447 lines
488 KiB
JavaScript
447 lines
488 KiB
JavaScript
function $y(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 f of d.addedNodes)f.tagName==="LINK"&&f.rel==="modulepreload"&&i(f)}).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 Gm(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}var _c={exports:{}},Ca={},Pc={exports:{}},De={};/**
|
||
* @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 Oh;function By(){if(Oh)return De;Oh=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"),f=Symbol.for("react.context"),m=Symbol.for("react.forward_ref"),p=Symbol.for("react.suspense"),g=Symbol.for("react.memo"),v=Symbol.for("react.lazy"),w=Symbol.iterator;function _(L){return L===null||typeof L!="object"?null:(L=w&&L[w]||L["@@iterator"],typeof L=="function"?L:null)}var E={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},k=Object.assign,S={};function N(L,H,ue){this.props=L,this.context=H,this.refs=S,this.updater=ue||E}N.prototype.isReactComponent={},N.prototype.setState=function(L,H){if(typeof L!="object"&&typeof L!="function"&&L!=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,L,H,"setState")},N.prototype.forceUpdate=function(L){this.updater.enqueueForceUpdate(this,L,"forceUpdate")};function y(){}y.prototype=N.prototype;function C(L,H,ue){this.props=L,this.context=H,this.refs=S,this.updater=ue||E}var j=C.prototype=new y;j.constructor=C,k(j,N.prototype),j.isPureReactComponent=!0;var A=Array.isArray,z=Object.prototype.hasOwnProperty,K={current:null},W={key:!0,ref:!0,__self:!0,__source:!0};function V(L,H,ue){var re,je={},Ne=null,ee=null;if(H!=null)for(re in H.ref!==void 0&&(ee=H.ref),H.key!==void 0&&(Ne=""+H.key),H)z.call(H,re)&&!W.hasOwnProperty(re)&&(je[re]=H[re]);var de=arguments.length-2;if(de===1)je.children=ue;else if(1<de){for(var Ee=Array(de),Se=0;Se<de;Se++)Ee[Se]=arguments[Se+2];je.children=Ee}if(L&&L.defaultProps)for(re in de=L.defaultProps,de)je[re]===void 0&&(je[re]=de[re]);return{$$typeof:r,type:L,key:Ne,ref:ee,props:je,_owner:K.current}}function le(L,H){return{$$typeof:r,type:L.type,key:H,ref:L.ref,props:L.props,_owner:L._owner}}function me(L){return typeof L=="object"&&L!==null&&L.$$typeof===r}function oe(L){var H={"=":"=0",":":"=2"};return"$"+L.replace(/[=:]/g,function(ue){return H[ue]})}var fe=/\/+/g;function T(L,H){return typeof L=="object"&&L!==null&&L.key!=null?oe(""+L.key):H.toString(36)}function se(L,H,ue,re,je){var Ne=typeof L;(Ne==="undefined"||Ne==="boolean")&&(L=null);var ee=!1;if(L===null)ee=!0;else switch(Ne){case"string":case"number":ee=!0;break;case"object":switch(L.$$typeof){case r:case a:ee=!0}}if(ee)return ee=L,je=je(ee),L=re===""?"."+T(ee,0):re,A(je)?(ue="",L!=null&&(ue=L.replace(fe,"$&/")+"/"),se(je,H,ue,"",function(Se){return Se})):je!=null&&(me(je)&&(je=le(je,ue+(!je.key||ee&&ee.key===je.key?"":(""+je.key).replace(fe,"$&/")+"/")+L)),H.push(je)),1;if(ee=0,re=re===""?".":re+":",A(L))for(var de=0;de<L.length;de++){Ne=L[de];var Ee=re+T(Ne,de);ee+=se(Ne,H,ue,Ee,je)}else if(Ee=_(L),typeof Ee=="function")for(L=Ee.call(L),de=0;!(Ne=L.next()).done;)Ne=Ne.value,Ee=re+T(Ne,de++),ee+=se(Ne,H,ue,Ee,je);else if(Ne==="object")throw H=String(L),Error("Objects are not valid as a React child (found: "+(H==="[object Object]"?"object with keys {"+Object.keys(L).join(", ")+"}":H)+"). If you meant to render a collection of children, use an array instead.");return ee}function G(L,H,ue){if(L==null)return L;var re=[],je=0;return se(L,re,"","",function(Ne){return H.call(ue,Ne,je++)}),re}function Q(L){if(L._status===-1){var H=L._result;H=H(),H.then(function(ue){(L._status===0||L._status===-1)&&(L._status=1,L._result=ue)},function(ue){(L._status===0||L._status===-1)&&(L._status=2,L._result=ue)}),L._status===-1&&(L._status=0,L._result=H)}if(L._status===1)return L._result.default;throw L._result}var O={current:null},R={transition:null},Y={ReactCurrentDispatcher:O,ReactCurrentBatchConfig:R,ReactCurrentOwner:K};function X(){throw Error("act(...) is not supported in production builds of React.")}return De.Children={map:G,forEach:function(L,H,ue){G(L,function(){H.apply(this,arguments)},ue)},count:function(L){var H=0;return G(L,function(){H++}),H},toArray:function(L){return G(L,function(H){return H})||[]},only:function(L){if(!me(L))throw Error("React.Children.only expected to receive a single React element child.");return L}},De.Component=N,De.Fragment=l,De.Profiler=c,De.PureComponent=C,De.StrictMode=i,De.Suspense=p,De.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Y,De.act=X,De.cloneElement=function(L,H,ue){if(L==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+L+".");var re=k({},L.props),je=L.key,Ne=L.ref,ee=L._owner;if(H!=null){if(H.ref!==void 0&&(Ne=H.ref,ee=K.current),H.key!==void 0&&(je=""+H.key),L.type&&L.type.defaultProps)var de=L.type.defaultProps;for(Ee in H)z.call(H,Ee)&&!W.hasOwnProperty(Ee)&&(re[Ee]=H[Ee]===void 0&&de!==void 0?de[Ee]:H[Ee])}var Ee=arguments.length-2;if(Ee===1)re.children=ue;else if(1<Ee){de=Array(Ee);for(var Se=0;Se<Ee;Se++)de[Se]=arguments[Se+2];re.children=de}return{$$typeof:r,type:L.type,key:je,ref:Ne,props:re,_owner:ee}},De.createContext=function(L){return L={$$typeof:f,_currentValue:L,_currentValue2:L,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},L.Provider={$$typeof:d,_context:L},L.Consumer=L},De.createElement=V,De.createFactory=function(L){var H=V.bind(null,L);return H.type=L,H},De.createRef=function(){return{current:null}},De.forwardRef=function(L){return{$$typeof:m,render:L}},De.isValidElement=me,De.lazy=function(L){return{$$typeof:v,_payload:{_status:-1,_result:L},_init:Q}},De.memo=function(L,H){return{$$typeof:g,type:L,compare:H===void 0?null:H}},De.startTransition=function(L){var H=R.transition;R.transition={};try{L()}finally{R.transition=H}},De.unstable_act=X,De.useCallback=function(L,H){return O.current.useCallback(L,H)},De.useContext=function(L){return O.current.useContext(L)},De.useDebugValue=function(){},De.useDeferredValue=function(L){return O.current.useDeferredValue(L)},De.useEffect=function(L,H){return O.current.useEffect(L,H)},De.useId=function(){return O.current.useId()},De.useImperativeHandle=function(L,H,ue){return O.current.useImperativeHandle(L,H,ue)},De.useInsertionEffect=function(L,H){return O.current.useInsertionEffect(L,H)},De.useLayoutEffect=function(L,H){return O.current.useLayoutEffect(L,H)},De.useMemo=function(L,H){return O.current.useMemo(L,H)},De.useReducer=function(L,H,ue){return O.current.useReducer(L,H,ue)},De.useRef=function(L){return O.current.useRef(L)},De.useState=function(L){return O.current.useState(L)},De.useSyncExternalStore=function(L,H,ue){return O.current.useSyncExternalStore(L,H,ue)},De.useTransition=function(){return O.current.useTransition()},De.version="18.3.1",De}var Fh;function wu(){return Fh||(Fh=1,Pc.exports=By()),Pc.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 zh;function Uy(){if(zh)return Ca;zh=1;var r=wu(),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 f(m,p,g){var v,w={},_=null,E=null;g!==void 0&&(_=""+g),p.key!==void 0&&(_=""+p.key),p.ref!==void 0&&(E=p.ref);for(v in p)i.call(p,v)&&!d.hasOwnProperty(v)&&(w[v]=p[v]);if(m&&m.defaultProps)for(v in p=m.defaultProps,p)w[v]===void 0&&(w[v]=p[v]);return{$$typeof:a,type:m,key:_,ref:E,props:w,_owner:c.current}}return Ca.Fragment=l,Ca.jsx=f,Ca.jsxs=f,Ca}var $h;function Vy(){return $h||($h=1,_c.exports=Uy()),_c.exports}var n=Vy(),x=wu();const dr=Gm(x),vo=$y({__proto__:null,default:dr},[x]);var Wl={},Rc={exports:{}},Lt={},Tc={exports:{}},Ic={};/**
|
||
* @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 Bh;function Wy(){return Bh||(Bh=1,(function(r){function a(R,Y){var X=R.length;R.push(Y);e:for(;0<X;){var L=X-1>>>1,H=R[L];if(0<c(H,Y))R[L]=Y,R[X]=H,X=L;else break e}}function l(R){return R.length===0?null:R[0]}function i(R){if(R.length===0)return null;var Y=R[0],X=R.pop();if(X!==Y){R[0]=X;e:for(var L=0,H=R.length,ue=H>>>1;L<ue;){var re=2*(L+1)-1,je=R[re],Ne=re+1,ee=R[Ne];if(0>c(je,X))Ne<H&&0>c(ee,je)?(R[L]=ee,R[Ne]=X,L=Ne):(R[L]=je,R[re]=X,L=re);else if(Ne<H&&0>c(ee,X))R[L]=ee,R[Ne]=X,L=Ne;else break e}}return Y}function c(R,Y){var X=R.sortIndex-Y.sortIndex;return X!==0?X:R.id-Y.id}if(typeof performance=="object"&&typeof performance.now=="function"){var d=performance;r.unstable_now=function(){return d.now()}}else{var f=Date,m=f.now();r.unstable_now=function(){return f.now()-m}}var p=[],g=[],v=1,w=null,_=3,E=!1,k=!1,S=!1,N=typeof setTimeout=="function"?setTimeout:null,y=typeof clearTimeout=="function"?clearTimeout:null,C=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(R){for(var Y=l(g);Y!==null;){if(Y.callback===null)i(g);else if(Y.startTime<=R)i(g),Y.sortIndex=Y.expirationTime,a(p,Y);else break;Y=l(g)}}function A(R){if(S=!1,j(R),!k)if(l(p)!==null)k=!0,Q(z);else{var Y=l(g);Y!==null&&O(A,Y.startTime-R)}}function z(R,Y){k=!1,S&&(S=!1,y(V),V=-1),E=!0;var X=_;try{for(j(Y),w=l(p);w!==null&&(!(w.expirationTime>Y)||R&&!oe());){var L=w.callback;if(typeof L=="function"){w.callback=null,_=w.priorityLevel;var H=L(w.expirationTime<=Y);Y=r.unstable_now(),typeof H=="function"?w.callback=H:w===l(p)&&i(p),j(Y)}else i(p);w=l(p)}if(w!==null)var ue=!0;else{var re=l(g);re!==null&&O(A,re.startTime-Y),ue=!1}return ue}finally{w=null,_=X,E=!1}}var K=!1,W=null,V=-1,le=5,me=-1;function oe(){return!(r.unstable_now()-me<le)}function fe(){if(W!==null){var R=r.unstable_now();me=R;var Y=!0;try{Y=W(!0,R)}finally{Y?T():(K=!1,W=null)}}else K=!1}var T;if(typeof C=="function")T=function(){C(fe)};else if(typeof MessageChannel<"u"){var se=new MessageChannel,G=se.port2;se.port1.onmessage=fe,T=function(){G.postMessage(null)}}else T=function(){N(fe,0)};function Q(R){W=R,K||(K=!0,T())}function O(R,Y){V=N(function(){R(r.unstable_now())},Y)}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(R){R.callback=null},r.unstable_continueExecution=function(){k||E||(k=!0,Q(z))},r.unstable_forceFrameRate=function(R){0>R||125<R?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):le=0<R?Math.floor(1e3/R):5},r.unstable_getCurrentPriorityLevel=function(){return _},r.unstable_getFirstCallbackNode=function(){return l(p)},r.unstable_next=function(R){switch(_){case 1:case 2:case 3:var Y=3;break;default:Y=_}var X=_;_=Y;try{return R()}finally{_=X}},r.unstable_pauseExecution=function(){},r.unstable_requestPaint=function(){},r.unstable_runWithPriority=function(R,Y){switch(R){case 1:case 2:case 3:case 4:case 5:break;default:R=3}var X=_;_=R;try{return Y()}finally{_=X}},r.unstable_scheduleCallback=function(R,Y,X){var L=r.unstable_now();switch(typeof X=="object"&&X!==null?(X=X.delay,X=typeof X=="number"&&0<X?L+X:L):X=L,R){case 1:var H=-1;break;case 2:H=250;break;case 5:H=1073741823;break;case 4:H=1e4;break;default:H=5e3}return H=X+H,R={id:v++,callback:Y,priorityLevel:R,startTime:X,expirationTime:H,sortIndex:-1},X>L?(R.sortIndex=X,a(g,R),l(p)===null&&R===l(g)&&(S?(y(V),V=-1):S=!0,O(A,X-L))):(R.sortIndex=H,a(p,R),k||E||(k=!0,Q(z))),R},r.unstable_shouldYield=oe,r.unstable_wrapCallback=function(R){var Y=_;return function(){var X=_;_=Y;try{return R.apply(this,arguments)}finally{_=X}}}})(Ic)),Ic}var Uh;function Hy(){return Uh||(Uh=1,Tc.exports=Wy()),Tc.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 Vh;function Ky(){if(Vh)return Lt;Vh=1;var r=wu(),a=Hy();function l(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,s=1;s<arguments.length;s++)t+="&args[]="+encodeURIComponent(arguments[s]);return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var i=new Set,c={};function d(e,t){f(e,t),f(e+"Capture",t)}function f(e,t){for(c[e]=t,e=0;e<t.length;e++)i.add(t[e])}var m=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),p=Object.prototype.hasOwnProperty,g=/^[: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]*$/,v={},w={};function _(e){return p.call(w,e)?!0:p.call(v,e)?!1:g.test(e)?w[e]=!0:(v[e]=!0,!1)}function E(e,t,s,o){if(s!==null&&s.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return o?!1:s!==null?!s.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function k(e,t,s,o){if(t===null||typeof t>"u"||E(e,t,s,o))return!0;if(o)return!1;if(s!==null)switch(s.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function S(e,t,s,o,u,h,b){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=o,this.attributeNamespace=u,this.mustUseProperty=s,this.propertyName=e,this.type=t,this.sanitizeURL=h,this.removeEmptyString=b}var N={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){N[e]=new S(e,0,!1,e,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];N[t]=new S(t,1,!1,e[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(e){N[e]=new S(e,2,!1,e.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){N[e]=new S(e,2,!1,e,null,!1,!1)}),"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){N[e]=new S(e,3,!1,e.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(e){N[e]=new S(e,3,!0,e,null,!1,!1)}),["capture","download"].forEach(function(e){N[e]=new S(e,4,!1,e,null,!1,!1)}),["cols","rows","size","span"].forEach(function(e){N[e]=new S(e,6,!1,e,null,!1,!1)}),["rowSpan","start"].forEach(function(e){N[e]=new S(e,5,!1,e.toLowerCase(),null,!1,!1)});var y=/[\-:]([a-z])/g;function C(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(y,C);N[t]=new S(t,1,!1,e,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(y,C);N[t]=new S(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(y,C);N[t]=new S(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(e){N[e]=new S(e,1,!1,e.toLowerCase(),null,!1,!1)}),N.xlinkHref=new S("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(e){N[e]=new S(e,1,!1,e.toLowerCase(),null,!0,!0)});function j(e,t,s,o){var u=N.hasOwnProperty(t)?N[t]:null;(u!==null?u.type!==0:o||!(2<t.length)||t[0]!=="o"&&t[0]!=="O"||t[1]!=="n"&&t[1]!=="N")&&(k(t,s,u,o)&&(s=null),o||u===null?_(t)&&(s===null?e.removeAttribute(t):e.setAttribute(t,""+s)):u.mustUseProperty?e[u.propertyName]=s===null?u.type===3?!1:"":s:(t=u.attributeName,o=u.attributeNamespace,s===null?e.removeAttribute(t):(u=u.type,s=u===3||u===4&&s===!0?"":""+s,o?e.setAttributeNS(o,t,s):e.setAttribute(t,s))))}var A=r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,z=Symbol.for("react.element"),K=Symbol.for("react.portal"),W=Symbol.for("react.fragment"),V=Symbol.for("react.strict_mode"),le=Symbol.for("react.profiler"),me=Symbol.for("react.provider"),oe=Symbol.for("react.context"),fe=Symbol.for("react.forward_ref"),T=Symbol.for("react.suspense"),se=Symbol.for("react.suspense_list"),G=Symbol.for("react.memo"),Q=Symbol.for("react.lazy"),O=Symbol.for("react.offscreen"),R=Symbol.iterator;function Y(e){return e===null||typeof e!="object"?null:(e=R&&e[R]||e["@@iterator"],typeof e=="function"?e:null)}var X=Object.assign,L;function H(e){if(L===void 0)try{throw Error()}catch(s){var t=s.stack.trim().match(/\n( *(at )?)/);L=t&&t[1]||""}return`
|
||
`+L+e}var ue=!1;function re(e,t){if(!e||ue)return"";ue=!0;var s=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(t)if(t=function(){throw Error()},Object.defineProperty(t.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(t,[])}catch($){var o=$}Reflect.construct(e,[],t)}else{try{t.call()}catch($){o=$}e.call(t.prototype)}else{try{throw Error()}catch($){o=$}e()}}catch($){if($&&o&&typeof $.stack=="string"){for(var u=$.stack.split(`
|
||
`),h=o.stack.split(`
|
||
`),b=u.length-1,P=h.length-1;1<=b&&0<=P&&u[b]!==h[P];)P--;for(;1<=b&&0<=P;b--,P--)if(u[b]!==h[P]){if(b!==1||P!==1)do if(b--,P--,0>P||u[b]!==h[P]){var I=`
|
||
`+u[b].replace(" at new "," at ");return e.displayName&&I.includes("<anonymous>")&&(I=I.replace("<anonymous>",e.displayName)),I}while(1<=b&&0<=P);break}}}finally{ue=!1,Error.prepareStackTrace=s}return(e=e?e.displayName||e.name:"")?H(e):""}function je(e){switch(e.tag){case 5:return H(e.type);case 16:return H("Lazy");case 13:return H("Suspense");case 19:return H("SuspenseList");case 0:case 2:case 15:return e=re(e.type,!1),e;case 11:return e=re(e.type.render,!1),e;case 1:return e=re(e.type,!0),e;default:return""}}function Ne(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case W:return"Fragment";case K:return"Portal";case le:return"Profiler";case V:return"StrictMode";case T:return"Suspense";case se:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case oe:return(e.displayName||"Context")+".Consumer";case me:return(e._context.displayName||"Context")+".Provider";case fe:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case G:return t=e.displayName||null,t!==null?t:Ne(e.type)||"Memo";case Q:t=e._payload,e=e._init;try{return Ne(e(t))}catch{}}return null}function ee(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return Ne(t);case 8:return t===V?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function de(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Ee(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function Se(e){var t=Ee(e)?"checked":"value",s=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),o=""+e[t];if(!e.hasOwnProperty(t)&&typeof s<"u"&&typeof s.get=="function"&&typeof s.set=="function"){var u=s.get,h=s.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return u.call(this)},set:function(b){o=""+b,h.call(this,b)}}),Object.defineProperty(e,t,{enumerable:s.enumerable}),{getValue:function(){return o},setValue:function(b){o=""+b},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Te(e){e._valueTracker||(e._valueTracker=Se(e))}function B(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var s=t.getValue(),o="";return e&&(o=Ee(e)?e.checked?"true":"false":e.value),e=o,e!==s?(t.setValue(e),!0):!1}function Ie(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function $e(e,t){var s=t.checked;return X({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:s??e._wrapperState.initialChecked})}function Nt(e,t){var s=t.defaultValue==null?"":t.defaultValue,o=t.checked!=null?t.checked:t.defaultChecked;s=de(t.value!=null?t.value:s),e._wrapperState={initialChecked:o,initialValue:s,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function Vt(e,t){t=t.checked,t!=null&&j(e,"checked",t,!1)}function Jt(e,t){Vt(e,t);var s=de(t.value),o=t.type;if(s!=null)o==="number"?(s===0&&e.value===""||e.value!=s)&&(e.value=""+s):e.value!==""+s&&(e.value=""+s);else if(o==="submit"||o==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?fn(e,t.type,s):t.hasOwnProperty("defaultValue")&&fn(e,t.type,de(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function Qr(e,t,s){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var o=t.type;if(!(o!=="submit"&&o!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,s||t===e.value||(e.value=t),e.defaultValue=t}s=e.name,s!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,s!==""&&(e.name=s)}function fn(e,t,s){(t!=="number"||Ie(e.ownerDocument)!==e)&&(s==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+s&&(e.defaultValue=""+s))}var Cr=Array.isArray;function hn(e,t,s,o){if(e=e.options,t){t={};for(var u=0;u<s.length;u++)t["$"+s[u]]=!0;for(s=0;s<e.length;s++)u=t.hasOwnProperty("$"+e[s].value),e[s].selected!==u&&(e[s].selected=u),u&&o&&(e[s].defaultSelected=!0)}else{for(s=""+de(s),t=null,u=0;u<e.length;u++){if(e[u].value===s){e[u].selected=!0,o&&(e[u].defaultSelected=!0);return}t!==null||e[u].disabled||(t=e[u])}t!==null&&(t.selected=!0)}}function Yr(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(l(91));return X({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function U(e,t){var s=t.value;if(s==null){if(s=t.children,t=t.defaultValue,s!=null){if(t!=null)throw Error(l(92));if(Cr(s)){if(1<s.length)throw Error(l(93));s=s[0]}t=s}t==null&&(t=""),s=t}e._wrapperState={initialValue:de(s)}}function ce(e,t){var s=de(t.value),o=de(t.defaultValue);s!=null&&(s=""+s,s!==e.value&&(e.value=s),t.defaultValue==null&&e.defaultValue!==s&&(e.defaultValue=s)),o!=null&&(e.defaultValue=""+o)}function lt(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function Ve(e){switch(e){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function Dt(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?Ve(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var Cn,dt=(function(e){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(t,s,o,u){MSApp.execUnsafeLocalFunction(function(){return e(t,s,o,u)})}:e})(function(e,t){if(e.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in e)e.innerHTML=t;else{for(Cn=Cn||document.createElement("div"),Cn.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=Cn.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function mn(e,t){if(t){var s=e.firstChild;if(s&&s===e.lastChild&&s.nodeType===3){s.nodeValue=t;return}}e.textContent=t}var Us={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},Wg=["Webkit","ms","Moz","O"];Object.keys(Us).forEach(function(e){Wg.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Us[t]=Us[e]})});function qu(e,t,s){return t==null||typeof t=="boolean"||t===""?"":s||typeof t!="number"||t===0||Us.hasOwnProperty(e)&&Us[e]?(""+t).trim():t+"px"}function Ju(e,t){e=e.style;for(var s in t)if(t.hasOwnProperty(s)){var o=s.indexOf("--")===0,u=qu(s,t[s],o);s==="float"&&(s="cssFloat"),o?e.setProperty(s,u):e[s]=u}}var Hg=X({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 $o(e,t){if(t){if(Hg[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(l(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(l(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(l(61))}if(t.style!=null&&typeof t.style!="object")throw Error(l(62))}}function Bo(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var Uo=null;function Vo(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Wo=null,Xr=null,qr=null;function Zu(e){if(e=ua(e)){if(typeof Wo!="function")throw Error(l(280));var t=e.stateNode;t&&(t=al(t),Wo(e.stateNode,e.type,t))}}function ed(e){Xr?qr?qr.push(e):qr=[e]:Xr=e}function td(){if(Xr){var e=Xr,t=qr;if(qr=Xr=null,Zu(e),t)for(e=0;e<t.length;e++)Zu(t[e])}}function nd(e,t){return e(t)}function rd(){}var Ho=!1;function sd(e,t,s){if(Ho)return e(t,s);Ho=!0;try{return nd(e,t,s)}finally{Ho=!1,(Xr!==null||qr!==null)&&(rd(),td())}}function Vs(e,t){var s=e.stateNode;if(s===null)return null;var o=al(s);if(o===null)return null;s=o[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(o=!o.disabled)||(e=e.type,o=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!o;break e;default:e=!1}if(e)return null;if(s&&typeof s!="function")throw Error(l(231,t,typeof s));return s}var Ko=!1;if(m)try{var Ws={};Object.defineProperty(Ws,"passive",{get:function(){Ko=!0}}),window.addEventListener("test",Ws,Ws),window.removeEventListener("test",Ws,Ws)}catch{Ko=!1}function Kg(e,t,s,o,u,h,b,P,I){var $=Array.prototype.slice.call(arguments,3);try{t.apply(s,$)}catch(J){this.onError(J)}}var Hs=!1,Oa=null,Fa=!1,Go=null,Gg={onError:function(e){Hs=!0,Oa=e}};function Qg(e,t,s,o,u,h,b,P,I){Hs=!1,Oa=null,Kg.apply(Gg,arguments)}function Yg(e,t,s,o,u,h,b,P,I){if(Qg.apply(this,arguments),Hs){if(Hs){var $=Oa;Hs=!1,Oa=null}else throw Error(l(198));Fa||(Fa=!0,Go=$)}}function kr(e){var t=e,s=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,(t.flags&4098)!==0&&(s=t.return),e=t.return;while(e)}return t.tag===3?s:null}function ad(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function ld(e){if(kr(e)!==e)throw Error(l(188))}function Xg(e){var t=e.alternate;if(!t){if(t=kr(e),t===null)throw Error(l(188));return t!==e?null:e}for(var s=e,o=t;;){var u=s.return;if(u===null)break;var h=u.alternate;if(h===null){if(o=u.return,o!==null){s=o;continue}break}if(u.child===h.child){for(h=u.child;h;){if(h===s)return ld(u),e;if(h===o)return ld(u),t;h=h.sibling}throw Error(l(188))}if(s.return!==o.return)s=u,o=h;else{for(var b=!1,P=u.child;P;){if(P===s){b=!0,s=u,o=h;break}if(P===o){b=!0,o=u,s=h;break}P=P.sibling}if(!b){for(P=h.child;P;){if(P===s){b=!0,s=h,o=u;break}if(P===o){b=!0,o=h,s=u;break}P=P.sibling}if(!b)throw Error(l(189))}}if(s.alternate!==o)throw Error(l(190))}if(s.tag!==3)throw Error(l(188));return s.stateNode.current===s?e:t}function od(e){return e=Xg(e),e!==null?id(e):null}function id(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=id(e);if(t!==null)return t;e=e.sibling}return null}var cd=a.unstable_scheduleCallback,ud=a.unstable_cancelCallback,qg=a.unstable_shouldYield,Jg=a.unstable_requestPaint,ot=a.unstable_now,Zg=a.unstable_getCurrentPriorityLevel,Qo=a.unstable_ImmediatePriority,dd=a.unstable_UserBlockingPriority,za=a.unstable_NormalPriority,e0=a.unstable_LowPriority,fd=a.unstable_IdlePriority,$a=null,pn=null;function t0(e){if(pn&&typeof pn.onCommitFiberRoot=="function")try{pn.onCommitFiberRoot($a,e,void 0,(e.current.flags&128)===128)}catch{}}var Zt=Math.clz32?Math.clz32:s0,n0=Math.log,r0=Math.LN2;function s0(e){return e>>>=0,e===0?32:31-(n0(e)/r0|0)|0}var Ba=64,Ua=4194304;function Ks(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function Va(e,t){var s=e.pendingLanes;if(s===0)return 0;var o=0,u=e.suspendedLanes,h=e.pingedLanes,b=s&268435455;if(b!==0){var P=b&~u;P!==0?o=Ks(P):(h&=b,h!==0&&(o=Ks(h)))}else b=s&~u,b!==0?o=Ks(b):h!==0&&(o=Ks(h));if(o===0)return 0;if(t!==0&&t!==o&&(t&u)===0&&(u=o&-o,h=t&-t,u>=h||u===16&&(h&4194240)!==0))return t;if((o&4)!==0&&(o|=s&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=o;0<t;)s=31-Zt(t),u=1<<s,o|=e[s],t&=~u;return o}function a0(e,t){switch(e){case 1:case 2:case 4:return t+250;case 8:case 16:case 32:case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function l0(e,t){for(var s=e.suspendedLanes,o=e.pingedLanes,u=e.expirationTimes,h=e.pendingLanes;0<h;){var b=31-Zt(h),P=1<<b,I=u[b];I===-1?((P&s)===0||(P&o)!==0)&&(u[b]=a0(P,t)):I<=t&&(e.expiredLanes|=P),h&=~P}}function Yo(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function hd(){var e=Ba;return Ba<<=1,(Ba&4194240)===0&&(Ba=64),e}function Xo(e){for(var t=[],s=0;31>s;s++)t.push(e);return t}function Gs(e,t,s){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-Zt(t),e[t]=s}function o0(e,t){var s=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var o=e.eventTimes;for(e=e.expirationTimes;0<s;){var u=31-Zt(s),h=1<<u;t[u]=0,o[u]=-1,e[u]=-1,s&=~h}}function qo(e,t){var s=e.entangledLanes|=t;for(e=e.entanglements;s;){var o=31-Zt(s),u=1<<o;u&t|e[o]&t&&(e[o]|=t),s&=~u}}var Ke=0;function md(e){return e&=-e,1<e?4<e?(e&268435455)!==0?16:536870912:4:1}var pd,Jo,xd,gd,yd,Zo=!1,Wa=[],Hn=null,Kn=null,Gn=null,Qs=new Map,Ys=new Map,Qn=[],i0="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 vd(e,t){switch(e){case"focusin":case"focusout":Hn=null;break;case"dragenter":case"dragleave":Kn=null;break;case"mouseover":case"mouseout":Gn=null;break;case"pointerover":case"pointerout":Qs.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":Ys.delete(t.pointerId)}}function Xs(e,t,s,o,u,h){return e===null||e.nativeEvent!==h?(e={blockedOn:t,domEventName:s,eventSystemFlags:o,nativeEvent:h,targetContainers:[u]},t!==null&&(t=ua(t),t!==null&&Jo(t)),e):(e.eventSystemFlags|=o,t=e.targetContainers,u!==null&&t.indexOf(u)===-1&&t.push(u),e)}function c0(e,t,s,o,u){switch(t){case"focusin":return Hn=Xs(Hn,e,t,s,o,u),!0;case"dragenter":return Kn=Xs(Kn,e,t,s,o,u),!0;case"mouseover":return Gn=Xs(Gn,e,t,s,o,u),!0;case"pointerover":var h=u.pointerId;return Qs.set(h,Xs(Qs.get(h)||null,e,t,s,o,u)),!0;case"gotpointercapture":return h=u.pointerId,Ys.set(h,Xs(Ys.get(h)||null,e,t,s,o,u)),!0}return!1}function wd(e){var t=Er(e.target);if(t!==null){var s=kr(t);if(s!==null){if(t=s.tag,t===13){if(t=ad(s),t!==null){e.blockedOn=t,yd(e.priority,function(){xd(s)});return}}else if(t===3&&s.stateNode.current.memoizedState.isDehydrated){e.blockedOn=s.tag===3?s.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Ha(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var s=ti(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(s===null){s=e.nativeEvent;var o=new s.constructor(s.type,s);Uo=o,s.target.dispatchEvent(o),Uo=null}else return t=ua(s),t!==null&&Jo(t),e.blockedOn=s,!1;t.shift()}return!0}function bd(e,t,s){Ha(e)&&s.delete(t)}function u0(){Zo=!1,Hn!==null&&Ha(Hn)&&(Hn=null),Kn!==null&&Ha(Kn)&&(Kn=null),Gn!==null&&Ha(Gn)&&(Gn=null),Qs.forEach(bd),Ys.forEach(bd)}function qs(e,t){e.blockedOn===t&&(e.blockedOn=null,Zo||(Zo=!0,a.unstable_scheduleCallback(a.unstable_NormalPriority,u0)))}function Js(e){function t(u){return qs(u,e)}if(0<Wa.length){qs(Wa[0],e);for(var s=1;s<Wa.length;s++){var o=Wa[s];o.blockedOn===e&&(o.blockedOn=null)}}for(Hn!==null&&qs(Hn,e),Kn!==null&&qs(Kn,e),Gn!==null&&qs(Gn,e),Qs.forEach(t),Ys.forEach(t),s=0;s<Qn.length;s++)o=Qn[s],o.blockedOn===e&&(o.blockedOn=null);for(;0<Qn.length&&(s=Qn[0],s.blockedOn===null);)wd(s),s.blockedOn===null&&Qn.shift()}var Jr=A.ReactCurrentBatchConfig,Ka=!0;function d0(e,t,s,o){var u=Ke,h=Jr.transition;Jr.transition=null;try{Ke=1,ei(e,t,s,o)}finally{Ke=u,Jr.transition=h}}function f0(e,t,s,o){var u=Ke,h=Jr.transition;Jr.transition=null;try{Ke=4,ei(e,t,s,o)}finally{Ke=u,Jr.transition=h}}function ei(e,t,s,o){if(Ka){var u=ti(e,t,s,o);if(u===null)yi(e,t,o,Ga,s),vd(e,o);else if(c0(u,e,t,s,o))o.stopPropagation();else if(vd(e,o),t&4&&-1<i0.indexOf(e)){for(;u!==null;){var h=ua(u);if(h!==null&&pd(h),h=ti(e,t,s,o),h===null&&yi(e,t,o,Ga,s),h===u)break;u=h}u!==null&&o.stopPropagation()}else yi(e,t,o,null,s)}}var Ga=null;function ti(e,t,s,o){if(Ga=null,e=Vo(o),e=Er(e),e!==null)if(t=kr(e),t===null)e=null;else if(s=t.tag,s===13){if(e=ad(t),e!==null)return e;e=null}else if(s===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null);return Ga=e,null}function Nd(e){switch(e){case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 1;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(Zg()){case Qo:return 1;case dd:return 4;case za:case e0:return 16;case fd:return 536870912;default:return 16}default:return 16}}var Yn=null,ni=null,Qa=null;function jd(){if(Qa)return Qa;var e,t=ni,s=t.length,o,u="value"in Yn?Yn.value:Yn.textContent,h=u.length;for(e=0;e<s&&t[e]===u[e];e++);var b=s-e;for(o=1;o<=b&&t[s-o]===u[h-o];o++);return Qa=u.slice(e,1<o?1-o:void 0)}function Ya(e){var t=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function Xa(){return!0}function Sd(){return!1}function Ot(e){function t(s,o,u,h,b){this._reactName=s,this._targetInst=u,this.type=o,this.nativeEvent=h,this.target=b,this.currentTarget=null;for(var P in e)e.hasOwnProperty(P)&&(s=e[P],this[P]=s?s(h):h[P]);return this.isDefaultPrevented=(h.defaultPrevented!=null?h.defaultPrevented:h.returnValue===!1)?Xa:Sd,this.isPropagationStopped=Sd,this}return X(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var s=this.nativeEvent;s&&(s.preventDefault?s.preventDefault():typeof s.returnValue!="unknown"&&(s.returnValue=!1),this.isDefaultPrevented=Xa)},stopPropagation:function(){var s=this.nativeEvent;s&&(s.stopPropagation?s.stopPropagation():typeof s.cancelBubble!="unknown"&&(s.cancelBubble=!0),this.isPropagationStopped=Xa)},persist:function(){},isPersistent:Xa}),t}var Zr={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},ri=Ot(Zr),Zs=X({},Zr,{view:0,detail:0}),h0=Ot(Zs),si,ai,ea,qa=X({},Zs,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:oi,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==ea&&(ea&&e.type==="mousemove"?(si=e.screenX-ea.screenX,ai=e.screenY-ea.screenY):ai=si=0,ea=e),si)},movementY:function(e){return"movementY"in e?e.movementY:ai}}),Cd=Ot(qa),m0=X({},qa,{dataTransfer:0}),p0=Ot(m0),x0=X({},Zs,{relatedTarget:0}),li=Ot(x0),g0=X({},Zr,{animationName:0,elapsedTime:0,pseudoElement:0}),y0=Ot(g0),v0=X({},Zr,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),w0=Ot(v0),b0=X({},Zr,{data:0}),kd=Ot(b0),N0={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},j0={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"},S0={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function C0(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=S0[e])?!!t[e]:!1}function oi(){return C0}var k0=X({},Zs,{key:function(e){if(e.key){var t=N0[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Ya(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?j0[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:oi,charCode:function(e){return e.type==="keypress"?Ya(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Ya(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),E0=Ot(k0),_0=X({},qa,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Ed=Ot(_0),P0=X({},Zs,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:oi}),R0=Ot(P0),T0=X({},Zr,{propertyName:0,elapsedTime:0,pseudoElement:0}),I0=Ot(T0),A0=X({},qa,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0}),M0=Ot(A0),L0=[9,13,27,32],ii=m&&"CompositionEvent"in window,ta=null;m&&"documentMode"in document&&(ta=document.documentMode);var D0=m&&"TextEvent"in window&&!ta,_d=m&&(!ii||ta&&8<ta&&11>=ta),Pd=" ",Rd=!1;function Td(e,t){switch(e){case"keyup":return L0.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Id(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var es=!1;function O0(e,t){switch(e){case"compositionend":return Id(t);case"keypress":return t.which!==32?null:(Rd=!0,Pd);case"textInput":return e=t.data,e===Pd&&Rd?null:e;default:return null}}function F0(e,t){if(es)return e==="compositionend"||!ii&&Td(e,t)?(e=jd(),Qa=ni=Yn=null,es=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return _d&&t.locale!=="ko"?null:t.data;default:return null}}var z0={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 Ad(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!z0[e.type]:t==="textarea"}function Md(e,t,s,o){ed(o),t=nl(t,"onChange"),0<t.length&&(s=new ri("onChange","change",null,s,o),e.push({event:s,listeners:t}))}var na=null,ra=null;function $0(e){Jd(e,0)}function Ja(e){var t=as(e);if(B(t))return e}function B0(e,t){if(e==="change")return t}var Ld=!1;if(m){var ci;if(m){var ui="oninput"in document;if(!ui){var Dd=document.createElement("div");Dd.setAttribute("oninput","return;"),ui=typeof Dd.oninput=="function"}ci=ui}else ci=!1;Ld=ci&&(!document.documentMode||9<document.documentMode)}function Od(){na&&(na.detachEvent("onpropertychange",Fd),ra=na=null)}function Fd(e){if(e.propertyName==="value"&&Ja(ra)){var t=[];Md(t,ra,e,Vo(e)),sd($0,t)}}function U0(e,t,s){e==="focusin"?(Od(),na=t,ra=s,na.attachEvent("onpropertychange",Fd)):e==="focusout"&&Od()}function V0(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Ja(ra)}function W0(e,t){if(e==="click")return Ja(t)}function H0(e,t){if(e==="input"||e==="change")return Ja(t)}function K0(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var en=typeof Object.is=="function"?Object.is:K0;function sa(e,t){if(en(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var s=Object.keys(e),o=Object.keys(t);if(s.length!==o.length)return!1;for(o=0;o<s.length;o++){var u=s[o];if(!p.call(t,u)||!en(e[u],t[u]))return!1}return!0}function zd(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function $d(e,t){var s=zd(e);e=0;for(var o;s;){if(s.nodeType===3){if(o=e+s.textContent.length,e<=t&&o>=t)return{node:s,offset:t-e};e=o}e:{for(;s;){if(s.nextSibling){s=s.nextSibling;break e}s=s.parentNode}s=void 0}s=zd(s)}}function Bd(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Bd(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Ud(){for(var e=window,t=Ie();t instanceof e.HTMLIFrameElement;){try{var s=typeof t.contentWindow.location.href=="string"}catch{s=!1}if(s)e=t.contentWindow;else break;t=Ie(e.document)}return t}function di(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}function G0(e){var t=Ud(),s=e.focusedElem,o=e.selectionRange;if(t!==s&&s&&s.ownerDocument&&Bd(s.ownerDocument.documentElement,s)){if(o!==null&&di(s)){if(t=o.start,e=o.end,e===void 0&&(e=t),"selectionStart"in s)s.selectionStart=t,s.selectionEnd=Math.min(e,s.value.length);else if(e=(t=s.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var u=s.textContent.length,h=Math.min(o.start,u);o=o.end===void 0?h:Math.min(o.end,u),!e.extend&&h>o&&(u=o,o=h,h=u),u=$d(s,h);var b=$d(s,o);u&&b&&(e.rangeCount!==1||e.anchorNode!==u.node||e.anchorOffset!==u.offset||e.focusNode!==b.node||e.focusOffset!==b.offset)&&(t=t.createRange(),t.setStart(u.node,u.offset),e.removeAllRanges(),h>o?(e.addRange(t),e.extend(b.node,b.offset)):(t.setEnd(b.node,b.offset),e.addRange(t)))}}for(t=[],e=s;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof s.focus=="function"&&s.focus(),s=0;s<t.length;s++)e=t[s],e.element.scrollLeft=e.left,e.element.scrollTop=e.top}}var Q0=m&&"documentMode"in document&&11>=document.documentMode,ts=null,fi=null,aa=null,hi=!1;function Vd(e,t,s){var o=s.window===s?s.document:s.nodeType===9?s:s.ownerDocument;hi||ts==null||ts!==Ie(o)||(o=ts,"selectionStart"in o&&di(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}),aa&&sa(aa,o)||(aa=o,o=nl(fi,"onSelect"),0<o.length&&(t=new ri("onSelect","select",null,t,s),e.push({event:t,listeners:o}),t.target=ts)))}function Za(e,t){var s={};return s[e.toLowerCase()]=t.toLowerCase(),s["Webkit"+e]="webkit"+t,s["Moz"+e]="moz"+t,s}var ns={animationend:Za("Animation","AnimationEnd"),animationiteration:Za("Animation","AnimationIteration"),animationstart:Za("Animation","AnimationStart"),transitionend:Za("Transition","TransitionEnd")},mi={},Wd={};m&&(Wd=document.createElement("div").style,"AnimationEvent"in window||(delete ns.animationend.animation,delete ns.animationiteration.animation,delete ns.animationstart.animation),"TransitionEvent"in window||delete ns.transitionend.transition);function el(e){if(mi[e])return mi[e];if(!ns[e])return e;var t=ns[e],s;for(s in t)if(t.hasOwnProperty(s)&&s in Wd)return mi[e]=t[s];return e}var Hd=el("animationend"),Kd=el("animationiteration"),Gd=el("animationstart"),Qd=el("transitionend"),Yd=new Map,Xd="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 Xn(e,t){Yd.set(e,t),d(t,[e])}for(var pi=0;pi<Xd.length;pi++){var xi=Xd[pi],Y0=xi.toLowerCase(),X0=xi[0].toUpperCase()+xi.slice(1);Xn(Y0,"on"+X0)}Xn(Hd,"onAnimationEnd"),Xn(Kd,"onAnimationIteration"),Xn(Gd,"onAnimationStart"),Xn("dblclick","onDoubleClick"),Xn("focusin","onFocus"),Xn("focusout","onBlur"),Xn(Qd,"onTransitionEnd"),f("onMouseEnter",["mouseout","mouseover"]),f("onMouseLeave",["mouseout","mouseover"]),f("onPointerEnter",["pointerout","pointerover"]),f("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 la="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(" "),q0=new Set("cancel close invalid load scroll toggle".split(" ").concat(la));function qd(e,t,s){var o=e.type||"unknown-event";e.currentTarget=s,Yg(o,t,void 0,e),e.currentTarget=null}function Jd(e,t){t=(t&4)!==0;for(var s=0;s<e.length;s++){var o=e[s],u=o.event;o=o.listeners;e:{var h=void 0;if(t)for(var b=o.length-1;0<=b;b--){var P=o[b],I=P.instance,$=P.currentTarget;if(P=P.listener,I!==h&&u.isPropagationStopped())break e;qd(u,P,$),h=I}else for(b=0;b<o.length;b++){if(P=o[b],I=P.instance,$=P.currentTarget,P=P.listener,I!==h&&u.isPropagationStopped())break e;qd(u,P,$),h=I}}}if(Fa)throw e=Go,Fa=!1,Go=null,e}function Xe(e,t){var s=t[Si];s===void 0&&(s=t[Si]=new Set);var o=e+"__bubble";s.has(o)||(Zd(t,e,2,!1),s.add(o))}function gi(e,t,s){var o=0;t&&(o|=4),Zd(s,e,o,t)}var tl="_reactListening"+Math.random().toString(36).slice(2);function oa(e){if(!e[tl]){e[tl]=!0,i.forEach(function(s){s!=="selectionchange"&&(q0.has(s)||gi(s,!1,e),gi(s,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[tl]||(t[tl]=!0,gi("selectionchange",!1,t))}}function Zd(e,t,s,o){switch(Nd(t)){case 1:var u=d0;break;case 4:u=f0;break;default:u=ei}s=u.bind(null,t,s,e),u=void 0,!Ko||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(u=!0),o?u!==void 0?e.addEventListener(t,s,{capture:!0,passive:u}):e.addEventListener(t,s,!0):u!==void 0?e.addEventListener(t,s,{passive:u}):e.addEventListener(t,s,!1)}function yi(e,t,s,o,u){var h=o;if((t&1)===0&&(t&2)===0&&o!==null)e:for(;;){if(o===null)return;var b=o.tag;if(b===3||b===4){var P=o.stateNode.containerInfo;if(P===u||P.nodeType===8&&P.parentNode===u)break;if(b===4)for(b=o.return;b!==null;){var I=b.tag;if((I===3||I===4)&&(I=b.stateNode.containerInfo,I===u||I.nodeType===8&&I.parentNode===u))return;b=b.return}for(;P!==null;){if(b=Er(P),b===null)return;if(I=b.tag,I===5||I===6){o=h=b;continue e}P=P.parentNode}}o=o.return}sd(function(){var $=h,J=Vo(s),Z=[];e:{var q=Yd.get(e);if(q!==void 0){var ie=ri,pe=e;switch(e){case"keypress":if(Ya(s)===0)break e;case"keydown":case"keyup":ie=E0;break;case"focusin":pe="focus",ie=li;break;case"focusout":pe="blur",ie=li;break;case"beforeblur":case"afterblur":ie=li;break;case"click":if(s.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":ie=Cd;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":ie=p0;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":ie=R0;break;case Hd:case Kd:case Gd:ie=y0;break;case Qd:ie=I0;break;case"scroll":ie=h0;break;case"wheel":ie=M0;break;case"copy":case"cut":case"paste":ie=w0;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":ie=Ed}var ve=(t&4)!==0,it=!ve&&e==="scroll",D=ve?q!==null?q+"Capture":null:q;ve=[];for(var M=$,F;M!==null;){F=M;var ne=F.stateNode;if(F.tag===5&&ne!==null&&(F=ne,D!==null&&(ne=Vs(M,D),ne!=null&&ve.push(ia(M,ne,F)))),it)break;M=M.return}0<ve.length&&(q=new ie(q,pe,null,s,J),Z.push({event:q,listeners:ve}))}}if((t&7)===0){e:{if(q=e==="mouseover"||e==="pointerover",ie=e==="mouseout"||e==="pointerout",q&&s!==Uo&&(pe=s.relatedTarget||s.fromElement)&&(Er(pe)||pe[kn]))break e;if((ie||q)&&(q=J.window===J?J:(q=J.ownerDocument)?q.defaultView||q.parentWindow:window,ie?(pe=s.relatedTarget||s.toElement,ie=$,pe=pe?Er(pe):null,pe!==null&&(it=kr(pe),pe!==it||pe.tag!==5&&pe.tag!==6)&&(pe=null)):(ie=null,pe=$),ie!==pe)){if(ve=Cd,ne="onMouseLeave",D="onMouseEnter",M="mouse",(e==="pointerout"||e==="pointerover")&&(ve=Ed,ne="onPointerLeave",D="onPointerEnter",M="pointer"),it=ie==null?q:as(ie),F=pe==null?q:as(pe),q=new ve(ne,M+"leave",ie,s,J),q.target=it,q.relatedTarget=F,ne=null,Er(J)===$&&(ve=new ve(D,M+"enter",pe,s,J),ve.target=F,ve.relatedTarget=it,ne=ve),it=ne,ie&&pe)t:{for(ve=ie,D=pe,M=0,F=ve;F;F=rs(F))M++;for(F=0,ne=D;ne;ne=rs(ne))F++;for(;0<M-F;)ve=rs(ve),M--;for(;0<F-M;)D=rs(D),F--;for(;M--;){if(ve===D||D!==null&&ve===D.alternate)break t;ve=rs(ve),D=rs(D)}ve=null}else ve=null;ie!==null&&ef(Z,q,ie,ve,!1),pe!==null&&it!==null&&ef(Z,it,pe,ve,!0)}}e:{if(q=$?as($):window,ie=q.nodeName&&q.nodeName.toLowerCase(),ie==="select"||ie==="input"&&q.type==="file")var we=B0;else if(Ad(q))if(Ld)we=H0;else{we=V0;var Ce=U0}else(ie=q.nodeName)&&ie.toLowerCase()==="input"&&(q.type==="checkbox"||q.type==="radio")&&(we=W0);if(we&&(we=we(e,$))){Md(Z,we,s,J);break e}Ce&&Ce(e,q,$),e==="focusout"&&(Ce=q._wrapperState)&&Ce.controlled&&q.type==="number"&&fn(q,"number",q.value)}switch(Ce=$?as($):window,e){case"focusin":(Ad(Ce)||Ce.contentEditable==="true")&&(ts=Ce,fi=$,aa=null);break;case"focusout":aa=fi=ts=null;break;case"mousedown":hi=!0;break;case"contextmenu":case"mouseup":case"dragend":hi=!1,Vd(Z,s,J);break;case"selectionchange":if(Q0)break;case"keydown":case"keyup":Vd(Z,s,J)}var ke;if(ii)e:{switch(e){case"compositionstart":var Re="onCompositionStart";break e;case"compositionend":Re="onCompositionEnd";break e;case"compositionupdate":Re="onCompositionUpdate";break e}Re=void 0}else es?Td(e,s)&&(Re="onCompositionEnd"):e==="keydown"&&s.keyCode===229&&(Re="onCompositionStart");Re&&(_d&&s.locale!=="ko"&&(es||Re!=="onCompositionStart"?Re==="onCompositionEnd"&&es&&(ke=jd()):(Yn=J,ni="value"in Yn?Yn.value:Yn.textContent,es=!0)),Ce=nl($,Re),0<Ce.length&&(Re=new kd(Re,e,null,s,J),Z.push({event:Re,listeners:Ce}),ke?Re.data=ke:(ke=Id(s),ke!==null&&(Re.data=ke)))),(ke=D0?O0(e,s):F0(e,s))&&($=nl($,"onBeforeInput"),0<$.length&&(J=new kd("onBeforeInput","beforeinput",null,s,J),Z.push({event:J,listeners:$}),J.data=ke))}Jd(Z,t)})}function ia(e,t,s){return{instance:e,listener:t,currentTarget:s}}function nl(e,t){for(var s=t+"Capture",o=[];e!==null;){var u=e,h=u.stateNode;u.tag===5&&h!==null&&(u=h,h=Vs(e,s),h!=null&&o.unshift(ia(e,h,u)),h=Vs(e,t),h!=null&&o.push(ia(e,h,u))),e=e.return}return o}function rs(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function ef(e,t,s,o,u){for(var h=t._reactName,b=[];s!==null&&s!==o;){var P=s,I=P.alternate,$=P.stateNode;if(I!==null&&I===o)break;P.tag===5&&$!==null&&(P=$,u?(I=Vs(s,h),I!=null&&b.unshift(ia(s,I,P))):u||(I=Vs(s,h),I!=null&&b.push(ia(s,I,P)))),s=s.return}b.length!==0&&e.push({event:t,listeners:b})}var J0=/\r\n?/g,Z0=/\u0000|\uFFFD/g;function tf(e){return(typeof e=="string"?e:""+e).replace(J0,`
|
||
`).replace(Z0,"")}function rl(e,t,s){if(t=tf(t),tf(e)!==t&&s)throw Error(l(425))}function sl(){}var vi=null,wi=null;function bi(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var Ni=typeof setTimeout=="function"?setTimeout:void 0,ey=typeof clearTimeout=="function"?clearTimeout:void 0,nf=typeof Promise=="function"?Promise:void 0,ty=typeof queueMicrotask=="function"?queueMicrotask:typeof nf<"u"?function(e){return nf.resolve(null).then(e).catch(ny)}:Ni;function ny(e){setTimeout(function(){throw e})}function ji(e,t){var s=t,o=0;do{var u=s.nextSibling;if(e.removeChild(s),u&&u.nodeType===8)if(s=u.data,s==="/$"){if(o===0){e.removeChild(u),Js(t);return}o--}else s!=="$"&&s!=="$?"&&s!=="$!"||o++;s=u}while(s);Js(t)}function qn(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t==="$"||t==="$!"||t==="$?")break;if(t==="/$")return null}}return e}function rf(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var s=e.data;if(s==="$"||s==="$!"||s==="$?"){if(t===0)return e;t--}else s==="/$"&&t++}e=e.previousSibling}return null}var ss=Math.random().toString(36).slice(2),xn="__reactFiber$"+ss,ca="__reactProps$"+ss,kn="__reactContainer$"+ss,Si="__reactEvents$"+ss,ry="__reactListeners$"+ss,sy="__reactHandles$"+ss;function Er(e){var t=e[xn];if(t)return t;for(var s=e.parentNode;s;){if(t=s[kn]||s[xn]){if(s=t.alternate,t.child!==null||s!==null&&s.child!==null)for(e=rf(e);e!==null;){if(s=e[xn])return s;e=rf(e)}return t}e=s,s=e.parentNode}return null}function ua(e){return e=e[xn]||e[kn],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function as(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(l(33))}function al(e){return e[ca]||null}var Ci=[],ls=-1;function Jn(e){return{current:e}}function qe(e){0>ls||(e.current=Ci[ls],Ci[ls]=null,ls--)}function Qe(e,t){ls++,Ci[ls]=e.current,e.current=t}var Zn={},jt=Jn(Zn),Rt=Jn(!1),_r=Zn;function os(e,t){var s=e.type.contextTypes;if(!s)return Zn;var o=e.stateNode;if(o&&o.__reactInternalMemoizedUnmaskedChildContext===t)return o.__reactInternalMemoizedMaskedChildContext;var u={},h;for(h in s)u[h]=t[h];return o&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=u),u}function Tt(e){return e=e.childContextTypes,e!=null}function ll(){qe(Rt),qe(jt)}function sf(e,t,s){if(jt.current!==Zn)throw Error(l(168));Qe(jt,t),Qe(Rt,s)}function af(e,t,s){var o=e.stateNode;if(t=t.childContextTypes,typeof o.getChildContext!="function")return s;o=o.getChildContext();for(var u in o)if(!(u in t))throw Error(l(108,ee(e)||"Unknown",u));return X({},s,o)}function ol(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Zn,_r=jt.current,Qe(jt,e),Qe(Rt,Rt.current),!0}function lf(e,t,s){var o=e.stateNode;if(!o)throw Error(l(169));s?(e=af(e,t,_r),o.__reactInternalMemoizedMergedChildContext=e,qe(Rt),qe(jt),Qe(jt,e)):qe(Rt),Qe(Rt,s)}var En=null,il=!1,ki=!1;function of(e){En===null?En=[e]:En.push(e)}function ay(e){il=!0,of(e)}function er(){if(!ki&&En!==null){ki=!0;var e=0,t=Ke;try{var s=En;for(Ke=1;e<s.length;e++){var o=s[e];do o=o(!0);while(o!==null)}En=null,il=!1}catch(u){throw En!==null&&(En=En.slice(e+1)),cd(Qo,er),u}finally{Ke=t,ki=!1}}return null}var is=[],cs=0,cl=null,ul=0,Wt=[],Ht=0,Pr=null,_n=1,Pn="";function Rr(e,t){is[cs++]=ul,is[cs++]=cl,cl=e,ul=t}function cf(e,t,s){Wt[Ht++]=_n,Wt[Ht++]=Pn,Wt[Ht++]=Pr,Pr=e;var o=_n;e=Pn;var u=32-Zt(o)-1;o&=~(1<<u),s+=1;var h=32-Zt(t)+u;if(30<h){var b=u-u%5;h=(o&(1<<b)-1).toString(32),o>>=b,u-=b,_n=1<<32-Zt(t)+u|s<<u|o,Pn=h+e}else _n=1<<h|s<<u|o,Pn=e}function Ei(e){e.return!==null&&(Rr(e,1),cf(e,1,0))}function _i(e){for(;e===cl;)cl=is[--cs],is[cs]=null,ul=is[--cs],is[cs]=null;for(;e===Pr;)Pr=Wt[--Ht],Wt[Ht]=null,Pn=Wt[--Ht],Wt[Ht]=null,_n=Wt[--Ht],Wt[Ht]=null}var Ft=null,zt=null,Je=!1,tn=null;function uf(e,t){var s=Yt(5,null,null,0);s.elementType="DELETED",s.stateNode=t,s.return=e,t=e.deletions,t===null?(e.deletions=[s],e.flags|=16):t.push(s)}function df(e,t){switch(e.tag){case 5:var s=e.type;return t=t.nodeType!==1||s.toLowerCase()!==t.nodeName.toLowerCase()?null:t,t!==null?(e.stateNode=t,Ft=e,zt=qn(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,Ft=e,zt=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(s=Pr!==null?{id:_n,overflow:Pn}:null,e.memoizedState={dehydrated:t,treeContext:s,retryLane:1073741824},s=Yt(18,null,null,0),s.stateNode=t,s.return=e,e.child=s,Ft=e,zt=null,!0):!1;default:return!1}}function Pi(e){return(e.mode&1)!==0&&(e.flags&128)===0}function Ri(e){if(Je){var t=zt;if(t){var s=t;if(!df(e,t)){if(Pi(e))throw Error(l(418));t=qn(s.nextSibling);var o=Ft;t&&df(e,t)?uf(o,s):(e.flags=e.flags&-4097|2,Je=!1,Ft=e)}}else{if(Pi(e))throw Error(l(418));e.flags=e.flags&-4097|2,Je=!1,Ft=e}}}function ff(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;Ft=e}function dl(e){if(e!==Ft)return!1;if(!Je)return ff(e),Je=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!bi(e.type,e.memoizedProps)),t&&(t=zt)){if(Pi(e))throw hf(),Error(l(418));for(;t;)uf(e,t),t=qn(t.nextSibling)}if(ff(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(l(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8){var s=e.data;if(s==="/$"){if(t===0){zt=qn(e.nextSibling);break e}t--}else s!=="$"&&s!=="$!"&&s!=="$?"||t++}e=e.nextSibling}zt=null}}else zt=Ft?qn(e.stateNode.nextSibling):null;return!0}function hf(){for(var e=zt;e;)e=qn(e.nextSibling)}function us(){zt=Ft=null,Je=!1}function Ti(e){tn===null?tn=[e]:tn.push(e)}var ly=A.ReactCurrentBatchConfig;function da(e,t,s){if(e=s.ref,e!==null&&typeof e!="function"&&typeof e!="object"){if(s._owner){if(s=s._owner,s){if(s.tag!==1)throw Error(l(309));var o=s.stateNode}if(!o)throw Error(l(147,e));var u=o,h=""+e;return t!==null&&t.ref!==null&&typeof t.ref=="function"&&t.ref._stringRef===h?t.ref:(t=function(b){var P=u.refs;b===null?delete P[h]:P[h]=b},t._stringRef=h,t)}if(typeof e!="string")throw Error(l(284));if(!s._owner)throw Error(l(290,e))}return e}function fl(e,t){throw e=Object.prototype.toString.call(t),Error(l(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function mf(e){var t=e._init;return t(e._payload)}function pf(e){function t(D,M){if(e){var F=D.deletions;F===null?(D.deletions=[M],D.flags|=16):F.push(M)}}function s(D,M){if(!e)return null;for(;M!==null;)t(D,M),M=M.sibling;return null}function o(D,M){for(D=new Map;M!==null;)M.key!==null?D.set(M.key,M):D.set(M.index,M),M=M.sibling;return D}function u(D,M){return D=ir(D,M),D.index=0,D.sibling=null,D}function h(D,M,F){return D.index=F,e?(F=D.alternate,F!==null?(F=F.index,F<M?(D.flags|=2,M):F):(D.flags|=2,M)):(D.flags|=1048576,M)}function b(D){return e&&D.alternate===null&&(D.flags|=2),D}function P(D,M,F,ne){return M===null||M.tag!==6?(M=Nc(F,D.mode,ne),M.return=D,M):(M=u(M,F),M.return=D,M)}function I(D,M,F,ne){var we=F.type;return we===W?J(D,M,F.props.children,ne,F.key):M!==null&&(M.elementType===we||typeof we=="object"&&we!==null&&we.$$typeof===Q&&mf(we)===M.type)?(ne=u(M,F.props),ne.ref=da(D,M,F),ne.return=D,ne):(ne=Dl(F.type,F.key,F.props,null,D.mode,ne),ne.ref=da(D,M,F),ne.return=D,ne)}function $(D,M,F,ne){return M===null||M.tag!==4||M.stateNode.containerInfo!==F.containerInfo||M.stateNode.implementation!==F.implementation?(M=jc(F,D.mode,ne),M.return=D,M):(M=u(M,F.children||[]),M.return=D,M)}function J(D,M,F,ne,we){return M===null||M.tag!==7?(M=Fr(F,D.mode,ne,we),M.return=D,M):(M=u(M,F),M.return=D,M)}function Z(D,M,F){if(typeof M=="string"&&M!==""||typeof M=="number")return M=Nc(""+M,D.mode,F),M.return=D,M;if(typeof M=="object"&&M!==null){switch(M.$$typeof){case z:return F=Dl(M.type,M.key,M.props,null,D.mode,F),F.ref=da(D,null,M),F.return=D,F;case K:return M=jc(M,D.mode,F),M.return=D,M;case Q:var ne=M._init;return Z(D,ne(M._payload),F)}if(Cr(M)||Y(M))return M=Fr(M,D.mode,F,null),M.return=D,M;fl(D,M)}return null}function q(D,M,F,ne){var we=M!==null?M.key:null;if(typeof F=="string"&&F!==""||typeof F=="number")return we!==null?null:P(D,M,""+F,ne);if(typeof F=="object"&&F!==null){switch(F.$$typeof){case z:return F.key===we?I(D,M,F,ne):null;case K:return F.key===we?$(D,M,F,ne):null;case Q:return we=F._init,q(D,M,we(F._payload),ne)}if(Cr(F)||Y(F))return we!==null?null:J(D,M,F,ne,null);fl(D,F)}return null}function ie(D,M,F,ne,we){if(typeof ne=="string"&&ne!==""||typeof ne=="number")return D=D.get(F)||null,P(M,D,""+ne,we);if(typeof ne=="object"&&ne!==null){switch(ne.$$typeof){case z:return D=D.get(ne.key===null?F:ne.key)||null,I(M,D,ne,we);case K:return D=D.get(ne.key===null?F:ne.key)||null,$(M,D,ne,we);case Q:var Ce=ne._init;return ie(D,M,F,Ce(ne._payload),we)}if(Cr(ne)||Y(ne))return D=D.get(F)||null,J(M,D,ne,we,null);fl(M,ne)}return null}function pe(D,M,F,ne){for(var we=null,Ce=null,ke=M,Re=M=0,gt=null;ke!==null&&Re<F.length;Re++){ke.index>Re?(gt=ke,ke=null):gt=ke.sibling;var Be=q(D,ke,F[Re],ne);if(Be===null){ke===null&&(ke=gt);break}e&&ke&&Be.alternate===null&&t(D,ke),M=h(Be,M,Re),Ce===null?we=Be:Ce.sibling=Be,Ce=Be,ke=gt}if(Re===F.length)return s(D,ke),Je&&Rr(D,Re),we;if(ke===null){for(;Re<F.length;Re++)ke=Z(D,F[Re],ne),ke!==null&&(M=h(ke,M,Re),Ce===null?we=ke:Ce.sibling=ke,Ce=ke);return Je&&Rr(D,Re),we}for(ke=o(D,ke);Re<F.length;Re++)gt=ie(ke,D,Re,F[Re],ne),gt!==null&&(e&>.alternate!==null&&ke.delete(gt.key===null?Re:gt.key),M=h(gt,M,Re),Ce===null?we=gt:Ce.sibling=gt,Ce=gt);return e&&ke.forEach(function(cr){return t(D,cr)}),Je&&Rr(D,Re),we}function ve(D,M,F,ne){var we=Y(F);if(typeof we!="function")throw Error(l(150));if(F=we.call(F),F==null)throw Error(l(151));for(var Ce=we=null,ke=M,Re=M=0,gt=null,Be=F.next();ke!==null&&!Be.done;Re++,Be=F.next()){ke.index>Re?(gt=ke,ke=null):gt=ke.sibling;var cr=q(D,ke,Be.value,ne);if(cr===null){ke===null&&(ke=gt);break}e&&ke&&cr.alternate===null&&t(D,ke),M=h(cr,M,Re),Ce===null?we=cr:Ce.sibling=cr,Ce=cr,ke=gt}if(Be.done)return s(D,ke),Je&&Rr(D,Re),we;if(ke===null){for(;!Be.done;Re++,Be=F.next())Be=Z(D,Be.value,ne),Be!==null&&(M=h(Be,M,Re),Ce===null?we=Be:Ce.sibling=Be,Ce=Be);return Je&&Rr(D,Re),we}for(ke=o(D,ke);!Be.done;Re++,Be=F.next())Be=ie(ke,D,Re,Be.value,ne),Be!==null&&(e&&Be.alternate!==null&&ke.delete(Be.key===null?Re:Be.key),M=h(Be,M,Re),Ce===null?we=Be:Ce.sibling=Be,Ce=Be);return e&&ke.forEach(function(zy){return t(D,zy)}),Je&&Rr(D,Re),we}function it(D,M,F,ne){if(typeof F=="object"&&F!==null&&F.type===W&&F.key===null&&(F=F.props.children),typeof F=="object"&&F!==null){switch(F.$$typeof){case z:e:{for(var we=F.key,Ce=M;Ce!==null;){if(Ce.key===we){if(we=F.type,we===W){if(Ce.tag===7){s(D,Ce.sibling),M=u(Ce,F.props.children),M.return=D,D=M;break e}}else if(Ce.elementType===we||typeof we=="object"&&we!==null&&we.$$typeof===Q&&mf(we)===Ce.type){s(D,Ce.sibling),M=u(Ce,F.props),M.ref=da(D,Ce,F),M.return=D,D=M;break e}s(D,Ce);break}else t(D,Ce);Ce=Ce.sibling}F.type===W?(M=Fr(F.props.children,D.mode,ne,F.key),M.return=D,D=M):(ne=Dl(F.type,F.key,F.props,null,D.mode,ne),ne.ref=da(D,M,F),ne.return=D,D=ne)}return b(D);case K:e:{for(Ce=F.key;M!==null;){if(M.key===Ce)if(M.tag===4&&M.stateNode.containerInfo===F.containerInfo&&M.stateNode.implementation===F.implementation){s(D,M.sibling),M=u(M,F.children||[]),M.return=D,D=M;break e}else{s(D,M);break}else t(D,M);M=M.sibling}M=jc(F,D.mode,ne),M.return=D,D=M}return b(D);case Q:return Ce=F._init,it(D,M,Ce(F._payload),ne)}if(Cr(F))return pe(D,M,F,ne);if(Y(F))return ve(D,M,F,ne);fl(D,F)}return typeof F=="string"&&F!==""||typeof F=="number"?(F=""+F,M!==null&&M.tag===6?(s(D,M.sibling),M=u(M,F),M.return=D,D=M):(s(D,M),M=Nc(F,D.mode,ne),M.return=D,D=M),b(D)):s(D,M)}return it}var ds=pf(!0),xf=pf(!1),hl=Jn(null),ml=null,fs=null,Ii=null;function Ai(){Ii=fs=ml=null}function Mi(e){var t=hl.current;qe(hl),e._currentValue=t}function Li(e,t,s){for(;e!==null;){var o=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,o!==null&&(o.childLanes|=t)):o!==null&&(o.childLanes&t)!==t&&(o.childLanes|=t),e===s)break;e=e.return}}function hs(e,t){ml=e,Ii=fs=null,e=e.dependencies,e!==null&&e.firstContext!==null&&((e.lanes&t)!==0&&(It=!0),e.firstContext=null)}function Kt(e){var t=e._currentValue;if(Ii!==e)if(e={context:e,memoizedValue:t,next:null},fs===null){if(ml===null)throw Error(l(308));fs=e,ml.dependencies={lanes:0,firstContext:e}}else fs=fs.next=e;return t}var Tr=null;function Di(e){Tr===null?Tr=[e]:Tr.push(e)}function gf(e,t,s,o){var u=t.interleaved;return u===null?(s.next=s,Di(t)):(s.next=u.next,u.next=s),t.interleaved=s,Rn(e,o)}function Rn(e,t){e.lanes|=t;var s=e.alternate;for(s!==null&&(s.lanes|=t),s=e,e=e.return;e!==null;)e.childLanes|=t,s=e.alternate,s!==null&&(s.childLanes|=t),s=e,e=e.return;return s.tag===3?s.stateNode:null}var tr=!1;function Oi(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function yf(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function Tn(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function nr(e,t,s){var o=e.updateQueue;if(o===null)return null;if(o=o.shared,(Fe&2)!==0){var u=o.pending;return u===null?t.next=t:(t.next=u.next,u.next=t),o.pending=t,Rn(e,s)}return u=o.interleaved,u===null?(t.next=t,Di(o)):(t.next=u.next,u.next=t),o.interleaved=t,Rn(e,s)}function pl(e,t,s){if(t=t.updateQueue,t!==null&&(t=t.shared,(s&4194240)!==0)){var o=t.lanes;o&=e.pendingLanes,s|=o,t.lanes=s,qo(e,s)}}function vf(e,t){var s=e.updateQueue,o=e.alternate;if(o!==null&&(o=o.updateQueue,s===o)){var u=null,h=null;if(s=s.firstBaseUpdate,s!==null){do{var b={eventTime:s.eventTime,lane:s.lane,tag:s.tag,payload:s.payload,callback:s.callback,next:null};h===null?u=h=b:h=h.next=b,s=s.next}while(s!==null);h===null?u=h=t:h=h.next=t}else u=h=t;s={baseState:o.baseState,firstBaseUpdate:u,lastBaseUpdate:h,shared:o.shared,effects:o.effects},e.updateQueue=s;return}e=s.lastBaseUpdate,e===null?s.firstBaseUpdate=t:e.next=t,s.lastBaseUpdate=t}function xl(e,t,s,o){var u=e.updateQueue;tr=!1;var h=u.firstBaseUpdate,b=u.lastBaseUpdate,P=u.shared.pending;if(P!==null){u.shared.pending=null;var I=P,$=I.next;I.next=null,b===null?h=$:b.next=$,b=I;var J=e.alternate;J!==null&&(J=J.updateQueue,P=J.lastBaseUpdate,P!==b&&(P===null?J.firstBaseUpdate=$:P.next=$,J.lastBaseUpdate=I))}if(h!==null){var Z=u.baseState;b=0,J=$=I=null,P=h;do{var q=P.lane,ie=P.eventTime;if((o&q)===q){J!==null&&(J=J.next={eventTime:ie,lane:0,tag:P.tag,payload:P.payload,callback:P.callback,next:null});e:{var pe=e,ve=P;switch(q=t,ie=s,ve.tag){case 1:if(pe=ve.payload,typeof pe=="function"){Z=pe.call(ie,Z,q);break e}Z=pe;break e;case 3:pe.flags=pe.flags&-65537|128;case 0:if(pe=ve.payload,q=typeof pe=="function"?pe.call(ie,Z,q):pe,q==null)break e;Z=X({},Z,q);break e;case 2:tr=!0}}P.callback!==null&&P.lane!==0&&(e.flags|=64,q=u.effects,q===null?u.effects=[P]:q.push(P))}else ie={eventTime:ie,lane:q,tag:P.tag,payload:P.payload,callback:P.callback,next:null},J===null?($=J=ie,I=Z):J=J.next=ie,b|=q;if(P=P.next,P===null){if(P=u.shared.pending,P===null)break;q=P,P=q.next,q.next=null,u.lastBaseUpdate=q,u.shared.pending=null}}while(!0);if(J===null&&(I=Z),u.baseState=I,u.firstBaseUpdate=$,u.lastBaseUpdate=J,t=u.shared.interleaved,t!==null){u=t;do b|=u.lane,u=u.next;while(u!==t)}else h===null&&(u.shared.lanes=0);Mr|=b,e.lanes=b,e.memoizedState=Z}}function wf(e,t,s){if(e=t.effects,t.effects=null,e!==null)for(t=0;t<e.length;t++){var o=e[t],u=o.callback;if(u!==null){if(o.callback=null,o=s,typeof u!="function")throw Error(l(191,u));u.call(o)}}}var fa={},gn=Jn(fa),ha=Jn(fa),ma=Jn(fa);function Ir(e){if(e===fa)throw Error(l(174));return e}function Fi(e,t){switch(Qe(ma,t),Qe(ha,e),Qe(gn,fa),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:Dt(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=Dt(t,e)}qe(gn),Qe(gn,t)}function ms(){qe(gn),qe(ha),qe(ma)}function bf(e){Ir(ma.current);var t=Ir(gn.current),s=Dt(t,e.type);t!==s&&(Qe(ha,e),Qe(gn,s))}function zi(e){ha.current===e&&(qe(gn),qe(ha))}var tt=Jn(0);function gl(e){for(var t=e;t!==null;){if(t.tag===13){var s=t.memoizedState;if(s!==null&&(s=s.dehydrated,s===null||s.data==="$?"||s.data==="$!"))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==void 0){if((t.flags&128)!==0)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var $i=[];function Bi(){for(var e=0;e<$i.length;e++)$i[e]._workInProgressVersionPrimary=null;$i.length=0}var yl=A.ReactCurrentDispatcher,Ui=A.ReactCurrentBatchConfig,Ar=0,nt=null,ft=null,pt=null,vl=!1,pa=!1,xa=0,oy=0;function St(){throw Error(l(321))}function Vi(e,t){if(t===null)return!1;for(var s=0;s<t.length&&s<e.length;s++)if(!en(e[s],t[s]))return!1;return!0}function Wi(e,t,s,o,u,h){if(Ar=h,nt=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,yl.current=e===null||e.memoizedState===null?dy:fy,e=s(o,u),pa){h=0;do{if(pa=!1,xa=0,25<=h)throw Error(l(301));h+=1,pt=ft=null,t.updateQueue=null,yl.current=hy,e=s(o,u)}while(pa)}if(yl.current=Nl,t=ft!==null&&ft.next!==null,Ar=0,pt=ft=nt=null,vl=!1,t)throw Error(l(300));return e}function Hi(){var e=xa!==0;return xa=0,e}function yn(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return pt===null?nt.memoizedState=pt=e:pt=pt.next=e,pt}function Gt(){if(ft===null){var e=nt.alternate;e=e!==null?e.memoizedState:null}else e=ft.next;var t=pt===null?nt.memoizedState:pt.next;if(t!==null)pt=t,ft=e;else{if(e===null)throw Error(l(310));ft=e,e={memoizedState:ft.memoizedState,baseState:ft.baseState,baseQueue:ft.baseQueue,queue:ft.queue,next:null},pt===null?nt.memoizedState=pt=e:pt=pt.next=e}return pt}function ga(e,t){return typeof t=="function"?t(e):t}function Ki(e){var t=Gt(),s=t.queue;if(s===null)throw Error(l(311));s.lastRenderedReducer=e;var o=ft,u=o.baseQueue,h=s.pending;if(h!==null){if(u!==null){var b=u.next;u.next=h.next,h.next=b}o.baseQueue=u=h,s.pending=null}if(u!==null){h=u.next,o=o.baseState;var P=b=null,I=null,$=h;do{var J=$.lane;if((Ar&J)===J)I!==null&&(I=I.next={lane:0,action:$.action,hasEagerState:$.hasEagerState,eagerState:$.eagerState,next:null}),o=$.hasEagerState?$.eagerState:e(o,$.action);else{var Z={lane:J,action:$.action,hasEagerState:$.hasEagerState,eagerState:$.eagerState,next:null};I===null?(P=I=Z,b=o):I=I.next=Z,nt.lanes|=J,Mr|=J}$=$.next}while($!==null&&$!==h);I===null?b=o:I.next=P,en(o,t.memoizedState)||(It=!0),t.memoizedState=o,t.baseState=b,t.baseQueue=I,s.lastRenderedState=o}if(e=s.interleaved,e!==null){u=e;do h=u.lane,nt.lanes|=h,Mr|=h,u=u.next;while(u!==e)}else u===null&&(s.lanes=0);return[t.memoizedState,s.dispatch]}function Gi(e){var t=Gt(),s=t.queue;if(s===null)throw Error(l(311));s.lastRenderedReducer=e;var o=s.dispatch,u=s.pending,h=t.memoizedState;if(u!==null){s.pending=null;var b=u=u.next;do h=e(h,b.action),b=b.next;while(b!==u);en(h,t.memoizedState)||(It=!0),t.memoizedState=h,t.baseQueue===null&&(t.baseState=h),s.lastRenderedState=h}return[h,o]}function Nf(){}function jf(e,t){var s=nt,o=Gt(),u=t(),h=!en(o.memoizedState,u);if(h&&(o.memoizedState=u,It=!0),o=o.queue,Qi(kf.bind(null,s,o,e),[e]),o.getSnapshot!==t||h||pt!==null&&pt.memoizedState.tag&1){if(s.flags|=2048,ya(9,Cf.bind(null,s,o,u,t),void 0,null),xt===null)throw Error(l(349));(Ar&30)!==0||Sf(s,t,u)}return u}function Sf(e,t,s){e.flags|=16384,e={getSnapshot:t,value:s},t=nt.updateQueue,t===null?(t={lastEffect:null,stores:null},nt.updateQueue=t,t.stores=[e]):(s=t.stores,s===null?t.stores=[e]:s.push(e))}function Cf(e,t,s,o){t.value=s,t.getSnapshot=o,Ef(t)&&_f(e)}function kf(e,t,s){return s(function(){Ef(t)&&_f(e)})}function Ef(e){var t=e.getSnapshot;e=e.value;try{var s=t();return!en(e,s)}catch{return!0}}function _f(e){var t=Rn(e,1);t!==null&&an(t,e,1,-1)}function Pf(e){var t=yn();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:ga,lastRenderedState:e},t.queue=e,e=e.dispatch=uy.bind(null,nt,e),[t.memoizedState,e]}function ya(e,t,s,o){return e={tag:e,create:t,destroy:s,deps:o,next:null},t=nt.updateQueue,t===null?(t={lastEffect:null,stores:null},nt.updateQueue=t,t.lastEffect=e.next=e):(s=t.lastEffect,s===null?t.lastEffect=e.next=e:(o=s.next,s.next=e,e.next=o,t.lastEffect=e)),e}function Rf(){return Gt().memoizedState}function wl(e,t,s,o){var u=yn();nt.flags|=e,u.memoizedState=ya(1|t,s,void 0,o===void 0?null:o)}function bl(e,t,s,o){var u=Gt();o=o===void 0?null:o;var h=void 0;if(ft!==null){var b=ft.memoizedState;if(h=b.destroy,o!==null&&Vi(o,b.deps)){u.memoizedState=ya(t,s,h,o);return}}nt.flags|=e,u.memoizedState=ya(1|t,s,h,o)}function Tf(e,t){return wl(8390656,8,e,t)}function Qi(e,t){return bl(2048,8,e,t)}function If(e,t){return bl(4,2,e,t)}function Af(e,t){return bl(4,4,e,t)}function Mf(e,t){if(typeof t=="function")return e=e(),t(e),function(){t(null)};if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function Lf(e,t,s){return s=s!=null?s.concat([e]):null,bl(4,4,Mf.bind(null,t,e),s)}function Yi(){}function Df(e,t){var s=Gt();t=t===void 0?null:t;var o=s.memoizedState;return o!==null&&t!==null&&Vi(t,o[1])?o[0]:(s.memoizedState=[e,t],e)}function Of(e,t){var s=Gt();t=t===void 0?null:t;var o=s.memoizedState;return o!==null&&t!==null&&Vi(t,o[1])?o[0]:(e=e(),s.memoizedState=[e,t],e)}function Ff(e,t,s){return(Ar&21)===0?(e.baseState&&(e.baseState=!1,It=!0),e.memoizedState=s):(en(s,t)||(s=hd(),nt.lanes|=s,Mr|=s,e.baseState=!0),t)}function iy(e,t){var s=Ke;Ke=s!==0&&4>s?s:4,e(!0);var o=Ui.transition;Ui.transition={};try{e(!1),t()}finally{Ke=s,Ui.transition=o}}function zf(){return Gt().memoizedState}function cy(e,t,s){var o=lr(e);if(s={lane:o,action:s,hasEagerState:!1,eagerState:null,next:null},$f(e))Bf(t,s);else if(s=gf(e,t,s,o),s!==null){var u=Pt();an(s,e,o,u),Uf(s,t,o)}}function uy(e,t,s){var o=lr(e),u={lane:o,action:s,hasEagerState:!1,eagerState:null,next:null};if($f(e))Bf(t,u);else{var h=e.alternate;if(e.lanes===0&&(h===null||h.lanes===0)&&(h=t.lastRenderedReducer,h!==null))try{var b=t.lastRenderedState,P=h(b,s);if(u.hasEagerState=!0,u.eagerState=P,en(P,b)){var I=t.interleaved;I===null?(u.next=u,Di(t)):(u.next=I.next,I.next=u),t.interleaved=u;return}}catch{}finally{}s=gf(e,t,u,o),s!==null&&(u=Pt(),an(s,e,o,u),Uf(s,t,o))}}function $f(e){var t=e.alternate;return e===nt||t!==null&&t===nt}function Bf(e,t){pa=vl=!0;var s=e.pending;s===null?t.next=t:(t.next=s.next,s.next=t),e.pending=t}function Uf(e,t,s){if((s&4194240)!==0){var o=t.lanes;o&=e.pendingLanes,s|=o,t.lanes=s,qo(e,s)}}var Nl={readContext:Kt,useCallback:St,useContext:St,useEffect:St,useImperativeHandle:St,useInsertionEffect:St,useLayoutEffect:St,useMemo:St,useReducer:St,useRef:St,useState:St,useDebugValue:St,useDeferredValue:St,useTransition:St,useMutableSource:St,useSyncExternalStore:St,useId:St,unstable_isNewReconciler:!1},dy={readContext:Kt,useCallback:function(e,t){return yn().memoizedState=[e,t===void 0?null:t],e},useContext:Kt,useEffect:Tf,useImperativeHandle:function(e,t,s){return s=s!=null?s.concat([e]):null,wl(4194308,4,Mf.bind(null,t,e),s)},useLayoutEffect:function(e,t){return wl(4194308,4,e,t)},useInsertionEffect:function(e,t){return wl(4,2,e,t)},useMemo:function(e,t){var s=yn();return t=t===void 0?null:t,e=e(),s.memoizedState=[e,t],e},useReducer:function(e,t,s){var o=yn();return t=s!==void 0?s(t):t,o.memoizedState=o.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},o.queue=e,e=e.dispatch=cy.bind(null,nt,e),[o.memoizedState,e]},useRef:function(e){var t=yn();return e={current:e},t.memoizedState=e},useState:Pf,useDebugValue:Yi,useDeferredValue:function(e){return yn().memoizedState=e},useTransition:function(){var e=Pf(!1),t=e[0];return e=iy.bind(null,e[1]),yn().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,s){var o=nt,u=yn();if(Je){if(s===void 0)throw Error(l(407));s=s()}else{if(s=t(),xt===null)throw Error(l(349));(Ar&30)!==0||Sf(o,t,s)}u.memoizedState=s;var h={value:s,getSnapshot:t};return u.queue=h,Tf(kf.bind(null,o,h,e),[e]),o.flags|=2048,ya(9,Cf.bind(null,o,h,s,t),void 0,null),s},useId:function(){var e=yn(),t=xt.identifierPrefix;if(Je){var s=Pn,o=_n;s=(o&~(1<<32-Zt(o)-1)).toString(32)+s,t=":"+t+"R"+s,s=xa++,0<s&&(t+="H"+s.toString(32)),t+=":"}else s=oy++,t=":"+t+"r"+s.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},fy={readContext:Kt,useCallback:Df,useContext:Kt,useEffect:Qi,useImperativeHandle:Lf,useInsertionEffect:If,useLayoutEffect:Af,useMemo:Of,useReducer:Ki,useRef:Rf,useState:function(){return Ki(ga)},useDebugValue:Yi,useDeferredValue:function(e){var t=Gt();return Ff(t,ft.memoizedState,e)},useTransition:function(){var e=Ki(ga)[0],t=Gt().memoizedState;return[e,t]},useMutableSource:Nf,useSyncExternalStore:jf,useId:zf,unstable_isNewReconciler:!1},hy={readContext:Kt,useCallback:Df,useContext:Kt,useEffect:Qi,useImperativeHandle:Lf,useInsertionEffect:If,useLayoutEffect:Af,useMemo:Of,useReducer:Gi,useRef:Rf,useState:function(){return Gi(ga)},useDebugValue:Yi,useDeferredValue:function(e){var t=Gt();return ft===null?t.memoizedState=e:Ff(t,ft.memoizedState,e)},useTransition:function(){var e=Gi(ga)[0],t=Gt().memoizedState;return[e,t]},useMutableSource:Nf,useSyncExternalStore:jf,useId:zf,unstable_isNewReconciler:!1};function nn(e,t){if(e&&e.defaultProps){t=X({},t),e=e.defaultProps;for(var s in e)t[s]===void 0&&(t[s]=e[s]);return t}return t}function Xi(e,t,s,o){t=e.memoizedState,s=s(o,t),s=s==null?t:X({},t,s),e.memoizedState=s,e.lanes===0&&(e.updateQueue.baseState=s)}var jl={isMounted:function(e){return(e=e._reactInternals)?kr(e)===e:!1},enqueueSetState:function(e,t,s){e=e._reactInternals;var o=Pt(),u=lr(e),h=Tn(o,u);h.payload=t,s!=null&&(h.callback=s),t=nr(e,h,u),t!==null&&(an(t,e,u,o),pl(t,e,u))},enqueueReplaceState:function(e,t,s){e=e._reactInternals;var o=Pt(),u=lr(e),h=Tn(o,u);h.tag=1,h.payload=t,s!=null&&(h.callback=s),t=nr(e,h,u),t!==null&&(an(t,e,u,o),pl(t,e,u))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var s=Pt(),o=lr(e),u=Tn(s,o);u.tag=2,t!=null&&(u.callback=t),t=nr(e,u,o),t!==null&&(an(t,e,o,s),pl(t,e,o))}};function Vf(e,t,s,o,u,h,b){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(o,h,b):t.prototype&&t.prototype.isPureReactComponent?!sa(s,o)||!sa(u,h):!0}function Wf(e,t,s){var o=!1,u=Zn,h=t.contextType;return typeof h=="object"&&h!==null?h=Kt(h):(u=Tt(t)?_r:jt.current,o=t.contextTypes,h=(o=o!=null)?os(e,u):Zn),t=new t(s,h),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=jl,e.stateNode=t,t._reactInternals=e,o&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=u,e.__reactInternalMemoizedMaskedChildContext=h),t}function Hf(e,t,s,o){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(s,o),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(s,o),t.state!==e&&jl.enqueueReplaceState(t,t.state,null)}function qi(e,t,s,o){var u=e.stateNode;u.props=s,u.state=e.memoizedState,u.refs={},Oi(e);var h=t.contextType;typeof h=="object"&&h!==null?u.context=Kt(h):(h=Tt(t)?_r:jt.current,u.context=os(e,h)),u.state=e.memoizedState,h=t.getDerivedStateFromProps,typeof h=="function"&&(Xi(e,t,h,s),u.state=e.memoizedState),typeof t.getDerivedStateFromProps=="function"||typeof u.getSnapshotBeforeUpdate=="function"||typeof u.UNSAFE_componentWillMount!="function"&&typeof u.componentWillMount!="function"||(t=u.state,typeof u.componentWillMount=="function"&&u.componentWillMount(),typeof u.UNSAFE_componentWillMount=="function"&&u.UNSAFE_componentWillMount(),t!==u.state&&jl.enqueueReplaceState(u,u.state,null),xl(e,s,u,o),u.state=e.memoizedState),typeof u.componentDidMount=="function"&&(e.flags|=4194308)}function ps(e,t){try{var s="",o=t;do s+=je(o),o=o.return;while(o);var u=s}catch(h){u=`
|
||
Error generating stack: `+h.message+`
|
||
`+h.stack}return{value:e,source:t,stack:u,digest:null}}function Ji(e,t,s){return{value:e,source:null,stack:s??null,digest:t??null}}function Zi(e,t){try{console.error(t.value)}catch(s){setTimeout(function(){throw s})}}var my=typeof WeakMap=="function"?WeakMap:Map;function Kf(e,t,s){s=Tn(-1,s),s.tag=3,s.payload={element:null};var o=t.value;return s.callback=function(){Rl||(Rl=!0,mc=o),Zi(e,t)},s}function Gf(e,t,s){s=Tn(-1,s),s.tag=3;var o=e.type.getDerivedStateFromError;if(typeof o=="function"){var u=t.value;s.payload=function(){return o(u)},s.callback=function(){Zi(e,t)}}var h=e.stateNode;return h!==null&&typeof h.componentDidCatch=="function"&&(s.callback=function(){Zi(e,t),typeof o!="function"&&(sr===null?sr=new Set([this]):sr.add(this));var b=t.stack;this.componentDidCatch(t.value,{componentStack:b!==null?b:""})}),s}function Qf(e,t,s){var o=e.pingCache;if(o===null){o=e.pingCache=new my;var u=new Set;o.set(t,u)}else u=o.get(t),u===void 0&&(u=new Set,o.set(t,u));u.has(s)||(u.add(s),e=_y.bind(null,e,t,s),t.then(e,e))}function Yf(e){do{var t;if((t=e.tag===13)&&(t=e.memoizedState,t=t!==null?t.dehydrated!==null:!0),t)return e;e=e.return}while(e!==null);return null}function Xf(e,t,s,o,u){return(e.mode&1)===0?(e===t?e.flags|=65536:(e.flags|=128,s.flags|=131072,s.flags&=-52805,s.tag===1&&(s.alternate===null?s.tag=17:(t=Tn(-1,1),t.tag=2,nr(s,t,1))),s.lanes|=1),e):(e.flags|=65536,e.lanes=u,e)}var py=A.ReactCurrentOwner,It=!1;function _t(e,t,s,o){t.child=e===null?xf(t,null,s,o):ds(t,e.child,s,o)}function qf(e,t,s,o,u){s=s.render;var h=t.ref;return hs(t,u),o=Wi(e,t,s,o,h,u),s=Hi(),e!==null&&!It?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~u,In(e,t,u)):(Je&&s&&Ei(t),t.flags|=1,_t(e,t,o,u),t.child)}function Jf(e,t,s,o,u){if(e===null){var h=s.type;return typeof h=="function"&&!bc(h)&&h.defaultProps===void 0&&s.compare===null&&s.defaultProps===void 0?(t.tag=15,t.type=h,Zf(e,t,h,o,u)):(e=Dl(s.type,null,o,t,t.mode,u),e.ref=t.ref,e.return=t,t.child=e)}if(h=e.child,(e.lanes&u)===0){var b=h.memoizedProps;if(s=s.compare,s=s!==null?s:sa,s(b,o)&&e.ref===t.ref)return In(e,t,u)}return t.flags|=1,e=ir(h,o),e.ref=t.ref,e.return=t,t.child=e}function Zf(e,t,s,o,u){if(e!==null){var h=e.memoizedProps;if(sa(h,o)&&e.ref===t.ref)if(It=!1,t.pendingProps=o=h,(e.lanes&u)!==0)(e.flags&131072)!==0&&(It=!0);else return t.lanes=e.lanes,In(e,t,u)}return ec(e,t,s,o,u)}function eh(e,t,s){var o=t.pendingProps,u=o.children,h=e!==null?e.memoizedState:null;if(o.mode==="hidden")if((t.mode&1)===0)t.memoizedState={baseLanes:0,cachePool:null,transitions:null},Qe(gs,$t),$t|=s;else{if((s&1073741824)===0)return e=h!==null?h.baseLanes|s:s,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,Qe(gs,$t),$t|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},o=h!==null?h.baseLanes:s,Qe(gs,$t),$t|=o}else h!==null?(o=h.baseLanes|s,t.memoizedState=null):o=s,Qe(gs,$t),$t|=o;return _t(e,t,u,s),t.child}function th(e,t){var s=t.ref;(e===null&&s!==null||e!==null&&e.ref!==s)&&(t.flags|=512,t.flags|=2097152)}function ec(e,t,s,o,u){var h=Tt(s)?_r:jt.current;return h=os(t,h),hs(t,u),s=Wi(e,t,s,o,h,u),o=Hi(),e!==null&&!It?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~u,In(e,t,u)):(Je&&o&&Ei(t),t.flags|=1,_t(e,t,s,u),t.child)}function nh(e,t,s,o,u){if(Tt(s)){var h=!0;ol(t)}else h=!1;if(hs(t,u),t.stateNode===null)Cl(e,t),Wf(t,s,o),qi(t,s,o,u),o=!0;else if(e===null){var b=t.stateNode,P=t.memoizedProps;b.props=P;var I=b.context,$=s.contextType;typeof $=="object"&&$!==null?$=Kt($):($=Tt(s)?_r:jt.current,$=os(t,$));var J=s.getDerivedStateFromProps,Z=typeof J=="function"||typeof b.getSnapshotBeforeUpdate=="function";Z||typeof b.UNSAFE_componentWillReceiveProps!="function"&&typeof b.componentWillReceiveProps!="function"||(P!==o||I!==$)&&Hf(t,b,o,$),tr=!1;var q=t.memoizedState;b.state=q,xl(t,o,b,u),I=t.memoizedState,P!==o||q!==I||Rt.current||tr?(typeof J=="function"&&(Xi(t,s,J,o),I=t.memoizedState),(P=tr||Vf(t,s,P,o,q,I,$))?(Z||typeof b.UNSAFE_componentWillMount!="function"&&typeof b.componentWillMount!="function"||(typeof b.componentWillMount=="function"&&b.componentWillMount(),typeof b.UNSAFE_componentWillMount=="function"&&b.UNSAFE_componentWillMount()),typeof b.componentDidMount=="function"&&(t.flags|=4194308)):(typeof b.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=o,t.memoizedState=I),b.props=o,b.state=I,b.context=$,o=P):(typeof b.componentDidMount=="function"&&(t.flags|=4194308),o=!1)}else{b=t.stateNode,yf(e,t),P=t.memoizedProps,$=t.type===t.elementType?P:nn(t.type,P),b.props=$,Z=t.pendingProps,q=b.context,I=s.contextType,typeof I=="object"&&I!==null?I=Kt(I):(I=Tt(s)?_r:jt.current,I=os(t,I));var ie=s.getDerivedStateFromProps;(J=typeof ie=="function"||typeof b.getSnapshotBeforeUpdate=="function")||typeof b.UNSAFE_componentWillReceiveProps!="function"&&typeof b.componentWillReceiveProps!="function"||(P!==Z||q!==I)&&Hf(t,b,o,I),tr=!1,q=t.memoizedState,b.state=q,xl(t,o,b,u);var pe=t.memoizedState;P!==Z||q!==pe||Rt.current||tr?(typeof ie=="function"&&(Xi(t,s,ie,o),pe=t.memoizedState),($=tr||Vf(t,s,$,o,q,pe,I)||!1)?(J||typeof b.UNSAFE_componentWillUpdate!="function"&&typeof b.componentWillUpdate!="function"||(typeof b.componentWillUpdate=="function"&&b.componentWillUpdate(o,pe,I),typeof b.UNSAFE_componentWillUpdate=="function"&&b.UNSAFE_componentWillUpdate(o,pe,I)),typeof b.componentDidUpdate=="function"&&(t.flags|=4),typeof b.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof b.componentDidUpdate!="function"||P===e.memoizedProps&&q===e.memoizedState||(t.flags|=4),typeof b.getSnapshotBeforeUpdate!="function"||P===e.memoizedProps&&q===e.memoizedState||(t.flags|=1024),t.memoizedProps=o,t.memoizedState=pe),b.props=o,b.state=pe,b.context=I,o=$):(typeof b.componentDidUpdate!="function"||P===e.memoizedProps&&q===e.memoizedState||(t.flags|=4),typeof b.getSnapshotBeforeUpdate!="function"||P===e.memoizedProps&&q===e.memoizedState||(t.flags|=1024),o=!1)}return tc(e,t,s,o,h,u)}function tc(e,t,s,o,u,h){th(e,t);var b=(t.flags&128)!==0;if(!o&&!b)return u&&lf(t,s,!1),In(e,t,h);o=t.stateNode,py.current=t;var P=b&&typeof s.getDerivedStateFromError!="function"?null:o.render();return t.flags|=1,e!==null&&b?(t.child=ds(t,e.child,null,h),t.child=ds(t,null,P,h)):_t(e,t,P,h),t.memoizedState=o.state,u&&lf(t,s,!0),t.child}function rh(e){var t=e.stateNode;t.pendingContext?sf(e,t.pendingContext,t.pendingContext!==t.context):t.context&&sf(e,t.context,!1),Fi(e,t.containerInfo)}function sh(e,t,s,o,u){return us(),Ti(u),t.flags|=256,_t(e,t,s,o),t.child}var nc={dehydrated:null,treeContext:null,retryLane:0};function rc(e){return{baseLanes:e,cachePool:null,transitions:null}}function ah(e,t,s){var o=t.pendingProps,u=tt.current,h=!1,b=(t.flags&128)!==0,P;if((P=b)||(P=e!==null&&e.memoizedState===null?!1:(u&2)!==0),P?(h=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(u|=1),Qe(tt,u&1),e===null)return Ri(t),e=t.memoizedState,e!==null&&(e=e.dehydrated,e!==null)?((t.mode&1)===0?t.lanes=1:e.data==="$!"?t.lanes=8:t.lanes=1073741824,null):(b=o.children,e=o.fallback,h?(o=t.mode,h=t.child,b={mode:"hidden",children:b},(o&1)===0&&h!==null?(h.childLanes=0,h.pendingProps=b):h=Ol(b,o,0,null),e=Fr(e,o,s,null),h.return=t,e.return=t,h.sibling=e,t.child=h,t.child.memoizedState=rc(s),t.memoizedState=nc,e):sc(t,b));if(u=e.memoizedState,u!==null&&(P=u.dehydrated,P!==null))return xy(e,t,b,o,P,u,s);if(h){h=o.fallback,b=t.mode,u=e.child,P=u.sibling;var I={mode:"hidden",children:o.children};return(b&1)===0&&t.child!==u?(o=t.child,o.childLanes=0,o.pendingProps=I,t.deletions=null):(o=ir(u,I),o.subtreeFlags=u.subtreeFlags&14680064),P!==null?h=ir(P,h):(h=Fr(h,b,s,null),h.flags|=2),h.return=t,o.return=t,o.sibling=h,t.child=o,o=h,h=t.child,b=e.child.memoizedState,b=b===null?rc(s):{baseLanes:b.baseLanes|s,cachePool:null,transitions:b.transitions},h.memoizedState=b,h.childLanes=e.childLanes&~s,t.memoizedState=nc,o}return h=e.child,e=h.sibling,o=ir(h,{mode:"visible",children:o.children}),(t.mode&1)===0&&(o.lanes=s),o.return=t,o.sibling=null,e!==null&&(s=t.deletions,s===null?(t.deletions=[e],t.flags|=16):s.push(e)),t.child=o,t.memoizedState=null,o}function sc(e,t){return t=Ol({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function Sl(e,t,s,o){return o!==null&&Ti(o),ds(t,e.child,null,s),e=sc(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function xy(e,t,s,o,u,h,b){if(s)return t.flags&256?(t.flags&=-257,o=Ji(Error(l(422))),Sl(e,t,b,o)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(h=o.fallback,u=t.mode,o=Ol({mode:"visible",children:o.children},u,0,null),h=Fr(h,u,b,null),h.flags|=2,o.return=t,h.return=t,o.sibling=h,t.child=o,(t.mode&1)!==0&&ds(t,e.child,null,b),t.child.memoizedState=rc(b),t.memoizedState=nc,h);if((t.mode&1)===0)return Sl(e,t,b,null);if(u.data==="$!"){if(o=u.nextSibling&&u.nextSibling.dataset,o)var P=o.dgst;return o=P,h=Error(l(419)),o=Ji(h,o,void 0),Sl(e,t,b,o)}if(P=(b&e.childLanes)!==0,It||P){if(o=xt,o!==null){switch(b&-b){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|b))!==0?0:u,u!==0&&u!==h.retryLane&&(h.retryLane=u,Rn(e,u),an(o,e,u,-1))}return wc(),o=Ji(Error(l(421))),Sl(e,t,b,o)}return u.data==="$?"?(t.flags|=128,t.child=e.child,t=Py.bind(null,e),u._reactRetry=t,null):(e=h.treeContext,zt=qn(u.nextSibling),Ft=t,Je=!0,tn=null,e!==null&&(Wt[Ht++]=_n,Wt[Ht++]=Pn,Wt[Ht++]=Pr,_n=e.id,Pn=e.overflow,Pr=t),t=sc(t,o.children),t.flags|=4096,t)}function lh(e,t,s){e.lanes|=t;var o=e.alternate;o!==null&&(o.lanes|=t),Li(e.return,t,s)}function ac(e,t,s,o,u){var h=e.memoizedState;h===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:o,tail:s,tailMode:u}:(h.isBackwards=t,h.rendering=null,h.renderingStartTime=0,h.last=o,h.tail=s,h.tailMode=u)}function oh(e,t,s){var o=t.pendingProps,u=o.revealOrder,h=o.tail;if(_t(e,t,o.children,s),o=tt.current,(o&2)!==0)o=o&1|2,t.flags|=128;else{if(e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&lh(e,s,t);else if(e.tag===19)lh(e,s,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}o&=1}if(Qe(tt,o),(t.mode&1)===0)t.memoizedState=null;else switch(u){case"forwards":for(s=t.child,u=null;s!==null;)e=s.alternate,e!==null&&gl(e)===null&&(u=s),s=s.sibling;s=u,s===null?(u=t.child,t.child=null):(u=s.sibling,s.sibling=null),ac(t,!1,u,s,h);break;case"backwards":for(s=null,u=t.child,t.child=null;u!==null;){if(e=u.alternate,e!==null&&gl(e)===null){t.child=u;break}e=u.sibling,u.sibling=s,s=u,u=e}ac(t,!0,s,null,h);break;case"together":ac(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function Cl(e,t){(t.mode&1)===0&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function In(e,t,s){if(e!==null&&(t.dependencies=e.dependencies),Mr|=t.lanes,(s&t.childLanes)===0)return null;if(e!==null&&t.child!==e.child)throw Error(l(153));if(t.child!==null){for(e=t.child,s=ir(e,e.pendingProps),t.child=s,s.return=t;e.sibling!==null;)e=e.sibling,s=s.sibling=ir(e,e.pendingProps),s.return=t;s.sibling=null}return t.child}function gy(e,t,s){switch(t.tag){case 3:rh(t),us();break;case 5:bf(t);break;case 1:Tt(t.type)&&ol(t);break;case 4:Fi(t,t.stateNode.containerInfo);break;case 10:var o=t.type._context,u=t.memoizedProps.value;Qe(hl,o._currentValue),o._currentValue=u;break;case 13:if(o=t.memoizedState,o!==null)return o.dehydrated!==null?(Qe(tt,tt.current&1),t.flags|=128,null):(s&t.child.childLanes)!==0?ah(e,t,s):(Qe(tt,tt.current&1),e=In(e,t,s),e!==null?e.sibling:null);Qe(tt,tt.current&1);break;case 19:if(o=(s&t.childLanes)!==0,(e.flags&128)!==0){if(o)return oh(e,t,s);t.flags|=128}if(u=t.memoizedState,u!==null&&(u.rendering=null,u.tail=null,u.lastEffect=null),Qe(tt,tt.current),o)break;return null;case 22:case 23:return t.lanes=0,eh(e,t,s)}return In(e,t,s)}var ih,lc,ch,uh;ih=function(e,t){for(var s=t.child;s!==null;){if(s.tag===5||s.tag===6)e.appendChild(s.stateNode);else if(s.tag!==4&&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;s=s.return}s.sibling.return=s.return,s=s.sibling}},lc=function(){},ch=function(e,t,s,o){var u=e.memoizedProps;if(u!==o){e=t.stateNode,Ir(gn.current);var h=null;switch(s){case"input":u=$e(e,u),o=$e(e,o),h=[];break;case"select":u=X({},u,{value:void 0}),o=X({},o,{value:void 0}),h=[];break;case"textarea":u=Yr(e,u),o=Yr(e,o),h=[];break;default:typeof u.onClick!="function"&&typeof o.onClick=="function"&&(e.onclick=sl)}$o(s,o);var b;s=null;for($ in u)if(!o.hasOwnProperty($)&&u.hasOwnProperty($)&&u[$]!=null)if($==="style"){var P=u[$];for(b in P)P.hasOwnProperty(b)&&(s||(s={}),s[b]="")}else $!=="dangerouslySetInnerHTML"&&$!=="children"&&$!=="suppressContentEditableWarning"&&$!=="suppressHydrationWarning"&&$!=="autoFocus"&&(c.hasOwnProperty($)?h||(h=[]):(h=h||[]).push($,null));for($ in o){var I=o[$];if(P=u!=null?u[$]:void 0,o.hasOwnProperty($)&&I!==P&&(I!=null||P!=null))if($==="style")if(P){for(b in P)!P.hasOwnProperty(b)||I&&I.hasOwnProperty(b)||(s||(s={}),s[b]="");for(b in I)I.hasOwnProperty(b)&&P[b]!==I[b]&&(s||(s={}),s[b]=I[b])}else s||(h||(h=[]),h.push($,s)),s=I;else $==="dangerouslySetInnerHTML"?(I=I?I.__html:void 0,P=P?P.__html:void 0,I!=null&&P!==I&&(h=h||[]).push($,I)):$==="children"?typeof I!="string"&&typeof I!="number"||(h=h||[]).push($,""+I):$!=="suppressContentEditableWarning"&&$!=="suppressHydrationWarning"&&(c.hasOwnProperty($)?(I!=null&&$==="onScroll"&&Xe("scroll",e),h||P===I||(h=[])):(h=h||[]).push($,I))}s&&(h=h||[]).push("style",s);var $=h;(t.updateQueue=$)&&(t.flags|=4)}},uh=function(e,t,s,o){s!==o&&(t.flags|=4)};function va(e,t){if(!Je)switch(e.tailMode){case"hidden":t=e.tail;for(var s=null;t!==null;)t.alternate!==null&&(s=t),t=t.sibling;s===null?e.tail=null:s.sibling=null;break;case"collapsed":s=e.tail;for(var o=null;s!==null;)s.alternate!==null&&(o=s),s=s.sibling;o===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:o.sibling=null}}function Ct(e){var t=e.alternate!==null&&e.alternate.child===e.child,s=0,o=0;if(t)for(var u=e.child;u!==null;)s|=u.lanes|u.childLanes,o|=u.subtreeFlags&14680064,o|=u.flags&14680064,u.return=e,u=u.sibling;else for(u=e.child;u!==null;)s|=u.lanes|u.childLanes,o|=u.subtreeFlags,o|=u.flags,u.return=e,u=u.sibling;return e.subtreeFlags|=o,e.childLanes=s,t}function yy(e,t,s){var o=t.pendingProps;switch(_i(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Ct(t),null;case 1:return Tt(t.type)&&ll(),Ct(t),null;case 3:return o=t.stateNode,ms(),qe(Rt),qe(jt),Bi(),o.pendingContext&&(o.context=o.pendingContext,o.pendingContext=null),(e===null||e.child===null)&&(dl(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,tn!==null&&(gc(tn),tn=null))),lc(e,t),Ct(t),null;case 5:zi(t);var u=Ir(ma.current);if(s=t.type,e!==null&&t.stateNode!=null)ch(e,t,s,o,u),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!o){if(t.stateNode===null)throw Error(l(166));return Ct(t),null}if(e=Ir(gn.current),dl(t)){o=t.stateNode,s=t.type;var h=t.memoizedProps;switch(o[xn]=t,o[ca]=h,e=(t.mode&1)!==0,s){case"dialog":Xe("cancel",o),Xe("close",o);break;case"iframe":case"object":case"embed":Xe("load",o);break;case"video":case"audio":for(u=0;u<la.length;u++)Xe(la[u],o);break;case"source":Xe("error",o);break;case"img":case"image":case"link":Xe("error",o),Xe("load",o);break;case"details":Xe("toggle",o);break;case"input":Nt(o,h),Xe("invalid",o);break;case"select":o._wrapperState={wasMultiple:!!h.multiple},Xe("invalid",o);break;case"textarea":U(o,h),Xe("invalid",o)}$o(s,h),u=null;for(var b in h)if(h.hasOwnProperty(b)){var P=h[b];b==="children"?typeof P=="string"?o.textContent!==P&&(h.suppressHydrationWarning!==!0&&rl(o.textContent,P,e),u=["children",P]):typeof P=="number"&&o.textContent!==""+P&&(h.suppressHydrationWarning!==!0&&rl(o.textContent,P,e),u=["children",""+P]):c.hasOwnProperty(b)&&P!=null&&b==="onScroll"&&Xe("scroll",o)}switch(s){case"input":Te(o),Qr(o,h,!0);break;case"textarea":Te(o),lt(o);break;case"select":case"option":break;default:typeof h.onClick=="function"&&(o.onclick=sl)}o=u,t.updateQueue=o,o!==null&&(t.flags|=4)}else{b=u.nodeType===9?u:u.ownerDocument,e==="http://www.w3.org/1999/xhtml"&&(e=Ve(s)),e==="http://www.w3.org/1999/xhtml"?s==="script"?(e=b.createElement("div"),e.innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):typeof o.is=="string"?e=b.createElement(s,{is:o.is}):(e=b.createElement(s),s==="select"&&(b=e,o.multiple?b.multiple=!0:o.size&&(b.size=o.size))):e=b.createElementNS(e,s),e[xn]=t,e[ca]=o,ih(e,t,!1,!1),t.stateNode=e;e:{switch(b=Bo(s,o),s){case"dialog":Xe("cancel",e),Xe("close",e),u=o;break;case"iframe":case"object":case"embed":Xe("load",e),u=o;break;case"video":case"audio":for(u=0;u<la.length;u++)Xe(la[u],e);u=o;break;case"source":Xe("error",e),u=o;break;case"img":case"image":case"link":Xe("error",e),Xe("load",e),u=o;break;case"details":Xe("toggle",e),u=o;break;case"input":Nt(e,o),u=$e(e,o),Xe("invalid",e);break;case"option":u=o;break;case"select":e._wrapperState={wasMultiple:!!o.multiple},u=X({},o,{value:void 0}),Xe("invalid",e);break;case"textarea":U(e,o),u=Yr(e,o),Xe("invalid",e);break;default:u=o}$o(s,u),P=u;for(h in P)if(P.hasOwnProperty(h)){var I=P[h];h==="style"?Ju(e,I):h==="dangerouslySetInnerHTML"?(I=I?I.__html:void 0,I!=null&&dt(e,I)):h==="children"?typeof I=="string"?(s!=="textarea"||I!=="")&&mn(e,I):typeof I=="number"&&mn(e,""+I):h!=="suppressContentEditableWarning"&&h!=="suppressHydrationWarning"&&h!=="autoFocus"&&(c.hasOwnProperty(h)?I!=null&&h==="onScroll"&&Xe("scroll",e):I!=null&&j(e,h,I,b))}switch(s){case"input":Te(e),Qr(e,o,!1);break;case"textarea":Te(e),lt(e);break;case"option":o.value!=null&&e.setAttribute("value",""+de(o.value));break;case"select":e.multiple=!!o.multiple,h=o.value,h!=null?hn(e,!!o.multiple,h,!1):o.defaultValue!=null&&hn(e,!!o.multiple,o.defaultValue,!0);break;default:typeof u.onClick=="function"&&(e.onclick=sl)}switch(s){case"button":case"input":case"select":case"textarea":o=!!o.autoFocus;break e;case"img":o=!0;break e;default:o=!1}}o&&(t.flags|=4)}t.ref!==null&&(t.flags|=512,t.flags|=2097152)}return Ct(t),null;case 6:if(e&&t.stateNode!=null)uh(e,t,e.memoizedProps,o);else{if(typeof o!="string"&&t.stateNode===null)throw Error(l(166));if(s=Ir(ma.current),Ir(gn.current),dl(t)){if(o=t.stateNode,s=t.memoizedProps,o[xn]=t,(h=o.nodeValue!==s)&&(e=Ft,e!==null))switch(e.tag){case 3:rl(o.nodeValue,s,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&rl(o.nodeValue,s,(e.mode&1)!==0)}h&&(t.flags|=4)}else o=(s.nodeType===9?s:s.ownerDocument).createTextNode(o),o[xn]=t,t.stateNode=o}return Ct(t),null;case 13:if(qe(tt),o=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(Je&&zt!==null&&(t.mode&1)!==0&&(t.flags&128)===0)hf(),us(),t.flags|=98560,h=!1;else if(h=dl(t),o!==null&&o.dehydrated!==null){if(e===null){if(!h)throw Error(l(318));if(h=t.memoizedState,h=h!==null?h.dehydrated:null,!h)throw Error(l(317));h[xn]=t}else us(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;Ct(t),h=!1}else tn!==null&&(gc(tn),tn=null),h=!0;if(!h)return t.flags&65536?t:null}return(t.flags&128)!==0?(t.lanes=s,t):(o=o!==null,o!==(e!==null&&e.memoizedState!==null)&&o&&(t.child.flags|=8192,(t.mode&1)!==0&&(e===null||(tt.current&1)!==0?ht===0&&(ht=3):wc())),t.updateQueue!==null&&(t.flags|=4),Ct(t),null);case 4:return ms(),lc(e,t),e===null&&oa(t.stateNode.containerInfo),Ct(t),null;case 10:return Mi(t.type._context),Ct(t),null;case 17:return Tt(t.type)&&ll(),Ct(t),null;case 19:if(qe(tt),h=t.memoizedState,h===null)return Ct(t),null;if(o=(t.flags&128)!==0,b=h.rendering,b===null)if(o)va(h,!1);else{if(ht!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(b=gl(e),b!==null){for(t.flags|=128,va(h,!1),o=b.updateQueue,o!==null&&(t.updateQueue=o,t.flags|=4),t.subtreeFlags=0,o=s,s=t.child;s!==null;)h=s,e=o,h.flags&=14680066,b=h.alternate,b===null?(h.childLanes=0,h.lanes=e,h.child=null,h.subtreeFlags=0,h.memoizedProps=null,h.memoizedState=null,h.updateQueue=null,h.dependencies=null,h.stateNode=null):(h.childLanes=b.childLanes,h.lanes=b.lanes,h.child=b.child,h.subtreeFlags=0,h.deletions=null,h.memoizedProps=b.memoizedProps,h.memoizedState=b.memoizedState,h.updateQueue=b.updateQueue,h.type=b.type,e=b.dependencies,h.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),s=s.sibling;return Qe(tt,tt.current&1|2),t.child}e=e.sibling}h.tail!==null&&ot()>ys&&(t.flags|=128,o=!0,va(h,!1),t.lanes=4194304)}else{if(!o)if(e=gl(b),e!==null){if(t.flags|=128,o=!0,s=e.updateQueue,s!==null&&(t.updateQueue=s,t.flags|=4),va(h,!0),h.tail===null&&h.tailMode==="hidden"&&!b.alternate&&!Je)return Ct(t),null}else 2*ot()-h.renderingStartTime>ys&&s!==1073741824&&(t.flags|=128,o=!0,va(h,!1),t.lanes=4194304);h.isBackwards?(b.sibling=t.child,t.child=b):(s=h.last,s!==null?s.sibling=b:t.child=b,h.last=b)}return h.tail!==null?(t=h.tail,h.rendering=t,h.tail=t.sibling,h.renderingStartTime=ot(),t.sibling=null,s=tt.current,Qe(tt,o?s&1|2:s&1),t):(Ct(t),null);case 22:case 23:return vc(),o=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==o&&(t.flags|=8192),o&&(t.mode&1)!==0?($t&1073741824)!==0&&(Ct(t),t.subtreeFlags&6&&(t.flags|=8192)):Ct(t),null;case 24:return null;case 25:return null}throw Error(l(156,t.tag))}function vy(e,t){switch(_i(t),t.tag){case 1:return Tt(t.type)&&ll(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return ms(),qe(Rt),qe(jt),Bi(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 5:return zi(t),null;case 13:if(qe(tt),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(l(340));us()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return qe(tt),null;case 4:return ms(),null;case 10:return Mi(t.type._context),null;case 22:case 23:return vc(),null;case 24:return null;default:return null}}var kl=!1,kt=!1,wy=typeof WeakSet=="function"?WeakSet:Set,he=null;function xs(e,t){var s=e.ref;if(s!==null)if(typeof s=="function")try{s(null)}catch(o){st(e,t,o)}else s.current=null}function oc(e,t,s){try{s()}catch(o){st(e,t,o)}}var dh=!1;function by(e,t){if(vi=Ka,e=Ud(),di(e)){if("selectionStart"in e)var s={start:e.selectionStart,end:e.selectionEnd};else e:{s=(s=e.ownerDocument)&&s.defaultView||window;var o=s.getSelection&&s.getSelection();if(o&&o.rangeCount!==0){s=o.anchorNode;var u=o.anchorOffset,h=o.focusNode;o=o.focusOffset;try{s.nodeType,h.nodeType}catch{s=null;break e}var b=0,P=-1,I=-1,$=0,J=0,Z=e,q=null;t:for(;;){for(var ie;Z!==s||u!==0&&Z.nodeType!==3||(P=b+u),Z!==h||o!==0&&Z.nodeType!==3||(I=b+o),Z.nodeType===3&&(b+=Z.nodeValue.length),(ie=Z.firstChild)!==null;)q=Z,Z=ie;for(;;){if(Z===e)break t;if(q===s&&++$===u&&(P=b),q===h&&++J===o&&(I=b),(ie=Z.nextSibling)!==null)break;Z=q,q=Z.parentNode}Z=ie}s=P===-1||I===-1?null:{start:P,end:I}}else s=null}s=s||{start:0,end:0}}else s=null;for(wi={focusedElem:e,selectionRange:s},Ka=!1,he=t;he!==null;)if(t=he,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,he=e;else for(;he!==null;){t=he;try{var pe=t.alternate;if((t.flags&1024)!==0)switch(t.tag){case 0:case 11:case 15:break;case 1:if(pe!==null){var ve=pe.memoizedProps,it=pe.memoizedState,D=t.stateNode,M=D.getSnapshotBeforeUpdate(t.elementType===t.type?ve:nn(t.type,ve),it);D.__reactInternalSnapshotBeforeUpdate=M}break;case 3:var F=t.stateNode.containerInfo;F.nodeType===1?F.textContent="":F.nodeType===9&&F.documentElement&&F.removeChild(F.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(l(163))}}catch(ne){st(t,t.return,ne)}if(e=t.sibling,e!==null){e.return=t.return,he=e;break}he=t.return}return pe=dh,dh=!1,pe}function wa(e,t,s){var o=t.updateQueue;if(o=o!==null?o.lastEffect:null,o!==null){var u=o=o.next;do{if((u.tag&e)===e){var h=u.destroy;u.destroy=void 0,h!==void 0&&oc(t,s,h)}u=u.next}while(u!==o)}}function El(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var s=t=t.next;do{if((s.tag&e)===e){var o=s.create;s.destroy=o()}s=s.next}while(s!==t)}}function ic(e){var t=e.ref;if(t!==null){var s=e.stateNode;switch(e.tag){case 5:e=s;break;default:e=s}typeof t=="function"?t(e):t.current=e}}function fh(e){var t=e.alternate;t!==null&&(e.alternate=null,fh(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[xn],delete t[ca],delete t[Si],delete t[ry],delete t[sy])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function hh(e){return e.tag===5||e.tag===3||e.tag===4}function mh(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||hh(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function cc(e,t,s){var o=e.tag;if(o===5||o===6)e=e.stateNode,t?s.nodeType===8?s.parentNode.insertBefore(e,t):s.insertBefore(e,t):(s.nodeType===8?(t=s.parentNode,t.insertBefore(e,s)):(t=s,t.appendChild(e)),s=s._reactRootContainer,s!=null||t.onclick!==null||(t.onclick=sl));else if(o!==4&&(e=e.child,e!==null))for(cc(e,t,s),e=e.sibling;e!==null;)cc(e,t,s),e=e.sibling}function uc(e,t,s){var o=e.tag;if(o===5||o===6)e=e.stateNode,t?s.insertBefore(e,t):s.appendChild(e);else if(o!==4&&(e=e.child,e!==null))for(uc(e,t,s),e=e.sibling;e!==null;)uc(e,t,s),e=e.sibling}var wt=null,rn=!1;function rr(e,t,s){for(s=s.child;s!==null;)ph(e,t,s),s=s.sibling}function ph(e,t,s){if(pn&&typeof pn.onCommitFiberUnmount=="function")try{pn.onCommitFiberUnmount($a,s)}catch{}switch(s.tag){case 5:kt||xs(s,t);case 6:var o=wt,u=rn;wt=null,rr(e,t,s),wt=o,rn=u,wt!==null&&(rn?(e=wt,s=s.stateNode,e.nodeType===8?e.parentNode.removeChild(s):e.removeChild(s)):wt.removeChild(s.stateNode));break;case 18:wt!==null&&(rn?(e=wt,s=s.stateNode,e.nodeType===8?ji(e.parentNode,s):e.nodeType===1&&ji(e,s),Js(e)):ji(wt,s.stateNode));break;case 4:o=wt,u=rn,wt=s.stateNode.containerInfo,rn=!0,rr(e,t,s),wt=o,rn=u;break;case 0:case 11:case 14:case 15:if(!kt&&(o=s.updateQueue,o!==null&&(o=o.lastEffect,o!==null))){u=o=o.next;do{var h=u,b=h.destroy;h=h.tag,b!==void 0&&((h&2)!==0||(h&4)!==0)&&oc(s,t,b),u=u.next}while(u!==o)}rr(e,t,s);break;case 1:if(!kt&&(xs(s,t),o=s.stateNode,typeof o.componentWillUnmount=="function"))try{o.props=s.memoizedProps,o.state=s.memoizedState,o.componentWillUnmount()}catch(P){st(s,t,P)}rr(e,t,s);break;case 21:rr(e,t,s);break;case 22:s.mode&1?(kt=(o=kt)||s.memoizedState!==null,rr(e,t,s),kt=o):rr(e,t,s);break;default:rr(e,t,s)}}function xh(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var s=e.stateNode;s===null&&(s=e.stateNode=new wy),t.forEach(function(o){var u=Ry.bind(null,e,o);s.has(o)||(s.add(o),o.then(u,u))})}}function sn(e,t){var s=t.deletions;if(s!==null)for(var o=0;o<s.length;o++){var u=s[o];try{var h=e,b=t,P=b;e:for(;P!==null;){switch(P.tag){case 5:wt=P.stateNode,rn=!1;break e;case 3:wt=P.stateNode.containerInfo,rn=!0;break e;case 4:wt=P.stateNode.containerInfo,rn=!0;break e}P=P.return}if(wt===null)throw Error(l(160));ph(h,b,u),wt=null,rn=!1;var I=u.alternate;I!==null&&(I.return=null),u.return=null}catch($){st(u,t,$)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)gh(t,e),t=t.sibling}function gh(e,t){var s=e.alternate,o=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(sn(t,e),vn(e),o&4){try{wa(3,e,e.return),El(3,e)}catch(ve){st(e,e.return,ve)}try{wa(5,e,e.return)}catch(ve){st(e,e.return,ve)}}break;case 1:sn(t,e),vn(e),o&512&&s!==null&&xs(s,s.return);break;case 5:if(sn(t,e),vn(e),o&512&&s!==null&&xs(s,s.return),e.flags&32){var u=e.stateNode;try{mn(u,"")}catch(ve){st(e,e.return,ve)}}if(o&4&&(u=e.stateNode,u!=null)){var h=e.memoizedProps,b=s!==null?s.memoizedProps:h,P=e.type,I=e.updateQueue;if(e.updateQueue=null,I!==null)try{P==="input"&&h.type==="radio"&&h.name!=null&&Vt(u,h),Bo(P,b);var $=Bo(P,h);for(b=0;b<I.length;b+=2){var J=I[b],Z=I[b+1];J==="style"?Ju(u,Z):J==="dangerouslySetInnerHTML"?dt(u,Z):J==="children"?mn(u,Z):j(u,J,Z,$)}switch(P){case"input":Jt(u,h);break;case"textarea":ce(u,h);break;case"select":var q=u._wrapperState.wasMultiple;u._wrapperState.wasMultiple=!!h.multiple;var ie=h.value;ie!=null?hn(u,!!h.multiple,ie,!1):q!==!!h.multiple&&(h.defaultValue!=null?hn(u,!!h.multiple,h.defaultValue,!0):hn(u,!!h.multiple,h.multiple?[]:"",!1))}u[ca]=h}catch(ve){st(e,e.return,ve)}}break;case 6:if(sn(t,e),vn(e),o&4){if(e.stateNode===null)throw Error(l(162));u=e.stateNode,h=e.memoizedProps;try{u.nodeValue=h}catch(ve){st(e,e.return,ve)}}break;case 3:if(sn(t,e),vn(e),o&4&&s!==null&&s.memoizedState.isDehydrated)try{Js(t.containerInfo)}catch(ve){st(e,e.return,ve)}break;case 4:sn(t,e),vn(e);break;case 13:sn(t,e),vn(e),u=e.child,u.flags&8192&&(h=u.memoizedState!==null,u.stateNode.isHidden=h,!h||u.alternate!==null&&u.alternate.memoizedState!==null||(hc=ot())),o&4&&xh(e);break;case 22:if(J=s!==null&&s.memoizedState!==null,e.mode&1?(kt=($=kt)||J,sn(t,e),kt=$):sn(t,e),vn(e),o&8192){if($=e.memoizedState!==null,(e.stateNode.isHidden=$)&&!J&&(e.mode&1)!==0)for(he=e,J=e.child;J!==null;){for(Z=he=J;he!==null;){switch(q=he,ie=q.child,q.tag){case 0:case 11:case 14:case 15:wa(4,q,q.return);break;case 1:xs(q,q.return);var pe=q.stateNode;if(typeof pe.componentWillUnmount=="function"){o=q,s=q.return;try{t=o,pe.props=t.memoizedProps,pe.state=t.memoizedState,pe.componentWillUnmount()}catch(ve){st(o,s,ve)}}break;case 5:xs(q,q.return);break;case 22:if(q.memoizedState!==null){wh(Z);continue}}ie!==null?(ie.return=q,he=ie):wh(Z)}J=J.sibling}e:for(J=null,Z=e;;){if(Z.tag===5){if(J===null){J=Z;try{u=Z.stateNode,$?(h=u.style,typeof h.setProperty=="function"?h.setProperty("display","none","important"):h.display="none"):(P=Z.stateNode,I=Z.memoizedProps.style,b=I!=null&&I.hasOwnProperty("display")?I.display:null,P.style.display=qu("display",b))}catch(ve){st(e,e.return,ve)}}}else if(Z.tag===6){if(J===null)try{Z.stateNode.nodeValue=$?"":Z.memoizedProps}catch(ve){st(e,e.return,ve)}}else if((Z.tag!==22&&Z.tag!==23||Z.memoizedState===null||Z===e)&&Z.child!==null){Z.child.return=Z,Z=Z.child;continue}if(Z===e)break e;for(;Z.sibling===null;){if(Z.return===null||Z.return===e)break e;J===Z&&(J=null),Z=Z.return}J===Z&&(J=null),Z.sibling.return=Z.return,Z=Z.sibling}}break;case 19:sn(t,e),vn(e),o&4&&xh(e);break;case 21:break;default:sn(t,e),vn(e)}}function vn(e){var t=e.flags;if(t&2){try{e:{for(var s=e.return;s!==null;){if(hh(s)){var o=s;break e}s=s.return}throw Error(l(160))}switch(o.tag){case 5:var u=o.stateNode;o.flags&32&&(mn(u,""),o.flags&=-33);var h=mh(e);uc(e,h,u);break;case 3:case 4:var b=o.stateNode.containerInfo,P=mh(e);cc(e,P,b);break;default:throw Error(l(161))}}catch(I){st(e,e.return,I)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Ny(e,t,s){he=e,yh(e)}function yh(e,t,s){for(var o=(e.mode&1)!==0;he!==null;){var u=he,h=u.child;if(u.tag===22&&o){var b=u.memoizedState!==null||kl;if(!b){var P=u.alternate,I=P!==null&&P.memoizedState!==null||kt;P=kl;var $=kt;if(kl=b,(kt=I)&&!$)for(he=u;he!==null;)b=he,I=b.child,b.tag===22&&b.memoizedState!==null?bh(u):I!==null?(I.return=b,he=I):bh(u);for(;h!==null;)he=h,yh(h),h=h.sibling;he=u,kl=P,kt=$}vh(e)}else(u.subtreeFlags&8772)!==0&&h!==null?(h.return=u,he=h):vh(e)}}function vh(e){for(;he!==null;){var t=he;if((t.flags&8772)!==0){var s=t.alternate;try{if((t.flags&8772)!==0)switch(t.tag){case 0:case 11:case 15:kt||El(5,t);break;case 1:var o=t.stateNode;if(t.flags&4&&!kt)if(s===null)o.componentDidMount();else{var u=t.elementType===t.type?s.memoizedProps:nn(t.type,s.memoizedProps);o.componentDidUpdate(u,s.memoizedState,o.__reactInternalSnapshotBeforeUpdate)}var h=t.updateQueue;h!==null&&wf(t,h,o);break;case 3:var b=t.updateQueue;if(b!==null){if(s=null,t.child!==null)switch(t.child.tag){case 5:s=t.child.stateNode;break;case 1:s=t.child.stateNode}wf(t,b,s)}break;case 5:var P=t.stateNode;if(s===null&&t.flags&4){s=P;var I=t.memoizedProps;switch(t.type){case"button":case"input":case"select":case"textarea":I.autoFocus&&s.focus();break;case"img":I.src&&(s.src=I.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(t.memoizedState===null){var $=t.alternate;if($!==null){var J=$.memoizedState;if(J!==null){var Z=J.dehydrated;Z!==null&&Js(Z)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(l(163))}kt||t.flags&512&&ic(t)}catch(q){st(t,t.return,q)}}if(t===e){he=null;break}if(s=t.sibling,s!==null){s.return=t.return,he=s;break}he=t.return}}function wh(e){for(;he!==null;){var t=he;if(t===e){he=null;break}var s=t.sibling;if(s!==null){s.return=t.return,he=s;break}he=t.return}}function bh(e){for(;he!==null;){var t=he;try{switch(t.tag){case 0:case 11:case 15:var s=t.return;try{El(4,t)}catch(I){st(t,s,I)}break;case 1:var o=t.stateNode;if(typeof o.componentDidMount=="function"){var u=t.return;try{o.componentDidMount()}catch(I){st(t,u,I)}}var h=t.return;try{ic(t)}catch(I){st(t,h,I)}break;case 5:var b=t.return;try{ic(t)}catch(I){st(t,b,I)}}}catch(I){st(t,t.return,I)}if(t===e){he=null;break}var P=t.sibling;if(P!==null){P.return=t.return,he=P;break}he=t.return}}var jy=Math.ceil,_l=A.ReactCurrentDispatcher,dc=A.ReactCurrentOwner,Qt=A.ReactCurrentBatchConfig,Fe=0,xt=null,ut=null,bt=0,$t=0,gs=Jn(0),ht=0,ba=null,Mr=0,Pl=0,fc=0,Na=null,At=null,hc=0,ys=1/0,An=null,Rl=!1,mc=null,sr=null,Tl=!1,ar=null,Il=0,ja=0,pc=null,Al=-1,Ml=0;function Pt(){return(Fe&6)!==0?ot():Al!==-1?Al:Al=ot()}function lr(e){return(e.mode&1)===0?1:(Fe&2)!==0&&bt!==0?bt&-bt:ly.transition!==null?(Ml===0&&(Ml=hd()),Ml):(e=Ke,e!==0||(e=window.event,e=e===void 0?16:Nd(e.type)),e)}function an(e,t,s,o){if(50<ja)throw ja=0,pc=null,Error(l(185));Gs(e,s,o),((Fe&2)===0||e!==xt)&&(e===xt&&((Fe&2)===0&&(Pl|=s),ht===4&&or(e,bt)),Mt(e,o),s===1&&Fe===0&&(t.mode&1)===0&&(ys=ot()+500,il&&er()))}function Mt(e,t){var s=e.callbackNode;l0(e,t);var o=Va(e,e===xt?bt:0);if(o===0)s!==null&&ud(s),e.callbackNode=null,e.callbackPriority=0;else if(t=o&-o,e.callbackPriority!==t){if(s!=null&&ud(s),t===1)e.tag===0?ay(jh.bind(null,e)):of(jh.bind(null,e)),ty(function(){(Fe&6)===0&&er()}),s=null;else{switch(md(o)){case 1:s=Qo;break;case 4:s=dd;break;case 16:s=za;break;case 536870912:s=fd;break;default:s=za}s=Th(s,Nh.bind(null,e))}e.callbackPriority=t,e.callbackNode=s}}function Nh(e,t){if(Al=-1,Ml=0,(Fe&6)!==0)throw Error(l(327));var s=e.callbackNode;if(vs()&&e.callbackNode!==s)return null;var o=Va(e,e===xt?bt:0);if(o===0)return null;if((o&30)!==0||(o&e.expiredLanes)!==0||t)t=Ll(e,o);else{t=o;var u=Fe;Fe|=2;var h=Ch();(xt!==e||bt!==t)&&(An=null,ys=ot()+500,Dr(e,t));do try{ky();break}catch(P){Sh(e,P)}while(!0);Ai(),_l.current=h,Fe=u,ut!==null?t=0:(xt=null,bt=0,t=ht)}if(t!==0){if(t===2&&(u=Yo(e),u!==0&&(o=u,t=xc(e,u))),t===1)throw s=ba,Dr(e,0),or(e,o),Mt(e,ot()),s;if(t===6)or(e,o);else{if(u=e.current.alternate,(o&30)===0&&!Sy(u)&&(t=Ll(e,o),t===2&&(h=Yo(e),h!==0&&(o=h,t=xc(e,h))),t===1))throw s=ba,Dr(e,0),or(e,o),Mt(e,ot()),s;switch(e.finishedWork=u,e.finishedLanes=o,t){case 0:case 1:throw Error(l(345));case 2:Or(e,At,An);break;case 3:if(or(e,o),(o&130023424)===o&&(t=hc+500-ot(),10<t)){if(Va(e,0)!==0)break;if(u=e.suspendedLanes,(u&o)!==o){Pt(),e.pingedLanes|=e.suspendedLanes&u;break}e.timeoutHandle=Ni(Or.bind(null,e,At,An),t);break}Or(e,At,An);break;case 4:if(or(e,o),(o&4194240)===o)break;for(t=e.eventTimes,u=-1;0<o;){var b=31-Zt(o);h=1<<b,b=t[b],b>u&&(u=b),o&=~h}if(o=u,o=ot()-o,o=(120>o?120:480>o?480:1080>o?1080:1920>o?1920:3e3>o?3e3:4320>o?4320:1960*jy(o/1960))-o,10<o){e.timeoutHandle=Ni(Or.bind(null,e,At,An),o);break}Or(e,At,An);break;case 5:Or(e,At,An);break;default:throw Error(l(329))}}}return Mt(e,ot()),e.callbackNode===s?Nh.bind(null,e):null}function xc(e,t){var s=Na;return e.current.memoizedState.isDehydrated&&(Dr(e,t).flags|=256),e=Ll(e,t),e!==2&&(t=At,At=s,t!==null&&gc(t)),e}function gc(e){At===null?At=e:At.push.apply(At,e)}function Sy(e){for(var t=e;;){if(t.flags&16384){var s=t.updateQueue;if(s!==null&&(s=s.stores,s!==null))for(var o=0;o<s.length;o++){var u=s[o],h=u.getSnapshot;u=u.value;try{if(!en(h(),u))return!1}catch{return!1}}}if(s=t.child,t.subtreeFlags&16384&&s!==null)s.return=t,t=s;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function or(e,t){for(t&=~fc,t&=~Pl,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var s=31-Zt(t),o=1<<s;e[s]=-1,t&=~o}}function jh(e){if((Fe&6)!==0)throw Error(l(327));vs();var t=Va(e,0);if((t&1)===0)return Mt(e,ot()),null;var s=Ll(e,t);if(e.tag!==0&&s===2){var o=Yo(e);o!==0&&(t=o,s=xc(e,o))}if(s===1)throw s=ba,Dr(e,0),or(e,t),Mt(e,ot()),s;if(s===6)throw Error(l(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,Or(e,At,An),Mt(e,ot()),null}function yc(e,t){var s=Fe;Fe|=1;try{return e(t)}finally{Fe=s,Fe===0&&(ys=ot()+500,il&&er())}}function Lr(e){ar!==null&&ar.tag===0&&(Fe&6)===0&&vs();var t=Fe;Fe|=1;var s=Qt.transition,o=Ke;try{if(Qt.transition=null,Ke=1,e)return e()}finally{Ke=o,Qt.transition=s,Fe=t,(Fe&6)===0&&er()}}function vc(){$t=gs.current,qe(gs)}function Dr(e,t){e.finishedWork=null,e.finishedLanes=0;var s=e.timeoutHandle;if(s!==-1&&(e.timeoutHandle=-1,ey(s)),ut!==null)for(s=ut.return;s!==null;){var o=s;switch(_i(o),o.tag){case 1:o=o.type.childContextTypes,o!=null&&ll();break;case 3:ms(),qe(Rt),qe(jt),Bi();break;case 5:zi(o);break;case 4:ms();break;case 13:qe(tt);break;case 19:qe(tt);break;case 10:Mi(o.type._context);break;case 22:case 23:vc()}s=s.return}if(xt=e,ut=e=ir(e.current,null),bt=$t=t,ht=0,ba=null,fc=Pl=Mr=0,At=Na=null,Tr!==null){for(t=0;t<Tr.length;t++)if(s=Tr[t],o=s.interleaved,o!==null){s.interleaved=null;var u=o.next,h=s.pending;if(h!==null){var b=h.next;h.next=u,o.next=b}s.pending=o}Tr=null}return e}function Sh(e,t){do{var s=ut;try{if(Ai(),yl.current=Nl,vl){for(var o=nt.memoizedState;o!==null;){var u=o.queue;u!==null&&(u.pending=null),o=o.next}vl=!1}if(Ar=0,pt=ft=nt=null,pa=!1,xa=0,dc.current=null,s===null||s.return===null){ht=1,ba=t,ut=null;break}e:{var h=e,b=s.return,P=s,I=t;if(t=bt,P.flags|=32768,I!==null&&typeof I=="object"&&typeof I.then=="function"){var $=I,J=P,Z=J.tag;if((J.mode&1)===0&&(Z===0||Z===11||Z===15)){var q=J.alternate;q?(J.updateQueue=q.updateQueue,J.memoizedState=q.memoizedState,J.lanes=q.lanes):(J.updateQueue=null,J.memoizedState=null)}var ie=Yf(b);if(ie!==null){ie.flags&=-257,Xf(ie,b,P,h,t),ie.mode&1&&Qf(h,$,t),t=ie,I=$;var pe=t.updateQueue;if(pe===null){var ve=new Set;ve.add(I),t.updateQueue=ve}else pe.add(I);break e}else{if((t&1)===0){Qf(h,$,t),wc();break e}I=Error(l(426))}}else if(Je&&P.mode&1){var it=Yf(b);if(it!==null){(it.flags&65536)===0&&(it.flags|=256),Xf(it,b,P,h,t),Ti(ps(I,P));break e}}h=I=ps(I,P),ht!==4&&(ht=2),Na===null?Na=[h]:Na.push(h),h=b;do{switch(h.tag){case 3:h.flags|=65536,t&=-t,h.lanes|=t;var D=Kf(h,I,t);vf(h,D);break e;case 1:P=I;var M=h.type,F=h.stateNode;if((h.flags&128)===0&&(typeof M.getDerivedStateFromError=="function"||F!==null&&typeof F.componentDidCatch=="function"&&(sr===null||!sr.has(F)))){h.flags|=65536,t&=-t,h.lanes|=t;var ne=Gf(h,P,t);vf(h,ne);break e}}h=h.return}while(h!==null)}Eh(s)}catch(we){t=we,ut===s&&s!==null&&(ut=s=s.return);continue}break}while(!0)}function Ch(){var e=_l.current;return _l.current=Nl,e===null?Nl:e}function wc(){(ht===0||ht===3||ht===2)&&(ht=4),xt===null||(Mr&268435455)===0&&(Pl&268435455)===0||or(xt,bt)}function Ll(e,t){var s=Fe;Fe|=2;var o=Ch();(xt!==e||bt!==t)&&(An=null,Dr(e,t));do try{Cy();break}catch(u){Sh(e,u)}while(!0);if(Ai(),Fe=s,_l.current=o,ut!==null)throw Error(l(261));return xt=null,bt=0,ht}function Cy(){for(;ut!==null;)kh(ut)}function ky(){for(;ut!==null&&!qg();)kh(ut)}function kh(e){var t=Rh(e.alternate,e,$t);e.memoizedProps=e.pendingProps,t===null?Eh(e):ut=t,dc.current=null}function Eh(e){var t=e;do{var s=t.alternate;if(e=t.return,(t.flags&32768)===0){if(s=yy(s,t,$t),s!==null){ut=s;return}}else{if(s=vy(s,t),s!==null){s.flags&=32767,ut=s;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{ht=6,ut=null;return}}if(t=t.sibling,t!==null){ut=t;return}ut=t=e}while(t!==null);ht===0&&(ht=5)}function Or(e,t,s){var o=Ke,u=Qt.transition;try{Qt.transition=null,Ke=1,Ey(e,t,s,o)}finally{Qt.transition=u,Ke=o}return null}function Ey(e,t,s,o){do vs();while(ar!==null);if((Fe&6)!==0)throw Error(l(327));s=e.finishedWork;var u=e.finishedLanes;if(s===null)return null;if(e.finishedWork=null,e.finishedLanes=0,s===e.current)throw Error(l(177));e.callbackNode=null,e.callbackPriority=0;var h=s.lanes|s.childLanes;if(o0(e,h),e===xt&&(ut=xt=null,bt=0),(s.subtreeFlags&2064)===0&&(s.flags&2064)===0||Tl||(Tl=!0,Th(za,function(){return vs(),null})),h=(s.flags&15990)!==0,(s.subtreeFlags&15990)!==0||h){h=Qt.transition,Qt.transition=null;var b=Ke;Ke=1;var P=Fe;Fe|=4,dc.current=null,by(e,s),gh(s,e),G0(wi),Ka=!!vi,wi=vi=null,e.current=s,Ny(s),Jg(),Fe=P,Ke=b,Qt.transition=h}else e.current=s;if(Tl&&(Tl=!1,ar=e,Il=u),h=e.pendingLanes,h===0&&(sr=null),t0(s.stateNode),Mt(e,ot()),t!==null)for(o=e.onRecoverableError,s=0;s<t.length;s++)u=t[s],o(u.value,{componentStack:u.stack,digest:u.digest});if(Rl)throw Rl=!1,e=mc,mc=null,e;return(Il&1)!==0&&e.tag!==0&&vs(),h=e.pendingLanes,(h&1)!==0?e===pc?ja++:(ja=0,pc=e):ja=0,er(),null}function vs(){if(ar!==null){var e=md(Il),t=Qt.transition,s=Ke;try{if(Qt.transition=null,Ke=16>e?16:e,ar===null)var o=!1;else{if(e=ar,ar=null,Il=0,(Fe&6)!==0)throw Error(l(331));var u=Fe;for(Fe|=4,he=e.current;he!==null;){var h=he,b=h.child;if((he.flags&16)!==0){var P=h.deletions;if(P!==null){for(var I=0;I<P.length;I++){var $=P[I];for(he=$;he!==null;){var J=he;switch(J.tag){case 0:case 11:case 15:wa(8,J,h)}var Z=J.child;if(Z!==null)Z.return=J,he=Z;else for(;he!==null;){J=he;var q=J.sibling,ie=J.return;if(fh(J),J===$){he=null;break}if(q!==null){q.return=ie,he=q;break}he=ie}}}var pe=h.alternate;if(pe!==null){var ve=pe.child;if(ve!==null){pe.child=null;do{var it=ve.sibling;ve.sibling=null,ve=it}while(ve!==null)}}he=h}}if((h.subtreeFlags&2064)!==0&&b!==null)b.return=h,he=b;else e:for(;he!==null;){if(h=he,(h.flags&2048)!==0)switch(h.tag){case 0:case 11:case 15:wa(9,h,h.return)}var D=h.sibling;if(D!==null){D.return=h.return,he=D;break e}he=h.return}}var M=e.current;for(he=M;he!==null;){b=he;var F=b.child;if((b.subtreeFlags&2064)!==0&&F!==null)F.return=b,he=F;else e:for(b=M;he!==null;){if(P=he,(P.flags&2048)!==0)try{switch(P.tag){case 0:case 11:case 15:El(9,P)}}catch(we){st(P,P.return,we)}if(P===b){he=null;break e}var ne=P.sibling;if(ne!==null){ne.return=P.return,he=ne;break e}he=P.return}}if(Fe=u,er(),pn&&typeof pn.onPostCommitFiberRoot=="function")try{pn.onPostCommitFiberRoot($a,e)}catch{}o=!0}return o}finally{Ke=s,Qt.transition=t}}return!1}function _h(e,t,s){t=ps(s,t),t=Kf(e,t,1),e=nr(e,t,1),t=Pt(),e!==null&&(Gs(e,1,t),Mt(e,t))}function st(e,t,s){if(e.tag===3)_h(e,e,s);else for(;t!==null;){if(t.tag===3){_h(t,e,s);break}else if(t.tag===1){var o=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof o.componentDidCatch=="function"&&(sr===null||!sr.has(o))){e=ps(s,e),e=Gf(t,e,1),t=nr(t,e,1),e=Pt(),t!==null&&(Gs(t,1,e),Mt(t,e));break}}t=t.return}}function _y(e,t,s){var o=e.pingCache;o!==null&&o.delete(t),t=Pt(),e.pingedLanes|=e.suspendedLanes&s,xt===e&&(bt&s)===s&&(ht===4||ht===3&&(bt&130023424)===bt&&500>ot()-hc?Dr(e,0):fc|=s),Mt(e,t)}function Ph(e,t){t===0&&((e.mode&1)===0?t=1:(t=Ua,Ua<<=1,(Ua&130023424)===0&&(Ua=4194304)));var s=Pt();e=Rn(e,t),e!==null&&(Gs(e,t,s),Mt(e,s))}function Py(e){var t=e.memoizedState,s=0;t!==null&&(s=t.retryLane),Ph(e,s)}function Ry(e,t){var s=0;switch(e.tag){case 13:var o=e.stateNode,u=e.memoizedState;u!==null&&(s=u.retryLane);break;case 19:o=e.stateNode;break;default:throw Error(l(314))}o!==null&&o.delete(t),Ph(e,s)}var Rh;Rh=function(e,t,s){if(e!==null)if(e.memoizedProps!==t.pendingProps||Rt.current)It=!0;else{if((e.lanes&s)===0&&(t.flags&128)===0)return It=!1,gy(e,t,s);It=(e.flags&131072)!==0}else It=!1,Je&&(t.flags&1048576)!==0&&cf(t,ul,t.index);switch(t.lanes=0,t.tag){case 2:var o=t.type;Cl(e,t),e=t.pendingProps;var u=os(t,jt.current);hs(t,s),u=Wi(null,t,o,e,u,s);var h=Hi();return t.flags|=1,typeof u=="object"&&u!==null&&typeof u.render=="function"&&u.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,Tt(o)?(h=!0,ol(t)):h=!1,t.memoizedState=u.state!==null&&u.state!==void 0?u.state:null,Oi(t),u.updater=jl,t.stateNode=u,u._reactInternals=t,qi(t,o,e,s),t=tc(null,t,o,!0,h,s)):(t.tag=0,Je&&h&&Ei(t),_t(null,t,u,s),t=t.child),t;case 16:o=t.elementType;e:{switch(Cl(e,t),e=t.pendingProps,u=o._init,o=u(o._payload),t.type=o,u=t.tag=Iy(o),e=nn(o,e),u){case 0:t=ec(null,t,o,e,s);break e;case 1:t=nh(null,t,o,e,s);break e;case 11:t=qf(null,t,o,e,s);break e;case 14:t=Jf(null,t,o,nn(o.type,e),s);break e}throw Error(l(306,o,""))}return t;case 0:return o=t.type,u=t.pendingProps,u=t.elementType===o?u:nn(o,u),ec(e,t,o,u,s);case 1:return o=t.type,u=t.pendingProps,u=t.elementType===o?u:nn(o,u),nh(e,t,o,u,s);case 3:e:{if(rh(t),e===null)throw Error(l(387));o=t.pendingProps,h=t.memoizedState,u=h.element,yf(e,t),xl(t,o,null,s);var b=t.memoizedState;if(o=b.element,h.isDehydrated)if(h={element:o,isDehydrated:!1,cache:b.cache,pendingSuspenseBoundaries:b.pendingSuspenseBoundaries,transitions:b.transitions},t.updateQueue.baseState=h,t.memoizedState=h,t.flags&256){u=ps(Error(l(423)),t),t=sh(e,t,o,s,u);break e}else if(o!==u){u=ps(Error(l(424)),t),t=sh(e,t,o,s,u);break e}else for(zt=qn(t.stateNode.containerInfo.firstChild),Ft=t,Je=!0,tn=null,s=xf(t,null,o,s),t.child=s;s;)s.flags=s.flags&-3|4096,s=s.sibling;else{if(us(),o===u){t=In(e,t,s);break e}_t(e,t,o,s)}t=t.child}return t;case 5:return bf(t),e===null&&Ri(t),o=t.type,u=t.pendingProps,h=e!==null?e.memoizedProps:null,b=u.children,bi(o,u)?b=null:h!==null&&bi(o,h)&&(t.flags|=32),th(e,t),_t(e,t,b,s),t.child;case 6:return e===null&&Ri(t),null;case 13:return ah(e,t,s);case 4:return Fi(t,t.stateNode.containerInfo),o=t.pendingProps,e===null?t.child=ds(t,null,o,s):_t(e,t,o,s),t.child;case 11:return o=t.type,u=t.pendingProps,u=t.elementType===o?u:nn(o,u),qf(e,t,o,u,s);case 7:return _t(e,t,t.pendingProps,s),t.child;case 8:return _t(e,t,t.pendingProps.children,s),t.child;case 12:return _t(e,t,t.pendingProps.children,s),t.child;case 10:e:{if(o=t.type._context,u=t.pendingProps,h=t.memoizedProps,b=u.value,Qe(hl,o._currentValue),o._currentValue=b,h!==null)if(en(h.value,b)){if(h.children===u.children&&!Rt.current){t=In(e,t,s);break e}}else for(h=t.child,h!==null&&(h.return=t);h!==null;){var P=h.dependencies;if(P!==null){b=h.child;for(var I=P.firstContext;I!==null;){if(I.context===o){if(h.tag===1){I=Tn(-1,s&-s),I.tag=2;var $=h.updateQueue;if($!==null){$=$.shared;var J=$.pending;J===null?I.next=I:(I.next=J.next,J.next=I),$.pending=I}}h.lanes|=s,I=h.alternate,I!==null&&(I.lanes|=s),Li(h.return,s,t),P.lanes|=s;break}I=I.next}}else if(h.tag===10)b=h.type===t.type?null:h.child;else if(h.tag===18){if(b=h.return,b===null)throw Error(l(341));b.lanes|=s,P=b.alternate,P!==null&&(P.lanes|=s),Li(b,s,t),b=h.sibling}else b=h.child;if(b!==null)b.return=h;else for(b=h;b!==null;){if(b===t){b=null;break}if(h=b.sibling,h!==null){h.return=b.return,b=h;break}b=b.return}h=b}_t(e,t,u.children,s),t=t.child}return t;case 9:return u=t.type,o=t.pendingProps.children,hs(t,s),u=Kt(u),o=o(u),t.flags|=1,_t(e,t,o,s),t.child;case 14:return o=t.type,u=nn(o,t.pendingProps),u=nn(o.type,u),Jf(e,t,o,u,s);case 15:return Zf(e,t,t.type,t.pendingProps,s);case 17:return o=t.type,u=t.pendingProps,u=t.elementType===o?u:nn(o,u),Cl(e,t),t.tag=1,Tt(o)?(e=!0,ol(t)):e=!1,hs(t,s),Wf(t,o,u),qi(t,o,u,s),tc(null,t,o,!0,e,s);case 19:return oh(e,t,s);case 22:return eh(e,t,s)}throw Error(l(156,t.tag))};function Th(e,t){return cd(e,t)}function Ty(e,t,s,o){this.tag=e,this.key=s,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=o,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Yt(e,t,s,o){return new Ty(e,t,s,o)}function bc(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Iy(e){if(typeof e=="function")return bc(e)?1:0;if(e!=null){if(e=e.$$typeof,e===fe)return 11;if(e===G)return 14}return 2}function ir(e,t){var s=e.alternate;return s===null?(s=Yt(e.tag,t,e.key,e.mode),s.elementType=e.elementType,s.type=e.type,s.stateNode=e.stateNode,s.alternate=e,e.alternate=s):(s.pendingProps=t,s.type=e.type,s.flags=0,s.subtreeFlags=0,s.deletions=null),s.flags=e.flags&14680064,s.childLanes=e.childLanes,s.lanes=e.lanes,s.child=e.child,s.memoizedProps=e.memoizedProps,s.memoizedState=e.memoizedState,s.updateQueue=e.updateQueue,t=e.dependencies,s.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},s.sibling=e.sibling,s.index=e.index,s.ref=e.ref,s}function Dl(e,t,s,o,u,h){var b=2;if(o=e,typeof e=="function")bc(e)&&(b=1);else if(typeof e=="string")b=5;else e:switch(e){case W:return Fr(s.children,u,h,t);case V:b=8,u|=8;break;case le:return e=Yt(12,s,t,u|2),e.elementType=le,e.lanes=h,e;case T:return e=Yt(13,s,t,u),e.elementType=T,e.lanes=h,e;case se:return e=Yt(19,s,t,u),e.elementType=se,e.lanes=h,e;case O:return Ol(s,u,h,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case me:b=10;break e;case oe:b=9;break e;case fe:b=11;break e;case G:b=14;break e;case Q:b=16,o=null;break e}throw Error(l(130,e==null?e:typeof e,""))}return t=Yt(b,s,t,u),t.elementType=e,t.type=o,t.lanes=h,t}function Fr(e,t,s,o){return e=Yt(7,e,o,t),e.lanes=s,e}function Ol(e,t,s,o){return e=Yt(22,e,o,t),e.elementType=O,e.lanes=s,e.stateNode={isHidden:!1},e}function Nc(e,t,s){return e=Yt(6,e,null,t),e.lanes=s,e}function jc(e,t,s){return t=Yt(4,e.children!==null?e.children:[],e.key,t),t.lanes=s,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function Ay(e,t,s,o,u){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Xo(0),this.expirationTimes=Xo(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Xo(0),this.identifierPrefix=o,this.onRecoverableError=u,this.mutableSourceEagerHydrationData=null}function Sc(e,t,s,o,u,h,b,P,I){return e=new Ay(e,t,s,P,I),t===1?(t=1,h===!0&&(t|=8)):t=0,h=Yt(3,null,null,t),e.current=h,h.stateNode=e,h.memoizedState={element:o,isDehydrated:s,cache:null,transitions:null,pendingSuspenseBoundaries:null},Oi(h),e}function My(e,t,s){var o=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:K,key:o==null?null:""+o,children:e,containerInfo:t,implementation:s}}function Ih(e){if(!e)return Zn;e=e._reactInternals;e:{if(kr(e)!==e||e.tag!==1)throw Error(l(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(Tt(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(t!==null);throw Error(l(171))}if(e.tag===1){var s=e.type;if(Tt(s))return af(e,s,t)}return t}function Ah(e,t,s,o,u,h,b,P,I){return e=Sc(s,o,!0,e,u,h,b,P,I),e.context=Ih(null),s=e.current,o=Pt(),u=lr(s),h=Tn(o,u),h.callback=t??null,nr(s,h,u),e.current.lanes=u,Gs(e,u,o),Mt(e,o),e}function Fl(e,t,s,o){var u=t.current,h=Pt(),b=lr(u);return s=Ih(s),t.context===null?t.context=s:t.pendingContext=s,t=Tn(h,b),t.payload={element:e},o=o===void 0?null:o,o!==null&&(t.callback=o),e=nr(u,t,b),e!==null&&(an(e,u,b,h),pl(e,u,b)),b}function zl(e){if(e=e.current,!e.child)return null;switch(e.child.tag){case 5:return e.child.stateNode;default:return e.child.stateNode}}function Mh(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var s=e.retryLane;e.retryLane=s!==0&&s<t?s:t}}function Cc(e,t){Mh(e,t),(e=e.alternate)&&Mh(e,t)}function Ly(){return null}var Lh=typeof reportError=="function"?reportError:function(e){console.error(e)};function kc(e){this._internalRoot=e}$l.prototype.render=kc.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(l(409));Fl(e,t,null,null)},$l.prototype.unmount=kc.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;Lr(function(){Fl(null,e,null,null)}),t[kn]=null}};function $l(e){this._internalRoot=e}$l.prototype.unstable_scheduleHydration=function(e){if(e){var t=gd();e={blockedOn:null,target:e,priority:t};for(var s=0;s<Qn.length&&t!==0&&t<Qn[s].priority;s++);Qn.splice(s,0,e),s===0&&wd(e)}};function Ec(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function Bl(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function Dh(){}function Dy(e,t,s,o,u){if(u){if(typeof o=="function"){var h=o;o=function(){var $=zl(b);h.call($)}}var b=Ah(t,o,e,0,null,!1,!1,"",Dh);return e._reactRootContainer=b,e[kn]=b.current,oa(e.nodeType===8?e.parentNode:e),Lr(),b}for(;u=e.lastChild;)e.removeChild(u);if(typeof o=="function"){var P=o;o=function(){var $=zl(I);P.call($)}}var I=Sc(e,0,!1,null,null,!1,!1,"",Dh);return e._reactRootContainer=I,e[kn]=I.current,oa(e.nodeType===8?e.parentNode:e),Lr(function(){Fl(t,I,s,o)}),I}function Ul(e,t,s,o,u){var h=s._reactRootContainer;if(h){var b=h;if(typeof u=="function"){var P=u;u=function(){var I=zl(b);P.call(I)}}Fl(t,b,e,u)}else b=Dy(s,t,e,u,o);return zl(b)}pd=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var s=Ks(t.pendingLanes);s!==0&&(qo(t,s|1),Mt(t,ot()),(Fe&6)===0&&(ys=ot()+500,er()))}break;case 13:Lr(function(){var o=Rn(e,1);if(o!==null){var u=Pt();an(o,e,1,u)}}),Cc(e,1)}},Jo=function(e){if(e.tag===13){var t=Rn(e,134217728);if(t!==null){var s=Pt();an(t,e,134217728,s)}Cc(e,134217728)}},xd=function(e){if(e.tag===13){var t=lr(e),s=Rn(e,t);if(s!==null){var o=Pt();an(s,e,t,o)}Cc(e,t)}},gd=function(){return Ke},yd=function(e,t){var s=Ke;try{return Ke=e,t()}finally{Ke=s}},Wo=function(e,t,s){switch(t){case"input":if(Jt(e,s),t=s.name,s.type==="radio"&&t!=null){for(s=e;s.parentNode;)s=s.parentNode;for(s=s.querySelectorAll("input[name="+JSON.stringify(""+t)+'][type="radio"]'),t=0;t<s.length;t++){var o=s[t];if(o!==e&&o.form===e.form){var u=al(o);if(!u)throw Error(l(90));B(o),Jt(o,u)}}}break;case"textarea":ce(e,s);break;case"select":t=s.value,t!=null&&hn(e,!!s.multiple,t,!1)}},nd=yc,rd=Lr;var Oy={usingClientEntryPoint:!1,Events:[ua,as,al,ed,td,yc]},Sa={findFiberByHostInstance:Er,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},Fy={bundleType:Sa.bundleType,version:Sa.version,rendererPackageName:Sa.rendererPackageName,rendererConfig:Sa.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:A.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=od(e),e===null?null:e.stateNode},findFiberByHostInstance:Sa.findFiberByHostInstance||Ly,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 Vl=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Vl.isDisabled&&Vl.supportsFiber)try{$a=Vl.inject(Fy),pn=Vl}catch{}}return Lt.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Oy,Lt.createPortal=function(e,t){var s=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!Ec(t))throw Error(l(200));return My(e,t,null,s)},Lt.createRoot=function(e,t){if(!Ec(e))throw Error(l(299));var s=!1,o="",u=Lh;return t!=null&&(t.unstable_strictMode===!0&&(s=!0),t.identifierPrefix!==void 0&&(o=t.identifierPrefix),t.onRecoverableError!==void 0&&(u=t.onRecoverableError)),t=Sc(e,1,!1,null,null,s,!1,o,u),e[kn]=t.current,oa(e.nodeType===8?e.parentNode:e),new kc(t)},Lt.findDOMNode=function(e){if(e==null)return null;if(e.nodeType===1)return e;var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(l(188)):(e=Object.keys(e).join(","),Error(l(268,e)));return e=od(t),e=e===null?null:e.stateNode,e},Lt.flushSync=function(e){return Lr(e)},Lt.hydrate=function(e,t,s){if(!Bl(t))throw Error(l(200));return Ul(null,e,t,!0,s)},Lt.hydrateRoot=function(e,t,s){if(!Ec(e))throw Error(l(405));var o=s!=null&&s.hydratedSources||null,u=!1,h="",b=Lh;if(s!=null&&(s.unstable_strictMode===!0&&(u=!0),s.identifierPrefix!==void 0&&(h=s.identifierPrefix),s.onRecoverableError!==void 0&&(b=s.onRecoverableError)),t=Ah(t,null,e,1,s??null,u,!1,h,b),e[kn]=t.current,oa(e),o)for(e=0;e<o.length;e++)s=o[e],u=s._getVersion,u=u(s._source),t.mutableSourceEagerHydrationData==null?t.mutableSourceEagerHydrationData=[s,u]:t.mutableSourceEagerHydrationData.push(s,u);return new $l(t)},Lt.render=function(e,t,s){if(!Bl(t))throw Error(l(200));return Ul(null,e,t,!1,s)},Lt.unmountComponentAtNode=function(e){if(!Bl(e))throw Error(l(40));return e._reactRootContainer?(Lr(function(){Ul(null,null,e,!1,function(){e._reactRootContainer=null,e[kn]=null})}),!0):!1},Lt.unstable_batchedUpdates=yc,Lt.unstable_renderSubtreeIntoContainer=function(e,t,s,o){if(!Bl(s))throw Error(l(200));if(e==null||e._reactInternals===void 0)throw Error(l(38));return Ul(e,t,s,!1,o)},Lt.version="18.3.1-next-f1338f8080-20240426",Lt}var Wh;function Qm(){if(Wh)return Rc.exports;Wh=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(),Rc.exports=Ky(),Rc.exports}var Hh;function Gy(){if(Hh)return Wl;Hh=1;var r=Qm();return Wl.createRoot=r.createRoot,Wl.hydrateRoot=r.hydrateRoot,Wl}var Qy=Gy(),Ia=Qm();const Yy=Gm(Ia);/**
|
||
* @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 _a(){return _a=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},_a.apply(this,arguments)}var mr;(function(r){r.Pop="POP",r.Push="PUSH",r.Replace="REPLACE"})(mr||(mr={}));const Kh="popstate";function Xy(r){r===void 0&&(r={});function a(i,c){let{pathname:d,search:f,hash:m}=i.location;return Qc("",{pathname:d,search:f,hash:m},c.state&&c.state.usr||null,c.state&&c.state.key||"default")}function l(i,c){return typeof c=="string"?c:ao(c)}return Jy(a,l,null,r)}function ct(r,a){if(r===!1||r===null||typeof r>"u")throw new Error(a)}function bu(r,a){if(!r){typeof console<"u"&&console.warn(a);try{throw new Error(a)}catch{}}}function qy(){return Math.random().toString(36).substr(2,8)}function Gh(r,a){return{usr:r.state,key:r.key,idx:a}}function Qc(r,a,l,i){return l===void 0&&(l=null),_a({pathname:typeof r=="string"?r:r.pathname,search:"",hash:""},typeof a=="string"?As(a):a,{state:l,key:a&&a.key||i||qy()})}function ao(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 As(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 Jy(r,a,l,i){i===void 0&&(i={});let{window:c=document.defaultView,v5Compat:d=!1}=i,f=c.history,m=mr.Pop,p=null,g=v();g==null&&(g=0,f.replaceState(_a({},f.state,{idx:g}),""));function v(){return(f.state||{idx:null}).idx}function w(){m=mr.Pop;let N=v(),y=N==null?null:N-g;g=N,p&&p({action:m,location:S.location,delta:y})}function _(N,y){m=mr.Push;let C=Qc(S.location,N,y);g=v()+1;let j=Gh(C,g),A=S.createHref(C);try{f.pushState(j,"",A)}catch(z){if(z instanceof DOMException&&z.name==="DataCloneError")throw z;c.location.assign(A)}d&&p&&p({action:m,location:S.location,delta:1})}function E(N,y){m=mr.Replace;let C=Qc(S.location,N,y);g=v();let j=Gh(C,g),A=S.createHref(C);f.replaceState(j,"",A),d&&p&&p({action:m,location:S.location,delta:0})}function k(N){let y=c.location.origin!=="null"?c.location.origin:c.location.href,C=typeof N=="string"?N:ao(N);return C=C.replace(/ $/,"%20"),ct(y,"No window.location.(origin|href) available to create URL for href: "+C),new URL(C,y)}let S={get action(){return m},get location(){return r(c,f)},listen(N){if(p)throw new Error("A history only accepts one active listener");return c.addEventListener(Kh,w),p=N,()=>{c.removeEventListener(Kh,w),p=null}},createHref(N){return a(c,N)},createURL:k,encodeLocation(N){let y=k(N);return{pathname:y.pathname,search:y.search,hash:y.hash}},push:_,replace:E,go(N){return f.go(N)}};return S}var Qh;(function(r){r.data="data",r.deferred="deferred",r.redirect="redirect",r.error="error"})(Qh||(Qh={}));function Zy(r,a,l){return l===void 0&&(l="/"),ev(r,a,l)}function ev(r,a,l,i){let c=typeof a=="string"?As(a):a,d=Nu(c.pathname||"/",l);if(d==null)return null;let f=Ym(r);tv(f);let m=null;for(let p=0;m==null&&p<f.length;++p){let g=hv(d);m=uv(f[p],g)}return m}function Ym(r,a,l,i){a===void 0&&(a=[]),l===void 0&&(l=[]),i===void 0&&(i="");let c=(d,f,m)=>{let p={relativePath:m===void 0?d.path||"":m,caseSensitive:d.caseSensitive===!0,childrenIndex:f,route:d};p.relativePath.startsWith("/")&&(ct(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 g=xr([i,p.relativePath]),v=l.concat(p);d.children&&d.children.length>0&&(ct(d.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+g+'".')),Ym(d.children,a,v,g)),!(d.path==null&&!d.index)&&a.push({path:g,score:iv(g,d.index),routesMeta:v})};return r.forEach((d,f)=>{var m;if(d.path===""||!((m=d.path)!=null&&m.includes("?")))c(d,f);else for(let p of Xm(d.path))c(d,f,p)}),a}function Xm(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 f=Xm(i.join("/")),m=[];return m.push(...f.map(p=>p===""?d:[d,p].join("/"))),c&&m.push(...f),m.map(p=>r.startsWith("/")&&p===""?"/":p)}function tv(r){r.sort((a,l)=>a.score!==l.score?l.score-a.score:cv(a.routesMeta.map(i=>i.childrenIndex),l.routesMeta.map(i=>i.childrenIndex)))}const nv=/^:[\w-]+$/,rv=3,sv=2,av=1,lv=10,ov=-2,Yh=r=>r==="*";function iv(r,a){let l=r.split("/"),i=l.length;return l.some(Yh)&&(i+=ov),a&&(i+=sv),l.filter(c=>!Yh(c)).reduce((c,d)=>c+(nv.test(d)?rv:d===""?av:lv),i)}function cv(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 uv(r,a,l){let{routesMeta:i}=r,c={},d="/",f=[];for(let m=0;m<i.length;++m){let p=i[m],g=m===i.length-1,v=d==="/"?a:a.slice(d.length)||"/",w=dv({path:p.relativePath,caseSensitive:p.caseSensitive,end:g},v),_=p.route;if(!w)return null;Object.assign(c,w.params),f.push({params:c,pathname:xr([d,w.pathname]),pathnameBase:yv(xr([d,w.pathnameBase])),route:_}),w.pathnameBase!=="/"&&(d=xr([d,w.pathnameBase]))}return f}function dv(r,a){typeof r=="string"&&(r={path:r,caseSensitive:!1,end:!0});let[l,i]=fv(r.path,r.caseSensitive,r.end),c=a.match(l);if(!c)return null;let d=c[0],f=d.replace(/(.)\/+$/,"$1"),m=c.slice(1);return{params:i.reduce((g,v,w)=>{let{paramName:_,isOptional:E}=v;if(_==="*"){let S=m[w]||"";f=d.slice(0,d.length-S.length).replace(/(.)\/+$/,"$1")}const k=m[w];return E&&!k?g[_]=void 0:g[_]=(k||"").replace(/%2F/g,"/"),g},{}),pathname:d,pathnameBase:f,pattern:r}}function fv(r,a,l){a===void 0&&(a=!1),l===void 0&&(l=!0),bu(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,(f,m,p)=>(i.push({paramName:m,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 hv(r){try{return r.split("/").map(a=>decodeURIComponent(a).replace(/\//g,"%2F")).join("/")}catch(a){return bu(!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 Nu(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 mv=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,pv=r=>mv.test(r);function xv(r,a){a===void 0&&(a="/");let{pathname:l,search:i="",hash:c=""}=typeof r=="string"?As(r):r,d;if(l)if(pv(l))d=l;else{if(l.includes("//")){let f=l;l=l.replace(/\/\/+/g,"/"),bu(!1,"Pathnames cannot have embedded double slashes - normalizing "+(f+" -> "+l))}l.startsWith("/")?d=Xh(l.substring(1),"/"):d=Xh(l,a)}else d=a;return{pathname:d,search:vv(i),hash:wv(c)}}function Xh(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 Ac(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 gv(r){return r.filter((a,l)=>l===0||a.route.path&&a.route.path.length>0)}function ju(r,a){let l=gv(r);return a?l.map((i,c)=>c===l.length-1?i.pathname:i.pathnameBase):l.map(i=>i.pathnameBase)}function Su(r,a,l,i){i===void 0&&(i=!1);let c;typeof r=="string"?c=As(r):(c=_a({},r),ct(!c.pathname||!c.pathname.includes("?"),Ac("?","pathname","search",c)),ct(!c.pathname||!c.pathname.includes("#"),Ac("#","pathname","hash",c)),ct(!c.search||!c.search.includes("#"),Ac("#","search","hash",c)));let d=r===""||c.pathname==="",f=d?"/":c.pathname,m;if(f==null)m=l;else{let w=a.length-1;if(!i&&f.startsWith("..")){let _=f.split("/");for(;_[0]==="..";)_.shift(),w-=1;c.pathname=_.join("/")}m=w>=0?a[w]:"/"}let p=xv(c,m),g=f&&f!=="/"&&f.endsWith("/"),v=(d||f===".")&&l.endsWith("/");return!p.pathname.endsWith("/")&&(g||v)&&(p.pathname+="/"),p}const xr=r=>r.join("/").replace(/\/\/+/g,"/"),yv=r=>r.replace(/\/+$/,"").replace(/^\/*/,"/"),vv=r=>!r||r==="?"?"":r.startsWith("?")?r:"?"+r,wv=r=>!r||r==="#"?"":r.startsWith("#")?r:"#"+r;function bv(r){return r!=null&&typeof r.status=="number"&&typeof r.statusText=="string"&&typeof r.internal=="boolean"&&"data"in r}const qm=["post","put","patch","delete"];new Set(qm);const Nv=["get",...qm];new Set(Nv);/**
|
||
* 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 Pa(){return Pa=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},Pa.apply(this,arguments)}const Cu=x.createContext(null),jv=x.createContext(null),br=x.createContext(null),wo=x.createContext(null),Wn=x.createContext({outlet:null,matches:[],isDataRoute:!1}),Jm=x.createContext(null);function Sv(r,a){let{relative:l}=a===void 0?{}:a;Ms()||ct(!1);let{basename:i,navigator:c}=x.useContext(br),{hash:d,pathname:f,search:m}=ep(r,{relative:l}),p=f;return i!=="/"&&(p=f==="/"?i:xr([i,f])),c.createHref({pathname:p,search:m,hash:d})}function Ms(){return x.useContext(wo)!=null}function Ls(){return Ms()||ct(!1),x.useContext(wo).location}function Zm(r){x.useContext(br).static||x.useLayoutEffect(r)}function Aa(){let{isDataRoute:r}=x.useContext(Wn);return r?zv():Cv()}function Cv(){Ms()||ct(!1);let r=x.useContext(Cu),{basename:a,future:l,navigator:i}=x.useContext(br),{matches:c}=x.useContext(Wn),{pathname:d}=Ls(),f=JSON.stringify(ju(c,l.v7_relativeSplatPath)),m=x.useRef(!1);return Zm(()=>{m.current=!0}),x.useCallback(function(g,v){if(v===void 0&&(v={}),!m.current)return;if(typeof g=="number"){i.go(g);return}let w=Su(g,JSON.parse(f),d,v.relative==="path");r==null&&a!=="/"&&(w.pathname=w.pathname==="/"?a:xr([a,w.pathname])),(v.replace?i.replace:i.push)(w,v.state,v)},[a,i,f,d,r])}const kv=x.createContext(null);function Ev(r){let a=x.useContext(Wn).outlet;return a&&x.createElement(kv.Provider,{value:r},a)}function ep(r,a){let{relative:l}=a===void 0?{}:a,{future:i}=x.useContext(br),{matches:c}=x.useContext(Wn),{pathname:d}=Ls(),f=JSON.stringify(ju(c,i.v7_relativeSplatPath));return x.useMemo(()=>Su(r,JSON.parse(f),d,l==="path"),[r,f,d,l])}function _v(r,a){return Pv(r,a)}function Pv(r,a,l,i){Ms()||ct(!1);let{navigator:c}=x.useContext(br),{matches:d}=x.useContext(Wn),f=d[d.length-1],m=f?f.params:{};f&&f.pathname;let p=f?f.pathnameBase:"/";f&&f.route;let g=Ls(),v;if(a){var w;let N=typeof a=="string"?As(a):a;p==="/"||(w=N.pathname)!=null&&w.startsWith(p)||ct(!1),v=N}else v=g;let _=v.pathname||"/",E=_;if(p!=="/"){let N=p.replace(/^\//,"").split("/");E="/"+_.replace(/^\//,"").split("/").slice(N.length).join("/")}let k=Zy(r,{pathname:E}),S=Mv(k&&k.map(N=>Object.assign({},N,{params:Object.assign({},m,N.params),pathname:xr([p,c.encodeLocation?c.encodeLocation(N.pathname).pathname:N.pathname]),pathnameBase:N.pathnameBase==="/"?p:xr([p,c.encodeLocation?c.encodeLocation(N.pathnameBase).pathname:N.pathnameBase])})),d,l,i);return a&&S?x.createElement(wo.Provider,{value:{location:Pa({pathname:"/",search:"",hash:"",state:null,key:"default"},v),navigationType:mr.Pop}},S):S}function Rv(){let r=Fv(),a=bv(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 x.createElement(x.Fragment,null,x.createElement("h2",null,"Unexpected Application Error!"),x.createElement("h3",{style:{fontStyle:"italic"}},a),l?x.createElement("pre",{style:c},l):null,null)}const Tv=x.createElement(Rv,null);class Iv extends x.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?x.createElement(Wn.Provider,{value:this.props.routeContext},x.createElement(Jm.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function Av(r){let{routeContext:a,match:l,children:i}=r,c=x.useContext(Cu);return c&&c.static&&c.staticContext&&(l.route.errorElement||l.route.ErrorBoundary)&&(c.staticContext._deepestRenderedBoundaryId=l.route.id),x.createElement(Wn.Provider,{value:a},i)}function Mv(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 f=r,m=(c=l)==null?void 0:c.errors;if(m!=null){let v=f.findIndex(w=>w.route.id&&(m==null?void 0:m[w.route.id])!==void 0);v>=0||ct(!1),f=f.slice(0,Math.min(f.length,v+1))}let p=!1,g=-1;if(l&&i&&i.v7_partialHydration)for(let v=0;v<f.length;v++){let w=f[v];if((w.route.HydrateFallback||w.route.hydrateFallbackElement)&&(g=v),w.route.id){let{loaderData:_,errors:E}=l,k=w.route.loader&&_[w.route.id]===void 0&&(!E||E[w.route.id]===void 0);if(w.route.lazy||k){p=!0,g>=0?f=f.slice(0,g+1):f=[f[0]];break}}}return f.reduceRight((v,w,_)=>{let E,k=!1,S=null,N=null;l&&(E=m&&w.route.id?m[w.route.id]:void 0,S=w.route.errorElement||Tv,p&&(g<0&&_===0?($v("route-fallback"),k=!0,N=null):g===_&&(k=!0,N=w.route.hydrateFallbackElement||null)));let y=a.concat(f.slice(0,_+1)),C=()=>{let j;return E?j=S:k?j=N:w.route.Component?j=x.createElement(w.route.Component,null):w.route.element?j=w.route.element:j=v,x.createElement(Av,{match:w,routeContext:{outlet:v,matches:y,isDataRoute:l!=null},children:j})};return l&&(w.route.ErrorBoundary||w.route.errorElement||_===0)?x.createElement(Iv,{location:l.location,revalidation:l.revalidation,component:S,error:E,children:C(),routeContext:{outlet:null,matches:y,isDataRoute:!0}}):C()},null)}var tp=(function(r){return r.UseBlocker="useBlocker",r.UseRevalidator="useRevalidator",r.UseNavigateStable="useNavigate",r})(tp||{}),np=(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})(np||{});function Lv(r){let a=x.useContext(Cu);return a||ct(!1),a}function Dv(r){let a=x.useContext(jv);return a||ct(!1),a}function Ov(r){let a=x.useContext(Wn);return a||ct(!1),a}function rp(r){let a=Ov(),l=a.matches[a.matches.length-1];return l.route.id||ct(!1),l.route.id}function Fv(){var r;let a=x.useContext(Jm),l=Dv(),i=rp();return a!==void 0?a:(r=l.errors)==null?void 0:r[i]}function zv(){let{router:r}=Lv(tp.UseNavigateStable),a=rp(np.UseNavigateStable),l=x.useRef(!1);return Zm(()=>{l.current=!0}),x.useCallback(function(c,d){d===void 0&&(d={}),l.current&&(typeof c=="number"?r.navigate(c):r.navigate(c,Pa({fromRouteId:a},d)))},[r,a])}const qh={};function $v(r,a,l){qh[r]||(qh[r]=!0)}function Bv(r,a){r==null||r.v7_startTransition,r==null||r.v7_relativeSplatPath}function Jh(r){let{to:a,replace:l,state:i,relative:c}=r;Ms()||ct(!1);let{future:d,static:f}=x.useContext(br),{matches:m}=x.useContext(Wn),{pathname:p}=Ls(),g=Aa(),v=Su(a,ju(m,d.v7_relativeSplatPath),p,c==="path"),w=JSON.stringify(v);return x.useEffect(()=>g(JSON.parse(w),{replace:l,state:i,relative:c}),[g,w,c,l,i]),null}function Uv(r){return Ev(r.context)}function yt(r){ct(!1)}function Vv(r){let{basename:a="/",children:l=null,location:i,navigationType:c=mr.Pop,navigator:d,static:f=!1,future:m}=r;Ms()&&ct(!1);let p=a.replace(/^\/*/,"/"),g=x.useMemo(()=>({basename:p,navigator:d,static:f,future:Pa({v7_relativeSplatPath:!1},m)}),[p,m,d,f]);typeof i=="string"&&(i=As(i));let{pathname:v="/",search:w="",hash:_="",state:E=null,key:k="default"}=i,S=x.useMemo(()=>{let N=Nu(v,p);return N==null?null:{location:{pathname:N,search:w,hash:_,state:E,key:k},navigationType:c}},[p,v,w,_,E,k,c]);return S==null?null:x.createElement(br.Provider,{value:g},x.createElement(wo.Provider,{children:l,value:S}))}function Wv(r){let{children:a,location:l}=r;return _v(Yc(a),l)}new Promise(()=>{});function Yc(r,a){a===void 0&&(a=[]);let l=[];return x.Children.forEach(r,(i,c)=>{if(!x.isValidElement(i))return;let d=[...a,c];if(i.type===x.Fragment){l.push.apply(l,Yc(i.props.children,d));return}i.type!==yt&&ct(!1),!i.props.index||!i.props.children||ct(!1);let f={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&&(f.children=Yc(i.props.children,d)),l.push(f)}),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 Xc(){return Xc=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},Xc.apply(this,arguments)}function Hv(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 Kv(r){return!!(r.metaKey||r.altKey||r.ctrlKey||r.shiftKey)}function Gv(r,a){return r.button===0&&(!a||a==="_self")&&!Kv(r)}const Qv=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","viewTransition"],Yv="6";try{window.__reactRouterVersion=Yv}catch{}const Xv="startTransition",Zh=vo[Xv];function qv(r){let{basename:a,children:l,future:i,window:c}=r,d=x.useRef();d.current==null&&(d.current=Xy({window:c,v5Compat:!0}));let f=d.current,[m,p]=x.useState({action:f.action,location:f.location}),{v7_startTransition:g}=i||{},v=x.useCallback(w=>{g&&Zh?Zh(()=>p(w)):p(w)},[p,g]);return x.useLayoutEffect(()=>f.listen(v),[f,v]),x.useEffect(()=>Bv(i),[i]),x.createElement(Vv,{basename:a,children:l,location:m.location,navigationType:m.action,navigator:f,future:i})}const Jv=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",Zv=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,ew=x.forwardRef(function(a,l){let{onClick:i,relative:c,reloadDocument:d,replace:f,state:m,target:p,to:g,preventScrollReset:v,viewTransition:w}=a,_=Hv(a,Qv),{basename:E}=x.useContext(br),k,S=!1;if(typeof g=="string"&&Zv.test(g)&&(k=g,Jv))try{let j=new URL(window.location.href),A=g.startsWith("//")?new URL(j.protocol+g):new URL(g),z=Nu(A.pathname,E);A.origin===j.origin&&z!=null?g=z+A.search+A.hash:S=!0}catch{}let N=Sv(g,{relative:c}),y=tw(g,{replace:f,state:m,target:p,preventScrollReset:v,relative:c,viewTransition:w});function C(j){i&&i(j),j.defaultPrevented||y(j)}return x.createElement("a",Xc({},_,{href:k||N,onClick:S||d?i:C,ref:l,target:p}))});var em;(function(r){r.UseScrollRestoration="useScrollRestoration",r.UseSubmit="useSubmit",r.UseSubmitFetcher="useSubmitFetcher",r.UseFetcher="useFetcher",r.useViewTransitionState="useViewTransitionState"})(em||(em={}));var tm;(function(r){r.UseFetcher="useFetcher",r.UseFetchers="useFetchers",r.UseScrollRestoration="useScrollRestoration"})(tm||(tm={}));function tw(r,a){let{target:l,replace:i,state:c,preventScrollReset:d,relative:f,viewTransition:m}=a===void 0?{}:a,p=Aa(),g=Ls(),v=ep(r,{relative:f});return x.useCallback(w=>{if(Gv(w,l)){w.preventDefault();let _=i!==void 0?i:ao(g)===ao(v);p(r,{replace:_,state:c,preventScrollReset:d,relative:f,viewTransition:m})}},[g,p,v,i,c,l,r,d,f,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 nw=r=>r.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),rw=r=>r.replace(/^([A-Z])|[\s-_]+(\w)/g,(a,l,i)=>i?i.toUpperCase():l.toLowerCase()),nm=r=>{const a=rw(r);return a.charAt(0).toUpperCase()+a.slice(1)},sp=(...r)=>r.filter((a,l,i)=>!!a&&a.trim()!==""&&i.indexOf(a)===l).join(" ").trim(),sw=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 aw={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 lw=x.forwardRef(({color:r="currentColor",size:a=24,strokeWidth:l=2,absoluteStrokeWidth:i,className:c="",children:d,iconNode:f,...m},p)=>x.createElement("svg",{ref:p,...aw,width:a,height:a,stroke:r,strokeWidth:i?Number(l)*24/Number(a):l,className:sp("lucide",c),...!d&&!sw(m)&&{"aria-hidden":"true"},...m},[...f.map(([g,v])=>x.createElement(g,v)),...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 be=(r,a)=>{const l=x.forwardRef(({className:i,...c},d)=>x.createElement(lw,{ref:d,iconNode:a,className:sp(`lucide-${nw(nm(r))}`,`lucide-${r}`,i),...c}));return l.displayName=nm(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 ow=[["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"}]],rm=be("bitcoin",ow);/**
|
||
* @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 iw=[["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"}]],Ps=be("book-open",iw);/**
|
||
* @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 cw=[["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"}]],qc=be("calendar",cw);/**
|
||
* @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 uw=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],bo=be("check",uw);/**
|
||
* @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 dw=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],ap=be("chevron-down",dw);/**
|
||
* @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 fw=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],lp=be("chevron-right",fw);/**
|
||
* @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 hw=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],mw=be("chevron-up",hw);/**
|
||
* @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 pw=[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]],Jc=be("circle-check-big",pw);/**
|
||
* @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 xw=[["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"}]],op=be("circle-question-mark",xw);/**
|
||
* @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 gw=[["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"}]],sm=be("circle-user",gw);/**
|
||
* @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 yw=[["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"}]],vw=be("circle-x",yw);/**
|
||
* @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 ww=[["path",{d:"M12 6v6l4 2",key:"mmk7yg"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],ip=be("clock",ww);/**
|
||
* @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 bw=[["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"}]],cp=be("copy",bw);/**
|
||
* @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 Nw=[["rect",{width:"20",height:"14",x:"2",y:"5",rx:"2",key:"ynyp8z"}],["line",{x1:"2",x2:"22",y1:"10",y2:"10",key:"1b3vmo"}]],Zc=be("credit-card",Nw);/**
|
||
* @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 jw=[["ellipse",{cx:"12",cy:"5",rx:"9",ry:"3",key:"msslwz"}],["path",{d:"M3 5V19A9 3 0 0 0 21 19V5",key:"1wlel7"}],["path",{d:"M3 12A9 3 0 0 0 21 12",key:"mv7ke4"}]],Sw=be("database",jw);/**
|
||
* @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 Cw=[["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"}]],lo=be("dollar-sign",Cw);/**
|
||
* @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 kw=[["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"}]],up=be("download",kw);/**
|
||
* @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 Ew=[["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"}]],oo=be("external-link",Ew);/**
|
||
* @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 _w=[["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"}]],ku=be("eye",_w);/**
|
||
* @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 Pw=[["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"}]],dp=be("file-text",Pw);/**
|
||
* @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 Rw=[["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"}]],Tw=be("funnel",Rw);/**
|
||
* @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 Iw=[["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"}]],am=be("gift",Iw);/**
|
||
* @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 Aw=[["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"}]],eu=be("globe",Aw);/**
|
||
* @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 Mw=[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}],["path",{d:"M12 7v5l4 2",key:"1fdv2h"}]],lm=be("history",Mw);/**
|
||
* @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 Lw=[["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"}]],Dw=be("image",Lw);/**
|
||
* @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 Ow=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],om=be("info",Ow);/**
|
||
* @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 Fw=[["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"}]],im=be("key",Fw);/**
|
||
* @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 zw=[["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"}]],$w=be("layout-dashboard",zw);/**
|
||
* @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 Bw=[["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"}]],Cs=be("link-2",Bw);/**
|
||
* @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 Uw=[["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"}]],cm=be("link",Uw);/**
|
||
* @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 Vw=[["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"}]],Ww=be("lock",Vw);/**
|
||
* @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 Hw=[["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"}]],Kw=be("log-out",Hw);/**
|
||
* @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 Gw=[["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"}]],Qw=be("map-pin",Gw);/**
|
||
* @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 Yw=[["path",{d:"M4 5h16",key:"1tepv9"}],["path",{d:"M4 12h16",key:"1lakjw"}],["path",{d:"M4 19h16",key:"1djgab"}]],Xw=be("menu",Yw);/**
|
||
* @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 qw=[["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"}]],Jw=be("message-circle",qw);/**
|
||
* @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 Zw=[["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"}]],e1=be("palette",Zw);/**
|
||
* @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 t1=[["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"}]],Rs=be("pen-line",t1);/**
|
||
* @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 n1=[["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"}]],r1=be("percent",n1);/**
|
||
* @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 s1=[["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"}]],a1=be("phone",s1);/**
|
||
* @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 l1=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],ks=be("plus",l1);/**
|
||
* @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 o1=[["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"}]],um=be("qr-code",o1);/**
|
||
* @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 i1=[["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"}]],Ze=be("refresh-cw",i1);/**
|
||
* @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 c1=[["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"}]],$n=be("save",c1);/**
|
||
* @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 u1=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],Br=be("search",u1);/**
|
||
* @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 d1=[["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"}]],io=be("settings",d1);/**
|
||
* @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 f1=[["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"}]],h1=be("settings-2",f1);/**
|
||
* @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 m1=[["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"}]],p1=be("shield-check",m1);/**
|
||
* @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 x1=[["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"}]],tu=be("shopping-bag",x1);/**
|
||
* @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 g1=[["rect",{width:"14",height:"20",x:"5",y:"2",rx:"2",ry:"2",key:"1yt0o3"}],["path",{d:"M12 18h.01",key:"mhygvu"}]],nu=be("smartphone",g1);/**
|
||
* @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 y1=[["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"}]],v1=be("tag",y1);/**
|
||
* @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 w1=[["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"}]],fp=be("trash-2",w1);/**
|
||
* @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 b1=[["path",{d:"M16 7h6v6",key:"box55l"}],["path",{d:"m22 7-8.5 8.5-5-5L2 17",key:"1t1m79"}]],ru=be("trending-up",b1);/**
|
||
* @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 N1=[["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"}]],Ss=be("upload",N1);/**
|
||
* @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 j1=[["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"}]],dm=be("user-plus",j1);/**
|
||
* @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 S1=[["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"}]],Zl=be("user",S1);/**
|
||
* @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 C1=[["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"}]],on=be("users",C1);/**
|
||
* @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 k1=[["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"}]],Ts=be("wallet",k1);/**
|
||
* @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 E1=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],Ur=be("x",E1);/**
|
||
* @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 _1=[["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"}]],P1=be("zap",_1),R1=()=>"";function su(r){const a=R1(),l=r.startsWith("/")?r:`/${r}`;return a?`${a}${l}`:l}async function No(r,a={}){const{data:l,...i}=a,c=su(r),d=new Headers(i.headers);l!=null&&!d.has("Content-Type")&&d.set("Content-Type","application/json");const f=l!=null?JSON.stringify(l):i.body,m=await fetch(c,{...i,headers:d,body:f,credentials:"include"}),g=(m.headers.get("Content-Type")||"").includes("application/json")?await m.json():m;if(!m.ok){const v=new Error((g==null?void 0:g.error)||`HTTP ${m.status}`);throw v.status=m.status,v.data=g,v}return g}function Ge(r,a){return No(r,{...a,method:"GET"})}function vt(r,a,l){return No(r,{...l,method:"POST",data:a})}function Bn(r,a,l){return No(r,{...l,method:"PUT",data:a})}function T1(r,a){return No(r,{...a,method:"DELETE"})}const I1=[{icon:$w,label:"数据概览",href:"/dashboard"},{icon:Ps,label:"内容管理",href:"/content"},{icon:on,label:"用户管理",href:"/users"},{icon:Ts,label:"交易中心",href:"/distribution"},{icon:Zc,label:"推广设置",href:"/referral-settings"},{icon:io,label:"系统设置",href:"/settings"}];function A1(){const r=Ls(),a=Aa(),[l,i]=x.useState(!1),[c,d]=x.useState(!1);x.useEffect(()=>{i(!0)},[]),x.useEffect(()=>{if(!l)return;d(!1);let m=!1;return Ge("/api/admin").then(p=>{m||(p&&p.success!==!1?d(!0):a("/login",{replace:!0}))}).catch(()=>{m||a("/login",{replace:!0})}),()=>{m=!0}},[l,a]);const f=async()=>{await vt("/api/admin/logout",{}),a("/login",{replace:!0})};return!l||!c?n.jsxs("div",{className:"flex min-h-screen bg-[#0a1628]",children:[n.jsx("div",{className:"w-64 bg-[#0f2137] border-r border-gray-700/50"}),n.jsx("div",{className:"flex-1 flex items-center justify-center",children:n.jsx("div",{className:"text-[#38bdac]",children:"加载中..."})})]}):n.jsxs("div",{className:"flex min-h-screen bg-[#0a1628]",children:[n.jsxs("div",{className:"w-64 bg-[#0f2137] flex flex-col border-r border-gray-700/50 shadow-xl",children:[n.jsxs("div",{className:"p-6 border-b border-gray-700/50",children:[n.jsx("h1",{className:"text-xl font-bold text-[#38bdac]",children:"管理后台"}),n.jsx("p",{className:"text-xs text-gray-400 mt-1",children:"Soul创业派对"})]}),n.jsx("nav",{className:"flex-1 p-4 space-y-1",children:I1.map(m=>{const p=r.pathname===m.href;return n.jsxs(ew,{to:m.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:[n.jsx(m.icon,{className:"w-5 h-5"}),n.jsx("span",{className:"text-sm",children:m.label})]},m.href)})}),n.jsxs("div",{className:"p-4 border-t border-gray-700/50 space-y-1",children:[n.jsxs("button",{type:"button",onClick:f,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:[n.jsx(Kw,{className:"w-5 h-5"}),n.jsx("span",{className:"text-sm",children:"退出登录"})]}),n.jsx("a",{href:`${typeof window<"u"?window.location.origin:""}/view`,target:"_blank",rel:"noreferrer",className:"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:n.jsx("span",{className:"text-sm",children:"返回前台"})})]})]}),n.jsx("div",{className:"flex-1 overflow-auto bg-[#0a1628]",children:n.jsx(Uv,{})})]})}function fm(r,a){if(typeof r=="function")return r(a);r!=null&&(r.current=a)}function Eu(...r){return a=>{let l=!1;const i=r.map(c=>{const d=fm(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():fm(r[c],null)}}}}function We(...r){return x.useCallback(Eu(...r),r)}var M1=Symbol.for("react.lazy"),co=vo[" use ".trim().toString()];function L1(r){return typeof r=="object"&&r!==null&&"then"in r}function hp(r){return r!=null&&typeof r=="object"&&"$$typeof"in r&&r.$$typeof===M1&&"_payload"in r&&L1(r._payload)}function mp(r){const a=D1(r),l=x.forwardRef((i,c)=>{let{children:d,...f}=i;hp(d)&&typeof co=="function"&&(d=co(d._payload));const m=x.Children.toArray(d),p=m.find(F1);if(p){const g=p.props.children,v=m.map(w=>w===p?x.Children.count(g)>1?x.Children.only(null):x.isValidElement(g)?g.props.children:null:w);return n.jsx(a,{...f,ref:c,children:x.isValidElement(g)?x.cloneElement(g,void 0,v):null})}return n.jsx(a,{...f,ref:c,children:d})});return l.displayName=`${r}.Slot`,l}var pp=mp("Slot");function D1(r){const a=x.forwardRef((l,i)=>{let{children:c,...d}=l;if(hp(c)&&typeof co=="function"&&(c=co(c._payload)),x.isValidElement(c)){const f=$1(c),m=z1(d,c.props);return c.type!==x.Fragment&&(m.ref=i?Eu(i,f):f),x.cloneElement(c,m)}return x.Children.count(c)>1?x.Children.only(null):null});return a.displayName=`${r}.SlotClone`,a}var O1=Symbol("radix.slottable");function F1(r){return x.isValidElement(r)&&typeof r.type=="function"&&"__radixId"in r.type&&r.type.__radixId===O1}function z1(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]=(...m)=>{const p=d(...m);return c(...m),p}:c&&(l[i]=c):i==="style"?l[i]={...c,...d}:i==="className"&&(l[i]=[c,d].filter(Boolean).join(" "))}return{...r,...l}}function $1(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 xp(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=xp(r[a]))&&(i&&(i+=" "),i+=l)}else for(l in r)r[l]&&(i&&(i+=" "),i+=l);return i}function gp(){for(var r,a,l=0,i="",c=arguments.length;l<c;l++)(r=arguments[l])&&(a=xp(r))&&(i&&(i+=" "),i+=a);return i}const hm=r=>typeof r=="boolean"?`${r}`:r===0?"0":r,mm=gp,yp=(r,a)=>l=>{var i;if((a==null?void 0:a.variants)==null)return mm(r,l==null?void 0:l.class,l==null?void 0:l.className);const{variants:c,defaultVariants:d}=a,f=Object.keys(c).map(g=>{const v=l==null?void 0:l[g],w=d==null?void 0:d[g];if(v===null)return null;const _=hm(v)||hm(w);return c[g][_]}),m=l&&Object.entries(l).reduce((g,v)=>{let[w,_]=v;return _===void 0||(g[w]=_),g},{}),p=a==null||(i=a.compoundVariants)===null||i===void 0?void 0:i.reduce((g,v)=>{let{class:w,className:_,...E}=v;return Object.entries(E).every(k=>{let[S,N]=k;return Array.isArray(N)?N.includes({...d,...m}[S]):{...d,...m}[S]===N})?[...g,w,_]:g},[]);return mm(r,f,p,l==null?void 0:l.class,l==null?void 0:l.className)},B1=(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},U1=(r,a)=>({classGroupId:r,validator:a}),vp=(r=new Map,a=null,l)=>({nextPart:r,validators:a,classGroupId:l}),uo="-",pm=[],V1="arbitrary..",W1=r=>{const a=K1(r),{conflictingClassGroups:l,conflictingClassGroupModifiers:i}=r;return{getClassGroupId:f=>{if(f.startsWith("[")&&f.endsWith("]"))return H1(f);const m=f.split(uo),p=m[0]===""&&m.length>1?1:0;return wp(m,p,a)},getConflictingClassGroupIds:(f,m)=>{if(m){const p=i[f],g=l[f];return p?g?B1(g,p):p:g||pm}return l[f]||pm}}},wp=(r,a,l)=>{if(r.length-a===0)return l.classGroupId;const c=r[a],d=l.nextPart.get(c);if(d){const g=wp(r,a+1,d);if(g)return g}const f=l.validators;if(f===null)return;const m=a===0?r.join(uo):r.slice(a).join(uo),p=f.length;for(let g=0;g<p;g++){const v=f[g];if(v.validator(m))return v.classGroupId}},H1=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?V1+i:void 0})(),K1=r=>{const{theme:a,classGroups:l}=r;return G1(l,a)},G1=(r,a)=>{const l=vp();for(const i in r){const c=r[i];_u(c,l,i,a)}return l},_u=(r,a,l,i)=>{const c=r.length;for(let d=0;d<c;d++){const f=r[d];Q1(f,a,l,i)}},Q1=(r,a,l,i)=>{if(typeof r=="string"){Y1(r,a,l);return}if(typeof r=="function"){X1(r,a,l,i);return}q1(r,a,l,i)},Y1=(r,a,l)=>{const i=r===""?a:bp(a,r);i.classGroupId=l},X1=(r,a,l,i)=>{if(J1(r)){_u(r(i),a,l,i);return}a.validators===null&&(a.validators=[]),a.validators.push(U1(l,r))},q1=(r,a,l,i)=>{const c=Object.entries(r),d=c.length;for(let f=0;f<d;f++){const[m,p]=c[f];_u(p,bp(a,m),l,i)}},bp=(r,a)=>{let l=r;const i=a.split(uo),c=i.length;for(let d=0;d<c;d++){const f=i[d];let m=l.nextPart.get(f);m||(m=vp(),l.nextPart.set(f,m)),l=m}return l},J1=r=>"isThemeGetter"in r&&r.isThemeGetter===!0,Z1=r=>{if(r<1)return{get:()=>{},set:()=>{}};let a=0,l=Object.create(null),i=Object.create(null);const c=(d,f)=>{l[d]=f,a++,a>r&&(a=0,i=l,l=Object.create(null))};return{get(d){let f=l[d];if(f!==void 0)return f;if((f=i[d])!==void 0)return c(d,f),f},set(d,f){d in l?l[d]=f:c(d,f)}}},au="!",xm=":",eb=[],gm=(r,a,l,i,c)=>({modifiers:r,hasImportantModifier:a,baseClassName:l,maybePostfixModifierPosition:i,isExternal:c}),tb=r=>{const{prefix:a,experimentalParseClassName:l}=r;let i=c=>{const d=[];let f=0,m=0,p=0,g;const v=c.length;for(let S=0;S<v;S++){const N=c[S];if(f===0&&m===0){if(N===xm){d.push(c.slice(p,S)),p=S+1;continue}if(N==="/"){g=S;continue}}N==="["?f++:N==="]"?f--:N==="("?m++:N===")"&&m--}const w=d.length===0?c:c.slice(p);let _=w,E=!1;w.endsWith(au)?(_=w.slice(0,-1),E=!0):w.startsWith(au)&&(_=w.slice(1),E=!0);const k=g&&g>p?g-p:void 0;return gm(d,E,_,k)};if(a){const c=a+xm,d=i;i=f=>f.startsWith(c)?d(f.slice(c.length)):gm(eb,!1,f,void 0,!0)}if(l){const c=i;i=d=>l({className:d,parseClassName:c})}return i},nb=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 f=l[d],m=f[0]==="[",p=a.has(f);m||p?(c.length>0&&(c.sort(),i.push(...c),c=[]),i.push(f)):c.push(f)}return c.length>0&&(c.sort(),i.push(...c)),i}},rb=r=>({cache:Z1(r.cacheSize),parseClassName:tb(r),sortModifiers:nb(r),...W1(r)}),sb=/\s+/,ab=(r,a)=>{const{parseClassName:l,getClassGroupId:i,getConflictingClassGroupIds:c,sortModifiers:d}=a,f=[],m=r.trim().split(sb);let p="";for(let g=m.length-1;g>=0;g-=1){const v=m[g],{isExternal:w,modifiers:_,hasImportantModifier:E,baseClassName:k,maybePostfixModifierPosition:S}=l(v);if(w){p=v+(p.length>0?" "+p:p);continue}let N=!!S,y=i(N?k.substring(0,S):k);if(!y){if(!N){p=v+(p.length>0?" "+p:p);continue}if(y=i(k),!y){p=v+(p.length>0?" "+p:p);continue}N=!1}const C=_.length===0?"":_.length===1?_[0]:d(_).join(":"),j=E?C+au:C,A=j+y;if(f.indexOf(A)>-1)continue;f.push(A);const z=c(y,N);for(let K=0;K<z.length;++K){const W=z[K];f.push(j+W)}p=v+(p.length>0?" "+p:p)}return p},lb=(...r)=>{let a=0,l,i,c="";for(;a<r.length;)(l=r[a++])&&(i=Np(l))&&(c&&(c+=" "),c+=i);return c},Np=r=>{if(typeof r=="string")return r;let a,l="";for(let i=0;i<r.length;i++)r[i]&&(a=Np(r[i]))&&(l&&(l+=" "),l+=a);return l},ob=(r,...a)=>{let l,i,c,d;const f=p=>{const g=a.reduce((v,w)=>w(v),r());return l=rb(g),i=l.cache.get,c=l.cache.set,d=m,m(p)},m=p=>{const g=i(p);if(g)return g;const v=ab(p,l);return c(p,v),v};return d=f,(...p)=>d(lb(...p))},ib=[],mt=r=>{const a=l=>l[r]||ib;return a.isThemeGetter=!0,a},jp=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,Sp=/^\((?:(\w[\w-]*):)?(.+)\)$/i,cb=/^\d+\/\d+$/,ub=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,db=/\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$/,fb=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,hb=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,mb=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,ws=r=>cb.test(r),Me=r=>!!r&&!Number.isNaN(Number(r)),ur=r=>!!r&&Number.isInteger(Number(r)),Mc=r=>r.endsWith("%")&&Me(r.slice(0,-1)),Mn=r=>ub.test(r),pb=()=>!0,xb=r=>db.test(r)&&!fb.test(r),Cp=()=>!1,gb=r=>hb.test(r),yb=r=>mb.test(r),vb=r=>!xe(r)&&!ge(r),wb=r=>Ds(r,_p,Cp),xe=r=>jp.test(r),zr=r=>Ds(r,Pp,xb),Lc=r=>Ds(r,Cb,Me),ym=r=>Ds(r,kp,Cp),bb=r=>Ds(r,Ep,yb),Hl=r=>Ds(r,Rp,gb),ge=r=>Sp.test(r),ka=r=>Os(r,Pp),Nb=r=>Os(r,kb),vm=r=>Os(r,kp),jb=r=>Os(r,_p),Sb=r=>Os(r,Ep),Kl=r=>Os(r,Rp,!0),Ds=(r,a,l)=>{const i=jp.exec(r);return i?i[1]?a(i[1]):l(i[2]):!1},Os=(r,a,l=!1)=>{const i=Sp.exec(r);return i?i[1]?a(i[1]):l:!1},kp=r=>r==="position"||r==="percentage",Ep=r=>r==="image"||r==="url",_p=r=>r==="length"||r==="size"||r==="bg-size",Pp=r=>r==="length",Cb=r=>r==="number",kb=r=>r==="family-name",Rp=r=>r==="shadow",Eb=()=>{const r=mt("color"),a=mt("font"),l=mt("text"),i=mt("font-weight"),c=mt("tracking"),d=mt("leading"),f=mt("breakpoint"),m=mt("container"),p=mt("spacing"),g=mt("radius"),v=mt("shadow"),w=mt("inset-shadow"),_=mt("text-shadow"),E=mt("drop-shadow"),k=mt("blur"),S=mt("perspective"),N=mt("aspect"),y=mt("ease"),C=mt("animate"),j=()=>["auto","avoid","all","avoid-page","page","left","right","column"],A=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],z=()=>[...A(),ge,xe],K=()=>["auto","hidden","clip","visible","scroll"],W=()=>["auto","contain","none"],V=()=>[ge,xe,p],le=()=>[ws,"full","auto",...V()],me=()=>[ur,"none","subgrid",ge,xe],oe=()=>["auto",{span:["full",ur,ge,xe]},ur,ge,xe],fe=()=>[ur,"auto",ge,xe],T=()=>["auto","min","max","fr",ge,xe],se=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],G=()=>["start","end","center","stretch","center-safe","end-safe"],Q=()=>["auto",...V()],O=()=>[ws,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...V()],R=()=>[r,ge,xe],Y=()=>[...A(),vm,ym,{position:[ge,xe]}],X=()=>["no-repeat",{repeat:["","x","y","space","round"]}],L=()=>["auto","cover","contain",jb,wb,{size:[ge,xe]}],H=()=>[Mc,ka,zr],ue=()=>["","none","full",g,ge,xe],re=()=>["",Me,ka,zr],je=()=>["solid","dashed","dotted","double"],Ne=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],ee=()=>[Me,Mc,vm,ym],de=()=>["","none",k,ge,xe],Ee=()=>["none",Me,ge,xe],Se=()=>["none",Me,ge,xe],Te=()=>[Me,ge,xe],B=()=>[ws,"full",...V()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[Mn],breakpoint:[Mn],color:[pb],container:[Mn],"drop-shadow":[Mn],ease:["in","out","in-out"],font:[vb],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[Mn],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[Mn],shadow:[Mn],spacing:["px",Me],text:[Mn],"text-shadow":[Mn],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",ws,xe,ge,N]}],container:["container"],columns:[{columns:[Me,xe,ge,m]}],"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:z()}],overflow:[{overflow:K()}],"overflow-x":[{"overflow-x":K()}],"overflow-y":[{"overflow-y":K()}],overscroll:[{overscroll:W()}],"overscroll-x":[{"overscroll-x":W()}],"overscroll-y":[{"overscroll-y":W()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:le()}],"inset-x":[{"inset-x":le()}],"inset-y":[{"inset-y":le()}],start:[{start:le()}],end:[{end:le()}],top:[{top:le()}],right:[{right:le()}],bottom:[{bottom:le()}],left:[{left:le()}],visibility:["visible","invisible","collapse"],z:[{z:[ur,"auto",ge,xe]}],basis:[{basis:[ws,"full","auto",m,...V()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[Me,ws,"auto","initial","none",xe]}],grow:[{grow:["",Me,ge,xe]}],shrink:[{shrink:["",Me,ge,xe]}],order:[{order:[ur,"first","last","none",ge,xe]}],"grid-cols":[{"grid-cols":me()}],"col-start-end":[{col:oe()}],"col-start":[{"col-start":fe()}],"col-end":[{"col-end":fe()}],"grid-rows":[{"grid-rows":me()}],"row-start-end":[{row:oe()}],"row-start":[{"row-start":fe()}],"row-end":[{"row-end":fe()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":T()}],"auto-rows":[{"auto-rows":T()}],gap:[{gap:V()}],"gap-x":[{"gap-x":V()}],"gap-y":[{"gap-y":V()}],"justify-content":[{justify:[...se(),"normal"]}],"justify-items":[{"justify-items":[...G(),"normal"]}],"justify-self":[{"justify-self":["auto",...G()]}],"align-content":[{content:["normal",...se()]}],"align-items":[{items:[...G(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...G(),{baseline:["","last"]}]}],"place-content":[{"place-content":se()}],"place-items":[{"place-items":[...G(),"baseline"]}],"place-self":[{"place-self":["auto",...G()]}],p:[{p:V()}],px:[{px:V()}],py:[{py:V()}],ps:[{ps:V()}],pe:[{pe:V()}],pt:[{pt:V()}],pr:[{pr:V()}],pb:[{pb:V()}],pl:[{pl:V()}],m:[{m:Q()}],mx:[{mx:Q()}],my:[{my:Q()}],ms:[{ms:Q()}],me:[{me:Q()}],mt:[{mt:Q()}],mr:[{mr:Q()}],mb:[{mb:Q()}],ml:[{ml:Q()}],"space-x":[{"space-x":V()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":V()}],"space-y-reverse":["space-y-reverse"],size:[{size:O()}],w:[{w:[m,"screen",...O()]}],"min-w":[{"min-w":[m,"screen","none",...O()]}],"max-w":[{"max-w":[m,"screen","none","prose",{screen:[f]},...O()]}],h:[{h:["screen","lh",...O()]}],"min-h":[{"min-h":["screen","lh","none",...O()]}],"max-h":[{"max-h":["screen","lh",...O()]}],"font-size":[{text:["base",l,ka,zr]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[i,ge,Lc]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",Mc,xe]}],"font-family":[{font:[Nb,xe,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,ge,xe]}],"line-clamp":[{"line-clamp":[Me,"none",ge,Lc]}],leading:[{leading:[d,...V()]}],"list-image":[{"list-image":["none",ge,xe]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",ge,xe]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:R()}],"text-color":[{text:R()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...je(),"wavy"]}],"text-decoration-thickness":[{decoration:[Me,"from-font","auto",ge,zr]}],"text-decoration-color":[{decoration:R()}],"underline-offset":[{"underline-offset":[Me,"auto",ge,xe]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:V()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",ge,xe]}],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",ge,xe]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:Y()}],"bg-repeat":[{bg:X()}],"bg-size":[{bg:L()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},ur,ge,xe],radial:["",ge,xe],conic:[ur,ge,xe]},Sb,bb]}],"bg-color":[{bg:R()}],"gradient-from-pos":[{from:H()}],"gradient-via-pos":[{via:H()}],"gradient-to-pos":[{to:H()}],"gradient-from":[{from:R()}],"gradient-via":[{via:R()}],"gradient-to":[{to:R()}],rounded:[{rounded:ue()}],"rounded-s":[{"rounded-s":ue()}],"rounded-e":[{"rounded-e":ue()}],"rounded-t":[{"rounded-t":ue()}],"rounded-r":[{"rounded-r":ue()}],"rounded-b":[{"rounded-b":ue()}],"rounded-l":[{"rounded-l":ue()}],"rounded-ss":[{"rounded-ss":ue()}],"rounded-se":[{"rounded-se":ue()}],"rounded-ee":[{"rounded-ee":ue()}],"rounded-es":[{"rounded-es":ue()}],"rounded-tl":[{"rounded-tl":ue()}],"rounded-tr":[{"rounded-tr":ue()}],"rounded-br":[{"rounded-br":ue()}],"rounded-bl":[{"rounded-bl":ue()}],"border-w":[{border:re()}],"border-w-x":[{"border-x":re()}],"border-w-y":[{"border-y":re()}],"border-w-s":[{"border-s":re()}],"border-w-e":[{"border-e":re()}],"border-w-t":[{"border-t":re()}],"border-w-r":[{"border-r":re()}],"border-w-b":[{"border-b":re()}],"border-w-l":[{"border-l":re()}],"divide-x":[{"divide-x":re()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":re()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...je(),"hidden","none"]}],"divide-style":[{divide:[...je(),"hidden","none"]}],"border-color":[{border:R()}],"border-color-x":[{"border-x":R()}],"border-color-y":[{"border-y":R()}],"border-color-s":[{"border-s":R()}],"border-color-e":[{"border-e":R()}],"border-color-t":[{"border-t":R()}],"border-color-r":[{"border-r":R()}],"border-color-b":[{"border-b":R()}],"border-color-l":[{"border-l":R()}],"divide-color":[{divide:R()}],"outline-style":[{outline:[...je(),"none","hidden"]}],"outline-offset":[{"outline-offset":[Me,ge,xe]}],"outline-w":[{outline:["",Me,ka,zr]}],"outline-color":[{outline:R()}],shadow:[{shadow:["","none",v,Kl,Hl]}],"shadow-color":[{shadow:R()}],"inset-shadow":[{"inset-shadow":["none",w,Kl,Hl]}],"inset-shadow-color":[{"inset-shadow":R()}],"ring-w":[{ring:re()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:R()}],"ring-offset-w":[{"ring-offset":[Me,zr]}],"ring-offset-color":[{"ring-offset":R()}],"inset-ring-w":[{"inset-ring":re()}],"inset-ring-color":[{"inset-ring":R()}],"text-shadow":[{"text-shadow":["none",_,Kl,Hl]}],"text-shadow-color":[{"text-shadow":R()}],opacity:[{opacity:[Me,ge,xe]}],"mix-blend":[{"mix-blend":[...Ne(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":Ne()}],"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":[Me]}],"mask-image-linear-from-pos":[{"mask-linear-from":ee()}],"mask-image-linear-to-pos":[{"mask-linear-to":ee()}],"mask-image-linear-from-color":[{"mask-linear-from":R()}],"mask-image-linear-to-color":[{"mask-linear-to":R()}],"mask-image-t-from-pos":[{"mask-t-from":ee()}],"mask-image-t-to-pos":[{"mask-t-to":ee()}],"mask-image-t-from-color":[{"mask-t-from":R()}],"mask-image-t-to-color":[{"mask-t-to":R()}],"mask-image-r-from-pos":[{"mask-r-from":ee()}],"mask-image-r-to-pos":[{"mask-r-to":ee()}],"mask-image-r-from-color":[{"mask-r-from":R()}],"mask-image-r-to-color":[{"mask-r-to":R()}],"mask-image-b-from-pos":[{"mask-b-from":ee()}],"mask-image-b-to-pos":[{"mask-b-to":ee()}],"mask-image-b-from-color":[{"mask-b-from":R()}],"mask-image-b-to-color":[{"mask-b-to":R()}],"mask-image-l-from-pos":[{"mask-l-from":ee()}],"mask-image-l-to-pos":[{"mask-l-to":ee()}],"mask-image-l-from-color":[{"mask-l-from":R()}],"mask-image-l-to-color":[{"mask-l-to":R()}],"mask-image-x-from-pos":[{"mask-x-from":ee()}],"mask-image-x-to-pos":[{"mask-x-to":ee()}],"mask-image-x-from-color":[{"mask-x-from":R()}],"mask-image-x-to-color":[{"mask-x-to":R()}],"mask-image-y-from-pos":[{"mask-y-from":ee()}],"mask-image-y-to-pos":[{"mask-y-to":ee()}],"mask-image-y-from-color":[{"mask-y-from":R()}],"mask-image-y-to-color":[{"mask-y-to":R()}],"mask-image-radial":[{"mask-radial":[ge,xe]}],"mask-image-radial-from-pos":[{"mask-radial-from":ee()}],"mask-image-radial-to-pos":[{"mask-radial-to":ee()}],"mask-image-radial-from-color":[{"mask-radial-from":R()}],"mask-image-radial-to-color":[{"mask-radial-to":R()}],"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":A()}],"mask-image-conic-pos":[{"mask-conic":[Me]}],"mask-image-conic-from-pos":[{"mask-conic-from":ee()}],"mask-image-conic-to-pos":[{"mask-conic-to":ee()}],"mask-image-conic-from-color":[{"mask-conic-from":R()}],"mask-image-conic-to-color":[{"mask-conic-to":R()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:Y()}],"mask-repeat":[{mask:X()}],"mask-size":[{mask:L()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",ge,xe]}],filter:[{filter:["","none",ge,xe]}],blur:[{blur:de()}],brightness:[{brightness:[Me,ge,xe]}],contrast:[{contrast:[Me,ge,xe]}],"drop-shadow":[{"drop-shadow":["","none",E,Kl,Hl]}],"drop-shadow-color":[{"drop-shadow":R()}],grayscale:[{grayscale:["",Me,ge,xe]}],"hue-rotate":[{"hue-rotate":[Me,ge,xe]}],invert:[{invert:["",Me,ge,xe]}],saturate:[{saturate:[Me,ge,xe]}],sepia:[{sepia:["",Me,ge,xe]}],"backdrop-filter":[{"backdrop-filter":["","none",ge,xe]}],"backdrop-blur":[{"backdrop-blur":de()}],"backdrop-brightness":[{"backdrop-brightness":[Me,ge,xe]}],"backdrop-contrast":[{"backdrop-contrast":[Me,ge,xe]}],"backdrop-grayscale":[{"backdrop-grayscale":["",Me,ge,xe]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[Me,ge,xe]}],"backdrop-invert":[{"backdrop-invert":["",Me,ge,xe]}],"backdrop-opacity":[{"backdrop-opacity":[Me,ge,xe]}],"backdrop-saturate":[{"backdrop-saturate":[Me,ge,xe]}],"backdrop-sepia":[{"backdrop-sepia":["",Me,ge,xe]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":V()}],"border-spacing-x":[{"border-spacing-x":V()}],"border-spacing-y":[{"border-spacing-y":V()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",ge,xe]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[Me,"initial",ge,xe]}],ease:[{ease:["linear","initial",y,ge,xe]}],delay:[{delay:[Me,ge,xe]}],animate:[{animate:["none",C,ge,xe]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[S,ge,xe]}],"perspective-origin":[{"perspective-origin":z()}],rotate:[{rotate:Ee()}],"rotate-x":[{"rotate-x":Ee()}],"rotate-y":[{"rotate-y":Ee()}],"rotate-z":[{"rotate-z":Ee()}],scale:[{scale:Se()}],"scale-x":[{"scale-x":Se()}],"scale-y":[{"scale-y":Se()}],"scale-z":[{"scale-z":Se()}],"scale-3d":["scale-3d"],skew:[{skew:Te()}],"skew-x":[{"skew-x":Te()}],"skew-y":[{"skew-y":Te()}],transform:[{transform:[ge,xe,"","none","gpu","cpu"]}],"transform-origin":[{origin:z()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:B()}],"translate-x":[{"translate-x":B()}],"translate-y":[{"translate-y":B()}],"translate-z":[{"translate-z":B()}],"translate-none":["translate-none"],accent:[{accent:R()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:R()}],"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",ge,xe]}],"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":V()}],"scroll-mx":[{"scroll-mx":V()}],"scroll-my":[{"scroll-my":V()}],"scroll-ms":[{"scroll-ms":V()}],"scroll-me":[{"scroll-me":V()}],"scroll-mt":[{"scroll-mt":V()}],"scroll-mr":[{"scroll-mr":V()}],"scroll-mb":[{"scroll-mb":V()}],"scroll-ml":[{"scroll-ml":V()}],"scroll-p":[{"scroll-p":V()}],"scroll-px":[{"scroll-px":V()}],"scroll-py":[{"scroll-py":V()}],"scroll-ps":[{"scroll-ps":V()}],"scroll-pe":[{"scroll-pe":V()}],"scroll-pt":[{"scroll-pt":V()}],"scroll-pr":[{"scroll-pr":V()}],"scroll-pb":[{"scroll-pb":V()}],"scroll-pl":[{"scroll-pl":V()}],"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",ge,xe]}],fill:[{fill:["none",...R()]}],"stroke-w":[{stroke:[Me,ka,zr,Lc]}],stroke:[{stroke:["none",...R()]}],"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"]}},_b=ob(Eb);function He(...r){return _b(gp(r))}const Pb=yp("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 ye({className:r,variant:a,size:l,asChild:i=!1,...c}){const d=i?pp:"button";return n.jsx(d,{"data-slot":"button",className:He(Pb({variant:a,size:l,className:r})),...c})}function ae({className:r,type:a,...l}){return n.jsx("input",{type:a,"data-slot":"input",className:He("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 Rb(){const r=Aa(),[a,l]=x.useState(""),[i,c]=x.useState(""),[d,f]=x.useState(""),[m,p]=x.useState(!1),g=async()=>{f(""),p(!0);try{const v=await vt("/api/admin",{username:a.trim(),password:i});if((v==null?void 0:v.success)!==!1){r("/dashboard",{replace:!0});return}f(v.error||"用户名或密码错误")}catch(v){const w=v;f(w.status===401?"用户名或密码错误":(w==null?void 0:w.message)||"网络错误,请重试")}finally{p(!1)}};return n.jsxs("div",{className:"min-h-screen bg-[#0a1628] flex items-center justify-center p-4",children:[n.jsxs("div",{className:"absolute inset-0 overflow-hidden",children:[n.jsx("div",{className:"absolute top-1/4 left-1/4 w-96 h-96 bg-[#38bdac]/5 rounded-full blur-3xl"}),n.jsx("div",{className:"absolute bottom-1/4 right-1/4 w-96 h-96 bg-blue-500/5 rounded-full blur-3xl"})]}),n.jsxs("div",{className:"w-full max-w-md relative z-10",children:[n.jsxs("div",{className:"text-center mb-8",children:[n.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:n.jsx(p1,{className:"w-8 h-8 text-[#38bdac]"})}),n.jsx("h1",{className:"text-2xl font-bold text-white mb-2",children:"管理后台"}),n.jsx("p",{className:"text-gray-400",children:"一场SOUL的创业实验场"})]}),n.jsxs("div",{className:"bg-[#0f2137] rounded-2xl p-8 shadow-xl border border-gray-700/50 backdrop-blur-xl",children:[n.jsx("h2",{className:"text-xl font-semibold text-white mb-6 text-center",children:"管理员登录"}),n.jsxs("div",{className:"space-y-4",children:[n.jsxs("div",{children:[n.jsx("label",{className:"block text-gray-400 text-sm mb-2",children:"用户名"}),n.jsxs("div",{className:"relative",children:[n.jsx(Zl,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-5 h-5 text-gray-500"}),n.jsx(ae,{type:"text",value:a,onChange:v=>l(v.target.value),placeholder:"请输入用户名",className:"pl-10 bg-[#0a1628] border-gray-700 text-white placeholder:text-gray-500 focus:border-[#38bdac]"})]})]}),n.jsxs("div",{children:[n.jsx("label",{className:"block text-gray-400 text-sm mb-2",children:"密码"}),n.jsxs("div",{className:"relative",children:[n.jsx(Ww,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-5 h-5 text-gray-500"}),n.jsx(ae,{type:"password",value:i,onChange:v=>c(v.target.value),placeholder:"请输入密码",className:"pl-10 bg-[#0a1628] border-gray-700 text-white placeholder:text-gray-500 focus:border-[#38bdac]",onKeyDown:v=>v.key==="Enter"&&g()})]})]}),d&&n.jsx("div",{className:"bg-red-500/10 text-red-400 text-sm p-3 rounded-lg border border-red-500/20",children:d}),n.jsx(ye,{onClick:g,disabled:m,className:"w-full bg-[#38bdac] hover:bg-[#2da396] text-white py-5 disabled:opacity-50",children:m?"登录中...":"登录"})]})]}),n.jsx("p",{className:"text-center text-gray-500 text-xs mt-6",children:"Soul创业实验场 · 后台管理系统"})]})]})}const _e=x.forwardRef(({className:r,...a},l)=>n.jsx("div",{ref:l,className:He("rounded-xl border bg-card text-card-foreground shadow",r),...a}));_e.displayName="Card";const ze=x.forwardRef(({className:r,...a},l)=>n.jsx("div",{ref:l,className:He("flex flex-col space-y-1.5 p-6",r),...a}));ze.displayName="CardHeader";const Ue=x.forwardRef(({className:r,...a},l)=>n.jsx("h3",{ref:l,className:He("font-semibold leading-none tracking-tight",r),...a}));Ue.displayName="CardTitle";const at=x.forwardRef(({className:r,...a},l)=>n.jsx("p",{ref:l,className:He("text-sm text-muted-foreground",r),...a}));at.displayName="CardDescription";const Pe=x.forwardRef(({className:r,...a},l)=>n.jsx("div",{ref:l,className:He("p-6 pt-0",r),...a}));Pe.displayName="CardContent";const Tb=x.forwardRef(({className:r,...a},l)=>n.jsx("div",{ref:l,className:He("flex items-center p-6 pt-0",r),...a}));Tb.displayName="CardFooter";function Ib(){const r=Aa(),[a,l]=x.useState(!1),[i,c]=x.useState([]),[d,f]=x.useState([]);async function m(){try{const[E,k]=await Promise.all([Ge("/api/db/users"),Ge("/api/orders")]);E!=null&&E.success&&E.users&&c(E.users),k!=null&&k.success&&k.orders&&f(k.orders)}catch(E){console.error("加载数据失败",E)}}if(x.useEffect(()=>{l(!0),m()},[]),!a)return n.jsxs("div",{className:"p-8 max-w-7xl mx-auto",children:[n.jsx("h1",{className:"text-2xl font-bold mb-8 text-white",children:"数据概览"}),n.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-6 mb-8",children:[1,2,3,4].map(E=>n.jsxs(_e,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:[n.jsxs(ze,{className:"flex flex-row items-center justify-between pb-2",children:[n.jsx("div",{className:"h-4 w-20 bg-gray-700 rounded animate-pulse"}),n.jsx("div",{className:"w-8 h-8 bg-gray-700 rounded-lg animate-pulse"})]}),n.jsx(Pe,{children:n.jsx("div",{className:"h-8 w-16 bg-gray-700 rounded animate-pulse"})})]},E))}),n.jsxs("div",{className:"flex items-center justify-center py-8",children:[n.jsx(Ze,{className:"w-6 h-6 text-[#38bdac] animate-spin"}),n.jsx("span",{className:"ml-2 text-gray-400",children:"加载中..."})]})]});const p=d.reduce((E,k)=>E+Number(k.amount||0),0),g=i.length,v=d.length,w=E=>{const k=E.productType||"",S=E.description||"";if(S){if(k==="section"&&S.includes("章节")){if(S.includes("-")){const N=S.split("-");if(N.length>=3)return{title:`第${N[1]}章 第${N[2]}节`,subtitle:"《一场Soul的创业实验》"}}return{title:S,subtitle:"章节购买"}}return k==="fullbook"||S.includes("全书")?{title:"《一场Soul的创业实验》",subtitle:"全书购买"}:k==="match"||S.includes("伙伴")?{title:"找伙伴匹配",subtitle:"功能服务"}:{title:S,subtitle:k==="section"?"单章":k==="fullbook"?"全书":"其他"}}return k==="section"?{title:`章节 ${E.productId||""}`,subtitle:"单章购买"}:k==="fullbook"?{title:"《一场Soul的创业实验》",subtitle:"全书购买"}:k==="match"?{title:"找伙伴匹配",subtitle:"功能服务"}:{title:"未知商品",subtitle:k||"其他"}},_=[{title:"总用户数",value:g,icon:on,color:"text-blue-400",bg:"bg-blue-500/20",link:"/users"},{title:"总收入",value:`¥${Number(p).toFixed(2)}`,icon:ru,color:"text-[#38bdac]",bg:"bg-[#38bdac]/20",link:"/orders"},{title:"订单数",value:v,icon:tu,color:"text-purple-400",bg:"bg-purple-500/20",link:"/orders"},{title:"转化率",value:`${g>0?(v/g*100).toFixed(1):0}%`,icon:Ps,color:"text-orange-400",bg:"bg-orange-500/20",link:"/distribution"}];return n.jsxs("div",{className:"p-8 max-w-7xl mx-auto",children:[n.jsx("h1",{className:"text-2xl font-bold mb-8 text-white",children:"数据概览"}),n.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-6 mb-8",children:_.map((E,k)=>n.jsxs(_e,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl cursor-pointer hover:border-[#38bdac]/50 transition-colors group",onClick:()=>E.link&&r(E.link),children:[n.jsxs(ze,{className:"flex flex-row items-center justify-between pb-2",children:[n.jsx(Ue,{className:"text-sm font-medium text-gray-400",children:E.title}),n.jsx("div",{className:`p-2 rounded-lg ${E.bg}`,children:n.jsx(E.icon,{className:`w-4 h-4 ${E.color}`})})]}),n.jsx(Pe,{children:n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsx("div",{className:"text-2xl font-bold text-white",children:E.value}),n.jsx(lp,{className:"w-5 h-5 text-gray-600 group-hover:text-[#38bdac] transition-colors"})]})})]},k))}),n.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-8",children:[n.jsxs(_e,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:[n.jsx(ze,{children:n.jsx(Ue,{className:"text-white",children:"最近订单"})}),n.jsx(Pe,{children:n.jsxs("div",{className:"space-y-3",children:[d.slice(-5).reverse().map(E=>{var C;const k=E.referrerId?i.find(j=>j.id===E.referrerId):void 0,S=E.referralCode||(k==null?void 0:k.referral_code)||(k==null?void 0:k.nickname)||(E.referrerId?String(E.referrerId).slice(0,8):""),N=w(E),y=E.userNickname||((C=i.find(j=>j.id===E.userId))==null?void 0:C.nickname)||"匿名用户";return n.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:[n.jsxs("div",{className:"flex items-start gap-3 flex-1",children:[E.userAvatar?n.jsx("img",{src:E.userAvatar,alt:y,className:"w-9 h-9 rounded-full object-cover flex-shrink-0 mt-0.5",onError:j=>{j.currentTarget.style.display="none";const A=j.currentTarget.nextElementSibling;A&&A.classList.remove("hidden")}}):null,n.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 ${E.userAvatar?"hidden":""}`,children:y.charAt(0)}),n.jsxs("div",{className:"flex-1 min-w-0",children:[n.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[n.jsx("span",{className:"text-sm text-gray-300",children:y}),n.jsx("span",{className:"text-gray-600",children:"·"}),n.jsx("span",{className:"text-sm font-medium text-white truncate",children:N.title})]}),n.jsxs("div",{className:"flex items-center gap-2 text-xs text-gray-500",children:[n.jsx("span",{className:"px-1.5 py-0.5 bg-gray-700/50 rounded",children:N.subtitle}),n.jsx("span",{children:new Date(E.createdAt||0).toLocaleString("zh-CN",{month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"})})]}),S&&n.jsxs("p",{className:"text-xs text-gray-600 mt-1",children:["推荐: ",S]})]})]}),n.jsxs("div",{className:"text-right ml-4 flex-shrink-0",children:[n.jsxs("p",{className:"text-sm font-bold text-[#38bdac]",children:["+¥",Number(E.amount).toFixed(2)]}),n.jsx("p",{className:"text-xs text-gray-500 mt-0.5",children:E.paymentMethod||"微信"})]})]},E.id)}),d.length===0&&n.jsxs("div",{className:"text-center py-12",children:[n.jsx(tu,{className:"w-12 h-12 text-gray-600 mx-auto mb-3"}),n.jsx("p",{className:"text-gray-500",children:"暂无订单数据"})]})]})})]}),n.jsxs(_e,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:[n.jsx(ze,{children:n.jsx(Ue,{className:"text-white",children:"新注册用户"})}),n.jsx(Pe,{children:n.jsxs("div",{className:"space-y-3",children:[i.slice(-5).reverse().map(E=>{var k;return n.jsxs("div",{className:"flex items-center justify-between p-4 bg-[#0a1628] rounded-lg border border-gray-700/30",children:[n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsx("div",{className:"w-10 h-10 rounded-full bg-[#38bdac]/20 flex items-center justify-center text-sm font-medium text-[#38bdac]",children:((k=E.nickname)==null?void 0:k.charAt(0))||"?"}),n.jsxs("div",{children:[n.jsx("p",{className:"text-sm font-medium text-white",children:E.nickname||"匿名用户"}),n.jsx("p",{className:"text-xs text-gray-500",children:E.phone||"-"})]})]}),n.jsx("p",{className:"text-xs text-gray-400",children:E.createdAt?new Date(E.createdAt).toLocaleDateString():"-"})]},E.id)}),i.length===0&&n.jsx("p",{className:"text-gray-500 text-center py-8",children:"暂无用户数据"})]})})]})]})]})}const jo=x.forwardRef(({className:r,...a},l)=>n.jsx("div",{className:"relative w-full overflow-auto",children:n.jsx("table",{ref:l,className:He("w-full caption-bottom text-sm",r),...a})}));jo.displayName="Table";const So=x.forwardRef(({className:r,...a},l)=>n.jsx("thead",{ref:l,className:He("[&_tr]:border-b",r),...a}));So.displayName="TableHeader";const Co=x.forwardRef(({className:r,...a},l)=>n.jsx("tbody",{ref:l,className:He("[&_tr:last-child]:border-0",r),...a}));Co.displayName="TableBody";const zn=x.forwardRef(({className:r,...a},l)=>n.jsx("tr",{ref:l,className:He("border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted",r),...a}));zn.displayName="TableRow";const et=x.forwardRef(({className:r,...a},l)=>n.jsx("th",{ref:l,className:He("h-12 px-4 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0",r),...a}));et.displayName="TableHead";const Ye=x.forwardRef(({className:r,...a},l)=>n.jsx("td",{ref:l,className:He("p-4 align-middle [&:has([role=checkbox])]:pr-0",r),...a}));Ye.displayName="TableCell";const Ab=yp("inline-flex items-center justify-center rounded-md border px-2 py-0.5 text-xs font-medium w-fit whitespace-nowrap shrink-0 transition-colors",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground",secondary:"border-transparent bg-secondary text-secondary-foreground",destructive:"border-transparent bg-destructive text-white",outline:"text-foreground"}},defaultVariants:{variant:"default"}});function Oe({className:r,variant:a,asChild:l=!1,...i}){const c=l?pp:"span";return n.jsx(c,{className:He(Ab({variant:a}),r),...i})}function Mb(){const[r,a]=x.useState([]),[l,i]=x.useState([]),[c,d]=x.useState(""),[f,m]=x.useState("all"),[p,g]=x.useState(!0);async function v(){g(!0);try{const[y,C]=await Promise.all([Ge("/api/orders"),Ge("/api/db/users")]);y!=null&&y.success&&y.orders&&a(y.orders),C!=null&&C.success&&C.users&&i(C.users)}catch(y){console.error("加载订单失败",y)}finally{g(!1)}}x.useEffect(()=>{v()},[]);const w=y=>{var C;return y.userNickname||((C=l.find(j=>j.id===y.userId))==null?void 0:C.nickname)||"匿名用户"},_=y=>{var C;return((C=l.find(j=>j.id===y))==null?void 0:C.phone)||"-"},E=y=>{const C=y.productType||y.type||"",j=y.description||"";if(j){if(C==="section"&&j.includes("章节")){if(j.includes("-")){const A=j.split("-");if(A.length>=3)return{name:`第${A[1]}章 第${A[2]}节`,type:"《一场Soul的创业实验》"}}return{name:j,type:"章节购买"}}return C==="fullbook"||j.includes("全书")?{name:"《一场Soul的创业实验》",type:"全书购买"}:C==="match"||j.includes("伙伴")?{name:"找伙伴匹配",type:"功能服务"}:{name:j,type:"其他"}}return C==="section"?{name:`章节 ${y.productId||y.sectionId||""}`,type:"单章"}:C==="fullbook"?{name:"《一场Soul的创业实验》",type:"全书"}:C==="match"?{name:"找伙伴匹配",type:"功能"}:{name:"未知商品",type:C||"其他"}},k=r.filter(y=>{const C=E(y),j=w(y).includes(c)||_(y.userId).includes(c)||C.name.includes(c)||y.orderSn&&y.orderSn.includes(c)||y.id&&y.id.includes(c),A=f==="all"||y.status===f||f==="completed"&&y.status==="paid";return j&&A}),S=r.filter(y=>y.status==="paid"||y.status==="completed").reduce((y,C)=>y+Number(C.amount||0),0),N=r.filter(y=>{const C=new Date().toDateString();return(y.status==="paid"||y.status==="completed")&&new Date(y.createdAt).toDateString()===C}).reduce((y,C)=>y+Number(C.amount||0),0);return n.jsxs("div",{className:"p-8 max-w-7xl mx-auto",children:[n.jsxs("div",{className:"flex justify-between items-center mb-8",children:[n.jsxs("div",{children:[n.jsx("h2",{className:"text-2xl font-bold text-white",children:"订单管理"}),n.jsxs("p",{className:"text-gray-400 mt-1",children:["共 ",r.length," 笔订单"]})]}),n.jsx("div",{className:"flex items-center gap-4",children:n.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[n.jsx("span",{className:"text-gray-400",children:"总收入:"}),n.jsxs("span",{className:"text-[#38bdac] font-bold",children:["¥",S.toFixed(2)]}),n.jsx("span",{className:"text-gray-600",children:"|"}),n.jsx("span",{className:"text-gray-400",children:"今日:"}),n.jsxs("span",{className:"text-[#FFD700] font-bold",children:["¥",N.toFixed(2)]})]})})]}),n.jsxs("div",{className:"flex items-center gap-4 mb-6",children:[n.jsxs("div",{className:"relative flex-1 max-w-md",children:[n.jsx(Br,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-gray-500"}),n.jsx(ae,{type:"text",placeholder:"搜索订单号/用户/章节...",className:"pl-10 bg-[#0f2137] border-gray-700 text-white placeholder:text-gray-500",value:c,onChange:y=>d(y.target.value)})]}),n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx(Tw,{className:"w-4 h-4 text-gray-400"}),n.jsxs("select",{value:f,onChange:y=>m(y.target.value),className:"bg-[#0f2137] border border-gray-700 text-white rounded-lg px-3 py-2 text-sm",children:[n.jsx("option",{value:"all",children:"全部状态"}),n.jsx("option",{value:"completed",children:"已完成"}),n.jsx("option",{value:"pending",children:"待支付"}),n.jsx("option",{value:"created",children:"已创建"}),n.jsx("option",{value:"failed",children:"已失败"})]})]}),n.jsxs(ye,{variant:"outline",className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:[n.jsx(up,{className:"w-4 h-4 mr-2"}),"导出"]})]}),n.jsx(_e,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:n.jsx(Pe,{className:"p-0",children:p?n.jsxs("div",{className:"flex items-center justify-center py-12",children:[n.jsx(Ze,{className:"w-6 h-6 text-[#38bdac] animate-spin"}),n.jsx("span",{className:"ml-2 text-gray-400",children:"加载中..."})]}):n.jsxs(jo,{children:[n.jsx(So,{children:n.jsxs(zn,{className:"bg-[#0a1628] hover:bg-[#0a1628] border-gray-700",children:[n.jsx(et,{className:"text-gray-400",children:"订单号"}),n.jsx(et,{className:"text-gray-400",children:"用户"}),n.jsx(et,{className:"text-gray-400",children:"商品"}),n.jsx(et,{className:"text-gray-400",children:"金额"}),n.jsx(et,{className:"text-gray-400",children:"支付方式"}),n.jsx(et,{className:"text-gray-400",children:"状态"}),n.jsx(et,{className:"text-gray-400",children:"分销佣金"}),n.jsx(et,{className:"text-gray-400",children:"下单时间"})]})}),n.jsxs(Co,{children:[k.map(y=>{const C=E(y);return n.jsxs(zn,{className:"hover:bg-[#0a1628] border-gray-700/50",children:[n.jsxs(Ye,{className:"font-mono text-xs text-gray-400",children:[(y.orderSn||y.id||"").slice(0,12),"..."]}),n.jsx(Ye,{children:n.jsxs("div",{children:[n.jsx("p",{className:"text-white text-sm",children:w(y)}),n.jsx("p",{className:"text-gray-500 text-xs",children:_(y.userId)})]})}),n.jsx(Ye,{children:n.jsxs("div",{children:[n.jsx("p",{className:"text-white text-sm",children:C.name}),n.jsx("p",{className:"text-gray-500 text-xs",children:C.type})]})}),n.jsxs(Ye,{className:"text-[#38bdac] font-bold",children:["¥",Number(y.amount||0).toFixed(2)]}),n.jsx(Ye,{className:"text-gray-300",children:y.paymentMethod==="wechat"?"微信支付":y.paymentMethod==="alipay"?"支付宝":y.paymentMethod||"微信支付"}),n.jsx(Ye,{children:y.status==="paid"||y.status==="completed"?n.jsx(Oe,{className:"bg-green-500/20 text-green-400 hover:bg-green-500/20 border-0",children:"已完成"}):y.status==="pending"||y.status==="created"?n.jsx(Oe,{className:"bg-yellow-500/20 text-yellow-400 hover:bg-yellow-500/20 border-0",children:"待支付"}):n.jsx(Oe,{className:"bg-red-500/20 text-red-400 hover:bg-red-500/20 border-0",children:"已失败"})}),n.jsx(Ye,{className:"text-[#FFD700]",children:y.referrerEarnings?`¥${Number(y.referrerEarnings).toFixed(2)}`:"-"}),n.jsx(Ye,{className:"text-gray-400 text-sm",children:new Date(y.createdAt).toLocaleString("zh-CN")})]},y.id)}),k.length===0&&n.jsx(zn,{children:n.jsx(Ye,{colSpan:8,className:"text-center py-12 text-gray-500",children:"暂无订单数据"})})]})]})})})]})}var Lb=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Db=Lb.reduce((r,a)=>{const l=mp(`Primitive.${a}`),i=x.forwardRef((c,d)=>{const{asChild:f,...m}=c,p=f?l:a;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),n.jsx(p,{...m,ref:d})});return i.displayName=`Primitive.${a}`,{...r,[a]:i}},{}),Ob="Label",Tp=x.forwardRef((r,a)=>n.jsx(Db.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())}}));Tp.displayName=Ob;var Ip=Tp;const te=x.forwardRef(({className:r,...a},l)=>n.jsx(Ip,{ref:l,className:He("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",r),...a}));te.displayName=Ip.displayName;function Ae(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 Fb(r,a){const l=x.createContext(a),i=d=>{const{children:f,...m}=d,p=x.useMemo(()=>m,Object.values(m));return n.jsx(l.Provider,{value:p,children:f})};i.displayName=r+"Provider";function c(d){const f=x.useContext(l);if(f)return f;if(a!==void 0)return a;throw new Error(`\`${d}\` must be used within \`${r}\``)}return[i,c]}function Nr(r,a=[]){let l=[];function i(d,f){const m=x.createContext(f),p=l.length;l=[...l,f];const g=w=>{var y;const{scope:_,children:E,...k}=w,S=((y=_==null?void 0:_[r])==null?void 0:y[p])||m,N=x.useMemo(()=>k,Object.values(k));return n.jsx(S.Provider,{value:N,children:E})};g.displayName=d+"Provider";function v(w,_){var S;const E=((S=_==null?void 0:_[r])==null?void 0:S[p])||m,k=x.useContext(E);if(k)return k;if(f!==void 0)return f;throw new Error(`\`${w}\` must be used within \`${d}\``)}return[g,v]}const c=()=>{const d=l.map(f=>x.createContext(f));return function(m){const p=(m==null?void 0:m[r])||d;return x.useMemo(()=>({[`__scope${r}`]:{...m,[r]:p}}),[m,p])}};return c.scopeName=r,[i,zb(c,...a)]}function zb(...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 f=i.reduce((m,{useScope:p,scopeName:g})=>{const w=p(d)[`__scope${g}`];return{...m,...w}},{});return x.useMemo(()=>({[`__scope${a.scopeName}`]:f}),[f])}};return l.scopeName=a.scopeName,l}var Et=globalThis!=null&&globalThis.document?x.useLayoutEffect:()=>{},$b=vo[" useId ".trim().toString()]||(()=>{}),Bb=0;function gr(r){const[a,l]=x.useState($b());return Et(()=>{l(i=>i??String(Bb++))},[r]),a?`radix-${a}`:""}var Ub=vo[" useInsertionEffect ".trim().toString()]||Et;function Vr({prop:r,defaultProp:a,onChange:l=()=>{},caller:i}){const[c,d,f]=Vb({defaultProp:a,onChange:l}),m=r!==void 0,p=m?r:c;{const v=x.useRef(r!==void 0);x.useEffect(()=>{const w=v.current;w!==m&&console.warn(`${i} is changing from ${w?"controlled":"uncontrolled"} to ${m?"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.`),v.current=m},[m,i])}const g=x.useCallback(v=>{var w;if(m){const _=Wb(v)?v(r):v;_!==r&&((w=f.current)==null||w.call(f,_))}else d(v)},[m,r,d,f]);return[p,g]}function Vb({defaultProp:r,onChange:a}){const[l,i]=x.useState(r),c=x.useRef(l),d=x.useRef(a);return Ub(()=>{d.current=a},[a]),x.useEffect(()=>{var f;c.current!==l&&((f=d.current)==null||f.call(d,l),c.current=l)},[l,c]),[l,i,d]}function Wb(r){return typeof r=="function"}function Ra(r){const a=Hb(r),l=x.forwardRef((i,c)=>{const{children:d,...f}=i,m=x.Children.toArray(d),p=m.find(Gb);if(p){const g=p.props.children,v=m.map(w=>w===p?x.Children.count(g)>1?x.Children.only(null):x.isValidElement(g)?g.props.children:null:w);return n.jsx(a,{...f,ref:c,children:x.isValidElement(g)?x.cloneElement(g,void 0,v):null})}return n.jsx(a,{...f,ref:c,children:d})});return l.displayName=`${r}.Slot`,l}function Hb(r){const a=x.forwardRef((l,i)=>{const{children:c,...d}=l;if(x.isValidElement(c)){const f=Yb(c),m=Qb(d,c.props);return c.type!==x.Fragment&&(m.ref=i?Eu(i,f):f),x.cloneElement(c,m)}return x.Children.count(c)>1?x.Children.only(null):null});return a.displayName=`${r}.SlotClone`,a}var Kb=Symbol("radix.slottable");function Gb(r){return x.isValidElement(r)&&typeof r.type=="function"&&"__radixId"in r.type&&r.type.__radixId===Kb}function Qb(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]=(...m)=>{const p=d(...m);return c(...m),p}:c&&(l[i]=c):i==="style"?l[i]={...c,...d}:i==="className"&&(l[i]=[c,d].filter(Boolean).join(" "))}return{...r,...l}}function Yb(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 Xb=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Le=Xb.reduce((r,a)=>{const l=Ra(`Primitive.${a}`),i=x.forwardRef((c,d)=>{const{asChild:f,...m}=c,p=f?l:a;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),n.jsx(p,{...m,ref:d})});return i.displayName=`Primitive.${a}`,{...r,[a]:i}},{});function qb(r,a){r&&Ia.flushSync(()=>r.dispatchEvent(a))}function yr(r){const a=x.useRef(r);return x.useEffect(()=>{a.current=r}),x.useMemo(()=>(...l)=>{var i;return(i=a.current)==null?void 0:i.call(a,...l)},[])}function Jb(r,a=globalThis==null?void 0:globalThis.document){const l=yr(r);x.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 Zb="DismissableLayer",lu="dismissableLayer.update",eN="dismissableLayer.pointerDownOutside",tN="dismissableLayer.focusOutside",wm,Ap=x.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Pu=x.forwardRef((r,a)=>{const{disableOutsidePointerEvents:l=!1,onEscapeKeyDown:i,onPointerDownOutside:c,onFocusOutside:d,onInteractOutside:f,onDismiss:m,...p}=r,g=x.useContext(Ap),[v,w]=x.useState(null),_=(v==null?void 0:v.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,E]=x.useState({}),k=We(a,W=>w(W)),S=Array.from(g.layers),[N]=[...g.layersWithOutsidePointerEventsDisabled].slice(-1),y=S.indexOf(N),C=v?S.indexOf(v):-1,j=g.layersWithOutsidePointerEventsDisabled.size>0,A=C>=y,z=sN(W=>{const V=W.target,le=[...g.branches].some(me=>me.contains(V));!A||le||(c==null||c(W),f==null||f(W),W.defaultPrevented||m==null||m())},_),K=aN(W=>{const V=W.target;[...g.branches].some(me=>me.contains(V))||(d==null||d(W),f==null||f(W),W.defaultPrevented||m==null||m())},_);return Jb(W=>{C===g.layers.size-1&&(i==null||i(W),!W.defaultPrevented&&m&&(W.preventDefault(),m()))},_),x.useEffect(()=>{if(v)return l&&(g.layersWithOutsidePointerEventsDisabled.size===0&&(wm=_.body.style.pointerEvents,_.body.style.pointerEvents="none"),g.layersWithOutsidePointerEventsDisabled.add(v)),g.layers.add(v),bm(),()=>{l&&g.layersWithOutsidePointerEventsDisabled.size===1&&(_.body.style.pointerEvents=wm)}},[v,_,l,g]),x.useEffect(()=>()=>{v&&(g.layers.delete(v),g.layersWithOutsidePointerEventsDisabled.delete(v),bm())},[v,g]),x.useEffect(()=>{const W=()=>E({});return document.addEventListener(lu,W),()=>document.removeEventListener(lu,W)},[]),n.jsx(Le.div,{...p,ref:k,style:{pointerEvents:j?A?"auto":"none":void 0,...r.style},onFocusCapture:Ae(r.onFocusCapture,K.onFocusCapture),onBlurCapture:Ae(r.onBlurCapture,K.onBlurCapture),onPointerDownCapture:Ae(r.onPointerDownCapture,z.onPointerDownCapture)})});Pu.displayName=Zb;var nN="DismissableLayerBranch",rN=x.forwardRef((r,a)=>{const l=x.useContext(Ap),i=x.useRef(null),c=We(a,i);return x.useEffect(()=>{const d=i.current;if(d)return l.branches.add(d),()=>{l.branches.delete(d)}},[l.branches]),n.jsx(Le.div,{...r,ref:c})});rN.displayName=nN;function sN(r,a=globalThis==null?void 0:globalThis.document){const l=yr(r),i=x.useRef(!1),c=x.useRef(()=>{});return x.useEffect(()=>{const d=m=>{if(m.target&&!i.current){let p=function(){Mp(eN,l,g,{discrete:!0})};const g={originalEvent:m};m.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},f=window.setTimeout(()=>{a.addEventListener("pointerdown",d)},0);return()=>{window.clearTimeout(f),a.removeEventListener("pointerdown",d),a.removeEventListener("click",c.current)}},[a,l]),{onPointerDownCapture:()=>i.current=!0}}function aN(r,a=globalThis==null?void 0:globalThis.document){const l=yr(r),i=x.useRef(!1);return x.useEffect(()=>{const c=d=>{d.target&&!i.current&&Mp(tN,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 bm(){const r=new CustomEvent(lu);document.dispatchEvent(r)}function Mp(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?qb(c,d):c.dispatchEvent(d)}var Dc="focusScope.autoFocusOnMount",Oc="focusScope.autoFocusOnUnmount",Nm={bubbles:!1,cancelable:!0},lN="FocusScope",Ru=x.forwardRef((r,a)=>{const{loop:l=!1,trapped:i=!1,onMountAutoFocus:c,onUnmountAutoFocus:d,...f}=r,[m,p]=x.useState(null),g=yr(c),v=yr(d),w=x.useRef(null),_=We(a,S=>p(S)),E=x.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;x.useEffect(()=>{if(i){let S=function(j){if(E.paused||!m)return;const A=j.target;m.contains(A)?w.current=A:fr(w.current,{select:!0})},N=function(j){if(E.paused||!m)return;const A=j.relatedTarget;A!==null&&(m.contains(A)||fr(w.current,{select:!0}))},y=function(j){if(document.activeElement===document.body)for(const z of j)z.removedNodes.length>0&&fr(m)};document.addEventListener("focusin",S),document.addEventListener("focusout",N);const C=new MutationObserver(y);return m&&C.observe(m,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",S),document.removeEventListener("focusout",N),C.disconnect()}}},[i,m,E.paused]),x.useEffect(()=>{if(m){Sm.add(E);const S=document.activeElement;if(!m.contains(S)){const y=new CustomEvent(Dc,Nm);m.addEventListener(Dc,g),m.dispatchEvent(y),y.defaultPrevented||(oN(fN(Lp(m)),{select:!0}),document.activeElement===S&&fr(m))}return()=>{m.removeEventListener(Dc,g),setTimeout(()=>{const y=new CustomEvent(Oc,Nm);m.addEventListener(Oc,v),m.dispatchEvent(y),y.defaultPrevented||fr(S??document.body,{select:!0}),m.removeEventListener(Oc,v),Sm.remove(E)},0)}}},[m,g,v,E]);const k=x.useCallback(S=>{if(!l&&!i||E.paused)return;const N=S.key==="Tab"&&!S.altKey&&!S.ctrlKey&&!S.metaKey,y=document.activeElement;if(N&&y){const C=S.currentTarget,[j,A]=iN(C);j&&A?!S.shiftKey&&y===A?(S.preventDefault(),l&&fr(j,{select:!0})):S.shiftKey&&y===j&&(S.preventDefault(),l&&fr(A,{select:!0})):y===C&&S.preventDefault()}},[l,i,E.paused]);return n.jsx(Le.div,{tabIndex:-1,...f,ref:_,onKeyDown:k})});Ru.displayName=lN;function oN(r,{select:a=!1}={}){const l=document.activeElement;for(const i of r)if(fr(i,{select:a}),document.activeElement!==l)return}function iN(r){const a=Lp(r),l=jm(a,r),i=jm(a.reverse(),r);return[l,i]}function Lp(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 jm(r,a){for(const l of r)if(!cN(l,{upTo:a}))return l}function cN(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 uN(r){return r instanceof HTMLInputElement&&"select"in r}function fr(r,{select:a=!1}={}){if(r&&r.focus){const l=document.activeElement;r.focus({preventScroll:!0}),r!==l&&uN(r)&&a&&r.select()}}var Sm=dN();function dN(){let r=[];return{add(a){const l=r[0];a!==l&&(l==null||l.pause()),r=Cm(r,a),r.unshift(a)},remove(a){var l;r=Cm(r,a),(l=r[0])==null||l.resume()}}}function Cm(r,a){const l=[...r],i=l.indexOf(a);return i!==-1&&l.splice(i,1),l}function fN(r){return r.filter(a=>a.tagName!=="A")}var hN="Portal",Tu=x.forwardRef((r,a)=>{var m;const{container:l,...i}=r,[c,d]=x.useState(!1);Et(()=>d(!0),[]);const f=l||c&&((m=globalThis==null?void 0:globalThis.document)==null?void 0:m.body);return f?Yy.createPortal(n.jsx(Le.div,{...i,ref:a}),f):null});Tu.displayName=hN;function mN(r,a){return x.useReducer((l,i)=>a[l][i]??l,r)}var Ma=r=>{const{present:a,children:l}=r,i=pN(a),c=typeof l=="function"?l({present:i.isPresent}):x.Children.only(l),d=We(i.ref,xN(c));return typeof l=="function"||i.isPresent?x.cloneElement(c,{ref:d}):null};Ma.displayName="Presence";function pN(r){const[a,l]=x.useState(),i=x.useRef(null),c=x.useRef(r),d=x.useRef("none"),f=r?"mounted":"unmounted",[m,p]=mN(f,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return x.useEffect(()=>{const g=Gl(i.current);d.current=m==="mounted"?g:"none"},[m]),Et(()=>{const g=i.current,v=c.current;if(v!==r){const _=d.current,E=Gl(g);r?p("MOUNT"):E==="none"||(g==null?void 0:g.display)==="none"?p("UNMOUNT"):p(v&&_!==E?"ANIMATION_OUT":"UNMOUNT"),c.current=r}},[r,p]),Et(()=>{if(a){let g;const v=a.ownerDocument.defaultView??window,w=E=>{const S=Gl(i.current).includes(CSS.escape(E.animationName));if(E.target===a&&S&&(p("ANIMATION_END"),!c.current)){const N=a.style.animationFillMode;a.style.animationFillMode="forwards",g=v.setTimeout(()=>{a.style.animationFillMode==="forwards"&&(a.style.animationFillMode=N)})}},_=E=>{E.target===a&&(d.current=Gl(i.current))};return a.addEventListener("animationstart",_),a.addEventListener("animationcancel",w),a.addEventListener("animationend",w),()=>{v.clearTimeout(g),a.removeEventListener("animationstart",_),a.removeEventListener("animationcancel",w),a.removeEventListener("animationend",w)}}else p("ANIMATION_END")},[a,p]),{isPresent:["mounted","unmountSuspended"].includes(m),ref:x.useCallback(g=>{i.current=g?getComputedStyle(g):null,l(g)},[])}}function Gl(r){return(r==null?void 0:r.animationName)||"none"}function xN(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 Fc=0;function Dp(){x.useEffect(()=>{const r=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",r[0]??km()),document.body.insertAdjacentElement("beforeend",r[1]??km()),Fc++,()=>{Fc===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(a=>a.remove()),Fc--}},[])}function km(){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 wn=function(){return wn=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},wn.apply(this,arguments)};function Op(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 gN(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 eo="right-scroll-bar-position",to="width-before-scroll-bar",yN="with-scroll-bars-hidden",vN="--removed-body-scroll-bar-size";function zc(r,a){return typeof r=="function"?r(a):r&&(r.current=a),r}function wN(r,a){var l=x.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 bN=typeof window<"u"?x.useLayoutEffect:x.useEffect,Em=new WeakMap;function NN(r,a){var l=wN(null,function(i){return r.forEach(function(c){return zc(c,i)})});return bN(function(){var i=Em.get(l);if(i){var c=new Set(i),d=new Set(r),f=l.current;c.forEach(function(m){d.has(m)||zc(m,null)}),d.forEach(function(m){c.has(m)||zc(m,f)})}Em.set(l,r)},[r]),l}function jN(r){return r}function SN(r,a){a===void 0&&(a=jN);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 f=a(d,i);return l.push(f),function(){l=l.filter(function(m){return m!==f})}},assignSyncMedium:function(d){for(i=!0;l.length;){var f=l;l=[],f.forEach(d)}l={push:function(m){return d(m)},filter:function(){return l}}},assignMedium:function(d){i=!0;var f=[];if(l.length){var m=l;l=[],m.forEach(d),f=l}var p=function(){var v=f;f=[],v.forEach(d)},g=function(){return Promise.resolve().then(p)};g(),l={push:function(v){f.push(v),g()},filter:function(v){return f=f.filter(v),l}}}};return c}function CN(r){r===void 0&&(r={});var a=SN(null);return a.options=wn({async:!0,ssr:!1},r),a}var Fp=function(r){var a=r.sideCar,l=Op(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 x.createElement(i,wn({},l))};Fp.isSideCarExport=!0;function kN(r,a){return r.useMedium(a),Fp}var zp=CN(),$c=function(){},ko=x.forwardRef(function(r,a){var l=x.useRef(null),i=x.useState({onScrollCapture:$c,onWheelCapture:$c,onTouchMoveCapture:$c}),c=i[0],d=i[1],f=r.forwardProps,m=r.children,p=r.className,g=r.removeScrollBar,v=r.enabled,w=r.shards,_=r.sideCar,E=r.noRelative,k=r.noIsolation,S=r.inert,N=r.allowPinchZoom,y=r.as,C=y===void 0?"div":y,j=r.gapMode,A=Op(r,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),z=_,K=NN([l,a]),W=wn(wn({},A),c);return x.createElement(x.Fragment,null,v&&x.createElement(z,{sideCar:zp,removeScrollBar:g,shards:w,noRelative:E,noIsolation:k,inert:S,setCallbacks:d,allowPinchZoom:!!N,lockRef:l,gapMode:j}),f?x.cloneElement(x.Children.only(m),wn(wn({},W),{ref:K})):x.createElement(C,wn({},W,{className:p,ref:K}),m))});ko.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};ko.classNames={fullWidth:to,zeroRight:eo};var EN=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function _N(){if(!document)return null;var r=document.createElement("style");r.type="text/css";var a=EN();return a&&r.setAttribute("nonce",a),r}function PN(r,a){r.styleSheet?r.styleSheet.cssText=a:r.appendChild(document.createTextNode(a))}function RN(r){var a=document.head||document.getElementsByTagName("head")[0];a.appendChild(r)}var TN=function(){var r=0,a=null;return{add:function(l){r==0&&(a=_N())&&(PN(a,l),RN(a)),r++},remove:function(){r--,!r&&a&&(a.parentNode&&a.parentNode.removeChild(a),a=null)}}},IN=function(){var r=TN();return function(a,l){x.useEffect(function(){return r.add(a),function(){r.remove()}},[a&&l])}},$p=function(){var r=IN(),a=function(l){var i=l.styles,c=l.dynamic;return r(i,c),null};return a},AN={left:0,top:0,right:0,gap:0},Bc=function(r){return parseInt(r||"",10)||0},MN=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[Bc(l),Bc(i),Bc(c)]},LN=function(r){if(r===void 0&&(r="margin"),typeof window>"u")return AN;var a=MN(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])}},DN=$p(),Es="data-scroll-locked",ON=function(r,a,l,i){var c=r.left,d=r.top,f=r.right,m=r.gap;return l===void 0&&(l="margin"),`
|
||
.`.concat(yN,` {
|
||
overflow: hidden `).concat(i,`;
|
||
padding-right: `).concat(m,"px ").concat(i,`;
|
||
}
|
||
body[`).concat(Es,`] {
|
||
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(f,`px;
|
||
margin-left:0;
|
||
margin-top:0;
|
||
margin-right: `).concat(m,"px ").concat(i,`;
|
||
`),l==="padding"&&"padding-right: ".concat(m,"px ").concat(i,";")].filter(Boolean).join(""),`
|
||
}
|
||
|
||
.`).concat(eo,` {
|
||
right: `).concat(m,"px ").concat(i,`;
|
||
}
|
||
|
||
.`).concat(to,` {
|
||
margin-right: `).concat(m,"px ").concat(i,`;
|
||
}
|
||
|
||
.`).concat(eo," .").concat(eo,` {
|
||
right: 0 `).concat(i,`;
|
||
}
|
||
|
||
.`).concat(to," .").concat(to,` {
|
||
margin-right: 0 `).concat(i,`;
|
||
}
|
||
|
||
body[`).concat(Es,`] {
|
||
`).concat(vN,": ").concat(m,`px;
|
||
}
|
||
`)},_m=function(){var r=parseInt(document.body.getAttribute(Es)||"0",10);return isFinite(r)?r:0},FN=function(){x.useEffect(function(){return document.body.setAttribute(Es,(_m()+1).toString()),function(){var r=_m()-1;r<=0?document.body.removeAttribute(Es):document.body.setAttribute(Es,r.toString())}},[])},zN=function(r){var a=r.noRelative,l=r.noImportant,i=r.gapMode,c=i===void 0?"margin":i;FN();var d=x.useMemo(function(){return LN(c)},[c]);return x.createElement(DN,{styles:ON(d,!a,c,l?"":"!important")})},ou=!1;if(typeof window<"u")try{var Ql=Object.defineProperty({},"passive",{get:function(){return ou=!0,!0}});window.addEventListener("test",Ql,Ql),window.removeEventListener("test",Ql,Ql)}catch{ou=!1}var bs=ou?{passive:!1}:!1,$N=function(r){return r.tagName==="TEXTAREA"},Bp=function(r,a){if(!(r instanceof Element))return!1;var l=window.getComputedStyle(r);return l[a]!=="hidden"&&!(l.overflowY===l.overflowX&&!$N(r)&&l[a]==="visible")},BN=function(r){return Bp(r,"overflowY")},UN=function(r){return Bp(r,"overflowX")},Pm=function(r,a){var l=a.ownerDocument,i=a;do{typeof ShadowRoot<"u"&&i instanceof ShadowRoot&&(i=i.host);var c=Up(r,i);if(c){var d=Vp(r,i),f=d[1],m=d[2];if(f>m)return!0}i=i.parentNode}while(i&&i!==l.body);return!1},VN=function(r){var a=r.scrollTop,l=r.scrollHeight,i=r.clientHeight;return[a,l,i]},WN=function(r){var a=r.scrollLeft,l=r.scrollWidth,i=r.clientWidth;return[a,l,i]},Up=function(r,a){return r==="v"?BN(a):UN(a)},Vp=function(r,a){return r==="v"?VN(a):WN(a)},HN=function(r,a){return r==="h"&&a==="rtl"?-1:1},KN=function(r,a,l,i,c){var d=HN(r,window.getComputedStyle(a).direction),f=d*i,m=l.target,p=a.contains(m),g=!1,v=f>0,w=0,_=0;do{if(!m)break;var E=Vp(r,m),k=E[0],S=E[1],N=E[2],y=S-N-d*k;(k||y)&&Up(r,m)&&(w+=y,_+=k);var C=m.parentNode;m=C&&C.nodeType===Node.DOCUMENT_FRAGMENT_NODE?C.host:C}while(!p&&m!==document.body||p&&(a.contains(m)||a===m));return(v&&Math.abs(w)<1||!v&&Math.abs(_)<1)&&(g=!0),g},Yl=function(r){return"changedTouches"in r?[r.changedTouches[0].clientX,r.changedTouches[0].clientY]:[0,0]},Rm=function(r){return[r.deltaX,r.deltaY]},Tm=function(r){return r&&"current"in r?r.current:r},GN=function(r,a){return r[0]===a[0]&&r[1]===a[1]},QN=function(r){return`
|
||
.block-interactivity-`.concat(r,` {pointer-events: none;}
|
||
.allow-interactivity-`).concat(r,` {pointer-events: all;}
|
||
`)},YN=0,Ns=[];function XN(r){var a=x.useRef([]),l=x.useRef([0,0]),i=x.useRef(),c=x.useState(YN++)[0],d=x.useState($p)[0],f=x.useRef(r);x.useEffect(function(){f.current=r},[r]),x.useEffect(function(){if(r.inert){document.body.classList.add("block-interactivity-".concat(c));var S=gN([r.lockRef.current],(r.shards||[]).map(Tm),!0).filter(Boolean);return S.forEach(function(N){return N.classList.add("allow-interactivity-".concat(c))}),function(){document.body.classList.remove("block-interactivity-".concat(c)),S.forEach(function(N){return N.classList.remove("allow-interactivity-".concat(c))})}}},[r.inert,r.lockRef.current,r.shards]);var m=x.useCallback(function(S,N){if("touches"in S&&S.touches.length===2||S.type==="wheel"&&S.ctrlKey)return!f.current.allowPinchZoom;var y=Yl(S),C=l.current,j="deltaX"in S?S.deltaX:C[0]-y[0],A="deltaY"in S?S.deltaY:C[1]-y[1],z,K=S.target,W=Math.abs(j)>Math.abs(A)?"h":"v";if("touches"in S&&W==="h"&&K.type==="range")return!1;var V=window.getSelection(),le=V&&V.anchorNode,me=le?le===K||le.contains(K):!1;if(me)return!1;var oe=Pm(W,K);if(!oe)return!0;if(oe?z=W:(z=W==="v"?"h":"v",oe=Pm(W,K)),!oe)return!1;if(!i.current&&"changedTouches"in S&&(j||A)&&(i.current=z),!z)return!0;var fe=i.current||z;return KN(fe,N,S,fe==="h"?j:A)},[]),p=x.useCallback(function(S){var N=S;if(!(!Ns.length||Ns[Ns.length-1]!==d)){var y="deltaY"in N?Rm(N):Yl(N),C=a.current.filter(function(z){return z.name===N.type&&(z.target===N.target||N.target===z.shadowParent)&&GN(z.delta,y)})[0];if(C&&C.should){N.cancelable&&N.preventDefault();return}if(!C){var j=(f.current.shards||[]).map(Tm).filter(Boolean).filter(function(z){return z.contains(N.target)}),A=j.length>0?m(N,j[0]):!f.current.noIsolation;A&&N.cancelable&&N.preventDefault()}}},[]),g=x.useCallback(function(S,N,y,C){var j={name:S,delta:N,target:y,should:C,shadowParent:qN(y)};a.current.push(j),setTimeout(function(){a.current=a.current.filter(function(A){return A!==j})},1)},[]),v=x.useCallback(function(S){l.current=Yl(S),i.current=void 0},[]),w=x.useCallback(function(S){g(S.type,Rm(S),S.target,m(S,r.lockRef.current))},[]),_=x.useCallback(function(S){g(S.type,Yl(S),S.target,m(S,r.lockRef.current))},[]);x.useEffect(function(){return Ns.push(d),r.setCallbacks({onScrollCapture:w,onWheelCapture:w,onTouchMoveCapture:_}),document.addEventListener("wheel",p,bs),document.addEventListener("touchmove",p,bs),document.addEventListener("touchstart",v,bs),function(){Ns=Ns.filter(function(S){return S!==d}),document.removeEventListener("wheel",p,bs),document.removeEventListener("touchmove",p,bs),document.removeEventListener("touchstart",v,bs)}},[]);var E=r.removeScrollBar,k=r.inert;return x.createElement(x.Fragment,null,k?x.createElement(d,{styles:QN(c)}):null,E?x.createElement(zN,{noRelative:r.noRelative,gapMode:r.gapMode}):null)}function qN(r){for(var a=null;r!==null;)r instanceof ShadowRoot&&(a=r.host,r=r.host),r=r.parentNode;return a}const JN=kN(zp,XN);var Iu=x.forwardRef(function(r,a){return x.createElement(ko,wn({},r,{ref:a,sideCar:JN}))});Iu.classNames=ko.classNames;var ZN=function(r){if(typeof document>"u")return null;var a=Array.isArray(r)?r[0]:r;return a.ownerDocument.body},js=new WeakMap,Xl=new WeakMap,ql={},Uc=0,Wp=function(r){return r&&(r.host||Wp(r.parentNode))},ej=function(r,a){return a.map(function(l){if(r.contains(l))return l;var i=Wp(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})},tj=function(r,a,l,i){var c=ej(a,Array.isArray(r)?r:[r]);ql[l]||(ql[l]=new WeakMap);var d=ql[l],f=[],m=new Set,p=new Set(c),g=function(w){!w||m.has(w)||(m.add(w),g(w.parentNode))};c.forEach(g);var v=function(w){!w||p.has(w)||Array.prototype.forEach.call(w.children,function(_){if(m.has(_))v(_);else try{var E=_.getAttribute(i),k=E!==null&&E!=="false",S=(js.get(_)||0)+1,N=(d.get(_)||0)+1;js.set(_,S),d.set(_,N),f.push(_),S===1&&k&&Xl.set(_,!0),N===1&&_.setAttribute(l,"true"),k||_.setAttribute(i,"true")}catch(y){console.error("aria-hidden: cannot operate on ",_,y)}})};return v(a),m.clear(),Uc++,function(){f.forEach(function(w){var _=js.get(w)-1,E=d.get(w)-1;js.set(w,_),d.set(w,E),_||(Xl.has(w)||w.removeAttribute(i),Xl.delete(w)),E||w.removeAttribute(l)}),Uc--,Uc||(js=new WeakMap,js=new WeakMap,Xl=new WeakMap,ql={})}},Hp=function(r,a,l){l===void 0&&(l="data-aria-hidden");var i=Array.from(Array.isArray(r)?r:[r]),c=ZN(r);return c?(i.push.apply(i,Array.from(c.querySelectorAll("[aria-live], script"))),tj(i,c,l,"aria-hidden")):function(){return null}},Eo="Dialog",[Kp]=Nr(Eo),[nj,dn]=Kp(Eo),Gp=r=>{const{__scopeDialog:a,children:l,open:i,defaultOpen:c,onOpenChange:d,modal:f=!0}=r,m=x.useRef(null),p=x.useRef(null),[g,v]=Vr({prop:i,defaultProp:c??!1,onChange:d,caller:Eo});return n.jsx(nj,{scope:a,triggerRef:m,contentRef:p,contentId:gr(),titleId:gr(),descriptionId:gr(),open:g,onOpenChange:v,onOpenToggle:x.useCallback(()=>v(w=>!w),[v]),modal:f,children:l})};Gp.displayName=Eo;var Qp="DialogTrigger",rj=x.forwardRef((r,a)=>{const{__scopeDialog:l,...i}=r,c=dn(Qp,l),d=We(a,c.triggerRef);return n.jsx(Le.button,{type:"button","aria-haspopup":"dialog","aria-expanded":c.open,"aria-controls":c.contentId,"data-state":Lu(c.open),...i,ref:d,onClick:Ae(r.onClick,c.onOpenToggle)})});rj.displayName=Qp;var Au="DialogPortal",[sj,Yp]=Kp(Au,{forceMount:void 0}),Xp=r=>{const{__scopeDialog:a,forceMount:l,children:i,container:c}=r,d=dn(Au,a);return n.jsx(sj,{scope:a,forceMount:l,children:x.Children.map(i,f=>n.jsx(Ma,{present:l||d.open,children:n.jsx(Tu,{asChild:!0,container:c,children:f})}))})};Xp.displayName=Au;var fo="DialogOverlay",qp=x.forwardRef((r,a)=>{const l=Yp(fo,r.__scopeDialog),{forceMount:i=l.forceMount,...c}=r,d=dn(fo,r.__scopeDialog);return d.modal?n.jsx(Ma,{present:i||d.open,children:n.jsx(lj,{...c,ref:a})}):null});qp.displayName=fo;var aj=Ra("DialogOverlay.RemoveScroll"),lj=x.forwardRef((r,a)=>{const{__scopeDialog:l,...i}=r,c=dn(fo,l);return n.jsx(Iu,{as:aj,allowPinchZoom:!0,shards:[c.contentRef],children:n.jsx(Le.div,{"data-state":Lu(c.open),...i,ref:a,style:{pointerEvents:"auto",...i.style}})})}),Wr="DialogContent",Jp=x.forwardRef((r,a)=>{const l=Yp(Wr,r.__scopeDialog),{forceMount:i=l.forceMount,...c}=r,d=dn(Wr,r.__scopeDialog);return n.jsx(Ma,{present:i||d.open,children:d.modal?n.jsx(oj,{...c,ref:a}):n.jsx(ij,{...c,ref:a})})});Jp.displayName=Wr;var oj=x.forwardRef((r,a)=>{const l=dn(Wr,r.__scopeDialog),i=x.useRef(null),c=We(a,l.contentRef,i);return x.useEffect(()=>{const d=i.current;if(d)return Hp(d)},[]),n.jsx(Zp,{...r,ref:c,trapFocus:l.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Ae(r.onCloseAutoFocus,d=>{var f;d.preventDefault(),(f=l.triggerRef.current)==null||f.focus()}),onPointerDownOutside:Ae(r.onPointerDownOutside,d=>{const f=d.detail.originalEvent,m=f.button===0&&f.ctrlKey===!0;(f.button===2||m)&&d.preventDefault()}),onFocusOutside:Ae(r.onFocusOutside,d=>d.preventDefault())})}),ij=x.forwardRef((r,a)=>{const l=dn(Wr,r.__scopeDialog),i=x.useRef(!1),c=x.useRef(!1);return n.jsx(Zp,{...r,ref:a,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:d=>{var f,m;(f=r.onCloseAutoFocus)==null||f.call(r,d),d.defaultPrevented||(i.current||(m=l.triggerRef.current)==null||m.focus(),d.preventDefault()),i.current=!1,c.current=!1},onInteractOutside:d=>{var p,g;(p=r.onInteractOutside)==null||p.call(r,d),d.defaultPrevented||(i.current=!0,d.detail.originalEvent.type==="pointerdown"&&(c.current=!0));const f=d.target;((g=l.triggerRef.current)==null?void 0:g.contains(f))&&d.preventDefault(),d.detail.originalEvent.type==="focusin"&&c.current&&d.preventDefault()}})}),Zp=x.forwardRef((r,a)=>{const{__scopeDialog:l,trapFocus:i,onOpenAutoFocus:c,onCloseAutoFocus:d,...f}=r,m=dn(Wr,l),p=x.useRef(null),g=We(a,p);return Dp(),n.jsxs(n.Fragment,{children:[n.jsx(Ru,{asChild:!0,loop:!0,trapped:i,onMountAutoFocus:c,onUnmountAutoFocus:d,children:n.jsx(Pu,{role:"dialog",id:m.contentId,"aria-describedby":m.descriptionId,"aria-labelledby":m.titleId,"data-state":Lu(m.open),...f,ref:g,onDismiss:()=>m.onOpenChange(!1)})}),n.jsxs(n.Fragment,{children:[n.jsx(uj,{titleId:m.titleId}),n.jsx(fj,{contentRef:p,descriptionId:m.descriptionId})]})]})}),Mu="DialogTitle",ex=x.forwardRef((r,a)=>{const{__scopeDialog:l,...i}=r,c=dn(Mu,l);return n.jsx(Le.h2,{id:c.titleId,...i,ref:a})});ex.displayName=Mu;var tx="DialogDescription",cj=x.forwardRef((r,a)=>{const{__scopeDialog:l,...i}=r,c=dn(tx,l);return n.jsx(Le.p,{id:c.descriptionId,...i,ref:a})});cj.displayName=tx;var nx="DialogClose",rx=x.forwardRef((r,a)=>{const{__scopeDialog:l,...i}=r,c=dn(nx,l);return n.jsx(Le.button,{type:"button",...i,ref:a,onClick:Ae(r.onClick,()=>c.onOpenChange(!1))})});rx.displayName=nx;function Lu(r){return r?"open":"closed"}var sx="DialogTitleWarning",[MC,ax]=Fb(sx,{contentName:Wr,titleName:Mu,docsSlug:"dialog"}),uj=({titleId:r})=>{const a=ax(sx),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 x.useEffect(()=>{r&&(document.getElementById(r)||console.error(l))},[l,r]),null},dj="DialogDescriptionWarning",fj=({contentRef:r,descriptionId:a})=>{const i=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${ax(dj).contentName}}.`;return x.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},hj=Gp,mj=Xp,pj=qp,xj=Jp,gj=ex,yj=rx;function Ln(r){return n.jsx(hj,{"data-slot":"dialog",...r})}function vj(r){return n.jsx(mj,{...r})}function wj({className:r,...a}){return n.jsx(pj,{className:He("fixed inset-0 z-50 bg-black/50",r),...a})}function Dn({className:r,children:a,showCloseButton:l=!0,...i}){return n.jsxs(vj,{children:[n.jsx(wj,{}),n.jsxs(xj,{className:He("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&&n.jsxs(yj,{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:[n.jsx(Ur,{className:"h-4 w-4"}),n.jsx("span",{className:"sr-only",children:"Close"})]})]})]})}function On({className:r,...a}){return n.jsx("div",{className:He("flex flex-col gap-2 text-center sm:text-left",r),...a})}function pr({className:r,...a}){return n.jsx("div",{className:He("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",r),...a})}function Fn(r){return n.jsx(gj,{className:"text-lg font-semibold leading-none",...r})}function Du(r){const a=x.useRef({value:r,previous:r});return x.useMemo(()=>(a.current.value!==r&&(a.current.previous=a.current.value,a.current.value=r),a.current.previous),[r])}function Ou(r){const[a,l]=x.useState(void 0);return Et(()=>{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 f,m;if("borderBoxSize"in d){const p=d.borderBoxSize,g=Array.isArray(p)?p[0]:p;f=g.inlineSize,m=g.blockSize}else f=r.offsetWidth,m=r.offsetHeight;l({width:f,height:m})});return i.observe(r,{box:"border-box"}),()=>i.unobserve(r)}else l(void 0)},[r]),a}var _o="Switch",[bj]=Nr(_o),[Nj,jj]=bj(_o),lx=x.forwardRef((r,a)=>{const{__scopeSwitch:l,name:i,checked:c,defaultChecked:d,required:f,disabled:m,value:p="on",onCheckedChange:g,form:v,...w}=r,[_,E]=x.useState(null),k=We(a,j=>E(j)),S=x.useRef(!1),N=_?v||!!_.closest("form"):!0,[y,C]=Vr({prop:c,defaultProp:d??!1,onChange:g,caller:_o});return n.jsxs(Nj,{scope:l,checked:y,disabled:m,children:[n.jsx(Le.button,{type:"button",role:"switch","aria-checked":y,"aria-required":f,"data-state":ux(y),"data-disabled":m?"":void 0,disabled:m,value:p,...w,ref:k,onClick:Ae(r.onClick,j=>{C(A=>!A),N&&(S.current=j.isPropagationStopped(),S.current||j.stopPropagation())})}),N&&n.jsx(cx,{control:_,bubbles:!S.current,name:i,value:p,checked:y,required:f,disabled:m,form:v,style:{transform:"translateX(-100%)"}})]})});lx.displayName=_o;var ox="SwitchThumb",ix=x.forwardRef((r,a)=>{const{__scopeSwitch:l,...i}=r,c=jj(ox,l);return n.jsx(Le.span,{"data-state":ux(c.checked),"data-disabled":c.disabled?"":void 0,...i,ref:a})});ix.displayName=ox;var Sj="SwitchBubbleInput",cx=x.forwardRef(({__scopeSwitch:r,control:a,checked:l,bubbles:i=!0,...c},d)=>{const f=x.useRef(null),m=We(f,d),p=Du(l),g=Ou(a);return x.useEffect(()=>{const v=f.current;if(!v)return;const w=window.HTMLInputElement.prototype,E=Object.getOwnPropertyDescriptor(w,"checked").set;if(p!==l&&E){const k=new Event("click",{bubbles:i});E.call(v,l),v.dispatchEvent(k)}},[p,l,i]),n.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:l,...c,tabIndex:-1,ref:m,style:{...c.style,...g,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});cx.displayName=Sj;function ux(r){return r?"checked":"unchecked"}var dx=lx,Cj=ix;const rt=x.forwardRef(({className:r,...a},l)=>n.jsx(dx,{className:He("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-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input",r),...a,ref:l,children:n.jsx(Cj,{className:He("pointer-events-none block h-4 w-4 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-4 data-[state=unchecked]:translate-x-0")})}));rt.displayName=dx.displayName;function Fu(r){const a=r+"CollectionProvider",[l,i]=Nr(a),[c,d]=l(a,{collectionRef:{current:null},itemMap:new Map}),f=S=>{const{scope:N,children:y}=S,C=dr.useRef(null),j=dr.useRef(new Map).current;return n.jsx(c,{scope:N,itemMap:j,collectionRef:C,children:y})};f.displayName=a;const m=r+"CollectionSlot",p=Ra(m),g=dr.forwardRef((S,N)=>{const{scope:y,children:C}=S,j=d(m,y),A=We(N,j.collectionRef);return n.jsx(p,{ref:A,children:C})});g.displayName=m;const v=r+"CollectionItemSlot",w="data-radix-collection-item",_=Ra(v),E=dr.forwardRef((S,N)=>{const{scope:y,children:C,...j}=S,A=dr.useRef(null),z=We(N,A),K=d(v,y);return dr.useEffect(()=>(K.itemMap.set(A,{ref:A,...j}),()=>void K.itemMap.delete(A))),n.jsx(_,{[w]:"",ref:z,children:C})});E.displayName=v;function k(S){const N=d(r+"CollectionConsumer",S);return dr.useCallback(()=>{const C=N.collectionRef.current;if(!C)return[];const j=Array.from(C.querySelectorAll(`[${w}]`));return Array.from(N.itemMap.values()).sort((K,W)=>j.indexOf(K.ref.current)-j.indexOf(W.ref.current))},[N.collectionRef,N.itemMap])}return[{Provider:f,Slot:g,ItemSlot:E},k,i]}var kj=x.createContext(void 0);function Po(r){const a=x.useContext(kj);return r||a||"ltr"}var Vc="rovingFocusGroup.onEntryFocus",Ej={bubbles:!1,cancelable:!0},La="RovingFocusGroup",[iu,fx,_j]=Fu(La),[Pj,hx]=Nr(La,[_j]),[Rj,Tj]=Pj(La),mx=x.forwardRef((r,a)=>n.jsx(iu.Provider,{scope:r.__scopeRovingFocusGroup,children:n.jsx(iu.Slot,{scope:r.__scopeRovingFocusGroup,children:n.jsx(Ij,{...r,ref:a})})}));mx.displayName=La;var Ij=x.forwardRef((r,a)=>{const{__scopeRovingFocusGroup:l,orientation:i,loop:c=!1,dir:d,currentTabStopId:f,defaultCurrentTabStopId:m,onCurrentTabStopIdChange:p,onEntryFocus:g,preventScrollOnEntryFocus:v=!1,...w}=r,_=x.useRef(null),E=We(a,_),k=Po(d),[S,N]=Vr({prop:f,defaultProp:m??null,onChange:p,caller:La}),[y,C]=x.useState(!1),j=yr(g),A=fx(l),z=x.useRef(!1),[K,W]=x.useState(0);return x.useEffect(()=>{const V=_.current;if(V)return V.addEventListener(Vc,j),()=>V.removeEventListener(Vc,j)},[j]),n.jsx(Rj,{scope:l,orientation:i,dir:k,loop:c,currentTabStopId:S,onItemFocus:x.useCallback(V=>N(V),[N]),onItemShiftTab:x.useCallback(()=>C(!0),[]),onFocusableItemAdd:x.useCallback(()=>W(V=>V+1),[]),onFocusableItemRemove:x.useCallback(()=>W(V=>V-1),[]),children:n.jsx(Le.div,{tabIndex:y||K===0?-1:0,"data-orientation":i,...w,ref:E,style:{outline:"none",...r.style},onMouseDown:Ae(r.onMouseDown,()=>{z.current=!0}),onFocus:Ae(r.onFocus,V=>{const le=!z.current;if(V.target===V.currentTarget&&le&&!y){const me=new CustomEvent(Vc,Ej);if(V.currentTarget.dispatchEvent(me),!me.defaultPrevented){const oe=A().filter(Q=>Q.focusable),fe=oe.find(Q=>Q.active),T=oe.find(Q=>Q.id===S),G=[fe,T,...oe].filter(Boolean).map(Q=>Q.ref.current);gx(G,v)}}z.current=!1}),onBlur:Ae(r.onBlur,()=>C(!1))})})}),px="RovingFocusGroupItem",xx=x.forwardRef((r,a)=>{const{__scopeRovingFocusGroup:l,focusable:i=!0,active:c=!1,tabStopId:d,children:f,...m}=r,p=gr(),g=d||p,v=Tj(px,l),w=v.currentTabStopId===g,_=fx(l),{onFocusableItemAdd:E,onFocusableItemRemove:k,currentTabStopId:S}=v;return x.useEffect(()=>{if(i)return E(),()=>k()},[i,E,k]),n.jsx(iu.ItemSlot,{scope:l,id:g,focusable:i,active:c,children:n.jsx(Le.span,{tabIndex:w?0:-1,"data-orientation":v.orientation,...m,ref:a,onMouseDown:Ae(r.onMouseDown,N=>{i?v.onItemFocus(g):N.preventDefault()}),onFocus:Ae(r.onFocus,()=>v.onItemFocus(g)),onKeyDown:Ae(r.onKeyDown,N=>{if(N.key==="Tab"&&N.shiftKey){v.onItemShiftTab();return}if(N.target!==N.currentTarget)return;const y=Lj(N,v.orientation,v.dir);if(y!==void 0){if(N.metaKey||N.ctrlKey||N.altKey||N.shiftKey)return;N.preventDefault();let j=_().filter(A=>A.focusable).map(A=>A.ref.current);if(y==="last")j.reverse();else if(y==="prev"||y==="next"){y==="prev"&&j.reverse();const A=j.indexOf(N.currentTarget);j=v.loop?Dj(j,A+1):j.slice(A+1)}setTimeout(()=>gx(j))}}),children:typeof f=="function"?f({isCurrentTabStop:w,hasTabStop:S!=null}):f})})});xx.displayName=px;var Aj={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function Mj(r,a){return a!=="rtl"?r:r==="ArrowLeft"?"ArrowRight":r==="ArrowRight"?"ArrowLeft":r}function Lj(r,a,l){const i=Mj(r.key,l);if(!(a==="vertical"&&["ArrowLeft","ArrowRight"].includes(i))&&!(a==="horizontal"&&["ArrowUp","ArrowDown"].includes(i)))return Aj[i]}function gx(r,a=!1){const l=document.activeElement;for(const i of r)if(i===l||(i.focus({preventScroll:a}),document.activeElement!==l))return}function Dj(r,a){return r.map((l,i)=>r[(a+i)%r.length])}var Oj=mx,Fj=xx,Ro="Tabs",[zj]=Nr(Ro,[hx]),yx=hx(),[$j,zu]=zj(Ro),vx=x.forwardRef((r,a)=>{const{__scopeTabs:l,value:i,onValueChange:c,defaultValue:d,orientation:f="horizontal",dir:m,activationMode:p="automatic",...g}=r,v=Po(m),[w,_]=Vr({prop:i,onChange:c,defaultProp:d??"",caller:Ro});return n.jsx($j,{scope:l,baseId:gr(),value:w,onValueChange:_,orientation:f,dir:v,activationMode:p,children:n.jsx(Le.div,{dir:v,"data-orientation":f,...g,ref:a})})});vx.displayName=Ro;var wx="TabsList",bx=x.forwardRef((r,a)=>{const{__scopeTabs:l,loop:i=!0,...c}=r,d=zu(wx,l),f=yx(l);return n.jsx(Oj,{asChild:!0,...f,orientation:d.orientation,dir:d.dir,loop:i,children:n.jsx(Le.div,{role:"tablist","aria-orientation":d.orientation,...c,ref:a})})});bx.displayName=wx;var Nx="TabsTrigger",jx=x.forwardRef((r,a)=>{const{__scopeTabs:l,value:i,disabled:c=!1,...d}=r,f=zu(Nx,l),m=yx(l),p=kx(f.baseId,i),g=Ex(f.baseId,i),v=i===f.value;return n.jsx(Fj,{asChild:!0,...m,focusable:!c,active:v,children:n.jsx(Le.button,{type:"button",role:"tab","aria-selected":v,"aria-controls":g,"data-state":v?"active":"inactive","data-disabled":c?"":void 0,disabled:c,id:p,...d,ref:a,onMouseDown:Ae(r.onMouseDown,w=>{!c&&w.button===0&&w.ctrlKey===!1?f.onValueChange(i):w.preventDefault()}),onKeyDown:Ae(r.onKeyDown,w=>{[" ","Enter"].includes(w.key)&&f.onValueChange(i)}),onFocus:Ae(r.onFocus,()=>{const w=f.activationMode!=="manual";!v&&!c&&w&&f.onValueChange(i)})})})});jx.displayName=Nx;var Sx="TabsContent",Cx=x.forwardRef((r,a)=>{const{__scopeTabs:l,value:i,forceMount:c,children:d,...f}=r,m=zu(Sx,l),p=kx(m.baseId,i),g=Ex(m.baseId,i),v=i===m.value,w=x.useRef(v);return x.useEffect(()=>{const _=requestAnimationFrame(()=>w.current=!1);return()=>cancelAnimationFrame(_)},[]),n.jsx(Ma,{present:c||v,children:({present:_})=>n.jsx(Le.div,{"data-state":v?"active":"inactive","data-orientation":m.orientation,role:"tabpanel","aria-labelledby":p,hidden:!_,id:g,tabIndex:0,...f,ref:a,style:{...r.style,animationDuration:w.current?"0s":void 0},children:_&&d})})});Cx.displayName=Sx;function kx(r,a){return`${r}-trigger-${a}`}function Ex(r,a){return`${r}-content-${a}`}var Bj=vx,_x=bx,Px=jx,Rx=Cx;const $u=Bj,To=x.forwardRef(({className:r,...a},l)=>n.jsx(_x,{ref:l,className:He("inline-flex h-9 items-center justify-center rounded-lg bg-muted p-1 text-muted-foreground",r),...a}));To.displayName=_x.displayName;const Xt=x.forwardRef(({className:r,...a},l)=>n.jsx(Px,{ref:l,className:He("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}));Xt.displayName=Px.displayName;const qt=x.forwardRef(({className:r,...a},l)=>n.jsx(Rx,{ref:l,className:He("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",r),...a}));qt.displayName=Rx.displayName;function Uj({open:r,onClose:a,userId:l,onUserUpdated:i}){var Q;const[c,d]=x.useState(null),[f,m]=x.useState([]),[p,g]=x.useState([]),[v,w]=x.useState(!1),[_,E]=x.useState(!1),[k,S]=x.useState(!1),[N,y]=x.useState("info"),[C,j]=x.useState(""),[A,z]=x.useState(""),[K,W]=x.useState([]),[V,le]=x.useState("");x.useEffect(()=>{r&&l&&me()},[r,l]);async function me(){if(l){w(!0);try{const O=await Ge(`/api/db/users?id=${encodeURIComponent(l)}`);if(O!=null&&O.success&&O.user){const R=O.user;d(R),j(R.phone||""),z(R.nickname||""),W(typeof R.tags=="string"?JSON.parse(R.tags||"[]"):[])}try{const R=await Ge(`/api/user/track?userId=${encodeURIComponent(l)}&limit=50`);R!=null&&R.success&&R.tracks&&m(R.tracks)}catch{m([])}try{const R=await Ge(`/api/db/users/referrals?userId=${encodeURIComponent(l)}`);R!=null&&R.success&&R.referrals&&g(R.referrals)}catch{g([])}}catch(O){console.error("Load user detail error:",O)}finally{w(!1)}}}async function oe(){if(!(c!=null&&c.phone)){alert("用户未绑定手机号,无法同步");return}E(!0);try{const O=await vt("/api/ckb/sync",{action:"full_sync",phone:c.phone,userId:c.id});O!=null&&O.success?(alert("同步成功"),me()):alert("同步失败: "+(O==null?void 0:O.error))}catch(O){console.error("Sync CKB error:",O),alert("同步失败")}finally{E(!1)}}async function fe(){if(c){S(!0);try{const O=await Bn("/api/db/users",{id:c.id,phone:C||void 0,nickname:A||void 0,tags:JSON.stringify(K)});O!=null&&O.success?(alert("保存成功"),me(),i==null||i()):alert("保存失败: "+(O==null?void 0:O.error))}catch(O){console.error("Save user error:",O),alert("保存失败")}finally{S(!1)}}}const T=()=>{V&&!K.includes(V)&&(W([...K,V]),le(""))},se=O=>{W(K.filter(R=>R!==O))},G=O=>{const Y={view_chapter:Ps,purchase:tu,match:on,login:Zl,register:Zl,share:Cs,bind_phone:a1,bind_wechat:Jw}[O]||lm;return n.jsx(Y,{className:"w-4 h-4"})};return r?n.jsx(Ln,{open:r,onOpenChange:()=>a(),children:n.jsxs(Dn,{className:"bg-[#0f2137] border-gray-700 text-white max-w-4xl max-h-[90vh] overflow-hidden",children:[n.jsx(On,{children:n.jsxs(Fn,{className:"text-white flex items-center gap-2",children:[n.jsx(Zl,{className:"w-5 h-5 text-[#38bdac]"}),"用户详情",(c==null?void 0:c.phone)&&n.jsx(Oe,{className:"bg-green-500/20 text-green-400 border-0 ml-2",children:"已绑定手机"})]})}),v?n.jsxs("div",{className:"flex items-center justify-center py-20",children:[n.jsx(Ze,{className:"w-6 h-6 text-[#38bdac] animate-spin"}),n.jsx("span",{className:"ml-2 text-gray-400",children:"加载中..."})]}):c?n.jsxs("div",{className:"flex flex-col h-[70vh]",children:[n.jsxs("div",{className:"flex items-center gap-4 p-4 bg-[#0a1628] rounded-lg mb-4",children:[n.jsx("div",{className:"w-16 h-16 rounded-full bg-[#38bdac]/20 flex items-center justify-center text-2xl text-[#38bdac]",children:c.avatar?n.jsx("img",{src:c.avatar,className:"w-full h-full rounded-full object-cover",alt:""}):((Q=c.nickname)==null?void 0:Q.charAt(0))||"?"}),n.jsxs("div",{className:"flex-1",children:[n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx("h3",{className:"text-lg font-bold text-white",children:c.nickname}),c.is_admin&&n.jsx(Oe,{className:"bg-purple-500/20 text-purple-400 border-0",children:"管理员"}),c.has_full_book&&n.jsx(Oe,{className:"bg-green-500/20 text-green-400 border-0",children:"全书已购"})]}),n.jsxs("p",{className:"text-gray-400 text-sm mt-1",children:[c.phone?`📱 ${c.phone}`:"未绑定手机",c.wechat_id&&` · 💬 ${c.wechat_id}`]}),n.jsxs("p",{className:"text-gray-500 text-xs mt-1",children:["ID: ",c.id," · 推广码: ",c.referral_code]})]}),n.jsxs("div",{className:"text-right",children:[n.jsxs("p",{className:"text-[#38bdac] font-bold",children:["¥",(c.earnings||0).toFixed(2)]}),n.jsx("p",{className:"text-gray-500 text-xs",children:"累计收益"})]})]}),n.jsxs($u,{value:N,onValueChange:y,className:"flex-1 flex flex-col overflow-hidden",children:[n.jsxs(To,{className:"bg-[#0a1628] border border-gray-700/50 p-1 mb-4",children:[n.jsx(Xt,{value:"info",className:"data-[state=active]:bg-[#38bdac]/20 data-[state=active]:text-[#38bdac]",children:"基础信息"}),n.jsx(Xt,{value:"tags",className:"data-[state=active]:bg-[#38bdac]/20 data-[state=active]:text-[#38bdac]",children:"标签体系"}),n.jsx(Xt,{value:"tracks",className:"data-[state=active]:bg-[#38bdac]/20 data-[state=active]:text-[#38bdac]",children:"行为轨迹"}),n.jsx(Xt,{value:"relations",className:"data-[state=active]:bg-[#38bdac]/20 data-[state=active]:text-[#38bdac]",children:"关系链路"})]}),n.jsxs(qt,{value:"info",className:"flex-1 overflow-auto space-y-4",children:[n.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[n.jsxs("div",{className:"space-y-2",children:[n.jsx(te,{className:"text-gray-300",children:"手机号"}),n.jsx(ae,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"输入手机号",value:C,onChange:O=>j(O.target.value)})]}),n.jsxs("div",{className:"space-y-2",children:[n.jsx(te,{className:"text-gray-300",children:"昵称"}),n.jsx(ae,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"输入昵称",value:A,onChange:O=>z(O.target.value)})]})]}),n.jsxs("div",{className:"grid grid-cols-3 gap-4",children:[n.jsxs("div",{className:"p-4 bg-[#0a1628] rounded-lg",children:[n.jsx("p",{className:"text-gray-400 text-sm",children:"推荐人数"}),n.jsx("p",{className:"text-2xl font-bold text-white",children:c.referral_count||0})]}),n.jsxs("div",{className:"p-4 bg-[#0a1628] rounded-lg",children:[n.jsx("p",{className:"text-gray-400 text-sm",children:"待提现"}),n.jsxs("p",{className:"text-2xl font-bold text-yellow-400",children:["¥",(c.pending_earnings||0).toFixed(2)]})]}),n.jsxs("div",{className:"p-4 bg-[#0a1628] rounded-lg",children:[n.jsx("p",{className:"text-gray-400 text-sm",children:"创建时间"}),n.jsx("p",{className:"text-sm text-white",children:c.created_at?new Date(c.created_at).toLocaleDateString():"-"})]})]}),n.jsxs("div",{className:"p-4 bg-[#0a1628] rounded-lg",children:[n.jsxs("div",{className:"flex items-center justify-between mb-3",children:[n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx(Cs,{className:"w-4 h-4 text-[#38bdac]"}),n.jsx("span",{className:"text-white font-medium",children:"存客宝同步"})]}),n.jsx(ye,{size:"sm",onClick:oe,disabled:_||!c.phone,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:_?n.jsxs(n.Fragment,{children:[n.jsx(Ze,{className:"w-4 h-4 mr-1 animate-spin"})," 同步中..."]}):n.jsxs(n.Fragment,{children:[n.jsx(Ze,{className:"w-4 h-4 mr-1"})," 同步数据"]})})]}),n.jsxs("div",{className:"grid grid-cols-2 gap-4 text-sm",children:[n.jsxs("div",{children:[n.jsx("span",{className:"text-gray-500",children:"同步状态:"}),c.ckb_synced_at?n.jsx(Oe,{className:"bg-green-500/20 text-green-400 border-0 ml-1",children:"已同步"}):n.jsx(Oe,{className:"bg-gray-500/20 text-gray-400 border-0 ml-1",children:"未同步"})]}),n.jsxs("div",{children:[n.jsx("span",{className:"text-gray-500",children:"最后同步:"}),n.jsx("span",{className:"text-gray-300 ml-1",children:c.ckb_synced_at?new Date(c.ckb_synced_at).toLocaleString():"-"})]})]})]})]}),n.jsx(qt,{value:"tags",className:"flex-1 overflow-auto space-y-4",children:n.jsxs("div",{className:"p-4 bg-[#0a1628] rounded-lg",children:[n.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[n.jsx(v1,{className:"w-4 h-4 text-[#38bdac]"}),n.jsx("span",{className:"text-white font-medium",children:"系统标签"})]}),n.jsxs("div",{className:"flex flex-wrap gap-2 mb-3",children:[K.map((O,R)=>n.jsxs(Oe,{className:"bg-[#38bdac]/20 text-[#38bdac] border-0 pr-1",children:[O,n.jsx("button",{type:"button",onClick:()=>se(O),className:"ml-1 hover:text-red-400",children:n.jsx(Ur,{className:"w-3 h-3"})})]},R)),K.length===0&&n.jsx("span",{className:"text-gray-500 text-sm",children:"暂无标签"})]}),n.jsxs("div",{className:"flex gap-2",children:[n.jsx(ae,{className:"bg-[#162840] border-gray-700 text-white flex-1",placeholder:"添加新标签",value:V,onChange:O=>le(O.target.value),onKeyDown:O=>O.key==="Enter"&&T()}),n.jsx(ye,{onClick:T,className:"bg-[#38bdac] hover:bg-[#2da396]",children:"添加"})]})]})}),n.jsx(qt,{value:"tracks",className:"flex-1 overflow-auto",children:n.jsx("div",{className:"space-y-2",children:f.length>0?f.map(O=>n.jsxs("div",{className:"flex items-start gap-3 p-3 bg-[#0a1628] rounded-lg",children:[n.jsx("div",{className:"w-8 h-8 rounded-full bg-[#38bdac]/20 flex items-center justify-center text-[#38bdac]",children:G(O.action)}),n.jsxs("div",{className:"flex-1",children:[n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx("span",{className:"text-white font-medium",children:O.actionLabel}),O.chapterTitle&&n.jsxs("span",{className:"text-gray-400 text-sm",children:["- ",O.chapterTitle]})]}),n.jsxs("p",{className:"text-gray-500 text-xs mt-1",children:[n.jsx(ip,{className:"w-3 h-3 inline mr-1"}),O.timeAgo," · ",new Date(O.createdAt).toLocaleString()]})]})]},O.id)):n.jsxs("div",{className:"text-center py-12",children:[n.jsx(lm,{className:"w-10 h-10 text-[#38bdac]/40 mx-auto mb-4"}),n.jsx("p",{className:"text-gray-400",children:"暂无行为轨迹"})]})})}),n.jsx(qt,{value:"relations",className:"flex-1 overflow-auto space-y-4",children:n.jsxs("div",{className:"p-4 bg-[#0a1628] rounded-lg",children:[n.jsxs("div",{className:"flex items-center justify-between mb-3",children:[n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx(Cs,{className:"w-4 h-4 text-[#38bdac]"}),n.jsx("span",{className:"text-white font-medium",children:"推荐的用户"})]}),n.jsxs(Oe,{className:"bg-[#38bdac]/20 text-[#38bdac] border-0",children:["共 ",p.length," 人"]})]}),n.jsx("div",{className:"space-y-2 max-h-[200px] overflow-y-auto",children:p.length>0?p.map((O,R)=>{var X;const Y=O;return n.jsxs("div",{className:"flex items-center justify-between p-2 bg-[#162840] rounded",children:[n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx("div",{className:"w-6 h-6 rounded-full bg-[#38bdac]/20 flex items-center justify-center text-xs text-[#38bdac]",children:((X=Y.nickname)==null?void 0:X.charAt(0))||"?"}),n.jsx("span",{className:"text-white text-sm",children:Y.nickname})]}),n.jsxs("div",{className:"flex items-center gap-2",children:[Y.status==="vip"&&n.jsx(Oe,{className:"bg-green-500/20 text-green-400 border-0 text-xs",children:"已购"}),n.jsx("span",{className:"text-gray-500 text-xs",children:Y.createdAt?new Date(Y.createdAt).toLocaleDateString():""})]})]},Y.id||R)}):n.jsx("p",{className:"text-gray-500 text-sm text-center py-4",children:"暂无推荐用户"})})]})})]}),n.jsxs("div",{className:"flex justify-end gap-2 pt-4 border-t border-gray-700 mt-4",children:[n.jsxs(ye,{variant:"outline",onClick:a,className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:[n.jsx(Ur,{className:"w-4 h-4 mr-2"}),"关闭"]}),n.jsxs(ye,{onClick:fe,disabled:k,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:[n.jsx($n,{className:"w-4 h-4 mr-2"}),k?"保存中...":"保存修改"]})]})]}):n.jsx("div",{className:"text-center py-12 text-gray-500",children:"用户不存在"})]})}):null}function Vj(){var ee,de,Ee,Se,Te;const[r,a]=x.useState([]),[l,i]=x.useState(""),[c,d]=x.useState(!0),[,f]=x.useState(null),[m,p]=x.useState(!1),[g,v]=x.useState(!1),[w,_]=x.useState(null),[E,k]=x.useState(""),[S,N]=x.useState(""),[y,C]=x.useState(!1),[j,A]=x.useState(!1),[z,K]=x.useState({referrals:[],stats:{}}),[W,V]=x.useState(!1),[le,me]=x.useState(null),[oe,fe]=x.useState(!1),[T,se]=x.useState(null),[G,Q]=x.useState({phone:"",nickname:"",password:"",is_admin:!1,has_full_book:!1});async function O(){d(!0),f(null);try{const B=await Ge("/api/db/users");B!=null&&B.success?a(B.users||[]):f((B==null?void 0:B.error)||"加载失败")}catch(B){console.error("Load users error:",B),f("网络错误,请检查连接")}finally{d(!1)}}x.useEffect(()=>{O()},[]);const R=r.filter(B=>(B.nickname||"").includes(l)||(B.phone||"").includes(l));async function Y(B){if(confirm("确定要删除这个用户吗?"))try{const Ie=await T1(`/api/db/users?id=${encodeURIComponent(B)}`);Ie!=null&&Ie.success?O():alert("删除失败: "+((Ie==null?void 0:Ie.error)||"未知错误"))}catch(Ie){console.error("Delete user error:",Ie),alert("删除失败")}}const X=B=>{_(B),Q({phone:B.phone||"",nickname:B.nickname||"",password:"",is_admin:!!(B.is_admin??!1),has_full_book:!!(B.has_full_book??!1)}),p(!0)},L=()=>{_(null),Q({phone:"",nickname:"",password:"",is_admin:!1,has_full_book:!1}),p(!0)};async function H(){if(!G.phone||!G.nickname){alert("请填写手机号和昵称");return}C(!0);try{if(w){const B=await Bn("/api/db/users",{id:w.id,nickname:G.nickname,is_admin:G.is_admin,has_full_book:G.has_full_book,...G.password&&{password:G.password}});if(!(B!=null&&B.success)){alert("更新失败: "+((B==null?void 0:B.error)||"未知错误"));return}}else{const B=await vt("/api/db/users",{phone:G.phone,nickname:G.nickname,password:G.password,is_admin:G.is_admin});if(!(B!=null&&B.success)){alert("创建失败: "+((B==null?void 0:B.error)||"未知错误"));return}}p(!1),O()}catch(B){console.error("Save user error:",B),alert("保存失败")}finally{C(!1)}}const ue=B=>{_(B),k(""),N(""),v(!0)};async function re(B){me(B),A(!0),V(!0);try{const Ie=await Ge(`/api/db/users/referrals?userId=${encodeURIComponent(B.id)}`);Ie!=null&&Ie.success?K({referrals:Ie.referrals||[],stats:Ie.stats||{}}):K({referrals:[],stats:{}})}catch(Ie){console.error("Load referrals error:",Ie),K({referrals:[],stats:{}})}finally{V(!1)}}const je=B=>{se(B.id),fe(!0)};async function Ne(){if(!E){alert("请输入新密码");return}if(E!==S){alert("两次输入的密码不一致");return}if(E.length<6){alert("密码长度不能少于6位");return}C(!0);try{const B=await Bn("/api/db/users",{id:w==null?void 0:w.id,password:E});B!=null&&B.success?(alert("密码修改成功"),v(!1)):alert("密码修改失败: "+((B==null?void 0:B.error)||"未知错误"))}catch(B){console.error("Change password error:",B),alert("密码修改失败")}finally{C(!1)}}return n.jsxs("div",{className:"p-8 max-w-7xl mx-auto",children:[n.jsxs("div",{className:"flex justify-between items-center mb-8",children:[n.jsxs("div",{children:[n.jsx("h2",{className:"text-2xl font-bold text-white",children:"用户管理"}),n.jsxs("p",{className:"text-gray-400 mt-1",children:["共 ",r.length," 位注册用户"]})]}),n.jsxs("div",{className:"flex items-center gap-4",children:[n.jsxs(ye,{variant:"outline",onClick:O,disabled:c,className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:[n.jsx(Ze,{className:`w-4 h-4 mr-2 ${c?"animate-spin":""}`}),"刷新"]}),n.jsxs("div",{className:"relative",children:[n.jsx(Br,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-gray-500"}),n.jsx(ae,{type:"text",placeholder:"搜索用户...",className:"pl-10 bg-[#0f2137] border-gray-700 text-white placeholder:text-gray-500 w-64",value:l,onChange:B=>i(B.target.value)})]}),n.jsxs(ye,{onClick:L,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:[n.jsx(dm,{className:"w-4 h-4 mr-2"}),"添加用户"]})]})]}),n.jsx(Ln,{open:m,onOpenChange:p,children:n.jsxs(Dn,{className:"bg-[#0f2137] border-gray-700 text-white max-w-lg",children:[n.jsx(On,{children:n.jsxs(Fn,{className:"text-white flex items-center gap-2",children:[w?n.jsx(Rs,{className:"w-5 h-5 text-[#38bdac]"}):n.jsx(dm,{className:"w-5 h-5 text-[#38bdac]"}),w?"编辑用户":"添加用户"]})}),n.jsxs("div",{className:"space-y-4 py-4",children:[n.jsxs("div",{className:"space-y-2",children:[n.jsx(te,{className:"text-gray-300",children:"手机号"}),n.jsx(ae,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"请输入手机号",value:G.phone,onChange:B=>Q({...G,phone:B.target.value}),disabled:!!w})]}),n.jsxs("div",{className:"space-y-2",children:[n.jsx(te,{className:"text-gray-300",children:"昵称"}),n.jsx(ae,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"请输入昵称",value:G.nickname,onChange:B=>Q({...G,nickname:B.target.value})})]}),n.jsxs("div",{className:"space-y-2",children:[n.jsx(te,{className:"text-gray-300",children:w?"新密码 (留空则不修改)":"密码"}),n.jsx(ae,{type:"password",className:"bg-[#0a1628] border-gray-700 text-white",placeholder:w?"留空则不修改":"请输入密码",value:G.password,onChange:B=>Q({...G,password:B.target.value})})]}),n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsx(te,{className:"text-gray-300",children:"管理员权限"}),n.jsx(rt,{checked:G.is_admin,onCheckedChange:B=>Q({...G,is_admin:B})})]}),n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsx(te,{className:"text-gray-300",children:"已购全书"}),n.jsx(rt,{checked:G.has_full_book,onCheckedChange:B=>Q({...G,has_full_book:B})})]})]}),n.jsxs(pr,{children:[n.jsxs(ye,{variant:"outline",onClick:()=>p(!1),className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:[n.jsx(Ur,{className:"w-4 h-4 mr-2"}),"取消"]}),n.jsxs(ye,{onClick:H,disabled:y,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:[n.jsx($n,{className:"w-4 h-4 mr-2"}),y?"保存中...":"保存"]})]})]})}),n.jsx(Ln,{open:g,onOpenChange:v,children:n.jsxs(Dn,{className:"bg-[#0f2137] border-gray-700 text-white max-w-md",children:[n.jsx(On,{children:n.jsxs(Fn,{className:"text-white flex items-center gap-2",children:[n.jsx(im,{className:"w-5 h-5 text-[#38bdac]"}),"修改密码"]})}),n.jsxs("div",{className:"space-y-4 py-4",children:[n.jsxs("div",{className:"bg-[#0a1628] rounded-lg p-3",children:[n.jsxs("p",{className:"text-gray-400 text-sm",children:["用户:",w==null?void 0:w.nickname]}),n.jsxs("p",{className:"text-gray-400 text-sm",children:["手机号:",w==null?void 0:w.phone]})]}),n.jsxs("div",{className:"space-y-2",children:[n.jsx(te,{className:"text-gray-300",children:"新密码"}),n.jsx(ae,{type:"password",className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"请输入新密码 (至少6位)",value:E,onChange:B=>k(B.target.value)})]}),n.jsxs("div",{className:"space-y-2",children:[n.jsx(te,{className:"text-gray-300",children:"确认密码"}),n.jsx(ae,{type:"password",className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"请再次输入新密码",value:S,onChange:B=>N(B.target.value)})]})]}),n.jsxs(pr,{children:[n.jsx(ye,{variant:"outline",onClick:()=>v(!1),className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:"取消"}),n.jsx(ye,{onClick:Ne,disabled:y,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:y?"保存中...":"确认修改"})]})]})}),n.jsx(Uj,{open:oe,onClose:()=>fe(!1),userId:T,onUserUpdated:O}),n.jsx(Ln,{open:j,onOpenChange:A,children:n.jsxs(Dn,{className:"bg-[#0f2137] border-gray-700 text-white max-w-2xl max-h-[80vh] overflow-auto",children:[n.jsx(On,{children:n.jsxs(Fn,{className:"text-white flex items-center gap-2",children:[n.jsx(on,{className:"w-5 h-5 text-[#38bdac]"}),"绑定关系详情 - ",le==null?void 0:le.nickname]})}),n.jsxs("div",{className:"space-y-4 py-4",children:[n.jsxs("div",{className:"grid grid-cols-4 gap-3",children:[n.jsxs("div",{className:"bg-[#0a1628] rounded-lg p-3 text-center",children:[n.jsx("div",{className:"text-2xl font-bold text-[#38bdac]",children:((ee=z.stats)==null?void 0:ee.total)||0}),n.jsx("div",{className:"text-xs text-gray-400",children:"绑定总数"})]}),n.jsxs("div",{className:"bg-[#0a1628] rounded-lg p-3 text-center",children:[n.jsx("div",{className:"text-2xl font-bold text-green-400",children:((de=z.stats)==null?void 0:de.purchased)||0}),n.jsx("div",{className:"text-xs text-gray-400",children:"已付费"})]}),n.jsxs("div",{className:"bg-[#0a1628] rounded-lg p-3 text-center",children:[n.jsxs("div",{className:"text-2xl font-bold text-yellow-400",children:["¥",(((Ee=z.stats)==null?void 0:Ee.earnings)||0).toFixed(2)]}),n.jsx("div",{className:"text-xs text-gray-400",children:"累计收益"})]}),n.jsxs("div",{className:"bg-[#0a1628] rounded-lg p-3 text-center",children:[n.jsxs("div",{className:"text-2xl font-bold text-orange-400",children:["¥",(((Se=z.stats)==null?void 0:Se.pendingEarnings)||0).toFixed(2)]}),n.jsx("div",{className:"text-xs text-gray-400",children:"待提现"})]})]}),W?n.jsxs("div",{className:"flex items-center justify-center py-8",children:[n.jsx(Ze,{className:"w-5 h-5 text-[#38bdac] animate-spin"}),n.jsx("span",{className:"ml-2 text-gray-400",children:"加载中..."})]}):(((Te=z.referrals)==null?void 0:Te.length)??0)>0?n.jsx("div",{className:"space-y-2 max-h-[300px] overflow-y-auto",children:(z.referrals??[]).map((B,Ie)=>{var Nt;const $e=B;return n.jsxs("div",{className:"flex items-center justify-between bg-[#0a1628] rounded-lg p-3",children:[n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsx("div",{className:"w-8 h-8 rounded-full bg-[#38bdac]/20 flex items-center justify-center text-sm text-[#38bdac]",children:((Nt=$e.nickname)==null?void 0:Nt.charAt(0))||"?"}),n.jsxs("div",{children:[n.jsx("div",{className:"text-white text-sm",children:$e.nickname}),n.jsx("div",{className:"text-xs text-gray-500",children:$e.phone||($e.hasOpenId?"微信用户":"未绑定")})]})]}),n.jsxs("div",{className:"flex items-center gap-2",children:[$e.status==="vip"&&n.jsx(Oe,{className:"bg-green-500/20 text-green-400 border-0 text-xs",children:"全书已购"}),$e.status==="paid"&&n.jsxs(Oe,{className:"bg-blue-500/20 text-blue-400 border-0 text-xs",children:["已付费",$e.purchasedSections,"章"]}),$e.status==="free"&&n.jsx(Oe,{className:"bg-gray-500/20 text-gray-400 border-0 text-xs",children:"未付费"}),n.jsx("span",{className:"text-xs text-gray-500",children:$e.createdAt?new Date($e.createdAt).toLocaleDateString():""})]})]},$e.id||Ie)})}):n.jsx("div",{className:"text-center py-8 text-gray-500",children:"暂无绑定用户"})]}),n.jsx(pr,{children:n.jsx(ye,{variant:"outline",onClick:()=>A(!1),className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:"关闭"})})]})}),n.jsx(_e,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:n.jsx(Pe,{className:"p-0",children:c?n.jsxs("div",{className:"flex items-center justify-center py-12",children:[n.jsx(Ze,{className:"w-6 h-6 text-[#38bdac] animate-spin"}),n.jsx("span",{className:"ml-2 text-gray-400",children:"加载中..."})]}):n.jsxs(jo,{children:[n.jsx(So,{children:n.jsxs(zn,{className:"bg-[#0a1628] hover:bg-[#0a1628] border-gray-700",children:[n.jsx(et,{className:"text-gray-400",children:"用户信息"}),n.jsx(et,{className:"text-gray-400",children:"绑定信息"}),n.jsx(et,{className:"text-gray-400",children:"购买状态"}),n.jsx(et,{className:"text-gray-400",children:"分销收益"}),n.jsx(et,{className:"text-gray-400",children:"推广码"}),n.jsx(et,{className:"text-gray-400",children:"注册时间"}),n.jsx(et,{className:"text-right text-gray-400",children:"操作"})]})}),n.jsxs(Co,{children:[R.map(B=>{var Ie,$e,Nt;return n.jsxs(zn,{className:"hover:bg-[#0a1628] border-gray-700/50",children:[n.jsx(Ye,{children:n.jsxs("div",{className:"flex items-center gap-3",children:[n.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?n.jsx("img",{src:B.avatar,className:"w-full h-full rounded-full object-cover",alt:""}):((Ie=B.nickname)==null?void 0:Ie.charAt(0))||"?"}),n.jsxs("div",{children:[n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx("p",{className:"font-medium text-white",children:B.nickname}),B.is_admin&&n.jsx(Oe,{className:"bg-purple-500/20 text-purple-400 hover:bg-purple-500/20 border-0 text-xs",children:"管理员"}),B.open_id&&!(($e=B.id)!=null&&$e.startsWith("user_"))&&n.jsx(Oe,{className:"bg-green-500/20 text-green-400 hover:bg-green-500/20 border-0 text-xs",children:"微信"})]}),n.jsx("p",{className:"text-xs text-gray-500 font-mono",children:B.open_id?B.open_id.slice(0,12)+"...":(Nt=B.id)==null?void 0:Nt.slice(0,12)})]})]})}),n.jsx(Ye,{children:n.jsxs("div",{className:"space-y-1",children:[B.phone&&n.jsxs("div",{className:"flex items-center gap-1 text-xs",children:[n.jsx("span",{className:"text-gray-500",children:"📱"}),n.jsx("span",{className:"text-gray-300",children:B.phone})]}),B.wechat_id&&n.jsxs("div",{className:"flex items-center gap-1 text-xs",children:[n.jsx("span",{className:"text-gray-500",children:"💬"}),n.jsx("span",{className:"text-gray-300",children:B.wechat_id})]}),B.open_id&&n.jsxs("div",{className:"flex items-center gap-1 text-xs",children:[n.jsx("span",{className:"text-gray-500",children:"🔗"}),n.jsxs("span",{className:"text-gray-500 truncate max-w-[100px]",title:B.open_id,children:[B.open_id.slice(0,12),"..."]})]}),!B.phone&&!B.wechat_id&&!B.open_id&&n.jsx("span",{className:"text-gray-600 text-xs",children:"未绑定"})]})}),n.jsx(Ye,{children:B.has_full_book?n.jsx(Oe,{className:"bg-green-500/20 text-green-400 hover:bg-green-500/20 border-0",children:"全书已购"}):n.jsx(Oe,{variant:"outline",className:"text-gray-500 border-gray-600",children:"未购买"})}),n.jsx(Ye,{children:n.jsxs("div",{className:"space-y-1",children:[n.jsxs("div",{className:"text-white font-medium",children:["¥",parseFloat(String(B.earnings||0)).toFixed(2)]}),parseFloat(String(B.pending_earnings||0))>0&&n.jsxs("div",{className:"text-xs text-yellow-400",children:["待提现: ¥",parseFloat(String(B.pending_earnings||0)).toFixed(2)]}),n.jsxs("div",{className:"text-xs text-[#38bdac] cursor-pointer hover:underline flex items-center gap-1",onClick:()=>re(B),onKeyDown:Vt=>Vt.key==="Enter"&&re(B),role:"button",tabIndex:0,children:[n.jsx(on,{className:"w-3 h-3"}),"绑定",B.referral_count||0,"人"]})]})}),n.jsx(Ye,{children:n.jsx("code",{className:"text-[#38bdac] text-xs bg-[#38bdac]/10 px-2 py-0.5 rounded",children:B.referral_code||"-"})}),n.jsx(Ye,{className:"text-gray-400",children:B.created_at?new Date(B.created_at).toLocaleDateString():"-"}),n.jsx(Ye,{className:"text-right",children:n.jsxs("div",{className:"flex items-center justify-end gap-1",children:[n.jsx(ye,{variant:"ghost",size:"sm",onClick:()=>je(B),className:"text-gray-400 hover:text-blue-400 hover:bg-blue-400/10",title:"查看详情",children:n.jsx(ku,{className:"w-4 h-4"})}),n.jsx(ye,{variant:"ghost",size:"sm",onClick:()=>X(B),className:"text-gray-400 hover:text-[#38bdac] hover:bg-[#38bdac]/10",title:"编辑",children:n.jsx(Rs,{className:"w-4 h-4"})}),n.jsx(ye,{variant:"ghost",size:"sm",onClick:()=>ue(B),className:"text-gray-400 hover:text-yellow-400 hover:bg-yellow-400/10",title:"修改密码",children:n.jsx(im,{className:"w-4 h-4"})}),n.jsx(ye,{variant:"ghost",size:"sm",className:"text-red-400 hover:text-red-300 hover:bg-red-500/10",onClick:()=>Y(B.id),title:"删除",children:n.jsx(fp,{className:"w-4 h-4"})})]})})]},B.id)}),R.length===0&&n.jsx(zn,{children:n.jsx(Ye,{colSpan:7,className:"text-center py-12 text-gray-500",children:"暂无用户数据"})})]})]})})})]})}function Wj(){const[r,a]=x.useState("overview"),[l,i]=x.useState([]),[c,d]=x.useState(null),[f,m]=x.useState([]),[p,g]=x.useState([]),[v,w]=x.useState([]),[_,E]=x.useState(!0),[k,S]=x.useState(""),[N,y]=x.useState("all"),[C,j]=x.useState(new Set);x.useEffect(()=>{A()},[]),x.useEffect(()=>{z(r)},[r]);async function A(){try{const T=await Ge("/api/admin/distribution/overview");T!=null&&T.success&&T.overview&&d(T.overview)}catch(T){console.error("[Admin] 概览接口异常:",T)}try{const T=await Ge("/api/db/users");w((T==null?void 0:T.users)||[])}catch(T){console.error("[Admin] 用户数据加载失败:",T)}}async function z(T){if(!C.has(T)){E(!0);try{const se=v;switch(T){case"overview":break;case"orders":{try{const G=await Ge("/api/orders");if(G!=null&&G.success&&G.orders){const Q=G.orders.map(O=>{const R=se.find(X=>X.id===O.userId),Y=O.referrerId?se.find(X=>X.id===O.referrerId):null;return{...O,amount:parseFloat(String(O.amount))||0,userNickname:(R==null?void 0:R.nickname)||O.userNickname||"未知用户",userPhone:(R==null?void 0:R.phone)||O.userPhone||"-",referrerNickname:(Y==null?void 0:Y.nickname)||null,referrerCode:(Y==null?void 0:Y.referral_code)||null,type:O.productType||O.type}});i(Q)}else i([])}catch{i([])}break}case"bindings":{try{const G=await Ge("/api/db/distribution");m((G==null?void 0:G.bindings)||[])}catch{m([])}break}case"withdrawals":{try{const G=await Ge("/api/admin/withdrawals");if(G!=null&&G.success&&G.withdrawals){const Q=G.withdrawals.map(O=>({...O,user_name:O.userNickname??O.user_name,created_at:O.created_at??O.createdAt,completed_at:O.processedAt??O.completed_at,account:O.account??"未绑定微信号",status:O.status==="success"?"completed":O.status==="failed"?"rejected":O.status}));g(Q)}else G!=null&&G.success||alert(`获取提现记录失败: ${(G==null?void 0:G.error)||"未知错误"}`),g([])}catch(G){console.error(G),alert("加载提现数据失败"),g([])}break}}j(G=>new Set(G).add(T))}catch(se){console.error(se)}finally{E(!1)}}}function K(){j(T=>{const se=new Set(T);return se.delete(r),se}),r==="overview"&&A(),z(r)}async function W(T){if(confirm("确认审核通过并打款?"))try{await Bn("/api/admin/withdrawals",{id:T,action:"approve"}),K()}catch(se){console.error(se),alert("操作失败")}}async function V(T){const se=prompt("请输入拒绝原因:");if(se)try{await Bn("/api/admin/withdrawals",{id:T,action:"reject",errorMessage:se}),K()}catch(G){console.error(G),alert("操作失败")}}function le(T){const se={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",processing:"bg-blue-500/20 text-blue-400",completed:"bg-green-500/20 text-green-400",rejected:"bg-red-500/20 text-red-400"},G={active:"有效",converted:"已转化",expired:"已过期",cancelled:"已取消",pending:"待审核",processing:"处理中",completed:"已完成",rejected:"已拒绝"};return n.jsx(Oe,{className:`${se[T]||"bg-gray-500/20 text-gray-400"} border-0`,children:G[T]||T})}const me=f.filter(T=>{var se,G,Q,O;if(N!=="all"&&T.status!==N)return!1;if(k){const R=k.toLowerCase();return((se=T.referee_nickname)==null?void 0:se.toLowerCase().includes(R))||((G=T.referee_phone)==null?void 0:G.includes(R))||((Q=T.referrer_name)==null?void 0:Q.toLowerCase().includes(R))||((O=T.referrer_code)==null?void 0:O.toLowerCase().includes(R))}return!0}),oe=p.filter(T=>{var se,G;if(N!=="all"&&T.status!==N)return!1;if(k){const Q=k.toLowerCase();return((se=T.user_name)==null?void 0:se.toLowerCase().includes(Q))||((G=T.account)==null?void 0:G.toLowerCase().includes(Q))}return!0}),fe=l.filter(T=>{var se,G,Q,O,R,Y;if(N!=="all"&&T.status!==N)return!1;if(k){const X=k.toLowerCase();return((se=T.id)==null?void 0:se.toLowerCase().includes(X))||((G=T.userNickname)==null?void 0:G.toLowerCase().includes(X))||((Q=T.userPhone)==null?void 0:Q.includes(X))||((O=T.sectionTitle)==null?void 0:O.toLowerCase().includes(X))||((R=T.chapterTitle)==null?void 0:R.toLowerCase().includes(X))||((Y=T.bookName)==null?void 0:Y.toLowerCase().includes(X))||T.referrerCode&&T.referrerCode.toLowerCase().includes(X)||T.referrerNickname&&T.referrerNickname.toLowerCase().includes(X)}return!0});return n.jsxs("div",{className:"p-8 max-w-7xl mx-auto",children:[n.jsxs("div",{className:"flex items-center justify-between mb-8",children:[n.jsxs("div",{children:[n.jsx("h1",{className:"text-2xl font-bold text-white",children:"交易中心"}),n.jsx("p",{className:"text-gray-400 mt-1",children:"统一管理:订单、分销绑定、提现审核"})]}),n.jsxs(ye,{onClick:K,disabled:_,variant:"outline",className:"border-gray-700 text-gray-300 hover:bg-gray-800",children:[n.jsx(Ze,{className:`w-4 h-4 mr-2 ${_?"animate-spin":""}`}),"刷新数据"]})]}),n.jsx("div",{className:"flex gap-2 mb-6 border-b border-gray-700 pb-4",children:[{key:"overview",label:"数据概览",icon:ru},{key:"orders",label:"订单管理",icon:lo},{key:"bindings",label:"绑定管理",icon:Cs},{key:"withdrawals",label:"提现审核",icon:Ts}].map(T=>n.jsxs("button",{type:"button",onClick:()=>{a(T.key),y("all"),S("")},className:`flex items-center gap-2 px-4 py-2 rounded-lg text-sm font-medium transition-colors ${r===T.key?"bg-[#38bdac] text-white":"text-gray-400 hover:text-white hover:bg-gray-800"}`,children:[n.jsx(T.icon,{className:"w-4 h-4"}),T.label]},T.key))}),_?n.jsxs("div",{className:"flex items-center justify-center py-20",children:[n.jsx(Ze,{className:"w-8 h-8 text-[#38bdac] animate-spin"}),n.jsx("span",{className:"ml-2 text-gray-400",children:"加载中..."})]}):n.jsxs(n.Fragment,{children:[r==="overview"&&c&&n.jsxs("div",{className:"space-y-6",children:[n.jsxs("div",{className:"grid grid-cols-4 gap-4",children:[n.jsx(_e,{className:"bg-[#0f2137] border-gray-700/50",children:n.jsx(Pe,{className:"p-6",children:n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsxs("div",{children:[n.jsx("p",{className:"text-gray-400 text-sm",children:"今日点击"}),n.jsx("p",{className:"text-2xl font-bold text-white mt-1",children:c.todayClicks})]}),n.jsx("div",{className:"w-12 h-12 rounded-xl bg-blue-500/20 flex items-center justify-center",children:n.jsx(ku,{className:"w-6 h-6 text-blue-400"})})]})})}),n.jsx(_e,{className:"bg-[#0f2137] border-gray-700/50",children:n.jsx(Pe,{className:"p-6",children:n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsxs("div",{children:[n.jsx("p",{className:"text-gray-400 text-sm",children:"今日绑定"}),n.jsx("p",{className:"text-2xl font-bold text-white mt-1",children:c.todayBindings})]}),n.jsx("div",{className:"w-12 h-12 rounded-xl bg-green-500/20 flex items-center justify-center",children:n.jsx(Cs,{className:"w-6 h-6 text-green-400"})})]})})}),n.jsx(_e,{className:"bg-[#0f2137] border-gray-700/50",children:n.jsx(Pe,{className:"p-6",children:n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsxs("div",{children:[n.jsx("p",{className:"text-gray-400 text-sm",children:"今日转化"}),n.jsx("p",{className:"text-2xl font-bold text-white mt-1",children:c.todayConversions})]}),n.jsx("div",{className:"w-12 h-12 rounded-xl bg-purple-500/20 flex items-center justify-center",children:n.jsx(Jc,{className:"w-6 h-6 text-purple-400"})})]})})}),n.jsx(_e,{className:"bg-[#0f2137] border-gray-700/50",children:n.jsx(Pe,{className:"p-6",children:n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsxs("div",{children:[n.jsx("p",{className:"text-gray-400 text-sm",children:"今日佣金"}),n.jsxs("p",{className:"text-2xl font-bold text-[#38bdac] mt-1",children:["¥",c.todayEarnings.toFixed(2)]})]}),n.jsx("div",{className:"w-12 h-12 rounded-xl bg-[#38bdac]/20 flex items-center justify-center",children:n.jsx(lo,{className:"w-6 h-6 text-[#38bdac]"})})]})})})]}),n.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[n.jsx(_e,{className:"bg-orange-500/10 border-orange-500/30",children:n.jsx(Pe,{className:"p-6",children:n.jsxs("div",{className:"flex items-center gap-4",children:[n.jsx("div",{className:"w-12 h-12 rounded-xl bg-orange-500/20 flex items-center justify-center",children:n.jsx(ip,{className:"w-6 h-6 text-orange-400"})}),n.jsxs("div",{className:"flex-1",children:[n.jsx("p",{className:"text-orange-300 font-medium",children:"即将过期绑定"}),n.jsxs("p",{className:"text-2xl font-bold text-white",children:[c.expiringBindings," 个"]}),n.jsx("p",{className:"text-orange-300/60 text-sm",children:"7天内到期,需关注转化"})]})]})})}),n.jsx(_e,{className:"bg-blue-500/10 border-blue-500/30",children:n.jsx(Pe,{className:"p-6",children:n.jsxs("div",{className:"flex items-center gap-4",children:[n.jsx("div",{className:"w-12 h-12 rounded-xl bg-blue-500/20 flex items-center justify-center",children:n.jsx(Ts,{className:"w-6 h-6 text-blue-400"})}),n.jsxs("div",{className:"flex-1",children:[n.jsx("p",{className:"text-blue-300 font-medium",children:"待审核提现"}),n.jsxs("p",{className:"text-2xl font-bold text-white",children:[c.pendingWithdrawals," 笔"]}),n.jsxs("p",{className:"text-blue-300/60 text-sm",children:["共 ¥",c.pendingWithdrawAmount.toFixed(2)]})]}),n.jsx(ye,{onClick:()=>a("withdrawals"),variant:"outline",className:"border-blue-500/50 text-blue-400 hover:bg-blue-500/20",children:"去审核"})]})})})]}),n.jsxs("div",{className:"grid grid-cols-2 gap-6",children:[n.jsxs(_e,{className:"bg-[#0f2137] border-gray-700/50",children:[n.jsx(ze,{children:n.jsxs(Ue,{className:"text-white flex items-center gap-2",children:[n.jsx(qc,{className:"w-5 h-5 text-[#38bdac]"}),"本月统计"]})}),n.jsx(Pe,{children:n.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[n.jsxs("div",{className:"p-4 bg-white/5 rounded-lg",children:[n.jsx("p",{className:"text-gray-400 text-sm",children:"点击量"}),n.jsx("p",{className:"text-xl font-bold text-white",children:c.monthClicks})]}),n.jsxs("div",{className:"p-4 bg-white/5 rounded-lg",children:[n.jsx("p",{className:"text-gray-400 text-sm",children:"绑定数"}),n.jsx("p",{className:"text-xl font-bold text-white",children:c.monthBindings})]}),n.jsxs("div",{className:"p-4 bg-white/5 rounded-lg",children:[n.jsx("p",{className:"text-gray-400 text-sm",children:"转化数"}),n.jsx("p",{className:"text-xl font-bold text-white",children:c.monthConversions})]}),n.jsxs("div",{className:"p-4 bg-white/5 rounded-lg",children:[n.jsx("p",{className:"text-gray-400 text-sm",children:"佣金"}),n.jsxs("p",{className:"text-xl font-bold text-[#38bdac]",children:["¥",c.monthEarnings.toFixed(2)]})]})]})})]}),n.jsxs(_e,{className:"bg-[#0f2137] border-gray-700/50",children:[n.jsx(ze,{children:n.jsxs(Ue,{className:"text-white flex items-center gap-2",children:[n.jsx(ru,{className:"w-5 h-5 text-[#38bdac]"}),"累计统计"]})}),n.jsxs(Pe,{children:[n.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[n.jsxs("div",{className:"p-4 bg-white/5 rounded-lg",children:[n.jsx("p",{className:"text-gray-400 text-sm",children:"总点击"}),n.jsx("p",{className:"text-xl font-bold text-white",children:c.totalClicks.toLocaleString()})]}),n.jsxs("div",{className:"p-4 bg-white/5 rounded-lg",children:[n.jsx("p",{className:"text-gray-400 text-sm",children:"总绑定"}),n.jsx("p",{className:"text-xl font-bold text-white",children:c.totalBindings.toLocaleString()})]}),n.jsxs("div",{className:"p-4 bg-white/5 rounded-lg",children:[n.jsx("p",{className:"text-gray-400 text-sm",children:"总转化"}),n.jsx("p",{className:"text-xl font-bold text-white",children:c.totalConversions})]}),n.jsxs("div",{className:"p-4 bg-white/5 rounded-lg",children:[n.jsx("p",{className:"text-gray-400 text-sm",children:"总佣金"}),n.jsxs("p",{className:"text-xl font-bold text-[#38bdac]",children:["¥",c.totalEarnings.toFixed(2)]})]})]}),n.jsxs("div",{className:"mt-4 p-4 bg-[#38bdac]/10 rounded-lg flex items-center justify-between",children:[n.jsx("span",{className:"text-gray-300",children:"点击转化率"}),n.jsxs("span",{className:"text-[#38bdac] font-bold text-xl",children:[c.conversionRate,"%"]})]})]})]})]}),n.jsxs(_e,{className:"bg-[#0f2137] border-gray-700/50",children:[n.jsx(ze,{children:n.jsxs(Ue,{className:"text-white flex items-center gap-2",children:[n.jsx(on,{className:"w-5 h-5 text-[#38bdac]"}),"推广统计"]})}),n.jsx(Pe,{children:n.jsxs("div",{className:"grid grid-cols-4 gap-4",children:[n.jsxs("div",{className:"p-4 bg-white/5 rounded-lg text-center",children:[n.jsx("p",{className:"text-3xl font-bold text-white",children:c.totalDistributors}),n.jsx("p",{className:"text-gray-400 text-sm mt-1",children:"推广用户数"})]}),n.jsxs("div",{className:"p-4 bg-white/5 rounded-lg text-center",children:[n.jsx("p",{className:"text-3xl font-bold text-green-400",children:c.activeDistributors}),n.jsx("p",{className:"text-gray-400 text-sm mt-1",children:"有收益用户"})]}),n.jsxs("div",{className:"p-4 bg-white/5 rounded-lg text-center",children:[n.jsx("p",{className:"text-3xl font-bold text-[#38bdac]",children:"90%"}),n.jsx("p",{className:"text-gray-400 text-sm mt-1",children:"佣金比例"})]}),n.jsxs("div",{className:"p-4 bg-white/5 rounded-lg text-center",children:[n.jsx("p",{className:"text-3xl font-bold text-orange-400",children:"30天"}),n.jsx("p",{className:"text-gray-400 text-sm mt-1",children:"绑定有效期"})]})]})})]})]}),r==="orders"&&n.jsxs("div",{className:"space-y-4",children:[n.jsxs("div",{className:"flex gap-4",children:[n.jsxs("div",{className:"relative flex-1",children:[n.jsx(Br,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-gray-400"}),n.jsx(ae,{value:k,onChange:T=>S(T.target.value),placeholder:"搜索订单号、用户名、手机号...",className:"pl-10 bg-[#0f2137] border-gray-700 text-white"})]}),n.jsxs("select",{value:N,onChange:T=>y(T.target.value),className:"px-4 py-2 bg-[#0f2137] border border-gray-700 rounded-lg text-white",children:[n.jsx("option",{value:"all",children:"全部状态"}),n.jsx("option",{value:"completed",children:"已完成"}),n.jsx("option",{value:"pending",children:"待支付"}),n.jsx("option",{value:"failed",children:"已失败"})]})]}),n.jsx(_e,{className:"bg-[#0f2137] border-gray-700/50",children:n.jsx(Pe,{className:"p-0",children:l.length===0?n.jsx("div",{className:"py-12 text-center text-gray-500",children:"暂无订单数据"}):n.jsx("div",{className:"overflow-x-auto",children:n.jsxs("table",{className:"w-full text-sm",children:[n.jsx("thead",{children:n.jsxs("tr",{className:"bg-[#0a1628] text-gray-400",children:[n.jsx("th",{className:"p-4 text-left font-medium",children:"订单号"}),n.jsx("th",{className:"p-4 text-left font-medium",children:"用户"}),n.jsx("th",{className:"p-4 text-left font-medium",children:"商品"}),n.jsx("th",{className:"p-4 text-left font-medium",children:"金额"}),n.jsx("th",{className:"p-4 text-left font-medium",children:"支付方式"}),n.jsx("th",{className:"p-4 text-left font-medium",children:"状态"}),n.jsx("th",{className:"p-4 text-left font-medium",children:"推荐人/邀请码"}),n.jsx("th",{className:"p-4 text-left font-medium",children:"分销佣金"}),n.jsx("th",{className:"p-4 text-left font-medium",children:"下单时间"})]})}),n.jsx("tbody",{className:"divide-y divide-gray-700/50",children:fe.map(T=>{var se,G;return n.jsxs("tr",{className:"hover:bg-[#0a1628] transition-colors",children:[n.jsxs("td",{className:"p-4 font-mono text-xs text-gray-400",children:[(se=T.id)==null?void 0:se.slice(0,12),"..."]}),n.jsx("td",{className:"p-4",children:n.jsxs("div",{children:[n.jsx("p",{className:"text-white text-sm",children:T.userNickname}),n.jsx("p",{className:"text-gray-500 text-xs",children:T.userPhone})]})}),n.jsx("td",{className:"p-4",children:n.jsxs("div",{children:[n.jsx("p",{className:"text-white text-sm",children:(()=>{const Q=T.productType||T.type;return Q==="fullbook"?`${T.bookName||"《底层逻辑》"} - 全本`:Q==="match"?"匹配次数购买":`${T.bookName||"《底层逻辑》"} - ${T.sectionTitle||T.chapterTitle||`章节${T.productId||T.sectionId||""}`}`})()}),n.jsx("p",{className:"text-gray-500 text-xs",children:(()=>{const Q=T.productType||T.type;return Q==="fullbook"?"全书解锁":Q==="match"?"功能权益":T.chapterTitle||"单章购买"})()})]})}),n.jsxs("td",{className:"p-4 text-[#38bdac] font-bold",children:["¥",typeof T.amount=="number"?T.amount.toFixed(2):parseFloat(String(T.amount||"0")).toFixed(2)]}),n.jsx("td",{className:"p-4 text-gray-300",children:T.paymentMethod==="wechat"?"微信支付":T.paymentMethod==="alipay"?"支付宝":T.paymentMethod||"微信支付"}),n.jsx("td",{className:"p-4",children:T.status==="completed"||T.status==="paid"?n.jsx(Oe,{className:"bg-green-500/20 text-green-400 border-0",children:"已完成"}):T.status==="pending"||T.status==="created"?n.jsx(Oe,{className:"bg-yellow-500/20 text-yellow-400 border-0",children:"待支付"}):n.jsx(Oe,{className:"bg-red-500/20 text-red-400 border-0",children:"已失败"})}),n.jsx("td",{className:"p-4 text-gray-300 text-sm",children:T.referrerId||T.referralCode?n.jsxs("span",{title:T.referralCode||T.referrerCode||T.referrerId||"",children:[T.referrerNickname||T.referralCode||T.referrerCode||((G=T.referrerId)==null?void 0:G.slice(0,8)),(T.referralCode||T.referrerCode)&&` (${T.referralCode||T.referrerCode})`]}):"-"}),n.jsx("td",{className:"p-4 text-[#FFD700]",children:T.referrerEarnings?`¥${(typeof T.referrerEarnings=="number"?T.referrerEarnings:parseFloat(String(T.referrerEarnings))).toFixed(2)}`:"-"}),n.jsx("td",{className:"p-4 text-gray-400 text-sm",children:T.createdAt?new Date(T.createdAt).toLocaleString("zh-CN"):"-"})]},T.id)})})]})})})})]}),r==="bindings"&&n.jsxs("div",{className:"space-y-4",children:[n.jsxs("div",{className:"flex gap-4",children:[n.jsxs("div",{className:"relative flex-1",children:[n.jsx(Br,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-gray-400"}),n.jsx(ae,{value:k,onChange:T=>S(T.target.value),placeholder:"搜索用户昵称、手机号、推广码...",className:"pl-10 bg-[#0f2137] border-gray-700 text-white"})]}),n.jsxs("select",{value:N,onChange:T=>y(T.target.value),className:"px-4 py-2 bg-[#0f2137] border border-gray-700 rounded-lg text-white",children:[n.jsx("option",{value:"all",children:"全部状态"}),n.jsx("option",{value:"active",children:"有效"}),n.jsx("option",{value:"converted",children:"已转化"}),n.jsx("option",{value:"expired",children:"已过期"})]})]}),n.jsx(_e,{className:"bg-[#0f2137] border-gray-700/50",children:n.jsx(Pe,{className:"p-0",children:me.length===0?n.jsx("div",{className:"py-12 text-center text-gray-500",children:"暂无绑定数据"}):n.jsx("div",{className:"overflow-x-auto",children:n.jsxs("table",{className:"w-full text-sm",children:[n.jsx("thead",{children:n.jsxs("tr",{className:"bg-[#0a1628] text-gray-400",children:[n.jsx("th",{className:"p-4 text-left font-medium",children:"访客"}),n.jsx("th",{className:"p-4 text-left font-medium",children:"分销商"}),n.jsx("th",{className:"p-4 text-left font-medium",children:"绑定时间"}),n.jsx("th",{className:"p-4 text-left font-medium",children:"到期时间"}),n.jsx("th",{className:"p-4 text-left font-medium",children:"状态"}),n.jsx("th",{className:"p-4 text-left font-medium",children:"佣金"})]})}),n.jsx("tbody",{className:"divide-y divide-gray-700/50",children:me.map(T=>n.jsxs("tr",{className:"hover:bg-[#0a1628] transition-colors",children:[n.jsx("td",{className:"p-4",children:n.jsxs("div",{children:[n.jsx("p",{className:"text-white font-medium",children:T.referee_nickname||"匿名用户"}),n.jsx("p",{className:"text-gray-500 text-xs",children:T.referee_phone})]})}),n.jsx("td",{className:"p-4",children:n.jsxs("div",{children:[n.jsx("p",{className:"text-white",children:T.referrer_name||"-"}),n.jsx("p",{className:"text-gray-500 text-xs font-mono",children:T.referrer_code})]})}),n.jsx("td",{className:"p-4 text-gray-400",children:T.bound_at?new Date(T.bound_at).toLocaleDateString("zh-CN"):"-"}),n.jsx("td",{className:"p-4 text-gray-400",children:T.expires_at?new Date(T.expires_at).toLocaleDateString("zh-CN"):"-"}),n.jsx("td",{className:"p-4",children:le(T.status)}),n.jsx("td",{className:"p-4",children:T.commission?n.jsxs("span",{className:"text-[#38bdac] font-medium",children:["¥",T.commission.toFixed(2)]}):n.jsx("span",{className:"text-gray-500",children:"-"})})]},T.id))})]})})})})]}),r==="withdrawals"&&n.jsxs("div",{className:"space-y-4",children:[n.jsxs("div",{className:"flex gap-4",children:[n.jsxs("div",{className:"relative flex-1",children:[n.jsx(Br,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-gray-400"}),n.jsx(ae,{value:k,onChange:T=>S(T.target.value),placeholder:"搜索用户名称、账号...",className:"pl-10 bg-[#0f2137] border-gray-700 text-white"})]}),n.jsxs("select",{value:N,onChange:T=>y(T.target.value),className:"px-4 py-2 bg-[#0f2137] border border-gray-700 rounded-lg text-white",children:[n.jsx("option",{value:"all",children:"全部状态"}),n.jsx("option",{value:"pending",children:"待审核"}),n.jsx("option",{value:"completed",children:"已完成"}),n.jsx("option",{value:"rejected",children:"已拒绝"})]})]}),n.jsx(_e,{className:"bg-[#0f2137] border-gray-700/50",children:n.jsx(Pe,{className:"p-0",children:oe.length===0?n.jsx("div",{className:"py-12 text-center text-gray-500",children:"暂无提现记录"}):n.jsx("div",{className:"overflow-x-auto",children:n.jsxs("table",{className:"w-full text-sm",children:[n.jsx("thead",{children:n.jsxs("tr",{className:"bg-[#0a1628] text-gray-400",children:[n.jsx("th",{className:"p-4 text-left font-medium",children:"申请人"}),n.jsx("th",{className:"p-4 text-left font-medium",children:"金额"}),n.jsx("th",{className:"p-4 text-left font-medium",children:"收款方式"}),n.jsx("th",{className:"p-4 text-left font-medium",children:"收款账号"}),n.jsx("th",{className:"p-4 text-left font-medium",children:"申请时间"}),n.jsx("th",{className:"p-4 text-left font-medium",children:"状态"}),n.jsx("th",{className:"p-4 text-right font-medium",children:"操作"})]})}),n.jsx("tbody",{className:"divide-y divide-gray-700/50",children:oe.map(T=>n.jsxs("tr",{className:"hover:bg-[#0a1628] transition-colors",children:[n.jsx("td",{className:"p-4",children:n.jsxs("div",{className:"flex items-center gap-2",children:[T.userAvatar?n.jsx("img",{src:T.userAvatar,alt:"",className:"w-8 h-8 rounded-full object-cover"}):n.jsx("div",{className:"w-8 h-8 rounded-full bg-gray-600 flex items-center justify-center text-white text-sm font-medium",children:(T.user_name||T.name||"?").slice(0,1)}),n.jsx("p",{className:"text-white font-medium",children:T.user_name||T.name})]})}),n.jsx("td",{className:"p-4",children:n.jsxs("span",{className:"text-[#38bdac] font-bold",children:["¥",T.amount.toFixed(2)]})}),n.jsx("td",{className:"p-4",children:n.jsx(Oe,{className:T.method==="wechat"?"bg-green-500/20 text-green-400 border-0":"bg-blue-500/20 text-blue-400 border-0",children:T.method==="wechat"?"微信":"支付宝"})}),n.jsx("td",{className:"p-4",children:n.jsxs("div",{children:[n.jsx("p",{className:"text-white font-mono text-xs",children:T.account}),n.jsx("p",{className:"text-gray-500 text-xs",children:T.name})]})}),n.jsx("td",{className:"p-4 text-gray-400",children:T.created_at||T.createdAt?new Date(T.created_at||T.createdAt||"").toLocaleString("zh-CN"):"-"}),n.jsx("td",{className:"p-4",children:le(T.status)}),n.jsx("td",{className:"p-4 text-right",children:T.status==="pending"&&n.jsxs("div",{className:"flex gap-2 justify-end",children:[n.jsxs(ye,{size:"sm",onClick:()=>W(T.id),className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:[n.jsx(Jc,{className:"w-4 h-4 mr-1"}),"通过"]}),n.jsxs(ye,{size:"sm",variant:"outline",onClick:()=>V(T.id),className:"border-red-500/50 text-red-400 hover:bg-red-500/20",children:[n.jsx(vw,{className:"w-4 h-4 mr-1"}),"拒绝"]})]})})]},T.id))})]})})})})]})]})]})}function Hj(){const[r,a]=x.useState([]),[l,i]=x.useState({total:0,pendingCount:0,pendingAmount:0,successCount:0,successAmount:0,failedCount:0}),[c,d]=x.useState(!0),[f,m]=x.useState("all"),[p,g]=x.useState(null);async function v(){var k,S,N,y,C,j;d(!0);try{const A=await Ge(`/api/admin/withdrawals?status=${f}`);if(A!=null&&A.success){const z=(A.withdrawals||[]).map(K=>({...K,createdAt:K.created_at??K.createdAt,userNickname:K.user_name??K.userNickname}));a(z),i({total:((k=A.stats)==null?void 0:k.total)??z.length,pendingCount:((S=A.stats)==null?void 0:S.pendingCount)??0,pendingAmount:((N=A.stats)==null?void 0:N.pendingAmount)??0,successCount:((y=A.stats)==null?void 0:y.successCount)??0,successAmount:((C=A.stats)==null?void 0:C.successAmount)??0,failedCount:((j=A.stats)==null?void 0:j.failedCount)??0})}}catch(A){console.error("Load withdrawals error:",A)}finally{d(!1)}}x.useEffect(()=>{v()},[f]);async function w(k){const S=r.find(N=>N.id===k);if(S!=null&&S.userCommissionInfo&&S.userCommissionInfo.availableAfterThis<0){if(!confirm(`⚠️ 风险警告:该用户审核后余额为负数(¥${S.userCommissionInfo.availableAfterThis.toFixed(2)}),可能存在超额提现。
|
||
|
||
确认已核实用户账户并完成打款?`))return}else if(!confirm("确认已完成打款?批准后将更新用户提现记录。"))return;g(k);try{const N=await Bn("/api/admin/withdrawals",{id:k,action:"approve"});N!=null&&N.success?v():alert("操作失败: "+((N==null?void 0:N.error)??""))}catch{alert("操作失败")}finally{g(null)}}async function _(k){const S=prompt("请输入拒绝原因(将返还用户余额):");if(S){g(k);try{const N=await Bn("/api/admin/withdrawals",{id:k,action:"reject",reason:S});N!=null&&N.success?v():alert("操作失败: "+((N==null?void 0:N.error)??""))}catch{alert("操作失败")}finally{g(null)}}}function E(k){switch(k){case"pending":case"pending_confirm":return n.jsx(Oe,{className:"bg-orange-500/20 text-orange-400 hover:bg-orange-500/20 border-0",children:"待处理"});case"processing":return n.jsx(Oe,{className:"bg-blue-500/20 text-blue-400 hover:bg-blue-500/20 border-0",children:"处理中"});case"success":case"completed":return n.jsx(Oe,{className:"bg-green-500/20 text-green-400 hover:bg-green-500/20 border-0",children:"已完成"});case"failed":case"rejected":return n.jsx(Oe,{className:"bg-red-500/20 text-red-400 hover:bg-red-500/20 border-0",children:"已拒绝"});default:return n.jsx(Oe,{className:"bg-gray-500/20 text-gray-400 border-0",children:k})}}return n.jsxs("div",{className:"p-8 max-w-6xl mx-auto",children:[n.jsxs("div",{className:"flex justify-between items-start mb-8",children:[n.jsxs("div",{children:[n.jsx("h1",{className:"text-2xl font-bold text-white",children:"分账提现管理"}),n.jsx("p",{className:"text-gray-400 mt-1",children:"管理用户分销收益的提现申请"})]}),n.jsxs(ye,{variant:"outline",onClick:v,disabled:c,className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:[n.jsx(Ze,{className:`w-4 h-4 mr-2 ${c?"animate-spin":""}`}),"刷新"]})]}),n.jsx(_e,{className:"bg-gradient-to-r from-[#38bdac]/10 to-[#0f2137] border-[#38bdac]/30 mb-6",children:n.jsx(Pe,{className:"p-4",children:n.jsxs("div",{className:"flex items-start gap-3",children:[n.jsx(lo,{className:"w-5 h-5 text-[#38bdac] mt-0.5"}),n.jsxs("div",{children:[n.jsx("h3",{className:"text-white font-medium mb-2",children:"自动分账规则"}),n.jsxs("div",{className:"text-sm text-gray-400 space-y-1",children:[n.jsxs("p",{children:["• ",n.jsx("span",{className:"text-[#38bdac]",children:"分销比例"}),":推广者获得订单金额的"," ",n.jsx("span",{className:"text-white font-medium",children:"90%"})]}),n.jsxs("p",{children:["• ",n.jsx("span",{className:"text-[#38bdac]",children:"结算方式"}),":用户付款后,分销收益自动计入推广者账户"]}),n.jsxs("p",{children:["• ",n.jsx("span",{className:"text-[#38bdac]",children:"提现方式"}),":用户在小程序端点击提现,系统自动转账到微信零钱"]}),n.jsxs("p",{children:["• ",n.jsx("span",{className:"text-[#38bdac]",children:"审批流程"}),":待处理的提现需管理员手动确认打款后批准"]})]})]})]})})}),n.jsxs("div",{className:"grid grid-cols-4 gap-4 mb-6",children:[n.jsx(_e,{className:"bg-[#0f2137] border-gray-700/50",children:n.jsxs(Pe,{className:"p-4 text-center",children:[n.jsx("div",{className:"text-3xl font-bold text-[#38bdac]",children:l.total}),n.jsx("div",{className:"text-sm text-gray-400",children:"总申请"})]})}),n.jsx(_e,{className:"bg-[#0f2137] border-gray-700/50",children:n.jsxs(Pe,{className:"p-4 text-center",children:[n.jsx("div",{className:"text-3xl font-bold text-orange-400",children:l.pendingCount}),n.jsx("div",{className:"text-sm text-gray-400",children:"待处理"}),n.jsxs("div",{className:"text-xs text-orange-400 mt-1",children:["¥",l.pendingAmount.toFixed(2)]})]})}),n.jsx(_e,{className:"bg-[#0f2137] border-gray-700/50",children:n.jsxs(Pe,{className:"p-4 text-center",children:[n.jsx("div",{className:"text-3xl font-bold text-green-400",children:l.successCount}),n.jsx("div",{className:"text-sm text-gray-400",children:"已完成"}),n.jsxs("div",{className:"text-xs text-green-400 mt-1",children:["¥",l.successAmount.toFixed(2)]})]})}),n.jsx(_e,{className:"bg-[#0f2137] border-gray-700/50",children:n.jsxs(Pe,{className:"p-4 text-center",children:[n.jsx("div",{className:"text-3xl font-bold text-red-400",children:l.failedCount}),n.jsx("div",{className:"text-sm text-gray-400",children:"已拒绝"})]})})]}),n.jsx("div",{className:"flex gap-2 mb-4",children:["all","pending","success","failed"].map(k=>n.jsx(ye,{variant:f===k?"default":"outline",size:"sm",onClick:()=>m(k),className:f===k?"bg-[#38bdac] hover:bg-[#2da396] text-white":"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:k==="all"?"全部":k==="pending"?"待处理":k==="success"?"已完成":"已拒绝"},k))}),n.jsx(_e,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:n.jsx(Pe,{className:"p-0",children:c?n.jsxs("div",{className:"flex items-center justify-center py-12",children:[n.jsx(Ze,{className:"w-6 h-6 text-[#38bdac] animate-spin"}),n.jsx("span",{className:"ml-2 text-gray-400",children:"加载中..."})]}):r.length===0?n.jsxs("div",{className:"text-center py-12",children:[n.jsx(Ts,{className:"w-12 h-12 text-gray-600 mx-auto mb-3"}),n.jsx("p",{className:"text-gray-500",children:"暂无提现记录"})]}):n.jsx("div",{className:"overflow-x-auto",children:n.jsxs("table",{className:"w-full text-sm",children:[n.jsx("thead",{children:n.jsxs("tr",{className:"bg-[#0a1628] text-gray-400",children:[n.jsx("th",{className:"p-4 text-left font-medium",children:"申请时间"}),n.jsx("th",{className:"p-4 text-left font-medium",children:"用户"}),n.jsx("th",{className:"p-4 text-left font-medium",children:"提现金额"}),n.jsx("th",{className:"p-4 text-left font-medium",children:"用户佣金信息"}),n.jsx("th",{className:"p-4 text-left font-medium",children:"状态"}),n.jsx("th",{className:"p-4 text-left font-medium",children:"处理时间"}),n.jsx("th",{className:"p-4 text-right font-medium",children:"操作"})]})}),n.jsx("tbody",{className:"divide-y divide-gray-700/50",children:r.map(k=>n.jsxs("tr",{className:"hover:bg-[#0a1628] transition-colors",children:[n.jsx("td",{className:"p-4 text-gray-400",children:new Date(k.created_at??k.createdAt??"").toLocaleString()}),n.jsx("td",{className:"p-4",children:n.jsxs("div",{className:"flex items-center gap-2",children:[k.userAvatar?n.jsx("img",{src:k.userAvatar,alt:k.userNickname??k.user_name??"",className:"w-8 h-8 rounded-full object-cover"}):n.jsx("div",{className:"w-8 h-8 rounded-full bg-[#38bdac]/20 flex items-center justify-center text-sm text-[#38bdac]",children:(k.userNickname??k.user_name??"?").charAt(0)}),n.jsxs("div",{children:[n.jsx("p",{className:"font-medium text-white",children:k.userNickname??k.user_name??"未知"}),n.jsx("p",{className:"text-xs text-gray-500",children:k.userPhone??k.referralCode??(k.user_id??k.userId??"").slice(0,10)})]})]})}),n.jsx("td",{className:"p-4",children:n.jsxs("span",{className:"font-bold text-orange-400",children:["¥",Number(k.amount).toFixed(2)]})}),n.jsx("td",{className:"p-4",children:k.userCommissionInfo?n.jsxs("div",{className:"text-xs space-y-1",children:[n.jsxs("div",{className:"flex justify-between gap-4",children:[n.jsx("span",{className:"text-gray-500",children:"累计佣金:"}),n.jsxs("span",{className:"text-[#38bdac] font-medium",children:["¥",k.userCommissionInfo.totalCommission.toFixed(2)]})]}),n.jsxs("div",{className:"flex justify-between gap-4",children:[n.jsx("span",{className:"text-gray-500",children:"已提现:"}),n.jsxs("span",{className:"text-gray-400",children:["¥",k.userCommissionInfo.withdrawnEarnings.toFixed(2)]})]}),n.jsxs("div",{className:"flex justify-between gap-4",children:[n.jsx("span",{className:"text-gray-500",children:"待审核:"}),n.jsxs("span",{className:"text-orange-400",children:["¥",k.userCommissionInfo.pendingWithdrawals.toFixed(2)]})]}),n.jsxs("div",{className:"flex justify-between gap-4 pt-1 border-t border-gray-700/30",children:[n.jsx("span",{className:"text-gray-500",children:"审核后余额:"}),n.jsxs("span",{className:k.userCommissionInfo.availableAfterThis>=0?"text-green-400 font-medium":"text-red-400 font-medium",children:["¥",k.userCommissionInfo.availableAfterThis.toFixed(2)]})]})]}):n.jsx("span",{className:"text-gray-500 text-xs",children:"暂无数据"})}),n.jsxs("td",{className:"p-4",children:[E(k.status),k.errorMessage&&n.jsx("p",{className:"text-xs text-red-400 mt-1",children:k.errorMessage})]}),n.jsx("td",{className:"p-4 text-gray-400",children:k.processedAt??k.completed_at?new Date(k.processedAt??k.completed_at??"").toLocaleString():"-"}),n.jsxs("td",{className:"p-4 text-right",children:[(k.status==="pending"||k.status==="pending_confirm")&&n.jsxs("div",{className:"flex items-center justify-end gap-2",children:[n.jsxs(ye,{size:"sm",onClick:()=>w(k.id),disabled:p===k.id,className:"bg-green-600 hover:bg-green-700 text-white",children:[n.jsx(bo,{className:"w-4 h-4 mr-1"}),"批准"]}),n.jsxs(ye,{size:"sm",variant:"outline",onClick:()=>_(k.id),disabled:p===k.id,className:"border-red-500/50 text-red-400 hover:bg-red-500/10 bg-transparent",children:[n.jsx(Ur,{className:"w-4 h-4 mr-1"}),"拒绝"]})]}),(k.status==="success"||k.status==="completed")&&k.transactionId&&n.jsx("span",{className:"text-xs text-gray-500 font-mono",children:k.transactionId})]})]},k.id))})]})})})})]})}const $r=x.forwardRef(({className:r,...a},l)=>n.jsx("textarea",{className:He("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}));$r.displayName="Textarea";function ho(r,[a,l]){return Math.min(l,Math.max(a,r))}const Kj=["top","right","bottom","left"],vr=Math.min,Bt=Math.max,mo=Math.round,Jl=Math.floor,Nn=r=>({x:r,y:r}),Gj={left:"right",right:"left",bottom:"top",top:"bottom"},Qj={start:"end",end:"start"};function cu(r,a,l){return Bt(r,vr(a,l))}function Un(r,a){return typeof r=="function"?r(a):r}function Vn(r){return r.split("-")[0]}function Fs(r){return r.split("-")[1]}function Bu(r){return r==="x"?"y":"x"}function Uu(r){return r==="y"?"height":"width"}const Yj=new Set(["top","bottom"]);function bn(r){return Yj.has(Vn(r))?"y":"x"}function Vu(r){return Bu(bn(r))}function Xj(r,a,l){l===void 0&&(l=!1);const i=Fs(r),c=Vu(r),d=Uu(c);let f=c==="x"?i===(l?"end":"start")?"right":"left":i==="start"?"bottom":"top";return a.reference[d]>a.floating[d]&&(f=po(f)),[f,po(f)]}function qj(r){const a=po(r);return[uu(r),a,uu(a)]}function uu(r){return r.replace(/start|end/g,a=>Qj[a])}const Im=["left","right"],Am=["right","left"],Jj=["top","bottom"],Zj=["bottom","top"];function e2(r,a,l){switch(r){case"top":case"bottom":return l?a?Am:Im:a?Im:Am;case"left":case"right":return a?Jj:Zj;default:return[]}}function t2(r,a,l,i){const c=Fs(r);let d=e2(Vn(r),l==="start",i);return c&&(d=d.map(f=>f+"-"+c),a&&(d=d.concat(d.map(uu)))),d}function po(r){return r.replace(/left|right|bottom|top/g,a=>Gj[a])}function n2(r){return{top:0,right:0,bottom:0,left:0,...r}}function Tx(r){return typeof r!="number"?n2(r):{top:r,right:r,bottom:r,left:r}}function xo(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 Mm(r,a,l){let{reference:i,floating:c}=r;const d=bn(a),f=Vu(a),m=Uu(f),p=Vn(a),g=d==="y",v=i.x+i.width/2-c.width/2,w=i.y+i.height/2-c.height/2,_=i[m]/2-c[m]/2;let E;switch(p){case"top":E={x:v,y:i.y-c.height};break;case"bottom":E={x:v,y:i.y+i.height};break;case"right":E={x:i.x+i.width,y:w};break;case"left":E={x:i.x-c.width,y:w};break;default:E={x:i.x,y:i.y}}switch(Fs(a)){case"start":E[f]-=_*(l&&g?-1:1);break;case"end":E[f]+=_*(l&&g?-1:1);break}return E}async function r2(r,a){var l;a===void 0&&(a={});const{x:i,y:c,platform:d,rects:f,elements:m,strategy:p}=r,{boundary:g="clippingAncestors",rootBoundary:v="viewport",elementContext:w="floating",altBoundary:_=!1,padding:E=0}=Un(a,r),k=Tx(E),N=m[_?w==="floating"?"reference":"floating":w],y=xo(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(m.floating)),boundary:g,rootBoundary:v,strategy:p})),C=w==="floating"?{x:i,y:c,width:f.floating.width,height:f.floating.height}:f.reference,j=await(d.getOffsetParent==null?void 0:d.getOffsetParent(m.floating)),A=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},z=xo(d.convertOffsetParentRelativeRectToViewportRelativeRect?await d.convertOffsetParentRelativeRectToViewportRelativeRect({elements:m,rect:C,offsetParent:j,strategy:p}):C);return{top:(y.top-z.top+k.top)/A.y,bottom:(z.bottom-y.bottom+k.bottom)/A.y,left:(y.left-z.left+k.left)/A.x,right:(z.right-y.right+k.right)/A.x}}const s2=async(r,a,l)=>{const{placement:i="bottom",strategy:c="absolute",middleware:d=[],platform:f}=l,m=d.filter(Boolean),p=await(f.isRTL==null?void 0:f.isRTL(a));let g=await f.getElementRects({reference:r,floating:a,strategy:c}),{x:v,y:w}=Mm(g,i,p),_=i,E={},k=0;for(let N=0;N<m.length;N++){var S;const{name:y,fn:C}=m[N],{x:j,y:A,data:z,reset:K}=await C({x:v,y:w,initialPlacement:i,placement:_,strategy:c,middlewareData:E,rects:g,platform:{...f,detectOverflow:(S=f.detectOverflow)!=null?S:r2},elements:{reference:r,floating:a}});v=j??v,w=A??w,E={...E,[y]:{...E[y],...z}},K&&k<=50&&(k++,typeof K=="object"&&(K.placement&&(_=K.placement),K.rects&&(g=K.rects===!0?await f.getElementRects({reference:r,floating:a,strategy:c}):K.rects),{x:v,y:w}=Mm(g,_,p)),N=-1)}return{x:v,y:w,placement:_,strategy:c,middlewareData:E}},a2=r=>({name:"arrow",options:r,async fn(a){const{x:l,y:i,placement:c,rects:d,platform:f,elements:m,middlewareData:p}=a,{element:g,padding:v=0}=Un(r,a)||{};if(g==null)return{};const w=Tx(v),_={x:l,y:i},E=Vu(c),k=Uu(E),S=await f.getDimensions(g),N=E==="y",y=N?"top":"left",C=N?"bottom":"right",j=N?"clientHeight":"clientWidth",A=d.reference[k]+d.reference[E]-_[E]-d.floating[k],z=_[E]-d.reference[E],K=await(f.getOffsetParent==null?void 0:f.getOffsetParent(g));let W=K?K[j]:0;(!W||!await(f.isElement==null?void 0:f.isElement(K)))&&(W=m.floating[j]||d.floating[k]);const V=A/2-z/2,le=W/2-S[k]/2-1,me=vr(w[y],le),oe=vr(w[C],le),fe=me,T=W-S[k]-oe,se=W/2-S[k]/2+V,G=cu(fe,se,T),Q=!p.arrow&&Fs(c)!=null&&se!==G&&d.reference[k]/2-(se<fe?me:oe)-S[k]/2<0,O=Q?se<fe?se-fe:se-T:0;return{[E]:_[E]+O,data:{[E]:G,centerOffset:se-G-O,...Q&&{alignmentOffset:O}},reset:Q}}}),l2=function(r){return r===void 0&&(r={}),{name:"flip",options:r,async fn(a){var l,i;const{placement:c,middlewareData:d,rects:f,initialPlacement:m,platform:p,elements:g}=a,{mainAxis:v=!0,crossAxis:w=!0,fallbackPlacements:_,fallbackStrategy:E="bestFit",fallbackAxisSideDirection:k="none",flipAlignment:S=!0,...N}=Un(r,a);if((l=d.arrow)!=null&&l.alignmentOffset)return{};const y=Vn(c),C=bn(m),j=Vn(m)===m,A=await(p.isRTL==null?void 0:p.isRTL(g.floating)),z=_||(j||!S?[po(m)]:qj(m)),K=k!=="none";!_&&K&&z.push(...t2(m,S,k,A));const W=[m,...z],V=await p.detectOverflow(a,N),le=[];let me=((i=d.flip)==null?void 0:i.overflows)||[];if(v&&le.push(V[y]),w){const se=Xj(c,f,A);le.push(V[se[0]],V[se[1]])}if(me=[...me,{placement:c,overflows:le}],!le.every(se=>se<=0)){var oe,fe;const se=(((oe=d.flip)==null?void 0:oe.index)||0)+1,G=W[se];if(G&&(!(w==="alignment"?C!==bn(G):!1)||me.every(R=>bn(R.placement)===C?R.overflows[0]>0:!0)))return{data:{index:se,overflows:me},reset:{placement:G}};let Q=(fe=me.filter(O=>O.overflows[0]<=0).sort((O,R)=>O.overflows[1]-R.overflows[1])[0])==null?void 0:fe.placement;if(!Q)switch(E){case"bestFit":{var T;const O=(T=me.filter(R=>{if(K){const Y=bn(R.placement);return Y===C||Y==="y"}return!0}).map(R=>[R.placement,R.overflows.filter(Y=>Y>0).reduce((Y,X)=>Y+X,0)]).sort((R,Y)=>R[1]-Y[1])[0])==null?void 0:T[0];O&&(Q=O);break}case"initialPlacement":Q=m;break}if(c!==Q)return{reset:{placement:Q}}}return{}}}};function Lm(r,a){return{top:r.top-a.height,right:r.right-a.width,bottom:r.bottom-a.height,left:r.left-a.width}}function Dm(r){return Kj.some(a=>r[a]>=0)}const o2=function(r){return r===void 0&&(r={}),{name:"hide",options:r,async fn(a){const{rects:l,platform:i}=a,{strategy:c="referenceHidden",...d}=Un(r,a);switch(c){case"referenceHidden":{const f=await i.detectOverflow(a,{...d,elementContext:"reference"}),m=Lm(f,l.reference);return{data:{referenceHiddenOffsets:m,referenceHidden:Dm(m)}}}case"escaped":{const f=await i.detectOverflow(a,{...d,altBoundary:!0}),m=Lm(f,l.floating);return{data:{escapedOffsets:m,escaped:Dm(m)}}}default:return{}}}}},Ix=new Set(["left","top"]);async function i2(r,a){const{placement:l,platform:i,elements:c}=r,d=await(i.isRTL==null?void 0:i.isRTL(c.floating)),f=Vn(l),m=Fs(l),p=bn(l)==="y",g=Ix.has(f)?-1:1,v=d&&p?-1:1,w=Un(a,r);let{mainAxis:_,crossAxis:E,alignmentAxis:k}=typeof w=="number"?{mainAxis:w,crossAxis:0,alignmentAxis:null}:{mainAxis:w.mainAxis||0,crossAxis:w.crossAxis||0,alignmentAxis:w.alignmentAxis};return m&&typeof k=="number"&&(E=m==="end"?k*-1:k),p?{x:E*v,y:_*g}:{x:_*g,y:E*v}}const c2=function(r){return r===void 0&&(r=0),{name:"offset",options:r,async fn(a){var l,i;const{x:c,y:d,placement:f,middlewareData:m}=a,p=await i2(a,r);return f===((l=m.offset)==null?void 0:l.placement)&&(i=m.arrow)!=null&&i.alignmentOffset?{}:{x:c+p.x,y:d+p.y,data:{...p,placement:f}}}}},u2=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:f=!0,crossAxis:m=!1,limiter:p={fn:y=>{let{x:C,y:j}=y;return{x:C,y:j}}},...g}=Un(r,a),v={x:l,y:i},w=await d.detectOverflow(a,g),_=bn(Vn(c)),E=Bu(_);let k=v[E],S=v[_];if(f){const y=E==="y"?"top":"left",C=E==="y"?"bottom":"right",j=k+w[y],A=k-w[C];k=cu(j,k,A)}if(m){const y=_==="y"?"top":"left",C=_==="y"?"bottom":"right",j=S+w[y],A=S-w[C];S=cu(j,S,A)}const N=p.fn({...a,[E]:k,[_]:S});return{...N,data:{x:N.x-l,y:N.y-i,enabled:{[E]:f,[_]:m}}}}}},d2=function(r){return r===void 0&&(r={}),{options:r,fn(a){const{x:l,y:i,placement:c,rects:d,middlewareData:f}=a,{offset:m=0,mainAxis:p=!0,crossAxis:g=!0}=Un(r,a),v={x:l,y:i},w=bn(c),_=Bu(w);let E=v[_],k=v[w];const S=Un(m,a),N=typeof S=="number"?{mainAxis:S,crossAxis:0}:{mainAxis:0,crossAxis:0,...S};if(p){const j=_==="y"?"height":"width",A=d.reference[_]-d.floating[j]+N.mainAxis,z=d.reference[_]+d.reference[j]-N.mainAxis;E<A?E=A:E>z&&(E=z)}if(g){var y,C;const j=_==="y"?"width":"height",A=Ix.has(Vn(c)),z=d.reference[w]-d.floating[j]+(A&&((y=f.offset)==null?void 0:y[w])||0)+(A?0:N.crossAxis),K=d.reference[w]+d.reference[j]+(A?0:((C=f.offset)==null?void 0:C[w])||0)-(A?N.crossAxis:0);k<z?k=z:k>K&&(k=K)}return{[_]:E,[w]:k}}}},f2=function(r){return r===void 0&&(r={}),{name:"size",options:r,async fn(a){var l,i;const{placement:c,rects:d,platform:f,elements:m}=a,{apply:p=()=>{},...g}=Un(r,a),v=await f.detectOverflow(a,g),w=Vn(c),_=Fs(c),E=bn(c)==="y",{width:k,height:S}=d.floating;let N,y;w==="top"||w==="bottom"?(N=w,y=_===(await(f.isRTL==null?void 0:f.isRTL(m.floating))?"start":"end")?"left":"right"):(y=w,N=_==="end"?"top":"bottom");const C=S-v.top-v.bottom,j=k-v.left-v.right,A=vr(S-v[N],C),z=vr(k-v[y],j),K=!a.middlewareData.shift;let W=A,V=z;if((l=a.middlewareData.shift)!=null&&l.enabled.x&&(V=j),(i=a.middlewareData.shift)!=null&&i.enabled.y&&(W=C),K&&!_){const me=Bt(v.left,0),oe=Bt(v.right,0),fe=Bt(v.top,0),T=Bt(v.bottom,0);E?V=k-2*(me!==0||oe!==0?me+oe:Bt(v.left,v.right)):W=S-2*(fe!==0||T!==0?fe+T:Bt(v.top,v.bottom))}await p({...a,availableWidth:V,availableHeight:W});const le=await f.getDimensions(m.floating);return k!==le.width||S!==le.height?{reset:{rects:!0}}:{}}}};function Io(){return typeof window<"u"}function zs(r){return Ax(r)?(r.nodeName||"").toLowerCase():"#document"}function Ut(r){var a;return(r==null||(a=r.ownerDocument)==null?void 0:a.defaultView)||window}function Sn(r){var a;return(a=(Ax(r)?r.ownerDocument:r.document)||window.document)==null?void 0:a.documentElement}function Ax(r){return Io()?r instanceof Node||r instanceof Ut(r).Node:!1}function cn(r){return Io()?r instanceof Element||r instanceof Ut(r).Element:!1}function jn(r){return Io()?r instanceof HTMLElement||r instanceof Ut(r).HTMLElement:!1}function Om(r){return!Io()||typeof ShadowRoot>"u"?!1:r instanceof ShadowRoot||r instanceof Ut(r).ShadowRoot}const h2=new Set(["inline","contents"]);function Da(r){const{overflow:a,overflowX:l,overflowY:i,display:c}=un(r);return/auto|scroll|overlay|hidden|clip/.test(a+i+l)&&!h2.has(c)}const m2=new Set(["table","td","th"]);function p2(r){return m2.has(zs(r))}const x2=[":popover-open",":modal"];function Ao(r){return x2.some(a=>{try{return r.matches(a)}catch{return!1}})}const g2=["transform","translate","scale","rotate","perspective"],y2=["transform","translate","scale","rotate","perspective","filter"],v2=["paint","layout","strict","content"];function Wu(r){const a=Hu(),l=cn(r)?un(r):r;return g2.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)||y2.some(i=>(l.willChange||"").includes(i))||v2.some(i=>(l.contain||"").includes(i))}function w2(r){let a=wr(r);for(;jn(a)&&!Is(a);){if(Wu(a))return a;if(Ao(a))return null;a=wr(a)}return null}function Hu(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const b2=new Set(["html","body","#document"]);function Is(r){return b2.has(zs(r))}function un(r){return Ut(r).getComputedStyle(r)}function Mo(r){return cn(r)?{scrollLeft:r.scrollLeft,scrollTop:r.scrollTop}:{scrollLeft:r.scrollX,scrollTop:r.scrollY}}function wr(r){if(zs(r)==="html")return r;const a=r.assignedSlot||r.parentNode||Om(r)&&r.host||Sn(r);return Om(a)?a.host:a}function Mx(r){const a=wr(r);return Is(a)?r.ownerDocument?r.ownerDocument.body:r.body:jn(a)&&Da(a)?a:Mx(a)}function Ta(r,a,l){var i;a===void 0&&(a=[]),l===void 0&&(l=!0);const c=Mx(r),d=c===((i=r.ownerDocument)==null?void 0:i.body),f=Ut(c);if(d){const m=du(f);return a.concat(f,f.visualViewport||[],Da(c)?c:[],m&&l?Ta(m):[])}return a.concat(c,Ta(c,[],l))}function du(r){return r.parent&&Object.getPrototypeOf(r.parent)?r.frameElement:null}function Lx(r){const a=un(r);let l=parseFloat(a.width)||0,i=parseFloat(a.height)||0;const c=jn(r),d=c?r.offsetWidth:l,f=c?r.offsetHeight:i,m=mo(l)!==d||mo(i)!==f;return m&&(l=d,i=f),{width:l,height:i,$:m}}function Ku(r){return cn(r)?r:r.contextElement}function _s(r){const a=Ku(r);if(!jn(a))return Nn(1);const l=a.getBoundingClientRect(),{width:i,height:c,$:d}=Lx(a);let f=(d?mo(l.width):l.width)/i,m=(d?mo(l.height):l.height)/c;return(!f||!Number.isFinite(f))&&(f=1),(!m||!Number.isFinite(m))&&(m=1),{x:f,y:m}}const N2=Nn(0);function Dx(r){const a=Ut(r);return!Hu()||!a.visualViewport?N2:{x:a.visualViewport.offsetLeft,y:a.visualViewport.offsetTop}}function j2(r,a,l){return a===void 0&&(a=!1),!l||a&&l!==Ut(r)?!1:a}function Hr(r,a,l,i){a===void 0&&(a=!1),l===void 0&&(l=!1);const c=r.getBoundingClientRect(),d=Ku(r);let f=Nn(1);a&&(i?cn(i)&&(f=_s(i)):f=_s(r));const m=j2(d,l,i)?Dx(d):Nn(0);let p=(c.left+m.x)/f.x,g=(c.top+m.y)/f.y,v=c.width/f.x,w=c.height/f.y;if(d){const _=Ut(d),E=i&&cn(i)?Ut(i):i;let k=_,S=du(k);for(;S&&i&&E!==k;){const N=_s(S),y=S.getBoundingClientRect(),C=un(S),j=y.left+(S.clientLeft+parseFloat(C.paddingLeft))*N.x,A=y.top+(S.clientTop+parseFloat(C.paddingTop))*N.y;p*=N.x,g*=N.y,v*=N.x,w*=N.y,p+=j,g+=A,k=Ut(S),S=du(k)}}return xo({width:v,height:w,x:p,y:g})}function Lo(r,a){const l=Mo(r).scrollLeft;return a?a.left+l:Hr(Sn(r)).left+l}function Ox(r,a){const l=r.getBoundingClientRect(),i=l.left+a.scrollLeft-Lo(r,l),c=l.top+a.scrollTop;return{x:i,y:c}}function S2(r){let{elements:a,rect:l,offsetParent:i,strategy:c}=r;const d=c==="fixed",f=Sn(i),m=a?Ao(a.floating):!1;if(i===f||m&&d)return l;let p={scrollLeft:0,scrollTop:0},g=Nn(1);const v=Nn(0),w=jn(i);if((w||!w&&!d)&&((zs(i)!=="body"||Da(f))&&(p=Mo(i)),jn(i))){const E=Hr(i);g=_s(i),v.x=E.x+i.clientLeft,v.y=E.y+i.clientTop}const _=f&&!w&&!d?Ox(f,p):Nn(0);return{width:l.width*g.x,height:l.height*g.y,x:l.x*g.x-p.scrollLeft*g.x+v.x+_.x,y:l.y*g.y-p.scrollTop*g.y+v.y+_.y}}function C2(r){return Array.from(r.getClientRects())}function k2(r){const a=Sn(r),l=Mo(r),i=r.ownerDocument.body,c=Bt(a.scrollWidth,a.clientWidth,i.scrollWidth,i.clientWidth),d=Bt(a.scrollHeight,a.clientHeight,i.scrollHeight,i.clientHeight);let f=-l.scrollLeft+Lo(r);const m=-l.scrollTop;return un(i).direction==="rtl"&&(f+=Bt(a.clientWidth,i.clientWidth)-c),{width:c,height:d,x:f,y:m}}const Fm=25;function E2(r,a){const l=Ut(r),i=Sn(r),c=l.visualViewport;let d=i.clientWidth,f=i.clientHeight,m=0,p=0;if(c){d=c.width,f=c.height;const v=Hu();(!v||v&&a==="fixed")&&(m=c.offsetLeft,p=c.offsetTop)}const g=Lo(i);if(g<=0){const v=i.ownerDocument,w=v.body,_=getComputedStyle(w),E=v.compatMode==="CSS1Compat"&&parseFloat(_.marginLeft)+parseFloat(_.marginRight)||0,k=Math.abs(i.clientWidth-w.clientWidth-E);k<=Fm&&(d-=k)}else g<=Fm&&(d+=g);return{width:d,height:f,x:m,y:p}}const _2=new Set(["absolute","fixed"]);function P2(r,a){const l=Hr(r,!0,a==="fixed"),i=l.top+r.clientTop,c=l.left+r.clientLeft,d=jn(r)?_s(r):Nn(1),f=r.clientWidth*d.x,m=r.clientHeight*d.y,p=c*d.x,g=i*d.y;return{width:f,height:m,x:p,y:g}}function zm(r,a,l){let i;if(a==="viewport")i=E2(r,l);else if(a==="document")i=k2(Sn(r));else if(cn(a))i=P2(a,l);else{const c=Dx(r);i={x:a.x-c.x,y:a.y-c.y,width:a.width,height:a.height}}return xo(i)}function Fx(r,a){const l=wr(r);return l===a||!cn(l)||Is(l)?!1:un(l).position==="fixed"||Fx(l,a)}function R2(r,a){const l=a.get(r);if(l)return l;let i=Ta(r,[],!1).filter(m=>cn(m)&&zs(m)!=="body"),c=null;const d=un(r).position==="fixed";let f=d?wr(r):r;for(;cn(f)&&!Is(f);){const m=un(f),p=Wu(f);!p&&m.position==="fixed"&&(c=null),(d?!p&&!c:!p&&m.position==="static"&&!!c&&_2.has(c.position)||Da(f)&&!p&&Fx(r,f))?i=i.filter(v=>v!==f):c=m,f=wr(f)}return a.set(r,i),i}function T2(r){let{element:a,boundary:l,rootBoundary:i,strategy:c}=r;const f=[...l==="clippingAncestors"?Ao(a)?[]:R2(a,this._c):[].concat(l),i],m=f[0],p=f.reduce((g,v)=>{const w=zm(a,v,c);return g.top=Bt(w.top,g.top),g.right=vr(w.right,g.right),g.bottom=vr(w.bottom,g.bottom),g.left=Bt(w.left,g.left),g},zm(a,m,c));return{width:p.right-p.left,height:p.bottom-p.top,x:p.left,y:p.top}}function I2(r){const{width:a,height:l}=Lx(r);return{width:a,height:l}}function A2(r,a,l){const i=jn(a),c=Sn(a),d=l==="fixed",f=Hr(r,!0,d,a);let m={scrollLeft:0,scrollTop:0};const p=Nn(0);function g(){p.x=Lo(c)}if(i||!i&&!d)if((zs(a)!=="body"||Da(c))&&(m=Mo(a)),i){const E=Hr(a,!0,d,a);p.x=E.x+a.clientLeft,p.y=E.y+a.clientTop}else c&&g();d&&!i&&c&&g();const v=c&&!i&&!d?Ox(c,m):Nn(0),w=f.left+m.scrollLeft-p.x-v.x,_=f.top+m.scrollTop-p.y-v.y;return{x:w,y:_,width:f.width,height:f.height}}function Wc(r){return un(r).position==="static"}function $m(r,a){if(!jn(r)||un(r).position==="fixed")return null;if(a)return a(r);let l=r.offsetParent;return Sn(r)===l&&(l=l.ownerDocument.body),l}function zx(r,a){const l=Ut(r);if(Ao(r))return l;if(!jn(r)){let c=wr(r);for(;c&&!Is(c);){if(cn(c)&&!Wc(c))return c;c=wr(c)}return l}let i=$m(r,a);for(;i&&p2(i)&&Wc(i);)i=$m(i,a);return i&&Is(i)&&Wc(i)&&!Wu(i)?l:i||w2(r)||l}const M2=async function(r){const a=this.getOffsetParent||zx,l=this.getDimensions,i=await l(r.floating);return{reference:A2(r.reference,await a(r.floating),r.strategy),floating:{x:0,y:0,width:i.width,height:i.height}}};function L2(r){return un(r).direction==="rtl"}const D2={convertOffsetParentRelativeRectToViewportRelativeRect:S2,getDocumentElement:Sn,getClippingRect:T2,getOffsetParent:zx,getElementRects:M2,getClientRects:C2,getDimensions:I2,getScale:_s,isElement:cn,isRTL:L2};function $x(r,a){return r.x===a.x&&r.y===a.y&&r.width===a.width&&r.height===a.height}function O2(r,a){let l=null,i;const c=Sn(r);function d(){var m;clearTimeout(i),(m=l)==null||m.disconnect(),l=null}function f(m,p){m===void 0&&(m=!1),p===void 0&&(p=1),d();const g=r.getBoundingClientRect(),{left:v,top:w,width:_,height:E}=g;if(m||a(),!_||!E)return;const k=Jl(w),S=Jl(c.clientWidth-(v+_)),N=Jl(c.clientHeight-(w+E)),y=Jl(v),j={rootMargin:-k+"px "+-S+"px "+-N+"px "+-y+"px",threshold:Bt(0,vr(1,p))||1};let A=!0;function z(K){const W=K[0].intersectionRatio;if(W!==p){if(!A)return f();W?f(!1,W):i=setTimeout(()=>{f(!1,1e-7)},1e3)}W===1&&!$x(g,r.getBoundingClientRect())&&f(),A=!1}try{l=new IntersectionObserver(z,{...j,root:c.ownerDocument})}catch{l=new IntersectionObserver(z,j)}l.observe(r)}return f(!0),d}function F2(r,a,l,i){i===void 0&&(i={});const{ancestorScroll:c=!0,ancestorResize:d=!0,elementResize:f=typeof ResizeObserver=="function",layoutShift:m=typeof IntersectionObserver=="function",animationFrame:p=!1}=i,g=Ku(r),v=c||d?[...g?Ta(g):[],...Ta(a)]:[];v.forEach(y=>{c&&y.addEventListener("scroll",l,{passive:!0}),d&&y.addEventListener("resize",l)});const w=g&&m?O2(g,l):null;let _=-1,E=null;f&&(E=new ResizeObserver(y=>{let[C]=y;C&&C.target===g&&E&&(E.unobserve(a),cancelAnimationFrame(_),_=requestAnimationFrame(()=>{var j;(j=E)==null||j.observe(a)})),l()}),g&&!p&&E.observe(g),E.observe(a));let k,S=p?Hr(r):null;p&&N();function N(){const y=Hr(r);S&&!$x(S,y)&&l(),S=y,k=requestAnimationFrame(N)}return l(),()=>{var y;v.forEach(C=>{c&&C.removeEventListener("scroll",l),d&&C.removeEventListener("resize",l)}),w==null||w(),(y=E)==null||y.disconnect(),E=null,p&&cancelAnimationFrame(k)}}const z2=c2,$2=u2,B2=l2,U2=f2,V2=o2,Bm=a2,W2=d2,H2=(r,a,l)=>{const i=new Map,c={platform:D2,...l},d={...c.platform,_c:i};return s2(r,a,{...c,platform:d})};var K2=typeof document<"u",G2=function(){},no=K2?x.useLayoutEffect:G2;function go(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(!go(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)&&!go(r[d],a[d]))return!1}return!0}return r!==r&&a!==a}function Bx(r){return typeof window>"u"?1:(r.ownerDocument.defaultView||window).devicePixelRatio||1}function Um(r,a){const l=Bx(r);return Math.round(a*l)/l}function Hc(r){const a=x.useRef(r);return no(()=>{a.current=r}),a}function Q2(r){r===void 0&&(r={});const{placement:a="bottom",strategy:l="absolute",middleware:i=[],platform:c,elements:{reference:d,floating:f}={},transform:m=!0,whileElementsMounted:p,open:g}=r,[v,w]=x.useState({x:0,y:0,strategy:l,placement:a,middlewareData:{},isPositioned:!1}),[_,E]=x.useState(i);go(_,i)||E(i);const[k,S]=x.useState(null),[N,y]=x.useState(null),C=x.useCallback(R=>{R!==K.current&&(K.current=R,S(R))},[]),j=x.useCallback(R=>{R!==W.current&&(W.current=R,y(R))},[]),A=d||k,z=f||N,K=x.useRef(null),W=x.useRef(null),V=x.useRef(v),le=p!=null,me=Hc(p),oe=Hc(c),fe=Hc(g),T=x.useCallback(()=>{if(!K.current||!W.current)return;const R={placement:a,strategy:l,middleware:_};oe.current&&(R.platform=oe.current),H2(K.current,W.current,R).then(Y=>{const X={...Y,isPositioned:fe.current!==!1};se.current&&!go(V.current,X)&&(V.current=X,Ia.flushSync(()=>{w(X)}))})},[_,a,l,oe,fe]);no(()=>{g===!1&&V.current.isPositioned&&(V.current.isPositioned=!1,w(R=>({...R,isPositioned:!1})))},[g]);const se=x.useRef(!1);no(()=>(se.current=!0,()=>{se.current=!1}),[]),no(()=>{if(A&&(K.current=A),z&&(W.current=z),A&&z){if(me.current)return me.current(A,z,T);T()}},[A,z,T,me,le]);const G=x.useMemo(()=>({reference:K,floating:W,setReference:C,setFloating:j}),[C,j]),Q=x.useMemo(()=>({reference:A,floating:z}),[A,z]),O=x.useMemo(()=>{const R={position:l,left:0,top:0};if(!Q.floating)return R;const Y=Um(Q.floating,v.x),X=Um(Q.floating,v.y);return m?{...R,transform:"translate("+Y+"px, "+X+"px)",...Bx(Q.floating)>=1.5&&{willChange:"transform"}}:{position:l,left:Y,top:X}},[l,m,Q.floating,v.x,v.y]);return x.useMemo(()=>({...v,update:T,refs:G,elements:Q,floatingStyles:O}),[v,T,G,Q,O])}const Y2=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?Bm({element:i.current,padding:c}).fn(l):{}:i?Bm({element:i,padding:c}).fn(l):{}}}},X2=(r,a)=>({...z2(r),options:[r,a]}),q2=(r,a)=>({...$2(r),options:[r,a]}),J2=(r,a)=>({...W2(r),options:[r,a]}),Z2=(r,a)=>({...B2(r),options:[r,a]}),eS=(r,a)=>({...U2(r),options:[r,a]}),tS=(r,a)=>({...V2(r),options:[r,a]}),nS=(r,a)=>({...Y2(r),options:[r,a]});var rS="Arrow",Ux=x.forwardRef((r,a)=>{const{children:l,width:i=10,height:c=5,...d}=r;return n.jsx(Le.svg,{...d,ref:a,width:i,height:c,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:r.asChild?l:n.jsx("polygon",{points:"0,0 30,0 15,10"})})});Ux.displayName=rS;var sS=Ux,Gu="Popper",[Vx,Wx]=Nr(Gu),[aS,Hx]=Vx(Gu),Kx=r=>{const{__scopePopper:a,children:l}=r,[i,c]=x.useState(null);return n.jsx(aS,{scope:a,anchor:i,onAnchorChange:c,children:l})};Kx.displayName=Gu;var Gx="PopperAnchor",Qx=x.forwardRef((r,a)=>{const{__scopePopper:l,virtualRef:i,...c}=r,d=Hx(Gx,l),f=x.useRef(null),m=We(a,f),p=x.useRef(null);return x.useEffect(()=>{const g=p.current;p.current=(i==null?void 0:i.current)||f.current,g!==p.current&&d.onAnchorChange(p.current)}),i?null:n.jsx(Le.div,{...c,ref:m})});Qx.displayName=Gx;var Qu="PopperContent",[lS,oS]=Vx(Qu),Yx=x.forwardRef((r,a)=>{var ee,de,Ee,Se,Te,B;const{__scopePopper:l,side:i="bottom",sideOffset:c=0,align:d="center",alignOffset:f=0,arrowPadding:m=0,avoidCollisions:p=!0,collisionBoundary:g=[],collisionPadding:v=0,sticky:w="partial",hideWhenDetached:_=!1,updatePositionStrategy:E="optimized",onPlaced:k,...S}=r,N=Hx(Qu,l),[y,C]=x.useState(null),j=We(a,Ie=>C(Ie)),[A,z]=x.useState(null),K=Ou(A),W=(K==null?void 0:K.width)??0,V=(K==null?void 0:K.height)??0,le=i+(d!=="center"?"-"+d:""),me=typeof v=="number"?v:{top:0,right:0,bottom:0,left:0,...v},oe=Array.isArray(g)?g:[g],fe=oe.length>0,T={padding:me,boundary:oe.filter(cS),altBoundary:fe},{refs:se,floatingStyles:G,placement:Q,isPositioned:O,middlewareData:R}=Q2({strategy:"fixed",placement:le,whileElementsMounted:(...Ie)=>F2(...Ie,{animationFrame:E==="always"}),elements:{reference:N.anchor},middleware:[X2({mainAxis:c+V,alignmentAxis:f}),p&&q2({mainAxis:!0,crossAxis:!1,limiter:w==="partial"?J2():void 0,...T}),p&&Z2({...T}),eS({...T,apply:({elements:Ie,rects:$e,availableWidth:Nt,availableHeight:Vt})=>{const{width:Jt,height:Qr}=$e.reference,fn=Ie.floating.style;fn.setProperty("--radix-popper-available-width",`${Nt}px`),fn.setProperty("--radix-popper-available-height",`${Vt}px`),fn.setProperty("--radix-popper-anchor-width",`${Jt}px`),fn.setProperty("--radix-popper-anchor-height",`${Qr}px`)}}),A&&nS({element:A,padding:m}),uS({arrowWidth:W,arrowHeight:V}),_&&tS({strategy:"referenceHidden",...T})]}),[Y,X]=Jx(Q),L=yr(k);Et(()=>{O&&(L==null||L())},[O,L]);const H=(ee=R.arrow)==null?void 0:ee.x,ue=(de=R.arrow)==null?void 0:de.y,re=((Ee=R.arrow)==null?void 0:Ee.centerOffset)!==0,[je,Ne]=x.useState();return Et(()=>{y&&Ne(window.getComputedStyle(y).zIndex)},[y]),n.jsx("div",{ref:se.setFloating,"data-radix-popper-content-wrapper":"",style:{...G,transform:O?G.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:je,"--radix-popper-transform-origin":[(Se=R.transformOrigin)==null?void 0:Se.x,(Te=R.transformOrigin)==null?void 0:Te.y].join(" "),...((B=R.hide)==null?void 0:B.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:r.dir,children:n.jsx(lS,{scope:l,placedSide:Y,onArrowChange:z,arrowX:H,arrowY:ue,shouldHideArrow:re,children:n.jsx(Le.div,{"data-side":Y,"data-align":X,...S,ref:j,style:{...S.style,animation:O?void 0:"none"}})})})});Yx.displayName=Qu;var Xx="PopperArrow",iS={top:"bottom",right:"left",bottom:"top",left:"right"},qx=x.forwardRef(function(a,l){const{__scopePopper:i,...c}=a,d=oS(Xx,i),f=iS[d.placedSide];return n.jsx("span",{ref:d.onArrowChange,style:{position:"absolute",left:d.arrowX,top:d.arrowY,[f]: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:n.jsx(sS,{...c,ref:l,style:{...c.style,display:"block"}})})});qx.displayName=Xx;function cS(r){return r!==null}var uS=r=>({name:"transformOrigin",options:r,fn(a){var N,y,C;const{placement:l,rects:i,middlewareData:c}=a,f=((N=c.arrow)==null?void 0:N.centerOffset)!==0,m=f?0:r.arrowWidth,p=f?0:r.arrowHeight,[g,v]=Jx(l),w={start:"0%",center:"50%",end:"100%"}[v],_=(((y=c.arrow)==null?void 0:y.x)??0)+m/2,E=(((C=c.arrow)==null?void 0:C.y)??0)+p/2;let k="",S="";return g==="bottom"?(k=f?w:`${_}px`,S=`${-p}px`):g==="top"?(k=f?w:`${_}px`,S=`${i.floating.height+p}px`):g==="right"?(k=`${-p}px`,S=f?w:`${E}px`):g==="left"&&(k=`${i.floating.width+p}px`,S=f?w:`${E}px`),{data:{x:k,y:S}}}});function Jx(r){const[a,l="center"]=r.split("-");return[a,l]}var dS=Kx,fS=Qx,hS=Yx,mS=qx,Zx=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"}),pS="VisuallyHidden",xS=x.forwardRef((r,a)=>n.jsx(Le.span,{...r,ref:a,style:{...Zx,...r.style}}));xS.displayName=pS;var gS=[" ","Enter","ArrowUp","ArrowDown"],yS=[" ","Enter"],Kr="Select",[Do,Oo,vS]=Fu(Kr),[$s]=Nr(Kr,[vS,Wx]),Fo=Wx(),[wS,jr]=$s(Kr),[bS,NS]=$s(Kr),eg=r=>{const{__scopeSelect:a,children:l,open:i,defaultOpen:c,onOpenChange:d,value:f,defaultValue:m,onValueChange:p,dir:g,name:v,autoComplete:w,disabled:_,required:E,form:k}=r,S=Fo(a),[N,y]=x.useState(null),[C,j]=x.useState(null),[A,z]=x.useState(!1),K=Po(g),[W,V]=Vr({prop:i,defaultProp:c??!1,onChange:d,caller:Kr}),[le,me]=Vr({prop:f,defaultProp:m,onChange:p,caller:Kr}),oe=x.useRef(null),fe=N?k||!!N.closest("form"):!0,[T,se]=x.useState(new Set),G=Array.from(T).map(Q=>Q.props.value).join(";");return n.jsx(dS,{...S,children:n.jsxs(wS,{required:E,scope:a,trigger:N,onTriggerChange:y,valueNode:C,onValueNodeChange:j,valueNodeHasChildren:A,onValueNodeHasChildrenChange:z,contentId:gr(),value:le,onValueChange:me,open:W,onOpenChange:V,dir:K,triggerPointerDownPosRef:oe,disabled:_,children:[n.jsx(Do.Provider,{scope:a,children:n.jsx(bS,{scope:r.__scopeSelect,onNativeOptionAdd:x.useCallback(Q=>{se(O=>new Set(O).add(Q))},[]),onNativeOptionRemove:x.useCallback(Q=>{se(O=>{const R=new Set(O);return R.delete(Q),R})},[]),children:l})}),fe?n.jsxs(Ng,{"aria-hidden":!0,required:E,tabIndex:-1,name:v,autoComplete:w,value:le,onChange:Q=>me(Q.target.value),disabled:_,form:k,children:[le===void 0?n.jsx("option",{value:""}):null,Array.from(T)]},G):null]})})};eg.displayName=Kr;var tg="SelectTrigger",ng=x.forwardRef((r,a)=>{const{__scopeSelect:l,disabled:i=!1,...c}=r,d=Fo(l),f=jr(tg,l),m=f.disabled||i,p=We(a,f.onTriggerChange),g=Oo(l),v=x.useRef("touch"),[w,_,E]=Sg(S=>{const N=g().filter(j=>!j.disabled),y=N.find(j=>j.value===f.value),C=Cg(N,S,y);C!==void 0&&f.onValueChange(C.value)}),k=S=>{m||(f.onOpenChange(!0),E()),S&&(f.triggerPointerDownPosRef.current={x:Math.round(S.pageX),y:Math.round(S.pageY)})};return n.jsx(fS,{asChild:!0,...d,children:n.jsx(Le.button,{type:"button",role:"combobox","aria-controls":f.contentId,"aria-expanded":f.open,"aria-required":f.required,"aria-autocomplete":"none",dir:f.dir,"data-state":f.open?"open":"closed",disabled:m,"data-disabled":m?"":void 0,"data-placeholder":jg(f.value)?"":void 0,...c,ref:p,onClick:Ae(c.onClick,S=>{S.currentTarget.focus(),v.current!=="mouse"&&k(S)}),onPointerDown:Ae(c.onPointerDown,S=>{v.current=S.pointerType;const N=S.target;N.hasPointerCapture(S.pointerId)&&N.releasePointerCapture(S.pointerId),S.button===0&&S.ctrlKey===!1&&S.pointerType==="mouse"&&(k(S),S.preventDefault())}),onKeyDown:Ae(c.onKeyDown,S=>{const N=w.current!=="";!(S.ctrlKey||S.altKey||S.metaKey)&&S.key.length===1&&_(S.key),!(N&&S.key===" ")&&gS.includes(S.key)&&(k(),S.preventDefault())})})})});ng.displayName=tg;var rg="SelectValue",sg=x.forwardRef((r,a)=>{const{__scopeSelect:l,className:i,style:c,children:d,placeholder:f="",...m}=r,p=jr(rg,l),{onValueNodeHasChildrenChange:g}=p,v=d!==void 0,w=We(a,p.onValueNodeChange);return Et(()=>{g(v)},[g,v]),n.jsx(Le.span,{...m,ref:w,style:{pointerEvents:"none"},children:jg(p.value)?n.jsx(n.Fragment,{children:f}):d})});sg.displayName=rg;var jS="SelectIcon",ag=x.forwardRef((r,a)=>{const{__scopeSelect:l,children:i,...c}=r;return n.jsx(Le.span,{"aria-hidden":!0,...c,ref:a,children:i||"▼"})});ag.displayName=jS;var SS="SelectPortal",lg=r=>n.jsx(Tu,{asChild:!0,...r});lg.displayName=SS;var Gr="SelectContent",og=x.forwardRef((r,a)=>{const l=jr(Gr,r.__scopeSelect),[i,c]=x.useState();if(Et(()=>{c(new DocumentFragment)},[]),!l.open){const d=i;return d?Ia.createPortal(n.jsx(ig,{scope:r.__scopeSelect,children:n.jsx(Do.Slot,{scope:r.__scopeSelect,children:n.jsx("div",{children:r.children})})}),d):null}return n.jsx(cg,{...r,ref:a})});og.displayName=Gr;var ln=10,[ig,Sr]=$s(Gr),CS="SelectContentImpl",kS=Ra("SelectContent.RemoveScroll"),cg=x.forwardRef((r,a)=>{const{__scopeSelect:l,position:i="item-aligned",onCloseAutoFocus:c,onEscapeKeyDown:d,onPointerDownOutside:f,side:m,sideOffset:p,align:g,alignOffset:v,arrowPadding:w,collisionBoundary:_,collisionPadding:E,sticky:k,hideWhenDetached:S,avoidCollisions:N,...y}=r,C=jr(Gr,l),[j,A]=x.useState(null),[z,K]=x.useState(null),W=We(a,ee=>A(ee)),[V,le]=x.useState(null),[me,oe]=x.useState(null),fe=Oo(l),[T,se]=x.useState(!1),G=x.useRef(!1);x.useEffect(()=>{if(j)return Hp(j)},[j]),Dp();const Q=x.useCallback(ee=>{const[de,...Ee]=fe().map(B=>B.ref.current),[Se]=Ee.slice(-1),Te=document.activeElement;for(const B of ee)if(B===Te||(B==null||B.scrollIntoView({block:"nearest"}),B===de&&z&&(z.scrollTop=0),B===Se&&z&&(z.scrollTop=z.scrollHeight),B==null||B.focus(),document.activeElement!==Te))return},[fe,z]),O=x.useCallback(()=>Q([V,j]),[Q,V,j]);x.useEffect(()=>{T&&O()},[T,O]);const{onOpenChange:R,triggerPointerDownPosRef:Y}=C;x.useEffect(()=>{if(j){let ee={x:0,y:0};const de=Se=>{var Te,B;ee={x:Math.abs(Math.round(Se.pageX)-(((Te=Y.current)==null?void 0:Te.x)??0)),y:Math.abs(Math.round(Se.pageY)-(((B=Y.current)==null?void 0:B.y)??0))}},Ee=Se=>{ee.x<=10&&ee.y<=10?Se.preventDefault():j.contains(Se.target)||R(!1),document.removeEventListener("pointermove",de),Y.current=null};return Y.current!==null&&(document.addEventListener("pointermove",de),document.addEventListener("pointerup",Ee,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",de),document.removeEventListener("pointerup",Ee,{capture:!0})}}},[j,R,Y]),x.useEffect(()=>{const ee=()=>R(!1);return window.addEventListener("blur",ee),window.addEventListener("resize",ee),()=>{window.removeEventListener("blur",ee),window.removeEventListener("resize",ee)}},[R]);const[X,L]=Sg(ee=>{const de=fe().filter(Te=>!Te.disabled),Ee=de.find(Te=>Te.ref.current===document.activeElement),Se=Cg(de,ee,Ee);Se&&setTimeout(()=>Se.ref.current.focus())}),H=x.useCallback((ee,de,Ee)=>{const Se=!G.current&&!Ee;(C.value!==void 0&&C.value===de||Se)&&(le(ee),Se&&(G.current=!0))},[C.value]),ue=x.useCallback(()=>j==null?void 0:j.focus(),[j]),re=x.useCallback((ee,de,Ee)=>{const Se=!G.current&&!Ee;(C.value!==void 0&&C.value===de||Se)&&oe(ee)},[C.value]),je=i==="popper"?fu:ug,Ne=je===fu?{side:m,sideOffset:p,align:g,alignOffset:v,arrowPadding:w,collisionBoundary:_,collisionPadding:E,sticky:k,hideWhenDetached:S,avoidCollisions:N}:{};return n.jsx(ig,{scope:l,content:j,viewport:z,onViewportChange:K,itemRefCallback:H,selectedItem:V,onItemLeave:ue,itemTextRefCallback:re,focusSelectedItem:O,selectedItemText:me,position:i,isPositioned:T,searchRef:X,children:n.jsx(Iu,{as:kS,allowPinchZoom:!0,children:n.jsx(Ru,{asChild:!0,trapped:C.open,onMountAutoFocus:ee=>{ee.preventDefault()},onUnmountAutoFocus:Ae(c,ee=>{var de;(de=C.trigger)==null||de.focus({preventScroll:!0}),ee.preventDefault()}),children:n.jsx(Pu,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:d,onPointerDownOutside:f,onFocusOutside:ee=>ee.preventDefault(),onDismiss:()=>C.onOpenChange(!1),children:n.jsx(je,{role:"listbox",id:C.contentId,"data-state":C.open?"open":"closed",dir:C.dir,onContextMenu:ee=>ee.preventDefault(),...y,...Ne,onPlaced:()=>se(!0),ref:W,style:{display:"flex",flexDirection:"column",outline:"none",...y.style},onKeyDown:Ae(y.onKeyDown,ee=>{const de=ee.ctrlKey||ee.altKey||ee.metaKey;if(ee.key==="Tab"&&ee.preventDefault(),!de&&ee.key.length===1&&L(ee.key),["ArrowUp","ArrowDown","Home","End"].includes(ee.key)){let Se=fe().filter(Te=>!Te.disabled).map(Te=>Te.ref.current);if(["ArrowUp","End"].includes(ee.key)&&(Se=Se.slice().reverse()),["ArrowUp","ArrowDown"].includes(ee.key)){const Te=ee.target,B=Se.indexOf(Te);Se=Se.slice(B+1)}setTimeout(()=>Q(Se)),ee.preventDefault()}})})})})})})});cg.displayName=CS;var ES="SelectItemAlignedPosition",ug=x.forwardRef((r,a)=>{const{__scopeSelect:l,onPlaced:i,...c}=r,d=jr(Gr,l),f=Sr(Gr,l),[m,p]=x.useState(null),[g,v]=x.useState(null),w=We(a,W=>v(W)),_=Oo(l),E=x.useRef(!1),k=x.useRef(!0),{viewport:S,selectedItem:N,selectedItemText:y,focusSelectedItem:C}=f,j=x.useCallback(()=>{if(d.trigger&&d.valueNode&&m&&g&&S&&N&&y){const W=d.trigger.getBoundingClientRect(),V=g.getBoundingClientRect(),le=d.valueNode.getBoundingClientRect(),me=y.getBoundingClientRect();if(d.dir!=="rtl"){const Te=me.left-V.left,B=le.left-Te,Ie=W.left-B,$e=W.width+Ie,Nt=Math.max($e,V.width),Vt=window.innerWidth-ln,Jt=ho(B,[ln,Math.max(ln,Vt-Nt)]);m.style.minWidth=$e+"px",m.style.left=Jt+"px"}else{const Te=V.right-me.right,B=window.innerWidth-le.right-Te,Ie=window.innerWidth-W.right-B,$e=W.width+Ie,Nt=Math.max($e,V.width),Vt=window.innerWidth-ln,Jt=ho(B,[ln,Math.max(ln,Vt-Nt)]);m.style.minWidth=$e+"px",m.style.right=Jt+"px"}const oe=_(),fe=window.innerHeight-ln*2,T=S.scrollHeight,se=window.getComputedStyle(g),G=parseInt(se.borderTopWidth,10),Q=parseInt(se.paddingTop,10),O=parseInt(se.borderBottomWidth,10),R=parseInt(se.paddingBottom,10),Y=G+Q+T+R+O,X=Math.min(N.offsetHeight*5,Y),L=window.getComputedStyle(S),H=parseInt(L.paddingTop,10),ue=parseInt(L.paddingBottom,10),re=W.top+W.height/2-ln,je=fe-re,Ne=N.offsetHeight/2,ee=N.offsetTop+Ne,de=G+Q+ee,Ee=Y-de;if(de<=re){const Te=oe.length>0&&N===oe[oe.length-1].ref.current;m.style.bottom="0px";const B=g.clientHeight-S.offsetTop-S.offsetHeight,Ie=Math.max(je,Ne+(Te?ue:0)+B+O),$e=de+Ie;m.style.height=$e+"px"}else{const Te=oe.length>0&&N===oe[0].ref.current;m.style.top="0px";const Ie=Math.max(re,G+S.offsetTop+(Te?H:0)+Ne)+Ee;m.style.height=Ie+"px",S.scrollTop=de-re+S.offsetTop}m.style.margin=`${ln}px 0`,m.style.minHeight=X+"px",m.style.maxHeight=fe+"px",i==null||i(),requestAnimationFrame(()=>E.current=!0)}},[_,d.trigger,d.valueNode,m,g,S,N,y,d.dir,i]);Et(()=>j(),[j]);const[A,z]=x.useState();Et(()=>{g&&z(window.getComputedStyle(g).zIndex)},[g]);const K=x.useCallback(W=>{W&&k.current===!0&&(j(),C==null||C(),k.current=!1)},[j,C]);return n.jsx(PS,{scope:l,contentWrapper:m,shouldExpandOnScrollRef:E,onScrollButtonChange:K,children:n.jsx("div",{ref:p,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:A},children:n.jsx(Le.div,{...c,ref:w,style:{boxSizing:"border-box",maxHeight:"100%",...c.style}})})})});ug.displayName=ES;var _S="SelectPopperPosition",fu=x.forwardRef((r,a)=>{const{__scopeSelect:l,align:i="start",collisionPadding:c=ln,...d}=r,f=Fo(l);return n.jsx(hS,{...f,...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)"}})});fu.displayName=_S;var[PS,Yu]=$s(Gr,{}),hu="SelectViewport",dg=x.forwardRef((r,a)=>{const{__scopeSelect:l,nonce:i,...c}=r,d=Sr(hu,l),f=Yu(hu,l),m=We(a,d.onViewportChange),p=x.useRef(0);return n.jsxs(n.Fragment,{children:[n.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}),n.jsx(Do.Slot,{scope:l,children:n.jsx(Le.div,{"data-radix-select-viewport":"",role:"presentation",...c,ref:m,style:{position:"relative",flex:1,overflow:"hidden auto",...c.style},onScroll:Ae(c.onScroll,g=>{const v=g.currentTarget,{contentWrapper:w,shouldExpandOnScrollRef:_}=f;if(_!=null&&_.current&&w){const E=Math.abs(p.current-v.scrollTop);if(E>0){const k=window.innerHeight-ln*2,S=parseFloat(w.style.minHeight),N=parseFloat(w.style.height),y=Math.max(S,N);if(y<k){const C=y+E,j=Math.min(k,C),A=C-j;w.style.height=j+"px",w.style.bottom==="0px"&&(v.scrollTop=A>0?A:0,w.style.justifyContent="flex-end")}}}p.current=v.scrollTop})})})]})});dg.displayName=hu;var fg="SelectGroup",[RS,TS]=$s(fg),IS=x.forwardRef((r,a)=>{const{__scopeSelect:l,...i}=r,c=gr();return n.jsx(RS,{scope:l,id:c,children:n.jsx(Le.div,{role:"group","aria-labelledby":c,...i,ref:a})})});IS.displayName=fg;var hg="SelectLabel",AS=x.forwardRef((r,a)=>{const{__scopeSelect:l,...i}=r,c=TS(hg,l);return n.jsx(Le.div,{id:c.id,...i,ref:a})});AS.displayName=hg;var yo="SelectItem",[MS,mg]=$s(yo),pg=x.forwardRef((r,a)=>{const{__scopeSelect:l,value:i,disabled:c=!1,textValue:d,...f}=r,m=jr(yo,l),p=Sr(yo,l),g=m.value===i,[v,w]=x.useState(d??""),[_,E]=x.useState(!1),k=We(a,C=>{var j;return(j=p.itemRefCallback)==null?void 0:j.call(p,C,i,c)}),S=gr(),N=x.useRef("touch"),y=()=>{c||(m.onValueChange(i),m.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 n.jsx(MS,{scope:l,value:i,disabled:c,textId:S,isSelected:g,onItemTextChange:x.useCallback(C=>{w(j=>j||((C==null?void 0:C.textContent)??"").trim())},[]),children:n.jsx(Do.ItemSlot,{scope:l,value:i,disabled:c,textValue:v,children:n.jsx(Le.div,{role:"option","aria-labelledby":S,"data-highlighted":_?"":void 0,"aria-selected":g&&_,"data-state":g?"checked":"unchecked","aria-disabled":c||void 0,"data-disabled":c?"":void 0,tabIndex:c?void 0:-1,...f,ref:k,onFocus:Ae(f.onFocus,()=>E(!0)),onBlur:Ae(f.onBlur,()=>E(!1)),onClick:Ae(f.onClick,()=>{N.current!=="mouse"&&y()}),onPointerUp:Ae(f.onPointerUp,()=>{N.current==="mouse"&&y()}),onPointerDown:Ae(f.onPointerDown,C=>{N.current=C.pointerType}),onPointerMove:Ae(f.onPointerMove,C=>{var j;N.current=C.pointerType,c?(j=p.onItemLeave)==null||j.call(p):N.current==="mouse"&&C.currentTarget.focus({preventScroll:!0})}),onPointerLeave:Ae(f.onPointerLeave,C=>{var j;C.currentTarget===document.activeElement&&((j=p.onItemLeave)==null||j.call(p))}),onKeyDown:Ae(f.onKeyDown,C=>{var A;((A=p.searchRef)==null?void 0:A.current)!==""&&C.key===" "||(yS.includes(C.key)&&y(),C.key===" "&&C.preventDefault())})})})})});pg.displayName=yo;var Ea="SelectItemText",xg=x.forwardRef((r,a)=>{const{__scopeSelect:l,className:i,style:c,...d}=r,f=jr(Ea,l),m=Sr(Ea,l),p=mg(Ea,l),g=NS(Ea,l),[v,w]=x.useState(null),_=We(a,y=>w(y),p.onItemTextChange,y=>{var C;return(C=m.itemTextRefCallback)==null?void 0:C.call(m,y,p.value,p.disabled)}),E=v==null?void 0:v.textContent,k=x.useMemo(()=>n.jsx("option",{value:p.value,disabled:p.disabled,children:E},p.value),[p.disabled,p.value,E]),{onNativeOptionAdd:S,onNativeOptionRemove:N}=g;return Et(()=>(S(k),()=>N(k)),[S,N,k]),n.jsxs(n.Fragment,{children:[n.jsx(Le.span,{id:p.textId,...d,ref:_}),p.isSelected&&f.valueNode&&!f.valueNodeHasChildren?Ia.createPortal(d.children,f.valueNode):null]})});xg.displayName=Ea;var gg="SelectItemIndicator",yg=x.forwardRef((r,a)=>{const{__scopeSelect:l,...i}=r;return mg(gg,l).isSelected?n.jsx(Le.span,{"aria-hidden":!0,...i,ref:a}):null});yg.displayName=gg;var mu="SelectScrollUpButton",vg=x.forwardRef((r,a)=>{const l=Sr(mu,r.__scopeSelect),i=Yu(mu,r.__scopeSelect),[c,d]=x.useState(!1),f=We(a,i.onScrollButtonChange);return Et(()=>{if(l.viewport&&l.isPositioned){let m=function(){const g=p.scrollTop>0;d(g)};const p=l.viewport;return m(),p.addEventListener("scroll",m),()=>p.removeEventListener("scroll",m)}},[l.viewport,l.isPositioned]),c?n.jsx(bg,{...r,ref:f,onAutoScroll:()=>{const{viewport:m,selectedItem:p}=l;m&&p&&(m.scrollTop=m.scrollTop-p.offsetHeight)}}):null});vg.displayName=mu;var pu="SelectScrollDownButton",wg=x.forwardRef((r,a)=>{const l=Sr(pu,r.__scopeSelect),i=Yu(pu,r.__scopeSelect),[c,d]=x.useState(!1),f=We(a,i.onScrollButtonChange);return Et(()=>{if(l.viewport&&l.isPositioned){let m=function(){const g=p.scrollHeight-p.clientHeight,v=Math.ceil(p.scrollTop)<g;d(v)};const p=l.viewport;return m(),p.addEventListener("scroll",m),()=>p.removeEventListener("scroll",m)}},[l.viewport,l.isPositioned]),c?n.jsx(bg,{...r,ref:f,onAutoScroll:()=>{const{viewport:m,selectedItem:p}=l;m&&p&&(m.scrollTop=m.scrollTop+p.offsetHeight)}}):null});wg.displayName=pu;var bg=x.forwardRef((r,a)=>{const{__scopeSelect:l,onAutoScroll:i,...c}=r,d=Sr("SelectScrollButton",l),f=x.useRef(null),m=Oo(l),p=x.useCallback(()=>{f.current!==null&&(window.clearInterval(f.current),f.current=null)},[]);return x.useEffect(()=>()=>p(),[p]),Et(()=>{var v;const g=m().find(w=>w.ref.current===document.activeElement);(v=g==null?void 0:g.ref.current)==null||v.scrollIntoView({block:"nearest"})},[m]),n.jsx(Le.div,{"aria-hidden":!0,...c,ref:a,style:{flexShrink:0,...c.style},onPointerDown:Ae(c.onPointerDown,()=>{f.current===null&&(f.current=window.setInterval(i,50))}),onPointerMove:Ae(c.onPointerMove,()=>{var g;(g=d.onItemLeave)==null||g.call(d),f.current===null&&(f.current=window.setInterval(i,50))}),onPointerLeave:Ae(c.onPointerLeave,()=>{p()})})}),LS="SelectSeparator",DS=x.forwardRef((r,a)=>{const{__scopeSelect:l,...i}=r;return n.jsx(Le.div,{"aria-hidden":!0,...i,ref:a})});DS.displayName=LS;var xu="SelectArrow",OS=x.forwardRef((r,a)=>{const{__scopeSelect:l,...i}=r,c=Fo(l),d=jr(xu,l),f=Sr(xu,l);return d.open&&f.position==="popper"?n.jsx(mS,{...c,...i,ref:a}):null});OS.displayName=xu;var FS="SelectBubbleInput",Ng=x.forwardRef(({__scopeSelect:r,value:a,...l},i)=>{const c=x.useRef(null),d=We(i,c),f=Du(a);return x.useEffect(()=>{const m=c.current;if(!m)return;const p=window.HTMLSelectElement.prototype,v=Object.getOwnPropertyDescriptor(p,"value").set;if(f!==a&&v){const w=new Event("change",{bubbles:!0});v.call(m,a),m.dispatchEvent(w)}},[f,a]),n.jsx(Le.select,{...l,style:{...Zx,...l.style},ref:d,defaultValue:a})});Ng.displayName=FS;function jg(r){return r===""||r===void 0}function Sg(r){const a=yr(r),l=x.useRef(""),i=x.useRef(0),c=x.useCallback(f=>{const m=l.current+f;a(m),(function p(g){l.current=g,window.clearTimeout(i.current),g!==""&&(i.current=window.setTimeout(()=>p(""),1e3))})(m)},[a]),d=x.useCallback(()=>{l.current="",window.clearTimeout(i.current)},[]);return x.useEffect(()=>()=>window.clearTimeout(i.current),[]),[l,c,d]}function Cg(r,a,l){const c=a.length>1&&Array.from(a).every(g=>g===a[0])?a[0]:a,d=l?r.indexOf(l):-1;let f=zS(r,Math.max(d,0));c.length===1&&(f=f.filter(g=>g!==l));const p=f.find(g=>g.textValue.toLowerCase().startsWith(c.toLowerCase()));return p!==l?p:void 0}function zS(r,a){return r.map((l,i)=>r[(a+i)%r.length])}var $S=eg,kg=ng,BS=sg,US=ag,VS=lg,Eg=og,WS=dg,_g=pg,HS=xg,KS=yg,GS=vg,QS=wg;const Kc=$S,Gc=BS,ro=x.forwardRef(({className:r,children:a,...l},i)=>n.jsxs(kg,{ref:i,className:He("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,n.jsx(US,{asChild:!0,children:n.jsx(ap,{className:"h-4 w-4 opacity-50"})})]}));ro.displayName=kg.displayName;const so=x.forwardRef(({className:r,children:a,position:l="popper",...i},c)=>n.jsx(VS,{children:n.jsxs(Eg,{ref:c,className:He("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:[n.jsx(GS,{className:"flex cursor-default items-center justify-center py-1",children:n.jsx(mw,{className:"h-4 w-4"})}),n.jsx(WS,{className:"p-1",children:a}),n.jsx(QS,{className:"flex cursor-default items-center justify-center py-1",children:n.jsx(ap,{className:"h-4 w-4"})})]})}));so.displayName=Eg.displayName;const hr=x.forwardRef(({className:r,children:a,...l},i)=>n.jsxs(_g,{ref:i,className:He("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:[n.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:n.jsx(KS,{children:n.jsx(bo,{className:"h-4 w-4"})})}),n.jsx(HS,{children:a})]}));hr.displayName=_g.displayName;function YS(r){const a=new Map;for(const l of r){const i=l.partId||"part-1",c=l.partTitle||"未分类",d=l.chapterId||"chapter-1",f=l.chapterTitle||"未分类";a.has(i)||a.set(i,{id:i,title:c,chapters:new Map});const m=a.get(i);m.chapters.has(d)||m.chapters.set(d,{id:d,title:f,sections:[]}),m.chapters.get(d).sections.push({id:l.id,title:l.title,price:l.price??1,filePath:l.filePath,isFree:l.isFree})}return Array.from(a.values()).map(l=>({...l,chapters:Array.from(l.chapters.values())}))}function XS(r,a){const l=r.split(`
|
||
`),i=[];let c=null,d=[],f=1;for(const m of l){const p=m.match(/^#+\s+(.+)$/)||m.match(/^(\d+[.\、]\s*.+)$/);p?(c&&(c.content=d.join(`
|
||
`).trim(),c.content&&i.push(c)),c={id:`import-${f}`,title:p[1].replace(/^#+\s*/,"").trim(),price:1,is_free:f<=3},d=[],f++):c?d.push(m):m.trim()&&(c={id:`import-${f}`,title:a.replace(/\.(txt|md|markdown)$/i,""),price:1,is_free:!0},d.push(m),f++)}return c&&(c.content=d.join(`
|
||
`).trim(),c.content&&i.push(c)),i}function qS(){const[r,a]=x.useState([]),[l,i]=x.useState(!0),[c,d]=x.useState([]),[f,m]=x.useState(null),[p,g]=x.useState(!1),[v,w]=x.useState(!1),[_,E]=x.useState(!1),[k,S]=x.useState(!1),[N,y]=x.useState(""),[C,j]=x.useState(!1),[A,z]=x.useState(!1),[K,W]=x.useState(!1),[V,le]=x.useState(""),[me,oe]=x.useState(!1),[fe,T]=x.useState(!1),[se,G]=x.useState(""),[Q,O]=x.useState([]),[R,Y]=x.useState(!1),[X,L]=x.useState(!1),H=x.useRef(null),ue=x.useRef(null),[re,je]=x.useState({id:"",title:"",price:1,partId:"part-1",chapterId:"chapter-1",content:""}),Ne=YS(r),ee=r.length,de=async()=>{i(!0);try{const U=await Ge("/api/db/book?action=list");a(Array.isArray(U==null?void 0:U.sections)?U.sections:[]),c.length===0&&Ne.length>0&&d([Ne[0].id])}catch(U){console.error(U),a([])}finally{i(!1)}};x.useEffect(()=>{de()},[]),x.useEffect(()=>{!l&&Ne.length>0&&c.length===0&&d([Ne[0].id])},[l,Ne.length,c.length]);const Ee=U=>{d(ce=>ce.includes(U)?ce.filter(lt=>lt!==U):[...ce,U])},Se=async U=>{oe(!0);try{const ce=await Ge(`/api/db/book?action=read&id=${encodeURIComponent(U.id)}`);ce!=null&&ce.success&&ce.section?m({id:U.id,title:ce.section.title??U.title,price:ce.section.price??U.price,content:ce.section.content??"",filePath:U.filePath,isFree:U.isFree||U.price===0}):(m({id:U.id,title:U.title,price:U.price,content:"",filePath:U.filePath,isFree:U.isFree}),ce&&!ce.success&&alert("无法读取文件内容: "+(ce.error||"未知错误")))}catch(ce){console.error(ce),m({id:U.id,title:U.title,price:U.price,content:"",filePath:U.filePath,isFree:U.isFree})}finally{oe(!1)}},Te=async()=>{var U;if(f){T(!0);try{let ce=f.content||"";const lt=[new RegExp(`^#+\\s*${f.id.replace(".","\\.")}\\s+.*$`,"gm"),new RegExp(`^#+\\s*${f.id.replace(".","\\.")}[::].*$`,"gm"),new RegExp(`^#\\s+.*${(U=f.title)==null?void 0:U.slice(0,10).replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}.*$`,"gm")];for(const Dt of lt)ce=ce.replace(Dt,"");ce=ce.replace(/^\s*\n+/,"").trim();const Ve=await Bn("/api/db/book",{id:f.id,title:f.title,price:f.isFree?0:f.price,content:ce,isFree:f.isFree||f.price===0,saveToFile:!0});Ve&&Ve.success!==!1?(alert(`已保存章节: ${f.title}`),m(null),de()):alert("保存失败: "+(Ve&&typeof Ve=="object"&&"error"in Ve?Ve.error:"未知错误"))}catch(ce){console.error(ce),alert("保存失败")}finally{T(!1)}}},B=async()=>{if(!re.id||!re.title){alert("请填写章节ID和标题");return}T(!0);try{const U=await Bn("/api/db/book",{id:re.id,title:re.title,price:re.price,content:re.content,partId:re.partId,chapterId:re.chapterId,saveToFile:!1});U&&U.success!==!1?(alert(`章节创建成功: ${re.title}`),W(!1),je({id:"",title:"",price:1,partId:"part-1",chapterId:"chapter-1",content:""}),de()):alert("创建失败: "+(U&&typeof U=="object"&&"error"in U?U.error:"未知错误"))}catch(U){console.error(U),alert("创建失败")}finally{T(!1)}},Ie=async U=>{var lt,Ve;const ce=(lt=U.target.files)==null?void 0:lt[0];if(ce){L(!0);try{const Dt=new FormData;Dt.append("file",ce),Dt.append("folder","book-images");const dt=await(await fetch(su("/api/upload"),{method:"POST",body:Dt,credentials:"include"})).json();if(dt!=null&&dt.success&&((Ve=dt==null?void 0:dt.data)!=null&&Ve.url)){const mn=``;f&&m({...f,content:(f.content||"")+`
|
||
|
||
`+mn}),alert(`图片上传成功: ${dt.data.url}`)}else alert("上传失败: "+((dt==null?void 0:dt.error)||"未知错误"))}catch(Dt){console.error(Dt),alert("上传失败")}finally{L(!1),ue.current&&(ue.current.value="")}}},$e=async()=>{var U;if(se.trim()){Y(!0);try{const ce=await Ge(`/api/search?q=${encodeURIComponent(se)}`);ce!=null&&ce.success&&((U=ce.data)!=null&&U.results)?O(ce.data.results):(O([]),ce&&!ce.success&&alert("搜索失败: "+ce.error))}catch(ce){console.error(ce),O([]),alert("搜索失败")}finally{Y(!1)}}},Nt=async()=>{g(!0);try{const U=await vt("/api/db/book",{action:"sync"});U&&U.success!==!1?(alert(U.message||"同步成功"),de()):alert("同步失败: "+(U&&typeof U=="object"&&"error"in U?U.error:"未知错误"))}catch(U){console.error(U),alert("同步失败")}finally{g(!1)}},Vt=async()=>{w(!0);try{const ce=await(await fetch(su("/api/db/book?action=export"),{credentials:"include"})).blob(),lt=window.URL.createObjectURL(ce),Ve=document.createElement("a");Ve.href=lt,Ve.download=`book_sections_${new Date().toISOString().split("T")[0]}.json`,document.body.appendChild(Ve),Ve.click(),window.URL.revokeObjectURL(lt),document.body.removeChild(Ve),alert("导出成功")}catch(U){console.error(U),alert("导出失败")}finally{w(!1)}},Jt=async()=>{if(!V.trim()){alert("请输入或上传JSON数据");return}E(!0);try{const U=JSON.parse(V),ce=await vt("/api/db/book",{action:"import",data:U});ce&&ce.success!==!1?(alert(ce.message||"导入成功"),z(!1),le(""),de()):alert("导入失败: "+(ce&&typeof ce=="object"&&"error"in ce?ce.error:"未知错误"))}catch(U){console.error(U),alert("导入失败: JSON格式错误")}finally{E(!1)}},Qr=U=>{var Ve;const ce=(Ve=U.target.files)==null?void 0:Ve[0];if(!ce)return;const lt=new FileReader;lt.onload=Dt=>{var mn;const Cn=((mn=Dt.target)==null?void 0:mn.result)||"",dt=ce.name.toLowerCase();dt.endsWith(".json")?le(Cn):dt.endsWith(".txt")||dt.endsWith(".md")||dt.endsWith(".markdown")?le(JSON.stringify(XS(Cn,ce.name),null,2)):le(Cn)},lt.readAsText(ce)},fn=async()=>{var U;if(confirm("确定要初始化数据库吗?这将创建所有必需的表结构。")){S(!0);try{const ce=await vt("/api/db/init",{adminToken:"init_db_2025"});ce&&ce.success!==!1?alert(((U=ce.data)==null?void 0:U.message)||"初始化成功"):alert("初始化失败: "+(ce&&typeof ce=="object"&&"error"in ce?ce.error:"未知错误"))}catch(ce){console.error(ce),alert("初始化失败")}finally{S(!1)}}},Cr=async()=>{if(!N.trim()){alert("请输入飞书文档链接");return}g(!0),await new Promise(U=>setTimeout(U,2e3)),g(!1),j(!1),alert("飞书文档同步成功!")},hn=Ne.find(U=>U.id===re.partId),Yr=(hn==null?void 0:hn.chapters)??[];return n.jsxs("div",{className:"p-8 max-w-6xl mx-auto",children:[n.jsxs("div",{className:"flex justify-between items-center mb-8",children:[n.jsxs("div",{children:[n.jsx("h2",{className:"text-2xl font-bold text-white",children:"内容管理"}),n.jsxs("p",{className:"text-gray-400 mt-1",children:["共 ",Ne.length," 篇 · ",ee," 节内容"]})]}),n.jsxs("div",{className:"flex gap-2",children:[n.jsxs(ye,{onClick:fn,disabled:k,variant:"outline",className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:[n.jsx(Sw,{className:"w-4 h-4 mr-2"}),k?"初始化中...":"初始化数据库"]}),n.jsxs(ye,{onClick:Nt,disabled:p,variant:"outline",className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:[n.jsx(Ze,{className:`w-4 h-4 mr-2 ${p?"animate-spin":""}`}),"同步到数据库"]}),n.jsxs(ye,{onClick:()=>z(!0),variant:"outline",className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:[n.jsx(Ss,{className:"w-4 h-4 mr-2"}),"导入"]}),n.jsxs(ye,{onClick:Vt,disabled:v,variant:"outline",className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:[n.jsx(up,{className:"w-4 h-4 mr-2"}),v?"导出中...":"导出"]}),n.jsxs(ye,{onClick:()=>j(!0),className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:[n.jsx(dp,{className:"w-4 h-4 mr-2"}),"同步飞书"]})]})]}),n.jsx(Ln,{open:A,onOpenChange:z,children:n.jsxs(Dn,{className:"bg-[#0f2137] border-gray-700 text-white max-w-2xl",showCloseButton:!0,children:[n.jsx(On,{children:n.jsxs(Fn,{className:"text-white flex items-center gap-2",children:[n.jsx(Ss,{className:"w-5 h-5 text-[#38bdac]"}),"导入章节数据"]})}),n.jsxs("div",{className:"space-y-4 py-4",children:[n.jsxs("div",{className:"space-y-2",children:[n.jsx(te,{className:"text-gray-300",children:"上传文件 (支持 JSON / TXT / MD)"}),n.jsx("input",{ref:H,type:"file",accept:".json,.txt,.md,.markdown",onChange:Qr,className:"hidden"}),n.jsxs(ye,{variant:"outline",onClick:()=>{var U;return(U=H.current)==null?void 0:U.click()},className:"w-full border-dashed border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:[n.jsx(Ss,{className:"w-4 h-4 mr-2"}),"选择文件 (JSON/TXT/MD)"]}),n.jsxs("p",{className:"text-xs text-gray-500",children:["• JSON格式: 直接导入章节数据",n.jsx("br",{}),"• TXT/MD格式: 自动解析为章节内容"]})]}),n.jsxs("div",{className:"space-y-2",children:[n.jsx(te,{className:"text-gray-300",children:"或粘贴数据"}),n.jsx($r,{className:"bg-[#0a1628] border-gray-700 text-white min-h-[200px] font-mono text-sm placeholder:text-gray-500",placeholder:`JSON格式: [{"id": "1-1", "title": "章节标题", "content": "内容..."}]
|
||
|
||
或直接粘贴TXT/MD内容,系统将自动解析`,value:V,onChange:U=>le(U.target.value)})]})]}),n.jsxs(pr,{children:[n.jsx(ye,{variant:"outline",onClick:()=>{z(!1),le("")},className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:"取消"}),n.jsx(ye,{onClick:Jt,disabled:_||!V.trim(),className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:_?n.jsxs(n.Fragment,{children:[n.jsx(Ze,{className:"w-4 h-4 mr-2 animate-spin"}),"导入中..."]}):n.jsxs(n.Fragment,{children:[n.jsx(Ss,{className:"w-4 h-4 mr-2"}),"开始导入"]})})]})]})}),n.jsx(Ln,{open:C,onOpenChange:j,children:n.jsxs(Dn,{className:"bg-[#0f2137] border-gray-700 text-white max-w-lg",showCloseButton:!0,children:[n.jsx(On,{children:n.jsxs(Fn,{className:"text-white flex items-center gap-2",children:[n.jsx(Cs,{className:"w-5 h-5 text-[#38bdac]"}),"同步飞书文档"]})}),n.jsxs("div",{className:"space-y-4 py-4",children:[n.jsxs("div",{className:"space-y-2",children:[n.jsx(te,{className:"text-gray-300",children:"飞书文档链接"}),n.jsx(ae,{className:"bg-[#0a1628] border-gray-700 text-white placeholder:text-gray-500",placeholder:"https://xxx.feishu.cn/docx/...",value:N,onChange:U=>y(U.target.value)}),n.jsx("p",{className:"text-xs text-gray-500",children:"请确保文档已开启公开访问权限"})]}),n.jsx("div",{className:"bg-[#38bdac]/10 border border-[#38bdac]/30 rounded-lg p-3",children:n.jsx("p",{className:"text-[#38bdac] text-sm",children:"同步说明:系统将自动解析飞书文档结构,按照标题层级导入为章节内容。"})})]}),n.jsxs(pr,{children:[n.jsx(ye,{variant:"outline",onClick:()=>j(!1),className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:"取消"}),n.jsx(ye,{onClick:Cr,disabled:p,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:p?n.jsxs(n.Fragment,{children:[n.jsx(Ze,{className:"w-4 h-4 mr-2 animate-spin"}),"同步中..."]}):n.jsxs(n.Fragment,{children:[n.jsx(Ze,{className:"w-4 h-4 mr-2"}),"开始同步"]})})]})]})}),n.jsx(Ln,{open:K,onOpenChange:W,children:n.jsxs(Dn,{className:"bg-[#0f2137] border-gray-700 text-white max-w-2xl max-h-[90vh] overflow-y-auto",showCloseButton:!0,children:[n.jsx(On,{children:n.jsxs(Fn,{className:"text-white flex items-center gap-2",children:[n.jsx(ks,{className:"w-5 h-5 text-[#38bdac]"}),"新建章节"]})}),n.jsxs("div",{className:"space-y-4 py-4",children:[n.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[n.jsxs("div",{className:"space-y-2",children:[n.jsx(te,{className:"text-gray-300",children:"章节ID *"}),n.jsx(ae,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"如: 9.15",value:re.id,onChange:U=>je({...re,id:U.target.value})})]}),n.jsxs("div",{className:"space-y-2",children:[n.jsx(te,{className:"text-gray-300",children:"价格 (元)"}),n.jsx(ae,{type:"number",className:"bg-[#0a1628] border-gray-700 text-white",value:re.price,onChange:U=>je({...re,price:Number(U.target.value)})})]})]}),n.jsxs("div",{className:"space-y-2",children:[n.jsx(te,{className:"text-gray-300",children:"章节标题 *"}),n.jsx(ae,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"输入章节标题",value:re.title,onChange:U=>je({...re,title:U.target.value})})]}),n.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[n.jsxs("div",{className:"space-y-2",children:[n.jsx(te,{className:"text-gray-300",children:"所属篇"}),n.jsxs(Kc,{value:re.partId,onValueChange:U=>je({...re,partId:U,chapterId:"chapter-1"}),children:[n.jsx(ro,{className:"bg-[#0a1628] border-gray-700 text-white",children:n.jsx(Gc,{})}),n.jsxs(so,{className:"bg-[#0f2137] border-gray-700",children:[Ne.map(U=>n.jsx(hr,{value:U.id,className:"text-white hover:bg-[#38bdac]/20 focus:bg-[#38bdac]/20",children:U.title},U.id)),Ne.length===0&&n.jsx(hr,{value:"part-1",className:"text-white hover:bg-[#38bdac]/20 focus:bg-[#38bdac]/20",children:"默认篇"})]})]})]}),n.jsxs("div",{className:"space-y-2",children:[n.jsx(te,{className:"text-gray-300",children:"所属章"}),n.jsxs(Kc,{value:re.chapterId,onValueChange:U=>je({...re,chapterId:U}),children:[n.jsx(ro,{className:"bg-[#0a1628] border-gray-700 text-white",children:n.jsx(Gc,{})}),n.jsxs(so,{className:"bg-[#0f2137] border-gray-700",children:[Yr.map(U=>n.jsx(hr,{value:U.id,className:"text-white hover:bg-[#38bdac]/20 focus:bg-[#38bdac]/20",children:U.title},U.id)),Yr.length===0&&n.jsx(hr,{value:"chapter-1",className:"text-white hover:bg-[#38bdac]/20 focus:bg-[#38bdac]/20",children:"默认章"})]})]})]})]}),n.jsxs("div",{className:"space-y-2",children:[n.jsx(te,{className:"text-gray-300",children:"内容 (Markdown格式)"}),n.jsx($r,{className:"bg-[#0a1628] border-gray-700 text-white min-h-[300px] font-mono text-sm placeholder:text-gray-500",placeholder:"输入章节内容...",value:re.content,onChange:U=>je({...re,content:U.target.value})})]})]}),n.jsxs(pr,{children:[n.jsx(ye,{variant:"outline",onClick:()=>W(!1),className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:"取消"}),n.jsx(ye,{onClick:B,disabled:fe||!re.id||!re.title,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:fe?n.jsxs(n.Fragment,{children:[n.jsx(Ze,{className:"w-4 h-4 mr-2 animate-spin"}),"创建中..."]}):n.jsxs(n.Fragment,{children:[n.jsx(ks,{className:"w-4 h-4 mr-2"}),"创建章节"]})})]})]})}),n.jsx(Ln,{open:!!f,onOpenChange:()=>m(null),children:n.jsxs(Dn,{className:"bg-[#0f2137] border-gray-700 text-white max-w-4xl max-h-[90vh] overflow-y-auto",showCloseButton:!0,children:[n.jsx(On,{children:n.jsxs(Fn,{className:"text-white flex items-center gap-2",children:[n.jsx(Rs,{className:"w-5 h-5 text-[#38bdac]"}),"编辑章节"]})}),f&&n.jsxs("div",{className:"space-y-4 py-4",children:[n.jsxs("div",{className:"grid grid-cols-3 gap-4",children:[n.jsxs("div",{className:"space-y-2",children:[n.jsx(te,{className:"text-gray-300",children:"章节ID"}),n.jsx(ae,{className:"bg-[#0a1628] border-gray-700 text-white",value:f.id,disabled:!0})]}),n.jsxs("div",{className:"space-y-2",children:[n.jsx(te,{className:"text-gray-300",children:"价格 (元)"}),n.jsx(ae,{type:"number",className:"bg-[#0a1628] border-gray-700 text-white",value:f.isFree?0:f.price,onChange:U=>m({...f,price:Number(U.target.value),isFree:Number(U.target.value)===0}),disabled:f.isFree})]}),n.jsxs("div",{className:"space-y-2",children:[n.jsx(te,{className:"text-gray-300",children:"免费章节"}),n.jsx("div",{className:"flex items-center h-10",children:n.jsxs("label",{className:"flex items-center cursor-pointer",children:[n.jsx("input",{type:"checkbox",checked:f.isFree||f.price===0,onChange:U=>m({...f,isFree:U.target.checked,price:U.target.checked?0:1}),className:"w-5 h-5 rounded border-gray-600 bg-[#0a1628] text-[#38bdac] focus:ring-[#38bdac]"}),n.jsx("span",{className:"ml-2 text-gray-400 text-sm",children:"设为免费"})]})})]})]}),n.jsxs("div",{className:"space-y-2",children:[n.jsx(te,{className:"text-gray-300",children:"章节标题"}),n.jsx(ae,{className:"bg-[#0a1628] border-gray-700 text-white",value:f.title,onChange:U=>m({...f,title:U.target.value})})]}),f.filePath&&n.jsxs("div",{className:"space-y-2",children:[n.jsx(te,{className:"text-gray-300",children:"文件路径"}),n.jsx(ae,{className:"bg-[#0a1628] border-gray-700 text-gray-400 text-sm",value:f.filePath,disabled:!0})]}),n.jsxs("div",{className:"space-y-2",children:[n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsx(te,{className:"text-gray-300",children:"内容 (Markdown格式)"}),n.jsxs("div",{className:"flex gap-2",children:[n.jsx("input",{ref:ue,type:"file",accept:"image/*",onChange:Ie,className:"hidden"}),n.jsxs(ye,{variant:"outline",size:"sm",onClick:()=>{var U;return(U=ue.current)==null?void 0:U.click()},disabled:X,className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:[X?n.jsx(Ze,{className:"w-4 h-4 mr-1 animate-spin"}):n.jsx(Dw,{className:"w-4 h-4 mr-1"}),"上传图片"]})]})]}),me?n.jsxs("div",{className:"bg-[#0a1628] border border-gray-700 rounded-md min-h-[400px] flex items-center justify-center",children:[n.jsx(Ze,{className:"w-6 h-6 text-[#38bdac] animate-spin"}),n.jsx("span",{className:"ml-2 text-gray-400",children:"加载中..."})]}):n.jsx($r,{className:"bg-[#0a1628] border-gray-700 text-white min-h-[400px] font-mono text-sm placeholder:text-gray-500",placeholder:"此处输入章节内容,支持Markdown格式...",value:f.content,onChange:U=>m({...f,content:U.target.value})})]})]}),n.jsxs(pr,{children:[n.jsxs(ye,{variant:"outline",onClick:()=>m(null),className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:[n.jsx(Ur,{className:"w-4 h-4 mr-2"}),"取消"]}),n.jsx(ye,{onClick:Te,disabled:fe,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:fe?n.jsxs(n.Fragment,{children:[n.jsx(Ze,{className:"w-4 h-4 mr-2 animate-spin"}),"保存中..."]}):n.jsxs(n.Fragment,{children:[n.jsx($n,{className:"w-4 h-4 mr-2"}),"保存修改"]})})]})]})}),n.jsxs($u,{defaultValue:"chapters",className:"space-y-6",children:[n.jsxs(To,{className:"bg-[#0f2137] border border-gray-700/50 p-1",children:[n.jsxs(Xt,{value:"chapters",className:"data-[state=active]:bg-[#38bdac]/20 data-[state=active]:text-[#38bdac] text-gray-400",children:[n.jsx(Ps,{className:"w-4 h-4 mr-2"}),"章节管理"]}),n.jsxs(Xt,{value:"search",className:"data-[state=active]:bg-[#38bdac]/20 data-[state=active]:text-[#38bdac] text-gray-400",children:[n.jsx(Br,{className:"w-4 h-4 mr-2"}),"内容搜索"]}),n.jsxs(Xt,{value:"hooks",className:"data-[state=active]:bg-[#38bdac]/20 data-[state=active]:text-[#38bdac] text-gray-400",children:[n.jsx(h1,{className:"w-4 h-4 mr-2"}),"钩子配置"]})]}),n.jsxs(qt,{value:"chapters",className:"space-y-4",children:[n.jsxs(ye,{onClick:()=>W(!0),className:"w-full bg-[#38bdac]/10 hover:bg-[#38bdac]/20 text-[#38bdac] border border-[#38bdac]/30",children:[n.jsx(ks,{className:"w-4 h-4 mr-2"}),"新建章节"]}),l?n.jsxs("div",{className:"flex items-center justify-center py-12",children:[n.jsx(Ze,{className:"w-6 h-6 text-[#38bdac] animate-spin"}),n.jsx("span",{className:"ml-2 text-gray-400",children:"加载中..."})]}):Ne.map((U,ce)=>n.jsxs(_e,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl overflow-hidden",children:[n.jsx(ze,{className:"cursor-pointer hover:bg-[#162840] transition-colors",onClick:()=>Ee(U.id),children:n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsxs("span",{className:"text-[#38bdac] font-mono text-sm",children:["0",ce+1]}),n.jsx(Ue,{className:"text-white",children:U.title}),n.jsxs(Oe,{variant:"outline",className:"text-gray-400 border-gray-600",children:[U.chapters.reduce((lt,Ve)=>lt+Ve.sections.length,0)," 节"]})]}),n.jsx(lp,{className:`w-5 h-5 text-gray-400 transition-transform ${c.includes(U.id)?"rotate-90":""}`})]})}),c.includes(U.id)&&n.jsx(Pe,{className:"pt-0 pb-4",children:n.jsx("div",{className:"space-y-3 pl-8 border-l-2 border-gray-700",children:U.chapters.map(lt=>n.jsxs("div",{className:"space-y-2",children:[n.jsx("h4",{className:"font-medium text-gray-300",children:lt.title}),n.jsx("div",{className:"space-y-1",children:lt.sections.map(Ve=>n.jsxs("div",{className:"flex items-center justify-between py-2 px-3 rounded-lg hover:bg-[#162840] text-sm group transition-colors",children:[n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx(Jc,{className:"w-4 h-4 text-[#38bdac]"}),n.jsx("span",{className:"text-gray-400",children:Ve.title})]}),n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx("span",{className:"text-[#38bdac] font-medium",children:Ve.price===0?"免费":`¥${Ve.price}`}),n.jsxs(ye,{variant:"ghost",size:"sm",onClick:()=>Se(Ve),className:"text-gray-500 hover:text-[#38bdac] hover:bg-[#38bdac]/10 opacity-0 group-hover:opacity-100 transition-opacity",children:[n.jsx(ku,{className:"w-4 h-4 mr-1"}),"读取"]}),n.jsxs(ye,{variant:"ghost",size:"sm",onClick:()=>Se(Ve),className:"text-gray-500 hover:text-[#38bdac] hover:bg-[#38bdac]/10 opacity-0 group-hover:opacity-100 transition-opacity",children:[n.jsx(Rs,{className:"w-4 h-4 mr-1"}),"编辑"]})]})]},Ve.id))})]},lt.id))})})]},U.id))]}),n.jsx(qt,{value:"search",className:"space-y-4",children:n.jsxs(_e,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:[n.jsx(ze,{children:n.jsx(Ue,{className:"text-white",children:"内容搜索"})}),n.jsxs(Pe,{className:"space-y-4",children:[n.jsxs("div",{className:"flex gap-2",children:[n.jsx(ae,{className:"bg-[#0a1628] border-gray-700 text-white placeholder:text-gray-500 flex-1",placeholder:"搜索标题或内容...",value:se,onChange:U=>G(U.target.value),onKeyDown:U=>U.key==="Enter"&&$e()}),n.jsx(ye,{onClick:$e,disabled:R||!se.trim(),className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:R?n.jsx(Ze,{className:"w-4 h-4 animate-spin"}):n.jsx(Br,{className:"w-4 h-4"})})]}),Q.length>0&&n.jsxs("div",{className:"space-y-2 mt-4",children:[n.jsxs("p",{className:"text-gray-400 text-sm",children:["找到 ",Q.length," 个结果"]}),Q.map(U=>n.jsxs("div",{className:"p-3 rounded-lg bg-[#162840] hover:bg-[#1a3050] cursor-pointer transition-colors",onClick:()=>Se({id:U.id,title:U.title,price:U.price??1,filePath:""}),children:[n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsxs("div",{children:[n.jsx("span",{className:"text-[#38bdac] font-mono text-xs mr-2",children:U.id}),n.jsx("span",{className:"text-white",children:U.title})]}),n.jsx(Oe,{variant:"outline",className:"text-gray-400 border-gray-600 text-xs",children:U.matchType==="title"?"标题匹配":"内容匹配"})]}),U.snippet&&n.jsx("p",{className:"text-gray-500 text-xs mt-2 line-clamp-2",children:U.snippet}),(U.partTitle||U.chapterTitle)&&n.jsxs("p",{className:"text-gray-600 text-xs mt-1",children:[U.partTitle," · ",U.chapterTitle]})]},U.id))]})]})]})}),n.jsx(qt,{value:"hooks",className:"space-y-4",children:n.jsxs(_e,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:[n.jsx(ze,{children:n.jsx(Ue,{className:"text-white",children:"引流钩子配置"})}),n.jsxs(Pe,{className:"space-y-4",children:[n.jsxs("div",{className:"grid w-full max-w-sm items-center gap-1.5",children:[n.jsx(te,{htmlFor:"hook-chapter",className:"text-gray-300",children:"触发章节"}),n.jsxs(Kc,{defaultValue:"3",children:[n.jsx(ro,{id:"hook-chapter",className:"bg-[#0a1628] border-gray-700 text-white",children:n.jsx(Gc,{placeholder:"选择章节"})}),n.jsxs(so,{className:"bg-[#0f2137] border-gray-700",children:[n.jsx(hr,{value:"1",className:"text-white hover:bg-[#38bdac]/20 focus:bg-[#38bdac]/20",children:"第一章"}),n.jsx(hr,{value:"2",className:"text-white hover:bg-[#38bdac]/20 focus:bg-[#38bdac]/20",children:"第二章"}),n.jsx(hr,{value:"3",className:"text-white hover:bg-[#38bdac]/20 focus:bg-[#38bdac]/20",children:"第三章 (默认)"})]})]})]}),n.jsxs("div",{className:"grid w-full gap-1.5",children:[n.jsx(te,{htmlFor:"message",className:"text-gray-300",children:"引流文案"}),n.jsx($r,{placeholder:"输入引导用户加群的文案...",id:"message",className:"bg-[#0a1628] border-gray-700 text-white placeholder:text-gray-500",defaultValue:"阅读更多精彩内容,请加入Soul创业实验派对群..."})]}),n.jsx(ye,{className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:"保存配置"})]})]})})]})]})}function JS(){const[r,a]=x.useState([]),[l,i]=x.useState(null),[c,d]=x.useState(!0),[f,m]=x.useState([]),[p,g]=x.useState(null),[v,w]=x.useState(1);async function _(){d(!0);try{const N=await Ge("/api/admin/chapters");N!=null&&N.success&&N.data&&(a(N.data.structure??[]),i(N.data.stats??null))}catch(N){console.error("加载章节失败:",N)}finally{d(!1)}}x.useEffect(()=>{_()},[]);const E=N=>{m(y=>y.includes(N)?y.filter(C=>C!==N):[...y,N])},k=async N=>{try{const y=await vt("/api/admin/chapters",{action:"updatePrice",chapterId:N,data:{price:v}});y!=null&&y.success&&(alert("价格更新成功"),g(null),_())}catch(y){console.error("更新价格失败:",y)}},S=async(N,y)=>{try{const C=await vt("/api/admin/chapters",{action:"toggleFree",chapterId:N,data:{isFree:!y}});C!=null&&C.success&&(alert("状态更新成功"),_())}catch(C){console.error("更新状态失败:",C)}};return c?n.jsx("div",{className:"min-h-[60vh] flex items-center justify-center",children:n.jsx("div",{className:"text-xl text-gray-400",children:"加载中..."})}):n.jsxs("div",{className:"min-h-screen bg-black text-white",children:[n.jsx("div",{className:"sticky top-0 bg-black/90 backdrop-blur border-b border-white/10 z-50",children:n.jsxs("div",{className:"max-w-6xl mx-auto px-4 py-4 flex items-center justify-between",children:[n.jsx("h1",{className:"text-xl font-bold",children:"章节管理"}),n.jsxs("div",{className:"flex items-center gap-4",children:[n.jsx("button",{type:"button",onClick:()=>m(r.map(N=>N.id)),className:"px-4 py-2 bg-white/10 rounded-lg hover:bg-white/20 text-white",children:"展开全部"}),n.jsx("button",{type:"button",onClick:()=>m([]),className:"px-4 py-2 bg-white/10 rounded-lg hover:bg-white/20 text-white",children:"收起全部"})]})]})}),n.jsxs("div",{className:"max-w-6xl mx-auto px-4 py-8",children:[l&&n.jsxs("div",{className:"grid grid-cols-4 gap-4 mb-8",children:[n.jsxs("div",{className:"bg-gradient-to-br from-cyan-500/20 to-cyan-500/5 border border-cyan-500/30 rounded-xl p-4",children:[n.jsx("div",{className:"text-3xl font-bold text-cyan-400",children:l.totalSections}),n.jsx("div",{className:"text-white/60 text-sm mt-1",children:"总章节数"})]}),n.jsxs("div",{className:"bg-gradient-to-br from-green-500/20 to-green-500/5 border border-green-500/30 rounded-xl p-4",children:[n.jsx("div",{className:"text-3xl font-bold text-green-400",children:l.freeSections}),n.jsx("div",{className:"text-white/60 text-sm mt-1",children:"免费章节"})]}),n.jsxs("div",{className:"bg-gradient-to-br from-yellow-500/20 to-yellow-500/5 border border-yellow-500/30 rounded-xl p-4",children:[n.jsx("div",{className:"text-3xl font-bold text-yellow-400",children:l.paidSections}),n.jsx("div",{className:"text-white/60 text-sm mt-1",children:"付费章节"})]}),n.jsxs("div",{className:"bg-gradient-to-br from-purple-500/20 to-purple-500/5 border border-purple-500/30 rounded-xl p-4",children:[n.jsx("div",{className:"text-3xl font-bold text-purple-400",children:l.totalParts}),n.jsx("div",{className:"text-white/60 text-sm mt-1",children:"篇章数"})]})]}),n.jsx("div",{className:"space-y-4",children:r.map(N=>n.jsxs("div",{className:"bg-white/5 border border-white/10 rounded-xl overflow-hidden",children:[n.jsxs("div",{className:"flex items-center justify-between p-4 cursor-pointer hover:bg-white/5",onClick:()=>E(N.id),onKeyDown:y=>y.key==="Enter"&&E(N.id),role:"button",tabIndex:0,children:[n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsx("span",{className:"text-2xl",children:N.type==="preface"?"📖":N.type==="epilogue"?"🎬":N.type==="appendix"?"📎":"📚"}),n.jsx("span",{className:"font-semibold text-white",children:N.title}),n.jsxs("span",{className:"text-white/40 text-sm",children:["(",N.chapters.reduce((y,C)=>{var j;return y+(((j=C.sections)==null?void 0:j.length)||1)},0)," 节)"]})]}),n.jsx("span",{className:"text-white/40",children:f.includes(N.id)?"▲":"▼"})]}),f.includes(N.id)&&n.jsx("div",{className:"border-t border-white/10",children:N.chapters.map(y=>n.jsx("div",{className:"border-b border-white/5 last:border-b-0",children:y.sections?n.jsxs(n.Fragment,{children:[n.jsx("div",{className:"px-6 py-3 bg-white/5 text-white/70 font-medium",children:y.title}),n.jsx("div",{className:"divide-y divide-white/5",children:y.sections.map(C=>n.jsxs("div",{className:"flex items-center justify-between px-6 py-3 hover:bg-white/5",children:[n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsx("span",{className:C.isFree?"text-green-400":"text-yellow-400",children:C.isFree?"🔓":"🔒"}),n.jsx("span",{className:"text-white/80",children:C.id}),n.jsx("span",{className:"text-white/60",children:C.title})]}),n.jsx("div",{className:"flex items-center gap-3",children:p===C.id?n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx("input",{type:"number",value:v,onChange:j=>w(Number(j.target.value)),className:"w-20 px-2 py-1 bg-white/10 border border-white/20 rounded text-white",min:0,step:.1}),n.jsx("button",{type:"button",onClick:()=>k(C.id),className:"px-3 py-1 bg-cyan-500 text-black rounded text-sm",children:"保存"}),n.jsx("button",{type:"button",onClick:()=>g(null),className:"px-3 py-1 bg-white/20 rounded text-sm text-white",children:"取消"})]}):n.jsxs(n.Fragment,{children:[n.jsx("span",{className:`px-2 py-1 rounded text-xs ${C.isFree?"bg-green-500/20 text-green-400":"bg-yellow-500/20 text-yellow-400"}`,children:C.isFree?"免费":`¥${C.price}`}),n.jsx("button",{type:"button",onClick:()=>{g(C.id),w(C.price)},className:"px-2 py-1 text-xs bg-white/10 rounded hover:bg-white/20 text-white",children:"编辑价格"}),n.jsx("button",{type:"button",onClick:()=>S(C.id,C.isFree),className:"px-2 py-1 text-xs bg-white/10 rounded hover:bg-white/20 text-white",children:C.isFree?"设为付费":"设为免费"})]})})]},C.id))})]}):n.jsxs("div",{className:"flex items-center justify-between px-6 py-3 hover:bg-white/5",children:[n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsx("span",{className:y.isFree?"text-green-400":"text-yellow-400",children:y.isFree?"🔓":"🔒"}),n.jsx("span",{className:"text-white/80",children:y.title})]}),n.jsx("span",{className:`px-2 py-1 rounded text-xs ${y.isFree?"bg-green-500/20 text-green-400":"bg-yellow-500/20 text-yellow-400"}`,children:y.isFree?"免费":`¥${y.price??1}`})]})},y.id))})]},N.id))})]})]})}var Pg=["PageUp","PageDown"],Rg=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],Tg={"from-left":["Home","PageDown","ArrowDown","ArrowLeft"],"from-right":["Home","PageDown","ArrowDown","ArrowRight"],"from-bottom":["Home","PageDown","ArrowDown","ArrowLeft"],"from-top":["Home","PageDown","ArrowUp","ArrowLeft"]},Bs="Slider",[gu,ZS,eC]=Fu(Bs),[Ig]=Nr(Bs,[eC]),[tC,zo]=Ig(Bs),Ag=x.forwardRef((r,a)=>{const{name:l,min:i=0,max:c=100,step:d=1,orientation:f="horizontal",disabled:m=!1,minStepsBetweenThumbs:p=0,defaultValue:g=[i],value:v,onValueChange:w=()=>{},onValueCommit:_=()=>{},inverted:E=!1,form:k,...S}=r,N=x.useRef(new Set),y=x.useRef(0),j=f==="horizontal"?nC:rC,[A=[],z]=Vr({prop:v,defaultProp:g,onChange:oe=>{var T;(T=[...N.current][y.current])==null||T.focus(),w(oe)}}),K=x.useRef(A);function W(oe){const fe=iC(A,oe);me(oe,fe)}function V(oe){me(oe,y.current)}function le(){const oe=K.current[y.current];A[y.current]!==oe&&_(A)}function me(oe,fe,{commit:T}={commit:!1}){const se=fC(d),G=hC(Math.round((oe-i)/d)*d+i,se),Q=ho(G,[i,c]);z((O=[])=>{const R=lC(O,Q,fe);if(dC(R,p*d)){y.current=R.indexOf(Q);const Y=String(R)!==String(O);return Y&&T&&_(R),Y?R:O}else return O})}return n.jsx(tC,{scope:r.__scopeSlider,name:l,disabled:m,min:i,max:c,valueIndexToChangeRef:y,thumbs:N.current,values:A,orientation:f,form:k,children:n.jsx(gu.Provider,{scope:r.__scopeSlider,children:n.jsx(gu.Slot,{scope:r.__scopeSlider,children:n.jsx(j,{"aria-disabled":m,"data-disabled":m?"":void 0,...S,ref:a,onPointerDown:Ae(S.onPointerDown,()=>{m||(K.current=A)}),min:i,max:c,inverted:E,onSlideStart:m?void 0:W,onSlideMove:m?void 0:V,onSlideEnd:m?void 0:le,onHomeKeyDown:()=>!m&&me(i,0,{commit:!0}),onEndKeyDown:()=>!m&&me(c,A.length-1,{commit:!0}),onStepKeyDown:({event:oe,direction:fe})=>{if(!m){const G=Pg.includes(oe.key)||oe.shiftKey&&Rg.includes(oe.key)?10:1,Q=y.current,O=A[Q],R=d*G*fe;me(O+R,Q,{commit:!0})}}})})})})});Ag.displayName=Bs;var[Mg,Lg]=Ig(Bs,{startEdge:"left",endEdge:"right",size:"width",direction:1}),nC=x.forwardRef((r,a)=>{const{min:l,max:i,dir:c,inverted:d,onSlideStart:f,onSlideMove:m,onSlideEnd:p,onStepKeyDown:g,...v}=r,[w,_]=x.useState(null),E=We(a,j=>_(j)),k=x.useRef(void 0),S=Po(c),N=S==="ltr",y=N&&!d||!N&&d;function C(j){const A=k.current||w.getBoundingClientRect(),z=[0,A.width],W=Xu(z,y?[l,i]:[i,l]);return k.current=A,W(j-A.left)}return n.jsx(Mg,{scope:r.__scopeSlider,startEdge:y?"left":"right",endEdge:y?"right":"left",direction:y?1:-1,size:"width",children:n.jsx(Dg,{dir:S,"data-orientation":"horizontal",...v,ref:E,style:{...v.style,"--radix-slider-thumb-transform":"translateX(-50%)"},onSlideStart:j=>{const A=C(j.clientX);f==null||f(A)},onSlideMove:j=>{const A=C(j.clientX);m==null||m(A)},onSlideEnd:()=>{k.current=void 0,p==null||p()},onStepKeyDown:j=>{const z=Tg[y?"from-left":"from-right"].includes(j.key);g==null||g({event:j,direction:z?-1:1})}})})}),rC=x.forwardRef((r,a)=>{const{min:l,max:i,inverted:c,onSlideStart:d,onSlideMove:f,onSlideEnd:m,onStepKeyDown:p,...g}=r,v=x.useRef(null),w=We(a,v),_=x.useRef(void 0),E=!c;function k(S){const N=_.current||v.current.getBoundingClientRect(),y=[0,N.height],j=Xu(y,E?[i,l]:[l,i]);return _.current=N,j(S-N.top)}return n.jsx(Mg,{scope:r.__scopeSlider,startEdge:E?"bottom":"top",endEdge:E?"top":"bottom",size:"height",direction:E?1:-1,children:n.jsx(Dg,{"data-orientation":"vertical",...g,ref:w,style:{...g.style,"--radix-slider-thumb-transform":"translateY(50%)"},onSlideStart:S=>{const N=k(S.clientY);d==null||d(N)},onSlideMove:S=>{const N=k(S.clientY);f==null||f(N)},onSlideEnd:()=>{_.current=void 0,m==null||m()},onStepKeyDown:S=>{const y=Tg[E?"from-bottom":"from-top"].includes(S.key);p==null||p({event:S,direction:y?-1:1})}})})}),Dg=x.forwardRef((r,a)=>{const{__scopeSlider:l,onSlideStart:i,onSlideMove:c,onSlideEnd:d,onHomeKeyDown:f,onEndKeyDown:m,onStepKeyDown:p,...g}=r,v=zo(Bs,l);return n.jsx(Le.span,{...g,ref:a,onKeyDown:Ae(r.onKeyDown,w=>{w.key==="Home"?(f(w),w.preventDefault()):w.key==="End"?(m(w),w.preventDefault()):Pg.concat(Rg).includes(w.key)&&(p(w),w.preventDefault())}),onPointerDown:Ae(r.onPointerDown,w=>{const _=w.target;_.setPointerCapture(w.pointerId),w.preventDefault(),v.thumbs.has(_)?_.focus():i(w)}),onPointerMove:Ae(r.onPointerMove,w=>{w.target.hasPointerCapture(w.pointerId)&&c(w)}),onPointerUp:Ae(r.onPointerUp,w=>{const _=w.target;_.hasPointerCapture(w.pointerId)&&(_.releasePointerCapture(w.pointerId),d(w))})})}),Og="SliderTrack",Fg=x.forwardRef((r,a)=>{const{__scopeSlider:l,...i}=r,c=zo(Og,l);return n.jsx(Le.span,{"data-disabled":c.disabled?"":void 0,"data-orientation":c.orientation,...i,ref:a})});Fg.displayName=Og;var yu="SliderRange",zg=x.forwardRef((r,a)=>{const{__scopeSlider:l,...i}=r,c=zo(yu,l),d=Lg(yu,l),f=x.useRef(null),m=We(a,f),p=c.values.length,g=c.values.map(_=>Ug(_,c.min,c.max)),v=p>1?Math.min(...g):0,w=100-Math.max(...g);return n.jsx(Le.span,{"data-orientation":c.orientation,"data-disabled":c.disabled?"":void 0,...i,ref:m,style:{...r.style,[d.startEdge]:v+"%",[d.endEdge]:w+"%"}})});zg.displayName=yu;var vu="SliderThumb",$g=x.forwardRef((r,a)=>{const l=ZS(r.__scopeSlider),[i,c]=x.useState(null),d=We(a,m=>c(m)),f=x.useMemo(()=>i?l().findIndex(m=>m.ref.current===i):-1,[l,i]);return n.jsx(sC,{...r,ref:d,index:f})}),sC=x.forwardRef((r,a)=>{const{__scopeSlider:l,index:i,name:c,...d}=r,f=zo(vu,l),m=Lg(vu,l),[p,g]=x.useState(null),v=We(a,C=>g(C)),w=p?f.form||!!p.closest("form"):!0,_=Ou(p),E=f.values[i],k=E===void 0?0:Ug(E,f.min,f.max),S=oC(i,f.values.length),N=_==null?void 0:_[m.size],y=N?cC(N,k,m.direction):0;return x.useEffect(()=>{if(p)return f.thumbs.add(p),()=>{f.thumbs.delete(p)}},[p,f.thumbs]),n.jsxs("span",{style:{transform:"var(--radix-slider-thumb-transform)",position:"absolute",[m.startEdge]:`calc(${k}% + ${y}px)`},children:[n.jsx(gu.ItemSlot,{scope:r.__scopeSlider,children:n.jsx(Le.span,{role:"slider","aria-label":r["aria-label"]||S,"aria-valuemin":f.min,"aria-valuenow":E,"aria-valuemax":f.max,"aria-orientation":f.orientation,"data-orientation":f.orientation,"data-disabled":f.disabled?"":void 0,tabIndex:f.disabled?void 0:0,...d,ref:v,style:E===void 0?{display:"none"}:r.style,onFocus:Ae(r.onFocus,()=>{f.valueIndexToChangeRef.current=i})})}),w&&n.jsx(Bg,{name:c??(f.name?f.name+(f.values.length>1?"[]":""):void 0),form:f.form,value:E},i)]})});$g.displayName=vu;var aC="RadioBubbleInput",Bg=x.forwardRef(({__scopeSlider:r,value:a,...l},i)=>{const c=x.useRef(null),d=We(c,i),f=Du(a);return x.useEffect(()=>{const m=c.current;if(!m)return;const p=window.HTMLInputElement.prototype,v=Object.getOwnPropertyDescriptor(p,"value").set;if(f!==a&&v){const w=new Event("input",{bubbles:!0});v.call(m,a),m.dispatchEvent(w)}},[f,a]),n.jsx(Le.input,{style:{display:"none"},...l,ref:d,defaultValue:a})});Bg.displayName=aC;function lC(r=[],a,l){const i=[...r];return i[l]=a,i.sort((c,d)=>c-d)}function Ug(r,a,l){const d=100/(l-a)*(r-a);return ho(d,[0,100])}function oC(r,a){return a>2?`Value ${r+1} of ${a}`:a===2?["Minimum","Maximum"][r]:void 0}function iC(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 cC(r,a,l){const i=r/2,d=Xu([0,50],[0,i]);return(i-d(a)*l)*l}function uC(r){return r.slice(0,-1).map((a,l)=>r[l+1]-a)}function dC(r,a){if(a>0){const l=uC(r);return Math.min(...l)>=a}return!0}function Xu(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 fC(r){return(String(r).split(".")[1]||"").length}function hC(r,a){const l=Math.pow(10,a);return Math.round(r*l)/l}var mC=Ag,pC=Fg,xC=zg,gC=$g;function Vg({className:r,defaultValue:a,value:l,min:i=0,max:c=100,...d}){const f=x.useMemo(()=>Array.isArray(l)?l:Array.isArray(a)?a:[i,c],[l,a,i,c]);return n.jsxs(mC,{defaultValue:a,value:l,min:i,max:c,className:He("relative flex w-full touch-none items-center select-none data-[disabled]:opacity-50",r),...d,children:[n.jsx(pC,{className:"bg-muted relative grow overflow-hidden rounded-full h-1.5 w-full",children:n.jsx(xC,{className:"bg-primary absolute h-full"})}),Array.from({length:f.length},(m,p)=>n.jsx(gC,{className:"block size-4 shrink-0 rounded-full border border-primary bg-white shadow-sm focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50"},p))]})}const yC={distributorShare:90,minWithdrawAmount:10,bindingDays:30,userDiscount:5,enableAutoWithdraw:!1};function vC(){const[r,a]=x.useState(yC),[l,i]=x.useState(!0),[c,d]=x.useState(!1);x.useEffect(()=>{Ge("/api/db/config?key=referral_config").then(p=>{const g=(p==null?void 0:p.data)??(p==null?void 0:p.config);g&&a({distributorShare:g.distributorShare??90,minWithdrawAmount:g.minWithdrawAmount??10,bindingDays:g.bindingDays??30,userDiscount:g.userDiscount??5,enableAutoWithdraw:g.enableAutoWithdraw??!1})}).catch(console.error).finally(()=>i(!1))},[]);const f=async()=>{d(!0);try{const g={key:"referral_config",config:{distributorShare:Number(r.distributorShare)||0,minWithdrawAmount:Number(r.minWithdrawAmount)||0,bindingDays:Number(r.bindingDays)||0,userDiscount:Number(r.userDiscount)||0,enableAutoWithdraw:!!r.enableAutoWithdraw},description:"分销 / 推广规则配置"},v=await vt("/api/db/config",g);if(!v||v.success===!1){alert("保存失败: "+(v&&typeof v=="object"&&"error"in v?v.error:""));return}alert(`✅ 分销配置已保存成功!
|
||
|
||
• 小程序与网站的推广规则会一起生效
|
||
• 绑定关系会使用新的天数配置
|
||
• 佣金比例会立即应用到新订单
|
||
|
||
如有缓存,请刷新前台/小程序页面。`)}catch(p){console.error(p),alert("保存失败: "+(p instanceof Error?p.message:String(p)))}finally{d(!1)}},m=p=>g=>{const v=parseFloat(g.target.value||"0");a(w=>({...w,[p]:isNaN(v)?0:v}))};return l?n.jsx("div",{className:"p-8 text-gray-500",children:"加载中..."}):n.jsxs("div",{className:"p-8 max-w-4xl mx-auto",children:[n.jsxs("div",{className:"flex justify-between items-center mb-8",children:[n.jsxs("div",{children:[n.jsxs("h2",{className:"text-2xl font-bold text-white flex items-center gap-2",children:[n.jsx(Ts,{className:"w-5 h-5 text-[#38bdac]"}),"推广 / 分销设置"]}),n.jsx("p",{className:"text-gray-400 mt-1",children:"统一管理「好友优惠」「你得 90% 收益」「绑定期 30 天」「提现门槛」等规则,小程序和 Web 共用这套配置。"})]}),n.jsxs(ye,{onClick:f,disabled:c||l,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:[n.jsx($n,{className:"w-4 h-4 mr-2"}),c?"保存中...":"保存配置"]})]}),n.jsxs("div",{className:"space-y-6",children:[n.jsxs(_e,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:[n.jsxs(ze,{children:[n.jsxs(Ue,{className:"flex items-center gap-2 text-white",children:[n.jsx(r1,{className:"w-4 h-4 text-[#38bdac]"}),"推广规则"]}),n.jsx(at,{className:"text-gray-400",children:"这三项会直接体现在小程序「推广规则」卡片上,同时影响实收佣金计算。"})]}),n.jsx(Pe,{className:"space-y-6",children:n.jsxs("div",{className:"grid grid-cols-3 gap-6",children:[n.jsxs("div",{className:"space-y-2",children:[n.jsxs(te,{className:"text-gray-300 flex items-center gap-2",children:[n.jsx(om,{className:"w-3 h-3 text-[#38bdac]"}),"好友优惠(%)"]}),n.jsx(ae,{type:"number",min:0,max:100,className:"bg-[#0a1628] border-gray-700 text-white",value:r.userDiscount,onChange:m("userDiscount")}),n.jsx("p",{className:"text-xs text-gray-500",children:"例如 5 表示好友立减 5%(在价格配置基础上生效)。"})]}),n.jsxs("div",{className:"space-y-2",children:[n.jsxs(te,{className:"text-gray-300 flex items-center gap-2",children:[n.jsx(on,{className:"w-3 h-3 text-[#38bdac]"}),"推广者分成(%)"]}),n.jsxs("div",{className:"flex items-center gap-4",children:[n.jsx(Vg,{className:"flex-1",min:10,max:100,step:1,value:[r.distributorShare],onValueChange:([p])=>a(g=>({...g,distributorShare:p}))}),n.jsx(ae,{type:"number",min:0,max:100,className:"w-20 bg-[#0a1628] border-gray-700 text-white text-center",value:r.distributorShare,onChange:m("distributorShare")})]}),n.jsxs("p",{className:"text-xs text-gray-500",children:["实际佣金 = 订单金额 ×"," ",n.jsxs("span",{className:"text-[#38bdac] font-mono",children:[r.distributorShare,"%"]}),",支付回调和分销统计都会用这个值。"]})]}),n.jsxs("div",{className:"space-y-2",children:[n.jsxs(te,{className:"text-gray-300 flex items-center gap-2",children:[n.jsx(on,{className:"w-3 h-3 text-[#38bdac]"}),"绑定有效期(天)"]}),n.jsx(ae,{type:"number",min:1,max:365,className:"bg-[#0a1628] border-gray-700 text-white",value:r.bindingDays,onChange:m("bindingDays")}),n.jsx("p",{className:"text-xs text-gray-500",children:"好友通过你的链接进来并登录后,绑定在你名下的天数。"})]})]})})]}),n.jsxs(_e,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:[n.jsxs(ze,{children:[n.jsxs(Ue,{className:"flex items-center gap-2 text-white",children:[n.jsx(Ts,{className:"w-4 h-4 text-[#38bdac]"}),"提现规则"]}),n.jsx(at,{className:"text-gray-400",children:"与「提现中心」「自动提现」相关的参数,影响推广者看到的可提现金额和最低门槛。"})]}),n.jsx(Pe,{className:"space-y-6",children:n.jsxs("div",{className:"grid grid-cols-2 gap-6",children:[n.jsxs("div",{className:"space-y-2",children:[n.jsx(te,{className:"text-gray-300",children:"最低提现金额(元)"}),n.jsx(ae,{type:"number",min:0,step:1,className:"bg-[#0a1628] border-gray-700 text-white",value:r.minWithdrawAmount,onChange:m("minWithdrawAmount")}),n.jsx("p",{className:"text-xs text-gray-500",children:"小程序「满 X 元可提现」展示的门槛,同时用于后端接口校验。"})]}),n.jsxs("div",{className:"space-y-2",children:[n.jsxs(te,{className:"text-gray-300 flex items-center gap-2",children:["自动提现开关",n.jsx(Oe,{variant:"outline",className:"border-[#38bdac]/40 text-[#38bdac] text-[10px]",children:"预留"})]}),n.jsxs("div",{className:"flex items-center gap-3 mt-1",children:[n.jsx(rt,{checked:r.enableAutoWithdraw,onCheckedChange:p=>a(g=>({...g,enableAutoWithdraw:p}))}),n.jsx("span",{className:"text-sm text-gray-400",children:"开启后,可结合定时任务实现「收益自动打款到微信零钱」。"})]})]})]})})]}),n.jsxs(_e,{className:"bg-[#0f2137] border-gray-700/50",children:[n.jsx(ze,{children:n.jsxs(Ue,{className:"flex items-center gap-2 text-gray-200 text-sm",children:[n.jsx(om,{className:"w-4 h-4 text-[#38bdac]"}),"使用说明"]})}),n.jsxs(Pe,{className:"space-y-2 text-xs text-gray-400 leading-relaxed",children:[n.jsxs("p",{children:["1. 以上配置会写入"," ",n.jsx("code",{className:"font-mono text-[11px] text-[#38bdac]",children:"system_config.referral_config"}),",小程序「推广中心」、Web 推广页以及支付回调都会读取同一份配置。"]}),n.jsx("p",{children:"2. 修改后新订单立即生效;旧订单的历史佣金不会自动重算,只影响之后产生的订单。"}),n.jsx("p",{children:"3. 如遇前端展示与实际结算不一致,优先以此处配置为准,再排查缓存和小程序版本。"})]})]})]})]})}const wC={name:"卡若",startDate:"2025年10月15日",bio:"连续创业者,私域运营专家,每天早上6-9点在Soul派对房分享真实商业故事",liveTime:"06:00-09:00",platform:"Soul派对房",description:"连续创业者,私域运营专家"},bC={sectionPrice:1,baseBookPrice:9.9,distributorShare:90,authorInfo:{...wC}},NC={appId:"wxb8bbb2b10dec74aa",apiDomain:"https://soul.quwanzhi.com",buyerDiscount:5,referralBindDays:30,minWithdraw:10},jC={matchEnabled:!0,referralEnabled:!0,searchEnabled:!0,aboutEnabled:!0};function Vm(r){if(!r||typeof r!="object")return{};const a=r,l={};return Array.isArray(a.freeChapters)&&(l.freeChapters=a.freeChapters),a.mpConfig&&typeof a.mpConfig=="object"&&(l.mpConfig=a.mpConfig),a.features&&typeof a.features=="object"&&(l.features=a.features),typeof a.sectionPrice=="number"&&(l.sectionPrice=a.sectionPrice),typeof a.baseBookPrice=="number"&&(l.baseBookPrice=a.baseBookPrice),typeof a.distributorShare=="number"&&(l.distributorShare=a.distributorShare),a.authorInfo&&typeof a.authorInfo=="object"&&(l.authorInfo=a.authorInfo),l}function Wm(r){const a={};for(const l of r){if(!l||typeof l!="object")continue;const i=l,c=i.config_key;let d;try{d=typeof i.config_value=="string"?JSON.parse(i.config_value):i.config_value}catch{d=i.config_value}if(c==="feature_config"&&d&&typeof d=="object"&&(a.features=d),c==="mp_config"&&d&&typeof d=="object"&&(a.mpConfig=d),c==="free_chapters"&&Array.isArray(d)&&(a.freeChapters=d),c==="site_settings"&&d&&typeof d=="object"){const f=d;typeof f.sectionPrice=="number"&&(a.sectionPrice=f.sectionPrice),typeof f.baseBookPrice=="number"&&(a.baseBookPrice=f.baseBookPrice),typeof f.distributorShare=="number"&&(a.distributorShare=f.distributorShare),f.authorInfo&&typeof f.authorInfo=="object"&&(a.authorInfo=f.authorInfo)}}return a}function SC(){const[r,a]=x.useState(bC),[l,i]=x.useState(["preface","epilogue","1.1","appendix-1","appendix-2","appendix-3"]),[c,d]=x.useState(""),[f,m]=x.useState(NC),[p,g]=x.useState(jC),[v,w]=x.useState(!1),[_,E]=x.useState(!0);x.useEffect(()=>{(async()=>{var C;try{const[j,A]=await Promise.all([Ge("/api/db/config"),Ge("/api/config").catch(()=>null)]);let z=Vm((j==null?void 0:j.data)??j);const K=j==null?void 0:j.data;Array.isArray(K)&&(z={...z,...Wm(K)}),(C=z.freeChapters)!=null&&C.length&&i(z.freeChapters),z.mpConfig&&Object.keys(z.mpConfig).length&&m(W=>({...W,...z.mpConfig})),z.features&&Object.keys(z.features).length&&g(W=>({...W,...z.features})),A!=null&&A.authorInfo&&typeof A.authorInfo=="object"&&a(W=>({...W,authorInfo:{...W.authorInfo,...A.authorInfo}})),(typeof z.sectionPrice=="number"||typeof z.baseBookPrice=="number"||typeof z.distributorShare=="number"||z.authorInfo&&Object.keys(z.authorInfo).length)&&a(W=>({...W,...typeof z.sectionPrice=="number"&&{sectionPrice:z.sectionPrice},...typeof z.baseBookPrice=="number"&&{baseBookPrice:z.baseBookPrice},...typeof z.distributorShare=="number"&&{distributorShare:z.distributorShare},...z.authorInfo&&{authorInfo:{...W.authorInfo,...z.authorInfo}}}))}catch(j){console.error("Load config error:",j)}finally{E(!1)}})()},[]);const k=async()=>{var y;w(!0);try{await vt("/api/db/settings",r).catch(()=>{}),await vt("/api/db/config",{key:"free_chapters",value:l,description:"免费章节ID列表"}).catch(()=>{}),await vt("/api/db/config",{key:"mp_config",value:f,description:"小程序配置"}).catch(()=>{}),await vt("/api/db/config",{key:"feature_config",value:p,description:"功能开关配置"});const C=await Ge("/api/db/config").catch(()=>({})),j=Array.isArray(C==null?void 0:C.data)?Wm(C.data):Vm((C==null?void 0:C.data)??C);j.features&&g(A=>({...A,...j.features})),alert(`设置已保存!
|
||
|
||
找伙伴功能:`+((y=j.features)!=null&&y.matchEnabled?"✅ 开启":"❌ 关闭"))}catch(C){console.error("Save settings error:",C),alert("保存失败: "+(C instanceof Error?C.message:String(C)))}finally{w(!1)}},S=()=>{c&&!l.includes(c)&&(i([...l,c]),d(""))},N=y=>{i(l.filter(C=>C!==y))};return _?n.jsx("div",{className:"p-8 text-gray-500",children:"加载中..."}):n.jsxs("div",{className:"p-8 max-w-4xl mx-auto",children:[n.jsxs("div",{className:"flex justify-between items-center mb-8",children:[n.jsxs("div",{children:[n.jsx("h2",{className:"text-2xl font-bold text-white",children:"系统设置"}),n.jsx("p",{className:"text-gray-400 mt-1",children:"配置全站基础参数与开关"})]}),n.jsxs(ye,{onClick:k,disabled:v,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:[n.jsx($n,{className:"w-4 h-4 mr-2"}),v?"保存中...":"保存设置"]})]}),n.jsxs("div",{className:"space-y-6",children:[n.jsxs(_e,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:[n.jsxs(ze,{children:[n.jsxs(Ue,{className:"text-white flex items-center gap-2",children:[n.jsx(sm,{className:"w-5 h-5 text-[#38bdac]"}),"关于作者"]}),n.jsx(at,{className:"text-gray-400",children:'配置作者信息,将在"关于作者"页面显示'})]}),n.jsxs(Pe,{className:"space-y-4",children:[n.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[n.jsxs("div",{className:"space-y-2",children:[n.jsxs(te,{htmlFor:"author-name",className:"text-gray-300 flex items-center gap-1",children:[n.jsx(sm,{className:"w-3 h-3"}),"主理人名称"]}),n.jsx(ae,{id:"author-name",className:"bg-[#0a1628] border-gray-700 text-white",value:r.authorInfo.name??"",onChange:y=>a(C=>({...C,authorInfo:{...C.authorInfo,name:y.target.value}}))})]}),n.jsxs("div",{className:"space-y-2",children:[n.jsxs(te,{htmlFor:"start-date",className:"text-gray-300 flex items-center gap-1",children:[n.jsx(qc,{className:"w-3 h-3"}),"开播日期"]}),n.jsx(ae,{id:"start-date",className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"例如: 2025年10月15日",value:r.authorInfo.startDate??"",onChange:y=>a(C=>({...C,authorInfo:{...C.authorInfo,startDate:y.target.value}}))})]})]}),n.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[n.jsxs("div",{className:"space-y-2",children:[n.jsxs(te,{htmlFor:"live-time",className:"text-gray-300 flex items-center gap-1",children:[n.jsx(qc,{className:"w-3 h-3"}),"直播时间"]}),n.jsx(ae,{id:"live-time",className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"例如: 06:00-09:00",value:r.authorInfo.liveTime??"",onChange:y=>a(C=>({...C,authorInfo:{...C.authorInfo,liveTime:y.target.value}}))})]}),n.jsxs("div",{className:"space-y-2",children:[n.jsxs(te,{htmlFor:"platform",className:"text-gray-300 flex items-center gap-1",children:[n.jsx(Qw,{className:"w-3 h-3"}),"直播平台"]}),n.jsx(ae,{id:"platform",className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"例如: Soul派对房",value:r.authorInfo.platform??"",onChange:y=>a(C=>({...C,authorInfo:{...C.authorInfo,platform:y.target.value}}))})]})]}),n.jsxs("div",{className:"space-y-2",children:[n.jsxs(te,{htmlFor:"description",className:"text-gray-300 flex items-center gap-1",children:[n.jsx(Ps,{className:"w-3 h-3"}),"简介描述"]}),n.jsx(ae,{id:"description",className:"bg-[#0a1628] border-gray-700 text-white",value:r.authorInfo.description??"",onChange:y=>a(C=>({...C,authorInfo:{...C.authorInfo,description:y.target.value}}))})]}),n.jsxs("div",{className:"space-y-2",children:[n.jsx(te,{htmlFor:"bio",className:"text-gray-300",children:"详细介绍"}),n.jsx($r,{id:"bio",className:"bg-[#0a1628] border-gray-700 text-white min-h-[100px]",placeholder:"输入作者详细介绍...",value:r.authorInfo.bio??"",onChange:y=>a(C=>({...C,authorInfo:{...C.authorInfo,bio:y.target.value}}))})]}),n.jsxs("div",{className:"mt-4 p-4 rounded-xl bg-[#0a1628] border border-[#38bdac]/30",children:[n.jsx("p",{className:"text-xs text-gray-500 mb-2",children:"预览效果"}),n.jsxs("div",{className:"flex items-center gap-3",children:[n.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:(r.authorInfo.name??"K").charAt(0)}),n.jsxs("div",{children:[n.jsx("p",{className:"text-white font-semibold",children:r.authorInfo.name}),n.jsx("p",{className:"text-gray-400 text-xs",children:r.authorInfo.description}),n.jsxs("p",{className:"text-[#38bdac] text-xs mt-1",children:["每日 ",r.authorInfo.liveTime," · ",r.authorInfo.platform]})]})]})]})]})]}),n.jsxs(_e,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:[n.jsxs(ze,{children:[n.jsxs(Ue,{className:"text-white flex items-center gap-2",children:[n.jsx(lo,{className:"w-5 h-5 text-[#38bdac]"}),"价格设置"]}),n.jsx(at,{className:"text-gray-400",children:"配置书籍和章节的定价"})]}),n.jsx(Pe,{className:"space-y-4",children:n.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[n.jsxs("div",{className:"space-y-2",children:[n.jsx(te,{className:"text-gray-300",children:"单节价格 (元)"}),n.jsx(ae,{type:"number",className:"bg-[#0a1628] border-gray-700 text-white",value:r.sectionPrice,onChange:y=>a(C=>({...C,sectionPrice:Number.parseFloat(y.target.value)||1}))})]}),n.jsxs("div",{className:"space-y-2",children:[n.jsx(te,{className:"text-gray-300",children:"整本价格 (元)"}),n.jsx(ae,{type:"number",className:"bg-[#0a1628] border-gray-700 text-white",value:r.baseBookPrice,onChange:y=>a(C=>({...C,baseBookPrice:Number.parseFloat(y.target.value)||9.9}))})]})]})})]}),n.jsxs(_e,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:[n.jsxs(ze,{children:[n.jsxs(Ue,{className:"text-white flex items-center gap-2",children:[n.jsx(am,{className:"w-5 h-5 text-[#38bdac]"}),"免费章节"]}),n.jsx(at,{className:"text-gray-400",children:"设置哪些章节对所有用户免费开放"})]}),n.jsxs(Pe,{className:"space-y-4",children:[n.jsx("div",{className:"flex flex-wrap gap-2",children:l.map(y=>n.jsxs("span",{className:"inline-flex items-center gap-1 bg-[#38bdac]/20 text-[#38bdac] border border-[#38bdac]/30 px-3 py-1 rounded-md text-sm",children:[y,n.jsx("button",{type:"button",onClick:()=>N(y),className:"ml-1 hover:text-red-400",children:n.jsx(Ur,{className:"w-3 h-3"})})]},y))}),n.jsxs("div",{className:"flex gap-2",children:[n.jsx(ae,{className:"bg-[#0a1628] border-gray-700 text-white flex-1",placeholder:"输入章节ID,如 1.2、2.1、preface",value:c,onChange:y=>d(y.target.value),onKeyDown:y=>y.key==="Enter"&&S()}),n.jsxs(ye,{onClick:S,className:"bg-[#38bdac] hover:bg-[#2da396]",children:[n.jsx(ks,{className:"w-4 h-4 mr-1"}),"添加"]})]}),n.jsx("p",{className:"text-xs text-gray-500",children:"常用ID: preface(序言), epilogue(尾声), appendix-1/2/3(附录), 1.1/1.2等(章节)"})]})]}),n.jsxs(_e,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:[n.jsxs(ze,{children:[n.jsxs(Ue,{className:"text-white flex items-center gap-2",children:[n.jsx(io,{className:"w-5 h-5 text-[#38bdac]"}),"功能开关"]}),n.jsx(at,{className:"text-gray-400",children:"控制各个功能模块的显示/隐藏"})]}),n.jsxs(Pe,{className:"space-y-4",children:[n.jsxs("div",{className:"space-y-4",children:[n.jsxs("div",{className:"flex items-center justify-between p-4 rounded-lg bg-[#0a1628] border border-gray-700/50",children:[n.jsxs("div",{className:"space-y-1",children:[n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx(on,{className:"w-4 h-4 text-[#38bdac]"}),n.jsx(te,{htmlFor:"match-enabled",className:"text-white font-medium cursor-pointer",children:"找伙伴功能"})]}),n.jsx("p",{className:"text-xs text-gray-400 ml-6",children:"控制小程序和Web端的找伙伴功能显示"})]}),n.jsx(rt,{id:"match-enabled",checked:p.matchEnabled,onCheckedChange:y=>g(C=>({...C,matchEnabled:y}))})]}),n.jsxs("div",{className:"flex items-center justify-between p-4 rounded-lg bg-[#0a1628] border border-gray-700/50",children:[n.jsxs("div",{className:"space-y-1",children:[n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx(am,{className:"w-4 h-4 text-[#38bdac]"}),n.jsx(te,{htmlFor:"referral-enabled",className:"text-white font-medium cursor-pointer",children:"推广功能"})]}),n.jsx("p",{className:"text-xs text-gray-400 ml-6",children:"控制推广中心的显示(我的页面入口)"})]}),n.jsx(rt,{id:"referral-enabled",checked:p.referralEnabled,onCheckedChange:y=>g(C=>({...C,referralEnabled:y}))})]}),n.jsxs("div",{className:"flex items-center justify-between p-4 rounded-lg bg-[#0a1628] border border-gray-700/50",children:[n.jsxs("div",{className:"space-y-1",children:[n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx(Ps,{className:"w-4 h-4 text-[#38bdac]"}),n.jsx(te,{htmlFor:"search-enabled",className:"text-white font-medium cursor-pointer",children:"搜索功能"})]}),n.jsx("p",{className:"text-xs text-gray-400 ml-6",children:"控制首页搜索栏的显示"})]}),n.jsx(rt,{id:"search-enabled",checked:p.searchEnabled,onCheckedChange:y=>g(C=>({...C,searchEnabled:y}))})]}),n.jsxs("div",{className:"flex items-center justify-between p-4 rounded-lg bg-[#0a1628] border border-gray-700/50",children:[n.jsxs("div",{className:"space-y-1",children:[n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx(io,{className:"w-4 h-4 text-[#38bdac]"}),n.jsx(te,{htmlFor:"about-enabled",className:"text-white font-medium cursor-pointer",children:"关于页面"})]}),n.jsx("p",{className:"text-xs text-gray-400 ml-6",children:"控制关于页面的访问"})]}),n.jsx(rt,{id:"about-enabled",checked:p.aboutEnabled,onCheckedChange:y=>g(C=>({...C,aboutEnabled:y}))})]})]}),n.jsx("div",{className:"p-3 rounded-lg bg-blue-500/10 border border-blue-500/30",children:n.jsx("p",{className:"text-xs text-blue-300",children:"💡 关闭功能后,相关入口会自动隐藏。建议在功能开发完成后再开启。"})})]})]}),n.jsxs(_e,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:[n.jsxs(ze,{children:[n.jsxs(Ue,{className:"text-white flex items-center gap-2",children:[n.jsx(nu,{className:"w-5 h-5 text-[#38bdac]"}),"小程序配置"]}),n.jsx(at,{className:"text-gray-400",children:"微信小程序相关参数设置"})]}),n.jsxs(Pe,{className:"space-y-4",children:[n.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[n.jsxs("div",{className:"space-y-2",children:[n.jsx(te,{className:"text-gray-300",children:"AppID"}),n.jsx(ae,{className:"bg-[#0a1628] border-gray-700 text-white",value:f.appId,onChange:y=>m(C=>({...C,appId:y.target.value}))})]}),n.jsxs("div",{className:"space-y-2",children:[n.jsx(te,{className:"text-gray-300",children:"API域名"}),n.jsx(ae,{className:"bg-[#0a1628] border-gray-700 text-white",value:f.apiDomain,onChange:y=>m(C=>({...C,apiDomain:y.target.value}))})]})]}),n.jsxs("div",{className:"grid grid-cols-3 gap-4",children:[n.jsxs("div",{className:"space-y-2",children:[n.jsx(te,{className:"text-gray-300",children:"购买者优惠 (%)"}),n.jsx(ae,{type:"number",className:"bg-[#0a1628] border-gray-700 text-white",value:f.buyerDiscount,onChange:y=>m(C=>({...C,buyerDiscount:Number(y.target.value)}))})]}),n.jsxs("div",{className:"space-y-2",children:[n.jsx(te,{className:"text-gray-300",children:"推荐绑定天数"}),n.jsx(ae,{type:"number",className:"bg-[#0a1628] border-gray-700 text-white",value:f.referralBindDays,onChange:y=>m(C=>({...C,referralBindDays:Number(y.target.value)}))})]}),n.jsxs("div",{className:"space-y-2",children:[n.jsx(te,{className:"text-gray-300",children:"最低提现 (元)"}),n.jsx(ae,{type:"number",className:"bg-[#0a1628] border-gray-700 text-white",value:f.minWithdraw,onChange:y=>m(C=>({...C,minWithdraw:Number(y.target.value)}))})]})]})]})]}),n.jsxs(_e,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:[n.jsxs(ze,{children:[n.jsxs(Ue,{className:"text-white flex items-center gap-2",children:[n.jsx(on,{className:"w-5 h-5 text-[#38bdac]"}),"分销设置"]}),n.jsx(at,{className:"text-gray-400",children:"配置分销比例和奖励规则"})]}),n.jsx(Pe,{className:"space-y-6",children:n.jsxs("div",{className:"space-y-4",children:[n.jsxs("div",{className:"flex justify-between items-center",children:[n.jsx(te,{className:"text-gray-300",children:"分销者分成比例"}),n.jsxs("span",{className:"text-2xl font-bold text-[#38bdac]",children:[r.distributorShare,"%"]})]}),n.jsx(Vg,{value:[r.distributorShare],onValueChange:([y])=>a(C=>({...C,distributorShare:y})),max:100,step:5,className:"w-full"}),n.jsxs("div",{className:"flex justify-between text-sm text-gray-400",children:[n.jsxs("span",{children:["作者获得: ",100-r.distributorShare,"%"]}),n.jsxs("span",{children:["分销者获得: ",r.distributorShare,"%"]})]})]})})]}),n.jsxs(_e,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:[n.jsxs(ze,{children:[n.jsx(Ue,{className:"text-white",children:"功能开关"}),n.jsx(at,{className:"text-gray-400",children:"控制系统核心模块的启用状态"})]}),n.jsxs(Pe,{className:"space-y-6",children:[n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsxs(te,{htmlFor:"maintenance-mode",className:"flex flex-col space-y-1",children:[n.jsx("span",{className:"text-white",children:"维护模式"}),n.jsx("span",{className:"font-normal text-xs text-gray-500",children:"启用后前台将显示维护中页面"})]}),n.jsx(rt,{id:"maintenance-mode"})]}),n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsxs(te,{htmlFor:"payment-enabled",className:"flex flex-col space-y-1",children:[n.jsx("span",{className:"text-white",children:"全站支付"}),n.jsx("span",{className:"font-normal text-xs text-gray-500",children:"关闭后所有支付功能将暂停"})]}),n.jsx(rt,{id:"payment-enabled",defaultChecked:!0})]}),n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsxs(te,{htmlFor:"referral-enabled-2",className:"flex flex-col space-y-1",children:[n.jsx("span",{className:"text-white",children:"分销系统"}),n.jsx("span",{className:"font-normal text-xs text-gray-500",children:"是否允许用户生成邀请链接"})]}),n.jsx(rt,{id:"referral-enabled-2",checked:p.referralEnabled,onCheckedChange:y=>g(C=>({...C,referralEnabled:y}))})]}),n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsxs(te,{htmlFor:"match-enabled-2",className:"flex flex-col space-y-1",children:[n.jsx("span",{className:"text-white",children:"找伙伴功能"}),n.jsx("span",{className:"font-normal text-xs text-gray-500",children:"是否启用找伙伴匹配功能"})]}),n.jsx(rt,{id:"match-enabled-2",checked:p.matchEnabled,onCheckedChange:y=>g(C=>({...C,matchEnabled:y}))})]})]})]})]})]})}const Hm={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 CC(){const[r,a]=x.useState(!1),[l,i]=x.useState(Hm),[c,d]=x.useState(""),f=async()=>{a(!0);try{const y=await Ge("/api/config");y!=null&&y.paymentMethods&&i({...Hm,...y.paymentMethods})}catch(y){console.error(y)}finally{a(!1)}};x.useEffect(()=>{f()},[]);const m=async()=>{a(!0);try{await vt("/api/config",{paymentMethods:l}),alert("配置已保存!")}catch(y){console.error("保存失败:",y),alert("保存失败: "+(y instanceof Error?y.message:String(y)))}finally{a(!1)}},p=(y,C)=>{navigator.clipboard.writeText(y),d(C),setTimeout(()=>d(""),2e3)},g=(y,C)=>{i(j=>({...j,wechat:{...j.wechat,[y]:C}}))},v=(y,C)=>{i(j=>({...j,alipay:{...j.alipay,[y]:C}}))},w=(y,C)=>{i(j=>({...j,usdt:{...j.usdt,[y]:C}}))},_=(y,C)=>{i(j=>({...j,paypal:{...j.paypal,[y]:C}}))},E=l.wechat,k=l.alipay,S=l.usdt,N=l.paypal;return n.jsxs("div",{className:"p-8 max-w-5xl mx-auto",children:[n.jsxs("div",{className:"flex justify-between items-center mb-8",children:[n.jsxs("div",{children:[n.jsx("h1",{className:"text-2xl font-bold mb-2 text-white",children:"支付配置"}),n.jsx("p",{className:"text-gray-400",children:"配置微信、支付宝、USDT、PayPal等支付参数"})]}),n.jsxs("div",{className:"flex gap-3",children:[n.jsxs(ye,{variant:"outline",onClick:f,className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:[n.jsx(Ze,{className:`w-4 h-4 mr-2 ${r?"animate-spin":""}`}),"同步配置"]}),n.jsxs(ye,{onClick:m,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:[n.jsx($n,{className:"w-4 h-4 mr-2"}),"保存配置"]})]})]}),n.jsx("div",{className:"mb-6 bg-[#07C160]/10 border border-[#07C160]/30 rounded-xl p-4",children:n.jsxs("div",{className:"flex items-start gap-3",children:[n.jsx(op,{className:"w-5 h-5 text-[#07C160] flex-shrink-0 mt-0.5"}),n.jsxs("div",{className:"text-sm",children:[n.jsx("p",{className:"font-medium mb-2 text-[#07C160]",children:"如何获取微信群跳转链接?"}),n.jsxs("ol",{className:"text-[#07C160]/80 space-y-1 list-decimal list-inside",children:[n.jsx("li",{children:"打开微信,进入目标微信群"}),n.jsx("li",{children:'点击右上角"..." → "群二维码"'}),n.jsx("li",{children:'点击右上角"..." → "发送到电脑"'}),n.jsx("li",{children:"在电脑上保存二维码图片,上传到图床获取URL"}),n.jsx("li",{children:"或使用草料二维码等工具解析二维码获取链接"})]}),n.jsx("p",{className:"text-[#07C160]/60 mt-2",children:"提示:微信群二维码7天后失效,建议使用活码工具"})]})]})}),n.jsxs($u,{defaultValue:"wechat",className:"space-y-6",children:[n.jsxs(To,{className:"bg-[#0f2137] border border-gray-700/50 p-1 grid grid-cols-4 w-full",children:[n.jsxs(Xt,{value:"wechat",className:"data-[state=active]:bg-[#07C160]/20 data-[state=active]:text-[#07C160] text-gray-400",children:[n.jsx(nu,{className:"w-4 h-4 mr-2"}),"微信"]}),n.jsxs(Xt,{value:"alipay",className:"data-[state=active]:bg-[#1677FF]/20 data-[state=active]:text-[#1677FF] text-gray-400",children:[n.jsx(Zc,{className:"w-4 h-4 mr-2"}),"支付宝"]}),n.jsxs(Xt,{value:"usdt",className:"data-[state=active]:bg-[#26A17B]/20 data-[state=active]:text-[#26A17B] text-gray-400",children:[n.jsx(rm,{className:"w-4 h-4 mr-2"}),"USDT"]}),n.jsxs(Xt,{value:"paypal",className:"data-[state=active]:bg-[#003087]/20 data-[state=active]:text-[#169BD7] text-gray-400",children:[n.jsx(eu,{className:"w-4 h-4 mr-2"}),"PayPal"]})]}),n.jsx(qt,{value:"wechat",className:"space-y-4",children:n.jsxs(_e,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:[n.jsxs(ze,{className:"flex flex-row items-center justify-between pb-2",children:[n.jsxs("div",{className:"space-y-1",children:[n.jsxs(Ue,{className:"text-[#07C160] flex items-center gap-2",children:[n.jsx(nu,{className:"w-5 h-5"}),"微信支付配置"]}),n.jsx(at,{className:"text-gray-400",children:"配置微信支付参数和跳转链接"})]}),n.jsx(rt,{checked:!!E.enabled,onCheckedChange:y=>g("enabled",y)})]}),n.jsxs(Pe,{className:"space-y-4",children:[n.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[n.jsxs("div",{className:"space-y-2",children:[n.jsx(te,{className:"text-gray-300",children:"网站AppID"}),n.jsx(ae,{className:"bg-[#0a1628] border-gray-700 text-white font-mono text-sm",value:String(E.websiteAppId??""),onChange:y=>g("websiteAppId",y.target.value)})]}),n.jsxs("div",{className:"space-y-2",children:[n.jsx(te,{className:"text-gray-300",children:"商户号"}),n.jsx(ae,{className:"bg-[#0a1628] border-gray-700 text-white font-mono text-sm",value:String(E.merchantId??""),onChange:y=>g("merchantId",y.target.value)})]})]}),n.jsxs("div",{className:"border-t border-gray-700/50 pt-4 space-y-4",children:[n.jsxs("h4",{className:"text-white font-medium flex items-center gap-2",children:[n.jsx(oo,{className:"w-4 h-4 text-[#38bdac]"}),"跳转链接配置(核心功能)"]}),n.jsxs("div",{className:"space-y-2",children:[n.jsx(te,{className:"text-gray-300",children:"微信收款码/支付链接"}),n.jsx(ae,{className:"bg-[#0a1628] border-gray-700 text-white placeholder:text-gray-500",placeholder:"https://收款码图片URL 或 weixin://支付链接",value:String(E.qrCode??""),onChange:y=>g("qrCode",y.target.value)}),n.jsx("p",{className:"text-xs text-gray-500",children:"用户点击微信支付后显示的二维码图片URL"})]}),n.jsxs("div",{className:"space-y-2 bg-[#07C160]/5 p-4 rounded-xl border border-[#07C160]/20",children:[n.jsx(te,{className:"text-[#07C160] font-medium",children:"微信群跳转链接(支付成功后跳转)"}),n.jsx(ae,{className:"bg-[#0a1628] border-[#07C160]/30 text-white placeholder:text-gray-500",placeholder:"https://weixin.qq.com/g/... 或微信群二维码图片URL",value:String(E.groupQrCode??""),onChange:y=>g("groupQrCode",y.target.value)}),n.jsx("p",{className:"text-xs text-[#07C160]/70",children:"用户支付成功后将自动跳转到此链接,进入指定微信群"})]})]})]})]})}),n.jsx(qt,{value:"alipay",className:"space-y-4",children:n.jsxs(_e,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:[n.jsxs(ze,{className:"flex flex-row items-center justify-between pb-2",children:[n.jsxs("div",{className:"space-y-1",children:[n.jsxs(Ue,{className:"text-[#1677FF] flex items-center gap-2",children:[n.jsx(Zc,{className:"w-5 h-5"}),"支付宝配置"]}),n.jsx(at,{className:"text-gray-400",children:"已加载真实支付宝参数"})]}),n.jsx(rt,{checked:!!k.enabled,onCheckedChange:y=>v("enabled",y)})]}),n.jsxs(Pe,{className:"space-y-4",children:[n.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[n.jsxs("div",{className:"space-y-2",children:[n.jsx(te,{className:"text-gray-300",children:"合作者身份 (PID)"}),n.jsxs("div",{className:"flex gap-2",children:[n.jsx(ae,{className:"bg-[#0a1628] border-gray-700 text-white font-mono text-sm",value:String(k.partnerId??""),onChange:y=>v("partnerId",y.target.value)}),n.jsx(ye,{size:"icon",variant:"outline",className:"border-gray-700 bg-transparent",onClick:()=>p(String(k.partnerId??""),"pid"),children:c==="pid"?n.jsx(bo,{className:"w-4 h-4 text-green-500"}):n.jsx(cp,{className:"w-4 h-4 text-gray-400"})})]})]}),n.jsxs("div",{className:"space-y-2",children:[n.jsx(te,{className:"text-gray-300",children:"安全校验码 (Key)"}),n.jsx(ae,{type:"password",className:"bg-[#0a1628] border-gray-700 text-white font-mono text-sm",value:String(k.securityKey??""),onChange:y=>v("securityKey",y.target.value)})]})]}),n.jsxs("div",{className:"border-t border-gray-700/50 pt-4 space-y-4",children:[n.jsxs("h4",{className:"text-white font-medium flex items-center gap-2",children:[n.jsx(oo,{className:"w-4 h-4 text-[#38bdac]"}),"跳转链接配置"]}),n.jsxs("div",{className:"space-y-2",children:[n.jsx(te,{className:"text-gray-300",children:"支付宝收款码/跳转链接"}),n.jsx(ae,{className:"bg-[#0a1628] border-gray-700 text-white placeholder:text-gray-500",placeholder:"https://qr.alipay.com/... 或收款码图片URL",value:String(k.qrCode??""),onChange:y=>v("qrCode",y.target.value)}),n.jsx("p",{className:"text-xs text-gray-500",children:"用户点击支付宝支付后显示的二维码"})]})]})]})]})}),n.jsx(qt,{value:"usdt",className:"space-y-4",children:n.jsxs(_e,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:[n.jsxs(ze,{className:"flex flex-row items-center justify-between pb-2",children:[n.jsxs("div",{className:"space-y-1",children:[n.jsxs(Ue,{className:"text-[#26A17B] flex items-center gap-2",children:[n.jsx(rm,{className:"w-5 h-5"}),"USDT配置"]}),n.jsx(at,{className:"text-gray-400",children:"配置加密货币收款地址"})]}),n.jsx(rt,{checked:!!S.enabled,onCheckedChange:y=>w("enabled",y)})]}),n.jsxs(Pe,{className:"space-y-4",children:[n.jsxs("div",{className:"space-y-2",children:[n.jsx(te,{className:"text-gray-300",children:"网络类型"}),n.jsxs("select",{className:"w-full bg-[#0a1628] border border-gray-700 text-white rounded-md p-2",value:String(S.network??"TRC20"),onChange:y=>w("network",y.target.value),children:[n.jsx("option",{value:"TRC20",children:"TRC20 (波场)"}),n.jsx("option",{value:"ERC20",children:"ERC20 (以太坊)"}),n.jsx("option",{value:"BEP20",children:"BEP20 (币安链)"})]})]}),n.jsxs("div",{className:"space-y-2",children:[n.jsx(te,{className:"text-gray-300",children:"收款地址"}),n.jsx(ae,{className:"bg-[#0a1628] border-gray-700 text-white font-mono text-sm",placeholder:"T... (TRC20地址)",value:String(S.address??""),onChange:y=>w("address",y.target.value)})]}),n.jsxs("div",{className:"space-y-2",children:[n.jsx(te,{className:"text-gray-300",children:"汇率 (1 USD = ? CNY)"}),n.jsx(ae,{type:"number",className:"bg-[#0a1628] border-gray-700 text-white",value:Number(S.exchangeRate)??7.2,onChange:y=>w("exchangeRate",Number.parseFloat(y.target.value)||7.2)})]})]})]})}),n.jsx(qt,{value:"paypal",className:"space-y-4",children:n.jsxs(_e,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:[n.jsxs(ze,{className:"flex flex-row items-center justify-between pb-2",children:[n.jsxs("div",{className:"space-y-1",children:[n.jsxs(Ue,{className:"text-[#169BD7] flex items-center gap-2",children:[n.jsx(eu,{className:"w-5 h-5"}),"PayPal配置"]}),n.jsx(at,{className:"text-gray-400",children:"配置PayPal收款账户"})]}),n.jsx(rt,{checked:!!N.enabled,onCheckedChange:y=>_("enabled",y)})]}),n.jsxs(Pe,{className:"space-y-4",children:[n.jsxs("div",{className:"space-y-2",children:[n.jsx(te,{className:"text-gray-300",children:"PayPal邮箱"}),n.jsx(ae,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"your@email.com",value:String(N.email??""),onChange:y=>_("email",y.target.value)})]}),n.jsxs("div",{className:"space-y-2",children:[n.jsx(te,{className:"text-gray-300",children:"汇率 (1 USD = ? CNY)"}),n.jsx(ae,{type:"number",className:"bg-[#0a1628] border-gray-700 text-white",value:Number(N.exchangeRate)??7.2,onChange:y=>_("exchangeRate",Number(y.target.value)||7.2)})]})]})]})})]})]})}const kC={siteName:"卡若日记",siteTitle:"一场SOUL的创业实验场",siteDescription:"来自Soul派对房的真实商业故事",logo:"/logo.png",favicon:"/favicon.ico",primaryColor:"#00CED1"},EC={home:{enabled:!0,label:"首页"},chapters:{enabled:!0,label:"目录"},match:{enabled:!0,label:"匹配"},my:{enabled:!0,label:"我的"}},_C={homeTitle:"一场SOUL的创业实验场",homeSubtitle:"来自Soul派对房的真实商业故事",chaptersTitle:"我要看",matchTitle:"语音匹配",myTitle:"我的",aboutTitle:"关于作者"};function PC(){const[r,a]=x.useState({siteConfig:{...kC},menuConfig:{...EC},pageConfig:{..._C}}),[l,i]=x.useState(!1);x.useEffect(()=>{Ge("/api/config").then(p=>{p!=null&&p.siteConfig&&a(g=>({...g,siteConfig:{...g.siteConfig,...p.siteConfig}})),p!=null&&p.menuConfig&&a(g=>({...g,menuConfig:{...g.menuConfig,...p.menuConfig}})),p!=null&&p.pageConfig&&a(g=>({...g,pageConfig:{...g.pageConfig,...p.pageConfig}}))}).catch(console.error)},[]);const c=()=>{i(!0),setTimeout(()=>i(!1),2e3),alert("配置已保存(当前为前端状态,后端可对接 /api/db/config 持久化)")},d=r.siteConfig,f=r.menuConfig,m=r.pageConfig;return n.jsxs("div",{className:"p-8 max-w-4xl mx-auto",children:[n.jsxs("div",{className:"flex justify-between items-center mb-8",children:[n.jsxs("div",{children:[n.jsx("h2",{className:"text-2xl font-bold text-white",children:"网站配置"}),n.jsx("p",{className:"text-gray-400 mt-1",children:"配置网站名称、图标、菜单和页面标题"})]}),n.jsxs(ye,{onClick:c,className:`${l?"bg-green-500":"bg-[#00CED1]"} hover:bg-[#20B2AA] text-white transition-colors`,children:[n.jsx($n,{className:"w-4 h-4 mr-2"}),l?"已保存":"保存设置"]})]}),n.jsxs("div",{className:"space-y-6",children:[n.jsxs(_e,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:[n.jsxs(ze,{children:[n.jsxs(Ue,{className:"text-white flex items-center gap-2",children:[n.jsx(eu,{className:"w-5 h-5 text-[#00CED1]"}),"网站基础信息"]}),n.jsx(at,{className:"text-gray-400",children:"配置网站名称、标题和描述"})]}),n.jsxs(Pe,{className:"space-y-4",children:[n.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[n.jsxs("div",{className:"space-y-2",children:[n.jsx(te,{htmlFor:"site-name",className:"text-gray-300",children:"网站名称"}),n.jsx(ae,{id:"site-name",className:"bg-[#0a1628] border-gray-700 text-white",value:d.siteName??"",onChange:p=>a(g=>({...g,siteConfig:{...g.siteConfig,siteName:p.target.value}}))})]}),n.jsxs("div",{className:"space-y-2",children:[n.jsx(te,{htmlFor:"site-title",className:"text-gray-300",children:"网站标题"}),n.jsx(ae,{id:"site-title",className:"bg-[#0a1628] border-gray-700 text-white",value:d.siteTitle??"",onChange:p=>a(g=>({...g,siteConfig:{...g.siteConfig,siteTitle:p.target.value}}))})]})]}),n.jsxs("div",{className:"space-y-2",children:[n.jsx(te,{htmlFor:"site-desc",className:"text-gray-300",children:"网站描述"}),n.jsx(ae,{id:"site-desc",className:"bg-[#0a1628] border-gray-700 text-white",value:d.siteDescription??"",onChange:p=>a(g=>({...g,siteConfig:{...g.siteConfig,siteDescription:p.target.value}}))})]}),n.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[n.jsxs("div",{className:"space-y-2",children:[n.jsx(te,{htmlFor:"logo",className:"text-gray-300",children:"Logo地址"}),n.jsx(ae,{id:"logo",className:"bg-[#0a1628] border-gray-700 text-white",value:d.logo??"",onChange:p=>a(g=>({...g,siteConfig:{...g.siteConfig,logo:p.target.value}}))})]}),n.jsxs("div",{className:"space-y-2",children:[n.jsx(te,{htmlFor:"favicon",className:"text-gray-300",children:"Favicon地址"}),n.jsx(ae,{id:"favicon",className:"bg-[#0a1628] border-gray-700 text-white",value:d.favicon??"",onChange:p=>a(g=>({...g,siteConfig:{...g.siteConfig,favicon:p.target.value}}))})]})]})]})]}),n.jsxs(_e,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:[n.jsxs(ze,{children:[n.jsxs(Ue,{className:"text-white flex items-center gap-2",children:[n.jsx(e1,{className:"w-5 h-5 text-[#00CED1]"}),"主题颜色"]}),n.jsx(at,{className:"text-gray-400",children:"配置网站主题色"})]}),n.jsx(Pe,{children:n.jsxs("div",{className:"flex items-center gap-4",children:[n.jsxs("div",{className:"space-y-2 flex-1",children:[n.jsx(te,{htmlFor:"primary-color",className:"text-gray-300",children:"主色调"}),n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsx(ae,{id:"primary-color",type:"color",className:"w-16 h-10 bg-[#0a1628] border-gray-700 cursor-pointer p-1",value:d.primaryColor??"#00CED1",onChange:p=>a(g=>({...g,siteConfig:{...g.siteConfig,primaryColor:p.target.value}}))}),n.jsx(ae,{className:"bg-[#0a1628] border-gray-700 text-white flex-1",value:d.primaryColor??"#00CED1",onChange:p=>a(g=>({...g,siteConfig:{...g.siteConfig,primaryColor:p.target.value}}))})]})]}),n.jsx("div",{className:"w-24 h-24 rounded-xl flex items-center justify-center text-white font-bold",style:{backgroundColor:d.primaryColor??"#00CED1"},children:"预览"})]})})]}),n.jsxs(_e,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:[n.jsxs(ze,{children:[n.jsxs(Ue,{className:"text-white flex items-center gap-2",children:[n.jsx(Xw,{className:"w-5 h-5 text-[#00CED1]"}),"底部菜单配置"]}),n.jsx(at,{className:"text-gray-400",children:"控制底部导航栏菜单的显示和名称"})]}),n.jsx(Pe,{className:"space-y-4",children:Object.entries(f).map(([p,g])=>n.jsxs("div",{className:"flex items-center justify-between p-4 bg-[#0a1628] rounded-lg",children:[n.jsxs("div",{className:"flex items-center gap-4 flex-1",children:[n.jsx(rt,{checked:(g==null?void 0:g.enabled)??!0,onCheckedChange:v=>a(w=>({...w,menuConfig:{...w.menuConfig,[p]:{...g,enabled:v}}}))}),n.jsx("span",{className:"text-gray-300 w-16 capitalize",children:p}),n.jsx(ae,{className:"bg-[#0f2137] border-gray-700 text-white max-w-[200px]",value:(g==null?void 0:g.label)??"",onChange:v=>a(w=>({...w,menuConfig:{...w.menuConfig,[p]:{...g,label:v.target.value}}}))})]}),n.jsx("span",{className:`text-sm ${g!=null&&g.enabled?"text-green-400":"text-gray-500"}`,children:g!=null&&g.enabled?"显示":"隐藏"})]},p))})]}),n.jsxs(_e,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:[n.jsxs(ze,{children:[n.jsxs(Ue,{className:"text-white flex items-center gap-2",children:[n.jsx(dp,{className:"w-5 h-5 text-[#00CED1]"}),"页面标题配置"]}),n.jsx(at,{className:"text-gray-400",children:"配置各个页面的标题和副标题"})]}),n.jsxs(Pe,{className:"space-y-4",children:[n.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[n.jsxs("div",{className:"space-y-2",children:[n.jsx(te,{className:"text-gray-300",children:"首页标题"}),n.jsx(ae,{className:"bg-[#0a1628] border-gray-700 text-white",value:m.homeTitle??"",onChange:p=>a(g=>({...g,pageConfig:{...g.pageConfig,homeTitle:p.target.value}}))})]}),n.jsxs("div",{className:"space-y-2",children:[n.jsx(te,{className:"text-gray-300",children:"首页副标题"}),n.jsx(ae,{className:"bg-[#0a1628] border-gray-700 text-white",value:m.homeSubtitle??"",onChange:p=>a(g=>({...g,pageConfig:{...g.pageConfig,homeSubtitle:p.target.value}}))})]})]}),n.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[n.jsxs("div",{className:"space-y-2",children:[n.jsx(te,{className:"text-gray-300",children:"目录页标题"}),n.jsx(ae,{className:"bg-[#0a1628] border-gray-700 text-white",value:m.chaptersTitle??"",onChange:p=>a(g=>({...g,pageConfig:{...g.pageConfig,chaptersTitle:p.target.value}}))})]}),n.jsxs("div",{className:"space-y-2",children:[n.jsx(te,{className:"text-gray-300",children:"匹配页标题"}),n.jsx(ae,{className:"bg-[#0a1628] border-gray-700 text-white",value:m.matchTitle??"",onChange:p=>a(g=>({...g,pageConfig:{...g.pageConfig,matchTitle:p.target.value}}))})]})]}),n.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[n.jsxs("div",{className:"space-y-2",children:[n.jsx(te,{className:"text-gray-300",children:"我的页标题"}),n.jsx(ae,{className:"bg-[#0a1628] border-gray-700 text-white",value:m.myTitle??"",onChange:p=>a(g=>({...g,pageConfig:{...g.pageConfig,myTitle:p.target.value}}))})]}),n.jsxs("div",{className:"space-y-2",children:[n.jsx(te,{className:"text-gray-300",children:"关于作者标题"}),n.jsx(ae,{className:"bg-[#0a1628] border-gray-700 text-white",value:m.aboutTitle??"",onChange:p=>a(g=>({...g,pageConfig:{...g.pageConfig,aboutTitle:p.target.value}}))})]})]})]})]})]})]})}function RC(){const[r,a]=x.useState(""),[l,i]=x.useState(""),[c,d]=x.useState(""),[f,m]=x.useState({}),p=async()=>{var E,k,S,N;try{const y=await Ge("/api/config"),C=(k=(E=y==null?void 0:y.liveQRCodes)==null?void 0:E[0])==null?void 0:k.urls;Array.isArray(C)&&a(C.join(`
|
||
`));const j=(N=(S=y==null?void 0:y.paymentMethods)==null?void 0:S.wechat)==null?void 0:N.groupQrCode;j&&i(j),m({paymentMethods:y==null?void 0:y.paymentMethods,liveQRCodes:y==null?void 0:y.liveQRCodes})}catch(y){console.error(y)}};x.useEffect(()=>{p()},[]);const g=(E,k)=>{navigator.clipboard.writeText(E),d(k),setTimeout(()=>d(""),2e3)},v=async()=>{try{const E=r.split(`
|
||
`).map(S=>S.trim()).filter(Boolean),k=[...f.liveQRCodes||[]];k[0]?k[0].urls=E:k.push({id:"live-1",name:"微信群活码",urls:E,clickCount:0}),await vt("/api/config",{liveQRCodes:k}),alert("群活码配置已保存!"),await p()}catch(E){console.error(E),alert("保存失败: "+(E instanceof Error?E.message:String(E)))}},w=async()=>{var E;try{await vt("/api/config",{paymentMethods:{...f.paymentMethods||{},wechat:{...((E=f.paymentMethods)==null?void 0:E.wechat)||{},groupQrCode:l}}}),alert("微信群链接已保存!用户支付成功后将自动跳转"),await p()}catch(k){console.error(k),alert("保存失败: "+(k instanceof Error?k.message:String(k)))}},_=()=>{l?window.open(l,"_blank"):alert("请先配置微信群链接")};return n.jsxs("div",{className:"p-8 max-w-5xl mx-auto",children:[n.jsxs("div",{className:"mb-8",children:[n.jsx("h2",{className:"text-2xl font-bold text-white",children:"微信群活码管理"}),n.jsx("p",{className:"text-gray-400 mt-1",children:"配置微信群跳转链接,用户支付后自动跳转加群"})]}),n.jsx("div",{className:"mb-6 bg-[#07C160]/10 border border-[#07C160]/30 rounded-xl p-4",children:n.jsxs("div",{className:"flex items-start gap-3",children:[n.jsx(op,{className:"w-5 h-5 text-[#07C160] flex-shrink-0 mt-0.5"}),n.jsxs("div",{className:"text-sm",children:[n.jsx("p",{className:"font-medium mb-2 text-[#07C160]",children:"微信群活码配置指南"}),n.jsxs("div",{className:"text-[#07C160]/80 space-y-2",children:[n.jsx("p",{className:"font-medium",children:"方法一:使用草料活码(推荐)"}),n.jsxs("ol",{className:"list-decimal list-inside space-y-1 pl-2",children:[n.jsx("li",{children:"访问草料二维码创建活码"}),n.jsx("li",{children:"上传微信群二维码图片,生成永久链接"}),n.jsx("li",{children:"复制生成的短链接填入下方配置"}),n.jsx("li",{children:"群满后可直接在草料后台更换新群码,链接不变"})]}),n.jsx("p",{className:"font-medium mt-3",children:"方法二:直接使用微信群链接"}),n.jsxs("ol",{className:"list-decimal list-inside space-y-1 pl-2",children:[n.jsx("li",{children:'微信打开目标群 → 右上角"..." → 群二维码'}),n.jsx("li",{children:"长按二维码 → 识别二维码 → 复制链接"})]}),n.jsx("p",{className:"text-[#07C160]/60 mt-2",children:"注意:微信原生群二维码7天后失效,建议使用草料活码"})]})]})]})}),n.jsxs("div",{className:"grid gap-6 md:grid-cols-2",children:[n.jsxs(_e,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl md:col-span-2",children:[n.jsxs(ze,{children:[n.jsxs(Ue,{className:"text-[#07C160] flex items-center gap-2",children:[n.jsx(um,{className:"w-5 h-5"}),"支付成功跳转链接(核心配置)"]}),n.jsx(at,{className:"text-gray-400",children:"用户支付完成后自动跳转到此链接,进入指定微信群"})]}),n.jsxs(Pe,{className:"space-y-4",children:[n.jsxs("div",{className:"space-y-2",children:[n.jsxs(te,{className:"text-gray-300 flex items-center gap-2",children:[n.jsx(cm,{className:"w-4 h-4"}),"微信群链接 / 活码链接"]}),n.jsxs("div",{className:"flex gap-2",children:[n.jsx(ae,{placeholder:"https://cli.im/xxxxx 或 https://weixin.qq.com/g/...",className:"bg-[#0a1628] border-gray-700 text-white placeholder:text-gray-500 flex-1",value:l,onChange:E=>i(E.target.value)}),n.jsx(ye,{variant:"outline",size:"icon",className:"border-gray-700 bg-transparent hover:bg-gray-700/50",onClick:()=>g(l,"group"),children:c==="group"?n.jsx(bo,{className:"w-4 h-4 text-green-500"}):n.jsx(cp,{className:"w-4 h-4 text-gray-400"})})]}),n.jsxs("p",{className:"text-xs text-gray-500 flex items-center gap-1",children:[n.jsx(oo,{className:"w-3 h-3"}),"支持格式:草料短链、微信群链接(https://weixin.qq.com/g/...)、企业微信链接等"]})]}),n.jsxs("div",{className:"flex gap-3",children:[n.jsxs(ye,{onClick:w,className:"flex-1 bg-[#07C160] hover:bg-[#06AD51] text-white",children:[n.jsx(Ss,{className:"w-4 h-4 mr-2"}),"保存配置"]}),n.jsxs(ye,{onClick:_,variant:"outline",className:"border-[#07C160] text-[#07C160] hover:bg-[#07C160]/10 bg-transparent",children:[n.jsx(oo,{className:"w-4 h-4 mr-2"}),"测试跳转"]})]})]})]}),n.jsxs(_e,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl md:col-span-2",children:[n.jsxs(ze,{children:[n.jsxs(Ue,{className:"text-white flex items-center gap-2",children:[n.jsx(um,{className:"w-5 h-5 text-[#38bdac]"}),"多群轮换(高级配置)"]}),n.jsx(at,{className:"text-gray-400",children:"配置多个群链接,系统自动轮换分配,避免单群满员"})]}),n.jsxs(Pe,{className:"space-y-4",children:[n.jsxs("div",{className:"space-y-2",children:[n.jsxs(te,{className:"text-gray-300 flex items-center gap-2",children:[n.jsx(cm,{className:"w-4 h-4"}),"多个群链接(每行一个)"]}),n.jsx($r,{placeholder:"https://cli.im/group1\\nhttps://cli.im/group2",className:"bg-[#0a1628] border-gray-700 text-white placeholder:text-gray-500 min-h-[120px] font-mono text-sm",value:r,onChange:E=>a(E.target.value)}),n.jsx("p",{className:"text-xs text-gray-500",children:"每行填写一个群链接,系统将按顺序或随机分配"})]}),n.jsxs("div",{className:"flex items-center justify-between p-3 bg-[#0a1628] rounded-lg border border-gray-700/50",children:[n.jsx("span",{className:"text-sm text-gray-400",children:"已配置群数量"}),n.jsxs("span",{className:"font-bold text-[#38bdac]",children:[r.split(`
|
||
`).filter(Boolean).length," 个"]})]}),n.jsxs(ye,{onClick:v,className:"w-full bg-[#38bdac] hover:bg-[#2da396] text-white",children:[n.jsx(Ss,{className:"w-4 h-4 mr-2"}),"保存多群配置"]})]})]})]}),n.jsxs("div",{className:"mt-6 bg-[#0f2137] rounded-xl p-4 border border-gray-700/50",children:[n.jsx("h4",{className:"text-white font-medium mb-3",children:"常见问题"}),n.jsxs("div",{className:"space-y-3 text-sm",children:[n.jsxs("div",{children:[n.jsx("p",{className:"text-[#38bdac]",children:"Q: 为什么推荐使用草料活码?"}),n.jsx("p",{className:"text-gray-400",children:"A: 草料活码是永久链接,群满后可直接在后台更换新群码,无需修改网站配置。微信原生群码7天失效。"})]}),n.jsxs("div",{children:[n.jsx("p",{className:"text-[#38bdac]",children:"Q: 支付后没有跳转怎么办?"}),n.jsx("p",{className:"text-gray-400",children:"A: 1) 检查链接是否正确填写 2) 部分浏览器可能拦截弹窗,用户需手动允许 3) 建议使用https开头的链接"})]})]})]})]})}const Km={matchTypes:[{id:"partner",label:"创业合伙",matchLabel:"创业伙伴",icon:"⭐",matchFromDB:!0,showJoinAfterMatch:!1,price:1,enabled:!0},{id:"investor",label:"资源对接",matchLabel:"资源对接",icon:"👥",matchFromDB:!1,showJoinAfterMatch:!0,price:1,enabled:!0},{id:"mentor",label:"导师顾问",matchLabel:"商业顾问",icon:"❤️",matchFromDB:!1,showJoinAfterMatch:!0,price:1,enabled:!0},{id:"team",label:"团队招募",matchLabel:"加入项目",icon:"🎮",matchFromDB:!1,showJoinAfterMatch:!0,price:1,enabled:!0}],freeMatchLimit:3,matchPrice:1,settings:{enableFreeMatches:!0,enablePaidMatches:!0,maxMatchesPerDay:10}},TC=["⭐","👥","❤️","🎮","💼","🚀","💡","🎯","🔥","✨"];function IC(){const[r,a]=x.useState(Km),[l,i]=x.useState(!0),[c,d]=x.useState(!1),[f,m]=x.useState(!1),[p,g]=x.useState(null),[v,w]=x.useState({id:"",label:"",matchLabel:"",icon:"⭐",matchFromDB:!1,showJoinAfterMatch:!0,price:1,enabled:!0}),_=async()=>{i(!0);try{const j=await Ge("/api/db/config?key=match_config"),A=(j==null?void 0:j.data)??(j==null?void 0:j.config);A&&a({...Km,...A})}catch(j){console.error("加载匹配配置失败:",j)}finally{i(!1)}};x.useEffect(()=>{_()},[]);const E=async()=>{d(!0);try{const j=await vt("/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)}},k=j=>{g(j),w({id:j.id,label:j.label,matchLabel:j.matchLabel,icon:j.icon,matchFromDB:j.matchFromDB,showJoinAfterMatch:j.showJoinAfterMatch,price:j.price,enabled:j.enabled}),m(!0)},S=()=>{g(null),w({id:"",label:"",matchLabel:"",icon:"⭐",matchFromDB:!1,showJoinAfterMatch:!0,price:1,enabled:!0}),m(!0)},N=()=>{if(!v.id||!v.label){alert("请填写类型ID和名称");return}const j=[...r.matchTypes];if(p){const A=j.findIndex(z=>z.id===p.id);A!==-1&&(j[A]={...v})}else{if(j.some(A=>A.id===v.id)){alert("类型ID已存在");return}j.push({...v})}a({...r,matchTypes:j}),m(!1)},y=j=>{confirm("确定要删除这个匹配类型吗?")&&a({...r,matchTypes:r.matchTypes.filter(A=>A.id!==j)})},C=j=>{a({...r,matchTypes:r.matchTypes.map(A=>A.id===j?{...A,enabled:!A.enabled}:A)})};return n.jsxs("div",{className:"p-8 max-w-6xl mx-auto space-y-6",children:[n.jsxs("div",{className:"flex justify-between items-center",children:[n.jsxs("div",{children:[n.jsxs("h2",{className:"text-2xl font-bold text-white flex items-center gap-2",children:[n.jsx(io,{className:"w-6 h-6 text-[#38bdac]"}),"匹配功能配置"]}),n.jsx("p",{className:"text-gray-400 mt-1",children:"管理找伙伴功能的匹配类型和价格"})]}),n.jsxs("div",{className:"flex gap-3",children:[n.jsxs(ye,{variant:"outline",onClick:_,disabled:l,className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:[n.jsx(Ze,{className:`w-4 h-4 mr-2 ${l?"animate-spin":""}`}),"刷新"]}),n.jsxs(ye,{onClick:E,disabled:c,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:[n.jsx($n,{className:"w-4 h-4 mr-2"}),c?"保存中...":"保存配置"]})]})]}),n.jsxs(_e,{className:"bg-[#0f2137] border-gray-700/50",children:[n.jsxs(ze,{children:[n.jsxs(Ue,{className:"text-white flex items-center gap-2",children:[n.jsx(P1,{className:"w-5 h-5 text-yellow-400"}),"基础设置"]}),n.jsx(at,{className:"text-gray-400",children:"配置免费匹配次数和付费规则"})]}),n.jsxs(Pe,{className:"space-y-6",children:[n.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-6",children:[n.jsxs("div",{className:"space-y-2",children:[n.jsx(te,{className:"text-gray-300",children:"每日免费匹配次数"}),n.jsx(ae,{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})}),n.jsx("p",{className:"text-xs text-gray-500",children:"用户每天可免费匹配的次数"})]}),n.jsxs("div",{className:"space-y-2",children:[n.jsx(te,{className:"text-gray-300",children:"付费匹配价格(元)"}),n.jsx(ae,{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})}),n.jsx("p",{className:"text-xs text-gray-500",children:"免费次数用完后的单次匹配价格"})]}),n.jsxs("div",{className:"space-y-2",children:[n.jsx(te,{className:"text-gray-300",children:"每日最大匹配次数"}),n.jsx(ae,{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}})}),n.jsx("p",{className:"text-xs text-gray-500",children:"包含免费和付费的总次数"})]})]}),n.jsxs("div",{className:"flex gap-8 pt-4 border-t border-gray-700/50",children:[n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsx(rt,{checked:r.settings.enableFreeMatches,onCheckedChange:j=>a({...r,settings:{...r.settings,enableFreeMatches:j}})}),n.jsx(te,{className:"text-gray-300",children:"启用免费匹配"})]}),n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsx(rt,{checked:r.settings.enablePaidMatches,onCheckedChange:j=>a({...r,settings:{...r.settings,enablePaidMatches:j}})}),n.jsx(te,{className:"text-gray-300",children:"启用付费匹配"})]})]})]})]}),n.jsxs(_e,{className:"bg-[#0f2137] border-gray-700/50",children:[n.jsxs(ze,{className:"flex flex-row items-center justify-between",children:[n.jsxs("div",{children:[n.jsxs(Ue,{className:"text-white flex items-center gap-2",children:[n.jsx(on,{className:"w-5 h-5 text-[#38bdac]"}),"匹配类型管理"]}),n.jsx(at,{className:"text-gray-400",children:"配置不同的匹配类型及其价格"})]}),n.jsxs(ye,{onClick:S,size:"sm",className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:[n.jsx(ks,{className:"w-4 h-4 mr-1"}),"添加类型"]})]}),n.jsx(Pe,{children:n.jsxs(jo,{children:[n.jsx(So,{children:n.jsxs(zn,{className:"bg-[#0a1628] hover:bg-[#0a1628] border-gray-700",children:[n.jsx(et,{className:"text-gray-400",children:"图标"}),n.jsx(et,{className:"text-gray-400",children:"类型ID"}),n.jsx(et,{className:"text-gray-400",children:"显示名称"}),n.jsx(et,{className:"text-gray-400",children:"匹配标签"}),n.jsx(et,{className:"text-gray-400",children:"价格"}),n.jsx(et,{className:"text-gray-400",children:"数据库匹配"}),n.jsx(et,{className:"text-gray-400",children:"状态"}),n.jsx(et,{className:"text-right text-gray-400",children:"操作"})]})}),n.jsx(Co,{children:r.matchTypes.map(j=>n.jsxs(zn,{className:"hover:bg-[#0a1628] border-gray-700/50",children:[n.jsx(Ye,{children:n.jsx("span",{className:"text-2xl",children:j.icon})}),n.jsx(Ye,{className:"font-mono text-gray-300",children:j.id}),n.jsx(Ye,{className:"text-white font-medium",children:j.label}),n.jsx(Ye,{className:"text-gray-300",children:j.matchLabel}),n.jsx(Ye,{children:n.jsxs(Oe,{className:"bg-yellow-500/20 text-yellow-400 hover:bg-yellow-500/20 border-0",children:["¥",j.price]})}),n.jsx(Ye,{children:j.matchFromDB?n.jsx(Oe,{className:"bg-green-500/20 text-green-400 hover:bg-green-500/20 border-0",children:"是"}):n.jsx(Oe,{variant:"outline",className:"text-gray-500 border-gray-600",children:"否"})}),n.jsx(Ye,{children:n.jsx(rt,{checked:j.enabled,onCheckedChange:()=>C(j.id)})}),n.jsx(Ye,{className:"text-right",children:n.jsxs("div",{className:"flex items-center justify-end gap-1",children:[n.jsx(ye,{variant:"ghost",size:"sm",onClick:()=>k(j),className:"text-gray-400 hover:text-[#38bdac] hover:bg-[#38bdac]/10",children:n.jsx(Rs,{className:"w-4 h-4"})}),n.jsx(ye,{variant:"ghost",size:"sm",onClick:()=>y(j.id),className:"text-red-400 hover:text-red-300 hover:bg-red-500/10",children:n.jsx(fp,{className:"w-4 h-4"})})]})})]},j.id))})]})})]}),n.jsx(Ln,{open:f,onOpenChange:m,children:n.jsxs(Dn,{className:"bg-[#0f2137] border-gray-700 text-white max-w-lg",showCloseButton:!0,children:[n.jsx(On,{children:n.jsxs(Fn,{className:"text-white flex items-center gap-2",children:[p?n.jsx(Rs,{className:"w-5 h-5 text-[#38bdac]"}):n.jsx(ks,{className:"w-5 h-5 text-[#38bdac]"}),p?"编辑匹配类型":"添加匹配类型"]})}),n.jsxs("div",{className:"space-y-4 py-4",children:[n.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[n.jsxs("div",{className:"space-y-2",children:[n.jsx(te,{className:"text-gray-300",children:"类型ID(英文)"}),n.jsx(ae,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"如: partner",value:v.id,onChange:j=>w({...v,id:j.target.value}),disabled:!!p})]}),n.jsxs("div",{className:"space-y-2",children:[n.jsx(te,{className:"text-gray-300",children:"图标"}),n.jsx("div",{className:"flex gap-1 flex-wrap",children:TC.map(j=>n.jsx("button",{type:"button",className:`w-8 h-8 text-lg rounded ${v.icon===j?"bg-[#38bdac]/30 ring-1 ring-[#38bdac]":"bg-[#0a1628]"}`,onClick:()=>w({...v,icon:j}),children:j},j))})]})]}),n.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[n.jsxs("div",{className:"space-y-2",children:[n.jsx(te,{className:"text-gray-300",children:"显示名称"}),n.jsx(ae,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"如: 创业合伙",value:v.label,onChange:j=>w({...v,label:j.target.value})})]}),n.jsxs("div",{className:"space-y-2",children:[n.jsx(te,{className:"text-gray-300",children:"匹配标签"}),n.jsx(ae,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"如: 创业伙伴",value:v.matchLabel,onChange:j=>w({...v,matchLabel:j.target.value})})]})]}),n.jsxs("div",{className:"space-y-2",children:[n.jsx(te,{className:"text-gray-300",children:"单次匹配价格(元)"}),n.jsx(ae,{type:"number",min:.01,step:.01,className:"bg-[#0a1628] border-gray-700 text-white",value:v.price,onChange:j=>w({...v,price:parseFloat(j.target.value)||1})})]}),n.jsxs("div",{className:"flex gap-6 pt-2",children:[n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsx(rt,{checked:v.matchFromDB,onCheckedChange:j=>w({...v,matchFromDB:j})}),n.jsx(te,{className:"text-gray-300 text-sm",children:"从数据库匹配"})]}),n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsx(rt,{checked:v.showJoinAfterMatch,onCheckedChange:j=>w({...v,showJoinAfterMatch:j})}),n.jsx(te,{className:"text-gray-300 text-sm",children:"匹配后显示加入"})]}),n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsx(rt,{checked:v.enabled,onCheckedChange:j=>w({...v,enabled:j})}),n.jsx(te,{className:"text-gray-300 text-sm",children:"启用"})]})]})]}),n.jsxs(pr,{children:[n.jsx(ye,{variant:"outline",onClick:()=>m(!1),className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:"取消"}),n.jsxs(ye,{onClick:N,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:[n.jsx($n,{className:"w-4 h-4 mr-2"}),"保存"]})]})]})})]})}function AC(){return n.jsxs(Wv,{children:[n.jsx(yt,{path:"/login",element:n.jsx(Rb,{})}),n.jsxs(yt,{path:"/",element:n.jsx(A1,{}),children:[n.jsx(yt,{index:!0,element:n.jsx(Jh,{to:"/dashboard",replace:!0})}),n.jsx(yt,{path:"dashboard",element:n.jsx(Ib,{})}),n.jsx(yt,{path:"orders",element:n.jsx(Mb,{})}),n.jsx(yt,{path:"users",element:n.jsx(Vj,{})}),n.jsx(yt,{path:"distribution",element:n.jsx(Wj,{})}),n.jsx(yt,{path:"withdrawals",element:n.jsx(Hj,{})}),n.jsx(yt,{path:"content",element:n.jsx(qS,{})}),n.jsx(yt,{path:"chapters",element:n.jsx(JS,{})}),n.jsx(yt,{path:"referral-settings",element:n.jsx(vC,{})}),n.jsx(yt,{path:"settings",element:n.jsx(SC,{})}),n.jsx(yt,{path:"payment",element:n.jsx(CC,{})}),n.jsx(yt,{path:"site",element:n.jsx(PC,{})}),n.jsx(yt,{path:"qrcodes",element:n.jsx(RC,{})}),n.jsx(yt,{path:"match",element:n.jsx(IC,{})})]}),n.jsx(yt,{path:"*",element:n.jsx(Jh,{to:"/dashboard",replace:!0})})]})}Qy.createRoot(document.getElementById("root")).render(n.jsx(x.StrictMode,{children:n.jsx(qv,{children:n.jsx(AC,{})})}));
|