diff --git a/.cursor/README.md b/.cursor/README.md index 85e99036..9fdb20da 100644 --- a/.cursor/README.md +++ b/.cursor/README.md @@ -102,13 +102,13 @@ API 需操作数据库且 MCP 不可用? → 加载 SKILL-MySQL直接操作 |------|-------|----------| | 跨端协同 | SKILL-角色流程控制.md | 小程序/管理端/API 任一有功能开发且涉及多端时;流程图见 `.cursor/docs/角色协同流程图.html` | | 变更检查 | SKILL-变更关联检查.md、soul-change-checklist.mdc | **无论改哪端,改完必过** | -| **文档同步** | **SKILL-助理小风-文档同步.md** | **讨论完毕、记录内容、同步到开发文档时**;对应规则 `assistant-xiaofeng.mdc` | +| **文档同步** | **SKILL-助理橙子-文档同步.md** | **讨论完毕、记录内容、同步到开发文档时**;对应规则 `assistant-xiaofeng.mdc` | | next-project | SKILL-next-project仅预览.md | 编辑 next-project/ 或需区分线上后端时 | | 项目拆解 | SKILL-Next全栈拆解为前后端分离与小程序.md | 拆解 Next.js 全栈时;拆解前必读 SKILL-三端架构与框架分析.md | --- -**小橙(橙子/橙橙/🍊)**:当用户说小橙、橙子、橙橙、🍊、「讨论完毕」「记录一下」「同步到开发文档」等时,加载 **SKILL-助理小风-文档同步.md**,以小橙身份记录讨论要点并更新 `开发文档/`、`临时需求池/`,保持项目文档与讨论结论一致。 +**小橙(橙子/橙橙/🍊)**:当用户说小橙、橙子、橙橙、🍊、「讨论完毕」「记录一下」「同步到开发文档」等时,加载 **SKILL-助理橙子-文档同步.md**,以小橙身份记录讨论要点并更新 `开发文档/`、`临时需求池/`,保持项目文档与讨论结论一致。 **Skills 迭代**:Skills 会随 bug 修复与项目演进持续升级。修 bug 时若发现规则、流程或约定有遗漏或错误,应同步更新对应 Skill,避免同类问题复现。详见 `.cursor/docs/角色驱动Skills分析.md`。 diff --git a/.cursor/rules/soul-project-boundary.mdc b/.cursor/rules/soul-project-boundary.mdc index 6897f9d6..f1aa75b0 100644 --- a/.cursor/rules/soul-project-boundary.mdc +++ b/.cursor/rules/soul-project-boundary.mdc @@ -52,4 +52,4 @@ alwaysApply: true | 涉及「该接口给谁用」 | 先确定使用方再写/改代码,避免路径混用 | | **跨端功能开发** | 加载 **SKILL-角色流程控制.md**,按协同流程执行 | | **变更完成准备提交** | **必过** **soul-change-checklist.mdc** + **SKILL-变更关联检查.md**,未过即视为漏改 | -| **小橙/橙子/橙橙/🍊、讨论完毕、记录、同步文档** | 加载 **SKILL-助理小风-文档同步.md**,以小橙身份更新开发文档 | +| **小橙/橙子/橙橙/🍊、讨论完毕、记录、同步文档** | 加载 **SKILL-助理橙子-文档同步.md**,以小橙身份更新开发文档 | diff --git a/.cursor/skills/SKILL-API开发.md b/.cursor/skills/SKILL-API开发.md index 8554532d..63c764bd 100644 --- a/.cursor/skills/SKILL-API开发.md +++ b/.cursor/skills/SKILL-API开发.md @@ -42,6 +42,17 @@ description: Soul 创业派对后端 API 开发规范。在 soul-api/ 下编辑 - **Model**:所有表对应结构体在 `internal/model`,带 `gorm` 与 `json` 标签;不对外暴露字段用 `json:"-"`。 - **配置**:仅通过 `internal/config` 的 `Load()` 读环境变量;业务代码不直接 `os.Getenv`。 +### 3.2 新增表/字段完整流程(吸收 vip_roles 经验) + +| 步骤 | 动作 | +|------|------| +| 1 | 在 `internal/model/` 新建 `xxx.go`,定义结构体与 `TableName()` | +| 2 | 在 `internal/database/database.go` 中 `AutoMigrate(&model.Xxx{})` | +| 3 | 在 `soul-api/scripts/` 编写迁移 SQL(CREATE TABLE IF NOT EXISTS、ALTER TABLE ADD COLUMN、INSERT IGNORE 默认数据) | +| 4 | 新建 `internal/handler/xxx.go` 实现 CRUD(GET 列表、POST 新增、PUT 更新、DELETE 删除) | +| 5 | 在 `router.go` 的 `db` 组下注册:`db.GET("/xxx", handler.DBXxxList)`、`db.POST/PUT/DELETE("/xxx", handler.DBXxxAction)` | +| 6 | 部署前执行迁移脚本:`mysql -u user -p db < soul-api/scripts/add-xxx.sql` | + ## 3.1 依赖物尽其用(补充) | 依赖 | 用途 | 约定 | diff --git a/.cursor/skills/SKILL-MySQL直接操作.md b/.cursor/skills/SKILL-MySQL直接操作.md index b6ef8c9b..d6f813ec 100644 --- a/.cursor/skills/SKILL-MySQL直接操作.md +++ b/.cursor/skills/SKILL-MySQL直接操作.md @@ -99,7 +99,22 @@ MCP 配置参考:`开发文档/8、部署/Soul-MySQL-MCP配置说明.md`(连 ## 7. 与 soul-api 的配合 - 执行 `ALTER TABLE` 后,**必须**同步修改 `internal/model` 中的 GORM 结构体。 -- 迁移 SQL 建议放在 `soul-api/migrations/` 或项目内统一目录,便于版本管理。 +- 迁移 SQL 建议放在 `soul-api/scripts/` 或 `soul-api/migrations/`,便于版本管理。 + +--- + +## 8. 迁移脚本最佳实践(吸收 vip_roles 经验) + +新增表或字段时,编写可重复执行或幂等的 SQL 脚本: + +| 场景 | 写法 | 说明 | +|------|------|------| +| **新建表** | `CREATE TABLE IF NOT EXISTS xxx (...)` | 幂等,重复执行不报错 | +| **新增列** | `ALTER TABLE xxx ADD COLUMN yyy ...` | MySQL 不支持 IF NOT EXISTS,重复执行会报错;可单独执行或注释掉已执行部分 | +| **插入默认数据** | `INSERT IGNORE INTO xxx (name, sort) VALUES (...)` | 配合 `UNIQUE(name)` 防重复;不指定 id 让 AUTO_INCREMENT 生效 | +| **脚本位置** | `soul-api/scripts/add-xxx.sql` | 命名清晰,便于部署时按顺序执行 | + +**完整流程**:1) 编写 SQL 脚本 → 2) 在 `database.go` 中 `AutoMigrate(&model.Xxx{})` → 3) 同步修改 `internal/model` → 4) 部署前执行 `mysql -u user -p db < scripts/add-xxx.sql`。 --- diff --git a/.cursor/skills/SKILL-助理小风-文档同步.md b/.cursor/skills/SKILL-助理橙子-文档同步.md similarity index 100% rename from .cursor/skills/SKILL-助理小风-文档同步.md rename to .cursor/skills/SKILL-助理橙子-文档同步.md diff --git a/.cursor/skills/SKILL-变更关联检查.md b/.cursor/skills/SKILL-变更关联检查.md index 7a167728..a6eaf162 100644 --- a/.cursor/skills/SKILL-变更关联检查.md +++ b/.cursor/skills/SKILL-变更关联检查.md @@ -63,6 +63,7 @@ description: Soul 创业派对变更关联检查。miniprogram/soul-admin/soul-a | 章节/内容 | 目录、阅读、购买 | book/content、user 权限与进度 | 章节/内容 CRUD、配置 | | 找伙伴/匹配 | 匹配、展示 | match、ckb 等 miniprogram 接口 | 匹配配置、开关 | | 配置项 | 仅读取 | miniprogram/config 或 db/config | 配置编辑(admin/db) | +| VIP/超级个体 | 展示列表、详情 | miniprogram/vip/members;db/users PUT、db/vip-roles | 用户列表「设置 VIP」弹窗、VIP 角色管理页 | 每次做「某个功能」的变更时,问: diff --git a/.cursor/skills/SKILL-管理端开发.md b/.cursor/skills/SKILL-管理端开发.md index faa8de8b..56c1a76d 100644 --- a/.cursor/skills/SKILL-管理端开发.md +++ b/.cursor/skills/SKILL-管理端开发.md @@ -61,6 +61,15 @@ description: Soul 创业派对管理端开发规范。在 soul-admin/ 下编辑 **检查清单**:分页、搜索防抖、刷新、loading、空状态、错误条、仅 admin/db 路径。详见 `开发文档/列表标准与角色分工.md`。 +### 4.1 表单弹窗与「可选择+可手动填写」(吸收 SetVipModal 经验) + +当表单需支持「从预设选项选择」或「手动填写自定义值」时: + +- **下拉**:``,最终提交时取「选中项」或「自定义输入」; +- **独立弹窗**:功能入口在列表行操作按钮(如「设置 VIP」),点击打开独立 `XxxModal`,不塞进详情页,保持详情页纯粹; +- **路由与菜单**:新增管理页(如 VIP 角色)时,在 `App.tsx` 加 Route,在 `AdminLayout` 的 `menuItems` 加菜单项。 + --- ## 5. 业务逻辑约定(与 soul-api 对齐) diff --git a/soul-admin/dist/assets/index-BvA8RYip.js b/soul-admin/dist/assets/index-BvA8RYip.js new file mode 100644 index 00000000..23c458b8 --- /dev/null +++ b/soul-admin/dist/assets/index-BvA8RYip.js @@ -0,0 +1,455 @@ +function Wv(r,a){for(var l=0;li[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 u of c)if(u.type==="childList")for(const f of u.addedNodes)f.tagName==="LINK"&&f.rel==="modulepreload"&&i(f)}).observe(document,{childList:!0,subtree:!0});function l(c){const u={};return c.integrity&&(u.integrity=c.integrity),c.referrerPolicy&&(u.referrerPolicy=c.referrerPolicy),c.crossOrigin==="use-credentials"?u.credentials="include":c.crossOrigin==="anonymous"?u.credentials="omit":u.credentials="same-origin",u}function i(c){if(c.ep)return;c.ep=!0;const u=l(c);fetch(c.href,u)}})();function qm(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}var Tc={exports:{}},Pa={},Ic={exports:{}},Me={};/** + * @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 Vh;function Hv(){if(Vh)return Me;Vh=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"),u=Symbol.for("react.provider"),f=Symbol.for("react.context"),m=Symbol.for("react.forward_ref"),x=Symbol.for("react.suspense"),y=Symbol.for("react.memo"),g=Symbol.for("react.lazy"),v=Symbol.iterator;function P(E){return E===null||typeof E!="object"?null:(E=v&&E[v]||E["@@iterator"],typeof E=="function"?E:null)}var R={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},S=Object.assign,j={};function N(E,k,q){this.props=E,this.context=k,this.refs=j,this.updater=q||R}N.prototype.isReactComponent={},N.prototype.setState=function(E,k){if(typeof E!="object"&&typeof E!="function"&&E!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,E,k,"setState")},N.prototype.forceUpdate=function(E){this.updater.enqueueForceUpdate(this,E,"forceUpdate")};function C(){}C.prototype=N.prototype;function _(E,k,q){this.props=E,this.context=k,this.refs=j,this.updater=q||R}var b=_.prototype=new C;b.constructor=_,S(b,N.prototype),b.isPureReactComponent=!0;var I=Array.isArray,$=Object.prototype.hasOwnProperty,G={current:null},L={key:!0,ref:!0,__self:!0,__source:!0};function V(E,k,q){var J,he={},me=null,W=null;if(k!=null)for(J in k.ref!==void 0&&(W=k.ref),k.key!==void 0&&(me=""+k.key),k)$.call(k,J)&&!L.hasOwnProperty(J)&&(he[J]=k[J]);var ie=arguments.length-2;if(ie===1)he.children=q;else if(1>>1,k=A[E];if(0>>1;Ec(he,ne))mec(W,he)?(A[E]=W,A[me]=ne,E=me):(A[E]=he,A[J]=ne,E=J);else if(mec(W,ne))A[E]=W,A[me]=ne,E=me;else break e}}return Q}function c(A,Q){var ne=A.sortIndex-Q.sortIndex;return ne!==0?ne:A.id-Q.id}if(typeof performance=="object"&&typeof performance.now=="function"){var u=performance;r.unstable_now=function(){return u.now()}}else{var f=Date,m=f.now();r.unstable_now=function(){return f.now()-m}}var x=[],y=[],g=1,v=null,P=3,R=!1,S=!1,j=!1,N=typeof setTimeout=="function"?setTimeout:null,C=typeof clearTimeout=="function"?clearTimeout:null,_=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function b(A){for(var Q=l(y);Q!==null;){if(Q.callback===null)i(y);else if(Q.startTime<=A)i(y),Q.sortIndex=Q.expirationTime,a(x,Q);else break;Q=l(y)}}function I(A){if(j=!1,b(A),!S)if(l(x)!==null)S=!0,H($);else{var Q=l(y);Q!==null&&K(I,Q.startTime-A)}}function $(A,Q){S=!1,j&&(j=!1,C(V),V=-1),R=!0;var ne=P;try{for(b(Q),v=l(x);v!==null&&(!(v.expirationTime>Q)||A&&!oe());){var E=v.callback;if(typeof E=="function"){v.callback=null,P=v.priorityLevel;var k=E(v.expirationTime<=Q);Q=r.unstable_now(),typeof k=="function"?v.callback=k:v===l(x)&&i(x),b(Q)}else i(x);v=l(x)}if(v!==null)var q=!0;else{var J=l(y);J!==null&&K(I,J.startTime-Q),q=!1}return q}finally{v=null,P=ne,R=!1}}var G=!1,L=null,V=-1,te=5,de=-1;function oe(){return!(r.unstable_now()-deA||125E?(A.sortIndex=ne,a(y,A),l(x)===null&&A===l(y)&&(j?(C(V),V=-1):j=!0,K(I,ne-E))):(A.sortIndex=k,a(x,A),S||R||(S=!0,H($))),A},r.unstable_shouldYield=oe,r.unstable_wrapCallback=function(A){var Q=P;return function(){var ne=P;P=Q;try{return A.apply(this,arguments)}finally{P=ne}}}})(Lc)),Lc}var Gh;function Yv(){return Gh||(Gh=1,Mc.exports=Qv()),Mc.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 Qh;function qv(){if(Qh)return At;Qh=1;var r=Nd(),a=Yv();function l(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,s=1;s"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),x=Object.prototype.hasOwnProperty,y=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,g={},v={};function P(e){return x.call(v,e)?!0:x.call(g,e)?!1:y.test(e)?v[e]=!0:(g[e]=!0,!1)}function R(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 S(e,t,s,o){if(t===null||typeof t>"u"||R(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 j(e,t,s,o,d,h,w){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=o,this.attributeNamespace=d,this.mustUseProperty=s,this.propertyName=e,this.type=t,this.sanitizeURL=h,this.removeEmptyString=w}var N={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){N[e]=new j(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 j(t,1,!1,e[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(e){N[e]=new j(e,2,!1,e.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){N[e]=new j(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 j(e,3,!1,e.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(e){N[e]=new j(e,3,!0,e,null,!1,!1)}),["capture","download"].forEach(function(e){N[e]=new j(e,4,!1,e,null,!1,!1)}),["cols","rows","size","span"].forEach(function(e){N[e]=new j(e,6,!1,e,null,!1,!1)}),["rowSpan","start"].forEach(function(e){N[e]=new j(e,5,!1,e.toLowerCase(),null,!1,!1)});var C=/[\-:]([a-z])/g;function _(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(C,_);N[t]=new j(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(C,_);N[t]=new j(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(C,_);N[t]=new j(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(e){N[e]=new j(e,1,!1,e.toLowerCase(),null,!1,!1)}),N.xlinkHref=new j("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(e){N[e]=new j(e,1,!1,e.toLowerCase(),null,!0,!0)});function b(e,t,s,o){var d=N.hasOwnProperty(t)?N[t]:null;(d!==null?d.type!==0:o||!(2T||d[w]!==h[T]){var M=` +`+d[w].replace(" at new "," at ");return e.displayName&&M.includes("")&&(M=M.replace("",e.displayName)),M}while(1<=w&&0<=T);break}}}finally{q=!1,Error.prepareStackTrace=s}return(e=e?e.displayName||e.name:"")?k(e):""}function he(e){switch(e.tag){case 5:return k(e.type);case 16:return k("Lazy");case 13:return k("Suspense");case 19:return k("SuspenseList");case 0:case 2:case 15:return e=J(e.type,!1),e;case 11:return e=J(e.type.render,!1),e;case 1:return e=J(e.type,!0),e;default:return""}}function me(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 L:return"Fragment";case G:return"Portal";case te:return"Profiler";case V:return"StrictMode";case Y:return"Suspense";case B:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case oe:return(e.displayName||"Context")+".Consumer";case de:return(e._context.displayName||"Context")+".Provider";case ue:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case z:return t=e.displayName||null,t!==null?t:me(e.type)||"Memo";case H:t=e._payload,e=e._init;try{return me(e(t))}catch{}}return null}function W(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 me(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 ie(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function ce(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function pe(e){var t=ce(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 d=s.get,h=s.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return d.call(this)},set:function(w){o=""+w,h.call(this,w)}}),Object.defineProperty(e,t,{enumerable:s.enumerable}),{getValue:function(){return o},setValue:function(w){o=""+w},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Pe(e){e._valueTracker||(e._valueTracker=pe(e))}function _e(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var s=t.getValue(),o="";return e&&(o=ce(e)?e.checked?"true":"false":e.value),e=o,e!==s?(t.setValue(e),!0):!1}function at(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 yt(e,t){var s=t.checked;return ne({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:s??e._wrapperState.initialChecked})}function un(e,t){var s=t.defaultValue==null?"":t.defaultValue,o=t.checked!=null?t.checked:t.defaultChecked;s=ie(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 fn(e,t){t=t.checked,t!=null&&b(e,"checked",t,!1)}function Qt(e,t){fn(e,t);var s=ie(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")?hn(e,t.type,s):t.hasOwnProperty("defaultValue")&&hn(e,t.type,ie(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function br(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 hn(e,t,s){(t!=="number"||at(e.ownerDocument)!==e)&&(s==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+s&&(e.defaultValue=""+s))}var Nr=Array.isArray;function Vn(e,t,s,o){if(e=e.options,t){t={};for(var d=0;d"+t.valueOf().toString()+"",t=De.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function Yt(e,t){if(t){var s=e.firstChild;if(s&&s===e.lastChild&&s.nodeType===3){s.nodeValue=t;return}}e.textContent=t}var Sr={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},Qg=["Webkit","ms","Moz","O"];Object.keys(Sr).forEach(function(e){Qg.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Sr[t]=Sr[e]})});function nu(e,t,s){return t==null||typeof t=="boolean"||t===""?"":s||typeof t!="number"||t===0||Sr.hasOwnProperty(e)&&Sr[e]?(""+t).trim():t+"px"}function ru(e,t){e=e.style;for(var s in t)if(t.hasOwnProperty(s)){var o=s.indexOf("--")===0,d=nu(s,t[s],o);s==="float"&&(s="cssFloat"),o?e.setProperty(s,d):e[s]=d}}var Yg=ne({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 Uo(e,t){if(t){if(Yg[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 Wo(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 Ho=null;function Ko(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Go=null,Xr=null,Jr=null;function su(e){if(e=ha(e)){if(typeof Go!="function")throw Error(l(280));var t=e.stateNode;t&&(t=il(t),Go(e.stateNode,e.type,t))}}function au(e){Xr?Jr?Jr.push(e):Jr=[e]:Xr=e}function lu(){if(Xr){var e=Xr,t=Jr;if(Jr=Xr=null,su(e),t)for(e=0;e>>=0,e===0?32:31-(l0(e)/o0|0)|0}var Wa=64,Ha=4194304;function Ys(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 Ka(e,t){var s=e.pendingLanes;if(s===0)return 0;var o=0,d=e.suspendedLanes,h=e.pingedLanes,w=s&268435455;if(w!==0){var T=w&~d;T!==0?o=Ys(T):(h&=w,h!==0&&(o=Ys(h)))}else w=s&~d,w!==0?o=Ys(w):h!==0&&(o=Ys(h));if(o===0)return 0;if(t!==0&&t!==o&&(t&d)===0&&(d=o&-o,h=t&-t,d>=h||d===16&&(h&4194240)!==0))return t;if((o&4)!==0&&(o|=s&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=o;0s;s++)t.push(e);return t}function qs(e,t,s){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-qt(t),e[t]=s}function u0(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=sa),Mu=" ",Lu=!1;function Ou(e,t){switch(e){case"keyup":return z0.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Du(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var ts=!1;function B0(e,t){switch(e){case"compositionend":return Du(t);case"keypress":return t.which!==32?null:(Lu=!0,Mu);case"textInput":return e=t.data,e===Mu&&Lu?null:e;default:return null}}function V0(e,t){if(ts)return e==="compositionend"||!ui&&Ou(e,t)?(e=Pu(),Xa=ai=Gn=null,ts=!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)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=Wu(s)}}function Ku(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Ku(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Gu(){for(var e=window,t=at();t instanceof e.HTMLIFrameElement;){try{var s=typeof t.contentWindow.location.href=="string"}catch{s=!1}if(s)e=t.contentWindow;else break;t=at(e.document)}return t}function mi(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 X0(e){var t=Gu(),s=e.focusedElem,o=e.selectionRange;if(t!==s&&s&&s.ownerDocument&&Ku(s.ownerDocument.documentElement,s)){if(o!==null&&mi(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 d=s.textContent.length,h=Math.min(o.start,d);o=o.end===void 0?h:Math.min(o.end,d),!e.extend&&h>o&&(d=o,o=h,h=d),d=Hu(s,h);var w=Hu(s,o);d&&w&&(e.rangeCount!==1||e.anchorNode!==d.node||e.anchorOffset!==d.offset||e.focusNode!==w.node||e.focusOffset!==w.offset)&&(t=t.createRange(),t.setStart(d.node,d.offset),e.removeAllRanges(),h>o?(e.addRange(t),e.extend(w.node,w.offset)):(t.setEnd(w.node,w.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=document.documentMode,ns=null,pi=null,ia=null,xi=!1;function Qu(e,t,s){var o=s.window===s?s.document:s.nodeType===9?s:s.ownerDocument;xi||ns==null||ns!==at(o)||(o=ns,"selectionStart"in o&&mi(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}),ia&&oa(ia,o)||(ia=o,o=al(pi,"onSelect"),0os||(e.current=Pi[os],Pi[os]=null,os--)}function Ge(e,t){os++,Pi[os]=e.current,e.current=t}var Xn={},wt=qn(Xn),Pt=qn(!1),Er=Xn;function is(e,t){var s=e.type.contextTypes;if(!s)return Xn;var o=e.stateNode;if(o&&o.__reactInternalMemoizedUnmaskedChildContext===t)return o.__reactInternalMemoizedMaskedChildContext;var d={},h;for(h in s)d[h]=t[h];return o&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=d),d}function Rt(e){return e=e.childContextTypes,e!=null}function cl(){Ye(Pt),Ye(wt)}function df(e,t,s){if(wt.current!==Xn)throw Error(l(168));Ge(wt,t),Ge(Pt,s)}function uf(e,t,s){var o=e.stateNode;if(t=t.childContextTypes,typeof o.getChildContext!="function")return s;o=o.getChildContext();for(var d in o)if(!(d in t))throw Error(l(108,W(e)||"Unknown",d));return ne({},s,o)}function dl(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Xn,Er=wt.current,Ge(wt,e),Ge(Pt,Pt.current),!0}function ff(e,t,s){var o=e.stateNode;if(!o)throw Error(l(169));s?(e=uf(e,t,Er),o.__reactInternalMemoizedMergedChildContext=e,Ye(Pt),Ye(wt),Ge(wt,e)):Ye(Pt),Ge(Pt,s)}var Rn=null,ul=!1,Ri=!1;function hf(e){Rn===null?Rn=[e]:Rn.push(e)}function cv(e){ul=!0,hf(e)}function Jn(){if(!Ri&&Rn!==null){Ri=!0;var e=0,t=Ke;try{var s=Rn;for(Ke=1;e>=w,d-=w,_n=1<<32-qt(t)+d|s<Re?(mt=Ee,Ee=null):mt=Ee.sibling;var Ve=Z(D,Ee,F[Re],ae);if(Ve===null){Ee===null&&(Ee=mt);break}e&&Ee&&Ve.alternate===null&&t(D,Ee),O=h(Ve,O,Re),ke===null?Ne=Ve:ke.sibling=Ve,ke=Ve,Ee=mt}if(Re===F.length)return s(D,Ee),qe&&Rr(D,Re),Ne;if(Ee===null){for(;ReRe?(mt=Ee,Ee=null):mt=Ee.sibling;var or=Z(D,Ee,Ve.value,ae);if(or===null){Ee===null&&(Ee=mt);break}e&&Ee&&or.alternate===null&&t(D,Ee),O=h(or,O,Re),ke===null?Ne=or:ke.sibling=or,ke=or,Ee=mt}if(Ve.done)return s(D,Ee),qe&&Rr(D,Re),Ne;if(Ee===null){for(;!Ve.done;Re++,Ve=F.next())Ve=re(D,Ve.value,ae),Ve!==null&&(O=h(Ve,O,Re),ke===null?Ne=Ve:ke.sibling=Ve,ke=Ve);return qe&&Rr(D,Re),Ne}for(Ee=o(D,Ee);!Ve.done;Re++,Ve=F.next())Ve=fe(Ee,D,Re,Ve.value,ae),Ve!==null&&(e&&Ve.alternate!==null&&Ee.delete(Ve.key===null?Re:Ve.key),O=h(Ve,O,Re),ke===null?Ne=Ve:ke.sibling=Ve,ke=Ve);return e&&Ee.forEach(function(Uv){return t(D,Uv)}),qe&&Rr(D,Re),Ne}function nt(D,O,F,ae){if(typeof F=="object"&&F!==null&&F.type===L&&F.key===null&&(F=F.props.children),typeof F=="object"&&F!==null){switch(F.$$typeof){case $:e:{for(var Ne=F.key,ke=O;ke!==null;){if(ke.key===Ne){if(Ne=F.type,Ne===L){if(ke.tag===7){s(D,ke.sibling),O=d(ke,F.props.children),O.return=D,D=O;break e}}else if(ke.elementType===Ne||typeof Ne=="object"&&Ne!==null&&Ne.$$typeof===H&&yf(Ne)===ke.type){s(D,ke.sibling),O=d(ke,F.props),O.ref=ma(D,ke,F),O.return=D,D=O;break e}s(D,ke);break}else t(D,ke);ke=ke.sibling}F.type===L?(O=Dr(F.props.children,D.mode,ae,F.key),O.return=D,D=O):(ae=zl(F.type,F.key,F.props,null,D.mode,ae),ae.ref=ma(D,O,F),ae.return=D,D=ae)}return w(D);case G:e:{for(ke=F.key;O!==null;){if(O.key===ke)if(O.tag===4&&O.stateNode.containerInfo===F.containerInfo&&O.stateNode.implementation===F.implementation){s(D,O.sibling),O=d(O,F.children||[]),O.return=D,D=O;break e}else{s(D,O);break}else t(D,O);O=O.sibling}O=kc(F,D.mode,ae),O.return=D,D=O}return w(D);case H:return ke=F._init,nt(D,O,ke(F._payload),ae)}if(Nr(F))return ve(D,O,F,ae);if(Q(F))return je(D,O,F,ae);pl(D,F)}return typeof F=="string"&&F!==""||typeof F=="number"?(F=""+F,O!==null&&O.tag===6?(s(D,O.sibling),O=d(O,F),O.return=D,D=O):(s(D,O),O=Cc(F,D.mode,ae),O.return=D,D=O),w(D)):s(D,O)}return nt}var fs=wf(!0),jf=wf(!1),xl=qn(null),gl=null,hs=null,Li=null;function Oi(){Li=hs=gl=null}function Di(e){var t=xl.current;Ye(xl),e._currentValue=t}function Fi(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 ms(e,t){gl=e,Li=hs=null,e=e.dependencies,e!==null&&e.firstContext!==null&&((e.lanes&t)!==0&&(_t=!0),e.firstContext=null)}function Vt(e){var t=e._currentValue;if(Li!==e)if(e={context:e,memoizedValue:t,next:null},hs===null){if(gl===null)throw Error(l(308));hs=e,gl.dependencies={lanes:0,firstContext:e}}else hs=hs.next=e;return t}var _r=null;function zi(e){_r===null?_r=[e]:_r.push(e)}function bf(e,t,s,o){var d=t.interleaved;return d===null?(s.next=s,zi(t)):(s.next=d.next,d.next=s),t.interleaved=s,In(e,o)}function In(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 Zn=!1;function $i(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Nf(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 An(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function er(e,t,s){var o=e.updateQueue;if(o===null)return null;if(o=o.shared,($e&2)!==0){var d=o.pending;return d===null?t.next=t:(t.next=d.next,d.next=t),o.pending=t,In(e,s)}return d=o.interleaved,d===null?(t.next=t,zi(o)):(t.next=d.next,d.next=t),o.interleaved=t,In(e,s)}function vl(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,ei(e,s)}}function Sf(e,t){var s=e.updateQueue,o=e.alternate;if(o!==null&&(o=o.updateQueue,s===o)){var d=null,h=null;if(s=s.firstBaseUpdate,s!==null){do{var w={eventTime:s.eventTime,lane:s.lane,tag:s.tag,payload:s.payload,callback:s.callback,next:null};h===null?d=h=w:h=h.next=w,s=s.next}while(s!==null);h===null?d=h=t:h=h.next=t}else d=h=t;s={baseState:o.baseState,firstBaseUpdate:d,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 yl(e,t,s,o){var d=e.updateQueue;Zn=!1;var h=d.firstBaseUpdate,w=d.lastBaseUpdate,T=d.shared.pending;if(T!==null){d.shared.pending=null;var M=T,U=M.next;M.next=null,w===null?h=U:w.next=U,w=M;var ee=e.alternate;ee!==null&&(ee=ee.updateQueue,T=ee.lastBaseUpdate,T!==w&&(T===null?ee.firstBaseUpdate=U:T.next=U,ee.lastBaseUpdate=M))}if(h!==null){var re=d.baseState;w=0,ee=U=M=null,T=h;do{var Z=T.lane,fe=T.eventTime;if((o&Z)===Z){ee!==null&&(ee=ee.next={eventTime:fe,lane:0,tag:T.tag,payload:T.payload,callback:T.callback,next:null});e:{var ve=e,je=T;switch(Z=t,fe=s,je.tag){case 1:if(ve=je.payload,typeof ve=="function"){re=ve.call(fe,re,Z);break e}re=ve;break e;case 3:ve.flags=ve.flags&-65537|128;case 0:if(ve=je.payload,Z=typeof ve=="function"?ve.call(fe,re,Z):ve,Z==null)break e;re=ne({},re,Z);break e;case 2:Zn=!0}}T.callback!==null&&T.lane!==0&&(e.flags|=64,Z=d.effects,Z===null?d.effects=[T]:Z.push(T))}else fe={eventTime:fe,lane:Z,tag:T.tag,payload:T.payload,callback:T.callback,next:null},ee===null?(U=ee=fe,M=re):ee=ee.next=fe,w|=Z;if(T=T.next,T===null){if(T=d.shared.pending,T===null)break;Z=T,T=Z.next,Z.next=null,d.lastBaseUpdate=Z,d.shared.pending=null}}while(!0);if(ee===null&&(M=re),d.baseState=M,d.firstBaseUpdate=U,d.lastBaseUpdate=ee,t=d.shared.interleaved,t!==null){d=t;do w|=d.lane,d=d.next;while(d!==t)}else h===null&&(d.shared.lanes=0);Ar|=w,e.lanes=w,e.memoizedState=re}}function Cf(e,t,s){if(e=t.effects,t.effects=null,e!==null)for(t=0;ts?s:4,e(!0);var o=Hi.transition;Hi.transition={};try{e(!1),t()}finally{Ke=s,Hi.transition=o}}function Wf(){return Ut().memoizedState}function hv(e,t,s){var o=sr(e);if(s={lane:o,action:s,hasEagerState:!1,eagerState:null,next:null},Hf(e))Kf(t,s);else if(s=bf(e,t,s,o),s!==null){var d=kt();nn(s,e,o,d),Gf(s,t,o)}}function mv(e,t,s){var o=sr(e),d={lane:o,action:s,hasEagerState:!1,eagerState:null,next:null};if(Hf(e))Kf(t,d);else{var h=e.alternate;if(e.lanes===0&&(h===null||h.lanes===0)&&(h=t.lastRenderedReducer,h!==null))try{var w=t.lastRenderedState,T=h(w,s);if(d.hasEagerState=!0,d.eagerState=T,Xt(T,w)){var M=t.interleaved;M===null?(d.next=d,zi(t)):(d.next=M.next,M.next=d),t.interleaved=d;return}}catch{}finally{}s=bf(e,t,d,o),s!==null&&(d=kt(),nn(s,e,o,d),Gf(s,t,o))}}function Hf(e){var t=e.alternate;return e===Je||t!==null&&t===Je}function Kf(e,t){va=bl=!0;var s=e.pending;s===null?t.next=t:(t.next=s.next,s.next=t),e.pending=t}function Gf(e,t,s){if((s&4194240)!==0){var o=t.lanes;o&=e.pendingLanes,s|=o,t.lanes=s,ei(e,s)}}var Cl={readContext:Vt,useCallback:jt,useContext:jt,useEffect:jt,useImperativeHandle:jt,useInsertionEffect:jt,useLayoutEffect:jt,useMemo:jt,useReducer:jt,useRef:jt,useState:jt,useDebugValue:jt,useDeferredValue:jt,useTransition:jt,useMutableSource:jt,useSyncExternalStore:jt,useId:jt,unstable_isNewReconciler:!1},pv={readContext:Vt,useCallback:function(e,t){return gn().memoizedState=[e,t===void 0?null:t],e},useContext:Vt,useEffect:Of,useImperativeHandle:function(e,t,s){return s=s!=null?s.concat([e]):null,Nl(4194308,4,zf.bind(null,t,e),s)},useLayoutEffect:function(e,t){return Nl(4194308,4,e,t)},useInsertionEffect:function(e,t){return Nl(4,2,e,t)},useMemo:function(e,t){var s=gn();return t=t===void 0?null:t,e=e(),s.memoizedState=[e,t],e},useReducer:function(e,t,s){var o=gn();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=hv.bind(null,Je,e),[o.memoizedState,e]},useRef:function(e){var t=gn();return e={current:e},t.memoizedState=e},useState:Mf,useDebugValue:Ji,useDeferredValue:function(e){return gn().memoizedState=e},useTransition:function(){var e=Mf(!1),t=e[0];return e=fv.bind(null,e[1]),gn().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,s){var o=Je,d=gn();if(qe){if(s===void 0)throw Error(l(407));s=s()}else{if(s=t(),ht===null)throw Error(l(349));(Ir&30)!==0||Rf(o,t,s)}d.memoizedState=s;var h={value:s,getSnapshot:t};return d.queue=h,Of(Tf.bind(null,o,h,e),[e]),o.flags|=2048,ja(9,_f.bind(null,o,h,s,t),void 0,null),s},useId:function(){var e=gn(),t=ht.identifierPrefix;if(qe){var s=Tn,o=_n;s=(o&~(1<<32-qt(o)-1)).toString(32)+s,t=":"+t+"R"+s,s=ya++,0<\/script>",e=e.removeChild(e.firstChild)):typeof o.is=="string"?e=w.createElement(s,{is:o.is}):(e=w.createElement(s),s==="select"&&(w=e,o.multiple?w.multiple=!0:o.size&&(w.size=o.size))):e=w.createElementNS(e,s),e[pn]=t,e[fa]=o,hh(e,t,!1,!1),t.stateNode=e;e:{switch(w=Wo(s,o),s){case"dialog":Qe("cancel",e),Qe("close",e),d=o;break;case"iframe":case"object":case"embed":Qe("load",e),d=o;break;case"video":case"audio":for(d=0;dys&&(t.flags|=128,o=!0,ba(h,!1),t.lanes=4194304)}else{if(!o)if(e=wl(w),e!==null){if(t.flags|=128,o=!0,s=e.updateQueue,s!==null&&(t.updateQueue=s,t.flags|=4),ba(h,!0),h.tail===null&&h.tailMode==="hidden"&&!w.alternate&&!qe)return bt(t),null}else 2*tt()-h.renderingStartTime>ys&&s!==1073741824&&(t.flags|=128,o=!0,ba(h,!1),t.lanes=4194304);h.isBackwards?(w.sibling=t.child,t.child=w):(s=h.last,s!==null?s.sibling=w:t.child=w,h.last=w)}return h.tail!==null?(t=h.tail,h.rendering=t,h.tail=t.sibling,h.renderingStartTime=tt(),t.sibling=null,s=Xe.current,Ge(Xe,o?s&1|2:s&1),t):(bt(t),null);case 22:case 23:return bc(),o=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==o&&(t.flags|=8192),o&&(t.mode&1)!==0?(Dt&1073741824)!==0&&(bt(t),t.subtreeFlags&6&&(t.flags|=8192)):bt(t),null;case 24:return null;case 25:return null}throw Error(l(156,t.tag))}function Nv(e,t){switch(Ti(t),t.tag){case 1:return Rt(t.type)&&cl(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return ps(),Ye(Pt),Ye(wt),Wi(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 5:return Vi(t),null;case 13:if(Ye(Xe),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 Ye(Xe),null;case 4:return ps(),null;case 10:return Di(t.type._context),null;case 22:case 23:return bc(),null;case 24:return null;default:return null}}var Rl=!1,Nt=!1,Sv=typeof WeakSet=="function"?WeakSet:Set,xe=null;function gs(e,t){var s=e.ref;if(s!==null)if(typeof s=="function")try{s(null)}catch(o){et(e,t,o)}else s.current=null}function dc(e,t,s){try{s()}catch(o){et(e,t,o)}}var xh=!1;function Cv(e,t){if(bi=Ya,e=Gu(),mi(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 d=o.anchorOffset,h=o.focusNode;o=o.focusOffset;try{s.nodeType,h.nodeType}catch{s=null;break e}var w=0,T=-1,M=-1,U=0,ee=0,re=e,Z=null;t:for(;;){for(var fe;re!==s||d!==0&&re.nodeType!==3||(T=w+d),re!==h||o!==0&&re.nodeType!==3||(M=w+o),re.nodeType===3&&(w+=re.nodeValue.length),(fe=re.firstChild)!==null;)Z=re,re=fe;for(;;){if(re===e)break t;if(Z===s&&++U===d&&(T=w),Z===h&&++ee===o&&(M=w),(fe=re.nextSibling)!==null)break;re=Z,Z=re.parentNode}re=fe}s=T===-1||M===-1?null:{start:T,end:M}}else s=null}s=s||{start:0,end:0}}else s=null;for(Ni={focusedElem:e,selectionRange:s},Ya=!1,xe=t;xe!==null;)if(t=xe,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,xe=e;else for(;xe!==null;){t=xe;try{var ve=t.alternate;if((t.flags&1024)!==0)switch(t.tag){case 0:case 11:case 15:break;case 1:if(ve!==null){var je=ve.memoizedProps,nt=ve.memoizedState,D=t.stateNode,O=D.getSnapshotBeforeUpdate(t.elementType===t.type?je:Zt(t.type,je),nt);D.__reactInternalSnapshotBeforeUpdate=O}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(ae){et(t,t.return,ae)}if(e=t.sibling,e!==null){e.return=t.return,xe=e;break}xe=t.return}return ve=xh,xh=!1,ve}function Na(e,t,s){var o=t.updateQueue;if(o=o!==null?o.lastEffect:null,o!==null){var d=o=o.next;do{if((d.tag&e)===e){var h=d.destroy;d.destroy=void 0,h!==void 0&&dc(t,s,h)}d=d.next}while(d!==o)}}function _l(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 uc(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 gh(e){var t=e.alternate;t!==null&&(e.alternate=null,gh(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[pn],delete t[fa],delete t[Ei],delete t[ov],delete t[iv])),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 vh(e){return e.tag===5||e.tag===3||e.tag===4}function yh(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||vh(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 fc(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=ol));else if(o!==4&&(e=e.child,e!==null))for(fc(e,t,s),e=e.sibling;e!==null;)fc(e,t,s),e=e.sibling}function hc(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(hc(e,t,s),e=e.sibling;e!==null;)hc(e,t,s),e=e.sibling}var xt=null,en=!1;function tr(e,t,s){for(s=s.child;s!==null;)wh(e,t,s),s=s.sibling}function wh(e,t,s){if(mn&&typeof mn.onCommitFiberUnmount=="function")try{mn.onCommitFiberUnmount(Ua,s)}catch{}switch(s.tag){case 5:Nt||gs(s,t);case 6:var o=xt,d=en;xt=null,tr(e,t,s),xt=o,en=d,xt!==null&&(en?(e=xt,s=s.stateNode,e.nodeType===8?e.parentNode.removeChild(s):e.removeChild(s)):xt.removeChild(s.stateNode));break;case 18:xt!==null&&(en?(e=xt,s=s.stateNode,e.nodeType===8?ki(e.parentNode,s):e.nodeType===1&&ki(e,s),ta(e)):ki(xt,s.stateNode));break;case 4:o=xt,d=en,xt=s.stateNode.containerInfo,en=!0,tr(e,t,s),xt=o,en=d;break;case 0:case 11:case 14:case 15:if(!Nt&&(o=s.updateQueue,o!==null&&(o=o.lastEffect,o!==null))){d=o=o.next;do{var h=d,w=h.destroy;h=h.tag,w!==void 0&&((h&2)!==0||(h&4)!==0)&&dc(s,t,w),d=d.next}while(d!==o)}tr(e,t,s);break;case 1:if(!Nt&&(gs(s,t),o=s.stateNode,typeof o.componentWillUnmount=="function"))try{o.props=s.memoizedProps,o.state=s.memoizedState,o.componentWillUnmount()}catch(T){et(s,t,T)}tr(e,t,s);break;case 21:tr(e,t,s);break;case 22:s.mode&1?(Nt=(o=Nt)||s.memoizedState!==null,tr(e,t,s),Nt=o):tr(e,t,s);break;default:tr(e,t,s)}}function jh(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var s=e.stateNode;s===null&&(s=e.stateNode=new Sv),t.forEach(function(o){var d=Mv.bind(null,e,o);s.has(o)||(s.add(o),o.then(d,d))})}}function tn(e,t){var s=t.deletions;if(s!==null)for(var o=0;od&&(d=w),o&=~h}if(o=d,o=tt()-o,o=(120>o?120:480>o?480:1080>o?1080:1920>o?1920:3e3>o?3e3:4320>o?4320:1960*Ev(o/1960))-o,10e?16:e,rr===null)var o=!1;else{if(e=rr,rr=null,Ll=0,($e&6)!==0)throw Error(l(331));var d=$e;for($e|=4,xe=e.current;xe!==null;){var h=xe,w=h.child;if((xe.flags&16)!==0){var T=h.deletions;if(T!==null){for(var M=0;Mtt()-xc?Lr(e,0):pc|=s),It(e,t)}function Mh(e,t){t===0&&((e.mode&1)===0?t=1:(t=Ha,Ha<<=1,(Ha&130023424)===0&&(Ha=4194304)));var s=kt();e=In(e,t),e!==null&&(qs(e,t,s),It(e,s))}function Av(e){var t=e.memoizedState,s=0;t!==null&&(s=t.retryLane),Mh(e,s)}function Mv(e,t){var s=0;switch(e.tag){case 13:var o=e.stateNode,d=e.memoizedState;d!==null&&(s=d.retryLane);break;case 19:o=e.stateNode;break;default:throw Error(l(314))}o!==null&&o.delete(t),Mh(e,s)}var Lh;Lh=function(e,t,s){if(e!==null)if(e.memoizedProps!==t.pendingProps||Pt.current)_t=!0;else{if((e.lanes&s)===0&&(t.flags&128)===0)return _t=!1,jv(e,t,s);_t=(e.flags&131072)!==0}else _t=!1,qe&&(t.flags&1048576)!==0&&mf(t,hl,t.index);switch(t.lanes=0,t.tag){case 2:var o=t.type;Pl(e,t),e=t.pendingProps;var d=is(t,wt.current);ms(t,s),d=Gi(null,t,o,e,d,s);var h=Qi();return t.flags|=1,typeof d=="object"&&d!==null&&typeof d.render=="function"&&d.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,Rt(o)?(h=!0,dl(t)):h=!1,t.memoizedState=d.state!==null&&d.state!==void 0?d.state:null,$i(t),d.updater=kl,t.stateNode=d,d._reactInternals=t,ec(t,o,e,s),t=sc(null,t,o,!0,h,s)):(t.tag=0,qe&&h&&_i(t),Ct(null,t,d,s),t=t.child),t;case 16:o=t.elementType;e:{switch(Pl(e,t),e=t.pendingProps,d=o._init,o=d(o._payload),t.type=o,d=t.tag=Ov(o),e=Zt(o,e),d){case 0:t=rc(null,t,o,e,s);break e;case 1:t=oh(null,t,o,e,s);break e;case 11:t=nh(null,t,o,e,s);break e;case 14:t=rh(null,t,o,Zt(o.type,e),s);break e}throw Error(l(306,o,""))}return t;case 0:return o=t.type,d=t.pendingProps,d=t.elementType===o?d:Zt(o,d),rc(e,t,o,d,s);case 1:return o=t.type,d=t.pendingProps,d=t.elementType===o?d:Zt(o,d),oh(e,t,o,d,s);case 3:e:{if(ih(t),e===null)throw Error(l(387));o=t.pendingProps,h=t.memoizedState,d=h.element,Nf(e,t),yl(t,o,null,s);var w=t.memoizedState;if(o=w.element,h.isDehydrated)if(h={element:o,isDehydrated:!1,cache:w.cache,pendingSuspenseBoundaries:w.pendingSuspenseBoundaries,transitions:w.transitions},t.updateQueue.baseState=h,t.memoizedState=h,t.flags&256){d=xs(Error(l(423)),t),t=ch(e,t,o,s,d);break e}else if(o!==d){d=xs(Error(l(424)),t),t=ch(e,t,o,s,d);break e}else for(Ot=Yn(t.stateNode.containerInfo.firstChild),Lt=t,qe=!0,Jt=null,s=jf(t,null,o,s),t.child=s;s;)s.flags=s.flags&-3|4096,s=s.sibling;else{if(us(),o===d){t=Mn(e,t,s);break e}Ct(e,t,o,s)}t=t.child}return t;case 5:return kf(t),e===null&&Ai(t),o=t.type,d=t.pendingProps,h=e!==null?e.memoizedProps:null,w=d.children,Si(o,d)?w=null:h!==null&&Si(o,h)&&(t.flags|=32),lh(e,t),Ct(e,t,w,s),t.child;case 6:return e===null&&Ai(t),null;case 13:return dh(e,t,s);case 4:return Bi(t,t.stateNode.containerInfo),o=t.pendingProps,e===null?t.child=fs(t,null,o,s):Ct(e,t,o,s),t.child;case 11:return o=t.type,d=t.pendingProps,d=t.elementType===o?d:Zt(o,d),nh(e,t,o,d,s);case 7:return Ct(e,t,t.pendingProps,s),t.child;case 8:return Ct(e,t,t.pendingProps.children,s),t.child;case 12:return Ct(e,t,t.pendingProps.children,s),t.child;case 10:e:{if(o=t.type._context,d=t.pendingProps,h=t.memoizedProps,w=d.value,Ge(xl,o._currentValue),o._currentValue=w,h!==null)if(Xt(h.value,w)){if(h.children===d.children&&!Pt.current){t=Mn(e,t,s);break e}}else for(h=t.child,h!==null&&(h.return=t);h!==null;){var T=h.dependencies;if(T!==null){w=h.child;for(var M=T.firstContext;M!==null;){if(M.context===o){if(h.tag===1){M=An(-1,s&-s),M.tag=2;var U=h.updateQueue;if(U!==null){U=U.shared;var ee=U.pending;ee===null?M.next=M:(M.next=ee.next,ee.next=M),U.pending=M}}h.lanes|=s,M=h.alternate,M!==null&&(M.lanes|=s),Fi(h.return,s,t),T.lanes|=s;break}M=M.next}}else if(h.tag===10)w=h.type===t.type?null:h.child;else if(h.tag===18){if(w=h.return,w===null)throw Error(l(341));w.lanes|=s,T=w.alternate,T!==null&&(T.lanes|=s),Fi(w,s,t),w=h.sibling}else w=h.child;if(w!==null)w.return=h;else for(w=h;w!==null;){if(w===t){w=null;break}if(h=w.sibling,h!==null){h.return=w.return,w=h;break}w=w.return}h=w}Ct(e,t,d.children,s),t=t.child}return t;case 9:return d=t.type,o=t.pendingProps.children,ms(t,s),d=Vt(d),o=o(d),t.flags|=1,Ct(e,t,o,s),t.child;case 14:return o=t.type,d=Zt(o,t.pendingProps),d=Zt(o.type,d),rh(e,t,o,d,s);case 15:return sh(e,t,t.type,t.pendingProps,s);case 17:return o=t.type,d=t.pendingProps,d=t.elementType===o?d:Zt(o,d),Pl(e,t),t.tag=1,Rt(o)?(e=!0,dl(t)):e=!1,ms(t,s),Yf(t,o,d),ec(t,o,d,s),sc(null,t,o,!0,e,s);case 19:return fh(e,t,s);case 22:return ah(e,t,s)}throw Error(l(156,t.tag))};function Oh(e,t){return mu(e,t)}function Lv(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 Ht(e,t,s,o){return new Lv(e,t,s,o)}function Sc(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Ov(e){if(typeof e=="function")return Sc(e)?1:0;if(e!=null){if(e=e.$$typeof,e===ue)return 11;if(e===z)return 14}return 2}function lr(e,t){var s=e.alternate;return s===null?(s=Ht(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 zl(e,t,s,o,d,h){var w=2;if(o=e,typeof e=="function")Sc(e)&&(w=1);else if(typeof e=="string")w=5;else e:switch(e){case L:return Dr(s.children,d,h,t);case V:w=8,d|=8;break;case te:return e=Ht(12,s,t,d|2),e.elementType=te,e.lanes=h,e;case Y:return e=Ht(13,s,t,d),e.elementType=Y,e.lanes=h,e;case B:return e=Ht(19,s,t,d),e.elementType=B,e.lanes=h,e;case K:return $l(s,d,h,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case de:w=10;break e;case oe:w=9;break e;case ue:w=11;break e;case z:w=14;break e;case H:w=16,o=null;break e}throw Error(l(130,e==null?e:typeof e,""))}return t=Ht(w,s,t,d),t.elementType=e,t.type=o,t.lanes=h,t}function Dr(e,t,s,o){return e=Ht(7,e,o,t),e.lanes=s,e}function $l(e,t,s,o){return e=Ht(22,e,o,t),e.elementType=K,e.lanes=s,e.stateNode={isHidden:!1},e}function Cc(e,t,s){return e=Ht(6,e,null,t),e.lanes=s,e}function kc(e,t,s){return t=Ht(4,e.children!==null?e.children:[],e.key,t),t.lanes=s,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function Dv(e,t,s,o,d){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=Zo(0),this.expirationTimes=Zo(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Zo(0),this.identifierPrefix=o,this.onRecoverableError=d,this.mutableSourceEagerHydrationData=null}function Ec(e,t,s,o,d,h,w,T,M){return e=new Dv(e,t,s,T,M),t===1?(t=1,h===!0&&(t|=8)):t=0,h=Ht(3,null,null,t),e.current=h,h.stateNode=e,h.memoizedState={element:o,isDehydrated:s,cache:null,transitions:null,pendingSuspenseBoundaries:null},$i(h),e}function Fv(e,t,s){var o=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(r)}catch(a){console.error(a)}}return r(),Ac.exports=qv(),Ac.exports}var qh;function Xv(){if(qh)return Gl;qh=1;var r=Xm();return Gl.createRoot=r.createRoot,Gl.hydrateRoot=r.hydrateRoot,Gl}var Jv=Xv(),La=Xm();const Zv=qm(La);/** + * @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 Ta(){return Ta=Object.assign?Object.assign.bind():function(r){for(var a=1;a"u")throw new Error(a)}function Sd(r,a){if(!r){typeof console<"u"&&console.warn(a);try{throw new Error(a)}catch{}}}function ty(){return Math.random().toString(36).substr(2,8)}function Jh(r,a){return{usr:r.state,key:r.key,idx:a}}function Jc(r,a,l,i){return l===void 0&&(l=null),Ta({pathname:typeof r=="string"?r:r.pathname,search:"",hash:""},typeof a=="string"?Ts(a):a,{state:l,key:a&&a.key||i||ty()})}function co(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 Ts(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 ny(r,a,l,i){i===void 0&&(i={});let{window:c=document.defaultView,v5Compat:u=!1}=i,f=c.history,m=fr.Pop,x=null,y=g();y==null&&(y=0,f.replaceState(Ta({},f.state,{idx:y}),""));function g(){return(f.state||{idx:null}).idx}function v(){m=fr.Pop;let N=g(),C=N==null?null:N-y;y=N,x&&x({action:m,location:j.location,delta:C})}function P(N,C){m=fr.Push;let _=Jc(j.location,N,C);y=g()+1;let b=Jh(_,y),I=j.createHref(_);try{f.pushState(b,"",I)}catch($){if($ instanceof DOMException&&$.name==="DataCloneError")throw $;c.location.assign(I)}u&&x&&x({action:m,location:j.location,delta:1})}function R(N,C){m=fr.Replace;let _=Jc(j.location,N,C);y=g();let b=Jh(_,y),I=j.createHref(_);f.replaceState(b,"",I),u&&x&&x({action:m,location:j.location,delta:0})}function S(N){let C=c.location.origin!=="null"?c.location.origin:c.location.href,_=typeof N=="string"?N:co(N);return _=_.replace(/ $/,"%20"),st(C,"No window.location.(origin|href) available to create URL for href: "+_),new URL(_,C)}let j={get action(){return m},get location(){return r(c,f)},listen(N){if(x)throw new Error("A history only accepts one active listener");return c.addEventListener(Xh,v),x=N,()=>{c.removeEventListener(Xh,v),x=null}},createHref(N){return a(c,N)},createURL:S,encodeLocation(N){let C=S(N);return{pathname:C.pathname,search:C.search,hash:C.hash}},push:P,replace:R,go(N){return f.go(N)}};return j}var Zh;(function(r){r.data="data",r.deferred="deferred",r.redirect="redirect",r.error="error"})(Zh||(Zh={}));function ry(r,a,l){return l===void 0&&(l="/"),sy(r,a,l)}function sy(r,a,l,i){let c=typeof a=="string"?Ts(a):a,u=Cd(c.pathname||"/",l);if(u==null)return null;let f=Jm(r);ay(f);let m=null;for(let x=0;m==null&&x{let x={relativePath:m===void 0?u.path||"":m,caseSensitive:u.caseSensitive===!0,childrenIndex:f,route:u};x.relativePath.startsWith("/")&&(st(x.relativePath.startsWith(i),'Absolute route path "'+x.relativePath+'" nested under path '+('"'+i+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),x.relativePath=x.relativePath.slice(i.length));let y=hr([i,x.relativePath]),g=l.concat(x);u.children&&u.children.length>0&&(st(u.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+y+'".')),Jm(u.children,a,g,y)),!(u.path==null&&!u.index)&&a.push({path:y,score:fy(y,u.index),routesMeta:g})};return r.forEach((u,f)=>{var m;if(u.path===""||!((m=u.path)!=null&&m.includes("?")))c(u,f);else for(let x of Zm(u.path))c(u,f,x)}),a}function Zm(r){let a=r.split("/");if(a.length===0)return[];let[l,...i]=a,c=l.endsWith("?"),u=l.replace(/\?$/,"");if(i.length===0)return c?[u,""]:[u];let f=Zm(i.join("/")),m=[];return m.push(...f.map(x=>x===""?u:[u,x].join("/"))),c&&m.push(...f),m.map(x=>r.startsWith("/")&&x===""?"/":x)}function ay(r){r.sort((a,l)=>a.score!==l.score?l.score-a.score:hy(a.routesMeta.map(i=>i.childrenIndex),l.routesMeta.map(i=>i.childrenIndex)))}const ly=/^:[\w-]+$/,oy=3,iy=2,cy=1,dy=10,uy=-2,em=r=>r==="*";function fy(r,a){let l=r.split("/"),i=l.length;return l.some(em)&&(i+=uy),a&&(i+=iy),l.filter(c=>!em(c)).reduce((c,u)=>c+(ly.test(u)?oy:u===""?cy:dy),i)}function hy(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 my(r,a,l){let{routesMeta:i}=r,c={},u="/",f=[];for(let m=0;m{let{paramName:P,isOptional:R}=g;if(P==="*"){let j=m[v]||"";f=u.slice(0,u.length-j.length).replace(/(.)\/+$/,"$1")}const S=m[v];return R&&!S?y[P]=void 0:y[P]=(S||"").replace(/%2F/g,"/"),y},{}),pathname:u,pathnameBase:f,pattern:r}}function xy(r,a,l){a===void 0&&(a=!1),l===void 0&&(l=!0),Sd(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,x)=>(i.push({paramName:m,isOptional:x!=null}),x?"/?([^\\/]+)?":"/([^\\/]+)"));return r.endsWith("*")?(i.push({paramName:"*"}),c+=r==="*"||r==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):l?c+="\\/*$":r!==""&&r!=="/"&&(c+="(?:(?=\\/|$))"),[new RegExp(c,a?void 0:"i"),i]}function gy(r){try{return r.split("/").map(a=>decodeURIComponent(a).replace(/\//g,"%2F")).join("/")}catch(a){return Sd(!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 Cd(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 vy=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,yy=r=>vy.test(r);function wy(r,a){a===void 0&&(a="/");let{pathname:l,search:i="",hash:c=""}=typeof r=="string"?Ts(r):r,u;if(l)if(yy(l))u=l;else{if(l.includes("//")){let f=l;l=l.replace(/\/\/+/g,"/"),Sd(!1,"Pathnames cannot have embedded double slashes - normalizing "+(f+" -> "+l))}l.startsWith("/")?u=tm(l.substring(1),"/"):u=tm(l,a)}else u=a;return{pathname:u,search:Ny(i),hash:Sy(c)}}function tm(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 Oc(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 and the router will parse it for you.'}function jy(r){return r.filter((a,l)=>l===0||a.route.path&&a.route.path.length>0)}function kd(r,a){let l=jy(r);return a?l.map((i,c)=>c===l.length-1?i.pathname:i.pathnameBase):l.map(i=>i.pathnameBase)}function Ed(r,a,l,i){i===void 0&&(i=!1);let c;typeof r=="string"?c=Ts(r):(c=Ta({},r),st(!c.pathname||!c.pathname.includes("?"),Oc("?","pathname","search",c)),st(!c.pathname||!c.pathname.includes("#"),Oc("#","pathname","hash",c)),st(!c.search||!c.search.includes("#"),Oc("#","search","hash",c)));let u=r===""||c.pathname==="",f=u?"/":c.pathname,m;if(f==null)m=l;else{let v=a.length-1;if(!i&&f.startsWith("..")){let P=f.split("/");for(;P[0]==="..";)P.shift(),v-=1;c.pathname=P.join("/")}m=v>=0?a[v]:"/"}let x=wy(c,m),y=f&&f!=="/"&&f.endsWith("/"),g=(u||f===".")&&l.endsWith("/");return!x.pathname.endsWith("/")&&(y||g)&&(x.pathname+="/"),x}const hr=r=>r.join("/").replace(/\/\/+/g,"/"),by=r=>r.replace(/\/+$/,"").replace(/^\/*/,"/"),Ny=r=>!r||r==="?"?"":r.startsWith("?")?r:"?"+r,Sy=r=>!r||r==="#"?"":r.startsWith("#")?r:"#"+r;function Cy(r){return r!=null&&typeof r.status=="number"&&typeof r.statusText=="string"&&typeof r.internal=="boolean"&&"data"in r}const ep=["post","put","patch","delete"];new Set(ep);const ky=["get",...ep];new Set(ky);/** + * 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 Ia(){return Ia=Object.assign?Object.assign.bind():function(r){for(var a=1;a{m.current=!0}),p.useCallback(function(y,g){if(g===void 0&&(g={}),!m.current)return;if(typeof y=="number"){i.go(y);return}let v=Ed(y,JSON.parse(f),u,g.relative==="path");r==null&&a!=="/"&&(v.pathname=v.pathname==="/"?a:hr([a,v.pathname])),(g.replace?i.replace:i.push)(v,g.state,g)},[a,i,f,u,r])}const _y=p.createContext(null);function Ty(r){let a=p.useContext(Bn).outlet;return a&&p.createElement(_y.Provider,{value:r},a)}function rp(r,a){let{relative:l}=a===void 0?{}:a,{future:i}=p.useContext(vr),{matches:c}=p.useContext(Bn),{pathname:u}=Yr(),f=JSON.stringify(kd(c,i.v7_relativeSplatPath));return p.useMemo(()=>Ed(r,JSON.parse(f),u,l==="path"),[r,f,u,l])}function Iy(r,a){return Ay(r,a)}function Ay(r,a,l,i){Is()||st(!1);let{navigator:c}=p.useContext(vr),{matches:u}=p.useContext(Bn),f=u[u.length-1],m=f?f.params:{};f&&f.pathname;let x=f?f.pathnameBase:"/";f&&f.route;let y=Yr(),g;if(a){var v;let N=typeof a=="string"?Ts(a):a;x==="/"||(v=N.pathname)!=null&&v.startsWith(x)||st(!1),g=N}else g=y;let P=g.pathname||"/",R=P;if(x!=="/"){let N=x.replace(/^\//,"").split("/");R="/"+P.replace(/^\//,"").split("/").slice(N.length).join("/")}let S=ry(r,{pathname:R}),j=Fy(S&&S.map(N=>Object.assign({},N,{params:Object.assign({},m,N.params),pathname:hr([x,c.encodeLocation?c.encodeLocation(N.pathname).pathname:N.pathname]),pathnameBase:N.pathnameBase==="/"?x:hr([x,c.encodeLocation?c.encodeLocation(N.pathnameBase).pathname:N.pathnameBase])})),u,l,i);return a&&j?p.createElement(So.Provider,{value:{location:Ia({pathname:"/",search:"",hash:"",state:null,key:"default"},g),navigationType:fr.Pop}},j):j}function My(){let r=Vy(),a=Cy(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 p.createElement(p.Fragment,null,p.createElement("h2",null,"Unexpected Application Error!"),p.createElement("h3",{style:{fontStyle:"italic"}},a),l?p.createElement("pre",{style:c},l):null,null)}const Ly=p.createElement(My,null);class Oy extends p.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?p.createElement(Bn.Provider,{value:this.props.routeContext},p.createElement(tp.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function Dy(r){let{routeContext:a,match:l,children:i}=r,c=p.useContext(Pd);return c&&c.static&&c.staticContext&&(l.route.errorElement||l.route.ErrorBoundary)&&(c.staticContext._deepestRenderedBoundaryId=l.route.id),p.createElement(Bn.Provider,{value:a},i)}function Fy(r,a,l,i){var c;if(a===void 0&&(a=[]),l===void 0&&(l=null),i===void 0&&(i=null),r==null){var u;if(!l)return null;if(l.errors)r=l.matches;else if((u=i)!=null&&u.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 g=f.findIndex(v=>v.route.id&&(m==null?void 0:m[v.route.id])!==void 0);g>=0||st(!1),f=f.slice(0,Math.min(f.length,g+1))}let x=!1,y=-1;if(l&&i&&i.v7_partialHydration)for(let g=0;g=0?f=f.slice(0,y+1):f=[f[0]];break}}}return f.reduceRight((g,v,P)=>{let R,S=!1,j=null,N=null;l&&(R=m&&v.route.id?m[v.route.id]:void 0,j=v.route.errorElement||Ly,x&&(y<0&&P===0?(Wy("route-fallback"),S=!0,N=null):y===P&&(S=!0,N=v.route.hydrateFallbackElement||null)));let C=a.concat(f.slice(0,P+1)),_=()=>{let b;return R?b=j:S?b=N:v.route.Component?b=p.createElement(v.route.Component,null):v.route.element?b=v.route.element:b=g,p.createElement(Dy,{match:v,routeContext:{outlet:g,matches:C,isDataRoute:l!=null},children:b})};return l&&(v.route.ErrorBoundary||v.route.errorElement||P===0)?p.createElement(Oy,{location:l.location,revalidation:l.revalidation,component:j,error:R,children:_(),routeContext:{outlet:null,matches:C,isDataRoute:!0}}):_()},null)}var sp=(function(r){return r.UseBlocker="useBlocker",r.UseRevalidator="useRevalidator",r.UseNavigateStable="useNavigate",r})(sp||{}),ap=(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})(ap||{});function zy(r){let a=p.useContext(Pd);return a||st(!1),a}function $y(r){let a=p.useContext(Ey);return a||st(!1),a}function By(r){let a=p.useContext(Bn);return a||st(!1),a}function lp(r){let a=By(),l=a.matches[a.matches.length-1];return l.route.id||st(!1),l.route.id}function Vy(){var r;let a=p.useContext(tp),l=$y(),i=lp();return a!==void 0?a:(r=l.errors)==null?void 0:r[i]}function Uy(){let{router:r}=zy(sp.UseNavigateStable),a=lp(ap.UseNavigateStable),l=p.useRef(!1);return np(()=>{l.current=!0}),p.useCallback(function(c,u){u===void 0&&(u={}),l.current&&(typeof c=="number"?r.navigate(c):r.navigate(c,Ia({fromRouteId:a},u)))},[r,a])}const nm={};function Wy(r,a,l){nm[r]||(nm[r]=!0)}function Hy(r,a){r==null||r.v7_startTransition,r==null||r.v7_relativeSplatPath}function Ky(r){let{to:a,replace:l,state:i,relative:c}=r;Is()||st(!1);let{future:u,static:f}=p.useContext(vr),{matches:m}=p.useContext(Bn),{pathname:x}=Yr(),y=Oa(),g=Ed(a,kd(m,u.v7_relativeSplatPath),x,c==="path"),v=JSON.stringify(g);return p.useEffect(()=>y(JSON.parse(v),{replace:l,state:i,relative:c}),[y,v,c,l,i]),null}function Gy(r){return Ty(r.context)}function rt(r){st(!1)}function Qy(r){let{basename:a="/",children:l=null,location:i,navigationType:c=fr.Pop,navigator:u,static:f=!1,future:m}=r;Is()&&st(!1);let x=a.replace(/^\/*/,"/"),y=p.useMemo(()=>({basename:x,navigator:u,static:f,future:Ia({v7_relativeSplatPath:!1},m)}),[x,m,u,f]);typeof i=="string"&&(i=Ts(i));let{pathname:g="/",search:v="",hash:P="",state:R=null,key:S="default"}=i,j=p.useMemo(()=>{let N=Cd(g,x);return N==null?null:{location:{pathname:N,search:v,hash:P,state:R,key:S},navigationType:c}},[x,g,v,P,R,S,c]);return j==null?null:p.createElement(vr.Provider,{value:y},p.createElement(So.Provider,{children:l,value:j}))}function Yy(r){let{children:a,location:l}=r;return Iy(Zc(a),l)}new Promise(()=>{});function Zc(r,a){a===void 0&&(a=[]);let l=[];return p.Children.forEach(r,(i,c)=>{if(!p.isValidElement(i))return;let u=[...a,c];if(i.type===p.Fragment){l.push.apply(l,Zc(i.props.children,u));return}i.type!==rt&&st(!1),!i.props.index||!i.props.children||st(!1);let f={id:i.props.id||u.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=Zc(i.props.children,u)),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 ed(){return ed=Object.assign?Object.assign.bind():function(r){for(var a=1;a=0)&&(l[c]=r[c]);return l}function Xy(r){return!!(r.metaKey||r.altKey||r.ctrlKey||r.shiftKey)}function Jy(r,a){return r.button===0&&(!a||a==="_self")&&!Xy(r)}const Zy=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","viewTransition"],ew="6";try{window.__reactRouterVersion=ew}catch{}const tw="startTransition",rm=No[tw];function nw(r){let{basename:a,children:l,future:i,window:c}=r,u=p.useRef();u.current==null&&(u.current=ey({window:c,v5Compat:!0}));let f=u.current,[m,x]=p.useState({action:f.action,location:f.location}),{v7_startTransition:y}=i||{},g=p.useCallback(v=>{y&&rm?rm(()=>x(v)):x(v)},[x,y]);return p.useLayoutEffect(()=>f.listen(g),[f,g]),p.useEffect(()=>Hy(i),[i]),p.createElement(Qy,{basename:a,children:l,location:m.location,navigationType:m.action,navigator:f,future:i})}const rw=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",sw=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,op=p.forwardRef(function(a,l){let{onClick:i,relative:c,reloadDocument:u,replace:f,state:m,target:x,to:y,preventScrollReset:g,viewTransition:v}=a,P=qy(a,Zy),{basename:R}=p.useContext(vr),S,j=!1;if(typeof y=="string"&&sw.test(y)&&(S=y,rw))try{let b=new URL(window.location.href),I=y.startsWith("//")?new URL(b.protocol+y):new URL(y),$=Cd(I.pathname,R);I.origin===b.origin&&$!=null?y=$+I.search+I.hash:j=!0}catch{}let N=Py(y,{relative:c}),C=aw(y,{replace:f,state:m,target:x,preventScrollReset:g,relative:c,viewTransition:v});function _(b){i&&i(b),b.defaultPrevented||C(b)}return p.createElement("a",ed({},P,{href:S||N,onClick:j||u?i:_,ref:l,target:x}))});var sm;(function(r){r.UseScrollRestoration="useScrollRestoration",r.UseSubmit="useSubmit",r.UseSubmitFetcher="useSubmitFetcher",r.UseFetcher="useFetcher",r.useViewTransitionState="useViewTransitionState"})(sm||(sm={}));var am;(function(r){r.UseFetcher="useFetcher",r.UseFetchers="useFetchers",r.UseScrollRestoration="useScrollRestoration"})(am||(am={}));function aw(r,a){let{target:l,replace:i,state:c,preventScrollReset:u,relative:f,viewTransition:m}=a===void 0?{}:a,x=Oa(),y=Yr(),g=rp(r,{relative:f});return p.useCallback(v=>{if(Jy(v,l)){v.preventDefault();let P=i!==void 0?i:co(y)===co(g);x(r,{replace:P,state:c,preventScrollReset:u,relative:f,viewTransition:m})}},[y,x,g,i,c,l,r,u,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 lw=r=>r.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),ow=r=>r.replace(/^([A-Z])|[\s-_]+(\w)/g,(a,l,i)=>i?i.toUpperCase():l.toLowerCase()),lm=r=>{const a=ow(r);return a.charAt(0).toUpperCase()+a.slice(1)},ip=(...r)=>r.filter((a,l,i)=>!!a&&a.trim()!==""&&i.indexOf(a)===l).join(" ").trim(),iw=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 cw={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 dw=p.forwardRef(({color:r="currentColor",size:a=24,strokeWidth:l=2,absoluteStrokeWidth:i,className:c="",children:u,iconNode:f,...m},x)=>p.createElement("svg",{ref:x,...cw,width:a,height:a,stroke:r,strokeWidth:i?Number(l)*24/Number(a):l,className:ip("lucide",c),...!u&&!iw(m)&&{"aria-hidden":"true"},...m},[...f.map(([y,g])=>p.createElement(y,g)),...Array.isArray(u)?u:[u]]));/** + * @license lucide-react v0.562.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const be=(r,a)=>{const l=p.forwardRef(({className:i,...c},u)=>p.createElement(dw,{ref:u,iconNode:a,className:ip(`lucide-${lw(lm(r))}`,`lucide-${r}`,i),...c}));return l.displayName=lm(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 uw=[["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"}]],om=be("bitcoin",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 fw=[["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",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:"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"}]],td=be("calendar",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 mw=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],Co=be("check",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 pw=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],cp=be("chevron-down",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=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],dp=be("chevron-right",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=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],vw=be("chevron-up",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"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]],ww=be("circle-alert",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 jw=[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]],nd=be("circle-check-big",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 bw=[["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"}]],up=be("circle-question-mark",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=[["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"}]],im=be("circle-user",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 Sw=[["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"}]],Cw=be("circle-x",Sw);/** + * @license lucide-react v0.562.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 6v6l4 2",key:"mmk7yg"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],fp=be("clock",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=[["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"}]],hp=be("copy",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 Pw=[["rect",{width:"20",height:"14",x:"2",y:"5",rx:"2",key:"ynyp8z"}],["line",{x1:"2",x2:"22",y1:"10",y2:"10",key:"1b3vmo"}]],rd=be("credit-card",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:"M11.562 3.266a.5.5 0 0 1 .876 0L15.39 8.87a1 1 0 0 0 1.516.294L21.183 5.5a.5.5 0 0 1 .798.519l-2.834 10.246a1 1 0 0 1-.956.734H5.81a1 1 0 0 1-.957-.734L2.02 6.02a.5.5 0 0 1 .798-.519l4.276 3.664a1 1 0 0 0 1.516-.294z",key:"1vdc57"}],["path",{d:"M5 21h14",key:"11awu3"}]],ko=be("crown",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 _w=[["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"}]],uo=be("dollar-sign",_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 Tw=[["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"}]],Iw=be("download",Tw);/** + * @license lucide-react v0.562.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=[["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"}]],fo=be("external-link",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:"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"}]],Rd=be("eye",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=[["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"}]],Ow=be("file-text",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 Dw=[["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"}]],Fw=be("funnel",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 zw=[["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"}]],cm=be("gift",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 $w=[["circle",{cx:"18",cy:"18",r:"3",key:"1xkwt0"}],["circle",{cx:"6",cy:"6",r:"3",key:"1lh9wr"}],["path",{d:"M6 21V9a9 9 0 0 0 9 9",key:"7kw0sc"}]],Bw=be("git-merge",$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 Vw=[["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"}]],sd=be("globe",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 Uw=[["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"}]],dm=be("history",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 Ww=[["path",{d:"M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8",key:"5wwlr5"}],["path",{d:"M3 10a2 2 0 0 1 .709-1.528l7-6a2 2 0 0 1 2.582 0l7 6A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z",key:"r6nss1"}]],Hw=be("house",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 Kw=[["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"}]],Gw=be("image",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 Qw=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],Ql=be("info",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 Yw=[["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"}]],um=be("key",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=[["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"}]],Xw=be("layout-dashboard",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 Jw=[["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"}]],zr=be("link-2",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 Zw=[["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"}]],fm=be("link",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 e1=[["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"}]],t1=be("lock",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 n1=[["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"}]],r1=be("log-out",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:"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"}]],a1=be("map-pin",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:"M4 5h16",key:"1tepv9"}],["path",{d:"M4 12h16",key:"1lakjw"}],["path",{d:"M4 19h16",key:"1djgab"}]],o1=be("menu",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 i1=[["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"}]],c1=be("message-circle",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 d1=[["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"}]],u1=be("palette",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:"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"}]],Ur=be("pen-line",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 h1=[["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"}]],m1=be("percent",h1);/** + * @license lucide-react v0.562.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const p1=[["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"}]],x1=be("phone",p1);/** + * @license lucide-react v0.562.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=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],$r=be("plus",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 v1=[["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"}]],hm=be("qr-code",v1);/** + * @license lucide-react v0.562.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:"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",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:"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"}]],an=be("save",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 j1=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],Br=be("search",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 b1=[["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"}]],ho=be("settings",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:"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"}]],S1=be("settings-2",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 C1=[["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"}]],k1=be("shield-check",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 E1=[["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"}]],ad=be("shopping-bag",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 P1=[["rect",{width:"14",height:"20",x:"5",y:"2",rx:"2",ry:"2",key:"1yt0o3"}],["path",{d:"M12 18h.01",key:"mhygvu"}]],ld=be("smartphone",P1);/** + * @license lucide-react v0.562.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const R1=[["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"}]],_1=be("tag",R1);/** + * @license lucide-react v0.562.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:"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"}]],Eo=be("trash-2",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 I1=[["path",{d:"M16 7h6v6",key:"box55l"}],["path",{d:"m22 7-8.5 8.5-5-5L2 17",key:"1t1m79"}]],od=be("trending-up",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 A1=[["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"}]],mm=be("upload",A1);/** + * @license lucide-react v0.562.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:"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"}]],pm=be("user-plus",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 L1=[["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"}]],ro=be("user",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=[["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"}]],Cn=be("users",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 D1=[["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"}]],Rs=be("wallet",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:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],Fn=be("x",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 z1=[["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"}]],$1=be("zap",z1),_d="admin_token";function B1(){try{return localStorage.getItem(_d)}catch{return null}}function V1(r){try{localStorage.setItem(_d,r)}catch{}}function U1(){try{localStorage.removeItem(_d)}catch{}}const W1="https://soulapi.quwanzhi.com",H1=()=>{const r="https://soulapi.quwanzhi.com";return r.length>0?r.replace(/\/$/,""):W1};function mp(r){const a=H1(),l=r.startsWith("/")?r:`/${r}`;return a?`${a}${l}`:l}async function Po(r,a={}){const{data:l,...i}=a,c=mp(r),u=new Headers(i.headers),f=B1();f&&u.set("Authorization",`Bearer ${f}`),l!=null&&!u.has("Content-Type")&&u.set("Content-Type","application/json");const m=l!=null?JSON.stringify(l):i.body,x=await fetch(c,{...i,headers:u,body:m,credentials:"include"}),g=(x.headers.get("Content-Type")||"").includes("application/json")?await x.json():x;if(!x.ok){const v=new Error((g==null?void 0:g.error)||`HTTP ${x.status}`);throw v.status=x.status,v.data=g,v}return g}function Ue(r,a){return Po(r,{...a,method:"GET"})}function vt(r,a,l){return Po(r,{...l,method:"POST",data:a})}function ln(r,a,l){return Po(r,{...l,method:"PUT",data:a})}function Td(r,a){return Po(r,{...a,method:"DELETE"})}const K1=[{icon:Xw,label:"数据概览",href:"/dashboard"},{icon:Ps,label:"内容管理",href:"/content"},{icon:Cn,label:"用户管理",href:"/users"},{icon:ko,label:"VIP 角色",href:"/vip-roles"},{icon:Rs,label:"交易中心",href:"/distribution"},{icon:Bw,label:"匹配记录",href:"/match-records"},{icon:rd,label:"推广设置",href:"/referral-settings"},{icon:ho,label:"系统设置",href:"/settings"}];function G1(){const r=Yr(),a=Oa(),[l,i]=p.useState(!1),[c,u]=p.useState(!1);p.useEffect(()=>{i(!0)},[]),p.useEffect(()=>{if(!l)return;u(!1);let m=!1;return Ue("/api/admin").then(x=>{m||(x&&x.success!==!1?u(!0):a("/login",{replace:!0}))}).catch(()=>{m||a("/login",{replace:!0})}),()=>{m=!0}},[l,a]);const f=async()=>{U1();try{await vt("/api/admin/logout",{})}catch{}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:K1.map(m=>{const x=r.pathname===m.href;return n.jsxs(op,{to:m.href,className:`flex items-center gap-3 px-4 py-3 rounded-lg transition-colors ${x?"bg-[#38bdac]/20 text-[#38bdac] font-medium":"text-gray-400 hover:bg-gray-700/50 hover:text-white"}`,children:[n.jsx(m.icon,{className:"w-5 h-5"}),n.jsx("span",{className:"text-sm",children:m.label})]},m.href)})}),n.jsx("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(r1,{className:"w-5 h-5"}),n.jsx("span",{className:"text-sm",children:"退出登录"})]})})]}),n.jsx("div",{className:"flex-1 overflow-auto bg-[#0a1628]",children:n.jsx(Gy,{})})]})}function xm(r,a){if(typeof r=="function")return r(a);r!=null&&(r.current=a)}function Id(...r){return a=>{let l=!1;const i=r.map(c=>{const u=xm(c,a);return!l&&typeof u=="function"&&(l=!0),u});if(l)return()=>{for(let c=0;c{let{children:u,...f}=i;pp(u)&&typeof mo=="function"&&(u=mo(u._payload));const m=p.Children.toArray(u),x=m.find(J1);if(x){const y=x.props.children,g=m.map(v=>v===x?p.Children.count(y)>1?p.Children.only(null):p.isValidElement(y)?y.props.children:null:v);return n.jsx(a,{...f,ref:c,children:p.isValidElement(y)?p.cloneElement(y,void 0,g):null})}return n.jsx(a,{...f,ref:c,children:u})});return l.displayName=`${r}.Slot`,l}var gp=xp("Slot");function q1(r){const a=p.forwardRef((l,i)=>{let{children:c,...u}=l;if(pp(c)&&typeof mo=="function"&&(c=mo(c._payload)),p.isValidElement(c)){const f=ej(c),m=Z1(u,c.props);return c.type!==p.Fragment&&(m.ref=i?Id(i,f):f),p.cloneElement(c,m)}return p.Children.count(c)>1?p.Children.only(null):null});return a.displayName=`${r}.SlotClone`,a}var X1=Symbol("radix.slottable");function J1(r){return p.isValidElement(r)&&typeof r.type=="function"&&"__radixId"in r.type&&r.type.__radixId===X1}function Z1(r,a){const l={...a};for(const i in a){const c=r[i],u=a[i];/^on[A-Z]/.test(i)?c&&u?l[i]=(...m)=>{const x=u(...m);return c(...m),x}:c&&(l[i]=c):i==="style"?l[i]={...c,...u}:i==="className"&&(l[i]=[c,u].filter(Boolean).join(" "))}return{...r,...l}}function ej(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 vp(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;atypeof r=="boolean"?`${r}`:r===0?"0":r,vm=yp,wp=(r,a)=>l=>{var i;if((a==null?void 0:a.variants)==null)return vm(r,l==null?void 0:l.class,l==null?void 0:l.className);const{variants:c,defaultVariants:u}=a,f=Object.keys(c).map(y=>{const g=l==null?void 0:l[y],v=u==null?void 0:u[y];if(g===null)return null;const P=gm(g)||gm(v);return c[y][P]}),m=l&&Object.entries(l).reduce((y,g)=>{let[v,P]=g;return P===void 0||(y[v]=P),y},{}),x=a==null||(i=a.compoundVariants)===null||i===void 0?void 0:i.reduce((y,g)=>{let{class:v,className:P,...R}=g;return Object.entries(R).every(S=>{let[j,N]=S;return Array.isArray(N)?N.includes({...u,...m}[j]):{...u,...m}[j]===N})?[...y,v,P]:y},[]);return vm(r,f,x,l==null?void 0:l.class,l==null?void 0:l.className)},tj=(r,a)=>{const l=new Array(r.length+a.length);for(let i=0;i({classGroupId:r,validator:a}),jp=(r=new Map,a=null,l)=>({nextPart:r,validators:a,classGroupId:l}),po="-",ym=[],rj="arbitrary..",sj=r=>{const a=lj(r),{conflictingClassGroups:l,conflictingClassGroupModifiers:i}=r;return{getClassGroupId:f=>{if(f.startsWith("[")&&f.endsWith("]"))return aj(f);const m=f.split(po),x=m[0]===""&&m.length>1?1:0;return bp(m,x,a)},getConflictingClassGroupIds:(f,m)=>{if(m){const x=i[f],y=l[f];return x?y?tj(y,x):x:y||ym}return l[f]||ym}}},bp=(r,a,l)=>{if(r.length-a===0)return l.classGroupId;const c=r[a],u=l.nextPart.get(c);if(u){const y=bp(r,a+1,u);if(y)return y}const f=l.validators;if(f===null)return;const m=a===0?r.join(po):r.slice(a).join(po),x=f.length;for(let y=0;yr.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const a=r.slice(1,-1),l=a.indexOf(":"),i=a.slice(0,l);return i?rj+i:void 0})(),lj=r=>{const{theme:a,classGroups:l}=r;return oj(l,a)},oj=(r,a)=>{const l=jp();for(const i in r){const c=r[i];Ad(c,l,i,a)}return l},Ad=(r,a,l,i)=>{const c=r.length;for(let u=0;u{if(typeof r=="string"){cj(r,a,l);return}if(typeof r=="function"){dj(r,a,l,i);return}uj(r,a,l,i)},cj=(r,a,l)=>{const i=r===""?a:Np(a,r);i.classGroupId=l},dj=(r,a,l,i)=>{if(fj(r)){Ad(r(i),a,l,i);return}a.validators===null&&(a.validators=[]),a.validators.push(nj(l,r))},uj=(r,a,l,i)=>{const c=Object.entries(r),u=c.length;for(let f=0;f{let l=r;const i=a.split(po),c=i.length;for(let u=0;u"isThemeGetter"in r&&r.isThemeGetter===!0,hj=r=>{if(r<1)return{get:()=>{},set:()=>{}};let a=0,l=Object.create(null),i=Object.create(null);const c=(u,f)=>{l[u]=f,a++,a>r&&(a=0,i=l,l=Object.create(null))};return{get(u){let f=l[u];if(f!==void 0)return f;if((f=i[u])!==void 0)return c(u,f),f},set(u,f){u in l?l[u]=f:c(u,f)}}},id="!",wm=":",mj=[],jm=(r,a,l,i,c)=>({modifiers:r,hasImportantModifier:a,baseClassName:l,maybePostfixModifierPosition:i,isExternal:c}),pj=r=>{const{prefix:a,experimentalParseClassName:l}=r;let i=c=>{const u=[];let f=0,m=0,x=0,y;const g=c.length;for(let j=0;jx?y-x:void 0;return jm(u,R,P,S)};if(a){const c=a+wm,u=i;i=f=>f.startsWith(c)?u(f.slice(c.length)):jm(mj,!1,f,void 0,!0)}if(l){const c=i;i=u=>l({className:u,parseClassName:c})}return i},xj=r=>{const a=new Map;return r.orderSensitiveModifiers.forEach((l,i)=>{a.set(l,1e6+i)}),l=>{const i=[];let c=[];for(let u=0;u0&&(c.sort(),i.push(...c),c=[]),i.push(f)):c.push(f)}return c.length>0&&(c.sort(),i.push(...c)),i}},gj=r=>({cache:hj(r.cacheSize),parseClassName:pj(r),sortModifiers:xj(r),...sj(r)}),vj=/\s+/,yj=(r,a)=>{const{parseClassName:l,getClassGroupId:i,getConflictingClassGroupIds:c,sortModifiers:u}=a,f=[],m=r.trim().split(vj);let x="";for(let y=m.length-1;y>=0;y-=1){const g=m[y],{isExternal:v,modifiers:P,hasImportantModifier:R,baseClassName:S,maybePostfixModifierPosition:j}=l(g);if(v){x=g+(x.length>0?" "+x:x);continue}let N=!!j,C=i(N?S.substring(0,j):S);if(!C){if(!N){x=g+(x.length>0?" "+x:x);continue}if(C=i(S),!C){x=g+(x.length>0?" "+x:x);continue}N=!1}const _=P.length===0?"":P.length===1?P[0]:u(P).join(":"),b=R?_+id:_,I=b+C;if(f.indexOf(I)>-1)continue;f.push(I);const $=c(C,N);for(let G=0;G<$.length;++G){const L=$[G];f.push(b+L)}x=g+(x.length>0?" "+x:x)}return x},wj=(...r)=>{let a=0,l,i,c="";for(;a{if(typeof r=="string")return r;let a,l="";for(let i=0;i{let l,i,c,u;const f=x=>{const y=a.reduce((g,v)=>v(g),r());return l=gj(y),i=l.cache.get,c=l.cache.set,u=m,m(x)},m=x=>{const y=i(x);if(y)return y;const g=yj(x,l);return c(x,g),g};return u=f,(...x)=>u(wj(...x))},bj=[],ut=r=>{const a=l=>l[r]||bj;return a.isThemeGetter=!0,a},Cp=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,kp=/^\((?:(\w[\w-]*):)?(.+)\)$/i,Nj=/^\d+\/\d+$/,Sj=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Cj=/\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$/,kj=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,Ej=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Pj=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,js=r=>Nj.test(r),Ie=r=>!!r&&!Number.isNaN(Number(r)),ir=r=>!!r&&Number.isInteger(Number(r)),Dc=r=>r.endsWith("%")&&Ie(r.slice(0,-1)),On=r=>Sj.test(r),Rj=()=>!0,_j=r=>Cj.test(r)&&!kj.test(r),Ep=()=>!1,Tj=r=>Ej.test(r),Ij=r=>Pj.test(r),Aj=r=>!ye(r)&&!we(r),Mj=r=>As(r,_p,Ep),ye=r=>Cp.test(r),Fr=r=>As(r,Tp,_j),Fc=r=>As(r,zj,Ie),bm=r=>As(r,Pp,Ep),Lj=r=>As(r,Rp,Ij),Yl=r=>As(r,Ip,Tj),we=r=>kp.test(r),Ra=r=>Ms(r,Tp),Oj=r=>Ms(r,$j),Nm=r=>Ms(r,Pp),Dj=r=>Ms(r,_p),Fj=r=>Ms(r,Rp),ql=r=>Ms(r,Ip,!0),As=(r,a,l)=>{const i=Cp.exec(r);return i?i[1]?a(i[1]):l(i[2]):!1},Ms=(r,a,l=!1)=>{const i=kp.exec(r);return i?i[1]?a(i[1]):l:!1},Pp=r=>r==="position"||r==="percentage",Rp=r=>r==="image"||r==="url",_p=r=>r==="length"||r==="size"||r==="bg-size",Tp=r=>r==="length",zj=r=>r==="number",$j=r=>r==="family-name",Ip=r=>r==="shadow",Bj=()=>{const r=ut("color"),a=ut("font"),l=ut("text"),i=ut("font-weight"),c=ut("tracking"),u=ut("leading"),f=ut("breakpoint"),m=ut("container"),x=ut("spacing"),y=ut("radius"),g=ut("shadow"),v=ut("inset-shadow"),P=ut("text-shadow"),R=ut("drop-shadow"),S=ut("blur"),j=ut("perspective"),N=ut("aspect"),C=ut("ease"),_=ut("animate"),b=()=>["auto","avoid","all","avoid-page","page","left","right","column"],I=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],$=()=>[...I(),we,ye],G=()=>["auto","hidden","clip","visible","scroll"],L=()=>["auto","contain","none"],V=()=>[we,ye,x],te=()=>[js,"full","auto",...V()],de=()=>[ir,"none","subgrid",we,ye],oe=()=>["auto",{span:["full",ir,we,ye]},ir,we,ye],ue=()=>[ir,"auto",we,ye],Y=()=>["auto","min","max","fr",we,ye],B=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],z=()=>["start","end","center","stretch","center-safe","end-safe"],H=()=>["auto",...V()],K=()=>[js,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...V()],A=()=>[r,we,ye],Q=()=>[...I(),Nm,bm,{position:[we,ye]}],ne=()=>["no-repeat",{repeat:["","x","y","space","round"]}],E=()=>["auto","cover","contain",Dj,Mj,{size:[we,ye]}],k=()=>[Dc,Ra,Fr],q=()=>["","none","full",y,we,ye],J=()=>["",Ie,Ra,Fr],he=()=>["solid","dashed","dotted","double"],me=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],W=()=>[Ie,Dc,Nm,bm],ie=()=>["","none",S,we,ye],ce=()=>["none",Ie,we,ye],pe=()=>["none",Ie,we,ye],Pe=()=>[Ie,we,ye],_e=()=>[js,"full",...V()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[On],breakpoint:[On],color:[Rj],container:[On],"drop-shadow":[On],ease:["in","out","in-out"],font:[Aj],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[On],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[On],shadow:[On],spacing:["px",Ie],text:[On],"text-shadow":[On],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",js,ye,we,N]}],container:["container"],columns:[{columns:[Ie,ye,we,m]}],"break-after":[{"break-after":b()}],"break-before":[{"break-before":b()}],"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:$()}],overflow:[{overflow:G()}],"overflow-x":[{"overflow-x":G()}],"overflow-y":[{"overflow-y":G()}],overscroll:[{overscroll:L()}],"overscroll-x":[{"overscroll-x":L()}],"overscroll-y":[{"overscroll-y":L()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:te()}],"inset-x":[{"inset-x":te()}],"inset-y":[{"inset-y":te()}],start:[{start:te()}],end:[{end:te()}],top:[{top:te()}],right:[{right:te()}],bottom:[{bottom:te()}],left:[{left:te()}],visibility:["visible","invisible","collapse"],z:[{z:[ir,"auto",we,ye]}],basis:[{basis:[js,"full","auto",m,...V()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[Ie,js,"auto","initial","none",ye]}],grow:[{grow:["",Ie,we,ye]}],shrink:[{shrink:["",Ie,we,ye]}],order:[{order:[ir,"first","last","none",we,ye]}],"grid-cols":[{"grid-cols":de()}],"col-start-end":[{col:oe()}],"col-start":[{"col-start":ue()}],"col-end":[{"col-end":ue()}],"grid-rows":[{"grid-rows":de()}],"row-start-end":[{row:oe()}],"row-start":[{"row-start":ue()}],"row-end":[{"row-end":ue()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":Y()}],"auto-rows":[{"auto-rows":Y()}],gap:[{gap:V()}],"gap-x":[{"gap-x":V()}],"gap-y":[{"gap-y":V()}],"justify-content":[{justify:[...B(),"normal"]}],"justify-items":[{"justify-items":[...z(),"normal"]}],"justify-self":[{"justify-self":["auto",...z()]}],"align-content":[{content:["normal",...B()]}],"align-items":[{items:[...z(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...z(),{baseline:["","last"]}]}],"place-content":[{"place-content":B()}],"place-items":[{"place-items":[...z(),"baseline"]}],"place-self":[{"place-self":["auto",...z()]}],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:H()}],mx:[{mx:H()}],my:[{my:H()}],ms:[{ms:H()}],me:[{me:H()}],mt:[{mt:H()}],mr:[{mr:H()}],mb:[{mb:H()}],ml:[{ml:H()}],"space-x":[{"space-x":V()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":V()}],"space-y-reverse":["space-y-reverse"],size:[{size:K()}],w:[{w:[m,"screen",...K()]}],"min-w":[{"min-w":[m,"screen","none",...K()]}],"max-w":[{"max-w":[m,"screen","none","prose",{screen:[f]},...K()]}],h:[{h:["screen","lh",...K()]}],"min-h":[{"min-h":["screen","lh","none",...K()]}],"max-h":[{"max-h":["screen","lh",...K()]}],"font-size":[{text:["base",l,Ra,Fr]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[i,we,Fc]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",Dc,ye]}],"font-family":[{font:[Oj,ye,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,we,ye]}],"line-clamp":[{"line-clamp":[Ie,"none",we,Fc]}],leading:[{leading:[u,...V()]}],"list-image":[{"list-image":["none",we,ye]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",we,ye]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:A()}],"text-color":[{text:A()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...he(),"wavy"]}],"text-decoration-thickness":[{decoration:[Ie,"from-font","auto",we,Fr]}],"text-decoration-color":[{decoration:A()}],"underline-offset":[{"underline-offset":[Ie,"auto",we,ye]}],"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",we,ye]}],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",we,ye]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:Q()}],"bg-repeat":[{bg:ne()}],"bg-size":[{bg:E()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},ir,we,ye],radial:["",we,ye],conic:[ir,we,ye]},Fj,Lj]}],"bg-color":[{bg:A()}],"gradient-from-pos":[{from:k()}],"gradient-via-pos":[{via:k()}],"gradient-to-pos":[{to:k()}],"gradient-from":[{from:A()}],"gradient-via":[{via:A()}],"gradient-to":[{to:A()}],rounded:[{rounded:q()}],"rounded-s":[{"rounded-s":q()}],"rounded-e":[{"rounded-e":q()}],"rounded-t":[{"rounded-t":q()}],"rounded-r":[{"rounded-r":q()}],"rounded-b":[{"rounded-b":q()}],"rounded-l":[{"rounded-l":q()}],"rounded-ss":[{"rounded-ss":q()}],"rounded-se":[{"rounded-se":q()}],"rounded-ee":[{"rounded-ee":q()}],"rounded-es":[{"rounded-es":q()}],"rounded-tl":[{"rounded-tl":q()}],"rounded-tr":[{"rounded-tr":q()}],"rounded-br":[{"rounded-br":q()}],"rounded-bl":[{"rounded-bl":q()}],"border-w":[{border:J()}],"border-w-x":[{"border-x":J()}],"border-w-y":[{"border-y":J()}],"border-w-s":[{"border-s":J()}],"border-w-e":[{"border-e":J()}],"border-w-t":[{"border-t":J()}],"border-w-r":[{"border-r":J()}],"border-w-b":[{"border-b":J()}],"border-w-l":[{"border-l":J()}],"divide-x":[{"divide-x":J()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":J()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...he(),"hidden","none"]}],"divide-style":[{divide:[...he(),"hidden","none"]}],"border-color":[{border:A()}],"border-color-x":[{"border-x":A()}],"border-color-y":[{"border-y":A()}],"border-color-s":[{"border-s":A()}],"border-color-e":[{"border-e":A()}],"border-color-t":[{"border-t":A()}],"border-color-r":[{"border-r":A()}],"border-color-b":[{"border-b":A()}],"border-color-l":[{"border-l":A()}],"divide-color":[{divide:A()}],"outline-style":[{outline:[...he(),"none","hidden"]}],"outline-offset":[{"outline-offset":[Ie,we,ye]}],"outline-w":[{outline:["",Ie,Ra,Fr]}],"outline-color":[{outline:A()}],shadow:[{shadow:["","none",g,ql,Yl]}],"shadow-color":[{shadow:A()}],"inset-shadow":[{"inset-shadow":["none",v,ql,Yl]}],"inset-shadow-color":[{"inset-shadow":A()}],"ring-w":[{ring:J()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:A()}],"ring-offset-w":[{"ring-offset":[Ie,Fr]}],"ring-offset-color":[{"ring-offset":A()}],"inset-ring-w":[{"inset-ring":J()}],"inset-ring-color":[{"inset-ring":A()}],"text-shadow":[{"text-shadow":["none",P,ql,Yl]}],"text-shadow-color":[{"text-shadow":A()}],opacity:[{opacity:[Ie,we,ye]}],"mix-blend":[{"mix-blend":[...me(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":me()}],"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":[Ie]}],"mask-image-linear-from-pos":[{"mask-linear-from":W()}],"mask-image-linear-to-pos":[{"mask-linear-to":W()}],"mask-image-linear-from-color":[{"mask-linear-from":A()}],"mask-image-linear-to-color":[{"mask-linear-to":A()}],"mask-image-t-from-pos":[{"mask-t-from":W()}],"mask-image-t-to-pos":[{"mask-t-to":W()}],"mask-image-t-from-color":[{"mask-t-from":A()}],"mask-image-t-to-color":[{"mask-t-to":A()}],"mask-image-r-from-pos":[{"mask-r-from":W()}],"mask-image-r-to-pos":[{"mask-r-to":W()}],"mask-image-r-from-color":[{"mask-r-from":A()}],"mask-image-r-to-color":[{"mask-r-to":A()}],"mask-image-b-from-pos":[{"mask-b-from":W()}],"mask-image-b-to-pos":[{"mask-b-to":W()}],"mask-image-b-from-color":[{"mask-b-from":A()}],"mask-image-b-to-color":[{"mask-b-to":A()}],"mask-image-l-from-pos":[{"mask-l-from":W()}],"mask-image-l-to-pos":[{"mask-l-to":W()}],"mask-image-l-from-color":[{"mask-l-from":A()}],"mask-image-l-to-color":[{"mask-l-to":A()}],"mask-image-x-from-pos":[{"mask-x-from":W()}],"mask-image-x-to-pos":[{"mask-x-to":W()}],"mask-image-x-from-color":[{"mask-x-from":A()}],"mask-image-x-to-color":[{"mask-x-to":A()}],"mask-image-y-from-pos":[{"mask-y-from":W()}],"mask-image-y-to-pos":[{"mask-y-to":W()}],"mask-image-y-from-color":[{"mask-y-from":A()}],"mask-image-y-to-color":[{"mask-y-to":A()}],"mask-image-radial":[{"mask-radial":[we,ye]}],"mask-image-radial-from-pos":[{"mask-radial-from":W()}],"mask-image-radial-to-pos":[{"mask-radial-to":W()}],"mask-image-radial-from-color":[{"mask-radial-from":A()}],"mask-image-radial-to-color":[{"mask-radial-to":A()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":I()}],"mask-image-conic-pos":[{"mask-conic":[Ie]}],"mask-image-conic-from-pos":[{"mask-conic-from":W()}],"mask-image-conic-to-pos":[{"mask-conic-to":W()}],"mask-image-conic-from-color":[{"mask-conic-from":A()}],"mask-image-conic-to-color":[{"mask-conic-to":A()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:Q()}],"mask-repeat":[{mask:ne()}],"mask-size":[{mask:E()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",we,ye]}],filter:[{filter:["","none",we,ye]}],blur:[{blur:ie()}],brightness:[{brightness:[Ie,we,ye]}],contrast:[{contrast:[Ie,we,ye]}],"drop-shadow":[{"drop-shadow":["","none",R,ql,Yl]}],"drop-shadow-color":[{"drop-shadow":A()}],grayscale:[{grayscale:["",Ie,we,ye]}],"hue-rotate":[{"hue-rotate":[Ie,we,ye]}],invert:[{invert:["",Ie,we,ye]}],saturate:[{saturate:[Ie,we,ye]}],sepia:[{sepia:["",Ie,we,ye]}],"backdrop-filter":[{"backdrop-filter":["","none",we,ye]}],"backdrop-blur":[{"backdrop-blur":ie()}],"backdrop-brightness":[{"backdrop-brightness":[Ie,we,ye]}],"backdrop-contrast":[{"backdrop-contrast":[Ie,we,ye]}],"backdrop-grayscale":[{"backdrop-grayscale":["",Ie,we,ye]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[Ie,we,ye]}],"backdrop-invert":[{"backdrop-invert":["",Ie,we,ye]}],"backdrop-opacity":[{"backdrop-opacity":[Ie,we,ye]}],"backdrop-saturate":[{"backdrop-saturate":[Ie,we,ye]}],"backdrop-sepia":[{"backdrop-sepia":["",Ie,we,ye]}],"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",we,ye]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[Ie,"initial",we,ye]}],ease:[{ease:["linear","initial",C,we,ye]}],delay:[{delay:[Ie,we,ye]}],animate:[{animate:["none",_,we,ye]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[j,we,ye]}],"perspective-origin":[{"perspective-origin":$()}],rotate:[{rotate:ce()}],"rotate-x":[{"rotate-x":ce()}],"rotate-y":[{"rotate-y":ce()}],"rotate-z":[{"rotate-z":ce()}],scale:[{scale:pe()}],"scale-x":[{"scale-x":pe()}],"scale-y":[{"scale-y":pe()}],"scale-z":[{"scale-z":pe()}],"scale-3d":["scale-3d"],skew:[{skew:Pe()}],"skew-x":[{"skew-x":Pe()}],"skew-y":[{"skew-y":Pe()}],transform:[{transform:[we,ye,"","none","gpu","cpu"]}],"transform-origin":[{origin:$()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:_e()}],"translate-x":[{"translate-x":_e()}],"translate-y":[{"translate-y":_e()}],"translate-z":[{"translate-z":_e()}],"translate-none":["translate-none"],accent:[{accent:A()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:A()}],"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",we,ye]}],"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",we,ye]}],fill:[{fill:["none",...A()]}],"stroke-w":[{stroke:[Ie,Ra,Fr,Fc]}],stroke:[{stroke:["none",...A()]}],"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"]}},Vj=jj(Bj);function He(...r){return Vj(yp(r))}const Uj=wp("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 ge({className:r,variant:a,size:l,asChild:i=!1,...c}){const u=i?gp:"button";return n.jsx(u,{"data-slot":"button",className:He(Uj({variant:a,size:l,className:r})),...c})}function le({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 Wj(){const r=Oa(),[a,l]=p.useState(""),[i,c]=p.useState(""),[u,f]=p.useState(""),[m,x]=p.useState(!1),y=async()=>{f(""),x(!0);try{const g=await vt("/api/admin",{username:a.trim(),password:i});if((g==null?void 0:g.success)!==!1&&(g!=null&&g.token)){V1(g.token),r("/dashboard",{replace:!0});return}f(g.error||"用户名或密码错误")}catch(g){const v=g;f(v.status===401?"用户名或密码错误":(v==null?void 0:v.message)||"网络错误,请重试")}finally{x(!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(k1,{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(ro,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-5 h-5 text-gray-500"}),n.jsx(le,{type:"text",value:a,onChange:g=>l(g.target.value),placeholder:"请输入用户名",className:"pl-10 bg-[#0a1628] border-gray-700 text-white placeholder:text-gray-500 focus:border-[#38bdac]"})]})]}),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(t1,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-5 h-5 text-gray-500"}),n.jsx(le,{type:"password",value:i,onChange:g=>c(g.target.value),placeholder:"请输入密码",className:"pl-10 bg-[#0a1628] border-gray-700 text-white placeholder:text-gray-500 focus:border-[#38bdac]",onKeyDown:g=>g.key==="Enter"&&y()})]})]}),u&&n.jsx("div",{className:"bg-red-500/10 text-red-400 text-sm p-3 rounded-lg border border-red-500/20",children:u}),n.jsx(ge,{onClick:y,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 Se=p.forwardRef(({className:r,...a},l)=>n.jsx("div",{ref:l,className:He("rounded-xl border bg-card text-card-foreground shadow",r),...a}));Se.displayName="Card";const Fe=p.forwardRef(({className:r,...a},l)=>n.jsx("div",{ref:l,className:He("flex flex-col space-y-1.5 p-6",r),...a}));Fe.displayName="CardHeader";const ze=p.forwardRef(({className:r,...a},l)=>n.jsx("h3",{ref:l,className:He("font-semibold leading-none tracking-tight",r),...a}));ze.displayName="CardTitle";const it=p.forwardRef(({className:r,...a},l)=>n.jsx("p",{ref:l,className:He("text-sm text-muted-foreground",r),...a}));it.displayName="CardDescription";const Ce=p.forwardRef(({className:r,...a},l)=>n.jsx("div",{ref:l,className:He("p-6 pt-0",r),...a}));Ce.displayName="CardContent";const Hj=p.forwardRef(({className:r,...a},l)=>n.jsx("div",{ref:l,className:He("flex items-center p-6 pt-0",r),...a}));Hj.displayName="CardFooter";function Kj(){const r=Oa(),[a,l]=p.useState(!0),[i,c]=p.useState([]),[u,f]=p.useState([]);async function m(){l(!0);try{const[S,j]=await Promise.all([Ue("/api/db/users"),Ue("/api/orders")]);S!=null&&S.success&&S.users&&c(S.users),j!=null&&j.success&&j.orders&&f(j.orders)}catch(S){console.error("加载数据失败",S)}finally{l(!1)}}if(p.useEffect(()=>{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.jsxs("div",{className:"flex flex-col items-center justify-center py-24",children:[n.jsx(Ze,{className:"w-12 h-12 text-[#38bdac] animate-spin mb-4"}),n.jsx("span",{className:"text-gray-400",children:"加载中..."})]})]});const y=u.filter(S=>S.status==="paid"||S.status==="completed"||S.status==="success").reduce((S,j)=>S+Number(j.amount||0),0),g=i.length,v=u.length,P=S=>{const j=S.productType||"",N=S.description||"";if(N){if(j==="section"&&N.includes("章节")){if(N.includes("-")){const C=N.split("-");if(C.length>=3)return{title:`第${C[1]}章 第${C[2]}节`,subtitle:"《一场Soul的创业实验》"}}return{title:N,subtitle:"章节购买"}}return j==="fullbook"||N.includes("全书")?{title:"《一场Soul的创业实验》",subtitle:"全书购买"}:j==="match"||N.includes("伙伴")?{title:"找伙伴匹配",subtitle:"功能服务"}:{title:N,subtitle:j==="section"?"单章":j==="fullbook"?"全书":"其他"}}return j==="section"?{title:`章节 ${S.productId||""}`,subtitle:"单章购买"}:j==="fullbook"?{title:"《一场Soul的创业实验》",subtitle:"全书购买"}:j==="match"?{title:"找伙伴匹配",subtitle:"功能服务"}:{title:"未知商品",subtitle:j||"其他"}},R=[{title:"总用户数",value:g,icon:Cn,color:"text-blue-400",bg:"bg-blue-500/20",link:"/users"},{title:"总收入",value:`¥${Number(y).toFixed(2)}`,icon:od,color:"text-[#38bdac]",bg:"bg-[#38bdac]/20",link:"/orders"},{title:"订单数",value:v,icon:ad,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:R.map((S,j)=>n.jsxs(Se,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl cursor-pointer hover:border-[#38bdac]/50 transition-colors group",onClick:()=>S.link&&r(S.link),children:[n.jsxs(Fe,{className:"flex flex-row items-center justify-between pb-2",children:[n.jsx(ze,{className:"text-sm font-medium text-gray-400",children:S.title}),n.jsx("div",{className:`p-2 rounded-lg ${S.bg}`,children:n.jsx(S.icon,{className:`w-4 h-4 ${S.color}`})})]}),n.jsx(Ce,{children:n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsx("div",{className:"text-2xl font-bold text-white",children:S.value}),n.jsx(dp,{className:"w-5 h-5 text-gray-600 group-hover:text-[#38bdac] transition-colors"})]})})]},j))}),n.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-8",children:[n.jsxs(Se,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:[n.jsx(Fe,{children:n.jsx(ze,{className:"text-white",children:"最近订单"})}),n.jsx(Ce,{children:n.jsxs("div",{className:"space-y-3",children:[u.slice(-5).reverse().map(S=>{var b;const j=S.referrerId?i.find(I=>I.id===S.referrerId):void 0,N=S.referralCode||(j==null?void 0:j.referralCode)||(j==null?void 0:j.nickname)||(S.referrerId?String(S.referrerId).slice(0,8):""),C=P(S),_=S.userNickname||((b=i.find(I=>I.id===S.userId))==null?void 0:b.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:[S.userAvatar?n.jsx("img",{src:S.userAvatar,alt:_,className:"w-9 h-9 rounded-full object-cover flex-shrink-0 mt-0.5",onError:I=>{I.currentTarget.style.display="none";const $=I.currentTarget.nextElementSibling;$&&$.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 ${S.userAvatar?"hidden":""}`,children:_.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:_}),n.jsx("span",{className:"text-gray-600",children:"·"}),n.jsx("span",{className:"text-sm font-medium text-white truncate",children:C.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:C.subtitle}),n.jsx("span",{children:new Date(S.createdAt||0).toLocaleString("zh-CN",{month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"})})]}),N&&n.jsxs("p",{className:"text-xs text-gray-600 mt-1",children:["推荐: ",N]})]})]}),n.jsxs("div",{className:"text-right ml-4 flex-shrink-0",children:[n.jsxs("p",{className:"text-sm font-bold text-[#38bdac]",children:["+¥",Number(S.amount).toFixed(2)]}),n.jsx("p",{className:"text-xs text-gray-500 mt-0.5",children:S.paymentMethod||"微信"})]})]},S.id)}),u.length===0&&n.jsxs("div",{className:"text-center py-12",children:[n.jsx(ad,{className:"w-12 h-12 text-gray-600 mx-auto mb-3"}),n.jsx("p",{className:"text-gray-500",children:"暂无订单数据"})]})]})})]}),n.jsxs(Se,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:[n.jsx(Fe,{children:n.jsx(ze,{className:"text-white",children:"新注册用户"})}),n.jsx(Ce,{children:n.jsxs("div",{className:"space-y-3",children:[i.slice(-5).reverse().map(S=>{var j;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:((j=S.nickname)==null?void 0:j.charAt(0))||"?"}),n.jsxs("div",{children:[n.jsx("p",{className:"text-sm font-medium text-white",children:S.nickname||"匿名用户"}),n.jsx("p",{className:"text-xs text-gray-500",children:S.phone||"-"})]})]}),n.jsx("p",{className:"text-xs text-gray-400",children:S.createdAt?new Date(S.createdAt).toLocaleDateString():"-"})]},S.id)}),i.length===0&&n.jsx("p",{className:"text-gray-500 text-center py-8",children:"暂无用户数据"})]})})]})]})]})}const Ls=p.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})}));Ls.displayName="Table";const Os=p.forwardRef(({className:r,...a},l)=>n.jsx("thead",{ref:l,className:He("[&_tr]:border-b",r),...a}));Os.displayName="TableHeader";const Ds=p.forwardRef(({className:r,...a},l)=>n.jsx("tbody",{ref:l,className:He("[&_tr:last-child]:border-0",r),...a}));Ds.displayName="TableBody";const Et=p.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}));Et.displayName="TableRow";const Be=p.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}));Be.displayName="TableHead";const Le=p.forwardRef(({className:r,...a},l)=>n.jsx("td",{ref:l,className:He("p-4 align-middle [&:has([role=checkbox])]:pr-0",r),...a}));Le.displayName="TableCell";const Gj=wp("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?gp:"span";return n.jsx(c,{className:He(Gj({variant:a}),r),...i})}function Ap(r,a){const[l,i]=p.useState(r);return p.useEffect(()=>{const c=setTimeout(()=>i(r),a);return()=>clearTimeout(c)},[r,a]),l}function Vr({page:r,totalPages:a,total:l,pageSize:i,onPageChange:c,onPageSizeChange:u,pageSizeOptions:f=[10,20,50,100]}){return a<=1&&!u?null:n.jsxs("div",{className:"flex items-center justify-between gap-4 py-4 px-5 border-t border-gray-700/50",children:[n.jsxs("div",{className:"flex items-center gap-2 text-sm text-gray-400",children:[n.jsxs("span",{children:["共 ",l," 条"]}),u&&n.jsx("select",{value:i,onChange:m=>u(Number(m.target.value)),className:"bg-[#0f2137] border border-gray-600 rounded px-2 py-1 text-gray-300 text-sm",children:f.map(m=>n.jsxs("option",{value:m,children:[m," 条/页"]},m))})]}),a>1&&n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx("button",{type:"button",onClick:()=>c(1),disabled:r<=1,className:"px-2 py-1 rounded border border-gray-600 text-gray-400 hover:bg-gray-700/50 disabled:opacity-40 text-sm",children:"首页"}),n.jsx("button",{type:"button",onClick:()=>c(r-1),disabled:r<=1,className:"px-3 py-1 rounded border border-gray-600 text-gray-400 hover:bg-gray-700/50 disabled:opacity-40 text-sm",children:"上一页"}),n.jsxs("span",{className:"px-3 py-1 text-gray-400 text-sm",children:[r," / ",a]}),n.jsx("button",{type:"button",onClick:()=>c(r+1),disabled:r>=a,className:"px-3 py-1 rounded border border-gray-600 text-gray-400 hover:bg-gray-700/50 disabled:opacity-40 text-sm",children:"下一页"}),n.jsx("button",{type:"button",onClick:()=>c(a),disabled:r>=a,className:"px-2 py-1 rounded border border-gray-600 text-gray-400 hover:bg-gray-700/50 disabled:opacity-40 text-sm",children:"末页"})]})]})}function Qj(){const[r,a]=p.useState([]),[l,i]=p.useState([]),[c,u]=p.useState(0),[f,m]=p.useState(0),[x,y]=p.useState(0),[g,v]=p.useState(1),[P,R]=p.useState(10),[S,j]=p.useState(""),N=Ap(S,300),[C,_]=p.useState("all"),[b,I]=p.useState(!0),[$,G]=p.useState(null);async function L(){I(!0),G(null);try{const Y=C==="all"?"":C==="completed"?"completed":C,B=new URLSearchParams({page:String(g),pageSize:String(P),...Y&&{status:Y},...N&&{search:N}}),[z,H]=await Promise.all([Ue(`/api/orders?${B}`),Ue("/api/db/users?page=1&pageSize=500")]);z!=null&&z.success&&(a(z.orders||[]),u(z.total??0),m(z.totalRevenue??0),y(z.todayRevenue??0)),H!=null&&H.success&&H.users&&i(H.users)}catch(Y){console.error("加载订单失败",Y),G("加载订单失败,请检查网络后重试")}finally{I(!1)}}p.useEffect(()=>{v(1)},[N,C]),p.useEffect(()=>{L()},[g,P,N,C]);const V=Y=>{var B;return Y.userNickname||((B=l.find(z=>z.id===Y.userId))==null?void 0:B.nickname)||"匿名用户"},te=Y=>{var B;return((B=l.find(z=>z.id===Y))==null?void 0:B.phone)||"-"},de=Y=>{const B=Y.productType||Y.type||"",z=Y.description||"";if(z){if(B==="section"&&z.includes("章节")){if(z.includes("-")){const H=z.split("-");if(H.length>=3)return{name:`第${H[1]}章 第${H[2]}节`,type:"《一场Soul的创业实验》"}}return{name:z,type:"章节购买"}}return B==="fullbook"||z.includes("全书")?{name:"《一场Soul的创业实验》",type:"全书购买"}:B==="vip"||z.includes("VIP")?{name:"VIP年度会员",type:"VIP"}:B==="match"||z.includes("伙伴")?{name:"找伙伴匹配",type:"功能服务"}:{name:z,type:"其他"}}return B==="section"?{name:`章节 ${Y.productId||Y.sectionId||""}`,type:"单章"}:B==="fullbook"?{name:"《一场Soul的创业实验》",type:"全书"}:B==="vip"?{name:"VIP年度会员",type:"VIP"}:B==="match"?{name:"找伙伴匹配",type:"功能"}:{name:"未知商品",type:B||"其他"}},oe=Math.ceil(c/P)||1;function ue(){if(r.length===0){alert("暂无数据可导出");return}const Y=["订单号","用户","手机号","商品","金额","支付方式","状态","分销佣金","下单时间"],B=r.map(Q=>{const ne=de(Q);return[Q.orderSn||Q.id||"",V(Q),te(Q.userId),ne.name,Number(Q.amount||0).toFixed(2),Q.paymentMethod==="wechat"?"微信支付":Q.paymentMethod==="alipay"?"支付宝":Q.paymentMethod||"微信支付",Q.status==="paid"||Q.status==="completed"?"已完成":Q.status==="pending"||Q.status==="created"?"待支付":"已失败",Q.referrerEarnings?Number(Q.referrerEarnings).toFixed(2):"-",Q.createdAt?new Date(Q.createdAt).toLocaleString("zh-CN"):""].join(",")}),z="\uFEFF"+[Y.join(","),...B].join(` +`),H=new Blob([z],{type:"text/csv;charset=utf-8"}),K=URL.createObjectURL(H),A=document.createElement("a");A.href=K,A.download=`订单列表_${new Date().toISOString().slice(0,10)}.csv`,A.click(),URL.revokeObjectURL(K)}return n.jsxs("div",{className:"p-8 max-w-7xl mx-auto",children:[$&&n.jsxs("div",{className:"mb-4 px-4 py-3 rounded-lg bg-red-500/20 border border-red-500/50 text-red-400 text-sm flex items-center justify-between",children:[n.jsx("span",{children:$}),n.jsx("button",{type:"button",onClick:()=>G(null),className:"hover:text-red-300",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(ge,{variant:"outline",onClick:L,disabled:b,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 ${b?"animate-spin":""}`}),"刷新"]}),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:["¥",f.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:["¥",x.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(le,{type:"text",placeholder:"搜索订单号/用户/章节...",className:"pl-10 bg-[#0f2137] border-gray-700 text-white placeholder:text-gray-500",value:S,onChange:Y=>j(Y.target.value)})]}),n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx(Fw,{className:"w-4 h-4 text-gray-400"}),n.jsxs("select",{value:C,onChange:Y=>_(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(ge,{variant:"outline",onClick:ue,disabled:r.length===0,className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:[n.jsx(Iw,{className:"w-4 h-4 mr-2"}),"导出 CSV"]})]}),n.jsx(Se,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:n.jsx(Ce,{className:"p-0",children:b?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("div",{children:[n.jsxs(Ls,{children:[n.jsx(Os,{children:n.jsxs(Et,{className:"bg-[#0a1628] hover:bg-[#0a1628] border-gray-700",children:[n.jsx(Be,{className:"text-gray-400",children:"订单号"}),n.jsx(Be,{className:"text-gray-400",children:"用户"}),n.jsx(Be,{className:"text-gray-400",children:"商品"}),n.jsx(Be,{className:"text-gray-400",children:"金额"}),n.jsx(Be,{className:"text-gray-400",children:"支付方式"}),n.jsx(Be,{className:"text-gray-400",children:"状态"}),n.jsx(Be,{className:"text-gray-400",children:"分销佣金"}),n.jsx(Be,{className:"text-gray-400",children:"下单时间"})]})}),n.jsxs(Ds,{children:[r.map(Y=>{const B=de(Y);return n.jsxs(Et,{className:"hover:bg-[#0a1628] border-gray-700/50",children:[n.jsxs(Le,{className:"font-mono text-xs text-gray-400",children:[(Y.orderSn||Y.id||"").slice(0,12),"..."]}),n.jsx(Le,{children:n.jsxs("div",{children:[n.jsx("p",{className:"text-white text-sm",children:V(Y)}),n.jsx("p",{className:"text-gray-500 text-xs",children:te(Y.userId)})]})}),n.jsx(Le,{children:n.jsxs("div",{children:[n.jsxs("p",{className:"text-white text-sm flex items-center gap-2",children:[B.name,(Y.productType||Y.type)==="vip"&&n.jsx(Oe,{className:"bg-amber-500/20 text-amber-400 hover:bg-amber-500/20 border-0 text-xs",children:"VIP"})]}),n.jsx("p",{className:"text-gray-500 text-xs",children:B.type})]})}),n.jsxs(Le,{className:"text-[#38bdac] font-bold",children:["¥",Number(Y.amount||0).toFixed(2)]}),n.jsx(Le,{className:"text-gray-300",children:Y.paymentMethod==="wechat"?"微信支付":Y.paymentMethod==="alipay"?"支付宝":Y.paymentMethod||"微信支付"}),n.jsx(Le,{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(Le,{className:"text-[#FFD700]",children:Y.referrerEarnings?`¥${Number(Y.referrerEarnings).toFixed(2)}`:"-"}),n.jsx(Le,{className:"text-gray-400 text-sm",children:new Date(Y.createdAt).toLocaleString("zh-CN")})]},Y.id)}),r.length===0&&n.jsx(Et,{children:n.jsx(Le,{colSpan:8,className:"text-center py-12 text-gray-500",children:"暂无订单数据"})})]})]}),n.jsx(Vr,{page:g,totalPages:oe,total:c,pageSize:P,onPageChange:v,onPageSizeChange:Y=>{R(Y),v(1)}})]})})})]})}var Yj=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],qj=Yj.reduce((r,a)=>{const l=xp(`Primitive.${a}`),i=p.forwardRef((c,u)=>{const{asChild:f,...m}=c,x=f?l:a;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),n.jsx(x,{...m,ref:u})});return i.displayName=`Primitive.${a}`,{...r,[a]:i}},{}),Xj="Label",Mp=p.forwardRef((r,a)=>n.jsx(qj.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())}}));Mp.displayName=Xj;var Lp=Mp;const se=p.forwardRef(({className:r,...a},l)=>n.jsx(Lp,{ref:l,className:He("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",r),...a}));se.displayName=Lp.displayName;function Te(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 Jj(r,a){const l=p.createContext(a),i=u=>{const{children:f,...m}=u,x=p.useMemo(()=>m,Object.values(m));return n.jsx(l.Provider,{value:x,children:f})};i.displayName=r+"Provider";function c(u){const f=p.useContext(l);if(f)return f;if(a!==void 0)return a;throw new Error(`\`${u}\` must be used within \`${r}\``)}return[i,c]}function yr(r,a=[]){let l=[];function i(u,f){const m=p.createContext(f),x=l.length;l=[...l,f];const y=v=>{var C;const{scope:P,children:R,...S}=v,j=((C=P==null?void 0:P[r])==null?void 0:C[x])||m,N=p.useMemo(()=>S,Object.values(S));return n.jsx(j.Provider,{value:N,children:R})};y.displayName=u+"Provider";function g(v,P){var j;const R=((j=P==null?void 0:P[r])==null?void 0:j[x])||m,S=p.useContext(R);if(S)return S;if(f!==void 0)return f;throw new Error(`\`${v}\` must be used within \`${u}\``)}return[y,g]}const c=()=>{const u=l.map(f=>p.createContext(f));return function(m){const x=(m==null?void 0:m[r])||u;return p.useMemo(()=>({[`__scope${r}`]:{...m,[r]:x}}),[m,x])}};return c.scopeName=r,[i,Zj(c,...a)]}function Zj(...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(u){const f=i.reduce((m,{useScope:x,scopeName:y})=>{const v=x(u)[`__scope${y}`];return{...m,...v}},{});return p.useMemo(()=>({[`__scope${a.scopeName}`]:f}),[f])}};return l.scopeName=a.scopeName,l}var St=globalThis!=null&&globalThis.document?p.useLayoutEffect:()=>{},eb=No[" useId ".trim().toString()]||(()=>{}),tb=0;function mr(r){const[a,l]=p.useState(eb());return St(()=>{l(i=>i??String(tb++))},[r]),a?`radix-${a}`:""}var nb=No[" useInsertionEffect ".trim().toString()]||St;function Wr({prop:r,defaultProp:a,onChange:l=()=>{},caller:i}){const[c,u,f]=rb({defaultProp:a,onChange:l}),m=r!==void 0,x=m?r:c;{const g=p.useRef(r!==void 0);p.useEffect(()=>{const v=g.current;v!==m&&console.warn(`${i} is changing from ${v?"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.`),g.current=m},[m,i])}const y=p.useCallback(g=>{var v;if(m){const P=sb(g)?g(r):g;P!==r&&((v=f.current)==null||v.call(f,P))}else u(g)},[m,r,u,f]);return[x,y]}function rb({defaultProp:r,onChange:a}){const[l,i]=p.useState(r),c=p.useRef(l),u=p.useRef(a);return nb(()=>{u.current=a},[a]),p.useEffect(()=>{var f;c.current!==l&&((f=u.current)==null||f.call(u,l),c.current=l)},[l,c]),[l,i,u]}function sb(r){return typeof r=="function"}function Aa(r){const a=ab(r),l=p.forwardRef((i,c)=>{const{children:u,...f}=i,m=p.Children.toArray(u),x=m.find(ob);if(x){const y=x.props.children,g=m.map(v=>v===x?p.Children.count(y)>1?p.Children.only(null):p.isValidElement(y)?y.props.children:null:v);return n.jsx(a,{...f,ref:c,children:p.isValidElement(y)?p.cloneElement(y,void 0,g):null})}return n.jsx(a,{...f,ref:c,children:u})});return l.displayName=`${r}.Slot`,l}function ab(r){const a=p.forwardRef((l,i)=>{const{children:c,...u}=l;if(p.isValidElement(c)){const f=cb(c),m=ib(u,c.props);return c.type!==p.Fragment&&(m.ref=i?Id(i,f):f),p.cloneElement(c,m)}return p.Children.count(c)>1?p.Children.only(null):null});return a.displayName=`${r}.SlotClone`,a}var lb=Symbol("radix.slottable");function ob(r){return p.isValidElement(r)&&typeof r.type=="function"&&"__radixId"in r.type&&r.type.__radixId===lb}function ib(r,a){const l={...a};for(const i in a){const c=r[i],u=a[i];/^on[A-Z]/.test(i)?c&&u?l[i]=(...m)=>{const x=u(...m);return c(...m),x}:c&&(l[i]=c):i==="style"?l[i]={...c,...u}:i==="className"&&(l[i]=[c,u].filter(Boolean).join(" "))}return{...r,...l}}function cb(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 db=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Ae=db.reduce((r,a)=>{const l=Aa(`Primitive.${a}`),i=p.forwardRef((c,u)=>{const{asChild:f,...m}=c,x=f?l:a;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),n.jsx(x,{...m,ref:u})});return i.displayName=`Primitive.${a}`,{...r,[a]:i}},{});function ub(r,a){r&&La.flushSync(()=>r.dispatchEvent(a))}function pr(r){const a=p.useRef(r);return p.useEffect(()=>{a.current=r}),p.useMemo(()=>(...l)=>{var i;return(i=a.current)==null?void 0:i.call(a,...l)},[])}function fb(r,a=globalThis==null?void 0:globalThis.document){const l=pr(r);p.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 hb="DismissableLayer",cd="dismissableLayer.update",mb="dismissableLayer.pointerDownOutside",pb="dismissableLayer.focusOutside",Sm,Op=p.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Md=p.forwardRef((r,a)=>{const{disableOutsidePointerEvents:l=!1,onEscapeKeyDown:i,onPointerDownOutside:c,onFocusOutside:u,onInteractOutside:f,onDismiss:m,...x}=r,y=p.useContext(Op),[g,v]=p.useState(null),P=(g==null?void 0:g.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,R]=p.useState({}),S=We(a,L=>v(L)),j=Array.from(y.layers),[N]=[...y.layersWithOutsidePointerEventsDisabled].slice(-1),C=j.indexOf(N),_=g?j.indexOf(g):-1,b=y.layersWithOutsidePointerEventsDisabled.size>0,I=_>=C,$=vb(L=>{const V=L.target,te=[...y.branches].some(de=>de.contains(V));!I||te||(c==null||c(L),f==null||f(L),L.defaultPrevented||m==null||m())},P),G=yb(L=>{const V=L.target;[...y.branches].some(de=>de.contains(V))||(u==null||u(L),f==null||f(L),L.defaultPrevented||m==null||m())},P);return fb(L=>{_===y.layers.size-1&&(i==null||i(L),!L.defaultPrevented&&m&&(L.preventDefault(),m()))},P),p.useEffect(()=>{if(g)return l&&(y.layersWithOutsidePointerEventsDisabled.size===0&&(Sm=P.body.style.pointerEvents,P.body.style.pointerEvents="none"),y.layersWithOutsidePointerEventsDisabled.add(g)),y.layers.add(g),Cm(),()=>{l&&y.layersWithOutsidePointerEventsDisabled.size===1&&(P.body.style.pointerEvents=Sm)}},[g,P,l,y]),p.useEffect(()=>()=>{g&&(y.layers.delete(g),y.layersWithOutsidePointerEventsDisabled.delete(g),Cm())},[g,y]),p.useEffect(()=>{const L=()=>R({});return document.addEventListener(cd,L),()=>document.removeEventListener(cd,L)},[]),n.jsx(Ae.div,{...x,ref:S,style:{pointerEvents:b?I?"auto":"none":void 0,...r.style},onFocusCapture:Te(r.onFocusCapture,G.onFocusCapture),onBlurCapture:Te(r.onBlurCapture,G.onBlurCapture),onPointerDownCapture:Te(r.onPointerDownCapture,$.onPointerDownCapture)})});Md.displayName=hb;var xb="DismissableLayerBranch",gb=p.forwardRef((r,a)=>{const l=p.useContext(Op),i=p.useRef(null),c=We(a,i);return p.useEffect(()=>{const u=i.current;if(u)return l.branches.add(u),()=>{l.branches.delete(u)}},[l.branches]),n.jsx(Ae.div,{...r,ref:c})});gb.displayName=xb;function vb(r,a=globalThis==null?void 0:globalThis.document){const l=pr(r),i=p.useRef(!1),c=p.useRef(()=>{});return p.useEffect(()=>{const u=m=>{if(m.target&&!i.current){let x=function(){Dp(mb,l,y,{discrete:!0})};const y={originalEvent:m};m.pointerType==="touch"?(a.removeEventListener("click",c.current),c.current=x,a.addEventListener("click",c.current,{once:!0})):x()}else a.removeEventListener("click",c.current);i.current=!1},f=window.setTimeout(()=>{a.addEventListener("pointerdown",u)},0);return()=>{window.clearTimeout(f),a.removeEventListener("pointerdown",u),a.removeEventListener("click",c.current)}},[a,l]),{onPointerDownCapture:()=>i.current=!0}}function yb(r,a=globalThis==null?void 0:globalThis.document){const l=pr(r),i=p.useRef(!1);return p.useEffect(()=>{const c=u=>{u.target&&!i.current&&Dp(pb,l,{originalEvent:u},{discrete:!1})};return a.addEventListener("focusin",c),()=>a.removeEventListener("focusin",c)},[a,l]),{onFocusCapture:()=>i.current=!0,onBlurCapture:()=>i.current=!1}}function Cm(){const r=new CustomEvent(cd);document.dispatchEvent(r)}function Dp(r,a,l,{discrete:i}){const c=l.originalEvent.target,u=new CustomEvent(r,{bubbles:!1,cancelable:!0,detail:l});a&&c.addEventListener(r,a,{once:!0}),i?ub(c,u):c.dispatchEvent(u)}var zc="focusScope.autoFocusOnMount",$c="focusScope.autoFocusOnUnmount",km={bubbles:!1,cancelable:!0},wb="FocusScope",Ld=p.forwardRef((r,a)=>{const{loop:l=!1,trapped:i=!1,onMountAutoFocus:c,onUnmountAutoFocus:u,...f}=r,[m,x]=p.useState(null),y=pr(c),g=pr(u),v=p.useRef(null),P=We(a,j=>x(j)),R=p.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;p.useEffect(()=>{if(i){let j=function(b){if(R.paused||!m)return;const I=b.target;m.contains(I)?v.current=I:dr(v.current,{select:!0})},N=function(b){if(R.paused||!m)return;const I=b.relatedTarget;I!==null&&(m.contains(I)||dr(v.current,{select:!0}))},C=function(b){if(document.activeElement===document.body)for(const $ of b)$.removedNodes.length>0&&dr(m)};document.addEventListener("focusin",j),document.addEventListener("focusout",N);const _=new MutationObserver(C);return m&&_.observe(m,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",j),document.removeEventListener("focusout",N),_.disconnect()}}},[i,m,R.paused]),p.useEffect(()=>{if(m){Pm.add(R);const j=document.activeElement;if(!m.contains(j)){const C=new CustomEvent(zc,km);m.addEventListener(zc,y),m.dispatchEvent(C),C.defaultPrevented||(jb(kb(Fp(m)),{select:!0}),document.activeElement===j&&dr(m))}return()=>{m.removeEventListener(zc,y),setTimeout(()=>{const C=new CustomEvent($c,km);m.addEventListener($c,g),m.dispatchEvent(C),C.defaultPrevented||dr(j??document.body,{select:!0}),m.removeEventListener($c,g),Pm.remove(R)},0)}}},[m,y,g,R]);const S=p.useCallback(j=>{if(!l&&!i||R.paused)return;const N=j.key==="Tab"&&!j.altKey&&!j.ctrlKey&&!j.metaKey,C=document.activeElement;if(N&&C){const _=j.currentTarget,[b,I]=bb(_);b&&I?!j.shiftKey&&C===I?(j.preventDefault(),l&&dr(b,{select:!0})):j.shiftKey&&C===b&&(j.preventDefault(),l&&dr(I,{select:!0})):C===_&&j.preventDefault()}},[l,i,R.paused]);return n.jsx(Ae.div,{tabIndex:-1,...f,ref:P,onKeyDown:S})});Ld.displayName=wb;function jb(r,{select:a=!1}={}){const l=document.activeElement;for(const i of r)if(dr(i,{select:a}),document.activeElement!==l)return}function bb(r){const a=Fp(r),l=Em(a,r),i=Em(a.reverse(),r);return[l,i]}function Fp(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 Em(r,a){for(const l of r)if(!Nb(l,{upTo:a}))return l}function Nb(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 Sb(r){return r instanceof HTMLInputElement&&"select"in r}function dr(r,{select:a=!1}={}){if(r&&r.focus){const l=document.activeElement;r.focus({preventScroll:!0}),r!==l&&Sb(r)&&a&&r.select()}}var Pm=Cb();function Cb(){let r=[];return{add(a){const l=r[0];a!==l&&(l==null||l.pause()),r=Rm(r,a),r.unshift(a)},remove(a){var l;r=Rm(r,a),(l=r[0])==null||l.resume()}}}function Rm(r,a){const l=[...r],i=l.indexOf(a);return i!==-1&&l.splice(i,1),l}function kb(r){return r.filter(a=>a.tagName!=="A")}var Eb="Portal",Od=p.forwardRef((r,a)=>{var m;const{container:l,...i}=r,[c,u]=p.useState(!1);St(()=>u(!0),[]);const f=l||c&&((m=globalThis==null?void 0:globalThis.document)==null?void 0:m.body);return f?Zv.createPortal(n.jsx(Ae.div,{...i,ref:a}),f):null});Od.displayName=Eb;function Pb(r,a){return p.useReducer((l,i)=>a[l][i]??l,r)}var Da=r=>{const{present:a,children:l}=r,i=Rb(a),c=typeof l=="function"?l({present:i.isPresent}):p.Children.only(l),u=We(i.ref,_b(c));return typeof l=="function"||i.isPresent?p.cloneElement(c,{ref:u}):null};Da.displayName="Presence";function Rb(r){const[a,l]=p.useState(),i=p.useRef(null),c=p.useRef(r),u=p.useRef("none"),f=r?"mounted":"unmounted",[m,x]=Pb(f,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return p.useEffect(()=>{const y=Xl(i.current);u.current=m==="mounted"?y:"none"},[m]),St(()=>{const y=i.current,g=c.current;if(g!==r){const P=u.current,R=Xl(y);r?x("MOUNT"):R==="none"||(y==null?void 0:y.display)==="none"?x("UNMOUNT"):x(g&&P!==R?"ANIMATION_OUT":"UNMOUNT"),c.current=r}},[r,x]),St(()=>{if(a){let y;const g=a.ownerDocument.defaultView??window,v=R=>{const j=Xl(i.current).includes(CSS.escape(R.animationName));if(R.target===a&&j&&(x("ANIMATION_END"),!c.current)){const N=a.style.animationFillMode;a.style.animationFillMode="forwards",y=g.setTimeout(()=>{a.style.animationFillMode==="forwards"&&(a.style.animationFillMode=N)})}},P=R=>{R.target===a&&(u.current=Xl(i.current))};return a.addEventListener("animationstart",P),a.addEventListener("animationcancel",v),a.addEventListener("animationend",v),()=>{g.clearTimeout(y),a.removeEventListener("animationstart",P),a.removeEventListener("animationcancel",v),a.removeEventListener("animationend",v)}}else x("ANIMATION_END")},[a,x]),{isPresent:["mounted","unmountSuspended"].includes(m),ref:p.useCallback(y=>{i.current=y?getComputedStyle(y):null,l(y)},[])}}function Xl(r){return(r==null?void 0:r.animationName)||"none"}function _b(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 Bc=0;function zp(){p.useEffect(()=>{const r=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",r[0]??_m()),document.body.insertAdjacentElement("beforeend",r[1]??_m()),Bc++,()=>{Bc===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(a=>a.remove()),Bc--}},[])}function _m(){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 yn=function(){return yn=Object.assign||function(a){for(var l,i=1,c=arguments.length;i"u")return Gb;var a=Qb(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])}},qb=Up(),Cs="data-scroll-locked",Xb=function(r,a,l,i){var c=r.left,u=r.top,f=r.right,m=r.gap;return l===void 0&&(l="margin"),` + .`.concat(Ib,` { + overflow: hidden `).concat(i,`; + padding-right: `).concat(m,"px ").concat(i,`; + } + body[`).concat(Cs,`] { + overflow: hidden `).concat(i,`; + overscroll-behavior: contain; + `).concat([a&&"position: relative ".concat(i,";"),l==="margin"&&` + padding-left: `.concat(c,`px; + padding-top: `).concat(u,`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(so,` { + right: `).concat(m,"px ").concat(i,`; + } + + .`).concat(ao,` { + margin-right: `).concat(m,"px ").concat(i,`; + } + + .`).concat(so," .").concat(so,` { + right: 0 `).concat(i,`; + } + + .`).concat(ao," .").concat(ao,` { + margin-right: 0 `).concat(i,`; + } + + body[`).concat(Cs,`] { + `).concat(Ab,": ").concat(m,`px; + } +`)},Im=function(){var r=parseInt(document.body.getAttribute(Cs)||"0",10);return isFinite(r)?r:0},Jb=function(){p.useEffect(function(){return document.body.setAttribute(Cs,(Im()+1).toString()),function(){var r=Im()-1;r<=0?document.body.removeAttribute(Cs):document.body.setAttribute(Cs,r.toString())}},[])},Zb=function(r){var a=r.noRelative,l=r.noImportant,i=r.gapMode,c=i===void 0?"margin":i;Jb();var u=p.useMemo(function(){return Yb(c)},[c]);return p.createElement(qb,{styles:Xb(u,!a,c,l?"":"!important")})},dd=!1;if(typeof window<"u")try{var Jl=Object.defineProperty({},"passive",{get:function(){return dd=!0,!0}});window.addEventListener("test",Jl,Jl),window.removeEventListener("test",Jl,Jl)}catch{dd=!1}var bs=dd?{passive:!1}:!1,eN=function(r){return r.tagName==="TEXTAREA"},Wp=function(r,a){if(!(r instanceof Element))return!1;var l=window.getComputedStyle(r);return l[a]!=="hidden"&&!(l.overflowY===l.overflowX&&!eN(r)&&l[a]==="visible")},tN=function(r){return Wp(r,"overflowY")},nN=function(r){return Wp(r,"overflowX")},Am=function(r,a){var l=a.ownerDocument,i=a;do{typeof ShadowRoot<"u"&&i instanceof ShadowRoot&&(i=i.host);var c=Hp(r,i);if(c){var u=Kp(r,i),f=u[1],m=u[2];if(f>m)return!0}i=i.parentNode}while(i&&i!==l.body);return!1},rN=function(r){var a=r.scrollTop,l=r.scrollHeight,i=r.clientHeight;return[a,l,i]},sN=function(r){var a=r.scrollLeft,l=r.scrollWidth,i=r.clientWidth;return[a,l,i]},Hp=function(r,a){return r==="v"?tN(a):nN(a)},Kp=function(r,a){return r==="v"?rN(a):sN(a)},aN=function(r,a){return r==="h"&&a==="rtl"?-1:1},lN=function(r,a,l,i,c){var u=aN(r,window.getComputedStyle(a).direction),f=u*i,m=l.target,x=a.contains(m),y=!1,g=f>0,v=0,P=0;do{if(!m)break;var R=Kp(r,m),S=R[0],j=R[1],N=R[2],C=j-N-u*S;(S||C)&&Hp(r,m)&&(v+=C,P+=S);var _=m.parentNode;m=_&&_.nodeType===Node.DOCUMENT_FRAGMENT_NODE?_.host:_}while(!x&&m!==document.body||x&&(a.contains(m)||a===m));return(g&&Math.abs(v)<1||!g&&Math.abs(P)<1)&&(y=!0),y},Zl=function(r){return"changedTouches"in r?[r.changedTouches[0].clientX,r.changedTouches[0].clientY]:[0,0]},Mm=function(r){return[r.deltaX,r.deltaY]},Lm=function(r){return r&&"current"in r?r.current:r},oN=function(r,a){return r[0]===a[0]&&r[1]===a[1]},iN=function(r){return` + .block-interactivity-`.concat(r,` {pointer-events: none;} + .allow-interactivity-`).concat(r,` {pointer-events: all;} +`)},cN=0,Ns=[];function dN(r){var a=p.useRef([]),l=p.useRef([0,0]),i=p.useRef(),c=p.useState(cN++)[0],u=p.useState(Up)[0],f=p.useRef(r);p.useEffect(function(){f.current=r},[r]),p.useEffect(function(){if(r.inert){document.body.classList.add("block-interactivity-".concat(c));var j=Tb([r.lockRef.current],(r.shards||[]).map(Lm),!0).filter(Boolean);return j.forEach(function(N){return N.classList.add("allow-interactivity-".concat(c))}),function(){document.body.classList.remove("block-interactivity-".concat(c)),j.forEach(function(N){return N.classList.remove("allow-interactivity-".concat(c))})}}},[r.inert,r.lockRef.current,r.shards]);var m=p.useCallback(function(j,N){if("touches"in j&&j.touches.length===2||j.type==="wheel"&&j.ctrlKey)return!f.current.allowPinchZoom;var C=Zl(j),_=l.current,b="deltaX"in j?j.deltaX:_[0]-C[0],I="deltaY"in j?j.deltaY:_[1]-C[1],$,G=j.target,L=Math.abs(b)>Math.abs(I)?"h":"v";if("touches"in j&&L==="h"&&G.type==="range")return!1;var V=window.getSelection(),te=V&&V.anchorNode,de=te?te===G||te.contains(G):!1;if(de)return!1;var oe=Am(L,G);if(!oe)return!0;if(oe?$=L:($=L==="v"?"h":"v",oe=Am(L,G)),!oe)return!1;if(!i.current&&"changedTouches"in j&&(b||I)&&(i.current=$),!$)return!0;var ue=i.current||$;return lN(ue,N,j,ue==="h"?b:I)},[]),x=p.useCallback(function(j){var N=j;if(!(!Ns.length||Ns[Ns.length-1]!==u)){var C="deltaY"in N?Mm(N):Zl(N),_=a.current.filter(function($){return $.name===N.type&&($.target===N.target||N.target===$.shadowParent)&&oN($.delta,C)})[0];if(_&&_.should){N.cancelable&&N.preventDefault();return}if(!_){var b=(f.current.shards||[]).map(Lm).filter(Boolean).filter(function($){return $.contains(N.target)}),I=b.length>0?m(N,b[0]):!f.current.noIsolation;I&&N.cancelable&&N.preventDefault()}}},[]),y=p.useCallback(function(j,N,C,_){var b={name:j,delta:N,target:C,should:_,shadowParent:uN(C)};a.current.push(b),setTimeout(function(){a.current=a.current.filter(function(I){return I!==b})},1)},[]),g=p.useCallback(function(j){l.current=Zl(j),i.current=void 0},[]),v=p.useCallback(function(j){y(j.type,Mm(j),j.target,m(j,r.lockRef.current))},[]),P=p.useCallback(function(j){y(j.type,Zl(j),j.target,m(j,r.lockRef.current))},[]);p.useEffect(function(){return Ns.push(u),r.setCallbacks({onScrollCapture:v,onWheelCapture:v,onTouchMoveCapture:P}),document.addEventListener("wheel",x,bs),document.addEventListener("touchmove",x,bs),document.addEventListener("touchstart",g,bs),function(){Ns=Ns.filter(function(j){return j!==u}),document.removeEventListener("wheel",x,bs),document.removeEventListener("touchmove",x,bs),document.removeEventListener("touchstart",g,bs)}},[]);var R=r.removeScrollBar,S=r.inert;return p.createElement(p.Fragment,null,S?p.createElement(u,{styles:iN(c)}):null,R?p.createElement(Zb,{noRelative:r.noRelative,gapMode:r.gapMode}):null)}function uN(r){for(var a=null;r!==null;)r instanceof ShadowRoot&&(a=r.host,r=r.host),r=r.parentNode;return a}const fN=$b(Vp,dN);var Dd=p.forwardRef(function(r,a){return p.createElement(Ro,yn({},r,{ref:a,sideCar:fN}))});Dd.classNames=Ro.classNames;var hN=function(r){if(typeof document>"u")return null;var a=Array.isArray(r)?r[0]:r;return a.ownerDocument.body},Ss=new WeakMap,eo=new WeakMap,to={},Hc=0,Gp=function(r){return r&&(r.host||Gp(r.parentNode))},mN=function(r,a){return a.map(function(l){if(r.contains(l))return l;var i=Gp(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})},pN=function(r,a,l,i){var c=mN(a,Array.isArray(r)?r:[r]);to[l]||(to[l]=new WeakMap);var u=to[l],f=[],m=new Set,x=new Set(c),y=function(v){!v||m.has(v)||(m.add(v),y(v.parentNode))};c.forEach(y);var g=function(v){!v||x.has(v)||Array.prototype.forEach.call(v.children,function(P){if(m.has(P))g(P);else try{var R=P.getAttribute(i),S=R!==null&&R!=="false",j=(Ss.get(P)||0)+1,N=(u.get(P)||0)+1;Ss.set(P,j),u.set(P,N),f.push(P),j===1&&S&&eo.set(P,!0),N===1&&P.setAttribute(l,"true"),S||P.setAttribute(i,"true")}catch(C){console.error("aria-hidden: cannot operate on ",P,C)}})};return g(a),m.clear(),Hc++,function(){f.forEach(function(v){var P=Ss.get(v)-1,R=u.get(v)-1;Ss.set(v,P),u.set(v,R),P||(eo.has(v)||v.removeAttribute(i),eo.delete(v)),R||v.removeAttribute(l)}),Hc--,Hc||(Ss=new WeakMap,Ss=new WeakMap,eo=new WeakMap,to={})}},Qp=function(r,a,l){l===void 0&&(l="data-aria-hidden");var i=Array.from(Array.isArray(r)?r:[r]),c=hN(r);return c?(i.push.apply(i,Array.from(c.querySelectorAll("[aria-live], script"))),pN(i,c,l,"aria-hidden")):function(){return null}},_o="Dialog",[Yp]=yr(_o),[xN,dn]=Yp(_o),qp=r=>{const{__scopeDialog:a,children:l,open:i,defaultOpen:c,onOpenChange:u,modal:f=!0}=r,m=p.useRef(null),x=p.useRef(null),[y,g]=Wr({prop:i,defaultProp:c??!1,onChange:u,caller:_o});return n.jsx(xN,{scope:a,triggerRef:m,contentRef:x,contentId:mr(),titleId:mr(),descriptionId:mr(),open:y,onOpenChange:g,onOpenToggle:p.useCallback(()=>g(v=>!v),[g]),modal:f,children:l})};qp.displayName=_o;var Xp="DialogTrigger",gN=p.forwardRef((r,a)=>{const{__scopeDialog:l,...i}=r,c=dn(Xp,l),u=We(a,c.triggerRef);return n.jsx(Ae.button,{type:"button","aria-haspopup":"dialog","aria-expanded":c.open,"aria-controls":c.contentId,"data-state":$d(c.open),...i,ref:u,onClick:Te(r.onClick,c.onOpenToggle)})});gN.displayName=Xp;var Fd="DialogPortal",[vN,Jp]=Yp(Fd,{forceMount:void 0}),Zp=r=>{const{__scopeDialog:a,forceMount:l,children:i,container:c}=r,u=dn(Fd,a);return n.jsx(vN,{scope:a,forceMount:l,children:p.Children.map(i,f=>n.jsx(Da,{present:l||u.open,children:n.jsx(Od,{asChild:!0,container:c,children:f})}))})};Zp.displayName=Fd;var xo="DialogOverlay",ex=p.forwardRef((r,a)=>{const l=Jp(xo,r.__scopeDialog),{forceMount:i=l.forceMount,...c}=r,u=dn(xo,r.__scopeDialog);return u.modal?n.jsx(Da,{present:i||u.open,children:n.jsx(wN,{...c,ref:a})}):null});ex.displayName=xo;var yN=Aa("DialogOverlay.RemoveScroll"),wN=p.forwardRef((r,a)=>{const{__scopeDialog:l,...i}=r,c=dn(xo,l);return n.jsx(Dd,{as:yN,allowPinchZoom:!0,shards:[c.contentRef],children:n.jsx(Ae.div,{"data-state":$d(c.open),...i,ref:a,style:{pointerEvents:"auto",...i.style}})})}),Hr="DialogContent",tx=p.forwardRef((r,a)=>{const l=Jp(Hr,r.__scopeDialog),{forceMount:i=l.forceMount,...c}=r,u=dn(Hr,r.__scopeDialog);return n.jsx(Da,{present:i||u.open,children:u.modal?n.jsx(jN,{...c,ref:a}):n.jsx(bN,{...c,ref:a})})});tx.displayName=Hr;var jN=p.forwardRef((r,a)=>{const l=dn(Hr,r.__scopeDialog),i=p.useRef(null),c=We(a,l.contentRef,i);return p.useEffect(()=>{const u=i.current;if(u)return Qp(u)},[]),n.jsx(nx,{...r,ref:c,trapFocus:l.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Te(r.onCloseAutoFocus,u=>{var f;u.preventDefault(),(f=l.triggerRef.current)==null||f.focus()}),onPointerDownOutside:Te(r.onPointerDownOutside,u=>{const f=u.detail.originalEvent,m=f.button===0&&f.ctrlKey===!0;(f.button===2||m)&&u.preventDefault()}),onFocusOutside:Te(r.onFocusOutside,u=>u.preventDefault())})}),bN=p.forwardRef((r,a)=>{const l=dn(Hr,r.__scopeDialog),i=p.useRef(!1),c=p.useRef(!1);return n.jsx(nx,{...r,ref:a,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:u=>{var f,m;(f=r.onCloseAutoFocus)==null||f.call(r,u),u.defaultPrevented||(i.current||(m=l.triggerRef.current)==null||m.focus(),u.preventDefault()),i.current=!1,c.current=!1},onInteractOutside:u=>{var x,y;(x=r.onInteractOutside)==null||x.call(r,u),u.defaultPrevented||(i.current=!0,u.detail.originalEvent.type==="pointerdown"&&(c.current=!0));const f=u.target;((y=l.triggerRef.current)==null?void 0:y.contains(f))&&u.preventDefault(),u.detail.originalEvent.type==="focusin"&&c.current&&u.preventDefault()}})}),nx=p.forwardRef((r,a)=>{const{__scopeDialog:l,trapFocus:i,onOpenAutoFocus:c,onCloseAutoFocus:u,...f}=r,m=dn(Hr,l),x=p.useRef(null),y=We(a,x);return zp(),n.jsxs(n.Fragment,{children:[n.jsx(Ld,{asChild:!0,loop:!0,trapped:i,onMountAutoFocus:c,onUnmountAutoFocus:u,children:n.jsx(Md,{role:"dialog",id:m.contentId,"aria-describedby":m.descriptionId,"aria-labelledby":m.titleId,"data-state":$d(m.open),...f,ref:y,onDismiss:()=>m.onOpenChange(!1)})}),n.jsxs(n.Fragment,{children:[n.jsx(NN,{titleId:m.titleId}),n.jsx(CN,{contentRef:x,descriptionId:m.descriptionId})]})]})}),zd="DialogTitle",rx=p.forwardRef((r,a)=>{const{__scopeDialog:l,...i}=r,c=dn(zd,l);return n.jsx(Ae.h2,{id:c.titleId,...i,ref:a})});rx.displayName=zd;var sx="DialogDescription",ax=p.forwardRef((r,a)=>{const{__scopeDialog:l,...i}=r,c=dn(sx,l);return n.jsx(Ae.p,{id:c.descriptionId,...i,ref:a})});ax.displayName=sx;var lx="DialogClose",ox=p.forwardRef((r,a)=>{const{__scopeDialog:l,...i}=r,c=dn(lx,l);return n.jsx(Ae.button,{type:"button",...i,ref:a,onClick:Te(r.onClick,()=>c.onOpenChange(!1))})});ox.displayName=lx;function $d(r){return r?"open":"closed"}var ix="DialogTitleWarning",[ZC,cx]=Jj(ix,{contentName:Hr,titleName:zd,docsSlug:"dialog"}),NN=({titleId:r})=>{const a=cx(ix),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 p.useEffect(()=>{r&&(document.getElementById(r)||console.error(l))},[l,r]),null},SN="DialogDescriptionWarning",CN=({contentRef:r,descriptionId:a})=>{const i=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${cx(SN).contentName}}.`;return p.useEffect(()=>{var u;const c=(u=r.current)==null?void 0:u.getAttribute("aria-describedby");a&&c&&(document.getElementById(a)||console.warn(i))},[i,r,a]),null},kN=qp,EN=Zp,PN=ex,RN=tx,_N=rx,TN=ax,IN=ox;function jn(r){return n.jsx(kN,{"data-slot":"dialog",...r})}function AN(r){return n.jsx(EN,{...r})}const dx=p.forwardRef(({className:r,...a},l)=>n.jsx(PN,{ref:l,className:He("fixed inset-0 z-50 bg-black/50",r),...a}));dx.displayName="DialogOverlay";const sn=p.forwardRef(({className:r,children:a,showCloseButton:l=!0,...i},c)=>n.jsxs(AN,{children:[n.jsx(dx,{}),n.jsxs(RN,{ref:c,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(IN,{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(Fn,{className:"h-4 w-4"}),n.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));sn.displayName="DialogContent";function bn({className:r,...a}){return n.jsx("div",{className:He("flex flex-col gap-2 text-center sm:text-left",r),...a})}function Dn({className:r,...a}){return n.jsx("div",{className:He("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",r),...a})}function Nn(r){return n.jsx(_N,{className:"text-lg font-semibold leading-none",...r})}function MN(r){return n.jsx(TN,{className:"text-sm text-muted-foreground",...r})}function Bd(r){const a=p.useRef({value:r,previous:r});return p.useMemo(()=>(a.current.value!==r&&(a.current.previous=a.current.value,a.current.value=r),a.current.previous),[r])}function Vd(r){const[a,l]=p.useState(void 0);return St(()=>{if(r){l({width:r.offsetWidth,height:r.offsetHeight});const i=new ResizeObserver(c=>{if(!Array.isArray(c)||!c.length)return;const u=c[0];let f,m;if("borderBoxSize"in u){const x=u.borderBoxSize,y=Array.isArray(x)?x[0]:x;f=y.inlineSize,m=y.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 To="Switch",[LN]=yr(To),[ON,DN]=LN(To),ux=p.forwardRef((r,a)=>{const{__scopeSwitch:l,name:i,checked:c,defaultChecked:u,required:f,disabled:m,value:x="on",onCheckedChange:y,form:g,...v}=r,[P,R]=p.useState(null),S=We(a,b=>R(b)),j=p.useRef(!1),N=P?g||!!P.closest("form"):!0,[C,_]=Wr({prop:c,defaultProp:u??!1,onChange:y,caller:To});return n.jsxs(ON,{scope:l,checked:C,disabled:m,children:[n.jsx(Ae.button,{type:"button",role:"switch","aria-checked":C,"aria-required":f,"data-state":px(C),"data-disabled":m?"":void 0,disabled:m,value:x,...v,ref:S,onClick:Te(r.onClick,b=>{_(I=>!I),N&&(j.current=b.isPropagationStopped(),j.current||b.stopPropagation())})}),N&&n.jsx(mx,{control:P,bubbles:!j.current,name:i,value:x,checked:C,required:f,disabled:m,form:g,style:{transform:"translateX(-100%)"}})]})});ux.displayName=To;var fx="SwitchThumb",hx=p.forwardRef((r,a)=>{const{__scopeSwitch:l,...i}=r,c=DN(fx,l);return n.jsx(Ae.span,{"data-state":px(c.checked),"data-disabled":c.disabled?"":void 0,...i,ref:a})});hx.displayName=fx;var FN="SwitchBubbleInput",mx=p.forwardRef(({__scopeSwitch:r,control:a,checked:l,bubbles:i=!0,...c},u)=>{const f=p.useRef(null),m=We(f,u),x=Bd(l),y=Vd(a);return p.useEffect(()=>{const g=f.current;if(!g)return;const v=window.HTMLInputElement.prototype,R=Object.getOwnPropertyDescriptor(v,"checked").set;if(x!==l&&R){const S=new Event("click",{bubbles:i});R.call(g,l),g.dispatchEvent(S)}},[x,l,i]),n.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:l,...c,tabIndex:-1,ref:m,style:{...c.style,...y,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});mx.displayName=FN;function px(r){return r?"checked":"unchecked"}var xx=ux,zN=hx;const ot=p.forwardRef(({className:r,...a},l)=>n.jsx(xx,{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-[#38bdac] focus-visible:ring-offset-2 focus-visible:ring-offset-[#0a1628] disabled:cursor-not-allowed disabled:opacity-50 data-[state=unchecked]:bg-gray-600 data-[state=checked]:bg-[#38bdac]",r),...a,ref:l,children:n.jsx(zN,{className:He("pointer-events-none block h-4 w-4 rounded-full bg-white shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-4 data-[state=unchecked]:translate-x-0")})}));ot.displayName=xx.displayName;function Ud(r){const a=r+"CollectionProvider",[l,i]=yr(a),[c,u]=l(a,{collectionRef:{current:null},itemMap:new Map}),f=j=>{const{scope:N,children:C}=j,_=cr.useRef(null),b=cr.useRef(new Map).current;return n.jsx(c,{scope:N,itemMap:b,collectionRef:_,children:C})};f.displayName=a;const m=r+"CollectionSlot",x=Aa(m),y=cr.forwardRef((j,N)=>{const{scope:C,children:_}=j,b=u(m,C),I=We(N,b.collectionRef);return n.jsx(x,{ref:I,children:_})});y.displayName=m;const g=r+"CollectionItemSlot",v="data-radix-collection-item",P=Aa(g),R=cr.forwardRef((j,N)=>{const{scope:C,children:_,...b}=j,I=cr.useRef(null),$=We(N,I),G=u(g,C);return cr.useEffect(()=>(G.itemMap.set(I,{ref:I,...b}),()=>void G.itemMap.delete(I))),n.jsx(P,{[v]:"",ref:$,children:_})});R.displayName=g;function S(j){const N=u(r+"CollectionConsumer",j);return cr.useCallback(()=>{const _=N.collectionRef.current;if(!_)return[];const b=Array.from(_.querySelectorAll(`[${v}]`));return Array.from(N.itemMap.values()).sort((G,L)=>b.indexOf(G.ref.current)-b.indexOf(L.ref.current))},[N.collectionRef,N.itemMap])}return[{Provider:f,Slot:y,ItemSlot:R},S,i]}var $N=p.createContext(void 0);function Io(r){const a=p.useContext($N);return r||a||"ltr"}var Kc="rovingFocusGroup.onEntryFocus",BN={bubbles:!1,cancelable:!0},Fa="RovingFocusGroup",[ud,gx,VN]=Ud(Fa),[UN,vx]=yr(Fa,[VN]),[WN,HN]=UN(Fa),yx=p.forwardRef((r,a)=>n.jsx(ud.Provider,{scope:r.__scopeRovingFocusGroup,children:n.jsx(ud.Slot,{scope:r.__scopeRovingFocusGroup,children:n.jsx(KN,{...r,ref:a})})}));yx.displayName=Fa;var KN=p.forwardRef((r,a)=>{const{__scopeRovingFocusGroup:l,orientation:i,loop:c=!1,dir:u,currentTabStopId:f,defaultCurrentTabStopId:m,onCurrentTabStopIdChange:x,onEntryFocus:y,preventScrollOnEntryFocus:g=!1,...v}=r,P=p.useRef(null),R=We(a,P),S=Io(u),[j,N]=Wr({prop:f,defaultProp:m??null,onChange:x,caller:Fa}),[C,_]=p.useState(!1),b=pr(y),I=gx(l),$=p.useRef(!1),[G,L]=p.useState(0);return p.useEffect(()=>{const V=P.current;if(V)return V.addEventListener(Kc,b),()=>V.removeEventListener(Kc,b)},[b]),n.jsx(WN,{scope:l,orientation:i,dir:S,loop:c,currentTabStopId:j,onItemFocus:p.useCallback(V=>N(V),[N]),onItemShiftTab:p.useCallback(()=>_(!0),[]),onFocusableItemAdd:p.useCallback(()=>L(V=>V+1),[]),onFocusableItemRemove:p.useCallback(()=>L(V=>V-1),[]),children:n.jsx(Ae.div,{tabIndex:C||G===0?-1:0,"data-orientation":i,...v,ref:R,style:{outline:"none",...r.style},onMouseDown:Te(r.onMouseDown,()=>{$.current=!0}),onFocus:Te(r.onFocus,V=>{const te=!$.current;if(V.target===V.currentTarget&&te&&!C){const de=new CustomEvent(Kc,BN);if(V.currentTarget.dispatchEvent(de),!de.defaultPrevented){const oe=I().filter(H=>H.focusable),ue=oe.find(H=>H.active),Y=oe.find(H=>H.id===j),z=[ue,Y,...oe].filter(Boolean).map(H=>H.ref.current);bx(z,g)}}$.current=!1}),onBlur:Te(r.onBlur,()=>_(!1))})})}),wx="RovingFocusGroupItem",jx=p.forwardRef((r,a)=>{const{__scopeRovingFocusGroup:l,focusable:i=!0,active:c=!1,tabStopId:u,children:f,...m}=r,x=mr(),y=u||x,g=HN(wx,l),v=g.currentTabStopId===y,P=gx(l),{onFocusableItemAdd:R,onFocusableItemRemove:S,currentTabStopId:j}=g;return p.useEffect(()=>{if(i)return R(),()=>S()},[i,R,S]),n.jsx(ud.ItemSlot,{scope:l,id:y,focusable:i,active:c,children:n.jsx(Ae.span,{tabIndex:v?0:-1,"data-orientation":g.orientation,...m,ref:a,onMouseDown:Te(r.onMouseDown,N=>{i?g.onItemFocus(y):N.preventDefault()}),onFocus:Te(r.onFocus,()=>g.onItemFocus(y)),onKeyDown:Te(r.onKeyDown,N=>{if(N.key==="Tab"&&N.shiftKey){g.onItemShiftTab();return}if(N.target!==N.currentTarget)return;const C=YN(N,g.orientation,g.dir);if(C!==void 0){if(N.metaKey||N.ctrlKey||N.altKey||N.shiftKey)return;N.preventDefault();let b=P().filter(I=>I.focusable).map(I=>I.ref.current);if(C==="last")b.reverse();else if(C==="prev"||C==="next"){C==="prev"&&b.reverse();const I=b.indexOf(N.currentTarget);b=g.loop?qN(b,I+1):b.slice(I+1)}setTimeout(()=>bx(b))}}),children:typeof f=="function"?f({isCurrentTabStop:v,hasTabStop:j!=null}):f})})});jx.displayName=wx;var GN={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function QN(r,a){return a!=="rtl"?r:r==="ArrowLeft"?"ArrowRight":r==="ArrowRight"?"ArrowLeft":r}function YN(r,a,l){const i=QN(r.key,l);if(!(a==="vertical"&&["ArrowLeft","ArrowRight"].includes(i))&&!(a==="horizontal"&&["ArrowUp","ArrowDown"].includes(i)))return GN[i]}function bx(r,a=!1){const l=document.activeElement;for(const i of r)if(i===l||(i.focus({preventScroll:a}),document.activeElement!==l))return}function qN(r,a){return r.map((l,i)=>r[(a+i)%r.length])}var XN=yx,JN=jx,Ao="Tabs",[ZN]=yr(Ao,[vx]),Nx=vx(),[e2,Wd]=ZN(Ao),Sx=p.forwardRef((r,a)=>{const{__scopeTabs:l,value:i,onValueChange:c,defaultValue:u,orientation:f="horizontal",dir:m,activationMode:x="automatic",...y}=r,g=Io(m),[v,P]=Wr({prop:i,onChange:c,defaultProp:u??"",caller:Ao});return n.jsx(e2,{scope:l,baseId:mr(),value:v,onValueChange:P,orientation:f,dir:g,activationMode:x,children:n.jsx(Ae.div,{dir:g,"data-orientation":f,...y,ref:a})})});Sx.displayName=Ao;var Cx="TabsList",kx=p.forwardRef((r,a)=>{const{__scopeTabs:l,loop:i=!0,...c}=r,u=Wd(Cx,l),f=Nx(l);return n.jsx(XN,{asChild:!0,...f,orientation:u.orientation,dir:u.dir,loop:i,children:n.jsx(Ae.div,{role:"tablist","aria-orientation":u.orientation,...c,ref:a})})});kx.displayName=Cx;var Ex="TabsTrigger",Px=p.forwardRef((r,a)=>{const{__scopeTabs:l,value:i,disabled:c=!1,...u}=r,f=Wd(Ex,l),m=Nx(l),x=Tx(f.baseId,i),y=Ix(f.baseId,i),g=i===f.value;return n.jsx(JN,{asChild:!0,...m,focusable:!c,active:g,children:n.jsx(Ae.button,{type:"button",role:"tab","aria-selected":g,"aria-controls":y,"data-state":g?"active":"inactive","data-disabled":c?"":void 0,disabled:c,id:x,...u,ref:a,onMouseDown:Te(r.onMouseDown,v=>{!c&&v.button===0&&v.ctrlKey===!1?f.onValueChange(i):v.preventDefault()}),onKeyDown:Te(r.onKeyDown,v=>{[" ","Enter"].includes(v.key)&&f.onValueChange(i)}),onFocus:Te(r.onFocus,()=>{const v=f.activationMode!=="manual";!g&&!c&&v&&f.onValueChange(i)})})})});Px.displayName=Ex;var Rx="TabsContent",_x=p.forwardRef((r,a)=>{const{__scopeTabs:l,value:i,forceMount:c,children:u,...f}=r,m=Wd(Rx,l),x=Tx(m.baseId,i),y=Ix(m.baseId,i),g=i===m.value,v=p.useRef(g);return p.useEffect(()=>{const P=requestAnimationFrame(()=>v.current=!1);return()=>cancelAnimationFrame(P)},[]),n.jsx(Da,{present:c||g,children:({present:P})=>n.jsx(Ae.div,{"data-state":g?"active":"inactive","data-orientation":m.orientation,role:"tabpanel","aria-labelledby":x,hidden:!P,id:y,tabIndex:0,...f,ref:a,style:{...r.style,animationDuration:v.current?"0s":void 0},children:P&&u})})});_x.displayName=Rx;function Tx(r,a){return`${r}-trigger-${a}`}function Ix(r,a){return`${r}-content-${a}`}var t2=Sx,Ax=kx,Mx=Px,Lx=_x;const Hd=t2,Mo=p.forwardRef(({className:r,...a},l)=>n.jsx(Ax,{ref:l,className:He("inline-flex h-9 items-center justify-center rounded-lg bg-muted p-1 text-muted-foreground",r),...a}));Mo.displayName=Ax.displayName;const Kt=p.forwardRef(({className:r,...a},l)=>n.jsx(Mx,{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}));Kt.displayName=Mx.displayName;const Gt=p.forwardRef(({className:r,...a},l)=>n.jsx(Lx,{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}));Gt.displayName=Lx.displayName;function n2({open:r,onClose:a,userId:l,onUserUpdated:i}){var H;const[c,u]=p.useState(null),[f,m]=p.useState([]),[x,y]=p.useState([]),[g,v]=p.useState(!1),[P,R]=p.useState(!1),[S,j]=p.useState(!1),[N,C]=p.useState("info"),[_,b]=p.useState(""),[I,$]=p.useState(""),[G,L]=p.useState([]),[V,te]=p.useState("");p.useEffect(()=>{r&&l&&de()},[r,l]);async function de(){if(l){v(!0);try{const K=await Ue(`/api/db/users?id=${encodeURIComponent(l)}`);if(K!=null&&K.success&&K.user){const A=K.user;u(A),b(A.phone||""),$(A.nickname||""),L(typeof A.tags=="string"?JSON.parse(A.tags||"[]"):[])}try{const A=await Ue(`/api/user/track?userId=${encodeURIComponent(l)}&limit=50`);A!=null&&A.success&&A.tracks&&m(A.tracks)}catch{m([])}try{const A=await Ue(`/api/db/users/referrals?userId=${encodeURIComponent(l)}`);A!=null&&A.success&&A.referrals&&y(A.referrals)}catch{y([])}}catch(K){console.error("Load user detail error:",K)}finally{v(!1)}}}async function oe(){if(!(c!=null&&c.phone)){alert("用户未绑定手机号,无法同步");return}R(!0);try{const K=await vt("/api/ckb/sync",{action:"full_sync",phone:c.phone,userId:c.id});K!=null&&K.success?(alert("同步成功"),de()):alert("同步失败: "+(K==null?void 0:K.error))}catch(K){console.error("Sync CKB error:",K),alert("同步失败")}finally{R(!1)}}async function ue(){if(c){j(!0);try{const K={id:c.id,phone:_||void 0,nickname:I||void 0,tags:JSON.stringify(G)},A=await ln("/api/db/users",K);A!=null&&A.success?(alert("保存成功"),de(),i==null||i()):alert("保存失败: "+(A==null?void 0:A.error))}catch(K){console.error("Save user error:",K),alert("保存失败")}finally{j(!1)}}}const Y=()=>{V&&!G.includes(V)&&(L([...G,V]),te(""))},B=K=>{L(G.filter(A=>A!==K))},z=K=>{const Q={view_chapter:Ps,purchase:ad,match:Cn,login:ro,register:ro,share:zr,bind_phone:x1,bind_wechat:c1}[K]||dm;return n.jsx(Q,{className:"w-4 h-4"})};return r?n.jsx(jn,{open:r,onOpenChange:()=>a(),children:n.jsxs(sn,{className:"bg-[#0f2137] border-gray-700 text-white max-w-4xl max-h-[90vh] overflow-hidden",children:[n.jsx(bn,{children:n.jsxs(Nn,{className:"text-white flex items-center gap-2",children:[n.jsx(ro,{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:"已绑定手机"})]})}),g?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:""}):((H=c.nickname)==null?void 0:H.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.isAdmin&&n.jsx(Oe,{className:"bg-purple-500/20 text-purple-400 border-0",children:"管理员"}),c.hasFullBook&&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.wechatId&&` · 💬 ${c.wechatId}`]}),n.jsxs("p",{className:"text-gray-500 text-xs mt-1",children:["ID: ",c.id," · 推广码: ",c.referralCode??"-"]})]}),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(Hd,{value:N,onValueChange:C,className:"flex-1 flex flex-col overflow-hidden",children:[n.jsxs(Mo,{className:"bg-[#0a1628] border border-gray-700/50 p-1 mb-4",children:[n.jsx(Kt,{value:"info",className:"data-[state=active]:bg-[#38bdac]/20 data-[state=active]:text-[#38bdac]",children:"基础信息"}),n.jsx(Kt,{value:"tags",className:"data-[state=active]:bg-[#38bdac]/20 data-[state=active]:text-[#38bdac]",children:"标签体系"}),n.jsx(Kt,{value:"tracks",className:"data-[state=active]:bg-[#38bdac]/20 data-[state=active]:text-[#38bdac]",children:"行为轨迹"}),n.jsx(Kt,{value:"relations",className:"data-[state=active]:bg-[#38bdac]/20 data-[state=active]:text-[#38bdac]",children:"关系链路"})]}),n.jsxs(Gt,{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(se,{className:"text-gray-300",children:"手机号"}),n.jsx(le,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"输入手机号",value:_,onChange:K=>b(K.target.value)})]}),n.jsxs("div",{className:"space-y-2",children:[n.jsx(se,{className:"text-gray-300",children:"昵称"}),n.jsx(le,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"输入昵称",value:I,onChange:K=>$(K.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.referralCount??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.pendingEarnings??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.createdAt?new Date(c.createdAt).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(zr,{className:"w-4 h-4 text-[#38bdac]"}),n.jsx("span",{className:"text-white font-medium",children:"存客宝同步"})]}),n.jsx(ge,{size:"sm",onClick:oe,disabled:P||!c.phone,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:P?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.ckbSyncedAt?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.ckbSyncedAt?new Date(c.ckbSyncedAt).toLocaleString():"-"})]})]})]})]}),n.jsx(Gt,{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(_1,{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:[G.map((K,A)=>n.jsxs(Oe,{className:"bg-[#38bdac]/20 text-[#38bdac] border-0 pr-1",children:[K,n.jsx("button",{type:"button",onClick:()=>B(K),className:"ml-1 hover:text-red-400",children:n.jsx(Fn,{className:"w-3 h-3"})})]},A)),G.length===0&&n.jsx("span",{className:"text-gray-500 text-sm",children:"暂无标签"})]}),n.jsxs("div",{className:"flex gap-2",children:[n.jsx(le,{className:"bg-[#162840] border-gray-700 text-white flex-1",placeholder:"添加新标签",value:V,onChange:K=>te(K.target.value),onKeyDown:K=>K.key==="Enter"&&Y()}),n.jsx(ge,{onClick:Y,className:"bg-[#38bdac] hover:bg-[#2da396]",children:"添加"})]})]})}),n.jsx(Gt,{value:"tracks",className:"flex-1 overflow-auto",children:n.jsx("div",{className:"space-y-2",children:f.length>0?f.map(K=>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:z(K.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:K.actionLabel}),K.chapterTitle&&n.jsxs("span",{className:"text-gray-400 text-sm",children:["- ",K.chapterTitle]})]}),n.jsxs("p",{className:"text-gray-500 text-xs mt-1",children:[n.jsx(fp,{className:"w-3 h-3 inline mr-1"}),K.timeAgo," · ",new Date(K.createdAt).toLocaleString()]})]})]},K.id)):n.jsxs("div",{className:"text-center py-12",children:[n.jsx(dm,{className:"w-10 h-10 text-[#38bdac]/40 mx-auto mb-4"}),n.jsx("p",{className:"text-gray-400",children:"暂无行为轨迹"})]})})}),n.jsx(Gt,{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(zr,{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:["共 ",x.length," 人"]})]}),n.jsx("div",{className:"space-y-2 max-h-[200px] overflow-y-auto",children:x.length>0?x.map((K,A)=>{var ne;const Q=K;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:((ne=Q.nickname)==null?void 0:ne.charAt(0))||"?"}),n.jsx("span",{className:"text-white text-sm",children:Q.nickname})]}),n.jsxs("div",{className:"flex items-center gap-2",children:[Q.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:Q.createdAt?new Date(Q.createdAt).toLocaleDateString():""})]})]},Q.id||A)}):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(ge,{variant:"outline",onClick:a,className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:[n.jsx(Fn,{className:"w-4 h-4 mr-2"}),"关闭"]}),n.jsxs(ge,{onClick:ue,disabled:S,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:[n.jsx(an,{className:"w-4 h-4 mr-2"}),S?"保存中...":"保存修改"]})]})]}):n.jsx("div",{className:"text-center py-12 text-gray-500",children:"用户不存在"})]})}):null}const Gc={isVip:!1,vipExpireDate:"",vipSort:"",vipRole:"",vipRoleCustom:"",vipName:"",vipProject:"",vipContact:"",vipBio:""};function r2({open:r,onClose:a,userId:l,userNickname:i="",onSaved:c}){const[u,f]=p.useState(Gc),[m,x]=p.useState([]),[y,g]=p.useState(!1),[v,P]=p.useState(!1);p.useEffect(()=>{if(!r){f(Gc);return}let S=!1;return g(!0),Promise.all([Ue("/api/db/vip-roles"),l?Ue(`/api/db/users?id=${encodeURIComponent(l)}`):Promise.resolve(null)]).then(([j,N])=>{if(S)return;const C=j!=null&&j.success&&j.data?j.data:[];x(C);const _=N&&N.user?N.user:null;if(_){const b=String(_.vipRole??""),I=C.some($=>$.name===b);f({isVip:!!(_.isVip??!1),vipExpireDate:_.vipExpireDate?String(_.vipExpireDate).slice(0,10):"",vipSort:typeof _.vipSort=="number"?_.vipSort:"",vipRole:I?b:b?"__custom__":"",vipRoleCustom:I?"":b,vipName:String(_.vipName??""),vipProject:String(_.vipProject??""),vipContact:String(_.vipContact??""),vipBio:String(_.vipBio??"")})}else f(Gc)}).catch(j=>{S||console.error("Load error:",j)}).finally(()=>{S||g(!1)}),()=>{S=!0}},[r,l]);async function R(){if(l){if(u.isVip&&!u.vipExpireDate.trim()){alert("开启 VIP 时请填写有效到期日");return}if(u.isVip&&u.vipExpireDate.trim()){const S=new Date(u.vipExpireDate);if(isNaN(S.getTime())){alert("到期日格式无效,请使用 YYYY-MM-DD");return}}P(!0);try{const S=u.vipRole==="__custom__"?u.vipRoleCustom.trim():u.vipRole,j={id:l,isVip:u.isVip,vipExpireDate:u.isVip?u.vipExpireDate:void 0,vipSort:u.vipSort===""?void 0:u.vipSort,vipRole:S||void 0,vipName:u.vipName||void 0,vipProject:u.vipProject||void 0,vipContact:u.vipContact||void 0,vipBio:u.vipBio||void 0},N=await ln("/api/db/users",j);N!=null&&N.success?(alert("VIP 设置已保存"),c==null||c(),a()):alert("保存失败: "+(N==null?void 0:N.error))}catch(S){console.error("Save VIP error:",S),alert("保存失败")}finally{P(!1)}}}return r?n.jsx(jn,{open:r,onOpenChange:()=>a(),children:n.jsxs(sn,{className:"bg-[#0f2137] border-gray-700 text-white max-w-md",children:[n.jsx(bn,{children:n.jsxs(Nn,{className:"text-white flex items-center gap-2",children:[n.jsx(ko,{className:"w-5 h-5 text-amber-400"}),"设置 VIP - ",i||l]})}),y?n.jsx("div",{className:"py-8 text-center text-gray-400",children:"加载中..."}):n.jsxs("div",{className:"space-y-4 py-4",children:[n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsx(se,{className:"text-gray-300",children:"VIP 会员"}),n.jsx(ot,{checked:u.isVip,onCheckedChange:S=>f(j=>({...j,isVip:S}))})]}),u.isVip&&n.jsxs(n.Fragment,{children:[n.jsxs("div",{className:"space-y-2",children:[n.jsxs(se,{className:"text-gray-300",children:["到期日 (YYYY-MM-DD) ",n.jsx("span",{className:"text-amber-400",children:"*"})]}),n.jsx(le,{type:"date",className:"bg-[#0a1628] border-gray-700 text-white",value:u.vipExpireDate,onChange:S=>f(j=>({...j,vipExpireDate:S.target.value}))})]}),n.jsxs("div",{className:"space-y-2",children:[n.jsx(se,{className:"text-gray-300",children:"排序"}),n.jsx(le,{type:"number",className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"数字越小越靠前,留空按时间",value:u.vipSort===""?"":u.vipSort,onChange:S=>{const j=S.target.value;f(N=>({...N,vipSort:j===""?"":parseInt(j,10)||0}))}})]})]}),n.jsxs("div",{className:"space-y-2",children:[n.jsx(se,{className:"text-gray-300",children:"角色"}),n.jsxs("select",{className:"w-full bg-[#0a1628] border border-gray-700 text-white rounded-md px-3 py-2",value:u.vipRole,onChange:S=>f(j=>({...j,vipRole:S.target.value})),children:[n.jsx("option",{value:"",children:"请选择或下方手动填写"}),m.map(S=>n.jsx("option",{value:S.name,children:S.name},S.id)),n.jsx("option",{value:"__custom__",children:"其他(手动填写)"})]}),u.vipRole==="__custom__"&&n.jsx(le,{className:"bg-[#0a1628] border-gray-700 text-white mt-1",placeholder:"输入自定义角色",value:u.vipRoleCustom,onChange:S=>f(j=>({...j,vipRoleCustom:S.target.value}))})]}),n.jsxs("div",{className:"space-y-2",children:[n.jsx(se,{className:"text-gray-300",children:"VIP 展示名"}),n.jsx(le,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"创业老板排行展示名",value:u.vipName,onChange:S=>f(j=>({...j,vipName:S.target.value}))})]}),n.jsxs("div",{className:"space-y-2",children:[n.jsx(se,{className:"text-gray-300",children:"项目/公司"}),n.jsx(le,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"项目名称",value:u.vipProject,onChange:S=>f(j=>({...j,vipProject:S.target.value}))})]}),n.jsxs("div",{className:"space-y-2",children:[n.jsx(se,{className:"text-gray-300",children:"联系方式"}),n.jsx(le,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"微信号或手机",value:u.vipContact,onChange:S=>f(j=>({...j,vipContact:S.target.value}))})]}),n.jsxs("div",{className:"space-y-2",children:[n.jsx(se,{className:"text-gray-300",children:"一句话简介"}),n.jsx(le,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"简要描述业务",value:u.vipBio,onChange:S=>f(j=>({...j,vipBio:S.target.value}))})]})]}),n.jsxs(Dn,{children:[n.jsxs(ge,{variant:"outline",onClick:a,className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:[n.jsx(Fn,{className:"w-4 h-4 mr-2"}),"取消"]}),n.jsxs(ge,{onClick:R,disabled:v||y,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:[n.jsx(an,{className:"w-4 h-4 mr-2"}),v?"保存中...":"保存"]})]})]})}):null}function s2(){var qr,Vs,Us,Ws,Hs;const[r,a]=p.useState([]),[l,i]=p.useState(0),[c,u]=p.useState(1),[f,m]=p.useState(10),[x,y]=p.useState(""),g=Ap(x,300),[v,P]=p.useState("all"),[R,S]=p.useState(!0),[j,N]=p.useState(null),[C,_]=p.useState(!1),[b,I]=p.useState(!1),[$,G]=p.useState(null),[L,V]=p.useState(""),[te,de]=p.useState(""),[oe,ue]=p.useState(!1),[Y,B]=p.useState(!1),[z,H]=p.useState({referrals:[],stats:{}}),[K,A]=p.useState(!1),[Q,ne]=p.useState(null),[E,k]=p.useState(!1),[q,J]=p.useState(null),[he,me]=p.useState(!1),[W,ie]=p.useState(null),[ce,pe]=p.useState({phone:"",nickname:"",password:"",isAdmin:!1,hasFullBook:!1});async function Pe(){S(!0),N(null);try{const X=new URLSearchParams({page:String(c),pageSize:String(f),search:g,...v==="vip"&&{vip:"true"}}),De=await Ue(`/api/db/users?${X}`);De!=null&&De.success?(a(De.users||[]),i(De.total??0)):N((De==null?void 0:De.error)||"加载失败")}catch(X){console.error("Load users error:",X),N("网络错误,请检查连接")}finally{S(!1)}}p.useEffect(()=>{u(1)},[g,v]),p.useEffect(()=>{Pe()},[c,f,g,v]);const _e=Math.ceil(l/f)||1;async function at(X){if(confirm("确定要删除这个用户吗?"))try{const De=await Td(`/api/db/users?id=${encodeURIComponent(X)}`);De!=null&&De.success?Pe():alert("删除失败: "+((De==null?void 0:De.error)||"未知错误"))}catch(De){console.error("Delete user error:",De),alert("删除失败")}}const yt=X=>{G(X),pe({phone:X.phone||"",nickname:X.nickname||"",password:"",isAdmin:!!(X.isAdmin??!1),hasFullBook:!!(X.hasFullBook??!1)}),_(!0)},un=()=>{G(null),pe({phone:"",nickname:"",password:"",isAdmin:!1,hasFullBook:!1}),_(!0)};async function fn(){if(!ce.phone||!ce.nickname){alert("请填写手机号和昵称");return}ue(!0);try{if($){const X=await ln("/api/db/users",{id:$.id,nickname:ce.nickname,isAdmin:ce.isAdmin,hasFullBook:ce.hasFullBook,...ce.password&&{password:ce.password}});if(!(X!=null&&X.success)){alert("更新失败: "+((X==null?void 0:X.error)||"未知错误"));return}}else{const X=await vt("/api/db/users",{phone:ce.phone,nickname:ce.nickname,password:ce.password,isAdmin:ce.isAdmin});if(!(X!=null&&X.success)){alert("创建失败: "+((X==null?void 0:X.error)||"未知错误"));return}}_(!1),Pe()}catch(X){console.error("Save user error:",X),alert("保存失败")}finally{ue(!1)}}const Qt=X=>{G(X),V(""),de(""),I(!0)};async function br(X){ne(X),B(!0),A(!0);try{const De=await Ue(`/api/db/users/referrals?userId=${encodeURIComponent(X.id)}`);De!=null&&De.success?H({referrals:De.referrals||[],stats:De.stats||{}}):H({referrals:[],stats:{}})}catch(De){console.error("Load referrals error:",De),H({referrals:[],stats:{}})}finally{A(!1)}}const hn=X=>{J(X.id),k(!0)},Nr=X=>{ie(X),me(!0)};async function Vn(){if(!L){alert("请输入新密码");return}if(L!==te){alert("两次输入的密码不一致");return}if(L.length<6){alert("密码长度不能少于6位");return}ue(!0);try{const X=await ln("/api/db/users",{id:$==null?void 0:$.id,password:L});X!=null&&X.success?(alert("密码修改成功"),I(!1)):alert("密码修改失败: "+((X==null?void 0:X.error)||"未知错误"))}catch(X){console.error("Change password error:",X),alert("密码修改失败")}finally{ue(!1)}}return n.jsxs("div",{className:"p-8 max-w-7xl mx-auto",children:[j&&n.jsxs("div",{className:"mb-4 px-4 py-3 rounded-lg bg-red-500/20 border border-red-500/50 text-red-400 text-sm flex items-center justify-between",children:[n.jsx("span",{children:j}),n.jsx("button",{type:"button",onClick:()=>N(null),className:"hover:text-red-300",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:["共 ",l," 位注册用户",v==="vip"&&",当前筛选 VIP"]})]}),n.jsxs("div",{className:"flex items-center gap-4",children:[n.jsxs(ge,{variant:"outline",onClick:Pe,disabled:R,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("select",{value:v,onChange:X=>{P(X.target.value),u(1)},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:"vip",children:"VIP会员"})]}),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(le,{type:"text",placeholder:"搜索用户...",className:"pl-10 bg-[#0f2137] border-gray-700 text-white placeholder:text-gray-500 w-64",value:x,onChange:X=>y(X.target.value)})]}),n.jsxs(ge,{onClick:un,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:[n.jsx(pm,{className:"w-4 h-4 mr-2"}),"添加用户"]})]})]}),n.jsx(jn,{open:C,onOpenChange:_,children:n.jsxs(sn,{className:"bg-[#0f2137] border-gray-700 text-white max-w-lg",children:[n.jsx(bn,{children:n.jsxs(Nn,{className:"text-white flex items-center gap-2",children:[$?n.jsx(Ur,{className:"w-5 h-5 text-[#38bdac]"}):n.jsx(pm,{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(se,{className:"text-gray-300",children:"手机号"}),n.jsx(le,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"请输入手机号",value:ce.phone,onChange:X=>pe({...ce,phone:X.target.value}),disabled:!!$})]}),n.jsxs("div",{className:"space-y-2",children:[n.jsx(se,{className:"text-gray-300",children:"昵称"}),n.jsx(le,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"请输入昵称",value:ce.nickname,onChange:X=>pe({...ce,nickname:X.target.value})})]}),n.jsxs("div",{className:"space-y-2",children:[n.jsx(se,{className:"text-gray-300",children:$?"新密码 (留空则不修改)":"密码"}),n.jsx(le,{type:"password",className:"bg-[#0a1628] border-gray-700 text-white",placeholder:$?"留空则不修改":"请输入密码",value:ce.password,onChange:X=>pe({...ce,password:X.target.value})})]}),n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsx(se,{className:"text-gray-300",children:"管理员权限"}),n.jsx(ot,{checked:ce.isAdmin,onCheckedChange:X=>pe({...ce,isAdmin:X})})]}),n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsx(se,{className:"text-gray-300",children:"已购全书"}),n.jsx(ot,{checked:ce.hasFullBook,onCheckedChange:X=>pe({...ce,hasFullBook:X})})]})]}),n.jsxs(Dn,{children:[n.jsxs(ge,{variant:"outline",onClick:()=>_(!1),className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:[n.jsx(Fn,{className:"w-4 h-4 mr-2"}),"取消"]}),n.jsxs(ge,{onClick:fn,disabled:oe,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:[n.jsx(an,{className:"w-4 h-4 mr-2"}),oe?"保存中...":"保存"]})]})]})}),n.jsx(jn,{open:b,onOpenChange:I,children:n.jsxs(sn,{className:"bg-[#0f2137] border-gray-700 text-white max-w-md",children:[n.jsx(bn,{children:n.jsxs(Nn,{className:"text-white flex items-center gap-2",children:[n.jsx(um,{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:["用户:",$==null?void 0:$.nickname]}),n.jsxs("p",{className:"text-gray-400 text-sm",children:["手机号:",$==null?void 0:$.phone]})]}),n.jsxs("div",{className:"space-y-2",children:[n.jsx(se,{className:"text-gray-300",children:"新密码"}),n.jsx(le,{type:"password",className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"请输入新密码 (至少6位)",value:L,onChange:X=>V(X.target.value)})]}),n.jsxs("div",{className:"space-y-2",children:[n.jsx(se,{className:"text-gray-300",children:"确认密码"}),n.jsx(le,{type:"password",className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"请再次输入新密码",value:te,onChange:X=>de(X.target.value)})]})]}),n.jsxs(Dn,{children:[n.jsx(ge,{variant:"outline",onClick:()=>I(!1),className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:"取消"}),n.jsx(ge,{onClick:Vn,disabled:oe,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:oe?"保存中...":"确认修改"})]})]})}),n.jsx(n2,{open:E,onClose:()=>k(!1),userId:q,onUserUpdated:Pe}),n.jsx(r2,{open:he,onClose:()=>{me(!1),ie(null)},userId:(W==null?void 0:W.id)??null,userNickname:W==null?void 0:W.nickname,onSaved:Pe}),n.jsx(jn,{open:Y,onOpenChange:B,children:n.jsxs(sn,{className:"bg-[#0f2137] border-gray-700 text-white max-w-2xl max-h-[80vh] overflow-auto",children:[n.jsx(bn,{children:n.jsxs(Nn,{className:"text-white flex items-center gap-2",children:[n.jsx(Cn,{className:"w-5 h-5 text-[#38bdac]"}),"绑定关系详情 - ",Q==null?void 0:Q.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:((qr=z.stats)==null?void 0:qr.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:((Vs=z.stats)==null?void 0:Vs.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:["¥",(((Us=z.stats)==null?void 0:Us.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:["¥",(((Ws=z.stats)==null?void 0:Ws.pendingEarnings)||0).toFixed(2)]}),n.jsx("div",{className:"text-xs text-gray-400",children:"待提现"})]})]}),K?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:"加载中..."})]}):(((Hs=z.referrals)==null?void 0:Hs.length)??0)>0?n.jsx("div",{className:"space-y-2 max-h-[300px] overflow-y-auto",children:(z.referrals??[]).map((X,De)=>{var Yt;const pt=X;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:((Yt=pt.nickname)==null?void 0:Yt.charAt(0))||"?"}),n.jsxs("div",{children:[n.jsx("div",{className:"text-white text-sm",children:pt.nickname}),n.jsx("div",{className:"text-xs text-gray-500",children:pt.phone||(pt.hasOpenId?"微信用户":"未绑定")})]})]}),n.jsxs("div",{className:"flex items-center gap-2",children:[pt.status==="vip"&&n.jsx(Oe,{className:"bg-green-500/20 text-green-400 border-0 text-xs",children:"全书已购"}),pt.status==="paid"&&n.jsxs(Oe,{className:"bg-blue-500/20 text-blue-400 border-0 text-xs",children:["已付费",pt.purchasedSections,"章"]}),pt.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:pt.createdAt?new Date(pt.createdAt).toLocaleDateString():""})]})]},pt.id||De)})}):n.jsx("div",{className:"text-center py-8 text-gray-500",children:"暂无绑定用户"})]}),n.jsx(Dn,{children:n.jsx(ge,{variant:"outline",onClick:()=>B(!1),className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:"关闭"})})]})}),n.jsx(Se,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:n.jsx(Ce,{className:"p-0",children:R?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("div",{children:[n.jsxs(Ls,{children:[n.jsx(Os,{children:n.jsxs(Et,{className:"bg-[#0a1628] hover:bg-[#0a1628] border-gray-700",children:[n.jsx(Be,{className:"text-gray-400",children:"用户信息"}),n.jsx(Be,{className:"text-gray-400",children:"绑定信息"}),n.jsx(Be,{className:"text-gray-400",children:"购买状态"}),n.jsx(Be,{className:"text-gray-400",children:"分销收益"}),n.jsx(Be,{className:"text-gray-400",children:"推广码"}),n.jsx(Be,{className:"text-gray-400",children:"注册时间"}),n.jsx(Be,{className:"text-right text-gray-400",children:"操作"})]})}),n.jsxs(Ds,{children:[r.map(X=>{var De,pt,Yt;return n.jsxs(Et,{className:"hover:bg-[#0a1628] border-gray-700/50",children:[n.jsx(Le,{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:X.avatar?n.jsx("img",{src:X.avatar,className:"w-full h-full rounded-full object-cover",alt:""}):((De=X.nickname)==null?void 0:De.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:X.nickname}),X.isAdmin&&n.jsx(Oe,{className:"bg-purple-500/20 text-purple-400 hover:bg-purple-500/20 border-0 text-xs",children:"管理员"}),X.openId&&!((pt=X.id)!=null&&pt.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:X.openId?X.openId.slice(0,12)+"...":(Yt=X.id)==null?void 0:Yt.slice(0,12)})]})]})}),n.jsx(Le,{children:n.jsxs("div",{className:"space-y-1",children:[X.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:X.phone})]}),X.wechatId&&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:X.wechatId})]}),X.openId&&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:X.openId,children:[X.openId.slice(0,12),"..."]})]}),!X.phone&&!X.wechatId&&!X.openId&&n.jsx("span",{className:"text-gray-600 text-xs",children:"未绑定"})]})}),n.jsx(Le,{children:X.hasFullBook?n.jsx(Oe,{className:"bg-amber-500/20 text-amber-400 hover:bg-amber-500/20 border-0",children:"VIP"}):n.jsx(Oe,{variant:"outline",className:"text-gray-500 border-gray-600",children:"未购买"})}),n.jsx(Le,{children:n.jsxs("div",{className:"space-y-1",children:[n.jsxs("div",{className:"text-white font-medium",children:["¥",parseFloat(String(X.earnings||0)).toFixed(2)]}),parseFloat(String(X.pendingEarnings||0))>0&&n.jsxs("div",{className:"text-xs text-yellow-400",children:["待提现: ¥",parseFloat(String(X.pendingEarnings||0)).toFixed(2)]}),n.jsxs("div",{className:"text-xs text-[#38bdac] cursor-pointer hover:underline flex items-center gap-1",onClick:()=>br(X),onKeyDown:Sr=>Sr.key==="Enter"&&br(X),role:"button",tabIndex:0,children:[n.jsx(Cn,{className:"w-3 h-3"}),"绑定",X.referralCount||0,"人"]})]})}),n.jsx(Le,{children:n.jsx("code",{className:"text-[#38bdac] text-xs bg-[#38bdac]/10 px-2 py-0.5 rounded",children:X.referralCode||"-"})}),n.jsx(Le,{className:"text-gray-400",children:X.createdAt?new Date(X.createdAt).toLocaleDateString():"-"}),n.jsx(Le,{className:"text-right",children:n.jsxs("div",{className:"flex items-center justify-end gap-1",children:[n.jsx(ge,{variant:"ghost",size:"sm",onClick:()=>Nr(X),className:"text-gray-400 hover:text-amber-400 hover:bg-amber-400/10",title:"设置 VIP",children:n.jsx(ko,{className:"w-4 h-4"})}),n.jsx(ge,{variant:"ghost",size:"sm",onClick:()=>hn(X),className:"text-gray-400 hover:text-blue-400 hover:bg-blue-400/10",title:"查看详情",children:n.jsx(Rd,{className:"w-4 h-4"})}),n.jsx(ge,{variant:"ghost",size:"sm",onClick:()=>yt(X),className:"text-gray-400 hover:text-[#38bdac] hover:bg-[#38bdac]/10",title:"编辑",children:n.jsx(Ur,{className:"w-4 h-4"})}),n.jsx(ge,{variant:"ghost",size:"sm",onClick:()=>Qt(X),className:"text-gray-400 hover:text-yellow-400 hover:bg-yellow-400/10",title:"修改密码",children:n.jsx(um,{className:"w-4 h-4"})}),n.jsx(ge,{variant:"ghost",size:"sm",className:"text-red-400 hover:text-red-300 hover:bg-red-500/10",onClick:()=>at(X.id),title:"删除",children:n.jsx(Eo,{className:"w-4 h-4"})})]})})]},X.id)}),r.length===0&&n.jsx(Et,{children:n.jsx(Le,{colSpan:7,className:"text-center py-12 text-gray-500",children:"暂无用户数据"})})]})]}),n.jsx(Vr,{page:c,totalPages:_e,total:l,pageSize:f,onPageChange:u,onPageSizeChange:X=>{m(X),u(1)}})]})})})]})}function a2(){const[r,a]=p.useState("overview"),[l,i]=p.useState([]),[c,u]=p.useState(null),[f,m]=p.useState([]),[x,y]=p.useState([]),[g,v]=p.useState([]),[P,R]=p.useState(!0),[S,j]=p.useState(null),[N,C]=p.useState(""),[_,b]=p.useState("all"),[I,$]=p.useState(1),[G,L]=p.useState(10),[V,te]=p.useState(0),[de,oe]=p.useState(new Set);p.useEffect(()=>{ue()},[]),p.useEffect(()=>{$(1)},[r,_]),p.useEffect(()=>{Y(r)},[r]),p.useEffect(()=>{["orders","bindings","withdrawals"].includes(r)&&Y(r,!0)},[I,G,_,N]);async function ue(){j(null);try{const k=await Ue("/api/admin/distribution/overview");k!=null&&k.success&&k.overview&&u(k.overview)}catch(k){console.error("[Admin] 概览接口异常:",k),j("加载概览失败")}try{const k=await Ue("/api/db/users");v((k==null?void 0:k.users)||[])}catch(k){console.error("[Admin] 用户数据加载失败:",k)}}async function Y(k,q=!1){var J;if(!(!q&&de.has(k))){R(!0);try{const he=g;switch(k){case"overview":break;case"orders":{try{const me=new URLSearchParams({page:String(I),pageSize:String(G),..._!=="all"&&{status:_},...N&&{search:N}}),W=await Ue(`/api/orders?${me}`);if(W!=null&&W.success&&W.orders){const ie=W.orders.map(ce=>{const pe=he.find(_e=>_e.id===ce.userId),Pe=ce.referrerId?he.find(_e=>_e.id===ce.referrerId):null;return{...ce,amount:parseFloat(String(ce.amount))||0,userNickname:(pe==null?void 0:pe.nickname)||ce.userNickname||"未知用户",userPhone:(pe==null?void 0:pe.phone)||ce.userPhone||"-",referrerNickname:(Pe==null?void 0:Pe.nickname)||null,referrerCode:(Pe==null?void 0:Pe.referralCode)??null,type:ce.productType||ce.type}});i(ie),te(W.total??ie.length)}else i([]),te(0)}catch(me){console.error(me),j("加载订单失败"),i([])}break}case"bindings":{try{const me=new URLSearchParams({page:String(I),pageSize:String(G),..._!=="all"&&{status:_}}),W=await Ue(`/api/db/distribution?${me}`);m((W==null?void 0:W.bindings)||[]),te((W==null?void 0:W.total)??((J=W==null?void 0:W.bindings)==null?void 0:J.length)??0)}catch(me){console.error(me),j("加载绑定数据失败"),m([])}break}case"withdrawals":{try{const me=_==="completed"?"success":_==="rejected"?"failed":_,W=new URLSearchParams({...me&&me!=="all"&&{status:me},page:String(I),pageSize:String(G)}),ie=await Ue(`/api/admin/withdrawals?${W}`);if(ie!=null&&ie.success&&ie.withdrawals){const ce=ie.withdrawals.map(pe=>({...pe,account:pe.account??"未绑定微信号",status:pe.status==="success"?"completed":pe.status==="failed"?"rejected":pe.status}));y(ce),te((ie==null?void 0:ie.total)??ce.length)}else ie!=null&&ie.success||j(`获取提现记录失败: ${(ie==null?void 0:ie.error)||"未知错误"}`),y([])}catch(me){console.error(me),j("加载提现数据失败"),y([])}break}}oe(me=>new Set(me).add(k))}catch(he){console.error(he)}finally{R(!1)}}}async function B(){j(null),oe(k=>{const q=new Set(k);return q.delete(r),q}),r==="overview"&&ue(),await Y(r,!0)}async function z(k){if(confirm("确认审核通过并打款?"))try{const q=await ln("/api/admin/withdrawals",{id:k,action:"approve"});if(!(q!=null&&q.success)){const J=(q==null?void 0:q.message)||(q==null?void 0:q.error)||"操作失败";alert(J);return}await B()}catch(q){console.error(q),alert("操作失败")}}async function H(k){const q=prompt("请输入拒绝原因:");if(q)try{const J=await ln("/api/admin/withdrawals",{id:k,action:"reject",errorMessage:q});if(!(J!=null&&J.success)){alert((J==null?void 0:J.error)||"操作失败");return}await B()}catch(J){console.error(J),alert("操作失败")}}function K(k){const q={active:"bg-green-500/20 text-green-400",converted:"bg-blue-500/20 text-blue-400",expired:"bg-gray-500/20 text-gray-400",cancelled:"bg-red-500/20 text-red-400",pending:"bg-orange-500/20 text-orange-400",pending_confirm:"bg-orange-500/20 text-orange-400",processing:"bg-blue-500/20 text-blue-400",completed:"bg-green-500/20 text-green-400",rejected:"bg-red-500/20 text-red-400"},J={active:"有效",converted:"已转化",expired:"已过期",cancelled:"已取消",pending:"待审核",pending_confirm:"待用户确认",processing:"处理中",completed:"已完成",rejected:"已拒绝"};return n.jsx(Oe,{className:`${q[k]||"bg-gray-500/20 text-gray-400"} border-0`,children:J[k]||k})}const A=Math.ceil(V/G)||1,Q=l,ne=f.filter(k=>{var J,he,me,W;if(!N)return!0;const q=N.toLowerCase();return((J=k.refereeNickname)==null?void 0:J.toLowerCase().includes(q))||((he=k.refereePhone)==null?void 0:he.includes(q))||((me=k.referrerName)==null?void 0:me.toLowerCase().includes(q))||((W=k.referrerCode)==null?void 0:W.toLowerCase().includes(q))}),E=x.filter(k=>{var J;if(!N)return!0;const q=N.toLowerCase();return((J=k.userName)==null?void 0:J.toLowerCase().includes(q))||k.account&&k.account.toLowerCase().includes(q)});return n.jsxs("div",{className:"p-8 max-w-7xl mx-auto",children:[S&&n.jsxs("div",{className:"mb-4 px-4 py-3 rounded-lg bg-red-500/20 border border-red-500/50 text-red-400 text-sm flex items-center justify-between",children:[n.jsx("span",{children:S}),n.jsx("button",{type:"button",onClick:()=>j(null),className:"hover:text-red-300",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(ge,{onClick:B,disabled:P,variant:"outline",className:"border-gray-700 text-gray-300 hover:bg-gray-800",children:[n.jsx(Ze,{className:`w-4 h-4 mr-2 ${P?"animate-spin":""}`}),"刷新数据"]})]}),n.jsx("div",{className:"flex gap-2 mb-6 border-b border-gray-700 pb-4",children:[{key:"overview",label:"数据概览",icon:od},{key:"orders",label:"订单管理",icon:uo},{key:"bindings",label:"绑定管理",icon:zr},{key:"withdrawals",label:"提现审核",icon:Rs}].map(k=>n.jsxs("button",{type:"button",onClick:()=>{a(k.key),b("all"),C("")},className:`flex items-center gap-2 px-4 py-2 rounded-lg text-sm font-medium transition-colors ${r===k.key?"bg-[#38bdac] text-white":"text-gray-400 hover:text-white hover:bg-gray-800"}`,children:[n.jsx(k.icon,{className:"w-4 h-4"}),k.label]},k.key))}),P?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(Se,{className:"bg-[#0f2137] border-gray-700/50",children:n.jsx(Ce,{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(Rd,{className:"w-6 h-6 text-blue-400"})})]})})}),n.jsx(Se,{className:"bg-[#0f2137] border-gray-700/50",children:n.jsx(Ce,{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(zr,{className:"w-6 h-6 text-green-400"})})]})})}),n.jsx(Se,{className:"bg-[#0f2137] border-gray-700/50",children:n.jsx(Ce,{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(nd,{className:"w-6 h-6 text-purple-400"})})]})})}),n.jsx(Se,{className:"bg-[#0f2137] border-gray-700/50",children:n.jsx(Ce,{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(uo,{className:"w-6 h-6 text-[#38bdac]"})})]})})})]}),n.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[n.jsx(Se,{className:"bg-orange-500/10 border-orange-500/30",children:n.jsx(Ce,{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(fp,{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(Se,{className:"bg-blue-500/10 border-blue-500/30",children:n.jsx(Ce,{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(Rs,{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(ge,{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(Se,{className:"bg-[#0f2137] border-gray-700/50",children:[n.jsx(Fe,{children:n.jsxs(ze,{className:"text-white flex items-center gap-2",children:[n.jsx(td,{className:"w-5 h-5 text-[#38bdac]"}),"本月统计"]})}),n.jsx(Ce,{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(Se,{className:"bg-[#0f2137] border-gray-700/50",children:[n.jsx(Fe,{children:n.jsxs(ze,{className:"text-white flex items-center gap-2",children:[n.jsx(od,{className:"w-5 h-5 text-[#38bdac]"}),"累计统计"]})}),n.jsxs(Ce,{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(Se,{className:"bg-[#0f2137] border-gray-700/50",children:[n.jsx(Fe,{children:n.jsxs(ze,{className:"text-white flex items-center gap-2",children:[n.jsx(Cn,{className:"w-5 h-5 text-[#38bdac]"}),"推广统计"]})}),n.jsx(Ce,{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(le,{value:N,onChange:k=>C(k.target.value),placeholder:"搜索订单号、用户名、手机号...",className:"pl-10 bg-[#0f2137] border-gray-700 text-white"})]}),n.jsxs("select",{value:_,onChange:k=>b(k.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(Se,{className:"bg-[#0f2137] border-gray-700/50",children:n.jsxs(Ce,{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:Q.map(k=>{var q,J;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:[(q=k.id)==null?void 0:q.slice(0,12),"..."]}),n.jsx("td",{className:"p-4",children:n.jsxs("div",{children:[n.jsx("p",{className:"text-white text-sm",children:k.userNickname}),n.jsx("p",{className:"text-gray-500 text-xs",children:k.userPhone})]})}),n.jsx("td",{className:"p-4",children:n.jsxs("div",{children:[n.jsx("p",{className:"text-white text-sm",children:(()=>{const he=k.productType||k.type;return he==="fullbook"?`${k.bookName||"《底层逻辑》"} - 全本`:he==="match"?"匹配次数购买":`${k.bookName||"《底层逻辑》"} - ${k.sectionTitle||k.chapterTitle||`章节${k.productId||k.sectionId||""}`}`})()}),n.jsx("p",{className:"text-gray-500 text-xs",children:(()=>{const he=k.productType||k.type;return he==="fullbook"?"全书解锁":he==="match"?"功能权益":k.chapterTitle||"单章购买"})()})]})}),n.jsxs("td",{className:"p-4 text-[#38bdac] font-bold",children:["¥",typeof k.amount=="number"?k.amount.toFixed(2):parseFloat(String(k.amount||"0")).toFixed(2)]}),n.jsx("td",{className:"p-4 text-gray-300",children:k.paymentMethod==="wechat"?"微信支付":k.paymentMethod==="alipay"?"支付宝":k.paymentMethod||"微信支付"}),n.jsx("td",{className:"p-4",children:k.status==="completed"||k.status==="paid"?n.jsx(Oe,{className:"bg-green-500/20 text-green-400 border-0",children:"已完成"}):k.status==="pending"||k.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:k.referrerId||k.referralCode?n.jsxs("span",{title:k.referralCode||k.referrerCode||k.referrerId||"",children:[k.referrerNickname||k.referralCode||k.referrerCode||((J=k.referrerId)==null?void 0:J.slice(0,8)),(k.referralCode||k.referrerCode)&&` (${k.referralCode||k.referrerCode})`]}):"-"}),n.jsx("td",{className:"p-4 text-[#FFD700]",children:k.referrerEarnings?`¥${(typeof k.referrerEarnings=="number"?k.referrerEarnings:parseFloat(String(k.referrerEarnings))).toFixed(2)}`:"-"}),n.jsx("td",{className:"p-4 text-gray-400 text-sm",children:k.createdAt?new Date(k.createdAt).toLocaleString("zh-CN"):"-"})]},k.id)})})]})}),r==="orders"&&n.jsx(Vr,{page:I,totalPages:A,total:V,pageSize:G,onPageChange:$,onPageSizeChange:k=>{L(k),$(1)}})]})})]}),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(le,{value:N,onChange:k=>C(k.target.value),placeholder:"搜索用户昵称、手机号、推广码...",className:"pl-10 bg-[#0f2137] border-gray-700 text-white"})]}),n.jsxs("select",{value:_,onChange:k=>b(k.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(Se,{className:"bg-[#0f2137] border-gray-700/50",children:n.jsxs(Ce,{className:"p-0",children:[ne.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:ne.map(k=>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:k.refereeNickname||"匿名用户"}),n.jsx("p",{className:"text-gray-500 text-xs",children:k.refereePhone})]})}),n.jsx("td",{className:"p-4",children:n.jsxs("div",{children:[n.jsx("p",{className:"text-white",children:k.referrerName||"-"}),n.jsx("p",{className:"text-gray-500 text-xs font-mono",children:k.referrerCode})]})}),n.jsx("td",{className:"p-4 text-gray-400",children:k.boundAt?new Date(k.boundAt).toLocaleDateString("zh-CN"):"-"}),n.jsx("td",{className:"p-4 text-gray-400",children:k.expiresAt?new Date(k.expiresAt).toLocaleDateString("zh-CN"):"-"}),n.jsx("td",{className:"p-4",children:K(k.status)}),n.jsx("td",{className:"p-4",children:k.commission?n.jsxs("span",{className:"text-[#38bdac] font-medium",children:["¥",k.commission.toFixed(2)]}):n.jsx("span",{className:"text-gray-500",children:"-"})})]},k.id))})]})}),r==="bindings"&&n.jsx(Vr,{page:I,totalPages:A,total:V,pageSize:G,onPageChange:$,onPageSizeChange:k=>{L(k),$(1)}})]})})]}),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(le,{value:N,onChange:k=>C(k.target.value),placeholder:"搜索用户名称、账号...",className:"pl-10 bg-[#0f2137] border-gray-700 text-white"})]}),n.jsxs("select",{value:_,onChange:k=>b(k.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(Se,{className:"bg-[#0f2137] border-gray-700/50",children:n.jsxs(Ce,{className:"p-0",children:[E.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:E.map(k=>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:[k.userAvatar?n.jsx("img",{src:k.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:(k.userName||k.name||"?").slice(0,1)}),n.jsx("p",{className:"text-white font-medium",children:k.userName||k.name})]})}),n.jsx("td",{className:"p-4",children:n.jsxs("span",{className:"text-[#38bdac] font-bold",children:["¥",k.amount.toFixed(2)]})}),n.jsx("td",{className:"p-4",children:n.jsx(Oe,{className:k.method==="wechat"?"bg-green-500/20 text-green-400 border-0":"bg-blue-500/20 text-blue-400 border-0",children:k.method==="wechat"?"微信":"支付宝"})}),n.jsx("td",{className:"p-4",children:n.jsxs("div",{children:[n.jsx("p",{className:"text-white font-mono text-xs",children:k.account}),n.jsx("p",{className:"text-gray-500 text-xs",children:k.name})]})}),n.jsx("td",{className:"p-4 text-gray-400",children:k.createdAt?new Date(k.createdAt).toLocaleString("zh-CN"):"-"}),n.jsx("td",{className:"p-4",children:K(k.status)}),n.jsx("td",{className:"p-4 text-right",children:k.status==="pending"&&n.jsxs("div",{className:"flex gap-2 justify-end",children:[n.jsxs(ge,{size:"sm",onClick:()=>z(k.id),className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:[n.jsx(nd,{className:"w-4 h-4 mr-1"}),"通过"]}),n.jsxs(ge,{size:"sm",variant:"outline",onClick:()=>H(k.id),className:"border-red-500/50 text-red-400 hover:bg-red-500/20",children:[n.jsx(Cw,{className:"w-4 h-4 mr-1"}),"拒绝"]})]})})]},k.id))})]})}),r==="withdrawals"&&n.jsx(Vr,{page:I,totalPages:A,total:V,pageSize:G,onPageChange:$,onPageSizeChange:k=>{L(k),$(1)}})]})})]})]})]})}function l2(){const[r,a]=p.useState([]),[l,i]=p.useState({total:0,pendingCount:0,pendingAmount:0,successCount:0,successAmount:0,failedCount:0}),[c,u]=p.useState(!0),[f,m]=p.useState(null),[x,y]=p.useState("all"),[g,v]=p.useState(1),[P,R]=p.useState(10),[S,j]=p.useState(0),[N,C]=p.useState(null);async function _(){var L,V,te,de,oe,ue,Y;u(!0),m(null);try{const B=new URLSearchParams({status:x,page:String(g),pageSize:String(P)}),z=await Ue(`/api/admin/withdrawals?${B}`);if(z!=null&&z.success){const H=z.withdrawals||[];a(H),j(z.total??((L=z.stats)==null?void 0:L.total)??H.length),i({total:((V=z.stats)==null?void 0:V.total)??z.total??H.length,pendingCount:((te=z.stats)==null?void 0:te.pendingCount)??0,pendingAmount:((de=z.stats)==null?void 0:de.pendingAmount)??0,successCount:((oe=z.stats)==null?void 0:oe.successCount)??0,successAmount:((ue=z.stats)==null?void 0:ue.successAmount)??0,failedCount:((Y=z.stats)==null?void 0:Y.failedCount)??0})}else m("加载提现记录失败")}catch(B){console.error("Load withdrawals error:",B),m("加载失败,请检查网络后重试")}finally{u(!1)}}p.useEffect(()=>{v(1)},[x]),p.useEffect(()=>{_()},[x,g,P]);const b=Math.ceil(S/P)||1;async function I(L){const V=r.find(te=>te.id===L);if(V!=null&&V.userCommissionInfo&&V.userCommissionInfo.availableAfterThis<0){if(!confirm(`⚠️ 风险警告:该用户审核后余额为负数(¥${V.userCommissionInfo.availableAfterThis.toFixed(2)}),可能存在超额提现。 + +确认已核实用户账户并完成打款?`))return}else if(!confirm("确认已完成打款?批准后将更新用户提现记录。"))return;C(L);try{const te=await ln("/api/admin/withdrawals",{id:L,action:"approve"});te!=null&&te.success?_():alert("操作失败: "+((te==null?void 0:te.error)??""))}catch{alert("操作失败")}finally{C(null)}}async function $(L){const V=prompt("请输入拒绝原因(将返还用户余额):");if(V){C(L);try{const te=await ln("/api/admin/withdrawals",{id:L,action:"reject",errorMessage:V});te!=null&&te.success?_():alert("操作失败: "+((te==null?void 0:te.error)??""))}catch{alert("操作失败")}finally{C(null)}}}function G(L){switch(L){case"pending":return n.jsx(Oe,{className:"bg-orange-500/20 text-orange-400 hover:bg-orange-500/20 border-0",children:"待处理"});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:L})}}return n.jsxs("div",{className:"p-8 max-w-6xl mx-auto",children:[f&&n.jsxs("div",{className:"mb-4 px-4 py-3 rounded-lg bg-red-500/20 border border-red-500/50 text-red-400 text-sm flex items-center justify-between",children:[n.jsx("span",{children:f}),n.jsx("button",{type:"button",onClick:()=>m(null),className:"hover:text-red-300",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(ge,{variant:"outline",onClick:_,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(Se,{className:"bg-gradient-to-r from-[#38bdac]/10 to-[#0f2137] border-[#38bdac]/30 mb-6",children:n.jsx(Ce,{className:"p-4",children:n.jsxs("div",{className:"flex items-start gap-3",children:[n.jsx(uo,{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(Se,{className:"bg-[#0f2137] border-gray-700/50",children:n.jsxs(Ce,{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(Se,{className:"bg-[#0f2137] border-gray-700/50",children:n.jsxs(Ce,{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(Se,{className:"bg-[#0f2137] border-gray-700/50",children:n.jsxs(Ce,{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(Se,{className:"bg-[#0f2137] border-gray-700/50",children:n.jsxs(Ce,{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(L=>n.jsx(ge,{variant:x===L?"default":"outline",size:"sm",onClick:()=>y(L),className:x===L?"bg-[#38bdac] hover:bg-[#2da396] text-white":"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:L==="all"?"全部":L==="pending"?"待处理":L==="success"?"已完成":"已拒绝"},L))}),n.jsx(Se,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:n.jsx(Ce,{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(Rs,{className:"w-12 h-12 text-gray-600 mx-auto mb-3"}),n.jsx("p",{className:"text-gray-500",children:"暂无提现记录"})]}):n.jsxs(n.Fragment,{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-right font-medium",children:"操作"})]})}),n.jsx("tbody",{className:"divide-y divide-gray-700/50",children:r.map(L=>n.jsxs("tr",{className:"hover:bg-[#0a1628] transition-colors",children:[n.jsx("td",{className:"p-4 text-gray-400",children:new Date(L.createdAt??"").toLocaleString()}),n.jsx("td",{className:"p-4",children:n.jsxs("div",{className:"flex items-center gap-2",children:[L.userAvatar?n.jsx("img",{src:L.userAvatar,alt:L.userName??"",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:(L.userName??"?").charAt(0)}),n.jsxs("div",{children:[n.jsx("p",{className:"font-medium text-white",children:L.userName??"未知"}),n.jsx("p",{className:"text-xs text-gray-500",children:L.userPhone??L.referralCode??(L.userId??"").slice(0,10)})]})]})}),n.jsx("td",{className:"p-4",children:n.jsxs("span",{className:"font-bold text-orange-400",children:["¥",Number(L.amount).toFixed(2)]})}),n.jsx("td",{className:"p-4",children:L.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:["¥",L.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:["¥",L.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:["¥",L.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:L.userCommissionInfo.availableAfterThis>=0?"text-green-400 font-medium":"text-red-400 font-medium",children:["¥",L.userCommissionInfo.availableAfterThis.toFixed(2)]})]})]}):n.jsx("span",{className:"text-gray-500 text-xs",children:"暂无数据"})}),n.jsxs("td",{className:"p-4",children:[G(L.status),L.errorMessage&&n.jsx("p",{className:"text-xs text-red-400 mt-1",children:L.errorMessage})]}),n.jsx("td",{className:"p-4 text-gray-400",children:L.processedAt?new Date(L.processedAt).toLocaleString():"-"}),n.jsx("td",{className:"p-4 text-gray-400",children:L.userConfirmedAt?n.jsxs("span",{className:"text-green-400",title:L.userConfirmedAt,children:["已确认 ",new Date(L.userConfirmedAt).toLocaleString()]}):"-"}),n.jsxs("td",{className:"p-4 text-right",children:[(L.status==="pending"||L.status==="pending_confirm")&&n.jsxs("div",{className:"flex items-center justify-end gap-2",children:[n.jsxs(ge,{size:"sm",onClick:()=>I(L.id),disabled:N===L.id,className:"bg-green-600 hover:bg-green-700 text-white",children:[n.jsx(Co,{className:"w-4 h-4 mr-1"}),"批准"]}),n.jsxs(ge,{size:"sm",variant:"outline",onClick:()=>$(L.id),disabled:N===L.id,className:"border-red-500/50 text-red-400 hover:bg-red-500/10 bg-transparent",children:[n.jsx(Fn,{className:"w-4 h-4 mr-1"}),"拒绝"]})]}),(L.status==="success"||L.status==="completed")&&L.transactionId&&n.jsx("span",{className:"text-xs text-gray-500 font-mono",children:L.transactionId})]})]},L.id))})]})}),n.jsx(Vr,{page:g,totalPages:b,total:S,pageSize:P,onPageChange:v,onPageSizeChange:L=>{R(L),v(1)}})]})})})]})}const ks=p.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}));ks.displayName="Textarea";function go(r,[a,l]){return Math.min(l,Math.max(a,r))}const o2=["top","right","bottom","left"],xr=Math.min,Ft=Math.max,vo=Math.round,no=Math.floor,Sn=r=>({x:r,y:r}),i2={left:"right",right:"left",bottom:"top",top:"bottom"},c2={start:"end",end:"start"};function fd(r,a,l){return Ft(r,xr(a,l))}function zn(r,a){return typeof r=="function"?r(a):r}function $n(r){return r.split("-")[0]}function Fs(r){return r.split("-")[1]}function Kd(r){return r==="x"?"y":"x"}function Gd(r){return r==="y"?"height":"width"}const d2=new Set(["top","bottom"]);function wn(r){return d2.has($n(r))?"y":"x"}function Qd(r){return Kd(wn(r))}function u2(r,a,l){l===void 0&&(l=!1);const i=Fs(r),c=Qd(r),u=Gd(c);let f=c==="x"?i===(l?"end":"start")?"right":"left":i==="start"?"bottom":"top";return a.reference[u]>a.floating[u]&&(f=yo(f)),[f,yo(f)]}function f2(r){const a=yo(r);return[hd(r),a,hd(a)]}function hd(r){return r.replace(/start|end/g,a=>c2[a])}const Om=["left","right"],Dm=["right","left"],h2=["top","bottom"],m2=["bottom","top"];function p2(r,a,l){switch(r){case"top":case"bottom":return l?a?Dm:Om:a?Om:Dm;case"left":case"right":return a?h2:m2;default:return[]}}function x2(r,a,l,i){const c=Fs(r);let u=p2($n(r),l==="start",i);return c&&(u=u.map(f=>f+"-"+c),a&&(u=u.concat(u.map(hd)))),u}function yo(r){return r.replace(/left|right|bottom|top/g,a=>i2[a])}function g2(r){return{top:0,right:0,bottom:0,left:0,...r}}function Ox(r){return typeof r!="number"?g2(r):{top:r,right:r,bottom:r,left:r}}function wo(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 Fm(r,a,l){let{reference:i,floating:c}=r;const u=wn(a),f=Qd(a),m=Gd(f),x=$n(a),y=u==="y",g=i.x+i.width/2-c.width/2,v=i.y+i.height/2-c.height/2,P=i[m]/2-c[m]/2;let R;switch(x){case"top":R={x:g,y:i.y-c.height};break;case"bottom":R={x:g,y:i.y+i.height};break;case"right":R={x:i.x+i.width,y:v};break;case"left":R={x:i.x-c.width,y:v};break;default:R={x:i.x,y:i.y}}switch(Fs(a)){case"start":R[f]-=P*(l&&y?-1:1);break;case"end":R[f]+=P*(l&&y?-1:1);break}return R}async function v2(r,a){var l;a===void 0&&(a={});const{x:i,y:c,platform:u,rects:f,elements:m,strategy:x}=r,{boundary:y="clippingAncestors",rootBoundary:g="viewport",elementContext:v="floating",altBoundary:P=!1,padding:R=0}=zn(a,r),S=Ox(R),N=m[P?v==="floating"?"reference":"floating":v],C=wo(await u.getClippingRect({element:(l=await(u.isElement==null?void 0:u.isElement(N)))==null||l?N:N.contextElement||await(u.getDocumentElement==null?void 0:u.getDocumentElement(m.floating)),boundary:y,rootBoundary:g,strategy:x})),_=v==="floating"?{x:i,y:c,width:f.floating.width,height:f.floating.height}:f.reference,b=await(u.getOffsetParent==null?void 0:u.getOffsetParent(m.floating)),I=await(u.isElement==null?void 0:u.isElement(b))?await(u.getScale==null?void 0:u.getScale(b))||{x:1,y:1}:{x:1,y:1},$=wo(u.convertOffsetParentRelativeRectToViewportRelativeRect?await u.convertOffsetParentRelativeRectToViewportRelativeRect({elements:m,rect:_,offsetParent:b,strategy:x}):_);return{top:(C.top-$.top+S.top)/I.y,bottom:($.bottom-C.bottom+S.bottom)/I.y,left:(C.left-$.left+S.left)/I.x,right:($.right-C.right+S.right)/I.x}}const y2=async(r,a,l)=>{const{placement:i="bottom",strategy:c="absolute",middleware:u=[],platform:f}=l,m=u.filter(Boolean),x=await(f.isRTL==null?void 0:f.isRTL(a));let y=await f.getElementRects({reference:r,floating:a,strategy:c}),{x:g,y:v}=Fm(y,i,x),P=i,R={},S=0;for(let N=0;N({name:"arrow",options:r,async fn(a){const{x:l,y:i,placement:c,rects:u,platform:f,elements:m,middlewareData:x}=a,{element:y,padding:g=0}=zn(r,a)||{};if(y==null)return{};const v=Ox(g),P={x:l,y:i},R=Qd(c),S=Gd(R),j=await f.getDimensions(y),N=R==="y",C=N?"top":"left",_=N?"bottom":"right",b=N?"clientHeight":"clientWidth",I=u.reference[S]+u.reference[R]-P[R]-u.floating[S],$=P[R]-u.reference[R],G=await(f.getOffsetParent==null?void 0:f.getOffsetParent(y));let L=G?G[b]:0;(!L||!await(f.isElement==null?void 0:f.isElement(G)))&&(L=m.floating[b]||u.floating[S]);const V=I/2-$/2,te=L/2-j[S]/2-1,de=xr(v[C],te),oe=xr(v[_],te),ue=de,Y=L-j[S]-oe,B=L/2-j[S]/2+V,z=fd(ue,B,Y),H=!x.arrow&&Fs(c)!=null&&B!==z&&u.reference[S]/2-(BB<=0)){var oe,ue;const B=(((oe=u.flip)==null?void 0:oe.index)||0)+1,z=L[B];if(z&&(!(v==="alignment"?_!==wn(z):!1)||de.every(A=>wn(A.placement)===_?A.overflows[0]>0:!0)))return{data:{index:B,overflows:de},reset:{placement:z}};let H=(ue=de.filter(K=>K.overflows[0]<=0).sort((K,A)=>K.overflows[1]-A.overflows[1])[0])==null?void 0:ue.placement;if(!H)switch(R){case"bestFit":{var Y;const K=(Y=de.filter(A=>{if(G){const Q=wn(A.placement);return Q===_||Q==="y"}return!0}).map(A=>[A.placement,A.overflows.filter(Q=>Q>0).reduce((Q,ne)=>Q+ne,0)]).sort((A,Q)=>A[1]-Q[1])[0])==null?void 0:Y[0];K&&(H=K);break}case"initialPlacement":H=m;break}if(c!==H)return{reset:{placement:H}}}return{}}}};function zm(r,a){return{top:r.top-a.height,right:r.right-a.width,bottom:r.bottom-a.height,left:r.left-a.width}}function $m(r){return o2.some(a=>r[a]>=0)}const b2=function(r){return r===void 0&&(r={}),{name:"hide",options:r,async fn(a){const{rects:l,platform:i}=a,{strategy:c="referenceHidden",...u}=zn(r,a);switch(c){case"referenceHidden":{const f=await i.detectOverflow(a,{...u,elementContext:"reference"}),m=zm(f,l.reference);return{data:{referenceHiddenOffsets:m,referenceHidden:$m(m)}}}case"escaped":{const f=await i.detectOverflow(a,{...u,altBoundary:!0}),m=zm(f,l.floating);return{data:{escapedOffsets:m,escaped:$m(m)}}}default:return{}}}}},Dx=new Set(["left","top"]);async function N2(r,a){const{placement:l,platform:i,elements:c}=r,u=await(i.isRTL==null?void 0:i.isRTL(c.floating)),f=$n(l),m=Fs(l),x=wn(l)==="y",y=Dx.has(f)?-1:1,g=u&&x?-1:1,v=zn(a,r);let{mainAxis:P,crossAxis:R,alignmentAxis:S}=typeof v=="number"?{mainAxis:v,crossAxis:0,alignmentAxis:null}:{mainAxis:v.mainAxis||0,crossAxis:v.crossAxis||0,alignmentAxis:v.alignmentAxis};return m&&typeof S=="number"&&(R=m==="end"?S*-1:S),x?{x:R*g,y:P*y}:{x:P*y,y:R*g}}const S2=function(r){return r===void 0&&(r=0),{name:"offset",options:r,async fn(a){var l,i;const{x:c,y:u,placement:f,middlewareData:m}=a,x=await N2(a,r);return f===((l=m.offset)==null?void 0:l.placement)&&(i=m.arrow)!=null&&i.alignmentOffset?{}:{x:c+x.x,y:u+x.y,data:{...x,placement:f}}}}},C2=function(r){return r===void 0&&(r={}),{name:"shift",options:r,async fn(a){const{x:l,y:i,placement:c,platform:u}=a,{mainAxis:f=!0,crossAxis:m=!1,limiter:x={fn:C=>{let{x:_,y:b}=C;return{x:_,y:b}}},...y}=zn(r,a),g={x:l,y:i},v=await u.detectOverflow(a,y),P=wn($n(c)),R=Kd(P);let S=g[R],j=g[P];if(f){const C=R==="y"?"top":"left",_=R==="y"?"bottom":"right",b=S+v[C],I=S-v[_];S=fd(b,S,I)}if(m){const C=P==="y"?"top":"left",_=P==="y"?"bottom":"right",b=j+v[C],I=j-v[_];j=fd(b,j,I)}const N=x.fn({...a,[R]:S,[P]:j});return{...N,data:{x:N.x-l,y:N.y-i,enabled:{[R]:f,[P]:m}}}}}},k2=function(r){return r===void 0&&(r={}),{options:r,fn(a){const{x:l,y:i,placement:c,rects:u,middlewareData:f}=a,{offset:m=0,mainAxis:x=!0,crossAxis:y=!0}=zn(r,a),g={x:l,y:i},v=wn(c),P=Kd(v);let R=g[P],S=g[v];const j=zn(m,a),N=typeof j=="number"?{mainAxis:j,crossAxis:0}:{mainAxis:0,crossAxis:0,...j};if(x){const b=P==="y"?"height":"width",I=u.reference[P]-u.floating[b]+N.mainAxis,$=u.reference[P]+u.reference[b]-N.mainAxis;R$&&(R=$)}if(y){var C,_;const b=P==="y"?"width":"height",I=Dx.has($n(c)),$=u.reference[v]-u.floating[b]+(I&&((C=f.offset)==null?void 0:C[v])||0)+(I?0:N.crossAxis),G=u.reference[v]+u.reference[b]+(I?0:((_=f.offset)==null?void 0:_[v])||0)-(I?N.crossAxis:0);S<$?S=$:S>G&&(S=G)}return{[P]:R,[v]:S}}}},E2=function(r){return r===void 0&&(r={}),{name:"size",options:r,async fn(a){var l,i;const{placement:c,rects:u,platform:f,elements:m}=a,{apply:x=()=>{},...y}=zn(r,a),g=await f.detectOverflow(a,y),v=$n(c),P=Fs(c),R=wn(c)==="y",{width:S,height:j}=u.floating;let N,C;v==="top"||v==="bottom"?(N=v,C=P===(await(f.isRTL==null?void 0:f.isRTL(m.floating))?"start":"end")?"left":"right"):(C=v,N=P==="end"?"top":"bottom");const _=j-g.top-g.bottom,b=S-g.left-g.right,I=xr(j-g[N],_),$=xr(S-g[C],b),G=!a.middlewareData.shift;let L=I,V=$;if((l=a.middlewareData.shift)!=null&&l.enabled.x&&(V=b),(i=a.middlewareData.shift)!=null&&i.enabled.y&&(L=_),G&&!P){const de=Ft(g.left,0),oe=Ft(g.right,0),ue=Ft(g.top,0),Y=Ft(g.bottom,0);R?V=S-2*(de!==0||oe!==0?de+oe:Ft(g.left,g.right)):L=j-2*(ue!==0||Y!==0?ue+Y:Ft(g.top,g.bottom))}await x({...a,availableWidth:V,availableHeight:L});const te=await f.getDimensions(m.floating);return S!==te.width||j!==te.height?{reset:{rects:!0}}:{}}}};function Lo(){return typeof window<"u"}function zs(r){return Fx(r)?(r.nodeName||"").toLowerCase():"#document"}function zt(r){var a;return(r==null||(a=r.ownerDocument)==null?void 0:a.defaultView)||window}function En(r){var a;return(a=(Fx(r)?r.ownerDocument:r.document)||window.document)==null?void 0:a.documentElement}function Fx(r){return Lo()?r instanceof Node||r instanceof zt(r).Node:!1}function on(r){return Lo()?r instanceof Element||r instanceof zt(r).Element:!1}function kn(r){return Lo()?r instanceof HTMLElement||r instanceof zt(r).HTMLElement:!1}function Bm(r){return!Lo()||typeof ShadowRoot>"u"?!1:r instanceof ShadowRoot||r instanceof zt(r).ShadowRoot}const P2=new Set(["inline","contents"]);function za(r){const{overflow:a,overflowX:l,overflowY:i,display:c}=cn(r);return/auto|scroll|overlay|hidden|clip/.test(a+i+l)&&!P2.has(c)}const R2=new Set(["table","td","th"]);function _2(r){return R2.has(zs(r))}const T2=[":popover-open",":modal"];function Oo(r){return T2.some(a=>{try{return r.matches(a)}catch{return!1}})}const I2=["transform","translate","scale","rotate","perspective"],A2=["transform","translate","scale","rotate","perspective","filter"],M2=["paint","layout","strict","content"];function Yd(r){const a=qd(),l=on(r)?cn(r):r;return I2.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)||A2.some(i=>(l.willChange||"").includes(i))||M2.some(i=>(l.contain||"").includes(i))}function L2(r){let a=gr(r);for(;kn(a)&&!_s(a);){if(Yd(a))return a;if(Oo(a))return null;a=gr(a)}return null}function qd(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const O2=new Set(["html","body","#document"]);function _s(r){return O2.has(zs(r))}function cn(r){return zt(r).getComputedStyle(r)}function Do(r){return on(r)?{scrollLeft:r.scrollLeft,scrollTop:r.scrollTop}:{scrollLeft:r.scrollX,scrollTop:r.scrollY}}function gr(r){if(zs(r)==="html")return r;const a=r.assignedSlot||r.parentNode||Bm(r)&&r.host||En(r);return Bm(a)?a.host:a}function zx(r){const a=gr(r);return _s(a)?r.ownerDocument?r.ownerDocument.body:r.body:kn(a)&&za(a)?a:zx(a)}function Ma(r,a,l){var i;a===void 0&&(a=[]),l===void 0&&(l=!0);const c=zx(r),u=c===((i=r.ownerDocument)==null?void 0:i.body),f=zt(c);if(u){const m=md(f);return a.concat(f,f.visualViewport||[],za(c)?c:[],m&&l?Ma(m):[])}return a.concat(c,Ma(c,[],l))}function md(r){return r.parent&&Object.getPrototypeOf(r.parent)?r.frameElement:null}function $x(r){const a=cn(r);let l=parseFloat(a.width)||0,i=parseFloat(a.height)||0;const c=kn(r),u=c?r.offsetWidth:l,f=c?r.offsetHeight:i,m=vo(l)!==u||vo(i)!==f;return m&&(l=u,i=f),{width:l,height:i,$:m}}function Xd(r){return on(r)?r:r.contextElement}function Es(r){const a=Xd(r);if(!kn(a))return Sn(1);const l=a.getBoundingClientRect(),{width:i,height:c,$:u}=$x(a);let f=(u?vo(l.width):l.width)/i,m=(u?vo(l.height):l.height)/c;return(!f||!Number.isFinite(f))&&(f=1),(!m||!Number.isFinite(m))&&(m=1),{x:f,y:m}}const D2=Sn(0);function Bx(r){const a=zt(r);return!qd()||!a.visualViewport?D2:{x:a.visualViewport.offsetLeft,y:a.visualViewport.offsetTop}}function F2(r,a,l){return a===void 0&&(a=!1),!l||a&&l!==zt(r)?!1:a}function Kr(r,a,l,i){a===void 0&&(a=!1),l===void 0&&(l=!1);const c=r.getBoundingClientRect(),u=Xd(r);let f=Sn(1);a&&(i?on(i)&&(f=Es(i)):f=Es(r));const m=F2(u,l,i)?Bx(u):Sn(0);let x=(c.left+m.x)/f.x,y=(c.top+m.y)/f.y,g=c.width/f.x,v=c.height/f.y;if(u){const P=zt(u),R=i&&on(i)?zt(i):i;let S=P,j=md(S);for(;j&&i&&R!==S;){const N=Es(j),C=j.getBoundingClientRect(),_=cn(j),b=C.left+(j.clientLeft+parseFloat(_.paddingLeft))*N.x,I=C.top+(j.clientTop+parseFloat(_.paddingTop))*N.y;x*=N.x,y*=N.y,g*=N.x,v*=N.y,x+=b,y+=I,S=zt(j),j=md(S)}}return wo({width:g,height:v,x,y})}function Fo(r,a){const l=Do(r).scrollLeft;return a?a.left+l:Kr(En(r)).left+l}function Vx(r,a){const l=r.getBoundingClientRect(),i=l.left+a.scrollLeft-Fo(r,l),c=l.top+a.scrollTop;return{x:i,y:c}}function z2(r){let{elements:a,rect:l,offsetParent:i,strategy:c}=r;const u=c==="fixed",f=En(i),m=a?Oo(a.floating):!1;if(i===f||m&&u)return l;let x={scrollLeft:0,scrollTop:0},y=Sn(1);const g=Sn(0),v=kn(i);if((v||!v&&!u)&&((zs(i)!=="body"||za(f))&&(x=Do(i)),kn(i))){const R=Kr(i);y=Es(i),g.x=R.x+i.clientLeft,g.y=R.y+i.clientTop}const P=f&&!v&&!u?Vx(f,x):Sn(0);return{width:l.width*y.x,height:l.height*y.y,x:l.x*y.x-x.scrollLeft*y.x+g.x+P.x,y:l.y*y.y-x.scrollTop*y.y+g.y+P.y}}function $2(r){return Array.from(r.getClientRects())}function B2(r){const a=En(r),l=Do(r),i=r.ownerDocument.body,c=Ft(a.scrollWidth,a.clientWidth,i.scrollWidth,i.clientWidth),u=Ft(a.scrollHeight,a.clientHeight,i.scrollHeight,i.clientHeight);let f=-l.scrollLeft+Fo(r);const m=-l.scrollTop;return cn(i).direction==="rtl"&&(f+=Ft(a.clientWidth,i.clientWidth)-c),{width:c,height:u,x:f,y:m}}const Vm=25;function V2(r,a){const l=zt(r),i=En(r),c=l.visualViewport;let u=i.clientWidth,f=i.clientHeight,m=0,x=0;if(c){u=c.width,f=c.height;const g=qd();(!g||g&&a==="fixed")&&(m=c.offsetLeft,x=c.offsetTop)}const y=Fo(i);if(y<=0){const g=i.ownerDocument,v=g.body,P=getComputedStyle(v),R=g.compatMode==="CSS1Compat"&&parseFloat(P.marginLeft)+parseFloat(P.marginRight)||0,S=Math.abs(i.clientWidth-v.clientWidth-R);S<=Vm&&(u-=S)}else y<=Vm&&(u+=y);return{width:u,height:f,x:m,y:x}}const U2=new Set(["absolute","fixed"]);function W2(r,a){const l=Kr(r,!0,a==="fixed"),i=l.top+r.clientTop,c=l.left+r.clientLeft,u=kn(r)?Es(r):Sn(1),f=r.clientWidth*u.x,m=r.clientHeight*u.y,x=c*u.x,y=i*u.y;return{width:f,height:m,x,y}}function Um(r,a,l){let i;if(a==="viewport")i=V2(r,l);else if(a==="document")i=B2(En(r));else if(on(a))i=W2(a,l);else{const c=Bx(r);i={x:a.x-c.x,y:a.y-c.y,width:a.width,height:a.height}}return wo(i)}function Ux(r,a){const l=gr(r);return l===a||!on(l)||_s(l)?!1:cn(l).position==="fixed"||Ux(l,a)}function H2(r,a){const l=a.get(r);if(l)return l;let i=Ma(r,[],!1).filter(m=>on(m)&&zs(m)!=="body"),c=null;const u=cn(r).position==="fixed";let f=u?gr(r):r;for(;on(f)&&!_s(f);){const m=cn(f),x=Yd(f);!x&&m.position==="fixed"&&(c=null),(u?!x&&!c:!x&&m.position==="static"&&!!c&&U2.has(c.position)||za(f)&&!x&&Ux(r,f))?i=i.filter(g=>g!==f):c=m,f=gr(f)}return a.set(r,i),i}function K2(r){let{element:a,boundary:l,rootBoundary:i,strategy:c}=r;const f=[...l==="clippingAncestors"?Oo(a)?[]:H2(a,this._c):[].concat(l),i],m=f[0],x=f.reduce((y,g)=>{const v=Um(a,g,c);return y.top=Ft(v.top,y.top),y.right=xr(v.right,y.right),y.bottom=xr(v.bottom,y.bottom),y.left=Ft(v.left,y.left),y},Um(a,m,c));return{width:x.right-x.left,height:x.bottom-x.top,x:x.left,y:x.top}}function G2(r){const{width:a,height:l}=$x(r);return{width:a,height:l}}function Q2(r,a,l){const i=kn(a),c=En(a),u=l==="fixed",f=Kr(r,!0,u,a);let m={scrollLeft:0,scrollTop:0};const x=Sn(0);function y(){x.x=Fo(c)}if(i||!i&&!u)if((zs(a)!=="body"||za(c))&&(m=Do(a)),i){const R=Kr(a,!0,u,a);x.x=R.x+a.clientLeft,x.y=R.y+a.clientTop}else c&&y();u&&!i&&c&&y();const g=c&&!i&&!u?Vx(c,m):Sn(0),v=f.left+m.scrollLeft-x.x-g.x,P=f.top+m.scrollTop-x.y-g.y;return{x:v,y:P,width:f.width,height:f.height}}function Qc(r){return cn(r).position==="static"}function Wm(r,a){if(!kn(r)||cn(r).position==="fixed")return null;if(a)return a(r);let l=r.offsetParent;return En(r)===l&&(l=l.ownerDocument.body),l}function Wx(r,a){const l=zt(r);if(Oo(r))return l;if(!kn(r)){let c=gr(r);for(;c&&!_s(c);){if(on(c)&&!Qc(c))return c;c=gr(c)}return l}let i=Wm(r,a);for(;i&&_2(i)&&Qc(i);)i=Wm(i,a);return i&&_s(i)&&Qc(i)&&!Yd(i)?l:i||L2(r)||l}const Y2=async function(r){const a=this.getOffsetParent||Wx,l=this.getDimensions,i=await l(r.floating);return{reference:Q2(r.reference,await a(r.floating),r.strategy),floating:{x:0,y:0,width:i.width,height:i.height}}};function q2(r){return cn(r).direction==="rtl"}const X2={convertOffsetParentRelativeRectToViewportRelativeRect:z2,getDocumentElement:En,getClippingRect:K2,getOffsetParent:Wx,getElementRects:Y2,getClientRects:$2,getDimensions:G2,getScale:Es,isElement:on,isRTL:q2};function Hx(r,a){return r.x===a.x&&r.y===a.y&&r.width===a.width&&r.height===a.height}function J2(r,a){let l=null,i;const c=En(r);function u(){var m;clearTimeout(i),(m=l)==null||m.disconnect(),l=null}function f(m,x){m===void 0&&(m=!1),x===void 0&&(x=1),u();const y=r.getBoundingClientRect(),{left:g,top:v,width:P,height:R}=y;if(m||a(),!P||!R)return;const S=no(v),j=no(c.clientWidth-(g+P)),N=no(c.clientHeight-(v+R)),C=no(g),b={rootMargin:-S+"px "+-j+"px "+-N+"px "+-C+"px",threshold:Ft(0,xr(1,x))||1};let I=!0;function $(G){const L=G[0].intersectionRatio;if(L!==x){if(!I)return f();L?f(!1,L):i=setTimeout(()=>{f(!1,1e-7)},1e3)}L===1&&!Hx(y,r.getBoundingClientRect())&&f(),I=!1}try{l=new IntersectionObserver($,{...b,root:c.ownerDocument})}catch{l=new IntersectionObserver($,b)}l.observe(r)}return f(!0),u}function Z2(r,a,l,i){i===void 0&&(i={});const{ancestorScroll:c=!0,ancestorResize:u=!0,elementResize:f=typeof ResizeObserver=="function",layoutShift:m=typeof IntersectionObserver=="function",animationFrame:x=!1}=i,y=Xd(r),g=c||u?[...y?Ma(y):[],...Ma(a)]:[];g.forEach(C=>{c&&C.addEventListener("scroll",l,{passive:!0}),u&&C.addEventListener("resize",l)});const v=y&&m?J2(y,l):null;let P=-1,R=null;f&&(R=new ResizeObserver(C=>{let[_]=C;_&&_.target===y&&R&&(R.unobserve(a),cancelAnimationFrame(P),P=requestAnimationFrame(()=>{var b;(b=R)==null||b.observe(a)})),l()}),y&&!x&&R.observe(y),R.observe(a));let S,j=x?Kr(r):null;x&&N();function N(){const C=Kr(r);j&&!Hx(j,C)&&l(),j=C,S=requestAnimationFrame(N)}return l(),()=>{var C;g.forEach(_=>{c&&_.removeEventListener("scroll",l),u&&_.removeEventListener("resize",l)}),v==null||v(),(C=R)==null||C.disconnect(),R=null,x&&cancelAnimationFrame(S)}}const eS=S2,tS=C2,nS=j2,rS=E2,sS=b2,Hm=w2,aS=k2,lS=(r,a,l)=>{const i=new Map,c={platform:X2,...l},u={...c.platform,_c:i};return y2(r,a,{...c,platform:u})};var oS=typeof document<"u",iS=function(){},lo=oS?p.useLayoutEffect:iS;function jo(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(!jo(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 u=c[i];if(!(u==="_owner"&&r.$$typeof)&&!jo(r[u],a[u]))return!1}return!0}return r!==r&&a!==a}function Kx(r){return typeof window>"u"?1:(r.ownerDocument.defaultView||window).devicePixelRatio||1}function Km(r,a){const l=Kx(r);return Math.round(a*l)/l}function Yc(r){const a=p.useRef(r);return lo(()=>{a.current=r}),a}function cS(r){r===void 0&&(r={});const{placement:a="bottom",strategy:l="absolute",middleware:i=[],platform:c,elements:{reference:u,floating:f}={},transform:m=!0,whileElementsMounted:x,open:y}=r,[g,v]=p.useState({x:0,y:0,strategy:l,placement:a,middlewareData:{},isPositioned:!1}),[P,R]=p.useState(i);jo(P,i)||R(i);const[S,j]=p.useState(null),[N,C]=p.useState(null),_=p.useCallback(A=>{A!==G.current&&(G.current=A,j(A))},[]),b=p.useCallback(A=>{A!==L.current&&(L.current=A,C(A))},[]),I=u||S,$=f||N,G=p.useRef(null),L=p.useRef(null),V=p.useRef(g),te=x!=null,de=Yc(x),oe=Yc(c),ue=Yc(y),Y=p.useCallback(()=>{if(!G.current||!L.current)return;const A={placement:a,strategy:l,middleware:P};oe.current&&(A.platform=oe.current),lS(G.current,L.current,A).then(Q=>{const ne={...Q,isPositioned:ue.current!==!1};B.current&&!jo(V.current,ne)&&(V.current=ne,La.flushSync(()=>{v(ne)}))})},[P,a,l,oe,ue]);lo(()=>{y===!1&&V.current.isPositioned&&(V.current.isPositioned=!1,v(A=>({...A,isPositioned:!1})))},[y]);const B=p.useRef(!1);lo(()=>(B.current=!0,()=>{B.current=!1}),[]),lo(()=>{if(I&&(G.current=I),$&&(L.current=$),I&&$){if(de.current)return de.current(I,$,Y);Y()}},[I,$,Y,de,te]);const z=p.useMemo(()=>({reference:G,floating:L,setReference:_,setFloating:b}),[_,b]),H=p.useMemo(()=>({reference:I,floating:$}),[I,$]),K=p.useMemo(()=>{const A={position:l,left:0,top:0};if(!H.floating)return A;const Q=Km(H.floating,g.x),ne=Km(H.floating,g.y);return m?{...A,transform:"translate("+Q+"px, "+ne+"px)",...Kx(H.floating)>=1.5&&{willChange:"transform"}}:{position:l,left:Q,top:ne}},[l,m,H.floating,g.x,g.y]);return p.useMemo(()=>({...g,update:Y,refs:z,elements:H,floatingStyles:K}),[g,Y,z,H,K])}const dS=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?Hm({element:i.current,padding:c}).fn(l):{}:i?Hm({element:i,padding:c}).fn(l):{}}}},uS=(r,a)=>({...eS(r),options:[r,a]}),fS=(r,a)=>({...tS(r),options:[r,a]}),hS=(r,a)=>({...aS(r),options:[r,a]}),mS=(r,a)=>({...nS(r),options:[r,a]}),pS=(r,a)=>({...rS(r),options:[r,a]}),xS=(r,a)=>({...sS(r),options:[r,a]}),gS=(r,a)=>({...dS(r),options:[r,a]});var vS="Arrow",Gx=p.forwardRef((r,a)=>{const{children:l,width:i=10,height:c=5,...u}=r;return n.jsx(Ae.svg,{...u,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"})})});Gx.displayName=vS;var yS=Gx,Jd="Popper",[Qx,Yx]=yr(Jd),[wS,qx]=Qx(Jd),Xx=r=>{const{__scopePopper:a,children:l}=r,[i,c]=p.useState(null);return n.jsx(wS,{scope:a,anchor:i,onAnchorChange:c,children:l})};Xx.displayName=Jd;var Jx="PopperAnchor",Zx=p.forwardRef((r,a)=>{const{__scopePopper:l,virtualRef:i,...c}=r,u=qx(Jx,l),f=p.useRef(null),m=We(a,f),x=p.useRef(null);return p.useEffect(()=>{const y=x.current;x.current=(i==null?void 0:i.current)||f.current,y!==x.current&&u.onAnchorChange(x.current)}),i?null:n.jsx(Ae.div,{...c,ref:m})});Zx.displayName=Jx;var Zd="PopperContent",[jS,bS]=Qx(Zd),eg=p.forwardRef((r,a)=>{var W,ie,ce,pe,Pe,_e;const{__scopePopper:l,side:i="bottom",sideOffset:c=0,align:u="center",alignOffset:f=0,arrowPadding:m=0,avoidCollisions:x=!0,collisionBoundary:y=[],collisionPadding:g=0,sticky:v="partial",hideWhenDetached:P=!1,updatePositionStrategy:R="optimized",onPlaced:S,...j}=r,N=qx(Zd,l),[C,_]=p.useState(null),b=We(a,at=>_(at)),[I,$]=p.useState(null),G=Vd(I),L=(G==null?void 0:G.width)??0,V=(G==null?void 0:G.height)??0,te=i+(u!=="center"?"-"+u:""),de=typeof g=="number"?g:{top:0,right:0,bottom:0,left:0,...g},oe=Array.isArray(y)?y:[y],ue=oe.length>0,Y={padding:de,boundary:oe.filter(SS),altBoundary:ue},{refs:B,floatingStyles:z,placement:H,isPositioned:K,middlewareData:A}=cS({strategy:"fixed",placement:te,whileElementsMounted:(...at)=>Z2(...at,{animationFrame:R==="always"}),elements:{reference:N.anchor},middleware:[uS({mainAxis:c+V,alignmentAxis:f}),x&&fS({mainAxis:!0,crossAxis:!1,limiter:v==="partial"?hS():void 0,...Y}),x&&mS({...Y}),pS({...Y,apply:({elements:at,rects:yt,availableWidth:un,availableHeight:fn})=>{const{width:Qt,height:br}=yt.reference,hn=at.floating.style;hn.setProperty("--radix-popper-available-width",`${un}px`),hn.setProperty("--radix-popper-available-height",`${fn}px`),hn.setProperty("--radix-popper-anchor-width",`${Qt}px`),hn.setProperty("--radix-popper-anchor-height",`${br}px`)}}),I&&gS({element:I,padding:m}),CS({arrowWidth:L,arrowHeight:V}),P&&xS({strategy:"referenceHidden",...Y})]}),[Q,ne]=rg(H),E=pr(S);St(()=>{K&&(E==null||E())},[K,E]);const k=(W=A.arrow)==null?void 0:W.x,q=(ie=A.arrow)==null?void 0:ie.y,J=((ce=A.arrow)==null?void 0:ce.centerOffset)!==0,[he,me]=p.useState();return St(()=>{C&&me(window.getComputedStyle(C).zIndex)},[C]),n.jsx("div",{ref:B.setFloating,"data-radix-popper-content-wrapper":"",style:{...z,transform:K?z.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:he,"--radix-popper-transform-origin":[(pe=A.transformOrigin)==null?void 0:pe.x,(Pe=A.transformOrigin)==null?void 0:Pe.y].join(" "),...((_e=A.hide)==null?void 0:_e.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:r.dir,children:n.jsx(jS,{scope:l,placedSide:Q,onArrowChange:$,arrowX:k,arrowY:q,shouldHideArrow:J,children:n.jsx(Ae.div,{"data-side":Q,"data-align":ne,...j,ref:b,style:{...j.style,animation:K?void 0:"none"}})})})});eg.displayName=Zd;var tg="PopperArrow",NS={top:"bottom",right:"left",bottom:"top",left:"right"},ng=p.forwardRef(function(a,l){const{__scopePopper:i,...c}=a,u=bS(tg,i),f=NS[u.placedSide];return n.jsx("span",{ref:u.onArrowChange,style:{position:"absolute",left:u.arrowX,top:u.arrowY,[f]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[u.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[u.placedSide],visibility:u.shouldHideArrow?"hidden":void 0},children:n.jsx(yS,{...c,ref:l,style:{...c.style,display:"block"}})})});ng.displayName=tg;function SS(r){return r!==null}var CS=r=>({name:"transformOrigin",options:r,fn(a){var N,C,_;const{placement:l,rects:i,middlewareData:c}=a,f=((N=c.arrow)==null?void 0:N.centerOffset)!==0,m=f?0:r.arrowWidth,x=f?0:r.arrowHeight,[y,g]=rg(l),v={start:"0%",center:"50%",end:"100%"}[g],P=(((C=c.arrow)==null?void 0:C.x)??0)+m/2,R=(((_=c.arrow)==null?void 0:_.y)??0)+x/2;let S="",j="";return y==="bottom"?(S=f?v:`${P}px`,j=`${-x}px`):y==="top"?(S=f?v:`${P}px`,j=`${i.floating.height+x}px`):y==="right"?(S=`${-x}px`,j=f?v:`${R}px`):y==="left"&&(S=`${i.floating.width+x}px`,j=f?v:`${R}px`),{data:{x:S,y:j}}}});function rg(r){const[a,l="center"]=r.split("-");return[a,l]}var kS=Xx,ES=Zx,PS=eg,RS=ng,sg=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"}),_S="VisuallyHidden",TS=p.forwardRef((r,a)=>n.jsx(Ae.span,{...r,ref:a,style:{...sg,...r.style}}));TS.displayName=_S;var IS=[" ","Enter","ArrowUp","ArrowDown"],AS=[" ","Enter"],Gr="Select",[zo,$o,MS]=Ud(Gr),[$s]=yr(Gr,[MS,Yx]),Bo=Yx(),[LS,wr]=$s(Gr),[OS,DS]=$s(Gr),ag=r=>{const{__scopeSelect:a,children:l,open:i,defaultOpen:c,onOpenChange:u,value:f,defaultValue:m,onValueChange:x,dir:y,name:g,autoComplete:v,disabled:P,required:R,form:S}=r,j=Bo(a),[N,C]=p.useState(null),[_,b]=p.useState(null),[I,$]=p.useState(!1),G=Io(y),[L,V]=Wr({prop:i,defaultProp:c??!1,onChange:u,caller:Gr}),[te,de]=Wr({prop:f,defaultProp:m,onChange:x,caller:Gr}),oe=p.useRef(null),ue=N?S||!!N.closest("form"):!0,[Y,B]=p.useState(new Set),z=Array.from(Y).map(H=>H.props.value).join(";");return n.jsx(kS,{...j,children:n.jsxs(LS,{required:R,scope:a,trigger:N,onTriggerChange:C,valueNode:_,onValueNodeChange:b,valueNodeHasChildren:I,onValueNodeHasChildrenChange:$,contentId:mr(),value:te,onValueChange:de,open:L,onOpenChange:V,dir:G,triggerPointerDownPosRef:oe,disabled:P,children:[n.jsx(zo.Provider,{scope:a,children:n.jsx(OS,{scope:r.__scopeSelect,onNativeOptionAdd:p.useCallback(H=>{B(K=>new Set(K).add(H))},[]),onNativeOptionRemove:p.useCallback(H=>{B(K=>{const A=new Set(K);return A.delete(H),A})},[]),children:l})}),ue?n.jsxs(Eg,{"aria-hidden":!0,required:R,tabIndex:-1,name:g,autoComplete:v,value:te,onChange:H=>de(H.target.value),disabled:P,form:S,children:[te===void 0?n.jsx("option",{value:""}):null,Array.from(Y)]},z):null]})})};ag.displayName=Gr;var lg="SelectTrigger",og=p.forwardRef((r,a)=>{const{__scopeSelect:l,disabled:i=!1,...c}=r,u=Bo(l),f=wr(lg,l),m=f.disabled||i,x=We(a,f.onTriggerChange),y=$o(l),g=p.useRef("touch"),[v,P,R]=Rg(j=>{const N=y().filter(b=>!b.disabled),C=N.find(b=>b.value===f.value),_=_g(N,j,C);_!==void 0&&f.onValueChange(_.value)}),S=j=>{m||(f.onOpenChange(!0),R()),j&&(f.triggerPointerDownPosRef.current={x:Math.round(j.pageX),y:Math.round(j.pageY)})};return n.jsx(ES,{asChild:!0,...u,children:n.jsx(Ae.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":Pg(f.value)?"":void 0,...c,ref:x,onClick:Te(c.onClick,j=>{j.currentTarget.focus(),g.current!=="mouse"&&S(j)}),onPointerDown:Te(c.onPointerDown,j=>{g.current=j.pointerType;const N=j.target;N.hasPointerCapture(j.pointerId)&&N.releasePointerCapture(j.pointerId),j.button===0&&j.ctrlKey===!1&&j.pointerType==="mouse"&&(S(j),j.preventDefault())}),onKeyDown:Te(c.onKeyDown,j=>{const N=v.current!=="";!(j.ctrlKey||j.altKey||j.metaKey)&&j.key.length===1&&P(j.key),!(N&&j.key===" ")&&IS.includes(j.key)&&(S(),j.preventDefault())})})})});og.displayName=lg;var ig="SelectValue",cg=p.forwardRef((r,a)=>{const{__scopeSelect:l,className:i,style:c,children:u,placeholder:f="",...m}=r,x=wr(ig,l),{onValueNodeHasChildrenChange:y}=x,g=u!==void 0,v=We(a,x.onValueNodeChange);return St(()=>{y(g)},[y,g]),n.jsx(Ae.span,{...m,ref:v,style:{pointerEvents:"none"},children:Pg(x.value)?n.jsx(n.Fragment,{children:f}):u})});cg.displayName=ig;var FS="SelectIcon",dg=p.forwardRef((r,a)=>{const{__scopeSelect:l,children:i,...c}=r;return n.jsx(Ae.span,{"aria-hidden":!0,...c,ref:a,children:i||"▼"})});dg.displayName=FS;var zS="SelectPortal",ug=r=>n.jsx(Od,{asChild:!0,...r});ug.displayName=zS;var Qr="SelectContent",fg=p.forwardRef((r,a)=>{const l=wr(Qr,r.__scopeSelect),[i,c]=p.useState();if(St(()=>{c(new DocumentFragment)},[]),!l.open){const u=i;return u?La.createPortal(n.jsx(hg,{scope:r.__scopeSelect,children:n.jsx(zo.Slot,{scope:r.__scopeSelect,children:n.jsx("div",{children:r.children})})}),u):null}return n.jsx(mg,{...r,ref:a})});fg.displayName=Qr;var rn=10,[hg,jr]=$s(Qr),$S="SelectContentImpl",BS=Aa("SelectContent.RemoveScroll"),mg=p.forwardRef((r,a)=>{const{__scopeSelect:l,position:i="item-aligned",onCloseAutoFocus:c,onEscapeKeyDown:u,onPointerDownOutside:f,side:m,sideOffset:x,align:y,alignOffset:g,arrowPadding:v,collisionBoundary:P,collisionPadding:R,sticky:S,hideWhenDetached:j,avoidCollisions:N,...C}=r,_=wr(Qr,l),[b,I]=p.useState(null),[$,G]=p.useState(null),L=We(a,W=>I(W)),[V,te]=p.useState(null),[de,oe]=p.useState(null),ue=$o(l),[Y,B]=p.useState(!1),z=p.useRef(!1);p.useEffect(()=>{if(b)return Qp(b)},[b]),zp();const H=p.useCallback(W=>{const[ie,...ce]=ue().map(_e=>_e.ref.current),[pe]=ce.slice(-1),Pe=document.activeElement;for(const _e of W)if(_e===Pe||(_e==null||_e.scrollIntoView({block:"nearest"}),_e===ie&&$&&($.scrollTop=0),_e===pe&&$&&($.scrollTop=$.scrollHeight),_e==null||_e.focus(),document.activeElement!==Pe))return},[ue,$]),K=p.useCallback(()=>H([V,b]),[H,V,b]);p.useEffect(()=>{Y&&K()},[Y,K]);const{onOpenChange:A,triggerPointerDownPosRef:Q}=_;p.useEffect(()=>{if(b){let W={x:0,y:0};const ie=pe=>{var Pe,_e;W={x:Math.abs(Math.round(pe.pageX)-(((Pe=Q.current)==null?void 0:Pe.x)??0)),y:Math.abs(Math.round(pe.pageY)-(((_e=Q.current)==null?void 0:_e.y)??0))}},ce=pe=>{W.x<=10&&W.y<=10?pe.preventDefault():b.contains(pe.target)||A(!1),document.removeEventListener("pointermove",ie),Q.current=null};return Q.current!==null&&(document.addEventListener("pointermove",ie),document.addEventListener("pointerup",ce,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",ie),document.removeEventListener("pointerup",ce,{capture:!0})}}},[b,A,Q]),p.useEffect(()=>{const W=()=>A(!1);return window.addEventListener("blur",W),window.addEventListener("resize",W),()=>{window.removeEventListener("blur",W),window.removeEventListener("resize",W)}},[A]);const[ne,E]=Rg(W=>{const ie=ue().filter(Pe=>!Pe.disabled),ce=ie.find(Pe=>Pe.ref.current===document.activeElement),pe=_g(ie,W,ce);pe&&setTimeout(()=>pe.ref.current.focus())}),k=p.useCallback((W,ie,ce)=>{const pe=!z.current&&!ce;(_.value!==void 0&&_.value===ie||pe)&&(te(W),pe&&(z.current=!0))},[_.value]),q=p.useCallback(()=>b==null?void 0:b.focus(),[b]),J=p.useCallback((W,ie,ce)=>{const pe=!z.current&&!ce;(_.value!==void 0&&_.value===ie||pe)&&oe(W)},[_.value]),he=i==="popper"?pd:pg,me=he===pd?{side:m,sideOffset:x,align:y,alignOffset:g,arrowPadding:v,collisionBoundary:P,collisionPadding:R,sticky:S,hideWhenDetached:j,avoidCollisions:N}:{};return n.jsx(hg,{scope:l,content:b,viewport:$,onViewportChange:G,itemRefCallback:k,selectedItem:V,onItemLeave:q,itemTextRefCallback:J,focusSelectedItem:K,selectedItemText:de,position:i,isPositioned:Y,searchRef:ne,children:n.jsx(Dd,{as:BS,allowPinchZoom:!0,children:n.jsx(Ld,{asChild:!0,trapped:_.open,onMountAutoFocus:W=>{W.preventDefault()},onUnmountAutoFocus:Te(c,W=>{var ie;(ie=_.trigger)==null||ie.focus({preventScroll:!0}),W.preventDefault()}),children:n.jsx(Md,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:u,onPointerDownOutside:f,onFocusOutside:W=>W.preventDefault(),onDismiss:()=>_.onOpenChange(!1),children:n.jsx(he,{role:"listbox",id:_.contentId,"data-state":_.open?"open":"closed",dir:_.dir,onContextMenu:W=>W.preventDefault(),...C,...me,onPlaced:()=>B(!0),ref:L,style:{display:"flex",flexDirection:"column",outline:"none",...C.style},onKeyDown:Te(C.onKeyDown,W=>{const ie=W.ctrlKey||W.altKey||W.metaKey;if(W.key==="Tab"&&W.preventDefault(),!ie&&W.key.length===1&&E(W.key),["ArrowUp","ArrowDown","Home","End"].includes(W.key)){let pe=ue().filter(Pe=>!Pe.disabled).map(Pe=>Pe.ref.current);if(["ArrowUp","End"].includes(W.key)&&(pe=pe.slice().reverse()),["ArrowUp","ArrowDown"].includes(W.key)){const Pe=W.target,_e=pe.indexOf(Pe);pe=pe.slice(_e+1)}setTimeout(()=>H(pe)),W.preventDefault()}})})})})})})});mg.displayName=$S;var VS="SelectItemAlignedPosition",pg=p.forwardRef((r,a)=>{const{__scopeSelect:l,onPlaced:i,...c}=r,u=wr(Qr,l),f=jr(Qr,l),[m,x]=p.useState(null),[y,g]=p.useState(null),v=We(a,L=>g(L)),P=$o(l),R=p.useRef(!1),S=p.useRef(!0),{viewport:j,selectedItem:N,selectedItemText:C,focusSelectedItem:_}=f,b=p.useCallback(()=>{if(u.trigger&&u.valueNode&&m&&y&&j&&N&&C){const L=u.trigger.getBoundingClientRect(),V=y.getBoundingClientRect(),te=u.valueNode.getBoundingClientRect(),de=C.getBoundingClientRect();if(u.dir!=="rtl"){const Pe=de.left-V.left,_e=te.left-Pe,at=L.left-_e,yt=L.width+at,un=Math.max(yt,V.width),fn=window.innerWidth-rn,Qt=go(_e,[rn,Math.max(rn,fn-un)]);m.style.minWidth=yt+"px",m.style.left=Qt+"px"}else{const Pe=V.right-de.right,_e=window.innerWidth-te.right-Pe,at=window.innerWidth-L.right-_e,yt=L.width+at,un=Math.max(yt,V.width),fn=window.innerWidth-rn,Qt=go(_e,[rn,Math.max(rn,fn-un)]);m.style.minWidth=yt+"px",m.style.right=Qt+"px"}const oe=P(),ue=window.innerHeight-rn*2,Y=j.scrollHeight,B=window.getComputedStyle(y),z=parseInt(B.borderTopWidth,10),H=parseInt(B.paddingTop,10),K=parseInt(B.borderBottomWidth,10),A=parseInt(B.paddingBottom,10),Q=z+H+Y+A+K,ne=Math.min(N.offsetHeight*5,Q),E=window.getComputedStyle(j),k=parseInt(E.paddingTop,10),q=parseInt(E.paddingBottom,10),J=L.top+L.height/2-rn,he=ue-J,me=N.offsetHeight/2,W=N.offsetTop+me,ie=z+H+W,ce=Q-ie;if(ie<=J){const Pe=oe.length>0&&N===oe[oe.length-1].ref.current;m.style.bottom="0px";const _e=y.clientHeight-j.offsetTop-j.offsetHeight,at=Math.max(he,me+(Pe?q:0)+_e+K),yt=ie+at;m.style.height=yt+"px"}else{const Pe=oe.length>0&&N===oe[0].ref.current;m.style.top="0px";const at=Math.max(J,z+j.offsetTop+(Pe?k:0)+me)+ce;m.style.height=at+"px",j.scrollTop=ie-J+j.offsetTop}m.style.margin=`${rn}px 0`,m.style.minHeight=ne+"px",m.style.maxHeight=ue+"px",i==null||i(),requestAnimationFrame(()=>R.current=!0)}},[P,u.trigger,u.valueNode,m,y,j,N,C,u.dir,i]);St(()=>b(),[b]);const[I,$]=p.useState();St(()=>{y&&$(window.getComputedStyle(y).zIndex)},[y]);const G=p.useCallback(L=>{L&&S.current===!0&&(b(),_==null||_(),S.current=!1)},[b,_]);return n.jsx(WS,{scope:l,contentWrapper:m,shouldExpandOnScrollRef:R,onScrollButtonChange:G,children:n.jsx("div",{ref:x,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:I},children:n.jsx(Ae.div,{...c,ref:v,style:{boxSizing:"border-box",maxHeight:"100%",...c.style}})})})});pg.displayName=VS;var US="SelectPopperPosition",pd=p.forwardRef((r,a)=>{const{__scopeSelect:l,align:i="start",collisionPadding:c=rn,...u}=r,f=Bo(l);return n.jsx(PS,{...f,...u,ref:a,align:i,collisionPadding:c,style:{boxSizing:"border-box",...u.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});pd.displayName=US;var[WS,eu]=$s(Qr,{}),xd="SelectViewport",xg=p.forwardRef((r,a)=>{const{__scopeSelect:l,nonce:i,...c}=r,u=jr(xd,l),f=eu(xd,l),m=We(a,u.onViewportChange),x=p.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(zo.Slot,{scope:l,children:n.jsx(Ae.div,{"data-radix-select-viewport":"",role:"presentation",...c,ref:m,style:{position:"relative",flex:1,overflow:"hidden auto",...c.style},onScroll:Te(c.onScroll,y=>{const g=y.currentTarget,{contentWrapper:v,shouldExpandOnScrollRef:P}=f;if(P!=null&&P.current&&v){const R=Math.abs(x.current-g.scrollTop);if(R>0){const S=window.innerHeight-rn*2,j=parseFloat(v.style.minHeight),N=parseFloat(v.style.height),C=Math.max(j,N);if(C0?I:0,v.style.justifyContent="flex-end")}}}x.current=g.scrollTop})})})]})});xg.displayName=xd;var gg="SelectGroup",[HS,KS]=$s(gg),GS=p.forwardRef((r,a)=>{const{__scopeSelect:l,...i}=r,c=mr();return n.jsx(HS,{scope:l,id:c,children:n.jsx(Ae.div,{role:"group","aria-labelledby":c,...i,ref:a})})});GS.displayName=gg;var vg="SelectLabel",QS=p.forwardRef((r,a)=>{const{__scopeSelect:l,...i}=r,c=KS(vg,l);return n.jsx(Ae.div,{id:c.id,...i,ref:a})});QS.displayName=vg;var bo="SelectItem",[YS,yg]=$s(bo),wg=p.forwardRef((r,a)=>{const{__scopeSelect:l,value:i,disabled:c=!1,textValue:u,...f}=r,m=wr(bo,l),x=jr(bo,l),y=m.value===i,[g,v]=p.useState(u??""),[P,R]=p.useState(!1),S=We(a,_=>{var b;return(b=x.itemRefCallback)==null?void 0:b.call(x,_,i,c)}),j=mr(),N=p.useRef("touch"),C=()=>{c||(m.onValueChange(i),m.onOpenChange(!1))};if(i==="")throw new Error("A must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return n.jsx(YS,{scope:l,value:i,disabled:c,textId:j,isSelected:y,onItemTextChange:p.useCallback(_=>{v(b=>b||((_==null?void 0:_.textContent)??"").trim())},[]),children:n.jsx(zo.ItemSlot,{scope:l,value:i,disabled:c,textValue:g,children:n.jsx(Ae.div,{role:"option","aria-labelledby":j,"data-highlighted":P?"":void 0,"aria-selected":y&&P,"data-state":y?"checked":"unchecked","aria-disabled":c||void 0,"data-disabled":c?"":void 0,tabIndex:c?void 0:-1,...f,ref:S,onFocus:Te(f.onFocus,()=>R(!0)),onBlur:Te(f.onBlur,()=>R(!1)),onClick:Te(f.onClick,()=>{N.current!=="mouse"&&C()}),onPointerUp:Te(f.onPointerUp,()=>{N.current==="mouse"&&C()}),onPointerDown:Te(f.onPointerDown,_=>{N.current=_.pointerType}),onPointerMove:Te(f.onPointerMove,_=>{var b;N.current=_.pointerType,c?(b=x.onItemLeave)==null||b.call(x):N.current==="mouse"&&_.currentTarget.focus({preventScroll:!0})}),onPointerLeave:Te(f.onPointerLeave,_=>{var b;_.currentTarget===document.activeElement&&((b=x.onItemLeave)==null||b.call(x))}),onKeyDown:Te(f.onKeyDown,_=>{var I;((I=x.searchRef)==null?void 0:I.current)!==""&&_.key===" "||(AS.includes(_.key)&&C(),_.key===" "&&_.preventDefault())})})})})});wg.displayName=bo;var _a="SelectItemText",jg=p.forwardRef((r,a)=>{const{__scopeSelect:l,className:i,style:c,...u}=r,f=wr(_a,l),m=jr(_a,l),x=yg(_a,l),y=DS(_a,l),[g,v]=p.useState(null),P=We(a,C=>v(C),x.onItemTextChange,C=>{var _;return(_=m.itemTextRefCallback)==null?void 0:_.call(m,C,x.value,x.disabled)}),R=g==null?void 0:g.textContent,S=p.useMemo(()=>n.jsx("option",{value:x.value,disabled:x.disabled,children:R},x.value),[x.disabled,x.value,R]),{onNativeOptionAdd:j,onNativeOptionRemove:N}=y;return St(()=>(j(S),()=>N(S)),[j,N,S]),n.jsxs(n.Fragment,{children:[n.jsx(Ae.span,{id:x.textId,...u,ref:P}),x.isSelected&&f.valueNode&&!f.valueNodeHasChildren?La.createPortal(u.children,f.valueNode):null]})});jg.displayName=_a;var bg="SelectItemIndicator",Ng=p.forwardRef((r,a)=>{const{__scopeSelect:l,...i}=r;return yg(bg,l).isSelected?n.jsx(Ae.span,{"aria-hidden":!0,...i,ref:a}):null});Ng.displayName=bg;var gd="SelectScrollUpButton",Sg=p.forwardRef((r,a)=>{const l=jr(gd,r.__scopeSelect),i=eu(gd,r.__scopeSelect),[c,u]=p.useState(!1),f=We(a,i.onScrollButtonChange);return St(()=>{if(l.viewport&&l.isPositioned){let m=function(){const y=x.scrollTop>0;u(y)};const x=l.viewport;return m(),x.addEventListener("scroll",m),()=>x.removeEventListener("scroll",m)}},[l.viewport,l.isPositioned]),c?n.jsx(kg,{...r,ref:f,onAutoScroll:()=>{const{viewport:m,selectedItem:x}=l;m&&x&&(m.scrollTop=m.scrollTop-x.offsetHeight)}}):null});Sg.displayName=gd;var vd="SelectScrollDownButton",Cg=p.forwardRef((r,a)=>{const l=jr(vd,r.__scopeSelect),i=eu(vd,r.__scopeSelect),[c,u]=p.useState(!1),f=We(a,i.onScrollButtonChange);return St(()=>{if(l.viewport&&l.isPositioned){let m=function(){const y=x.scrollHeight-x.clientHeight,g=Math.ceil(x.scrollTop)x.removeEventListener("scroll",m)}},[l.viewport,l.isPositioned]),c?n.jsx(kg,{...r,ref:f,onAutoScroll:()=>{const{viewport:m,selectedItem:x}=l;m&&x&&(m.scrollTop=m.scrollTop+x.offsetHeight)}}):null});Cg.displayName=vd;var kg=p.forwardRef((r,a)=>{const{__scopeSelect:l,onAutoScroll:i,...c}=r,u=jr("SelectScrollButton",l),f=p.useRef(null),m=$o(l),x=p.useCallback(()=>{f.current!==null&&(window.clearInterval(f.current),f.current=null)},[]);return p.useEffect(()=>()=>x(),[x]),St(()=>{var g;const y=m().find(v=>v.ref.current===document.activeElement);(g=y==null?void 0:y.ref.current)==null||g.scrollIntoView({block:"nearest"})},[m]),n.jsx(Ae.div,{"aria-hidden":!0,...c,ref:a,style:{flexShrink:0,...c.style},onPointerDown:Te(c.onPointerDown,()=>{f.current===null&&(f.current=window.setInterval(i,50))}),onPointerMove:Te(c.onPointerMove,()=>{var y;(y=u.onItemLeave)==null||y.call(u),f.current===null&&(f.current=window.setInterval(i,50))}),onPointerLeave:Te(c.onPointerLeave,()=>{x()})})}),qS="SelectSeparator",XS=p.forwardRef((r,a)=>{const{__scopeSelect:l,...i}=r;return n.jsx(Ae.div,{"aria-hidden":!0,...i,ref:a})});XS.displayName=qS;var yd="SelectArrow",JS=p.forwardRef((r,a)=>{const{__scopeSelect:l,...i}=r,c=Bo(l),u=wr(yd,l),f=jr(yd,l);return u.open&&f.position==="popper"?n.jsx(RS,{...c,...i,ref:a}):null});JS.displayName=yd;var ZS="SelectBubbleInput",Eg=p.forwardRef(({__scopeSelect:r,value:a,...l},i)=>{const c=p.useRef(null),u=We(i,c),f=Bd(a);return p.useEffect(()=>{const m=c.current;if(!m)return;const x=window.HTMLSelectElement.prototype,g=Object.getOwnPropertyDescriptor(x,"value").set;if(f!==a&&g){const v=new Event("change",{bubbles:!0});g.call(m,a),m.dispatchEvent(v)}},[f,a]),n.jsx(Ae.select,{...l,style:{...sg,...l.style},ref:u,defaultValue:a})});Eg.displayName=ZS;function Pg(r){return r===""||r===void 0}function Rg(r){const a=pr(r),l=p.useRef(""),i=p.useRef(0),c=p.useCallback(f=>{const m=l.current+f;a(m),(function x(y){l.current=y,window.clearTimeout(i.current),y!==""&&(i.current=window.setTimeout(()=>x(""),1e3))})(m)},[a]),u=p.useCallback(()=>{l.current="",window.clearTimeout(i.current)},[]);return p.useEffect(()=>()=>window.clearTimeout(i.current),[]),[l,c,u]}function _g(r,a,l){const c=a.length>1&&Array.from(a).every(y=>y===a[0])?a[0]:a,u=l?r.indexOf(l):-1;let f=eC(r,Math.max(u,0));c.length===1&&(f=f.filter(y=>y!==l));const x=f.find(y=>y.textValue.toLowerCase().startsWith(c.toLowerCase()));return x!==l?x:void 0}function eC(r,a){return r.map((l,i)=>r[(a+i)%r.length])}var tC=ag,Tg=og,nC=cg,rC=dg,sC=ug,Ig=fg,aC=xg,Ag=wg,lC=jg,oC=Ng,iC=Sg,cC=Cg;const qc=tC,Xc=nC,oo=p.forwardRef(({className:r,children:a,...l},i)=>n.jsxs(Tg,{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(rC,{asChild:!0,children:n.jsx(cp,{className:"h-4 w-4 opacity-50"})})]}));oo.displayName=Tg.displayName;const io=p.forwardRef(({className:r,children:a,position:l="popper",...i},c)=>n.jsx(sC,{children:n.jsxs(Ig,{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(iC,{className:"flex cursor-default items-center justify-center py-1",children:n.jsx(vw,{className:"h-4 w-4"})}),n.jsx(aC,{className:"p-1",children:a}),n.jsx(cC,{className:"flex cursor-default items-center justify-center py-1",children:n.jsx(cp,{className:"h-4 w-4"})})]})}));io.displayName=Ig.displayName;const ur=p.forwardRef(({className:r,children:a,...l},i)=>n.jsxs(Ag,{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(oC,{children:n.jsx(Co,{className:"h-4 w-4"})})}),n.jsx(lC,{children:a})]}));ur.displayName=Ag.displayName;function dC(r){const a=new Map;for(const l of r){const i=l.partId||"part-1",c=l.partTitle||"未分类",u=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(u)||m.chapters.set(u,{id:u,title:f,sections:[]}),m.chapters.get(u).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 uC(){const[r,a]=p.useState([]),[l,i]=p.useState(!0),[c,u]=p.useState([]),[f,m]=p.useState(null),[x,y]=p.useState(!1),[g,v]=p.useState(!1),[P,R]=p.useState(!1),[S,j]=p.useState(""),[N,C]=p.useState([]),[_,b]=p.useState(!1),[I,$]=p.useState(!1),G=p.useRef(null),[L,V]=p.useState({id:"",title:"",price:1,partId:"part-1",chapterId:"chapter-1",content:""}),te=dC(r),de=r.length,oe=async()=>{i(!0);try{const E=await Ue("/api/db/book?action=list");a(Array.isArray(E==null?void 0:E.sections)?E.sections:[]),c.length===0&&te.length>0&&u([te[0].id])}catch(E){console.error(E),a([])}finally{i(!1)}};p.useEffect(()=>{oe()},[]),p.useEffect(()=>{!l&&te.length>0&&c.length===0&&u([te[0].id])},[l,te.length,c.length]);const ue=E=>{u(k=>k.includes(E)?k.filter(q=>q!==E):[...k,E])},Y=async E=>{if(confirm(`确定要删除章节「${E.title}」吗?此操作不可恢复。`))try{const k=await Td(`/api/db/book?id=${encodeURIComponent(E.id)}`);k&&k.success!==!1?(alert("已删除"),oe()):alert("删除失败: "+(k&&typeof k=="object"&&"error"in k?k.error:"未知错误"))}catch(k){console.error(k),alert("删除失败")}},B=async E=>{v(!0);try{const k=await Ue(`/api/db/book?action=read&id=${encodeURIComponent(E.id)}`);k!=null&&k.success&&k.section?m({id:E.id,title:k.section.title??E.title,price:k.section.price??E.price,content:k.section.content??"",filePath:E.filePath,isFree:E.isFree||E.price===0}):(m({id:E.id,title:E.title,price:E.price,content:"",filePath:E.filePath,isFree:E.isFree}),k&&!k.success&&alert("无法读取文件内容: "+(k.error||"未知错误")))}catch(k){console.error(k),m({id:E.id,title:E.title,price:E.price,content:"",filePath:E.filePath,isFree:E.isFree})}finally{v(!1)}},z=async()=>{var E;if(f){R(!0);try{let k=f.content||"";const q=[new RegExp(`^#+\\s*${f.id.replace(".","\\.")}\\s+.*$`,"gm"),new RegExp(`^#+\\s*${f.id.replace(".","\\.")}[::].*$`,"gm"),new RegExp(`^#\\s+.*${(E=f.title)==null?void 0:E.slice(0,10).replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}.*$`,"gm")];for(const he of q)k=k.replace(he,"");k=k.replace(/^\s*\n+/,"").trim();const J=await ln("/api/db/book",{id:f.id,title:f.title,price:f.isFree?0:f.price,content:k,isFree:f.isFree||f.price===0,saveToFile:!0});J&&J.success!==!1?(alert(`已保存章节: ${f.title}`),m(null),oe()):alert("保存失败: "+(J&&typeof J=="object"&&"error"in J?J.error:"未知错误"))}catch(k){console.error(k),alert("保存失败")}finally{R(!1)}}},H=async()=>{if(!L.id||!L.title){alert("请填写章节ID和标题");return}R(!0);try{const E=await ln("/api/db/book",{id:L.id,title:L.title,price:L.price,content:L.content,partId:L.partId,chapterId:L.chapterId,saveToFile:!1});E&&E.success!==!1?(alert(`章节创建成功: ${L.title}`),y(!1),V({id:"",title:"",price:1,partId:"part-1",chapterId:"chapter-1",content:""}),oe()):alert("创建失败: "+(E&&typeof E=="object"&&"error"in E?E.error:"未知错误"))}catch(E){console.error(E),alert("创建失败")}finally{R(!1)}},K=async E=>{var q,J;const k=(q=E.target.files)==null?void 0:q[0];if(k){$(!0);try{const he=new FormData;he.append("file",k),he.append("folder","book-images");const W=await(await fetch(mp("/api/upload"),{method:"POST",body:he,credentials:"include"})).json();if(W!=null&&W.success&&((J=W==null?void 0:W.data)!=null&&J.url)){const ie=`![${k.name}](${W.data.url})`;f&&m({...f,content:(f.content||"")+` + +`+ie}),alert(`图片上传成功: ${W.data.url}`)}else alert("上传失败: "+((W==null?void 0:W.error)||"未知错误"))}catch(he){console.error(he),alert("上传失败")}finally{$(!1),G.current&&(G.current.value="")}}},A=async()=>{var E;if(S.trim()){b(!0);try{const k=await Ue(`/api/search?q=${encodeURIComponent(S)}`);k!=null&&k.success&&((E=k.data)!=null&&E.results)?C(k.data.results):(C([]),k&&!k.success&&alert("搜索失败: "+k.error))}catch(k){console.error(k),C([]),alert("搜索失败")}finally{b(!1)}}},Q=te.find(E=>E.id===L.partId),ne=(Q==null?void 0:Q.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:["共 ",te.length," 篇 · ",de," 节内容"]})]}),n.jsx("div",{className:"flex gap-2",children:n.jsxs(ge,{onClick:()=>{const E=typeof window<"u"?`${window.location.origin}/api-doc`:"";E&&window.open(E,"_blank","noopener,noreferrer")},variant:"outline",className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:[n.jsx(zr,{className:"w-4 h-4 mr-2"}),"API 接口"]})})]}),n.jsx(jn,{open:x,onOpenChange:y,children:n.jsxs(sn,{className:"bg-[#0f2137] border-gray-700 text-white max-w-2xl max-h-[90vh] overflow-y-auto",showCloseButton:!0,children:[n.jsx(bn,{children:n.jsxs(Nn,{className:"text-white flex items-center gap-2",children:[n.jsx($r,{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(se,{className:"text-gray-300",children:"章节ID *"}),n.jsx(le,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"如: 9.15",value:L.id,onChange:E=>V({...L,id:E.target.value})})]}),n.jsxs("div",{className:"space-y-2",children:[n.jsx(se,{className:"text-gray-300",children:"价格 (元)"}),n.jsx(le,{type:"number",className:"bg-[#0a1628] border-gray-700 text-white",value:L.price,onChange:E=>V({...L,price:Number(E.target.value)})})]})]}),n.jsxs("div",{className:"space-y-2",children:[n.jsx(se,{className:"text-gray-300",children:"章节标题 *"}),n.jsx(le,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"输入章节标题",value:L.title,onChange:E=>V({...L,title:E.target.value})})]}),n.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[n.jsxs("div",{className:"space-y-2",children:[n.jsx(se,{className:"text-gray-300",children:"所属篇"}),n.jsxs(qc,{value:L.partId,onValueChange:E=>V({...L,partId:E,chapterId:"chapter-1"}),children:[n.jsx(oo,{className:"bg-[#0a1628] border-gray-700 text-white",children:n.jsx(Xc,{})}),n.jsxs(io,{className:"bg-[#0f2137] border-gray-700",children:[te.map(E=>n.jsx(ur,{value:E.id,className:"text-white hover:bg-[#38bdac]/20 focus:bg-[#38bdac]/20",children:E.title},E.id)),te.length===0&&n.jsx(ur,{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(se,{className:"text-gray-300",children:"所属章"}),n.jsxs(qc,{value:L.chapterId,onValueChange:E=>V({...L,chapterId:E}),children:[n.jsx(oo,{className:"bg-[#0a1628] border-gray-700 text-white",children:n.jsx(Xc,{})}),n.jsxs(io,{className:"bg-[#0f2137] border-gray-700",children:[ne.map(E=>n.jsx(ur,{value:E.id,className:"text-white hover:bg-[#38bdac]/20 focus:bg-[#38bdac]/20",children:E.title},E.id)),ne.length===0&&n.jsx(ur,{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(se,{className:"text-gray-300",children:"内容 (Markdown格式)"}),n.jsx(ks,{className:"bg-[#0a1628] border-gray-700 text-white min-h-[300px] font-mono text-sm placeholder:text-gray-500",placeholder:"输入章节内容...",value:L.content,onChange:E=>V({...L,content:E.target.value})})]})]}),n.jsxs(Dn,{children:[n.jsx(ge,{variant:"outline",onClick:()=>y(!1),className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:"取消"}),n.jsx(ge,{onClick:H,disabled:P||!L.id||!L.title,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($r,{className:"w-4 h-4 mr-2"}),"创建章节"]})})]})]})}),n.jsx(jn,{open:!!f,onOpenChange:()=>m(null),children:n.jsxs(sn,{className:"bg-[#0f2137] border-gray-700 text-white max-w-4xl max-h-[90vh] overflow-y-auto",showCloseButton:!0,children:[n.jsx(bn,{children:n.jsxs(Nn,{className:"text-white flex items-center gap-2",children:[n.jsx(Ur,{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(se,{className:"text-gray-300",children:"章节ID"}),n.jsx(le,{className:"bg-[#0a1628] border-gray-700 text-white",value:f.id,disabled:!0})]}),n.jsxs("div",{className:"space-y-2",children:[n.jsx(se,{className:"text-gray-300",children:"价格 (元)"}),n.jsx(le,{type:"number",className:"bg-[#0a1628] border-gray-700 text-white",value:f.isFree?0:f.price,onChange:E=>m({...f,price:Number(E.target.value),isFree:Number(E.target.value)===0}),disabled:f.isFree})]}),n.jsxs("div",{className:"space-y-2",children:[n.jsx(se,{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:E=>m({...f,isFree:E.target.checked,price:E.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(se,{className:"text-gray-300",children:"章节标题"}),n.jsx(le,{className:"bg-[#0a1628] border-gray-700 text-white",value:f.title,onChange:E=>m({...f,title:E.target.value})})]}),f.filePath&&n.jsxs("div",{className:"space-y-2",children:[n.jsx(se,{className:"text-gray-300",children:"文件路径"}),n.jsx(le,{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(se,{className:"text-gray-300",children:"内容 (Markdown格式)"}),n.jsxs("div",{className:"flex gap-2",children:[n.jsx("input",{ref:G,type:"file",accept:"image/*",onChange:K,className:"hidden"}),n.jsxs(ge,{variant:"outline",size:"sm",onClick:()=>{var E;return(E=G.current)==null?void 0:E.click()},disabled:I,className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:[I?n.jsx(Ze,{className:"w-4 h-4 mr-1 animate-spin"}):n.jsx(Gw,{className:"w-4 h-4 mr-1"}),"上传图片"]})]})]}),g?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(ks,{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:E=>m({...f,content:E.target.value})})]})]}),n.jsxs(Dn,{children:[n.jsxs(ge,{variant:"outline",onClick:()=>m(null),className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:[n.jsx(Fn,{className:"w-4 h-4 mr-2"}),"取消"]}),n.jsx(ge,{onClick:z,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(an,{className:"w-4 h-4 mr-2"}),"保存修改"]})})]})]})}),n.jsxs(Hd,{defaultValue:"chapters",className:"space-y-6",children:[n.jsxs(Mo,{className:"bg-[#0f2137] border border-gray-700/50 p-1",children:[n.jsxs(Kt,{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(Kt,{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(Kt,{value:"hooks",className:"data-[state=active]:bg-[#38bdac]/20 data-[state=active]:text-[#38bdac] text-gray-400",children:[n.jsx(S1,{className:"w-4 h-4 mr-2"}),"钩子配置"]})]}),n.jsxs(Gt,{value:"chapters",className:"space-y-4",children:[n.jsxs(ge,{onClick:()=>y(!0),className:"w-full bg-[#38bdac]/10 hover:bg-[#38bdac]/20 text-[#38bdac] border border-[#38bdac]/30",children:[n.jsx($r,{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:"加载中..."})]}):te.map((E,k)=>n.jsxs(Se,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl overflow-hidden",children:[n.jsx(Fe,{className:"cursor-pointer hover:bg-[#162840] transition-colors",onClick:()=>ue(E.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",k+1]}),n.jsx(ze,{className:"text-white",children:E.title}),n.jsxs(Oe,{variant:"outline",className:"text-gray-400 border-gray-600",children:[E.chapters.reduce((q,J)=>q+J.sections.length,0)," 节"]})]}),n.jsx(dp,{className:`w-5 h-5 text-gray-400 transition-transform ${c.includes(E.id)?"rotate-90":""}`})]})}),c.includes(E.id)&&n.jsx(Ce,{className:"pt-0 pb-4",children:n.jsx("div",{className:"space-y-3 pl-8 border-l-2 border-gray-700",children:E.chapters.map(q=>n.jsxs("div",{className:"space-y-2",children:[n.jsx("h4",{className:"font-medium text-gray-300",children:q.title}),n.jsx("div",{className:"space-y-1",children:q.sections.map(J=>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(nd,{className:"w-4 h-4 text-[#38bdac]"}),n.jsx("span",{className:"text-gray-400",children:J.title})]}),n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx("span",{className:"text-[#38bdac] font-medium",children:J.price===0?"免费":`¥${J.price}`}),n.jsxs(ge,{variant:"ghost",size:"sm",onClick:()=>B(J),className:"text-gray-500 hover:text-[#38bdac] hover:bg-[#38bdac]/10 opacity-0 group-hover:opacity-100 transition-opacity",children:[n.jsx(Rd,{className:"w-4 h-4 mr-1"}),"读取"]}),n.jsxs(ge,{variant:"ghost",size:"sm",onClick:()=>B(J),className:"text-gray-500 hover:text-[#38bdac] hover:bg-[#38bdac]/10 opacity-0 group-hover:opacity-100 transition-opacity",children:[n.jsx(Ur,{className:"w-4 h-4 mr-1"}),"编辑"]}),n.jsxs(ge,{variant:"ghost",size:"sm",onClick:()=>Y(J),className:"text-gray-500 hover:text-red-400 hover:bg-red-500/10 opacity-0 group-hover:opacity-100 transition-opacity",children:[n.jsx(Eo,{className:"w-4 h-4 mr-1"}),"删除"]})]})]},J.id))})]},q.id))})})]},E.id))]}),n.jsx(Gt,{value:"search",className:"space-y-4",children:n.jsxs(Se,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:[n.jsx(Fe,{children:n.jsx(ze,{className:"text-white",children:"内容搜索"})}),n.jsxs(Ce,{className:"space-y-4",children:[n.jsxs("div",{className:"flex gap-2",children:[n.jsx(le,{className:"bg-[#0a1628] border-gray-700 text-white placeholder:text-gray-500 flex-1",placeholder:"搜索标题或内容...",value:S,onChange:E=>j(E.target.value),onKeyDown:E=>E.key==="Enter"&&A()}),n.jsx(ge,{onClick:A,disabled:_||!S.trim(),className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:_?n.jsx(Ze,{className:"w-4 h-4 animate-spin"}):n.jsx(Br,{className:"w-4 h-4"})})]}),N.length>0&&n.jsxs("div",{className:"space-y-2 mt-4",children:[n.jsxs("p",{className:"text-gray-400 text-sm",children:["找到 ",N.length," 个结果"]}),N.map(E=>n.jsxs("div",{className:"p-3 rounded-lg bg-[#162840] hover:bg-[#1a3050] cursor-pointer transition-colors",onClick:()=>B({id:E.id,title:E.title,price:E.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:E.id}),n.jsx("span",{className:"text-white",children:E.title})]}),n.jsx(Oe,{variant:"outline",className:"text-gray-400 border-gray-600 text-xs",children:E.matchType==="title"?"标题匹配":"内容匹配"})]}),E.snippet&&n.jsx("p",{className:"text-gray-500 text-xs mt-2 line-clamp-2",children:E.snippet}),(E.partTitle||E.chapterTitle)&&n.jsxs("p",{className:"text-gray-600 text-xs mt-1",children:[E.partTitle," · ",E.chapterTitle]})]},E.id))]})]})]})}),n.jsx(Gt,{value:"hooks",className:"space-y-4",children:n.jsxs(Se,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:[n.jsx(Fe,{children:n.jsx(ze,{className:"text-white",children:"引流钩子配置"})}),n.jsxs(Ce,{className:"space-y-4",children:[n.jsxs("div",{className:"grid w-full max-w-sm items-center gap-1.5",children:[n.jsx(se,{htmlFor:"hook-chapter",className:"text-gray-300",children:"触发章节"}),n.jsxs(qc,{defaultValue:"3",children:[n.jsx(oo,{id:"hook-chapter",className:"bg-[#0a1628] border-gray-700 text-white",children:n.jsx(Xc,{placeholder:"选择章节"})}),n.jsxs(io,{className:"bg-[#0f2137] border-gray-700",children:[n.jsx(ur,{value:"1",className:"text-white hover:bg-[#38bdac]/20 focus:bg-[#38bdac]/20",children:"第一章"}),n.jsx(ur,{value:"2",className:"text-white hover:bg-[#38bdac]/20 focus:bg-[#38bdac]/20",children:"第二章"}),n.jsx(ur,{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(se,{htmlFor:"message",className:"text-gray-300",children:"引流文案"}),n.jsx(ks,{placeholder:"输入引导用户加群的文案...",id:"message",className:"bg-[#0a1628] border-gray-700 text-white placeholder:text-gray-500",defaultValue:"阅读更多精彩内容,请加入Soul创业实验派对群..."})]}),n.jsx(ge,{className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:"保存配置"})]})]})})]})]})}function fC(){const[r,a]=p.useState([]),[l,i]=p.useState(null),[c,u]=p.useState(!0),[f,m]=p.useState(null),[x,y]=p.useState([]),[g,v]=p.useState(null),[P,R]=p.useState(1);async function S(){u(!0),m(null);try{const _=await Ue("/api/admin/chapters");_!=null&&_.success&&_.data?(a(_.data.structure??[]),i(_.data.stats??null)):m("加载章节失败")}catch(_){console.error("加载章节失败:",_),m("加载失败,请检查网络后重试")}finally{u(!1)}}p.useEffect(()=>{S()},[]);const j=_=>{y(b=>b.includes(_)?b.filter(I=>I!==_):[...b,_])},N=async _=>{try{const b=await vt("/api/admin/chapters",{action:"updatePrice",chapterId:_,data:{price:P}});b!=null&&b.success&&(alert("价格更新成功"),v(null),S())}catch(b){console.error("更新价格失败:",b)}},C=async(_,b)=>{try{const I=await vt("/api/admin/chapters",{action:"toggleFree",chapterId:_,data:{isFree:!b}});I!=null&&I.success&&(alert("状态更新成功"),S())}catch(I){console.error("更新状态失败:",I)}};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:S,disabled:c,className:"px-4 py-2 bg-white/10 rounded-lg hover:bg-white/20 text-white disabled:opacity-50",children:"刷新"}),n.jsx("button",{type:"button",onClick:()=>y(r.map(_=>_.id)),className:"px-4 py-2 bg-white/10 rounded-lg hover:bg-white/20 text-white",children:"展开全部"}),n.jsx("button",{type:"button",onClick:()=>y([]),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:[f&&n.jsxs("div",{className:"mb-4 px-4 py-3 rounded-lg bg-red-500/20 border border-red-500/50 text-red-400 text-sm flex items-center justify-between",children:[n.jsx("span",{children:f}),n.jsx("button",{type:"button",onClick:()=>m(null),className:"hover:text-red-300",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.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:()=>j(_.id),onKeyDown:b=>b.key==="Enter"&&j(_.id),role:"button",tabIndex:0,children:[n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsx("span",{className:"text-2xl",children:_.type==="preface"?"📖":_.type==="epilogue"?"🎬":_.type==="appendix"?"📎":"📚"}),n.jsx("span",{className:"font-semibold text-white",children:_.title}),n.jsxs("span",{className:"text-white/40 text-sm",children:["(",_.chapters.reduce((b,I)=>{var $;return b+((($=I.sections)==null?void 0:$.length)||1)},0)," 节)"]})]}),n.jsx("span",{className:"text-white/40",children:x.includes(_.id)?"▲":"▼"})]}),x.includes(_.id)&&n.jsx("div",{className:"border-t border-white/10",children:_.chapters.map(b=>n.jsx("div",{className:"border-b border-white/5 last:border-b-0",children:b.sections?n.jsxs(n.Fragment,{children:[n.jsx("div",{className:"px-6 py-3 bg-white/5 text-white/70 font-medium",children:b.title}),n.jsx("div",{className:"divide-y divide-white/5",children:b.sections.map(I=>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:I.isFree?"text-green-400":"text-yellow-400",children:I.isFree?"🔓":"🔒"}),n.jsx("span",{className:"text-white/80",children:I.id}),n.jsx("span",{className:"text-white/60",children:I.title})]}),n.jsx("div",{className:"flex items-center gap-3",children:g===I.id?n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx("input",{type:"number",value:P,onChange:$=>R(Number($.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:()=>N(I.id),className:"px-3 py-1 bg-cyan-500 text-black rounded text-sm",children:"保存"}),n.jsx("button",{type:"button",onClick:()=>v(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 ${I.isFree?"bg-green-500/20 text-green-400":"bg-yellow-500/20 text-yellow-400"}`,children:I.isFree?"免费":`¥${I.price}`}),n.jsx("button",{type:"button",onClick:()=>{v(I.id),R(I.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:()=>C(I.id,I.isFree),className:"px-2 py-1 text-xs bg-white/10 rounded hover:bg-white/20 text-white",children:I.isFree?"设为付费":"设为免费"})]})})]},I.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:b.isFree?"text-green-400":"text-yellow-400",children:b.isFree?"🔓":"🔒"}),n.jsx("span",{className:"text-white/80",children:b.title})]}),n.jsx("span",{className:`px-2 py-1 rounded text-xs ${b.isFree?"bg-green-500/20 text-green-400":"bg-yellow-500/20 text-yellow-400"}`,children:b.isFree?"免费":`¥${b.price??1}`})]})},b.id))})]},_.id))})]})]})}var Mg=["PageUp","PageDown"],Lg=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],Og={"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",[wd,hC,mC]=Ud(Bs),[Dg]=yr(Bs,[mC]),[pC,Vo]=Dg(Bs),Fg=p.forwardRef((r,a)=>{const{name:l,min:i=0,max:c=100,step:u=1,orientation:f="horizontal",disabled:m=!1,minStepsBetweenThumbs:x=0,defaultValue:y=[i],value:g,onValueChange:v=()=>{},onValueCommit:P=()=>{},inverted:R=!1,form:S,...j}=r,N=p.useRef(new Set),C=p.useRef(0),b=f==="horizontal"?xC:gC,[I=[],$]=Wr({prop:g,defaultProp:y,onChange:oe=>{var Y;(Y=[...N.current][C.current])==null||Y.focus(),v(oe)}}),G=p.useRef(I);function L(oe){const ue=bC(I,oe);de(oe,ue)}function V(oe){de(oe,C.current)}function te(){const oe=G.current[C.current];I[C.current]!==oe&&P(I)}function de(oe,ue,{commit:Y}={commit:!1}){const B=kC(u),z=EC(Math.round((oe-i)/u)*u+i,B),H=go(z,[i,c]);$((K=[])=>{const A=wC(K,H,ue);if(CC(A,x*u)){C.current=A.indexOf(H);const Q=String(A)!==String(K);return Q&&Y&&P(A),Q?A:K}else return K})}return n.jsx(pC,{scope:r.__scopeSlider,name:l,disabled:m,min:i,max:c,valueIndexToChangeRef:C,thumbs:N.current,values:I,orientation:f,form:S,children:n.jsx(wd.Provider,{scope:r.__scopeSlider,children:n.jsx(wd.Slot,{scope:r.__scopeSlider,children:n.jsx(b,{"aria-disabled":m,"data-disabled":m?"":void 0,...j,ref:a,onPointerDown:Te(j.onPointerDown,()=>{m||(G.current=I)}),min:i,max:c,inverted:R,onSlideStart:m?void 0:L,onSlideMove:m?void 0:V,onSlideEnd:m?void 0:te,onHomeKeyDown:()=>!m&&de(i,0,{commit:!0}),onEndKeyDown:()=>!m&&de(c,I.length-1,{commit:!0}),onStepKeyDown:({event:oe,direction:ue})=>{if(!m){const z=Mg.includes(oe.key)||oe.shiftKey&&Lg.includes(oe.key)?10:1,H=C.current,K=I[H],A=u*z*ue;de(K+A,H,{commit:!0})}}})})})})});Fg.displayName=Bs;var[zg,$g]=Dg(Bs,{startEdge:"left",endEdge:"right",size:"width",direction:1}),xC=p.forwardRef((r,a)=>{const{min:l,max:i,dir:c,inverted:u,onSlideStart:f,onSlideMove:m,onSlideEnd:x,onStepKeyDown:y,...g}=r,[v,P]=p.useState(null),R=We(a,b=>P(b)),S=p.useRef(void 0),j=Io(c),N=j==="ltr",C=N&&!u||!N&&u;function _(b){const I=S.current||v.getBoundingClientRect(),$=[0,I.width],L=tu($,C?[l,i]:[i,l]);return S.current=I,L(b-I.left)}return n.jsx(zg,{scope:r.__scopeSlider,startEdge:C?"left":"right",endEdge:C?"right":"left",direction:C?1:-1,size:"width",children:n.jsx(Bg,{dir:j,"data-orientation":"horizontal",...g,ref:R,style:{...g.style,"--radix-slider-thumb-transform":"translateX(-50%)"},onSlideStart:b=>{const I=_(b.clientX);f==null||f(I)},onSlideMove:b=>{const I=_(b.clientX);m==null||m(I)},onSlideEnd:()=>{S.current=void 0,x==null||x()},onStepKeyDown:b=>{const $=Og[C?"from-left":"from-right"].includes(b.key);y==null||y({event:b,direction:$?-1:1})}})})}),gC=p.forwardRef((r,a)=>{const{min:l,max:i,inverted:c,onSlideStart:u,onSlideMove:f,onSlideEnd:m,onStepKeyDown:x,...y}=r,g=p.useRef(null),v=We(a,g),P=p.useRef(void 0),R=!c;function S(j){const N=P.current||g.current.getBoundingClientRect(),C=[0,N.height],b=tu(C,R?[i,l]:[l,i]);return P.current=N,b(j-N.top)}return n.jsx(zg,{scope:r.__scopeSlider,startEdge:R?"bottom":"top",endEdge:R?"top":"bottom",size:"height",direction:R?1:-1,children:n.jsx(Bg,{"data-orientation":"vertical",...y,ref:v,style:{...y.style,"--radix-slider-thumb-transform":"translateY(50%)"},onSlideStart:j=>{const N=S(j.clientY);u==null||u(N)},onSlideMove:j=>{const N=S(j.clientY);f==null||f(N)},onSlideEnd:()=>{P.current=void 0,m==null||m()},onStepKeyDown:j=>{const C=Og[R?"from-bottom":"from-top"].includes(j.key);x==null||x({event:j,direction:C?-1:1})}})})}),Bg=p.forwardRef((r,a)=>{const{__scopeSlider:l,onSlideStart:i,onSlideMove:c,onSlideEnd:u,onHomeKeyDown:f,onEndKeyDown:m,onStepKeyDown:x,...y}=r,g=Vo(Bs,l);return n.jsx(Ae.span,{...y,ref:a,onKeyDown:Te(r.onKeyDown,v=>{v.key==="Home"?(f(v),v.preventDefault()):v.key==="End"?(m(v),v.preventDefault()):Mg.concat(Lg).includes(v.key)&&(x(v),v.preventDefault())}),onPointerDown:Te(r.onPointerDown,v=>{const P=v.target;P.setPointerCapture(v.pointerId),v.preventDefault(),g.thumbs.has(P)?P.focus():i(v)}),onPointerMove:Te(r.onPointerMove,v=>{v.target.hasPointerCapture(v.pointerId)&&c(v)}),onPointerUp:Te(r.onPointerUp,v=>{const P=v.target;P.hasPointerCapture(v.pointerId)&&(P.releasePointerCapture(v.pointerId),u(v))})})}),Vg="SliderTrack",Ug=p.forwardRef((r,a)=>{const{__scopeSlider:l,...i}=r,c=Vo(Vg,l);return n.jsx(Ae.span,{"data-disabled":c.disabled?"":void 0,"data-orientation":c.orientation,...i,ref:a})});Ug.displayName=Vg;var jd="SliderRange",Wg=p.forwardRef((r,a)=>{const{__scopeSlider:l,...i}=r,c=Vo(jd,l),u=$g(jd,l),f=p.useRef(null),m=We(a,f),x=c.values.length,y=c.values.map(P=>Gg(P,c.min,c.max)),g=x>1?Math.min(...y):0,v=100-Math.max(...y);return n.jsx(Ae.span,{"data-orientation":c.orientation,"data-disabled":c.disabled?"":void 0,...i,ref:m,style:{...r.style,[u.startEdge]:g+"%",[u.endEdge]:v+"%"}})});Wg.displayName=jd;var bd="SliderThumb",Hg=p.forwardRef((r,a)=>{const l=hC(r.__scopeSlider),[i,c]=p.useState(null),u=We(a,m=>c(m)),f=p.useMemo(()=>i?l().findIndex(m=>m.ref.current===i):-1,[l,i]);return n.jsx(vC,{...r,ref:u,index:f})}),vC=p.forwardRef((r,a)=>{const{__scopeSlider:l,index:i,name:c,...u}=r,f=Vo(bd,l),m=$g(bd,l),[x,y]=p.useState(null),g=We(a,_=>y(_)),v=x?f.form||!!x.closest("form"):!0,P=Vd(x),R=f.values[i],S=R===void 0?0:Gg(R,f.min,f.max),j=jC(i,f.values.length),N=P==null?void 0:P[m.size],C=N?NC(N,S,m.direction):0;return p.useEffect(()=>{if(x)return f.thumbs.add(x),()=>{f.thumbs.delete(x)}},[x,f.thumbs]),n.jsxs("span",{style:{transform:"var(--radix-slider-thumb-transform)",position:"absolute",[m.startEdge]:`calc(${S}% + ${C}px)`},children:[n.jsx(wd.ItemSlot,{scope:r.__scopeSlider,children:n.jsx(Ae.span,{role:"slider","aria-label":r["aria-label"]||j,"aria-valuemin":f.min,"aria-valuenow":R,"aria-valuemax":f.max,"aria-orientation":f.orientation,"data-orientation":f.orientation,"data-disabled":f.disabled?"":void 0,tabIndex:f.disabled?void 0:0,...u,ref:g,style:R===void 0?{display:"none"}:r.style,onFocus:Te(r.onFocus,()=>{f.valueIndexToChangeRef.current=i})})}),v&&n.jsx(Kg,{name:c??(f.name?f.name+(f.values.length>1?"[]":""):void 0),form:f.form,value:R},i)]})});Hg.displayName=bd;var yC="RadioBubbleInput",Kg=p.forwardRef(({__scopeSlider:r,value:a,...l},i)=>{const c=p.useRef(null),u=We(c,i),f=Bd(a);return p.useEffect(()=>{const m=c.current;if(!m)return;const x=window.HTMLInputElement.prototype,g=Object.getOwnPropertyDescriptor(x,"value").set;if(f!==a&&g){const v=new Event("input",{bubbles:!0});g.call(m,a),m.dispatchEvent(v)}},[f,a]),n.jsx(Ae.input,{style:{display:"none"},...l,ref:u,defaultValue:a})});Kg.displayName=yC;function wC(r=[],a,l){const i=[...r];return i[l]=a,i.sort((c,u)=>c-u)}function Gg(r,a,l){const u=100/(l-a)*(r-a);return go(u,[0,100])}function jC(r,a){return a>2?`Value ${r+1} of ${a}`:a===2?["Minimum","Maximum"][r]:void 0}function bC(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 NC(r,a,l){const i=r/2,u=tu([0,50],[0,i]);return(i-u(a)*l)*l}function SC(r){return r.slice(0,-1).map((a,l)=>r[l+1]-a)}function CC(r,a){if(a>0){const l=SC(r);return Math.min(...l)>=a}return!0}function tu(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 kC(r){return(String(r).split(".")[1]||"").length}function EC(r,a){const l=Math.pow(10,a);return Math.round(r*l)/l}var PC=Fg,RC=Ug,_C=Wg,TC=Hg;function IC({className:r,defaultValue:a,value:l,min:i=0,max:c=100,...u}){const f=p.useMemo(()=>Array.isArray(l)?l:Array.isArray(a)?a:[i,c],[l,a,i,c]);return n.jsxs(PC,{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),...u,children:[n.jsx(RC,{className:"bg-gray-600 relative grow overflow-hidden rounded-full h-1.5 w-full",children:n.jsx(_C,{className:"bg-[#38bdac] absolute h-full rounded-full"})}),Array.from({length:f.length},(m,x)=>n.jsx(TC,{className:"block size-4 shrink-0 rounded-full border-2 border-[#38bdac] bg-white shadow-sm focus-visible:ring-2 focus-visible:ring-[#38bdac] focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50"},x))]})}const AC={distributorShare:90,minWithdrawAmount:10,bindingDays:30,userDiscount:5,enableAutoWithdraw:!1,vipOrderShareVip:20,vipOrderShareNonVip:10};function MC(){const[r,a]=p.useState(AC),[l,i]=p.useState(!0),[c,u]=p.useState(!1);p.useEffect(()=>{Ue("/api/admin/referral-settings").then(x=>{const y=x==null?void 0:x.data;y&&typeof y=="object"&&a({distributorShare:y.distributorShare??90,minWithdrawAmount:y.minWithdrawAmount??10,bindingDays:y.bindingDays??30,userDiscount:y.userDiscount??5,enableAutoWithdraw:y.enableAutoWithdraw??!1,vipOrderShareVip:y.vipOrderShareVip??20,vipOrderShareNonVip:y.vipOrderShareNonVip??10})}).catch(console.error).finally(()=>i(!1))},[]);const f=async()=>{u(!0);try{const x={distributorShare:Number(r.distributorShare)||0,minWithdrawAmount:Number(r.minWithdrawAmount)||0,bindingDays:Number(r.bindingDays)||0,userDiscount:Number(r.userDiscount)||0,enableAutoWithdraw:!!r.enableAutoWithdraw,vipOrderShareVip:Number(r.vipOrderShareVip)||20,vipOrderShareNonVip:Number(r.vipOrderShareNonVip)||10},y=await vt("/api/admin/referral-settings",x);if(!y||y.success===!1){alert("保存失败: "+(y&&typeof y=="object"&&"error"in y?y.error:""));return}alert(`✅ 分销配置已保存成功! + +• 小程序与网站的推广规则会一起生效 +• 绑定关系会使用新的天数配置 +• 佣金比例会立即应用到新订单 + +如有缓存,请刷新前台/小程序页面。`)}catch(x){console.error(x),alert("保存失败: "+(x instanceof Error?x.message:String(x)))}finally{u(!1)}},m=x=>y=>{const g=parseFloat(y.target.value||"0");a(v=>({...v,[x]:isNaN(g)?0:g}))};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(Rs,{className:"w-5 h-5 text-[#38bdac]"}),"推广 / 分销设置"]}),n.jsx("p",{className:"text-gray-400 mt-1",children:"统一管理「好友优惠」「你得 90% 收益」「绑定期 30 天」「提现门槛」等规则,小程序和 Web 共用这套配置。"})]}),n.jsxs(ge,{onClick:f,disabled:c||l,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:[n.jsx(an,{className:"w-4 h-4 mr-2"}),c?"保存中...":"保存配置"]})]}),n.jsxs("div",{className:"space-y-6",children:[n.jsxs(Se,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:[n.jsxs(Fe,{children:[n.jsxs(ze,{className:"flex items-center gap-2 text-white",children:[n.jsx(m1,{className:"w-4 h-4 text-[#38bdac]"}),"推广规则"]}),n.jsx(it,{className:"text-gray-400",children:"这三项会直接体现在小程序「推广规则」卡片上,同时影响实收佣金计算。"})]}),n.jsx(Ce,{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(se,{className:"text-gray-300 flex items-center gap-2",children:[n.jsx(Ql,{className:"w-3 h-3 text-[#38bdac]"}),"好友优惠(%)"]}),n.jsx(le,{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(se,{className:"text-gray-300 flex items-center gap-2",children:[n.jsx(Cn,{className:"w-3 h-3 text-[#38bdac]"}),"推广者分成(%)"]}),n.jsxs("div",{className:"flex items-center gap-4",children:[n.jsx(IC,{className:"flex-1",min:10,max:100,step:1,value:[r.distributorShare],onValueChange:([x])=>a(y=>({...y,distributorShare:x}))}),n.jsx(le,{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(se,{className:"text-gray-300 flex items-center gap-2",children:[n.jsx(Ql,{className:"w-3 h-3 text-[#38bdac]"}),"会员订单分润(推广者是会员 %)"]}),n.jsx(le,{type:"number",min:0,max:100,className:"bg-[#0a1628] border-gray-700 text-white",value:r.vipOrderShareVip,onChange:m("vipOrderShareVip")}),n.jsx("p",{className:"text-xs text-gray-500",children:"推广者已是会员时,会员订单佣金比例,默认 20%。"})]}),n.jsxs("div",{className:"space-y-2",children:[n.jsxs(se,{className:"text-gray-300 flex items-center gap-2",children:[n.jsx(Ql,{className:"w-3 h-3 text-[#38bdac]"}),"会员订单分润(推广者非会员 %)"]}),n.jsx(le,{type:"number",min:0,max:100,className:"bg-[#0a1628] border-gray-700 text-white",value:r.vipOrderShareNonVip,onChange:m("vipOrderShareNonVip")}),n.jsx("p",{className:"text-xs text-gray-500",children:"推广者非会员时,会员订单佣金比例,默认 10%。"})]}),n.jsxs("div",{className:"space-y-2",children:[n.jsxs(se,{className:"text-gray-300 flex items-center gap-2",children:[n.jsx(Cn,{className:"w-3 h-3 text-[#38bdac]"}),"绑定有效期(天)"]}),n.jsx(le,{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(Se,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:[n.jsxs(Fe,{children:[n.jsxs(ze,{className:"flex items-center gap-2 text-white",children:[n.jsx(Rs,{className:"w-4 h-4 text-[#38bdac]"}),"提现规则"]}),n.jsx(it,{className:"text-gray-400",children:"与「提现中心」「自动提现」相关的参数,影响推广者看到的可提现金额和最低门槛。"})]}),n.jsx(Ce,{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(se,{className:"text-gray-300",children:"最低提现金额(元)"}),n.jsx(le,{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(se,{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(ot,{checked:r.enableAutoWithdraw,onCheckedChange:x=>a(y=>({...y,enableAutoWithdraw:x}))}),n.jsx("span",{className:"text-sm text-gray-400",children:"开启后,可结合定时任务实现「收益自动打款到微信零钱」。"})]})]})]})})]}),n.jsxs(Se,{className:"bg-[#0f2137] border-gray-700/50",children:[n.jsx(Fe,{children:n.jsxs(ze,{className:"flex items-center gap-2 text-gray-200 text-sm",children:[n.jsx(Ql,{className:"w-4 h-4 text-[#38bdac]"}),"使用说明"]})}),n.jsxs(Ce,{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 LC={appId:"wxb8bbb2b10dec74aa",withdrawSubscribeTmplId:"u3MbZGPRkrZIk-I7QdpwzFxnO_CeQPaCWF2FkiIablE",mchId:"1318592501",minWithdraw:10},OC={name:"卡若",startDate:"2025年10月15日",bio:"连续创业者,私域运营专家,每天早上6-9点在Soul派对房分享真实商业故事",liveTime:"06:00-09:00",platform:"Soul派对房",description:"连续创业者,私域运营专家"},DC={sectionPrice:1,baseBookPrice:9.9,distributorShare:90,authorInfo:{...OC}},FC={matchEnabled:!0,referralEnabled:!0,searchEnabled:!0,aboutEnabled:!0};function zC(){const[r,a]=p.useState(DC),[l,i]=p.useState(["preface","epilogue","1.1","appendix-1","appendix-2","appendix-3"]),[c,u]=p.useState(""),[f,m]=p.useState(FC),[x,y]=p.useState(LC),[g,v]=p.useState(!1),[P,R]=p.useState(!0),[S,j]=p.useState(!1),[N,C]=p.useState(""),[_,b]=p.useState(""),[I,$]=p.useState(!1),[G,L]=p.useState(!1),V=(B,z,H=!1)=>{C(B),b(z),$(H),j(!0)};p.useEffect(()=>{(async()=>{try{const z=await Ue("/api/admin/settings");if(!z||z.success===!1)return;if(Array.isArray(z.freeChapters)&&z.freeChapters.length&&i(z.freeChapters),z.featureConfig&&Object.keys(z.featureConfig).length&&m(H=>({...H,...z.featureConfig})),z.mpConfig&&typeof z.mpConfig=="object"&&y(H=>({...H,...z.mpConfig})),z.siteSettings&&typeof z.siteSettings=="object"){const H=z.siteSettings;a(K=>({...K,...typeof H.sectionPrice=="number"&&{sectionPrice:H.sectionPrice},...typeof H.baseBookPrice=="number"&&{baseBookPrice:H.baseBookPrice},...typeof H.distributorShare=="number"&&{distributorShare:H.distributorShare},...H.authorInfo&&typeof H.authorInfo=="object"&&{authorInfo:{...K.authorInfo,...H.authorInfo}}}))}}catch(z){console.error("Load settings error:",z)}finally{R(!1)}})()},[]);const te=async(B,z)=>{L(!0);try{const H=await vt("/api/admin/settings",{featureConfig:B});if(!H||H.success===!1){z(),V("保存失败",(H==null?void 0:H.error)??"未知错误",!0);return}V("已保存","功能开关已更新,相关入口将随之显示或隐藏。")}catch(H){console.error("Save feature config error:",H),z(),V("保存失败",H instanceof Error?H.message:String(H),!0)}finally{L(!1)}},de=(B,z)=>{const H=f,K={...H,[B]:z};m(K),te(K,()=>m(H))},oe=async()=>{v(!0);try{const B=await vt("/api/admin/settings",{freeChapters:l,featureConfig:f,siteSettings:{sectionPrice:r.sectionPrice,baseBookPrice:r.baseBookPrice,distributorShare:r.distributorShare,authorInfo:r.authorInfo},mpConfig:{...x,appId:x.appId||"",withdrawSubscribeTmplId:x.withdrawSubscribeTmplId||"",mchId:x.mchId||"",minWithdraw:typeof x.minWithdraw=="number"?x.minWithdraw:10}});if(!B||B.success===!1){V("保存失败",(B==null?void 0:B.error)??"未知错误",!0);return}V("已保存","设置已保存成功。")}catch(B){console.error("Save settings error:",B),V("保存失败",B instanceof Error?B.message:String(B),!0)}finally{v(!1)}},ue=()=>{c&&!l.includes(c)&&(i([...l,c]),u(""))},Y=B=>{i(l.filter(z=>z!==B))};return P?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(ge,{onClick:oe,disabled:g,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:[n.jsx(an,{className:"w-4 h-4 mr-2"}),g?"保存中...":"保存设置"]})]}),n.jsxs("div",{className:"space-y-6",children:[n.jsxs(Se,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:[n.jsxs(Fe,{children:[n.jsxs(ze,{className:"text-white flex items-center gap-2",children:[n.jsx(im,{className:"w-5 h-5 text-[#38bdac]"}),"关于作者"]}),n.jsx(it,{className:"text-gray-400",children:'配置作者信息,将在"关于作者"页面显示'})]}),n.jsxs(Ce,{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(se,{htmlFor:"author-name",className:"text-gray-300 flex items-center gap-1",children:[n.jsx(im,{className:"w-3 h-3"}),"主理人名称"]}),n.jsx(le,{id:"author-name",className:"bg-[#0a1628] border-gray-700 text-white",value:r.authorInfo.name??"",onChange:B=>a(z=>({...z,authorInfo:{...z.authorInfo,name:B.target.value}}))})]}),n.jsxs("div",{className:"space-y-2",children:[n.jsxs(se,{htmlFor:"start-date",className:"text-gray-300 flex items-center gap-1",children:[n.jsx(td,{className:"w-3 h-3"}),"开播日期"]}),n.jsx(le,{id:"start-date",className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"例如: 2025年10月15日",value:r.authorInfo.startDate??"",onChange:B=>a(z=>({...z,authorInfo:{...z.authorInfo,startDate:B.target.value}}))})]})]}),n.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[n.jsxs("div",{className:"space-y-2",children:[n.jsxs(se,{htmlFor:"live-time",className:"text-gray-300 flex items-center gap-1",children:[n.jsx(td,{className:"w-3 h-3"}),"直播时间"]}),n.jsx(le,{id:"live-time",className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"例如: 06:00-09:00",value:r.authorInfo.liveTime??"",onChange:B=>a(z=>({...z,authorInfo:{...z.authorInfo,liveTime:B.target.value}}))})]}),n.jsxs("div",{className:"space-y-2",children:[n.jsxs(se,{htmlFor:"platform",className:"text-gray-300 flex items-center gap-1",children:[n.jsx(a1,{className:"w-3 h-3"}),"直播平台"]}),n.jsx(le,{id:"platform",className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"例如: Soul派对房",value:r.authorInfo.platform??"",onChange:B=>a(z=>({...z,authorInfo:{...z.authorInfo,platform:B.target.value}}))})]})]}),n.jsxs("div",{className:"space-y-2",children:[n.jsxs(se,{htmlFor:"description",className:"text-gray-300 flex items-center gap-1",children:[n.jsx(Ps,{className:"w-3 h-3"}),"简介描述"]}),n.jsx(le,{id:"description",className:"bg-[#0a1628] border-gray-700 text-white",value:r.authorInfo.description??"",onChange:B=>a(z=>({...z,authorInfo:{...z.authorInfo,description:B.target.value}}))})]}),n.jsxs("div",{className:"space-y-2",children:[n.jsx(se,{htmlFor:"bio",className:"text-gray-300",children:"详细介绍"}),n.jsx(ks,{id:"bio",className:"bg-[#0a1628] border-gray-700 text-white min-h-[100px]",placeholder:"输入作者详细介绍...",value:r.authorInfo.bio??"",onChange:B=>a(z=>({...z,authorInfo:{...z.authorInfo,bio:B.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(Se,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:[n.jsxs(Fe,{children:[n.jsxs(ze,{className:"text-white flex items-center gap-2",children:[n.jsx(uo,{className:"w-5 h-5 text-[#38bdac]"}),"价格设置"]}),n.jsx(it,{className:"text-gray-400",children:"配置书籍和章节的定价"})]}),n.jsx(Ce,{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(se,{className:"text-gray-300",children:"单节价格 (元)"}),n.jsx(le,{type:"number",className:"bg-[#0a1628] border-gray-700 text-white",value:r.sectionPrice,onChange:B=>a(z=>({...z,sectionPrice:Number.parseFloat(B.target.value)||1}))})]}),n.jsxs("div",{className:"space-y-2",children:[n.jsx(se,{className:"text-gray-300",children:"整本价格 (元)"}),n.jsx(le,{type:"number",className:"bg-[#0a1628] border-gray-700 text-white",value:r.baseBookPrice,onChange:B=>a(z=>({...z,baseBookPrice:Number.parseFloat(B.target.value)||9.9}))})]})]})})]}),n.jsxs(Se,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:[n.jsxs(Fe,{children:[n.jsxs(ze,{className:"text-white flex items-center gap-2",children:[n.jsx(ld,{className:"w-5 h-5 text-[#38bdac]"}),"小程序配置"]}),n.jsx(it,{className:"text-gray-400",children:"订阅消息模板、支付商户号等,小程序从 /api/miniprogram/config 读取(API 地址由 app.js baseUrl 控制)"})]}),n.jsx(Ce,{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(se,{className:"text-gray-300",children:"小程序 AppID"}),n.jsx(le,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"wxb8bbb2b10dec74aa",value:x.appId??"",onChange:B=>y(z=>({...z,appId:B.target.value}))})]}),n.jsxs("div",{className:"space-y-2",children:[n.jsx(se,{className:"text-gray-300",children:"提现订阅模板 ID"}),n.jsx(le,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"用户申请提现时需授权",value:x.withdrawSubscribeTmplId??"",onChange:B=>y(z=>({...z,withdrawSubscribeTmplId:B.target.value}))})]}),n.jsxs("div",{className:"space-y-2",children:[n.jsx(se,{className:"text-gray-300",children:"微信支付商户号"}),n.jsx(le,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"1318592501",value:x.mchId??"",onChange:B=>y(z=>({...z,mchId:B.target.value}))})]}),n.jsxs("div",{className:"space-y-2",children:[n.jsx(se,{className:"text-gray-300",children:"最低提现金额 (元)"}),n.jsx(le,{type:"number",className:"bg-[#0a1628] border-gray-700 text-white",value:x.minWithdraw??10,onChange:B=>y(z=>({...z,minWithdraw:Number.parseFloat(B.target.value)||10}))})]})]})})]}),n.jsxs(Se,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:[n.jsxs(Fe,{children:[n.jsxs(ze,{className:"text-white flex items-center gap-2",children:[n.jsx(cm,{className:"w-5 h-5 text-[#38bdac]"}),"免费章节"]}),n.jsx(it,{className:"text-gray-400",children:"设置哪些章节对所有用户免费开放"})]}),n.jsxs(Ce,{className:"space-y-4",children:[n.jsx("div",{className:"flex flex-wrap gap-2",children:l.map(B=>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:[B,n.jsx("button",{type:"button",onClick:()=>Y(B),className:"ml-1 hover:text-red-400",children:n.jsx(Fn,{className:"w-3 h-3"})})]},B))}),n.jsxs("div",{className:"flex gap-2",children:[n.jsx(le,{className:"bg-[#0a1628] border-gray-700 text-white flex-1",placeholder:"输入章节ID,如 1.2、2.1、preface",value:c,onChange:B=>u(B.target.value),onKeyDown:B=>B.key==="Enter"&&ue()}),n.jsxs(ge,{onClick:ue,className:"bg-[#38bdac] hover:bg-[#2da396]",children:[n.jsx($r,{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(Se,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:[n.jsxs(Fe,{children:[n.jsxs(ze,{className:"text-white flex items-center gap-2",children:[n.jsx(ho,{className:"w-5 h-5 text-[#38bdac]"}),"功能开关"]}),n.jsx(it,{className:"text-gray-400",children:"控制各个功能模块的显示/隐藏"})]}),n.jsxs(Ce,{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(Cn,{className:"w-4 h-4 text-[#38bdac]"}),n.jsx(se,{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(ot,{id:"match-enabled",checked:f.matchEnabled,disabled:G,onCheckedChange:B=>de("matchEnabled",B)})]}),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(cm,{className:"w-4 h-4 text-[#38bdac]"}),n.jsx(se,{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(ot,{id:"referral-enabled",checked:f.referralEnabled,disabled:G,onCheckedChange:B=>de("referralEnabled",B)})]}),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(se,{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(ot,{id:"search-enabled",checked:f.searchEnabled,disabled:G,onCheckedChange:B=>de("searchEnabled",B)})]}),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(ho,{className:"w-4 h-4 text-[#38bdac]"}),n.jsx(se,{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(ot,{id:"about-enabled",checked:f.aboutEnabled,disabled:G,onCheckedChange:B=>de("aboutEnabled",B)})]})]}),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.jsx(jn,{open:S,onOpenChange:j,children:n.jsxs(sn,{className:"bg-[#0f2137] border-gray-700 text-white",showCloseButton:!0,children:[n.jsxs(bn,{children:[n.jsx(Nn,{className:I?"text-red-400":"text-[#38bdac]",children:N}),n.jsx(MN,{className:"text-gray-400 whitespace-pre-wrap pt-2",children:_})]}),n.jsx(Dn,{className:"mt-4",children:n.jsx(ge,{onClick:()=>j(!1),className:I?"bg-gray-600 hover:bg-gray-500":"bg-[#38bdac] hover:bg-[#2da396]",children:"确定"})})]})})]})}const Gm={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 $C(){const[r,a]=p.useState(!1),[l,i]=p.useState(Gm),[c,u]=p.useState(""),f=async()=>{a(!0);try{const C=await Ue("/api/config");C!=null&&C.paymentMethods&&i({...Gm,...C.paymentMethods})}catch(C){console.error(C)}finally{a(!1)}};p.useEffect(()=>{f()},[]);const m=async()=>{a(!0);try{await vt("/api/db/config",{key:"payment_methods",value:l,description:"支付方式配置"}),alert("配置已保存!")}catch(C){console.error("保存失败:",C),alert("保存失败: "+(C instanceof Error?C.message:String(C)))}finally{a(!1)}},x=(C,_)=>{navigator.clipboard.writeText(C),u(_),setTimeout(()=>u(""),2e3)},y=(C,_)=>{i(b=>({...b,wechat:{...b.wechat,[C]:_}}))},g=(C,_)=>{i(b=>({...b,alipay:{...b.alipay,[C]:_}}))},v=(C,_)=>{i(b=>({...b,usdt:{...b.usdt,[C]:_}}))},P=(C,_)=>{i(b=>({...b,paypal:{...b.paypal,[C]:_}}))},R=l.wechat,S=l.alipay,j=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(ge,{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(ge,{onClick:m,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:[n.jsx(an,{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(up,{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(Hd,{defaultValue:"wechat",className:"space-y-6",children:[n.jsxs(Mo,{className:"bg-[#0f2137] border border-gray-700/50 p-1 grid grid-cols-4 w-full",children:[n.jsxs(Kt,{value:"wechat",className:"data-[state=active]:bg-[#07C160]/20 data-[state=active]:text-[#07C160] text-gray-400",children:[n.jsx(ld,{className:"w-4 h-4 mr-2"}),"微信"]}),n.jsxs(Kt,{value:"alipay",className:"data-[state=active]:bg-[#1677FF]/20 data-[state=active]:text-[#1677FF] text-gray-400",children:[n.jsx(rd,{className:"w-4 h-4 mr-2"}),"支付宝"]}),n.jsxs(Kt,{value:"usdt",className:"data-[state=active]:bg-[#26A17B]/20 data-[state=active]:text-[#26A17B] text-gray-400",children:[n.jsx(om,{className:"w-4 h-4 mr-2"}),"USDT"]}),n.jsxs(Kt,{value:"paypal",className:"data-[state=active]:bg-[#003087]/20 data-[state=active]:text-[#169BD7] text-gray-400",children:[n.jsx(sd,{className:"w-4 h-4 mr-2"}),"PayPal"]})]}),n.jsx(Gt,{value:"wechat",className:"space-y-4",children:n.jsxs(Se,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:[n.jsxs(Fe,{className:"flex flex-row items-center justify-between pb-2",children:[n.jsxs("div",{className:"space-y-1",children:[n.jsxs(ze,{className:"text-[#07C160] flex items-center gap-2",children:[n.jsx(ld,{className:"w-5 h-5"}),"微信支付配置"]}),n.jsx(it,{className:"text-gray-400",children:"配置微信支付参数和跳转链接"})]}),n.jsx(ot,{checked:!!R.enabled,onCheckedChange:C=>y("enabled",C)})]}),n.jsxs(Ce,{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(se,{className:"text-gray-300",children:"网站AppID"}),n.jsx(le,{className:"bg-[#0a1628] border-gray-700 text-white font-mono text-sm",value:String(R.websiteAppId??""),onChange:C=>y("websiteAppId",C.target.value)})]}),n.jsxs("div",{className:"space-y-2",children:[n.jsx(se,{className:"text-gray-300",children:"商户号"}),n.jsx(le,{className:"bg-[#0a1628] border-gray-700 text-white font-mono text-sm",value:String(R.merchantId??""),onChange:C=>y("merchantId",C.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(fo,{className:"w-4 h-4 text-[#38bdac]"}),"跳转链接配置(核心功能)"]}),n.jsxs("div",{className:"space-y-2",children:[n.jsx(se,{className:"text-gray-300",children:"微信收款码/支付链接"}),n.jsx(le,{className:"bg-[#0a1628] border-gray-700 text-white placeholder:text-gray-500",placeholder:"https://收款码图片URL 或 weixin://支付链接",value:String(R.qrCode??""),onChange:C=>y("qrCode",C.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(se,{className:"text-[#07C160] font-medium",children:"微信群跳转链接(支付成功后跳转)"}),n.jsx(le,{className:"bg-[#0a1628] border-[#07C160]/30 text-white placeholder:text-gray-500",placeholder:"https://weixin.qq.com/g/... 或微信群二维码图片URL",value:String(R.groupQrCode??""),onChange:C=>y("groupQrCode",C.target.value)}),n.jsx("p",{className:"text-xs text-[#07C160]/70",children:"用户支付成功后将自动跳转到此链接,进入指定微信群"})]})]})]})]})}),n.jsx(Gt,{value:"alipay",className:"space-y-4",children:n.jsxs(Se,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:[n.jsxs(Fe,{className:"flex flex-row items-center justify-between pb-2",children:[n.jsxs("div",{className:"space-y-1",children:[n.jsxs(ze,{className:"text-[#1677FF] flex items-center gap-2",children:[n.jsx(rd,{className:"w-5 h-5"}),"支付宝配置"]}),n.jsx(it,{className:"text-gray-400",children:"已加载真实支付宝参数"})]}),n.jsx(ot,{checked:!!S.enabled,onCheckedChange:C=>g("enabled",C)})]}),n.jsxs(Ce,{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(se,{className:"text-gray-300",children:"合作者身份 (PID)"}),n.jsxs("div",{className:"flex gap-2",children:[n.jsx(le,{className:"bg-[#0a1628] border-gray-700 text-white font-mono text-sm",value:String(S.partnerId??""),onChange:C=>g("partnerId",C.target.value)}),n.jsx(ge,{size:"icon",variant:"outline",className:"border-gray-700 bg-transparent",onClick:()=>x(String(S.partnerId??""),"pid"),children:c==="pid"?n.jsx(Co,{className:"w-4 h-4 text-green-500"}):n.jsx(hp,{className:"w-4 h-4 text-gray-400"})})]})]}),n.jsxs("div",{className:"space-y-2",children:[n.jsx(se,{className:"text-gray-300",children:"安全校验码 (Key)"}),n.jsx(le,{type:"password",className:"bg-[#0a1628] border-gray-700 text-white font-mono text-sm",value:String(S.securityKey??""),onChange:C=>g("securityKey",C.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(fo,{className:"w-4 h-4 text-[#38bdac]"}),"跳转链接配置"]}),n.jsxs("div",{className:"space-y-2",children:[n.jsx(se,{className:"text-gray-300",children:"支付宝收款码/跳转链接"}),n.jsx(le,{className:"bg-[#0a1628] border-gray-700 text-white placeholder:text-gray-500",placeholder:"https://qr.alipay.com/... 或收款码图片URL",value:String(S.qrCode??""),onChange:C=>g("qrCode",C.target.value)}),n.jsx("p",{className:"text-xs text-gray-500",children:"用户点击支付宝支付后显示的二维码"})]})]})]})]})}),n.jsx(Gt,{value:"usdt",className:"space-y-4",children:n.jsxs(Se,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:[n.jsxs(Fe,{className:"flex flex-row items-center justify-between pb-2",children:[n.jsxs("div",{className:"space-y-1",children:[n.jsxs(ze,{className:"text-[#26A17B] flex items-center gap-2",children:[n.jsx(om,{className:"w-5 h-5"}),"USDT配置"]}),n.jsx(it,{className:"text-gray-400",children:"配置加密货币收款地址"})]}),n.jsx(ot,{checked:!!j.enabled,onCheckedChange:C=>v("enabled",C)})]}),n.jsxs(Ce,{className:"space-y-4",children:[n.jsxs("div",{className:"space-y-2",children:[n.jsx(se,{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(j.network??"TRC20"),onChange:C=>v("network",C.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(se,{className:"text-gray-300",children:"收款地址"}),n.jsx(le,{className:"bg-[#0a1628] border-gray-700 text-white font-mono text-sm",placeholder:"T... (TRC20地址)",value:String(j.address??""),onChange:C=>v("address",C.target.value)})]}),n.jsxs("div",{className:"space-y-2",children:[n.jsx(se,{className:"text-gray-300",children:"汇率 (1 USD = ? CNY)"}),n.jsx(le,{type:"number",className:"bg-[#0a1628] border-gray-700 text-white",value:Number(j.exchangeRate)??7.2,onChange:C=>v("exchangeRate",Number.parseFloat(C.target.value)||7.2)})]})]})]})}),n.jsx(Gt,{value:"paypal",className:"space-y-4",children:n.jsxs(Se,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:[n.jsxs(Fe,{className:"flex flex-row items-center justify-between pb-2",children:[n.jsxs("div",{className:"space-y-1",children:[n.jsxs(ze,{className:"text-[#169BD7] flex items-center gap-2",children:[n.jsx(sd,{className:"w-5 h-5"}),"PayPal配置"]}),n.jsx(it,{className:"text-gray-400",children:"配置PayPal收款账户"})]}),n.jsx(ot,{checked:!!N.enabled,onCheckedChange:C=>P("enabled",C)})]}),n.jsxs(Ce,{className:"space-y-4",children:[n.jsxs("div",{className:"space-y-2",children:[n.jsx(se,{className:"text-gray-300",children:"PayPal邮箱"}),n.jsx(le,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"your@email.com",value:String(N.email??""),onChange:C=>P("email",C.target.value)})]}),n.jsxs("div",{className:"space-y-2",children:[n.jsx(se,{className:"text-gray-300",children:"汇率 (1 USD = ? CNY)"}),n.jsx(le,{type:"number",className:"bg-[#0a1628] border-gray-700 text-white",value:Number(N.exchangeRate)??7.2,onChange:C=>P("exchangeRate",Number(C.target.value)||7.2)})]})]})]})})]})]})}const BC={siteName:"卡若日记",siteTitle:"一场SOUL的创业实验场",siteDescription:"来自Soul派对房的真实商业故事",logo:"/logo.png",favicon:"/favicon.ico",primaryColor:"#00CED1"},VC={home:{enabled:!0,label:"首页"},chapters:{enabled:!0,label:"目录"},match:{enabled:!0,label:"匹配"},my:{enabled:!0,label:"我的"}},UC={homeTitle:"一场SOUL的创业实验场",homeSubtitle:"来自Soul派对房的真实商业故事",chaptersTitle:"我要看",matchTitle:"语音匹配",myTitle:"我的",aboutTitle:"关于作者"};function WC(){const[r,a]=p.useState({siteConfig:{...BC},menuConfig:{...VC},pageConfig:{...UC}}),[l,i]=p.useState(!1),[c,u]=p.useState(!1);p.useEffect(()=>{Ue("/api/config").then(g=>{g!=null&&g.siteConfig&&a(v=>({...v,siteConfig:{...v.siteConfig,...g.siteConfig}})),g!=null&&g.menuConfig&&a(v=>({...v,menuConfig:{...v.menuConfig,...g.menuConfig}})),g!=null&&g.pageConfig&&a(v=>({...v,pageConfig:{...v.pageConfig,...g.pageConfig}}))}).catch(console.error)},[]);const f=async()=>{u(!0);try{await vt("/api/db/config",{key:"site_config",value:r.siteConfig,description:"网站基础配置"}),await vt("/api/db/config",{key:"menu_config",value:r.menuConfig,description:"底部菜单配置"}),await vt("/api/db/config",{key:"page_config",value:r.pageConfig,description:"页面标题配置"}),i(!0),setTimeout(()=>i(!1),2e3),alert("配置已保存")}catch(g){console.error(g),alert("保存失败: "+(g instanceof Error?g.message:String(g)))}finally{u(!1)}},m=r.siteConfig,x=r.menuConfig,y=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(ge,{onClick:f,disabled:c,className:`${l?"bg-green-500":"bg-[#00CED1]"} hover:bg-[#20B2AA] text-white transition-colors`,children:[n.jsx(an,{className:"w-4 h-4 mr-2"}),c?"保存中...":l?"已保存":"保存设置"]})]}),n.jsxs("div",{className:"space-y-6",children:[n.jsxs(Se,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:[n.jsxs(Fe,{children:[n.jsxs(ze,{className:"text-white flex items-center gap-2",children:[n.jsx(sd,{className:"w-5 h-5 text-[#00CED1]"}),"网站基础信息"]}),n.jsx(it,{className:"text-gray-400",children:"配置网站名称、标题和描述"})]}),n.jsxs(Ce,{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(se,{htmlFor:"site-name",className:"text-gray-300",children:"网站名称"}),n.jsx(le,{id:"site-name",className:"bg-[#0a1628] border-gray-700 text-white",value:m.siteName??"",onChange:g=>a(v=>({...v,siteConfig:{...v.siteConfig,siteName:g.target.value}}))})]}),n.jsxs("div",{className:"space-y-2",children:[n.jsx(se,{htmlFor:"site-title",className:"text-gray-300",children:"网站标题"}),n.jsx(le,{id:"site-title",className:"bg-[#0a1628] border-gray-700 text-white",value:m.siteTitle??"",onChange:g=>a(v=>({...v,siteConfig:{...v.siteConfig,siteTitle:g.target.value}}))})]})]}),n.jsxs("div",{className:"space-y-2",children:[n.jsx(se,{htmlFor:"site-desc",className:"text-gray-300",children:"网站描述"}),n.jsx(le,{id:"site-desc",className:"bg-[#0a1628] border-gray-700 text-white",value:m.siteDescription??"",onChange:g=>a(v=>({...v,siteConfig:{...v.siteConfig,siteDescription:g.target.value}}))})]}),n.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[n.jsxs("div",{className:"space-y-2",children:[n.jsx(se,{htmlFor:"logo",className:"text-gray-300",children:"Logo地址"}),n.jsx(le,{id:"logo",className:"bg-[#0a1628] border-gray-700 text-white",value:m.logo??"",onChange:g=>a(v=>({...v,siteConfig:{...v.siteConfig,logo:g.target.value}}))})]}),n.jsxs("div",{className:"space-y-2",children:[n.jsx(se,{htmlFor:"favicon",className:"text-gray-300",children:"Favicon地址"}),n.jsx(le,{id:"favicon",className:"bg-[#0a1628] border-gray-700 text-white",value:m.favicon??"",onChange:g=>a(v=>({...v,siteConfig:{...v.siteConfig,favicon:g.target.value}}))})]})]})]})]}),n.jsxs(Se,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:[n.jsxs(Fe,{children:[n.jsxs(ze,{className:"text-white flex items-center gap-2",children:[n.jsx(u1,{className:"w-5 h-5 text-[#00CED1]"}),"主题颜色"]}),n.jsx(it,{className:"text-gray-400",children:"配置网站主题色"})]}),n.jsx(Ce,{children:n.jsxs("div",{className:"flex items-center gap-4",children:[n.jsxs("div",{className:"space-y-2 flex-1",children:[n.jsx(se,{htmlFor:"primary-color",className:"text-gray-300",children:"主色调"}),n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsx(le,{id:"primary-color",type:"color",className:"w-16 h-10 bg-[#0a1628] border-gray-700 cursor-pointer p-1",value:m.primaryColor??"#00CED1",onChange:g=>a(v=>({...v,siteConfig:{...v.siteConfig,primaryColor:g.target.value}}))}),n.jsx(le,{className:"bg-[#0a1628] border-gray-700 text-white flex-1",value:m.primaryColor??"#00CED1",onChange:g=>a(v=>({...v,siteConfig:{...v.siteConfig,primaryColor:g.target.value}}))})]})]}),n.jsx("div",{className:"w-24 h-24 rounded-xl flex items-center justify-center text-white font-bold",style:{backgroundColor:m.primaryColor??"#00CED1"},children:"预览"})]})})]}),n.jsxs(Se,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:[n.jsxs(Fe,{children:[n.jsxs(ze,{className:"text-white flex items-center gap-2",children:[n.jsx(o1,{className:"w-5 h-5 text-[#00CED1]"}),"底部菜单配置"]}),n.jsx(it,{className:"text-gray-400",children:"控制底部导航栏菜单的显示和名称"})]}),n.jsx(Ce,{className:"space-y-4",children:Object.entries(x).map(([g,v])=>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(ot,{checked:(v==null?void 0:v.enabled)??!0,onCheckedChange:P=>a(R=>({...R,menuConfig:{...R.menuConfig,[g]:{...v,enabled:P}}}))}),n.jsx("span",{className:"text-gray-300 w-16 capitalize",children:g}),n.jsx(le,{className:"bg-[#0f2137] border-gray-700 text-white max-w-[200px]",value:(v==null?void 0:v.label)??"",onChange:P=>a(R=>({...R,menuConfig:{...R.menuConfig,[g]:{...v,label:P.target.value}}}))})]}),n.jsx("span",{className:`text-sm ${v!=null&&v.enabled?"text-green-400":"text-gray-500"}`,children:v!=null&&v.enabled?"显示":"隐藏"})]},g))})]}),n.jsxs(Se,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:[n.jsxs(Fe,{children:[n.jsxs(ze,{className:"text-white flex items-center gap-2",children:[n.jsx(Ow,{className:"w-5 h-5 text-[#00CED1]"}),"页面标题配置"]}),n.jsx(it,{className:"text-gray-400",children:"配置各个页面的标题和副标题"})]}),n.jsxs(Ce,{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(se,{className:"text-gray-300",children:"首页标题"}),n.jsx(le,{className:"bg-[#0a1628] border-gray-700 text-white",value:y.homeTitle??"",onChange:g=>a(v=>({...v,pageConfig:{...v.pageConfig,homeTitle:g.target.value}}))})]}),n.jsxs("div",{className:"space-y-2",children:[n.jsx(se,{className:"text-gray-300",children:"首页副标题"}),n.jsx(le,{className:"bg-[#0a1628] border-gray-700 text-white",value:y.homeSubtitle??"",onChange:g=>a(v=>({...v,pageConfig:{...v.pageConfig,homeSubtitle:g.target.value}}))})]})]}),n.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[n.jsxs("div",{className:"space-y-2",children:[n.jsx(se,{className:"text-gray-300",children:"目录页标题"}),n.jsx(le,{className:"bg-[#0a1628] border-gray-700 text-white",value:y.chaptersTitle??"",onChange:g=>a(v=>({...v,pageConfig:{...v.pageConfig,chaptersTitle:g.target.value}}))})]}),n.jsxs("div",{className:"space-y-2",children:[n.jsx(se,{className:"text-gray-300",children:"匹配页标题"}),n.jsx(le,{className:"bg-[#0a1628] border-gray-700 text-white",value:y.matchTitle??"",onChange:g=>a(v=>({...v,pageConfig:{...v.pageConfig,matchTitle:g.target.value}}))})]})]}),n.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[n.jsxs("div",{className:"space-y-2",children:[n.jsx(se,{className:"text-gray-300",children:"我的页标题"}),n.jsx(le,{className:"bg-[#0a1628] border-gray-700 text-white",value:y.myTitle??"",onChange:g=>a(v=>({...v,pageConfig:{...v.pageConfig,myTitle:g.target.value}}))})]}),n.jsxs("div",{className:"space-y-2",children:[n.jsx(se,{className:"text-gray-300",children:"关于作者标题"}),n.jsx(le,{className:"bg-[#0a1628] border-gray-700 text-white",value:y.aboutTitle??"",onChange:g=>a(v=>({...v,pageConfig:{...v.pageConfig,aboutTitle:g.target.value}}))})]})]})]})]})]})]})}function HC(){const[r,a]=p.useState(""),[l,i]=p.useState(""),[c,u]=p.useState(""),[f,m]=p.useState({}),x=async()=>{var R,S,j,N;try{const C=await Ue("/api/config"),_=(S=(R=C==null?void 0:C.liveQRCodes)==null?void 0:R[0])==null?void 0:S.urls;Array.isArray(_)&&a(_.join(` +`));const b=(N=(j=C==null?void 0:C.paymentMethods)==null?void 0:j.wechat)==null?void 0:N.groupQrCode;b&&i(b),m({paymentMethods:C==null?void 0:C.paymentMethods,liveQRCodes:C==null?void 0:C.liveQRCodes})}catch(C){console.error(C)}};p.useEffect(()=>{x()},[]);const y=(R,S)=>{navigator.clipboard.writeText(R),u(S),setTimeout(()=>u(""),2e3)},g=async()=>{try{const R=r.split(` +`).map(j=>j.trim()).filter(Boolean),S=[...f.liveQRCodes||[]];S[0]?S[0].urls=R:S.push({id:"live-1",name:"微信群活码",urls:R,clickCount:0}),await vt("/api/db/config",{key:"live_qr_codes",value:S,description:"群活码配置"}),alert("群活码配置已保存!"),await x()}catch(R){console.error(R),alert("保存失败: "+(R instanceof Error?R.message:String(R)))}},v=async()=>{var R;try{await vt("/api/db/config",{key:"payment_methods",value:{...f.paymentMethods||{},wechat:{...((R=f.paymentMethods)==null?void 0:R.wechat)||{},groupQrCode:l}},description:"支付方式配置"}),alert("微信群链接已保存!用户支付成功后将自动跳转"),await x()}catch(S){console.error(S),alert("保存失败: "+(S instanceof Error?S.message:String(S)))}},P=()=>{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(up,{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(Se,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl md:col-span-2",children:[n.jsxs(Fe,{children:[n.jsxs(ze,{className:"text-[#07C160] flex items-center gap-2",children:[n.jsx(hm,{className:"w-5 h-5"}),"支付成功跳转链接(核心配置)"]}),n.jsx(it,{className:"text-gray-400",children:"用户支付完成后自动跳转到此链接,进入指定微信群"})]}),n.jsxs(Ce,{className:"space-y-4",children:[n.jsxs("div",{className:"space-y-2",children:[n.jsxs(se,{className:"text-gray-300 flex items-center gap-2",children:[n.jsx(fm,{className:"w-4 h-4"}),"微信群链接 / 活码链接"]}),n.jsxs("div",{className:"flex gap-2",children:[n.jsx(le,{placeholder:"https://cli.im/xxxxx 或 https://weixin.qq.com/g/...",className:"bg-[#0a1628] border-gray-700 text-white placeholder:text-gray-500 flex-1",value:l,onChange:R=>i(R.target.value)}),n.jsx(ge,{variant:"outline",size:"icon",className:"border-gray-700 bg-transparent hover:bg-gray-700/50",onClick:()=>y(l,"group"),children:c==="group"?n.jsx(Co,{className:"w-4 h-4 text-green-500"}):n.jsx(hp,{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(fo,{className:"w-3 h-3"}),"支持格式:草料短链、微信群链接(https://weixin.qq.com/g/...)、企业微信链接等"]})]}),n.jsxs("div",{className:"flex gap-3",children:[n.jsxs(ge,{onClick:v,className:"flex-1 bg-[#07C160] hover:bg-[#06AD51] text-white",children:[n.jsx(mm,{className:"w-4 h-4 mr-2"}),"保存配置"]}),n.jsxs(ge,{onClick:P,variant:"outline",className:"border-[#07C160] text-[#07C160] hover:bg-[#07C160]/10 bg-transparent",children:[n.jsx(fo,{className:"w-4 h-4 mr-2"}),"测试跳转"]})]})]})]}),n.jsxs(Se,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl md:col-span-2",children:[n.jsxs(Fe,{children:[n.jsxs(ze,{className:"text-white flex items-center gap-2",children:[n.jsx(hm,{className:"w-5 h-5 text-[#38bdac]"}),"多群轮换(高级配置)"]}),n.jsx(it,{className:"text-gray-400",children:"配置多个群链接,系统自动轮换分配,避免单群满员"})]}),n.jsxs(Ce,{className:"space-y-4",children:[n.jsxs("div",{className:"space-y-2",children:[n.jsxs(se,{className:"text-gray-300 flex items-center gap-2",children:[n.jsx(fm,{className:"w-4 h-4"}),"多个群链接(每行一个)"]}),n.jsx(ks,{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:R=>a(R.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(ge,{onClick:g,className:"w-full bg-[#38bdac] hover:bg-[#2da396] text-white",children:[n.jsx(mm,{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 Qm={matchTypes:[{id:"partner",label:"创业合伙",matchLabel:"创业伙伴",icon:"⭐",matchFromDB:!0,showJoinAfterMatch:!1,price:1,enabled:!0},{id:"investor",label:"资源对接",matchLabel:"资源对接",icon:"👥",matchFromDB:!1,showJoinAfterMatch:!0,price:1,enabled:!0},{id:"mentor",label:"导师顾问",matchLabel:"商业顾问",icon:"❤️",matchFromDB:!1,showJoinAfterMatch:!0,price:1,enabled:!0},{id:"team",label:"团队招募",matchLabel:"加入项目",icon:"🎮",matchFromDB:!1,showJoinAfterMatch:!0,price:1,enabled:!0}],freeMatchLimit:3,matchPrice:1,settings:{enableFreeMatches:!0,enablePaidMatches:!0,maxMatchesPerDay:10}},KC=["⭐","👥","❤️","🎮","💼","🚀","💡","🎯","🔥","✨"];function GC(){const[r,a]=p.useState(Qm),[l,i]=p.useState(!0),[c,u]=p.useState(!1),[f,m]=p.useState(!1),[x,y]=p.useState(null),[g,v]=p.useState({id:"",label:"",matchLabel:"",icon:"⭐",matchFromDB:!1,showJoinAfterMatch:!0,price:1,enabled:!0}),P=async()=>{i(!0);try{const b=await Ue("/api/db/config/full?key=match_config"),I=(b==null?void 0:b.data)??(b==null?void 0:b.config);I&&a({...Qm,...I})}catch(b){console.error("加载匹配配置失败:",b)}finally{i(!1)}};p.useEffect(()=>{P()},[]);const R=async()=>{u(!0);try{const b=await vt("/api/db/config",{key:"match_config",value:r,description:"匹配功能配置"});b&&b.success!==!1?alert("配置保存成功!"):alert("保存失败: "+(b&&typeof b=="object"&&"error"in b?b.error:"未知错误"))}catch(b){console.error("保存配置失败:",b),alert("保存失败")}finally{u(!1)}},S=b=>{y(b),v({id:b.id,label:b.label,matchLabel:b.matchLabel,icon:b.icon,matchFromDB:b.matchFromDB,showJoinAfterMatch:b.showJoinAfterMatch,price:b.price,enabled:b.enabled}),m(!0)},j=()=>{y(null),v({id:"",label:"",matchLabel:"",icon:"⭐",matchFromDB:!1,showJoinAfterMatch:!0,price:1,enabled:!0}),m(!0)},N=()=>{if(!g.id||!g.label){alert("请填写类型ID和名称");return}const b=[...r.matchTypes];if(x){const I=b.findIndex($=>$.id===x.id);I!==-1&&(b[I]={...g})}else{if(b.some(I=>I.id===g.id)){alert("类型ID已存在");return}b.push({...g})}a({...r,matchTypes:b}),m(!1)},C=b=>{confirm("确定要删除这个匹配类型吗?")&&a({...r,matchTypes:r.matchTypes.filter(I=>I.id!==b)})},_=b=>{a({...r,matchTypes:r.matchTypes.map(I=>I.id===b?{...I,enabled:!I.enabled}:I)})};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(ho,{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(ge,{variant:"outline",onClick:P,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(ge,{onClick:R,disabled:c,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:[n.jsx(an,{className:"w-4 h-4 mr-2"}),c?"保存中...":"保存配置"]})]})]}),n.jsxs(Se,{className:"bg-[#0f2137] border-gray-700/50",children:[n.jsxs(Fe,{children:[n.jsxs(ze,{className:"text-white flex items-center gap-2",children:[n.jsx($1,{className:"w-5 h-5 text-yellow-400"}),"基础设置"]}),n.jsx(it,{className:"text-gray-400",children:"配置免费匹配次数和付费规则"})]}),n.jsxs(Ce,{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(se,{className:"text-gray-300",children:"每日免费匹配次数"}),n.jsx(le,{type:"number",min:0,max:100,className:"bg-[#0a1628] border-gray-700 text-white",value:r.freeMatchLimit,onChange:b=>a({...r,freeMatchLimit:parseInt(b.target.value,10)||0})}),n.jsx("p",{className:"text-xs text-gray-500",children:"用户每天可免费匹配的次数"})]}),n.jsxs("div",{className:"space-y-2",children:[n.jsx(se,{className:"text-gray-300",children:"付费匹配价格(元)"}),n.jsx(le,{type:"number",min:.01,step:.01,className:"bg-[#0a1628] border-gray-700 text-white",value:r.matchPrice,onChange:b=>a({...r,matchPrice:parseFloat(b.target.value)||1})}),n.jsx("p",{className:"text-xs text-gray-500",children:"免费次数用完后的单次匹配价格"})]}),n.jsxs("div",{className:"space-y-2",children:[n.jsx(se,{className:"text-gray-300",children:"每日最大匹配次数"}),n.jsx(le,{type:"number",min:1,max:100,className:"bg-[#0a1628] border-gray-700 text-white",value:r.settings.maxMatchesPerDay,onChange:b=>a({...r,settings:{...r.settings,maxMatchesPerDay:parseInt(b.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(ot,{checked:r.settings.enableFreeMatches,onCheckedChange:b=>a({...r,settings:{...r.settings,enableFreeMatches:b}})}),n.jsx(se,{className:"text-gray-300",children:"启用免费匹配"})]}),n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsx(ot,{checked:r.settings.enablePaidMatches,onCheckedChange:b=>a({...r,settings:{...r.settings,enablePaidMatches:b}})}),n.jsx(se,{className:"text-gray-300",children:"启用付费匹配"})]})]})]})]}),n.jsxs(Se,{className:"bg-[#0f2137] border-gray-700/50",children:[n.jsxs(Fe,{className:"flex flex-row items-center justify-between",children:[n.jsxs("div",{children:[n.jsxs(ze,{className:"text-white flex items-center gap-2",children:[n.jsx(Cn,{className:"w-5 h-5 text-[#38bdac]"}),"匹配类型管理"]}),n.jsx(it,{className:"text-gray-400",children:"配置不同的匹配类型及其价格"})]}),n.jsxs(ge,{onClick:j,size:"sm",className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:[n.jsx($r,{className:"w-4 h-4 mr-1"}),"添加类型"]})]}),n.jsx(Ce,{children:n.jsxs(Ls,{children:[n.jsx(Os,{children:n.jsxs(Et,{className:"bg-[#0a1628] hover:bg-[#0a1628] border-gray-700",children:[n.jsx(Be,{className:"text-gray-400",children:"图标"}),n.jsx(Be,{className:"text-gray-400",children:"类型ID"}),n.jsx(Be,{className:"text-gray-400",children:"显示名称"}),n.jsx(Be,{className:"text-gray-400",children:"匹配标签"}),n.jsx(Be,{className:"text-gray-400",children:"价格"}),n.jsx(Be,{className:"text-gray-400",children:"数据库匹配"}),n.jsx(Be,{className:"text-gray-400",children:"状态"}),n.jsx(Be,{className:"text-right text-gray-400",children:"操作"})]})}),n.jsx(Ds,{children:r.matchTypes.map(b=>n.jsxs(Et,{className:"hover:bg-[#0a1628] border-gray-700/50",children:[n.jsx(Le,{children:n.jsx("span",{className:"text-2xl",children:b.icon})}),n.jsx(Le,{className:"font-mono text-gray-300",children:b.id}),n.jsx(Le,{className:"text-white font-medium",children:b.label}),n.jsx(Le,{className:"text-gray-300",children:b.matchLabel}),n.jsx(Le,{children:n.jsxs(Oe,{className:"bg-yellow-500/20 text-yellow-400 hover:bg-yellow-500/20 border-0",children:["¥",b.price]})}),n.jsx(Le,{children:b.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(Le,{children:n.jsx(ot,{checked:b.enabled,onCheckedChange:()=>_(b.id)})}),n.jsx(Le,{className:"text-right",children:n.jsxs("div",{className:"flex items-center justify-end gap-1",children:[n.jsx(ge,{variant:"ghost",size:"sm",onClick:()=>S(b),className:"text-gray-400 hover:text-[#38bdac] hover:bg-[#38bdac]/10",children:n.jsx(Ur,{className:"w-4 h-4"})}),n.jsx(ge,{variant:"ghost",size:"sm",onClick:()=>C(b.id),className:"text-red-400 hover:text-red-300 hover:bg-red-500/10",children:n.jsx(Eo,{className:"w-4 h-4"})})]})})]},b.id))})]})})]}),n.jsx(jn,{open:f,onOpenChange:m,children:n.jsxs(sn,{className:"bg-[#0f2137] border-gray-700 text-white max-w-lg",showCloseButton:!0,children:[n.jsx(bn,{children:n.jsxs(Nn,{className:"text-white flex items-center gap-2",children:[x?n.jsx(Ur,{className:"w-5 h-5 text-[#38bdac]"}):n.jsx($r,{className:"w-5 h-5 text-[#38bdac]"}),x?"编辑匹配类型":"添加匹配类型"]})}),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(se,{className:"text-gray-300",children:"类型ID(英文)"}),n.jsx(le,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"如: partner",value:g.id,onChange:b=>v({...g,id:b.target.value}),disabled:!!x})]}),n.jsxs("div",{className:"space-y-2",children:[n.jsx(se,{className:"text-gray-300",children:"图标"}),n.jsx("div",{className:"flex gap-1 flex-wrap",children:KC.map(b=>n.jsx("button",{type:"button",className:`w-8 h-8 text-lg rounded ${g.icon===b?"bg-[#38bdac]/30 ring-1 ring-[#38bdac]":"bg-[#0a1628]"}`,onClick:()=>v({...g,icon:b}),children:b},b))})]})]}),n.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[n.jsxs("div",{className:"space-y-2",children:[n.jsx(se,{className:"text-gray-300",children:"显示名称"}),n.jsx(le,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"如: 创业合伙",value:g.label,onChange:b=>v({...g,label:b.target.value})})]}),n.jsxs("div",{className:"space-y-2",children:[n.jsx(se,{className:"text-gray-300",children:"匹配标签"}),n.jsx(le,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"如: 创业伙伴",value:g.matchLabel,onChange:b=>v({...g,matchLabel:b.target.value})})]})]}),n.jsxs("div",{className:"space-y-2",children:[n.jsx(se,{className:"text-gray-300",children:"单次匹配价格(元)"}),n.jsx(le,{type:"number",min:.01,step:.01,className:"bg-[#0a1628] border-gray-700 text-white",value:g.price,onChange:b=>v({...g,price:parseFloat(b.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(ot,{checked:g.matchFromDB,onCheckedChange:b=>v({...g,matchFromDB:b})}),n.jsx(se,{className:"text-gray-300 text-sm",children:"从数据库匹配"})]}),n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsx(ot,{checked:g.showJoinAfterMatch,onCheckedChange:b=>v({...g,showJoinAfterMatch:b})}),n.jsx(se,{className:"text-gray-300 text-sm",children:"匹配后显示加入"})]}),n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsx(ot,{checked:g.enabled,onCheckedChange:b=>v({...g,enabled:b})}),n.jsx(se,{className:"text-gray-300 text-sm",children:"启用"})]})]})]}),n.jsxs(Dn,{children:[n.jsx(ge,{variant:"outline",onClick:()=>m(!1),className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:"取消"}),n.jsxs(ge,{onClick:N,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:[n.jsx(an,{className:"w-4 h-4 mr-2"}),"保存"]})]})]})})]})}const Ym={partner:"找伙伴",investor:"资源对接",mentor:"导师顾问",team:"团队招募"};function QC(){const[r,a]=p.useState([]),[l,i]=p.useState(0),[c,u]=p.useState(1),[f,m]=p.useState(10),[x,y]=p.useState(""),[g,v]=p.useState(!0),[P,R]=p.useState(null);async function S(){v(!0),R(null);try{const N=new URLSearchParams({page:String(c),pageSize:String(f)});x&&N.set("matchType",x);const C=await Ue(`/api/db/match-records?${N}`);C!=null&&C.success?(a(C.records||[]),i(C.total??0)):R("加载匹配记录失败")}catch(N){console.error("加载匹配记录失败",N),R("加载失败,请检查网络后重试")}finally{v(!1)}}p.useEffect(()=>{S()},[c,x]);const j=Math.ceil(l/f)||1;return n.jsxs("div",{className:"p-8 max-w-7xl mx-auto",children:[P&&n.jsxs("div",{className:"mb-4 px-4 py-3 rounded-lg bg-red-500/20 border border-red-500/50 text-red-400 text-sm flex items-center justify-between",children:[n.jsx("span",{children:P}),n.jsx("button",{type:"button",onClick:()=>R(null),className:"hover:text-red-300",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:["找伙伴匹配统计,共 ",l," 条记录"]})]}),n.jsxs("div",{className:"flex items-center gap-4",children:[n.jsxs("select",{value:x,onChange:N=>{y(N.target.value),u(1)},className:"bg-[#0f2137] border border-gray-700 text-white rounded-lg px-3 py-2 text-sm",children:[n.jsx("option",{value:"",children:"全部类型"}),Object.entries(Ym).map(([N,C])=>n.jsx("option",{value:N,children:C},N))]}),n.jsxs("button",{type:"button",onClick:S,disabled:g,className:"flex items-center gap-2 px-4 py-2 rounded-lg border border-gray-600 text-gray-300 hover:bg-gray-700/50 transition-colors disabled:opacity-50",children:[n.jsx(Ze,{className:`w-4 h-4 ${g?"animate-spin":""}`}),"刷新"]})]})]}),n.jsx(Se,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:n.jsx(Ce,{className:"p-0",children:g?n.jsxs("div",{className:"flex 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(n.Fragment,{children:[n.jsxs(Ls,{children:[n.jsx(Os,{children:n.jsxs(Et,{className:"bg-[#0a1628] hover:bg-[#0a1628] border-gray-700",children:[n.jsx(Be,{className:"text-gray-400",children:"发起人"}),n.jsx(Be,{className:"text-gray-400",children:"匹配到"}),n.jsx(Be,{className:"text-gray-400",children:"类型"}),n.jsx(Be,{className:"text-gray-400",children:"联系方式"}),n.jsx(Be,{className:"text-gray-400",children:"匹配时间"})]})}),n.jsxs(Ds,{children:[r.map(N=>n.jsxs(Et,{className:"hover:bg-[#0a1628] border-gray-700/50",children:[n.jsx(Le,{children:n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsxs("div",{className:"w-9 h-9 rounded-full bg-[#38bdac]/20 flex items-center justify-center text-sm font-medium text-[#38bdac] flex-shrink-0 overflow-hidden",children:[N.userAvatar?n.jsx("img",{src:N.userAvatar,alt:"",className:"w-full h-full object-cover",onError:C=>{C.currentTarget.style.display="none";const _=C.currentTarget.nextElementSibling;_&&_.classList.remove("hidden")}}):null,n.jsx("span",{className:N.userAvatar?"hidden":"",children:(N.userNickname||N.userId||"?").charAt(0)})]}),n.jsxs("div",{children:[n.jsx("div",{className:"text-white",children:N.userNickname||N.userId}),n.jsxs("div",{className:"text-xs text-gray-500 font-mono",children:[N.userId.slice(0,16),"..."]})]})]})}),n.jsx(Le,{children:n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsxs("div",{className:"w-9 h-9 rounded-full bg-[#38bdac]/20 flex items-center justify-center text-sm font-medium text-[#38bdac] flex-shrink-0 overflow-hidden",children:[N.matchedUserAvatar?n.jsx("img",{src:N.matchedUserAvatar,alt:"",className:"w-full h-full object-cover",onError:C=>{C.currentTarget.style.display="none";const _=C.currentTarget.nextElementSibling;_&&_.classList.remove("hidden")}}):null,n.jsx("span",{className:N.matchedUserAvatar?"hidden":"",children:(N.matchedNickname||N.matchedUserId||"?").charAt(0)})]}),n.jsxs("div",{children:[n.jsx("div",{className:"text-white",children:N.matchedNickname||N.matchedUserId}),n.jsxs("div",{className:"text-xs text-gray-500 font-mono",children:[N.matchedUserId.slice(0,16),"..."]})]})]})}),n.jsx(Le,{children:n.jsx(Oe,{className:"bg-[#38bdac]/20 text-[#38bdac] border-0",children:Ym[N.matchType]||N.matchType})}),n.jsxs(Le,{className:"text-gray-400 text-sm",children:[N.phone&&n.jsxs("div",{children:["📱 ",N.phone]}),N.wechatId&&n.jsxs("div",{children:["💬 ",N.wechatId]}),!N.phone&&!N.wechatId&&"-"]}),n.jsx(Le,{className:"text-gray-400",children:N.createdAt?new Date(N.createdAt).toLocaleString():"-"})]},N.id)),r.length===0&&n.jsx(Et,{children:n.jsx(Le,{colSpan:5,className:"text-center py-12 text-gray-500",children:"暂无匹配记录"})})]})]}),n.jsx(Vr,{page:c,totalPages:j,total:l,pageSize:f,onPageChange:u,onPageSizeChange:N=>{m(N),u(1)}})]})})})]})}function YC(){const[r,a]=p.useState([]),[l,i]=p.useState(!0),[c,u]=p.useState(!1),[f,m]=p.useState(null),[x,y]=p.useState(""),[g,v]=p.useState(0),[P,R]=p.useState(!1);async function S(){i(!0);try{const b=await Ue("/api/db/vip-roles");b!=null&&b.success&&b.data&&a(b.data)}catch(b){console.error("Load roles error:",b)}finally{i(!1)}}p.useEffect(()=>{S()},[]);const j=()=>{m(null),y(""),v(r.length>0?Math.max(...r.map(b=>b.sort))+1:0),u(!0)},N=b=>{m(b),y(b.name),v(b.sort),u(!0)},C=async()=>{if(!x.trim()){alert("角色名称不能为空");return}R(!0);try{if(f){const b=await ln("/api/db/vip-roles",{id:f.id,name:x.trim(),sort:g});b!=null&&b.success?(u(!1),S()):alert("更新失败: "+(b==null?void 0:b.error))}else{const b=await vt("/api/db/vip-roles",{name:x.trim(),sort:g});b!=null&&b.success?(u(!1),S()):alert("新增失败: "+(b==null?void 0:b.error))}}catch(b){console.error("Save error:",b),alert("保存失败")}finally{R(!1)}},_=async b=>{if(confirm("确定删除该角色?已设置该角色的 VIP 用户将保留角色名称。"))try{const I=await Td(`/api/db/vip-roles?id=${b}`);I!=null&&I.success?S():alert("删除失败: "+(I==null?void 0:I.error))}catch(I){console.error("Delete error:",I),alert("删除失败")}};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.jsxs("h2",{className:"text-2xl font-bold text-white flex items-center gap-2",children:[n.jsx(ko,{className:"w-5 h-5 text-amber-400"}),"VIP 角色管理"]}),n.jsx("p",{className:"text-gray-400 mt-1",children:"超级个体固定角色,在「设置 VIP」时可选择或手动填写"})]}),n.jsxs(ge,{onClick:j,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:[n.jsx($r,{className:"w-4 h-4 mr-2"}),"新增角色"]})]}),n.jsx(Se,{className:"bg-[#0f2137] border-gray-700/50",children:n.jsx(Ce,{className:"p-0",children:l?n.jsx("div",{className:"py-12 text-center text-gray-400",children:"加载中..."}):n.jsxs(Ls,{children:[n.jsx(Os,{children:n.jsxs(Et,{className:"bg-[#0a1628] border-gray-700",children:[n.jsx(Be,{className:"text-gray-400",children:"ID"}),n.jsx(Be,{className:"text-gray-400",children:"角色名称"}),n.jsx(Be,{className:"text-gray-400",children:"排序"}),n.jsx(Be,{className:"text-right text-gray-400",children:"操作"})]})}),n.jsxs(Ds,{children:[r.map(b=>n.jsxs(Et,{className:"border-gray-700/50",children:[n.jsx(Le,{className:"text-gray-300",children:b.id}),n.jsx(Le,{className:"text-white",children:b.name}),n.jsx(Le,{className:"text-gray-400",children:b.sort}),n.jsxs(Le,{className:"text-right",children:[n.jsx(ge,{variant:"ghost",size:"sm",onClick:()=>N(b),className:"text-gray-400 hover:text-[#38bdac]",children:n.jsx(Ur,{className:"w-4 h-4"})}),n.jsx(ge,{variant:"ghost",size:"sm",onClick:()=>_(b.id),className:"text-gray-400 hover:text-red-400",children:n.jsx(Eo,{className:"w-4 h-4"})})]})]},b.id)),r.length===0&&n.jsx(Et,{children:n.jsx(Le,{colSpan:4,className:"text-center py-12 text-gray-500",children:"暂无角色,点击「新增角色」添加"})})]})]})})}),n.jsx(jn,{open:c,onOpenChange:u,children:n.jsxs(sn,{className:"bg-[#0f2137] border-gray-700 text-white max-w-sm",children:[n.jsx(bn,{children:n.jsx(Nn,{className:"text-white",children:f?"编辑角色":"新增角色"})}),n.jsxs("div",{className:"space-y-4 py-4",children:[n.jsxs("div",{className:"space-y-2",children:[n.jsx(se,{className:"text-gray-300",children:"角色名称"}),n.jsx(le,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"如:创始人、投资人",value:x,onChange:b=>y(b.target.value)})]}),n.jsxs("div",{className:"space-y-2",children:[n.jsx(se,{className:"text-gray-300",children:"排序(下拉展示顺序,越小越前)"}),n.jsx(le,{type:"number",className:"bg-[#0a1628] border-gray-700 text-white",value:g,onChange:b=>v(parseInt(b.target.value,10)||0)})]})]}),n.jsxs(Dn,{children:[n.jsxs(ge,{variant:"outline",onClick:()=>u(!1),className:"border-gray-600 text-gray-300",children:[n.jsx(Fn,{className:"w-4 h-4 mr-2"}),"取消"]}),n.jsxs(ge,{onClick:C,disabled:P,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:[n.jsx(an,{className:"w-4 h-4 mr-2"}),P?"保存中...":"保存"]})]})]})})]})}function qC(){return n.jsxs("div",{className:"p-8 max-w-4xl mx-auto",children:[n.jsxs("div",{className:"flex items-center gap-2 mb-8",children:[n.jsx(zr,{className:"w-8 h-8 text-[#38bdac]"}),n.jsx("h1",{className:"text-2xl font-bold text-white",children:"API 接口文档"})]}),n.jsx("p",{className:"text-gray-400 mb-6",children:"API 风格:RESTful · 版本 v1.0 · 基础路径 /api · 简单、清晰、易用。"}),n.jsxs(Se,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl mb-6",children:[n.jsx(Fe,{children:n.jsx(ze,{className:"text-white",children:"1. 接口总览"})}),n.jsxs(Ce,{className:"space-y-4 text-sm",children:[n.jsxs("div",{children:[n.jsx("p",{className:"text-gray-400 mb-2",children:"接口分类"}),n.jsxs("ul",{className:"space-y-1 text-gray-300 font-mono",children:[n.jsx("li",{children:"/api/book — 书籍内容(章节列表、内容获取、同步)"}),n.jsx("li",{children:"/api/payment — 支付系统(订单创建、回调、状态查询)"}),n.jsx("li",{children:"/api/referral — 分销系统(邀请码、收益、提现)"}),n.jsx("li",{children:"/api/user — 用户系统(登录、注册、信息更新)"}),n.jsx("li",{children:"/api/match — 匹配系统(寻找匹配、匹配历史)"}),n.jsx("li",{children:"/api/admin — 管理后台(内容/订单/用户/分销管理)"}),n.jsx("li",{children:"/api/config — 配置系统"})]})]}),n.jsxs("div",{children:[n.jsx("p",{className:"text-gray-400 mb-2",children:"认证方式"}),n.jsx("p",{className:"text-gray-300",children:"用户:Cookie session_id(可选)"}),n.jsx("p",{className:"text-gray-300",children:"管理端:Authorization: Bearer admin-token-secret"})]})]})]}),n.jsxs(Se,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl mb-6",children:[n.jsx(Fe,{children:n.jsx(ze,{className:"text-white",children:"2. 书籍内容"})}),n.jsxs(Ce,{className:"space-y-2 text-sm text-gray-300 font-mono",children:[n.jsx("p",{children:"GET /api/book/all-chapters — 获取所有章节"}),n.jsx("p",{children:"GET /api/book/chapter/:id — 获取单章内容"}),n.jsx("p",{children:"POST /api/book/sync — 同步章节(需管理员认证)"})]})]}),n.jsxs(Se,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl mb-6",children:[n.jsx(Fe,{children:n.jsx(ze,{className:"text-white",children:"3. 支付"})}),n.jsxs(Ce,{className:"space-y-2 text-sm text-gray-300 font-mono",children:[n.jsx("p",{children:"POST /api/payment/create-order — 创建订单"}),n.jsx("p",{children:"POST /api/payment/alipay/notify — 支付宝回调"}),n.jsx("p",{children:"POST /api/payment/wechat/notify — 微信回调"})]})]}),n.jsxs(Se,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl mb-6",children:[n.jsx(Fe,{children:n.jsx(ze,{className:"text-white",children:"4. 分销与用户"})}),n.jsxs(Ce,{className:"space-y-2 text-sm text-gray-300 font-mono",children:[n.jsx("p",{children:"/api/referral/* — 邀请码、收益查询、提现"}),n.jsx("p",{children:"/api/user/* — 登录、注册、信息更新"}),n.jsx("p",{children:"/api/match/* — 匹配、匹配历史"})]})]}),n.jsxs(Se,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl mb-6",children:[n.jsx(Fe,{children:n.jsx(ze,{className:"text-white",children:"5. 管理后台"})}),n.jsxs(Ce,{className:"space-y-2 text-sm text-gray-300 font-mono",children:[n.jsx("p",{children:"GET/POST /api/admin/referral-settings — 推广/分销设置(含 VIP 配置)"}),n.jsx("p",{children:"GET /api/db/users、/api/db/book — 用户与章节数据"}),n.jsx("p",{children:"GET /api/orders — 订单列表"})]})]}),n.jsx("p",{className:"text-gray-500 text-xs",children:"完整说明见项目内 开发文档/5、接口/API接口完整文档.md"})]})}function XC(){const r=Yr();return n.jsx("div",{className:"min-h-screen bg-[#0a1628] flex items-center justify-center p-8",children:n.jsxs("div",{className:"text-center max-w-md",children:[n.jsx("div",{className:"inline-flex items-center justify-center w-20 h-20 rounded-full bg-red-500/20 text-red-400 mb-6",children:n.jsx(ww,{className:"w-10 h-10"})}),n.jsx("h1",{className:"text-4xl font-bold text-white mb-2",children:"404"}),n.jsx("p",{className:"text-gray-400 mb-1",children:"页面不存在"}),n.jsx("p",{className:"text-sm text-gray-500 font-mono mb-8 break-all",children:r.pathname}),n.jsx(ge,{asChild:!0,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:n.jsxs(op,{to:"/",children:[n.jsx(Hw,{className:"w-4 h-4 mr-2"}),"返回首页"]})})]})})}function JC(){return n.jsxs(Yy,{children:[n.jsx(rt,{path:"/login",element:n.jsx(Wj,{})}),n.jsxs(rt,{path:"/",element:n.jsx(G1,{}),children:[n.jsx(rt,{index:!0,element:n.jsx(Ky,{to:"/dashboard",replace:!0})}),n.jsx(rt,{path:"dashboard",element:n.jsx(Kj,{})}),n.jsx(rt,{path:"orders",element:n.jsx(Qj,{})}),n.jsx(rt,{path:"users",element:n.jsx(s2,{})}),n.jsx(rt,{path:"distribution",element:n.jsx(a2,{})}),n.jsx(rt,{path:"withdrawals",element:n.jsx(l2,{})}),n.jsx(rt,{path:"content",element:n.jsx(uC,{})}),n.jsx(rt,{path:"chapters",element:n.jsx(fC,{})}),n.jsx(rt,{path:"referral-settings",element:n.jsx(MC,{})}),n.jsx(rt,{path:"vip-roles",element:n.jsx(YC,{})}),n.jsx(rt,{path:"settings",element:n.jsx(zC,{})}),n.jsx(rt,{path:"payment",element:n.jsx($C,{})}),n.jsx(rt,{path:"site",element:n.jsx(WC,{})}),n.jsx(rt,{path:"qrcodes",element:n.jsx(HC,{})}),n.jsx(rt,{path:"match",element:n.jsx(GC,{})}),n.jsx(rt,{path:"match-records",element:n.jsx(QC,{})}),n.jsx(rt,{path:"api-doc",element:n.jsx(qC,{})})]}),n.jsx(rt,{path:"*",element:n.jsx(XC,{})})]})}Jv.createRoot(document.getElementById("root")).render(n.jsx(p.StrictMode,{children:n.jsx(nw,{future:{v7_startTransition:!0,v7_relativeSplatPath:!0},children:n.jsx(JC,{})})})); diff --git a/soul-admin/dist/assets/index-Bw4NCaMi.css b/soul-admin/dist/assets/index-Bw4NCaMi.css new file mode 100644 index 00000000..87982e28 --- /dev/null +++ b/soul-admin/dist/assets/index-Bw4NCaMi.css @@ -0,0 +1 @@ +/*! tailwindcss v4.1.18 | MIT License | https://tailwindcss.com */@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-translate-x:0;--tw-translate-y:0;--tw-translate-z:0;--tw-scale-x:1;--tw-scale-y:1;--tw-scale-z:1;--tw-rotate-x:initial;--tw-rotate-y:initial;--tw-rotate-z:initial;--tw-skew-x:initial;--tw-skew-y:initial;--tw-pan-x:initial;--tw-pan-y:initial;--tw-pinch-zoom:initial;--tw-space-y-reverse:0;--tw-space-x-reverse:0;--tw-divide-x-reverse:0;--tw-border-style:solid;--tw-divide-y-reverse:0;--tw-gradient-position:initial;--tw-gradient-from:#0000;--tw-gradient-via:#0000;--tw-gradient-to:#0000;--tw-gradient-stops:initial;--tw-gradient-via-stops:initial;--tw-gradient-from-position:0%;--tw-gradient-via-position:50%;--tw-gradient-to-position:100%;--tw-leading:initial;--tw-font-weight:initial;--tw-tracking:initial;--tw-ordinal:initial;--tw-slashed-zero:initial;--tw-numeric-figure:initial;--tw-numeric-spacing:initial;--tw-numeric-fraction:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000;--tw-outline-style:solid;--tw-blur:initial;--tw-brightness:initial;--tw-contrast:initial;--tw-grayscale:initial;--tw-hue-rotate:initial;--tw-invert:initial;--tw-opacity:initial;--tw-saturate:initial;--tw-sepia:initial;--tw-drop-shadow:initial;--tw-drop-shadow-color:initial;--tw-drop-shadow-alpha:100%;--tw-drop-shadow-size:initial;--tw-backdrop-blur:initial;--tw-backdrop-brightness:initial;--tw-backdrop-contrast:initial;--tw-backdrop-grayscale:initial;--tw-backdrop-hue-rotate:initial;--tw-backdrop-invert:initial;--tw-backdrop-opacity:initial;--tw-backdrop-saturate:initial;--tw-backdrop-sepia:initial}}}@layer theme{:root,:host{--font-sans:-apple-system,BlinkMacSystemFont,"Segoe UI","PingFang SC","Microsoft YaHei",sans-serif;--font-mono:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace;--color-red-300:oklch(80.8% .114 19.571);--color-red-400:oklch(70.4% .191 22.216);--color-red-500:oklch(63.7% .237 25.331);--color-orange-300:oklch(83.7% .128 66.29);--color-orange-400:oklch(75% .183 55.934);--color-orange-500:oklch(70.5% .213 47.604);--color-amber-400:oklch(82.8% .189 84.429);--color-amber-500:oklch(76.9% .188 70.08);--color-yellow-400:oklch(85.2% .199 91.936);--color-yellow-500:oklch(79.5% .184 86.047);--color-green-400:oklch(79.2% .209 151.711);--color-green-500:oklch(72.3% .219 149.579);--color-green-600:oklch(62.7% .194 149.214);--color-green-700:oklch(52.7% .154 150.069);--color-cyan-400:oklch(78.9% .154 211.53);--color-cyan-500:oklch(71.5% .143 215.221);--color-blue-300:oklch(80.9% .105 251.813);--color-blue-400:oklch(70.7% .165 254.624);--color-blue-500:oklch(62.3% .214 259.815);--color-purple-400:oklch(71.4% .203 305.504);--color-purple-500:oklch(62.7% .265 303.9);--color-gray-200:oklch(92.8% .006 264.531);--color-gray-300:oklch(87.2% .01 258.338);--color-gray-400:oklch(70.7% .022 261.325);--color-gray-500:oklch(55.1% .027 264.364);--color-gray-600:oklch(44.6% .03 256.802);--color-gray-700:oklch(37.3% .034 259.733);--color-gray-800:oklch(27.8% .033 256.848);--color-black:#000;--color-white:#fff;--spacing:.25rem;--container-sm:24rem;--container-md:28rem;--container-lg:32rem;--container-2xl:42rem;--container-4xl:56rem;--container-5xl:64rem;--container-6xl:72rem;--container-7xl:80rem;--text-xs:.75rem;--text-xs--line-height:calc(1/.75);--text-sm:.875rem;--text-sm--line-height:calc(1.25/.875);--text-base:1rem;--text-base--line-height: 1.5 ;--text-lg:1.125rem;--text-lg--line-height:calc(1.75/1.125);--text-xl:1.25rem;--text-xl--line-height:calc(1.75/1.25);--text-2xl:1.5rem;--text-2xl--line-height:calc(2/1.5);--text-3xl:1.875rem;--text-3xl--line-height: 1.2 ;--text-4xl:2.25rem;--text-4xl--line-height:calc(2.5/2.25);--font-weight-medium:500;--font-weight-semibold:600;--font-weight-bold:700;--tracking-tight:-.025em;--leading-relaxed:1.625;--radius-sm:.25rem;--radius-md:.375rem;--radius-lg:.5rem;--radius-xl:.75rem;--radius-2xl:1rem;--animate-spin:spin 1s linear infinite;--blur-xl:24px;--blur-3xl:64px;--default-transition-duration:.15s;--default-transition-timing-function:cubic-bezier(.4,0,.2,1);--default-font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","PingFang SC","Microsoft YaHei",sans-serif;--default-mono-font-family:var(--font-mono)}}@layer base{*,:after,:before,::backdrop{box-sizing:border-box;border:0 solid;margin:0;padding:0}::file-selector-button{box-sizing:border-box;border:0 solid;margin:0;padding:0}html,:host{-webkit-text-size-adjust:100%;-moz-tab-size:4;tab-size:4;line-height:1.5;font-family:var(--default-font-family,ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji");font-feature-settings:var(--default-font-feature-settings,normal);font-variation-settings:var(--default-font-variation-settings,normal);-webkit-tap-highlight-color:transparent}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:var(--default-mono-font-family,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace);font-feature-settings:var(--default-mono-font-feature-settings,normal);font-variation-settings:var(--default-mono-font-variation-settings,normal);font-size:1em}small{font-size:80%}sub,sup{vertical-align:baseline;font-size:75%;line-height:0;position:relative}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}:-moz-focusring{outline:auto}progress{vertical-align:baseline}summary{display:list-item}ol,ul,menu{list-style:none}img,svg,video,canvas,audio,iframe,embed,object{vertical-align:middle;display:block}img,video{max-width:100%;height:auto}button,input,select,optgroup,textarea{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}::file-selector-button{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}:where(select:is([multiple],[size])) optgroup{font-weight:bolder}:where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}::file-selector-button{margin-inline-end:4px}::placeholder{opacity:1}@supports (not ((-webkit-appearance:-apple-pay-button))) or (contain-intrinsic-size:1px){::placeholder{color:currentColor}@supports (color:color-mix(in lab,red,red)){::placeholder{color:color-mix(in oklab,currentcolor 50%,transparent)}}}textarea{resize:vertical}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}::-webkit-datetime-edit{display:inline-flex}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-datetime-edit{padding-block:0}::-webkit-datetime-edit-year-field{padding-block:0}::-webkit-datetime-edit-month-field{padding-block:0}::-webkit-datetime-edit-day-field{padding-block:0}::-webkit-datetime-edit-hour-field{padding-block:0}::-webkit-datetime-edit-minute-field{padding-block:0}::-webkit-datetime-edit-second-field{padding-block:0}::-webkit-datetime-edit-millisecond-field{padding-block:0}::-webkit-datetime-edit-meridiem-field{padding-block:0}::-webkit-calendar-picker-indicator{line-height:1}:-moz-ui-invalid{box-shadow:none}button,input:where([type=button],[type=reset],[type=submit]){-webkit-appearance:button;-moz-appearance:button;appearance:button}::file-selector-button{-webkit-appearance:button;-moz-appearance:button;appearance:button}::-webkit-inner-spin-button{height:auto}::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}}@layer components;@layer utilities{.pointer-events-none{pointer-events:none}.collapse{visibility:collapse}.invisible{visibility:hidden}.visible{visibility:visible}.sr-only{clip-path:inset(50%);white-space:nowrap;border-width:0;width:1px;height:1px;margin:-1px;padding:0;position:absolute;overflow:hidden}.not-sr-only{clip-path:none;white-space:normal;width:auto;height:auto;margin:0;padding:0;position:static;overflow:visible}.absolute{position:absolute}.fixed{position:fixed}.relative{position:relative}.static{position:static}.sticky{position:sticky}.inset-0{inset:calc(var(--spacing)*0)}.top-0{top:calc(var(--spacing)*0)}.top-1\/2{top:50%}.top-1\/4{top:25%}.top-4{top:calc(var(--spacing)*4)}.top-\[50\%\]{top:50%}.right-1\/4{right:25%}.right-4{right:calc(var(--spacing)*4)}.bottom-1\/4{bottom:25%}.left-1\/4{left:25%}.left-2{left:calc(var(--spacing)*2)}.left-3{left:calc(var(--spacing)*3)}.left-\[50\%\]{left:50%}.isolate{isolation:isolate}.isolation-auto{isolation:auto}.z-10{z-index:10}.z-50{z-index:50}.container{width:100%}@media(min-width:40rem){.container{max-width:40rem}}@media(min-width:48rem){.container{max-width:48rem}}@media(min-width:64rem){.container{max-width:64rem}}@media(min-width:80rem){.container{max-width:80rem}}@media(min-width:96rem){.container{max-width:96rem}}.mx-auto{margin-inline:auto}.mt-0\.5{margin-top:calc(var(--spacing)*.5)}.mt-1{margin-top:calc(var(--spacing)*1)}.mt-2{margin-top:calc(var(--spacing)*2)}.mt-3{margin-top:calc(var(--spacing)*3)}.mt-4{margin-top:calc(var(--spacing)*4)}.mt-6{margin-top:calc(var(--spacing)*6)}.mr-1{margin-right:calc(var(--spacing)*1)}.mr-2{margin-right:calc(var(--spacing)*2)}.mb-1{margin-bottom:calc(var(--spacing)*1)}.mb-2{margin-bottom:calc(var(--spacing)*2)}.mb-3{margin-bottom:calc(var(--spacing)*3)}.mb-4{margin-bottom:calc(var(--spacing)*4)}.mb-6{margin-bottom:calc(var(--spacing)*6)}.mb-8{margin-bottom:calc(var(--spacing)*8)}.ml-1{margin-left:calc(var(--spacing)*1)}.ml-2{margin-left:calc(var(--spacing)*2)}.ml-4{margin-left:calc(var(--spacing)*4)}.ml-6{margin-left:calc(var(--spacing)*6)}.line-clamp-2{-webkit-line-clamp:2;-webkit-box-orient:vertical;display:-webkit-box;overflow:hidden}.block{display:block}.contents{display:contents}.flex{display:flex}.flow-root{display:flow-root}.grid{display:grid}.hidden{display:none}.inline{display:inline}.inline-block{display:inline-block}.inline-flex{display:inline-flex}.inline-grid{display:inline-grid}.inline-table{display:inline-table}.list-item{display:list-item}.table{display:table}.table-caption{display:table-caption}.table-cell{display:table-cell}.table-column{display:table-column}.table-column-group{display:table-column-group}.table-footer-group{display:table-footer-group}.table-header-group{display:table-header-group}.table-row{display:table-row}.table-row-group{display:table-row-group}.size-4{width:calc(var(--spacing)*4);height:calc(var(--spacing)*4)}.size-8{width:calc(var(--spacing)*8);height:calc(var(--spacing)*8)}.size-9{width:calc(var(--spacing)*9);height:calc(var(--spacing)*9)}.size-10{width:calc(var(--spacing)*10);height:calc(var(--spacing)*10)}.h-1\.5{height:calc(var(--spacing)*1.5)}.h-3{height:calc(var(--spacing)*3)}.h-3\.5{height:calc(var(--spacing)*3.5)}.h-4{height:calc(var(--spacing)*4)}.h-5{height:calc(var(--spacing)*5)}.h-6{height:calc(var(--spacing)*6)}.h-8{height:calc(var(--spacing)*8)}.h-9{height:calc(var(--spacing)*9)}.h-10{height:calc(var(--spacing)*10)}.h-12{height:calc(var(--spacing)*12)}.h-16{height:calc(var(--spacing)*16)}.h-20{height:calc(var(--spacing)*20)}.h-24{height:calc(var(--spacing)*24)}.h-96{height:calc(var(--spacing)*96)}.h-\[70vh\]{height:70vh}.h-full{height:100%}.max-h-96{max-height:calc(var(--spacing)*96)}.max-h-\[80vh\]{max-height:80vh}.max-h-\[90vh\]{max-height:90vh}.max-h-\[200px\]{max-height:200px}.max-h-\[300px\]{max-height:300px}.min-h-\[60vh\]{min-height:60vh}.min-h-\[80px\]{min-height:80px}.min-h-\[100px\]{min-height:100px}.min-h-\[120px\]{min-height:120px}.min-h-\[300px\]{min-height:300px}.min-h-\[400px\]{min-height:400px}.min-h-screen{min-height:100vh}.w-3{width:calc(var(--spacing)*3)}.w-3\.5{width:calc(var(--spacing)*3.5)}.w-4{width:calc(var(--spacing)*4)}.w-5{width:calc(var(--spacing)*5)}.w-6{width:calc(var(--spacing)*6)}.w-8{width:calc(var(--spacing)*8)}.w-9{width:calc(var(--spacing)*9)}.w-10{width:calc(var(--spacing)*10)}.w-12{width:calc(var(--spacing)*12)}.w-16{width:calc(var(--spacing)*16)}.w-20{width:calc(var(--spacing)*20)}.w-24{width:calc(var(--spacing)*24)}.w-64{width:calc(var(--spacing)*64)}.w-96{width:calc(var(--spacing)*96)}.w-fit{width:fit-content}.w-full{width:100%}.max-w-2xl{max-width:var(--container-2xl)}.max-w-4xl{max-width:var(--container-4xl)}.max-w-5xl{max-width:var(--container-5xl)}.max-w-6xl{max-width:var(--container-6xl)}.max-w-7xl{max-width:var(--container-7xl)}.max-w-\[100px\]{max-width:100px}.max-w-\[200px\]{max-width:200px}.max-w-\[calc\(100\%-2rem\)\]{max-width:calc(100% - 2rem)}.max-w-lg{max-width:var(--container-lg)}.max-w-md{max-width:var(--container-md)}.max-w-sm{max-width:var(--container-sm)}.min-w-0{min-width:calc(var(--spacing)*0)}.min-w-\[8rem\]{min-width:8rem}.flex-1{flex:1}.flex-shrink-0{flex-shrink:0}.shrink{flex-shrink:1}.shrink-0{flex-shrink:0}.grow{flex-grow:1}.caption-bottom{caption-side:bottom}.border-collapse{border-collapse:collapse}.-translate-x-1\/2{--tw-translate-x: -50% ;translate:var(--tw-translate-x)var(--tw-translate-y)}.-translate-y-1\/2{--tw-translate-y: -50% ;translate:var(--tw-translate-x)var(--tw-translate-y)}.translate-none{translate:none}.scale-3d{scale:var(--tw-scale-x)var(--tw-scale-y)var(--tw-scale-z)}.rotate-90{rotate:90deg}.transform{transform:var(--tw-rotate-x,)var(--tw-rotate-y,)var(--tw-rotate-z,)var(--tw-skew-x,)var(--tw-skew-y,)}.animate-spin{animation:var(--animate-spin)}.cursor-default{cursor:default}.cursor-pointer{cursor:pointer}.touch-pinch-zoom{--tw-pinch-zoom:pinch-zoom;touch-action:var(--tw-pan-x,)var(--tw-pan-y,)var(--tw-pinch-zoom,)}.touch-none{touch-action:none}.resize{resize:both}.list-inside{list-style-position:inside}.list-decimal{list-style-type:decimal}.grid-cols-1{grid-template-columns:repeat(1,minmax(0,1fr))}.grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.flex-col{flex-direction:column}.flex-col-reverse{flex-direction:column-reverse}.flex-row{flex-direction:row}.flex-wrap{flex-wrap:wrap}.items-center{align-items:center}.items-start{align-items:flex-start}.justify-between{justify-content:space-between}.justify-center{justify-content:center}.justify-end{justify-content:flex-end}.gap-1{gap:calc(var(--spacing)*1)}.gap-1\.5{gap:calc(var(--spacing)*1.5)}.gap-2{gap:calc(var(--spacing)*2)}.gap-3{gap:calc(var(--spacing)*3)}.gap-4{gap:calc(var(--spacing)*4)}.gap-6{gap:calc(var(--spacing)*6)}.gap-8{gap:calc(var(--spacing)*8)}:where(.space-y-1>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*1)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*1)*calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-1\.5>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*1.5)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*1.5)*calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-2>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*2)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*2)*calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-3>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*3)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*3)*calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-4>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*4)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*4)*calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-6>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*6)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*6)*calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-reverse>:not(:last-child)){--tw-space-y-reverse:1}:where(.space-x-reverse>:not(:last-child)){--tw-space-x-reverse:1}:where(.divide-x>:not(:last-child)){--tw-divide-x-reverse:0;border-inline-style:var(--tw-border-style);border-inline-start-width:calc(1px*var(--tw-divide-x-reverse));border-inline-end-width:calc(1px*calc(1 - var(--tw-divide-x-reverse)))}:where(.divide-y>:not(:last-child)){--tw-divide-y-reverse:0;border-bottom-style:var(--tw-border-style);border-top-style:var(--tw-border-style);border-top-width:calc(1px*var(--tw-divide-y-reverse));border-bottom-width:calc(1px*calc(1 - var(--tw-divide-y-reverse)))}:where(.divide-y-reverse>:not(:last-child)){--tw-divide-y-reverse:1}:where(.divide-gray-700\/50>:not(:last-child)){border-color:#36415380}@supports (color:color-mix(in lab,red,red)){:where(.divide-gray-700\/50>:not(:last-child)){border-color:color-mix(in oklab,var(--color-gray-700)50%,transparent)}}:where(.divide-white\/5>:not(:last-child)){border-color:#ffffff0d}@supports (color:color-mix(in lab,red,red)){:where(.divide-white\/5>:not(:last-child)){border-color:color-mix(in oklab,var(--color-white)5%,transparent)}}.truncate{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.overflow-auto{overflow:auto}.overflow-hidden{overflow:hidden}.overflow-x-auto{overflow-x:auto}.overflow-y-auto{overflow-y:auto}.rounded{border-radius:.25rem}.rounded-2xl{border-radius:var(--radius-2xl)}.rounded-full{border-radius:3.40282e38px}.rounded-lg{border-radius:var(--radius-lg)}.rounded-md{border-radius:var(--radius-md)}.rounded-sm{border-radius:var(--radius-sm)}.rounded-xl{border-radius:var(--radius-xl)}.rounded-s{border-start-start-radius:.25rem;border-end-start-radius:.25rem}.rounded-ss{border-start-start-radius:.25rem}.rounded-e{border-start-end-radius:.25rem;border-end-end-radius:.25rem}.rounded-se{border-start-end-radius:.25rem}.rounded-ee{border-end-end-radius:.25rem}.rounded-es{border-end-start-radius:.25rem}.rounded-t{border-top-left-radius:.25rem;border-top-right-radius:.25rem}.rounded-l{border-top-left-radius:.25rem;border-bottom-left-radius:.25rem}.rounded-tl{border-top-left-radius:.25rem}.rounded-r{border-top-right-radius:.25rem;border-bottom-right-radius:.25rem}.rounded-tr{border-top-right-radius:.25rem}.rounded-b{border-bottom-right-radius:.25rem;border-bottom-left-radius:.25rem}.rounded-br{border-bottom-right-radius:.25rem}.rounded-bl{border-bottom-left-radius:.25rem}.border{border-style:var(--tw-border-style);border-width:1px}.border-0{border-style:var(--tw-border-style);border-width:0}.border-2{border-style:var(--tw-border-style);border-width:2px}.border-x{border-inline-style:var(--tw-border-style);border-inline-width:1px}.border-y{border-block-style:var(--tw-border-style);border-block-width:1px}.border-s{border-inline-start-style:var(--tw-border-style);border-inline-start-width:1px}.border-e{border-inline-end-style:var(--tw-border-style);border-inline-end-width:1px}.border-t{border-top-style:var(--tw-border-style);border-top-width:1px}.border-r{border-right-style:var(--tw-border-style);border-right-width:1px}.border-b{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}.border-l{border-left-style:var(--tw-border-style);border-left-width:1px}.border-l-2{border-left-style:var(--tw-border-style);border-left-width:2px}.border-\[\#07C160\]{border-color:#07c160}.border-\[\#07C160\]\/20{border-color:#07c16033}.border-\[\#07C160\]\/30{border-color:#07c1604d}.border-\[\#38bdac\]{border-color:#38bdac}.border-\[\#38bdac\]\/30{border-color:#38bdac4d}.border-\[\#38bdac\]\/40{border-color:#38bdac66}.border-blue-500\/30{border-color:#3080ff4d}@supports (color:color-mix(in lab,red,red)){.border-blue-500\/30{border-color:color-mix(in oklab,var(--color-blue-500)30%,transparent)}}.border-blue-500\/50{border-color:#3080ff80}@supports (color:color-mix(in lab,red,red)){.border-blue-500\/50{border-color:color-mix(in oklab,var(--color-blue-500)50%,transparent)}}.border-cyan-500\/30{border-color:#00b7d74d}@supports (color:color-mix(in lab,red,red)){.border-cyan-500\/30{border-color:color-mix(in oklab,var(--color-cyan-500)30%,transparent)}}.border-gray-600{border-color:var(--color-gray-600)}.border-gray-700{border-color:var(--color-gray-700)}.border-gray-700\/30{border-color:#3641534d}@supports (color:color-mix(in lab,red,red)){.border-gray-700\/30{border-color:color-mix(in oklab,var(--color-gray-700)30%,transparent)}}.border-gray-700\/50{border-color:#36415380}@supports (color:color-mix(in lab,red,red)){.border-gray-700\/50{border-color:color-mix(in oklab,var(--color-gray-700)50%,transparent)}}.border-green-500\/30{border-color:#00c7584d}@supports (color:color-mix(in lab,red,red)){.border-green-500\/30{border-color:color-mix(in oklab,var(--color-green-500)30%,transparent)}}.border-orange-500\/30{border-color:#fe6e004d}@supports (color:color-mix(in lab,red,red)){.border-orange-500\/30{border-color:color-mix(in oklab,var(--color-orange-500)30%,transparent)}}.border-purple-500\/30{border-color:#ac4bff4d}@supports (color:color-mix(in lab,red,red)){.border-purple-500\/30{border-color:color-mix(in oklab,var(--color-purple-500)30%,transparent)}}.border-red-500\/20{border-color:#fb2c3633}@supports (color:color-mix(in lab,red,red)){.border-red-500\/20{border-color:color-mix(in oklab,var(--color-red-500)20%,transparent)}}.border-red-500\/50{border-color:#fb2c3680}@supports (color:color-mix(in lab,red,red)){.border-red-500\/50{border-color:color-mix(in oklab,var(--color-red-500)50%,transparent)}}.border-transparent{border-color:#0000}.border-white\/5{border-color:#ffffff0d}@supports (color:color-mix(in lab,red,red)){.border-white\/5{border-color:color-mix(in oklab,var(--color-white)5%,transparent)}}.border-white\/10{border-color:#ffffff1a}@supports (color:color-mix(in lab,red,red)){.border-white\/10{border-color:color-mix(in oklab,var(--color-white)10%,transparent)}}.border-white\/20{border-color:#fff3}@supports (color:color-mix(in lab,red,red)){.border-white\/20{border-color:color-mix(in oklab,var(--color-white)20%,transparent)}}.border-yellow-500\/30{border-color:#edb2004d}@supports (color:color-mix(in lab,red,red)){.border-yellow-500\/30{border-color:color-mix(in oklab,var(--color-yellow-500)30%,transparent)}}.bg-\[\#0a1628\]{background-color:#0a1628}.bg-\[\#0f2137\]{background-color:#0f2137}.bg-\[\#00CED1\]{background-color:#00ced1}.bg-\[\#07C160\]{background-color:#07c160}.bg-\[\#07C160\]\/5{background-color:#07c1600d}.bg-\[\#07C160\]\/10{background-color:#07c1601a}.bg-\[\#38bdac\]{background-color:#38bdac}.bg-\[\#38bdac\]\/5{background-color:#38bdac0d}.bg-\[\#38bdac\]\/10{background-color:#38bdac1a}.bg-\[\#38bdac\]\/20{background-color:#38bdac33}.bg-\[\#38bdac\]\/30{background-color:#38bdac4d}.bg-\[\#162840\]{background-color:#162840}.bg-amber-500\/20{background-color:#f99c0033}@supports (color:color-mix(in lab,red,red)){.bg-amber-500\/20{background-color:color-mix(in oklab,var(--color-amber-500)20%,transparent)}}.bg-black{background-color:var(--color-black)}.bg-black\/50{background-color:#00000080}@supports (color:color-mix(in lab,red,red)){.bg-black\/50{background-color:color-mix(in oklab,var(--color-black)50%,transparent)}}.bg-black\/90{background-color:#000000e6}@supports (color:color-mix(in lab,red,red)){.bg-black\/90{background-color:color-mix(in oklab,var(--color-black)90%,transparent)}}.bg-blue-500\/5{background-color:#3080ff0d}@supports (color:color-mix(in lab,red,red)){.bg-blue-500\/5{background-color:color-mix(in oklab,var(--color-blue-500)5%,transparent)}}.bg-blue-500\/10{background-color:#3080ff1a}@supports (color:color-mix(in lab,red,red)){.bg-blue-500\/10{background-color:color-mix(in oklab,var(--color-blue-500)10%,transparent)}}.bg-blue-500\/20{background-color:#3080ff33}@supports (color:color-mix(in lab,red,red)){.bg-blue-500\/20{background-color:color-mix(in oklab,var(--color-blue-500)20%,transparent)}}.bg-cyan-500{background-color:var(--color-cyan-500)}.bg-gray-500\/20{background-color:#6a728233}@supports (color:color-mix(in lab,red,red)){.bg-gray-500\/20{background-color:color-mix(in oklab,var(--color-gray-500)20%,transparent)}}.bg-gray-600{background-color:var(--color-gray-600)}.bg-gray-700\/50{background-color:#36415380}@supports (color:color-mix(in lab,red,red)){.bg-gray-700\/50{background-color:color-mix(in oklab,var(--color-gray-700)50%,transparent)}}.bg-green-500{background-color:var(--color-green-500)}.bg-green-500\/20{background-color:#00c75833}@supports (color:color-mix(in lab,red,red)){.bg-green-500\/20{background-color:color-mix(in oklab,var(--color-green-500)20%,transparent)}}.bg-green-600{background-color:var(--color-green-600)}.bg-orange-500\/10{background-color:#fe6e001a}@supports (color:color-mix(in lab,red,red)){.bg-orange-500\/10{background-color:color-mix(in oklab,var(--color-orange-500)10%,transparent)}}.bg-orange-500\/20{background-color:#fe6e0033}@supports (color:color-mix(in lab,red,red)){.bg-orange-500\/20{background-color:color-mix(in oklab,var(--color-orange-500)20%,transparent)}}.bg-purple-500\/20{background-color:#ac4bff33}@supports (color:color-mix(in lab,red,red)){.bg-purple-500\/20{background-color:color-mix(in oklab,var(--color-purple-500)20%,transparent)}}.bg-red-500\/10{background-color:#fb2c361a}@supports (color:color-mix(in lab,red,red)){.bg-red-500\/10{background-color:color-mix(in oklab,var(--color-red-500)10%,transparent)}}.bg-red-500\/20{background-color:#fb2c3633}@supports (color:color-mix(in lab,red,red)){.bg-red-500\/20{background-color:color-mix(in oklab,var(--color-red-500)20%,transparent)}}.bg-transparent{background-color:#0000}.bg-white{background-color:var(--color-white)}.bg-white\/5{background-color:#ffffff0d}@supports (color:color-mix(in lab,red,red)){.bg-white\/5{background-color:color-mix(in oklab,var(--color-white)5%,transparent)}}.bg-white\/10{background-color:#ffffff1a}@supports (color:color-mix(in lab,red,red)){.bg-white\/10{background-color:color-mix(in oklab,var(--color-white)10%,transparent)}}.bg-white\/20{background-color:#fff3}@supports (color:color-mix(in lab,red,red)){.bg-white\/20{background-color:color-mix(in oklab,var(--color-white)20%,transparent)}}.bg-yellow-500\/20{background-color:#edb20033}@supports (color:color-mix(in lab,red,red)){.bg-yellow-500\/20{background-color:color-mix(in oklab,var(--color-yellow-500)20%,transparent)}}.bg-gradient-to-br{--tw-gradient-position:to bottom right in oklab;background-image:linear-gradient(var(--tw-gradient-stops))}.bg-gradient-to-r{--tw-gradient-position:to right in oklab;background-image:linear-gradient(var(--tw-gradient-stops))}.from-\[\#00CED1\]{--tw-gradient-from:#00ced1;--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.from-\[\#38bdac\]\/10{--tw-gradient-from:oklab(72.378% -.11483 -.0053193/.1);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.from-cyan-500\/20{--tw-gradient-from:#00b7d733}@supports (color:color-mix(in lab,red,red)){.from-cyan-500\/20{--tw-gradient-from:color-mix(in oklab,var(--color-cyan-500)20%,transparent)}}.from-cyan-500\/20{--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.from-green-500\/20{--tw-gradient-from:#00c75833}@supports (color:color-mix(in lab,red,red)){.from-green-500\/20{--tw-gradient-from:color-mix(in oklab,var(--color-green-500)20%,transparent)}}.from-green-500\/20{--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.from-purple-500\/20{--tw-gradient-from:#ac4bff33}@supports (color:color-mix(in lab,red,red)){.from-purple-500\/20{--tw-gradient-from:color-mix(in oklab,var(--color-purple-500)20%,transparent)}}.from-purple-500\/20{--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.from-yellow-500\/20{--tw-gradient-from:#edb20033}@supports (color:color-mix(in lab,red,red)){.from-yellow-500\/20{--tw-gradient-from:color-mix(in oklab,var(--color-yellow-500)20%,transparent)}}.from-yellow-500\/20{--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.to-\[\#0f2137\]{--tw-gradient-to:#0f2137;--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.to-\[\#20B2AA\]{--tw-gradient-to:#20b2aa;--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.to-cyan-500\/5{--tw-gradient-to:#00b7d70d}@supports (color:color-mix(in lab,red,red)){.to-cyan-500\/5{--tw-gradient-to:color-mix(in oklab,var(--color-cyan-500)5%,transparent)}}.to-cyan-500\/5{--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.to-green-500\/5{--tw-gradient-to:#00c7580d}@supports (color:color-mix(in lab,red,red)){.to-green-500\/5{--tw-gradient-to:color-mix(in oklab,var(--color-green-500)5%,transparent)}}.to-green-500\/5{--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.to-purple-500\/5{--tw-gradient-to:#ac4bff0d}@supports (color:color-mix(in lab,red,red)){.to-purple-500\/5{--tw-gradient-to:color-mix(in oklab,var(--color-purple-500)5%,transparent)}}.to-purple-500\/5{--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.to-yellow-500\/5{--tw-gradient-to:#edb2000d}@supports (color:color-mix(in lab,red,red)){.to-yellow-500\/5{--tw-gradient-to:color-mix(in oklab,var(--color-yellow-500)5%,transparent)}}.to-yellow-500\/5{--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.bg-repeat{background-repeat:repeat}.mask-no-clip{-webkit-mask-clip:no-clip;mask-clip:no-clip}.mask-repeat{-webkit-mask-repeat:repeat;mask-repeat:repeat}.object-cover{object-fit:cover}.p-0{padding:calc(var(--spacing)*0)}.p-1{padding:calc(var(--spacing)*1)}.p-2{padding:calc(var(--spacing)*2)}.p-3{padding:calc(var(--spacing)*3)}.p-4{padding:calc(var(--spacing)*4)}.p-6{padding:calc(var(--spacing)*6)}.p-8{padding:calc(var(--spacing)*8)}.px-1\.5{padding-inline:calc(var(--spacing)*1.5)}.px-2{padding-inline:calc(var(--spacing)*2)}.px-3{padding-inline:calc(var(--spacing)*3)}.px-4{padding-inline:calc(var(--spacing)*4)}.px-5{padding-inline:calc(var(--spacing)*5)}.px-6{padding-inline:calc(var(--spacing)*6)}.py-0\.5{padding-block:calc(var(--spacing)*.5)}.py-1{padding-block:calc(var(--spacing)*1)}.py-1\.5{padding-block:calc(var(--spacing)*1.5)}.py-2{padding-block:calc(var(--spacing)*2)}.py-3{padding-block:calc(var(--spacing)*3)}.py-4{padding-block:calc(var(--spacing)*4)}.py-5{padding-block:calc(var(--spacing)*5)}.py-8{padding-block:calc(var(--spacing)*8)}.py-12{padding-block:calc(var(--spacing)*12)}.py-20{padding-block:calc(var(--spacing)*20)}.py-24{padding-block:calc(var(--spacing)*24)}.pt-0{padding-top:calc(var(--spacing)*0)}.pt-1{padding-top:calc(var(--spacing)*1)}.pt-2{padding-top:calc(var(--spacing)*2)}.pt-4{padding-top:calc(var(--spacing)*4)}.pr-1{padding-right:calc(var(--spacing)*1)}.pr-2{padding-right:calc(var(--spacing)*2)}.pb-2{padding-bottom:calc(var(--spacing)*2)}.pb-4{padding-bottom:calc(var(--spacing)*4)}.pl-2{padding-left:calc(var(--spacing)*2)}.pl-8{padding-left:calc(var(--spacing)*8)}.pl-10{padding-left:calc(var(--spacing)*10)}.text-center{text-align:center}.text-left{text-align:left}.text-right{text-align:right}.align-middle{vertical-align:middle}.font-mono{font-family:var(--font-mono)}.text-2xl{font-size:var(--text-2xl);line-height:var(--tw-leading,var(--text-2xl--line-height))}.text-3xl{font-size:var(--text-3xl);line-height:var(--tw-leading,var(--text-3xl--line-height))}.text-4xl{font-size:var(--text-4xl);line-height:var(--tw-leading,var(--text-4xl--line-height))}.text-base{font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height))}.text-lg{font-size:var(--text-lg);line-height:var(--tw-leading,var(--text-lg--line-height))}.text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.text-xl{font-size:var(--text-xl);line-height:var(--tw-leading,var(--text-xl--line-height))}.text-xs{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.text-\[10px\]{font-size:10px}.text-\[11px\]{font-size:11px}.leading-none{--tw-leading:1;line-height:1}.leading-relaxed{--tw-leading:var(--leading-relaxed);line-height:var(--leading-relaxed)}.font-bold{--tw-font-weight:var(--font-weight-bold);font-weight:var(--font-weight-bold)}.font-medium{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.font-semibold{--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold)}.tracking-tight{--tw-tracking:var(--tracking-tight);letter-spacing:var(--tracking-tight)}.text-wrap{text-wrap:wrap}.break-all{word-break:break-all}.text-clip{text-overflow:clip}.text-ellipsis{text-overflow:ellipsis}.whitespace-nowrap{white-space:nowrap}.whitespace-pre-wrap{white-space:pre-wrap}.text-\[\#00CED1\]{color:#00ced1}.text-\[\#07C160\]{color:#07c160}.text-\[\#07C160\]\/60{color:#07c16099}.text-\[\#07C160\]\/70{color:#07c160b3}.text-\[\#07C160\]\/80{color:#07c160cc}.text-\[\#26A17B\]{color:#26a17b}.text-\[\#38bdac\]{color:#38bdac}.text-\[\#38bdac\]\/40{color:#38bdac66}.text-\[\#169BD7\]{color:#169bd7}.text-\[\#1677FF\]{color:#1677ff}.text-\[\#FFD700\]{color:gold}.text-amber-400{color:var(--color-amber-400)}.text-black{color:var(--color-black)}.text-blue-300{color:var(--color-blue-300)}.text-blue-300\/60{color:#90c5ff99}@supports (color:color-mix(in lab,red,red)){.text-blue-300\/60{color:color-mix(in oklab,var(--color-blue-300)60%,transparent)}}.text-blue-400{color:var(--color-blue-400)}.text-cyan-400{color:var(--color-cyan-400)}.text-gray-200{color:var(--color-gray-200)}.text-gray-300{color:var(--color-gray-300)}.text-gray-400{color:var(--color-gray-400)}.text-gray-500{color:var(--color-gray-500)}.text-gray-600{color:var(--color-gray-600)}.text-green-400{color:var(--color-green-400)}.text-green-500{color:var(--color-green-500)}.text-orange-300{color:var(--color-orange-300)}.text-orange-300\/60{color:#ffb96d99}@supports (color:color-mix(in lab,red,red)){.text-orange-300\/60{color:color-mix(in oklab,var(--color-orange-300)60%,transparent)}}.text-orange-400{color:var(--color-orange-400)}.text-purple-400{color:var(--color-purple-400)}.text-red-400{color:var(--color-red-400)}.text-white{color:var(--color-white)}.text-white\/40{color:#fff6}@supports (color:color-mix(in lab,red,red)){.text-white\/40{color:color-mix(in oklab,var(--color-white)40%,transparent)}}.text-white\/60{color:#fff9}@supports (color:color-mix(in lab,red,red)){.text-white\/60{color:color-mix(in oklab,var(--color-white)60%,transparent)}}.text-white\/70{color:#ffffffb3}@supports (color:color-mix(in lab,red,red)){.text-white\/70{color:color-mix(in oklab,var(--color-white)70%,transparent)}}.text-white\/80{color:#fffc}@supports (color:color-mix(in lab,red,red)){.text-white\/80{color:color-mix(in oklab,var(--color-white)80%,transparent)}}.text-yellow-400{color:var(--color-yellow-400)}.capitalize{text-transform:capitalize}.lowercase{text-transform:lowercase}.normal-case{text-transform:none}.uppercase{text-transform:uppercase}.italic{font-style:italic}.not-italic{font-style:normal}.diagonal-fractions{--tw-numeric-fraction:diagonal-fractions;font-variant-numeric:var(--tw-ordinal,)var(--tw-slashed-zero,)var(--tw-numeric-figure,)var(--tw-numeric-spacing,)var(--tw-numeric-fraction,)}.lining-nums{--tw-numeric-figure:lining-nums;font-variant-numeric:var(--tw-ordinal,)var(--tw-slashed-zero,)var(--tw-numeric-figure,)var(--tw-numeric-spacing,)var(--tw-numeric-fraction,)}.oldstyle-nums{--tw-numeric-figure:oldstyle-nums;font-variant-numeric:var(--tw-ordinal,)var(--tw-slashed-zero,)var(--tw-numeric-figure,)var(--tw-numeric-spacing,)var(--tw-numeric-fraction,)}.ordinal{--tw-ordinal:ordinal;font-variant-numeric:var(--tw-ordinal,)var(--tw-slashed-zero,)var(--tw-numeric-figure,)var(--tw-numeric-spacing,)var(--tw-numeric-fraction,)}.proportional-nums{--tw-numeric-spacing:proportional-nums;font-variant-numeric:var(--tw-ordinal,)var(--tw-slashed-zero,)var(--tw-numeric-figure,)var(--tw-numeric-spacing,)var(--tw-numeric-fraction,)}.slashed-zero{--tw-slashed-zero:slashed-zero;font-variant-numeric:var(--tw-ordinal,)var(--tw-slashed-zero,)var(--tw-numeric-figure,)var(--tw-numeric-spacing,)var(--tw-numeric-fraction,)}.stacked-fractions{--tw-numeric-fraction:stacked-fractions;font-variant-numeric:var(--tw-ordinal,)var(--tw-slashed-zero,)var(--tw-numeric-figure,)var(--tw-numeric-spacing,)var(--tw-numeric-fraction,)}.tabular-nums{--tw-numeric-spacing:tabular-nums;font-variant-numeric:var(--tw-ordinal,)var(--tw-slashed-zero,)var(--tw-numeric-figure,)var(--tw-numeric-spacing,)var(--tw-numeric-fraction,)}.normal-nums{font-variant-numeric:normal}.line-through{text-decoration-line:line-through}.no-underline{text-decoration-line:none}.overline{text-decoration-line:overline}.underline{text-decoration-line:underline}.underline-offset-4{text-underline-offset:4px}.antialiased{-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.subpixel-antialiased{-webkit-font-smoothing:auto;-moz-osx-font-smoothing:auto}.opacity-0{opacity:0}.opacity-50{opacity:.5}.opacity-70{opacity:.7}.shadow{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a),0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-lg{--tw-shadow:0 10px 15px -3px var(--tw-shadow-color,#0000001a),0 4px 6px -4px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-md{--tw-shadow:0 4px 6px -1px var(--tw-shadow-color,#0000001a),0 2px 4px -2px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-sm{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a),0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-xl{--tw-shadow:0 20px 25px -5px var(--tw-shadow-color,#0000001a),0 8px 10px -6px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-xs{--tw-shadow:0 1px 2px 0 var(--tw-shadow-color,#0000000d);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.ring-0{--tw-ring-shadow:var(--tw-ring-inset,)0 0 0 calc(0px + var(--tw-ring-offset-width))var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.ring-1{--tw-ring-shadow:var(--tw-ring-inset,)0 0 0 calc(1px + var(--tw-ring-offset-width))var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.inset-ring{--tw-inset-ring-shadow:inset 0 0 0 1px var(--tw-inset-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.ring-\[\#38bdac\]{--tw-ring-color:#38bdac}.outline{outline-style:var(--tw-outline-style);outline-width:1px}.blur{--tw-blur:blur(8px);filter:var(--tw-blur,)var(--tw-brightness,)var(--tw-contrast,)var(--tw-grayscale,)var(--tw-hue-rotate,)var(--tw-invert,)var(--tw-saturate,)var(--tw-sepia,)var(--tw-drop-shadow,)}.blur-3xl{--tw-blur:blur(var(--blur-3xl));filter:var(--tw-blur,)var(--tw-brightness,)var(--tw-contrast,)var(--tw-grayscale,)var(--tw-hue-rotate,)var(--tw-invert,)var(--tw-saturate,)var(--tw-sepia,)var(--tw-drop-shadow,)}.drop-shadow{--tw-drop-shadow-size:drop-shadow(0 1px 2px var(--tw-drop-shadow-color,#0000001a))drop-shadow(0 1px 1px var(--tw-drop-shadow-color,#0000000f));--tw-drop-shadow:drop-shadow(0 1px 2px #0000001a)drop-shadow(0 1px 1px #0000000f);filter:var(--tw-blur,)var(--tw-brightness,)var(--tw-contrast,)var(--tw-grayscale,)var(--tw-hue-rotate,)var(--tw-invert,)var(--tw-saturate,)var(--tw-sepia,)var(--tw-drop-shadow,)}.filter{filter:var(--tw-blur,)var(--tw-brightness,)var(--tw-contrast,)var(--tw-grayscale,)var(--tw-hue-rotate,)var(--tw-invert,)var(--tw-saturate,)var(--tw-sepia,)var(--tw-drop-shadow,)}.filter\!{filter:var(--tw-blur,)var(--tw-brightness,)var(--tw-contrast,)var(--tw-grayscale,)var(--tw-hue-rotate,)var(--tw-invert,)var(--tw-saturate,)var(--tw-sepia,)var(--tw-drop-shadow,)!important}.backdrop-blur{--tw-backdrop-blur:blur(8px);-webkit-backdrop-filter:var(--tw-backdrop-blur,)var(--tw-backdrop-brightness,)var(--tw-backdrop-contrast,)var(--tw-backdrop-grayscale,)var(--tw-backdrop-hue-rotate,)var(--tw-backdrop-invert,)var(--tw-backdrop-opacity,)var(--tw-backdrop-saturate,)var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,)var(--tw-backdrop-brightness,)var(--tw-backdrop-contrast,)var(--tw-backdrop-grayscale,)var(--tw-backdrop-hue-rotate,)var(--tw-backdrop-invert,)var(--tw-backdrop-opacity,)var(--tw-backdrop-saturate,)var(--tw-backdrop-sepia,)}.backdrop-blur-xl{--tw-backdrop-blur:blur(var(--blur-xl));-webkit-backdrop-filter:var(--tw-backdrop-blur,)var(--tw-backdrop-brightness,)var(--tw-backdrop-contrast,)var(--tw-backdrop-grayscale,)var(--tw-backdrop-hue-rotate,)var(--tw-backdrop-invert,)var(--tw-backdrop-opacity,)var(--tw-backdrop-saturate,)var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,)var(--tw-backdrop-brightness,)var(--tw-backdrop-contrast,)var(--tw-backdrop-grayscale,)var(--tw-backdrop-hue-rotate,)var(--tw-backdrop-invert,)var(--tw-backdrop-opacity,)var(--tw-backdrop-saturate,)var(--tw-backdrop-sepia,)}.backdrop-grayscale{--tw-backdrop-grayscale:grayscale(100%);-webkit-backdrop-filter:var(--tw-backdrop-blur,)var(--tw-backdrop-brightness,)var(--tw-backdrop-contrast,)var(--tw-backdrop-grayscale,)var(--tw-backdrop-hue-rotate,)var(--tw-backdrop-invert,)var(--tw-backdrop-opacity,)var(--tw-backdrop-saturate,)var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,)var(--tw-backdrop-brightness,)var(--tw-backdrop-contrast,)var(--tw-backdrop-grayscale,)var(--tw-backdrop-hue-rotate,)var(--tw-backdrop-invert,)var(--tw-backdrop-opacity,)var(--tw-backdrop-saturate,)var(--tw-backdrop-sepia,)}.backdrop-invert{--tw-backdrop-invert:invert(100%);-webkit-backdrop-filter:var(--tw-backdrop-blur,)var(--tw-backdrop-brightness,)var(--tw-backdrop-contrast,)var(--tw-backdrop-grayscale,)var(--tw-backdrop-hue-rotate,)var(--tw-backdrop-invert,)var(--tw-backdrop-opacity,)var(--tw-backdrop-saturate,)var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,)var(--tw-backdrop-brightness,)var(--tw-backdrop-contrast,)var(--tw-backdrop-grayscale,)var(--tw-backdrop-hue-rotate,)var(--tw-backdrop-invert,)var(--tw-backdrop-opacity,)var(--tw-backdrop-saturate,)var(--tw-backdrop-sepia,)}.backdrop-sepia{--tw-backdrop-sepia:sepia(100%);-webkit-backdrop-filter:var(--tw-backdrop-blur,)var(--tw-backdrop-brightness,)var(--tw-backdrop-contrast,)var(--tw-backdrop-grayscale,)var(--tw-backdrop-hue-rotate,)var(--tw-backdrop-invert,)var(--tw-backdrop-opacity,)var(--tw-backdrop-saturate,)var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,)var(--tw-backdrop-brightness,)var(--tw-backdrop-contrast,)var(--tw-backdrop-grayscale,)var(--tw-backdrop-hue-rotate,)var(--tw-backdrop-invert,)var(--tw-backdrop-opacity,)var(--tw-backdrop-saturate,)var(--tw-backdrop-sepia,)}.backdrop-filter{-webkit-backdrop-filter:var(--tw-backdrop-blur,)var(--tw-backdrop-brightness,)var(--tw-backdrop-contrast,)var(--tw-backdrop-grayscale,)var(--tw-backdrop-hue-rotate,)var(--tw-backdrop-invert,)var(--tw-backdrop-opacity,)var(--tw-backdrop-saturate,)var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,)var(--tw-backdrop-brightness,)var(--tw-backdrop-contrast,)var(--tw-backdrop-grayscale,)var(--tw-backdrop-hue-rotate,)var(--tw-backdrop-invert,)var(--tw-backdrop-opacity,)var(--tw-backdrop-saturate,)var(--tw-backdrop-sepia,)}.transition{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to,opacity,box-shadow,transform,translate,scale,rotate,filter,-webkit-backdrop-filter,backdrop-filter,display,content-visibility,overlay,pointer-events;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition\!{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to,opacity,box-shadow,transform,translate,scale,rotate,filter,-webkit-backdrop-filter,backdrop-filter,display,content-visibility,overlay,pointer-events!important;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function))!important;transition-duration:var(--tw-duration,var(--default-transition-duration))!important}.transition-all{transition-property:all;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-colors{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-opacity{transition-property:opacity;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-transform{transition-property:transform,translate,scale,rotate;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.outline-none{--tw-outline-style:none;outline-style:none}.select-none{-webkit-user-select:none;user-select:none}:where(.divide-x-reverse>:not(:last-child)){--tw-divide-x-reverse:1}.ring-inset{--tw-ring-inset:inset}@media(hover:hover){.group-hover\:text-\[\#38bdac\]:is(:where(.group):hover *){color:#38bdac}.group-hover\:opacity-100:is(:where(.group):hover *){opacity:1}}.peer-disabled\:cursor-not-allowed:is(:where(.peer):disabled~*){cursor:not-allowed}.peer-disabled\:opacity-70:is(:where(.peer):disabled~*){opacity:.7}.placeholder\:text-gray-500::placeholder{color:var(--color-gray-500)}.last\:border-b-0:last-child{border-bottom-style:var(--tw-border-style);border-bottom-width:0}@media(hover:hover){.hover\:border-\[\#38bdac\]\/30:hover{border-color:#38bdac4d}.hover\:border-\[\#38bdac\]\/50:hover{border-color:#38bdac80}.hover\:bg-\[\#0a1628\]:hover{background-color:#0a1628}.hover\:bg-\[\#1a3050\]:hover{background-color:#1a3050}.hover\:bg-\[\#2da396\]:hover{background-color:#2da396}.hover\:bg-\[\#06AD51\]:hover{background-color:#06ad51}.hover\:bg-\[\#07C160\]\/10:hover{background-color:#07c1601a}.hover\:bg-\[\#20B2AA\]:hover{background-color:#20b2aa}.hover\:bg-\[\#38bdac\]\/10:hover{background-color:#38bdac1a}.hover\:bg-\[\#38bdac\]\/20:hover{background-color:#38bdac33}.hover\:bg-\[\#162840\]:hover{background-color:#162840}.hover\:bg-amber-400\/10:hover{background-color:#fcbb001a}@supports (color:color-mix(in lab,red,red)){.hover\:bg-amber-400\/10:hover{background-color:color-mix(in oklab,var(--color-amber-400)10%,transparent)}}.hover\:bg-amber-500\/20:hover{background-color:#f99c0033}@supports (color:color-mix(in lab,red,red)){.hover\:bg-amber-500\/20:hover{background-color:color-mix(in oklab,var(--color-amber-500)20%,transparent)}}.hover\:bg-blue-400\/10:hover{background-color:#54a2ff1a}@supports (color:color-mix(in lab,red,red)){.hover\:bg-blue-400\/10:hover{background-color:color-mix(in oklab,var(--color-blue-400)10%,transparent)}}.hover\:bg-blue-500\/20:hover{background-color:#3080ff33}@supports (color:color-mix(in lab,red,red)){.hover\:bg-blue-500\/20:hover{background-color:color-mix(in oklab,var(--color-blue-500)20%,transparent)}}.hover\:bg-gray-500:hover{background-color:var(--color-gray-500)}.hover\:bg-gray-700\/50:hover{background-color:#36415380}@supports (color:color-mix(in lab,red,red)){.hover\:bg-gray-700\/50:hover{background-color:color-mix(in oklab,var(--color-gray-700)50%,transparent)}}.hover\:bg-gray-800:hover{background-color:var(--color-gray-800)}.hover\:bg-green-500\/20:hover{background-color:#00c75833}@supports (color:color-mix(in lab,red,red)){.hover\:bg-green-500\/20:hover{background-color:color-mix(in oklab,var(--color-green-500)20%,transparent)}}.hover\:bg-green-700:hover{background-color:var(--color-green-700)}.hover\:bg-orange-500\/20:hover{background-color:#fe6e0033}@supports (color:color-mix(in lab,red,red)){.hover\:bg-orange-500\/20:hover{background-color:color-mix(in oklab,var(--color-orange-500)20%,transparent)}}.hover\:bg-purple-500\/20:hover{background-color:#ac4bff33}@supports (color:color-mix(in lab,red,red)){.hover\:bg-purple-500\/20:hover{background-color:color-mix(in oklab,var(--color-purple-500)20%,transparent)}}.hover\:bg-red-500\/10:hover{background-color:#fb2c361a}@supports (color:color-mix(in lab,red,red)){.hover\:bg-red-500\/10:hover{background-color:color-mix(in oklab,var(--color-red-500)10%,transparent)}}.hover\:bg-red-500\/20:hover{background-color:#fb2c3633}@supports (color:color-mix(in lab,red,red)){.hover\:bg-red-500\/20:hover{background-color:color-mix(in oklab,var(--color-red-500)20%,transparent)}}.hover\:bg-white\/5:hover{background-color:#ffffff0d}@supports (color:color-mix(in lab,red,red)){.hover\:bg-white\/5:hover{background-color:color-mix(in oklab,var(--color-white)5%,transparent)}}.hover\:bg-white\/20:hover{background-color:#fff3}@supports (color:color-mix(in lab,red,red)){.hover\:bg-white\/20:hover{background-color:color-mix(in oklab,var(--color-white)20%,transparent)}}.hover\:bg-yellow-400\/10:hover{background-color:#fac8001a}@supports (color:color-mix(in lab,red,red)){.hover\:bg-yellow-400\/10:hover{background-color:color-mix(in oklab,var(--color-yellow-400)10%,transparent)}}.hover\:bg-yellow-500\/20:hover{background-color:#edb20033}@supports (color:color-mix(in lab,red,red)){.hover\:bg-yellow-500\/20:hover{background-color:color-mix(in oklab,var(--color-yellow-500)20%,transparent)}}.hover\:text-\[\#38bdac\]:hover{color:#38bdac}.hover\:text-amber-400:hover{color:var(--color-amber-400)}.hover\:text-blue-400:hover{color:var(--color-blue-400)}.hover\:text-red-300:hover{color:var(--color-red-300)}.hover\:text-red-400:hover{color:var(--color-red-400)}.hover\:text-white:hover{color:var(--color-white)}.hover\:text-yellow-400:hover{color:var(--color-yellow-400)}.hover\:underline:hover{text-decoration-line:underline}.hover\:opacity-100:hover{opacity:1}}.focus\:border-\[\#38bdac\]:focus{border-color:#38bdac}.focus\:bg-\[\#38bdac\]\/20:focus{background-color:#38bdac33}.focus\:ring-2:focus{--tw-ring-shadow:var(--tw-ring-inset,)0 0 0 calc(2px + var(--tw-ring-offset-width))var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.focus\:ring-\[\#38bdac\]:focus{--tw-ring-color:#38bdac}.focus\:ring-offset-2:focus{--tw-ring-offset-width:2px;--tw-ring-offset-shadow:var(--tw-ring-inset,)0 0 0 var(--tw-ring-offset-width)var(--tw-ring-offset-color)}.focus\:outline-none:focus{--tw-outline-style:none;outline-style:none}.focus-visible\:ring-2:focus-visible{--tw-ring-shadow:var(--tw-ring-inset,)0 0 0 calc(2px + var(--tw-ring-offset-width))var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.focus-visible\:ring-\[3px\]:focus-visible{--tw-ring-shadow:var(--tw-ring-inset,)0 0 0 calc(3px + var(--tw-ring-offset-width))var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.focus-visible\:ring-\[\#38bdac\]:focus-visible{--tw-ring-color:#38bdac}.focus-visible\:ring-offset-2:focus-visible{--tw-ring-offset-width:2px;--tw-ring-offset-shadow:var(--tw-ring-inset,)0 0 0 var(--tw-ring-offset-width)var(--tw-ring-offset-color)}.focus-visible\:ring-offset-\[\#0a1628\]:focus-visible{--tw-ring-offset-color:#0a1628}.focus-visible\:outline-none:focus-visible{--tw-outline-style:none;outline-style:none}.disabled\:pointer-events-none:disabled{pointer-events:none}.disabled\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\:opacity-40:disabled{opacity:.4}.disabled\:opacity-50:disabled{opacity:.5}.has-\[\>svg\]\:px-2\.5:has(>svg){padding-inline:calc(var(--spacing)*2.5)}.has-\[\>svg\]\:px-3:has(>svg){padding-inline:calc(var(--spacing)*3)}.has-\[\>svg\]\:px-4:has(>svg){padding-inline:calc(var(--spacing)*4)}.data-\[disabled\]\:pointer-events-none[data-disabled]{pointer-events:none}.data-\[disabled\]\:opacity-50[data-disabled]{opacity:.5}.data-\[side\=bottom\]\:translate-y-1[data-side=bottom]{--tw-translate-y:calc(var(--spacing)*1);translate:var(--tw-translate-x)var(--tw-translate-y)}.data-\[state\=active\]\:bg-\[\#07C160\]\/20[data-state=active]{background-color:#07c16033}.data-\[state\=active\]\:bg-\[\#26A17B\]\/20[data-state=active]{background-color:#26a17b33}.data-\[state\=active\]\:bg-\[\#38bdac\]\/20[data-state=active]{background-color:#38bdac33}.data-\[state\=active\]\:bg-\[\#1677FF\]\/20[data-state=active]{background-color:#1677ff33}.data-\[state\=active\]\:bg-\[\#003087\]\/20[data-state=active]{background-color:#00308733}.data-\[state\=active\]\:text-\[\#07C160\][data-state=active]{color:#07c160}.data-\[state\=active\]\:text-\[\#26A17B\][data-state=active]{color:#26a17b}.data-\[state\=active\]\:text-\[\#38bdac\][data-state=active]{color:#38bdac}.data-\[state\=active\]\:text-\[\#169BD7\][data-state=active]{color:#169bd7}.data-\[state\=active\]\:text-\[\#1677FF\][data-state=active]{color:#1677ff}.data-\[state\=active\]\:shadow[data-state=active]{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a),0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.data-\[state\=checked\]\:translate-x-4[data-state=checked]{--tw-translate-x:calc(var(--spacing)*4);translate:var(--tw-translate-x)var(--tw-translate-y)}.data-\[state\=checked\]\:bg-\[\#38bdac\][data-state=checked]{background-color:#38bdac}.data-\[state\=unchecked\]\:translate-x-0[data-state=unchecked]{--tw-translate-x:calc(var(--spacing)*0);translate:var(--tw-translate-x)var(--tw-translate-y)}.data-\[state\=unchecked\]\:bg-gray-600[data-state=unchecked]{background-color:var(--color-gray-600)}@media(min-width:40rem){.sm\:max-w-lg{max-width:var(--container-lg)}.sm\:flex-row{flex-direction:row}.sm\:justify-end{justify-content:flex-end}.sm\:text-left{text-align:left}}@media(min-width:48rem){.md\:col-span-2{grid-column:span 2/span 2}.md\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.md\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.md\:text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}}@media(min-width:64rem){.lg\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.lg\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}}.\[\&_svg\]\:pointer-events-none svg{pointer-events:none}.\[\&_svg\]\:shrink-0 svg{flex-shrink:0}.\[\&_svg\:not\(\[class\*\=\'size-\'\]\)\]\:size-4 svg:not([class*=size-]){width:calc(var(--spacing)*4);height:calc(var(--spacing)*4)}.\[\&_tr\]\:border-b tr{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}.\[\&_tr\:last-child\]\:border-0 tr:last-child{border-style:var(--tw-border-style);border-width:0}.\[\&\:has\(\[role\=checkbox\]\)\]\:pr-0:has([role=checkbox]){padding-right:calc(var(--spacing)*0)}.\[\&\>span\]\:line-clamp-1>span{-webkit-line-clamp:1;-webkit-box-orient:vertical;display:-webkit-box;overflow:hidden}}:root{--background:oklch(14.5% 0 0);--foreground:oklch(98.5% 0 0);--card:oklch(20% .02 240);--card-foreground:oklch(98.5% 0 0);--popover:oklch(20% .02 240);--popover-foreground:oklch(98.5% 0 0);--primary:oklch(65% .15 180);--primary-foreground:oklch(20% 0 0);--secondary:oklch(27% 0 0);--secondary-foreground:oklch(98.5% 0 0);--muted:oklch(27% 0 0);--muted-foreground:oklch(65% 0 0);--accent:oklch(27% 0 0);--accent-foreground:oklch(98.5% 0 0);--destructive:oklch(55% .2 25);--destructive-foreground:oklch(98.5% 0 0);--border:oklch(35% 0 0);--input:oklch(35% 0 0);--ring:oklch(65% .15 180);--radius:.625rem}body{font-family:var(--font-sans);color:var(--foreground);background:#0a1628}@property --tw-translate-x{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-y{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-z{syntax:"*";inherits:false;initial-value:0}@property --tw-scale-x{syntax:"*";inherits:false;initial-value:1}@property --tw-scale-y{syntax:"*";inherits:false;initial-value:1}@property --tw-scale-z{syntax:"*";inherits:false;initial-value:1}@property --tw-rotate-x{syntax:"*";inherits:false}@property --tw-rotate-y{syntax:"*";inherits:false}@property --tw-rotate-z{syntax:"*";inherits:false}@property --tw-skew-x{syntax:"*";inherits:false}@property --tw-skew-y{syntax:"*";inherits:false}@property --tw-pan-x{syntax:"*";inherits:false}@property --tw-pan-y{syntax:"*";inherits:false}@property --tw-pinch-zoom{syntax:"*";inherits:false}@property --tw-space-y-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-space-x-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-divide-x-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-divide-y-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-gradient-position{syntax:"*";inherits:false}@property --tw-gradient-from{syntax:"";inherits:false;initial-value:#0000}@property --tw-gradient-via{syntax:"";inherits:false;initial-value:#0000}@property --tw-gradient-to{syntax:"";inherits:false;initial-value:#0000}@property --tw-gradient-stops{syntax:"*";inherits:false}@property --tw-gradient-via-stops{syntax:"*";inherits:false}@property --tw-gradient-from-position{syntax:"";inherits:false;initial-value:0%}@property --tw-gradient-via-position{syntax:"";inherits:false;initial-value:50%}@property --tw-gradient-to-position{syntax:"";inherits:false;initial-value:100%}@property --tw-leading{syntax:"*";inherits:false}@property --tw-font-weight{syntax:"*";inherits:false}@property --tw-tracking{syntax:"*";inherits:false}@property --tw-ordinal{syntax:"*";inherits:false}@property --tw-slashed-zero{syntax:"*";inherits:false}@property --tw-numeric-figure{syntax:"*";inherits:false}@property --tw-numeric-spacing{syntax:"*";inherits:false}@property --tw-numeric-fraction{syntax:"*";inherits:false}@property --tw-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:"*";inherits:false}@property --tw-shadow-alpha{syntax:"";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:"*";inherits:false}@property --tw-inset-shadow-alpha{syntax:"";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:"*";inherits:false}@property --tw-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:"*";inherits:false}@property --tw-inset-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:"*";inherits:false}@property --tw-ring-offset-width{syntax:"";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:"*";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-outline-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-blur{syntax:"*";inherits:false}@property --tw-brightness{syntax:"*";inherits:false}@property --tw-contrast{syntax:"*";inherits:false}@property --tw-grayscale{syntax:"*";inherits:false}@property --tw-hue-rotate{syntax:"*";inherits:false}@property --tw-invert{syntax:"*";inherits:false}@property --tw-opacity{syntax:"*";inherits:false}@property --tw-saturate{syntax:"*";inherits:false}@property --tw-sepia{syntax:"*";inherits:false}@property --tw-drop-shadow{syntax:"*";inherits:false}@property --tw-drop-shadow-color{syntax:"*";inherits:false}@property --tw-drop-shadow-alpha{syntax:"";inherits:false;initial-value:100%}@property --tw-drop-shadow-size{syntax:"*";inherits:false}@property --tw-backdrop-blur{syntax:"*";inherits:false}@property --tw-backdrop-brightness{syntax:"*";inherits:false}@property --tw-backdrop-contrast{syntax:"*";inherits:false}@property --tw-backdrop-grayscale{syntax:"*";inherits:false}@property --tw-backdrop-hue-rotate{syntax:"*";inherits:false}@property --tw-backdrop-invert{syntax:"*";inherits:false}@property --tw-backdrop-opacity{syntax:"*";inherits:false}@property --tw-backdrop-saturate{syntax:"*";inherits:false}@property --tw-backdrop-sepia{syntax:"*";inherits:false}@keyframes spin{to{transform:rotate(360deg)}} diff --git a/soul-admin/dist/assets/index-BwYBUNyp.css b/soul-admin/dist/assets/index-BwYBUNyp.css deleted file mode 100644 index 7ba9ddcc..00000000 --- a/soul-admin/dist/assets/index-BwYBUNyp.css +++ /dev/null @@ -1 +0,0 @@ -/*! tailwindcss v4.1.18 | MIT License | https://tailwindcss.com */@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-translate-x:0;--tw-translate-y:0;--tw-translate-z:0;--tw-scale-x:1;--tw-scale-y:1;--tw-scale-z:1;--tw-rotate-x:initial;--tw-rotate-y:initial;--tw-rotate-z:initial;--tw-skew-x:initial;--tw-skew-y:initial;--tw-pan-x:initial;--tw-pan-y:initial;--tw-pinch-zoom:initial;--tw-space-y-reverse:0;--tw-space-x-reverse:0;--tw-divide-x-reverse:0;--tw-border-style:solid;--tw-divide-y-reverse:0;--tw-gradient-position:initial;--tw-gradient-from:#0000;--tw-gradient-via:#0000;--tw-gradient-to:#0000;--tw-gradient-stops:initial;--tw-gradient-via-stops:initial;--tw-gradient-from-position:0%;--tw-gradient-via-position:50%;--tw-gradient-to-position:100%;--tw-leading:initial;--tw-font-weight:initial;--tw-tracking:initial;--tw-ordinal:initial;--tw-slashed-zero:initial;--tw-numeric-figure:initial;--tw-numeric-spacing:initial;--tw-numeric-fraction:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000;--tw-outline-style:solid;--tw-blur:initial;--tw-brightness:initial;--tw-contrast:initial;--tw-grayscale:initial;--tw-hue-rotate:initial;--tw-invert:initial;--tw-opacity:initial;--tw-saturate:initial;--tw-sepia:initial;--tw-drop-shadow:initial;--tw-drop-shadow-color:initial;--tw-drop-shadow-alpha:100%;--tw-drop-shadow-size:initial;--tw-backdrop-blur:initial;--tw-backdrop-brightness:initial;--tw-backdrop-contrast:initial;--tw-backdrop-grayscale:initial;--tw-backdrop-hue-rotate:initial;--tw-backdrop-invert:initial;--tw-backdrop-opacity:initial;--tw-backdrop-saturate:initial;--tw-backdrop-sepia:initial}}}@layer theme{:root,:host{--font-sans:-apple-system,BlinkMacSystemFont,"Segoe UI","PingFang SC","Microsoft YaHei",sans-serif;--font-mono:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace;--color-red-300:oklch(80.8% .114 19.571);--color-red-400:oklch(70.4% .191 22.216);--color-red-500:oklch(63.7% .237 25.331);--color-orange-300:oklch(83.7% .128 66.29);--color-orange-400:oklch(75% .183 55.934);--color-orange-500:oklch(70.5% .213 47.604);--color-amber-400:oklch(82.8% .189 84.429);--color-amber-500:oklch(76.9% .188 70.08);--color-yellow-400:oklch(85.2% .199 91.936);--color-yellow-500:oklch(79.5% .184 86.047);--color-green-400:oklch(79.2% .209 151.711);--color-green-500:oklch(72.3% .219 149.579);--color-green-600:oklch(62.7% .194 149.214);--color-green-700:oklch(52.7% .154 150.069);--color-cyan-400:oklch(78.9% .154 211.53);--color-cyan-500:oklch(71.5% .143 215.221);--color-blue-300:oklch(80.9% .105 251.813);--color-blue-400:oklch(70.7% .165 254.624);--color-blue-500:oklch(62.3% .214 259.815);--color-purple-400:oklch(71.4% .203 305.504);--color-purple-500:oklch(62.7% .265 303.9);--color-gray-200:oklch(92.8% .006 264.531);--color-gray-300:oklch(87.2% .01 258.338);--color-gray-400:oklch(70.7% .022 261.325);--color-gray-500:oklch(55.1% .027 264.364);--color-gray-600:oklch(44.6% .03 256.802);--color-gray-700:oklch(37.3% .034 259.733);--color-gray-800:oklch(27.8% .033 256.848);--color-black:#000;--color-white:#fff;--spacing:.25rem;--container-sm:24rem;--container-md:28rem;--container-lg:32rem;--container-2xl:42rem;--container-4xl:56rem;--container-5xl:64rem;--container-6xl:72rem;--container-7xl:80rem;--text-xs:.75rem;--text-xs--line-height:calc(1/.75);--text-sm:.875rem;--text-sm--line-height:calc(1.25/.875);--text-base:1rem;--text-base--line-height: 1.5 ;--text-lg:1.125rem;--text-lg--line-height:calc(1.75/1.125);--text-xl:1.25rem;--text-xl--line-height:calc(1.75/1.25);--text-2xl:1.5rem;--text-2xl--line-height:calc(2/1.5);--text-3xl:1.875rem;--text-3xl--line-height: 1.2 ;--text-4xl:2.25rem;--text-4xl--line-height:calc(2.5/2.25);--font-weight-medium:500;--font-weight-semibold:600;--font-weight-bold:700;--tracking-tight:-.025em;--leading-relaxed:1.625;--radius-sm:.25rem;--radius-md:.375rem;--radius-lg:.5rem;--radius-xl:.75rem;--radius-2xl:1rem;--animate-spin:spin 1s linear infinite;--animate-pulse:pulse 2s cubic-bezier(.4,0,.6,1)infinite;--blur-xl:24px;--blur-3xl:64px;--default-transition-duration:.15s;--default-transition-timing-function:cubic-bezier(.4,0,.2,1);--default-font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","PingFang SC","Microsoft YaHei",sans-serif;--default-mono-font-family:var(--font-mono)}}@layer base{*,:after,:before,::backdrop{box-sizing:border-box;border:0 solid;margin:0;padding:0}::file-selector-button{box-sizing:border-box;border:0 solid;margin:0;padding:0}html,:host{-webkit-text-size-adjust:100%;-moz-tab-size:4;tab-size:4;line-height:1.5;font-family:var(--default-font-family,ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji");font-feature-settings:var(--default-font-feature-settings,normal);font-variation-settings:var(--default-font-variation-settings,normal);-webkit-tap-highlight-color:transparent}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:var(--default-mono-font-family,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace);font-feature-settings:var(--default-mono-font-feature-settings,normal);font-variation-settings:var(--default-mono-font-variation-settings,normal);font-size:1em}small{font-size:80%}sub,sup{vertical-align:baseline;font-size:75%;line-height:0;position:relative}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}:-moz-focusring{outline:auto}progress{vertical-align:baseline}summary{display:list-item}ol,ul,menu{list-style:none}img,svg,video,canvas,audio,iframe,embed,object{vertical-align:middle;display:block}img,video{max-width:100%;height:auto}button,input,select,optgroup,textarea{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}::file-selector-button{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}:where(select:is([multiple],[size])) optgroup{font-weight:bolder}:where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}::file-selector-button{margin-inline-end:4px}::placeholder{opacity:1}@supports (not ((-webkit-appearance:-apple-pay-button))) or (contain-intrinsic-size:1px){::placeholder{color:currentColor}@supports (color:color-mix(in lab,red,red)){::placeholder{color:color-mix(in oklab,currentcolor 50%,transparent)}}}textarea{resize:vertical}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}::-webkit-datetime-edit{display:inline-flex}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-datetime-edit{padding-block:0}::-webkit-datetime-edit-year-field{padding-block:0}::-webkit-datetime-edit-month-field{padding-block:0}::-webkit-datetime-edit-day-field{padding-block:0}::-webkit-datetime-edit-hour-field{padding-block:0}::-webkit-datetime-edit-minute-field{padding-block:0}::-webkit-datetime-edit-second-field{padding-block:0}::-webkit-datetime-edit-millisecond-field{padding-block:0}::-webkit-datetime-edit-meridiem-field{padding-block:0}::-webkit-calendar-picker-indicator{line-height:1}:-moz-ui-invalid{box-shadow:none}button,input:where([type=button],[type=reset],[type=submit]){-webkit-appearance:button;-moz-appearance:button;appearance:button}::file-selector-button{-webkit-appearance:button;-moz-appearance:button;appearance:button}::-webkit-inner-spin-button{height:auto}::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}}@layer components;@layer utilities{.pointer-events-none{pointer-events:none}.collapse{visibility:collapse}.invisible{visibility:hidden}.visible{visibility:visible}.sr-only{clip-path:inset(50%);white-space:nowrap;border-width:0;width:1px;height:1px;margin:-1px;padding:0;position:absolute;overflow:hidden}.not-sr-only{clip-path:none;white-space:normal;width:auto;height:auto;margin:0;padding:0;position:static;overflow:visible}.absolute{position:absolute}.fixed{position:fixed}.relative{position:relative}.static{position:static}.sticky{position:sticky}.inset-0{inset:calc(var(--spacing)*0)}.top-0{top:calc(var(--spacing)*0)}.top-1\/2{top:50%}.top-1\/4{top:25%}.top-4{top:calc(var(--spacing)*4)}.top-\[50\%\]{top:50%}.right-1\/4{right:25%}.right-4{right:calc(var(--spacing)*4)}.bottom-1\/4{bottom:25%}.left-1\/4{left:25%}.left-2{left:calc(var(--spacing)*2)}.left-3{left:calc(var(--spacing)*3)}.left-\[50\%\]{left:50%}.isolate{isolation:isolate}.isolation-auto{isolation:auto}.z-10{z-index:10}.z-50{z-index:50}.container{width:100%}@media(min-width:40rem){.container{max-width:40rem}}@media(min-width:48rem){.container{max-width:48rem}}@media(min-width:64rem){.container{max-width:64rem}}@media(min-width:80rem){.container{max-width:80rem}}@media(min-width:96rem){.container{max-width:96rem}}.mx-auto{margin-inline:auto}.mt-0\.5{margin-top:calc(var(--spacing)*.5)}.mt-1{margin-top:calc(var(--spacing)*1)}.mt-2{margin-top:calc(var(--spacing)*2)}.mt-3{margin-top:calc(var(--spacing)*3)}.mt-4{margin-top:calc(var(--spacing)*4)}.mt-6{margin-top:calc(var(--spacing)*6)}.mr-1{margin-right:calc(var(--spacing)*1)}.mr-2{margin-right:calc(var(--spacing)*2)}.mb-1{margin-bottom:calc(var(--spacing)*1)}.mb-2{margin-bottom:calc(var(--spacing)*2)}.mb-3{margin-bottom:calc(var(--spacing)*3)}.mb-4{margin-bottom:calc(var(--spacing)*4)}.mb-6{margin-bottom:calc(var(--spacing)*6)}.mb-8{margin-bottom:calc(var(--spacing)*8)}.ml-1{margin-left:calc(var(--spacing)*1)}.ml-2{margin-left:calc(var(--spacing)*2)}.ml-4{margin-left:calc(var(--spacing)*4)}.ml-6{margin-left:calc(var(--spacing)*6)}.line-clamp-2{-webkit-line-clamp:2;-webkit-box-orient:vertical;display:-webkit-box;overflow:hidden}.block{display:block}.contents{display:contents}.flex{display:flex}.flow-root{display:flow-root}.grid{display:grid}.hidden{display:none}.inline{display:inline}.inline-block{display:inline-block}.inline-flex{display:inline-flex}.inline-grid{display:inline-grid}.inline-table{display:inline-table}.list-item{display:list-item}.table{display:table}.table-caption{display:table-caption}.table-cell{display:table-cell}.table-column{display:table-column}.table-column-group{display:table-column-group}.table-footer-group{display:table-footer-group}.table-header-group{display:table-header-group}.table-row{display:table-row}.table-row-group{display:table-row-group}.size-4{width:calc(var(--spacing)*4);height:calc(var(--spacing)*4)}.size-8{width:calc(var(--spacing)*8);height:calc(var(--spacing)*8)}.size-9{width:calc(var(--spacing)*9);height:calc(var(--spacing)*9)}.size-10{width:calc(var(--spacing)*10);height:calc(var(--spacing)*10)}.h-1\.5{height:calc(var(--spacing)*1.5)}.h-3{height:calc(var(--spacing)*3)}.h-3\.5{height:calc(var(--spacing)*3.5)}.h-4{height:calc(var(--spacing)*4)}.h-5{height:calc(var(--spacing)*5)}.h-6{height:calc(var(--spacing)*6)}.h-8{height:calc(var(--spacing)*8)}.h-9{height:calc(var(--spacing)*9)}.h-10{height:calc(var(--spacing)*10)}.h-12{height:calc(var(--spacing)*12)}.h-16{height:calc(var(--spacing)*16)}.h-20{height:calc(var(--spacing)*20)}.h-24{height:calc(var(--spacing)*24)}.h-96{height:calc(var(--spacing)*96)}.h-\[70vh\]{height:70vh}.h-full{height:100%}.max-h-96{max-height:calc(var(--spacing)*96)}.max-h-\[80vh\]{max-height:80vh}.max-h-\[90vh\]{max-height:90vh}.max-h-\[200px\]{max-height:200px}.max-h-\[300px\]{max-height:300px}.min-h-\[60vh\]{min-height:60vh}.min-h-\[80px\]{min-height:80px}.min-h-\[100px\]{min-height:100px}.min-h-\[120px\]{min-height:120px}.min-h-\[200px\]{min-height:200px}.min-h-\[300px\]{min-height:300px}.min-h-\[400px\]{min-height:400px}.min-h-screen{min-height:100vh}.w-3{width:calc(var(--spacing)*3)}.w-3\.5{width:calc(var(--spacing)*3.5)}.w-4{width:calc(var(--spacing)*4)}.w-5{width:calc(var(--spacing)*5)}.w-6{width:calc(var(--spacing)*6)}.w-8{width:calc(var(--spacing)*8)}.w-9{width:calc(var(--spacing)*9)}.w-10{width:calc(var(--spacing)*10)}.w-12{width:calc(var(--spacing)*12)}.w-16{width:calc(var(--spacing)*16)}.w-20{width:calc(var(--spacing)*20)}.w-24{width:calc(var(--spacing)*24)}.w-64{width:calc(var(--spacing)*64)}.w-96{width:calc(var(--spacing)*96)}.w-fit{width:fit-content}.w-full{width:100%}.max-w-2xl{max-width:var(--container-2xl)}.max-w-4xl{max-width:var(--container-4xl)}.max-w-5xl{max-width:var(--container-5xl)}.max-w-6xl{max-width:var(--container-6xl)}.max-w-7xl{max-width:var(--container-7xl)}.max-w-\[100px\]{max-width:100px}.max-w-\[200px\]{max-width:200px}.max-w-\[calc\(100\%-2rem\)\]{max-width:calc(100% - 2rem)}.max-w-lg{max-width:var(--container-lg)}.max-w-md{max-width:var(--container-md)}.max-w-sm{max-width:var(--container-sm)}.min-w-0{min-width:calc(var(--spacing)*0)}.min-w-\[8rem\]{min-width:8rem}.flex-1{flex:1}.flex-shrink-0{flex-shrink:0}.shrink{flex-shrink:1}.shrink-0{flex-shrink:0}.grow{flex-grow:1}.caption-bottom{caption-side:bottom}.border-collapse{border-collapse:collapse}.-translate-x-1\/2{--tw-translate-x: -50% ;translate:var(--tw-translate-x)var(--tw-translate-y)}.-translate-y-1\/2{--tw-translate-y: -50% ;translate:var(--tw-translate-x)var(--tw-translate-y)}.translate-none{translate:none}.scale-3d{scale:var(--tw-scale-x)var(--tw-scale-y)var(--tw-scale-z)}.rotate-90{rotate:90deg}.transform{transform:var(--tw-rotate-x,)var(--tw-rotate-y,)var(--tw-rotate-z,)var(--tw-skew-x,)var(--tw-skew-y,)}.animate-spin{animation:var(--animate-spin)}.cursor-default{cursor:default}.cursor-pointer{cursor:pointer}.touch-pinch-zoom{--tw-pinch-zoom:pinch-zoom;touch-action:var(--tw-pan-x,)var(--tw-pan-y,)var(--tw-pinch-zoom,)}.touch-none{touch-action:none}.resize{resize:both}.list-inside{list-style-position:inside}.list-decimal{list-style-type:decimal}.grid-cols-1{grid-template-columns:repeat(1,minmax(0,1fr))}.grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.flex-col{flex-direction:column}.flex-col-reverse{flex-direction:column-reverse}.flex-row{flex-direction:row}.flex-wrap{flex-wrap:wrap}.items-center{align-items:center}.items-start{align-items:flex-start}.justify-between{justify-content:space-between}.justify-center{justify-content:center}.justify-end{justify-content:flex-end}.gap-1{gap:calc(var(--spacing)*1)}.gap-1\.5{gap:calc(var(--spacing)*1.5)}.gap-2{gap:calc(var(--spacing)*2)}.gap-3{gap:calc(var(--spacing)*3)}.gap-4{gap:calc(var(--spacing)*4)}.gap-6{gap:calc(var(--spacing)*6)}.gap-8{gap:calc(var(--spacing)*8)}:where(.space-y-1>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*1)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*1)*calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-1\.5>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*1.5)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*1.5)*calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-2>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*2)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*2)*calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-3>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*3)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*3)*calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-4>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*4)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*4)*calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-6>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*6)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*6)*calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-reverse>:not(:last-child)){--tw-space-y-reverse:1}:where(.space-x-reverse>:not(:last-child)){--tw-space-x-reverse:1}:where(.divide-x>:not(:last-child)){--tw-divide-x-reverse:0;border-inline-style:var(--tw-border-style);border-inline-start-width:calc(1px*var(--tw-divide-x-reverse));border-inline-end-width:calc(1px*calc(1 - var(--tw-divide-x-reverse)))}:where(.divide-y>:not(:last-child)){--tw-divide-y-reverse:0;border-bottom-style:var(--tw-border-style);border-top-style:var(--tw-border-style);border-top-width:calc(1px*var(--tw-divide-y-reverse));border-bottom-width:calc(1px*calc(1 - var(--tw-divide-y-reverse)))}:where(.divide-y-reverse>:not(:last-child)){--tw-divide-y-reverse:1}:where(.divide-gray-700\/50>:not(:last-child)){border-color:#36415380}@supports (color:color-mix(in lab,red,red)){:where(.divide-gray-700\/50>:not(:last-child)){border-color:color-mix(in oklab,var(--color-gray-700)50%,transparent)}}:where(.divide-white\/5>:not(:last-child)){border-color:#ffffff0d}@supports (color:color-mix(in lab,red,red)){:where(.divide-white\/5>:not(:last-child)){border-color:color-mix(in oklab,var(--color-white)5%,transparent)}}.truncate{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.overflow-auto{overflow:auto}.overflow-hidden{overflow:hidden}.overflow-x-auto{overflow-x:auto}.overflow-y-auto{overflow-y:auto}.rounded{border-radius:.25rem}.rounded-2xl{border-radius:var(--radius-2xl)}.rounded-full{border-radius:3.40282e38px}.rounded-lg{border-radius:var(--radius-lg)}.rounded-md{border-radius:var(--radius-md)}.rounded-sm{border-radius:var(--radius-sm)}.rounded-xl{border-radius:var(--radius-xl)}.rounded-s{border-start-start-radius:.25rem;border-end-start-radius:.25rem}.rounded-ss{border-start-start-radius:.25rem}.rounded-e{border-start-end-radius:.25rem;border-end-end-radius:.25rem}.rounded-se{border-start-end-radius:.25rem}.rounded-ee{border-end-end-radius:.25rem}.rounded-es{border-end-start-radius:.25rem}.rounded-t{border-top-left-radius:.25rem;border-top-right-radius:.25rem}.rounded-l{border-top-left-radius:.25rem;border-bottom-left-radius:.25rem}.rounded-tl{border-top-left-radius:.25rem}.rounded-r{border-top-right-radius:.25rem;border-bottom-right-radius:.25rem}.rounded-tr{border-top-right-radius:.25rem}.rounded-b{border-bottom-right-radius:.25rem;border-bottom-left-radius:.25rem}.rounded-br{border-bottom-right-radius:.25rem}.rounded-bl{border-bottom-left-radius:.25rem}.border{border-style:var(--tw-border-style);border-width:1px}.border-0{border-style:var(--tw-border-style);border-width:0}.border-2{border-style:var(--tw-border-style);border-width:2px}.border-x{border-inline-style:var(--tw-border-style);border-inline-width:1px}.border-y{border-block-style:var(--tw-border-style);border-block-width:1px}.border-s{border-inline-start-style:var(--tw-border-style);border-inline-start-width:1px}.border-e{border-inline-end-style:var(--tw-border-style);border-inline-end-width:1px}.border-t{border-top-style:var(--tw-border-style);border-top-width:1px}.border-r{border-right-style:var(--tw-border-style);border-right-width:1px}.border-b{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}.border-l{border-left-style:var(--tw-border-style);border-left-width:1px}.border-l-2{border-left-style:var(--tw-border-style);border-left-width:2px}.border-dashed{--tw-border-style:dashed;border-style:dashed}.border-\[\#07C160\]{border-color:#07c160}.border-\[\#07C160\]\/20{border-color:#07c16033}.border-\[\#07C160\]\/30{border-color:#07c1604d}.border-\[\#38bdac\]\/30{border-color:#38bdac4d}.border-\[\#38bdac\]\/40{border-color:#38bdac66}.border-blue-500\/30{border-color:#3080ff4d}@supports (color:color-mix(in lab,red,red)){.border-blue-500\/30{border-color:color-mix(in oklab,var(--color-blue-500)30%,transparent)}}.border-blue-500\/50{border-color:#3080ff80}@supports (color:color-mix(in lab,red,red)){.border-blue-500\/50{border-color:color-mix(in oklab,var(--color-blue-500)50%,transparent)}}.border-cyan-500\/30{border-color:#00b7d74d}@supports (color:color-mix(in lab,red,red)){.border-cyan-500\/30{border-color:color-mix(in oklab,var(--color-cyan-500)30%,transparent)}}.border-gray-600{border-color:var(--color-gray-600)}.border-gray-700{border-color:var(--color-gray-700)}.border-gray-700\/30{border-color:#3641534d}@supports (color:color-mix(in lab,red,red)){.border-gray-700\/30{border-color:color-mix(in oklab,var(--color-gray-700)30%,transparent)}}.border-gray-700\/50{border-color:#36415380}@supports (color:color-mix(in lab,red,red)){.border-gray-700\/50{border-color:color-mix(in oklab,var(--color-gray-700)50%,transparent)}}.border-green-500\/30{border-color:#00c7584d}@supports (color:color-mix(in lab,red,red)){.border-green-500\/30{border-color:color-mix(in oklab,var(--color-green-500)30%,transparent)}}.border-orange-500\/30{border-color:#fe6e004d}@supports (color:color-mix(in lab,red,red)){.border-orange-500\/30{border-color:color-mix(in oklab,var(--color-orange-500)30%,transparent)}}.border-purple-500\/30{border-color:#ac4bff4d}@supports (color:color-mix(in lab,red,red)){.border-purple-500\/30{border-color:color-mix(in oklab,var(--color-purple-500)30%,transparent)}}.border-red-500\/20{border-color:#fb2c3633}@supports (color:color-mix(in lab,red,red)){.border-red-500\/20{border-color:color-mix(in oklab,var(--color-red-500)20%,transparent)}}.border-red-500\/50{border-color:#fb2c3680}@supports (color:color-mix(in lab,red,red)){.border-red-500\/50{border-color:color-mix(in oklab,var(--color-red-500)50%,transparent)}}.border-transparent{border-color:#0000}.border-white\/5{border-color:#ffffff0d}@supports (color:color-mix(in lab,red,red)){.border-white\/5{border-color:color-mix(in oklab,var(--color-white)5%,transparent)}}.border-white\/10{border-color:#ffffff1a}@supports (color:color-mix(in lab,red,red)){.border-white\/10{border-color:color-mix(in oklab,var(--color-white)10%,transparent)}}.border-white\/20{border-color:#fff3}@supports (color:color-mix(in lab,red,red)){.border-white\/20{border-color:color-mix(in oklab,var(--color-white)20%,transparent)}}.border-yellow-500\/30{border-color:#edb2004d}@supports (color:color-mix(in lab,red,red)){.border-yellow-500\/30{border-color:color-mix(in oklab,var(--color-yellow-500)30%,transparent)}}.bg-\[\#0a1628\]{background-color:#0a1628}.bg-\[\#0f2137\]{background-color:#0f2137}.bg-\[\#00CED1\]{background-color:#00ced1}.bg-\[\#07C160\]{background-color:#07c160}.bg-\[\#07C160\]\/5{background-color:#07c1600d}.bg-\[\#07C160\]\/10{background-color:#07c1601a}.bg-\[\#38bdac\]{background-color:#38bdac}.bg-\[\#38bdac\]\/5{background-color:#38bdac0d}.bg-\[\#38bdac\]\/10{background-color:#38bdac1a}.bg-\[\#38bdac\]\/20{background-color:#38bdac33}.bg-\[\#38bdac\]\/30{background-color:#38bdac4d}.bg-\[\#162840\]{background-color:#162840}.bg-amber-500\/20{background-color:#f99c0033}@supports (color:color-mix(in lab,red,red)){.bg-amber-500\/20{background-color:color-mix(in oklab,var(--color-amber-500)20%,transparent)}}.bg-black{background-color:var(--color-black)}.bg-black\/50{background-color:#00000080}@supports (color:color-mix(in lab,red,red)){.bg-black\/50{background-color:color-mix(in oklab,var(--color-black)50%,transparent)}}.bg-black\/90{background-color:#000000e6}@supports (color:color-mix(in lab,red,red)){.bg-black\/90{background-color:color-mix(in oklab,var(--color-black)90%,transparent)}}.bg-blue-500\/5{background-color:#3080ff0d}@supports (color:color-mix(in lab,red,red)){.bg-blue-500\/5{background-color:color-mix(in oklab,var(--color-blue-500)5%,transparent)}}.bg-blue-500\/10{background-color:#3080ff1a}@supports (color:color-mix(in lab,red,red)){.bg-blue-500\/10{background-color:color-mix(in oklab,var(--color-blue-500)10%,transparent)}}.bg-blue-500\/20{background-color:#3080ff33}@supports (color:color-mix(in lab,red,red)){.bg-blue-500\/20{background-color:color-mix(in oklab,var(--color-blue-500)20%,transparent)}}.bg-cyan-500{background-color:var(--color-cyan-500)}.bg-gray-500\/20{background-color:#6a728233}@supports (color:color-mix(in lab,red,red)){.bg-gray-500\/20{background-color:color-mix(in oklab,var(--color-gray-500)20%,transparent)}}.bg-gray-600{background-color:var(--color-gray-600)}.bg-gray-700\/50{background-color:#36415380}@supports (color:color-mix(in lab,red,red)){.bg-gray-700\/50{background-color:color-mix(in oklab,var(--color-gray-700)50%,transparent)}}.bg-green-500{background-color:var(--color-green-500)}.bg-green-500\/20{background-color:#00c75833}@supports (color:color-mix(in lab,red,red)){.bg-green-500\/20{background-color:color-mix(in oklab,var(--color-green-500)20%,transparent)}}.bg-green-600{background-color:var(--color-green-600)}.bg-orange-500\/10{background-color:#fe6e001a}@supports (color:color-mix(in lab,red,red)){.bg-orange-500\/10{background-color:color-mix(in oklab,var(--color-orange-500)10%,transparent)}}.bg-orange-500\/20{background-color:#fe6e0033}@supports (color:color-mix(in lab,red,red)){.bg-orange-500\/20{background-color:color-mix(in oklab,var(--color-orange-500)20%,transparent)}}.bg-purple-500\/20{background-color:#ac4bff33}@supports (color:color-mix(in lab,red,red)){.bg-purple-500\/20{background-color:color-mix(in oklab,var(--color-purple-500)20%,transparent)}}.bg-red-500\/10{background-color:#fb2c361a}@supports (color:color-mix(in lab,red,red)){.bg-red-500\/10{background-color:color-mix(in oklab,var(--color-red-500)10%,transparent)}}.bg-red-500\/20{background-color:#fb2c3633}@supports (color:color-mix(in lab,red,red)){.bg-red-500\/20{background-color:color-mix(in oklab,var(--color-red-500)20%,transparent)}}.bg-transparent{background-color:#0000}.bg-white{background-color:var(--color-white)}.bg-white\/5{background-color:#ffffff0d}@supports (color:color-mix(in lab,red,red)){.bg-white\/5{background-color:color-mix(in oklab,var(--color-white)5%,transparent)}}.bg-white\/10{background-color:#ffffff1a}@supports (color:color-mix(in lab,red,red)){.bg-white\/10{background-color:color-mix(in oklab,var(--color-white)10%,transparent)}}.bg-white\/20{background-color:#fff3}@supports (color:color-mix(in lab,red,red)){.bg-white\/20{background-color:color-mix(in oklab,var(--color-white)20%,transparent)}}.bg-yellow-500\/20{background-color:#edb20033}@supports (color:color-mix(in lab,red,red)){.bg-yellow-500\/20{background-color:color-mix(in oklab,var(--color-yellow-500)20%,transparent)}}.bg-gradient-to-br{--tw-gradient-position:to bottom right in oklab;background-image:linear-gradient(var(--tw-gradient-stops))}.bg-gradient-to-r{--tw-gradient-position:to right in oklab;background-image:linear-gradient(var(--tw-gradient-stops))}.from-\[\#00CED1\]{--tw-gradient-from:#00ced1;--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.from-\[\#38bdac\]\/10{--tw-gradient-from:oklab(72.378% -.11483 -.0053193/.1);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.from-cyan-500\/20{--tw-gradient-from:#00b7d733}@supports (color:color-mix(in lab,red,red)){.from-cyan-500\/20{--tw-gradient-from:color-mix(in oklab,var(--color-cyan-500)20%,transparent)}}.from-cyan-500\/20{--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.from-green-500\/20{--tw-gradient-from:#00c75833}@supports (color:color-mix(in lab,red,red)){.from-green-500\/20{--tw-gradient-from:color-mix(in oklab,var(--color-green-500)20%,transparent)}}.from-green-500\/20{--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.from-purple-500\/20{--tw-gradient-from:#ac4bff33}@supports (color:color-mix(in lab,red,red)){.from-purple-500\/20{--tw-gradient-from:color-mix(in oklab,var(--color-purple-500)20%,transparent)}}.from-purple-500\/20{--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.from-yellow-500\/20{--tw-gradient-from:#edb20033}@supports (color:color-mix(in lab,red,red)){.from-yellow-500\/20{--tw-gradient-from:color-mix(in oklab,var(--color-yellow-500)20%,transparent)}}.from-yellow-500\/20{--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.to-\[\#0f2137\]{--tw-gradient-to:#0f2137;--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.to-\[\#20B2AA\]{--tw-gradient-to:#20b2aa;--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.to-cyan-500\/5{--tw-gradient-to:#00b7d70d}@supports (color:color-mix(in lab,red,red)){.to-cyan-500\/5{--tw-gradient-to:color-mix(in oklab,var(--color-cyan-500)5%,transparent)}}.to-cyan-500\/5{--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.to-green-500\/5{--tw-gradient-to:#00c7580d}@supports (color:color-mix(in lab,red,red)){.to-green-500\/5{--tw-gradient-to:color-mix(in oklab,var(--color-green-500)5%,transparent)}}.to-green-500\/5{--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.to-purple-500\/5{--tw-gradient-to:#ac4bff0d}@supports (color:color-mix(in lab,red,red)){.to-purple-500\/5{--tw-gradient-to:color-mix(in oklab,var(--color-purple-500)5%,transparent)}}.to-purple-500\/5{--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.to-yellow-500\/5{--tw-gradient-to:#edb2000d}@supports (color:color-mix(in lab,red,red)){.to-yellow-500\/5{--tw-gradient-to:color-mix(in oklab,var(--color-yellow-500)5%,transparent)}}.to-yellow-500\/5{--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.bg-repeat{background-repeat:repeat}.mask-no-clip{-webkit-mask-clip:no-clip;mask-clip:no-clip}.mask-repeat{-webkit-mask-repeat:repeat;mask-repeat:repeat}.object-cover{object-fit:cover}.p-0{padding:calc(var(--spacing)*0)}.p-1{padding:calc(var(--spacing)*1)}.p-2{padding:calc(var(--spacing)*2)}.p-3{padding:calc(var(--spacing)*3)}.p-4{padding:calc(var(--spacing)*4)}.p-6{padding:calc(var(--spacing)*6)}.p-8{padding:calc(var(--spacing)*8)}.px-1\.5{padding-inline:calc(var(--spacing)*1.5)}.px-2{padding-inline:calc(var(--spacing)*2)}.px-3{padding-inline:calc(var(--spacing)*3)}.px-4{padding-inline:calc(var(--spacing)*4)}.px-5{padding-inline:calc(var(--spacing)*5)}.px-6{padding-inline:calc(var(--spacing)*6)}.py-0\.5{padding-block:calc(var(--spacing)*.5)}.py-1{padding-block:calc(var(--spacing)*1)}.py-1\.5{padding-block:calc(var(--spacing)*1.5)}.py-2{padding-block:calc(var(--spacing)*2)}.py-3{padding-block:calc(var(--spacing)*3)}.py-4{padding-block:calc(var(--spacing)*4)}.py-5{padding-block:calc(var(--spacing)*5)}.py-8{padding-block:calc(var(--spacing)*8)}.py-12{padding-block:calc(var(--spacing)*12)}.py-20{padding-block:calc(var(--spacing)*20)}.py-24{padding-block:calc(var(--spacing)*24)}.pt-0{padding-top:calc(var(--spacing)*0)}.pt-1{padding-top:calc(var(--spacing)*1)}.pt-2{padding-top:calc(var(--spacing)*2)}.pt-4{padding-top:calc(var(--spacing)*4)}.pr-1{padding-right:calc(var(--spacing)*1)}.pr-2{padding-right:calc(var(--spacing)*2)}.pb-2{padding-bottom:calc(var(--spacing)*2)}.pb-4{padding-bottom:calc(var(--spacing)*4)}.pl-2{padding-left:calc(var(--spacing)*2)}.pl-8{padding-left:calc(var(--spacing)*8)}.pl-10{padding-left:calc(var(--spacing)*10)}.text-center{text-align:center}.text-left{text-align:left}.text-right{text-align:right}.align-middle{vertical-align:middle}.font-mono{font-family:var(--font-mono)}.text-2xl{font-size:var(--text-2xl);line-height:var(--tw-leading,var(--text-2xl--line-height))}.text-3xl{font-size:var(--text-3xl);line-height:var(--tw-leading,var(--text-3xl--line-height))}.text-4xl{font-size:var(--text-4xl);line-height:var(--tw-leading,var(--text-4xl--line-height))}.text-base{font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height))}.text-lg{font-size:var(--text-lg);line-height:var(--tw-leading,var(--text-lg--line-height))}.text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.text-xl{font-size:var(--text-xl);line-height:var(--tw-leading,var(--text-xl--line-height))}.text-xs{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.text-\[10px\]{font-size:10px}.text-\[11px\]{font-size:11px}.leading-none{--tw-leading:1;line-height:1}.leading-relaxed{--tw-leading:var(--leading-relaxed);line-height:var(--leading-relaxed)}.font-bold{--tw-font-weight:var(--font-weight-bold);font-weight:var(--font-weight-bold)}.font-medium{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.font-semibold{--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold)}.tracking-tight{--tw-tracking:var(--tracking-tight);letter-spacing:var(--tracking-tight)}.text-wrap{text-wrap:wrap}.break-all{word-break:break-all}.text-clip{text-overflow:clip}.text-ellipsis{text-overflow:ellipsis}.whitespace-nowrap{white-space:nowrap}.whitespace-pre-wrap{white-space:pre-wrap}.text-\[\#00CED1\]{color:#00ced1}.text-\[\#07C160\]{color:#07c160}.text-\[\#07C160\]\/60{color:#07c16099}.text-\[\#07C160\]\/70{color:#07c160b3}.text-\[\#07C160\]\/80{color:#07c160cc}.text-\[\#26A17B\]{color:#26a17b}.text-\[\#38bdac\]{color:#38bdac}.text-\[\#38bdac\]\/40{color:#38bdac66}.text-\[\#169BD7\]{color:#169bd7}.text-\[\#1677FF\]{color:#1677ff}.text-\[\#FFD700\]{color:gold}.text-amber-400{color:var(--color-amber-400)}.text-black{color:var(--color-black)}.text-blue-300{color:var(--color-blue-300)}.text-blue-300\/60{color:#90c5ff99}@supports (color:color-mix(in lab,red,red)){.text-blue-300\/60{color:color-mix(in oklab,var(--color-blue-300)60%,transparent)}}.text-blue-400{color:var(--color-blue-400)}.text-cyan-400{color:var(--color-cyan-400)}.text-gray-200{color:var(--color-gray-200)}.text-gray-300{color:var(--color-gray-300)}.text-gray-400{color:var(--color-gray-400)}.text-gray-500{color:var(--color-gray-500)}.text-gray-600{color:var(--color-gray-600)}.text-green-400{color:var(--color-green-400)}.text-green-500{color:var(--color-green-500)}.text-orange-300{color:var(--color-orange-300)}.text-orange-300\/60{color:#ffb96d99}@supports (color:color-mix(in lab,red,red)){.text-orange-300\/60{color:color-mix(in oklab,var(--color-orange-300)60%,transparent)}}.text-orange-400{color:var(--color-orange-400)}.text-purple-400{color:var(--color-purple-400)}.text-red-400{color:var(--color-red-400)}.text-white{color:var(--color-white)}.text-white\/40{color:#fff6}@supports (color:color-mix(in lab,red,red)){.text-white\/40{color:color-mix(in oklab,var(--color-white)40%,transparent)}}.text-white\/60{color:#fff9}@supports (color:color-mix(in lab,red,red)){.text-white\/60{color:color-mix(in oklab,var(--color-white)60%,transparent)}}.text-white\/70{color:#ffffffb3}@supports (color:color-mix(in lab,red,red)){.text-white\/70{color:color-mix(in oklab,var(--color-white)70%,transparent)}}.text-white\/80{color:#fffc}@supports (color:color-mix(in lab,red,red)){.text-white\/80{color:color-mix(in oklab,var(--color-white)80%,transparent)}}.text-yellow-400{color:var(--color-yellow-400)}.capitalize{text-transform:capitalize}.lowercase{text-transform:lowercase}.normal-case{text-transform:none}.uppercase{text-transform:uppercase}.italic{font-style:italic}.not-italic{font-style:normal}.diagonal-fractions{--tw-numeric-fraction:diagonal-fractions;font-variant-numeric:var(--tw-ordinal,)var(--tw-slashed-zero,)var(--tw-numeric-figure,)var(--tw-numeric-spacing,)var(--tw-numeric-fraction,)}.lining-nums{--tw-numeric-figure:lining-nums;font-variant-numeric:var(--tw-ordinal,)var(--tw-slashed-zero,)var(--tw-numeric-figure,)var(--tw-numeric-spacing,)var(--tw-numeric-fraction,)}.oldstyle-nums{--tw-numeric-figure:oldstyle-nums;font-variant-numeric:var(--tw-ordinal,)var(--tw-slashed-zero,)var(--tw-numeric-figure,)var(--tw-numeric-spacing,)var(--tw-numeric-fraction,)}.ordinal{--tw-ordinal:ordinal;font-variant-numeric:var(--tw-ordinal,)var(--tw-slashed-zero,)var(--tw-numeric-figure,)var(--tw-numeric-spacing,)var(--tw-numeric-fraction,)}.proportional-nums{--tw-numeric-spacing:proportional-nums;font-variant-numeric:var(--tw-ordinal,)var(--tw-slashed-zero,)var(--tw-numeric-figure,)var(--tw-numeric-spacing,)var(--tw-numeric-fraction,)}.slashed-zero{--tw-slashed-zero:slashed-zero;font-variant-numeric:var(--tw-ordinal,)var(--tw-slashed-zero,)var(--tw-numeric-figure,)var(--tw-numeric-spacing,)var(--tw-numeric-fraction,)}.stacked-fractions{--tw-numeric-fraction:stacked-fractions;font-variant-numeric:var(--tw-ordinal,)var(--tw-slashed-zero,)var(--tw-numeric-figure,)var(--tw-numeric-spacing,)var(--tw-numeric-fraction,)}.tabular-nums{--tw-numeric-spacing:tabular-nums;font-variant-numeric:var(--tw-ordinal,)var(--tw-slashed-zero,)var(--tw-numeric-figure,)var(--tw-numeric-spacing,)var(--tw-numeric-fraction,)}.normal-nums{font-variant-numeric:normal}.line-through{text-decoration-line:line-through}.no-underline{text-decoration-line:none}.overline{text-decoration-line:overline}.underline{text-decoration-line:underline}.underline-offset-4{text-underline-offset:4px}.antialiased{-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.subpixel-antialiased{-webkit-font-smoothing:auto;-moz-osx-font-smoothing:auto}.opacity-0{opacity:0}.opacity-50{opacity:.5}.opacity-70{opacity:.7}.shadow{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a),0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-lg{--tw-shadow:0 10px 15px -3px var(--tw-shadow-color,#0000001a),0 4px 6px -4px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-md{--tw-shadow:0 4px 6px -1px var(--tw-shadow-color,#0000001a),0 2px 4px -2px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-sm{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a),0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-xl{--tw-shadow:0 20px 25px -5px var(--tw-shadow-color,#0000001a),0 8px 10px -6px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-xs{--tw-shadow:0 1px 2px 0 var(--tw-shadow-color,#0000000d);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.ring-0{--tw-ring-shadow:var(--tw-ring-inset,)0 0 0 calc(0px + var(--tw-ring-offset-width))var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.ring-1{--tw-ring-shadow:var(--tw-ring-inset,)0 0 0 calc(1px + var(--tw-ring-offset-width))var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.inset-ring{--tw-inset-ring-shadow:inset 0 0 0 1px var(--tw-inset-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.ring-\[\#38bdac\]{--tw-ring-color:#38bdac}.outline{outline-style:var(--tw-outline-style);outline-width:1px}.blur{--tw-blur:blur(8px);filter:var(--tw-blur,)var(--tw-brightness,)var(--tw-contrast,)var(--tw-grayscale,)var(--tw-hue-rotate,)var(--tw-invert,)var(--tw-saturate,)var(--tw-sepia,)var(--tw-drop-shadow,)}.blur-3xl{--tw-blur:blur(var(--blur-3xl));filter:var(--tw-blur,)var(--tw-brightness,)var(--tw-contrast,)var(--tw-grayscale,)var(--tw-hue-rotate,)var(--tw-invert,)var(--tw-saturate,)var(--tw-sepia,)var(--tw-drop-shadow,)}.drop-shadow{--tw-drop-shadow-size:drop-shadow(0 1px 2px var(--tw-drop-shadow-color,#0000001a))drop-shadow(0 1px 1px var(--tw-drop-shadow-color,#0000000f));--tw-drop-shadow:drop-shadow(0 1px 2px #0000001a)drop-shadow(0 1px 1px #0000000f);filter:var(--tw-blur,)var(--tw-brightness,)var(--tw-contrast,)var(--tw-grayscale,)var(--tw-hue-rotate,)var(--tw-invert,)var(--tw-saturate,)var(--tw-sepia,)var(--tw-drop-shadow,)}.filter{filter:var(--tw-blur,)var(--tw-brightness,)var(--tw-contrast,)var(--tw-grayscale,)var(--tw-hue-rotate,)var(--tw-invert,)var(--tw-saturate,)var(--tw-sepia,)var(--tw-drop-shadow,)}.filter\!{filter:var(--tw-blur,)var(--tw-brightness,)var(--tw-contrast,)var(--tw-grayscale,)var(--tw-hue-rotate,)var(--tw-invert,)var(--tw-saturate,)var(--tw-sepia,)var(--tw-drop-shadow,)!important}.backdrop-blur{--tw-backdrop-blur:blur(8px);-webkit-backdrop-filter:var(--tw-backdrop-blur,)var(--tw-backdrop-brightness,)var(--tw-backdrop-contrast,)var(--tw-backdrop-grayscale,)var(--tw-backdrop-hue-rotate,)var(--tw-backdrop-invert,)var(--tw-backdrop-opacity,)var(--tw-backdrop-saturate,)var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,)var(--tw-backdrop-brightness,)var(--tw-backdrop-contrast,)var(--tw-backdrop-grayscale,)var(--tw-backdrop-hue-rotate,)var(--tw-backdrop-invert,)var(--tw-backdrop-opacity,)var(--tw-backdrop-saturate,)var(--tw-backdrop-sepia,)}.backdrop-blur-xl{--tw-backdrop-blur:blur(var(--blur-xl));-webkit-backdrop-filter:var(--tw-backdrop-blur,)var(--tw-backdrop-brightness,)var(--tw-backdrop-contrast,)var(--tw-backdrop-grayscale,)var(--tw-backdrop-hue-rotate,)var(--tw-backdrop-invert,)var(--tw-backdrop-opacity,)var(--tw-backdrop-saturate,)var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,)var(--tw-backdrop-brightness,)var(--tw-backdrop-contrast,)var(--tw-backdrop-grayscale,)var(--tw-backdrop-hue-rotate,)var(--tw-backdrop-invert,)var(--tw-backdrop-opacity,)var(--tw-backdrop-saturate,)var(--tw-backdrop-sepia,)}.backdrop-grayscale{--tw-backdrop-grayscale:grayscale(100%);-webkit-backdrop-filter:var(--tw-backdrop-blur,)var(--tw-backdrop-brightness,)var(--tw-backdrop-contrast,)var(--tw-backdrop-grayscale,)var(--tw-backdrop-hue-rotate,)var(--tw-backdrop-invert,)var(--tw-backdrop-opacity,)var(--tw-backdrop-saturate,)var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,)var(--tw-backdrop-brightness,)var(--tw-backdrop-contrast,)var(--tw-backdrop-grayscale,)var(--tw-backdrop-hue-rotate,)var(--tw-backdrop-invert,)var(--tw-backdrop-opacity,)var(--tw-backdrop-saturate,)var(--tw-backdrop-sepia,)}.backdrop-invert{--tw-backdrop-invert:invert(100%);-webkit-backdrop-filter:var(--tw-backdrop-blur,)var(--tw-backdrop-brightness,)var(--tw-backdrop-contrast,)var(--tw-backdrop-grayscale,)var(--tw-backdrop-hue-rotate,)var(--tw-backdrop-invert,)var(--tw-backdrop-opacity,)var(--tw-backdrop-saturate,)var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,)var(--tw-backdrop-brightness,)var(--tw-backdrop-contrast,)var(--tw-backdrop-grayscale,)var(--tw-backdrop-hue-rotate,)var(--tw-backdrop-invert,)var(--tw-backdrop-opacity,)var(--tw-backdrop-saturate,)var(--tw-backdrop-sepia,)}.backdrop-sepia{--tw-backdrop-sepia:sepia(100%);-webkit-backdrop-filter:var(--tw-backdrop-blur,)var(--tw-backdrop-brightness,)var(--tw-backdrop-contrast,)var(--tw-backdrop-grayscale,)var(--tw-backdrop-hue-rotate,)var(--tw-backdrop-invert,)var(--tw-backdrop-opacity,)var(--tw-backdrop-saturate,)var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,)var(--tw-backdrop-brightness,)var(--tw-backdrop-contrast,)var(--tw-backdrop-grayscale,)var(--tw-backdrop-hue-rotate,)var(--tw-backdrop-invert,)var(--tw-backdrop-opacity,)var(--tw-backdrop-saturate,)var(--tw-backdrop-sepia,)}.backdrop-filter{-webkit-backdrop-filter:var(--tw-backdrop-blur,)var(--tw-backdrop-brightness,)var(--tw-backdrop-contrast,)var(--tw-backdrop-grayscale,)var(--tw-backdrop-hue-rotate,)var(--tw-backdrop-invert,)var(--tw-backdrop-opacity,)var(--tw-backdrop-saturate,)var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,)var(--tw-backdrop-brightness,)var(--tw-backdrop-contrast,)var(--tw-backdrop-grayscale,)var(--tw-backdrop-hue-rotate,)var(--tw-backdrop-invert,)var(--tw-backdrop-opacity,)var(--tw-backdrop-saturate,)var(--tw-backdrop-sepia,)}.transition{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to,opacity,box-shadow,transform,translate,scale,rotate,filter,-webkit-backdrop-filter,backdrop-filter,display,content-visibility,overlay,pointer-events;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition\!{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to,opacity,box-shadow,transform,translate,scale,rotate,filter,-webkit-backdrop-filter,backdrop-filter,display,content-visibility,overlay,pointer-events!important;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function))!important;transition-duration:var(--tw-duration,var(--default-transition-duration))!important}.transition-all{transition-property:all;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-colors{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-opacity{transition-property:opacity;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-transform{transition-property:transform,translate,scale,rotate;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.outline-none{--tw-outline-style:none;outline-style:none}.select-none{-webkit-user-select:none;user-select:none}:where(.divide-x-reverse>:not(:last-child)){--tw-divide-x-reverse:1}.ring-inset{--tw-ring-inset:inset}@media(hover:hover){.group-hover\:text-\[\#38bdac\]:is(:where(.group):hover *){color:#38bdac}.group-hover\:opacity-100:is(:where(.group):hover *){opacity:1}}.peer-disabled\:cursor-not-allowed:is(:where(.peer):disabled~*){cursor:not-allowed}.peer-disabled\:opacity-70:is(:where(.peer):disabled~*){opacity:.7}.placeholder\:text-gray-500::placeholder{color:var(--color-gray-500)}.last\:border-b-0:last-child{border-bottom-style:var(--tw-border-style);border-bottom-width:0}@media(hover:hover){.hover\:border-\[\#38bdac\]\/30:hover{border-color:#38bdac4d}.hover\:border-\[\#38bdac\]\/50:hover{border-color:#38bdac80}.hover\:bg-\[\#0a1628\]:hover{background-color:#0a1628}.hover\:bg-\[\#1a3050\]:hover{background-color:#1a3050}.hover\:bg-\[\#2da396\]:hover{background-color:#2da396}.hover\:bg-\[\#06AD51\]:hover{background-color:#06ad51}.hover\:bg-\[\#07C160\]\/10:hover{background-color:#07c1601a}.hover\:bg-\[\#20B2AA\]:hover{background-color:#20b2aa}.hover\:bg-\[\#38bdac\]\/10:hover{background-color:#38bdac1a}.hover\:bg-\[\#38bdac\]\/20:hover{background-color:#38bdac33}.hover\:bg-\[\#162840\]:hover{background-color:#162840}.hover\:bg-amber-500\/20:hover{background-color:#f99c0033}@supports (color:color-mix(in lab,red,red)){.hover\:bg-amber-500\/20:hover{background-color:color-mix(in oklab,var(--color-amber-500)20%,transparent)}}.hover\:bg-blue-400\/10:hover{background-color:#54a2ff1a}@supports (color:color-mix(in lab,red,red)){.hover\:bg-blue-400\/10:hover{background-color:color-mix(in oklab,var(--color-blue-400)10%,transparent)}}.hover\:bg-blue-500\/20:hover{background-color:#3080ff33}@supports (color:color-mix(in lab,red,red)){.hover\:bg-blue-500\/20:hover{background-color:color-mix(in oklab,var(--color-blue-500)20%,transparent)}}.hover\:bg-gray-500:hover{background-color:var(--color-gray-500)}.hover\:bg-gray-700\/50:hover{background-color:#36415380}@supports (color:color-mix(in lab,red,red)){.hover\:bg-gray-700\/50:hover{background-color:color-mix(in oklab,var(--color-gray-700)50%,transparent)}}.hover\:bg-gray-800:hover{background-color:var(--color-gray-800)}.hover\:bg-green-500\/20:hover{background-color:#00c75833}@supports (color:color-mix(in lab,red,red)){.hover\:bg-green-500\/20:hover{background-color:color-mix(in oklab,var(--color-green-500)20%,transparent)}}.hover\:bg-green-700:hover{background-color:var(--color-green-700)}.hover\:bg-orange-500\/20:hover{background-color:#fe6e0033}@supports (color:color-mix(in lab,red,red)){.hover\:bg-orange-500\/20:hover{background-color:color-mix(in oklab,var(--color-orange-500)20%,transparent)}}.hover\:bg-purple-500\/20:hover{background-color:#ac4bff33}@supports (color:color-mix(in lab,red,red)){.hover\:bg-purple-500\/20:hover{background-color:color-mix(in oklab,var(--color-purple-500)20%,transparent)}}.hover\:bg-red-500\/10:hover{background-color:#fb2c361a}@supports (color:color-mix(in lab,red,red)){.hover\:bg-red-500\/10:hover{background-color:color-mix(in oklab,var(--color-red-500)10%,transparent)}}.hover\:bg-red-500\/20:hover{background-color:#fb2c3633}@supports (color:color-mix(in lab,red,red)){.hover\:bg-red-500\/20:hover{background-color:color-mix(in oklab,var(--color-red-500)20%,transparent)}}.hover\:bg-white\/5:hover{background-color:#ffffff0d}@supports (color:color-mix(in lab,red,red)){.hover\:bg-white\/5:hover{background-color:color-mix(in oklab,var(--color-white)5%,transparent)}}.hover\:bg-white\/20:hover{background-color:#fff3}@supports (color:color-mix(in lab,red,red)){.hover\:bg-white\/20:hover{background-color:color-mix(in oklab,var(--color-white)20%,transparent)}}.hover\:bg-yellow-400\/10:hover{background-color:#fac8001a}@supports (color:color-mix(in lab,red,red)){.hover\:bg-yellow-400\/10:hover{background-color:color-mix(in oklab,var(--color-yellow-400)10%,transparent)}}.hover\:bg-yellow-500\/20:hover{background-color:#edb20033}@supports (color:color-mix(in lab,red,red)){.hover\:bg-yellow-500\/20:hover{background-color:color-mix(in oklab,var(--color-yellow-500)20%,transparent)}}.hover\:text-\[\#38bdac\]:hover{color:#38bdac}.hover\:text-blue-400:hover{color:var(--color-blue-400)}.hover\:text-red-300:hover{color:var(--color-red-300)}.hover\:text-red-400:hover{color:var(--color-red-400)}.hover\:text-white:hover{color:var(--color-white)}.hover\:text-yellow-400:hover{color:var(--color-yellow-400)}.hover\:underline:hover{text-decoration-line:underline}.hover\:opacity-100:hover{opacity:1}}.focus\:border-\[\#38bdac\]:focus{border-color:#38bdac}.focus\:bg-\[\#38bdac\]\/20:focus{background-color:#38bdac33}.focus\:ring-2:focus{--tw-ring-shadow:var(--tw-ring-inset,)0 0 0 calc(2px + var(--tw-ring-offset-width))var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.focus\:ring-\[\#38bdac\]:focus{--tw-ring-color:#38bdac}.focus\:ring-offset-2:focus{--tw-ring-offset-width:2px;--tw-ring-offset-shadow:var(--tw-ring-inset,)0 0 0 var(--tw-ring-offset-width)var(--tw-ring-offset-color)}.focus\:outline-none:focus{--tw-outline-style:none;outline-style:none}.focus-visible\:ring-2:focus-visible{--tw-ring-shadow:var(--tw-ring-inset,)0 0 0 calc(2px + var(--tw-ring-offset-width))var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.focus-visible\:ring-\[3px\]:focus-visible{--tw-ring-shadow:var(--tw-ring-inset,)0 0 0 calc(3px + var(--tw-ring-offset-width))var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.focus-visible\:ring-\[\#38bdac\]:focus-visible{--tw-ring-color:#38bdac}.focus-visible\:ring-offset-2:focus-visible{--tw-ring-offset-width:2px;--tw-ring-offset-shadow:var(--tw-ring-inset,)0 0 0 var(--tw-ring-offset-width)var(--tw-ring-offset-color)}.focus-visible\:ring-offset-\[\#0a1628\]:focus-visible{--tw-ring-offset-color:#0a1628}.focus-visible\:outline-none:focus-visible{--tw-outline-style:none;outline-style:none}.disabled\:pointer-events-none:disabled{pointer-events:none}.disabled\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\:opacity-40:disabled{opacity:.4}.disabled\:opacity-50:disabled{opacity:.5}.has-\[\>svg\]\:px-2\.5:has(>svg){padding-inline:calc(var(--spacing)*2.5)}.has-\[\>svg\]\:px-3:has(>svg){padding-inline:calc(var(--spacing)*3)}.has-\[\>svg\]\:px-4:has(>svg){padding-inline:calc(var(--spacing)*4)}.data-\[disabled\]\:pointer-events-none[data-disabled]{pointer-events:none}.data-\[disabled\]\:opacity-50[data-disabled]{opacity:.5}.data-\[side\=bottom\]\:translate-y-1[data-side=bottom]{--tw-translate-y:calc(var(--spacing)*1);translate:var(--tw-translate-x)var(--tw-translate-y)}.data-\[state\=active\]\:bg-\[\#07C160\]\/20[data-state=active]{background-color:#07c16033}.data-\[state\=active\]\:bg-\[\#26A17B\]\/20[data-state=active]{background-color:#26a17b33}.data-\[state\=active\]\:bg-\[\#38bdac\]\/20[data-state=active]{background-color:#38bdac33}.data-\[state\=active\]\:bg-\[\#1677FF\]\/20[data-state=active]{background-color:#1677ff33}.data-\[state\=active\]\:bg-\[\#003087\]\/20[data-state=active]{background-color:#00308733}.data-\[state\=active\]\:text-\[\#07C160\][data-state=active]{color:#07c160}.data-\[state\=active\]\:text-\[\#26A17B\][data-state=active]{color:#26a17b}.data-\[state\=active\]\:text-\[\#38bdac\][data-state=active]{color:#38bdac}.data-\[state\=active\]\:text-\[\#169BD7\][data-state=active]{color:#169bd7}.data-\[state\=active\]\:text-\[\#1677FF\][data-state=active]{color:#1677ff}.data-\[state\=active\]\:shadow[data-state=active]{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a),0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.data-\[state\=checked\]\:translate-x-4[data-state=checked]{--tw-translate-x:calc(var(--spacing)*4);translate:var(--tw-translate-x)var(--tw-translate-y)}.data-\[state\=checked\]\:bg-\[\#38bdac\][data-state=checked]{background-color:#38bdac}.data-\[state\=unchecked\]\:translate-x-0[data-state=unchecked]{--tw-translate-x:calc(var(--spacing)*0);translate:var(--tw-translate-x)var(--tw-translate-y)}.data-\[state\=unchecked\]\:bg-gray-600[data-state=unchecked]{background-color:var(--color-gray-600)}@media(min-width:40rem){.sm\:max-w-lg{max-width:var(--container-lg)}.sm\:flex-row{flex-direction:row}.sm\:justify-end{justify-content:flex-end}.sm\:text-left{text-align:left}}@media(min-width:48rem){.md\:col-span-2{grid-column:span 2/span 2}.md\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.md\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.md\:text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}}@media(min-width:64rem){.lg\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.lg\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}}.\[\&_svg\]\:pointer-events-none svg{pointer-events:none}.\[\&_svg\]\:shrink-0 svg{flex-shrink:0}.\[\&_svg\:not\(\[class\*\=\'size-\'\]\)\]\:size-4 svg:not([class*=size-]){width:calc(var(--spacing)*4);height:calc(var(--spacing)*4)}.\[\&_tr\]\:border-b tr{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}.\[\&_tr\:last-child\]\:border-0 tr:last-child{border-style:var(--tw-border-style);border-width:0}.\[\&\:has\(\[role\=checkbox\]\)\]\:pr-0:has([role=checkbox]){padding-right:calc(var(--spacing)*0)}.\[\&\>span\]\:line-clamp-1>span{-webkit-line-clamp:1;-webkit-box-orient:vertical;display:-webkit-box;overflow:hidden}}:root{--background:oklch(14.5% 0 0);--foreground:oklch(98.5% 0 0);--card:oklch(20% .02 240);--card-foreground:oklch(98.5% 0 0);--popover:oklch(20% .02 240);--popover-foreground:oklch(98.5% 0 0);--primary:oklch(65% .15 180);--primary-foreground:oklch(20% 0 0);--secondary:oklch(27% 0 0);--secondary-foreground:oklch(98.5% 0 0);--muted:oklch(27% 0 0);--muted-foreground:oklch(65% 0 0);--accent:oklch(27% 0 0);--accent-foreground:oklch(98.5% 0 0);--destructive:oklch(55% .2 25);--destructive-foreground:oklch(98.5% 0 0);--border:oklch(35% 0 0);--input:oklch(35% 0 0);--ring:oklch(65% .15 180);--radius:.625rem}body{font-family:var(--font-sans);color:var(--foreground);background:#0a1628}@property --tw-translate-x{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-y{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-z{syntax:"*";inherits:false;initial-value:0}@property --tw-scale-x{syntax:"*";inherits:false;initial-value:1}@property --tw-scale-y{syntax:"*";inherits:false;initial-value:1}@property --tw-scale-z{syntax:"*";inherits:false;initial-value:1}@property --tw-rotate-x{syntax:"*";inherits:false}@property --tw-rotate-y{syntax:"*";inherits:false}@property --tw-rotate-z{syntax:"*";inherits:false}@property --tw-skew-x{syntax:"*";inherits:false}@property --tw-skew-y{syntax:"*";inherits:false}@property --tw-pan-x{syntax:"*";inherits:false}@property --tw-pan-y{syntax:"*";inherits:false}@property --tw-pinch-zoom{syntax:"*";inherits:false}@property --tw-space-y-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-space-x-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-divide-x-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-divide-y-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-gradient-position{syntax:"*";inherits:false}@property --tw-gradient-from{syntax:"";inherits:false;initial-value:#0000}@property --tw-gradient-via{syntax:"";inherits:false;initial-value:#0000}@property --tw-gradient-to{syntax:"";inherits:false;initial-value:#0000}@property --tw-gradient-stops{syntax:"*";inherits:false}@property --tw-gradient-via-stops{syntax:"*";inherits:false}@property --tw-gradient-from-position{syntax:"";inherits:false;initial-value:0%}@property --tw-gradient-via-position{syntax:"";inherits:false;initial-value:50%}@property --tw-gradient-to-position{syntax:"";inherits:false;initial-value:100%}@property --tw-leading{syntax:"*";inherits:false}@property --tw-font-weight{syntax:"*";inherits:false}@property --tw-tracking{syntax:"*";inherits:false}@property --tw-ordinal{syntax:"*";inherits:false}@property --tw-slashed-zero{syntax:"*";inherits:false}@property --tw-numeric-figure{syntax:"*";inherits:false}@property --tw-numeric-spacing{syntax:"*";inherits:false}@property --tw-numeric-fraction{syntax:"*";inherits:false}@property --tw-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:"*";inherits:false}@property --tw-shadow-alpha{syntax:"";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:"*";inherits:false}@property --tw-inset-shadow-alpha{syntax:"";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:"*";inherits:false}@property --tw-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:"*";inherits:false}@property --tw-inset-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:"*";inherits:false}@property --tw-ring-offset-width{syntax:"";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:"*";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-outline-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-blur{syntax:"*";inherits:false}@property --tw-brightness{syntax:"*";inherits:false}@property --tw-contrast{syntax:"*";inherits:false}@property --tw-grayscale{syntax:"*";inherits:false}@property --tw-hue-rotate{syntax:"*";inherits:false}@property --tw-invert{syntax:"*";inherits:false}@property --tw-opacity{syntax:"*";inherits:false}@property --tw-saturate{syntax:"*";inherits:false}@property --tw-sepia{syntax:"*";inherits:false}@property --tw-drop-shadow{syntax:"*";inherits:false}@property --tw-drop-shadow-color{syntax:"*";inherits:false}@property --tw-drop-shadow-alpha{syntax:"";inherits:false;initial-value:100%}@property --tw-drop-shadow-size{syntax:"*";inherits:false}@property --tw-backdrop-blur{syntax:"*";inherits:false}@property --tw-backdrop-brightness{syntax:"*";inherits:false}@property --tw-backdrop-contrast{syntax:"*";inherits:false}@property --tw-backdrop-grayscale{syntax:"*";inherits:false}@property --tw-backdrop-hue-rotate{syntax:"*";inherits:false}@property --tw-backdrop-invert{syntax:"*";inherits:false}@property --tw-backdrop-opacity{syntax:"*";inherits:false}@property --tw-backdrop-saturate{syntax:"*";inherits:false}@property --tw-backdrop-sepia{syntax:"*";inherits:false}@keyframes spin{to{transform:rotate(360deg)}}@keyframes pulse{50%{opacity:.5}} diff --git a/soul-admin/dist/assets/index-gaoGu1RS.js b/soul-admin/dist/assets/index-gaoGu1RS.js deleted file mode 100644 index 28c30607..00000000 --- a/soul-admin/dist/assets/index-gaoGu1RS.js +++ /dev/null @@ -1,460 +0,0 @@ -function Vy(r,a){for(var l=0;li[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 Rc={exports:{}},ka={},_c={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 zh;function Wy(){if(zh)return De;zh=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"),x=Symbol.for("react.suspense"),v=Symbol.for("react.memo"),g=Symbol.for("react.lazy"),y=Symbol.iterator;function C(L){return L===null||typeof L!="object"?null:(L=y&&L[y]||L["@@iterator"],typeof L=="function"?L:null)}var E={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},k=Object.assign,j={};function b(L,R,ee){this.props=L,this.context=R,this.refs=j,this.updater=ee||E}b.prototype.isReactComponent={},b.prototype.setState=function(L,R){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,R,"setState")},b.prototype.forceUpdate=function(L){this.updater.enqueueForceUpdate(this,L,"forceUpdate")};function S(){}S.prototype=b.prototype;function P(L,R,ee){this.props=L,this.context=R,this.refs=j,this.updater=ee||E}var N=P.prototype=new S;N.constructor=P,k(N,b.prototype),N.isPureReactComponent=!0;var T=Array.isArray,U=Object.prototype.hasOwnProperty,G={current:null},D={key:!0,ref:!0,__self:!0,__source:!0};function V(L,R,ee){var q,le={},ue=null,Q=null;if(R!=null)for(q in R.ref!==void 0&&(Q=R.ref),R.key!==void 0&&(ue=""+R.key),R)U.call(R,q)&&!D.hasOwnProperty(q)&&(le[q]=R[q]);var ie=arguments.length-2;if(ie===1)le.children=ee;else if(1>>1,R=I[L];if(0>>1;Lc(le,ne))uec(Q,le)?(I[L]=Q,I[ue]=ne,L=ue):(I[L]=le,I[q]=ne,L=q);else if(uec(Q,ne))I[L]=Q,I[ue]=ne,L=ue;else break e}}return X}function c(I,X){var ne=I.sortIndex-X.sortIndex;return ne!==0?ne:I.id-X.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 x=[],v=[],g=1,y=null,C=3,E=!1,k=!1,j=!1,b=typeof setTimeout=="function"?setTimeout:null,S=typeof clearTimeout=="function"?clearTimeout:null,P=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function N(I){for(var X=l(v);X!==null;){if(X.callback===null)i(v);else if(X.startTime<=I)i(v),X.sortIndex=X.expirationTime,a(x,X);else break;X=l(v)}}function T(I){if(j=!1,N(I),!k)if(l(x)!==null)k=!0,K(U);else{var X=l(v);X!==null&&H(T,X.startTime-I)}}function U(I,X){k=!1,j&&(j=!1,S(V),V=-1),E=!0;var ne=C;try{for(N(X),y=l(x);y!==null&&(!(y.expirationTime>X)||I&&!de());){var L=y.callback;if(typeof L=="function"){y.callback=null,C=y.priorityLevel;var R=L(y.expirationTime<=X);X=r.unstable_now(),typeof R=="function"?y.callback=R:y===l(x)&&i(x),N(X)}else i(x);y=l(x)}if(y!==null)var ee=!0;else{var q=l(v);q!==null&&H(T,q.startTime-X),ee=!1}return ee}finally{y=null,C=ne,E=!1}}var G=!1,D=null,V=-1,se=5,he=-1;function de(){return!(r.unstable_now()-heI||125L?(I.sortIndex=ne,a(v,I),l(x)===null&&I===l(v)&&(j?(S(V),V=-1):j=!0,H(T,ne-L))):(I.sortIndex=R,a(x,I),k||E||(k=!0,K(U))),I},r.unstable_shouldYield=de,r.unstable_wrapCallback=function(I){var X=C;return function(){var ne=C;C=X;try{return I.apply(this,arguments)}finally{C=ne}}}})(Ac)),Ac}var Wh;function Qy(){return Wh||(Wh=1,Ic.exports=Gy()),Ic.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 Hh;function Yy(){if(Hh)return Dt;Hh=1;var r=bu(),a=Qy();function l(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,s=1;s"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),x=Object.prototype.hasOwnProperty,v=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,g={},y={};function C(e){return x.call(y,e)?!0:x.call(g,e)?!1:v.test(e)?y[e]=!0:(g[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 j(e,t,s,o,u,h,w){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=w}var b={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){b[e]=new j(e,0,!1,e,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];b[t]=new j(t,1,!1,e[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(e){b[e]=new j(e,2,!1,e.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){b[e]=new j(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){b[e]=new j(e,3,!1,e.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(e){b[e]=new j(e,3,!0,e,null,!1,!1)}),["capture","download"].forEach(function(e){b[e]=new j(e,4,!1,e,null,!1,!1)}),["cols","rows","size","span"].forEach(function(e){b[e]=new j(e,6,!1,e,null,!1,!1)}),["rowSpan","start"].forEach(function(e){b[e]=new j(e,5,!1,e.toLowerCase(),null,!1,!1)});var S=/[\-:]([a-z])/g;function P(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(S,P);b[t]=new j(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(S,P);b[t]=new j(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(S,P);b[t]=new j(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(e){b[e]=new j(e,1,!1,e.toLowerCase(),null,!1,!1)}),b.xlinkHref=new j("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(e){b[e]=new j(e,1,!1,e.toLowerCase(),null,!0,!0)});function N(e,t,s,o){var u=b.hasOwnProperty(t)?b[t]:null;(u!==null?u.type!==0:o||!(2_||u[w]!==h[_]){var A=` -`+u[w].replace(" at new "," at ");return e.displayName&&A.includes("")&&(A=A.replace("",e.displayName)),A}while(1<=w&&0<=_);break}}}finally{ee=!1,Error.prepareStackTrace=s}return(e=e?e.displayName||e.name:"")?R(e):""}function le(e){switch(e.tag){case 5:return R(e.type);case 16:return R("Lazy");case 13:return R("Suspense");case 19:return R("SuspenseList");case 0:case 2:case 15:return e=q(e.type,!1),e;case 11:return e=q(e.type.render,!1),e;case 1:return e=q(e.type,!0),e;default:return""}}function ue(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 D:return"Fragment";case G:return"Portal";case se:return"Profiler";case V:return"StrictMode";case Y:return"Suspense";case B:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case de:return(e.displayName||"Context")+".Consumer";case he: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 z:return t=e.displayName||null,t!==null?t:ue(e.type)||"Memo";case K:t=e._payload,e=e._init;try{return ue(e(t))}catch{}}return null}function Q(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 ue(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 ie(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function je(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function ye(e){var t=je(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(w){o=""+w,h.call(this,w)}}),Object.defineProperty(e,t,{enumerable:s.enumerable}),{getValue:function(){return o},setValue:function(w){o=""+w},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Pe(e){e._valueTracker||(e._valueTracker=ye(e))}function Ie(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var s=t.getValue(),o="";return e&&(o=je(e)?e.checked?"true":"false":e.value),e=o,e!==s?(t.setValue(e),!0):!1}function rt(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 it(e,t){var s=t.checked;return ne({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:s??e._wrapperState.initialChecked})}function Kt(e,t){var s=t.defaultValue==null?"":t.defaultValue,o=t.checked!=null?t.checked:t.defaultChecked;s=ie(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 Gt(e,t){t=t.checked,t!=null&&N(e,"checked",t,!1)}function _t(e,t){Gt(e,t);var s=ie(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")?Ot(e,t.type,s):t.hasOwnProperty("defaultValue")&&Ot(e,t.type,ie(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function In(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 Ot(e,t,s){(t!=="number"||rt(e.ownerDocument)!==e)&&(s==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+s&&(e.defaultValue=""+s))}var xn=Array.isArray;function Ft(e,t,s,o){if(e=e.options,t){t={};for(var u=0;u"+t.valueOf().toString()+"",t=An.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function gn(e,t){if(t){var s=e.firstChild;if(s&&s===e.lastChild&&s.nodeType===3){s.nodeValue=t;return}}e.textContent=t}var Vs={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},Gg=["Webkit","ms","Moz","O"];Object.keys(Vs).forEach(function(e){Gg.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Vs[t]=Vs[e]})});function Zu(e,t,s){return t==null||typeof t=="boolean"||t===""?"":s||typeof t!="number"||t===0||Vs.hasOwnProperty(e)&&Vs[e]?(""+t).trim():t+"px"}function ed(e,t){e=e.style;for(var s in t)if(t.hasOwnProperty(s)){var o=s.indexOf("--")===0,u=Zu(s,t[s],o);s==="float"&&(s="cssFloat"),o?e.setProperty(s,u):e[s]=u}}var Qg=ne({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 Bo(e,t){if(t){if(Qg[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 Uo(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 Vo=null;function Wo(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Ho=null,Jr=null,Zr=null;function td(e){if(e=da(e)){if(typeof Ho!="function")throw Error(l(280));var t=e.stateNode;t&&(t=cl(t),Ho(e.stateNode,e.type,t))}}function nd(e){Jr?Zr?Zr.push(e):Zr=[e]:Jr=e}function rd(){if(Jr){var e=Jr,t=Zr;if(Zr=Jr=null,td(e),t)for(e=0;e>>=0,e===0?32:31-(a0(e)/l0|0)|0}var Ha=64,Ka=4194304;function Gs(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 Ga(e,t){var s=e.pendingLanes;if(s===0)return 0;var o=0,u=e.suspendedLanes,h=e.pingedLanes,w=s&268435455;if(w!==0){var _=w&~u;_!==0?o=Gs(_):(h&=w,h!==0&&(o=Gs(h)))}else w=s&~u,w!==0?o=Gs(w):h!==0&&(o=Gs(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;0s;s++)t.push(e);return t}function Qs(e,t,s){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-rn(t),e[t]=s}function u0(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=na),Td=" ",Id=!1;function Ad(e,t){switch(e){case"keyup":return F0.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Md(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var ns=!1;function $0(e,t){switch(e){case"compositionend":return Md(t);case"keypress":return t.which!==32?null:(Id=!0,Td);case"textInput":return e=t.data,e===Td&&Id?null:e;default:return null}}function B0(e,t){if(ns)return e==="compositionend"||!ci&&Ad(e,t)?(e=Cd(),Ja=ri=Zn=null,ns=!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)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=Bd(s)}}function Vd(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Vd(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Wd(){for(var e=window,t=rt();t instanceof e.HTMLIFrameElement;){try{var s=typeof t.contentWindow.location.href=="string"}catch{s=!1}if(s)e=t.contentWindow;else break;t=rt(e.document)}return t}function fi(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 X0(e){var t=Wd(),s=e.focusedElem,o=e.selectionRange;if(t!==s&&s&&s.ownerDocument&&Vd(s.ownerDocument.documentElement,s)){if(o!==null&&fi(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=Ud(s,h);var w=Ud(s,o);u&&w&&(e.rangeCount!==1||e.anchorNode!==u.node||e.anchorOffset!==u.offset||e.focusNode!==w.node||e.focusOffset!==w.offset)&&(t=t.createRange(),t.setStart(u.node,u.offset),e.removeAllRanges(),h>o?(e.addRange(t),e.extend(w.node,w.offset)):(t.setEnd(w.node,w.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=document.documentMode,rs=null,hi=null,la=null,mi=!1;function Hd(e,t,s){var o=s.window===s?s.document:s.nodeType===9?s:s.ownerDocument;mi||rs==null||rs!==rt(o)||(o=rs,"selectionStart"in o&&fi(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}),la&&aa(la,o)||(la=o,o=ll(hi,"onSelect"),0is||(e.current=ki[is],ki[is]=null,is--)}function qe(e,t){is++,ki[is]=e.current,e.current=t}var rr={},Nt=nr(rr),Tt=nr(!1),_r=rr;function cs(e,t){var s=e.type.contextTypes;if(!s)return rr;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 It(e){return e=e.childContextTypes,e!=null}function ul(){Ze(Tt),Ze(Nt)}function lf(e,t,s){if(Nt.current!==rr)throw Error(l(168));qe(Nt,t),qe(Tt,s)}function of(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,Q(e)||"Unknown",u));return ne({},s,o)}function dl(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||rr,_r=Nt.current,qe(Nt,e),qe(Tt,Tt.current),!0}function cf(e,t,s){var o=e.stateNode;if(!o)throw Error(l(169));s?(e=of(e,t,_r),o.__reactInternalMemoizedMergedChildContext=e,Ze(Tt),Ze(Nt),qe(Nt,e)):Ze(Tt),qe(Tt,s)}var Ln=null,fl=!1,Ei=!1;function uf(e){Ln===null?Ln=[e]:Ln.push(e)}function iy(e){fl=!0,uf(e)}function sr(){if(!Ei&&Ln!==null){Ei=!0;var e=0,t=Ke;try{var s=Ln;for(Ke=1;e>=w,u-=w,Dn=1<<32-rn(t)+u|s<Te?(wt=Ee,Ee=null):wt=Ee.sibling;var $e=Z(F,Ee,$[Te],ae);if($e===null){Ee===null&&(Ee=wt);break}e&&Ee&&$e.alternate===null&&t(F,Ee),M=h($e,M,Te),ke===null?Ce=$e:ke.sibling=$e,ke=$e,Ee=wt}if(Te===$.length)return s(F,Ee),et&&Ir(F,Te),Ce;if(Ee===null){for(;Te<$.length;Te++)Ee=re(F,$[Te],ae),Ee!==null&&(M=h(Ee,M,Te),ke===null?Ce=Ee:ke.sibling=Ee,ke=Ee);return et&&Ir(F,Te),Ce}for(Ee=o(F,Ee);Te<$.length;Te++)wt=pe(Ee,F,Te,$[Te],ae),wt!==null&&(e&&wt.alternate!==null&&Ee.delete(wt.key===null?Te:wt.key),M=h(wt,M,Te),ke===null?Ce=wt:ke.sibling=wt,ke=wt);return e&&Ee.forEach(function(hr){return t(F,hr)}),et&&Ir(F,Te),Ce}function Ne(F,M,$,ae){var Ce=X($);if(typeof Ce!="function")throw Error(l(150));if($=Ce.call($),$==null)throw Error(l(151));for(var ke=Ce=null,Ee=M,Te=M=0,wt=null,$e=$.next();Ee!==null&&!$e.done;Te++,$e=$.next()){Ee.index>Te?(wt=Ee,Ee=null):wt=Ee.sibling;var hr=Z(F,Ee,$e.value,ae);if(hr===null){Ee===null&&(Ee=wt);break}e&&Ee&&hr.alternate===null&&t(F,Ee),M=h(hr,M,Te),ke===null?Ce=hr:ke.sibling=hr,ke=hr,Ee=wt}if($e.done)return s(F,Ee),et&&Ir(F,Te),Ce;if(Ee===null){for(;!$e.done;Te++,$e=$.next())$e=re(F,$e.value,ae),$e!==null&&(M=h($e,M,Te),ke===null?Ce=$e:ke.sibling=$e,ke=$e);return et&&Ir(F,Te),Ce}for(Ee=o(F,Ee);!$e.done;Te++,$e=$.next())$e=pe(Ee,F,Te,$e.value,ae),$e!==null&&(e&&$e.alternate!==null&&Ee.delete($e.key===null?Te:$e.key),M=h($e,M,Te),ke===null?Ce=$e:ke.sibling=$e,ke=$e);return e&&Ee.forEach(function(Uy){return t(F,Uy)}),et&&Ir(F,Te),Ce}function lt(F,M,$,ae){if(typeof $=="object"&&$!==null&&$.type===D&&$.key===null&&($=$.props.children),typeof $=="object"&&$!==null){switch($.$$typeof){case U:e:{for(var Ce=$.key,ke=M;ke!==null;){if(ke.key===Ce){if(Ce=$.type,Ce===D){if(ke.tag===7){s(F,ke.sibling),M=u(ke,$.props.children),M.return=F,F=M;break e}}else if(ke.elementType===Ce||typeof Ce=="object"&&Ce!==null&&Ce.$$typeof===K&&xf(Ce)===ke.type){s(F,ke.sibling),M=u(ke,$.props),M.ref=fa(F,ke,$),M.return=F,F=M;break e}s(F,ke);break}else t(F,ke);ke=ke.sibling}$.type===D?(M=$r($.props.children,F.mode,ae,$.key),M.return=F,F=M):(ae=$l($.type,$.key,$.props,null,F.mode,ae),ae.ref=fa(F,M,$),ae.return=F,F=ae)}return w(F);case G:e:{for(ke=$.key;M!==null;){if(M.key===ke)if(M.tag===4&&M.stateNode.containerInfo===$.containerInfo&&M.stateNode.implementation===$.implementation){s(F,M.sibling),M=u(M,$.children||[]),M.return=F,F=M;break e}else{s(F,M);break}else t(F,M);M=M.sibling}M=Sc($,F.mode,ae),M.return=F,F=M}return w(F);case K:return ke=$._init,lt(F,M,ke($._payload),ae)}if(xn($))return ve(F,M,$,ae);if(X($))return Ne(F,M,$,ae);xl(F,$)}return typeof $=="string"&&$!==""||typeof $=="number"?($=""+$,M!==null&&M.tag===6?(s(F,M.sibling),M=u(M,$),M.return=F,F=M):(s(F,M),M=Nc($,F.mode,ae),M.return=F,F=M),w(F)):s(F,M)}return lt}var hs=gf(!0),yf=gf(!1),gl=nr(null),yl=null,ms=null,Ai=null;function Mi(){Ai=ms=yl=null}function Li(e){var t=gl.current;Ze(gl),e._currentValue=t}function Di(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 ps(e,t){yl=e,Ai=ms=null,e=e.dependencies,e!==null&&e.firstContext!==null&&((e.lanes&t)!==0&&(At=!0),e.firstContext=null)}function Xt(e){var t=e._currentValue;if(Ai!==e)if(e={context:e,memoizedValue:t,next:null},ms===null){if(yl===null)throw Error(l(308));ms=e,yl.dependencies={lanes:0,firstContext:e}}else ms=ms.next=e;return t}var Ar=null;function Oi(e){Ar===null?Ar=[e]:Ar.push(e)}function vf(e,t,s,o){var u=t.interleaved;return u===null?(s.next=s,Oi(t)):(s.next=u.next,u.next=s),t.interleaved=s,Fn(e,o)}function Fn(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 ar=!1;function Fi(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function wf(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 zn(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function lr(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,Fn(e,s)}return u=o.interleaved,u===null?(t.next=t,Oi(o)):(t.next=u.next,u.next=t),o.interleaved=t,Fn(e,s)}function vl(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,Jo(e,s)}}function bf(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 w={eventTime:s.eventTime,lane:s.lane,tag:s.tag,payload:s.payload,callback:s.callback,next:null};h===null?u=h=w:h=h.next=w,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 wl(e,t,s,o){var u=e.updateQueue;ar=!1;var h=u.firstBaseUpdate,w=u.lastBaseUpdate,_=u.shared.pending;if(_!==null){u.shared.pending=null;var A=_,W=A.next;A.next=null,w===null?h=W:w.next=W,w=A;var te=e.alternate;te!==null&&(te=te.updateQueue,_=te.lastBaseUpdate,_!==w&&(_===null?te.firstBaseUpdate=W:_.next=W,te.lastBaseUpdate=A))}if(h!==null){var re=u.baseState;w=0,te=W=A=null,_=h;do{var Z=_.lane,pe=_.eventTime;if((o&Z)===Z){te!==null&&(te=te.next={eventTime:pe,lane:0,tag:_.tag,payload:_.payload,callback:_.callback,next:null});e:{var ve=e,Ne=_;switch(Z=t,pe=s,Ne.tag){case 1:if(ve=Ne.payload,typeof ve=="function"){re=ve.call(pe,re,Z);break e}re=ve;break e;case 3:ve.flags=ve.flags&-65537|128;case 0:if(ve=Ne.payload,Z=typeof ve=="function"?ve.call(pe,re,Z):ve,Z==null)break e;re=ne({},re,Z);break e;case 2:ar=!0}}_.callback!==null&&_.lane!==0&&(e.flags|=64,Z=u.effects,Z===null?u.effects=[_]:Z.push(_))}else pe={eventTime:pe,lane:Z,tag:_.tag,payload:_.payload,callback:_.callback,next:null},te===null?(W=te=pe,A=re):te=te.next=pe,w|=Z;if(_=_.next,_===null){if(_=u.shared.pending,_===null)break;Z=_,_=Z.next,Z.next=null,u.lastBaseUpdate=Z,u.shared.pending=null}}while(!0);if(te===null&&(A=re),u.baseState=A,u.firstBaseUpdate=W,u.lastBaseUpdate=te,t=u.shared.interleaved,t!==null){u=t;do w|=u.lane,u=u.next;while(u!==t)}else h===null&&(u.shared.lanes=0);Dr|=w,e.lanes=w,e.memoizedState=re}}function jf(e,t,s){if(e=t.effects,t.effects=null,e!==null)for(t=0;ts?s:4,e(!0);var o=Vi.transition;Vi.transition={};try{e(!1),t()}finally{Ke=s,Vi.transition=o}}function Bf(){return qt().memoizedState}function fy(e,t,s){var o=ur(e);if(s={lane:o,action:s,hasEagerState:!1,eagerState:null,next:null},Uf(e))Vf(t,s);else if(s=vf(e,t,s,o),s!==null){var u=Rt();un(s,e,o,u),Wf(s,t,o)}}function hy(e,t,s){var o=ur(e),u={lane:o,action:s,hasEagerState:!1,eagerState:null,next:null};if(Uf(e))Vf(t,u);else{var h=e.alternate;if(e.lanes===0&&(h===null||h.lanes===0)&&(h=t.lastRenderedReducer,h!==null))try{var w=t.lastRenderedState,_=h(w,s);if(u.hasEagerState=!0,u.eagerState=_,sn(_,w)){var A=t.interleaved;A===null?(u.next=u,Oi(t)):(u.next=A.next,A.next=u),t.interleaved=u;return}}catch{}finally{}s=vf(e,t,u,o),s!==null&&(u=Rt(),un(s,e,o,u),Wf(s,t,o))}}function Uf(e){var t=e.alternate;return e===nt||t!==null&&t===nt}function Vf(e,t){xa=Nl=!0;var s=e.pending;s===null?t.next=t:(t.next=s.next,s.next=t),e.pending=t}function Wf(e,t,s){if((s&4194240)!==0){var o=t.lanes;o&=e.pendingLanes,s|=o,t.lanes=s,Jo(e,s)}}var kl={readContext:Xt,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},my={readContext:Xt,useCallback:function(e,t){return bn().memoizedState=[e,t===void 0?null:t],e},useContext:Xt,useEffect:Af,useImperativeHandle:function(e,t,s){return s=s!=null?s.concat([e]):null,Sl(4194308,4,Df.bind(null,t,e),s)},useLayoutEffect:function(e,t){return Sl(4194308,4,e,t)},useInsertionEffect:function(e,t){return Sl(4,2,e,t)},useMemo:function(e,t){var s=bn();return t=t===void 0?null:t,e=e(),s.memoizedState=[e,t],e},useReducer:function(e,t,s){var o=bn();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=fy.bind(null,nt,e),[o.memoizedState,e]},useRef:function(e){var t=bn();return e={current:e},t.memoizedState=e},useState:Tf,useDebugValue:Xi,useDeferredValue:function(e){return bn().memoizedState=e},useTransition:function(){var e=Tf(!1),t=e[0];return e=dy.bind(null,e[1]),bn().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,s){var o=nt,u=bn();if(et){if(s===void 0)throw Error(l(407));s=s()}else{if(s=t(),vt===null)throw Error(l(349));(Lr&30)!==0||kf(o,t,s)}u.memoizedState=s;var h={value:s,getSnapshot:t};return u.queue=h,Af(Pf.bind(null,o,h,e),[e]),o.flags|=2048,va(9,Ef.bind(null,o,h,s,t),void 0,null),s},useId:function(){var e=bn(),t=vt.identifierPrefix;if(et){var s=On,o=Dn;s=(o&~(1<<32-rn(o)-1)).toString(32)+s,t=":"+t+"R"+s,s=ga++,0<\/script>",e=e.removeChild(e.firstChild)):typeof o.is=="string"?e=w.createElement(s,{is:o.is}):(e=w.createElement(s),s==="select"&&(w=e,o.multiple?w.multiple=!0:o.size&&(w.size=o.size))):e=w.createElementNS(e,s),e[vn]=t,e[ua]=o,uh(e,t,!1,!1),t.stateNode=e;e:{switch(w=Uo(s,o),s){case"dialog":Je("cancel",e),Je("close",e),u=o;break;case"iframe":case"object":case"embed":Je("load",e),u=o;break;case"video":case"audio":for(u=0;uws&&(t.flags|=128,o=!0,wa(h,!1),t.lanes=4194304)}else{if(!o)if(e=bl(w),e!==null){if(t.flags|=128,o=!0,s=e.updateQueue,s!==null&&(t.updateQueue=s,t.flags|=4),wa(h,!0),h.tail===null&&h.tailMode==="hidden"&&!w.alternate&&!et)return Ct(t),null}else 2*at()-h.renderingStartTime>ws&&s!==1073741824&&(t.flags|=128,o=!0,wa(h,!1),t.lanes=4194304);h.isBackwards?(w.sibling=t.child,t.child=w):(s=h.last,s!==null?s.sibling=w:t.child=w,h.last=w)}return h.tail!==null?(t=h.tail,h.rendering=t,h.tail=t.sibling,h.renderingStartTime=at(),t.sibling=null,s=tt.current,qe(tt,o?s&1|2:s&1),t):(Ct(t),null);case 22:case 23:return wc(),o=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==o&&(t.flags|=8192),o&&(t.mode&1)!==0?(Vt&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 jy(e,t){switch(Ri(t),t.tag){case 1:return It(t.type)&&ul(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return xs(),Ze(Tt),Ze(Nt),Ui(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 5:return $i(t),null;case 13:if(Ze(tt),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(l(340));fs()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Ze(tt),null;case 4:return xs(),null;case 10:return Li(t.type._context),null;case 22:case 23:return wc(),null;case 24:return null;default:return null}}var _l=!1,kt=!1,Ny=typeof WeakSet=="function"?WeakSet:Set,xe=null;function ys(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 ic(e,t,s){try{s()}catch(o){st(e,t,o)}}var hh=!1;function Sy(e,t){if(wi=Xa,e=Wd(),fi(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 w=0,_=-1,A=-1,W=0,te=0,re=e,Z=null;t:for(;;){for(var pe;re!==s||u!==0&&re.nodeType!==3||(_=w+u),re!==h||o!==0&&re.nodeType!==3||(A=w+o),re.nodeType===3&&(w+=re.nodeValue.length),(pe=re.firstChild)!==null;)Z=re,re=pe;for(;;){if(re===e)break t;if(Z===s&&++W===u&&(_=w),Z===h&&++te===o&&(A=w),(pe=re.nextSibling)!==null)break;re=Z,Z=re.parentNode}re=pe}s=_===-1||A===-1?null:{start:_,end:A}}else s=null}s=s||{start:0,end:0}}else s=null;for(bi={focusedElem:e,selectionRange:s},Xa=!1,xe=t;xe!==null;)if(t=xe,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,xe=e;else for(;xe!==null;){t=xe;try{var ve=t.alternate;if((t.flags&1024)!==0)switch(t.tag){case 0:case 11:case 15:break;case 1:if(ve!==null){var Ne=ve.memoizedProps,lt=ve.memoizedState,F=t.stateNode,M=F.getSnapshotBeforeUpdate(t.elementType===t.type?Ne:ln(t.type,Ne),lt);F.__reactInternalSnapshotBeforeUpdate=M}break;case 3:var $=t.stateNode.containerInfo;$.nodeType===1?$.textContent="":$.nodeType===9&&$.documentElement&&$.removeChild($.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(l(163))}}catch(ae){st(t,t.return,ae)}if(e=t.sibling,e!==null){e.return=t.return,xe=e;break}xe=t.return}return ve=hh,hh=!1,ve}function ba(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&&ic(t,s,h)}u=u.next}while(u!==o)}}function Tl(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 cc(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 mh(e){var t=e.alternate;t!==null&&(e.alternate=null,mh(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[vn],delete t[ua],delete t[Ci],delete t[ly],delete t[oy])),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 ph(e){return e.tag===5||e.tag===3||e.tag===4}function xh(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||ph(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 uc(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=il));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}function dc(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(dc(e,t,s),e=e.sibling;e!==null;)dc(e,t,s),e=e.sibling}var bt=null,on=!1;function or(e,t,s){for(s=s.child;s!==null;)gh(e,t,s),s=s.sibling}function gh(e,t,s){if(yn&&typeof yn.onCommitFiberUnmount=="function")try{yn.onCommitFiberUnmount(Wa,s)}catch{}switch(s.tag){case 5:kt||ys(s,t);case 6:var o=bt,u=on;bt=null,or(e,t,s),bt=o,on=u,bt!==null&&(on?(e=bt,s=s.stateNode,e.nodeType===8?e.parentNode.removeChild(s):e.removeChild(s)):bt.removeChild(s.stateNode));break;case 18:bt!==null&&(on?(e=bt,s=s.stateNode,e.nodeType===8?Si(e.parentNode,s):e.nodeType===1&&Si(e,s),Zs(e)):Si(bt,s.stateNode));break;case 4:o=bt,u=on,bt=s.stateNode.containerInfo,on=!0,or(e,t,s),bt=o,on=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,w=h.destroy;h=h.tag,w!==void 0&&((h&2)!==0||(h&4)!==0)&&ic(s,t,w),u=u.next}while(u!==o)}or(e,t,s);break;case 1:if(!kt&&(ys(s,t),o=s.stateNode,typeof o.componentWillUnmount=="function"))try{o.props=s.memoizedProps,o.state=s.memoizedState,o.componentWillUnmount()}catch(_){st(s,t,_)}or(e,t,s);break;case 21:or(e,t,s);break;case 22:s.mode&1?(kt=(o=kt)||s.memoizedState!==null,or(e,t,s),kt=o):or(e,t,s);break;default:or(e,t,s)}}function yh(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var s=e.stateNode;s===null&&(s=e.stateNode=new Ny),t.forEach(function(o){var u=Ay.bind(null,e,o);s.has(o)||(s.add(o),o.then(u,u))})}}function cn(e,t){var s=t.deletions;if(s!==null)for(var o=0;ou&&(u=w),o&=~h}if(o=u,o=at()-o,o=(120>o?120:480>o?480:1080>o?1080:1920>o?1920:3e3>o?3e3:4320>o?4320:1960*ky(o/1960))-o,10e?16:e,cr===null)var o=!1;else{if(e=cr,cr=null,Dl=0,(Fe&6)!==0)throw Error(l(331));var u=Fe;for(Fe|=4,xe=e.current;xe!==null;){var h=xe,w=h.child;if((xe.flags&16)!==0){var _=h.deletions;if(_!==null){for(var A=0;A<_.length;A++){var W=_[A];for(xe=W;xe!==null;){var te=xe;switch(te.tag){case 0:case 11:case 15:ba(8,te,h)}var re=te.child;if(re!==null)re.return=te,xe=re;else for(;xe!==null;){te=xe;var Z=te.sibling,pe=te.return;if(mh(te),te===W){xe=null;break}if(Z!==null){Z.return=pe,xe=Z;break}xe=pe}}}var ve=h.alternate;if(ve!==null){var Ne=ve.child;if(Ne!==null){ve.child=null;do{var lt=Ne.sibling;Ne.sibling=null,Ne=lt}while(Ne!==null)}}xe=h}}if((h.subtreeFlags&2064)!==0&&w!==null)w.return=h,xe=w;else e:for(;xe!==null;){if(h=xe,(h.flags&2048)!==0)switch(h.tag){case 0:case 11:case 15:ba(9,h,h.return)}var F=h.sibling;if(F!==null){F.return=h.return,xe=F;break e}xe=h.return}}var M=e.current;for(xe=M;xe!==null;){w=xe;var $=w.child;if((w.subtreeFlags&2064)!==0&&$!==null)$.return=w,xe=$;else e:for(w=M;xe!==null;){if(_=xe,(_.flags&2048)!==0)try{switch(_.tag){case 0:case 11:case 15:Tl(9,_)}}catch(Ce){st(_,_.return,Ce)}if(_===w){xe=null;break e}var ae=_.sibling;if(ae!==null){ae.return=_.return,xe=ae;break e}xe=_.return}}if(Fe=u,sr(),yn&&typeof yn.onPostCommitFiberRoot=="function")try{yn.onPostCommitFiberRoot(Wa,e)}catch{}o=!0}return o}finally{Ke=s,Jt.transition=t}}return!1}function _h(e,t,s){t=gs(s,t),t=Qf(e,t,1),e=lr(e,t,1),t=Rt(),e!==null&&(Qs(e,1,t),Lt(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"&&(ir===null||!ir.has(o))){e=gs(s,e),e=Yf(t,e,1),t=lr(t,e,1),e=Rt(),t!==null&&(Qs(t,1,e),Lt(t,e));break}}t=t.return}}function Ty(e,t,s){var o=e.pingCache;o!==null&&o.delete(t),t=Rt(),e.pingedLanes|=e.suspendedLanes&s,vt===e&&(jt&s)===s&&(ht===4||ht===3&&(jt&130023424)===jt&&500>at()-mc?Fr(e,0):hc|=s),Lt(e,t)}function Th(e,t){t===0&&((e.mode&1)===0?t=1:(t=Ka,Ka<<=1,(Ka&130023424)===0&&(Ka=4194304)));var s=Rt();e=Fn(e,t),e!==null&&(Qs(e,t,s),Lt(e,s))}function Iy(e){var t=e.memoizedState,s=0;t!==null&&(s=t.retryLane),Th(e,s)}function Ay(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),Th(e,s)}var Ih;Ih=function(e,t,s){if(e!==null)if(e.memoizedProps!==t.pendingProps||Tt.current)At=!0;else{if((e.lanes&s)===0&&(t.flags&128)===0)return At=!1,wy(e,t,s);At=(e.flags&131072)!==0}else At=!1,et&&(t.flags&1048576)!==0&&df(t,ml,t.index);switch(t.lanes=0,t.tag){case 2:var o=t.type;Rl(e,t),e=t.pendingProps;var u=cs(t,Nt.current);ps(t,s),u=Hi(null,t,o,e,u,s);var h=Ki();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,It(o)?(h=!0,dl(t)):h=!1,t.memoizedState=u.state!==null&&u.state!==void 0?u.state:null,Fi(t),u.updater=El,t.stateNode=u,u._reactInternals=t,Ji(t,o,e,s),t=nc(null,t,o,!0,h,s)):(t.tag=0,et&&h&&Pi(t),Pt(null,t,u,s),t=t.child),t;case 16:o=t.elementType;e:{switch(Rl(e,t),e=t.pendingProps,u=o._init,o=u(o._payload),t.type=o,u=t.tag=Ly(o),e=ln(o,e),u){case 0:t=tc(null,t,o,e,s);break e;case 1:t=sh(null,t,o,e,s);break e;case 11:t=Zf(null,t,o,e,s);break e;case 14:t=eh(null,t,o,ln(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:ln(o,u),tc(e,t,o,u,s);case 1:return o=t.type,u=t.pendingProps,u=t.elementType===o?u:ln(o,u),sh(e,t,o,u,s);case 3:e:{if(ah(t),e===null)throw Error(l(387));o=t.pendingProps,h=t.memoizedState,u=h.element,wf(e,t),wl(t,o,null,s);var w=t.memoizedState;if(o=w.element,h.isDehydrated)if(h={element:o,isDehydrated:!1,cache:w.cache,pendingSuspenseBoundaries:w.pendingSuspenseBoundaries,transitions:w.transitions},t.updateQueue.baseState=h,t.memoizedState=h,t.flags&256){u=gs(Error(l(423)),t),t=lh(e,t,o,s,u);break e}else if(o!==u){u=gs(Error(l(424)),t),t=lh(e,t,o,s,u);break e}else for(Ut=tr(t.stateNode.containerInfo.firstChild),Bt=t,et=!0,an=null,s=yf(t,null,o,s),t.child=s;s;)s.flags=s.flags&-3|4096,s=s.sibling;else{if(fs(),o===u){t=$n(e,t,s);break e}Pt(e,t,o,s)}t=t.child}return t;case 5:return Nf(t),e===null&&Ti(t),o=t.type,u=t.pendingProps,h=e!==null?e.memoizedProps:null,w=u.children,ji(o,u)?w=null:h!==null&&ji(o,h)&&(t.flags|=32),rh(e,t),Pt(e,t,w,s),t.child;case 6:return e===null&&Ti(t),null;case 13:return oh(e,t,s);case 4:return zi(t,t.stateNode.containerInfo),o=t.pendingProps,e===null?t.child=hs(t,null,o,s):Pt(e,t,o,s),t.child;case 11:return o=t.type,u=t.pendingProps,u=t.elementType===o?u:ln(o,u),Zf(e,t,o,u,s);case 7:return Pt(e,t,t.pendingProps,s),t.child;case 8:return Pt(e,t,t.pendingProps.children,s),t.child;case 12:return Pt(e,t,t.pendingProps.children,s),t.child;case 10:e:{if(o=t.type._context,u=t.pendingProps,h=t.memoizedProps,w=u.value,qe(gl,o._currentValue),o._currentValue=w,h!==null)if(sn(h.value,w)){if(h.children===u.children&&!Tt.current){t=$n(e,t,s);break e}}else for(h=t.child,h!==null&&(h.return=t);h!==null;){var _=h.dependencies;if(_!==null){w=h.child;for(var A=_.firstContext;A!==null;){if(A.context===o){if(h.tag===1){A=zn(-1,s&-s),A.tag=2;var W=h.updateQueue;if(W!==null){W=W.shared;var te=W.pending;te===null?A.next=A:(A.next=te.next,te.next=A),W.pending=A}}h.lanes|=s,A=h.alternate,A!==null&&(A.lanes|=s),Di(h.return,s,t),_.lanes|=s;break}A=A.next}}else if(h.tag===10)w=h.type===t.type?null:h.child;else if(h.tag===18){if(w=h.return,w===null)throw Error(l(341));w.lanes|=s,_=w.alternate,_!==null&&(_.lanes|=s),Di(w,s,t),w=h.sibling}else w=h.child;if(w!==null)w.return=h;else for(w=h;w!==null;){if(w===t){w=null;break}if(h=w.sibling,h!==null){h.return=w.return,w=h;break}w=w.return}h=w}Pt(e,t,u.children,s),t=t.child}return t;case 9:return u=t.type,o=t.pendingProps.children,ps(t,s),u=Xt(u),o=o(u),t.flags|=1,Pt(e,t,o,s),t.child;case 14:return o=t.type,u=ln(o,t.pendingProps),u=ln(o.type,u),eh(e,t,o,u,s);case 15:return th(e,t,t.type,t.pendingProps,s);case 17:return o=t.type,u=t.pendingProps,u=t.elementType===o?u:ln(o,u),Rl(e,t),t.tag=1,It(o)?(e=!0,dl(t)):e=!1,ps(t,s),Kf(t,o,u),Ji(t,o,u,s),nc(null,t,o,!0,e,s);case 19:return ch(e,t,s);case 22:return nh(e,t,s)}throw Error(l(156,t.tag))};function Ah(e,t){return dd(e,t)}function My(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 Zt(e,t,s,o){return new My(e,t,s,o)}function jc(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Ly(e){if(typeof e=="function")return jc(e)?1:0;if(e!=null){if(e=e.$$typeof,e===fe)return 11;if(e===z)return 14}return 2}function fr(e,t){var s=e.alternate;return s===null?(s=Zt(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 $l(e,t,s,o,u,h){var w=2;if(o=e,typeof e=="function")jc(e)&&(w=1);else if(typeof e=="string")w=5;else e:switch(e){case D:return $r(s.children,u,h,t);case V:w=8,u|=8;break;case se:return e=Zt(12,s,t,u|2),e.elementType=se,e.lanes=h,e;case Y:return e=Zt(13,s,t,u),e.elementType=Y,e.lanes=h,e;case B:return e=Zt(19,s,t,u),e.elementType=B,e.lanes=h,e;case H:return Bl(s,u,h,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case he:w=10;break e;case de:w=9;break e;case fe:w=11;break e;case z:w=14;break e;case K:w=16,o=null;break e}throw Error(l(130,e==null?e:typeof e,""))}return t=Zt(w,s,t,u),t.elementType=e,t.type=o,t.lanes=h,t}function $r(e,t,s,o){return e=Zt(7,e,o,t),e.lanes=s,e}function Bl(e,t,s,o){return e=Zt(22,e,o,t),e.elementType=H,e.lanes=s,e.stateNode={isHidden:!1},e}function Nc(e,t,s){return e=Zt(6,e,null,t),e.lanes=s,e}function Sc(e,t,s){return t=Zt(4,e.children!==null?e.children:[],e.key,t),t.lanes=s,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function Dy(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=qo(0),this.expirationTimes=qo(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=qo(0),this.identifierPrefix=o,this.onRecoverableError=u,this.mutableSourceEagerHydrationData=null}function Cc(e,t,s,o,u,h,w,_,A){return e=new Dy(e,t,s,_,A),t===1?(t=1,h===!0&&(t|=8)):t=0,h=Zt(3,null,null,t),e.current=h,h.stateNode=e,h.memoizedState={element:o,isDehydrated:s,cache:null,transitions:null,pendingSuspenseBoundaries:null},Fi(h),e}function Oy(e,t,s){var o=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(r)}catch(a){console.error(a)}}return r(),Tc.exports=Yy(),Tc.exports}var Gh;function Xy(){if(Gh)return Ql;Gh=1;var r=Qm();return Ql.createRoot=r.createRoot,Ql.hydrateRoot=r.hydrateRoot,Ql}var qy=Xy(),Aa=Qm();const Jy=Gm(Aa);/** - * @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 Ra(){return Ra=Object.assign?Object.assign.bind():function(r){for(var a=1;a"u")throw new Error(a)}function ju(r,a){if(!r){typeof console<"u"&&console.warn(a);try{throw new Error(a)}catch{}}}function ev(){return Math.random().toString(36).substr(2,8)}function Yh(r,a){return{usr:r.state,key:r.key,idx:a}}function Yc(r,a,l,i){return l===void 0&&(l=null),Ra({pathname:typeof r=="string"?r:r.pathname,search:"",hash:""},typeof a=="string"?Ls(a):a,{state:l,key:a&&a.key||i||ev()})}function co(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 Ls(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 tv(r,a,l,i){i===void 0&&(i={});let{window:c=document.defaultView,v5Compat:d=!1}=i,f=c.history,m=yr.Pop,x=null,v=g();v==null&&(v=0,f.replaceState(Ra({},f.state,{idx:v}),""));function g(){return(f.state||{idx:null}).idx}function y(){m=yr.Pop;let b=g(),S=b==null?null:b-v;v=b,x&&x({action:m,location:j.location,delta:S})}function C(b,S){m=yr.Push;let P=Yc(j.location,b,S);v=g()+1;let N=Yh(P,v),T=j.createHref(P);try{f.pushState(N,"",T)}catch(U){if(U instanceof DOMException&&U.name==="DataCloneError")throw U;c.location.assign(T)}d&&x&&x({action:m,location:j.location,delta:1})}function E(b,S){m=yr.Replace;let P=Yc(j.location,b,S);v=g();let N=Yh(P,v),T=j.createHref(P);f.replaceState(N,"",T),d&&x&&x({action:m,location:j.location,delta:0})}function k(b){let S=c.location.origin!=="null"?c.location.origin:c.location.href,P=typeof b=="string"?b:co(b);return P=P.replace(/ $/,"%20"),ot(S,"No window.location.(origin|href) available to create URL for href: "+P),new URL(P,S)}let j={get action(){return m},get location(){return r(c,f)},listen(b){if(x)throw new Error("A history only accepts one active listener");return c.addEventListener(Qh,y),x=b,()=>{c.removeEventListener(Qh,y),x=null}},createHref(b){return a(c,b)},createURL:k,encodeLocation(b){let S=k(b);return{pathname:S.pathname,search:S.search,hash:S.hash}},push:C,replace:E,go(b){return f.go(b)}};return j}var Xh;(function(r){r.data="data",r.deferred="deferred",r.redirect="redirect",r.error="error"})(Xh||(Xh={}));function nv(r,a,l){return l===void 0&&(l="/"),rv(r,a,l)}function rv(r,a,l,i){let c=typeof a=="string"?Ls(a):a,d=Nu(c.pathname||"/",l);if(d==null)return null;let f=Ym(r);sv(f);let m=null;for(let x=0;m==null&&x{let x={relativePath:m===void 0?d.path||"":m,caseSensitive:d.caseSensitive===!0,childrenIndex:f,route:d};x.relativePath.startsWith("/")&&(ot(x.relativePath.startsWith(i),'Absolute route path "'+x.relativePath+'" nested under path '+('"'+i+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),x.relativePath=x.relativePath.slice(i.length));let v=vr([i,x.relativePath]),g=l.concat(x);d.children&&d.children.length>0&&(ot(d.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+v+'".')),Ym(d.children,a,g,v)),!(d.path==null&&!d.index)&&a.push({path:v,score:dv(v,d.index),routesMeta:g})};return r.forEach((d,f)=>{var m;if(d.path===""||!((m=d.path)!=null&&m.includes("?")))c(d,f);else for(let x of Xm(d.path))c(d,f,x)}),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(x=>x===""?d:[d,x].join("/"))),c&&m.push(...f),m.map(x=>r.startsWith("/")&&x===""?"/":x)}function sv(r){r.sort((a,l)=>a.score!==l.score?l.score-a.score:fv(a.routesMeta.map(i=>i.childrenIndex),l.routesMeta.map(i=>i.childrenIndex)))}const av=/^:[\w-]+$/,lv=3,ov=2,iv=1,cv=10,uv=-2,qh=r=>r==="*";function dv(r,a){let l=r.split("/"),i=l.length;return l.some(qh)&&(i+=uv),a&&(i+=ov),l.filter(c=>!qh(c)).reduce((c,d)=>c+(av.test(d)?lv:d===""?iv:cv),i)}function fv(r,a){return r.length===a.length&&r.slice(0,-1).every((i,c)=>i===a[c])?r[r.length-1]-a[a.length-1]:0}function hv(r,a,l){let{routesMeta:i}=r,c={},d="/",f=[];for(let m=0;m{let{paramName:C,isOptional:E}=g;if(C==="*"){let j=m[y]||"";f=d.slice(0,d.length-j.length).replace(/(.)\/+$/,"$1")}const k=m[y];return E&&!k?v[C]=void 0:v[C]=(k||"").replace(/%2F/g,"/"),v},{}),pathname:d,pathnameBase:f,pattern:r}}function pv(r,a,l){a===void 0&&(a=!1),l===void 0&&(l=!0),ju(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,x)=>(i.push({paramName:m,isOptional:x!=null}),x?"/?([^\\/]+)?":"/([^\\/]+)"));return r.endsWith("*")?(i.push({paramName:"*"}),c+=r==="*"||r==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):l?c+="\\/*$":r!==""&&r!=="/"&&(c+="(?:(?=\\/|$))"),[new RegExp(c,a?void 0:"i"),i]}function xv(r){try{return r.split("/").map(a=>decodeURIComponent(a).replace(/\//g,"%2F")).join("/")}catch(a){return ju(!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 gv=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,yv=r=>gv.test(r);function vv(r,a){a===void 0&&(a="/");let{pathname:l,search:i="",hash:c=""}=typeof r=="string"?Ls(r):r,d;if(l)if(yv(l))d=l;else{if(l.includes("//")){let f=l;l=l.replace(/\/\/+/g,"/"),ju(!1,"Pathnames cannot have embedded double slashes - normalizing "+(f+" -> "+l))}l.startsWith("/")?d=Jh(l.substring(1),"/"):d=Jh(l,a)}else d=a;return{pathname:d,search:jv(i),hash:Nv(c)}}function Jh(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 Mc(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 and the router will parse it for you.'}function wv(r){return r.filter((a,l)=>l===0||a.route.path&&a.route.path.length>0)}function Su(r,a){let l=wv(r);return a?l.map((i,c)=>c===l.length-1?i.pathname:i.pathnameBase):l.map(i=>i.pathnameBase)}function Cu(r,a,l,i){i===void 0&&(i=!1);let c;typeof r=="string"?c=Ls(r):(c=Ra({},r),ot(!c.pathname||!c.pathname.includes("?"),Mc("?","pathname","search",c)),ot(!c.pathname||!c.pathname.includes("#"),Mc("#","pathname","hash",c)),ot(!c.search||!c.search.includes("#"),Mc("#","search","hash",c)));let d=r===""||c.pathname==="",f=d?"/":c.pathname,m;if(f==null)m=l;else{let y=a.length-1;if(!i&&f.startsWith("..")){let C=f.split("/");for(;C[0]==="..";)C.shift(),y-=1;c.pathname=C.join("/")}m=y>=0?a[y]:"/"}let x=vv(c,m),v=f&&f!=="/"&&f.endsWith("/"),g=(d||f===".")&&l.endsWith("/");return!x.pathname.endsWith("/")&&(v||g)&&(x.pathname+="/"),x}const vr=r=>r.join("/").replace(/\/\/+/g,"/"),bv=r=>r.replace(/\/+$/,"").replace(/^\/*/,"/"),jv=r=>!r||r==="?"?"":r.startsWith("?")?r:"?"+r,Nv=r=>!r||r==="#"?"":r.startsWith("#")?r:"#"+r;function Sv(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 Cv=["get",...qm];new Set(Cv);/** - * 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 _a(){return _a=Object.assign?Object.assign.bind():function(r){for(var a=1;a{m.current=!0}),p.useCallback(function(v,g){if(g===void 0&&(g={}),!m.current)return;if(typeof v=="number"){i.go(v);return}let y=Cu(v,JSON.parse(f),d,g.relative==="path");r==null&&a!=="/"&&(y.pathname=y.pathname==="/"?a:vr([a,y.pathname])),(g.replace?i.replace:i.push)(y,g.state,g)},[a,i,f,d,r])}const Rv=p.createContext(null);function _v(r){let a=p.useContext(Qn).outlet;return a&&p.createElement(Rv.Provider,{value:r},a)}function ep(r,a){let{relative:l}=a===void 0?{}:a,{future:i}=p.useContext(Sr),{matches:c}=p.useContext(Qn),{pathname:d}=qr(),f=JSON.stringify(Su(c,i.v7_relativeSplatPath));return p.useMemo(()=>Cu(r,JSON.parse(f),d,l==="path"),[r,f,d,l])}function Tv(r,a){return Iv(r,a)}function Iv(r,a,l,i){Ds()||ot(!1);let{navigator:c}=p.useContext(Sr),{matches:d}=p.useContext(Qn),f=d[d.length-1],m=f?f.params:{};f&&f.pathname;let x=f?f.pathnameBase:"/";f&&f.route;let v=qr(),g;if(a){var y;let b=typeof a=="string"?Ls(a):a;x==="/"||(y=b.pathname)!=null&&y.startsWith(x)||ot(!1),g=b}else g=v;let C=g.pathname||"/",E=C;if(x!=="/"){let b=x.replace(/^\//,"").split("/");E="/"+C.replace(/^\//,"").split("/").slice(b.length).join("/")}let k=nv(r,{pathname:E}),j=Ov(k&&k.map(b=>Object.assign({},b,{params:Object.assign({},m,b.params),pathname:vr([x,c.encodeLocation?c.encodeLocation(b.pathname).pathname:b.pathname]),pathnameBase:b.pathnameBase==="/"?x:vr([x,c.encodeLocation?c.encodeLocation(b.pathnameBase).pathname:b.pathnameBase])})),d,l,i);return a&&j?p.createElement(So.Provider,{value:{location:_a({pathname:"/",search:"",hash:"",state:null,key:"default"},g),navigationType:yr.Pop}},j):j}function Av(){let r=Bv(),a=Sv(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 p.createElement(p.Fragment,null,p.createElement("h2",null,"Unexpected Application Error!"),p.createElement("h3",{style:{fontStyle:"italic"}},a),l?p.createElement("pre",{style:c},l):null,null)}const Mv=p.createElement(Av,null);class Lv extends p.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?p.createElement(Qn.Provider,{value:this.props.routeContext},p.createElement(Jm.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function Dv(r){let{routeContext:a,match:l,children:i}=r,c=p.useContext(ku);return c&&c.static&&c.staticContext&&(l.route.errorElement||l.route.ErrorBoundary)&&(c.staticContext._deepestRenderedBoundaryId=l.route.id),p.createElement(Qn.Provider,{value:a},i)}function Ov(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 g=f.findIndex(y=>y.route.id&&(m==null?void 0:m[y.route.id])!==void 0);g>=0||ot(!1),f=f.slice(0,Math.min(f.length,g+1))}let x=!1,v=-1;if(l&&i&&i.v7_partialHydration)for(let g=0;g=0?f=f.slice(0,v+1):f=[f[0]];break}}}return f.reduceRight((g,y,C)=>{let E,k=!1,j=null,b=null;l&&(E=m&&y.route.id?m[y.route.id]:void 0,j=y.route.errorElement||Mv,x&&(v<0&&C===0?(Vv("route-fallback"),k=!0,b=null):v===C&&(k=!0,b=y.route.hydrateFallbackElement||null)));let S=a.concat(f.slice(0,C+1)),P=()=>{let N;return E?N=j:k?N=b:y.route.Component?N=p.createElement(y.route.Component,null):y.route.element?N=y.route.element:N=g,p.createElement(Dv,{match:y,routeContext:{outlet:g,matches:S,isDataRoute:l!=null},children:N})};return l&&(y.route.ErrorBoundary||y.route.errorElement||C===0)?p.createElement(Lv,{location:l.location,revalidation:l.revalidation,component:j,error:E,children:P(),routeContext:{outlet:null,matches:S,isDataRoute:!0}}):P()},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 Fv(r){let a=p.useContext(ku);return a||ot(!1),a}function zv(r){let a=p.useContext(kv);return a||ot(!1),a}function $v(r){let a=p.useContext(Qn);return a||ot(!1),a}function rp(r){let a=$v(),l=a.matches[a.matches.length-1];return l.route.id||ot(!1),l.route.id}function Bv(){var r;let a=p.useContext(Jm),l=zv(),i=rp();return a!==void 0?a:(r=l.errors)==null?void 0:r[i]}function Uv(){let{router:r}=Fv(tp.UseNavigateStable),a=rp(np.UseNavigateStable),l=p.useRef(!1);return Zm(()=>{l.current=!0}),p.useCallback(function(c,d){d===void 0&&(d={}),l.current&&(typeof c=="number"?r.navigate(c):r.navigate(c,_a({fromRouteId:a},d)))},[r,a])}const Zh={};function Vv(r,a,l){Zh[r]||(Zh[r]=!0)}function Wv(r,a){r==null||r.v7_startTransition,r==null||r.v7_relativeSplatPath}function Hv(r){let{to:a,replace:l,state:i,relative:c}=r;Ds()||ot(!1);let{future:d,static:f}=p.useContext(Sr),{matches:m}=p.useContext(Qn),{pathname:x}=qr(),v=Ma(),g=Cu(a,Su(m,d.v7_relativeSplatPath),x,c==="path"),y=JSON.stringify(g);return p.useEffect(()=>v(JSON.parse(y),{replace:l,state:i,relative:c}),[v,y,c,l,i]),null}function Kv(r){return _v(r.context)}function pt(r){ot(!1)}function Gv(r){let{basename:a="/",children:l=null,location:i,navigationType:c=yr.Pop,navigator:d,static:f=!1,future:m}=r;Ds()&&ot(!1);let x=a.replace(/^\/*/,"/"),v=p.useMemo(()=>({basename:x,navigator:d,static:f,future:_a({v7_relativeSplatPath:!1},m)}),[x,m,d,f]);typeof i=="string"&&(i=Ls(i));let{pathname:g="/",search:y="",hash:C="",state:E=null,key:k="default"}=i,j=p.useMemo(()=>{let b=Nu(g,x);return b==null?null:{location:{pathname:b,search:y,hash:C,state:E,key:k},navigationType:c}},[x,g,y,C,E,k,c]);return j==null?null:p.createElement(Sr.Provider,{value:v},p.createElement(So.Provider,{children:l,value:j}))}function Qv(r){let{children:a,location:l}=r;return Tv(Xc(a),l)}new Promise(()=>{});function Xc(r,a){a===void 0&&(a=[]);let l=[];return p.Children.forEach(r,(i,c)=>{if(!p.isValidElement(i))return;let d=[...a,c];if(i.type===p.Fragment){l.push.apply(l,Xc(i.props.children,d));return}i.type!==pt&&ot(!1),!i.props.index||!i.props.children||ot(!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=Xc(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 qc(){return qc=Object.assign?Object.assign.bind():function(r){for(var a=1;a=0)&&(l[c]=r[c]);return l}function Xv(r){return!!(r.metaKey||r.altKey||r.ctrlKey||r.shiftKey)}function qv(r,a){return r.button===0&&(!a||a==="_self")&&!Xv(r)}const Jv=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","viewTransition"],Zv="6";try{window.__reactRouterVersion=Zv}catch{}const ew="startTransition",em=No[ew];function tw(r){let{basename:a,children:l,future:i,window:c}=r,d=p.useRef();d.current==null&&(d.current=Zy({window:c,v5Compat:!0}));let f=d.current,[m,x]=p.useState({action:f.action,location:f.location}),{v7_startTransition:v}=i||{},g=p.useCallback(y=>{v&&em?em(()=>x(y)):x(y)},[x,v]);return p.useLayoutEffect(()=>f.listen(g),[f,g]),p.useEffect(()=>Wv(i),[i]),p.createElement(Gv,{basename:a,children:l,location:m.location,navigationType:m.action,navigator:f,future:i})}const nw=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",rw=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,sp=p.forwardRef(function(a,l){let{onClick:i,relative:c,reloadDocument:d,replace:f,state:m,target:x,to:v,preventScrollReset:g,viewTransition:y}=a,C=Yv(a,Jv),{basename:E}=p.useContext(Sr),k,j=!1;if(typeof v=="string"&&rw.test(v)&&(k=v,nw))try{let N=new URL(window.location.href),T=v.startsWith("//")?new URL(N.protocol+v):new URL(v),U=Nu(T.pathname,E);T.origin===N.origin&&U!=null?v=U+T.search+T.hash:j=!0}catch{}let b=Ev(v,{relative:c}),S=sw(v,{replace:f,state:m,target:x,preventScrollReset:g,relative:c,viewTransition:y});function P(N){i&&i(N),N.defaultPrevented||S(N)}return p.createElement("a",qc({},C,{href:k||b,onClick:j||d?i:P,ref:l,target:x}))});var tm;(function(r){r.UseScrollRestoration="useScrollRestoration",r.UseSubmit="useSubmit",r.UseSubmitFetcher="useSubmitFetcher",r.UseFetcher="useFetcher",r.useViewTransitionState="useViewTransitionState"})(tm||(tm={}));var nm;(function(r){r.UseFetcher="useFetcher",r.UseFetchers="useFetchers",r.UseScrollRestoration="useScrollRestoration"})(nm||(nm={}));function sw(r,a){let{target:l,replace:i,state:c,preventScrollReset:d,relative:f,viewTransition:m}=a===void 0?{}:a,x=Ma(),v=qr(),g=ep(r,{relative:f});return p.useCallback(y=>{if(qv(y,l)){y.preventDefault();let C=i!==void 0?i:co(v)===co(g);x(r,{replace:C,state:c,preventScrollReset:d,relative:f,viewTransition:m})}},[v,x,g,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 aw=r=>r.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),lw=r=>r.replace(/^([A-Z])|[\s-_]+(\w)/g,(a,l,i)=>i?i.toUpperCase():l.toLowerCase()),rm=r=>{const a=lw(r);return a.charAt(0).toUpperCase()+a.slice(1)},ap=(...r)=>r.filter((a,l,i)=>!!a&&a.trim()!==""&&i.indexOf(a)===l).join(" ").trim(),ow=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 iw={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 cw=p.forwardRef(({color:r="currentColor",size:a=24,strokeWidth:l=2,absoluteStrokeWidth:i,className:c="",children:d,iconNode:f,...m},x)=>p.createElement("svg",{ref:x,...iw,width:a,height:a,stroke:r,strokeWidth:i?Number(l)*24/Number(a):l,className:ap("lucide",c),...!d&&!ow(m)&&{"aria-hidden":"true"},...m},[...f.map(([v,g])=>p.createElement(v,g)),...Array.isArray(d)?d:[d]]));/** - * @license lucide-react v0.562.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Se=(r,a)=>{const l=p.forwardRef(({className:i,...c},d)=>p.createElement(cw,{ref:d,iconNode:a,className:ap(`lucide-${aw(rm(r))}`,`lucide-${r}`,i),...c}));return l.displayName=rm(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 uw=[["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"}]],sm=Se("bitcoin",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:"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"}]],Ts=Se("book-open",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:"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"}]],Jc=Se("calendar",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:"M20 6 9 17l-5-5",key:"1gmf2c"}]],Co=Se("check",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 mw=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],lp=Se("chevron-down",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 pw=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],op=Se("chevron-right",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=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],gw=Se("chevron-up",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 yw=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]],vw=Se("circle-alert",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:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]],Zc=Se("circle-check-big",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=[["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"}]],ip=Se("circle-question-mark",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 jw=[["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"}]],am=Se("circle-user",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 Nw=[["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"}]],Sw=Se("circle-x",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 Cw=[["path",{d:"M12 6v6l4 2",key:"mmk7yg"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],cp=Se("clock",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=[["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"}]],up=Se("copy",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=[["rect",{width:"20",height:"14",x:"2",y:"5",rx:"2",key:"ynyp8z"}],["line",{x1:"2",x2:"22",y1:"10",y2:"10",key:"1b3vmo"}]],eu=Se("credit-card",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 Pw=[["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"}]],Rw=Se("database",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 _w=[["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"}]],uo=Se("dollar-sign",_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 Tw=[["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"}]],dp=Se("download",Tw);/** - * @license lucide-react v0.562.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:"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"}]],fo=Se("external-link",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=[["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"}]],Eu=Se("eye",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:"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"}]],fp=Se("file-text",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=[["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"}]],Dw=Se("funnel",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=[["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"}]],lm=Se("gift",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=[["circle",{cx:"18",cy:"18",r:"3",key:"1xkwt0"}],["circle",{cx:"6",cy:"6",r:"3",key:"1lh9wr"}],["path",{d:"M6 21V9a9 9 0 0 0 9 9",key:"7kw0sc"}]],zw=Se("git-merge",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 $w=[["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"}]],tu=Se("globe",$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 Bw=[["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"}]],om=Se("history",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:"M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8",key:"5wwlr5"}],["path",{d:"M3 10a2 2 0 0 1 .709-1.528l7-6a2 2 0 0 1 2.582 0l7 6A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z",key:"r6nss1"}]],Vw=Se("house",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 Ww=[["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"}]],Hw=Se("image",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 Kw=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],im=Se("info",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 Gw=[["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"}]],cm=Se("key",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 Qw=[["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"}]],Yw=Se("layout-dashboard",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 Xw=[["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"}]],Es=Se("link-2",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 qw=[["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"}]],um=Se("link",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 Jw=[["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"}]],Zw=Se("lock",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 e1=[["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"}]],t1=Se("log-out",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 n1=[["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"}]],r1=Se("map-pin",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:"M4 5h16",key:"1tepv9"}],["path",{d:"M4 12h16",key:"1lakjw"}],["path",{d:"M4 19h16",key:"1djgab"}]],a1=Se("menu",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:"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"}]],o1=Se("message-circle",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 i1=[["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"}]],c1=Se("palette",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 u1=[["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"}]],Is=Se("pen-line",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=[["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"}]],f1=Se("percent",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 h1=[["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"}]],m1=Se("phone",h1);/** - * @license lucide-react v0.562.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const p1=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],Ps=Se("plus",p1);/** - * @license lucide-react v0.562.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=[["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"}]],dm=Se("qr-code",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=[["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"}]],Ye=Se("refresh-cw",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:"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"}]],Wn=Se("save",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 v1=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],Vr=Se("search",v1);/** - * @license lucide-react v0.562.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:"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"}]],ho=Se("settings",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:"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"}]],j1=Se("settings-2",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:"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"}]],S1=Se("shield-check",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 C1=[["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"}]],nu=Se("shopping-bag",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=[["rect",{width:"14",height:"20",x:"5",y:"2",rx:"2",ry:"2",key:"1yt0o3"}],["path",{d:"M12 18h.01",key:"mhygvu"}]],ru=Se("smartphone",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:"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"}]],P1=Se("tag",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 R1=[["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"}]],hp=Se("trash-2",R1);/** - * @license lucide-react v0.562.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:"M16 7h6v6",key:"box55l"}],["path",{d:"m22 7-8.5 8.5-5-5L2 17",key:"1t1m79"}]],su=Se("trending-up",_1);/** - * @license lucide-react v0.562.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:"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"}]],ks=Se("upload",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 I1=[["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"}]],fm=Se("user-plus",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 A1=[["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"}]],ro=Se("user",A1);/** - * @license lucide-react v0.562.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:"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"}]],Rn=Se("users",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 L1=[["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"}]],As=Se("wallet",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 D1=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],Hr=Se("x",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 O1=[["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"}]],F1=Se("zap",O1),Pu="admin_token";function z1(){try{return localStorage.getItem(Pu)}catch{return null}}function $1(r){try{localStorage.setItem(Pu,r)}catch{}}function B1(){try{localStorage.removeItem(Pu)}catch{}}const U1="https://soulapi.quwanzhi.com",V1=()=>{const r="https://soulapi.quwanzhi.com";return r.length>0?r.replace(/\/$/,""):U1};function au(r){const a=V1(),l=r.startsWith("/")?r:`/${r}`;return a?`${a}${l}`:l}async function ko(r,a={}){const{data:l,...i}=a,c=au(r),d=new Headers(i.headers),f=z1();f&&d.set("Authorization",`Bearer ${f}`),l!=null&&!d.has("Content-Type")&&d.set("Content-Type","application/json");const m=l!=null?JSON.stringify(l):i.body,x=await fetch(c,{...i,headers:d,body:m,credentials:"include"}),g=(x.headers.get("Content-Type")||"").includes("application/json")?await x.json():x;if(!x.ok){const y=new Error((g==null?void 0:g.error)||`HTTP ${x.status}`);throw y.status=x.status,y.data=g,y}return g}function Xe(r,a){return ko(r,{...a,method:"GET"})}function gt(r,a,l){return ko(r,{...l,method:"POST",data:a})}function Hn(r,a,l){return ko(r,{...l,method:"PUT",data:a})}function W1(r,a){return ko(r,{...a,method:"DELETE"})}const H1=[{icon:Yw,label:"数据概览",href:"/dashboard"},{icon:Ts,label:"内容管理",href:"/content"},{icon:Rn,label:"用户管理",href:"/users"},{icon:As,label:"交易中心",href:"/distribution"},{icon:zw,label:"匹配记录",href:"/match-records"},{icon:eu,label:"推广设置",href:"/referral-settings"},{icon:ho,label:"系统设置",href:"/settings"}];function K1(){const r=qr(),a=Ma(),[l,i]=p.useState(!1),[c,d]=p.useState(!1);p.useEffect(()=>{i(!0)},[]),p.useEffect(()=>{if(!l)return;d(!1);let m=!1;return Xe("/api/admin").then(x=>{m||(x&&x.success!==!1?d(!0):a("/login",{replace:!0}))}).catch(()=>{m||a("/login",{replace:!0})}),()=>{m=!0}},[l,a]);const f=async()=>{B1();try{await gt("/api/admin/logout",{})}catch{}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:H1.map(m=>{const x=r.pathname===m.href;return n.jsxs(sp,{to:m.href,className:`flex items-center gap-3 px-4 py-3 rounded-lg transition-colors ${x?"bg-[#38bdac]/20 text-[#38bdac] font-medium":"text-gray-400 hover:bg-gray-700/50 hover:text-white"}`,children:[n.jsx(m.icon,{className:"w-5 h-5"}),n.jsx("span",{className:"text-sm",children:m.label})]},m.href)})}),n.jsx("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(t1,{className:"w-5 h-5"}),n.jsx("span",{className:"text-sm",children:"退出登录"})]})})]}),n.jsx("div",{className:"flex-1 overflow-auto bg-[#0a1628]",children:n.jsx(Kv,{})})]})}function hm(r,a){if(typeof r=="function")return r(a);r!=null&&(r.current=a)}function Ru(...r){return a=>{let l=!1;const i=r.map(c=>{const d=hm(c,a);return!l&&typeof d=="function"&&(l=!0),d});if(l)return()=>{for(let c=0;c{let{children:d,...f}=i;mp(d)&&typeof mo=="function"&&(d=mo(d._payload));const m=p.Children.toArray(d),x=m.find(q1);if(x){const v=x.props.children,g=m.map(y=>y===x?p.Children.count(v)>1?p.Children.only(null):p.isValidElement(v)?v.props.children:null:y);return n.jsx(a,{...f,ref:c,children:p.isValidElement(v)?p.cloneElement(v,void 0,g):null})}return n.jsx(a,{...f,ref:c,children:d})});return l.displayName=`${r}.Slot`,l}var xp=pp("Slot");function Y1(r){const a=p.forwardRef((l,i)=>{let{children:c,...d}=l;if(mp(c)&&typeof mo=="function"&&(c=mo(c._payload)),p.isValidElement(c)){const f=Z1(c),m=J1(d,c.props);return c.type!==p.Fragment&&(m.ref=i?Ru(i,f):f),p.cloneElement(c,m)}return p.Children.count(c)>1?p.Children.only(null):null});return a.displayName=`${r}.SlotClone`,a}var X1=Symbol("radix.slottable");function q1(r){return p.isValidElement(r)&&typeof r.type=="function"&&"__radixId"in r.type&&r.type.__radixId===X1}function J1(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 x=d(...m);return c(...m),x}:c&&(l[i]=c):i==="style"?l[i]={...c,...d}:i==="className"&&(l[i]=[c,d].filter(Boolean).join(" "))}return{...r,...l}}function Z1(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 gp(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;atypeof r=="boolean"?`${r}`:r===0?"0":r,pm=yp,vp=(r,a)=>l=>{var i;if((a==null?void 0:a.variants)==null)return pm(r,l==null?void 0:l.class,l==null?void 0:l.className);const{variants:c,defaultVariants:d}=a,f=Object.keys(c).map(v=>{const g=l==null?void 0:l[v],y=d==null?void 0:d[v];if(g===null)return null;const C=mm(g)||mm(y);return c[v][C]}),m=l&&Object.entries(l).reduce((v,g)=>{let[y,C]=g;return C===void 0||(v[y]=C),v},{}),x=a==null||(i=a.compoundVariants)===null||i===void 0?void 0:i.reduce((v,g)=>{let{class:y,className:C,...E}=g;return Object.entries(E).every(k=>{let[j,b]=k;return Array.isArray(b)?b.includes({...d,...m}[j]):{...d,...m}[j]===b})?[...v,y,C]:v},[]);return pm(r,f,x,l==null?void 0:l.class,l==null?void 0:l.className)},eb=(r,a)=>{const l=new Array(r.length+a.length);for(let i=0;i({classGroupId:r,validator:a}),wp=(r=new Map,a=null,l)=>({nextPart:r,validators:a,classGroupId:l}),po="-",xm=[],nb="arbitrary..",rb=r=>{const a=ab(r),{conflictingClassGroups:l,conflictingClassGroupModifiers:i}=r;return{getClassGroupId:f=>{if(f.startsWith("[")&&f.endsWith("]"))return sb(f);const m=f.split(po),x=m[0]===""&&m.length>1?1:0;return bp(m,x,a)},getConflictingClassGroupIds:(f,m)=>{if(m){const x=i[f],v=l[f];return x?v?eb(v,x):x:v||xm}return l[f]||xm}}},bp=(r,a,l)=>{if(r.length-a===0)return l.classGroupId;const c=r[a],d=l.nextPart.get(c);if(d){const v=bp(r,a+1,d);if(v)return v}const f=l.validators;if(f===null)return;const m=a===0?r.join(po):r.slice(a).join(po),x=f.length;for(let v=0;vr.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const a=r.slice(1,-1),l=a.indexOf(":"),i=a.slice(0,l);return i?nb+i:void 0})(),ab=r=>{const{theme:a,classGroups:l}=r;return lb(l,a)},lb=(r,a)=>{const l=wp();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{if(typeof r=="string"){ib(r,a,l);return}if(typeof r=="function"){cb(r,a,l,i);return}ub(r,a,l,i)},ib=(r,a,l)=>{const i=r===""?a:jp(a,r);i.classGroupId=l},cb=(r,a,l,i)=>{if(db(r)){_u(r(i),a,l,i);return}a.validators===null&&(a.validators=[]),a.validators.push(tb(l,r))},ub=(r,a,l,i)=>{const c=Object.entries(r),d=c.length;for(let f=0;f{let l=r;const i=a.split(po),c=i.length;for(let d=0;d"isThemeGetter"in r&&r.isThemeGetter===!0,fb=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)}}},lu="!",gm=":",hb=[],ym=(r,a,l,i,c)=>({modifiers:r,hasImportantModifier:a,baseClassName:l,maybePostfixModifierPosition:i,isExternal:c}),mb=r=>{const{prefix:a,experimentalParseClassName:l}=r;let i=c=>{const d=[];let f=0,m=0,x=0,v;const g=c.length;for(let j=0;jx?v-x:void 0;return ym(d,E,C,k)};if(a){const c=a+gm,d=i;i=f=>f.startsWith(c)?d(f.slice(c.length)):ym(hb,!1,f,void 0,!0)}if(l){const c=i;i=d=>l({className:d,parseClassName:c})}return i},pb=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;d0&&(c.sort(),i.push(...c),c=[]),i.push(f)):c.push(f)}return c.length>0&&(c.sort(),i.push(...c)),i}},xb=r=>({cache:fb(r.cacheSize),parseClassName:mb(r),sortModifiers:pb(r),...rb(r)}),gb=/\s+/,yb=(r,a)=>{const{parseClassName:l,getClassGroupId:i,getConflictingClassGroupIds:c,sortModifiers:d}=a,f=[],m=r.trim().split(gb);let x="";for(let v=m.length-1;v>=0;v-=1){const g=m[v],{isExternal:y,modifiers:C,hasImportantModifier:E,baseClassName:k,maybePostfixModifierPosition:j}=l(g);if(y){x=g+(x.length>0?" "+x:x);continue}let b=!!j,S=i(b?k.substring(0,j):k);if(!S){if(!b){x=g+(x.length>0?" "+x:x);continue}if(S=i(k),!S){x=g+(x.length>0?" "+x:x);continue}b=!1}const P=C.length===0?"":C.length===1?C[0]:d(C).join(":"),N=E?P+lu:P,T=N+S;if(f.indexOf(T)>-1)continue;f.push(T);const U=c(S,b);for(let G=0;G0?" "+x:x)}return x},vb=(...r)=>{let a=0,l,i,c="";for(;a{if(typeof r=="string")return r;let a,l="";for(let i=0;i{let l,i,c,d;const f=x=>{const v=a.reduce((g,y)=>y(g),r());return l=xb(v),i=l.cache.get,c=l.cache.set,d=m,m(x)},m=x=>{const v=i(x);if(v)return v;const g=yb(x,l);return c(x,g),g};return d=f,(...x)=>d(vb(...x))},bb=[],mt=r=>{const a=l=>l[r]||bb;return a.isThemeGetter=!0,a},Sp=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,Cp=/^\((?:(\w[\w-]*):)?(.+)\)$/i,jb=/^\d+\/\d+$/,Nb=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Sb=/\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$/,Cb=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,kb=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Eb=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,js=r=>jb.test(r),Me=r=>!!r&&!Number.isNaN(Number(r)),mr=r=>!!r&&Number.isInteger(Number(r)),Lc=r=>r.endsWith("%")&&Me(r.slice(0,-1)),Un=r=>Nb.test(r),Pb=()=>!0,Rb=r=>Sb.test(r)&&!Cb.test(r),kp=()=>!1,_b=r=>kb.test(r),Tb=r=>Eb.test(r),Ib=r=>!we(r)&&!be(r),Ab=r=>Os(r,Rp,kp),we=r=>Sp.test(r),Br=r=>Os(r,_p,Rb),Dc=r=>Os(r,Fb,Me),vm=r=>Os(r,Ep,kp),Mb=r=>Os(r,Pp,Tb),Yl=r=>Os(r,Tp,_b),be=r=>Cp.test(r),Ea=r=>Fs(r,_p),Lb=r=>Fs(r,zb),wm=r=>Fs(r,Ep),Db=r=>Fs(r,Rp),Ob=r=>Fs(r,Pp),Xl=r=>Fs(r,Tp,!0),Os=(r,a,l)=>{const i=Sp.exec(r);return i?i[1]?a(i[1]):l(i[2]):!1},Fs=(r,a,l=!1)=>{const i=Cp.exec(r);return i?i[1]?a(i[1]):l:!1},Ep=r=>r==="position"||r==="percentage",Pp=r=>r==="image"||r==="url",Rp=r=>r==="length"||r==="size"||r==="bg-size",_p=r=>r==="length",Fb=r=>r==="number",zb=r=>r==="family-name",Tp=r=>r==="shadow",$b=()=>{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"),x=mt("spacing"),v=mt("radius"),g=mt("shadow"),y=mt("inset-shadow"),C=mt("text-shadow"),E=mt("drop-shadow"),k=mt("blur"),j=mt("perspective"),b=mt("aspect"),S=mt("ease"),P=mt("animate"),N=()=>["auto","avoid","all","avoid-page","page","left","right","column"],T=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],U=()=>[...T(),be,we],G=()=>["auto","hidden","clip","visible","scroll"],D=()=>["auto","contain","none"],V=()=>[be,we,x],se=()=>[js,"full","auto",...V()],he=()=>[mr,"none","subgrid",be,we],de=()=>["auto",{span:["full",mr,be,we]},mr,be,we],fe=()=>[mr,"auto",be,we],Y=()=>["auto","min","max","fr",be,we],B=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],z=()=>["start","end","center","stretch","center-safe","end-safe"],K=()=>["auto",...V()],H=()=>[js,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...V()],I=()=>[r,be,we],X=()=>[...T(),wm,vm,{position:[be,we]}],ne=()=>["no-repeat",{repeat:["","x","y","space","round"]}],L=()=>["auto","cover","contain",Db,Ab,{size:[be,we]}],R=()=>[Lc,Ea,Br],ee=()=>["","none","full",v,be,we],q=()=>["",Me,Ea,Br],le=()=>["solid","dashed","dotted","double"],ue=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],Q=()=>[Me,Lc,wm,vm],ie=()=>["","none",k,be,we],je=()=>["none",Me,be,we],ye=()=>["none",Me,be,we],Pe=()=>[Me,be,we],Ie=()=>[js,"full",...V()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[Un],breakpoint:[Un],color:[Pb],container:[Un],"drop-shadow":[Un],ease:["in","out","in-out"],font:[Ib],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[Un],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[Un],shadow:[Un],spacing:["px",Me],text:[Un],"text-shadow":[Un],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",js,we,be,b]}],container:["container"],columns:[{columns:[Me,we,be,m]}],"break-after":[{"break-after":N()}],"break-before":[{"break-before":N()}],"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:U()}],overflow:[{overflow:G()}],"overflow-x":[{"overflow-x":G()}],"overflow-y":[{"overflow-y":G()}],overscroll:[{overscroll:D()}],"overscroll-x":[{"overscroll-x":D()}],"overscroll-y":[{"overscroll-y":D()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:se()}],"inset-x":[{"inset-x":se()}],"inset-y":[{"inset-y":se()}],start:[{start:se()}],end:[{end:se()}],top:[{top:se()}],right:[{right:se()}],bottom:[{bottom:se()}],left:[{left:se()}],visibility:["visible","invisible","collapse"],z:[{z:[mr,"auto",be,we]}],basis:[{basis:[js,"full","auto",m,...V()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[Me,js,"auto","initial","none",we]}],grow:[{grow:["",Me,be,we]}],shrink:[{shrink:["",Me,be,we]}],order:[{order:[mr,"first","last","none",be,we]}],"grid-cols":[{"grid-cols":he()}],"col-start-end":[{col:de()}],"col-start":[{"col-start":fe()}],"col-end":[{"col-end":fe()}],"grid-rows":[{"grid-rows":he()}],"row-start-end":[{row:de()}],"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":Y()}],"auto-rows":[{"auto-rows":Y()}],gap:[{gap:V()}],"gap-x":[{"gap-x":V()}],"gap-y":[{"gap-y":V()}],"justify-content":[{justify:[...B(),"normal"]}],"justify-items":[{"justify-items":[...z(),"normal"]}],"justify-self":[{"justify-self":["auto",...z()]}],"align-content":[{content:["normal",...B()]}],"align-items":[{items:[...z(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...z(),{baseline:["","last"]}]}],"place-content":[{"place-content":B()}],"place-items":[{"place-items":[...z(),"baseline"]}],"place-self":[{"place-self":["auto",...z()]}],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:K()}],mx:[{mx:K()}],my:[{my:K()}],ms:[{ms:K()}],me:[{me:K()}],mt:[{mt:K()}],mr:[{mr:K()}],mb:[{mb:K()}],ml:[{ml:K()}],"space-x":[{"space-x":V()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":V()}],"space-y-reverse":["space-y-reverse"],size:[{size:H()}],w:[{w:[m,"screen",...H()]}],"min-w":[{"min-w":[m,"screen","none",...H()]}],"max-w":[{"max-w":[m,"screen","none","prose",{screen:[f]},...H()]}],h:[{h:["screen","lh",...H()]}],"min-h":[{"min-h":["screen","lh","none",...H()]}],"max-h":[{"max-h":["screen","lh",...H()]}],"font-size":[{text:["base",l,Ea,Br]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[i,be,Dc]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",Lc,we]}],"font-family":[{font:[Lb,we,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,be,we]}],"line-clamp":[{"line-clamp":[Me,"none",be,Dc]}],leading:[{leading:[d,...V()]}],"list-image":[{"list-image":["none",be,we]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",be,we]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:I()}],"text-color":[{text:I()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...le(),"wavy"]}],"text-decoration-thickness":[{decoration:[Me,"from-font","auto",be,Br]}],"text-decoration-color":[{decoration:I()}],"underline-offset":[{"underline-offset":[Me,"auto",be,we]}],"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",be,we]}],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",be,we]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:X()}],"bg-repeat":[{bg:ne()}],"bg-size":[{bg:L()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},mr,be,we],radial:["",be,we],conic:[mr,be,we]},Ob,Mb]}],"bg-color":[{bg:I()}],"gradient-from-pos":[{from:R()}],"gradient-via-pos":[{via:R()}],"gradient-to-pos":[{to:R()}],"gradient-from":[{from:I()}],"gradient-via":[{via:I()}],"gradient-to":[{to:I()}],rounded:[{rounded:ee()}],"rounded-s":[{"rounded-s":ee()}],"rounded-e":[{"rounded-e":ee()}],"rounded-t":[{"rounded-t":ee()}],"rounded-r":[{"rounded-r":ee()}],"rounded-b":[{"rounded-b":ee()}],"rounded-l":[{"rounded-l":ee()}],"rounded-ss":[{"rounded-ss":ee()}],"rounded-se":[{"rounded-se":ee()}],"rounded-ee":[{"rounded-ee":ee()}],"rounded-es":[{"rounded-es":ee()}],"rounded-tl":[{"rounded-tl":ee()}],"rounded-tr":[{"rounded-tr":ee()}],"rounded-br":[{"rounded-br":ee()}],"rounded-bl":[{"rounded-bl":ee()}],"border-w":[{border:q()}],"border-w-x":[{"border-x":q()}],"border-w-y":[{"border-y":q()}],"border-w-s":[{"border-s":q()}],"border-w-e":[{"border-e":q()}],"border-w-t":[{"border-t":q()}],"border-w-r":[{"border-r":q()}],"border-w-b":[{"border-b":q()}],"border-w-l":[{"border-l":q()}],"divide-x":[{"divide-x":q()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":q()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...le(),"hidden","none"]}],"divide-style":[{divide:[...le(),"hidden","none"]}],"border-color":[{border:I()}],"border-color-x":[{"border-x":I()}],"border-color-y":[{"border-y":I()}],"border-color-s":[{"border-s":I()}],"border-color-e":[{"border-e":I()}],"border-color-t":[{"border-t":I()}],"border-color-r":[{"border-r":I()}],"border-color-b":[{"border-b":I()}],"border-color-l":[{"border-l":I()}],"divide-color":[{divide:I()}],"outline-style":[{outline:[...le(),"none","hidden"]}],"outline-offset":[{"outline-offset":[Me,be,we]}],"outline-w":[{outline:["",Me,Ea,Br]}],"outline-color":[{outline:I()}],shadow:[{shadow:["","none",g,Xl,Yl]}],"shadow-color":[{shadow:I()}],"inset-shadow":[{"inset-shadow":["none",y,Xl,Yl]}],"inset-shadow-color":[{"inset-shadow":I()}],"ring-w":[{ring:q()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:I()}],"ring-offset-w":[{"ring-offset":[Me,Br]}],"ring-offset-color":[{"ring-offset":I()}],"inset-ring-w":[{"inset-ring":q()}],"inset-ring-color":[{"inset-ring":I()}],"text-shadow":[{"text-shadow":["none",C,Xl,Yl]}],"text-shadow-color":[{"text-shadow":I()}],opacity:[{opacity:[Me,be,we]}],"mix-blend":[{"mix-blend":[...ue(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":ue()}],"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":Q()}],"mask-image-linear-to-pos":[{"mask-linear-to":Q()}],"mask-image-linear-from-color":[{"mask-linear-from":I()}],"mask-image-linear-to-color":[{"mask-linear-to":I()}],"mask-image-t-from-pos":[{"mask-t-from":Q()}],"mask-image-t-to-pos":[{"mask-t-to":Q()}],"mask-image-t-from-color":[{"mask-t-from":I()}],"mask-image-t-to-color":[{"mask-t-to":I()}],"mask-image-r-from-pos":[{"mask-r-from":Q()}],"mask-image-r-to-pos":[{"mask-r-to":Q()}],"mask-image-r-from-color":[{"mask-r-from":I()}],"mask-image-r-to-color":[{"mask-r-to":I()}],"mask-image-b-from-pos":[{"mask-b-from":Q()}],"mask-image-b-to-pos":[{"mask-b-to":Q()}],"mask-image-b-from-color":[{"mask-b-from":I()}],"mask-image-b-to-color":[{"mask-b-to":I()}],"mask-image-l-from-pos":[{"mask-l-from":Q()}],"mask-image-l-to-pos":[{"mask-l-to":Q()}],"mask-image-l-from-color":[{"mask-l-from":I()}],"mask-image-l-to-color":[{"mask-l-to":I()}],"mask-image-x-from-pos":[{"mask-x-from":Q()}],"mask-image-x-to-pos":[{"mask-x-to":Q()}],"mask-image-x-from-color":[{"mask-x-from":I()}],"mask-image-x-to-color":[{"mask-x-to":I()}],"mask-image-y-from-pos":[{"mask-y-from":Q()}],"mask-image-y-to-pos":[{"mask-y-to":Q()}],"mask-image-y-from-color":[{"mask-y-from":I()}],"mask-image-y-to-color":[{"mask-y-to":I()}],"mask-image-radial":[{"mask-radial":[be,we]}],"mask-image-radial-from-pos":[{"mask-radial-from":Q()}],"mask-image-radial-to-pos":[{"mask-radial-to":Q()}],"mask-image-radial-from-color":[{"mask-radial-from":I()}],"mask-image-radial-to-color":[{"mask-radial-to":I()}],"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":T()}],"mask-image-conic-pos":[{"mask-conic":[Me]}],"mask-image-conic-from-pos":[{"mask-conic-from":Q()}],"mask-image-conic-to-pos":[{"mask-conic-to":Q()}],"mask-image-conic-from-color":[{"mask-conic-from":I()}],"mask-image-conic-to-color":[{"mask-conic-to":I()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:X()}],"mask-repeat":[{mask:ne()}],"mask-size":[{mask:L()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",be,we]}],filter:[{filter:["","none",be,we]}],blur:[{blur:ie()}],brightness:[{brightness:[Me,be,we]}],contrast:[{contrast:[Me,be,we]}],"drop-shadow":[{"drop-shadow":["","none",E,Xl,Yl]}],"drop-shadow-color":[{"drop-shadow":I()}],grayscale:[{grayscale:["",Me,be,we]}],"hue-rotate":[{"hue-rotate":[Me,be,we]}],invert:[{invert:["",Me,be,we]}],saturate:[{saturate:[Me,be,we]}],sepia:[{sepia:["",Me,be,we]}],"backdrop-filter":[{"backdrop-filter":["","none",be,we]}],"backdrop-blur":[{"backdrop-blur":ie()}],"backdrop-brightness":[{"backdrop-brightness":[Me,be,we]}],"backdrop-contrast":[{"backdrop-contrast":[Me,be,we]}],"backdrop-grayscale":[{"backdrop-grayscale":["",Me,be,we]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[Me,be,we]}],"backdrop-invert":[{"backdrop-invert":["",Me,be,we]}],"backdrop-opacity":[{"backdrop-opacity":[Me,be,we]}],"backdrop-saturate":[{"backdrop-saturate":[Me,be,we]}],"backdrop-sepia":[{"backdrop-sepia":["",Me,be,we]}],"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",be,we]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[Me,"initial",be,we]}],ease:[{ease:["linear","initial",S,be,we]}],delay:[{delay:[Me,be,we]}],animate:[{animate:["none",P,be,we]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[j,be,we]}],"perspective-origin":[{"perspective-origin":U()}],rotate:[{rotate:je()}],"rotate-x":[{"rotate-x":je()}],"rotate-y":[{"rotate-y":je()}],"rotate-z":[{"rotate-z":je()}],scale:[{scale:ye()}],"scale-x":[{"scale-x":ye()}],"scale-y":[{"scale-y":ye()}],"scale-z":[{"scale-z":ye()}],"scale-3d":["scale-3d"],skew:[{skew:Pe()}],"skew-x":[{"skew-x":Pe()}],"skew-y":[{"skew-y":Pe()}],transform:[{transform:[be,we,"","none","gpu","cpu"]}],"transform-origin":[{origin:U()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:Ie()}],"translate-x":[{"translate-x":Ie()}],"translate-y":[{"translate-y":Ie()}],"translate-z":[{"translate-z":Ie()}],"translate-none":["translate-none"],accent:[{accent:I()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:I()}],"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",be,we]}],"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",be,we]}],fill:[{fill:["none",...I()]}],"stroke-w":[{stroke:[Me,Ea,Br,Dc]}],stroke:[{stroke:["none",...I()]}],"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"]}},Bb=wb($b);function He(...r){return Bb(yp(r))}const Ub=vp("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 ge({className:r,variant:a,size:l,asChild:i=!1,...c}){const d=i?xp:"button";return n.jsx(d,{"data-slot":"button",className:He(Ub({variant:a,size:l,className:r})),...c})}function me({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 Vb(){const r=Ma(),[a,l]=p.useState(""),[i,c]=p.useState(""),[d,f]=p.useState(""),[m,x]=p.useState(!1),v=async()=>{f(""),x(!0);try{const g=await gt("/api/admin",{username:a.trim(),password:i});if((g==null?void 0:g.success)!==!1&&(g!=null&&g.token)){$1(g.token),r("/dashboard",{replace:!0});return}f(g.error||"用户名或密码错误")}catch(g){const y=g;f(y.status===401?"用户名或密码错误":(y==null?void 0:y.message)||"网络错误,请重试")}finally{x(!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(S1,{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(ro,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-5 h-5 text-gray-500"}),n.jsx(me,{type:"text",value:a,onChange:g=>l(g.target.value),placeholder:"请输入用户名",className:"pl-10 bg-[#0a1628] border-gray-700 text-white placeholder:text-gray-500 focus:border-[#38bdac]"})]})]}),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(Zw,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-5 h-5 text-gray-500"}),n.jsx(me,{type:"password",value:i,onChange:g=>c(g.target.value),placeholder:"请输入密码",className:"pl-10 bg-[#0a1628] border-gray-700 text-white placeholder:text-gray-500 focus:border-[#38bdac]",onKeyDown:g=>g.key==="Enter"&&v()})]})]}),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(ge,{onClick:v,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 Re=p.forwardRef(({className:r,...a},l)=>n.jsx("div",{ref:l,className:He("rounded-xl border bg-card text-card-foreground shadow",r),...a}));Re.displayName="Card";const Ue=p.forwardRef(({className:r,...a},l)=>n.jsx("div",{ref:l,className:He("flex flex-col space-y-1.5 p-6",r),...a}));Ue.displayName="CardHeader";const Ve=p.forwardRef(({className:r,...a},l)=>n.jsx("h3",{ref:l,className:He("font-semibold leading-none tracking-tight",r),...a}));Ve.displayName="CardTitle";const ut=p.forwardRef(({className:r,...a},l)=>n.jsx("p",{ref:l,className:He("text-sm text-muted-foreground",r),...a}));ut.displayName="CardDescription";const _e=p.forwardRef(({className:r,...a},l)=>n.jsx("div",{ref:l,className:He("p-6 pt-0",r),...a}));_e.displayName="CardContent";const Wb=p.forwardRef(({className:r,...a},l)=>n.jsx("div",{ref:l,className:He("flex items-center p-6 pt-0",r),...a}));Wb.displayName="CardFooter";function Hb(){const r=Ma(),[a,l]=p.useState(!0),[i,c]=p.useState([]),[d,f]=p.useState([]);async function m(){l(!0);try{const[k,j]=await Promise.all([Xe("/api/db/users"),Xe("/api/orders")]);k!=null&&k.success&&k.users&&c(k.users),j!=null&&j.success&&j.orders&&f(j.orders)}catch(k){console.error("加载数据失败",k)}finally{l(!1)}}if(p.useEffect(()=>{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.jsxs("div",{className:"flex flex-col items-center justify-center py-24",children:[n.jsx(Ye,{className:"w-12 h-12 text-[#38bdac] animate-spin mb-4"}),n.jsx("span",{className:"text-gray-400",children:"加载中..."})]})]});const v=d.filter(k=>k.status==="paid"||k.status==="completed"||k.status==="success").reduce((k,j)=>k+Number(j.amount||0),0),g=i.length,y=d.length,C=k=>{const j=k.productType||"",b=k.description||"";if(b){if(j==="section"&&b.includes("章节")){if(b.includes("-")){const S=b.split("-");if(S.length>=3)return{title:`第${S[1]}章 第${S[2]}节`,subtitle:"《一场Soul的创业实验》"}}return{title:b,subtitle:"章节购买"}}return j==="fullbook"||b.includes("全书")?{title:"《一场Soul的创业实验》",subtitle:"全书购买"}:j==="match"||b.includes("伙伴")?{title:"找伙伴匹配",subtitle:"功能服务"}:{title:b,subtitle:j==="section"?"单章":j==="fullbook"?"全书":"其他"}}return j==="section"?{title:`章节 ${k.productId||""}`,subtitle:"单章购买"}:j==="fullbook"?{title:"《一场Soul的创业实验》",subtitle:"全书购买"}:j==="match"?{title:"找伙伴匹配",subtitle:"功能服务"}:{title:"未知商品",subtitle:j||"其他"}},E=[{title:"总用户数",value:g,icon:Rn,color:"text-blue-400",bg:"bg-blue-500/20",link:"/users"},{title:"总收入",value:`¥${Number(v).toFixed(2)}`,icon:su,color:"text-[#38bdac]",bg:"bg-[#38bdac]/20",link:"/orders"},{title:"订单数",value:y,icon:nu,color:"text-purple-400",bg:"bg-purple-500/20",link:"/orders"},{title:"转化率",value:`${g>0?(y/g*100).toFixed(1):0}%`,icon:Ts,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:E.map((k,j)=>n.jsxs(Re,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl cursor-pointer hover:border-[#38bdac]/50 transition-colors group",onClick:()=>k.link&&r(k.link),children:[n.jsxs(Ue,{className:"flex flex-row items-center justify-between pb-2",children:[n.jsx(Ve,{className:"text-sm font-medium text-gray-400",children:k.title}),n.jsx("div",{className:`p-2 rounded-lg ${k.bg}`,children:n.jsx(k.icon,{className:`w-4 h-4 ${k.color}`})})]}),n.jsx(_e,{children:n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsx("div",{className:"text-2xl font-bold text-white",children:k.value}),n.jsx(op,{className:"w-5 h-5 text-gray-600 group-hover:text-[#38bdac] transition-colors"})]})})]},j))}),n.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-8",children:[n.jsxs(Re,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:[n.jsx(Ue,{children:n.jsx(Ve,{className:"text-white",children:"最近订单"})}),n.jsx(_e,{children:n.jsxs("div",{className:"space-y-3",children:[d.slice(-5).reverse().map(k=>{var N;const j=k.referrerId?i.find(T=>T.id===k.referrerId):void 0,b=k.referralCode||(j==null?void 0:j.referralCode)||(j==null?void 0:j.nickname)||(k.referrerId?String(k.referrerId).slice(0,8):""),S=C(k),P=k.userNickname||((N=i.find(T=>T.id===k.userId))==null?void 0:N.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:[k.userAvatar?n.jsx("img",{src:k.userAvatar,alt:P,className:"w-9 h-9 rounded-full object-cover flex-shrink-0 mt-0.5",onError:T=>{T.currentTarget.style.display="none";const U=T.currentTarget.nextElementSibling;U&&U.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 ${k.userAvatar?"hidden":""}`,children:P.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:P}),n.jsx("span",{className:"text-gray-600",children:"·"}),n.jsx("span",{className:"text-sm font-medium text-white truncate",children:S.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:S.subtitle}),n.jsx("span",{children:new Date(k.createdAt||0).toLocaleString("zh-CN",{month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"})})]}),b&&n.jsxs("p",{className:"text-xs text-gray-600 mt-1",children:["推荐: ",b]})]})]}),n.jsxs("div",{className:"text-right ml-4 flex-shrink-0",children:[n.jsxs("p",{className:"text-sm font-bold text-[#38bdac]",children:["+¥",Number(k.amount).toFixed(2)]}),n.jsx("p",{className:"text-xs text-gray-500 mt-0.5",children:k.paymentMethod||"微信"})]})]},k.id)}),d.length===0&&n.jsxs("div",{className:"text-center py-12",children:[n.jsx(nu,{className:"w-12 h-12 text-gray-600 mx-auto mb-3"}),n.jsx("p",{className:"text-gray-500",children:"暂无订单数据"})]})]})})]}),n.jsxs(Re,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:[n.jsx(Ue,{children:n.jsx(Ve,{className:"text-white",children:"新注册用户"})}),n.jsx(_e,{children:n.jsxs("div",{className:"space-y-3",children:[i.slice(-5).reverse().map(k=>{var j;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:((j=k.nickname)==null?void 0:j.charAt(0))||"?"}),n.jsxs("div",{children:[n.jsx("p",{className:"text-sm font-medium text-white",children:k.nickname||"匿名用户"}),n.jsx("p",{className:"text-xs text-gray-500",children:k.phone||"-"})]})]}),n.jsx("p",{className:"text-xs text-gray-400",children:k.createdAt?new Date(k.createdAt).toLocaleDateString():"-"})]},k.id)}),i.length===0&&n.jsx("p",{className:"text-gray-500 text-center py-8",children:"暂无用户数据"})]})})]})]})]})}const La=p.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})}));La.displayName="Table";const Da=p.forwardRef(({className:r,...a},l)=>n.jsx("thead",{ref:l,className:He("[&_tr]:border-b",r),...a}));Da.displayName="TableHeader";const Oa=p.forwardRef(({className:r,...a},l)=>n.jsx("tbody",{ref:l,className:He("[&_tr:last-child]:border-0",r),...a}));Oa.displayName="TableBody";const nn=p.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}));nn.displayName="TableRow";const Ge=p.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}));Ge.displayName="TableHead";const Be=p.forwardRef(({className:r,...a},l)=>n.jsx("td",{ref:l,className:He("p-4 align-middle [&:has([role=checkbox])]:pr-0",r),...a}));Be.displayName="TableCell";const Kb=vp("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?xp:"span";return n.jsx(c,{className:He(Kb({variant:a}),r),...i})}function Ip(r,a){const[l,i]=p.useState(r);return p.useEffect(()=>{const c=setTimeout(()=>i(r),a);return()=>clearTimeout(c)},[r,a]),l}function Wr({page:r,totalPages:a,total:l,pageSize:i,onPageChange:c,onPageSizeChange:d,pageSizeOptions:f=[10,20,50,100]}){return a<=1&&!d?null:n.jsxs("div",{className:"flex items-center justify-between gap-4 py-4 px-5 border-t border-gray-700/50",children:[n.jsxs("div",{className:"flex items-center gap-2 text-sm text-gray-400",children:[n.jsxs("span",{children:["共 ",l," 条"]}),d&&n.jsx("select",{value:i,onChange:m=>d(Number(m.target.value)),className:"bg-[#0f2137] border border-gray-600 rounded px-2 py-1 text-gray-300 text-sm",children:f.map(m=>n.jsxs("option",{value:m,children:[m," 条/页"]},m))})]}),a>1&&n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx("button",{type:"button",onClick:()=>c(1),disabled:r<=1,className:"px-2 py-1 rounded border border-gray-600 text-gray-400 hover:bg-gray-700/50 disabled:opacity-40 text-sm",children:"首页"}),n.jsx("button",{type:"button",onClick:()=>c(r-1),disabled:r<=1,className:"px-3 py-1 rounded border border-gray-600 text-gray-400 hover:bg-gray-700/50 disabled:opacity-40 text-sm",children:"上一页"}),n.jsxs("span",{className:"px-3 py-1 text-gray-400 text-sm",children:[r," / ",a]}),n.jsx("button",{type:"button",onClick:()=>c(r+1),disabled:r>=a,className:"px-3 py-1 rounded border border-gray-600 text-gray-400 hover:bg-gray-700/50 disabled:opacity-40 text-sm",children:"下一页"}),n.jsx("button",{type:"button",onClick:()=>c(a),disabled:r>=a,className:"px-2 py-1 rounded border border-gray-600 text-gray-400 hover:bg-gray-700/50 disabled:opacity-40 text-sm",children:"末页"})]})]})}function Gb(){const[r,a]=p.useState([]),[l,i]=p.useState([]),[c,d]=p.useState(0),[f,m]=p.useState(0),[x,v]=p.useState(0),[g,y]=p.useState(1),[C,E]=p.useState(10),[k,j]=p.useState(""),b=Ip(k,300),[S,P]=p.useState("all"),[N,T]=p.useState(!0),[U,G]=p.useState(null);async function D(){T(!0),G(null);try{const Y=S==="all"?"":S==="completed"?"completed":S,B=new URLSearchParams({page:String(g),pageSize:String(C),...Y&&{status:Y},...b&&{search:b}}),[z,K]=await Promise.all([Xe(`/api/orders?${B}`),Xe("/api/db/users?page=1&pageSize=500")]);z!=null&&z.success&&(a(z.orders||[]),d(z.total??0),m(z.totalRevenue??0),v(z.todayRevenue??0)),K!=null&&K.success&&K.users&&i(K.users)}catch(Y){console.error("加载订单失败",Y),G("加载订单失败,请检查网络后重试")}finally{T(!1)}}p.useEffect(()=>{y(1)},[b,S]),p.useEffect(()=>{D()},[g,C,b,S]);const V=Y=>{var B;return Y.userNickname||((B=l.find(z=>z.id===Y.userId))==null?void 0:B.nickname)||"匿名用户"},se=Y=>{var B;return((B=l.find(z=>z.id===Y))==null?void 0:B.phone)||"-"},he=Y=>{const B=Y.productType||Y.type||"",z=Y.description||"";if(z){if(B==="section"&&z.includes("章节")){if(z.includes("-")){const K=z.split("-");if(K.length>=3)return{name:`第${K[1]}章 第${K[2]}节`,type:"《一场Soul的创业实验》"}}return{name:z,type:"章节购买"}}return B==="fullbook"||z.includes("全书")?{name:"《一场Soul的创业实验》",type:"全书购买"}:B==="vip"||z.includes("VIP")?{name:"VIP年度会员",type:"VIP"}:B==="match"||z.includes("伙伴")?{name:"找伙伴匹配",type:"功能服务"}:{name:z,type:"其他"}}return B==="section"?{name:`章节 ${Y.productId||Y.sectionId||""}`,type:"单章"}:B==="fullbook"?{name:"《一场Soul的创业实验》",type:"全书"}:B==="vip"?{name:"VIP年度会员",type:"VIP"}:B==="match"?{name:"找伙伴匹配",type:"功能"}:{name:"未知商品",type:B||"其他"}},de=Math.ceil(c/C)||1;function fe(){if(r.length===0){alert("暂无数据可导出");return}const Y=["订单号","用户","手机号","商品","金额","支付方式","状态","分销佣金","下单时间"],B=r.map(X=>{const ne=he(X);return[X.orderSn||X.id||"",V(X),se(X.userId),ne.name,Number(X.amount||0).toFixed(2),X.paymentMethod==="wechat"?"微信支付":X.paymentMethod==="alipay"?"支付宝":X.paymentMethod||"微信支付",X.status==="paid"||X.status==="completed"?"已完成":X.status==="pending"||X.status==="created"?"待支付":"已失败",X.referrerEarnings?Number(X.referrerEarnings).toFixed(2):"-",X.createdAt?new Date(X.createdAt).toLocaleString("zh-CN"):""].join(",")}),z="\uFEFF"+[Y.join(","),...B].join(` -`),K=new Blob([z],{type:"text/csv;charset=utf-8"}),H=URL.createObjectURL(K),I=document.createElement("a");I.href=H,I.download=`订单列表_${new Date().toISOString().slice(0,10)}.csv`,I.click(),URL.revokeObjectURL(H)}return n.jsxs("div",{className:"p-8 max-w-7xl mx-auto",children:[U&&n.jsxs("div",{className:"mb-4 px-4 py-3 rounded-lg bg-red-500/20 border border-red-500/50 text-red-400 text-sm flex items-center justify-between",children:[n.jsx("span",{children:U}),n.jsx("button",{type:"button",onClick:()=>G(null),className:"hover:text-red-300",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(ge,{variant:"outline",onClick:D,disabled:N,className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:[n.jsx(Ye,{className:`w-4 h-4 mr-2 ${N?"animate-spin":""}`}),"刷新"]}),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:["¥",f.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:["¥",x.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(Vr,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-gray-500"}),n.jsx(me,{type:"text",placeholder:"搜索订单号/用户/章节...",className:"pl-10 bg-[#0f2137] border-gray-700 text-white placeholder:text-gray-500",value:k,onChange:Y=>j(Y.target.value)})]}),n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx(Dw,{className:"w-4 h-4 text-gray-400"}),n.jsxs("select",{value:S,onChange:Y=>P(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(ge,{variant:"outline",onClick:fe,disabled:r.length===0,className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:[n.jsx(dp,{className:"w-4 h-4 mr-2"}),"导出 CSV"]})]}),n.jsx(Re,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:n.jsx(_e,{className:"p-0",children:N?n.jsxs("div",{className:"flex items-center justify-center py-12",children:[n.jsx(Ye,{className:"w-6 h-6 text-[#38bdac] animate-spin"}),n.jsx("span",{className:"ml-2 text-gray-400",children:"加载中..."})]}):n.jsxs("div",{children:[n.jsxs(La,{children:[n.jsx(Da,{children:n.jsxs(nn,{className:"bg-[#0a1628] hover:bg-[#0a1628] border-gray-700",children:[n.jsx(Ge,{className:"text-gray-400",children:"订单号"}),n.jsx(Ge,{className:"text-gray-400",children:"用户"}),n.jsx(Ge,{className:"text-gray-400",children:"商品"}),n.jsx(Ge,{className:"text-gray-400",children:"金额"}),n.jsx(Ge,{className:"text-gray-400",children:"支付方式"}),n.jsx(Ge,{className:"text-gray-400",children:"状态"}),n.jsx(Ge,{className:"text-gray-400",children:"分销佣金"}),n.jsx(Ge,{className:"text-gray-400",children:"下单时间"})]})}),n.jsxs(Oa,{children:[r.map(Y=>{const B=he(Y);return n.jsxs(nn,{className:"hover:bg-[#0a1628] border-gray-700/50",children:[n.jsxs(Be,{className:"font-mono text-xs text-gray-400",children:[(Y.orderSn||Y.id||"").slice(0,12),"..."]}),n.jsx(Be,{children:n.jsxs("div",{children:[n.jsx("p",{className:"text-white text-sm",children:V(Y)}),n.jsx("p",{className:"text-gray-500 text-xs",children:se(Y.userId)})]})}),n.jsx(Be,{children:n.jsxs("div",{children:[n.jsxs("p",{className:"text-white text-sm flex items-center gap-2",children:[B.name,(Y.productType||Y.type)==="vip"&&n.jsx(Oe,{className:"bg-amber-500/20 text-amber-400 hover:bg-amber-500/20 border-0 text-xs",children:"VIP"})]}),n.jsx("p",{className:"text-gray-500 text-xs",children:B.type})]})}),n.jsxs(Be,{className:"text-[#38bdac] font-bold",children:["¥",Number(Y.amount||0).toFixed(2)]}),n.jsx(Be,{className:"text-gray-300",children:Y.paymentMethod==="wechat"?"微信支付":Y.paymentMethod==="alipay"?"支付宝":Y.paymentMethod||"微信支付"}),n.jsx(Be,{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(Be,{className:"text-[#FFD700]",children:Y.referrerEarnings?`¥${Number(Y.referrerEarnings).toFixed(2)}`:"-"}),n.jsx(Be,{className:"text-gray-400 text-sm",children:new Date(Y.createdAt).toLocaleString("zh-CN")})]},Y.id)}),r.length===0&&n.jsx(nn,{children:n.jsx(Be,{colSpan:8,className:"text-center py-12 text-gray-500",children:"暂无订单数据"})})]})]}),n.jsx(Wr,{page:g,totalPages:de,total:c,pageSize:C,onPageChange:y,onPageSizeChange:Y=>{E(Y),y(1)}})]})})})]})}var Qb=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Yb=Qb.reduce((r,a)=>{const l=pp(`Primitive.${a}`),i=p.forwardRef((c,d)=>{const{asChild:f,...m}=c,x=f?l:a;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),n.jsx(x,{...m,ref:d})});return i.displayName=`Primitive.${a}`,{...r,[a]:i}},{}),Xb="Label",Ap=p.forwardRef((r,a)=>n.jsx(Yb.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())}}));Ap.displayName=Xb;var Mp=Ap;const oe=p.forwardRef(({className:r,...a},l)=>n.jsx(Mp,{ref:l,className:He("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",r),...a}));oe.displayName=Mp.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 qb(r,a){const l=p.createContext(a),i=d=>{const{children:f,...m}=d,x=p.useMemo(()=>m,Object.values(m));return n.jsx(l.Provider,{value:x,children:f})};i.displayName=r+"Provider";function c(d){const f=p.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 Cr(r,a=[]){let l=[];function i(d,f){const m=p.createContext(f),x=l.length;l=[...l,f];const v=y=>{var S;const{scope:C,children:E,...k}=y,j=((S=C==null?void 0:C[r])==null?void 0:S[x])||m,b=p.useMemo(()=>k,Object.values(k));return n.jsx(j.Provider,{value:b,children:E})};v.displayName=d+"Provider";function g(y,C){var j;const E=((j=C==null?void 0:C[r])==null?void 0:j[x])||m,k=p.useContext(E);if(k)return k;if(f!==void 0)return f;throw new Error(`\`${y}\` must be used within \`${d}\``)}return[v,g]}const c=()=>{const d=l.map(f=>p.createContext(f));return function(m){const x=(m==null?void 0:m[r])||d;return p.useMemo(()=>({[`__scope${r}`]:{...m,[r]:x}}),[m,x])}};return c.scopeName=r,[i,Jb(c,...a)]}function Jb(...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:x,scopeName:v})=>{const y=x(d)[`__scope${v}`];return{...m,...y}},{});return p.useMemo(()=>({[`__scope${a.scopeName}`]:f}),[f])}};return l.scopeName=a.scopeName,l}var Et=globalThis!=null&&globalThis.document?p.useLayoutEffect:()=>{},Zb=No[" useId ".trim().toString()]||(()=>{}),ej=0;function wr(r){const[a,l]=p.useState(Zb());return Et(()=>{l(i=>i??String(ej++))},[r]),a?`radix-${a}`:""}var tj=No[" useInsertionEffect ".trim().toString()]||Et;function Kr({prop:r,defaultProp:a,onChange:l=()=>{},caller:i}){const[c,d,f]=nj({defaultProp:a,onChange:l}),m=r!==void 0,x=m?r:c;{const g=p.useRef(r!==void 0);p.useEffect(()=>{const y=g.current;y!==m&&console.warn(`${i} is changing from ${y?"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.`),g.current=m},[m,i])}const v=p.useCallback(g=>{var y;if(m){const C=rj(g)?g(r):g;C!==r&&((y=f.current)==null||y.call(f,C))}else d(g)},[m,r,d,f]);return[x,v]}function nj({defaultProp:r,onChange:a}){const[l,i]=p.useState(r),c=p.useRef(l),d=p.useRef(a);return tj(()=>{d.current=a},[a]),p.useEffect(()=>{var f;c.current!==l&&((f=d.current)==null||f.call(d,l),c.current=l)},[l,c]),[l,i,d]}function rj(r){return typeof r=="function"}function Ta(r){const a=sj(r),l=p.forwardRef((i,c)=>{const{children:d,...f}=i,m=p.Children.toArray(d),x=m.find(lj);if(x){const v=x.props.children,g=m.map(y=>y===x?p.Children.count(v)>1?p.Children.only(null):p.isValidElement(v)?v.props.children:null:y);return n.jsx(a,{...f,ref:c,children:p.isValidElement(v)?p.cloneElement(v,void 0,g):null})}return n.jsx(a,{...f,ref:c,children:d})});return l.displayName=`${r}.Slot`,l}function sj(r){const a=p.forwardRef((l,i)=>{const{children:c,...d}=l;if(p.isValidElement(c)){const f=ij(c),m=oj(d,c.props);return c.type!==p.Fragment&&(m.ref=i?Ru(i,f):f),p.cloneElement(c,m)}return p.Children.count(c)>1?p.Children.only(null):null});return a.displayName=`${r}.SlotClone`,a}var aj=Symbol("radix.slottable");function lj(r){return p.isValidElement(r)&&typeof r.type=="function"&&"__radixId"in r.type&&r.type.__radixId===aj}function oj(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 x=d(...m);return c(...m),x}:c&&(l[i]=c):i==="style"?l[i]={...c,...d}:i==="className"&&(l[i]=[c,d].filter(Boolean).join(" "))}return{...r,...l}}function ij(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 cj=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Le=cj.reduce((r,a)=>{const l=Ta(`Primitive.${a}`),i=p.forwardRef((c,d)=>{const{asChild:f,...m}=c,x=f?l:a;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),n.jsx(x,{...m,ref:d})});return i.displayName=`Primitive.${a}`,{...r,[a]:i}},{});function uj(r,a){r&&Aa.flushSync(()=>r.dispatchEvent(a))}function br(r){const a=p.useRef(r);return p.useEffect(()=>{a.current=r}),p.useMemo(()=>(...l)=>{var i;return(i=a.current)==null?void 0:i.call(a,...l)},[])}function dj(r,a=globalThis==null?void 0:globalThis.document){const l=br(r);p.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 fj="DismissableLayer",ou="dismissableLayer.update",hj="dismissableLayer.pointerDownOutside",mj="dismissableLayer.focusOutside",bm,Lp=p.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Tu=p.forwardRef((r,a)=>{const{disableOutsidePointerEvents:l=!1,onEscapeKeyDown:i,onPointerDownOutside:c,onFocusOutside:d,onInteractOutside:f,onDismiss:m,...x}=r,v=p.useContext(Lp),[g,y]=p.useState(null),C=(g==null?void 0:g.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,E]=p.useState({}),k=We(a,D=>y(D)),j=Array.from(v.layers),[b]=[...v.layersWithOutsidePointerEventsDisabled].slice(-1),S=j.indexOf(b),P=g?j.indexOf(g):-1,N=v.layersWithOutsidePointerEventsDisabled.size>0,T=P>=S,U=gj(D=>{const V=D.target,se=[...v.branches].some(he=>he.contains(V));!T||se||(c==null||c(D),f==null||f(D),D.defaultPrevented||m==null||m())},C),G=yj(D=>{const V=D.target;[...v.branches].some(he=>he.contains(V))||(d==null||d(D),f==null||f(D),D.defaultPrevented||m==null||m())},C);return dj(D=>{P===v.layers.size-1&&(i==null||i(D),!D.defaultPrevented&&m&&(D.preventDefault(),m()))},C),p.useEffect(()=>{if(g)return l&&(v.layersWithOutsidePointerEventsDisabled.size===0&&(bm=C.body.style.pointerEvents,C.body.style.pointerEvents="none"),v.layersWithOutsidePointerEventsDisabled.add(g)),v.layers.add(g),jm(),()=>{l&&v.layersWithOutsidePointerEventsDisabled.size===1&&(C.body.style.pointerEvents=bm)}},[g,C,l,v]),p.useEffect(()=>()=>{g&&(v.layers.delete(g),v.layersWithOutsidePointerEventsDisabled.delete(g),jm())},[g,v]),p.useEffect(()=>{const D=()=>E({});return document.addEventListener(ou,D),()=>document.removeEventListener(ou,D)},[]),n.jsx(Le.div,{...x,ref:k,style:{pointerEvents:N?T?"auto":"none":void 0,...r.style},onFocusCapture:Ae(r.onFocusCapture,G.onFocusCapture),onBlurCapture:Ae(r.onBlurCapture,G.onBlurCapture),onPointerDownCapture:Ae(r.onPointerDownCapture,U.onPointerDownCapture)})});Tu.displayName=fj;var pj="DismissableLayerBranch",xj=p.forwardRef((r,a)=>{const l=p.useContext(Lp),i=p.useRef(null),c=We(a,i);return p.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})});xj.displayName=pj;function gj(r,a=globalThis==null?void 0:globalThis.document){const l=br(r),i=p.useRef(!1),c=p.useRef(()=>{});return p.useEffect(()=>{const d=m=>{if(m.target&&!i.current){let x=function(){Dp(hj,l,v,{discrete:!0})};const v={originalEvent:m};m.pointerType==="touch"?(a.removeEventListener("click",c.current),c.current=x,a.addEventListener("click",c.current,{once:!0})):x()}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 yj(r,a=globalThis==null?void 0:globalThis.document){const l=br(r),i=p.useRef(!1);return p.useEffect(()=>{const c=d=>{d.target&&!i.current&&Dp(mj,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 jm(){const r=new CustomEvent(ou);document.dispatchEvent(r)}function Dp(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?uj(c,d):c.dispatchEvent(d)}var Oc="focusScope.autoFocusOnMount",Fc="focusScope.autoFocusOnUnmount",Nm={bubbles:!1,cancelable:!0},vj="FocusScope",Iu=p.forwardRef((r,a)=>{const{loop:l=!1,trapped:i=!1,onMountAutoFocus:c,onUnmountAutoFocus:d,...f}=r,[m,x]=p.useState(null),v=br(c),g=br(d),y=p.useRef(null),C=We(a,j=>x(j)),E=p.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;p.useEffect(()=>{if(i){let j=function(N){if(E.paused||!m)return;const T=N.target;m.contains(T)?y.current=T:xr(y.current,{select:!0})},b=function(N){if(E.paused||!m)return;const T=N.relatedTarget;T!==null&&(m.contains(T)||xr(y.current,{select:!0}))},S=function(N){if(document.activeElement===document.body)for(const U of N)U.removedNodes.length>0&&xr(m)};document.addEventListener("focusin",j),document.addEventListener("focusout",b);const P=new MutationObserver(S);return m&&P.observe(m,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",j),document.removeEventListener("focusout",b),P.disconnect()}}},[i,m,E.paused]),p.useEffect(()=>{if(m){Cm.add(E);const j=document.activeElement;if(!m.contains(j)){const S=new CustomEvent(Oc,Nm);m.addEventListener(Oc,v),m.dispatchEvent(S),S.defaultPrevented||(wj(Cj(Op(m)),{select:!0}),document.activeElement===j&&xr(m))}return()=>{m.removeEventListener(Oc,v),setTimeout(()=>{const S=new CustomEvent(Fc,Nm);m.addEventListener(Fc,g),m.dispatchEvent(S),S.defaultPrevented||xr(j??document.body,{select:!0}),m.removeEventListener(Fc,g),Cm.remove(E)},0)}}},[m,v,g,E]);const k=p.useCallback(j=>{if(!l&&!i||E.paused)return;const b=j.key==="Tab"&&!j.altKey&&!j.ctrlKey&&!j.metaKey,S=document.activeElement;if(b&&S){const P=j.currentTarget,[N,T]=bj(P);N&&T?!j.shiftKey&&S===T?(j.preventDefault(),l&&xr(N,{select:!0})):j.shiftKey&&S===N&&(j.preventDefault(),l&&xr(T,{select:!0})):S===P&&j.preventDefault()}},[l,i,E.paused]);return n.jsx(Le.div,{tabIndex:-1,...f,ref:C,onKeyDown:k})});Iu.displayName=vj;function wj(r,{select:a=!1}={}){const l=document.activeElement;for(const i of r)if(xr(i,{select:a}),document.activeElement!==l)return}function bj(r){const a=Op(r),l=Sm(a,r),i=Sm(a.reverse(),r);return[l,i]}function Op(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 Sm(r,a){for(const l of r)if(!jj(l,{upTo:a}))return l}function jj(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 Nj(r){return r instanceof HTMLInputElement&&"select"in r}function xr(r,{select:a=!1}={}){if(r&&r.focus){const l=document.activeElement;r.focus({preventScroll:!0}),r!==l&&Nj(r)&&a&&r.select()}}var Cm=Sj();function Sj(){let r=[];return{add(a){const l=r[0];a!==l&&(l==null||l.pause()),r=km(r,a),r.unshift(a)},remove(a){var l;r=km(r,a),(l=r[0])==null||l.resume()}}}function km(r,a){const l=[...r],i=l.indexOf(a);return i!==-1&&l.splice(i,1),l}function Cj(r){return r.filter(a=>a.tagName!=="A")}var kj="Portal",Au=p.forwardRef((r,a)=>{var m;const{container:l,...i}=r,[c,d]=p.useState(!1);Et(()=>d(!0),[]);const f=l||c&&((m=globalThis==null?void 0:globalThis.document)==null?void 0:m.body);return f?Jy.createPortal(n.jsx(Le.div,{...i,ref:a}),f):null});Au.displayName=kj;function Ej(r,a){return p.useReducer((l,i)=>a[l][i]??l,r)}var Fa=r=>{const{present:a,children:l}=r,i=Pj(a),c=typeof l=="function"?l({present:i.isPresent}):p.Children.only(l),d=We(i.ref,Rj(c));return typeof l=="function"||i.isPresent?p.cloneElement(c,{ref:d}):null};Fa.displayName="Presence";function Pj(r){const[a,l]=p.useState(),i=p.useRef(null),c=p.useRef(r),d=p.useRef("none"),f=r?"mounted":"unmounted",[m,x]=Ej(f,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return p.useEffect(()=>{const v=ql(i.current);d.current=m==="mounted"?v:"none"},[m]),Et(()=>{const v=i.current,g=c.current;if(g!==r){const C=d.current,E=ql(v);r?x("MOUNT"):E==="none"||(v==null?void 0:v.display)==="none"?x("UNMOUNT"):x(g&&C!==E?"ANIMATION_OUT":"UNMOUNT"),c.current=r}},[r,x]),Et(()=>{if(a){let v;const g=a.ownerDocument.defaultView??window,y=E=>{const j=ql(i.current).includes(CSS.escape(E.animationName));if(E.target===a&&j&&(x("ANIMATION_END"),!c.current)){const b=a.style.animationFillMode;a.style.animationFillMode="forwards",v=g.setTimeout(()=>{a.style.animationFillMode==="forwards"&&(a.style.animationFillMode=b)})}},C=E=>{E.target===a&&(d.current=ql(i.current))};return a.addEventListener("animationstart",C),a.addEventListener("animationcancel",y),a.addEventListener("animationend",y),()=>{g.clearTimeout(v),a.removeEventListener("animationstart",C),a.removeEventListener("animationcancel",y),a.removeEventListener("animationend",y)}}else x("ANIMATION_END")},[a,x]),{isPresent:["mounted","unmountSuspended"].includes(m),ref:p.useCallback(v=>{i.current=v?getComputedStyle(v):null,l(v)},[])}}function ql(r){return(r==null?void 0:r.animationName)||"none"}function Rj(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 zc=0;function Fp(){p.useEffect(()=>{const r=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",r[0]??Em()),document.body.insertAdjacentElement("beforeend",r[1]??Em()),zc++,()=>{zc===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(a=>a.remove()),zc--}},[])}function Em(){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 Nn=function(){return Nn=Object.assign||function(a){for(var l,i=1,c=arguments.length;i"u")return Kj;var a=Gj(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])}},Yj=Up(),Rs="data-scroll-locked",Xj=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(Tj,` { - overflow: hidden `).concat(i,`; - padding-right: `).concat(m,"px ").concat(i,`; - } - body[`).concat(Rs,`] { - 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(so,` { - right: `).concat(m,"px ").concat(i,`; - } - - .`).concat(ao,` { - margin-right: `).concat(m,"px ").concat(i,`; - } - - .`).concat(so," .").concat(so,` { - right: 0 `).concat(i,`; - } - - .`).concat(ao," .").concat(ao,` { - margin-right: 0 `).concat(i,`; - } - - body[`).concat(Rs,`] { - `).concat(Ij,": ").concat(m,`px; - } -`)},Rm=function(){var r=parseInt(document.body.getAttribute(Rs)||"0",10);return isFinite(r)?r:0},qj=function(){p.useEffect(function(){return document.body.setAttribute(Rs,(Rm()+1).toString()),function(){var r=Rm()-1;r<=0?document.body.removeAttribute(Rs):document.body.setAttribute(Rs,r.toString())}},[])},Jj=function(r){var a=r.noRelative,l=r.noImportant,i=r.gapMode,c=i===void 0?"margin":i;qj();var d=p.useMemo(function(){return Qj(c)},[c]);return p.createElement(Yj,{styles:Xj(d,!a,c,l?"":"!important")})},iu=!1;if(typeof window<"u")try{var Jl=Object.defineProperty({},"passive",{get:function(){return iu=!0,!0}});window.addEventListener("test",Jl,Jl),window.removeEventListener("test",Jl,Jl)}catch{iu=!1}var Ns=iu?{passive:!1}:!1,Zj=function(r){return r.tagName==="TEXTAREA"},Vp=function(r,a){if(!(r instanceof Element))return!1;var l=window.getComputedStyle(r);return l[a]!=="hidden"&&!(l.overflowY===l.overflowX&&!Zj(r)&&l[a]==="visible")},eN=function(r){return Vp(r,"overflowY")},tN=function(r){return Vp(r,"overflowX")},_m=function(r,a){var l=a.ownerDocument,i=a;do{typeof ShadowRoot<"u"&&i instanceof ShadowRoot&&(i=i.host);var c=Wp(r,i);if(c){var d=Hp(r,i),f=d[1],m=d[2];if(f>m)return!0}i=i.parentNode}while(i&&i!==l.body);return!1},nN=function(r){var a=r.scrollTop,l=r.scrollHeight,i=r.clientHeight;return[a,l,i]},rN=function(r){var a=r.scrollLeft,l=r.scrollWidth,i=r.clientWidth;return[a,l,i]},Wp=function(r,a){return r==="v"?eN(a):tN(a)},Hp=function(r,a){return r==="v"?nN(a):rN(a)},sN=function(r,a){return r==="h"&&a==="rtl"?-1:1},aN=function(r,a,l,i,c){var d=sN(r,window.getComputedStyle(a).direction),f=d*i,m=l.target,x=a.contains(m),v=!1,g=f>0,y=0,C=0;do{if(!m)break;var E=Hp(r,m),k=E[0],j=E[1],b=E[2],S=j-b-d*k;(k||S)&&Wp(r,m)&&(y+=S,C+=k);var P=m.parentNode;m=P&&P.nodeType===Node.DOCUMENT_FRAGMENT_NODE?P.host:P}while(!x&&m!==document.body||x&&(a.contains(m)||a===m));return(g&&Math.abs(y)<1||!g&&Math.abs(C)<1)&&(v=!0),v},Zl=function(r){return"changedTouches"in r?[r.changedTouches[0].clientX,r.changedTouches[0].clientY]:[0,0]},Tm=function(r){return[r.deltaX,r.deltaY]},Im=function(r){return r&&"current"in r?r.current:r},lN=function(r,a){return r[0]===a[0]&&r[1]===a[1]},oN=function(r){return` - .block-interactivity-`.concat(r,` {pointer-events: none;} - .allow-interactivity-`).concat(r,` {pointer-events: all;} -`)},iN=0,Ss=[];function cN(r){var a=p.useRef([]),l=p.useRef([0,0]),i=p.useRef(),c=p.useState(iN++)[0],d=p.useState(Up)[0],f=p.useRef(r);p.useEffect(function(){f.current=r},[r]),p.useEffect(function(){if(r.inert){document.body.classList.add("block-interactivity-".concat(c));var j=_j([r.lockRef.current],(r.shards||[]).map(Im),!0).filter(Boolean);return j.forEach(function(b){return b.classList.add("allow-interactivity-".concat(c))}),function(){document.body.classList.remove("block-interactivity-".concat(c)),j.forEach(function(b){return b.classList.remove("allow-interactivity-".concat(c))})}}},[r.inert,r.lockRef.current,r.shards]);var m=p.useCallback(function(j,b){if("touches"in j&&j.touches.length===2||j.type==="wheel"&&j.ctrlKey)return!f.current.allowPinchZoom;var S=Zl(j),P=l.current,N="deltaX"in j?j.deltaX:P[0]-S[0],T="deltaY"in j?j.deltaY:P[1]-S[1],U,G=j.target,D=Math.abs(N)>Math.abs(T)?"h":"v";if("touches"in j&&D==="h"&&G.type==="range")return!1;var V=window.getSelection(),se=V&&V.anchorNode,he=se?se===G||se.contains(G):!1;if(he)return!1;var de=_m(D,G);if(!de)return!0;if(de?U=D:(U=D==="v"?"h":"v",de=_m(D,G)),!de)return!1;if(!i.current&&"changedTouches"in j&&(N||T)&&(i.current=U),!U)return!0;var fe=i.current||U;return aN(fe,b,j,fe==="h"?N:T)},[]),x=p.useCallback(function(j){var b=j;if(!(!Ss.length||Ss[Ss.length-1]!==d)){var S="deltaY"in b?Tm(b):Zl(b),P=a.current.filter(function(U){return U.name===b.type&&(U.target===b.target||b.target===U.shadowParent)&&lN(U.delta,S)})[0];if(P&&P.should){b.cancelable&&b.preventDefault();return}if(!P){var N=(f.current.shards||[]).map(Im).filter(Boolean).filter(function(U){return U.contains(b.target)}),T=N.length>0?m(b,N[0]):!f.current.noIsolation;T&&b.cancelable&&b.preventDefault()}}},[]),v=p.useCallback(function(j,b,S,P){var N={name:j,delta:b,target:S,should:P,shadowParent:uN(S)};a.current.push(N),setTimeout(function(){a.current=a.current.filter(function(T){return T!==N})},1)},[]),g=p.useCallback(function(j){l.current=Zl(j),i.current=void 0},[]),y=p.useCallback(function(j){v(j.type,Tm(j),j.target,m(j,r.lockRef.current))},[]),C=p.useCallback(function(j){v(j.type,Zl(j),j.target,m(j,r.lockRef.current))},[]);p.useEffect(function(){return Ss.push(d),r.setCallbacks({onScrollCapture:y,onWheelCapture:y,onTouchMoveCapture:C}),document.addEventListener("wheel",x,Ns),document.addEventListener("touchmove",x,Ns),document.addEventListener("touchstart",g,Ns),function(){Ss=Ss.filter(function(j){return j!==d}),document.removeEventListener("wheel",x,Ns),document.removeEventListener("touchmove",x,Ns),document.removeEventListener("touchstart",g,Ns)}},[]);var E=r.removeScrollBar,k=r.inert;return p.createElement(p.Fragment,null,k?p.createElement(d,{styles:oN(c)}):null,E?p.createElement(Jj,{noRelative:r.noRelative,gapMode:r.gapMode}):null)}function uN(r){for(var a=null;r!==null;)r instanceof ShadowRoot&&(a=r.host,r=r.host),r=r.parentNode;return a}const dN=zj(Bp,cN);var Mu=p.forwardRef(function(r,a){return p.createElement(Eo,Nn({},r,{ref:a,sideCar:dN}))});Mu.classNames=Eo.classNames;var fN=function(r){if(typeof document>"u")return null;var a=Array.isArray(r)?r[0]:r;return a.ownerDocument.body},Cs=new WeakMap,eo=new WeakMap,to={},Vc=0,Kp=function(r){return r&&(r.host||Kp(r.parentNode))},hN=function(r,a){return a.map(function(l){if(r.contains(l))return l;var i=Kp(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})},mN=function(r,a,l,i){var c=hN(a,Array.isArray(r)?r:[r]);to[l]||(to[l]=new WeakMap);var d=to[l],f=[],m=new Set,x=new Set(c),v=function(y){!y||m.has(y)||(m.add(y),v(y.parentNode))};c.forEach(v);var g=function(y){!y||x.has(y)||Array.prototype.forEach.call(y.children,function(C){if(m.has(C))g(C);else try{var E=C.getAttribute(i),k=E!==null&&E!=="false",j=(Cs.get(C)||0)+1,b=(d.get(C)||0)+1;Cs.set(C,j),d.set(C,b),f.push(C),j===1&&k&&eo.set(C,!0),b===1&&C.setAttribute(l,"true"),k||C.setAttribute(i,"true")}catch(S){console.error("aria-hidden: cannot operate on ",C,S)}})};return g(a),m.clear(),Vc++,function(){f.forEach(function(y){var C=Cs.get(y)-1,E=d.get(y)-1;Cs.set(y,C),d.set(y,E),C||(eo.has(y)||y.removeAttribute(i),eo.delete(y)),E||y.removeAttribute(l)}),Vc--,Vc||(Cs=new WeakMap,Cs=new WeakMap,eo=new WeakMap,to={})}},Gp=function(r,a,l){l===void 0&&(l="data-aria-hidden");var i=Array.from(Array.isArray(r)?r:[r]),c=fN(r);return c?(i.push.apply(i,Array.from(c.querySelectorAll("[aria-live], script"))),mN(i,c,l,"aria-hidden")):function(){return null}},Po="Dialog",[Qp]=Cr(Po),[pN,pn]=Qp(Po),Yp=r=>{const{__scopeDialog:a,children:l,open:i,defaultOpen:c,onOpenChange:d,modal:f=!0}=r,m=p.useRef(null),x=p.useRef(null),[v,g]=Kr({prop:i,defaultProp:c??!1,onChange:d,caller:Po});return n.jsx(pN,{scope:a,triggerRef:m,contentRef:x,contentId:wr(),titleId:wr(),descriptionId:wr(),open:v,onOpenChange:g,onOpenToggle:p.useCallback(()=>g(y=>!y),[g]),modal:f,children:l})};Yp.displayName=Po;var Xp="DialogTrigger",xN=p.forwardRef((r,a)=>{const{__scopeDialog:l,...i}=r,c=pn(Xp,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":Ou(c.open),...i,ref:d,onClick:Ae(r.onClick,c.onOpenToggle)})});xN.displayName=Xp;var Lu="DialogPortal",[gN,qp]=Qp(Lu,{forceMount:void 0}),Jp=r=>{const{__scopeDialog:a,forceMount:l,children:i,container:c}=r,d=pn(Lu,a);return n.jsx(gN,{scope:a,forceMount:l,children:p.Children.map(i,f=>n.jsx(Fa,{present:l||d.open,children:n.jsx(Au,{asChild:!0,container:c,children:f})}))})};Jp.displayName=Lu;var xo="DialogOverlay",Zp=p.forwardRef((r,a)=>{const l=qp(xo,r.__scopeDialog),{forceMount:i=l.forceMount,...c}=r,d=pn(xo,r.__scopeDialog);return d.modal?n.jsx(Fa,{present:i||d.open,children:n.jsx(vN,{...c,ref:a})}):null});Zp.displayName=xo;var yN=Ta("DialogOverlay.RemoveScroll"),vN=p.forwardRef((r,a)=>{const{__scopeDialog:l,...i}=r,c=pn(xo,l);return n.jsx(Mu,{as:yN,allowPinchZoom:!0,shards:[c.contentRef],children:n.jsx(Le.div,{"data-state":Ou(c.open),...i,ref:a,style:{pointerEvents:"auto",...i.style}})})}),Gr="DialogContent",ex=p.forwardRef((r,a)=>{const l=qp(Gr,r.__scopeDialog),{forceMount:i=l.forceMount,...c}=r,d=pn(Gr,r.__scopeDialog);return n.jsx(Fa,{present:i||d.open,children:d.modal?n.jsx(wN,{...c,ref:a}):n.jsx(bN,{...c,ref:a})})});ex.displayName=Gr;var wN=p.forwardRef((r,a)=>{const l=pn(Gr,r.__scopeDialog),i=p.useRef(null),c=We(a,l.contentRef,i);return p.useEffect(()=>{const d=i.current;if(d)return Gp(d)},[]),n.jsx(tx,{...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())})}),bN=p.forwardRef((r,a)=>{const l=pn(Gr,r.__scopeDialog),i=p.useRef(!1),c=p.useRef(!1);return n.jsx(tx,{...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 x,v;(x=r.onInteractOutside)==null||x.call(r,d),d.defaultPrevented||(i.current=!0,d.detail.originalEvent.type==="pointerdown"&&(c.current=!0));const f=d.target;((v=l.triggerRef.current)==null?void 0:v.contains(f))&&d.preventDefault(),d.detail.originalEvent.type==="focusin"&&c.current&&d.preventDefault()}})}),tx=p.forwardRef((r,a)=>{const{__scopeDialog:l,trapFocus:i,onOpenAutoFocus:c,onCloseAutoFocus:d,...f}=r,m=pn(Gr,l),x=p.useRef(null),v=We(a,x);return Fp(),n.jsxs(n.Fragment,{children:[n.jsx(Iu,{asChild:!0,loop:!0,trapped:i,onMountAutoFocus:c,onUnmountAutoFocus:d,children:n.jsx(Tu,{role:"dialog",id:m.contentId,"aria-describedby":m.descriptionId,"aria-labelledby":m.titleId,"data-state":Ou(m.open),...f,ref:v,onDismiss:()=>m.onOpenChange(!1)})}),n.jsxs(n.Fragment,{children:[n.jsx(jN,{titleId:m.titleId}),n.jsx(SN,{contentRef:x,descriptionId:m.descriptionId})]})]})}),Du="DialogTitle",nx=p.forwardRef((r,a)=>{const{__scopeDialog:l,...i}=r,c=pn(Du,l);return n.jsx(Le.h2,{id:c.titleId,...i,ref:a})});nx.displayName=Du;var rx="DialogDescription",sx=p.forwardRef((r,a)=>{const{__scopeDialog:l,...i}=r,c=pn(rx,l);return n.jsx(Le.p,{id:c.descriptionId,...i,ref:a})});sx.displayName=rx;var ax="DialogClose",lx=p.forwardRef((r,a)=>{const{__scopeDialog:l,...i}=r,c=pn(ax,l);return n.jsx(Le.button,{type:"button",...i,ref:a,onClick:Ae(r.onClick,()=>c.onOpenChange(!1))})});lx.displayName=ax;function Ou(r){return r?"open":"closed"}var ox="DialogTitleWarning",[XC,ix]=qb(ox,{contentName:Gr,titleName:Du,docsSlug:"dialog"}),jN=({titleId:r})=>{const a=ix(ox),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 p.useEffect(()=>{r&&(document.getElementById(r)||console.error(l))},[l,r]),null},NN="DialogDescriptionWarning",SN=({contentRef:r,descriptionId:a})=>{const i=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${ix(NN).contentName}}.`;return p.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},CN=Yp,kN=Jp,EN=Zp,PN=ex,RN=nx,_N=sx,TN=lx;function Sn(r){return n.jsx(CN,{"data-slot":"dialog",...r})}function IN(r){return n.jsx(kN,{...r})}const cx=p.forwardRef(({className:r,...a},l)=>n.jsx(EN,{ref:l,className:He("fixed inset-0 z-50 bg-black/50",r),...a}));cx.displayName="DialogOverlay";const fn=p.forwardRef(({className:r,children:a,showCloseButton:l=!0,...i},c)=>n.jsxs(IN,{children:[n.jsx(cx,{}),n.jsxs(PN,{ref:c,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(TN,{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(Hr,{className:"h-4 w-4"}),n.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));fn.displayName="DialogContent";function Cn({className:r,...a}){return n.jsx("div",{className:He("flex flex-col gap-2 text-center sm:text-left",r),...a})}function Vn({className:r,...a}){return n.jsx("div",{className:He("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",r),...a})}function kn(r){return n.jsx(RN,{className:"text-lg font-semibold leading-none",...r})}function AN(r){return n.jsx(_N,{className:"text-sm text-muted-foreground",...r})}function Fu(r){const a=p.useRef({value:r,previous:r});return p.useMemo(()=>(a.current.value!==r&&(a.current.previous=a.current.value,a.current.value=r),a.current.previous),[r])}function zu(r){const[a,l]=p.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 x=d.borderBoxSize,v=Array.isArray(x)?x[0]:x;f=v.inlineSize,m=v.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 Ro="Switch",[MN]=Cr(Ro),[LN,DN]=MN(Ro),ux=p.forwardRef((r,a)=>{const{__scopeSwitch:l,name:i,checked:c,defaultChecked:d,required:f,disabled:m,value:x="on",onCheckedChange:v,form:g,...y}=r,[C,E]=p.useState(null),k=We(a,N=>E(N)),j=p.useRef(!1),b=C?g||!!C.closest("form"):!0,[S,P]=Kr({prop:c,defaultProp:d??!1,onChange:v,caller:Ro});return n.jsxs(LN,{scope:l,checked:S,disabled:m,children:[n.jsx(Le.button,{type:"button",role:"switch","aria-checked":S,"aria-required":f,"data-state":mx(S),"data-disabled":m?"":void 0,disabled:m,value:x,...y,ref:k,onClick:Ae(r.onClick,N=>{P(T=>!T),b&&(j.current=N.isPropagationStopped(),j.current||N.stopPropagation())})}),b&&n.jsx(hx,{control:C,bubbles:!j.current,name:i,value:x,checked:S,required:f,disabled:m,form:g,style:{transform:"translateX(-100%)"}})]})});ux.displayName=Ro;var dx="SwitchThumb",fx=p.forwardRef((r,a)=>{const{__scopeSwitch:l,...i}=r,c=DN(dx,l);return n.jsx(Le.span,{"data-state":mx(c.checked),"data-disabled":c.disabled?"":void 0,...i,ref:a})});fx.displayName=dx;var ON="SwitchBubbleInput",hx=p.forwardRef(({__scopeSwitch:r,control:a,checked:l,bubbles:i=!0,...c},d)=>{const f=p.useRef(null),m=We(f,d),x=Fu(l),v=zu(a);return p.useEffect(()=>{const g=f.current;if(!g)return;const y=window.HTMLInputElement.prototype,E=Object.getOwnPropertyDescriptor(y,"checked").set;if(x!==l&&E){const k=new Event("click",{bubbles:i});E.call(g,l),g.dispatchEvent(k)}},[x,l,i]),n.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:l,...c,tabIndex:-1,ref:m,style:{...c.style,...v,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});hx.displayName=ON;function mx(r){return r?"checked":"unchecked"}var px=ux,FN=fx;const xt=p.forwardRef(({className:r,...a},l)=>n.jsx(px,{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-[#38bdac] focus-visible:ring-offset-2 focus-visible:ring-offset-[#0a1628] disabled:cursor-not-allowed disabled:opacity-50 data-[state=unchecked]:bg-gray-600 data-[state=checked]:bg-[#38bdac]",r),...a,ref:l,children:n.jsx(FN,{className:He("pointer-events-none block h-4 w-4 rounded-full bg-white shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-4 data-[state=unchecked]:translate-x-0")})}));xt.displayName=px.displayName;function $u(r){const a=r+"CollectionProvider",[l,i]=Cr(a),[c,d]=l(a,{collectionRef:{current:null},itemMap:new Map}),f=j=>{const{scope:b,children:S}=j,P=pr.useRef(null),N=pr.useRef(new Map).current;return n.jsx(c,{scope:b,itemMap:N,collectionRef:P,children:S})};f.displayName=a;const m=r+"CollectionSlot",x=Ta(m),v=pr.forwardRef((j,b)=>{const{scope:S,children:P}=j,N=d(m,S),T=We(b,N.collectionRef);return n.jsx(x,{ref:T,children:P})});v.displayName=m;const g=r+"CollectionItemSlot",y="data-radix-collection-item",C=Ta(g),E=pr.forwardRef((j,b)=>{const{scope:S,children:P,...N}=j,T=pr.useRef(null),U=We(b,T),G=d(g,S);return pr.useEffect(()=>(G.itemMap.set(T,{ref:T,...N}),()=>void G.itemMap.delete(T))),n.jsx(C,{[y]:"",ref:U,children:P})});E.displayName=g;function k(j){const b=d(r+"CollectionConsumer",j);return pr.useCallback(()=>{const P=b.collectionRef.current;if(!P)return[];const N=Array.from(P.querySelectorAll(`[${y}]`));return Array.from(b.itemMap.values()).sort((G,D)=>N.indexOf(G.ref.current)-N.indexOf(D.ref.current))},[b.collectionRef,b.itemMap])}return[{Provider:f,Slot:v,ItemSlot:E},k,i]}var zN=p.createContext(void 0);function _o(r){const a=p.useContext(zN);return r||a||"ltr"}var Wc="rovingFocusGroup.onEntryFocus",$N={bubbles:!1,cancelable:!0},za="RovingFocusGroup",[cu,xx,BN]=$u(za),[UN,gx]=Cr(za,[BN]),[VN,WN]=UN(za),yx=p.forwardRef((r,a)=>n.jsx(cu.Provider,{scope:r.__scopeRovingFocusGroup,children:n.jsx(cu.Slot,{scope:r.__scopeRovingFocusGroup,children:n.jsx(HN,{...r,ref:a})})}));yx.displayName=za;var HN=p.forwardRef((r,a)=>{const{__scopeRovingFocusGroup:l,orientation:i,loop:c=!1,dir:d,currentTabStopId:f,defaultCurrentTabStopId:m,onCurrentTabStopIdChange:x,onEntryFocus:v,preventScrollOnEntryFocus:g=!1,...y}=r,C=p.useRef(null),E=We(a,C),k=_o(d),[j,b]=Kr({prop:f,defaultProp:m??null,onChange:x,caller:za}),[S,P]=p.useState(!1),N=br(v),T=xx(l),U=p.useRef(!1),[G,D]=p.useState(0);return p.useEffect(()=>{const V=C.current;if(V)return V.addEventListener(Wc,N),()=>V.removeEventListener(Wc,N)},[N]),n.jsx(VN,{scope:l,orientation:i,dir:k,loop:c,currentTabStopId:j,onItemFocus:p.useCallback(V=>b(V),[b]),onItemShiftTab:p.useCallback(()=>P(!0),[]),onFocusableItemAdd:p.useCallback(()=>D(V=>V+1),[]),onFocusableItemRemove:p.useCallback(()=>D(V=>V-1),[]),children:n.jsx(Le.div,{tabIndex:S||G===0?-1:0,"data-orientation":i,...y,ref:E,style:{outline:"none",...r.style},onMouseDown:Ae(r.onMouseDown,()=>{U.current=!0}),onFocus:Ae(r.onFocus,V=>{const se=!U.current;if(V.target===V.currentTarget&&se&&!S){const he=new CustomEvent(Wc,$N);if(V.currentTarget.dispatchEvent(he),!he.defaultPrevented){const de=T().filter(K=>K.focusable),fe=de.find(K=>K.active),Y=de.find(K=>K.id===j),z=[fe,Y,...de].filter(Boolean).map(K=>K.ref.current);bx(z,g)}}U.current=!1}),onBlur:Ae(r.onBlur,()=>P(!1))})})}),vx="RovingFocusGroupItem",wx=p.forwardRef((r,a)=>{const{__scopeRovingFocusGroup:l,focusable:i=!0,active:c=!1,tabStopId:d,children:f,...m}=r,x=wr(),v=d||x,g=WN(vx,l),y=g.currentTabStopId===v,C=xx(l),{onFocusableItemAdd:E,onFocusableItemRemove:k,currentTabStopId:j}=g;return p.useEffect(()=>{if(i)return E(),()=>k()},[i,E,k]),n.jsx(cu.ItemSlot,{scope:l,id:v,focusable:i,active:c,children:n.jsx(Le.span,{tabIndex:y?0:-1,"data-orientation":g.orientation,...m,ref:a,onMouseDown:Ae(r.onMouseDown,b=>{i?g.onItemFocus(v):b.preventDefault()}),onFocus:Ae(r.onFocus,()=>g.onItemFocus(v)),onKeyDown:Ae(r.onKeyDown,b=>{if(b.key==="Tab"&&b.shiftKey){g.onItemShiftTab();return}if(b.target!==b.currentTarget)return;const S=QN(b,g.orientation,g.dir);if(S!==void 0){if(b.metaKey||b.ctrlKey||b.altKey||b.shiftKey)return;b.preventDefault();let N=C().filter(T=>T.focusable).map(T=>T.ref.current);if(S==="last")N.reverse();else if(S==="prev"||S==="next"){S==="prev"&&N.reverse();const T=N.indexOf(b.currentTarget);N=g.loop?YN(N,T+1):N.slice(T+1)}setTimeout(()=>bx(N))}}),children:typeof f=="function"?f({isCurrentTabStop:y,hasTabStop:j!=null}):f})})});wx.displayName=vx;var KN={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function GN(r,a){return a!=="rtl"?r:r==="ArrowLeft"?"ArrowRight":r==="ArrowRight"?"ArrowLeft":r}function QN(r,a,l){const i=GN(r.key,l);if(!(a==="vertical"&&["ArrowLeft","ArrowRight"].includes(i))&&!(a==="horizontal"&&["ArrowUp","ArrowDown"].includes(i)))return KN[i]}function bx(r,a=!1){const l=document.activeElement;for(const i of r)if(i===l||(i.focus({preventScroll:a}),document.activeElement!==l))return}function YN(r,a){return r.map((l,i)=>r[(a+i)%r.length])}var XN=yx,qN=wx,To="Tabs",[JN]=Cr(To,[gx]),jx=gx(),[ZN,Bu]=JN(To),Nx=p.forwardRef((r,a)=>{const{__scopeTabs:l,value:i,onValueChange:c,defaultValue:d,orientation:f="horizontal",dir:m,activationMode:x="automatic",...v}=r,g=_o(m),[y,C]=Kr({prop:i,onChange:c,defaultProp:d??"",caller:To});return n.jsx(ZN,{scope:l,baseId:wr(),value:y,onValueChange:C,orientation:f,dir:g,activationMode:x,children:n.jsx(Le.div,{dir:g,"data-orientation":f,...v,ref:a})})});Nx.displayName=To;var Sx="TabsList",Cx=p.forwardRef((r,a)=>{const{__scopeTabs:l,loop:i=!0,...c}=r,d=Bu(Sx,l),f=jx(l);return n.jsx(XN,{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})})});Cx.displayName=Sx;var kx="TabsTrigger",Ex=p.forwardRef((r,a)=>{const{__scopeTabs:l,value:i,disabled:c=!1,...d}=r,f=Bu(kx,l),m=jx(l),x=_x(f.baseId,i),v=Tx(f.baseId,i),g=i===f.value;return n.jsx(qN,{asChild:!0,...m,focusable:!c,active:g,children:n.jsx(Le.button,{type:"button",role:"tab","aria-selected":g,"aria-controls":v,"data-state":g?"active":"inactive","data-disabled":c?"":void 0,disabled:c,id:x,...d,ref:a,onMouseDown:Ae(r.onMouseDown,y=>{!c&&y.button===0&&y.ctrlKey===!1?f.onValueChange(i):y.preventDefault()}),onKeyDown:Ae(r.onKeyDown,y=>{[" ","Enter"].includes(y.key)&&f.onValueChange(i)}),onFocus:Ae(r.onFocus,()=>{const y=f.activationMode!=="manual";!g&&!c&&y&&f.onValueChange(i)})})})});Ex.displayName=kx;var Px="TabsContent",Rx=p.forwardRef((r,a)=>{const{__scopeTabs:l,value:i,forceMount:c,children:d,...f}=r,m=Bu(Px,l),x=_x(m.baseId,i),v=Tx(m.baseId,i),g=i===m.value,y=p.useRef(g);return p.useEffect(()=>{const C=requestAnimationFrame(()=>y.current=!1);return()=>cancelAnimationFrame(C)},[]),n.jsx(Fa,{present:c||g,children:({present:C})=>n.jsx(Le.div,{"data-state":g?"active":"inactive","data-orientation":m.orientation,role:"tabpanel","aria-labelledby":x,hidden:!C,id:v,tabIndex:0,...f,ref:a,style:{...r.style,animationDuration:y.current?"0s":void 0},children:C&&d})})});Rx.displayName=Px;function _x(r,a){return`${r}-trigger-${a}`}function Tx(r,a){return`${r}-content-${a}`}var e2=Nx,Ix=Cx,Ax=Ex,Mx=Rx;const Uu=e2,Io=p.forwardRef(({className:r,...a},l)=>n.jsx(Ix,{ref:l,className:He("inline-flex h-9 items-center justify-center rounded-lg bg-muted p-1 text-muted-foreground",r),...a}));Io.displayName=Ix.displayName;const en=p.forwardRef(({className:r,...a},l)=>n.jsx(Ax,{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}));en.displayName=Ax.displayName;const tn=p.forwardRef(({className:r,...a},l)=>n.jsx(Mx,{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}));tn.displayName=Mx.displayName;function t2({open:r,onClose:a,userId:l,onUserUpdated:i}){var K;const[c,d]=p.useState(null),[f,m]=p.useState([]),[x,v]=p.useState([]),[g,y]=p.useState(!1),[C,E]=p.useState(!1),[k,j]=p.useState(!1),[b,S]=p.useState("info"),[P,N]=p.useState(""),[T,U]=p.useState(""),[G,D]=p.useState([]),[V,se]=p.useState("");p.useEffect(()=>{r&&l&&he()},[r,l]);async function he(){if(l){y(!0);try{const H=await Xe(`/api/db/users?id=${encodeURIComponent(l)}`);if(H!=null&&H.success&&H.user){const I=H.user;d(I),N(I.phone||""),U(I.nickname||""),D(typeof I.tags=="string"?JSON.parse(I.tags||"[]"):[])}try{const I=await Xe(`/api/user/track?userId=${encodeURIComponent(l)}&limit=50`);I!=null&&I.success&&I.tracks&&m(I.tracks)}catch{m([])}try{const I=await Xe(`/api/db/users/referrals?userId=${encodeURIComponent(l)}`);I!=null&&I.success&&I.referrals&&v(I.referrals)}catch{v([])}}catch(H){console.error("Load user detail error:",H)}finally{y(!1)}}}async function de(){if(!(c!=null&&c.phone)){alert("用户未绑定手机号,无法同步");return}E(!0);try{const H=await gt("/api/ckb/sync",{action:"full_sync",phone:c.phone,userId:c.id});H!=null&&H.success?(alert("同步成功"),he()):alert("同步失败: "+(H==null?void 0:H.error))}catch(H){console.error("Sync CKB error:",H),alert("同步失败")}finally{E(!1)}}async function fe(){if(c){j(!0);try{const H=await Hn("/api/db/users",{id:c.id,phone:P||void 0,nickname:T||void 0,tags:JSON.stringify(G)});H!=null&&H.success?(alert("保存成功"),he(),i==null||i()):alert("保存失败: "+(H==null?void 0:H.error))}catch(H){console.error("Save user error:",H),alert("保存失败")}finally{j(!1)}}}const Y=()=>{V&&!G.includes(V)&&(D([...G,V]),se(""))},B=H=>{D(G.filter(I=>I!==H))},z=H=>{const X={view_chapter:Ts,purchase:nu,match:Rn,login:ro,register:ro,share:Es,bind_phone:m1,bind_wechat:o1}[H]||om;return n.jsx(X,{className:"w-4 h-4"})};return r?n.jsx(Sn,{open:r,onOpenChange:()=>a(),children:n.jsxs(fn,{className:"bg-[#0f2137] border-gray-700 text-white max-w-4xl max-h-[90vh] overflow-hidden",children:[n.jsx(Cn,{children:n.jsxs(kn,{className:"text-white flex items-center gap-2",children:[n.jsx(ro,{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:"已绑定手机"})]})}),g?n.jsxs("div",{className:"flex items-center justify-center py-20",children:[n.jsx(Ye,{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:""}):((K=c.nickname)==null?void 0:K.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.isAdmin&&n.jsx(Oe,{className:"bg-purple-500/20 text-purple-400 border-0",children:"管理员"}),c.hasFullBook&&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.wechatId&&` · 💬 ${c.wechatId}`]}),n.jsxs("p",{className:"text-gray-500 text-xs mt-1",children:["ID: ",c.id," · 推广码: ",c.referralCode??"-"]})]}),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(Uu,{value:b,onValueChange:S,className:"flex-1 flex flex-col overflow-hidden",children:[n.jsxs(Io,{className:"bg-[#0a1628] border border-gray-700/50 p-1 mb-4",children:[n.jsx(en,{value:"info",className:"data-[state=active]:bg-[#38bdac]/20 data-[state=active]:text-[#38bdac]",children:"基础信息"}),n.jsx(en,{value:"tags",className:"data-[state=active]:bg-[#38bdac]/20 data-[state=active]:text-[#38bdac]",children:"标签体系"}),n.jsx(en,{value:"tracks",className:"data-[state=active]:bg-[#38bdac]/20 data-[state=active]:text-[#38bdac]",children:"行为轨迹"}),n.jsx(en,{value:"relations",className:"data-[state=active]:bg-[#38bdac]/20 data-[state=active]:text-[#38bdac]",children:"关系链路"})]}),n.jsxs(tn,{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(oe,{className:"text-gray-300",children:"手机号"}),n.jsx(me,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"输入手机号",value:P,onChange:H=>N(H.target.value)})]}),n.jsxs("div",{className:"space-y-2",children:[n.jsx(oe,{className:"text-gray-300",children:"昵称"}),n.jsx(me,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"输入昵称",value:T,onChange:H=>U(H.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.referralCount??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.pendingEarnings??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.createdAt?new Date(c.createdAt).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(Es,{className:"w-4 h-4 text-[#38bdac]"}),n.jsx("span",{className:"text-white font-medium",children:"存客宝同步"})]}),n.jsx(ge,{size:"sm",onClick:de,disabled:C||!c.phone,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:C?n.jsxs(n.Fragment,{children:[n.jsx(Ye,{className:"w-4 h-4 mr-1 animate-spin"})," 同步中..."]}):n.jsxs(n.Fragment,{children:[n.jsx(Ye,{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.ckbSyncedAt?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.ckbSyncedAt?new Date(c.ckbSyncedAt).toLocaleString():"-"})]})]})]})]}),n.jsx(tn,{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(P1,{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:[G.map((H,I)=>n.jsxs(Oe,{className:"bg-[#38bdac]/20 text-[#38bdac] border-0 pr-1",children:[H,n.jsx("button",{type:"button",onClick:()=>B(H),className:"ml-1 hover:text-red-400",children:n.jsx(Hr,{className:"w-3 h-3"})})]},I)),G.length===0&&n.jsx("span",{className:"text-gray-500 text-sm",children:"暂无标签"})]}),n.jsxs("div",{className:"flex gap-2",children:[n.jsx(me,{className:"bg-[#162840] border-gray-700 text-white flex-1",placeholder:"添加新标签",value:V,onChange:H=>se(H.target.value),onKeyDown:H=>H.key==="Enter"&&Y()}),n.jsx(ge,{onClick:Y,className:"bg-[#38bdac] hover:bg-[#2da396]",children:"添加"})]})]})}),n.jsx(tn,{value:"tracks",className:"flex-1 overflow-auto",children:n.jsx("div",{className:"space-y-2",children:f.length>0?f.map(H=>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:z(H.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:H.actionLabel}),H.chapterTitle&&n.jsxs("span",{className:"text-gray-400 text-sm",children:["- ",H.chapterTitle]})]}),n.jsxs("p",{className:"text-gray-500 text-xs mt-1",children:[n.jsx(cp,{className:"w-3 h-3 inline mr-1"}),H.timeAgo," · ",new Date(H.createdAt).toLocaleString()]})]})]},H.id)):n.jsxs("div",{className:"text-center py-12",children:[n.jsx(om,{className:"w-10 h-10 text-[#38bdac]/40 mx-auto mb-4"}),n.jsx("p",{className:"text-gray-400",children:"暂无行为轨迹"})]})})}),n.jsx(tn,{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(Es,{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:["共 ",x.length," 人"]})]}),n.jsx("div",{className:"space-y-2 max-h-[200px] overflow-y-auto",children:x.length>0?x.map((H,I)=>{var ne;const X=H;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:((ne=X.nickname)==null?void 0:ne.charAt(0))||"?"}),n.jsx("span",{className:"text-white text-sm",children:X.nickname})]}),n.jsxs("div",{className:"flex items-center gap-2",children:[X.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:X.createdAt?new Date(X.createdAt).toLocaleDateString():""})]})]},X.id||I)}):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(ge,{variant:"outline",onClick:a,className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:[n.jsx(Hr,{className:"w-4 h-4 mr-2"}),"关闭"]}),n.jsxs(ge,{onClick:fe,disabled:k,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:[n.jsx(Wn,{className:"w-4 h-4 mr-2"}),k?"保存中...":"保存修改"]})]})]}):n.jsx("div",{className:"text-center py-12 text-gray-500",children:"用户不存在"})]})}):null}function n2(){var _t,In,Ot,xn,Ft;const[r,a]=p.useState([]),[l,i]=p.useState(0),[c,d]=p.useState(1),[f,m]=p.useState(10),[x,v]=p.useState(""),g=Ip(x,300),[y,C]=p.useState("all"),[E,k]=p.useState(!0),[j,b]=p.useState(null),[S,P]=p.useState(!1),[N,T]=p.useState(!1),[U,G]=p.useState(null),[D,V]=p.useState(""),[se,he]=p.useState(""),[de,fe]=p.useState(!1),[Y,B]=p.useState(!1),[z,K]=p.useState({referrals:[],stats:{}}),[H,I]=p.useState(!1),[X,ne]=p.useState(null),[L,R]=p.useState(!1),[ee,q]=p.useState(null),[le,ue]=p.useState({phone:"",nickname:"",password:"",isAdmin:!1,hasFullBook:!1});async function Q(){k(!0),b(null);try{const J=new URLSearchParams({page:String(c),pageSize:String(f),search:g,...y==="vip"&&{vip:"true"}}),O=await Xe(`/api/db/users?${J}`);O!=null&&O.success?(a(O.users||[]),i(O.total??0)):b((O==null?void 0:O.error)||"加载失败")}catch(J){console.error("Load users error:",J),b("网络错误,请检查连接")}finally{k(!1)}}p.useEffect(()=>{d(1)},[g,y]),p.useEffect(()=>{Q()},[c,f,g,y]);const ie=Math.ceil(l/f)||1;async function je(J){if(confirm("确定要删除这个用户吗?"))try{const O=await W1(`/api/db/users?id=${encodeURIComponent(J)}`);O!=null&&O.success?Q():alert("删除失败: "+((O==null?void 0:O.error)||"未知错误"))}catch(O){console.error("Delete user error:",O),alert("删除失败")}}const ye=J=>{G(J),ue({phone:J.phone||"",nickname:J.nickname||"",password:"",isAdmin:!!(J.isAdmin??!1),hasFullBook:!!(J.hasFullBook??!1)}),P(!0)},Pe=()=>{G(null),ue({phone:"",nickname:"",password:"",isAdmin:!1,hasFullBook:!1}),P(!0)};async function Ie(){if(!le.phone||!le.nickname){alert("请填写手机号和昵称");return}fe(!0);try{if(U){const J=await Hn("/api/db/users",{id:U.id,nickname:le.nickname,isAdmin:le.isAdmin,hasFullBook:le.hasFullBook,...le.password&&{password:le.password}});if(!(J!=null&&J.success)){alert("更新失败: "+((J==null?void 0:J.error)||"未知错误"));return}}else{const J=await gt("/api/db/users",{phone:le.phone,nickname:le.nickname,password:le.password,isAdmin:le.isAdmin});if(!(J!=null&&J.success)){alert("创建失败: "+((J==null?void 0:J.error)||"未知错误"));return}}P(!1),Q()}catch(J){console.error("Save user error:",J),alert("保存失败")}finally{fe(!1)}}const rt=J=>{G(J),V(""),he(""),T(!0)};async function it(J){ne(J),B(!0),I(!0);try{const O=await Xe(`/api/db/users/referrals?userId=${encodeURIComponent(J.id)}`);O!=null&&O.success?K({referrals:O.referrals||[],stats:O.stats||{}}):K({referrals:[],stats:{}})}catch(O){console.error("Load referrals error:",O),K({referrals:[],stats:{}})}finally{I(!1)}}const Kt=J=>{q(J.id),R(!0)};async function Gt(){if(!D){alert("请输入新密码");return}if(D!==se){alert("两次输入的密码不一致");return}if(D.length<6){alert("密码长度不能少于6位");return}fe(!0);try{const J=await Hn("/api/db/users",{id:U==null?void 0:U.id,password:D});J!=null&&J.success?(alert("密码修改成功"),T(!1)):alert("密码修改失败: "+((J==null?void 0:J.error)||"未知错误"))}catch(J){console.error("Change password error:",J),alert("密码修改失败")}finally{fe(!1)}}return n.jsxs("div",{className:"p-8 max-w-7xl mx-auto",children:[j&&n.jsxs("div",{className:"mb-4 px-4 py-3 rounded-lg bg-red-500/20 border border-red-500/50 text-red-400 text-sm flex items-center justify-between",children:[n.jsx("span",{children:j}),n.jsx("button",{type:"button",onClick:()=>b(null),className:"hover:text-red-300",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:["共 ",l," 位注册用户",y==="vip"&&",当前筛选 VIP"]})]}),n.jsxs("div",{className:"flex items-center gap-4",children:[n.jsxs(ge,{variant:"outline",onClick:Q,disabled:E,className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:[n.jsx(Ye,{className:`w-4 h-4 mr-2 ${E?"animate-spin":""}`}),"刷新"]}),n.jsxs("select",{value:y,onChange:J=>{C(J.target.value),d(1)},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:"vip",children:"VIP会员"})]}),n.jsxs("div",{className:"relative",children:[n.jsx(Vr,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-gray-500"}),n.jsx(me,{type:"text",placeholder:"搜索用户...",className:"pl-10 bg-[#0f2137] border-gray-700 text-white placeholder:text-gray-500 w-64",value:x,onChange:J=>v(J.target.value)})]}),n.jsxs(ge,{onClick:Pe,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:[n.jsx(fm,{className:"w-4 h-4 mr-2"}),"添加用户"]})]})]}),n.jsx(Sn,{open:S,onOpenChange:P,children:n.jsxs(fn,{className:"bg-[#0f2137] border-gray-700 text-white max-w-lg",children:[n.jsx(Cn,{children:n.jsxs(kn,{className:"text-white flex items-center gap-2",children:[U?n.jsx(Is,{className:"w-5 h-5 text-[#38bdac]"}):n.jsx(fm,{className:"w-5 h-5 text-[#38bdac]"}),U?"编辑用户":"添加用户"]})}),n.jsxs("div",{className:"space-y-4 py-4",children:[n.jsxs("div",{className:"space-y-2",children:[n.jsx(oe,{className:"text-gray-300",children:"手机号"}),n.jsx(me,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"请输入手机号",value:le.phone,onChange:J=>ue({...le,phone:J.target.value}),disabled:!!U})]}),n.jsxs("div",{className:"space-y-2",children:[n.jsx(oe,{className:"text-gray-300",children:"昵称"}),n.jsx(me,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"请输入昵称",value:le.nickname,onChange:J=>ue({...le,nickname:J.target.value})})]}),n.jsxs("div",{className:"space-y-2",children:[n.jsx(oe,{className:"text-gray-300",children:U?"新密码 (留空则不修改)":"密码"}),n.jsx(me,{type:"password",className:"bg-[#0a1628] border-gray-700 text-white",placeholder:U?"留空则不修改":"请输入密码",value:le.password,onChange:J=>ue({...le,password:J.target.value})})]}),n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsx(oe,{className:"text-gray-300",children:"管理员权限"}),n.jsx(xt,{checked:le.isAdmin,onCheckedChange:J=>ue({...le,isAdmin:J})})]}),n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsx(oe,{className:"text-gray-300",children:"已购全书"}),n.jsx(xt,{checked:le.hasFullBook,onCheckedChange:J=>ue({...le,hasFullBook:J})})]})]}),n.jsxs(Vn,{children:[n.jsxs(ge,{variant:"outline",onClick:()=>P(!1),className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:[n.jsx(Hr,{className:"w-4 h-4 mr-2"}),"取消"]}),n.jsxs(ge,{onClick:Ie,disabled:de,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:[n.jsx(Wn,{className:"w-4 h-4 mr-2"}),de?"保存中...":"保存"]})]})]})}),n.jsx(Sn,{open:N,onOpenChange:T,children:n.jsxs(fn,{className:"bg-[#0f2137] border-gray-700 text-white max-w-md",children:[n.jsx(Cn,{children:n.jsxs(kn,{className:"text-white flex items-center gap-2",children:[n.jsx(cm,{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:["用户:",U==null?void 0:U.nickname]}),n.jsxs("p",{className:"text-gray-400 text-sm",children:["手机号:",U==null?void 0:U.phone]})]}),n.jsxs("div",{className:"space-y-2",children:[n.jsx(oe,{className:"text-gray-300",children:"新密码"}),n.jsx(me,{type:"password",className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"请输入新密码 (至少6位)",value:D,onChange:J=>V(J.target.value)})]}),n.jsxs("div",{className:"space-y-2",children:[n.jsx(oe,{className:"text-gray-300",children:"确认密码"}),n.jsx(me,{type:"password",className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"请再次输入新密码",value:se,onChange:J=>he(J.target.value)})]})]}),n.jsxs(Vn,{children:[n.jsx(ge,{variant:"outline",onClick:()=>T(!1),className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:"取消"}),n.jsx(ge,{onClick:Gt,disabled:de,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:de?"保存中...":"确认修改"})]})]})}),n.jsx(t2,{open:L,onClose:()=>R(!1),userId:ee,onUserUpdated:Q}),n.jsx(Sn,{open:Y,onOpenChange:B,children:n.jsxs(fn,{className:"bg-[#0f2137] border-gray-700 text-white max-w-2xl max-h-[80vh] overflow-auto",children:[n.jsx(Cn,{children:n.jsxs(kn,{className:"text-white flex items-center gap-2",children:[n.jsx(Rn,{className:"w-5 h-5 text-[#38bdac]"}),"绑定关系详情 - ",X==null?void 0:X.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:((_t=z.stats)==null?void 0:_t.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:((In=z.stats)==null?void 0:In.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:["¥",(((Ot=z.stats)==null?void 0:Ot.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:["¥",(((xn=z.stats)==null?void 0:xn.pendingEarnings)||0).toFixed(2)]}),n.jsx("div",{className:"text-xs text-gray-400",children:"待提现"})]})]}),H?n.jsxs("div",{className:"flex items-center justify-center py-8",children:[n.jsx(Ye,{className:"w-5 h-5 text-[#38bdac] animate-spin"}),n.jsx("span",{className:"ml-2 text-gray-400",children:"加载中..."})]}):(((Ft=z.referrals)==null?void 0:Ft.length)??0)>0?n.jsx("div",{className:"space-y-2 max-h-[300px] overflow-y-auto",children:(z.referrals??[]).map((J,O)=>{var Qe;const ce=J;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:((Qe=ce.nickname)==null?void 0:Qe.charAt(0))||"?"}),n.jsxs("div",{children:[n.jsx("div",{className:"text-white text-sm",children:ce.nickname}),n.jsx("div",{className:"text-xs text-gray-500",children:ce.phone||(ce.hasOpenId?"微信用户":"未绑定")})]})]}),n.jsxs("div",{className:"flex items-center gap-2",children:[ce.status==="vip"&&n.jsx(Oe,{className:"bg-green-500/20 text-green-400 border-0 text-xs",children:"全书已购"}),ce.status==="paid"&&n.jsxs(Oe,{className:"bg-blue-500/20 text-blue-400 border-0 text-xs",children:["已付费",ce.purchasedSections,"章"]}),ce.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:ce.createdAt?new Date(ce.createdAt).toLocaleDateString():""})]})]},ce.id||O)})}):n.jsx("div",{className:"text-center py-8 text-gray-500",children:"暂无绑定用户"})]}),n.jsx(Vn,{children:n.jsx(ge,{variant:"outline",onClick:()=>B(!1),className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:"关闭"})})]})}),n.jsx(Re,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:n.jsx(_e,{className:"p-0",children:E?n.jsxs("div",{className:"flex items-center justify-center py-12",children:[n.jsx(Ye,{className:"w-6 h-6 text-[#38bdac] animate-spin"}),n.jsx("span",{className:"ml-2 text-gray-400",children:"加载中..."})]}):n.jsxs("div",{children:[n.jsxs(La,{children:[n.jsx(Da,{children:n.jsxs(nn,{className:"bg-[#0a1628] hover:bg-[#0a1628] border-gray-700",children:[n.jsx(Ge,{className:"text-gray-400",children:"用户信息"}),n.jsx(Ge,{className:"text-gray-400",children:"绑定信息"}),n.jsx(Ge,{className:"text-gray-400",children:"购买状态"}),n.jsx(Ge,{className:"text-gray-400",children:"分销收益"}),n.jsx(Ge,{className:"text-gray-400",children:"推广码"}),n.jsx(Ge,{className:"text-gray-400",children:"注册时间"}),n.jsx(Ge,{className:"text-right text-gray-400",children:"操作"})]})}),n.jsxs(Oa,{children:[r.map(J=>{var O,ce,Qe;return n.jsxs(nn,{className:"hover:bg-[#0a1628] border-gray-700/50",children:[n.jsx(Be,{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:J.avatar?n.jsx("img",{src:J.avatar,className:"w-full h-full rounded-full object-cover",alt:""}):((O=J.nickname)==null?void 0:O.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:J.nickname}),J.isAdmin&&n.jsx(Oe,{className:"bg-purple-500/20 text-purple-400 hover:bg-purple-500/20 border-0 text-xs",children:"管理员"}),J.openId&&!((ce=J.id)!=null&&ce.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:J.openId?J.openId.slice(0,12)+"...":(Qe=J.id)==null?void 0:Qe.slice(0,12)})]})]})}),n.jsx(Be,{children:n.jsxs("div",{className:"space-y-1",children:[J.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:J.phone})]}),J.wechatId&&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:J.wechatId})]}),J.openId&&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:J.openId,children:[J.openId.slice(0,12),"..."]})]}),!J.phone&&!J.wechatId&&!J.openId&&n.jsx("span",{className:"text-gray-600 text-xs",children:"未绑定"})]})}),n.jsx(Be,{children:J.hasFullBook?n.jsx(Oe,{className:"bg-amber-500/20 text-amber-400 hover:bg-amber-500/20 border-0",children:"VIP"}):n.jsx(Oe,{variant:"outline",className:"text-gray-500 border-gray-600",children:"未购买"})}),n.jsx(Be,{children:n.jsxs("div",{className:"space-y-1",children:[n.jsxs("div",{className:"text-white font-medium",children:["¥",parseFloat(String(J.earnings||0)).toFixed(2)]}),parseFloat(String(J.pendingEarnings||0))>0&&n.jsxs("div",{className:"text-xs text-yellow-400",children:["待提现: ¥",parseFloat(String(J.pendingEarnings||0)).toFixed(2)]}),n.jsxs("div",{className:"text-xs text-[#38bdac] cursor-pointer hover:underline flex items-center gap-1",onClick:()=>it(J),onKeyDown:ze=>ze.key==="Enter"&&it(J),role:"button",tabIndex:0,children:[n.jsx(Rn,{className:"w-3 h-3"}),"绑定",J.referralCount||0,"人"]})]})}),n.jsx(Be,{children:n.jsx("code",{className:"text-[#38bdac] text-xs bg-[#38bdac]/10 px-2 py-0.5 rounded",children:J.referralCode||"-"})}),n.jsx(Be,{className:"text-gray-400",children:J.createdAt?new Date(J.createdAt).toLocaleDateString():"-"}),n.jsx(Be,{className:"text-right",children:n.jsxs("div",{className:"flex items-center justify-end gap-1",children:[n.jsx(ge,{variant:"ghost",size:"sm",onClick:()=>Kt(J),className:"text-gray-400 hover:text-blue-400 hover:bg-blue-400/10",title:"查看详情",children:n.jsx(Eu,{className:"w-4 h-4"})}),n.jsx(ge,{variant:"ghost",size:"sm",onClick:()=>ye(J),className:"text-gray-400 hover:text-[#38bdac] hover:bg-[#38bdac]/10",title:"编辑",children:n.jsx(Is,{className:"w-4 h-4"})}),n.jsx(ge,{variant:"ghost",size:"sm",onClick:()=>rt(J),className:"text-gray-400 hover:text-yellow-400 hover:bg-yellow-400/10",title:"修改密码",children:n.jsx(cm,{className:"w-4 h-4"})}),n.jsx(ge,{variant:"ghost",size:"sm",className:"text-red-400 hover:text-red-300 hover:bg-red-500/10",onClick:()=>je(J.id),title:"删除",children:n.jsx(hp,{className:"w-4 h-4"})})]})})]},J.id)}),r.length===0&&n.jsx(nn,{children:n.jsx(Be,{colSpan:7,className:"text-center py-12 text-gray-500",children:"暂无用户数据"})})]})]}),n.jsx(Wr,{page:c,totalPages:ie,total:l,pageSize:f,onPageChange:d,onPageSizeChange:J=>{m(J),d(1)}})]})})})]})}function r2(){const[r,a]=p.useState("overview"),[l,i]=p.useState([]),[c,d]=p.useState(null),[f,m]=p.useState([]),[x,v]=p.useState([]),[g,y]=p.useState([]),[C,E]=p.useState(!0),[k,j]=p.useState(null),[b,S]=p.useState(""),[P,N]=p.useState("all"),[T,U]=p.useState(1),[G,D]=p.useState(10),[V,se]=p.useState(0),[he,de]=p.useState(new Set);p.useEffect(()=>{fe()},[]),p.useEffect(()=>{U(1)},[r,P]),p.useEffect(()=>{Y(r)},[r]),p.useEffect(()=>{["orders","bindings","withdrawals"].includes(r)&&Y(r,!0)},[T,G,P,b]);async function fe(){j(null);try{const R=await Xe("/api/admin/distribution/overview");R!=null&&R.success&&R.overview&&d(R.overview)}catch(R){console.error("[Admin] 概览接口异常:",R),j("加载概览失败")}try{const R=await Xe("/api/db/users");y((R==null?void 0:R.users)||[])}catch(R){console.error("[Admin] 用户数据加载失败:",R)}}async function Y(R,ee=!1){var q;if(!(!ee&&he.has(R))){E(!0);try{const le=g;switch(R){case"overview":break;case"orders":{try{const ue=new URLSearchParams({page:String(T),pageSize:String(G),...P!=="all"&&{status:P},...b&&{search:b}}),Q=await Xe(`/api/orders?${ue}`);if(Q!=null&&Q.success&&Q.orders){const ie=Q.orders.map(je=>{const ye=le.find(Ie=>Ie.id===je.userId),Pe=je.referrerId?le.find(Ie=>Ie.id===je.referrerId):null;return{...je,amount:parseFloat(String(je.amount))||0,userNickname:(ye==null?void 0:ye.nickname)||je.userNickname||"未知用户",userPhone:(ye==null?void 0:ye.phone)||je.userPhone||"-",referrerNickname:(Pe==null?void 0:Pe.nickname)||null,referrerCode:(Pe==null?void 0:Pe.referralCode)??null,type:je.productType||je.type}});i(ie),se(Q.total??ie.length)}else i([]),se(0)}catch(ue){console.error(ue),j("加载订单失败"),i([])}break}case"bindings":{try{const ue=new URLSearchParams({page:String(T),pageSize:String(G),...P!=="all"&&{status:P}}),Q=await Xe(`/api/db/distribution?${ue}`);m((Q==null?void 0:Q.bindings)||[]),se((Q==null?void 0:Q.total)??((q=Q==null?void 0:Q.bindings)==null?void 0:q.length)??0)}catch(ue){console.error(ue),j("加载绑定数据失败"),m([])}break}case"withdrawals":{try{const ue=P==="completed"?"success":P==="rejected"?"failed":P,Q=new URLSearchParams({...ue&&ue!=="all"&&{status:ue},page:String(T),pageSize:String(G)}),ie=await Xe(`/api/admin/withdrawals?${Q}`);if(ie!=null&&ie.success&&ie.withdrawals){const je=ie.withdrawals.map(ye=>({...ye,account:ye.account??"未绑定微信号",status:ye.status==="success"?"completed":ye.status==="failed"?"rejected":ye.status}));v(je),se((ie==null?void 0:ie.total)??je.length)}else ie!=null&&ie.success||j(`获取提现记录失败: ${(ie==null?void 0:ie.error)||"未知错误"}`),v([])}catch(ue){console.error(ue),j("加载提现数据失败"),v([])}break}}de(ue=>new Set(ue).add(R))}catch(le){console.error(le)}finally{E(!1)}}}async function B(){j(null),de(R=>{const ee=new Set(R);return ee.delete(r),ee}),r==="overview"&&fe(),await Y(r,!0)}async function z(R){if(confirm("确认审核通过并打款?"))try{const ee=await Hn("/api/admin/withdrawals",{id:R,action:"approve"});if(!(ee!=null&&ee.success)){const q=(ee==null?void 0:ee.message)||(ee==null?void 0:ee.error)||"操作失败";alert(q);return}await B()}catch(ee){console.error(ee),alert("操作失败")}}async function K(R){const ee=prompt("请输入拒绝原因:");if(ee)try{const q=await Hn("/api/admin/withdrawals",{id:R,action:"reject",errorMessage:ee});if(!(q!=null&&q.success)){alert((q==null?void 0:q.error)||"操作失败");return}await B()}catch(q){console.error(q),alert("操作失败")}}function H(R){const ee={active:"bg-green-500/20 text-green-400",converted:"bg-blue-500/20 text-blue-400",expired:"bg-gray-500/20 text-gray-400",cancelled:"bg-red-500/20 text-red-400",pending:"bg-orange-500/20 text-orange-400",pending_confirm:"bg-orange-500/20 text-orange-400",processing:"bg-blue-500/20 text-blue-400",completed:"bg-green-500/20 text-green-400",rejected:"bg-red-500/20 text-red-400"},q={active:"有效",converted:"已转化",expired:"已过期",cancelled:"已取消",pending:"待审核",pending_confirm:"待用户确认",processing:"处理中",completed:"已完成",rejected:"已拒绝"};return n.jsx(Oe,{className:`${ee[R]||"bg-gray-500/20 text-gray-400"} border-0`,children:q[R]||R})}const I=Math.ceil(V/G)||1,X=l,ne=f.filter(R=>{var q,le,ue,Q;if(!b)return!0;const ee=b.toLowerCase();return((q=R.refereeNickname)==null?void 0:q.toLowerCase().includes(ee))||((le=R.refereePhone)==null?void 0:le.includes(ee))||((ue=R.referrerName)==null?void 0:ue.toLowerCase().includes(ee))||((Q=R.referrerCode)==null?void 0:Q.toLowerCase().includes(ee))}),L=x.filter(R=>{var q;if(!b)return!0;const ee=b.toLowerCase();return((q=R.userName)==null?void 0:q.toLowerCase().includes(ee))||R.account&&R.account.toLowerCase().includes(ee)});return n.jsxs("div",{className:"p-8 max-w-7xl mx-auto",children:[k&&n.jsxs("div",{className:"mb-4 px-4 py-3 rounded-lg bg-red-500/20 border border-red-500/50 text-red-400 text-sm flex items-center justify-between",children:[n.jsx("span",{children:k}),n.jsx("button",{type:"button",onClick:()=>j(null),className:"hover:text-red-300",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(ge,{onClick:B,disabled:C,variant:"outline",className:"border-gray-700 text-gray-300 hover:bg-gray-800",children:[n.jsx(Ye,{className:`w-4 h-4 mr-2 ${C?"animate-spin":""}`}),"刷新数据"]})]}),n.jsx("div",{className:"flex gap-2 mb-6 border-b border-gray-700 pb-4",children:[{key:"overview",label:"数据概览",icon:su},{key:"orders",label:"订单管理",icon:uo},{key:"bindings",label:"绑定管理",icon:Es},{key:"withdrawals",label:"提现审核",icon:As}].map(R=>n.jsxs("button",{type:"button",onClick:()=>{a(R.key),N("all"),S("")},className:`flex items-center gap-2 px-4 py-2 rounded-lg text-sm font-medium transition-colors ${r===R.key?"bg-[#38bdac] text-white":"text-gray-400 hover:text-white hover:bg-gray-800"}`,children:[n.jsx(R.icon,{className:"w-4 h-4"}),R.label]},R.key))}),C?n.jsxs("div",{className:"flex items-center justify-center py-20",children:[n.jsx(Ye,{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(Re,{className:"bg-[#0f2137] border-gray-700/50",children:n.jsx(_e,{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(Eu,{className:"w-6 h-6 text-blue-400"})})]})})}),n.jsx(Re,{className:"bg-[#0f2137] border-gray-700/50",children:n.jsx(_e,{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(Es,{className:"w-6 h-6 text-green-400"})})]})})}),n.jsx(Re,{className:"bg-[#0f2137] border-gray-700/50",children:n.jsx(_e,{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(Zc,{className:"w-6 h-6 text-purple-400"})})]})})}),n.jsx(Re,{className:"bg-[#0f2137] border-gray-700/50",children:n.jsx(_e,{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(uo,{className:"w-6 h-6 text-[#38bdac]"})})]})})})]}),n.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[n.jsx(Re,{className:"bg-orange-500/10 border-orange-500/30",children:n.jsx(_e,{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(cp,{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(Re,{className:"bg-blue-500/10 border-blue-500/30",children:n.jsx(_e,{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(As,{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(ge,{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(Re,{className:"bg-[#0f2137] border-gray-700/50",children:[n.jsx(Ue,{children:n.jsxs(Ve,{className:"text-white flex items-center gap-2",children:[n.jsx(Jc,{className:"w-5 h-5 text-[#38bdac]"}),"本月统计"]})}),n.jsx(_e,{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(Re,{className:"bg-[#0f2137] border-gray-700/50",children:[n.jsx(Ue,{children:n.jsxs(Ve,{className:"text-white flex items-center gap-2",children:[n.jsx(su,{className:"w-5 h-5 text-[#38bdac]"}),"累计统计"]})}),n.jsxs(_e,{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(Re,{className:"bg-[#0f2137] border-gray-700/50",children:[n.jsx(Ue,{children:n.jsxs(Ve,{className:"text-white flex items-center gap-2",children:[n.jsx(Rn,{className:"w-5 h-5 text-[#38bdac]"}),"推广统计"]})}),n.jsx(_e,{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(Vr,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-gray-400"}),n.jsx(me,{value:b,onChange:R=>S(R.target.value),placeholder:"搜索订单号、用户名、手机号...",className:"pl-10 bg-[#0f2137] border-gray-700 text-white"})]}),n.jsxs("select",{value:P,onChange:R=>N(R.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(Re,{className:"bg-[#0f2137] border-gray-700/50",children:n.jsxs(_e,{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:X.map(R=>{var ee,q;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:[(ee=R.id)==null?void 0:ee.slice(0,12),"..."]}),n.jsx("td",{className:"p-4",children:n.jsxs("div",{children:[n.jsx("p",{className:"text-white text-sm",children:R.userNickname}),n.jsx("p",{className:"text-gray-500 text-xs",children:R.userPhone})]})}),n.jsx("td",{className:"p-4",children:n.jsxs("div",{children:[n.jsx("p",{className:"text-white text-sm",children:(()=>{const le=R.productType||R.type;return le==="fullbook"?`${R.bookName||"《底层逻辑》"} - 全本`:le==="match"?"匹配次数购买":`${R.bookName||"《底层逻辑》"} - ${R.sectionTitle||R.chapterTitle||`章节${R.productId||R.sectionId||""}`}`})()}),n.jsx("p",{className:"text-gray-500 text-xs",children:(()=>{const le=R.productType||R.type;return le==="fullbook"?"全书解锁":le==="match"?"功能权益":R.chapterTitle||"单章购买"})()})]})}),n.jsxs("td",{className:"p-4 text-[#38bdac] font-bold",children:["¥",typeof R.amount=="number"?R.amount.toFixed(2):parseFloat(String(R.amount||"0")).toFixed(2)]}),n.jsx("td",{className:"p-4 text-gray-300",children:R.paymentMethod==="wechat"?"微信支付":R.paymentMethod==="alipay"?"支付宝":R.paymentMethod||"微信支付"}),n.jsx("td",{className:"p-4",children:R.status==="completed"||R.status==="paid"?n.jsx(Oe,{className:"bg-green-500/20 text-green-400 border-0",children:"已完成"}):R.status==="pending"||R.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:R.referrerId||R.referralCode?n.jsxs("span",{title:R.referralCode||R.referrerCode||R.referrerId||"",children:[R.referrerNickname||R.referralCode||R.referrerCode||((q=R.referrerId)==null?void 0:q.slice(0,8)),(R.referralCode||R.referrerCode)&&` (${R.referralCode||R.referrerCode})`]}):"-"}),n.jsx("td",{className:"p-4 text-[#FFD700]",children:R.referrerEarnings?`¥${(typeof R.referrerEarnings=="number"?R.referrerEarnings:parseFloat(String(R.referrerEarnings))).toFixed(2)}`:"-"}),n.jsx("td",{className:"p-4 text-gray-400 text-sm",children:R.createdAt?new Date(R.createdAt).toLocaleString("zh-CN"):"-"})]},R.id)})})]})}),r==="orders"&&n.jsx(Wr,{page:T,totalPages:I,total:V,pageSize:G,onPageChange:U,onPageSizeChange:R=>{D(R),U(1)}})]})})]}),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(Vr,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-gray-400"}),n.jsx(me,{value:b,onChange:R=>S(R.target.value),placeholder:"搜索用户昵称、手机号、推广码...",className:"pl-10 bg-[#0f2137] border-gray-700 text-white"})]}),n.jsxs("select",{value:P,onChange:R=>N(R.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(Re,{className:"bg-[#0f2137] border-gray-700/50",children:n.jsxs(_e,{className:"p-0",children:[ne.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:ne.map(R=>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:R.refereeNickname||"匿名用户"}),n.jsx("p",{className:"text-gray-500 text-xs",children:R.refereePhone})]})}),n.jsx("td",{className:"p-4",children:n.jsxs("div",{children:[n.jsx("p",{className:"text-white",children:R.referrerName||"-"}),n.jsx("p",{className:"text-gray-500 text-xs font-mono",children:R.referrerCode})]})}),n.jsx("td",{className:"p-4 text-gray-400",children:R.boundAt?new Date(R.boundAt).toLocaleDateString("zh-CN"):"-"}),n.jsx("td",{className:"p-4 text-gray-400",children:R.expiresAt?new Date(R.expiresAt).toLocaleDateString("zh-CN"):"-"}),n.jsx("td",{className:"p-4",children:H(R.status)}),n.jsx("td",{className:"p-4",children:R.commission?n.jsxs("span",{className:"text-[#38bdac] font-medium",children:["¥",R.commission.toFixed(2)]}):n.jsx("span",{className:"text-gray-500",children:"-"})})]},R.id))})]})}),r==="bindings"&&n.jsx(Wr,{page:T,totalPages:I,total:V,pageSize:G,onPageChange:U,onPageSizeChange:R=>{D(R),U(1)}})]})})]}),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(Vr,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-gray-400"}),n.jsx(me,{value:b,onChange:R=>S(R.target.value),placeholder:"搜索用户名称、账号...",className:"pl-10 bg-[#0f2137] border-gray-700 text-white"})]}),n.jsxs("select",{value:P,onChange:R=>N(R.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(Re,{className:"bg-[#0f2137] border-gray-700/50",children:n.jsxs(_e,{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-right font-medium",children:"操作"})]})}),n.jsx("tbody",{className:"divide-y divide-gray-700/50",children:L.map(R=>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:[R.userAvatar?n.jsx("img",{src:R.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:(R.userName||R.name||"?").slice(0,1)}),n.jsx("p",{className:"text-white font-medium",children:R.userName||R.name})]})}),n.jsx("td",{className:"p-4",children:n.jsxs("span",{className:"text-[#38bdac] font-bold",children:["¥",R.amount.toFixed(2)]})}),n.jsx("td",{className:"p-4",children:n.jsx(Oe,{className:R.method==="wechat"?"bg-green-500/20 text-green-400 border-0":"bg-blue-500/20 text-blue-400 border-0",children:R.method==="wechat"?"微信":"支付宝"})}),n.jsx("td",{className:"p-4",children:n.jsxs("div",{children:[n.jsx("p",{className:"text-white font-mono text-xs",children:R.account}),n.jsx("p",{className:"text-gray-500 text-xs",children:R.name})]})}),n.jsx("td",{className:"p-4 text-gray-400",children:R.createdAt?new Date(R.createdAt).toLocaleString("zh-CN"):"-"}),n.jsx("td",{className:"p-4",children:H(R.status)}),n.jsx("td",{className:"p-4 text-right",children:R.status==="pending"&&n.jsxs("div",{className:"flex gap-2 justify-end",children:[n.jsxs(ge,{size:"sm",onClick:()=>z(R.id),className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:[n.jsx(Zc,{className:"w-4 h-4 mr-1"}),"通过"]}),n.jsxs(ge,{size:"sm",variant:"outline",onClick:()=>K(R.id),className:"border-red-500/50 text-red-400 hover:bg-red-500/20",children:[n.jsx(Sw,{className:"w-4 h-4 mr-1"}),"拒绝"]})]})})]},R.id))})]})}),r==="withdrawals"&&n.jsx(Wr,{page:T,totalPages:I,total:V,pageSize:G,onPageChange:U,onPageSizeChange:R=>{D(R),U(1)}})]})})]})]})]})}function s2(){const[r,a]=p.useState([]),[l,i]=p.useState({total:0,pendingCount:0,pendingAmount:0,successCount:0,successAmount:0,failedCount:0}),[c,d]=p.useState(!0),[f,m]=p.useState(null),[x,v]=p.useState("all"),[g,y]=p.useState(1),[C,E]=p.useState(10),[k,j]=p.useState(0),[b,S]=p.useState(null);async function P(){var D,V,se,he,de,fe,Y;d(!0),m(null);try{const B=new URLSearchParams({status:x,page:String(g),pageSize:String(C)}),z=await Xe(`/api/admin/withdrawals?${B}`);if(z!=null&&z.success){const K=z.withdrawals||[];a(K),j(z.total??((D=z.stats)==null?void 0:D.total)??K.length),i({total:((V=z.stats)==null?void 0:V.total)??z.total??K.length,pendingCount:((se=z.stats)==null?void 0:se.pendingCount)??0,pendingAmount:((he=z.stats)==null?void 0:he.pendingAmount)??0,successCount:((de=z.stats)==null?void 0:de.successCount)??0,successAmount:((fe=z.stats)==null?void 0:fe.successAmount)??0,failedCount:((Y=z.stats)==null?void 0:Y.failedCount)??0})}else m("加载提现记录失败")}catch(B){console.error("Load withdrawals error:",B),m("加载失败,请检查网络后重试")}finally{d(!1)}}p.useEffect(()=>{y(1)},[x]),p.useEffect(()=>{P()},[x,g,C]);const N=Math.ceil(k/C)||1;async function T(D){const V=r.find(se=>se.id===D);if(V!=null&&V.userCommissionInfo&&V.userCommissionInfo.availableAfterThis<0){if(!confirm(`⚠️ 风险警告:该用户审核后余额为负数(¥${V.userCommissionInfo.availableAfterThis.toFixed(2)}),可能存在超额提现。 - -确认已核实用户账户并完成打款?`))return}else if(!confirm("确认已完成打款?批准后将更新用户提现记录。"))return;S(D);try{const se=await Hn("/api/admin/withdrawals",{id:D,action:"approve"});se!=null&&se.success?P():alert("操作失败: "+((se==null?void 0:se.error)??""))}catch{alert("操作失败")}finally{S(null)}}async function U(D){const V=prompt("请输入拒绝原因(将返还用户余额):");if(V){S(D);try{const se=await Hn("/api/admin/withdrawals",{id:D,action:"reject",errorMessage:V});se!=null&&se.success?P():alert("操作失败: "+((se==null?void 0:se.error)??""))}catch{alert("操作失败")}finally{S(null)}}}function G(D){switch(D){case"pending":return n.jsx(Oe,{className:"bg-orange-500/20 text-orange-400 hover:bg-orange-500/20 border-0",children:"待处理"});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:D})}}return n.jsxs("div",{className:"p-8 max-w-6xl mx-auto",children:[f&&n.jsxs("div",{className:"mb-4 px-4 py-3 rounded-lg bg-red-500/20 border border-red-500/50 text-red-400 text-sm flex items-center justify-between",children:[n.jsx("span",{children:f}),n.jsx("button",{type:"button",onClick:()=>m(null),className:"hover:text-red-300",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(ge,{variant:"outline",onClick:P,disabled:c,className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:[n.jsx(Ye,{className:`w-4 h-4 mr-2 ${c?"animate-spin":""}`}),"刷新"]})]}),n.jsx(Re,{className:"bg-gradient-to-r from-[#38bdac]/10 to-[#0f2137] border-[#38bdac]/30 mb-6",children:n.jsx(_e,{className:"p-4",children:n.jsxs("div",{className:"flex items-start gap-3",children:[n.jsx(uo,{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(Re,{className:"bg-[#0f2137] border-gray-700/50",children:n.jsxs(_e,{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(Re,{className:"bg-[#0f2137] border-gray-700/50",children:n.jsxs(_e,{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(Re,{className:"bg-[#0f2137] border-gray-700/50",children:n.jsxs(_e,{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(Re,{className:"bg-[#0f2137] border-gray-700/50",children:n.jsxs(_e,{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(D=>n.jsx(ge,{variant:x===D?"default":"outline",size:"sm",onClick:()=>v(D),className:x===D?"bg-[#38bdac] hover:bg-[#2da396] text-white":"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:D==="all"?"全部":D==="pending"?"待处理":D==="success"?"已完成":"已拒绝"},D))}),n.jsx(Re,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:n.jsx(_e,{className:"p-0",children:c?n.jsxs("div",{className:"flex items-center justify-center py-12",children:[n.jsx(Ye,{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(As,{className:"w-12 h-12 text-gray-600 mx-auto mb-3"}),n.jsx("p",{className:"text-gray-500",children:"暂无提现记录"})]}):n.jsxs(n.Fragment,{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-right font-medium",children:"操作"})]})}),n.jsx("tbody",{className:"divide-y divide-gray-700/50",children:r.map(D=>n.jsxs("tr",{className:"hover:bg-[#0a1628] transition-colors",children:[n.jsx("td",{className:"p-4 text-gray-400",children:new Date(D.createdAt??"").toLocaleString()}),n.jsx("td",{className:"p-4",children:n.jsxs("div",{className:"flex items-center gap-2",children:[D.userAvatar?n.jsx("img",{src:D.userAvatar,alt:D.userName??"",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:(D.userName??"?").charAt(0)}),n.jsxs("div",{children:[n.jsx("p",{className:"font-medium text-white",children:D.userName??"未知"}),n.jsx("p",{className:"text-xs text-gray-500",children:D.userPhone??D.referralCode??(D.userId??"").slice(0,10)})]})]})}),n.jsx("td",{className:"p-4",children:n.jsxs("span",{className:"font-bold text-orange-400",children:["¥",Number(D.amount).toFixed(2)]})}),n.jsx("td",{className:"p-4",children:D.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:["¥",D.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:["¥",D.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:["¥",D.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:D.userCommissionInfo.availableAfterThis>=0?"text-green-400 font-medium":"text-red-400 font-medium",children:["¥",D.userCommissionInfo.availableAfterThis.toFixed(2)]})]})]}):n.jsx("span",{className:"text-gray-500 text-xs",children:"暂无数据"})}),n.jsxs("td",{className:"p-4",children:[G(D.status),D.errorMessage&&n.jsx("p",{className:"text-xs text-red-400 mt-1",children:D.errorMessage})]}),n.jsx("td",{className:"p-4 text-gray-400",children:D.processedAt?new Date(D.processedAt).toLocaleString():"-"}),n.jsx("td",{className:"p-4 text-gray-400",children:D.userConfirmedAt?n.jsxs("span",{className:"text-green-400",title:D.userConfirmedAt,children:["已确认 ",new Date(D.userConfirmedAt).toLocaleString()]}):"-"}),n.jsxs("td",{className:"p-4 text-right",children:[(D.status==="pending"||D.status==="pending_confirm")&&n.jsxs("div",{className:"flex items-center justify-end gap-2",children:[n.jsxs(ge,{size:"sm",onClick:()=>T(D.id),disabled:b===D.id,className:"bg-green-600 hover:bg-green-700 text-white",children:[n.jsx(Co,{className:"w-4 h-4 mr-1"}),"批准"]}),n.jsxs(ge,{size:"sm",variant:"outline",onClick:()=>U(D.id),disabled:b===D.id,className:"border-red-500/50 text-red-400 hover:bg-red-500/10 bg-transparent",children:[n.jsx(Hr,{className:"w-4 h-4 mr-1"}),"拒绝"]})]}),(D.status==="success"||D.status==="completed")&&D.transactionId&&n.jsx("span",{className:"text-xs text-gray-500 font-mono",children:D.transactionId})]})]},D.id))})]})}),n.jsx(Wr,{page:g,totalPages:N,total:k,pageSize:C,onPageChange:y,onPageSizeChange:D=>{E(D),y(1)}})]})})})]})}const Ur=p.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}));Ur.displayName="Textarea";function go(r,[a,l]){return Math.min(l,Math.max(a,r))}const a2=["top","right","bottom","left"],jr=Math.min,Wt=Math.max,yo=Math.round,no=Math.floor,Pn=r=>({x:r,y:r}),l2={left:"right",right:"left",bottom:"top",top:"bottom"},o2={start:"end",end:"start"};function uu(r,a,l){return Wt(r,jr(a,l))}function Kn(r,a){return typeof r=="function"?r(a):r}function Gn(r){return r.split("-")[0]}function zs(r){return r.split("-")[1]}function Vu(r){return r==="x"?"y":"x"}function Wu(r){return r==="y"?"height":"width"}const i2=new Set(["top","bottom"]);function En(r){return i2.has(Gn(r))?"y":"x"}function Hu(r){return Vu(En(r))}function c2(r,a,l){l===void 0&&(l=!1);const i=zs(r),c=Hu(r),d=Wu(c);let f=c==="x"?i===(l?"end":"start")?"right":"left":i==="start"?"bottom":"top";return a.reference[d]>a.floating[d]&&(f=vo(f)),[f,vo(f)]}function u2(r){const a=vo(r);return[du(r),a,du(a)]}function du(r){return r.replace(/start|end/g,a=>o2[a])}const Am=["left","right"],Mm=["right","left"],d2=["top","bottom"],f2=["bottom","top"];function h2(r,a,l){switch(r){case"top":case"bottom":return l?a?Mm:Am:a?Am:Mm;case"left":case"right":return a?d2:f2;default:return[]}}function m2(r,a,l,i){const c=zs(r);let d=h2(Gn(r),l==="start",i);return c&&(d=d.map(f=>f+"-"+c),a&&(d=d.concat(d.map(du)))),d}function vo(r){return r.replace(/left|right|bottom|top/g,a=>l2[a])}function p2(r){return{top:0,right:0,bottom:0,left:0,...r}}function Lx(r){return typeof r!="number"?p2(r):{top:r,right:r,bottom:r,left:r}}function wo(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 Lm(r,a,l){let{reference:i,floating:c}=r;const d=En(a),f=Hu(a),m=Wu(f),x=Gn(a),v=d==="y",g=i.x+i.width/2-c.width/2,y=i.y+i.height/2-c.height/2,C=i[m]/2-c[m]/2;let E;switch(x){case"top":E={x:g,y:i.y-c.height};break;case"bottom":E={x:g,y:i.y+i.height};break;case"right":E={x:i.x+i.width,y};break;case"left":E={x:i.x-c.width,y};break;default:E={x:i.x,y:i.y}}switch(zs(a)){case"start":E[f]-=C*(l&&v?-1:1);break;case"end":E[f]+=C*(l&&v?-1:1);break}return E}async function x2(r,a){var l;a===void 0&&(a={});const{x:i,y:c,platform:d,rects:f,elements:m,strategy:x}=r,{boundary:v="clippingAncestors",rootBoundary:g="viewport",elementContext:y="floating",altBoundary:C=!1,padding:E=0}=Kn(a,r),k=Lx(E),b=m[C?y==="floating"?"reference":"floating":y],S=wo(await d.getClippingRect({element:(l=await(d.isElement==null?void 0:d.isElement(b)))==null||l?b:b.contextElement||await(d.getDocumentElement==null?void 0:d.getDocumentElement(m.floating)),boundary:v,rootBoundary:g,strategy:x})),P=y==="floating"?{x:i,y:c,width:f.floating.width,height:f.floating.height}:f.reference,N=await(d.getOffsetParent==null?void 0:d.getOffsetParent(m.floating)),T=await(d.isElement==null?void 0:d.isElement(N))?await(d.getScale==null?void 0:d.getScale(N))||{x:1,y:1}:{x:1,y:1},U=wo(d.convertOffsetParentRelativeRectToViewportRelativeRect?await d.convertOffsetParentRelativeRectToViewportRelativeRect({elements:m,rect:P,offsetParent:N,strategy:x}):P);return{top:(S.top-U.top+k.top)/T.y,bottom:(U.bottom-S.bottom+k.bottom)/T.y,left:(S.left-U.left+k.left)/T.x,right:(U.right-S.right+k.right)/T.x}}const g2=async(r,a,l)=>{const{placement:i="bottom",strategy:c="absolute",middleware:d=[],platform:f}=l,m=d.filter(Boolean),x=await(f.isRTL==null?void 0:f.isRTL(a));let v=await f.getElementRects({reference:r,floating:a,strategy:c}),{x:g,y}=Lm(v,i,x),C=i,E={},k=0;for(let b=0;b({name:"arrow",options:r,async fn(a){const{x:l,y:i,placement:c,rects:d,platform:f,elements:m,middlewareData:x}=a,{element:v,padding:g=0}=Kn(r,a)||{};if(v==null)return{};const y=Lx(g),C={x:l,y:i},E=Hu(c),k=Wu(E),j=await f.getDimensions(v),b=E==="y",S=b?"top":"left",P=b?"bottom":"right",N=b?"clientHeight":"clientWidth",T=d.reference[k]+d.reference[E]-C[E]-d.floating[k],U=C[E]-d.reference[E],G=await(f.getOffsetParent==null?void 0:f.getOffsetParent(v));let D=G?G[N]:0;(!D||!await(f.isElement==null?void 0:f.isElement(G)))&&(D=m.floating[N]||d.floating[k]);const V=T/2-U/2,se=D/2-j[k]/2-1,he=jr(y[S],se),de=jr(y[P],se),fe=he,Y=D-j[k]-de,B=D/2-j[k]/2+V,z=uu(fe,B,Y),K=!x.arrow&&zs(c)!=null&&B!==z&&d.reference[k]/2-(BB<=0)){var de,fe;const B=(((de=d.flip)==null?void 0:de.index)||0)+1,z=D[B];if(z&&(!(y==="alignment"?P!==En(z):!1)||he.every(I=>En(I.placement)===P?I.overflows[0]>0:!0)))return{data:{index:B,overflows:he},reset:{placement:z}};let K=(fe=he.filter(H=>H.overflows[0]<=0).sort((H,I)=>H.overflows[1]-I.overflows[1])[0])==null?void 0:fe.placement;if(!K)switch(E){case"bestFit":{var Y;const H=(Y=he.filter(I=>{if(G){const X=En(I.placement);return X===P||X==="y"}return!0}).map(I=>[I.placement,I.overflows.filter(X=>X>0).reduce((X,ne)=>X+ne,0)]).sort((I,X)=>I[1]-X[1])[0])==null?void 0:Y[0];H&&(K=H);break}case"initialPlacement":K=m;break}if(c!==K)return{reset:{placement:K}}}return{}}}};function Dm(r,a){return{top:r.top-a.height,right:r.right-a.width,bottom:r.bottom-a.height,left:r.left-a.width}}function Om(r){return a2.some(a=>r[a]>=0)}const w2=function(r){return r===void 0&&(r={}),{name:"hide",options:r,async fn(a){const{rects:l,platform:i}=a,{strategy:c="referenceHidden",...d}=Kn(r,a);switch(c){case"referenceHidden":{const f=await i.detectOverflow(a,{...d,elementContext:"reference"}),m=Dm(f,l.reference);return{data:{referenceHiddenOffsets:m,referenceHidden:Om(m)}}}case"escaped":{const f=await i.detectOverflow(a,{...d,altBoundary:!0}),m=Dm(f,l.floating);return{data:{escapedOffsets:m,escaped:Om(m)}}}default:return{}}}}},Dx=new Set(["left","top"]);async function b2(r,a){const{placement:l,platform:i,elements:c}=r,d=await(i.isRTL==null?void 0:i.isRTL(c.floating)),f=Gn(l),m=zs(l),x=En(l)==="y",v=Dx.has(f)?-1:1,g=d&&x?-1:1,y=Kn(a,r);let{mainAxis:C,crossAxis:E,alignmentAxis:k}=typeof y=="number"?{mainAxis:y,crossAxis:0,alignmentAxis:null}:{mainAxis:y.mainAxis||0,crossAxis:y.crossAxis||0,alignmentAxis:y.alignmentAxis};return m&&typeof k=="number"&&(E=m==="end"?k*-1:k),x?{x:E*g,y:C*v}:{x:C*v,y:E*g}}const j2=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,x=await b2(a,r);return f===((l=m.offset)==null?void 0:l.placement)&&(i=m.arrow)!=null&&i.alignmentOffset?{}:{x:c+x.x,y:d+x.y,data:{...x,placement:f}}}}},N2=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:x={fn:S=>{let{x:P,y:N}=S;return{x:P,y:N}}},...v}=Kn(r,a),g={x:l,y:i},y=await d.detectOverflow(a,v),C=En(Gn(c)),E=Vu(C);let k=g[E],j=g[C];if(f){const S=E==="y"?"top":"left",P=E==="y"?"bottom":"right",N=k+y[S],T=k-y[P];k=uu(N,k,T)}if(m){const S=C==="y"?"top":"left",P=C==="y"?"bottom":"right",N=j+y[S],T=j-y[P];j=uu(N,j,T)}const b=x.fn({...a,[E]:k,[C]:j});return{...b,data:{x:b.x-l,y:b.y-i,enabled:{[E]:f,[C]:m}}}}}},S2=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:x=!0,crossAxis:v=!0}=Kn(r,a),g={x:l,y:i},y=En(c),C=Vu(y);let E=g[C],k=g[y];const j=Kn(m,a),b=typeof j=="number"?{mainAxis:j,crossAxis:0}:{mainAxis:0,crossAxis:0,...j};if(x){const N=C==="y"?"height":"width",T=d.reference[C]-d.floating[N]+b.mainAxis,U=d.reference[C]+d.reference[N]-b.mainAxis;EU&&(E=U)}if(v){var S,P;const N=C==="y"?"width":"height",T=Dx.has(Gn(c)),U=d.reference[y]-d.floating[N]+(T&&((S=f.offset)==null?void 0:S[y])||0)+(T?0:b.crossAxis),G=d.reference[y]+d.reference[N]+(T?0:((P=f.offset)==null?void 0:P[y])||0)-(T?b.crossAxis:0);kG&&(k=G)}return{[C]:E,[y]:k}}}},C2=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:x=()=>{},...v}=Kn(r,a),g=await f.detectOverflow(a,v),y=Gn(c),C=zs(c),E=En(c)==="y",{width:k,height:j}=d.floating;let b,S;y==="top"||y==="bottom"?(b=y,S=C===(await(f.isRTL==null?void 0:f.isRTL(m.floating))?"start":"end")?"left":"right"):(S=y,b=C==="end"?"top":"bottom");const P=j-g.top-g.bottom,N=k-g.left-g.right,T=jr(j-g[b],P),U=jr(k-g[S],N),G=!a.middlewareData.shift;let D=T,V=U;if((l=a.middlewareData.shift)!=null&&l.enabled.x&&(V=N),(i=a.middlewareData.shift)!=null&&i.enabled.y&&(D=P),G&&!C){const he=Wt(g.left,0),de=Wt(g.right,0),fe=Wt(g.top,0),Y=Wt(g.bottom,0);E?V=k-2*(he!==0||de!==0?he+de:Wt(g.left,g.right)):D=j-2*(fe!==0||Y!==0?fe+Y:Wt(g.top,g.bottom))}await x({...a,availableWidth:V,availableHeight:D});const se=await f.getDimensions(m.floating);return k!==se.width||j!==se.height?{reset:{rects:!0}}:{}}}};function Ao(){return typeof window<"u"}function $s(r){return Ox(r)?(r.nodeName||"").toLowerCase():"#document"}function Ht(r){var a;return(r==null||(a=r.ownerDocument)==null?void 0:a.defaultView)||window}function Tn(r){var a;return(a=(Ox(r)?r.ownerDocument:r.document)||window.document)==null?void 0:a.documentElement}function Ox(r){return Ao()?r instanceof Node||r instanceof Ht(r).Node:!1}function hn(r){return Ao()?r instanceof Element||r instanceof Ht(r).Element:!1}function _n(r){return Ao()?r instanceof HTMLElement||r instanceof Ht(r).HTMLElement:!1}function Fm(r){return!Ao()||typeof ShadowRoot>"u"?!1:r instanceof ShadowRoot||r instanceof Ht(r).ShadowRoot}const k2=new Set(["inline","contents"]);function $a(r){const{overflow:a,overflowX:l,overflowY:i,display:c}=mn(r);return/auto|scroll|overlay|hidden|clip/.test(a+i+l)&&!k2.has(c)}const E2=new Set(["table","td","th"]);function P2(r){return E2.has($s(r))}const R2=[":popover-open",":modal"];function Mo(r){return R2.some(a=>{try{return r.matches(a)}catch{return!1}})}const _2=["transform","translate","scale","rotate","perspective"],T2=["transform","translate","scale","rotate","perspective","filter"],I2=["paint","layout","strict","content"];function Ku(r){const a=Gu(),l=hn(r)?mn(r):r;return _2.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)||T2.some(i=>(l.willChange||"").includes(i))||I2.some(i=>(l.contain||"").includes(i))}function A2(r){let a=Nr(r);for(;_n(a)&&!Ms(a);){if(Ku(a))return a;if(Mo(a))return null;a=Nr(a)}return null}function Gu(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const M2=new Set(["html","body","#document"]);function Ms(r){return M2.has($s(r))}function mn(r){return Ht(r).getComputedStyle(r)}function Lo(r){return hn(r)?{scrollLeft:r.scrollLeft,scrollTop:r.scrollTop}:{scrollLeft:r.scrollX,scrollTop:r.scrollY}}function Nr(r){if($s(r)==="html")return r;const a=r.assignedSlot||r.parentNode||Fm(r)&&r.host||Tn(r);return Fm(a)?a.host:a}function Fx(r){const a=Nr(r);return Ms(a)?r.ownerDocument?r.ownerDocument.body:r.body:_n(a)&&$a(a)?a:Fx(a)}function Ia(r,a,l){var i;a===void 0&&(a=[]),l===void 0&&(l=!0);const c=Fx(r),d=c===((i=r.ownerDocument)==null?void 0:i.body),f=Ht(c);if(d){const m=fu(f);return a.concat(f,f.visualViewport||[],$a(c)?c:[],m&&l?Ia(m):[])}return a.concat(c,Ia(c,[],l))}function fu(r){return r.parent&&Object.getPrototypeOf(r.parent)?r.frameElement:null}function zx(r){const a=mn(r);let l=parseFloat(a.width)||0,i=parseFloat(a.height)||0;const c=_n(r),d=c?r.offsetWidth:l,f=c?r.offsetHeight:i,m=yo(l)!==d||yo(i)!==f;return m&&(l=d,i=f),{width:l,height:i,$:m}}function Qu(r){return hn(r)?r:r.contextElement}function _s(r){const a=Qu(r);if(!_n(a))return Pn(1);const l=a.getBoundingClientRect(),{width:i,height:c,$:d}=zx(a);let f=(d?yo(l.width):l.width)/i,m=(d?yo(l.height):l.height)/c;return(!f||!Number.isFinite(f))&&(f=1),(!m||!Number.isFinite(m))&&(m=1),{x:f,y:m}}const L2=Pn(0);function $x(r){const a=Ht(r);return!Gu()||!a.visualViewport?L2:{x:a.visualViewport.offsetLeft,y:a.visualViewport.offsetTop}}function D2(r,a,l){return a===void 0&&(a=!1),!l||a&&l!==Ht(r)?!1:a}function Qr(r,a,l,i){a===void 0&&(a=!1),l===void 0&&(l=!1);const c=r.getBoundingClientRect(),d=Qu(r);let f=Pn(1);a&&(i?hn(i)&&(f=_s(i)):f=_s(r));const m=D2(d,l,i)?$x(d):Pn(0);let x=(c.left+m.x)/f.x,v=(c.top+m.y)/f.y,g=c.width/f.x,y=c.height/f.y;if(d){const C=Ht(d),E=i&&hn(i)?Ht(i):i;let k=C,j=fu(k);for(;j&&i&&E!==k;){const b=_s(j),S=j.getBoundingClientRect(),P=mn(j),N=S.left+(j.clientLeft+parseFloat(P.paddingLeft))*b.x,T=S.top+(j.clientTop+parseFloat(P.paddingTop))*b.y;x*=b.x,v*=b.y,g*=b.x,y*=b.y,x+=N,v+=T,k=Ht(j),j=fu(k)}}return wo({width:g,height:y,x,y:v})}function Do(r,a){const l=Lo(r).scrollLeft;return a?a.left+l:Qr(Tn(r)).left+l}function Bx(r,a){const l=r.getBoundingClientRect(),i=l.left+a.scrollLeft-Do(r,l),c=l.top+a.scrollTop;return{x:i,y:c}}function O2(r){let{elements:a,rect:l,offsetParent:i,strategy:c}=r;const d=c==="fixed",f=Tn(i),m=a?Mo(a.floating):!1;if(i===f||m&&d)return l;let x={scrollLeft:0,scrollTop:0},v=Pn(1);const g=Pn(0),y=_n(i);if((y||!y&&!d)&&(($s(i)!=="body"||$a(f))&&(x=Lo(i)),_n(i))){const E=Qr(i);v=_s(i),g.x=E.x+i.clientLeft,g.y=E.y+i.clientTop}const C=f&&!y&&!d?Bx(f,x):Pn(0);return{width:l.width*v.x,height:l.height*v.y,x:l.x*v.x-x.scrollLeft*v.x+g.x+C.x,y:l.y*v.y-x.scrollTop*v.y+g.y+C.y}}function F2(r){return Array.from(r.getClientRects())}function z2(r){const a=Tn(r),l=Lo(r),i=r.ownerDocument.body,c=Wt(a.scrollWidth,a.clientWidth,i.scrollWidth,i.clientWidth),d=Wt(a.scrollHeight,a.clientHeight,i.scrollHeight,i.clientHeight);let f=-l.scrollLeft+Do(r);const m=-l.scrollTop;return mn(i).direction==="rtl"&&(f+=Wt(a.clientWidth,i.clientWidth)-c),{width:c,height:d,x:f,y:m}}const zm=25;function $2(r,a){const l=Ht(r),i=Tn(r),c=l.visualViewport;let d=i.clientWidth,f=i.clientHeight,m=0,x=0;if(c){d=c.width,f=c.height;const g=Gu();(!g||g&&a==="fixed")&&(m=c.offsetLeft,x=c.offsetTop)}const v=Do(i);if(v<=0){const g=i.ownerDocument,y=g.body,C=getComputedStyle(y),E=g.compatMode==="CSS1Compat"&&parseFloat(C.marginLeft)+parseFloat(C.marginRight)||0,k=Math.abs(i.clientWidth-y.clientWidth-E);k<=zm&&(d-=k)}else v<=zm&&(d+=v);return{width:d,height:f,x:m,y:x}}const B2=new Set(["absolute","fixed"]);function U2(r,a){const l=Qr(r,!0,a==="fixed"),i=l.top+r.clientTop,c=l.left+r.clientLeft,d=_n(r)?_s(r):Pn(1),f=r.clientWidth*d.x,m=r.clientHeight*d.y,x=c*d.x,v=i*d.y;return{width:f,height:m,x,y:v}}function $m(r,a,l){let i;if(a==="viewport")i=$2(r,l);else if(a==="document")i=z2(Tn(r));else if(hn(a))i=U2(a,l);else{const c=$x(r);i={x:a.x-c.x,y:a.y-c.y,width:a.width,height:a.height}}return wo(i)}function Ux(r,a){const l=Nr(r);return l===a||!hn(l)||Ms(l)?!1:mn(l).position==="fixed"||Ux(l,a)}function V2(r,a){const l=a.get(r);if(l)return l;let i=Ia(r,[],!1).filter(m=>hn(m)&&$s(m)!=="body"),c=null;const d=mn(r).position==="fixed";let f=d?Nr(r):r;for(;hn(f)&&!Ms(f);){const m=mn(f),x=Ku(f);!x&&m.position==="fixed"&&(c=null),(d?!x&&!c:!x&&m.position==="static"&&!!c&&B2.has(c.position)||$a(f)&&!x&&Ux(r,f))?i=i.filter(g=>g!==f):c=m,f=Nr(f)}return a.set(r,i),i}function W2(r){let{element:a,boundary:l,rootBoundary:i,strategy:c}=r;const f=[...l==="clippingAncestors"?Mo(a)?[]:V2(a,this._c):[].concat(l),i],m=f[0],x=f.reduce((v,g)=>{const y=$m(a,g,c);return v.top=Wt(y.top,v.top),v.right=jr(y.right,v.right),v.bottom=jr(y.bottom,v.bottom),v.left=Wt(y.left,v.left),v},$m(a,m,c));return{width:x.right-x.left,height:x.bottom-x.top,x:x.left,y:x.top}}function H2(r){const{width:a,height:l}=zx(r);return{width:a,height:l}}function K2(r,a,l){const i=_n(a),c=Tn(a),d=l==="fixed",f=Qr(r,!0,d,a);let m={scrollLeft:0,scrollTop:0};const x=Pn(0);function v(){x.x=Do(c)}if(i||!i&&!d)if(($s(a)!=="body"||$a(c))&&(m=Lo(a)),i){const E=Qr(a,!0,d,a);x.x=E.x+a.clientLeft,x.y=E.y+a.clientTop}else c&&v();d&&!i&&c&&v();const g=c&&!i&&!d?Bx(c,m):Pn(0),y=f.left+m.scrollLeft-x.x-g.x,C=f.top+m.scrollTop-x.y-g.y;return{x:y,y:C,width:f.width,height:f.height}}function Hc(r){return mn(r).position==="static"}function Bm(r,a){if(!_n(r)||mn(r).position==="fixed")return null;if(a)return a(r);let l=r.offsetParent;return Tn(r)===l&&(l=l.ownerDocument.body),l}function Vx(r,a){const l=Ht(r);if(Mo(r))return l;if(!_n(r)){let c=Nr(r);for(;c&&!Ms(c);){if(hn(c)&&!Hc(c))return c;c=Nr(c)}return l}let i=Bm(r,a);for(;i&&P2(i)&&Hc(i);)i=Bm(i,a);return i&&Ms(i)&&Hc(i)&&!Ku(i)?l:i||A2(r)||l}const G2=async function(r){const a=this.getOffsetParent||Vx,l=this.getDimensions,i=await l(r.floating);return{reference:K2(r.reference,await a(r.floating),r.strategy),floating:{x:0,y:0,width:i.width,height:i.height}}};function Q2(r){return mn(r).direction==="rtl"}const Y2={convertOffsetParentRelativeRectToViewportRelativeRect:O2,getDocumentElement:Tn,getClippingRect:W2,getOffsetParent:Vx,getElementRects:G2,getClientRects:F2,getDimensions:H2,getScale:_s,isElement:hn,isRTL:Q2};function Wx(r,a){return r.x===a.x&&r.y===a.y&&r.width===a.width&&r.height===a.height}function X2(r,a){let l=null,i;const c=Tn(r);function d(){var m;clearTimeout(i),(m=l)==null||m.disconnect(),l=null}function f(m,x){m===void 0&&(m=!1),x===void 0&&(x=1),d();const v=r.getBoundingClientRect(),{left:g,top:y,width:C,height:E}=v;if(m||a(),!C||!E)return;const k=no(y),j=no(c.clientWidth-(g+C)),b=no(c.clientHeight-(y+E)),S=no(g),N={rootMargin:-k+"px "+-j+"px "+-b+"px "+-S+"px",threshold:Wt(0,jr(1,x))||1};let T=!0;function U(G){const D=G[0].intersectionRatio;if(D!==x){if(!T)return f();D?f(!1,D):i=setTimeout(()=>{f(!1,1e-7)},1e3)}D===1&&!Wx(v,r.getBoundingClientRect())&&f(),T=!1}try{l=new IntersectionObserver(U,{...N,root:c.ownerDocument})}catch{l=new IntersectionObserver(U,N)}l.observe(r)}return f(!0),d}function q2(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:x=!1}=i,v=Qu(r),g=c||d?[...v?Ia(v):[],...Ia(a)]:[];g.forEach(S=>{c&&S.addEventListener("scroll",l,{passive:!0}),d&&S.addEventListener("resize",l)});const y=v&&m?X2(v,l):null;let C=-1,E=null;f&&(E=new ResizeObserver(S=>{let[P]=S;P&&P.target===v&&E&&(E.unobserve(a),cancelAnimationFrame(C),C=requestAnimationFrame(()=>{var N;(N=E)==null||N.observe(a)})),l()}),v&&!x&&E.observe(v),E.observe(a));let k,j=x?Qr(r):null;x&&b();function b(){const S=Qr(r);j&&!Wx(j,S)&&l(),j=S,k=requestAnimationFrame(b)}return l(),()=>{var S;g.forEach(P=>{c&&P.removeEventListener("scroll",l),d&&P.removeEventListener("resize",l)}),y==null||y(),(S=E)==null||S.disconnect(),E=null,x&&cancelAnimationFrame(k)}}const J2=j2,Z2=N2,eS=v2,tS=C2,nS=w2,Um=y2,rS=S2,sS=(r,a,l)=>{const i=new Map,c={platform:Y2,...l},d={...c.platform,_c:i};return g2(r,a,{...c,platform:d})};var aS=typeof document<"u",lS=function(){},lo=aS?p.useLayoutEffect:lS;function bo(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(!bo(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)&&!bo(r[d],a[d]))return!1}return!0}return r!==r&&a!==a}function Hx(r){return typeof window>"u"?1:(r.ownerDocument.defaultView||window).devicePixelRatio||1}function Vm(r,a){const l=Hx(r);return Math.round(a*l)/l}function Kc(r){const a=p.useRef(r);return lo(()=>{a.current=r}),a}function oS(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:x,open:v}=r,[g,y]=p.useState({x:0,y:0,strategy:l,placement:a,middlewareData:{},isPositioned:!1}),[C,E]=p.useState(i);bo(C,i)||E(i);const[k,j]=p.useState(null),[b,S]=p.useState(null),P=p.useCallback(I=>{I!==G.current&&(G.current=I,j(I))},[]),N=p.useCallback(I=>{I!==D.current&&(D.current=I,S(I))},[]),T=d||k,U=f||b,G=p.useRef(null),D=p.useRef(null),V=p.useRef(g),se=x!=null,he=Kc(x),de=Kc(c),fe=Kc(v),Y=p.useCallback(()=>{if(!G.current||!D.current)return;const I={placement:a,strategy:l,middleware:C};de.current&&(I.platform=de.current),sS(G.current,D.current,I).then(X=>{const ne={...X,isPositioned:fe.current!==!1};B.current&&!bo(V.current,ne)&&(V.current=ne,Aa.flushSync(()=>{y(ne)}))})},[C,a,l,de,fe]);lo(()=>{v===!1&&V.current.isPositioned&&(V.current.isPositioned=!1,y(I=>({...I,isPositioned:!1})))},[v]);const B=p.useRef(!1);lo(()=>(B.current=!0,()=>{B.current=!1}),[]),lo(()=>{if(T&&(G.current=T),U&&(D.current=U),T&&U){if(he.current)return he.current(T,U,Y);Y()}},[T,U,Y,he,se]);const z=p.useMemo(()=>({reference:G,floating:D,setReference:P,setFloating:N}),[P,N]),K=p.useMemo(()=>({reference:T,floating:U}),[T,U]),H=p.useMemo(()=>{const I={position:l,left:0,top:0};if(!K.floating)return I;const X=Vm(K.floating,g.x),ne=Vm(K.floating,g.y);return m?{...I,transform:"translate("+X+"px, "+ne+"px)",...Hx(K.floating)>=1.5&&{willChange:"transform"}}:{position:l,left:X,top:ne}},[l,m,K.floating,g.x,g.y]);return p.useMemo(()=>({...g,update:Y,refs:z,elements:K,floatingStyles:H}),[g,Y,z,K,H])}const iS=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?Um({element:i.current,padding:c}).fn(l):{}:i?Um({element:i,padding:c}).fn(l):{}}}},cS=(r,a)=>({...J2(r),options:[r,a]}),uS=(r,a)=>({...Z2(r),options:[r,a]}),dS=(r,a)=>({...rS(r),options:[r,a]}),fS=(r,a)=>({...eS(r),options:[r,a]}),hS=(r,a)=>({...tS(r),options:[r,a]}),mS=(r,a)=>({...nS(r),options:[r,a]}),pS=(r,a)=>({...iS(r),options:[r,a]});var xS="Arrow",Kx=p.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"})})});Kx.displayName=xS;var gS=Kx,Yu="Popper",[Gx,Qx]=Cr(Yu),[yS,Yx]=Gx(Yu),Xx=r=>{const{__scopePopper:a,children:l}=r,[i,c]=p.useState(null);return n.jsx(yS,{scope:a,anchor:i,onAnchorChange:c,children:l})};Xx.displayName=Yu;var qx="PopperAnchor",Jx=p.forwardRef((r,a)=>{const{__scopePopper:l,virtualRef:i,...c}=r,d=Yx(qx,l),f=p.useRef(null),m=We(a,f),x=p.useRef(null);return p.useEffect(()=>{const v=x.current;x.current=(i==null?void 0:i.current)||f.current,v!==x.current&&d.onAnchorChange(x.current)}),i?null:n.jsx(Le.div,{...c,ref:m})});Jx.displayName=qx;var Xu="PopperContent",[vS,wS]=Gx(Xu),Zx=p.forwardRef((r,a)=>{var Q,ie,je,ye,Pe,Ie;const{__scopePopper:l,side:i="bottom",sideOffset:c=0,align:d="center",alignOffset:f=0,arrowPadding:m=0,avoidCollisions:x=!0,collisionBoundary:v=[],collisionPadding:g=0,sticky:y="partial",hideWhenDetached:C=!1,updatePositionStrategy:E="optimized",onPlaced:k,...j}=r,b=Yx(Xu,l),[S,P]=p.useState(null),N=We(a,rt=>P(rt)),[T,U]=p.useState(null),G=zu(T),D=(G==null?void 0:G.width)??0,V=(G==null?void 0:G.height)??0,se=i+(d!=="center"?"-"+d:""),he=typeof g=="number"?g:{top:0,right:0,bottom:0,left:0,...g},de=Array.isArray(v)?v:[v],fe=de.length>0,Y={padding:he,boundary:de.filter(jS),altBoundary:fe},{refs:B,floatingStyles:z,placement:K,isPositioned:H,middlewareData:I}=oS({strategy:"fixed",placement:se,whileElementsMounted:(...rt)=>q2(...rt,{animationFrame:E==="always"}),elements:{reference:b.anchor},middleware:[cS({mainAxis:c+V,alignmentAxis:f}),x&&uS({mainAxis:!0,crossAxis:!1,limiter:y==="partial"?dS():void 0,...Y}),x&&fS({...Y}),hS({...Y,apply:({elements:rt,rects:it,availableWidth:Kt,availableHeight:Gt})=>{const{width:_t,height:In}=it.reference,Ot=rt.floating.style;Ot.setProperty("--radix-popper-available-width",`${Kt}px`),Ot.setProperty("--radix-popper-available-height",`${Gt}px`),Ot.setProperty("--radix-popper-anchor-width",`${_t}px`),Ot.setProperty("--radix-popper-anchor-height",`${In}px`)}}),T&&pS({element:T,padding:m}),NS({arrowWidth:D,arrowHeight:V}),C&&mS({strategy:"referenceHidden",...Y})]}),[X,ne]=ng(K),L=br(k);Et(()=>{H&&(L==null||L())},[H,L]);const R=(Q=I.arrow)==null?void 0:Q.x,ee=(ie=I.arrow)==null?void 0:ie.y,q=((je=I.arrow)==null?void 0:je.centerOffset)!==0,[le,ue]=p.useState();return Et(()=>{S&&ue(window.getComputedStyle(S).zIndex)},[S]),n.jsx("div",{ref:B.setFloating,"data-radix-popper-content-wrapper":"",style:{...z,transform:H?z.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:le,"--radix-popper-transform-origin":[(ye=I.transformOrigin)==null?void 0:ye.x,(Pe=I.transformOrigin)==null?void 0:Pe.y].join(" "),...((Ie=I.hide)==null?void 0:Ie.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:r.dir,children:n.jsx(vS,{scope:l,placedSide:X,onArrowChange:U,arrowX:R,arrowY:ee,shouldHideArrow:q,children:n.jsx(Le.div,{"data-side":X,"data-align":ne,...j,ref:N,style:{...j.style,animation:H?void 0:"none"}})})})});Zx.displayName=Xu;var eg="PopperArrow",bS={top:"bottom",right:"left",bottom:"top",left:"right"},tg=p.forwardRef(function(a,l){const{__scopePopper:i,...c}=a,d=wS(eg,i),f=bS[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(gS,{...c,ref:l,style:{...c.style,display:"block"}})})});tg.displayName=eg;function jS(r){return r!==null}var NS=r=>({name:"transformOrigin",options:r,fn(a){var b,S,P;const{placement:l,rects:i,middlewareData:c}=a,f=((b=c.arrow)==null?void 0:b.centerOffset)!==0,m=f?0:r.arrowWidth,x=f?0:r.arrowHeight,[v,g]=ng(l),y={start:"0%",center:"50%",end:"100%"}[g],C=(((S=c.arrow)==null?void 0:S.x)??0)+m/2,E=(((P=c.arrow)==null?void 0:P.y)??0)+x/2;let k="",j="";return v==="bottom"?(k=f?y:`${C}px`,j=`${-x}px`):v==="top"?(k=f?y:`${C}px`,j=`${i.floating.height+x}px`):v==="right"?(k=`${-x}px`,j=f?y:`${E}px`):v==="left"&&(k=`${i.floating.width+x}px`,j=f?y:`${E}px`),{data:{x:k,y:j}}}});function ng(r){const[a,l="center"]=r.split("-");return[a,l]}var SS=Xx,CS=Jx,kS=Zx,ES=tg,rg=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),PS="VisuallyHidden",RS=p.forwardRef((r,a)=>n.jsx(Le.span,{...r,ref:a,style:{...rg,...r.style}}));RS.displayName=PS;var _S=[" ","Enter","ArrowUp","ArrowDown"],TS=[" ","Enter"],Yr="Select",[Oo,Fo,IS]=$u(Yr),[Bs]=Cr(Yr,[IS,Qx]),zo=Qx(),[AS,kr]=Bs(Yr),[MS,LS]=Bs(Yr),sg=r=>{const{__scopeSelect:a,children:l,open:i,defaultOpen:c,onOpenChange:d,value:f,defaultValue:m,onValueChange:x,dir:v,name:g,autoComplete:y,disabled:C,required:E,form:k}=r,j=zo(a),[b,S]=p.useState(null),[P,N]=p.useState(null),[T,U]=p.useState(!1),G=_o(v),[D,V]=Kr({prop:i,defaultProp:c??!1,onChange:d,caller:Yr}),[se,he]=Kr({prop:f,defaultProp:m,onChange:x,caller:Yr}),de=p.useRef(null),fe=b?k||!!b.closest("form"):!0,[Y,B]=p.useState(new Set),z=Array.from(Y).map(K=>K.props.value).join(";");return n.jsx(SS,{...j,children:n.jsxs(AS,{required:E,scope:a,trigger:b,onTriggerChange:S,valueNode:P,onValueNodeChange:N,valueNodeHasChildren:T,onValueNodeHasChildrenChange:U,contentId:wr(),value:se,onValueChange:he,open:D,onOpenChange:V,dir:G,triggerPointerDownPosRef:de,disabled:C,children:[n.jsx(Oo.Provider,{scope:a,children:n.jsx(MS,{scope:r.__scopeSelect,onNativeOptionAdd:p.useCallback(K=>{B(H=>new Set(H).add(K))},[]),onNativeOptionRemove:p.useCallback(K=>{B(H=>{const I=new Set(H);return I.delete(K),I})},[]),children:l})}),fe?n.jsxs(kg,{"aria-hidden":!0,required:E,tabIndex:-1,name:g,autoComplete:y,value:se,onChange:K=>he(K.target.value),disabled:C,form:k,children:[se===void 0?n.jsx("option",{value:""}):null,Array.from(Y)]},z):null]})})};sg.displayName=Yr;var ag="SelectTrigger",lg=p.forwardRef((r,a)=>{const{__scopeSelect:l,disabled:i=!1,...c}=r,d=zo(l),f=kr(ag,l),m=f.disabled||i,x=We(a,f.onTriggerChange),v=Fo(l),g=p.useRef("touch"),[y,C,E]=Pg(j=>{const b=v().filter(N=>!N.disabled),S=b.find(N=>N.value===f.value),P=Rg(b,j,S);P!==void 0&&f.onValueChange(P.value)}),k=j=>{m||(f.onOpenChange(!0),E()),j&&(f.triggerPointerDownPosRef.current={x:Math.round(j.pageX),y:Math.round(j.pageY)})};return n.jsx(CS,{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":Eg(f.value)?"":void 0,...c,ref:x,onClick:Ae(c.onClick,j=>{j.currentTarget.focus(),g.current!=="mouse"&&k(j)}),onPointerDown:Ae(c.onPointerDown,j=>{g.current=j.pointerType;const b=j.target;b.hasPointerCapture(j.pointerId)&&b.releasePointerCapture(j.pointerId),j.button===0&&j.ctrlKey===!1&&j.pointerType==="mouse"&&(k(j),j.preventDefault())}),onKeyDown:Ae(c.onKeyDown,j=>{const b=y.current!=="";!(j.ctrlKey||j.altKey||j.metaKey)&&j.key.length===1&&C(j.key),!(b&&j.key===" ")&&_S.includes(j.key)&&(k(),j.preventDefault())})})})});lg.displayName=ag;var og="SelectValue",ig=p.forwardRef((r,a)=>{const{__scopeSelect:l,className:i,style:c,children:d,placeholder:f="",...m}=r,x=kr(og,l),{onValueNodeHasChildrenChange:v}=x,g=d!==void 0,y=We(a,x.onValueNodeChange);return Et(()=>{v(g)},[v,g]),n.jsx(Le.span,{...m,ref:y,style:{pointerEvents:"none"},children:Eg(x.value)?n.jsx(n.Fragment,{children:f}):d})});ig.displayName=og;var DS="SelectIcon",cg=p.forwardRef((r,a)=>{const{__scopeSelect:l,children:i,...c}=r;return n.jsx(Le.span,{"aria-hidden":!0,...c,ref:a,children:i||"▼"})});cg.displayName=DS;var OS="SelectPortal",ug=r=>n.jsx(Au,{asChild:!0,...r});ug.displayName=OS;var Xr="SelectContent",dg=p.forwardRef((r,a)=>{const l=kr(Xr,r.__scopeSelect),[i,c]=p.useState();if(Et(()=>{c(new DocumentFragment)},[]),!l.open){const d=i;return d?Aa.createPortal(n.jsx(fg,{scope:r.__scopeSelect,children:n.jsx(Oo.Slot,{scope:r.__scopeSelect,children:n.jsx("div",{children:r.children})})}),d):null}return n.jsx(hg,{...r,ref:a})});dg.displayName=Xr;var dn=10,[fg,Er]=Bs(Xr),FS="SelectContentImpl",zS=Ta("SelectContent.RemoveScroll"),hg=p.forwardRef((r,a)=>{const{__scopeSelect:l,position:i="item-aligned",onCloseAutoFocus:c,onEscapeKeyDown:d,onPointerDownOutside:f,side:m,sideOffset:x,align:v,alignOffset:g,arrowPadding:y,collisionBoundary:C,collisionPadding:E,sticky:k,hideWhenDetached:j,avoidCollisions:b,...S}=r,P=kr(Xr,l),[N,T]=p.useState(null),[U,G]=p.useState(null),D=We(a,Q=>T(Q)),[V,se]=p.useState(null),[he,de]=p.useState(null),fe=Fo(l),[Y,B]=p.useState(!1),z=p.useRef(!1);p.useEffect(()=>{if(N)return Gp(N)},[N]),Fp();const K=p.useCallback(Q=>{const[ie,...je]=fe().map(Ie=>Ie.ref.current),[ye]=je.slice(-1),Pe=document.activeElement;for(const Ie of Q)if(Ie===Pe||(Ie==null||Ie.scrollIntoView({block:"nearest"}),Ie===ie&&U&&(U.scrollTop=0),Ie===ye&&U&&(U.scrollTop=U.scrollHeight),Ie==null||Ie.focus(),document.activeElement!==Pe))return},[fe,U]),H=p.useCallback(()=>K([V,N]),[K,V,N]);p.useEffect(()=>{Y&&H()},[Y,H]);const{onOpenChange:I,triggerPointerDownPosRef:X}=P;p.useEffect(()=>{if(N){let Q={x:0,y:0};const ie=ye=>{var Pe,Ie;Q={x:Math.abs(Math.round(ye.pageX)-(((Pe=X.current)==null?void 0:Pe.x)??0)),y:Math.abs(Math.round(ye.pageY)-(((Ie=X.current)==null?void 0:Ie.y)??0))}},je=ye=>{Q.x<=10&&Q.y<=10?ye.preventDefault():N.contains(ye.target)||I(!1),document.removeEventListener("pointermove",ie),X.current=null};return X.current!==null&&(document.addEventListener("pointermove",ie),document.addEventListener("pointerup",je,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",ie),document.removeEventListener("pointerup",je,{capture:!0})}}},[N,I,X]),p.useEffect(()=>{const Q=()=>I(!1);return window.addEventListener("blur",Q),window.addEventListener("resize",Q),()=>{window.removeEventListener("blur",Q),window.removeEventListener("resize",Q)}},[I]);const[ne,L]=Pg(Q=>{const ie=fe().filter(Pe=>!Pe.disabled),je=ie.find(Pe=>Pe.ref.current===document.activeElement),ye=Rg(ie,Q,je);ye&&setTimeout(()=>ye.ref.current.focus())}),R=p.useCallback((Q,ie,je)=>{const ye=!z.current&&!je;(P.value!==void 0&&P.value===ie||ye)&&(se(Q),ye&&(z.current=!0))},[P.value]),ee=p.useCallback(()=>N==null?void 0:N.focus(),[N]),q=p.useCallback((Q,ie,je)=>{const ye=!z.current&&!je;(P.value!==void 0&&P.value===ie||ye)&&de(Q)},[P.value]),le=i==="popper"?hu:mg,ue=le===hu?{side:m,sideOffset:x,align:v,alignOffset:g,arrowPadding:y,collisionBoundary:C,collisionPadding:E,sticky:k,hideWhenDetached:j,avoidCollisions:b}:{};return n.jsx(fg,{scope:l,content:N,viewport:U,onViewportChange:G,itemRefCallback:R,selectedItem:V,onItemLeave:ee,itemTextRefCallback:q,focusSelectedItem:H,selectedItemText:he,position:i,isPositioned:Y,searchRef:ne,children:n.jsx(Mu,{as:zS,allowPinchZoom:!0,children:n.jsx(Iu,{asChild:!0,trapped:P.open,onMountAutoFocus:Q=>{Q.preventDefault()},onUnmountAutoFocus:Ae(c,Q=>{var ie;(ie=P.trigger)==null||ie.focus({preventScroll:!0}),Q.preventDefault()}),children:n.jsx(Tu,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:d,onPointerDownOutside:f,onFocusOutside:Q=>Q.preventDefault(),onDismiss:()=>P.onOpenChange(!1),children:n.jsx(le,{role:"listbox",id:P.contentId,"data-state":P.open?"open":"closed",dir:P.dir,onContextMenu:Q=>Q.preventDefault(),...S,...ue,onPlaced:()=>B(!0),ref:D,style:{display:"flex",flexDirection:"column",outline:"none",...S.style},onKeyDown:Ae(S.onKeyDown,Q=>{const ie=Q.ctrlKey||Q.altKey||Q.metaKey;if(Q.key==="Tab"&&Q.preventDefault(),!ie&&Q.key.length===1&&L(Q.key),["ArrowUp","ArrowDown","Home","End"].includes(Q.key)){let ye=fe().filter(Pe=>!Pe.disabled).map(Pe=>Pe.ref.current);if(["ArrowUp","End"].includes(Q.key)&&(ye=ye.slice().reverse()),["ArrowUp","ArrowDown"].includes(Q.key)){const Pe=Q.target,Ie=ye.indexOf(Pe);ye=ye.slice(Ie+1)}setTimeout(()=>K(ye)),Q.preventDefault()}})})})})})})});hg.displayName=FS;var $S="SelectItemAlignedPosition",mg=p.forwardRef((r,a)=>{const{__scopeSelect:l,onPlaced:i,...c}=r,d=kr(Xr,l),f=Er(Xr,l),[m,x]=p.useState(null),[v,g]=p.useState(null),y=We(a,D=>g(D)),C=Fo(l),E=p.useRef(!1),k=p.useRef(!0),{viewport:j,selectedItem:b,selectedItemText:S,focusSelectedItem:P}=f,N=p.useCallback(()=>{if(d.trigger&&d.valueNode&&m&&v&&j&&b&&S){const D=d.trigger.getBoundingClientRect(),V=v.getBoundingClientRect(),se=d.valueNode.getBoundingClientRect(),he=S.getBoundingClientRect();if(d.dir!=="rtl"){const Pe=he.left-V.left,Ie=se.left-Pe,rt=D.left-Ie,it=D.width+rt,Kt=Math.max(it,V.width),Gt=window.innerWidth-dn,_t=go(Ie,[dn,Math.max(dn,Gt-Kt)]);m.style.minWidth=it+"px",m.style.left=_t+"px"}else{const Pe=V.right-he.right,Ie=window.innerWidth-se.right-Pe,rt=window.innerWidth-D.right-Ie,it=D.width+rt,Kt=Math.max(it,V.width),Gt=window.innerWidth-dn,_t=go(Ie,[dn,Math.max(dn,Gt-Kt)]);m.style.minWidth=it+"px",m.style.right=_t+"px"}const de=C(),fe=window.innerHeight-dn*2,Y=j.scrollHeight,B=window.getComputedStyle(v),z=parseInt(B.borderTopWidth,10),K=parseInt(B.paddingTop,10),H=parseInt(B.borderBottomWidth,10),I=parseInt(B.paddingBottom,10),X=z+K+Y+I+H,ne=Math.min(b.offsetHeight*5,X),L=window.getComputedStyle(j),R=parseInt(L.paddingTop,10),ee=parseInt(L.paddingBottom,10),q=D.top+D.height/2-dn,le=fe-q,ue=b.offsetHeight/2,Q=b.offsetTop+ue,ie=z+K+Q,je=X-ie;if(ie<=q){const Pe=de.length>0&&b===de[de.length-1].ref.current;m.style.bottom="0px";const Ie=v.clientHeight-j.offsetTop-j.offsetHeight,rt=Math.max(le,ue+(Pe?ee:0)+Ie+H),it=ie+rt;m.style.height=it+"px"}else{const Pe=de.length>0&&b===de[0].ref.current;m.style.top="0px";const rt=Math.max(q,z+j.offsetTop+(Pe?R:0)+ue)+je;m.style.height=rt+"px",j.scrollTop=ie-q+j.offsetTop}m.style.margin=`${dn}px 0`,m.style.minHeight=ne+"px",m.style.maxHeight=fe+"px",i==null||i(),requestAnimationFrame(()=>E.current=!0)}},[C,d.trigger,d.valueNode,m,v,j,b,S,d.dir,i]);Et(()=>N(),[N]);const[T,U]=p.useState();Et(()=>{v&&U(window.getComputedStyle(v).zIndex)},[v]);const G=p.useCallback(D=>{D&&k.current===!0&&(N(),P==null||P(),k.current=!1)},[N,P]);return n.jsx(US,{scope:l,contentWrapper:m,shouldExpandOnScrollRef:E,onScrollButtonChange:G,children:n.jsx("div",{ref:x,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:T},children:n.jsx(Le.div,{...c,ref:y,style:{boxSizing:"border-box",maxHeight:"100%",...c.style}})})})});mg.displayName=$S;var BS="SelectPopperPosition",hu=p.forwardRef((r,a)=>{const{__scopeSelect:l,align:i="start",collisionPadding:c=dn,...d}=r,f=zo(l);return n.jsx(kS,{...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)"}})});hu.displayName=BS;var[US,qu]=Bs(Xr,{}),mu="SelectViewport",pg=p.forwardRef((r,a)=>{const{__scopeSelect:l,nonce:i,...c}=r,d=Er(mu,l),f=qu(mu,l),m=We(a,d.onViewportChange),x=p.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(Oo.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,v=>{const g=v.currentTarget,{contentWrapper:y,shouldExpandOnScrollRef:C}=f;if(C!=null&&C.current&&y){const E=Math.abs(x.current-g.scrollTop);if(E>0){const k=window.innerHeight-dn*2,j=parseFloat(y.style.minHeight),b=parseFloat(y.style.height),S=Math.max(j,b);if(S0?T:0,y.style.justifyContent="flex-end")}}}x.current=g.scrollTop})})})]})});pg.displayName=mu;var xg="SelectGroup",[VS,WS]=Bs(xg),HS=p.forwardRef((r,a)=>{const{__scopeSelect:l,...i}=r,c=wr();return n.jsx(VS,{scope:l,id:c,children:n.jsx(Le.div,{role:"group","aria-labelledby":c,...i,ref:a})})});HS.displayName=xg;var gg="SelectLabel",KS=p.forwardRef((r,a)=>{const{__scopeSelect:l,...i}=r,c=WS(gg,l);return n.jsx(Le.div,{id:c.id,...i,ref:a})});KS.displayName=gg;var jo="SelectItem",[GS,yg]=Bs(jo),vg=p.forwardRef((r,a)=>{const{__scopeSelect:l,value:i,disabled:c=!1,textValue:d,...f}=r,m=kr(jo,l),x=Er(jo,l),v=m.value===i,[g,y]=p.useState(d??""),[C,E]=p.useState(!1),k=We(a,P=>{var N;return(N=x.itemRefCallback)==null?void 0:N.call(x,P,i,c)}),j=wr(),b=p.useRef("touch"),S=()=>{c||(m.onValueChange(i),m.onOpenChange(!1))};if(i==="")throw new Error("A must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return n.jsx(GS,{scope:l,value:i,disabled:c,textId:j,isSelected:v,onItemTextChange:p.useCallback(P=>{y(N=>N||((P==null?void 0:P.textContent)??"").trim())},[]),children:n.jsx(Oo.ItemSlot,{scope:l,value:i,disabled:c,textValue:g,children:n.jsx(Le.div,{role:"option","aria-labelledby":j,"data-highlighted":C?"":void 0,"aria-selected":v&&C,"data-state":v?"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,()=>{b.current!=="mouse"&&S()}),onPointerUp:Ae(f.onPointerUp,()=>{b.current==="mouse"&&S()}),onPointerDown:Ae(f.onPointerDown,P=>{b.current=P.pointerType}),onPointerMove:Ae(f.onPointerMove,P=>{var N;b.current=P.pointerType,c?(N=x.onItemLeave)==null||N.call(x):b.current==="mouse"&&P.currentTarget.focus({preventScroll:!0})}),onPointerLeave:Ae(f.onPointerLeave,P=>{var N;P.currentTarget===document.activeElement&&((N=x.onItemLeave)==null||N.call(x))}),onKeyDown:Ae(f.onKeyDown,P=>{var T;((T=x.searchRef)==null?void 0:T.current)!==""&&P.key===" "||(TS.includes(P.key)&&S(),P.key===" "&&P.preventDefault())})})})})});vg.displayName=jo;var Pa="SelectItemText",wg=p.forwardRef((r,a)=>{const{__scopeSelect:l,className:i,style:c,...d}=r,f=kr(Pa,l),m=Er(Pa,l),x=yg(Pa,l),v=LS(Pa,l),[g,y]=p.useState(null),C=We(a,S=>y(S),x.onItemTextChange,S=>{var P;return(P=m.itemTextRefCallback)==null?void 0:P.call(m,S,x.value,x.disabled)}),E=g==null?void 0:g.textContent,k=p.useMemo(()=>n.jsx("option",{value:x.value,disabled:x.disabled,children:E},x.value),[x.disabled,x.value,E]),{onNativeOptionAdd:j,onNativeOptionRemove:b}=v;return Et(()=>(j(k),()=>b(k)),[j,b,k]),n.jsxs(n.Fragment,{children:[n.jsx(Le.span,{id:x.textId,...d,ref:C}),x.isSelected&&f.valueNode&&!f.valueNodeHasChildren?Aa.createPortal(d.children,f.valueNode):null]})});wg.displayName=Pa;var bg="SelectItemIndicator",jg=p.forwardRef((r,a)=>{const{__scopeSelect:l,...i}=r;return yg(bg,l).isSelected?n.jsx(Le.span,{"aria-hidden":!0,...i,ref:a}):null});jg.displayName=bg;var pu="SelectScrollUpButton",Ng=p.forwardRef((r,a)=>{const l=Er(pu,r.__scopeSelect),i=qu(pu,r.__scopeSelect),[c,d]=p.useState(!1),f=We(a,i.onScrollButtonChange);return Et(()=>{if(l.viewport&&l.isPositioned){let m=function(){const v=x.scrollTop>0;d(v)};const x=l.viewport;return m(),x.addEventListener("scroll",m),()=>x.removeEventListener("scroll",m)}},[l.viewport,l.isPositioned]),c?n.jsx(Cg,{...r,ref:f,onAutoScroll:()=>{const{viewport:m,selectedItem:x}=l;m&&x&&(m.scrollTop=m.scrollTop-x.offsetHeight)}}):null});Ng.displayName=pu;var xu="SelectScrollDownButton",Sg=p.forwardRef((r,a)=>{const l=Er(xu,r.__scopeSelect),i=qu(xu,r.__scopeSelect),[c,d]=p.useState(!1),f=We(a,i.onScrollButtonChange);return Et(()=>{if(l.viewport&&l.isPositioned){let m=function(){const v=x.scrollHeight-x.clientHeight,g=Math.ceil(x.scrollTop)x.removeEventListener("scroll",m)}},[l.viewport,l.isPositioned]),c?n.jsx(Cg,{...r,ref:f,onAutoScroll:()=>{const{viewport:m,selectedItem:x}=l;m&&x&&(m.scrollTop=m.scrollTop+x.offsetHeight)}}):null});Sg.displayName=xu;var Cg=p.forwardRef((r,a)=>{const{__scopeSelect:l,onAutoScroll:i,...c}=r,d=Er("SelectScrollButton",l),f=p.useRef(null),m=Fo(l),x=p.useCallback(()=>{f.current!==null&&(window.clearInterval(f.current),f.current=null)},[]);return p.useEffect(()=>()=>x(),[x]),Et(()=>{var g;const v=m().find(y=>y.ref.current===document.activeElement);(g=v==null?void 0:v.ref.current)==null||g.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 v;(v=d.onItemLeave)==null||v.call(d),f.current===null&&(f.current=window.setInterval(i,50))}),onPointerLeave:Ae(c.onPointerLeave,()=>{x()})})}),QS="SelectSeparator",YS=p.forwardRef((r,a)=>{const{__scopeSelect:l,...i}=r;return n.jsx(Le.div,{"aria-hidden":!0,...i,ref:a})});YS.displayName=QS;var gu="SelectArrow",XS=p.forwardRef((r,a)=>{const{__scopeSelect:l,...i}=r,c=zo(l),d=kr(gu,l),f=Er(gu,l);return d.open&&f.position==="popper"?n.jsx(ES,{...c,...i,ref:a}):null});XS.displayName=gu;var qS="SelectBubbleInput",kg=p.forwardRef(({__scopeSelect:r,value:a,...l},i)=>{const c=p.useRef(null),d=We(i,c),f=Fu(a);return p.useEffect(()=>{const m=c.current;if(!m)return;const x=window.HTMLSelectElement.prototype,g=Object.getOwnPropertyDescriptor(x,"value").set;if(f!==a&&g){const y=new Event("change",{bubbles:!0});g.call(m,a),m.dispatchEvent(y)}},[f,a]),n.jsx(Le.select,{...l,style:{...rg,...l.style},ref:d,defaultValue:a})});kg.displayName=qS;function Eg(r){return r===""||r===void 0}function Pg(r){const a=br(r),l=p.useRef(""),i=p.useRef(0),c=p.useCallback(f=>{const m=l.current+f;a(m),(function x(v){l.current=v,window.clearTimeout(i.current),v!==""&&(i.current=window.setTimeout(()=>x(""),1e3))})(m)},[a]),d=p.useCallback(()=>{l.current="",window.clearTimeout(i.current)},[]);return p.useEffect(()=>()=>window.clearTimeout(i.current),[]),[l,c,d]}function Rg(r,a,l){const c=a.length>1&&Array.from(a).every(v=>v===a[0])?a[0]:a,d=l?r.indexOf(l):-1;let f=JS(r,Math.max(d,0));c.length===1&&(f=f.filter(v=>v!==l));const x=f.find(v=>v.textValue.toLowerCase().startsWith(c.toLowerCase()));return x!==l?x:void 0}function JS(r,a){return r.map((l,i)=>r[(a+i)%r.length])}var ZS=sg,_g=lg,eC=ig,tC=cg,nC=ug,Tg=dg,rC=pg,Ig=vg,sC=wg,aC=jg,lC=Ng,oC=Sg;const Gc=ZS,Qc=eC,oo=p.forwardRef(({className:r,children:a,...l},i)=>n.jsxs(_g,{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(tC,{asChild:!0,children:n.jsx(lp,{className:"h-4 w-4 opacity-50"})})]}));oo.displayName=_g.displayName;const io=p.forwardRef(({className:r,children:a,position:l="popper",...i},c)=>n.jsx(nC,{children:n.jsxs(Tg,{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(lC,{className:"flex cursor-default items-center justify-center py-1",children:n.jsx(gw,{className:"h-4 w-4"})}),n.jsx(rC,{className:"p-1",children:a}),n.jsx(oC,{className:"flex cursor-default items-center justify-center py-1",children:n.jsx(lp,{className:"h-4 w-4"})})]})}));io.displayName=Tg.displayName;const gr=p.forwardRef(({className:r,children:a,...l},i)=>n.jsxs(Ig,{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(aC,{children:n.jsx(Co,{className:"h-4 w-4"})})}),n.jsx(sC,{children:a})]}));gr.displayName=Ig.displayName;function iC(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 cC(r,a){const l=r.split(` -`),i=[];let c=null,d=[],f=1;for(const m of l){const x=m.match(/^#+\s+(.+)$/)||m.match(/^(\d+[.\、]\s*.+)$/);x?(c&&(c.content=d.join(` -`).trim(),c.content&&i.push(c)),c={id:`import-${f}`,title:x[1].replace(/^#+\s*/,"").trim(),price:1,isFree:f<=3},d=[],f++):c?d.push(m):m.trim()&&(c={id:`import-${f}`,title:a.replace(/\.(txt|md|markdown)$/i,""),price:1,isFree:!0},d.push(m),f++)}return c&&(c.content=d.join(` -`).trim(),c.content&&i.push(c)),i}function uC(){const[r,a]=p.useState([]),[l,i]=p.useState(!0),[c,d]=p.useState([]),[f,m]=p.useState(null),[x,v]=p.useState(!1),[g,y]=p.useState(!1),[C,E]=p.useState(!1),[k,j]=p.useState(!1),[b,S]=p.useState(""),[P,N]=p.useState(!1),[T,U]=p.useState(!1),[G,D]=p.useState(!1),[V,se]=p.useState(""),[he,de]=p.useState(!1),[fe,Y]=p.useState(!1),[B,z]=p.useState(""),[K,H]=p.useState([]),[I,X]=p.useState(!1),[ne,L]=p.useState(!1),R=p.useRef(null),ee=p.useRef(null),[q,le]=p.useState({id:"",title:"",price:1,partId:"part-1",chapterId:"chapter-1",content:""}),ue=iC(r),Q=r.length,ie=async()=>{i(!0);try{const O=await Xe("/api/db/book?action=list");a(Array.isArray(O==null?void 0:O.sections)?O.sections:[]),c.length===0&&ue.length>0&&d([ue[0].id])}catch(O){console.error(O),a([])}finally{i(!1)}};p.useEffect(()=>{ie()},[]),p.useEffect(()=>{!l&&ue.length>0&&c.length===0&&d([ue[0].id])},[l,ue.length,c.length]);const je=O=>{d(ce=>ce.includes(O)?ce.filter(Qe=>Qe!==O):[...ce,O])},ye=async O=>{de(!0);try{const ce=await Xe(`/api/db/book?action=read&id=${encodeURIComponent(O.id)}`);ce!=null&&ce.success&&ce.section?m({id:O.id,title:ce.section.title??O.title,price:ce.section.price??O.price,content:ce.section.content??"",filePath:O.filePath,isFree:O.isFree||O.price===0}):(m({id:O.id,title:O.title,price:O.price,content:"",filePath:O.filePath,isFree:O.isFree}),ce&&!ce.success&&alert("无法读取文件内容: "+(ce.error||"未知错误")))}catch(ce){console.error(ce),m({id:O.id,title:O.title,price:O.price,content:"",filePath:O.filePath,isFree:O.isFree})}finally{de(!1)}},Pe=async()=>{var O;if(f){Y(!0);try{let ce=f.content||"";const Qe=[new RegExp(`^#+\\s*${f.id.replace(".","\\.")}\\s+.*$`,"gm"),new RegExp(`^#+\\s*${f.id.replace(".","\\.")}[::].*$`,"gm"),new RegExp(`^#\\s+.*${(O=f.title)==null?void 0:O.slice(0,10).replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}.*$`,"gm")];for(const zt of Qe)ce=ce.replace(zt,"");ce=ce.replace(/^\s*\n+/,"").trim();const ze=await Hn("/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});ze&&ze.success!==!1?(alert(`已保存章节: ${f.title}`),m(null),ie()):alert("保存失败: "+(ze&&typeof ze=="object"&&"error"in ze?ze.error:"未知错误"))}catch(ce){console.error(ce),alert("保存失败")}finally{Y(!1)}}},Ie=async()=>{if(!q.id||!q.title){alert("请填写章节ID和标题");return}Y(!0);try{const O=await Hn("/api/db/book",{id:q.id,title:q.title,price:q.price,content:q.content,partId:q.partId,chapterId:q.chapterId,saveToFile:!1});O&&O.success!==!1?(alert(`章节创建成功: ${q.title}`),D(!1),le({id:"",title:"",price:1,partId:"part-1",chapterId:"chapter-1",content:""}),ie()):alert("创建失败: "+(O&&typeof O=="object"&&"error"in O?O.error:"未知错误"))}catch(O){console.error(O),alert("创建失败")}finally{Y(!1)}},rt=async O=>{var Qe,ze;const ce=(Qe=O.target.files)==null?void 0:Qe[0];if(ce){L(!0);try{const zt=new FormData;zt.append("file",ce),zt.append("folder","book-images");const dt=await(await fetch(au("/api/upload"),{method:"POST",body:zt,credentials:"include"})).json();if(dt!=null&&dt.success&&((ze=dt==null?void 0:dt.data)!=null&&ze.url)){const gn=`![${ce.name}](${dt.data.url})`;f&&m({...f,content:(f.content||"")+` - -`+gn}),alert(`图片上传成功: ${dt.data.url}`)}else alert("上传失败: "+((dt==null?void 0:dt.error)||"未知错误"))}catch(zt){console.error(zt),alert("上传失败")}finally{L(!1),ee.current&&(ee.current.value="")}}},it=async()=>{var O;if(B.trim()){X(!0);try{const ce=await Xe(`/api/search?q=${encodeURIComponent(B)}`);ce!=null&&ce.success&&((O=ce.data)!=null&&O.results)?H(ce.data.results):(H([]),ce&&!ce.success&&alert("搜索失败: "+ce.error))}catch(ce){console.error(ce),H([]),alert("搜索失败")}finally{X(!1)}}},Kt=async()=>{v(!0);try{const O=await gt("/api/db/book",{action:"sync"});O&&O.success!==!1?(alert(O.message||"同步成功"),ie()):alert("同步失败: "+(O&&typeof O=="object"&&"error"in O?O.error:"未知错误"))}catch(O){console.error(O),alert("同步失败")}finally{v(!1)}},Gt=async()=>{y(!0);try{const ce=await(await fetch(au("/api/db/book?action=export"),{credentials:"include"})).blob(),Qe=window.URL.createObjectURL(ce),ze=document.createElement("a");ze.href=Qe,ze.download=`book_sections_${new Date().toISOString().split("T")[0]}.json`,document.body.appendChild(ze),ze.click(),window.URL.revokeObjectURL(Qe),document.body.removeChild(ze),alert("导出成功")}catch(O){console.error(O),alert("导出失败")}finally{y(!1)}},_t=async()=>{if(!V.trim()){alert("请输入或上传JSON数据");return}E(!0);try{const O=JSON.parse(V),ce=await gt("/api/db/book",{action:"import",data:O});ce&&ce.success!==!1?(alert(ce.message||"导入成功"),U(!1),se(""),ie()):alert("导入失败: "+(ce&&typeof ce=="object"&&"error"in ce?ce.error:"未知错误"))}catch(O){console.error(O),alert("导入失败: JSON格式错误")}finally{E(!1)}},In=O=>{var ze;const ce=(ze=O.target.files)==null?void 0:ze[0];if(!ce)return;const Qe=new FileReader;Qe.onload=zt=>{var gn;const An=((gn=zt.target)==null?void 0:gn.result)||"",dt=ce.name.toLowerCase();dt.endsWith(".json")?se(An):dt.endsWith(".txt")||dt.endsWith(".md")||dt.endsWith(".markdown")?se(JSON.stringify(cC(An,ce.name),null,2)):se(An)},Qe.readAsText(ce)},Ot=async()=>{var O;if(confirm("确定要初始化数据库吗?这将创建所有必需的表结构。")){j(!0);try{const ce=await gt("/api/db/init",{adminToken:"init_db_2025"});ce&&ce.success!==!1?alert(((O=ce.data)==null?void 0:O.message)||"初始化成功"):alert("初始化失败: "+(ce&&typeof ce=="object"&&"error"in ce?ce.error:"未知错误"))}catch(ce){console.error(ce),alert("初始化失败")}finally{j(!1)}}},xn=async()=>{if(!b.trim()){alert("请输入飞书文档链接");return}v(!0),await new Promise(O=>setTimeout(O,2e3)),v(!1),N(!1),alert("飞书文档同步成功!")},Ft=ue.find(O=>O.id===q.partId),J=(Ft==null?void 0:Ft.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:["共 ",ue.length," 篇 · ",Q," 节内容"]})]}),n.jsxs("div",{className:"flex gap-2",children:[n.jsxs(ge,{onClick:Ot,disabled:k,variant:"outline",className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:[n.jsx(Rw,{className:"w-4 h-4 mr-2"}),k?"初始化中...":"初始化数据库"]}),n.jsxs(ge,{onClick:Kt,disabled:x,variant:"outline",className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:[n.jsx(Ye,{className:`w-4 h-4 mr-2 ${x?"animate-spin":""}`}),"同步到数据库"]}),n.jsxs(ge,{onClick:()=>U(!0),variant:"outline",className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:[n.jsx(ks,{className:"w-4 h-4 mr-2"}),"导入"]}),n.jsxs(ge,{onClick:Gt,disabled:g,variant:"outline",className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:[n.jsx(dp,{className:"w-4 h-4 mr-2"}),g?"导出中...":"导出"]}),n.jsxs(ge,{onClick:()=>N(!0),className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:[n.jsx(fp,{className:"w-4 h-4 mr-2"}),"同步飞书"]})]})]}),n.jsx(Sn,{open:T,onOpenChange:U,children:n.jsxs(fn,{className:"bg-[#0f2137] border-gray-700 text-white max-w-2xl",showCloseButton:!0,children:[n.jsx(Cn,{children:n.jsxs(kn,{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:"space-y-2",children:[n.jsx(oe,{className:"text-gray-300",children:"上传文件 (支持 JSON / TXT / MD)"}),n.jsx("input",{ref:R,type:"file",accept:".json,.txt,.md,.markdown",onChange:In,className:"hidden"}),n.jsxs(ge,{variant:"outline",onClick:()=>{var O;return(O=R.current)==null?void 0:O.click()},className:"w-full border-dashed border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:[n.jsx(ks,{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(oe,{className:"text-gray-300",children:"或粘贴数据"}),n.jsx(Ur,{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:O=>se(O.target.value)})]})]}),n.jsxs(Vn,{children:[n.jsx(ge,{variant:"outline",onClick:()=>{U(!1),se("")},className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:"取消"}),n.jsx(ge,{onClick:_t,disabled:C||!V.trim(),className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:C?n.jsxs(n.Fragment,{children:[n.jsx(Ye,{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(Sn,{open:P,onOpenChange:N,children:n.jsxs(fn,{className:"bg-[#0f2137] border-gray-700 text-white max-w-lg",showCloseButton:!0,children:[n.jsx(Cn,{children:n.jsxs(kn,{className:"text-white flex items-center gap-2",children:[n.jsx(Es,{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(oe,{className:"text-gray-300",children:"飞书文档链接"}),n.jsx(me,{className:"bg-[#0a1628] border-gray-700 text-white placeholder:text-gray-500",placeholder:"https://xxx.feishu.cn/docx/...",value:b,onChange:O=>S(O.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(Vn,{children:[n.jsx(ge,{variant:"outline",onClick:()=>N(!1),className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:"取消"}),n.jsx(ge,{onClick:xn,disabled:x,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:x?n.jsxs(n.Fragment,{children:[n.jsx(Ye,{className:"w-4 h-4 mr-2 animate-spin"}),"同步中..."]}):n.jsxs(n.Fragment,{children:[n.jsx(Ye,{className:"w-4 h-4 mr-2"}),"开始同步"]})})]})]})}),n.jsx(Sn,{open:G,onOpenChange:D,children:n.jsxs(fn,{className:"bg-[#0f2137] border-gray-700 text-white max-w-2xl max-h-[90vh] overflow-y-auto",showCloseButton:!0,children:[n.jsx(Cn,{children:n.jsxs(kn,{className:"text-white flex items-center gap-2",children:[n.jsx(Ps,{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(oe,{className:"text-gray-300",children:"章节ID *"}),n.jsx(me,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"如: 9.15",value:q.id,onChange:O=>le({...q,id:O.target.value})})]}),n.jsxs("div",{className:"space-y-2",children:[n.jsx(oe,{className:"text-gray-300",children:"价格 (元)"}),n.jsx(me,{type:"number",className:"bg-[#0a1628] border-gray-700 text-white",value:q.price,onChange:O=>le({...q,price:Number(O.target.value)})})]})]}),n.jsxs("div",{className:"space-y-2",children:[n.jsx(oe,{className:"text-gray-300",children:"章节标题 *"}),n.jsx(me,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"输入章节标题",value:q.title,onChange:O=>le({...q,title:O.target.value})})]}),n.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[n.jsxs("div",{className:"space-y-2",children:[n.jsx(oe,{className:"text-gray-300",children:"所属篇"}),n.jsxs(Gc,{value:q.partId,onValueChange:O=>le({...q,partId:O,chapterId:"chapter-1"}),children:[n.jsx(oo,{className:"bg-[#0a1628] border-gray-700 text-white",children:n.jsx(Qc,{})}),n.jsxs(io,{className:"bg-[#0f2137] border-gray-700",children:[ue.map(O=>n.jsx(gr,{value:O.id,className:"text-white hover:bg-[#38bdac]/20 focus:bg-[#38bdac]/20",children:O.title},O.id)),ue.length===0&&n.jsx(gr,{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(oe,{className:"text-gray-300",children:"所属章"}),n.jsxs(Gc,{value:q.chapterId,onValueChange:O=>le({...q,chapterId:O}),children:[n.jsx(oo,{className:"bg-[#0a1628] border-gray-700 text-white",children:n.jsx(Qc,{})}),n.jsxs(io,{className:"bg-[#0f2137] border-gray-700",children:[J.map(O=>n.jsx(gr,{value:O.id,className:"text-white hover:bg-[#38bdac]/20 focus:bg-[#38bdac]/20",children:O.title},O.id)),J.length===0&&n.jsx(gr,{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(oe,{className:"text-gray-300",children:"内容 (Markdown格式)"}),n.jsx(Ur,{className:"bg-[#0a1628] border-gray-700 text-white min-h-[300px] font-mono text-sm placeholder:text-gray-500",placeholder:"输入章节内容...",value:q.content,onChange:O=>le({...q,content:O.target.value})})]})]}),n.jsxs(Vn,{children:[n.jsx(ge,{variant:"outline",onClick:()=>D(!1),className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:"取消"}),n.jsx(ge,{onClick:Ie,disabled:fe||!q.id||!q.title,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:fe?n.jsxs(n.Fragment,{children:[n.jsx(Ye,{className:"w-4 h-4 mr-2 animate-spin"}),"创建中..."]}):n.jsxs(n.Fragment,{children:[n.jsx(Ps,{className:"w-4 h-4 mr-2"}),"创建章节"]})})]})]})}),n.jsx(Sn,{open:!!f,onOpenChange:()=>m(null),children:n.jsxs(fn,{className:"bg-[#0f2137] border-gray-700 text-white max-w-4xl max-h-[90vh] overflow-y-auto",showCloseButton:!0,children:[n.jsx(Cn,{children:n.jsxs(kn,{className:"text-white flex items-center gap-2",children:[n.jsx(Is,{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(oe,{className:"text-gray-300",children:"章节ID"}),n.jsx(me,{className:"bg-[#0a1628] border-gray-700 text-white",value:f.id,disabled:!0})]}),n.jsxs("div",{className:"space-y-2",children:[n.jsx(oe,{className:"text-gray-300",children:"价格 (元)"}),n.jsx(me,{type:"number",className:"bg-[#0a1628] border-gray-700 text-white",value:f.isFree?0:f.price,onChange:O=>m({...f,price:Number(O.target.value),isFree:Number(O.target.value)===0}),disabled:f.isFree})]}),n.jsxs("div",{className:"space-y-2",children:[n.jsx(oe,{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:O=>m({...f,isFree:O.target.checked,price:O.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(oe,{className:"text-gray-300",children:"章节标题"}),n.jsx(me,{className:"bg-[#0a1628] border-gray-700 text-white",value:f.title,onChange:O=>m({...f,title:O.target.value})})]}),f.filePath&&n.jsxs("div",{className:"space-y-2",children:[n.jsx(oe,{className:"text-gray-300",children:"文件路径"}),n.jsx(me,{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(oe,{className:"text-gray-300",children:"内容 (Markdown格式)"}),n.jsxs("div",{className:"flex gap-2",children:[n.jsx("input",{ref:ee,type:"file",accept:"image/*",onChange:rt,className:"hidden"}),n.jsxs(ge,{variant:"outline",size:"sm",onClick:()=>{var O;return(O=ee.current)==null?void 0:O.click()},disabled:ne,className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:[ne?n.jsx(Ye,{className:"w-4 h-4 mr-1 animate-spin"}):n.jsx(Hw,{className:"w-4 h-4 mr-1"}),"上传图片"]})]})]}),he?n.jsxs("div",{className:"bg-[#0a1628] border border-gray-700 rounded-md min-h-[400px] flex items-center justify-center",children:[n.jsx(Ye,{className:"w-6 h-6 text-[#38bdac] animate-spin"}),n.jsx("span",{className:"ml-2 text-gray-400",children:"加载中..."})]}):n.jsx(Ur,{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:O=>m({...f,content:O.target.value})})]})]}),n.jsxs(Vn,{children:[n.jsxs(ge,{variant:"outline",onClick:()=>m(null),className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:[n.jsx(Hr,{className:"w-4 h-4 mr-2"}),"取消"]}),n.jsx(ge,{onClick:Pe,disabled:fe,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:fe?n.jsxs(n.Fragment,{children:[n.jsx(Ye,{className:"w-4 h-4 mr-2 animate-spin"}),"保存中..."]}):n.jsxs(n.Fragment,{children:[n.jsx(Wn,{className:"w-4 h-4 mr-2"}),"保存修改"]})})]})]})}),n.jsxs(Uu,{defaultValue:"chapters",className:"space-y-6",children:[n.jsxs(Io,{className:"bg-[#0f2137] border border-gray-700/50 p-1",children:[n.jsxs(en,{value:"chapters",className:"data-[state=active]:bg-[#38bdac]/20 data-[state=active]:text-[#38bdac] text-gray-400",children:[n.jsx(Ts,{className:"w-4 h-4 mr-2"}),"章节管理"]}),n.jsxs(en,{value:"search",className:"data-[state=active]:bg-[#38bdac]/20 data-[state=active]:text-[#38bdac] text-gray-400",children:[n.jsx(Vr,{className:"w-4 h-4 mr-2"}),"内容搜索"]}),n.jsxs(en,{value:"hooks",className:"data-[state=active]:bg-[#38bdac]/20 data-[state=active]:text-[#38bdac] text-gray-400",children:[n.jsx(j1,{className:"w-4 h-4 mr-2"}),"钩子配置"]})]}),n.jsxs(tn,{value:"chapters",className:"space-y-4",children:[n.jsxs(ge,{onClick:()=>D(!0),className:"w-full bg-[#38bdac]/10 hover:bg-[#38bdac]/20 text-[#38bdac] border border-[#38bdac]/30",children:[n.jsx(Ps,{className:"w-4 h-4 mr-2"}),"新建章节"]}),l?n.jsxs("div",{className:"flex items-center justify-center py-12",children:[n.jsx(Ye,{className:"w-6 h-6 text-[#38bdac] animate-spin"}),n.jsx("span",{className:"ml-2 text-gray-400",children:"加载中..."})]}):ue.map((O,ce)=>n.jsxs(Re,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl overflow-hidden",children:[n.jsx(Ue,{className:"cursor-pointer hover:bg-[#162840] transition-colors",onClick:()=>je(O.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(Ve,{className:"text-white",children:O.title}),n.jsxs(Oe,{variant:"outline",className:"text-gray-400 border-gray-600",children:[O.chapters.reduce((Qe,ze)=>Qe+ze.sections.length,0)," 节"]})]}),n.jsx(op,{className:`w-5 h-5 text-gray-400 transition-transform ${c.includes(O.id)?"rotate-90":""}`})]})}),c.includes(O.id)&&n.jsx(_e,{className:"pt-0 pb-4",children:n.jsx("div",{className:"space-y-3 pl-8 border-l-2 border-gray-700",children:O.chapters.map(Qe=>n.jsxs("div",{className:"space-y-2",children:[n.jsx("h4",{className:"font-medium text-gray-300",children:Qe.title}),n.jsx("div",{className:"space-y-1",children:Qe.sections.map(ze=>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(Zc,{className:"w-4 h-4 text-[#38bdac]"}),n.jsx("span",{className:"text-gray-400",children:ze.title})]}),n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx("span",{className:"text-[#38bdac] font-medium",children:ze.price===0?"免费":`¥${ze.price}`}),n.jsxs(ge,{variant:"ghost",size:"sm",onClick:()=>ye(ze),className:"text-gray-500 hover:text-[#38bdac] hover:bg-[#38bdac]/10 opacity-0 group-hover:opacity-100 transition-opacity",children:[n.jsx(Eu,{className:"w-4 h-4 mr-1"}),"读取"]}),n.jsxs(ge,{variant:"ghost",size:"sm",onClick:()=>ye(ze),className:"text-gray-500 hover:text-[#38bdac] hover:bg-[#38bdac]/10 opacity-0 group-hover:opacity-100 transition-opacity",children:[n.jsx(Is,{className:"w-4 h-4 mr-1"}),"编辑"]})]})]},ze.id))})]},Qe.id))})})]},O.id))]}),n.jsx(tn,{value:"search",className:"space-y-4",children:n.jsxs(Re,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:[n.jsx(Ue,{children:n.jsx(Ve,{className:"text-white",children:"内容搜索"})}),n.jsxs(_e,{className:"space-y-4",children:[n.jsxs("div",{className:"flex gap-2",children:[n.jsx(me,{className:"bg-[#0a1628] border-gray-700 text-white placeholder:text-gray-500 flex-1",placeholder:"搜索标题或内容...",value:B,onChange:O=>z(O.target.value),onKeyDown:O=>O.key==="Enter"&&it()}),n.jsx(ge,{onClick:it,disabled:I||!B.trim(),className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:I?n.jsx(Ye,{className:"w-4 h-4 animate-spin"}):n.jsx(Vr,{className:"w-4 h-4"})})]}),K.length>0&&n.jsxs("div",{className:"space-y-2 mt-4",children:[n.jsxs("p",{className:"text-gray-400 text-sm",children:["找到 ",K.length," 个结果"]}),K.map(O=>n.jsxs("div",{className:"p-3 rounded-lg bg-[#162840] hover:bg-[#1a3050] cursor-pointer transition-colors",onClick:()=>ye({id:O.id,title:O.title,price:O.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:O.id}),n.jsx("span",{className:"text-white",children:O.title})]}),n.jsx(Oe,{variant:"outline",className:"text-gray-400 border-gray-600 text-xs",children:O.matchType==="title"?"标题匹配":"内容匹配"})]}),O.snippet&&n.jsx("p",{className:"text-gray-500 text-xs mt-2 line-clamp-2",children:O.snippet}),(O.partTitle||O.chapterTitle)&&n.jsxs("p",{className:"text-gray-600 text-xs mt-1",children:[O.partTitle," · ",O.chapterTitle]})]},O.id))]})]})]})}),n.jsx(tn,{value:"hooks",className:"space-y-4",children:n.jsxs(Re,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:[n.jsx(Ue,{children:n.jsx(Ve,{className:"text-white",children:"引流钩子配置"})}),n.jsxs(_e,{className:"space-y-4",children:[n.jsxs("div",{className:"grid w-full max-w-sm items-center gap-1.5",children:[n.jsx(oe,{htmlFor:"hook-chapter",className:"text-gray-300",children:"触发章节"}),n.jsxs(Gc,{defaultValue:"3",children:[n.jsx(oo,{id:"hook-chapter",className:"bg-[#0a1628] border-gray-700 text-white",children:n.jsx(Qc,{placeholder:"选择章节"})}),n.jsxs(io,{className:"bg-[#0f2137] border-gray-700",children:[n.jsx(gr,{value:"1",className:"text-white hover:bg-[#38bdac]/20 focus:bg-[#38bdac]/20",children:"第一章"}),n.jsx(gr,{value:"2",className:"text-white hover:bg-[#38bdac]/20 focus:bg-[#38bdac]/20",children:"第二章"}),n.jsx(gr,{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(oe,{htmlFor:"message",className:"text-gray-300",children:"引流文案"}),n.jsx(Ur,{placeholder:"输入引导用户加群的文案...",id:"message",className:"bg-[#0a1628] border-gray-700 text-white placeholder:text-gray-500",defaultValue:"阅读更多精彩内容,请加入Soul创业实验派对群..."})]}),n.jsx(ge,{className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:"保存配置"})]})]})})]})]})}function dC(){const[r,a]=p.useState([]),[l,i]=p.useState(null),[c,d]=p.useState(!0),[f,m]=p.useState(null),[x,v]=p.useState([]),[g,y]=p.useState(null),[C,E]=p.useState(1);async function k(){d(!0),m(null);try{const P=await Xe("/api/admin/chapters");P!=null&&P.success&&P.data?(a(P.data.structure??[]),i(P.data.stats??null)):m("加载章节失败")}catch(P){console.error("加载章节失败:",P),m("加载失败,请检查网络后重试")}finally{d(!1)}}p.useEffect(()=>{k()},[]);const j=P=>{v(N=>N.includes(P)?N.filter(T=>T!==P):[...N,P])},b=async P=>{try{const N=await gt("/api/admin/chapters",{action:"updatePrice",chapterId:P,data:{price:C}});N!=null&&N.success&&(alert("价格更新成功"),y(null),k())}catch(N){console.error("更新价格失败:",N)}},S=async(P,N)=>{try{const T=await gt("/api/admin/chapters",{action:"toggleFree",chapterId:P,data:{isFree:!N}});T!=null&&T.success&&(alert("状态更新成功"),k())}catch(T){console.error("更新状态失败:",T)}};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:k,disabled:c,className:"px-4 py-2 bg-white/10 rounded-lg hover:bg-white/20 text-white disabled:opacity-50",children:"刷新"}),n.jsx("button",{type:"button",onClick:()=>v(r.map(P=>P.id)),className:"px-4 py-2 bg-white/10 rounded-lg hover:bg-white/20 text-white",children:"展开全部"}),n.jsx("button",{type:"button",onClick:()=>v([]),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:[f&&n.jsxs("div",{className:"mb-4 px-4 py-3 rounded-lg bg-red-500/20 border border-red-500/50 text-red-400 text-sm flex items-center justify-between",children:[n.jsx("span",{children:f}),n.jsx("button",{type:"button",onClick:()=>m(null),className:"hover:text-red-300",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(P=>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:()=>j(P.id),onKeyDown:N=>N.key==="Enter"&&j(P.id),role:"button",tabIndex:0,children:[n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsx("span",{className:"text-2xl",children:P.type==="preface"?"📖":P.type==="epilogue"?"🎬":P.type==="appendix"?"📎":"📚"}),n.jsx("span",{className:"font-semibold text-white",children:P.title}),n.jsxs("span",{className:"text-white/40 text-sm",children:["(",P.chapters.reduce((N,T)=>{var U;return N+(((U=T.sections)==null?void 0:U.length)||1)},0)," 节)"]})]}),n.jsx("span",{className:"text-white/40",children:x.includes(P.id)?"▲":"▼"})]}),x.includes(P.id)&&n.jsx("div",{className:"border-t border-white/10",children:P.chapters.map(N=>n.jsx("div",{className:"border-b border-white/5 last:border-b-0",children:N.sections?n.jsxs(n.Fragment,{children:[n.jsx("div",{className:"px-6 py-3 bg-white/5 text-white/70 font-medium",children:N.title}),n.jsx("div",{className:"divide-y divide-white/5",children:N.sections.map(T=>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:T.isFree?"text-green-400":"text-yellow-400",children:T.isFree?"🔓":"🔒"}),n.jsx("span",{className:"text-white/80",children:T.id}),n.jsx("span",{className:"text-white/60",children:T.title})]}),n.jsx("div",{className:"flex items-center gap-3",children:g===T.id?n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx("input",{type:"number",value:C,onChange:U=>E(Number(U.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:()=>b(T.id),className:"px-3 py-1 bg-cyan-500 text-black rounded text-sm",children:"保存"}),n.jsx("button",{type:"button",onClick:()=>y(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 ${T.isFree?"bg-green-500/20 text-green-400":"bg-yellow-500/20 text-yellow-400"}`,children:T.isFree?"免费":`¥${T.price}`}),n.jsx("button",{type:"button",onClick:()=>{y(T.id),E(T.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(T.id,T.isFree),className:"px-2 py-1 text-xs bg-white/10 rounded hover:bg-white/20 text-white",children:T.isFree?"设为付费":"设为免费"})]})})]},T.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:N.isFree?"text-green-400":"text-yellow-400",children:N.isFree?"🔓":"🔒"}),n.jsx("span",{className:"text-white/80",children:N.title})]}),n.jsx("span",{className:`px-2 py-1 rounded text-xs ${N.isFree?"bg-green-500/20 text-green-400":"bg-yellow-500/20 text-yellow-400"}`,children:N.isFree?"免费":`¥${N.price??1}`})]})},N.id))})]},P.id))})]})]})}var Ag=["PageUp","PageDown"],Mg=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],Lg={"from-left":["Home","PageDown","ArrowDown","ArrowLeft"],"from-right":["Home","PageDown","ArrowDown","ArrowRight"],"from-bottom":["Home","PageDown","ArrowDown","ArrowLeft"],"from-top":["Home","PageDown","ArrowUp","ArrowLeft"]},Us="Slider",[yu,fC,hC]=$u(Us),[Dg]=Cr(Us,[hC]),[mC,$o]=Dg(Us),Og=p.forwardRef((r,a)=>{const{name:l,min:i=0,max:c=100,step:d=1,orientation:f="horizontal",disabled:m=!1,minStepsBetweenThumbs:x=0,defaultValue:v=[i],value:g,onValueChange:y=()=>{},onValueCommit:C=()=>{},inverted:E=!1,form:k,...j}=r,b=p.useRef(new Set),S=p.useRef(0),N=f==="horizontal"?pC:xC,[T=[],U]=Kr({prop:g,defaultProp:v,onChange:de=>{var Y;(Y=[...b.current][S.current])==null||Y.focus(),y(de)}}),G=p.useRef(T);function D(de){const fe=bC(T,de);he(de,fe)}function V(de){he(de,S.current)}function se(){const de=G.current[S.current];T[S.current]!==de&&C(T)}function he(de,fe,{commit:Y}={commit:!1}){const B=CC(d),z=kC(Math.round((de-i)/d)*d+i,B),K=go(z,[i,c]);U((H=[])=>{const I=vC(H,K,fe);if(SC(I,x*d)){S.current=I.indexOf(K);const X=String(I)!==String(H);return X&&Y&&C(I),X?I:H}else return H})}return n.jsx(mC,{scope:r.__scopeSlider,name:l,disabled:m,min:i,max:c,valueIndexToChangeRef:S,thumbs:b.current,values:T,orientation:f,form:k,children:n.jsx(yu.Provider,{scope:r.__scopeSlider,children:n.jsx(yu.Slot,{scope:r.__scopeSlider,children:n.jsx(N,{"aria-disabled":m,"data-disabled":m?"":void 0,...j,ref:a,onPointerDown:Ae(j.onPointerDown,()=>{m||(G.current=T)}),min:i,max:c,inverted:E,onSlideStart:m?void 0:D,onSlideMove:m?void 0:V,onSlideEnd:m?void 0:se,onHomeKeyDown:()=>!m&&he(i,0,{commit:!0}),onEndKeyDown:()=>!m&&he(c,T.length-1,{commit:!0}),onStepKeyDown:({event:de,direction:fe})=>{if(!m){const z=Ag.includes(de.key)||de.shiftKey&&Mg.includes(de.key)?10:1,K=S.current,H=T[K],I=d*z*fe;he(H+I,K,{commit:!0})}}})})})})});Og.displayName=Us;var[Fg,zg]=Dg(Us,{startEdge:"left",endEdge:"right",size:"width",direction:1}),pC=p.forwardRef((r,a)=>{const{min:l,max:i,dir:c,inverted:d,onSlideStart:f,onSlideMove:m,onSlideEnd:x,onStepKeyDown:v,...g}=r,[y,C]=p.useState(null),E=We(a,N=>C(N)),k=p.useRef(void 0),j=_o(c),b=j==="ltr",S=b&&!d||!b&&d;function P(N){const T=k.current||y.getBoundingClientRect(),U=[0,T.width],D=Ju(U,S?[l,i]:[i,l]);return k.current=T,D(N-T.left)}return n.jsx(Fg,{scope:r.__scopeSlider,startEdge:S?"left":"right",endEdge:S?"right":"left",direction:S?1:-1,size:"width",children:n.jsx($g,{dir:j,"data-orientation":"horizontal",...g,ref:E,style:{...g.style,"--radix-slider-thumb-transform":"translateX(-50%)"},onSlideStart:N=>{const T=P(N.clientX);f==null||f(T)},onSlideMove:N=>{const T=P(N.clientX);m==null||m(T)},onSlideEnd:()=>{k.current=void 0,x==null||x()},onStepKeyDown:N=>{const U=Lg[S?"from-left":"from-right"].includes(N.key);v==null||v({event:N,direction:U?-1:1})}})})}),xC=p.forwardRef((r,a)=>{const{min:l,max:i,inverted:c,onSlideStart:d,onSlideMove:f,onSlideEnd:m,onStepKeyDown:x,...v}=r,g=p.useRef(null),y=We(a,g),C=p.useRef(void 0),E=!c;function k(j){const b=C.current||g.current.getBoundingClientRect(),S=[0,b.height],N=Ju(S,E?[i,l]:[l,i]);return C.current=b,N(j-b.top)}return n.jsx(Fg,{scope:r.__scopeSlider,startEdge:E?"bottom":"top",endEdge:E?"top":"bottom",size:"height",direction:E?1:-1,children:n.jsx($g,{"data-orientation":"vertical",...v,ref:y,style:{...v.style,"--radix-slider-thumb-transform":"translateY(50%)"},onSlideStart:j=>{const b=k(j.clientY);d==null||d(b)},onSlideMove:j=>{const b=k(j.clientY);f==null||f(b)},onSlideEnd:()=>{C.current=void 0,m==null||m()},onStepKeyDown:j=>{const S=Lg[E?"from-bottom":"from-top"].includes(j.key);x==null||x({event:j,direction:S?-1:1})}})})}),$g=p.forwardRef((r,a)=>{const{__scopeSlider:l,onSlideStart:i,onSlideMove:c,onSlideEnd:d,onHomeKeyDown:f,onEndKeyDown:m,onStepKeyDown:x,...v}=r,g=$o(Us,l);return n.jsx(Le.span,{...v,ref:a,onKeyDown:Ae(r.onKeyDown,y=>{y.key==="Home"?(f(y),y.preventDefault()):y.key==="End"?(m(y),y.preventDefault()):Ag.concat(Mg).includes(y.key)&&(x(y),y.preventDefault())}),onPointerDown:Ae(r.onPointerDown,y=>{const C=y.target;C.setPointerCapture(y.pointerId),y.preventDefault(),g.thumbs.has(C)?C.focus():i(y)}),onPointerMove:Ae(r.onPointerMove,y=>{y.target.hasPointerCapture(y.pointerId)&&c(y)}),onPointerUp:Ae(r.onPointerUp,y=>{const C=y.target;C.hasPointerCapture(y.pointerId)&&(C.releasePointerCapture(y.pointerId),d(y))})})}),Bg="SliderTrack",Ug=p.forwardRef((r,a)=>{const{__scopeSlider:l,...i}=r,c=$o(Bg,l);return n.jsx(Le.span,{"data-disabled":c.disabled?"":void 0,"data-orientation":c.orientation,...i,ref:a})});Ug.displayName=Bg;var vu="SliderRange",Vg=p.forwardRef((r,a)=>{const{__scopeSlider:l,...i}=r,c=$o(vu,l),d=zg(vu,l),f=p.useRef(null),m=We(a,f),x=c.values.length,v=c.values.map(C=>Kg(C,c.min,c.max)),g=x>1?Math.min(...v):0,y=100-Math.max(...v);return n.jsx(Le.span,{"data-orientation":c.orientation,"data-disabled":c.disabled?"":void 0,...i,ref:m,style:{...r.style,[d.startEdge]:g+"%",[d.endEdge]:y+"%"}})});Vg.displayName=vu;var wu="SliderThumb",Wg=p.forwardRef((r,a)=>{const l=fC(r.__scopeSlider),[i,c]=p.useState(null),d=We(a,m=>c(m)),f=p.useMemo(()=>i?l().findIndex(m=>m.ref.current===i):-1,[l,i]);return n.jsx(gC,{...r,ref:d,index:f})}),gC=p.forwardRef((r,a)=>{const{__scopeSlider:l,index:i,name:c,...d}=r,f=$o(wu,l),m=zg(wu,l),[x,v]=p.useState(null),g=We(a,P=>v(P)),y=x?f.form||!!x.closest("form"):!0,C=zu(x),E=f.values[i],k=E===void 0?0:Kg(E,f.min,f.max),j=wC(i,f.values.length),b=C==null?void 0:C[m.size],S=b?jC(b,k,m.direction):0;return p.useEffect(()=>{if(x)return f.thumbs.add(x),()=>{f.thumbs.delete(x)}},[x,f.thumbs]),n.jsxs("span",{style:{transform:"var(--radix-slider-thumb-transform)",position:"absolute",[m.startEdge]:`calc(${k}% + ${S}px)`},children:[n.jsx(yu.ItemSlot,{scope:r.__scopeSlider,children:n.jsx(Le.span,{role:"slider","aria-label":r["aria-label"]||j,"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:g,style:E===void 0?{display:"none"}:r.style,onFocus:Ae(r.onFocus,()=>{f.valueIndexToChangeRef.current=i})})}),y&&n.jsx(Hg,{name:c??(f.name?f.name+(f.values.length>1?"[]":""):void 0),form:f.form,value:E},i)]})});Wg.displayName=wu;var yC="RadioBubbleInput",Hg=p.forwardRef(({__scopeSlider:r,value:a,...l},i)=>{const c=p.useRef(null),d=We(c,i),f=Fu(a);return p.useEffect(()=>{const m=c.current;if(!m)return;const x=window.HTMLInputElement.prototype,g=Object.getOwnPropertyDescriptor(x,"value").set;if(f!==a&&g){const y=new Event("input",{bubbles:!0});g.call(m,a),m.dispatchEvent(y)}},[f,a]),n.jsx(Le.input,{style:{display:"none"},...l,ref:d,defaultValue:a})});Hg.displayName=yC;function vC(r=[],a,l){const i=[...r];return i[l]=a,i.sort((c,d)=>c-d)}function Kg(r,a,l){const d=100/(l-a)*(r-a);return go(d,[0,100])}function wC(r,a){return a>2?`Value ${r+1} of ${a}`:a===2?["Minimum","Maximum"][r]:void 0}function bC(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 jC(r,a,l){const i=r/2,d=Ju([0,50],[0,i]);return(i-d(a)*l)*l}function NC(r){return r.slice(0,-1).map((a,l)=>r[l+1]-a)}function SC(r,a){if(a>0){const l=NC(r);return Math.min(...l)>=a}return!0}function Ju(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 CC(r){return(String(r).split(".")[1]||"").length}function kC(r,a){const l=Math.pow(10,a);return Math.round(r*l)/l}var EC=Og,PC=Ug,RC=Vg,_C=Wg;function TC({className:r,defaultValue:a,value:l,min:i=0,max:c=100,...d}){const f=p.useMemo(()=>Array.isArray(l)?l:Array.isArray(a)?a:[i,c],[l,a,i,c]);return n.jsxs(EC,{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(RC,{className:"bg-primary absolute h-full"})}),Array.from({length:f.length},(m,x)=>n.jsx(_C,{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"},x))]})}const IC={distributorShare:90,minWithdrawAmount:10,bindingDays:30,userDiscount:5,enableAutoWithdraw:!1};function AC(){const[r,a]=p.useState(IC),[l,i]=p.useState(!0),[c,d]=p.useState(!1);p.useEffect(()=>{Xe("/api/admin/referral-settings").then(x=>{const v=x==null?void 0:x.data;v&&typeof v=="object"&&a({distributorShare:v.distributorShare??90,minWithdrawAmount:v.minWithdrawAmount??10,bindingDays:v.bindingDays??30,userDiscount:v.userDiscount??5,enableAutoWithdraw:v.enableAutoWithdraw??!1})}).catch(console.error).finally(()=>i(!1))},[]);const f=async()=>{d(!0);try{const x={distributorShare:Number(r.distributorShare)||0,minWithdrawAmount:Number(r.minWithdrawAmount)||0,bindingDays:Number(r.bindingDays)||0,userDiscount:Number(r.userDiscount)||0,enableAutoWithdraw:!!r.enableAutoWithdraw},v=await gt("/api/admin/referral-settings",x);if(!v||v.success===!1){alert("保存失败: "+(v&&typeof v=="object"&&"error"in v?v.error:""));return}alert(`✅ 分销配置已保存成功! - -• 小程序与网站的推广规则会一起生效 -• 绑定关系会使用新的天数配置 -• 佣金比例会立即应用到新订单 - -如有缓存,请刷新前台/小程序页面。`)}catch(x){console.error(x),alert("保存失败: "+(x instanceof Error?x.message:String(x)))}finally{d(!1)}},m=x=>v=>{const g=parseFloat(v.target.value||"0");a(y=>({...y,[x]:isNaN(g)?0:g}))};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(As,{className:"w-5 h-5 text-[#38bdac]"}),"推广 / 分销设置"]}),n.jsx("p",{className:"text-gray-400 mt-1",children:"统一管理「好友优惠」「你得 90% 收益」「绑定期 30 天」「提现门槛」等规则,小程序和 Web 共用这套配置。"})]}),n.jsxs(ge,{onClick:f,disabled:c||l,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:[n.jsx(Wn,{className:"w-4 h-4 mr-2"}),c?"保存中...":"保存配置"]})]}),n.jsxs("div",{className:"space-y-6",children:[n.jsxs(Re,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:[n.jsxs(Ue,{children:[n.jsxs(Ve,{className:"flex items-center gap-2 text-white",children:[n.jsx(f1,{className:"w-4 h-4 text-[#38bdac]"}),"推广规则"]}),n.jsx(ut,{className:"text-gray-400",children:"这三项会直接体现在小程序「推广规则」卡片上,同时影响实收佣金计算。"})]}),n.jsx(_e,{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(oe,{className:"text-gray-300 flex items-center gap-2",children:[n.jsx(im,{className:"w-3 h-3 text-[#38bdac]"}),"好友优惠(%)"]}),n.jsx(me,{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(oe,{className:"text-gray-300 flex items-center gap-2",children:[n.jsx(Rn,{className:"w-3 h-3 text-[#38bdac]"}),"推广者分成(%)"]}),n.jsxs("div",{className:"flex items-center gap-4",children:[n.jsx(TC,{className:"flex-1",min:10,max:100,step:1,value:[r.distributorShare],onValueChange:([x])=>a(v=>({...v,distributorShare:x}))}),n.jsx(me,{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(oe,{className:"text-gray-300 flex items-center gap-2",children:[n.jsx(Rn,{className:"w-3 h-3 text-[#38bdac]"}),"绑定有效期(天)"]}),n.jsx(me,{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(Re,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:[n.jsxs(Ue,{children:[n.jsxs(Ve,{className:"flex items-center gap-2 text-white",children:[n.jsx(As,{className:"w-4 h-4 text-[#38bdac]"}),"提现规则"]}),n.jsx(ut,{className:"text-gray-400",children:"与「提现中心」「自动提现」相关的参数,影响推广者看到的可提现金额和最低门槛。"})]}),n.jsx(_e,{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(oe,{className:"text-gray-300",children:"最低提现金额(元)"}),n.jsx(me,{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(oe,{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(xt,{checked:r.enableAutoWithdraw,onCheckedChange:x=>a(v=>({...v,enableAutoWithdraw:x}))}),n.jsx("span",{className:"text-sm text-gray-400",children:"开启后,可结合定时任务实现「收益自动打款到微信零钱」。"})]})]})]})})]}),n.jsxs(Re,{className:"bg-[#0f2137] border-gray-700/50",children:[n.jsx(Ue,{children:n.jsxs(Ve,{className:"flex items-center gap-2 text-gray-200 text-sm",children:[n.jsx(im,{className:"w-4 h-4 text-[#38bdac]"}),"使用说明"]})}),n.jsxs(_e,{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 MC={appId:"wxb8bbb2b10dec74aa",apiDomain:"https://soulapi.quwanzhi.com",withdrawSubscribeTmplId:"u3MbZGPRkrZIk-I7QdpwzFxnO_CeQPaCWF2FkiIablE",mchId:"1318592501",minWithdraw:10},LC={name:"卡若",startDate:"2025年10月15日",bio:"连续创业者,私域运营专家,每天早上6-9点在Soul派对房分享真实商业故事",liveTime:"06:00-09:00",platform:"Soul派对房",description:"连续创业者,私域运营专家"},DC={sectionPrice:1,baseBookPrice:9.9,distributorShare:90,authorInfo:{...LC}},OC={matchEnabled:!0,referralEnabled:!0,searchEnabled:!0,aboutEnabled:!0};function FC(){const[r,a]=p.useState(DC),[l,i]=p.useState(["preface","epilogue","1.1","appendix-1","appendix-2","appendix-3"]),[c,d]=p.useState(""),[f,m]=p.useState(OC),[x,v]=p.useState(MC),[g,y]=p.useState(!1),[C,E]=p.useState(!0),[k,j]=p.useState(!1),[b,S]=p.useState(""),[P,N]=p.useState(""),[T,U]=p.useState(!1),[G,D]=p.useState(!1),V=(B,z,K=!1)=>{S(B),N(z),U(K),j(!0)};p.useEffect(()=>{(async()=>{try{const z=await Xe("/api/admin/settings");if(!z||z.success===!1)return;if(Array.isArray(z.freeChapters)&&z.freeChapters.length&&i(z.freeChapters),z.featureConfig&&Object.keys(z.featureConfig).length&&m(K=>({...K,...z.featureConfig})),z.mpConfig&&typeof z.mpConfig=="object"&&v(K=>({...K,...z.mpConfig})),z.siteSettings&&typeof z.siteSettings=="object"){const K=z.siteSettings;a(H=>({...H,...typeof K.sectionPrice=="number"&&{sectionPrice:K.sectionPrice},...typeof K.baseBookPrice=="number"&&{baseBookPrice:K.baseBookPrice},...typeof K.distributorShare=="number"&&{distributorShare:K.distributorShare},...K.authorInfo&&typeof K.authorInfo=="object"&&{authorInfo:{...H.authorInfo,...K.authorInfo}}}))}}catch(z){console.error("Load settings error:",z)}finally{E(!1)}})()},[]);const se=async(B,z)=>{D(!0);try{const K=await gt("/api/admin/settings",{featureConfig:B});if(!K||K.success===!1){z(),V("保存失败",(K==null?void 0:K.error)??"未知错误",!0);return}V("已保存","功能开关已更新,相关入口将随之显示或隐藏。")}catch(K){console.error("Save feature config error:",K),z(),V("保存失败",K instanceof Error?K.message:String(K),!0)}finally{D(!1)}},he=(B,z)=>{const K=f,H={...K,[B]:z};m(H),se(H,()=>m(K))},de=async()=>{y(!0);try{const B=await gt("/api/admin/settings",{freeChapters:l,featureConfig:f,siteSettings:{sectionPrice:r.sectionPrice,baseBookPrice:r.baseBookPrice,distributorShare:r.distributorShare,authorInfo:r.authorInfo},mpConfig:{appId:x.appId||"",apiDomain:x.apiDomain||"",withdrawSubscribeTmplId:x.withdrawSubscribeTmplId||"",mchId:x.mchId||"",minWithdraw:typeof x.minWithdraw=="number"?x.minWithdraw:10}});if(!B||B.success===!1){V("保存失败",(B==null?void 0:B.error)??"未知错误",!0);return}V("已保存","设置已保存成功。")}catch(B){console.error("Save settings error:",B),V("保存失败",B instanceof Error?B.message:String(B),!0)}finally{y(!1)}},fe=()=>{c&&!l.includes(c)&&(i([...l,c]),d(""))},Y=B=>{i(l.filter(z=>z!==B))};return C?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(ge,{onClick:de,disabled:g,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:[n.jsx(Wn,{className:"w-4 h-4 mr-2"}),g?"保存中...":"保存设置"]})]}),n.jsxs("div",{className:"space-y-6",children:[n.jsxs(Re,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:[n.jsxs(Ue,{children:[n.jsxs(Ve,{className:"text-white flex items-center gap-2",children:[n.jsx(am,{className:"w-5 h-5 text-[#38bdac]"}),"关于作者"]}),n.jsx(ut,{className:"text-gray-400",children:'配置作者信息,将在"关于作者"页面显示'})]}),n.jsxs(_e,{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(oe,{htmlFor:"author-name",className:"text-gray-300 flex items-center gap-1",children:[n.jsx(am,{className:"w-3 h-3"}),"主理人名称"]}),n.jsx(me,{id:"author-name",className:"bg-[#0a1628] border-gray-700 text-white",value:r.authorInfo.name??"",onChange:B=>a(z=>({...z,authorInfo:{...z.authorInfo,name:B.target.value}}))})]}),n.jsxs("div",{className:"space-y-2",children:[n.jsxs(oe,{htmlFor:"start-date",className:"text-gray-300 flex items-center gap-1",children:[n.jsx(Jc,{className:"w-3 h-3"}),"开播日期"]}),n.jsx(me,{id:"start-date",className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"例如: 2025年10月15日",value:r.authorInfo.startDate??"",onChange:B=>a(z=>({...z,authorInfo:{...z.authorInfo,startDate:B.target.value}}))})]})]}),n.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[n.jsxs("div",{className:"space-y-2",children:[n.jsxs(oe,{htmlFor:"live-time",className:"text-gray-300 flex items-center gap-1",children:[n.jsx(Jc,{className:"w-3 h-3"}),"直播时间"]}),n.jsx(me,{id:"live-time",className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"例如: 06:00-09:00",value:r.authorInfo.liveTime??"",onChange:B=>a(z=>({...z,authorInfo:{...z.authorInfo,liveTime:B.target.value}}))})]}),n.jsxs("div",{className:"space-y-2",children:[n.jsxs(oe,{htmlFor:"platform",className:"text-gray-300 flex items-center gap-1",children:[n.jsx(r1,{className:"w-3 h-3"}),"直播平台"]}),n.jsx(me,{id:"platform",className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"例如: Soul派对房",value:r.authorInfo.platform??"",onChange:B=>a(z=>({...z,authorInfo:{...z.authorInfo,platform:B.target.value}}))})]})]}),n.jsxs("div",{className:"space-y-2",children:[n.jsxs(oe,{htmlFor:"description",className:"text-gray-300 flex items-center gap-1",children:[n.jsx(Ts,{className:"w-3 h-3"}),"简介描述"]}),n.jsx(me,{id:"description",className:"bg-[#0a1628] border-gray-700 text-white",value:r.authorInfo.description??"",onChange:B=>a(z=>({...z,authorInfo:{...z.authorInfo,description:B.target.value}}))})]}),n.jsxs("div",{className:"space-y-2",children:[n.jsx(oe,{htmlFor:"bio",className:"text-gray-300",children:"详细介绍"}),n.jsx(Ur,{id:"bio",className:"bg-[#0a1628] border-gray-700 text-white min-h-[100px]",placeholder:"输入作者详细介绍...",value:r.authorInfo.bio??"",onChange:B=>a(z=>({...z,authorInfo:{...z.authorInfo,bio:B.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(Re,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:[n.jsxs(Ue,{children:[n.jsxs(Ve,{className:"text-white flex items-center gap-2",children:[n.jsx(uo,{className:"w-5 h-5 text-[#38bdac]"}),"价格设置"]}),n.jsx(ut,{className:"text-gray-400",children:"配置书籍和章节的定价"})]}),n.jsx(_e,{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(oe,{className:"text-gray-300",children:"单节价格 (元)"}),n.jsx(me,{type:"number",className:"bg-[#0a1628] border-gray-700 text-white",value:r.sectionPrice,onChange:B=>a(z=>({...z,sectionPrice:Number.parseFloat(B.target.value)||1}))})]}),n.jsxs("div",{className:"space-y-2",children:[n.jsx(oe,{className:"text-gray-300",children:"整本价格 (元)"}),n.jsx(me,{type:"number",className:"bg-[#0a1628] border-gray-700 text-white",value:r.baseBookPrice,onChange:B=>a(z=>({...z,baseBookPrice:Number.parseFloat(B.target.value)||9.9}))})]})]})})]}),n.jsxs(Re,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:[n.jsxs(Ue,{children:[n.jsxs(Ve,{className:"text-white flex items-center gap-2",children:[n.jsx(ru,{className:"w-5 h-5 text-[#38bdac]"}),"小程序配置"]}),n.jsx(ut,{className:"text-gray-400",children:"API 地址、订阅消息、支付商户号等,小程序从 /api/miniprogram/config 读取"})]}),n.jsx(_e,{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(oe,{className:"text-gray-300",children:"API 域名"}),n.jsx(me,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"https://soulapi.quwanzhi.com",value:x.apiDomain??"",onChange:B=>v(z=>({...z,apiDomain:B.target.value}))}),n.jsx("p",{className:"text-xs text-gray-500",children:"小程序请求接口的基础地址,不含 /api"})]}),n.jsxs("div",{className:"space-y-2",children:[n.jsx(oe,{className:"text-gray-300",children:"小程序 AppID"}),n.jsx(me,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"wxb8bbb2b10dec74aa",value:x.appId??"",onChange:B=>v(z=>({...z,appId:B.target.value}))})]}),n.jsxs("div",{className:"space-y-2",children:[n.jsx(oe,{className:"text-gray-300",children:"提现订阅模板 ID"}),n.jsx(me,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"用户申请提现时需授权",value:x.withdrawSubscribeTmplId??"",onChange:B=>v(z=>({...z,withdrawSubscribeTmplId:B.target.value}))})]}),n.jsxs("div",{className:"space-y-2",children:[n.jsx(oe,{className:"text-gray-300",children:"微信支付商户号"}),n.jsx(me,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"1318592501",value:x.mchId??"",onChange:B=>v(z=>({...z,mchId:B.target.value}))})]}),n.jsxs("div",{className:"space-y-2",children:[n.jsx(oe,{className:"text-gray-300",children:"最低提现金额 (元)"}),n.jsx(me,{type:"number",className:"bg-[#0a1628] border-gray-700 text-white",value:x.minWithdraw??10,onChange:B=>v(z=>({...z,minWithdraw:Number.parseFloat(B.target.value)||10}))})]})]})})]}),n.jsxs(Re,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:[n.jsxs(Ue,{children:[n.jsxs(Ve,{className:"text-white flex items-center gap-2",children:[n.jsx(lm,{className:"w-5 h-5 text-[#38bdac]"}),"免费章节"]}),n.jsx(ut,{className:"text-gray-400",children:"设置哪些章节对所有用户免费开放"})]}),n.jsxs(_e,{className:"space-y-4",children:[n.jsx("div",{className:"flex flex-wrap gap-2",children:l.map(B=>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:[B,n.jsx("button",{type:"button",onClick:()=>Y(B),className:"ml-1 hover:text-red-400",children:n.jsx(Hr,{className:"w-3 h-3"})})]},B))}),n.jsxs("div",{className:"flex gap-2",children:[n.jsx(me,{className:"bg-[#0a1628] border-gray-700 text-white flex-1",placeholder:"输入章节ID,如 1.2、2.1、preface",value:c,onChange:B=>d(B.target.value),onKeyDown:B=>B.key==="Enter"&&fe()}),n.jsxs(ge,{onClick:fe,className:"bg-[#38bdac] hover:bg-[#2da396]",children:[n.jsx(Ps,{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(Re,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:[n.jsxs(Ue,{children:[n.jsxs(Ve,{className:"text-white flex items-center gap-2",children:[n.jsx(ho,{className:"w-5 h-5 text-[#38bdac]"}),"功能开关"]}),n.jsx(ut,{className:"text-gray-400",children:"控制各个功能模块的显示/隐藏"})]}),n.jsxs(_e,{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(Rn,{className:"w-4 h-4 text-[#38bdac]"}),n.jsx(oe,{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(xt,{id:"match-enabled",checked:f.matchEnabled,disabled:G,onCheckedChange:B=>he("matchEnabled",B)})]}),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(lm,{className:"w-4 h-4 text-[#38bdac]"}),n.jsx(oe,{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(xt,{id:"referral-enabled",checked:f.referralEnabled,disabled:G,onCheckedChange:B=>he("referralEnabled",B)})]}),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(Ts,{className:"w-4 h-4 text-[#38bdac]"}),n.jsx(oe,{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(xt,{id:"search-enabled",checked:f.searchEnabled,disabled:G,onCheckedChange:B=>he("searchEnabled",B)})]}),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(ho,{className:"w-4 h-4 text-[#38bdac]"}),n.jsx(oe,{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(xt,{id:"about-enabled",checked:f.aboutEnabled,disabled:G,onCheckedChange:B=>he("aboutEnabled",B)})]})]}),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.jsx(Sn,{open:k,onOpenChange:j,children:n.jsxs(fn,{className:"bg-[#0f2137] border-gray-700 text-white",showCloseButton:!0,children:[n.jsxs(Cn,{children:[n.jsx(kn,{className:T?"text-red-400":"text-[#38bdac]",children:b}),n.jsx(AN,{className:"text-gray-400 whitespace-pre-wrap pt-2",children:P})]}),n.jsx(Vn,{className:"mt-4",children:n.jsx(ge,{onClick:()=>j(!1),className:T?"bg-gray-600 hover:bg-gray-500":"bg-[#38bdac] hover:bg-[#2da396]",children:"确定"})})]})})]})}const Wm={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 zC(){const[r,a]=p.useState(!1),[l,i]=p.useState(Wm),[c,d]=p.useState(""),f=async()=>{a(!0);try{const S=await Xe("/api/config");S!=null&&S.paymentMethods&&i({...Wm,...S.paymentMethods})}catch(S){console.error(S)}finally{a(!1)}};p.useEffect(()=>{f()},[]);const m=async()=>{a(!0);try{await gt("/api/db/config",{key:"payment_methods",value:l,description:"支付方式配置"}),alert("配置已保存!")}catch(S){console.error("保存失败:",S),alert("保存失败: "+(S instanceof Error?S.message:String(S)))}finally{a(!1)}},x=(S,P)=>{navigator.clipboard.writeText(S),d(P),setTimeout(()=>d(""),2e3)},v=(S,P)=>{i(N=>({...N,wechat:{...N.wechat,[S]:P}}))},g=(S,P)=>{i(N=>({...N,alipay:{...N.alipay,[S]:P}}))},y=(S,P)=>{i(N=>({...N,usdt:{...N.usdt,[S]:P}}))},C=(S,P)=>{i(N=>({...N,paypal:{...N.paypal,[S]:P}}))},E=l.wechat,k=l.alipay,j=l.usdt,b=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(ge,{variant:"outline",onClick:f,className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:[n.jsx(Ye,{className:`w-4 h-4 mr-2 ${r?"animate-spin":""}`}),"同步配置"]}),n.jsxs(ge,{onClick:m,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:[n.jsx(Wn,{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(ip,{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(Uu,{defaultValue:"wechat",className:"space-y-6",children:[n.jsxs(Io,{className:"bg-[#0f2137] border border-gray-700/50 p-1 grid grid-cols-4 w-full",children:[n.jsxs(en,{value:"wechat",className:"data-[state=active]:bg-[#07C160]/20 data-[state=active]:text-[#07C160] text-gray-400",children:[n.jsx(ru,{className:"w-4 h-4 mr-2"}),"微信"]}),n.jsxs(en,{value:"alipay",className:"data-[state=active]:bg-[#1677FF]/20 data-[state=active]:text-[#1677FF] text-gray-400",children:[n.jsx(eu,{className:"w-4 h-4 mr-2"}),"支付宝"]}),n.jsxs(en,{value:"usdt",className:"data-[state=active]:bg-[#26A17B]/20 data-[state=active]:text-[#26A17B] text-gray-400",children:[n.jsx(sm,{className:"w-4 h-4 mr-2"}),"USDT"]}),n.jsxs(en,{value:"paypal",className:"data-[state=active]:bg-[#003087]/20 data-[state=active]:text-[#169BD7] text-gray-400",children:[n.jsx(tu,{className:"w-4 h-4 mr-2"}),"PayPal"]})]}),n.jsx(tn,{value:"wechat",className:"space-y-4",children:n.jsxs(Re,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:[n.jsxs(Ue,{className:"flex flex-row items-center justify-between pb-2",children:[n.jsxs("div",{className:"space-y-1",children:[n.jsxs(Ve,{className:"text-[#07C160] flex items-center gap-2",children:[n.jsx(ru,{className:"w-5 h-5"}),"微信支付配置"]}),n.jsx(ut,{className:"text-gray-400",children:"配置微信支付参数和跳转链接"})]}),n.jsx(xt,{checked:!!E.enabled,onCheckedChange:S=>v("enabled",S)})]}),n.jsxs(_e,{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(oe,{className:"text-gray-300",children:"网站AppID"}),n.jsx(me,{className:"bg-[#0a1628] border-gray-700 text-white font-mono text-sm",value:String(E.websiteAppId??""),onChange:S=>v("websiteAppId",S.target.value)})]}),n.jsxs("div",{className:"space-y-2",children:[n.jsx(oe,{className:"text-gray-300",children:"商户号"}),n.jsx(me,{className:"bg-[#0a1628] border-gray-700 text-white font-mono text-sm",value:String(E.merchantId??""),onChange:S=>v("merchantId",S.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(fo,{className:"w-4 h-4 text-[#38bdac]"}),"跳转链接配置(核心功能)"]}),n.jsxs("div",{className:"space-y-2",children:[n.jsx(oe,{className:"text-gray-300",children:"微信收款码/支付链接"}),n.jsx(me,{className:"bg-[#0a1628] border-gray-700 text-white placeholder:text-gray-500",placeholder:"https://收款码图片URL 或 weixin://支付链接",value:String(E.qrCode??""),onChange:S=>v("qrCode",S.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(oe,{className:"text-[#07C160] font-medium",children:"微信群跳转链接(支付成功后跳转)"}),n.jsx(me,{className:"bg-[#0a1628] border-[#07C160]/30 text-white placeholder:text-gray-500",placeholder:"https://weixin.qq.com/g/... 或微信群二维码图片URL",value:String(E.groupQrCode??""),onChange:S=>v("groupQrCode",S.target.value)}),n.jsx("p",{className:"text-xs text-[#07C160]/70",children:"用户支付成功后将自动跳转到此链接,进入指定微信群"})]})]})]})]})}),n.jsx(tn,{value:"alipay",className:"space-y-4",children:n.jsxs(Re,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:[n.jsxs(Ue,{className:"flex flex-row items-center justify-between pb-2",children:[n.jsxs("div",{className:"space-y-1",children:[n.jsxs(Ve,{className:"text-[#1677FF] flex items-center gap-2",children:[n.jsx(eu,{className:"w-5 h-5"}),"支付宝配置"]}),n.jsx(ut,{className:"text-gray-400",children:"已加载真实支付宝参数"})]}),n.jsx(xt,{checked:!!k.enabled,onCheckedChange:S=>g("enabled",S)})]}),n.jsxs(_e,{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(oe,{className:"text-gray-300",children:"合作者身份 (PID)"}),n.jsxs("div",{className:"flex gap-2",children:[n.jsx(me,{className:"bg-[#0a1628] border-gray-700 text-white font-mono text-sm",value:String(k.partnerId??""),onChange:S=>g("partnerId",S.target.value)}),n.jsx(ge,{size:"icon",variant:"outline",className:"border-gray-700 bg-transparent",onClick:()=>x(String(k.partnerId??""),"pid"),children:c==="pid"?n.jsx(Co,{className:"w-4 h-4 text-green-500"}):n.jsx(up,{className:"w-4 h-4 text-gray-400"})})]})]}),n.jsxs("div",{className:"space-y-2",children:[n.jsx(oe,{className:"text-gray-300",children:"安全校验码 (Key)"}),n.jsx(me,{type:"password",className:"bg-[#0a1628] border-gray-700 text-white font-mono text-sm",value:String(k.securityKey??""),onChange:S=>g("securityKey",S.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(fo,{className:"w-4 h-4 text-[#38bdac]"}),"跳转链接配置"]}),n.jsxs("div",{className:"space-y-2",children:[n.jsx(oe,{className:"text-gray-300",children:"支付宝收款码/跳转链接"}),n.jsx(me,{className:"bg-[#0a1628] border-gray-700 text-white placeholder:text-gray-500",placeholder:"https://qr.alipay.com/... 或收款码图片URL",value:String(k.qrCode??""),onChange:S=>g("qrCode",S.target.value)}),n.jsx("p",{className:"text-xs text-gray-500",children:"用户点击支付宝支付后显示的二维码"})]})]})]})]})}),n.jsx(tn,{value:"usdt",className:"space-y-4",children:n.jsxs(Re,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:[n.jsxs(Ue,{className:"flex flex-row items-center justify-between pb-2",children:[n.jsxs("div",{className:"space-y-1",children:[n.jsxs(Ve,{className:"text-[#26A17B] flex items-center gap-2",children:[n.jsx(sm,{className:"w-5 h-5"}),"USDT配置"]}),n.jsx(ut,{className:"text-gray-400",children:"配置加密货币收款地址"})]}),n.jsx(xt,{checked:!!j.enabled,onCheckedChange:S=>y("enabled",S)})]}),n.jsxs(_e,{className:"space-y-4",children:[n.jsxs("div",{className:"space-y-2",children:[n.jsx(oe,{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(j.network??"TRC20"),onChange:S=>y("network",S.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(oe,{className:"text-gray-300",children:"收款地址"}),n.jsx(me,{className:"bg-[#0a1628] border-gray-700 text-white font-mono text-sm",placeholder:"T... (TRC20地址)",value:String(j.address??""),onChange:S=>y("address",S.target.value)})]}),n.jsxs("div",{className:"space-y-2",children:[n.jsx(oe,{className:"text-gray-300",children:"汇率 (1 USD = ? CNY)"}),n.jsx(me,{type:"number",className:"bg-[#0a1628] border-gray-700 text-white",value:Number(j.exchangeRate)??7.2,onChange:S=>y("exchangeRate",Number.parseFloat(S.target.value)||7.2)})]})]})]})}),n.jsx(tn,{value:"paypal",className:"space-y-4",children:n.jsxs(Re,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:[n.jsxs(Ue,{className:"flex flex-row items-center justify-between pb-2",children:[n.jsxs("div",{className:"space-y-1",children:[n.jsxs(Ve,{className:"text-[#169BD7] flex items-center gap-2",children:[n.jsx(tu,{className:"w-5 h-5"}),"PayPal配置"]}),n.jsx(ut,{className:"text-gray-400",children:"配置PayPal收款账户"})]}),n.jsx(xt,{checked:!!b.enabled,onCheckedChange:S=>C("enabled",S)})]}),n.jsxs(_e,{className:"space-y-4",children:[n.jsxs("div",{className:"space-y-2",children:[n.jsx(oe,{className:"text-gray-300",children:"PayPal邮箱"}),n.jsx(me,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"your@email.com",value:String(b.email??""),onChange:S=>C("email",S.target.value)})]}),n.jsxs("div",{className:"space-y-2",children:[n.jsx(oe,{className:"text-gray-300",children:"汇率 (1 USD = ? CNY)"}),n.jsx(me,{type:"number",className:"bg-[#0a1628] border-gray-700 text-white",value:Number(b.exchangeRate)??7.2,onChange:S=>C("exchangeRate",Number(S.target.value)||7.2)})]})]})]})})]})]})}const $C={siteName:"卡若日记",siteTitle:"一场SOUL的创业实验场",siteDescription:"来自Soul派对房的真实商业故事",logo:"/logo.png",favicon:"/favicon.ico",primaryColor:"#00CED1"},BC={home:{enabled:!0,label:"首页"},chapters:{enabled:!0,label:"目录"},match:{enabled:!0,label:"匹配"},my:{enabled:!0,label:"我的"}},UC={homeTitle:"一场SOUL的创业实验场",homeSubtitle:"来自Soul派对房的真实商业故事",chaptersTitle:"我要看",matchTitle:"语音匹配",myTitle:"我的",aboutTitle:"关于作者"};function VC(){const[r,a]=p.useState({siteConfig:{...$C},menuConfig:{...BC},pageConfig:{...UC}}),[l,i]=p.useState(!1),[c,d]=p.useState(!1);p.useEffect(()=>{Xe("/api/config").then(g=>{g!=null&&g.siteConfig&&a(y=>({...y,siteConfig:{...y.siteConfig,...g.siteConfig}})),g!=null&&g.menuConfig&&a(y=>({...y,menuConfig:{...y.menuConfig,...g.menuConfig}})),g!=null&&g.pageConfig&&a(y=>({...y,pageConfig:{...y.pageConfig,...g.pageConfig}}))}).catch(console.error)},[]);const f=async()=>{d(!0);try{await gt("/api/db/config",{key:"site_config",value:r.siteConfig,description:"网站基础配置"}),await gt("/api/db/config",{key:"menu_config",value:r.menuConfig,description:"底部菜单配置"}),await gt("/api/db/config",{key:"page_config",value:r.pageConfig,description:"页面标题配置"}),i(!0),setTimeout(()=>i(!1),2e3),alert("配置已保存")}catch(g){console.error(g),alert("保存失败: "+(g instanceof Error?g.message:String(g)))}finally{d(!1)}},m=r.siteConfig,x=r.menuConfig,v=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(ge,{onClick:f,disabled:c,className:`${l?"bg-green-500":"bg-[#00CED1]"} hover:bg-[#20B2AA] text-white transition-colors`,children:[n.jsx(Wn,{className:"w-4 h-4 mr-2"}),c?"保存中...":l?"已保存":"保存设置"]})]}),n.jsxs("div",{className:"space-y-6",children:[n.jsxs(Re,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:[n.jsxs(Ue,{children:[n.jsxs(Ve,{className:"text-white flex items-center gap-2",children:[n.jsx(tu,{className:"w-5 h-5 text-[#00CED1]"}),"网站基础信息"]}),n.jsx(ut,{className:"text-gray-400",children:"配置网站名称、标题和描述"})]}),n.jsxs(_e,{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(oe,{htmlFor:"site-name",className:"text-gray-300",children:"网站名称"}),n.jsx(me,{id:"site-name",className:"bg-[#0a1628] border-gray-700 text-white",value:m.siteName??"",onChange:g=>a(y=>({...y,siteConfig:{...y.siteConfig,siteName:g.target.value}}))})]}),n.jsxs("div",{className:"space-y-2",children:[n.jsx(oe,{htmlFor:"site-title",className:"text-gray-300",children:"网站标题"}),n.jsx(me,{id:"site-title",className:"bg-[#0a1628] border-gray-700 text-white",value:m.siteTitle??"",onChange:g=>a(y=>({...y,siteConfig:{...y.siteConfig,siteTitle:g.target.value}}))})]})]}),n.jsxs("div",{className:"space-y-2",children:[n.jsx(oe,{htmlFor:"site-desc",className:"text-gray-300",children:"网站描述"}),n.jsx(me,{id:"site-desc",className:"bg-[#0a1628] border-gray-700 text-white",value:m.siteDescription??"",onChange:g=>a(y=>({...y,siteConfig:{...y.siteConfig,siteDescription:g.target.value}}))})]}),n.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[n.jsxs("div",{className:"space-y-2",children:[n.jsx(oe,{htmlFor:"logo",className:"text-gray-300",children:"Logo地址"}),n.jsx(me,{id:"logo",className:"bg-[#0a1628] border-gray-700 text-white",value:m.logo??"",onChange:g=>a(y=>({...y,siteConfig:{...y.siteConfig,logo:g.target.value}}))})]}),n.jsxs("div",{className:"space-y-2",children:[n.jsx(oe,{htmlFor:"favicon",className:"text-gray-300",children:"Favicon地址"}),n.jsx(me,{id:"favicon",className:"bg-[#0a1628] border-gray-700 text-white",value:m.favicon??"",onChange:g=>a(y=>({...y,siteConfig:{...y.siteConfig,favicon:g.target.value}}))})]})]})]})]}),n.jsxs(Re,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:[n.jsxs(Ue,{children:[n.jsxs(Ve,{className:"text-white flex items-center gap-2",children:[n.jsx(c1,{className:"w-5 h-5 text-[#00CED1]"}),"主题颜色"]}),n.jsx(ut,{className:"text-gray-400",children:"配置网站主题色"})]}),n.jsx(_e,{children:n.jsxs("div",{className:"flex items-center gap-4",children:[n.jsxs("div",{className:"space-y-2 flex-1",children:[n.jsx(oe,{htmlFor:"primary-color",className:"text-gray-300",children:"主色调"}),n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsx(me,{id:"primary-color",type:"color",className:"w-16 h-10 bg-[#0a1628] border-gray-700 cursor-pointer p-1",value:m.primaryColor??"#00CED1",onChange:g=>a(y=>({...y,siteConfig:{...y.siteConfig,primaryColor:g.target.value}}))}),n.jsx(me,{className:"bg-[#0a1628] border-gray-700 text-white flex-1",value:m.primaryColor??"#00CED1",onChange:g=>a(y=>({...y,siteConfig:{...y.siteConfig,primaryColor:g.target.value}}))})]})]}),n.jsx("div",{className:"w-24 h-24 rounded-xl flex items-center justify-center text-white font-bold",style:{backgroundColor:m.primaryColor??"#00CED1"},children:"预览"})]})})]}),n.jsxs(Re,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:[n.jsxs(Ue,{children:[n.jsxs(Ve,{className:"text-white flex items-center gap-2",children:[n.jsx(a1,{className:"w-5 h-5 text-[#00CED1]"}),"底部菜单配置"]}),n.jsx(ut,{className:"text-gray-400",children:"控制底部导航栏菜单的显示和名称"})]}),n.jsx(_e,{className:"space-y-4",children:Object.entries(x).map(([g,y])=>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(xt,{checked:(y==null?void 0:y.enabled)??!0,onCheckedChange:C=>a(E=>({...E,menuConfig:{...E.menuConfig,[g]:{...y,enabled:C}}}))}),n.jsx("span",{className:"text-gray-300 w-16 capitalize",children:g}),n.jsx(me,{className:"bg-[#0f2137] border-gray-700 text-white max-w-[200px]",value:(y==null?void 0:y.label)??"",onChange:C=>a(E=>({...E,menuConfig:{...E.menuConfig,[g]:{...y,label:C.target.value}}}))})]}),n.jsx("span",{className:`text-sm ${y!=null&&y.enabled?"text-green-400":"text-gray-500"}`,children:y!=null&&y.enabled?"显示":"隐藏"})]},g))})]}),n.jsxs(Re,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:[n.jsxs(Ue,{children:[n.jsxs(Ve,{className:"text-white flex items-center gap-2",children:[n.jsx(fp,{className:"w-5 h-5 text-[#00CED1]"}),"页面标题配置"]}),n.jsx(ut,{className:"text-gray-400",children:"配置各个页面的标题和副标题"})]}),n.jsxs(_e,{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(oe,{className:"text-gray-300",children:"首页标题"}),n.jsx(me,{className:"bg-[#0a1628] border-gray-700 text-white",value:v.homeTitle??"",onChange:g=>a(y=>({...y,pageConfig:{...y.pageConfig,homeTitle:g.target.value}}))})]}),n.jsxs("div",{className:"space-y-2",children:[n.jsx(oe,{className:"text-gray-300",children:"首页副标题"}),n.jsx(me,{className:"bg-[#0a1628] border-gray-700 text-white",value:v.homeSubtitle??"",onChange:g=>a(y=>({...y,pageConfig:{...y.pageConfig,homeSubtitle:g.target.value}}))})]})]}),n.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[n.jsxs("div",{className:"space-y-2",children:[n.jsx(oe,{className:"text-gray-300",children:"目录页标题"}),n.jsx(me,{className:"bg-[#0a1628] border-gray-700 text-white",value:v.chaptersTitle??"",onChange:g=>a(y=>({...y,pageConfig:{...y.pageConfig,chaptersTitle:g.target.value}}))})]}),n.jsxs("div",{className:"space-y-2",children:[n.jsx(oe,{className:"text-gray-300",children:"匹配页标题"}),n.jsx(me,{className:"bg-[#0a1628] border-gray-700 text-white",value:v.matchTitle??"",onChange:g=>a(y=>({...y,pageConfig:{...y.pageConfig,matchTitle:g.target.value}}))})]})]}),n.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[n.jsxs("div",{className:"space-y-2",children:[n.jsx(oe,{className:"text-gray-300",children:"我的页标题"}),n.jsx(me,{className:"bg-[#0a1628] border-gray-700 text-white",value:v.myTitle??"",onChange:g=>a(y=>({...y,pageConfig:{...y.pageConfig,myTitle:g.target.value}}))})]}),n.jsxs("div",{className:"space-y-2",children:[n.jsx(oe,{className:"text-gray-300",children:"关于作者标题"}),n.jsx(me,{className:"bg-[#0a1628] border-gray-700 text-white",value:v.aboutTitle??"",onChange:g=>a(y=>({...y,pageConfig:{...y.pageConfig,aboutTitle:g.target.value}}))})]})]})]})]})]})]})}function WC(){const[r,a]=p.useState(""),[l,i]=p.useState(""),[c,d]=p.useState(""),[f,m]=p.useState({}),x=async()=>{var E,k,j,b;try{const S=await Xe("/api/config"),P=(k=(E=S==null?void 0:S.liveQRCodes)==null?void 0:E[0])==null?void 0:k.urls;Array.isArray(P)&&a(P.join(` -`));const N=(b=(j=S==null?void 0:S.paymentMethods)==null?void 0:j.wechat)==null?void 0:b.groupQrCode;N&&i(N),m({paymentMethods:S==null?void 0:S.paymentMethods,liveQRCodes:S==null?void 0:S.liveQRCodes})}catch(S){console.error(S)}};p.useEffect(()=>{x()},[]);const v=(E,k)=>{navigator.clipboard.writeText(E),d(k),setTimeout(()=>d(""),2e3)},g=async()=>{try{const E=r.split(` -`).map(j=>j.trim()).filter(Boolean),k=[...f.liveQRCodes||[]];k[0]?k[0].urls=E:k.push({id:"live-1",name:"微信群活码",urls:E,clickCount:0}),await gt("/api/db/config",{key:"live_qr_codes",value:k,description:"群活码配置"}),alert("群活码配置已保存!"),await x()}catch(E){console.error(E),alert("保存失败: "+(E instanceof Error?E.message:String(E)))}},y=async()=>{var E;try{await gt("/api/db/config",{key:"payment_methods",value:{...f.paymentMethods||{},wechat:{...((E=f.paymentMethods)==null?void 0:E.wechat)||{},groupQrCode:l}},description:"支付方式配置"}),alert("微信群链接已保存!用户支付成功后将自动跳转"),await x()}catch(k){console.error(k),alert("保存失败: "+(k instanceof Error?k.message:String(k)))}},C=()=>{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(ip,{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(Re,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl md:col-span-2",children:[n.jsxs(Ue,{children:[n.jsxs(Ve,{className:"text-[#07C160] flex items-center gap-2",children:[n.jsx(dm,{className:"w-5 h-5"}),"支付成功跳转链接(核心配置)"]}),n.jsx(ut,{className:"text-gray-400",children:"用户支付完成后自动跳转到此链接,进入指定微信群"})]}),n.jsxs(_e,{className:"space-y-4",children:[n.jsxs("div",{className:"space-y-2",children:[n.jsxs(oe,{className:"text-gray-300 flex items-center gap-2",children:[n.jsx(um,{className:"w-4 h-4"}),"微信群链接 / 活码链接"]}),n.jsxs("div",{className:"flex gap-2",children:[n.jsx(me,{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(ge,{variant:"outline",size:"icon",className:"border-gray-700 bg-transparent hover:bg-gray-700/50",onClick:()=>v(l,"group"),children:c==="group"?n.jsx(Co,{className:"w-4 h-4 text-green-500"}):n.jsx(up,{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(fo,{className:"w-3 h-3"}),"支持格式:草料短链、微信群链接(https://weixin.qq.com/g/...)、企业微信链接等"]})]}),n.jsxs("div",{className:"flex gap-3",children:[n.jsxs(ge,{onClick:y,className:"flex-1 bg-[#07C160] hover:bg-[#06AD51] text-white",children:[n.jsx(ks,{className:"w-4 h-4 mr-2"}),"保存配置"]}),n.jsxs(ge,{onClick:C,variant:"outline",className:"border-[#07C160] text-[#07C160] hover:bg-[#07C160]/10 bg-transparent",children:[n.jsx(fo,{className:"w-4 h-4 mr-2"}),"测试跳转"]})]})]})]}),n.jsxs(Re,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl md:col-span-2",children:[n.jsxs(Ue,{children:[n.jsxs(Ve,{className:"text-white flex items-center gap-2",children:[n.jsx(dm,{className:"w-5 h-5 text-[#38bdac]"}),"多群轮换(高级配置)"]}),n.jsx(ut,{className:"text-gray-400",children:"配置多个群链接,系统自动轮换分配,避免单群满员"})]}),n.jsxs(_e,{className:"space-y-4",children:[n.jsxs("div",{className:"space-y-2",children:[n.jsxs(oe,{className:"text-gray-300 flex items-center gap-2",children:[n.jsx(um,{className:"w-4 h-4"}),"多个群链接(每行一个)"]}),n.jsx(Ur,{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(ge,{onClick:g,className:"w-full bg-[#38bdac] hover:bg-[#2da396] text-white",children:[n.jsx(ks,{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 Hm={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}},HC=["⭐","👥","❤️","🎮","💼","🚀","💡","🎯","🔥","✨"];function KC(){const[r,a]=p.useState(Hm),[l,i]=p.useState(!0),[c,d]=p.useState(!1),[f,m]=p.useState(!1),[x,v]=p.useState(null),[g,y]=p.useState({id:"",label:"",matchLabel:"",icon:"⭐",matchFromDB:!1,showJoinAfterMatch:!0,price:1,enabled:!0}),C=async()=>{i(!0);try{const N=await Xe("/api/db/config/full?key=match_config"),T=(N==null?void 0:N.data)??(N==null?void 0:N.config);T&&a({...Hm,...T})}catch(N){console.error("加载匹配配置失败:",N)}finally{i(!1)}};p.useEffect(()=>{C()},[]);const E=async()=>{d(!0);try{const N=await gt("/api/db/config",{key:"match_config",value:r,description:"匹配功能配置"});N&&N.success!==!1?alert("配置保存成功!"):alert("保存失败: "+(N&&typeof N=="object"&&"error"in N?N.error:"未知错误"))}catch(N){console.error("保存配置失败:",N),alert("保存失败")}finally{d(!1)}},k=N=>{v(N),y({id:N.id,label:N.label,matchLabel:N.matchLabel,icon:N.icon,matchFromDB:N.matchFromDB,showJoinAfterMatch:N.showJoinAfterMatch,price:N.price,enabled:N.enabled}),m(!0)},j=()=>{v(null),y({id:"",label:"",matchLabel:"",icon:"⭐",matchFromDB:!1,showJoinAfterMatch:!0,price:1,enabled:!0}),m(!0)},b=()=>{if(!g.id||!g.label){alert("请填写类型ID和名称");return}const N=[...r.matchTypes];if(x){const T=N.findIndex(U=>U.id===x.id);T!==-1&&(N[T]={...g})}else{if(N.some(T=>T.id===g.id)){alert("类型ID已存在");return}N.push({...g})}a({...r,matchTypes:N}),m(!1)},S=N=>{confirm("确定要删除这个匹配类型吗?")&&a({...r,matchTypes:r.matchTypes.filter(T=>T.id!==N)})},P=N=>{a({...r,matchTypes:r.matchTypes.map(T=>T.id===N?{...T,enabled:!T.enabled}:T)})};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(ho,{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(ge,{variant:"outline",onClick:C,disabled:l,className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:[n.jsx(Ye,{className:`w-4 h-4 mr-2 ${l?"animate-spin":""}`}),"刷新"]}),n.jsxs(ge,{onClick:E,disabled:c,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:[n.jsx(Wn,{className:"w-4 h-4 mr-2"}),c?"保存中...":"保存配置"]})]})]}),n.jsxs(Re,{className:"bg-[#0f2137] border-gray-700/50",children:[n.jsxs(Ue,{children:[n.jsxs(Ve,{className:"text-white flex items-center gap-2",children:[n.jsx(F1,{className:"w-5 h-5 text-yellow-400"}),"基础设置"]}),n.jsx(ut,{className:"text-gray-400",children:"配置免费匹配次数和付费规则"})]}),n.jsxs(_e,{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(oe,{className:"text-gray-300",children:"每日免费匹配次数"}),n.jsx(me,{type:"number",min:0,max:100,className:"bg-[#0a1628] border-gray-700 text-white",value:r.freeMatchLimit,onChange:N=>a({...r,freeMatchLimit:parseInt(N.target.value,10)||0})}),n.jsx("p",{className:"text-xs text-gray-500",children:"用户每天可免费匹配的次数"})]}),n.jsxs("div",{className:"space-y-2",children:[n.jsx(oe,{className:"text-gray-300",children:"付费匹配价格(元)"}),n.jsx(me,{type:"number",min:.01,step:.01,className:"bg-[#0a1628] border-gray-700 text-white",value:r.matchPrice,onChange:N=>a({...r,matchPrice:parseFloat(N.target.value)||1})}),n.jsx("p",{className:"text-xs text-gray-500",children:"免费次数用完后的单次匹配价格"})]}),n.jsxs("div",{className:"space-y-2",children:[n.jsx(oe,{className:"text-gray-300",children:"每日最大匹配次数"}),n.jsx(me,{type:"number",min:1,max:100,className:"bg-[#0a1628] border-gray-700 text-white",value:r.settings.maxMatchesPerDay,onChange:N=>a({...r,settings:{...r.settings,maxMatchesPerDay:parseInt(N.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(xt,{checked:r.settings.enableFreeMatches,onCheckedChange:N=>a({...r,settings:{...r.settings,enableFreeMatches:N}})}),n.jsx(oe,{className:"text-gray-300",children:"启用免费匹配"})]}),n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsx(xt,{checked:r.settings.enablePaidMatches,onCheckedChange:N=>a({...r,settings:{...r.settings,enablePaidMatches:N}})}),n.jsx(oe,{className:"text-gray-300",children:"启用付费匹配"})]})]})]})]}),n.jsxs(Re,{className:"bg-[#0f2137] border-gray-700/50",children:[n.jsxs(Ue,{className:"flex flex-row items-center justify-between",children:[n.jsxs("div",{children:[n.jsxs(Ve,{className:"text-white flex items-center gap-2",children:[n.jsx(Rn,{className:"w-5 h-5 text-[#38bdac]"}),"匹配类型管理"]}),n.jsx(ut,{className:"text-gray-400",children:"配置不同的匹配类型及其价格"})]}),n.jsxs(ge,{onClick:j,size:"sm",className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:[n.jsx(Ps,{className:"w-4 h-4 mr-1"}),"添加类型"]})]}),n.jsx(_e,{children:n.jsxs(La,{children:[n.jsx(Da,{children:n.jsxs(nn,{className:"bg-[#0a1628] hover:bg-[#0a1628] border-gray-700",children:[n.jsx(Ge,{className:"text-gray-400",children:"图标"}),n.jsx(Ge,{className:"text-gray-400",children:"类型ID"}),n.jsx(Ge,{className:"text-gray-400",children:"显示名称"}),n.jsx(Ge,{className:"text-gray-400",children:"匹配标签"}),n.jsx(Ge,{className:"text-gray-400",children:"价格"}),n.jsx(Ge,{className:"text-gray-400",children:"数据库匹配"}),n.jsx(Ge,{className:"text-gray-400",children:"状态"}),n.jsx(Ge,{className:"text-right text-gray-400",children:"操作"})]})}),n.jsx(Oa,{children:r.matchTypes.map(N=>n.jsxs(nn,{className:"hover:bg-[#0a1628] border-gray-700/50",children:[n.jsx(Be,{children:n.jsx("span",{className:"text-2xl",children:N.icon})}),n.jsx(Be,{className:"font-mono text-gray-300",children:N.id}),n.jsx(Be,{className:"text-white font-medium",children:N.label}),n.jsx(Be,{className:"text-gray-300",children:N.matchLabel}),n.jsx(Be,{children:n.jsxs(Oe,{className:"bg-yellow-500/20 text-yellow-400 hover:bg-yellow-500/20 border-0",children:["¥",N.price]})}),n.jsx(Be,{children:N.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(Be,{children:n.jsx(xt,{checked:N.enabled,onCheckedChange:()=>P(N.id)})}),n.jsx(Be,{className:"text-right",children:n.jsxs("div",{className:"flex items-center justify-end gap-1",children:[n.jsx(ge,{variant:"ghost",size:"sm",onClick:()=>k(N),className:"text-gray-400 hover:text-[#38bdac] hover:bg-[#38bdac]/10",children:n.jsx(Is,{className:"w-4 h-4"})}),n.jsx(ge,{variant:"ghost",size:"sm",onClick:()=>S(N.id),className:"text-red-400 hover:text-red-300 hover:bg-red-500/10",children:n.jsx(hp,{className:"w-4 h-4"})})]})})]},N.id))})]})})]}),n.jsx(Sn,{open:f,onOpenChange:m,children:n.jsxs(fn,{className:"bg-[#0f2137] border-gray-700 text-white max-w-lg",showCloseButton:!0,children:[n.jsx(Cn,{children:n.jsxs(kn,{className:"text-white flex items-center gap-2",children:[x?n.jsx(Is,{className:"w-5 h-5 text-[#38bdac]"}):n.jsx(Ps,{className:"w-5 h-5 text-[#38bdac]"}),x?"编辑匹配类型":"添加匹配类型"]})}),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(oe,{className:"text-gray-300",children:"类型ID(英文)"}),n.jsx(me,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"如: partner",value:g.id,onChange:N=>y({...g,id:N.target.value}),disabled:!!x})]}),n.jsxs("div",{className:"space-y-2",children:[n.jsx(oe,{className:"text-gray-300",children:"图标"}),n.jsx("div",{className:"flex gap-1 flex-wrap",children:HC.map(N=>n.jsx("button",{type:"button",className:`w-8 h-8 text-lg rounded ${g.icon===N?"bg-[#38bdac]/30 ring-1 ring-[#38bdac]":"bg-[#0a1628]"}`,onClick:()=>y({...g,icon:N}),children:N},N))})]})]}),n.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[n.jsxs("div",{className:"space-y-2",children:[n.jsx(oe,{className:"text-gray-300",children:"显示名称"}),n.jsx(me,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"如: 创业合伙",value:g.label,onChange:N=>y({...g,label:N.target.value})})]}),n.jsxs("div",{className:"space-y-2",children:[n.jsx(oe,{className:"text-gray-300",children:"匹配标签"}),n.jsx(me,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"如: 创业伙伴",value:g.matchLabel,onChange:N=>y({...g,matchLabel:N.target.value})})]})]}),n.jsxs("div",{className:"space-y-2",children:[n.jsx(oe,{className:"text-gray-300",children:"单次匹配价格(元)"}),n.jsx(me,{type:"number",min:.01,step:.01,className:"bg-[#0a1628] border-gray-700 text-white",value:g.price,onChange:N=>y({...g,price:parseFloat(N.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(xt,{checked:g.matchFromDB,onCheckedChange:N=>y({...g,matchFromDB:N})}),n.jsx(oe,{className:"text-gray-300 text-sm",children:"从数据库匹配"})]}),n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsx(xt,{checked:g.showJoinAfterMatch,onCheckedChange:N=>y({...g,showJoinAfterMatch:N})}),n.jsx(oe,{className:"text-gray-300 text-sm",children:"匹配后显示加入"})]}),n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsx(xt,{checked:g.enabled,onCheckedChange:N=>y({...g,enabled:N})}),n.jsx(oe,{className:"text-gray-300 text-sm",children:"启用"})]})]})]}),n.jsxs(Vn,{children:[n.jsx(ge,{variant:"outline",onClick:()=>m(!1),className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:"取消"}),n.jsxs(ge,{onClick:b,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:[n.jsx(Wn,{className:"w-4 h-4 mr-2"}),"保存"]})]})]})})]})}const Km={partner:"找伙伴",investor:"资源对接",mentor:"导师顾问",team:"团队招募"};function GC(){const[r,a]=p.useState([]),[l,i]=p.useState(0),[c,d]=p.useState(1),[f,m]=p.useState(10),[x,v]=p.useState(""),[g,y]=p.useState(!0),[C,E]=p.useState(null);async function k(){y(!0),E(null);try{const b=new URLSearchParams({page:String(c),pageSize:String(f)});x&&b.set("matchType",x);const S=await Xe(`/api/db/match-records?${b}`);S!=null&&S.success?(a(S.records||[]),i(S.total??0)):E("加载匹配记录失败")}catch(b){console.error("加载匹配记录失败",b),E("加载失败,请检查网络后重试")}finally{y(!1)}}p.useEffect(()=>{k()},[c,x]);const j=Math.ceil(l/f)||1;return n.jsxs("div",{className:"p-8 max-w-7xl mx-auto",children:[C&&n.jsxs("div",{className:"mb-4 px-4 py-3 rounded-lg bg-red-500/20 border border-red-500/50 text-red-400 text-sm flex items-center justify-between",children:[n.jsx("span",{children:C}),n.jsx("button",{type:"button",onClick:()=>E(null),className:"hover:text-red-300",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:["找伙伴匹配统计,共 ",l," 条记录"]})]}),n.jsxs("div",{className:"flex items-center gap-4",children:[n.jsxs("select",{value:x,onChange:b=>{v(b.target.value),d(1)},className:"bg-[#0f2137] border border-gray-700 text-white rounded-lg px-3 py-2 text-sm",children:[n.jsx("option",{value:"",children:"全部类型"}),Object.entries(Km).map(([b,S])=>n.jsx("option",{value:b,children:S},b))]}),n.jsxs("button",{type:"button",onClick:k,disabled:g,className:"flex items-center gap-2 px-4 py-2 rounded-lg border border-gray-600 text-gray-300 hover:bg-gray-700/50 transition-colors disabled:opacity-50",children:[n.jsx(Ye,{className:`w-4 h-4 ${g?"animate-spin":""}`}),"刷新"]})]})]}),n.jsx(Re,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:n.jsx(_e,{className:"p-0",children:g?n.jsxs("div",{className:"flex justify-center py-12",children:[n.jsx(Ye,{className:"w-6 h-6 text-[#38bdac] animate-spin"}),n.jsx("span",{className:"ml-2 text-gray-400",children:"加载中..."})]}):n.jsxs(n.Fragment,{children:[n.jsxs(La,{children:[n.jsx(Da,{children:n.jsxs(nn,{className:"bg-[#0a1628] hover:bg-[#0a1628] border-gray-700",children:[n.jsx(Ge,{className:"text-gray-400",children:"发起人"}),n.jsx(Ge,{className:"text-gray-400",children:"匹配到"}),n.jsx(Ge,{className:"text-gray-400",children:"类型"}),n.jsx(Ge,{className:"text-gray-400",children:"联系方式"}),n.jsx(Ge,{className:"text-gray-400",children:"匹配时间"})]})}),n.jsxs(Oa,{children:[r.map(b=>n.jsxs(nn,{className:"hover:bg-[#0a1628] border-gray-700/50",children:[n.jsx(Be,{children:n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsxs("div",{className:"w-9 h-9 rounded-full bg-[#38bdac]/20 flex items-center justify-center text-sm font-medium text-[#38bdac] flex-shrink-0 overflow-hidden",children:[b.userAvatar?n.jsx("img",{src:b.userAvatar,alt:"",className:"w-full h-full object-cover",onError:S=>{S.currentTarget.style.display="none";const P=S.currentTarget.nextElementSibling;P&&P.classList.remove("hidden")}}):null,n.jsx("span",{className:b.userAvatar?"hidden":"",children:(b.userNickname||b.userId||"?").charAt(0)})]}),n.jsxs("div",{children:[n.jsx("div",{className:"text-white",children:b.userNickname||b.userId}),n.jsxs("div",{className:"text-xs text-gray-500 font-mono",children:[b.userId.slice(0,16),"..."]})]})]})}),n.jsx(Be,{children:n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsxs("div",{className:"w-9 h-9 rounded-full bg-[#38bdac]/20 flex items-center justify-center text-sm font-medium text-[#38bdac] flex-shrink-0 overflow-hidden",children:[b.matchedUserAvatar?n.jsx("img",{src:b.matchedUserAvatar,alt:"",className:"w-full h-full object-cover",onError:S=>{S.currentTarget.style.display="none";const P=S.currentTarget.nextElementSibling;P&&P.classList.remove("hidden")}}):null,n.jsx("span",{className:b.matchedUserAvatar?"hidden":"",children:(b.matchedNickname||b.matchedUserId||"?").charAt(0)})]}),n.jsxs("div",{children:[n.jsx("div",{className:"text-white",children:b.matchedNickname||b.matchedUserId}),n.jsxs("div",{className:"text-xs text-gray-500 font-mono",children:[b.matchedUserId.slice(0,16),"..."]})]})]})}),n.jsx(Be,{children:n.jsx(Oe,{className:"bg-[#38bdac]/20 text-[#38bdac] border-0",children:Km[b.matchType]||b.matchType})}),n.jsxs(Be,{className:"text-gray-400 text-sm",children:[b.phone&&n.jsxs("div",{children:["📱 ",b.phone]}),b.wechatId&&n.jsxs("div",{children:["💬 ",b.wechatId]}),!b.phone&&!b.wechatId&&"-"]}),n.jsx(Be,{className:"text-gray-400",children:b.createdAt?new Date(b.createdAt).toLocaleString():"-"})]},b.id)),r.length===0&&n.jsx(nn,{children:n.jsx(Be,{colSpan:5,className:"text-center py-12 text-gray-500",children:"暂无匹配记录"})})]})]}),n.jsx(Wr,{page:c,totalPages:j,total:l,pageSize:f,onPageChange:d,onPageSizeChange:b=>{m(b),d(1)}})]})})})]})}function QC(){const r=qr();return n.jsx("div",{className:"min-h-screen bg-[#0a1628] flex items-center justify-center p-8",children:n.jsxs("div",{className:"text-center max-w-md",children:[n.jsx("div",{className:"inline-flex items-center justify-center w-20 h-20 rounded-full bg-red-500/20 text-red-400 mb-6",children:n.jsx(vw,{className:"w-10 h-10"})}),n.jsx("h1",{className:"text-4xl font-bold text-white mb-2",children:"404"}),n.jsx("p",{className:"text-gray-400 mb-1",children:"页面不存在"}),n.jsx("p",{className:"text-sm text-gray-500 font-mono mb-8 break-all",children:r.pathname}),n.jsx(ge,{asChild:!0,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:n.jsxs(sp,{to:"/",children:[n.jsx(Vw,{className:"w-4 h-4 mr-2"}),"返回首页"]})})]})})}function YC(){return n.jsxs(Qv,{children:[n.jsx(pt,{path:"/login",element:n.jsx(Vb,{})}),n.jsxs(pt,{path:"/",element:n.jsx(K1,{}),children:[n.jsx(pt,{index:!0,element:n.jsx(Hv,{to:"/dashboard",replace:!0})}),n.jsx(pt,{path:"dashboard",element:n.jsx(Hb,{})}),n.jsx(pt,{path:"orders",element:n.jsx(Gb,{})}),n.jsx(pt,{path:"users",element:n.jsx(n2,{})}),n.jsx(pt,{path:"distribution",element:n.jsx(r2,{})}),n.jsx(pt,{path:"withdrawals",element:n.jsx(s2,{})}),n.jsx(pt,{path:"content",element:n.jsx(uC,{})}),n.jsx(pt,{path:"chapters",element:n.jsx(dC,{})}),n.jsx(pt,{path:"referral-settings",element:n.jsx(AC,{})}),n.jsx(pt,{path:"settings",element:n.jsx(FC,{})}),n.jsx(pt,{path:"payment",element:n.jsx(zC,{})}),n.jsx(pt,{path:"site",element:n.jsx(VC,{})}),n.jsx(pt,{path:"qrcodes",element:n.jsx(WC,{})}),n.jsx(pt,{path:"match",element:n.jsx(KC,{})}),n.jsx(pt,{path:"match-records",element:n.jsx(GC,{})})]}),n.jsx(pt,{path:"*",element:n.jsx(QC,{})})]})}qy.createRoot(document.getElementById("root")).render(n.jsx(p.StrictMode,{children:n.jsx(tw,{future:{v7_startTransition:!0,v7_relativeSplatPath:!0},children:n.jsx(YC,{})})})); diff --git a/soul-admin/dist/index.html b/soul-admin/dist/index.html index 37604dee..b20ef631 100644 --- a/soul-admin/dist/index.html +++ b/soul-admin/dist/index.html @@ -4,8 +4,8 @@ 管理后台 - Soul创业派对 - - + +
diff --git a/soul-admin/src/App.tsx b/soul-admin/src/App.tsx index 022e338d..5d5f242d 100644 --- a/soul-admin/src/App.tsx +++ b/soul-admin/src/App.tsx @@ -15,6 +15,7 @@ import { SitePage } from './pages/site/SitePage' import { QRCodesPage } from './pages/qrcodes/QRCodesPage' import { MatchPage } from './pages/match/MatchPage' import { MatchRecordsPage } from './pages/match-records/MatchRecordsPage' +import { VipRolesPage } from './pages/vip-roles/VipRolesPage' import { ApiDocPage } from './pages/api-doc/ApiDocPage' import { NotFoundPage } from './pages/not-found/NotFoundPage' @@ -32,6 +33,7 @@ function App() { } /> } /> } /> + } /> } /> } /> } /> diff --git a/soul-admin/src/components/modules/user/SetVipModal.tsx b/soul-admin/src/components/modules/user/SetVipModal.tsx new file mode 100644 index 00000000..b90e6174 --- /dev/null +++ b/soul-admin/src/components/modules/user/SetVipModal.tsx @@ -0,0 +1,280 @@ +import { useState, useEffect } from 'react' +import { + Dialog, + DialogContent, + DialogHeader, + DialogTitle, + DialogFooter, +} from '@/components/ui/dialog' +import { Button } from '@/components/ui/button' +import { Input } from '@/components/ui/input' +import { Label } from '@/components/ui/label' +import { Switch } from '@/components/ui/switch' +import { Crown, Save, X } from 'lucide-react' +import { get, put } from '@/api/client' + +interface SetVipModalProps { + open: boolean + onClose: () => void + userId: string | null + userNickname?: string + onSaved?: () => void +} + +interface VipRole { + id: number + name: string + sort: number +} + +interface VipForm { + isVip: boolean + vipExpireDate: string + vipSort: number | '' + vipRole: string + vipRoleCustom: string + vipName: string + vipProject: string + vipContact: string + vipBio: string +} + +const DEFAULT_FORM: VipForm = { + isVip: false, + vipExpireDate: '', + vipSort: '', + vipRole: '', + vipRoleCustom: '', + vipName: '', + vipProject: '', + vipContact: '', + vipBio: '', +} + +export function SetVipModal({ + open, + onClose, + userId, + userNickname = '', + onSaved, +}: SetVipModalProps) { + const [form, setForm] = useState(DEFAULT_FORM) + const [roles, setRoles] = useState([]) + const [loading, setLoading] = useState(false) + const [saving, setSaving] = useState(false) + + useEffect(() => { + if (!open) { + setForm(DEFAULT_FORM) + return + } + let cancelled = false + setLoading(true) + Promise.all([ + get<{ success?: boolean; data?: VipRole[] }>('/api/db/vip-roles'), + userId ? get<{ success?: boolean; user?: Record }>(`/api/db/users?id=${encodeURIComponent(userId)}`) : Promise.resolve(null), + ]).then(([rolesRes, userRes]) => { + if (cancelled) return + const rolesList = (rolesRes as { success?: boolean; data?: VipRole[] })?.success && (rolesRes as { data?: VipRole[] }).data ? (rolesRes as { data?: VipRole[] }).data! : [] + setRoles(rolesList) + const u = userRes && (userRes as { user?: Record }).user ? (userRes as { user?: Record }).user! : null + if (u) { + const vipRole = String(u.vipRole ?? '') + const inRoles = rolesList.some((r: VipRole) => r.name === vipRole) + setForm({ + isVip: !!(u.isVip ?? false), + vipExpireDate: u.vipExpireDate ? String(u.vipExpireDate).slice(0, 10) : '', + vipSort: typeof u.vipSort === 'number' ? u.vipSort : '', + vipRole: inRoles ? vipRole : (vipRole ? '__custom__' : ''), + vipRoleCustom: inRoles ? '' : vipRole, + vipName: String(u.vipName ?? ''), + vipProject: String(u.vipProject ?? ''), + vipContact: String(u.vipContact ?? ''), + vipBio: String(u.vipBio ?? ''), + }) + } else { + setForm(DEFAULT_FORM) + } + }).catch((e) => { + if (!cancelled) console.error('Load error:', e) + }).finally(() => { + if (!cancelled) setLoading(false) + }) + return () => { cancelled = true } + }, [open, userId]) + + async function handleSave() { + if (!userId) return + if (form.isVip && !form.vipExpireDate.trim()) { + alert('开启 VIP 时请填写有效到期日') + return + } + if (form.isVip && form.vipExpireDate.trim()) { + const d = new Date(form.vipExpireDate) + if (isNaN(d.getTime())) { + alert('到期日格式无效,请使用 YYYY-MM-DD') + return + } + } + setSaving(true) + try { + const roleValue = form.vipRole === '__custom__' ? form.vipRoleCustom.trim() : form.vipRole + const payload: Record = { + id: userId, + isVip: form.isVip, + vipExpireDate: form.isVip ? form.vipExpireDate : undefined, + vipSort: form.vipSort === '' ? undefined : form.vipSort, + vipRole: roleValue || undefined, + vipName: form.vipName || undefined, + vipProject: form.vipProject || undefined, + vipContact: form.vipContact || undefined, + vipBio: form.vipBio || undefined, + } + const data = await put<{ success?: boolean; error?: string }>('/api/db/users', payload) + if (data?.success) { + alert('VIP 设置已保存') + onSaved?.() + onClose() + } else { + alert('保存失败: ' + (data as { error?: string })?.error) + } + } catch (e) { + console.error('Save VIP error:', e) + alert('保存失败') + } finally { + setSaving(false) + } + } + + if (!open) return null + + return ( + onClose()}> + + + + + 设置 VIP - {userNickname || userId} + + + {loading ? ( +
加载中...
+ ) : ( +
+
+ + setForm((f) => ({ ...f, isVip: checked }))} + /> +
+ {form.isVip && ( + <> +
+ + setForm((f) => ({ ...f, vipExpireDate: e.target.value }))} + /> +
+
+ + { + const v = e.target.value + setForm((f) => ({ ...f, vipSort: v === '' ? '' : parseInt(v, 10) || 0 })) + }} + /> +
+ + )} +
+ + + {form.vipRole === '__custom__' && ( + setForm((f) => ({ ...f, vipRoleCustom: e.target.value }))} + /> + )} +
+
+ + setForm((f) => ({ ...f, vipName: e.target.value }))} + /> +
+
+ + setForm((f) => ({ ...f, vipProject: e.target.value }))} + /> +
+
+ + setForm((f) => ({ ...f, vipContact: e.target.value }))} + /> +
+
+ + setForm((f) => ({ ...f, vipBio: e.target.value }))} + /> +
+
+ )} + + + + +
+
+ ) +} diff --git a/soul-admin/src/components/modules/user/UserDetailModal.tsx b/soul-admin/src/components/modules/user/UserDetailModal.tsx index 9fc85220..bff93ab1 100644 --- a/soul-admin/src/components/modules/user/UserDetailModal.tsx +++ b/soul-admin/src/components/modules/user/UserDetailModal.tsx @@ -10,7 +10,6 @@ import { Badge } from '@/components/ui/badge' import { Input } from '@/components/ui/input' import { Label } from '@/components/ui/label' import { Tabs, TabsContent, TabsList, TabsTrigger } from '@/components/ui/tabs' -import { Switch } from '@/components/ui/switch' import { User, Phone, @@ -25,7 +24,6 @@ import { Save, X, Tag, - Crown, } from 'lucide-react' import { get, put, post } from '@/api/client' @@ -91,12 +89,6 @@ export function UserDetailModal({ const [editNickname, setEditNickname] = useState('') const [editTags, setEditTags] = useState([]) const [newTag, setNewTag] = useState('') - const [editIsVip, setEditIsVip] = useState(false) - const [editVipExpireDate, setEditVipExpireDate] = useState('') - const [editVipName, setEditVipName] = useState('') - const [editVipProject, setEditVipProject] = useState('') - const [editVipContact, setEditVipContact] = useState('') - const [editVipBio, setEditVipBio] = useState('') useEffect(() => { if (open && userId) loadUserDetail() @@ -115,12 +107,6 @@ export function UserDetailModal({ setEditPhone(u.phone || '') setEditNickname(u.nickname || '') setEditTags(typeof u.tags === 'string' ? (JSON.parse(u.tags || '[]') as string[]) : []) - setEditIsVip(!!u.isVip) - setEditVipExpireDate(u.vipExpireDate ? String(u.vipExpireDate).slice(0, 10) : '') - setEditVipName(u.vipName || '') - setEditVipProject(u.vipProject || '') - setEditVipContact(u.vipContact || '') - setEditVipBio(u.vipBio || '') } try { const trackData = await get<{ success?: boolean; tracks?: UserTrack[] }>( @@ -173,17 +159,6 @@ export function UserDetailModal({ async function handleSave() { if (!user) return - if (editIsVip && !editVipExpireDate.trim()) { - alert('开启 VIP 时请填写有效到期日') - return - } - if (editIsVip && editVipExpireDate.trim()) { - const d = new Date(editVipExpireDate) - if (isNaN(d.getTime())) { - alert('到期日格式无效,请使用 YYYY-MM-DD') - return - } - } setSaving(true) try { const payload: Record = { @@ -191,12 +166,6 @@ export function UserDetailModal({ phone: editPhone || undefined, nickname: editNickname || undefined, tags: JSON.stringify(editTags), - isVip: editIsVip, - vipExpireDate: editVipExpireDate || undefined, - vipName: editVipName || undefined, - vipProject: editVipProject || undefined, - vipContact: editVipContact || undefined, - vipBio: editVipBio || undefined, } const data = await put<{ success?: boolean; error?: string }>('/api/db/users', payload) if (data?.success) { @@ -331,70 +300,6 @@ export function UserDetailModal({ /> -
-
- - VIP 手动设置 -
-
-
- - -
-
- - setEditVipExpireDate(e.target.value)} - required={editIsVip} - /> -
-
- - setEditVipName(e.target.value)} - /> -
-
- - setEditVipProject(e.target.value)} - /> -
-
- - setEditVipContact(e.target.value)} - /> -
-
- - setEditVipBio(e.target.value)} - /> -
-
-

推荐人数

diff --git a/soul-admin/src/layouts/AdminLayout.tsx b/soul-admin/src/layouts/AdminLayout.tsx index d33f8b75..442b8368 100644 --- a/soul-admin/src/layouts/AdminLayout.tsx +++ b/soul-admin/src/layouts/AdminLayout.tsx @@ -9,6 +9,7 @@ import { Wallet, BookOpen, GitMerge, + Crown, } from 'lucide-react' import { get, post } from '@/api/client' import { clearAdminToken } from '@/api/auth' @@ -17,6 +18,7 @@ const menuItems = [ { icon: LayoutDashboard, label: '数据概览', href: '/dashboard' }, { icon: BookOpen, label: '内容管理', href: '/content' }, { icon: Users, label: '用户管理', href: '/users' }, + { icon: Crown, label: 'VIP 角色', href: '/vip-roles' }, { icon: Wallet, label: '交易中心', href: '/distribution' }, { icon: GitMerge, label: '匹配记录', href: '/match-records' }, { icon: CreditCard, label: '推广设置', href: '/referral-settings' }, diff --git a/soul-admin/src/pages/referral-settings/ReferralSettingsPage.tsx b/soul-admin/src/pages/referral-settings/ReferralSettingsPage.tsx index 1b42015d..0d2d768e 100644 --- a/soul-admin/src/pages/referral-settings/ReferralSettingsPage.tsx +++ b/soul-admin/src/pages/referral-settings/ReferralSettingsPage.tsx @@ -15,6 +15,8 @@ interface ReferralConfig { bindingDays: number userDiscount: number enableAutoWithdraw: boolean + vipOrderShareVip: number + vipOrderShareNonVip: number } const DEFAULT: ReferralConfig = { @@ -23,6 +25,8 @@ const DEFAULT: ReferralConfig = { bindingDays: 30, userDiscount: 5, enableAutoWithdraw: false, + vipOrderShareVip: 20, + vipOrderShareNonVip: 10, } export function ReferralSettingsPage() { @@ -41,6 +45,8 @@ export function ReferralSettingsPage() { bindingDays: c.bindingDays ?? 30, userDiscount: c.userDiscount ?? 5, enableAutoWithdraw: c.enableAutoWithdraw ?? false, + vipOrderShareVip: c.vipOrderShareVip ?? 20, + vipOrderShareNonVip: c.vipOrderShareNonVip ?? 10, }) } }) @@ -57,6 +63,8 @@ export function ReferralSettingsPage() { bindingDays: Number(config.bindingDays) || 0, userDiscount: Number(config.userDiscount) || 0, enableAutoWithdraw: Boolean(config.enableAutoWithdraw), + vipOrderShareVip: Number(config.vipOrderShareVip) || 20, + vipOrderShareNonVip: Number(config.vipOrderShareNonVip) || 10, } const res = await post<{ success?: boolean; error?: string }>('/api/admin/referral-settings', body) if (!res || (res as { success?: boolean }).success === false) { @@ -162,9 +170,45 @@ export function ReferralSettingsPage() { />

- 实际佣金 = 订单金额 ×{' '} + 内容订单佣金 = 订单金额 ×{' '} {config.distributorShare}% - ,支付回调和分销统计都会用这个值。 + ;会员订单见下方。 +

+
+ +
+ + +

+ 推广者已是会员时,会员订单佣金比例,默认 20%。 +

+
+ +
+ + +

+ 推广者非会员时,会员订单佣金比例,默认 10%。

diff --git a/soul-admin/src/pages/users/UsersPage.tsx b/soul-admin/src/pages/users/UsersPage.tsx index a12d6539..34563f20 100644 --- a/soul-admin/src/pages/users/UsersPage.tsx +++ b/soul-admin/src/pages/users/UsersPage.tsx @@ -31,8 +31,10 @@ import { RefreshCw, Users, Eye, + Crown, } from 'lucide-react' import { UserDetailModal } from '@/components/modules/user/UserDetailModal' +import { SetVipModal } from '@/components/modules/user/SetVipModal' import { Pagination } from '@/components/ui/Pagination' import { useDebounce } from '@/hooks/useDebounce' import { get, del, post, put } from '@/api/client' @@ -80,6 +82,8 @@ export function UsersPage() { const [selectedUserForReferrals, setSelectedUserForReferrals] = useState(null) const [showDetailModal, setShowDetailModal] = useState(false) const [selectedUserIdForDetail, setSelectedUserIdForDetail] = useState(null) + const [showSetVipModal, setShowSetVipModal] = useState(false) + const [selectedUserForVip, setSelectedUserForVip] = useState(null) const [formData, setFormData] = useState({ phone: '', nickname: '', @@ -237,6 +241,11 @@ export function UsersPage() { setShowDetailModal(true) } + const handleSetVip = (user: User) => { + setSelectedUserForVip(user) + setShowSetVipModal(true) + } + async function handleSavePassword() { if (!newPassword) { alert('请输入新密码') @@ -466,6 +475,14 @@ export function UsersPage() { onUserUpdated={loadUsers} /> + { setShowSetVipModal(false); setSelectedUserForVip(null) }} + userId={selectedUserForVip?.id ?? null} + userNickname={selectedUserForVip?.nickname} + onSaved={loadUsers} + /> + @@ -691,6 +708,15 @@ export function UsersPage() {
+ +
+ + + + {loading ? ( +
加载中...
+ ) : ( + + + + ID + 角色名称 + 排序 + 操作 + + + + {roles.map((r) => ( + + {r.id} + {r.name} + {r.sort} + + + + + + ))} + {roles.length === 0 && ( + + + 暂无角色,点击「新增角色」添加 + + + )} + +
+ )} +
+
+ + + + + + {editingRole ? '编辑角色' : '新增角色'} + + +
+
+ + setFormName(e.target.value)} + /> +
+
+ + setFormSort(parseInt(e.target.value, 10) || 0)} + /> +
+
+ + + + +
+
+ + ) +} diff --git a/soul-admin/tsconfig.tsbuildinfo b/soul-admin/tsconfig.tsbuildinfo index e1b0c3e1..624423a2 100644 --- a/soul-admin/tsconfig.tsbuildinfo +++ b/soul-admin/tsconfig.tsbuildinfo @@ -1 +1 @@ -{"root":["./src/app.tsx","./src/main.tsx","./src/vite-env.d.ts","./src/api/auth.ts","./src/api/client.ts","./src/components/modules/user/userdetailmodal.tsx","./src/components/ui/pagination.tsx","./src/components/ui/badge.tsx","./src/components/ui/button.tsx","./src/components/ui/card.tsx","./src/components/ui/dialog.tsx","./src/components/ui/input.tsx","./src/components/ui/label.tsx","./src/components/ui/select.tsx","./src/components/ui/slider.tsx","./src/components/ui/switch.tsx","./src/components/ui/table.tsx","./src/components/ui/tabs.tsx","./src/components/ui/textarea.tsx","./src/hooks/usedebounce.ts","./src/layouts/adminlayout.tsx","./src/lib/utils.ts","./src/pages/chapters/chapterspage.tsx","./src/pages/content/contentpage.tsx","./src/pages/dashboard/dashboardpage.tsx","./src/pages/distribution/distributionpage.tsx","./src/pages/login/loginpage.tsx","./src/pages/match/matchpage.tsx","./src/pages/match-records/matchrecordspage.tsx","./src/pages/not-found/notfoundpage.tsx","./src/pages/orders/orderspage.tsx","./src/pages/payment/paymentpage.tsx","./src/pages/qrcodes/qrcodespage.tsx","./src/pages/referral-settings/referralsettingspage.tsx","./src/pages/settings/settingspage.tsx","./src/pages/site/sitepage.tsx","./src/pages/users/userspage.tsx","./src/pages/withdrawals/withdrawalspage.tsx"],"version":"5.6.3"} \ No newline at end of file +{"root":["./src/app.tsx","./src/main.tsx","./src/vite-env.d.ts","./src/api/auth.ts","./src/api/client.ts","./src/components/modules/user/setvipmodal.tsx","./src/components/modules/user/userdetailmodal.tsx","./src/components/ui/pagination.tsx","./src/components/ui/badge.tsx","./src/components/ui/button.tsx","./src/components/ui/card.tsx","./src/components/ui/dialog.tsx","./src/components/ui/input.tsx","./src/components/ui/label.tsx","./src/components/ui/select.tsx","./src/components/ui/slider.tsx","./src/components/ui/switch.tsx","./src/components/ui/table.tsx","./src/components/ui/tabs.tsx","./src/components/ui/textarea.tsx","./src/hooks/usedebounce.ts","./src/layouts/adminlayout.tsx","./src/lib/utils.ts","./src/pages/api-doc/apidocpage.tsx","./src/pages/chapters/chapterspage.tsx","./src/pages/content/contentpage.tsx","./src/pages/dashboard/dashboardpage.tsx","./src/pages/distribution/distributionpage.tsx","./src/pages/login/loginpage.tsx","./src/pages/match/matchpage.tsx","./src/pages/match-records/matchrecordspage.tsx","./src/pages/not-found/notfoundpage.tsx","./src/pages/orders/orderspage.tsx","./src/pages/payment/paymentpage.tsx","./src/pages/qrcodes/qrcodespage.tsx","./src/pages/referral-settings/referralsettingspage.tsx","./src/pages/settings/settingspage.tsx","./src/pages/site/sitepage.tsx","./src/pages/users/userspage.tsx","./src/pages/vip-roles/viprolespage.tsx","./src/pages/withdrawals/withdrawalspage.tsx"],"version":"5.6.3"} \ No newline at end of file diff --git a/soul-api/internal/database/database.go b/soul-api/internal/database/database.go index 7c7670cd..dc0b3075 100644 --- a/soul-api/internal/database/database.go +++ b/soul-api/internal/database/database.go @@ -30,6 +30,9 @@ func Init(dsn string) error { if err := db.AutoMigrate(&model.UserAddress{}); err != nil { log.Printf("database: user_addresses migrate warning: %v", err) } + if err := db.AutoMigrate(&model.VipRole{}); err != nil { + log.Printf("database: vip_roles migrate warning: %v", err) + } log.Println("database: connected") return nil } diff --git a/soul-api/internal/handler/db.go b/soul-api/internal/handler/db.go index 91d85262..a670713e 100644 --- a/soul-api/internal/handler/db.go +++ b/soul-api/internal/handler/db.go @@ -278,12 +278,14 @@ func AdminSettingsPost(c *gin.Context) { func AdminReferralSettingsGet(c *gin.Context) { db := database.DB() defaultConfig := gin.H{ - "distributorShare": float64(90), + "distributorShare": float64(90), "minWithdrawAmount": float64(10), "bindingDays": float64(30), "userDiscount": float64(5), "withdrawFee": float64(5), "enableAutoWithdraw": false, + "vipOrderShareVip": float64(20), + "vipOrderShareNonVip": float64(10), } var row model.SystemConfig if err := db.Where("config_key = ?", "referral_config").First(&row).Error; err != nil { @@ -301,24 +303,36 @@ func AdminReferralSettingsGet(c *gin.Context) { // AdminReferralSettingsPost POST /api/admin/referral-settings 推广设置页专用:仅保存 referral_config(请求体为完整配置对象) func AdminReferralSettingsPost(c *gin.Context) { var body struct { - DistributorShare float64 `json:"distributorShare"` - MinWithdrawAmount float64 `json:"minWithdrawAmount"` - BindingDays float64 `json:"bindingDays"` - UserDiscount float64 `json:"userDiscount"` - WithdrawFee float64 `json:"withdrawFee"` - EnableAutoWithdraw bool `json:"enableAutoWithdraw"` + DistributorShare float64 `json:"distributorShare"` + MinWithdrawAmount float64 `json:"minWithdrawAmount"` + BindingDays float64 `json:"bindingDays"` + UserDiscount float64 `json:"userDiscount"` + WithdrawFee float64 `json:"withdrawFee"` + EnableAutoWithdraw bool `json:"enableAutoWithdraw"` + VipOrderShareVip float64 `json:"vipOrderShareVip"` + VipOrderShareNonVip float64 `json:"vipOrderShareNonVip"` } if err := c.ShouldBindJSON(&body); err != nil { c.JSON(http.StatusOK, gin.H{"success": false, "error": "请求体无效"}) return } + vipOrderShareVip := body.VipOrderShareVip + if vipOrderShareVip == 0 { + vipOrderShareVip = 20 + } + vipOrderShareNonVip := body.VipOrderShareNonVip + if vipOrderShareNonVip == 0 { + vipOrderShareNonVip = 10 + } val := gin.H{ - "distributorShare": body.DistributorShare, - "minWithdrawAmount": body.MinWithdrawAmount, - "bindingDays": body.BindingDays, - "userDiscount": body.UserDiscount, - "withdrawFee": body.WithdrawFee, + "distributorShare": body.DistributorShare, + "minWithdrawAmount": body.MinWithdrawAmount, + "bindingDays": body.BindingDays, + "userDiscount": body.UserDiscount, + "withdrawFee": body.WithdrawFee, "enableAutoWithdraw": body.EnableAutoWithdraw, + "vipOrderShareVip": vipOrderShareVip, + "vipOrderShareNonVip": vipOrderShareNonVip, } valBytes, err := json.Marshal(val) if err != nil { @@ -456,18 +470,6 @@ func DBUsersList(c *gin.Context) { return } - // 读取推广配置中的分销比例 - distributorShare := 0.9 - var cfg model.SystemConfig - if err := db.Where("config_key = ?", "referral_config").First(&cfg).Error; err == nil { - var config map[string]interface{} - if _ = json.Unmarshal(cfg.ConfigValue, &config); config["distributorShare"] != nil { - if share, ok := config["distributorShare"].(float64); ok { - distributorShare = share / 100 - } - } - } - userIDs := make([]string, 0, len(users)) for _, u := range users { userIDs = append(userIDs, u.ID) @@ -494,17 +496,15 @@ func DBUsersList(c *gin.Context) { sectionCountMap[r.UserID] = int(r.Count) } - // 2. 分销收益:从 referrer 订单计算佣金;可提现 = 累计佣金 - 已提现 - 待处理提现 + // 2. 分销收益:从 referrer 订单逐条 computeOrderCommission 求和(会员订单 20%/10%,内容订单 90%) referrerEarningsMap := make(map[string]float64) - var referrerRows []struct { - ReferrerID string - Total float64 - } - db.Model(&model.Order{}).Select("referrer_id, COALESCE(SUM(amount), 0) as total"). - Where("referrer_id IS NOT NULL AND referrer_id != '' AND status = ?", "paid"). - Group("referrer_id").Find(&referrerRows) - for _, r := range referrerRows { - referrerEarningsMap[r.ReferrerID] = r.Total * distributorShare + var referrerOrders []model.Order + db.Where("referrer_id IS NOT NULL AND referrer_id != '' AND status = ?", "paid").Find(&referrerOrders) + for i := range referrerOrders { + rid := referrerOrders[i].ReferrerID + if rid != nil && *rid != "" { + referrerEarningsMap[*rid] += computeOrderCommission(db, &referrerOrders[i], nil) + } } withdrawnMap := make(map[string]float64) var withdrawnRows []struct { @@ -625,6 +625,8 @@ func DBUsersAction(c *gin.Context) { PendingEarnings *float64 `json:"pendingEarnings"` IsVip *bool `json:"isVip"` VipExpireDate *string `json:"vipExpireDate"` // "2026-12-31" 或 "2026-12-31 23:59:59" + VipSort *int `json:"vipSort"` // 手动排序,越小越前 + VipRole *string `json:"vipRole"` // 角色:从 vip_roles 选或手动填写 VipName *string `json:"vipName"` VipAvatar *string `json:"vipAvatar"` VipProject *string `json:"vipProject"` @@ -675,6 +677,12 @@ func DBUsersAction(c *gin.Context) { } if body.IsVip != nil { updates["is_vip"] = *body.IsVip + if *body.IsVip { + now := time.Now() + updates["vip_activated_at"] = now // 手动设置时与付款一致:按时间排序,最新在前 + } else { + updates["vip_activated_at"] = nil + } } if body.VipExpireDate != nil { if *body.VipExpireDate == "" { @@ -687,6 +695,17 @@ func DBUsersAction(c *gin.Context) { } } } + if body.VipSort != nil { + updates["vip_sort"] = *body.VipSort + } + if body.VipRole != nil { + s := strings.TrimSpace(*body.VipRole) + if s == "" { + updates["vip_role"] = nil + } else { + updates["vip_role"] = s + } + } if body.VipName != nil { updates["vip_name"] = *body.VipName } @@ -752,18 +771,6 @@ func DBUsersReferrals(c *gin.Context) { } db := database.DB() - // 分销比例(与小程序 /api/miniprogram/earnings、支付回调一致) - distributorShare := 0.9 - var cfg model.SystemConfig - if err := db.Where("config_key = ?", "referral_config").First(&cfg).Error; err == nil { - var config map[string]interface{} - if _ = json.Unmarshal(cfg.ConfigValue, &config); config["distributorShare"] != nil { - if share, ok := config["distributorShare"].(float64); ok { - distributorShare = share / 100 - } - } - } - var bindings []model.ReferralBinding if err := db.Where("referrer_id = ?", userId).Order("binding_date DESC").Find(&bindings).Error; err != nil { c.JSON(http.StatusOK, gin.H{"success": true, "referrals": []interface{}{}, "stats": gin.H{"total": 0, "purchased": 0, "free": 0, "earnings": 0, "pendingEarnings": 0, "withdrawnEarnings": 0}}) @@ -817,12 +824,13 @@ func DBUsersReferrals(c *gin.Context) { }) } - // 累计收益、待提现:与小程序 MyEarnings 一致,从订单+提现表实时计算 - var orderSum struct{ Total float64 } - db.Model(&model.Order{}).Select("COALESCE(SUM(amount), 0) as total"). - Where("referrer_id = ? AND status = ?", userId, "paid"). - Scan(&orderSum) - earningsE := orderSum.Total * distributorShare + // 累计收益、待提现:与小程序 MyEarnings 一致,从订单逐条 computeOrderCommission 求和 + var refOrders []model.Order + db.Where("referrer_id = ? AND status = ?", userId, "paid").Find(&refOrders) + earningsE := 0.0 + for i := range refOrders { + earningsE += computeOrderCommission(db, &refOrders[i], nil) + } var withdrawnSum struct{ Total float64 } db.Model(&model.Withdrawal{}).Select("COALESCE(SUM(amount), 0) as total"). diff --git a/soul-api/internal/handler/miniprogram.go b/soul-api/internal/handler/miniprogram.go index ee6e6491..862e32b2 100644 --- a/soul-api/internal/handler/miniprogram.go +++ b/soul-api/internal/handler/miniprogram.go @@ -457,13 +457,18 @@ func MiniprogramPayNotify(c *gin.Context) { db.Model(&model.User{}).Where("id = ?", buyerUserID).Update("has_full_book", true) fmt.Printf("[PayNotify] 用户已购全书: %s\n", buyerUserID) } else if attach.ProductType == "vip" { - // VIP 支付成功:更新 users.is_vip、vip_expire_date(与 next-project 一致) + // VIP 支付成功:更新 users.is_vip、vip_expire_date、vip_activated_at(排序:后付款在前) expireDate := time.Now().AddDate(0, 0, 365) + vipActivatedAt := time.Now() + if order.PayTime != nil { + vipActivatedAt = *order.PayTime + } db.Model(&model.User{}).Where("id = ?", buyerUserID).Updates(map[string]interface{}{ - "is_vip": true, - "vip_expire_date": expireDate, + "is_vip": true, + "vip_expire_date": expireDate, + "vip_activated_at": vipActivatedAt, }) - fmt.Printf("[VIP] 设置方式=支付设置, userId=%s, orderSn=%s, 过期日=%s\n", buyerUserID, orderSn, expireDate.Format("2006-01-02")) + fmt.Printf("[VIP] 设置方式=支付设置, userId=%s, orderSn=%s, 过期日=%s, activatedAt=%s\n", buyerUserID, orderSn, expireDate.Format("2006-01-02"), vipActivatedAt.Format("2006-01-02 15:04:05")) } else if attach.ProductType == "match" { fmt.Printf("[PayNotify] 用户购买匹配次数: %s,订单 %s\n", buyerUserID, orderSn) } else if attach.ProductType == "section" && attach.ProductID != "" { @@ -505,33 +510,8 @@ func MiniprogramPayNotify(c *gin.Context) { io.Copy(c.Writer, resp.Body) } -// 处理分销佣金 -// amount 为实付金额(若有好友优惠则已打折);order 用于判断是否有推荐人从而反推原价 +// 处理分销佣金(会员订单 20%/10%,内容订单 90%) func processReferralCommission(db *gorm.DB, buyerUserID string, amount float64, orderSn string, order *model.Order) { - // 获取分成配置,默认 90%;好友优惠用于反推原价(佣金按原价计算) - distributorShare := 0.9 - userDiscount := 0.0 - var cfg model.SystemConfig - if err := db.Where("config_key = ?", "referral_config").First(&cfg).Error; err == nil { - var config map[string]interface{} - if err := json.Unmarshal(cfg.ConfigValue, &config); err == nil { - if share, ok := config["distributorShare"].(float64); ok { - distributorShare = share / 100 - } - if disc, ok := config["userDiscount"].(float64); ok { - userDiscount = disc / 100 - } - } - } - // 佣金按原价计算:若有推荐人则实付已打折,反推原价 = amount / (1 - userDiscount) - commissionBase := amount - if order != nil && userDiscount > 0 && (order.ReferrerID != nil && *order.ReferrerID != "" || order.ReferralCode != nil && *order.ReferralCode != "") { - if (1 - userDiscount) > 0 { - commissionBase = amount / (1 - userDiscount) - } - } - - // 查找有效推广绑定 type Binding struct { ID int `gorm:"column:id"` ReferrerID string `gorm:"column:referrer_id"` @@ -539,7 +519,6 @@ func processReferralCommission(db *gorm.DB, buyerUserID string, amount float64, PurchaseCount int `gorm:"column:purchase_count"` TotalCommission float64 `gorm:"column:total_commission"` } - var binding Binding err := db.Raw(` SELECT id, referrer_id, expiry_date, purchase_count, total_commission @@ -548,31 +527,35 @@ func processReferralCommission(db *gorm.DB, buyerUserID string, amount float64, ORDER BY binding_date DESC LIMIT 1 `, buyerUserID).Scan(&binding).Error - if err != nil { fmt.Printf("[PayNotify] 用户无有效推广绑定,跳过分佣: %s\n", buyerUserID) return } - - // 检查是否过期 if time.Now().After(binding.ExpiryDate) { fmt.Printf("[PayNotify] 绑定已过期,跳过分佣: %s\n", buyerUserID) return } - - // 计算佣金(按原价) - commission := commissionBase * distributorShare + // 确保 order 有 referrer_id(补记订单可能缺失) + if order != nil && (order.ReferrerID == nil || *order.ReferrerID == "") { + order.ReferrerID = &binding.ReferrerID + db.Model(order).Update("referrer_id", binding.ReferrerID) + } + // 构建用于计算的 order(若为 nil 则用 binding 信息) + calcOrder := order + if calcOrder == nil { + calcOrder = &model.Order{Amount: amount, ProductType: "unknown", ReferrerID: &binding.ReferrerID} + } + commission := computeOrderCommission(db, calcOrder, nil) + if commission <= 0 { + fmt.Printf("[PayNotify] 佣金为 0,跳过分佣: orderSn=%s\n", orderSn) + return + } newPurchaseCount := binding.PurchaseCount + 1 newTotalCommission := binding.TotalCommission + commission - - fmt.Printf("[PayNotify] 处理分佣: referrerId=%s, amount=%.2f, commission=%.2f, shareRate=%.0f%%\n", - binding.ReferrerID, amount, commission, distributorShare*100) - - // 更新推广者的待结算收益 + fmt.Printf("[PayNotify] 处理分佣: referrerId=%s, amount=%.2f, commission=%.2f\n", + binding.ReferrerID, amount, commission) db.Model(&model.User{}).Where("id = ?", binding.ReferrerID). Update("pending_earnings", db.Raw("pending_earnings + ?", commission)) - - // 更新绑定记录(COALESCE 避免 total_commission 为 NULL 时 NULL+?=NULL) db.Exec(` UPDATE referral_bindings SET last_purchase_date = NOW(), @@ -580,7 +563,6 @@ func processReferralCommission(db *gorm.DB, buyerUserID string, amount float64, total_commission = COALESCE(total_commission, 0) + ? WHERE id = ? `, commission, binding.ID) - fmt.Printf("[PayNotify] 分佣完成: 推广者 %s 获得 %.2f 元(第 %d 次购买,累计 %.2f 元)\n", binding.ReferrerID, commission, newPurchaseCount, newTotalCommission) } diff --git a/soul-api/internal/handler/orders.go b/soul-api/internal/handler/orders.go index 00b7e6db..ac8acc95 100644 --- a/soul-api/internal/handler/orders.go +++ b/soul-api/internal/handler/orders.go @@ -85,18 +85,6 @@ func OrdersList(c *gin.Context) { return } - // 分销比例(与支付回调一致) - distributorShare := 0.9 - var cfg model.SystemConfig - if err := db.Where("config_key = ?", "referral_config").First(&cfg).Error; err == nil { - var config map[string]interface{} - if _ = json.Unmarshal(cfg.ConfigValue, &config); config["distributorShare"] != nil { - if share, ok := config["distributorShare"].(float64); ok { - distributorShare = share / 100 - } - } - } - // 收集订单中的 user_id、referrer_id,查用户信息 userIDs := make(map[string]bool) for _, o := range orders { @@ -150,10 +138,14 @@ func OrdersList(c *gin.Context) { m["referrerCode"] = getStr(u.ReferralCode) } } - // 分销佣金:仅对已支付且存在推荐人的订单,按配置比例计算(与支付回调口径一致) + // 分销佣金:仅对已支付且存在推荐人的订单,按 computeOrderCommission(会员 20%/10%,内容 90%) status := getStr(o.Status) if status == "paid" && o.ReferrerID != nil && *o.ReferrerID != "" { - m["referrerEarnings"] = o.Amount * distributorShare + var refUser *model.User + if u := userMap[*o.ReferrerID]; u != nil { + refUser = u + } + m["referrerEarnings"] = computeOrderCommission(db, &o, refUser) } else { m["referrerEarnings"] = nil } diff --git a/soul-api/internal/handler/referral.go b/soul-api/internal/handler/referral.go index 12bc8652..38adb087 100644 --- a/soul-api/internal/handler/referral.go +++ b/soul-api/internal/handler/referral.go @@ -212,20 +212,16 @@ func ReferralData(c *gin.Context) { ).Count(&expiredBindings) // 3. 付款统计 - var paidOrders []struct { - Amount float64 - UserID string - } - db.Model(&model.Order{}). - Select("amount, user_id"). - Where("referrer_id = ? AND status = 'paid'", userId). - Find(&paidOrders) + var paidOrders []model.Order + db.Where("referrer_id = ? AND status = ?", userId, "paid").Find(&paidOrders) totalAmount := 0.0 + totalCommission := 0.0 uniqueUsers := make(map[string]bool) - for _, order := range paidOrders { - totalAmount += order.Amount - uniqueUsers[order.UserID] = true + for i := range paidOrders { + totalAmount += paidOrders[i].Amount + totalCommission += computeOrderCommission(db, &paidOrders[i], nil) + uniqueUsers[paidOrders[i].UserID] = true } uniquePaidCount := len(uniqueUsers) @@ -344,11 +340,12 @@ func ReferralData(c *gin.Context) { Find(&earningsDetailsList) earningsDetails := []gin.H{} - for _, e := range earningsDetailsList { + for i := range earningsDetailsList { + e := &earningsDetailsList[i] var buyer model.User db.Where("id = ?", e.UserID).First(&buyer) - commission := e.Amount * distributorShare + commission := computeOrderCommission(db, e, nil) earningsDetails = append(earningsDetails, gin.H{ "id": e.ID, "orderSn": e.OrderSN, @@ -363,9 +360,8 @@ func ReferralData(c *gin.Context) { }) } - // 计算收益 - totalCommission := totalAmount * distributorShare - estimatedEarnings := totalAmount * distributorShare + // 计算收益(totalCommission 已按订单逐条计算) + estimatedEarnings := totalCommission availableEarnings := totalCommission - withdrawnFromTable - pendingWithdrawAmount if availableEarnings < 0 { availableEarnings = 0 @@ -442,31 +438,16 @@ func MyEarnings(c *gin.Context) { return } db := database.DB() - distributorShare := 0.9 - var cfg model.SystemConfig - if err := db.Where("config_key = ?", "referral_config").First(&cfg).Error; err == nil { - var config map[string]interface{} - if _ = json.Unmarshal(cfg.ConfigValue, &config); config["distributorShare"] != nil { - if share, ok := config["distributorShare"].(float64); ok { - distributorShare = share / 100 - } - } - } var user model.User if err := db.Where("id = ?", userId).First(&user).Error; err != nil { c.JSON(http.StatusNotFound, gin.H{"success": false, "error": "用户不存在"}) return } - var paidOrders []struct { - Amount float64 - } - db.Model(&model.Order{}). - Select("amount"). - Where("referrer_id = ? AND status = 'paid'", userId). - Find(&paidOrders) - totalAmount := 0.0 - for _, o := range paidOrders { - totalAmount += o.Amount + var paidOrders []model.Order + db.Where("referrer_id = ? AND status = ?", userId, "paid").Find(&paidOrders) + totalCommission := 0.0 + for i := range paidOrders { + totalCommission += computeOrderCommission(db, &paidOrders[i], nil) } var pendingWithdraw struct{ Total float64 } db.Model(&model.Withdrawal{}). @@ -478,7 +459,6 @@ func MyEarnings(c *gin.Context) { Select("COALESCE(SUM(amount), 0) as total"). Where("user_id = ? AND status = ?", userId, "success"). Scan(&successWithdraw) - totalCommission := totalAmount * distributorShare pendingWithdrawAmount := pendingWithdraw.Total withdrawnFromTable := successWithdraw.Total availableEarnings := totalCommission - withdrawnFromTable - pendingWithdrawAmount diff --git a/soul-api/internal/handler/referral_commission.go b/soul-api/internal/handler/referral_commission.go new file mode 100644 index 00000000..7394e830 --- /dev/null +++ b/soul-api/internal/handler/referral_commission.go @@ -0,0 +1,69 @@ +package handler + +import ( + "encoding/json" + "time" + + "soul-api/internal/model" + + "gorm.io/gorm" +) + +// computeOrderCommission 按订单计算应付给推广者的佣金 +// 会员订单:推广者会员 20%、非会员 10%;内容订单:90%(好友优惠 5% 仅针对内容) +// order: 已支付订单,需有 product_type、amount、referrer_id +// referrerUser: 推广者用户信息,用于判断 is_vip(可为 nil,会查库) +func computeOrderCommission(db *gorm.DB, order *model.Order, referrerUser *model.User) float64 { + if order == nil || order.ReferrerID == nil || *order.ReferrerID == "" { + return 0 + } + // 读取推广配置 + distributorShare := 0.9 + userDiscount := 0.0 + vipOrderShareVip := 20.0 + vipOrderShareNonVip := 10.0 + var cfg model.SystemConfig + if err := db.Where("config_key = ?", "referral_config").First(&cfg).Error; err == nil { + var config map[string]interface{} + if err := json.Unmarshal(cfg.ConfigValue, &config); err == nil { + if share, ok := config["distributorShare"].(float64); ok { + distributorShare = share / 100 + } + if disc, ok := config["userDiscount"].(float64); ok { + userDiscount = disc / 100 + } + if v, ok := config["vipOrderShareVip"].(float64); ok { + vipOrderShareVip = v / 100 + } + if v, ok := config["vipOrderShareNonVip"].(float64); ok { + vipOrderShareNonVip = v / 100 + } + } + } + // 会员订单:无好友优惠,按推广者是否会员分 20%/10% + if order.ProductType == "vip" { + base := order.Amount + var referrer model.User + if referrerUser != nil { + referrer = *referrerUser + } else if err := db.Where("id = ?", *order.ReferrerID).First(&referrer).Error; err != nil { + return 0 + } + isVip := referrer.IsVip != nil && *referrer.IsVip + if referrer.VipExpireDate != nil && referrer.VipExpireDate.Before(time.Now()) { + isVip = false + } + if isVip { + return base * vipOrderShareVip + } + return base * vipOrderShareNonVip + } + // 内容订单:若有推荐人且 userDiscount>0,反推原价;否则按实付 + commissionBase := order.Amount + if userDiscount > 0 && (order.ReferrerID != nil && *order.ReferrerID != "" || (order.ReferralCode != nil && *order.ReferralCode != "")) { + if (1 - userDiscount) > 0 { + commissionBase = order.Amount / (1 - userDiscount) + } + } + return commissionBase * distributorShare +} diff --git a/soul-api/internal/handler/vip.go b/soul-api/internal/handler/vip.go index 4515af16..b5a4d64a 100644 --- a/soul-api/internal/handler/vip.go +++ b/soul-api/internal/handler/vip.go @@ -255,12 +255,12 @@ func VipMembers(c *gin.Context) { return } - // 列表:优先 users 表(is_vip=1 且 vip_expire_date>NOW) + // 列表:优先 users 表(is_vip=1 且 vip_expire_date>NOW),排序:vip_sort 优先(小在前),否则 vip_activated_at DESC var users []model.User err := db.Table("users"). - Select("id", "nickname", "avatar", "vip_name", "vip_project", "vip_avatar", "vip_bio"). + Select("id", "nickname", "avatar", "vip_name", "vip_role", "vip_project", "vip_avatar", "vip_bio", "vip_activated_at", "vip_sort"). Where("is_vip = 1 AND vip_expire_date > ?", time.Now()). - Order("vip_expire_date DESC"). + Order("COALESCE(vip_sort, 999999) ASC, COALESCE(vip_activated_at, vip_expire_date) DESC"). Limit(limit). Find(&users).Error @@ -320,12 +320,17 @@ func formatVipMember(u *model.User, isVip bool) gin.H { if contact == "" && u.WechatID != nil { contact = *u.WechatID } + vipRole := "" + if u.VipRole != nil { + vipRole = *u.VipRole + } return gin.H{ "id": u.ID, "name": name, "nickname": name, "avatar": avatar, "vip_name": name, + "vip_role": vipRole, "vip_avatar": avatar, "vip_project": project, "vip_contact": contact, diff --git a/soul-api/internal/handler/vip_roles.go b/soul-api/internal/handler/vip_roles.go new file mode 100644 index 00000000..1d9c3d16 --- /dev/null +++ b/soul-api/internal/handler/vip_roles.go @@ -0,0 +1,90 @@ +package handler + +import ( + "net/http" + + "soul-api/internal/database" + "soul-api/internal/model" + + "github.com/gin-gonic/gin" +) + +// DBVipRolesList GET /api/db/vip-roles 角色列表(管理端 Set VIP 下拉用) +func DBVipRolesList(c *gin.Context) { + db := database.DB() + var roles []model.VipRole + if err := db.Order("sort ASC, id ASC").Find(&roles).Error; err != nil { + c.JSON(http.StatusOK, gin.H{"success": false, "error": err.Error()}) + return + } + c.JSON(http.StatusOK, gin.H{"success": true, "data": roles}) +} + +// DBVipRolesAction POST /api/db/vip-roles 新增角色;PUT 更新;DELETE 删除 +func DBVipRolesAction(c *gin.Context) { + db := database.DB() + method := c.Request.Method + + if method == "POST" { + var body struct { + Name string `json:"name" binding:"required"` + Sort int `json:"sort"` + } + if err := c.ShouldBindJSON(&body); err != nil { + c.JSON(http.StatusOK, gin.H{"success": false, "error": "name 不能为空"}) + return + } + role := model.VipRole{Name: body.Name, Sort: body.Sort} + if err := db.Create(&role).Error; err != nil { + c.JSON(http.StatusOK, gin.H{"success": false, "error": err.Error()}) + return + } + c.JSON(http.StatusOK, gin.H{"success": true, "data": role}) + return + } + + if method == "PUT" { + var body struct { + ID int `json:"id" binding:"required"` + Name *string `json:"name"` + Sort *int `json:"sort"` + } + if err := c.ShouldBindJSON(&body); err != nil { + c.JSON(http.StatusOK, gin.H{"success": false, "error": "id 不能为空"}) + return + } + updates := map[string]interface{}{} + if body.Name != nil { + updates["name"] = *body.Name + } + if body.Sort != nil { + updates["sort"] = *body.Sort + } + if len(updates) == 0 { + c.JSON(http.StatusOK, gin.H{"success": true, "message": "没有需要更新的字段"}) + return + } + if err := db.Model(&model.VipRole{}).Where("id = ?", body.ID).Updates(updates).Error; err != nil { + c.JSON(http.StatusOK, gin.H{"success": false, "error": err.Error()}) + return + } + c.JSON(http.StatusOK, gin.H{"success": true, "message": "更新成功"}) + return + } + + if method == "DELETE" { + id := c.Query("id") + if id == "" { + c.JSON(http.StatusOK, gin.H{"success": false, "error": "id 不能为空"}) + return + } + if err := db.Where("id = ?", id).Delete(&model.VipRole{}).Error; err != nil { + c.JSON(http.StatusOK, gin.H{"success": false, "error": err.Error()}) + return + } + c.JSON(http.StatusOK, gin.H{"success": true, "message": "删除成功"}) + return + } + + c.JSON(http.StatusOK, gin.H{"success": false, "error": "不支持的请求方法"}) +} diff --git a/soul-api/internal/handler/withdraw.go b/soul-api/internal/handler/withdraw.go index 5b40ee96..0f50c05a 100644 --- a/soul-api/internal/handler/withdraw.go +++ b/soul-api/internal/handler/withdraw.go @@ -16,26 +16,23 @@ import ( ) // computeAvailableWithdraw 与小程序 / referral 页可提现逻辑一致:可提现 = 累计佣金 - 已提现 - 待审核 -// 用于 referral/data 展示与 withdraw 接口二次查库校验(不信任前端传参) +// 佣金按订单逐条 computeOrderCommission 求和(会员订单 20%/10%,内容订单 90%) func computeAvailableWithdraw(db *gorm.DB, userID string) (available, totalCommission, withdrawn, pending float64, minAmount float64) { - distributorShare := 0.9 minAmount = 10 var cfg model.SystemConfig if err := db.Where("config_key = ?", "referral_config").First(&cfg).Error; err == nil { var config map[string]interface{} if _ = json.Unmarshal(cfg.ConfigValue, &config); config != nil { - if share, ok := config["distributorShare"].(float64); ok { - distributorShare = share / 100 - } if m, ok := config["minWithdrawAmount"].(float64); ok { minAmount = m } } } - var sumOrder struct{ Total float64 } - db.Model(&model.Order{}).Where("referrer_id = ? AND status = ?", userID, "paid"). - Select("COALESCE(SUM(amount), 0) as total").Scan(&sumOrder) - totalCommission = sumOrder.Total * distributorShare + var orders []model.Order + db.Where("referrer_id = ? AND status = ?", userID, "paid").Find(&orders) + for i := range orders { + totalCommission += computeOrderCommission(db, &orders[i], nil) + } var w struct{ Total float64 } db.Model(&model.Withdrawal{}).Where("user_id = ? AND status = ?", userID, "success"). Select("COALESCE(SUM(amount), 0)").Scan(&w) diff --git a/soul-api/internal/model/user.go b/soul-api/internal/model/user.go index 6bb4bdc3..a249ac65 100644 --- a/soul-api/internal/model/user.go +++ b/soul-api/internal/model/user.go @@ -24,9 +24,12 @@ type User struct { Source *string `gorm:"column:source;size:50" json:"source,omitempty"` // VIP 相关(与 next-project 线上 users 表一致,支持手动设置;管理端需读写) - IsVip *bool `gorm:"column:is_vip" json:"isVip,omitempty"` - VipExpireDate *time.Time `gorm:"column:vip_expire_date" json:"vipExpireDate,omitempty"` - VipName *string `gorm:"column:vip_name;size:100" json:"vipName,omitempty"` + IsVip *bool `gorm:"column:is_vip" json:"isVip,omitempty"` + VipExpireDate *time.Time `gorm:"column:vip_expire_date" json:"vipExpireDate,omitempty"` + VipActivatedAt *time.Time `gorm:"column:vip_activated_at" json:"vipActivatedAt,omitempty"` // 成为 VIP 时间,排序用:付款=pay_time,手动=now + VipSort *int `gorm:"column:vip_sort" json:"vipSort,omitempty"` // 手动排序,越小越前,NULL 按 vip_activated_at + VipRole *string `gorm:"column:vip_role;size:50" json:"vipRole,omitempty"` // 角色:从 vip_roles 选或手动填写 + VipName *string `gorm:"column:vip_name;size:100" json:"vipName,omitempty"` VipAvatar *string `gorm:"column:vip_avatar;size:500" json:"vipAvatar,omitempty"` VipProject *string `gorm:"column:vip_project;size:200" json:"vipProject,omitempty"` VipContact *string `gorm:"column:vip_contact;size:100" json:"vipContact,omitempty"` diff --git a/soul-api/internal/model/vip_role.go b/soul-api/internal/model/vip_role.go new file mode 100644 index 00000000..8f253d02 --- /dev/null +++ b/soul-api/internal/model/vip_role.go @@ -0,0 +1,14 @@ +package model + +import "time" + +// VipRole 超级个体固定角色,用于 Set VIP 时下拉选择 +type VipRole struct { + ID int `gorm:"column:id;primaryKey;autoIncrement" json:"id"` + Name string `gorm:"column:name;size:50;not null" json:"name"` + Sort int `gorm:"column:sort;default:0" json:"sort"` // 下拉展示顺序,越小越前 + CreatedAt time.Time `gorm:"column:created_at" json:"createdAt"` + UpdatedAt time.Time `gorm:"column:updated_at" json:"updatedAt"` +} + +func (VipRole) TableName() string { return "vip_roles" } diff --git a/soul-api/internal/router/router.go b/soul-api/internal/router/router.go index 272a6f6a..0f7c64ee 100644 --- a/soul-api/internal/router/router.go +++ b/soul-api/internal/router/router.go @@ -130,6 +130,10 @@ func Setup(cfg *config.Config) *gin.Engine { db.PUT("/users", handler.DBUsersAction) db.DELETE("/users", handler.DBUsersDelete) db.GET("/users/referrals", handler.DBUsersReferrals) + db.GET("/vip-roles", handler.DBVipRolesList) + db.POST("/vip-roles", handler.DBVipRolesAction) + db.PUT("/vip-roles", handler.DBVipRolesAction) + db.DELETE("/vip-roles", handler.DBVipRolesAction) db.GET("/match-records", handler.DBMatchRecordsList) } diff --git a/soul-api/scripts/add-vip-activated-at.sql b/soul-api/scripts/add-vip-activated-at.sql new file mode 100644 index 00000000..ee36d60f --- /dev/null +++ b/soul-api/scripts/add-vip-activated-at.sql @@ -0,0 +1,13 @@ +-- 新增 users.vip_activated_at:成为 VIP 时间,用于排序(后付款/后设置在前) +-- 执行:mysql -u user -p database < add-vip-activated-at.sql +-- 若列已存在会报错,可忽略 + +ALTER TABLE users ADD COLUMN vip_activated_at DATETIME NULL COMMENT '成为VIP时间,付款=pay_time,手动=now,排序用'; + +-- 可选:为已有 VIP 用户回填 vip_activated_at(取该用户最近一次 vip 订单的 pay_time) +-- UPDATE users u +-- SET u.vip_activated_at = ( +-- SELECT MAX(o.pay_time) FROM orders o +-- WHERE o.user_id = u.id AND o.product_type = 'vip' AND o.status = 'paid' +-- ) +-- WHERE u.is_vip = 1 AND u.vip_activated_at IS NULL; diff --git a/soul-api/scripts/add-vip-roles-and-fields.sql b/soul-api/scripts/add-vip-roles-and-fields.sql new file mode 100644 index 00000000..adf5e0f1 --- /dev/null +++ b/soul-api/scripts/add-vip-roles-and-fields.sql @@ -0,0 +1,25 @@ +-- 1. 新建 vip_roles 表 +CREATE TABLE IF NOT EXISTS vip_roles ( + id INT AUTO_INCREMENT PRIMARY KEY, + name VARCHAR(50) NOT NULL UNIQUE COMMENT '角色名称', + sort INT DEFAULT 0 COMMENT '下拉展示顺序,越小越前', + created_at DATETIME DEFAULT CURRENT_TIMESTAMP, + updated_at DATETIME DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP +) COMMENT '超级个体固定角色'; + +-- 2. 插入默认角色(UNIQUE name 防重复) +INSERT IGNORE INTO vip_roles (name, sort) VALUES + ('创始人', 1), + ('投资人', 2), + ('产品经理', 3), + ('技术负责人', 4), + ('运营总监', 5), + ('销售总监', 6), + ('市场总监', 7), + ('合伙人', 8), + ('顾问', 9), + ('品牌主理人', 10); + +-- 3. users 表新增 vip_sort、vip_role +ALTER TABLE users ADD COLUMN vip_sort INT NULL COMMENT '手动排序,越小越前'; +ALTER TABLE users ADD COLUMN vip_role VARCHAR(50) NULL COMMENT '角色:从 vip_roles 选或手动填写'; diff --git a/临时需求池/首页页面/code.html b/临时需求池/首页页面/code.html deleted file mode 100644 index 456b40f6..00000000 --- a/临时需求池/首页页面/code.html +++ /dev/null @@ -1,263 +0,0 @@ - - - -Clean Home with Contact Author Link - - - - - - - - -
-
-
-
- S -
-
-
-

Soul创业派对

- -
-

来自派对房的真实故事

-
-
-
- 73章 -
-
-
-
- -search - - -
-
-
-
-
-最新更新 -

流量红利的终局

-

第五篇 真实的社会

- - 开始阅读 arrow_forward - -
-
-
-
-
-

我的阅读

-2/73章 -
-
-
-
-
-
-
2
-
已读
-
-
-
71
-
待读
-
-
-
5
-
篇章
-
-
-
11
-
章节
-
-
-
-
-
-
-

超级个体

-查看全部 chevron_right -
-
-
-
-person -
-微信用户RBEY -
-
-
-person -
-微信用户HciA -
-
-
- 版 -
-好版登小程序顾问 -
-
-
-Profile of user -
-乘风 -
-
-
-
-
-

精选推荐

-查看全部 chevron_right -
-
-
-
-
-1.1 -热门 -
-

荷包:电动车出租的被动收入模式

-

第一篇 真实的人

-
-chevron_right -
-
-
-
-1.2 -推荐 -
-

老墨:资源整合高手的社交方法

-

第一篇 真实的人

-
-chevron_right -
-
-
-
-9.17 -精选 -
-

第104场 | 婚恋、AI客服与一个微信

-

第四篇 真实的赚钱

-
-chevron_right -
-
-
-
-
-

最新新增

-+10 -
-
-
-
-
-
-
-NEW -

流量红利的终局

-
-
-¥1 -2/24 -
-
-

深入分析当前市场的流量趋势与未来走向...

-
-
-
-
-
-
-
-NEW -

9.18 第105场 | 创业社群

-
-
-¥1 -2/24 -
-
-

社群运营的核心逻辑与直播实战技巧分享...

-
-
-
-
-
-
- - -
- -找伙伴 -
- -
-
-
-
- - \ No newline at end of file diff --git a/临时需求池/首页页面/screen.png b/临时需求池/首页页面/screen.png deleted file mode 100644 index 71342cf2..00000000 Binary files a/临时需求池/首页页面/screen.png and /dev/null differ diff --git a/开发文档/10、项目管理/运营与变更.md b/开发文档/10、项目管理/运营与变更.md index 2698d908..4512b1b4 100644 --- a/开发文档/10、项目管理/运营与变更.md +++ b/开发文档/10、项目管理/运营与变更.md @@ -109,10 +109,35 @@ VIP 接口、章节推荐逻辑、数据库依赖 ## 分润规则 - **内容订单**:好友优惠 5%(仅针对文章/内容,会员订单无优惠);推广者 90% -- **会员订单**:推广者会员 20%、非会员 10%(待实现,技术分析见 `临时需求池/分润需求-技术分析.md`) +- **会员订单**:推广者会员 20%、非会员 10%(**已实现**,computeOrderCommission;推广设置页可配置 vipOrderShareVip、vipOrderShareNonVip) ## 需求池 - **需求分析**:`临时需求池/需求分析-产品经理视角.md` - **分润技术分析**:`临时需求池/分润需求-技术分析.md` - **搁置**:打包购买引导、存客宝对接 + +--- + +## VIP 升级(2026-02-26 小橙同步) + +### 功能变更 + +| 项目 | 说明 | +|------|------| +| **设置入口** | 用户列表每行新增「设置 VIP」按钮,独立 SetVipModal;UserDetailModal 移除 VIP 区块 | +| **排序** | `vip_activated_at`:付款=订单 pay_time,手动=now;`vip_sort` 手动排序;VipMembers 按「vip_sort 优先,否则 vip_activated_at DESC」 | +| **角色** | 新增 `vip_roles` 表;`users.vip_role` 存角色名;SetVipModal 下拉可选 +「其他」手动填写 | +| **管理端** | 新增「VIP 角色」页 `/vip-roles`,CRUD 预设角色 | + +### 数据迁移 + +- `开发文档/8、部署/VIP功能-数据库迁移说明.md` +- 脚本:`soul-api/scripts/add-vip-activated-at.sql`、`add-vip-roles-and-fields.sql` + +### Skills 升级 + +- SKILL-MySQL直接操作:§8 迁移脚本最佳实践 +- SKILL-API开发:§3.2 新增表/字段完整流程 +- SKILL-管理端开发:§4.1 表单弹窗与「可选择+可手动填写」 +- SKILL-变更关联检查:VIP/超级个体三端分工表 diff --git a/开发文档/1、需求/需求汇总.md b/开发文档/1、需求/需求汇总.md index 184a196c..190e197c 100644 --- a/开发文档/1、需求/需求汇总.md +++ b/开发文档/1、需求/需求汇总.md @@ -33,4 +33,7 @@ IP 设定、风格、输出规范(见原卡若角色设定)。 | 2026-02 | 找伙伴匹配后台用户库、资源对接两步(能帮什么/需要什么) | 已有 | match 页与后端 /api/match | | 2026-02 | VIP 手动设置 + 支付设置 + 日志(区分来源、订单号) | 已完成 | 用户详情弹窗、支付回调、db/miniprogram handler | | 2026-02 | 管理端设置 VIP 必填到期日 | 已完成 | 前后端校验 | -| 2026-02 | 会员订单分润差异化(会员 20% / 非会员 10%) | 待实现 | 技术分析见 临时需求池/分润需求-技术分析.md | +| 2026-02 | 会员订单分润差异化(会员 20% / 非会员 10%) | 已完成 | 技术分析见 临时需求池/分润需求-技术分析.md;computeOrderCommission;推广设置页增加会员分润配置 | +| 2026-02 | VIP 设置入口拆分:用户列表「设置 VIP」按钮 + 独立弹窗 | 已完成 | UserDetailModal 移除 VIP 区块;SetVipModal 独立 | +| 2026-02 | VIP 排序:后付款/后设置在前;支持手动排序 | 已完成 | vip_activated_at、vip_sort;VipMembers 排序逻辑 | +| 2026-02 | VIP 角色:可选择 + 可手动填写 | 已完成 | vip_roles 表;VIP 角色管理页;SetVipModal 角色下拉 | diff --git a/开发文档/8、部署/VIP功能-数据库迁移说明.md b/开发文档/8、部署/VIP功能-数据库迁移说明.md new file mode 100644 index 00000000..c27ba77f --- /dev/null +++ b/开发文档/8、部署/VIP功能-数据库迁移说明.md @@ -0,0 +1,44 @@ +# VIP 功能 - 数据库迁移说明 + +> 2026-02-26 小橙同步。VIP 排序、角色、设置入口升级。 + +--- + +## 一、迁移脚本 + +| 脚本 | 说明 | +|------|------| +| `soul-api/scripts/add-vip-activated-at.sql` | 新增 `users.vip_activated_at`(成为 VIP 时间,排序用) | +| `soul-api/scripts/add-vip-roles-and-fields.sql` | 新建 `vip_roles` 表;新增 `users.vip_sort`、`users.vip_role` | + +--- + +## 二、执行顺序 + +```bash +# 1. vip_activated_at(若尚未执行) +mysql -u user -p database < soul-api/scripts/add-vip-activated-at.sql + +# 2. vip_roles 表 + users 新字段 +mysql -u user -p database < soul-api/scripts/add-vip-roles-and-fields.sql +``` + +若 `vip_sort`、`vip_role` 已存在,对应 `ALTER` 会报错,可忽略或单独执行未执行过的语句。 + +--- + +## 三、功能说明 + +| 字段/表 | 用途 | +|---------|------| +| `vip_activated_at` | 成为 VIP 时间:付款=订单 pay_time,手动=设置时 now;排序用(后付款/后设置在前) | +| `vip_sort` | 手动排序,数字越小越靠前;NULL 时按 vip_activated_at | +| `vip_role` | 角色:从 vip_roles 选或手动填写 | +| `vip_roles` | 预设角色表(创始人、投资人、产品经理等),管理端可 CRUD | + +--- + +## 四、管理端入口 + +- **用户列表**:每行「设置 VIP」按钮(Crown 图标)→ SetVipModal +- **VIP 角色**:侧栏「VIP 角色」→ `/vip-roles`,管理预设角色列表 diff --git a/开发文档/8、部署/部署总览.md b/开发文档/8、部署/部署总览.md index 47a4f137..c995c017 100644 --- a/开发文档/8、部署/部署总览.md +++ b/开发文档/8、部署/部署总览.md @@ -18,6 +18,7 @@ | 文档 | 说明 | |------|------| +| [VIP功能-数据库迁移说明](VIP功能-数据库迁移说明.md) | VIP 排序、角色、vip_roles 表迁移(2026-02-26) | | [MCP-MySQL配置说明](MCP-MySQL配置说明.md) | MCP 连接 MySQL | | [Soul-MySQL-MCP配置说明](Soul-MySQL-MCP配置说明.md) | 本项目 MySQL MCP 配置 | | [API接入说明](API接入说明.md) | 外部/小程序接入 API |