diff --git a/.cursor/agent/产品经理/evolution/2026-03-05.md b/.cursor/agent/产品经理/evolution/2026-03-05.md new file mode 100644 index 00000000..52ccd6e1 --- /dev/null +++ b/.cursor/agent/产品经理/evolution/2026-03-05.md @@ -0,0 +1,12 @@ +# 产品经理 经验记录 - 2026-03-05 + +## 分支冲突后功能完整性分析会议 + +- **分支冲突后需优先核对需求文档与实现一致性**:避免「文档在合并中丢失」导致需求与实现脱节。重点核对 `开发文档/1、需求/`、`临时需求池/` 与当前实现是否一致。 +- **重点确认项**:个人资料页、增值版/普通版计价、找伙伴联系方式完善弹窗等近期需求是否按文档落地。 + +## 文章详情 @某人 高亮与一键加好友方案讨论 + +- **需求**:文章中支持 @某人,名称高亮、点击添加好友;编辑侧能插入 @用户并落库(含用户 id)。 +- **验收**:详情页 @ 高亮可点击;点击调起添加好友并提示;管理端插入 @ 后保存再编辑不错位。 +- **待确认**:添加好友接口 path、入参/出参及业务规则(已是好友、重复请求等);开发文档中接口放置位置。 diff --git a/.cursor/agent/产品经理/evolution/索引.md b/.cursor/agent/产品经理/evolution/索引.md index 0853f7d3..fbdc760a 100644 --- a/.cursor/agent/产品经理/evolution/索引.md +++ b/.cursor/agent/产品经理/evolution/索引.md @@ -2,3 +2,5 @@ | 日期 | 摘要 | 文件 | |------|------|------| +| 2026-03-05 | 分支冲突后需求文档与实现一致性核对 | [2026-03-05.md](./2026-03-05.md) | +| 2026-03-05 | 文章详情@某人高亮与一键加好友验收标准与待确认 | [2026-03-05.md](./2026-03-05.md) | diff --git a/.cursor/agent/后端工程师/evolution/2026-03-05.md b/.cursor/agent/后端工程师/evolution/2026-03-05.md new file mode 100644 index 00000000..f747138b --- /dev/null +++ b/.cursor/agent/后端工程师/evolution/2026-03-05.md @@ -0,0 +1,13 @@ +# 后端工程师 经验记录 - 2026-03-05 + +## 分支冲突后功能完整性分析会议 + +- **soul-api 被 gitignore 时**:需在 soul-api 所在位置单独确认 git 状态与合并情况,无法从本仓库直接检查。 +- **重点核对接口**:`/api/miniprogram/orders`(购买记录)、`/api/db/distribution`(分销)是否已实现并挂载到对应路由组。 +- **建议**:对照「三端需求业务对齐」文档逐项核对接口注册与实现;明确 soul-api 的版本管理与合并策略。 + +## 文章详情 @某人 高亮与一键加好友方案讨论 + +- **内容存储**:推荐正文内嵌 @ 标记,格式 `@[昵称](userId)`(或 `{{@userId:昵称}}`),后端只存不解析;章节/文章接口原样返回 content。 +- **添加好友接口**:在 miniprogram 路由组新增,如 `POST /api/miniprogram/friend/add`,入参 `targetUserId`;与存客宝 api_v1 分离,在开发文档中单独说明或 api_v1 新增小节。 +- **数据模型**:无需单独 mention 表,扩展内容表 content 存带 @ 标记字符串即可。 diff --git a/.cursor/agent/后端工程师/evolution/索引.md b/.cursor/agent/后端工程师/evolution/索引.md index d13cc177..a3f19dbe 100644 --- a/.cursor/agent/后端工程师/evolution/索引.md +++ b/.cursor/agent/后端工程师/evolution/索引.md @@ -2,3 +2,5 @@ | 日期 | 摘要 | 文件 | |------|------|------| +| 2026-03-05 | soul-api 合并状态确认;orders、distribution 接口核对 | [2026-03-05.md](./2026-03-05.md) | +| 2026-03-05 | 文章详情@某人:content 内嵌 @ 标记、miniprogram 添加好友接口 | [2026-03-05.md](./2026-03-05.md) | diff --git a/.cursor/agent/团队/evolution/2026-03-05.md b/.cursor/agent/团队/evolution/2026-03-05.md new file mode 100644 index 00000000..dc7dc05b --- /dev/null +++ b/.cursor/agent/团队/evolution/2026-03-05.md @@ -0,0 +1,17 @@ +# 团队 经验记录 - 2026-03-05 + +## 分支冲突后功能完整性分析会议(跨角色共享) + +- **分支冲突后各端需做完整性自查**: + - 产品:核对需求文档与实现一致性 + - 后端:在 soul-api 确认合并状态,核对 orders、distribution 等接口 + - 管理端:全功能自测,记录 404/异常接口 + - 小程序:核心流程自测,确认 orders 接口;修正 app.json 格式 + - 测试:制定「分支合并后回归清单」 +- **待确认**:`完整的` 分支上的提交是否已全部并入 devlop;soul-api 的版本管理与合并策略。 + +## 文章详情 @某人 高亮与一键加好友方案讨论(跨角色共享) + +- **内容格式**:正文内嵌 @ 标记,统一格式 `@[昵称](userId)`(或约定等价格式),后端/管理端/小程序共用。 +- **添加好友接口**:归属 soul-api 的 miniprogram 组,与存客宝 api_v1 分离;path、入参由后端/产品确认后写入开发文档。 +- **分工**:管理端编辑侧插入 @ 并写入 content;小程序解析、高亮、点击调添加好友;后端提供章节 content 与添加好友接口。 diff --git a/.cursor/agent/团队/evolution/索引.md b/.cursor/agent/团队/evolution/索引.md index f1035cf9..72a8adf9 100644 --- a/.cursor/agent/团队/evolution/索引.md +++ b/.cursor/agent/团队/evolution/索引.md @@ -4,3 +4,4 @@ | 日期 | 摘要 | 文件 | |------|------|------| +| 2026-03-05 | 分支冲突后各端完整性自查流程 | [2026-03-05.md](./2026-03-05.md) | diff --git a/.cursor/agent/小程序开发工程师/evolution/2026-03-05.md b/.cursor/agent/小程序开发工程师/evolution/2026-03-05.md new file mode 100644 index 00000000..01269e4d --- /dev/null +++ b/.cursor/agent/小程序开发工程师/evolution/2026-03-05.md @@ -0,0 +1,13 @@ +# 小程序开发工程师 经验记录 - 2026-03-05 + +## 分支冲突后功能完整性分析会议 + +- **app.json 多页面配置**:建议拆行便于维护,避免多页面写在同一行(如第 21 行)。 +- **分支合并后需做核心流程自测**:登录→阅读→购买→提现→找伙伴→个人资料→VIP,确认无白屏、无接口报错。 +- **重点确认**:`/api/miniprogram/orders`(购买记录)是否已实现;`完整的` 分支上的优化(如 5a5f0087 卡片边距)是否已并入 devlop。 + +## 文章详情 @某人 高亮与一键加好友方案讨论 + +- **展示**:阅读页 content 需解析「@ 标记」格式(如 `@[昵称](userId)`),将 @ 片段渲染为高亮可点击 ``,点击调 miniprogram 添加好友接口。 +- **接口**:添加好友接口由后端在 miniprogram 组提供(如 `POST /api/miniprogram/friend/add`),入参 `targetUserId`;不调用 api_v1 存客宝接口。 +- **实现要点**:在现有 contentParagraphs 按行渲染基础上,对每行再做 mention 解析,得到 text/mention 片段数组后 WXML 分支渲染;不改动现有阅读权限、进度、购买逻辑。 diff --git a/.cursor/agent/小程序开发工程师/evolution/索引.md b/.cursor/agent/小程序开发工程师/evolution/索引.md index 6bdf6290..562c1536 100644 --- a/.cursor/agent/小程序开发工程师/evolution/索引.md +++ b/.cursor/agent/小程序开发工程师/evolution/索引.md @@ -4,3 +4,5 @@ |------|------|------| | 2026-02-28 | input 边距口诀、match 资源对接弹窗修正 | [2026-02-28.md](./2026-02-28.md) | | 2026-03-03 | 我的页面卡片区边距优化,16rpx 推荐值 | [2026-03-03.md](./2026-03-03.md) | +| 2026-03-05 | 分支合并后核心流程自测;app.json 拆行;orders 接口确认 | [2026-03-05.md](./2026-03-05.md) | +| 2026-03-05 | 文章详情@某人高亮与一键加好友(解析@、调添加好友接口) | [2026-03-05.md](./2026-03-05.md) | diff --git a/.cursor/agent/开发助理/项目索引/产品.md b/.cursor/agent/开发助理/项目索引/产品.md index fa523aab..307488cf 100644 --- a/.cursor/agent/开发助理/项目索引/产品.md +++ b/.cursor/agent/开发助理/项目索引/产品.md @@ -17,9 +17,11 @@ Soul 创业派对产品定位:面向创业者的社区/工具型小程序。 | 2026-02-26 | 项目索引初始化,.cursor 规则优化完成 | 已完成 | | 2026-02-27 | 开发进度同步会议:汇报进度,待办「资料不解锁」补充、≥3 章弹窗明确 | 已完成 | | 2026-02-28 | stitch_soul 需求评审:内容→会员→导师变现路径,待产品补充正式需求文档 | 待续 | +| 2026-03-05 | 分支冲突后功能完整性分析会议:核对需求文档与实现一致性 | 待续 | +| 2026-03-05 | 文章详情@某人加好友方案讨论:验收标准、添加好友接口 path 待确认 | 待续 | > **格式说明**:每次开发后在此追加一行,日期格式 YYYY-MM-DD,状态用:已完成 / 进行中 / 待续 / 搁置 --- -**最后更新**:2026-02-28 +**最后更新**:2026-03-05 diff --git a/.cursor/agent/开发助理/项目索引/后端.md b/.cursor/agent/开发助理/项目索引/后端.md index f6ebf6d6..fe57a16d 100644 --- a/.cursor/agent/开发助理/项目索引/后端.md +++ b/.cursor/agent/开发助理/项目索引/后端.md @@ -18,9 +18,11 @@ soul-api(Go + Gin + GORM + MySQL)提供三组路由:`/api/miniprogram/*` | 2026-02-27 | 开发进度汇报:computeOrderCommission 会员分润差异化(20%/10%)已实现;vip_roles、vip_activated_at、referral_config 扩展已完成;miniprogram/admin/db 三组路由就绪 | 已完成 | | 2026-02-27 | 开发进度同步会议:进度已同步至开发文档,待办资料完善校验 | 已完成 | | 2026-02-28 | stitch_soul 需求评审:需梳理 chapter/book/vip,设计导师/预约/会员权益模型与接口 | 待续 | +| 2026-03-05 | 分支冲突后功能完整性分析会议:在 soul-api 确认合并状态,核对 orders、distribution 接口 | 待续 | +| 2026-03-05 | 文章详情@某人加好友方案讨论:content 内嵌 @ 标记、miniprogram 添加好友接口 | 待续 | > **格式说明**:每次开发后在此追加一行,日期格式 YYYY-MM-DD,状态用:已完成 / 进行中 / 待续 / 搁置 --- -**最后更新**:2026-02-28 +**最后更新**:2026-03-05 diff --git a/.cursor/agent/开发助理/项目索引/小程序.md b/.cursor/agent/开发助理/项目索引/小程序.md index 59665cf4..81a9c127 100644 --- a/.cursor/agent/开发助理/项目索引/小程序.md +++ b/.cursor/agent/开发助理/项目索引/小程序.md @@ -21,9 +21,11 @@ | 2026-02-28 | stitch_soul 需求评审:首页/目录/导师/会员/资料五类页面,待需求与接口确定后分阶段实现 | 待续 | | 2026-02-28 | 吸收经验:input 边距口诀「外边包 view、内部 width 100%」写入 Skill §6;match 资源对接弹窗已按规范修正 | 已完成 | | 2026-03-03 | 吸收经验:我的页面卡片区边距优化,16rpx 为个人中心类页面推荐值,已升级 SKILL §8 | 已完成 | +| 2026-03-05 | 分支冲突后功能完整性分析会议:修正 app.json 拆行、核心流程自测、确认 orders 接口 | 待续 | +| 2026-03-05 | 文章详情@某人加好友方案讨论:阅读页解析 @、高亮可点击、调添加好友接口 | 待续 | > **格式说明**:每次开发后在此追加一行,日期格式 YYYY-MM-DD,状态用:已完成 / 进行中 / 待续 / 搁置 --- -**最后更新**:2026-03-03 +**最后更新**:2026-03-05 diff --git a/.cursor/agent/开发助理/项目索引/测试.md b/.cursor/agent/开发助理/项目索引/测试.md index d9dc3ff6..5efb68b7 100644 --- a/.cursor/agent/开发助理/项目索引/测试.md +++ b/.cursor/agent/开发助理/项目索引/测试.md @@ -17,7 +17,9 @@ | 2026-02-27 | 测试人员角色与 Skill 初始化 | 已完成 | | 2026-02-27 | 小程序静态审查(API 路径、页面接口、手工验证建议) | 已完成 | | 2026-02-28 | stitch_soul 需求评审:关键场景为阅读/付费/会员/导师预约/资料;待需求确定后补充联调用例 | 待续 | +| 2026-03-05 | 分支冲突后功能完整性分析会议:制定「分支合并后回归清单」 | 待续 | +| 2026-03-05 | 文章详情@某人加好友方案讨论:@ 展示与添加好友用例、联调与回归 | 待续 | --- -**最后更新**:2026-02-28 +**最后更新**:2026-03-05 diff --git a/.cursor/agent/开发助理/项目索引/管理端.md b/.cursor/agent/开发助理/项目索引/管理端.md index 06c8cf75..0b2e284a 100644 --- a/.cursor/agent/开发助理/项目索引/管理端.md +++ b/.cursor/agent/开发助理/项目索引/管理端.md @@ -18,9 +18,11 @@ | 2026-02-27 | 开发进度汇报:内容管理仅 API 按钮、推广中心、SetVipModal、VIP 角色管理、推广设置会员分润配置、VIP 排序等均已落地 | 已完成 | | 2026-02-27 | 开发进度同步会议:进度已同步至运营与变更 | 已完成 | | 2026-02-28 | stitch_soul 需求评审:待后端方案确定后规划章节/导师/会员/预约管理页面 | 待续 | +| 2026-03-05 | 分支冲突后功能完整性分析会议:全功能自测,记录 404/异常接口 | 待续 | +| 2026-03-05 | 文章详情@某人加好友方案讨论:编辑页插入 @用户、保存约定 content 格式 | 待续 | > **格式说明**:每次开发后在此追加一行,日期格式 YYYY-MM-DD,状态用:已完成 / 进行中 / 待续 / 搁置 --- -**最后更新**:2026-02-28 +**最后更新**:2026-03-05 diff --git a/.cursor/agent/管理端开发工程师/evolution/2026-03-05.md b/.cursor/agent/管理端开发工程师/evolution/2026-03-05.md new file mode 100644 index 00000000..8b7d2f68 --- /dev/null +++ b/.cursor/agent/管理端开发工程师/evolution/2026-03-05.md @@ -0,0 +1,12 @@ +# 管理端开发工程师 经验记录 - 2026-03-05 + +## 分支冲突后功能完整性分析会议 + +- **路由与页面结构完整时**:主要风险在接口可用性。全功能自测可快速暴露 404 或异常接口。 +- **重点确认**:`DistributionPage` 调用的 `GET /api/db/distribution` 是否已实现;`OrdersPage` 的订单接口路径是否与 soul-api 一致。 +- **建议**:分支合并后做一次管理端全流程自测(登录→订单→提现→分销→VIP 角色→导师→配置),记录异常接口反馈后端。 + +## 文章详情 @某人 高亮与一键加好友方案讨论 + +- **编辑侧**:文章/章节编辑页增加「插入 @用户」,选择用户后插入到光标位置,保存时写入约定格式 content(如 `@[昵称](userId)`);仅调 `/api/admin/*`、`/api/db/*`。 +- **一致性**:与小程序、后端共用同一 content 格式,避免多套标记;列表/预览可简单高亮或原样显示。 diff --git a/.cursor/agent/管理端开发工程师/evolution/索引.md b/.cursor/agent/管理端开发工程师/evolution/索引.md index 2bab4dc1..4cd0b6f4 100644 --- a/.cursor/agent/管理端开发工程师/evolution/索引.md +++ b/.cursor/agent/管理端开发工程师/evolution/索引.md @@ -2,3 +2,5 @@ | 日期 | 摘要 | 文件 | |------|------|------| +| 2026-03-05 | 分支合并后全功能自测,404/异常接口记录 | [2026-03-05.md](./2026-03-05.md) | +| 2026-03-05 | 文章详情@某人:编辑页插入 @用户、保存约定 content 格式 | [2026-03-05.md](./2026-03-05.md) | diff --git a/.cursor/agent/软件测试/evolution/2026-03-05.md b/.cursor/agent/软件测试/evolution/2026-03-05.md new file mode 100644 index 00000000..2fc43be0 --- /dev/null +++ b/.cursor/agent/软件测试/evolution/2026-03-05.md @@ -0,0 +1,13 @@ +# 软件测试 经验记录 - 2026-03-05 + +## 分支冲突后功能完整性分析会议 + +- **分支合并后应制定「回归清单」**:覆盖三端联调关键路径(登录、VIP、阅读、分销、提现、找伙伴、个人资料、导师、购买记录)。 +- **soul-api 不在仓库时**:需与后端协作确认接口契约,无法在仓库内直接检查。 +- **多分支合并**:`完整的`、`soul-content`、`yongpxu-soul` 等分支合并结果需确认,各端自测 + 测试抽检。 + +## 文章详情 @某人 高亮与一键加好友方案讨论 + +- **用例**:无 @ 行为不变;有 @ 高亮且点击调起添加好友并提示;重复点击、未登录、无权限等边界;管理端插入 @ 后保存再编辑不错位。 +- **联调**:小程序↔章节接口(content 含 @)、小程序↔添加好友接口;管理端↔内容保存与用户列表。 +- **回归**:阅读页进度、购买、分享等不受 @ 功能影响。 diff --git a/.cursor/agent/软件测试/evolution/索引.md b/.cursor/agent/软件测试/evolution/索引.md index 11075bdc..9c1dad54 100644 --- a/.cursor/agent/软件测试/evolution/索引.md +++ b/.cursor/agent/软件测试/evolution/索引.md @@ -2,3 +2,5 @@ | 日期 | 摘要 | 文件 | |------|------|------| +| 2026-03-05 | 分支合并后回归清单制定;三端联调验证 | [2026-03-05.md](./2026-03-05.md) | +| 2026-03-05 | 文章详情@某人:@ 展示与添加好友用例、联调与回归点 | [2026-03-05.md](./2026-03-05.md) | diff --git a/.cursor/meeting/2026-03-05_分支冲突后功能完整性分析.md b/.cursor/meeting/2026-03-05_分支冲突后功能完整性分析.md new file mode 100644 index 00000000..0ffc11cf --- /dev/null +++ b/.cursor/meeting/2026-03-05_分支冲突后功能完整性分析.md @@ -0,0 +1,122 @@ +# 会议纪要 - 2026-03-05 | 分支冲突后功能完整性分析 + +> 本文件由**助理橙子**在会议结束后自动生成。 + +--- + +## 基本信息 + +- **时间**:2026-03-05 +- **议题**:分支冲突后可能有功能缺失,各成员分析自身项目完整性 +- **触发方式**:开个会议 +- **参与角色**:产品经理、后端开发、管理端开发工程师、小程序开发工程师、测试人员 + +--- + +## 各角色发言 + +### 【产品经理】 + +- 需求文档(stitch_soul、个人资料页、文章类型等)已记录,需核对 `开发文档/1、需求/`、`临时需求池/` 与实现是否一致 +- 风险:分支合并后文档可能被覆盖,导致需求与实现脱节 +- 重点确认:个人资料页、增值版/普通版计价、找伙伴联系方式完善弹窗 + +### 【后端开发】 + +- soul-api 被 .gitignore 排除,当前仓库无法直接检查 +- 风险:`/api/miniprogram/orders`、`/api/db/distribution` 等接口是否已实现需在 soul-api 所在位置核对 +- 建议:在 soul-api 仓库/目录确认合并状态,对照「三端需求业务对齐」逐项核对接口 + +### 【管理端开发工程师】 + +- 21 个路由与页面一一对应,无缺失;仅调用 `/api/admin/*`、`/api/db/*`,符合边界 +- 风险:`DistributionPage` 的 `GET /api/db/distribution` 若未实现会 404 +- 建议:全功能自测,记录 404 或异常接口反馈后端 + +### 【小程序开发工程师】 + +- 21 个页面均有对应目录和文件,无缺失;全部 `/api/miniprogram/*`,符合边界 +- 小问题:app.json 第 21 行多页面写同一行,建议拆行 +- 风险:`/api/miniprogram/orders` 是否已实现;`完整的` 分支上的优化(如 5a5f0087 卡片边距)是否已并入 devlop +- 建议:核心流程自测(登录→阅读→购买→提现→找伙伴→个人资料→VIP) + +### 【测试人员】 + +- 三端联调需逐项验证;回归清单应覆盖登录、VIP、阅读、分销、提现、找伙伴、个人资料、导师、购买记录 +- 风险:soul-api 无法在仓库内检查;多分支(完整的、soul-content、yongpxu-soul)合并结果需确认 +- 建议:制定「分支合并后回归清单」,各端自测 + 抽检 + +--- + +## 讨论过程 + +- **乘风**:reflog 显示 devlop 曾 reset 到 58d4c0b6,后又提交 7e3d36d6;`完整的` 分支有 5a5f0087 等提交,是否已并入 devlop? +- **小程序**:需对比 devlop 与 `完整的` 的 miniprogram 差异,确认 2026-03-03 卡片边距等优化是否保留 +- **后端**:soul-api 不在本仓库,需在 soul-api 所在位置单独确认 git 状态与合并情况 +- **管理端**:结构完整,主要风险在接口可用性,需联调确认 + +--- + +## 会议决议 + +1. **小程序端**:修正 app.json 第 21 行多页面拆行;核心流程自测;确认 `/api/miniprogram/orders` 是否可用 +2. **管理端**:全功能自测,记录 404/异常接口反馈后端 +3. **后端**:在 soul-api 所在仓库确认当前分支与合并状态;核对 orders、distribution 等接口是否已实现并挂载 +4. **产品**:核对 `开发文档/`、`临时需求池/` 与实现一致性;重点确认个人资料、增值版/普通版、找伙伴 +5. **测试**:制定「分支合并后回归清单」,覆盖登录、VIP、阅读、分销、提现、找伙伴、个人资料、导师、购买记录 +6. **待确认**:`完整的` 分支上的提交是否已全部并入 devlop;soul-api 的版本管理与合并策略 + +--- + +## 待办事项 + +| 责任角色 | 任务 | 优先级 | 截止建议 | +|---------|------|--------|---------| +| 小程序开发工程师 | 修正 app.json 第 21 行;核心流程自测;确认 orders 接口 | 高 | 2026-03-06 | +| 管理端开发工程师 | 全功能自测,记录 404/异常接口 | 高 | 2026-03-06 | +| 后端开发 | 在 soul-api 确认合并状态;核对 orders、distribution 接口 | 高 | 2026-03-06 | +| 产品经理 | 核对需求文档与实现一致性 | 中 | 2026-03-06 | +| 测试人员 | 制定「分支合并后回归清单」 | 中 | 2026-03-06 | + +--- + +## 问题与作答区 + +| # | 问题 | 责任角色 | 作答 | +|---|------|---------|------| +| 1 | `完整的` 分支上的提交(5a5f0087 等)是否已全部并入 devlop? | 小程序开发工程师 | (待补充) | +| 2 | soul-api 的版本管理与合并策略是什么?是否在独立仓库? | 后端开发 | (待补充) | +| 3 | `/api/miniprogram/orders` 是否已实现并挂载到 miniprogram 组? | 后端开发 | (待补充) | +| 4 | `/api/db/distribution` 是否已实现? | 后端开发 | (待补充) | + +--- + +## 各角色经验与业务理解更新 + +### 产品经理 + +- 分支冲突后需优先核对需求文档与实现一致性,避免「文档在合并中丢失」导致需求脱节 + +### 后端开发 + +- soul-api 被 gitignore 时,需在 soul-api 所在位置单独确认合并状态;重点核对 orders、distribution 等接口是否已实现并挂载 + +### 管理端开发工程师 + +- 路由与页面结构完整时,主要风险在接口可用性;全功能自测可快速暴露 404 或异常接口 + +### 小程序开发工程师 + +- app.json 多页面配置建议拆行便于维护;分支合并后需做核心流程自测,确认 orders 等依赖接口可用 + +### 测试人员 + +- 分支合并后应制定「回归清单」,覆盖三端联调关键路径;soul-api 不在仓库时需与后端协作确认接口契约 + +### 团队共享 + +- 分支冲突后各端需做完整性自查:产品核对需求文档、后端核对接口、管理端/小程序核对页面与功能、测试制定回归清单 + +--- + +*会议纪要由助理橙子生成 | 各角色经验已同步至 `agent/{角色}/evolution/2026-03-05.md`* diff --git a/.cursor/meeting/2026-03-05_文章详情@某人加好友方案讨论.md b/.cursor/meeting/2026-03-05_文章详情@某人加好友方案讨论.md new file mode 100644 index 00000000..f81d100f --- /dev/null +++ b/.cursor/meeting/2026-03-05_文章详情@某人加好友方案讨论.md @@ -0,0 +1,95 @@ +# 会议纪要 - 2026-03-05 | 文章详情 @某人 高亮与一键加好友方案讨论 + +> 本文件由**助理橙子**在会议结束后自动生成。 + +--- + +## 基本信息 + +- **时间**:2026-03-05 +- **议题**:小程序文章详情中「@某人」高亮、点击添加好友;内容编辑时如何插入并存储用户信息(含用户 id),以及是否有更优实现方式 +- **触发方式**:开一个开发大会,讨论一下 +- **参与角色**:产品经理、后端开发、管理端开发工程师、小程序开发工程师、测试人员 + +--- + +## 各角色发言 + +### 【产品经理】 + +- 需求:文章中可出现「@某某人」,名称高亮,用户点击后执行添加该人为好友;添加好友能力以接口为准。 +- 用户价值:从内容到人的关系链沉淀,提升互动与转化。 +- 业务规则:仅支持 @ 已存在用户;展示名以昵称为准;点击统一为「发起添加好友」。 +- 验收标准:文章详情内 @ 名称高亮且可点击;点击后调用添加好友流程;管理端/编辑侧能插入 @用户 并落库(含用户 id)。 + +### 【后端开发】 + +- 添加好友接口需在 soul-api 的 **miniprogram** 路由组下提供(如 `POST /api/miniprogram/friend/add` 或 `POST /api/miniprogram/user/add-friend`),入参建议 `targetUserId`;`开发文档/api_v1.md` 当前为存客宝文档,添加好友接口应单独约定或在该文档中新增小节。 +- 内容存储推荐**方案 A**:正文存带 @ 标记的字符串,如 `@[昵称](userId)` 或 `{{@userId:昵称}}`,后端只存不解析,由前端解析;方案 B(正文 + mentions 位置表)需维护偏移量,正文变更易错位。 +- 数据模型:内容表扩展 content 存带 @ 标记的字符串即可,无需单独表。 + +### 【管理端开发工程师】 + +- 文章/章节编辑页增加「插入 @用户」:选择用户后插入到光标位置,保存时写入约定格式的 content;仅调 `/api/admin/*`、`/api/db/*`。 +- 管理端列表/预览可简单高亮或原样显示,与小程序约定同一 content 格式即可。 + +### 【小程序开发工程师】 + +- 阅读页当前为按行渲染纯文本;需将 content 解析为「段落 + 片段」(普通文本 / mention),WXML 中对 mention 渲染为可点击 `` 并高亮,点击时调用 miniprogram 添加好友接口。 +- 继续使用现有章节内容接口,保证返回的 content 含 @ 标记;添加好友调用 miniprogram 组新接口。 + +### 【测试人员】 + +- 用例:无 @ 行为不变;有 @ 高亮且点击调起添加好友并提示;重复点击、未登录、无权限等边界;管理端插入 @ 后保存再编辑,内容与用户 id 不错位。 +- 联调:小程序 ↔ 章节接口、添加好友接口;管理端 ↔ 内容保存与用户列表。回归:阅读页其他功能不受影响。 + +--- + +## 讨论过程 + +- 一致同意采用「正文内嵌 @ 标记」方案,格式统一为 `@[昵称](userId)`(或约定等价格式)。 +- 添加好友接口不混用存客宝 api_v1,在 soul-api miniprogram 组新增并在开发文档中明确。 +- 管理端负责插入 @ 并写入同一 content 格式;小程序负责解析、展示与点击加好友。 + +--- + +## 会议决议 + +1. **内容格式**:正文使用内嵌 @ 标记,格式 `@[昵称](userId)`(或团队约定的等价格式),后端/管理端/小程序统一。 +2. **小程序**:阅读页解析 content 中 @,渲染为高亮可点击;点击时调 miniprogram 添加好友接口(如 `targetUserId`),并做结果提示。 +3. **管理端**:编辑页支持「插入 @用户」,保存时写入约定格式的 content。 +4. **后端**:提供 miniprogram 添加好友接口;章节/文章接口返回的 content 支持带 @ 标记的字符串。 +5. **待确认**:添加好友接口的最终 path、入参/出参;若已有好友/关注模型需对齐。 + +--- + +## 待办事项 + +| 责任角色 | 任务 | 优先级 | 截止建议 | +|---------|------|--------|---------| +| 后端开发 | 在 miniprogram 组新增添加好友接口并更新开发文档 | 高 | 排期后 | +| 管理端开发工程师 | 文章/章节编辑页支持插入 @用户并保存为约定 content 格式 | 高 | 后端接口与格式确定后 | +| 小程序开发工程师 | 阅读页解析 @ 并高亮可点击,点击调添加好友接口 | 高 | 后端接口就绪后 | +| 产品经理 | 确认添加好友接口 path 与业务规则(已是好友/重复请求等) | 中 | 开发前 | +| 测试人员 | 编写 @ 展示与添加好友用例及回归清单 | 中 | 联调前 | + +--- + +## 问题与作答区 + +| # | 问题 | 责任角色 | 作答 | +|---|------|---------|------| +| 1 | 添加好友接口的最终 path、入参(如 targetUserId)、出参及错误码? | 后端开发 | (待补充) | +| 2 | 开发文档中添加好友接口放在 api_v1.md 新小节还是单独文档? | 后端/产品 | (待补充) | +| 3 | 是否已有「好友/关注」表或接口需与本次对接? | 后端开发 | (待补充) | + +--- + +## 各角色经验与业务理解更新 + +- 本次会议结论已同步至各角色当日经验文件(见 `agent/{角色}/evolution/2026-03-05.md`)。 +- 团队共享:内容 @ 采用「正文内嵌 `@[昵称](userId)`」方案;添加好友接口归属 miniprogram 组,与存客宝 api_v1 分离。 + +--- + +*会议纪要由助理橙子生成 | 各角色经验已同步至 `agent/{角色}/evolution/2026-03-05.md`* diff --git a/.cursor/meeting/2026-03-05_超级个体解锁眼睛需求分析.md b/.cursor/meeting/2026-03-05_超级个体解锁眼睛需求分析.md new file mode 100644 index 00000000..449f9da2 --- /dev/null +++ b/.cursor/meeting/2026-03-05_超级个体解锁眼睛需求分析.md @@ -0,0 +1,78 @@ +# 需求分析 - 超级个体解锁眼睛交互改造 + +## 基本信息 +- **时间**:2026-03-05 +- **需求来源**:用户反馈 +- **涉及页面**:`miniprogram/pages/member-detail/member-detail` + +--- + +## 一、需求描述 + +超级个体详情页点击「解锁眼睛」图标时,需调整交互逻辑: + +| 原逻辑 | 新逻辑 | +|--------|--------| +| 弹窗「成为VIP会员并完成匹配后,即可查看完整联系方式」→ 确认跳转**找伙伴/匹配页** | **不跳转匹配页**;未登录先登录;已登录按权益处理 | + +### 新逻辑细则 + +1. **未登录**:弹窗「请先登录」→ 确认跳转「我的」页,用户登录后再返回操作 +2. **已登录**: + - **VIP 会员**(`hasFullBook`):直接解锁,可无限次解锁任意超级个体 + - **非 VIP**:每人 **1 次免费解锁**,第 2 次起弹窗「免费次数已用完,开通 VIP(¥1980/年)可无限解锁」→ 确认跳转 **VIP 会员页**(1980 付款页) + +--- + +## 二、已实现修改(小程序端) + +### 修改文件 +- `miniprogram/pages/member-detail/member-detail.js` + +### 实现要点 + +1. **解锁状态存储**(本地 `wx.setStorageSync`) + - Key:`member_unlocks_{userId}` + - 值:已解锁的 `memberId` 数组 + - 用于判断是否已解锁、是否已用掉免费次数 + +2. **`unlockContact()` 流程** + ``` + 点击眼睛 + → 未登录:Modal「需要登录」→ 去登录 → switchTab 我的 + → 已登录 + VIP:直接解锁并写入存储 + → 已登录 + 非VIP + 首次:免费解锁并写入存储 + → 已登录 + 非VIP + 非首次:Modal「去开通」→ navigateTo VIP 页 + ``` + +3. **`enrichAndFormat` 中 `contactUnlocked` / `wechatUnlocked`** + - 原:仅 `isMatched`(匹配过的人) + - 现:`isMatched || localUnlocked`(本地解锁列表也视为已解锁) + +--- + +## 三、后续可选优化(后端/管理端) + +### 1. 后端持久化(可选) + +当前免费次数与解锁记录存于**本地**,换设备或清缓存会丢失。若需跨设备、防作弊,可: + +- 新增接口:`POST /api/miniprogram/member/unlock` + - 入参:`memberId`、`userId` + - 逻辑:校验免费次数 / VIP 权益,记录解锁关系 +- 小程序改为调用该接口,成功后更新本地展示 + +### 2. 管理端统计(可选) + +- 统计「超级个体联系方式解锁」次数 +- 按用户、按超级个体维度统计 + +--- + +## 四、验收要点 + +- [ ] 未登录点击眼睛 → 弹窗「需要登录」→ 确认跳转「我的」 +- [ ] 已登录 + 非 VIP + 首次 → 免费解锁,展示完整联系方式 +- [ ] 已登录 + 非 VIP + 第 2 次起 → 弹窗「去开通」→ 确认跳转 VIP 页(¥1980) +- [ ] 已登录 + VIP → 直接解锁,不限次数 +- [ ] 不跳转匹配页 diff --git a/.cursor/meeting/README.md b/.cursor/meeting/README.md index d3f674f5..5bf6539a 100644 --- a/.cursor/meeting/README.md +++ b/.cursor/meeting/README.md @@ -62,3 +62,6 @@ YYYY-MM-DD_会议主题.md | 2026-02-28 | 临时需求池 stitch_soul 需求评审(含页面重构专项·10 张图全覆盖) | 产品、后端、管理端、小程序、测试 | [2026-02-28_临时需求池stitch_soul需求评审.md](2026-02-28_临时需求池stitch_soul需求评审.md) | | 2026-02-28 | 个人资料页实现评估(profile-show / profile-edit) | 产品、后端、管理端、小程序、测试 | [2026-02-28_个人资料页实现评估.md](2026-02-28_个人资料页实现评估.md) | | 2026-02-28 | 文章类型(普通版/增值版)需求分析 | 产品、后端、管理端、小程序、测试 | [2026-02-28_文章类型普通版增值版需求分析.md](2026-02-28_文章类型普通版增值版需求分析.md) | +| 2026-03-05 | 分支冲突后功能完整性分析 | 产品、后端、管理端、小程序、测试 | [2026-03-05_分支冲突后功能完整性分析.md](2026-03-05_分支冲突后功能完整性分析.md) | +| 2026-03-05 | 超级个体解锁眼睛需求分析 | 产品、小程序 | [2026-03-05_超级个体解锁眼睛需求分析.md](2026-03-05_超级个体解锁眼睛需求分析.md) | +| 2026-03-05 | 文章详情 @某人 高亮与一键加好友方案讨论 | 产品、后端、管理端、小程序、测试 | [2026-03-05_文章详情@某人加好友方案讨论.md](2026-03-05_文章详情@某人加好友方案讨论.md) | diff --git a/miniprogram/app.js b/miniprogram/app.js index 553d1ce2..f3c17bc9 100644 --- a/miniprogram/app.js +++ b/miniprogram/app.js @@ -8,9 +8,9 @@ const { parseScene } = require('./utils/scene.js') App({ globalData: { // API基础地址 - 连接真实后端 - baseUrl: 'https://soulapi.quwanzhi.com', + // baseUrl: 'https://soulapi.quwanzhi.com', // baseUrl: 'https://souldev.quwanzhi.com', - // baseUrl: 'http://localhost:8080', + baseUrl: 'http://localhost:8080', // 小程序配置 - 真实AppID diff --git a/miniprogram/app.json b/miniprogram/app.json index d9a24b4b..40ce10dd 100644 --- a/miniprogram/app.json +++ b/miniprogram/app.json @@ -53,14 +53,6 @@ }, "usingComponents": {}, "__usePrivacyCheck__": true, - "permission": { - "scope.userLocation": { - "desc": "用于匹配附近的书友" - } - }, - "requiredPrivateInfos": [ - "getLocation" - ], "lazyCodeLoading": "requiredComponents", "style": "v2", "sitemapLocation": "sitemap.json" diff --git a/miniprogram/assets/icons/edit-gray.svg b/miniprogram/assets/icons/edit-gray.svg new file mode 100644 index 00000000..4d821839 --- /dev/null +++ b/miniprogram/assets/icons/edit-gray.svg @@ -0,0 +1,4 @@ + + + + diff --git a/miniprogram/assets/icons/user-edit-gray.svg b/miniprogram/assets/icons/user-edit-gray.svg new file mode 100644 index 00000000..884c3651 --- /dev/null +++ b/miniprogram/assets/icons/user-edit-gray.svg @@ -0,0 +1,4 @@ + + + + diff --git a/miniprogram/pages/index/index.js b/miniprogram/pages/index/index.js index 9fb60ee6..0d12adec 100644 --- a/miniprogram/pages/index/index.js +++ b/miniprogram/pages/index/index.js @@ -54,7 +54,11 @@ Page({ partCount: 0, // 加载状态 - loading: true + loading: true, + + // 链接卡若 - 留资弹窗 + showLeadModal: false, + leadPhone: '' }, onLoad(options) { @@ -124,8 +128,8 @@ Page({ // 不再过滤无头像用户,无头像时用首字母展示 members = (Array.isArray(res.data) ? res.data : []).slice(0, 4).map(u => ({ id: u.id, - name: u.vipName || u.vip_name || u.nickname || '会员', - avatar: u.vipAvatar || u.vip_avatar || u.avatar || '', + name: u.nickname || u.vipName || u.vip_name || '会员', // 超级个体:用户资料优先,随「我的」修改实时生效 + avatar: u.avatar || '', isVip: true })) if (members.length > 0) { @@ -301,6 +305,113 @@ Page({ wx.navigateTo({ url: '/pages/about/about' }) }, + async onLinkKaruo() { + const app = getApp() + if (!app.globalData.isLoggedIn || !app.globalData.userInfo) { + wx.showModal({ + title: '提示', + content: '请先登录后再链接卡若', + confirmText: '去登录', + cancelText: '取消', + success: (res) => { + if (res.confirm) wx.switchTab({ url: '/pages/my/my' }) + } + }) + return + } + const userId = app.globalData.userInfo.id + const leadKey = 'karuo_lead_' + userId + let phone = (app.globalData.userInfo.phone || '').trim() + let wechatId = (app.globalData.userInfo.wechatId || app.globalData.userInfo.wechat_id || '').trim() + if (!phone && !wechatId) { + try { + const profileRes = await app.request({ url: `/api/miniprogram/user/profile?userId=${userId}`, silent: true }) + if (profileRes?.success && profileRes.data) { + phone = (profileRes.data.phone || '').trim() + wechatId = (profileRes.data.wechatId || profileRes.data.wechat_id || '').trim() + } + } catch (e) {} + } + if (phone || wechatId) { + const hasLead = wx.getStorageSync(leadKey) + if (hasLead) { + wx.showToast({ title: '已提交联系方式,卡若会尽快联系你', icon: 'none' }) + return + } + wx.showLoading({ title: '提交中...', mask: true }) + try { + const res = await app.request({ + url: '/api/miniprogram/ckb/lead', + method: 'POST', + data: { + userId, + phone: phone || undefined, + wechatId: wechatId || undefined, + name: (app.globalData.userInfo.nickname || '').trim() || undefined + } + }) + wx.hideLoading() + if (res && res.success) { + wx.setStorageSync(leadKey, true) + wx.showToast({ title: res.message || '提交成功', icon: 'success' }) + } else { + wx.showToast({ title: (res && res.message) || '提交失败', icon: 'none' }) + } + } catch (e) { + wx.hideLoading() + wx.showToast({ title: e.message || '提交失败', icon: 'none' }) + } + return + } + this.setData({ showLeadModal: true, leadPhone: '' }) + }, + + closeLeadModal() { + this.setData({ showLeadModal: false, leadPhone: '' }) + }, + + onLeadPhoneInput(e) { + this.setData({ leadPhone: (e.detail.value || '').trim() }) + }, + + async submitLead() { + const phone = (this.data.leadPhone || '').trim().replace(/\s/g, '') + if (!phone) { + wx.showToast({ title: '请输入手机号', icon: 'none' }) + return + } + if (phone.length < 11) { + wx.showToast({ title: '请输入正确的手机号', icon: 'none' }) + return + } + const app = getApp() + const userId = app.globalData.userInfo?.id + const leadKey = userId ? ('karuo_lead_' + userId) : '' + wx.showLoading({ title: '提交中...', mask: true }) + try { + const res = await app.request({ + url: '/api/miniprogram/ckb/lead', + method: 'POST', + data: { + userId, + phone, + name: (app.globalData.userInfo?.nickname || '').trim() || undefined + } + }) + wx.hideLoading() + this.setData({ showLeadModal: false, leadPhone: '' }) + if (res && res.success) { + if (leadKey) wx.setStorageSync(leadKey, true) + wx.showToast({ title: res.message || '提交成功,卡若会尽快联系您', icon: 'success' }) + } else { + wx.showToast({ title: (res && res.message) || '提交失败', icon: 'none' }) + } + } catch (e) { + wx.hideLoading() + wx.showToast({ title: e.message || '提交失败', icon: 'none' }) + } + }, + goToSuperList() { wx.switchTab({ url: '/pages/match/match' }) }, @@ -316,8 +427,22 @@ Page({ if (candidates.length === 0) { candidates = chapters.filter(exclude) } + // 解析「第X场」用于倒序,最新(场次大)放在最上方 + const sessionNum = (c) => { + const title = c.section_title || c.sectionTitle || c.title || c.chapterTitle || '' + const m = title.match(/第\s*(\d+)\s*场/) || title.match(/第(\d+)场/) + if (m) return parseInt(m[1], 10) + const id = c.id != null ? String(c.id) : '' + if (/^\d+$/.test(id)) return parseInt(id, 10) + return 0 + } const latest = candidates - .sort((a, b) => new Date(b.updatedAt || b.updated_at || 0) - new Date(a.updatedAt || a.updated_at || 0)) + .sort((a, b) => { + const na = sessionNum(a) + const nb = sessionNum(b) + if (na !== nb) return nb - na // 场次倒序:最新在上 + return new Date(b.updatedAt || b.updated_at || 0) - new Date(a.updatedAt || a.updated_at || 0) + }) .slice(0, 10) .map(c => { const d = new Date(c.updatedAt || c.updated_at || Date.now()) diff --git a/miniprogram/pages/index/index.wxml b/miniprogram/pages/index/index.wxml index 04cd2438..4506b61a 100644 --- a/miniprogram/pages/index/index.wxml +++ b/miniprogram/pages/index/index.wxml @@ -17,7 +17,7 @@ - + 点击链接卡若 @@ -186,4 +186,17 @@ + + + + + 留下联系方式 + 方便卡若与您联系 + + + + + + + diff --git a/miniprogram/pages/index/index.wxss b/miniprogram/pages/index/index.wxss index 3f30a6a1..bb2435de 100644 --- a/miniprogram/pages/index/index.wxss +++ b/miniprogram/pages/index/index.wxss @@ -842,3 +842,73 @@ .bottom-space { height: 40rpx; } + +/* ===== 链接卡若 - 留资弹窗 ===== */ +.lead-mask { + position: fixed; + left: 0; + right: 0; + top: 0; + bottom: 0; + background: rgba(0, 0, 0, 0.6); + z-index: 1000; + display: flex; + align-items: center; + justify-content: center; + padding: 48rpx; + box-sizing: border-box; +} +.lead-box { + width: 100%; + max-width: 560rpx; + background: #1C1C1E; + border-radius: 24rpx; + padding: 48rpx 40rpx; + border: 2rpx solid rgba(56, 189, 172, 0.3); +} +.lead-title { + display: block; + font-size: 34rpx; + font-weight: 600; + color: #ffffff; + margin-bottom: 12rpx; +} +.lead-desc { + display: block; + font-size: 26rpx; + color: #A0AEC0; + margin-bottom: 32rpx; +} +.lead-input { + width: 100%; + height: 88rpx; + background: #0a1628; + border: 2rpx solid rgba(255, 255, 255, 0.1); + border-radius: 16rpx; + padding: 0 24rpx; + box-sizing: border-box; + font-size: 30rpx; + color: #ffffff; + margin-bottom: 32rpx; +} +.lead-actions { + display: flex; + gap: 24rpx; +} +.lead-btn { + flex: 1; + height: 80rpx; + line-height: 80rpx; + border-radius: 16rpx; + font-size: 30rpx; + font-weight: 500; + border: none; +} +.lead-btn-cancel { + background: rgba(255, 255, 255, 0.1); + color: #A0AEC0; +} +.lead-btn-submit { + background: #38bdac; + color: #ffffff; +} diff --git a/miniprogram/pages/match/match.js b/miniprogram/pages/match/match.js index eeac9224..e1c8821a 100644 --- a/miniprogram/pages/match/match.js +++ b/miniprogram/pages/match/match.js @@ -14,7 +14,7 @@ const app = getApp() let MATCH_TYPES = [ { id: 'partner', label: '找伙伴', matchLabel: '找伙伴', icon: '⭐', matchFromDB: true, showJoinAfterMatch: false }, { id: 'investor', label: '资源对接', matchLabel: '资源对接', icon: '👥', matchFromDB: true, showJoinAfterMatch: true, requirePurchase: true }, - { id: 'mentor', label: '导师顾问', matchLabel: '立即咨询', icon: '❤️', matchFromDB: true, showJoinAfterMatch: true }, + { id: 'mentor', label: '导师顾问', matchLabel: '导师顾问', icon: '❤️', matchFromDB: true, showJoinAfterMatch: true }, { id: 'team', label: '团队招募', matchLabel: '团队招募', icon: '🎮', matchFromDB: true, showJoinAfterMatch: true } ] @@ -108,8 +108,15 @@ Page({ }) if (res.success && res.data) { - // 更新全局配置 - MATCH_TYPES = res.data.matchTypes || MATCH_TYPES + // 更新全局配置,导师顾问类型强制显示「导师顾问」 + let types = res.data.matchTypes || MATCH_TYPES + types = types.map(t => { + if (t.id === 'mentor') { + return { ...t, label: '导师顾问', matchLabel: '导师顾问' } + } + return t + }) + MATCH_TYPES = types FREE_MATCH_LIMIT = res.data.freeMatchLimit || FREE_MATCH_LIMIT const matchPrice = res.data.matchPrice || 1 @@ -459,7 +466,7 @@ Page({ // 生成模拟匹配数据 generateMockMatch() { - const nicknames = ['创业先锋', '资源整合者', '私域专家', '商业导师', '连续创业者'] + const nicknames = ['创业先锋', '资源整合者', '私域专家', '导师顾问', '连续创业者'] const concepts = [ '专注私域流量运营5年,帮助100+品牌实现从0到1的增长。', '连续创业者,擅长商业模式设计和资源整合。', diff --git a/miniprogram/pages/member-detail/member-detail.js b/miniprogram/pages/member-detail/member-detail.js index 763ce08d..46a505db 100644 --- a/miniprogram/pages/member-detail/member-detail.js +++ b/miniprogram/pages/member-detail/member-detail.js @@ -1,7 +1,7 @@ /** * Soul创业派对 - 超级个体/会员详情页 * 接口:优先 /api/miniprogram/vip/members?id=xx(VIP),回退 /api/miniprogram/users?id=xx(任意用户) - * 字段映射:name/vipName, avatar/vipAvatar, contact/vipContact/phone, wechatId, project/vipProject/projectIntro, + * 头像/昵称:统一用用户资料(nickname/avatar)优先,随「我的」修改实时生效 * mbti, region, industry, position, businessScale, skills, * storyBestMonth→bestMonth, storyAchievement→achievement, storyTurning→turningPoint, * helpOffer→canHelp, helpNeed→needHelp @@ -32,8 +32,8 @@ Page({ const u = Array.isArray(dbRes.data) ? dbRes.data[0] : dbRes.data if (u) { this.setData({ member: this.enrichAndFormat({ - id: u.id, name: u.vipName || u.vip_name || u.nickname || '创业者', - avatar: u.vipAvatar || u.vip_avatar || u.avatar || '', isVip: !!(u.is_vip), + id: u.id, name: u.nickname || u.vipName || u.vip_name || '创业者', + avatar: u.avatar || u.vipAvatar || u.vip_avatar || '', isVip: !!(u.is_vip), contactRaw: u.vipContact || u.vip_contact || u.phone || '', wechatId: u.wechatId || u.wechat_id, project: u.vipProject || u.vip_project || u.projectIntro || u.project_intro || '', @@ -63,7 +63,7 @@ Page({ const e = (v) => this._emptyIfPlaceholder(v) const merged = { id: raw.id, - name: raw.name || raw.vipName || raw.vip_name || raw.nickname || '创业者', + name: raw.nickname || raw.name || raw.vipName || raw.vip_name || '创业者', avatar: raw.avatar || raw.vipAvatar || raw.vip_avatar || '', isVip: !!(raw.isVip || raw.is_vip), mbti: e(raw.mbti), @@ -85,20 +85,84 @@ Page({ const contact = merged.contactRaw || '' const wechat = merged.wechatRaw || '' const isMatched = (app.globalData.matchedUsers || []).includes(merged.id) + const unlockData = this._getUnlockData(merged.id) merged.contactDisplay = contact ? (contact.slice(0, 3) + '****' + (contact.length > 7 ? contact.slice(-2) : '')) : '' - merged.contactUnlocked = isMatched + merged.contactUnlocked = isMatched || unlockData.contact merged.contactFull = contact merged.wechatDisplay = wechat ? (wechat.slice(0, 4) + '****' + (wechat.length > 8 ? wechat.slice(-3) : '')) : '' - merged.wechatUnlocked = isMatched + merged.wechatUnlocked = isMatched || unlockData.wechat merged.wechatFull = wechat return merged }, - unlockContact() { + _getUnlockData(memberId) { + const userId = app.globalData.userInfo?.id + if (!userId || !memberId) return { contact: false, wechat: false } + try { + const raw = wx.getStorageSync('member_unlocks_' + userId) + if (Array.isArray(raw) && raw.includes(memberId)) { + return { contact: true, wechat: true } + } + const data = raw && typeof raw === 'object' && !Array.isArray(raw) ? raw : {} + const member = data[memberId] + return { + contact: !!(member && member.contact), + wechat: !!(member && member.wechat) + } + } catch (e) { return { contact: false, wechat: false } } + }, + + _addUnlock(memberId, field) { + const userId = app.globalData.userInfo?.id + if (!userId || !memberId || !field) return + let obj = wx.getStorageSync('member_unlocks_' + userId) + if (Array.isArray(obj)) { + obj = obj.reduce((o, id) => { o[id] = { contact: true, wechat: true }; return o }, {}) + } + obj = obj && typeof obj === 'object' ? obj : {} + if (!obj[memberId]) obj[memberId] = {} + obj[memberId][field] = true + wx.setStorageSync('member_unlocks_' + userId, obj) + }, + + _hasUsedFreeForMember(memberId) { + const d = this._getUnlockData(memberId) + return d.contact || d.wechat + }, + + unlockField(e) { + const field = e.currentTarget.dataset.field + if (!field) return + const member = this.data.member + if (!member?.id || (field !== 'contact' && field !== 'wechat')) return + const isLoggedIn = app.globalData.isLoggedIn + if (!isLoggedIn) { + wx.showModal({ + title: '需要登录', + content: '请先登录后再解锁超级个体联系方式', + confirmText: '去登录', + cancelText: '取消', + success: (res) => { if (res.confirm) wx.switchTab({ url: '/pages/my/my' }) } + }) + return + } + const d = this._getUnlockData(member.id) + if (d[field]) return + const isVip = app.globalData.hasFullBook + const usedFree = this._hasUsedFreeForMember(member.id) + if (isVip || !usedFree) { + this._addUnlock(member.id, field) + const m = this.enrichAndFormat(member) + this.setData({ member: m }) + wx.showToast({ title: field === 'contact' ? '已解锁联系方式' : '已解锁微信号', icon: 'success' }) + return + } wx.showModal({ - title: '解锁完整联系方式', content: '成为VIP会员并完成匹配后,即可查看完整联系方式', - confirmText: '去匹配', cancelText: '知道了', - success: (res) => { if (res.confirm) wx.switchTab({ url: '/pages/match/match' }) } + title: '解锁' + (field === 'contact' ? '联系方式' : '微信号'), + content: '您的免费解锁次数已用完,开通VIP会员(¥1980/年)可无限解锁', + confirmText: '去开通', + cancelText: '取消', + success: (res) => { if (res.confirm) wx.navigateTo({ url: '/pages/vip/vip' }) } }) }, diff --git a/miniprogram/pages/member-detail/member-detail.wxml b/miniprogram/pages/member-detail/member-detail.wxml index 0b1730c5..afee99b3 100644 --- a/miniprogram/pages/member-detail/member-detail.wxml +++ b/miniprogram/pages/member-detail/member-detail.wxml @@ -57,8 +57,8 @@ 联系方式 - {{member.contactDisplay || member.contactRaw}} - + {{member.contactUnlocked ? member.contactFull : (member.contactDisplay || member.contactRaw)}} + 📋 @@ -67,8 +67,8 @@ 微信号 - {{member.wechatDisplay || member.wechatRaw}} - + {{member.wechatUnlocked ? member.wechatFull : (member.wechatDisplay || member.wechatRaw)}} + 📋 diff --git a/miniprogram/pages/my/my.js b/miniprogram/pages/my/my.js index b1a3889e..688b5e9f 100644 --- a/miniprogram/pages/my/my.js +++ b/miniprogram/pages/my/my.js @@ -621,7 +621,7 @@ Page({ wx.switchTab({ url: '/pages/match/match' }) }, - // 跳转到推广中心 + // 跳转到推广中心(需登录) goToReferral() { if (!this.data.isLoggedIn) { this.showLogin() @@ -630,7 +630,7 @@ Page({ wx.navigateTo({ url: '/pages/referral/referral' }) }, - // 跳转到找伙伴页面 + // 跳转到找伙伴 goToMatch() { wx.switchTab({ url: '/pages/match/match' }) }, @@ -650,14 +650,20 @@ Page({ }) }, - // VIP状态查询 + // VIP状态查询(hasFullBook 优先,兼容模拟支付等本地已置 VIP 的情况) async loadVipStatus() { + if (app.globalData.hasFullBook) { + this.setData({ isVip: true, vipExpireDate: this.data.vipExpireDate || '' }) + } const userId = app.globalData.userInfo?.id if (!userId) return try { const res = await app.request({ url: `/api/miniprogram/vip/status?userId=${userId}`, silent: true }) if (res?.success) { - this.setData({ isVip: res.data?.isVip, vipExpireDate: res.data?.expireDate || '' }) + this.setData({ + isVip: res.data?.isVip || app.globalData.hasFullBook, + vipExpireDate: res.data?.expireDate || this.data.vipExpireDate || '' + }) } } catch (e) { console.log('[My] VIP查询失败', e) } }, diff --git a/miniprogram/pages/my/my.wxml b/miniprogram/pages/my/my.wxml index 6fad4513..507e74cc 100644 --- a/miniprogram/pages/my/my.wxml +++ b/miniprogram/pages/my/my.wxml @@ -1,11 +1,11 @@ - + - 我的 - - + + + 我的 @@ -38,22 +38,22 @@ 会员 - 匹配 + 匹配 排行 微信号: {{userWechat || userIdShort || '--'}} - + {{readCount}} 已读章节 - + {{referralCount}} 推荐好友 - + {{earnings === '-' ? '--' : earnings}} 我的收益 @@ -70,17 +70,17 @@ 阅读统计 - + {{readCount}} 已读章节 - + {{totalReadTime}} 阅读分钟 - + {{matchHistory}} 匹配伙伴 @@ -208,7 +208,9 @@ 修改昵称 - + + + 微信用户可点击自动填充昵称 diff --git a/miniprogram/pages/my/my.wxss b/miniprogram/pages/my/my.wxss index 125731fb..cc4f02c7 100644 --- a/miniprogram/pages/my/my.wxss +++ b/miniprogram/pages/my/my.wxss @@ -9,7 +9,7 @@ padding-bottom: calc(220rpx + env(safe-area-inset-bottom, 0px)); } -/* ===== 导航栏(避让右上角系统胶囊) ===== */ +/* ===== 导航栏(左侧设置 + 标题居中,右侧避让胶囊) ===== */ .nav-bar { position: fixed; top: 0; left: 0; right: 0; z-index: 100; background: rgba(18,18,18,0.9); backdrop-filter: blur(8rpx); @@ -18,8 +18,8 @@ padding: 0 120rpx 0 32rpx; /* 右侧避让胶囊 */ border-bottom: 1rpx solid rgba(255,255,255,0.05); } -.nav-title { font-size: 40rpx; font-weight: bold; color: #4FD1C5; flex: 1; } -.nav-settings { width: 64rpx; height: 64rpx; display: flex; align-items: center; justify-content: center; margin-right: 16rpx; } +.nav-settings { width: 64rpx; height: 64rpx; flex-shrink: 0; display: flex; align-items: center; justify-content: center; margin-right: 16rpx; } +.nav-title { font-size: 40rpx; font-weight: bold; color: #4FD1C5; flex: 1; text-align: center; } .nav-settings-icon { width: 44rpx; height: 44rpx; opacity: 0.7; } .nav-placeholder { width: 100%; } @@ -217,7 +217,11 @@ .nickname-modal .modal-icon { font-size: 48rpx; } .nickname-modal .modal-title { font-size: 36rpx; font-weight: bold; } .nickname-input-wrap { margin-bottom: 32rpx; } -.nickname-input { width: 100%; padding: 24rpx; background: #262626; border-radius: 20rpx; font-size: 28rpx; color: #fff; box-sizing: border-box; } +.nickname-input-inner { + padding: 24rpx 32rpx; background: #262626; border-radius: 20rpx; +} +.nickname-input { width: 100%; font-size: 28rpx; color: #fff; background: transparent; box-sizing: border-box; } +.nickname-placeholder { color: #9CA3AF; } .input-tip { display: block; font-size: 22rpx; color: #9CA3AF; margin-top: 12rpx; } .modal-actions { display: flex; gap: 24rpx; } .modal-btn { flex: 1; height: 80rpx; line-height: 80rpx; text-align: center; border-radius: 20rpx; font-size: 28rpx; } diff --git a/miniprogram/pages/profile-edit/profile-edit.wxml b/miniprogram/pages/profile-edit/profile-edit.wxml index 82b15c08..f01469a4 100644 --- a/miniprogram/pages/profile-edit/profile-edit.wxml +++ b/miniprogram/pages/profile-edit/profile-edit.wxml @@ -18,8 +18,10 @@ - - {{nickname ? nickname[0] : '?'}} + + + {{nickname ? nickname[0] : '?'}} + 📷 更换头像 diff --git a/miniprogram/pages/profile-edit/profile-edit.wxss b/miniprogram/pages/profile-edit/profile-edit.wxss index 57df162a..29aed01f 100644 --- a/miniprogram/pages/profile-edit/profile-edit.wxss +++ b/miniprogram/pages/profile-edit/profile-edit.wxss @@ -31,18 +31,22 @@ .avatar-section { display: flex; flex-direction: column; align-items: center; margin-bottom: 48rpx; } .avatar-wrap { - position: relative; width: 192rpx; height: 192rpx; border-radius: 50%; overflow: hidden; + position: relative; width: 192rpx; height: 192rpx; border-radius: 50%; border: 4rpx solid #5EEAD4; box-shadow: 0 0 30rpx rgba(94,234,212,0.3); } +.avatar-inner { + width: 100%; height: 100%; border-radius: 50%; overflow: hidden; +} .avatar-img { width: 100%; height: 100%; display: block; } .avatar-placeholder { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; font-size: 72rpx; font-weight: bold; color: #5EEAD4; background: rgba(94,234,212,0.2); } .avatar-camera { - position: absolute; bottom: 0; right: 0; + position: absolute; bottom: -8rpx; right: -8rpx; width: 56rpx; height: 56rpx; background: #5EEAD4; color: #000; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 28rpx; + border: 4rpx solid #050B14; box-sizing: border-box; } .avatar-change { font-size: 28rpx; color: #5EEAD4; font-weight: 500; margin-top: 16rpx; } diff --git a/miniprogram/pages/read/read.js b/miniprogram/pages/read/read.js index 77c8aa60..a03ba8ba 100644 --- a/miniprogram/pages/read/read.js +++ b/miniprogram/pages/read/read.js @@ -81,6 +81,8 @@ Page({ if (app.globalData.initialSectionMid) delete app.globalData.initialSectionMid if (app.globalData.initialSectionId) delete app.globalData.initialSectionId + console.log("页面:",mid); + // mid 有值但无 id 时,从 bookData 或 API 解析 id if (mid && !id) { const bookData = app.globalData.bookData || [] @@ -126,7 +128,7 @@ Page({ }) // 统一:先拉章节数据,用 isFree/price===0 判断免费 - const chapterRes = await app.request({ url: `/api/miniprogram/book/chapter/${id}`, silent: true }) + const chapterRes = await app.request({ url: this._getChapterUrl({ id, mid }), silent: true }) const accessState = await accessManager.determineAccessState(id, chapterRes) const canAccess = accessManager.canAccessFullContent(accessState) @@ -196,7 +198,7 @@ Page({ const sectionPrice = this.data.sectionPrice ?? 1 let res = prefetchedChapter if (!res || !res.content) { - res = await app.request({ url: `/api/miniprogram/book/chapter/${id}`, silent: true }) + res = await app.request({ url: this._getChapterUrl({ id }), silent: true }) } const section = { id: res.id || id, @@ -295,6 +297,17 @@ Page({ return titles[id] || `章节 ${id}` }, + // 根据 id/mid 构造章节接口路径(优先使用 mid) + _getChapterUrl(params = {}) { + const { id, mid } = params + const finalMid = (mid !== undefined && mid !== null) ? mid : this.data.sectionMid + if (finalMid) { + return `/api/miniprogram/book/chapter/by-mid/${finalMid}` + } + const finalId = id || this.data.sectionId + return `/api/miniprogram/book/chapter/${finalId}` + }, + // 加载内容 - 三级降级方案:API → 本地缓存 → 备用API async loadContent(id) { const cacheKey = `chapter_${id}` @@ -344,7 +357,7 @@ Page({ reject(new Error('请求超时')) }, timeout) - app.request(`/api/miniprogram/book/chapter/${id}`) + app.request(this._getChapterUrl({ id })) .then(res => { clearTimeout(timer) resolve(res) @@ -360,14 +373,24 @@ Page({ setChapterContent(res) { const lines = res.content.split('\n').filter(line => line.trim()) const previewCount = Math.ceil(lines.length * 0.2) + const sectionPrice = this.data.sectionPrice ?? 1 + const sectionTitle = (res.sectionTitle || res.title || '').trim() this.setData({ + // 文章详情标题:只使用后端提供的 sectionTitle,不再拼接其他本地标题信息 + section: { + id: res.id || this.data.sectionId, + title: sectionTitle, + isFree: res.isFree === true || (res.price !== undefined && res.price === 0), + price: res.price ?? sectionPrice + }, content: res.content, previewContent: lines.slice(0, previewCount).join('\n'), contentParagraphs: lines, previewParagraphs: lines.slice(0, previewCount), partTitle: res.partTitle || '', - chapterTitle: res.chapterTitle || '' + // 导航栏、分享等使用的文章标题,同样统一为 sectionTitle + chapterTitle: sectionTitle }) }, @@ -504,11 +527,16 @@ Page({ } }, + // 分享到朋友圈:带文章标题,过长时截断(朋友圈卡片标题显示有限) onShareTimeline() { - const { section, sectionId, sectionMid } = this.data + const { section, sectionId, sectionMid, chapterTitle } = this.data const ref = app.getMyReferralCode() const q = sectionMid ? `mid=${sectionMid}` : `id=${sectionId}` - return { title: section?.title ? `📚 ${section.title}` : 'Soul创业派对 - 真实商业故事', query: ref ? `${q}&ref=${ref}` : q } + const articleTitle = (section?.title || chapterTitle || '').trim() + const title = articleTitle + ? (articleTitle.length > 28 ? articleTitle.slice(0, 28) + '...' : articleTitle) + : 'Soul创业派对 - 真实商业故事' + return { title, query: ref ? `${q}&ref=${ref}` : q } }, // 显示登录弹窗(每次打开协议未勾选,符合审核要求) @@ -588,7 +616,7 @@ Page({ // 2. 重新拉取章节数据,用 isFree/price 判断免费 const chapterRes = await app.request({ - url: `/api/miniprogram/book/chapter/${this.data.sectionId}`, + url: this._getChapterUrl({}), silent: true }) const newAccessState = await accessManager.determineAccessState( @@ -859,7 +887,7 @@ Page({ // 3. 重新拉取章节并判断权限(应为 unlocked_purchased) const chapterRes = await app.request({ - url: `/api/miniprogram/book/chapter/${this.data.sectionId}`, + url: this._getChapterUrl({}), silent: true }) let newAccessState = await accessManager.determineAccessState( @@ -1201,7 +1229,7 @@ Page({ // 重新拉取章节,用 isFree/price 判断免费 const chapterRes = await app.request({ - url: `/api/miniprogram/book/chapter/${this.data.sectionId}`, + url: this._getChapterUrl({}), silent: true }) const newAccessState = await accessManager.determineAccessState( diff --git a/miniprogram/pages/read/read.wxml b/miniprogram/pages/read/read.wxml index a17cc3b3..ddf4799f 100644 --- a/miniprogram/pages/read/read.wxml +++ b/miniprogram/pages/read/read.wxml @@ -13,8 +13,7 @@ - {{partTitle}} - {{chapterTitle}} + {{section.title || chapterTitle}} diff --git a/miniprogram/pages/settings/settings.js b/miniprogram/pages/settings/settings.js index 3f2cb8b1..5b21cb2a 100644 --- a/miniprogram/pages/settings/settings.js +++ b/miniprogram/pages/settings/settings.js @@ -64,67 +64,6 @@ Page({ } }, - // 一键获取收货地址 - getAddress() { - wx.chooseAddress({ - success: (res) => { - console.log('[Settings] 获取地址成功:', res) - const fullAddress = `${res.provinceName || ''}${res.cityName || ''}${res.countyName || ''}${res.detailInfo || ''}` - - if (fullAddress.trim()) { - wx.setStorageSync('user_address', fullAddress) - this.setData({ address: fullAddress }) - - // 更新用户信息 - if (app.globalData.userInfo) { - app.globalData.userInfo.address = fullAddress - wx.setStorageSync('userInfo', app.globalData.userInfo) - } - - // 同步到服务器 - this.syncAddressToServer(fullAddress) - - wx.showToast({ title: '地址已获取', icon: 'success' }) - } - }, - fail: (e) => { - console.log('[Settings] 获取地址失败:', e) - if (e.errMsg?.includes('cancel')) { - // 用户取消,不提示 - return - } - if (e.errMsg?.includes('auth deny') || e.errMsg?.includes('authorize')) { - wx.showModal({ - title: '需要授权', - content: '请在设置中允许获取收货地址', - confirmText: '去设置', - success: (res) => { - if (res.confirm) wx.openSetting() - } - }) - } else { - wx.showToast({ title: '获取失败,请重试', icon: 'none' }) - } - } - }) - }, - - // 同步地址到服务器 - async syncAddressToServer(address) { - try { - const userId = app.globalData.userInfo?.id - if (!userId) return - - await app.request('/api/miniprogram/user/update', { - method: 'POST', - data: { userId, address } - }) - console.log('[Settings] 地址已同步到服务器') - } catch (e) { - console.log('[Settings] 同步地址失败:', e) - } - }, - // 切换自动提现 async toggleAutoWithdraw(e) { const enabled = e.detail.value diff --git a/miniprogram/pages/vip/vip.js b/miniprogram/pages/vip/vip.js index 65c30361..b0e6d903 100644 --- a/miniprogram/pages/vip/vip.js +++ b/miniprogram/pages/vip/vip.js @@ -1,3 +1,4 @@ +import accessManager from '../../utils/chapterAccessManager' const app = getApp() Page({ @@ -88,9 +89,9 @@ Page({ if (payRes?.success && payRes.data?.payParams) { wx.requestPayment({ ...payRes.data.payParams, - success: () => { + success: async () => { wx.showToast({ title: 'VIP开通成功', icon: 'success' }) - this.loadVipInfo() + await this._onVipPaymentSuccess() }, fail: () => wx.showToast({ title: '支付取消', icon: 'none' }) }) @@ -103,6 +104,28 @@ Page({ } finally { this.setData({ purchasing: false }) } }, + async _onVipPaymentSuccess() { + wx.showLoading({ title: '同步权益中...', mask: true }) + try { + await new Promise(r => setTimeout(r, 1500)) + await accessManager.refreshUserPurchaseStatus() + await this.loadVipInfo() + app.globalData.hasFullBook = true + const userInfo = app.globalData.userInfo || {} + userInfo.hasFullBook = true + app.globalData.userInfo = userInfo + wx.setStorageSync('userInfo', userInfo) + const pages = getCurrentPages() + pages.forEach(p => { + if (typeof p.initUserStatus === 'function') p.initUserStatus() + else if (typeof p.updateUserStatus === 'function') p.updateUserStatus() + }) + } catch (e) { + console.error('[VIP] 支付后同步失败:', e) + } + wx.hideLoading() + }, + goBack() { wx.navigateBack() }, onShareAppMessage() { diff --git a/miniprogram/project.private.config.json b/miniprogram/project.private.config.json index 46fd5fc8..12b10c37 100644 --- a/miniprogram/project.private.config.json +++ b/miniprogram/project.private.config.json @@ -24,81 +24,11 @@ "miniprogram": { "list": [ { - "name": "pages/vip/vip", - "pathName": "pages/vip/vip", - "query": "", + "name": "pages/read/read", + "pathName": "pages/read/read", + "query": "mid=1", "scene": null, "launchMode": "default" - }, - { - "name": "pages/member-detail/member-detail", - "pathName": "pages/member-detail/member-detail", - "query": "id=ogpTW5QBRQNUOm4-zvg8it2XySrI", - "launchMode": "default", - "scene": null - }, - { - "name": "pages/vip/vip", - "pathName": "pages/vip/vip", - "query": "", - "launchMode": "default", - "scene": null - }, - { - "name": "pages/member-detail/member-detail", - "pathName": "pages/member-detail/member-detail", - "query": "id=ogpTW5cteGWqwOsRzh_CCIdKWGSE", - "launchMode": "default", - "scene": null - }, - { - "name": "pages/about/about", - "pathName": "pages/about/about", - "query": "", - "launchMode": "default", - "scene": null - }, - { - "name": "pages/about/about", - "pathName": "pages/about/about", - "query": "", - "launchMode": "default", - "scene": null - }, - { - "name": "pages/vip/vip", - "pathName": "pages/vip/vip", - "query": "", - "launchMode": "default", - "scene": null - }, - { - "name": "pages/profile-edit/profile-edit", - "pathName": "pages/profile-edit/profile-edit", - "query": "", - "launchMode": "default", - "scene": null - }, - { - "name": "个人资料", - "pathName": "pages/profile-show/profile-show", - "query": "", - "launchMode": "default", - "scene": null - }, - { - "name": "pages/mentors/mentors", - "pathName": "pages/mentors/mentors", - "query": "", - "launchMode": "default", - "scene": null - }, - { - "name": "我的", - "pathName": "pages/my/my", - "query": "", - "launchMode": "default", - "scene": null } ] } diff --git a/soul-admin/dist/assets/index-CAf6YeOV.js b/soul-admin/dist/assets/index-CAf6YeOV.js new file mode 100644 index 00000000..68bca864 --- /dev/null +++ b/soul-admin/dist/assets/index-CAf6YeOV.js @@ -0,0 +1,470 @@ +function ty(r,a){for(var l=0;lo[c]})}}}return Object.freeze(Object.defineProperty(r,Symbol.toStringTag,{value:"Module"}))}(function(){const a=document.createElement("link").relList;if(a&&a.supports&&a.supports("modulepreload"))return;for(const c of document.querySelectorAll('link[rel="modulepreload"]'))o(c);new MutationObserver(c=>{for(const u of c)if(u.type==="childList")for(const f of u.addedNodes)f.tagName==="LINK"&&f.rel==="modulepreload"&&o(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 o(c){if(c.ep)return;c.ep=!0;const u=l(c);fetch(c.href,u)}})();function cp(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}var Bc={exports:{}},Ma={},Uc={exports:{}},ze={};/** + * @license React + * react.production.min.js + * + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */var Zh;function ny(){if(Zh)return ze;Zh=1;var r=Symbol.for("react.element"),a=Symbol.for("react.portal"),l=Symbol.for("react.fragment"),o=Symbol.for("react.strict_mode"),c=Symbol.for("react.profiler"),u=Symbol.for("react.provider"),f=Symbol.for("react.context"),p=Symbol.for("react.forward_ref"),x=Symbol.for("react.suspense"),g=Symbol.for("react.memo"),v=Symbol.for("react.lazy"),y=Symbol.iterator;function E(D){return D===null||typeof D!="object"?null:(D=y&&D[y]||D["@@iterator"],typeof D=="function"?D:null)}var _={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},k=Object.assign,w={};function j(D,P,W){this.props=D,this.context=P,this.refs=w,this.updater=W||_}j.prototype.isReactComponent={},j.prototype.setState=function(D,P){if(typeof D!="object"&&typeof D!="function"&&D!=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,D,P,"setState")},j.prototype.forceUpdate=function(D){this.updater.enqueueForceUpdate(this,D,"forceUpdate")};function b(){}b.prototype=j.prototype;function C(D,P,W){this.props=D,this.context=P,this.refs=w,this.updater=W||_}var N=C.prototype=new b;N.constructor=C,k(N,j.prototype),N.isPureReactComponent=!0;var A=Array.isArray,$=Object.prototype.hasOwnProperty,V={current:null},R={key:!0,ref:!0,__self:!0,__source:!0};function T(D,P,W){var re,he={},me=null,se=null;if(P!=null)for(re in P.ref!==void 0&&(se=P.ref),P.key!==void 0&&(me=""+P.key),P)$.call(P,re)&&!R.hasOwnProperty(re)&&(he[re]=P[re]);var pe=arguments.length-2;if(pe===1)he.children=W;else if(1>>1,P=I[D];if(0>>1;Dc(he,B))mec(se,he)?(I[D]=se,I[me]=B,D=me):(I[D]=he,I[re]=B,D=re);else if(mec(se,B))I[D]=se,I[me]=B,D=me;else break e}}return Q}function c(I,Q){var B=I.sortIndex-Q.sortIndex;return B!==0?B:I.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,p=f.now();r.unstable_now=function(){return f.now()-p}}var x=[],g=[],v=1,y=null,E=3,_=!1,k=!1,w=!1,j=typeof setTimeout=="function"?setTimeout:null,b=typeof clearTimeout=="function"?clearTimeout:null,C=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function N(I){for(var Q=l(g);Q!==null;){if(Q.callback===null)o(g);else if(Q.startTime<=I)o(g),Q.sortIndex=Q.expirationTime,a(x,Q);else break;Q=l(g)}}function A(I){if(w=!1,N(I),!k)if(l(x)!==null)k=!0,ee($);else{var Q=l(g);Q!==null&&q(A,Q.startTime-I)}}function $(I,Q){k=!1,w&&(w=!1,b(T),T=-1),_=!0;var B=E;try{for(N(Q),y=l(x);y!==null&&(!(y.expirationTime>Q)||I&&!K());){var D=y.callback;if(typeof D=="function"){y.callback=null,E=y.priorityLevel;var P=D(y.expirationTime<=Q);Q=r.unstable_now(),typeof P=="function"?y.callback=P:y===l(x)&&o(x),N(Q)}else o(x);y=l(x)}if(y!==null)var W=!0;else{var re=l(g);re!==null&&q(A,re.startTime-Q),W=!1}return W}finally{y=null,E=B,_=!1}}var V=!1,R=null,T=-1,F=5,Y=-1;function K(){return!(r.unstable_now()-YI||125D?(I.sortIndex=B,a(g,I),l(x)===null&&I===l(g)&&(w?(b(T),T=-1):w=!0,q(A,B-D))):(I.sortIndex=P,a(x,I),k||_||(k=!0,ee($))),I},r.unstable_shouldYield=K,r.unstable_wrapCallback=function(I){var Q=E;return function(){var B=E;E=Q;try{return I.apply(this,arguments)}finally{E=B}}}})(Hc)),Hc}var sm;function ly(){return sm||(sm=1,Wc.exports=ay()),Wc.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 am;function iy(){if(am)return $t;am=1;var r=Ad(),a=ly();function l(e){for(var n="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,g=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,v={},y={};function E(e){return x.call(y,e)?!0:x.call(v,e)?!1:g.test(e)?y[e]=!0:(v[e]=!0,!1)}function _(e,n,s,i){if(s!==null&&s.type===0)return!1;switch(typeof n){case"function":case"symbol":return!0;case"boolean":return i?!1:s!==null?!s.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function k(e,n,s,i){if(n===null||typeof n>"u"||_(e,n,s,i))return!0;if(i)return!1;if(s!==null)switch(s.type){case 3:return!n;case 4:return n===!1;case 5:return isNaN(n);case 6:return isNaN(n)||1>n}return!1}function w(e,n,s,i,d,m,S){this.acceptsBooleans=n===2||n===3||n===4,this.attributeName=i,this.attributeNamespace=d,this.mustUseProperty=s,this.propertyName=e,this.type=n,this.sanitizeURL=m,this.removeEmptyString=S}var j={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){j[e]=new w(e,0,!1,e,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var n=e[0];j[n]=new w(n,1,!1,e[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(e){j[e]=new w(e,2,!1,e.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){j[e]=new w(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){j[e]=new w(e,3,!1,e.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(e){j[e]=new w(e,3,!0,e,null,!1,!1)}),["capture","download"].forEach(function(e){j[e]=new w(e,4,!1,e,null,!1,!1)}),["cols","rows","size","span"].forEach(function(e){j[e]=new w(e,6,!1,e,null,!1,!1)}),["rowSpan","start"].forEach(function(e){j[e]=new w(e,5,!1,e.toLowerCase(),null,!1,!1)});var b=/[\-:]([a-z])/g;function C(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var n=e.replace(b,C);j[n]=new w(n,1,!1,e,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var n=e.replace(b,C);j[n]=new w(n,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(e){var n=e.replace(b,C);j[n]=new w(n,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(e){j[e]=new w(e,1,!1,e.toLowerCase(),null,!1,!1)}),j.xlinkHref=new w("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(e){j[e]=new w(e,1,!1,e.toLowerCase(),null,!0,!0)});function N(e,n,s,i){var d=j.hasOwnProperty(n)?j[n]:null;(d!==null?d.type!==0:i||!(2M||d[S]!==m[M]){var O=` +`+d[S].replace(" at new "," at ");return e.displayName&&O.includes("")&&(O=O.replace("",e.displayName)),O}while(1<=S&&0<=M);break}}}finally{W=!1,Error.prepareStackTrace=s}return(e=e?e.displayName||e.name:"")?P(e):""}function he(e){switch(e.tag){case 5:return P(e.type);case 16:return P("Lazy");case 13:return P("Suspense");case 19:return P("SuspenseList");case 0:case 2:case 15:return e=re(e.type,!1),e;case 11:return e=re(e.type.render,!1),e;case 1:return e=re(e.type,!0),e;default:return""}}function 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 R:return"Fragment";case V:return"Portal";case F:return"Profiler";case T:return"StrictMode";case ce:return"Suspense";case X:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case K:return(e.displayName||"Context")+".Consumer";case Y:return(e._context.displayName||"Context")+".Provider";case J:var n=e.render;return e=e.displayName,e||(e=n.displayName||n.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case le:return n=e.displayName||null,n!==null?n:me(e.type)||"Memo";case ee:n=e._payload,e=e._init;try{return me(e(n))}catch{}}return null}function se(e){var n=e.type;switch(e.tag){case 24:return"Cache";case 9:return(n.displayName||"Context")+".Consumer";case 10:return(n._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=n.render,e=e.displayName||e.name||"",n.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return n;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return me(n);case 8:return n===T?"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 n=="function")return n.displayName||n.name||null;if(typeof n=="string")return n}return null}function pe(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function L(e){var n=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(n==="checkbox"||n==="radio")}function ue(e){var n=L(e)?"checked":"value",s=Object.getOwnPropertyDescriptor(e.constructor.prototype,n),i=""+e[n];if(!e.hasOwnProperty(n)&&typeof s<"u"&&typeof s.get=="function"&&typeof s.set=="function"){var d=s.get,m=s.set;return Object.defineProperty(e,n,{configurable:!0,get:function(){return d.call(this)},set:function(S){i=""+S,m.call(this,S)}}),Object.defineProperty(e,n,{enumerable:s.enumerable}),{getValue:function(){return i},setValue:function(S){i=""+S},stopTracking:function(){e._valueTracker=null,delete e[n]}}}}function xe(e){e._valueTracker||(e._valueTracker=ue(e))}function Re(e){if(!e)return!1;var n=e._valueTracker;if(!n)return!0;var s=n.getValue(),i="";return e&&(i=L(e)?e.checked?"true":"false":e.value),e=i,e!==s?(n.setValue(e),!0):!1}function De(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 Fe(e,n){var s=n.checked;return B({},n,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:s??e._wrapperState.initialChecked})}function Qe(e,n){var s=n.defaultValue==null?"":n.defaultValue,i=n.checked!=null?n.checked:n.defaultChecked;s=pe(n.value!=null?n.value:s),e._wrapperState={initialChecked:i,initialValue:s,controlled:n.type==="checkbox"||n.type==="radio"?n.checked!=null:n.value!=null}}function st(e,n){n=n.checked,n!=null&&N(e,"checked",n,!1)}function et(e,n){st(e,n);var s=pe(n.value),i=n.type;if(s!=null)i==="number"?(s===0&&e.value===""||e.value!=s)&&(e.value=""+s):e.value!==""+s&&(e.value=""+s);else if(i==="submit"||i==="reset"){e.removeAttribute("value");return}n.hasOwnProperty("value")?Mt(e,n.type,s):n.hasOwnProperty("defaultValue")&&Mt(e,n.type,pe(n.defaultValue)),n.checked==null&&n.defaultChecked!=null&&(e.defaultChecked=!!n.defaultChecked)}function At(e,n,s){if(n.hasOwnProperty("value")||n.hasOwnProperty("defaultValue")){var i=n.type;if(!(i!=="submit"&&i!=="reset"||n.value!==void 0&&n.value!==null))return;n=""+e._wrapperState.initialValue,s||n===e.value||(e.value=n),e.defaultValue=n}s=e.name,s!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,s!==""&&(e.name=s)}function Mt(e,n,s){(n!=="number"||De(e.ownerDocument)!==e)&&(s==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+s&&(e.defaultValue=""+s))}var Ir=Array.isArray;function Xn(e,n,s,i){if(e=e.options,n){n={};for(var d=0;d"+n.valueOf().toString()+"",n=Ue.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;n.firstChild;)e.appendChild(n.firstChild)}});function cn(e,n){if(n){var s=e.firstChild;if(s&&s===e.lastChild&&s.nodeType===3){s.nodeValue=n;return}}e.textContent=n}var Ar={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},a0=["Webkit","ms","Moz","O"];Object.keys(Ar).forEach(function(e){a0.forEach(function(n){n=n+e.charAt(0).toUpperCase()+e.substring(1),Ar[n]=Ar[e]})});function hu(e,n,s){return n==null||typeof n=="boolean"||n===""?"":s||typeof n!="number"||n===0||Ar.hasOwnProperty(e)&&Ar[e]?(""+n).trim():n+"px"}function mu(e,n){e=e.style;for(var s in n)if(n.hasOwnProperty(s)){var i=s.indexOf("--")===0,d=hu(s,n[s],i);s==="float"&&(s="cssFloat"),i?e.setProperty(s,d):e[s]=d}}var l0=B({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 Ji(e,n){if(n){if(l0[e]&&(n.children!=null||n.dangerouslySetInnerHTML!=null))throw Error(l(137,e));if(n.dangerouslySetInnerHTML!=null){if(n.children!=null)throw Error(l(60));if(typeof n.dangerouslySetInnerHTML!="object"||!("__html"in n.dangerouslySetInnerHTML))throw Error(l(61))}if(n.style!=null&&typeof n.style!="object")throw Error(l(62))}}function Zi(e,n){if(e.indexOf("-")===-1)return typeof n.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 eo=null;function to(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var no=null,as=null,ls=null;function pu(e){if(e=ya(e)){if(typeof no!="function")throw Error(l(280));var n=e.stateNode;n&&(n=xl(n),no(e.stateNode,e.type,n))}}function xu(e){as?ls?ls.push(e):ls=[e]:as=e}function gu(){if(as){var e=as,n=ls;if(ls=as=null,pu(e),n)for(e=0;e>>=0,e===0?32:31-(g0(e)/v0|0)|0}var Ja=64,Za=4194304;function ta(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 el(e,n){var s=e.pendingLanes;if(s===0)return 0;var i=0,d=e.suspendedLanes,m=e.pingedLanes,S=s&268435455;if(S!==0){var M=S&~d;M!==0?i=ta(M):(m&=S,m!==0&&(i=ta(m)))}else S=s&~d,S!==0?i=ta(S):m!==0&&(i=ta(m));if(i===0)return 0;if(n!==0&&n!==i&&(n&d)===0&&(d=i&-i,m=n&-n,d>=m||d===16&&(m&4194240)!==0))return n;if((i&4)!==0&&(i|=s&16),n=e.entangledLanes,n!==0)for(e=e.entanglements,n&=i;0s;s++)n.push(e);return n}function na(e,n,s){e.pendingLanes|=n,n!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,n=31-dn(n),e[n]=s}function b0(e,n){var s=e.pendingLanes&~n;e.pendingLanes=n,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=n,e.mutableReadLanes&=n,e.entangledLanes&=n,n=e.entanglements;var i=e.eventTimes;for(e=e.expirationTimes;0=da),Hu=" ",Ku=!1;function Gu(e,n){switch(e){case"keyup":return q0.indexOf(n.keyCode)!==-1;case"keydown":return n.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Yu(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var cs=!1;function J0(e,n){switch(e){case"compositionend":return Yu(n);case"keypress":return n.which!==32?null:(Ku=!0,Hu);case"textInput":return e=n.data,e===Hu&&Ku?null:e;default:return null}}function Z0(e,n){if(cs)return e==="compositionend"||!No&&Gu(e,n)?(e=zu(),al=po=nr=null,cs=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(n.ctrlKey||n.altKey||n.metaKey)||n.ctrlKey&&n.altKey){if(n.char&&1=n)return{node:s,offset:n-e};e=i}e:{for(;s;){if(s.nextSibling){s=s.nextSibling;break e}s=s.parentNode}s=void 0}s=tf(s)}}function rf(e,n){return e&&n?e===n?!0:e&&e.nodeType===3?!1:n&&n.nodeType===3?rf(e,n.parentNode):"contains"in e?e.contains(n):e.compareDocumentPosition?!!(e.compareDocumentPosition(n)&16):!1:!1}function sf(){for(var e=window,n=De();n instanceof e.HTMLIFrameElement;){try{var s=typeof n.contentWindow.location.href=="string"}catch{s=!1}if(s)e=n.contentWindow;else break;n=De(e.document)}return n}function So(e){var n=e&&e.nodeName&&e.nodeName.toLowerCase();return n&&(n==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||n==="textarea"||e.contentEditable==="true")}function ov(e){var n=sf(),s=e.focusedElem,i=e.selectionRange;if(n!==s&&s&&s.ownerDocument&&rf(s.ownerDocument.documentElement,s)){if(i!==null&&So(s)){if(n=i.start,e=i.end,e===void 0&&(e=n),"selectionStart"in s)s.selectionStart=n,s.selectionEnd=Math.min(e,s.value.length);else if(e=(n=s.ownerDocument||document)&&n.defaultView||window,e.getSelection){e=e.getSelection();var d=s.textContent.length,m=Math.min(i.start,d);i=i.end===void 0?m:Math.min(i.end,d),!e.extend&&m>i&&(d=i,i=m,m=d),d=nf(s,m);var S=nf(s,i);d&&S&&(e.rangeCount!==1||e.anchorNode!==d.node||e.anchorOffset!==d.offset||e.focusNode!==S.node||e.focusOffset!==S.offset)&&(n=n.createRange(),n.setStart(d.node,d.offset),e.removeAllRanges(),m>i?(e.addRange(n),e.extend(S.node,S.offset)):(n.setEnd(S.node,S.offset),e.addRange(n)))}}for(n=[],e=s;e=e.parentNode;)e.nodeType===1&&n.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof s.focus=="function"&&s.focus(),s=0;s=document.documentMode,ds=null,Co=null,ma=null,ko=!1;function af(e,n,s){var i=s.window===s?s.document:s.nodeType===9?s:s.ownerDocument;ko||ds==null||ds!==De(i)||(i=ds,"selectionStart"in i&&So(i)?i={start:i.selectionStart,end:i.selectionEnd}:(i=(i.ownerDocument&&i.ownerDocument.defaultView||window).getSelection(),i={anchorNode:i.anchorNode,anchorOffset:i.anchorOffset,focusNode:i.focusNode,focusOffset:i.focusOffset}),ma&&ha(ma,i)||(ma=i,i=hl(Co,"onSelect"),0ps||(e.current=Fo[ps],Fo[ps]=null,ps--)}function qe(e,n){ps++,Fo[ps]=e.current,e.current=n}var lr={},St=ar(lr),Dt=ar(!1),Lr=lr;function xs(e,n){var s=e.type.contextTypes;if(!s)return lr;var i=e.stateNode;if(i&&i.__reactInternalMemoizedUnmaskedChildContext===n)return i.__reactInternalMemoizedMaskedChildContext;var d={},m;for(m in s)d[m]=n[m];return i&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=n,e.__reactInternalMemoizedMaskedChildContext=d),d}function Lt(e){return e=e.childContextTypes,e!=null}function gl(){Je(Dt),Je(St)}function Nf(e,n,s){if(St.current!==lr)throw Error(l(168));qe(St,n),qe(Dt,s)}function bf(e,n,s){var i=e.stateNode;if(n=n.childContextTypes,typeof i.getChildContext!="function")return s;i=i.getChildContext();for(var d in i)if(!(d in n))throw Error(l(108,se(e)||"Unknown",d));return B({},s,i)}function vl(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||lr,Lr=St.current,qe(St,e),qe(Dt,Dt.current),!0}function wf(e,n,s){var i=e.stateNode;if(!i)throw Error(l(169));s?(e=bf(e,n,Lr),i.__reactInternalMemoizedMergedChildContext=e,Je(Dt),Je(St),qe(St,e)):Je(Dt),qe(Dt,s)}var Mn=null,yl=!1,zo=!1;function Sf(e){Mn===null?Mn=[e]:Mn.push(e)}function jv(e){yl=!0,Sf(e)}function ir(){if(!zo&&Mn!==null){zo=!0;var e=0,n=Ye;try{var s=Mn;for(Ye=1;e>=S,d-=S,Dn=1<<32-dn(n)+d|s<Ie?(yt=Te,Te=null):yt=Te.sibling;var He=ae(U,Te,H[Ie],fe);if(He===null){Te===null&&(Te=yt);break}e&&Te&&He.alternate===null&&n(U,Te),z=m(He,z,Ie),_e===null?Ce=He:_e.sibling=He,_e=He,Te=yt}if(Ie===H.length)return s(U,Te),tt&&Fr(U,Ie),Ce;if(Te===null){for(;IeIe?(yt=Te,Te=null):yt=Te.sibling;var xr=ae(U,Te,He.value,fe);if(xr===null){Te===null&&(Te=yt);break}e&&Te&&xr.alternate===null&&n(U,Te),z=m(xr,z,Ie),_e===null?Ce=xr:_e.sibling=xr,_e=xr,Te=yt}if(He.done)return s(U,Te),tt&&Fr(U,Ie),Ce;if(Te===null){for(;!He.done;Ie++,He=H.next())He=de(U,He.value,fe),He!==null&&(z=m(He,z,Ie),_e===null?Ce=He:_e.sibling=He,_e=He);return tt&&Fr(U,Ie),Ce}for(Te=i(U,Te);!He.done;Ie++,He=H.next())He=ge(Te,U,Ie,He.value,fe),He!==null&&(e&&He.alternate!==null&&Te.delete(He.key===null?Ie:He.key),z=m(He,z,Ie),_e===null?Ce=He:_e.sibling=He,_e=He);return e&&Te.forEach(function(ey){return n(U,ey)}),tt&&Fr(U,Ie),Ce}function dt(U,z,H,fe){if(typeof H=="object"&&H!==null&&H.type===R&&H.key===null&&(H=H.props.children),typeof H=="object"&&H!==null){switch(H.$$typeof){case $:e:{for(var Ce=H.key,_e=z;_e!==null;){if(_e.key===Ce){if(Ce=H.type,Ce===R){if(_e.tag===7){s(U,_e.sibling),z=d(_e,H.props.children),z.return=U,U=z;break e}}else if(_e.elementType===Ce||typeof Ce=="object"&&Ce!==null&&Ce.$$typeof===ee&&_f(Ce)===_e.type){s(U,_e.sibling),z=d(_e,H.props),z.ref=ja(U,_e,H),z.return=U,U=z;break e}s(U,_e);break}else n(U,_e);_e=_e.sibling}H.type===R?(z=Kr(H.props.children,U.mode,fe,H.key),z.return=U,U=z):(fe=Gl(H.type,H.key,H.props,null,U.mode,fe),fe.ref=ja(U,z,H),fe.return=U,U=fe)}return S(U);case V:e:{for(_e=H.key;z!==null;){if(z.key===_e)if(z.tag===4&&z.stateNode.containerInfo===H.containerInfo&&z.stateNode.implementation===H.implementation){s(U,z.sibling),z=d(z,H.children||[]),z.return=U,U=z;break e}else{s(U,z);break}else n(U,z);z=z.sibling}z=Lc(H,U.mode,fe),z.return=U,U=z}return S(U);case ee:return _e=H._init,dt(U,z,_e(H._payload),fe)}if(Ir(H))return je(U,z,H,fe);if(Q(H))return Se(U,z,H,fe);wl(U,H)}return typeof H=="string"&&H!==""||typeof H=="number"?(H=""+H,z!==null&&z.tag===6?(s(U,z.sibling),z=d(z,H),z.return=U,U=z):(s(U,z),z=Dc(H,U.mode,fe),z.return=U,U=z),S(U)):s(U,z)}return dt}var js=Tf(!0),If=Tf(!1),Sl=ar(null),Cl=null,Ns=null,Ho=null;function Ko(){Ho=Ns=Cl=null}function Go(e){var n=Sl.current;Je(Sl),e._currentValue=n}function Yo(e,n,s){for(;e!==null;){var i=e.alternate;if((e.childLanes&n)!==n?(e.childLanes|=n,i!==null&&(i.childLanes|=n)):i!==null&&(i.childLanes&n)!==n&&(i.childLanes|=n),e===s)break;e=e.return}}function bs(e,n){Cl=e,Ho=Ns=null,e=e.dependencies,e!==null&&e.firstContext!==null&&((e.lanes&n)!==0&&(Ot=!0),e.firstContext=null)}function en(e){var n=e._currentValue;if(Ho!==e)if(e={context:e,memoizedValue:n,next:null},Ns===null){if(Cl===null)throw Error(l(308));Ns=e,Cl.dependencies={lanes:0,firstContext:e}}else Ns=Ns.next=e;return n}var zr=null;function Qo(e){zr===null?zr=[e]:zr.push(e)}function Af(e,n,s,i){var d=n.interleaved;return d===null?(s.next=s,Qo(n)):(s.next=d.next,d.next=s),n.interleaved=s,On(e,i)}function On(e,n){e.lanes|=n;var s=e.alternate;for(s!==null&&(s.lanes|=n),s=e,e=e.return;e!==null;)e.childLanes|=n,s=e.alternate,s!==null&&(s.childLanes|=n),s=e,e=e.return;return s.tag===3?s.stateNode:null}var or=!1;function qo(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Mf(e,n){e=e.updateQueue,n.updateQueue===e&&(n.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function Fn(e,n){return{eventTime:e,lane:n,tag:0,payload:null,callback:null,next:null}}function cr(e,n,s){var i=e.updateQueue;if(i===null)return null;if(i=i.shared,(Ve&2)!==0){var d=i.pending;return d===null?n.next=n:(n.next=d.next,d.next=n),i.pending=n,On(e,s)}return d=i.interleaved,d===null?(n.next=n,Qo(i)):(n.next=d.next,d.next=n),i.interleaved=n,On(e,s)}function kl(e,n,s){if(n=n.updateQueue,n!==null&&(n=n.shared,(s&4194240)!==0)){var i=n.lanes;i&=e.pendingLanes,s|=i,n.lanes=s,co(e,s)}}function Df(e,n){var s=e.updateQueue,i=e.alternate;if(i!==null&&(i=i.updateQueue,s===i)){var d=null,m=null;if(s=s.firstBaseUpdate,s!==null){do{var S={eventTime:s.eventTime,lane:s.lane,tag:s.tag,payload:s.payload,callback:s.callback,next:null};m===null?d=m=S:m=m.next=S,s=s.next}while(s!==null);m===null?d=m=n:m=m.next=n}else d=m=n;s={baseState:i.baseState,firstBaseUpdate:d,lastBaseUpdate:m,shared:i.shared,effects:i.effects},e.updateQueue=s;return}e=s.lastBaseUpdate,e===null?s.firstBaseUpdate=n:e.next=n,s.lastBaseUpdate=n}function El(e,n,s,i){var d=e.updateQueue;or=!1;var m=d.firstBaseUpdate,S=d.lastBaseUpdate,M=d.shared.pending;if(M!==null){d.shared.pending=null;var O=M,G=O.next;O.next=null,S===null?m=G:S.next=G,S=O;var ie=e.alternate;ie!==null&&(ie=ie.updateQueue,M=ie.lastBaseUpdate,M!==S&&(M===null?ie.firstBaseUpdate=G:M.next=G,ie.lastBaseUpdate=O))}if(m!==null){var de=d.baseState;S=0,ie=G=O=null,M=m;do{var ae=M.lane,ge=M.eventTime;if((i&ae)===ae){ie!==null&&(ie=ie.next={eventTime:ge,lane:0,tag:M.tag,payload:M.payload,callback:M.callback,next:null});e:{var je=e,Se=M;switch(ae=n,ge=s,Se.tag){case 1:if(je=Se.payload,typeof je=="function"){de=je.call(ge,de,ae);break e}de=je;break e;case 3:je.flags=je.flags&-65537|128;case 0:if(je=Se.payload,ae=typeof je=="function"?je.call(ge,de,ae):je,ae==null)break e;de=B({},de,ae);break e;case 2:or=!0}}M.callback!==null&&M.lane!==0&&(e.flags|=64,ae=d.effects,ae===null?d.effects=[M]:ae.push(M))}else ge={eventTime:ge,lane:ae,tag:M.tag,payload:M.payload,callback:M.callback,next:null},ie===null?(G=ie=ge,O=de):ie=ie.next=ge,S|=ae;if(M=M.next,M===null){if(M=d.shared.pending,M===null)break;ae=M,M=ae.next,ae.next=null,d.lastBaseUpdate=ae,d.shared.pending=null}}while(!0);if(ie===null&&(O=de),d.baseState=O,d.firstBaseUpdate=G,d.lastBaseUpdate=ie,n=d.shared.interleaved,n!==null){d=n;do S|=d.lane,d=d.next;while(d!==n)}else m===null&&(d.shared.lanes=0);Ur|=S,e.lanes=S,e.memoizedState=de}}function Lf(e,n,s){if(e=n.effects,n.effects=null,e!==null)for(n=0;ns?s:4,e(!0);var i=tc.transition;tc.transition={};try{e(!1),n()}finally{Ye=s,tc.transition=i}}function th(){return tn().memoizedState}function Sv(e,n,s){var i=hr(e);if(s={lane:i,action:s,hasEagerState:!1,eagerState:null,next:null},nh(e))rh(n,s);else if(s=Af(e,n,s,i),s!==null){var d=Tt();xn(s,e,i,d),sh(s,n,i)}}function Cv(e,n,s){var i=hr(e),d={lane:i,action:s,hasEagerState:!1,eagerState:null,next:null};if(nh(e))rh(n,d);else{var m=e.alternate;if(e.lanes===0&&(m===null||m.lanes===0)&&(m=n.lastRenderedReducer,m!==null))try{var S=n.lastRenderedState,M=m(S,s);if(d.hasEagerState=!0,d.eagerState=M,un(M,S)){var O=n.interleaved;O===null?(d.next=d,Qo(n)):(d.next=O.next,O.next=d),n.interleaved=d;return}}catch{}finally{}s=Af(e,n,d,i),s!==null&&(d=Tt(),xn(s,e,i,d),sh(s,n,i))}}function nh(e){var n=e.alternate;return e===lt||n!==null&&n===lt}function rh(e,n){Sa=_l=!0;var s=e.pending;s===null?n.next=n:(n.next=s.next,s.next=n),e.pending=n}function sh(e,n,s){if((s&4194240)!==0){var i=n.lanes;i&=e.pendingLanes,s|=i,n.lanes=s,co(e,s)}}var Al={readContext:en,useCallback:Ct,useContext:Ct,useEffect:Ct,useImperativeHandle:Ct,useInsertionEffect:Ct,useLayoutEffect:Ct,useMemo:Ct,useReducer:Ct,useRef:Ct,useState:Ct,useDebugValue:Ct,useDeferredValue:Ct,useTransition:Ct,useMutableSource:Ct,useSyncExternalStore:Ct,useId:Ct,unstable_isNewReconciler:!1},kv={readContext:en,useCallback:function(e,n){return Cn().memoizedState=[e,n===void 0?null:n],e},useContext:en,useEffect:Gf,useImperativeHandle:function(e,n,s){return s=s!=null?s.concat([e]):null,Tl(4194308,4,qf.bind(null,n,e),s)},useLayoutEffect:function(e,n){return Tl(4194308,4,e,n)},useInsertionEffect:function(e,n){return Tl(4,2,e,n)},useMemo:function(e,n){var s=Cn();return n=n===void 0?null:n,e=e(),s.memoizedState=[e,n],e},useReducer:function(e,n,s){var i=Cn();return n=s!==void 0?s(n):n,i.memoizedState=i.baseState=n,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:n},i.queue=e,e=e.dispatch=Sv.bind(null,lt,e),[i.memoizedState,e]},useRef:function(e){var n=Cn();return e={current:e},n.memoizedState=e},useState:Hf,useDebugValue:oc,useDeferredValue:function(e){return Cn().memoizedState=e},useTransition:function(){var e=Hf(!1),n=e[0];return e=wv.bind(null,e[1]),Cn().memoizedState=e,[n,e]},useMutableSource:function(){},useSyncExternalStore:function(e,n,s){var i=lt,d=Cn();if(tt){if(s===void 0)throw Error(l(407));s=s()}else{if(s=n(),vt===null)throw Error(l(349));(Br&30)!==0||$f(i,n,s)}d.memoizedState=s;var m={value:s,getSnapshot:n};return d.queue=m,Gf(Uf.bind(null,i,m,e),[e]),i.flags|=2048,Ea(9,Bf.bind(null,i,m,s,n),void 0,null),s},useId:function(){var e=Cn(),n=vt.identifierPrefix;if(tt){var s=Ln,i=Dn;s=(i&~(1<<32-dn(i)-1)).toString(32)+s,n=":"+n+"R"+s,s=Ca++,0<\/script>",e=e.removeChild(e.firstChild)):typeof i.is=="string"?e=S.createElement(s,{is:i.is}):(e=S.createElement(s),s==="select"&&(S=e,i.multiple?S.multiple=!0:i.size&&(S.size=i.size))):e=S.createElementNS(e,s),e[wn]=n,e[va]=i,Sh(e,n,!1,!1),n.stateNode=e;e:{switch(S=Zi(s,i),s){case"dialog":Xe("cancel",e),Xe("close",e),d=i;break;case"iframe":case"object":case"embed":Xe("load",e),d=i;break;case"video":case"audio":for(d=0;dEs&&(n.flags|=128,i=!0,Pa(m,!1),n.lanes=4194304)}else{if(!i)if(e=Pl(S),e!==null){if(n.flags|=128,i=!0,s=e.updateQueue,s!==null&&(n.updateQueue=s,n.flags|=4),Pa(m,!0),m.tail===null&&m.tailMode==="hidden"&&!S.alternate&&!tt)return kt(n),null}else 2*ct()-m.renderingStartTime>Es&&s!==1073741824&&(n.flags|=128,i=!0,Pa(m,!1),n.lanes=4194304);m.isBackwards?(S.sibling=n.child,n.child=S):(s=m.last,s!==null?s.sibling=S:n.child=S,m.last=S)}return m.tail!==null?(n=m.tail,m.rendering=n,m.tail=n.sibling,m.renderingStartTime=ct(),n.sibling=null,s=at.current,qe(at,i?s&1|2:s&1),n):(kt(n),null);case 22:case 23:return Ic(),i=n.memoizedState!==null,e!==null&&e.memoizedState!==null!==i&&(n.flags|=8192),i&&(n.mode&1)!==0?(Yt&1073741824)!==0&&(kt(n),n.subtreeFlags&6&&(n.flags|=8192)):kt(n),null;case 24:return null;case 25:return null}throw Error(l(156,n.tag))}function Mv(e,n){switch(Bo(n),n.tag){case 1:return Lt(n.type)&&gl(),e=n.flags,e&65536?(n.flags=e&-65537|128,n):null;case 3:return ws(),Je(Dt),Je(St),ec(),e=n.flags,(e&65536)!==0&&(e&128)===0?(n.flags=e&-65537|128,n):null;case 5:return Jo(n),null;case 13:if(Je(at),e=n.memoizedState,e!==null&&e.dehydrated!==null){if(n.alternate===null)throw Error(l(340));ys()}return e=n.flags,e&65536?(n.flags=e&-65537|128,n):null;case 19:return Je(at),null;case 4:return ws(),null;case 10:return Go(n.type._context),null;case 22:case 23:return Ic(),null;case 24:return null;default:return null}}var Ol=!1,Et=!1,Dv=typeof WeakSet=="function"?WeakSet:Set,ve=null;function Cs(e,n){var s=e.ref;if(s!==null)if(typeof s=="function")try{s(null)}catch(i){it(e,n,i)}else s.current=null}function jc(e,n,s){try{s()}catch(i){it(e,n,i)}}var Eh=!1;function Lv(e,n){if(Io=rl,e=sf(),So(e)){if("selectionStart"in e)var s={start:e.selectionStart,end:e.selectionEnd};else e:{s=(s=e.ownerDocument)&&s.defaultView||window;var i=s.getSelection&&s.getSelection();if(i&&i.rangeCount!==0){s=i.anchorNode;var d=i.anchorOffset,m=i.focusNode;i=i.focusOffset;try{s.nodeType,m.nodeType}catch{s=null;break e}var S=0,M=-1,O=-1,G=0,ie=0,de=e,ae=null;t:for(;;){for(var ge;de!==s||d!==0&&de.nodeType!==3||(M=S+d),de!==m||i!==0&&de.nodeType!==3||(O=S+i),de.nodeType===3&&(S+=de.nodeValue.length),(ge=de.firstChild)!==null;)ae=de,de=ge;for(;;){if(de===e)break t;if(ae===s&&++G===d&&(M=S),ae===m&&++ie===i&&(O=S),(ge=de.nextSibling)!==null)break;de=ae,ae=de.parentNode}de=ge}s=M===-1||O===-1?null:{start:M,end:O}}else s=null}s=s||{start:0,end:0}}else s=null;for(Ao={focusedElem:e,selectionRange:s},rl=!1,ve=n;ve!==null;)if(n=ve,e=n.child,(n.subtreeFlags&1028)!==0&&e!==null)e.return=n,ve=e;else for(;ve!==null;){n=ve;try{var je=n.alternate;if((n.flags&1024)!==0)switch(n.tag){case 0:case 11:case 15:break;case 1:if(je!==null){var Se=je.memoizedProps,dt=je.memoizedState,U=n.stateNode,z=U.getSnapshotBeforeUpdate(n.elementType===n.type?Se:hn(n.type,Se),dt);U.__reactInternalSnapshotBeforeUpdate=z}break;case 3:var H=n.stateNode.containerInfo;H.nodeType===1?H.textContent="":H.nodeType===9&&H.documentElement&&H.removeChild(H.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(l(163))}}catch(fe){it(n,n.return,fe)}if(e=n.sibling,e!==null){e.return=n.return,ve=e;break}ve=n.return}return je=Eh,Eh=!1,je}function Ra(e,n,s){var i=n.updateQueue;if(i=i!==null?i.lastEffect:null,i!==null){var d=i=i.next;do{if((d.tag&e)===e){var m=d.destroy;d.destroy=void 0,m!==void 0&&jc(n,s,m)}d=d.next}while(d!==i)}}function Fl(e,n){if(n=n.updateQueue,n=n!==null?n.lastEffect:null,n!==null){var s=n=n.next;do{if((s.tag&e)===e){var i=s.create;s.destroy=i()}s=s.next}while(s!==n)}}function Nc(e){var n=e.ref;if(n!==null){var s=e.stateNode;switch(e.tag){case 5:e=s;break;default:e=s}typeof n=="function"?n(e):n.current=e}}function Ph(e){var n=e.alternate;n!==null&&(e.alternate=null,Ph(n)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(n=e.stateNode,n!==null&&(delete n[wn],delete n[va],delete n[Oo],delete n[vv],delete n[yv])),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 Rh(e){return e.tag===5||e.tag===3||e.tag===4}function _h(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Rh(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 bc(e,n,s){var i=e.tag;if(i===5||i===6)e=e.stateNode,n?s.nodeType===8?s.parentNode.insertBefore(e,n):s.insertBefore(e,n):(s.nodeType===8?(n=s.parentNode,n.insertBefore(e,s)):(n=s,n.appendChild(e)),s=s._reactRootContainer,s!=null||n.onclick!==null||(n.onclick=pl));else if(i!==4&&(e=e.child,e!==null))for(bc(e,n,s),e=e.sibling;e!==null;)bc(e,n,s),e=e.sibling}function wc(e,n,s){var i=e.tag;if(i===5||i===6)e=e.stateNode,n?s.insertBefore(e,n):s.appendChild(e);else if(i!==4&&(e=e.child,e!==null))for(wc(e,n,s),e=e.sibling;e!==null;)wc(e,n,s),e=e.sibling}var bt=null,mn=!1;function dr(e,n,s){for(s=s.child;s!==null;)Th(e,n,s),s=s.sibling}function Th(e,n,s){if(bn&&typeof bn.onCommitFiberUnmount=="function")try{bn.onCommitFiberUnmount(Xa,s)}catch{}switch(s.tag){case 5:Et||Cs(s,n);case 6:var i=bt,d=mn;bt=null,dr(e,n,s),bt=i,mn=d,bt!==null&&(mn?(e=bt,s=s.stateNode,e.nodeType===8?e.parentNode.removeChild(s):e.removeChild(s)):bt.removeChild(s.stateNode));break;case 18:bt!==null&&(mn?(e=bt,s=s.stateNode,e.nodeType===8?Lo(e.parentNode,s):e.nodeType===1&&Lo(e,s),ia(e)):Lo(bt,s.stateNode));break;case 4:i=bt,d=mn,bt=s.stateNode.containerInfo,mn=!0,dr(e,n,s),bt=i,mn=d;break;case 0:case 11:case 14:case 15:if(!Et&&(i=s.updateQueue,i!==null&&(i=i.lastEffect,i!==null))){d=i=i.next;do{var m=d,S=m.destroy;m=m.tag,S!==void 0&&((m&2)!==0||(m&4)!==0)&&jc(s,n,S),d=d.next}while(d!==i)}dr(e,n,s);break;case 1:if(!Et&&(Cs(s,n),i=s.stateNode,typeof i.componentWillUnmount=="function"))try{i.props=s.memoizedProps,i.state=s.memoizedState,i.componentWillUnmount()}catch(M){it(s,n,M)}dr(e,n,s);break;case 21:dr(e,n,s);break;case 22:s.mode&1?(Et=(i=Et)||s.memoizedState!==null,dr(e,n,s),Et=i):dr(e,n,s);break;default:dr(e,n,s)}}function Ih(e){var n=e.updateQueue;if(n!==null){e.updateQueue=null;var s=e.stateNode;s===null&&(s=e.stateNode=new Dv),n.forEach(function(i){var d=Hv.bind(null,e,i);s.has(i)||(s.add(i),i.then(d,d))})}}function pn(e,n){var s=n.deletions;if(s!==null)for(var i=0;id&&(d=S),i&=~m}if(i=d,i=ct()-i,i=(120>i?120:480>i?480:1080>i?1080:1920>i?1920:3e3>i?3e3:4320>i?4320:1960*Fv(i/1960))-i,10e?16:e,fr===null)var i=!1;else{if(e=fr,fr=null,Vl=0,(Ve&6)!==0)throw Error(l(331));var d=Ve;for(Ve|=4,ve=e.current;ve!==null;){var m=ve,S=m.child;if((ve.flags&16)!==0){var M=m.deletions;if(M!==null){for(var O=0;Oct()-kc?Wr(e,0):Cc|=s),zt(e,n)}function Hh(e,n){n===0&&((e.mode&1)===0?n=1:(n=Za,Za<<=1,(Za&130023424)===0&&(Za=4194304)));var s=Tt();e=On(e,n),e!==null&&(na(e,n,s),zt(e,s))}function Wv(e){var n=e.memoizedState,s=0;n!==null&&(s=n.retryLane),Hh(e,s)}function Hv(e,n){var s=0;switch(e.tag){case 13:var i=e.stateNode,d=e.memoizedState;d!==null&&(s=d.retryLane);break;case 19:i=e.stateNode;break;default:throw Error(l(314))}i!==null&&i.delete(n),Hh(e,s)}var Kh;Kh=function(e,n,s){if(e!==null)if(e.memoizedProps!==n.pendingProps||Dt.current)Ot=!0;else{if((e.lanes&s)===0&&(n.flags&128)===0)return Ot=!1,Iv(e,n,s);Ot=(e.flags&131072)!==0}else Ot=!1,tt&&(n.flags&1048576)!==0&&Cf(n,Nl,n.index);switch(n.lanes=0,n.tag){case 2:var i=n.type;Ll(e,n),e=n.pendingProps;var d=xs(n,St.current);bs(n,s),d=rc(null,n,i,e,d,s);var m=sc();return n.flags|=1,typeof d=="object"&&d!==null&&typeof d.render=="function"&&d.$$typeof===void 0?(n.tag=1,n.memoizedState=null,n.updateQueue=null,Lt(i)?(m=!0,vl(n)):m=!1,n.memoizedState=d.state!==null&&d.state!==void 0?d.state:null,qo(n),d.updater=Ml,n.stateNode=d,d._reactInternals=n,dc(n,i,e,s),n=mc(null,n,i,!0,m,s)):(n.tag=0,tt&&m&&$o(n),_t(null,n,d,s),n=n.child),n;case 16:i=n.elementType;e:{switch(Ll(e,n),e=n.pendingProps,d=i._init,i=d(i._payload),n.type=i,d=n.tag=Gv(i),e=hn(i,e),d){case 0:n=hc(null,n,i,e,s);break e;case 1:n=vh(null,n,i,e,s);break e;case 11:n=hh(null,n,i,e,s);break e;case 14:n=mh(null,n,i,hn(i.type,e),s);break e}throw Error(l(306,i,""))}return n;case 0:return i=n.type,d=n.pendingProps,d=n.elementType===i?d:hn(i,d),hc(e,n,i,d,s);case 1:return i=n.type,d=n.pendingProps,d=n.elementType===i?d:hn(i,d),vh(e,n,i,d,s);case 3:e:{if(yh(n),e===null)throw Error(l(387));i=n.pendingProps,m=n.memoizedState,d=m.element,Mf(e,n),El(n,i,null,s);var S=n.memoizedState;if(i=S.element,m.isDehydrated)if(m={element:i,isDehydrated:!1,cache:S.cache,pendingSuspenseBoundaries:S.pendingSuspenseBoundaries,transitions:S.transitions},n.updateQueue.baseState=m,n.memoizedState=m,n.flags&256){d=Ss(Error(l(423)),n),n=jh(e,n,i,s,d);break e}else if(i!==d){d=Ss(Error(l(424)),n),n=jh(e,n,i,s,d);break e}else for(Gt=sr(n.stateNode.containerInfo.firstChild),Kt=n,tt=!0,fn=null,s=If(n,null,i,s),n.child=s;s;)s.flags=s.flags&-3|4096,s=s.sibling;else{if(ys(),i===d){n=zn(e,n,s);break e}_t(e,n,i,s)}n=n.child}return n;case 5:return Of(n),e===null&&Vo(n),i=n.type,d=n.pendingProps,m=e!==null?e.memoizedProps:null,S=d.children,Mo(i,d)?S=null:m!==null&&Mo(i,m)&&(n.flags|=32),gh(e,n),_t(e,n,S,s),n.child;case 6:return e===null&&Vo(n),null;case 13:return Nh(e,n,s);case 4:return Xo(n,n.stateNode.containerInfo),i=n.pendingProps,e===null?n.child=js(n,null,i,s):_t(e,n,i,s),n.child;case 11:return i=n.type,d=n.pendingProps,d=n.elementType===i?d:hn(i,d),hh(e,n,i,d,s);case 7:return _t(e,n,n.pendingProps,s),n.child;case 8:return _t(e,n,n.pendingProps.children,s),n.child;case 12:return _t(e,n,n.pendingProps.children,s),n.child;case 10:e:{if(i=n.type._context,d=n.pendingProps,m=n.memoizedProps,S=d.value,qe(Sl,i._currentValue),i._currentValue=S,m!==null)if(un(m.value,S)){if(m.children===d.children&&!Dt.current){n=zn(e,n,s);break e}}else for(m=n.child,m!==null&&(m.return=n);m!==null;){var M=m.dependencies;if(M!==null){S=m.child;for(var O=M.firstContext;O!==null;){if(O.context===i){if(m.tag===1){O=Fn(-1,s&-s),O.tag=2;var G=m.updateQueue;if(G!==null){G=G.shared;var ie=G.pending;ie===null?O.next=O:(O.next=ie.next,ie.next=O),G.pending=O}}m.lanes|=s,O=m.alternate,O!==null&&(O.lanes|=s),Yo(m.return,s,n),M.lanes|=s;break}O=O.next}}else if(m.tag===10)S=m.type===n.type?null:m.child;else if(m.tag===18){if(S=m.return,S===null)throw Error(l(341));S.lanes|=s,M=S.alternate,M!==null&&(M.lanes|=s),Yo(S,s,n),S=m.sibling}else S=m.child;if(S!==null)S.return=m;else for(S=m;S!==null;){if(S===n){S=null;break}if(m=S.sibling,m!==null){m.return=S.return,S=m;break}S=S.return}m=S}_t(e,n,d.children,s),n=n.child}return n;case 9:return d=n.type,i=n.pendingProps.children,bs(n,s),d=en(d),i=i(d),n.flags|=1,_t(e,n,i,s),n.child;case 14:return i=n.type,d=hn(i,n.pendingProps),d=hn(i.type,d),mh(e,n,i,d,s);case 15:return ph(e,n,n.type,n.pendingProps,s);case 17:return i=n.type,d=n.pendingProps,d=n.elementType===i?d:hn(i,d),Ll(e,n),n.tag=1,Lt(i)?(e=!0,vl(n)):e=!1,bs(n,s),lh(n,i,d),dc(n,i,d,s),mc(null,n,i,!0,e,s);case 19:return wh(e,n,s);case 22:return xh(e,n,s)}throw Error(l(156,n.tag))};function Gh(e,n){return Cu(e,n)}function Kv(e,n,s,i){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=n,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=i,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function rn(e,n,s,i){return new Kv(e,n,s,i)}function Mc(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Gv(e){if(typeof e=="function")return Mc(e)?1:0;if(e!=null){if(e=e.$$typeof,e===J)return 11;if(e===le)return 14}return 2}function pr(e,n){var s=e.alternate;return s===null?(s=rn(e.tag,n,e.key,e.mode),s.elementType=e.elementType,s.type=e.type,s.stateNode=e.stateNode,s.alternate=e,e.alternate=s):(s.pendingProps=n,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,n=e.dependencies,s.dependencies=n===null?null:{lanes:n.lanes,firstContext:n.firstContext},s.sibling=e.sibling,s.index=e.index,s.ref=e.ref,s}function Gl(e,n,s,i,d,m){var S=2;if(i=e,typeof e=="function")Mc(e)&&(S=1);else if(typeof e=="string")S=5;else e:switch(e){case R:return Kr(s.children,d,m,n);case T:S=8,d|=8;break;case F:return e=rn(12,s,n,d|2),e.elementType=F,e.lanes=m,e;case ce:return e=rn(13,s,n,d),e.elementType=ce,e.lanes=m,e;case X:return e=rn(19,s,n,d),e.elementType=X,e.lanes=m,e;case q:return Yl(s,d,m,n);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case Y:S=10;break e;case K:S=9;break e;case J:S=11;break e;case le:S=14;break e;case ee:S=16,i=null;break e}throw Error(l(130,e==null?e:typeof e,""))}return n=rn(S,s,n,d),n.elementType=e,n.type=i,n.lanes=m,n}function Kr(e,n,s,i){return e=rn(7,e,i,n),e.lanes=s,e}function Yl(e,n,s,i){return e=rn(22,e,i,n),e.elementType=q,e.lanes=s,e.stateNode={isHidden:!1},e}function Dc(e,n,s){return e=rn(6,e,null,n),e.lanes=s,e}function Lc(e,n,s){return n=rn(4,e.children!==null?e.children:[],e.key,n),n.lanes=s,n.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},n}function Yv(e,n,s,i,d){this.tag=n,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=oo(0),this.expirationTimes=oo(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=oo(0),this.identifierPrefix=i,this.onRecoverableError=d,this.mutableSourceEagerHydrationData=null}function Oc(e,n,s,i,d,m,S,M,O){return e=new Yv(e,n,s,M,O),n===1?(n=1,m===!0&&(n|=8)):n=0,m=rn(3,null,null,n),e.current=m,m.stateNode=e,m.memoizedState={element:i,isDehydrated:s,cache:null,transitions:null,pendingSuspenseBoundaries:null},qo(m),e}function Qv(e,n,s){var i=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(r)}catch(a){console.error(a)}}return r(),Vc.exports=iy(),Vc.exports}var im;function oy(){if(im)return ti;im=1;var r=dp();return ti.createRoot=r.createRoot,ti.hydrateRoot=r.hydrateRoot,ti}var cy=oy(),Ua=dp();const dy=cp(Ua);/** + * @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 Oa(){return Oa=Object.assign?Object.assign.bind():function(r){for(var a=1;a"u")throw new Error(a)}function Md(r,a){if(!r){typeof console<"u"&&console.warn(a);try{throw new Error(a)}catch{}}}function fy(){return Math.random().toString(36).substr(2,8)}function cm(r,a){return{usr:r.state,key:r.key,idx:a}}function dd(r,a,l,o){return l===void 0&&(l=null),Oa({pathname:typeof r=="string"?r:r.pathname,search:"",hash:""},typeof a=="string"?$s(a):a,{state:l,key:a&&a.key||o||fy()})}function vi(r){let{pathname:a="/",search:l="",hash:o=""}=r;return l&&l!=="?"&&(a+=l.charAt(0)==="?"?l:"?"+l),o&&o!=="#"&&(a+=o.charAt(0)==="#"?o:"#"+o),a}function $s(r){let a={};if(r){let l=r.indexOf("#");l>=0&&(a.hash=r.substr(l),r=r.substr(0,l));let o=r.indexOf("?");o>=0&&(a.search=r.substr(o),r=r.substr(0,o)),r&&(a.pathname=r)}return a}function hy(r,a,l,o){o===void 0&&(o={});let{window:c=document.defaultView,v5Compat:u=!1}=o,f=c.history,p=Nr.Pop,x=null,g=v();g==null&&(g=0,f.replaceState(Oa({},f.state,{idx:g}),""));function v(){return(f.state||{idx:null}).idx}function y(){p=Nr.Pop;let j=v(),b=j==null?null:j-g;g=j,x&&x({action:p,location:w.location,delta:b})}function E(j,b){p=Nr.Push;let C=dd(w.location,j,b);g=v()+1;let N=cm(C,g),A=w.createHref(C);try{f.pushState(N,"",A)}catch($){if($ instanceof DOMException&&$.name==="DataCloneError")throw $;c.location.assign(A)}u&&x&&x({action:p,location:w.location,delta:1})}function _(j,b){p=Nr.Replace;let C=dd(w.location,j,b);g=v();let N=cm(C,g),A=w.createHref(C);f.replaceState(N,"",A),u&&x&&x({action:p,location:w.location,delta:0})}function k(j){let b=c.location.origin!=="null"?c.location.origin:c.location.href,C=typeof j=="string"?j:vi(j);return C=C.replace(/ $/,"%20"),ut(b,"No window.location.(origin|href) available to create URL for href: "+C),new URL(C,b)}let w={get action(){return p},get location(){return r(c,f)},listen(j){if(x)throw new Error("A history only accepts one active listener");return c.addEventListener(om,y),x=j,()=>{c.removeEventListener(om,y),x=null}},createHref(j){return a(c,j)},createURL:k,encodeLocation(j){let b=k(j);return{pathname:b.pathname,search:b.search,hash:b.hash}},push:E,replace:_,go(j){return f.go(j)}};return w}var dm;(function(r){r.data="data",r.deferred="deferred",r.redirect="redirect",r.error="error"})(dm||(dm={}));function my(r,a,l){return l===void 0&&(l="/"),py(r,a,l)}function py(r,a,l,o){let c=typeof a=="string"?$s(a):a,u=Dd(c.pathname||"/",l);if(u==null)return null;let f=up(r);xy(f);let p=null;for(let x=0;p==null&&x{let x={relativePath:p===void 0?u.path||"":p,caseSensitive:u.caseSensitive===!0,childrenIndex:f,route:u};x.relativePath.startsWith("/")&&(ut(x.relativePath.startsWith(o),'Absolute route path "'+x.relativePath+'" nested under path '+('"'+o+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),x.relativePath=x.relativePath.slice(o.length));let g=br([o,x.relativePath]),v=l.concat(x);u.children&&u.children.length>0&&(ut(u.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+g+'".')),up(u.children,a,v,g)),!(u.path==null&&!u.index)&&a.push({path:g,score:wy(g,u.index),routesMeta:v})};return r.forEach((u,f)=>{var p;if(u.path===""||!((p=u.path)!=null&&p.includes("?")))c(u,f);else for(let x of fp(u.path))c(u,f,x)}),a}function fp(r){let a=r.split("/");if(a.length===0)return[];let[l,...o]=a,c=l.endsWith("?"),u=l.replace(/\?$/,"");if(o.length===0)return c?[u,""]:[u];let f=fp(o.join("/")),p=[];return p.push(...f.map(x=>x===""?u:[u,x].join("/"))),c&&p.push(...f),p.map(x=>r.startsWith("/")&&x===""?"/":x)}function xy(r){r.sort((a,l)=>a.score!==l.score?l.score-a.score:Sy(a.routesMeta.map(o=>o.childrenIndex),l.routesMeta.map(o=>o.childrenIndex)))}const gy=/^:[\w-]+$/,vy=3,yy=2,jy=1,Ny=10,by=-2,um=r=>r==="*";function wy(r,a){let l=r.split("/"),o=l.length;return l.some(um)&&(o+=by),a&&(o+=yy),l.filter(c=>!um(c)).reduce((c,u)=>c+(gy.test(u)?vy:u===""?jy:Ny),o)}function Sy(r,a){return r.length===a.length&&r.slice(0,-1).every((o,c)=>o===a[c])?r[r.length-1]-a[a.length-1]:0}function Cy(r,a,l){let{routesMeta:o}=r,c={},u="/",f=[];for(let p=0;p{let{paramName:E,isOptional:_}=v;if(E==="*"){let w=p[y]||"";f=u.slice(0,u.length-w.length).replace(/(.)\/+$/,"$1")}const k=p[y];return _&&!k?g[E]=void 0:g[E]=(k||"").replace(/%2F/g,"/"),g},{}),pathname:u,pathnameBase:f,pattern:r}}function Ey(r,a,l){a===void 0&&(a=!1),l===void 0&&(l=!0),Md(r==="*"||!r.endsWith("*")||r.endsWith("/*"),'Route path "'+r+'" will be treated as if it were '+('"'+r.replace(/\*$/,"/*")+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+('please change the route path to "'+r.replace(/\*$/,"/*")+'".'));let o=[],c="^"+r.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(f,p,x)=>(o.push({paramName:p,isOptional:x!=null}),x?"/?([^\\/]+)?":"/([^\\/]+)"));return r.endsWith("*")?(o.push({paramName:"*"}),c+=r==="*"||r==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):l?c+="\\/*$":r!==""&&r!=="/"&&(c+="(?:(?=\\/|$))"),[new RegExp(c,a?void 0:"i"),o]}function Py(r){try{return r.split("/").map(a=>decodeURIComponent(a).replace(/\//g,"%2F")).join("/")}catch(a){return Md(!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 Dd(r,a){if(a==="/")return r;if(!r.toLowerCase().startsWith(a.toLowerCase()))return null;let l=a.endsWith("/")?a.length-1:a.length,o=r.charAt(l);return o&&o!=="/"?null:r.slice(l)||"/"}const Ry=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,_y=r=>Ry.test(r);function Ty(r,a){a===void 0&&(a="/");let{pathname:l,search:o="",hash:c=""}=typeof r=="string"?$s(r):r,u;if(l)if(_y(l))u=l;else{if(l.includes("//")){let f=l;l=l.replace(/\/\/+/g,"/"),Md(!1,"Pathnames cannot have embedded double slashes - normalizing "+(f+" -> "+l))}l.startsWith("/")?u=fm(l.substring(1),"/"):u=fm(l,a)}else u=a;return{pathname:u,search:My(o),hash:Dy(c)}}function fm(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 Kc(r,a,l,o){return"Cannot include a '"+r+"' character in a manually specified "+("`to."+a+"` field ["+JSON.stringify(o)+"]. Please separate it out to the ")+("`to."+l+"` field. Alternatively you may provide the full path as ")+'a string in and the router will parse it for you.'}function Iy(r){return r.filter((a,l)=>l===0||a.route.path&&a.route.path.length>0)}function Ld(r,a){let l=Iy(r);return a?l.map((o,c)=>c===l.length-1?o.pathname:o.pathnameBase):l.map(o=>o.pathnameBase)}function Od(r,a,l,o){o===void 0&&(o=!1);let c;typeof r=="string"?c=$s(r):(c=Oa({},r),ut(!c.pathname||!c.pathname.includes("?"),Kc("?","pathname","search",c)),ut(!c.pathname||!c.pathname.includes("#"),Kc("#","pathname","hash",c)),ut(!c.search||!c.search.includes("#"),Kc("#","search","hash",c)));let u=r===""||c.pathname==="",f=u?"/":c.pathname,p;if(f==null)p=l;else{let y=a.length-1;if(!o&&f.startsWith("..")){let E=f.split("/");for(;E[0]==="..";)E.shift(),y-=1;c.pathname=E.join("/")}p=y>=0?a[y]:"/"}let x=Ty(c,p),g=f&&f!=="/"&&f.endsWith("/"),v=(u||f===".")&&l.endsWith("/");return!x.pathname.endsWith("/")&&(g||v)&&(x.pathname+="/"),x}const br=r=>r.join("/").replace(/\/\/+/g,"/"),Ay=r=>r.replace(/\/+$/,"").replace(/^\/*/,"/"),My=r=>!r||r==="?"?"":r.startsWith("?")?r:"?"+r,Dy=r=>!r||r==="#"?"":r.startsWith("#")?r:"#"+r;function Ly(r){return r!=null&&typeof r.status=="number"&&typeof r.statusText=="string"&&typeof r.internal=="boolean"&&"data"in r}const hp=["post","put","patch","delete"];new Set(hp);const Oy=["get",...hp];new Set(Oy);/** + * 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 Fa(){return Fa=Object.assign?Object.assign.bind():function(r){for(var a=1;a{p.current=!0}),h.useCallback(function(g,v){if(v===void 0&&(v={}),!p.current)return;if(typeof g=="number"){o.go(g);return}let y=Od(g,JSON.parse(f),u,v.relative==="path");r==null&&a!=="/"&&(y.pathname=y.pathname==="/"?a:br([a,y.pathname])),(v.replace?o.replace:o.push)(y,v.state,v)},[a,o,f,u,r])}const By=h.createContext(null);function Uy(r){let a=h.useContext(Gn).outlet;return a&&h.createElement(By.Provider,{value:r},a)}function xp(r,a){let{relative:l}=a===void 0?{}:a,{future:o}=h.useContext(Pr),{matches:c}=h.useContext(Gn),{pathname:u}=rs(),f=JSON.stringify(Ld(c,o.v7_relativeSplatPath));return h.useMemo(()=>Od(r,JSON.parse(f),u,l==="path"),[r,f,u,l])}function Vy(r,a){return Wy(r,a)}function Wy(r,a,l,o){Bs()||ut(!1);let{navigator:c}=h.useContext(Pr),{matches:u}=h.useContext(Gn),f=u[u.length-1],p=f?f.params:{};f&&f.pathname;let x=f?f.pathnameBase:"/";f&&f.route;let g=rs(),v;if(a){var y;let j=typeof a=="string"?$s(a):a;x==="/"||(y=j.pathname)!=null&&y.startsWith(x)||ut(!1),v=j}else v=g;let E=v.pathname||"/",_=E;if(x!=="/"){let j=x.replace(/^\//,"").split("/");_="/"+E.replace(/^\//,"").split("/").slice(j.length).join("/")}let k=my(r,{pathname:_}),w=Qy(k&&k.map(j=>Object.assign({},j,{params:Object.assign({},p,j.params),pathname:br([x,c.encodeLocation?c.encodeLocation(j.pathname).pathname:j.pathname]),pathnameBase:j.pathnameBase==="/"?x:br([x,c.encodeLocation?c.encodeLocation(j.pathnameBase).pathname:j.pathnameBase])})),u,l,o);return a&&w?h.createElement(Ai.Provider,{value:{location:Fa({pathname:"/",search:"",hash:"",state:null,key:"default"},v),navigationType:Nr.Pop}},w):w}function Hy(){let r=Zy(),a=Ly(r)?r.status+" "+r.statusText:r instanceof Error?r.message:JSON.stringify(r),l=r instanceof Error?r.stack:null,c={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return h.createElement(h.Fragment,null,h.createElement("h2",null,"Unexpected Application Error!"),h.createElement("h3",{style:{fontStyle:"italic"}},a),l?h.createElement("pre",{style:c},l):null,null)}const Ky=h.createElement(Hy,null);class Gy extends h.Component{constructor(a){super(a),this.state={location:a.location,revalidation:a.revalidation,error:a.error}}static getDerivedStateFromError(a){return{error:a}}static getDerivedStateFromProps(a,l){return l.location!==a.location||l.revalidation!=="idle"&&a.revalidation==="idle"?{error:a.error,location:a.location,revalidation:a.revalidation}:{error:a.error!==void 0?a.error:l.error,location:l.location,revalidation:a.revalidation||l.revalidation}}componentDidCatch(a,l){console.error("React Router caught the following error during render",a,l)}render(){return this.state.error!==void 0?h.createElement(Gn.Provider,{value:this.props.routeContext},h.createElement(mp.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function Yy(r){let{routeContext:a,match:l,children:o}=r,c=h.useContext(Fd);return c&&c.static&&c.staticContext&&(l.route.errorElement||l.route.ErrorBoundary)&&(c.staticContext._deepestRenderedBoundaryId=l.route.id),h.createElement(Gn.Provider,{value:a},o)}function Qy(r,a,l,o){var c;if(a===void 0&&(a=[]),l===void 0&&(l=null),o===void 0&&(o=null),r==null){var u;if(!l)return null;if(l.errors)r=l.matches;else if((u=o)!=null&&u.v7_partialHydration&&a.length===0&&!l.initialized&&l.matches.length>0)r=l.matches;else return null}let f=r,p=(c=l)==null?void 0:c.errors;if(p!=null){let v=f.findIndex(y=>y.route.id&&(p==null?void 0:p[y.route.id])!==void 0);v>=0||ut(!1),f=f.slice(0,Math.min(f.length,v+1))}let x=!1,g=-1;if(l&&o&&o.v7_partialHydration)for(let v=0;v=0?f=f.slice(0,g+1):f=[f[0]];break}}}return f.reduceRight((v,y,E)=>{let _,k=!1,w=null,j=null;l&&(_=p&&y.route.id?p[y.route.id]:void 0,w=y.route.errorElement||Ky,x&&(g<0&&E===0?(tj("route-fallback"),k=!0,j=null):g===E&&(k=!0,j=y.route.hydrateFallbackElement||null)));let b=a.concat(f.slice(0,E+1)),C=()=>{let N;return _?N=w:k?N=j:y.route.Component?N=h.createElement(y.route.Component,null):y.route.element?N=y.route.element:N=v,h.createElement(Yy,{match:y,routeContext:{outlet:v,matches:b,isDataRoute:l!=null},children:N})};return l&&(y.route.ErrorBoundary||y.route.errorElement||E===0)?h.createElement(Gy,{location:l.location,revalidation:l.revalidation,component:w,error:_,children:C(),routeContext:{outlet:null,matches:b,isDataRoute:!0}}):C()},null)}var gp=(function(r){return r.UseBlocker="useBlocker",r.UseRevalidator="useRevalidator",r.UseNavigateStable="useNavigate",r})(gp||{}),vp=(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})(vp||{});function qy(r){let a=h.useContext(Fd);return a||ut(!1),a}function Xy(r){let a=h.useContext(Fy);return a||ut(!1),a}function Jy(r){let a=h.useContext(Gn);return a||ut(!1),a}function yp(r){let a=Jy(),l=a.matches[a.matches.length-1];return l.route.id||ut(!1),l.route.id}function Zy(){var r;let a=h.useContext(mp),l=Xy(),o=yp();return a!==void 0?a:(r=l.errors)==null?void 0:r[o]}function ej(){let{router:r}=qy(gp.UseNavigateStable),a=yp(vp.UseNavigateStable),l=h.useRef(!1);return pp(()=>{l.current=!0}),h.useCallback(function(c,u){u===void 0&&(u={}),l.current&&(typeof c=="number"?r.navigate(c):r.navigate(c,Fa({fromRouteId:a},u)))},[r,a])}const hm={};function tj(r,a,l){hm[r]||(hm[r]=!0)}function nj(r,a){r==null||r.v7_startTransition,r==null||r.v7_relativeSplatPath}function rj(r){let{to:a,replace:l,state:o,relative:c}=r;Bs()||ut(!1);let{future:u,static:f}=h.useContext(Pr),{matches:p}=h.useContext(Gn),{pathname:x}=rs(),g=Va(),v=Od(a,Ld(p,u.v7_relativeSplatPath),x,c==="path"),y=JSON.stringify(v);return h.useEffect(()=>g(JSON.parse(y),{replace:l,state:o,relative:c}),[g,y,c,l,o]),null}function sj(r){return Uy(r.context)}function nt(r){ut(!1)}function aj(r){let{basename:a="/",children:l=null,location:o,navigationType:c=Nr.Pop,navigator:u,static:f=!1,future:p}=r;Bs()&&ut(!1);let x=a.replace(/^\/*/,"/"),g=h.useMemo(()=>({basename:x,navigator:u,static:f,future:Fa({v7_relativeSplatPath:!1},p)}),[x,p,u,f]);typeof o=="string"&&(o=$s(o));let{pathname:v="/",search:y="",hash:E="",state:_=null,key:k="default"}=o,w=h.useMemo(()=>{let j=Dd(v,x);return j==null?null:{location:{pathname:j,search:y,hash:E,state:_,key:k},navigationType:c}},[x,v,y,E,_,k,c]);return w==null?null:h.createElement(Pr.Provider,{value:g},h.createElement(Ai.Provider,{children:l,value:w}))}function lj(r){let{children:a,location:l}=r;return Vy(ud(a),l)}new Promise(()=>{});function ud(r,a){a===void 0&&(a=[]);let l=[];return h.Children.forEach(r,(o,c)=>{if(!h.isValidElement(o))return;let u=[...a,c];if(o.type===h.Fragment){l.push.apply(l,ud(o.props.children,u));return}o.type!==nt&&ut(!1),!o.props.index||!o.props.children||ut(!1);let f={id:o.props.id||u.join("-"),caseSensitive:o.props.caseSensitive,element:o.props.element,Component:o.props.Component,index:o.props.index,path:o.props.path,loader:o.props.loader,action:o.props.action,errorElement:o.props.errorElement,ErrorBoundary:o.props.ErrorBoundary,hasErrorBoundary:o.props.ErrorBoundary!=null||o.props.errorElement!=null,shouldRevalidate:o.props.shouldRevalidate,handle:o.props.handle,lazy:o.props.lazy};o.props.children&&(f.children=ud(o.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 fd(){return fd=Object.assign?Object.assign.bind():function(r){for(var a=1;a=0)&&(l[c]=r[c]);return l}function oj(r){return!!(r.metaKey||r.altKey||r.ctrlKey||r.shiftKey)}function cj(r,a){return r.button===0&&(!a||a==="_self")&&!oj(r)}const dj=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","viewTransition"],uj="6";try{window.__reactRouterVersion=uj}catch{}const fj="startTransition",mm=Ii[fj];function hj(r){let{basename:a,children:l,future:o,window:c}=r,u=h.useRef();u.current==null&&(u.current=uy({window:c,v5Compat:!0}));let f=u.current,[p,x]=h.useState({action:f.action,location:f.location}),{v7_startTransition:g}=o||{},v=h.useCallback(y=>{g&&mm?mm(()=>x(y)):x(y)},[x,g]);return h.useLayoutEffect(()=>f.listen(v),[f,v]),h.useEffect(()=>nj(o),[o]),h.createElement(aj,{basename:a,children:l,location:p.location,navigationType:p.action,navigator:f,future:o})}const mj=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",pj=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,fi=h.forwardRef(function(a,l){let{onClick:o,relative:c,reloadDocument:u,replace:f,state:p,target:x,to:g,preventScrollReset:v,viewTransition:y}=a,E=ij(a,dj),{basename:_}=h.useContext(Pr),k,w=!1;if(typeof g=="string"&&pj.test(g)&&(k=g,mj))try{let N=new URL(window.location.href),A=g.startsWith("//")?new URL(N.protocol+g):new URL(g),$=Dd(A.pathname,_);A.origin===N.origin&&$!=null?g=$+A.search+A.hash:w=!0}catch{}let j=zy(g,{relative:c}),b=xj(g,{replace:f,state:p,target:x,preventScrollReset:v,relative:c,viewTransition:y});function C(N){o&&o(N),N.defaultPrevented||b(N)}return h.createElement("a",fd({},E,{href:k||j,onClick:w||u?o:C,ref:l,target:x}))});var pm;(function(r){r.UseScrollRestoration="useScrollRestoration",r.UseSubmit="useSubmit",r.UseSubmitFetcher="useSubmitFetcher",r.UseFetcher="useFetcher",r.useViewTransitionState="useViewTransitionState"})(pm||(pm={}));var xm;(function(r){r.UseFetcher="useFetcher",r.UseFetchers="useFetchers",r.UseScrollRestoration="useScrollRestoration"})(xm||(xm={}));function xj(r,a){let{target:l,replace:o,state:c,preventScrollReset:u,relative:f,viewTransition:p}=a===void 0?{}:a,x=Va(),g=rs(),v=xp(r,{relative:f});return h.useCallback(y=>{if(cj(y,l)){y.preventDefault();let E=o!==void 0?o:vi(g)===vi(v);x(r,{replace:E,state:c,preventScrollReset:u,relative:f,viewTransition:p})}},[g,x,v,o,c,l,r,u,f,p])}/** + * @license lucide-react v0.562.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const gj=r=>r.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),vj=r=>r.replace(/^([A-Z])|[\s-_]+(\w)/g,(a,l,o)=>o?o.toUpperCase():l.toLowerCase()),gm=r=>{const a=vj(r);return a.charAt(0).toUpperCase()+a.slice(1)},jp=(...r)=>r.filter((a,l,o)=>!!a&&a.trim()!==""&&o.indexOf(a)===l).join(" ").trim(),yj=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 jj={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 Nj=h.forwardRef(({color:r="currentColor",size:a=24,strokeWidth:l=2,absoluteStrokeWidth:o,className:c="",children:u,iconNode:f,...p},x)=>h.createElement("svg",{ref:x,...jj,width:a,height:a,stroke:r,strokeWidth:o?Number(l)*24/Number(a):l,className:jp("lucide",c),...!u&&!yj(p)&&{"aria-hidden":"true"},...p},[...f.map(([g,v])=>h.createElement(g,v)),...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 ye=(r,a)=>{const l=h.forwardRef(({className:o,...c},u)=>h.createElement(Nj,{ref:u,iconNode:a,className:jp(`lucide-${gj(gm(r))}`,`lucide-${r}`,o),...c}));return l.displayName=gm(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 bj=[["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"}]],vm=ye("bitcoin",bj);/** + * @license lucide-react v0.562.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const wj=[["path",{d:"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"}]],Wn=ye("book-open",wj);/** + * @license lucide-react v0.562.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Sj=[["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"}]],za=ye("calendar",Sj);/** + * @license lucide-react v0.562.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Cj=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],Mi=ye("check",Cj);/** + * @license lucide-react v0.562.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const kj=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],Di=ye("chevron-down",kj);/** + * @license lucide-react v0.562.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Ej=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],As=ye("chevron-right",Ej);/** + * @license lucide-react v0.562.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Pj=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],Np=ye("chevron-up",Pj);/** + * @license lucide-react v0.562.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Rj=[["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"}]],_j=ye("circle-alert",Rj);/** + * @license lucide-react v0.562.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Tj=[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]],ym=ye("circle-check-big",Tj);/** + * @license lucide-react v0.562.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Ij=[["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"}]],bp=ye("circle-question-mark",Ij);/** + * @license lucide-react v0.562.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Aj=[["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"}]],jm=ye("circle-user",Aj);/** + * @license lucide-react v0.562.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Mj=[["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"}]],Dj=ye("circle-x",Mj);/** + * @license lucide-react v0.562.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Lj=[["path",{d:"M12 6v6l4 2",key:"mmk7yg"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],wp=ye("clock",Lj);/** + * @license lucide-react v0.562.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Oj=[["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"}]],Sp=ye("copy",Oj);/** + * @license lucide-react v0.562.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Fj=[["rect",{width:"20",height:"14",x:"2",y:"5",rx:"2",key:"ynyp8z"}],["line",{x1:"2",x2:"22",y1:"10",y2:"10",key:"1b3vmo"}]],hd=ye("credit-card",Fj);/** + * @license lucide-react v0.562.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const zj=[["path",{d:"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"}]],Li=ye("crown",zj);/** + * @license lucide-react v0.562.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const $j=[["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"}]],yi=ye("dollar-sign",$j);/** + * @license lucide-react v0.562.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Bj=[["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"}]],Uj=ye("download",Bj);/** + * @license lucide-react v0.562.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Vj=[["path",{d:"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"}]],ji=ye("external-link",Vj);/** + * @license lucide-react v0.562.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Wj=[["path",{d:"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"}]],Ms=ye("eye",Wj);/** + * @license lucide-react v0.562.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Hj=[["path",{d:"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"}]],Kj=ye("file-text",Hj);/** + * @license lucide-react v0.562.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Gj=[["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"}]],Yj=ye("funnel",Gj);/** + * @license lucide-react v0.562.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Qj=[["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"}]],qj=ye("gift",Qj);/** + * @license lucide-react v0.562.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Xj=[["circle",{cx:"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"}]],Jj=ye("git-merge",Xj);/** + * @license lucide-react v0.562.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Zj=[["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"}]],md=ye("globe",Zj);/** + * @license lucide-react v0.562.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const eN=[["path",{d:"M21.42 10.922a1 1 0 0 0-.019-1.838L12.83 5.18a2 2 0 0 0-1.66 0L2.6 9.08a1 1 0 0 0 0 1.832l8.57 3.908a2 2 0 0 0 1.66 0z",key:"j76jl0"}],["path",{d:"M22 10v6",key:"1lu8f3"}],["path",{d:"M6 12.5V16a6 3 0 0 0 12 0v-3.5",key:"1r8lef"}]],tN=ye("graduation-cap",eN);/** + * @license lucide-react v0.562.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const nN=[["circle",{cx:"9",cy:"12",r:"1",key:"1vctgf"}],["circle",{cx:"9",cy:"5",r:"1",key:"hp0tcf"}],["circle",{cx:"9",cy:"19",r:"1",key:"fkjjf6"}],["circle",{cx:"15",cy:"12",r:"1",key:"1tmaij"}],["circle",{cx:"15",cy:"5",r:"1",key:"19l28e"}],["circle",{cx:"15",cy:"19",r:"1",key:"f4zoj3"}]],Gc=ye("grip-vertical",nN);/** + * @license lucide-react v0.562.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const rN=[["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"}]],Nm=ye("history",rN);/** + * @license lucide-react v0.562.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const sN=[["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"}]],aN=ye("house",sN);/** + * @license lucide-react v0.562.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const lN=[["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"}]],Cp=ye("image",lN);/** + * @license lucide-react v0.562.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const iN=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],ni=ye("info",iN);/** + * @license lucide-react v0.562.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const oN=[["path",{d:"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"}]],bm=ye("key",oN);/** + * @license lucide-react v0.562.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const cN=[["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"}]],dN=ye("layout-dashboard",cN);/** + * @license lucide-react v0.562.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const uN=[["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"}]],Yr=ye("link-2",uN);/** + * @license lucide-react v0.562.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const fN=[["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"}]],wm=ye("link",fN);/** + * @license lucide-react v0.562.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const hN=[["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"}]],mN=ye("lock",hN);/** + * @license lucide-react v0.562.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const pN=[["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"}]],xN=ye("log-out",pN);/** + * @license lucide-react v0.562.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const gN=[["path",{d:"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"}]],vN=ye("map-pin",gN);/** + * @license lucide-react v0.562.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const yN=[["path",{d:"M4 5h16",key:"1tepv9"}],["path",{d:"M4 12h16",key:"1lakjw"}],["path",{d:"M4 19h16",key:"1djgab"}]],jN=ye("menu",yN);/** + * @license lucide-react v0.562.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const NN=[["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"}]],bN=ye("message-circle",NN);/** + * @license lucide-react v0.562.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const wN=[["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"}]],SN=ye("palette",wN);/** + * @license lucide-react v0.562.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const CN=[["path",{d:"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"}]],sn=ye("pen-line",CN);/** + * @license lucide-react v0.562.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const kN=[["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"}]],EN=ye("percent",kN);/** + * @license lucide-react v0.562.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const PN=[["path",{d:"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"}]],RN=ye("phone",PN);/** + * @license lucide-react v0.562.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const _N=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],Rn=ye("plus",_N);/** + * @license lucide-react v0.562.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const TN=[["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"}]],Sm=ye("qr-code",TN);/** + * @license lucide-react v0.562.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const IN=[["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=ye("refresh-cw",IN);/** + * @license lucide-react v0.562.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const AN=[["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"}]],Wt=ye("save",AN);/** + * @license lucide-react v0.562.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const MN=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],Qr=ye("search",MN);/** + * @license lucide-react v0.562.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const DN=[["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"}]],Ni=ye("settings",DN);/** + * @license lucide-react v0.562.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const LN=[["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"}]],ON=ye("settings-2",LN);/** + * @license lucide-react v0.562.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const FN=[["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"}]],zd=ye("shield-check",FN);/** + * @license lucide-react v0.562.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const zN=[["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"}]],pd=ye("shopping-bag",zN);/** + * @license lucide-react v0.562.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const $N=[["rect",{width:"14",height:"20",x:"5",y:"2",rx:"2",ry:"2",key:"1yt0o3"}],["path",{d:"M12 18h.01",key:"mhygvu"}]],xd=ye("smartphone",$N);/** + * @license lucide-react v0.562.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const BN=[["path",{d:"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"}]],UN=ye("tag",BN);/** + * @license lucide-react v0.562.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const VN=[["path",{d:"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"}]],Vn=ye("trash-2",VN);/** + * @license lucide-react v0.562.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const WN=[["path",{d:"M16 7h6v6",key:"box55l"}],["path",{d:"m22 7-8.5 8.5-5-5L2 17",key:"1t1m79"}]],gd=ye("trending-up",WN);/** + * @license lucide-react v0.562.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const HN=[["path",{d:"M9 14 4 9l5-5",key:"102s5s"}],["path",{d:"M4 9h10.5a5.5 5.5 0 0 1 5.5 5.5a5.5 5.5 0 0 1-5.5 5.5H11",key:"f3b9sd"}]],kp=ye("undo-2",HN);/** + * @license lucide-react v0.562.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const KN=[["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"}]],bi=ye("upload",KN);/** + * @license lucide-react v0.562.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const GN=[["path",{d:"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"}]],Cm=ye("user-plus",GN);/** + * @license lucide-react v0.562.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const YN=[["path",{d:"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"}]],qr=ye("user",YN);/** + * @license lucide-react v0.562.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const QN=[["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"}]],vn=ye("users",QN);/** + * @license lucide-react v0.562.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const qN=[["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"}]],Os=ye("wallet",qN);/** + * @license lucide-react v0.562.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const XN=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],on=ye("x",XN);/** + * @license lucide-react v0.562.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const JN=[["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"}]],ZN=ye("zap",JN),$d="admin_token";function Bd(){try{return localStorage.getItem($d)}catch{return null}}function eb(r){try{localStorage.setItem($d,r)}catch{}}function tb(){try{localStorage.removeItem($d)}catch{}}const nb="https://soulapi.quwanzhi.com",rb=()=>{const r="https://soulapi.quwanzhi.com";return r.length>0?r.replace(/\/$/,""):nb};function Fs(r){const a=rb(),l=r.startsWith("/")?r:`/${r}`;return a?`${a}${l}`:l}async function Oi(r,a={}){const{data:l,...o}=a,c=Fs(r),u=new Headers(o.headers),f=Bd();f&&u.set("Authorization",`Bearer ${f}`),l!=null&&!u.has("Content-Type")&&u.set("Content-Type","application/json");const p=l!=null?JSON.stringify(l):o.body,x=await fetch(c,{...o,headers:u,body:p,credentials:"include"}),v=(x.headers.get("Content-Type")||"").includes("application/json")?await x.json():x;if(!x.ok){const y=new Error((v==null?void 0:v.error)||`HTTP ${x.status}`);throw y.status=x.status,y.data=v,y}return v}function We(r,a){return Oi(r,{...a,method:"GET"})}function jt(r,a,l){return Oi(r,{...l,method:"POST",data:a})}function Pt(r,a,l){return Oi(r,{...l,method:"PUT",data:a})}function Wa(r,a){return Oi(r,{...a,method:"DELETE"})}const sb=[{icon:dN,label:"数据概览",href:"/dashboard"},{icon:Wn,label:"内容管理",href:"/content"},{icon:vn,label:"用户管理",href:"/users"}],km=[{icon:Li,label:"VIP 角色",href:"/vip-roles"},{icon:qr,label:"作者详情",href:"/author-settings"},{icon:zd,label:"管理员",href:"/admin-users"},{icon:tN,label:"导师管理",href:"/mentors"},{icon:za,label:"导师预约",href:"/mentor-consultations"},{icon:Os,label:"推广中心",href:"/distribution"},{icon:Jj,label:"匹配记录",href:"/match-records"},{icon:hd,label:"推广设置",href:"/referral-settings"}];function ab(){const r=rs(),a=Va(),[l,o]=h.useState(!1),[c,u]=h.useState(!1),[f,p]=h.useState(!1);h.useEffect(()=>{o(!0)},[]),h.useEffect(()=>{km.some(v=>r.pathname===v.href)&&p(!0)},[r.pathname]),h.useEffect(()=>{if(!l)return;u(!1);let g=!1;return We("/api/admin").then(v=>{g||(v&&v.success!==!1?u(!0):a("/login",{replace:!0}))}).catch(()=>{g||a("/login",{replace:!0})}),()=>{g=!0}},[l,a]);const x=async()=>{tb();try{await jt("/api/admin/logout",{})}catch{}a("/login",{replace:!0})};return!l||!c?t.jsxs("div",{className:"flex min-h-screen bg-[#0a1628]",children:[t.jsx("div",{className:"w-64 bg-[#0f2137] border-r border-gray-700/50"}),t.jsx("div",{className:"flex-1 flex items-center justify-center",children:t.jsx("div",{className:"text-[#38bdac]",children:"加载中..."})})]}):t.jsxs("div",{className:"flex min-h-screen bg-[#0a1628]",children:[t.jsxs("div",{className:"w-64 bg-[#0f2137] flex flex-col border-r border-gray-700/50 shadow-xl",children:[t.jsxs("div",{className:"p-6 border-b border-gray-700/50",children:[t.jsx("h1",{className:"text-xl font-bold text-[#38bdac]",children:"管理后台"}),t.jsx("p",{className:"text-xs text-gray-400 mt-1",children:"Soul创业派对"})]}),t.jsxs("nav",{className:"flex-1 p-4 space-y-1 overflow-y-auto",children:[sb.map(g=>{const v=r.pathname===g.href;return t.jsxs(fi,{to:g.href,className:`flex items-center gap-3 px-4 py-3 rounded-lg transition-colors ${v?"bg-[#38bdac]/20 text-[#38bdac] font-medium":"text-gray-400 hover:bg-gray-700/50 hover:text-white"}`,children:[t.jsx(g.icon,{className:"w-5 h-5 shrink-0"}),t.jsx("span",{className:"text-sm",children:g.label})]},g.href)}),t.jsx("button",{type:"button",onClick:()=>p(!f),className:"w-full flex items-center justify-between gap-3 px-4 py-3 text-gray-400 hover:bg-gray-700/50 hover:text-white rounded-lg transition-colors",children:t.jsxs("span",{className:"flex items-center gap-3",children:[f?t.jsx(Np,{className:"w-5 h-5"}):t.jsx(Di,{className:"w-5 h-5"}),t.jsx("span",{className:"text-sm",children:"更多"})]})}),f&&t.jsx("div",{className:"space-y-1 pl-4",children:km.map(g=>{const v=r.pathname===g.href;return t.jsxs(fi,{to:g.href,className:`flex items-center gap-3 px-4 py-2 rounded-lg transition-colors ${v?"bg-[#38bdac]/20 text-[#38bdac] font-medium":"text-gray-400 hover:bg-gray-700/50 hover:text-white"}`,children:[t.jsx(g.icon,{className:"w-5 h-5 shrink-0"}),t.jsx("span",{className:"text-sm",children:g.label})]},g.href)})}),t.jsx("div",{className:"pt-4 mt-4 border-t border-gray-700/50",children:t.jsxs(fi,{to:"/settings",className:`flex items-center gap-3 px-4 py-3 rounded-lg transition-colors ${r.pathname==="/settings"?"bg-[#38bdac]/20 text-[#38bdac] font-medium":"text-gray-400 hover:bg-gray-700/50 hover:text-white"}`,children:[t.jsx(Ni,{className:"w-5 h-5 shrink-0"}),t.jsx("span",{className:"text-sm",children:"系统设置"})]})})]}),t.jsx("div",{className:"p-4 border-t border-gray-700/50 space-y-1",children:t.jsxs("button",{type:"button",onClick:x,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:[t.jsx(xN,{className:"w-5 h-5"}),t.jsx("span",{className:"text-sm",children:"退出登录"})]})})]}),t.jsx("div",{className:"flex-1 overflow-auto bg-[#0a1628] min-w-0",children:t.jsx("div",{className:"w-full min-w-[1024px] min-h-full",children:t.jsx(sj,{})})})]})}function Em(r,a){if(typeof r=="function")return r(a);r!=null&&(r.current=a)}function Ud(...r){return a=>{let l=!1;const o=r.map(c=>{const u=Em(c,a);return!l&&typeof u=="function"&&(l=!0),u});if(l)return()=>{for(let c=0;c{let{children:u,...f}=o;Ep(u)&&typeof wi=="function"&&(u=wi(u._payload));const p=h.Children.toArray(u),x=p.find(db);if(x){const g=x.props.children,v=p.map(y=>y===x?h.Children.count(g)>1?h.Children.only(null):h.isValidElement(g)?g.props.children:null:y);return t.jsx(a,{...f,ref:c,children:h.isValidElement(g)?h.cloneElement(g,void 0,v):null})}return t.jsx(a,{...f,ref:c,children:u})});return l.displayName=`${r}.Slot`,l}var Rp=Pp("Slot");function ob(r){const a=h.forwardRef((l,o)=>{let{children:c,...u}=l;if(Ep(c)&&typeof wi=="function"&&(c=wi(c._payload)),h.isValidElement(c)){const f=fb(c),p=ub(u,c.props);return c.type!==h.Fragment&&(p.ref=o?Ud(o,f):f),h.cloneElement(c,p)}return h.Children.count(c)>1?h.Children.only(null):null});return a.displayName=`${r}.SlotClone`,a}var cb=Symbol("radix.slottable");function db(r){return h.isValidElement(r)&&typeof r.type=="function"&&"__radixId"in r.type&&r.type.__radixId===cb}function ub(r,a){const l={...a};for(const o in a){const c=r[o],u=a[o];/^on[A-Z]/.test(o)?c&&u?l[o]=(...p)=>{const x=u(...p);return c(...p),x}:c&&(l[o]=c):o==="style"?l[o]={...c,...u}:o==="className"&&(l[o]=[c,u].filter(Boolean).join(" "))}return{...r,...l}}function fb(r){var o,c;let a=(o=Object.getOwnPropertyDescriptor(r.props,"ref"))==null?void 0:o.get,l=a&&"isReactWarning"in a&&a.isReactWarning;return l?r.ref:(a=(c=Object.getOwnPropertyDescriptor(r,"ref"))==null?void 0:c.get,l=a&&"isReactWarning"in a&&a.isReactWarning,l?r.props.ref:r.props.ref||r.ref)}function _p(r){var a,l,o="";if(typeof r=="string"||typeof r=="number")o+=r;else if(typeof r=="object")if(Array.isArray(r)){var c=r.length;for(a=0;atypeof r=="boolean"?`${r}`:r===0?"0":r,Rm=Tp,Ip=(r,a)=>l=>{var o;if((a==null?void 0:a.variants)==null)return Rm(r,l==null?void 0:l.class,l==null?void 0:l.className);const{variants:c,defaultVariants:u}=a,f=Object.keys(c).map(g=>{const v=l==null?void 0:l[g],y=u==null?void 0:u[g];if(v===null)return null;const E=Pm(v)||Pm(y);return c[g][E]}),p=l&&Object.entries(l).reduce((g,v)=>{let[y,E]=v;return E===void 0||(g[y]=E),g},{}),x=a==null||(o=a.compoundVariants)===null||o===void 0?void 0:o.reduce((g,v)=>{let{class:y,className:E,..._}=v;return Object.entries(_).every(k=>{let[w,j]=k;return Array.isArray(j)?j.includes({...u,...p}[w]):{...u,...p}[w]===j})?[...g,y,E]:g},[]);return Rm(r,f,x,l==null?void 0:l.class,l==null?void 0:l.className)},hb=(r,a)=>{const l=new Array(r.length+a.length);for(let o=0;o({classGroupId:r,validator:a}),Ap=(r=new Map,a=null,l)=>({nextPart:r,validators:a,classGroupId:l}),Si="-",_m=[],pb="arbitrary..",xb=r=>{const a=vb(r),{conflictingClassGroups:l,conflictingClassGroupModifiers:o}=r;return{getClassGroupId:f=>{if(f.startsWith("[")&&f.endsWith("]"))return gb(f);const p=f.split(Si),x=p[0]===""&&p.length>1?1:0;return Mp(p,x,a)},getConflictingClassGroupIds:(f,p)=>{if(p){const x=o[f],g=l[f];return x?g?hb(g,x):x:g||_m}return l[f]||_m}}},Mp=(r,a,l)=>{if(r.length-a===0)return l.classGroupId;const c=r[a],u=l.nextPart.get(c);if(u){const g=Mp(r,a+1,u);if(g)return g}const f=l.validators;if(f===null)return;const p=a===0?r.join(Si):r.slice(a).join(Si),x=f.length;for(let g=0;gr.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const a=r.slice(1,-1),l=a.indexOf(":"),o=a.slice(0,l);return o?pb+o:void 0})(),vb=r=>{const{theme:a,classGroups:l}=r;return yb(l,a)},yb=(r,a)=>{const l=Ap();for(const o in r){const c=r[o];Vd(c,l,o,a)}return l},Vd=(r,a,l,o)=>{const c=r.length;for(let u=0;u{if(typeof r=="string"){Nb(r,a,l);return}if(typeof r=="function"){bb(r,a,l,o);return}wb(r,a,l,o)},Nb=(r,a,l)=>{const o=r===""?a:Dp(a,r);o.classGroupId=l},bb=(r,a,l,o)=>{if(Sb(r)){Vd(r(o),a,l,o);return}a.validators===null&&(a.validators=[]),a.validators.push(mb(l,r))},wb=(r,a,l,o)=>{const c=Object.entries(r),u=c.length;for(let f=0;f{let l=r;const o=a.split(Si),c=o.length;for(let u=0;u"isThemeGetter"in r&&r.isThemeGetter===!0,Cb=r=>{if(r<1)return{get:()=>{},set:()=>{}};let a=0,l=Object.create(null),o=Object.create(null);const c=(u,f)=>{l[u]=f,a++,a>r&&(a=0,o=l,l=Object.create(null))};return{get(u){let f=l[u];if(f!==void 0)return f;if((f=o[u])!==void 0)return c(u,f),f},set(u,f){u in l?l[u]=f:c(u,f)}}},vd="!",Tm=":",kb=[],Im=(r,a,l,o,c)=>({modifiers:r,hasImportantModifier:a,baseClassName:l,maybePostfixModifierPosition:o,isExternal:c}),Eb=r=>{const{prefix:a,experimentalParseClassName:l}=r;let o=c=>{const u=[];let f=0,p=0,x=0,g;const v=c.length;for(let w=0;wx?g-x:void 0;return Im(u,_,E,k)};if(a){const c=a+Tm,u=o;o=f=>f.startsWith(c)?u(f.slice(c.length)):Im(kb,!1,f,void 0,!0)}if(l){const c=o;o=u=>l({className:u,parseClassName:c})}return o},Pb=r=>{const a=new Map;return r.orderSensitiveModifiers.forEach((l,o)=>{a.set(l,1e6+o)}),l=>{const o=[];let c=[];for(let u=0;u0&&(c.sort(),o.push(...c),c=[]),o.push(f)):c.push(f)}return c.length>0&&(c.sort(),o.push(...c)),o}},Rb=r=>({cache:Cb(r.cacheSize),parseClassName:Eb(r),sortModifiers:Pb(r),...xb(r)}),_b=/\s+/,Tb=(r,a)=>{const{parseClassName:l,getClassGroupId:o,getConflictingClassGroupIds:c,sortModifiers:u}=a,f=[],p=r.trim().split(_b);let x="";for(let g=p.length-1;g>=0;g-=1){const v=p[g],{isExternal:y,modifiers:E,hasImportantModifier:_,baseClassName:k,maybePostfixModifierPosition:w}=l(v);if(y){x=v+(x.length>0?" "+x:x);continue}let j=!!w,b=o(j?k.substring(0,w):k);if(!b){if(!j){x=v+(x.length>0?" "+x:x);continue}if(b=o(k),!b){x=v+(x.length>0?" "+x:x);continue}j=!1}const C=E.length===0?"":E.length===1?E[0]:u(E).join(":"),N=_?C+vd:C,A=N+b;if(f.indexOf(A)>-1)continue;f.push(A);const $=c(b,j);for(let V=0;V<$.length;++V){const R=$[V];f.push(N+R)}x=v+(x.length>0?" "+x:x)}return x},Ib=(...r)=>{let a=0,l,o,c="";for(;a{if(typeof r=="string")return r;let a,l="";for(let o=0;o{let l,o,c,u;const f=x=>{const g=a.reduce((v,y)=>y(v),r());return l=Rb(g),o=l.cache.get,c=l.cache.set,u=p,p(x)},p=x=>{const g=o(x);if(g)return g;const v=Tb(x,l);return c(x,v),v};return u=f,(...x)=>u(Ib(...x))},Mb=[],xt=r=>{const a=l=>l[r]||Mb;return a.isThemeGetter=!0,a},Op=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,Fp=/^\((?:(\w[\w-]*):)?(.+)\)$/i,Db=/^\d+\/\d+$/,Lb=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Ob=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,Fb=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,zb=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,$b=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Rs=r=>Db.test(r),Le=r=>!!r&&!Number.isNaN(Number(r)),gr=r=>!!r&&Number.isInteger(Number(r)),Yc=r=>r.endsWith("%")&&Le(r.slice(0,-1)),Bn=r=>Lb.test(r),Bb=()=>!0,Ub=r=>Ob.test(r)&&!Fb.test(r),zp=()=>!1,Vb=r=>zb.test(r),Wb=r=>$b.test(r),Hb=r=>!Ne(r)&&!be(r),Kb=r=>Us(r,Up,zp),Ne=r=>Op.test(r),Gr=r=>Us(r,Vp,Ub),Qc=r=>Us(r,Xb,Le),Am=r=>Us(r,$p,zp),Gb=r=>Us(r,Bp,Wb),ri=r=>Us(r,Wp,Vb),be=r=>Fp.test(r),Da=r=>Vs(r,Vp),Yb=r=>Vs(r,Jb),Mm=r=>Vs(r,$p),Qb=r=>Vs(r,Up),qb=r=>Vs(r,Bp),si=r=>Vs(r,Wp,!0),Us=(r,a,l)=>{const o=Op.exec(r);return o?o[1]?a(o[1]):l(o[2]):!1},Vs=(r,a,l=!1)=>{const o=Fp.exec(r);return o?o[1]?a(o[1]):l:!1},$p=r=>r==="position"||r==="percentage",Bp=r=>r==="image"||r==="url",Up=r=>r==="length"||r==="size"||r==="bg-size",Vp=r=>r==="length",Xb=r=>r==="number",Jb=r=>r==="family-name",Wp=r=>r==="shadow",Zb=()=>{const r=xt("color"),a=xt("font"),l=xt("text"),o=xt("font-weight"),c=xt("tracking"),u=xt("leading"),f=xt("breakpoint"),p=xt("container"),x=xt("spacing"),g=xt("radius"),v=xt("shadow"),y=xt("inset-shadow"),E=xt("text-shadow"),_=xt("drop-shadow"),k=xt("blur"),w=xt("perspective"),j=xt("aspect"),b=xt("ease"),C=xt("animate"),N=()=>["auto","avoid","all","avoid-page","page","left","right","column"],A=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],$=()=>[...A(),be,Ne],V=()=>["auto","hidden","clip","visible","scroll"],R=()=>["auto","contain","none"],T=()=>[be,Ne,x],F=()=>[Rs,"full","auto",...T()],Y=()=>[gr,"none","subgrid",be,Ne],K=()=>["auto",{span:["full",gr,be,Ne]},gr,be,Ne],J=()=>[gr,"auto",be,Ne],ce=()=>["auto","min","max","fr",be,Ne],X=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],le=()=>["start","end","center","stretch","center-safe","end-safe"],ee=()=>["auto",...T()],q=()=>[Rs,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...T()],I=()=>[r,be,Ne],Q=()=>[...A(),Mm,Am,{position:[be,Ne]}],B=()=>["no-repeat",{repeat:["","x","y","space","round"]}],D=()=>["auto","cover","contain",Qb,Kb,{size:[be,Ne]}],P=()=>[Yc,Da,Gr],W=()=>["","none","full",g,be,Ne],re=()=>["",Le,Da,Gr],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"],se=()=>[Le,Yc,Mm,Am],pe=()=>["","none",k,be,Ne],L=()=>["none",Le,be,Ne],ue=()=>["none",Le,be,Ne],xe=()=>[Le,be,Ne],Re=()=>[Rs,"full",...T()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[Bn],breakpoint:[Bn],color:[Bb],container:[Bn],"drop-shadow":[Bn],ease:["in","out","in-out"],font:[Hb],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[Bn],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[Bn],shadow:[Bn],spacing:["px",Le],text:[Bn],"text-shadow":[Bn],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",Rs,Ne,be,j]}],container:["container"],columns:[{columns:[Le,Ne,be,p]}],"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:$()}],overflow:[{overflow:V()}],"overflow-x":[{"overflow-x":V()}],"overflow-y":[{"overflow-y":V()}],overscroll:[{overscroll:R()}],"overscroll-x":[{"overscroll-x":R()}],"overscroll-y":[{"overscroll-y":R()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:F()}],"inset-x":[{"inset-x":F()}],"inset-y":[{"inset-y":F()}],start:[{start:F()}],end:[{end:F()}],top:[{top:F()}],right:[{right:F()}],bottom:[{bottom:F()}],left:[{left:F()}],visibility:["visible","invisible","collapse"],z:[{z:[gr,"auto",be,Ne]}],basis:[{basis:[Rs,"full","auto",p,...T()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[Le,Rs,"auto","initial","none",Ne]}],grow:[{grow:["",Le,be,Ne]}],shrink:[{shrink:["",Le,be,Ne]}],order:[{order:[gr,"first","last","none",be,Ne]}],"grid-cols":[{"grid-cols":Y()}],"col-start-end":[{col:K()}],"col-start":[{"col-start":J()}],"col-end":[{"col-end":J()}],"grid-rows":[{"grid-rows":Y()}],"row-start-end":[{row:K()}],"row-start":[{"row-start":J()}],"row-end":[{"row-end":J()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":ce()}],"auto-rows":[{"auto-rows":ce()}],gap:[{gap:T()}],"gap-x":[{"gap-x":T()}],"gap-y":[{"gap-y":T()}],"justify-content":[{justify:[...X(),"normal"]}],"justify-items":[{"justify-items":[...le(),"normal"]}],"justify-self":[{"justify-self":["auto",...le()]}],"align-content":[{content:["normal",...X()]}],"align-items":[{items:[...le(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...le(),{baseline:["","last"]}]}],"place-content":[{"place-content":X()}],"place-items":[{"place-items":[...le(),"baseline"]}],"place-self":[{"place-self":["auto",...le()]}],p:[{p:T()}],px:[{px:T()}],py:[{py:T()}],ps:[{ps:T()}],pe:[{pe:T()}],pt:[{pt:T()}],pr:[{pr:T()}],pb:[{pb:T()}],pl:[{pl:T()}],m:[{m:ee()}],mx:[{mx:ee()}],my:[{my:ee()}],ms:[{ms:ee()}],me:[{me:ee()}],mt:[{mt:ee()}],mr:[{mr:ee()}],mb:[{mb:ee()}],ml:[{ml:ee()}],"space-x":[{"space-x":T()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":T()}],"space-y-reverse":["space-y-reverse"],size:[{size:q()}],w:[{w:[p,"screen",...q()]}],"min-w":[{"min-w":[p,"screen","none",...q()]}],"max-w":[{"max-w":[p,"screen","none","prose",{screen:[f]},...q()]}],h:[{h:["screen","lh",...q()]}],"min-h":[{"min-h":["screen","lh","none",...q()]}],"max-h":[{"max-h":["screen","lh",...q()]}],"font-size":[{text:["base",l,Da,Gr]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[o,be,Qc]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",Yc,Ne]}],"font-family":[{font:[Yb,Ne,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,Ne]}],"line-clamp":[{"line-clamp":[Le,"none",be,Qc]}],leading:[{leading:[u,...T()]}],"list-image":[{"list-image":["none",be,Ne]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",be,Ne]}],"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:[...he(),"wavy"]}],"text-decoration-thickness":[{decoration:[Le,"from-font","auto",be,Gr]}],"text-decoration-color":[{decoration:I()}],"underline-offset":[{"underline-offset":[Le,"auto",be,Ne]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:T()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",be,Ne]}],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,Ne]}],"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:B()}],"bg-size":[{bg:D()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},gr,be,Ne],radial:["",be,Ne],conic:[gr,be,Ne]},qb,Gb]}],"bg-color":[{bg:I()}],"gradient-from-pos":[{from:P()}],"gradient-via-pos":[{via:P()}],"gradient-to-pos":[{to:P()}],"gradient-from":[{from:I()}],"gradient-via":[{via:I()}],"gradient-to":[{to:I()}],rounded:[{rounded:W()}],"rounded-s":[{"rounded-s":W()}],"rounded-e":[{"rounded-e":W()}],"rounded-t":[{"rounded-t":W()}],"rounded-r":[{"rounded-r":W()}],"rounded-b":[{"rounded-b":W()}],"rounded-l":[{"rounded-l":W()}],"rounded-ss":[{"rounded-ss":W()}],"rounded-se":[{"rounded-se":W()}],"rounded-ee":[{"rounded-ee":W()}],"rounded-es":[{"rounded-es":W()}],"rounded-tl":[{"rounded-tl":W()}],"rounded-tr":[{"rounded-tr":W()}],"rounded-br":[{"rounded-br":W()}],"rounded-bl":[{"rounded-bl":W()}],"border-w":[{border:re()}],"border-w-x":[{"border-x":re()}],"border-w-y":[{"border-y":re()}],"border-w-s":[{"border-s":re()}],"border-w-e":[{"border-e":re()}],"border-w-t":[{"border-t":re()}],"border-w-r":[{"border-r":re()}],"border-w-b":[{"border-b":re()}],"border-w-l":[{"border-l":re()}],"divide-x":[{"divide-x":re()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":re()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...he(),"hidden","none"]}],"divide-style":[{divide:[...he(),"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:[...he(),"none","hidden"]}],"outline-offset":[{"outline-offset":[Le,be,Ne]}],"outline-w":[{outline:["",Le,Da,Gr]}],"outline-color":[{outline:I()}],shadow:[{shadow:["","none",v,si,ri]}],"shadow-color":[{shadow:I()}],"inset-shadow":[{"inset-shadow":["none",y,si,ri]}],"inset-shadow-color":[{"inset-shadow":I()}],"ring-w":[{ring:re()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:I()}],"ring-offset-w":[{"ring-offset":[Le,Gr]}],"ring-offset-color":[{"ring-offset":I()}],"inset-ring-w":[{"inset-ring":re()}],"inset-ring-color":[{"inset-ring":I()}],"text-shadow":[{"text-shadow":["none",E,si,ri]}],"text-shadow-color":[{"text-shadow":I()}],opacity:[{opacity:[Le,be,Ne]}],"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":[Le]}],"mask-image-linear-from-pos":[{"mask-linear-from":se()}],"mask-image-linear-to-pos":[{"mask-linear-to":se()}],"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":se()}],"mask-image-t-to-pos":[{"mask-t-to":se()}],"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":se()}],"mask-image-r-to-pos":[{"mask-r-to":se()}],"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":se()}],"mask-image-b-to-pos":[{"mask-b-to":se()}],"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":se()}],"mask-image-l-to-pos":[{"mask-l-to":se()}],"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":se()}],"mask-image-x-to-pos":[{"mask-x-to":se()}],"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":se()}],"mask-image-y-to-pos":[{"mask-y-to":se()}],"mask-image-y-from-color":[{"mask-y-from":I()}],"mask-image-y-to-color":[{"mask-y-to":I()}],"mask-image-radial":[{"mask-radial":[be,Ne]}],"mask-image-radial-from-pos":[{"mask-radial-from":se()}],"mask-image-radial-to-pos":[{"mask-radial-to":se()}],"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":A()}],"mask-image-conic-pos":[{"mask-conic":[Le]}],"mask-image-conic-from-pos":[{"mask-conic-from":se()}],"mask-image-conic-to-pos":[{"mask-conic-to":se()}],"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:Q()}],"mask-repeat":[{mask:B()}],"mask-size":[{mask:D()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",be,Ne]}],filter:[{filter:["","none",be,Ne]}],blur:[{blur:pe()}],brightness:[{brightness:[Le,be,Ne]}],contrast:[{contrast:[Le,be,Ne]}],"drop-shadow":[{"drop-shadow":["","none",_,si,ri]}],"drop-shadow-color":[{"drop-shadow":I()}],grayscale:[{grayscale:["",Le,be,Ne]}],"hue-rotate":[{"hue-rotate":[Le,be,Ne]}],invert:[{invert:["",Le,be,Ne]}],saturate:[{saturate:[Le,be,Ne]}],sepia:[{sepia:["",Le,be,Ne]}],"backdrop-filter":[{"backdrop-filter":["","none",be,Ne]}],"backdrop-blur":[{"backdrop-blur":pe()}],"backdrop-brightness":[{"backdrop-brightness":[Le,be,Ne]}],"backdrop-contrast":[{"backdrop-contrast":[Le,be,Ne]}],"backdrop-grayscale":[{"backdrop-grayscale":["",Le,be,Ne]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[Le,be,Ne]}],"backdrop-invert":[{"backdrop-invert":["",Le,be,Ne]}],"backdrop-opacity":[{"backdrop-opacity":[Le,be,Ne]}],"backdrop-saturate":[{"backdrop-saturate":[Le,be,Ne]}],"backdrop-sepia":[{"backdrop-sepia":["",Le,be,Ne]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":T()}],"border-spacing-x":[{"border-spacing-x":T()}],"border-spacing-y":[{"border-spacing-y":T()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",be,Ne]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[Le,"initial",be,Ne]}],ease:[{ease:["linear","initial",b,be,Ne]}],delay:[{delay:[Le,be,Ne]}],animate:[{animate:["none",C,be,Ne]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[w,be,Ne]}],"perspective-origin":[{"perspective-origin":$()}],rotate:[{rotate:L()}],"rotate-x":[{"rotate-x":L()}],"rotate-y":[{"rotate-y":L()}],"rotate-z":[{"rotate-z":L()}],scale:[{scale:ue()}],"scale-x":[{"scale-x":ue()}],"scale-y":[{"scale-y":ue()}],"scale-z":[{"scale-z":ue()}],"scale-3d":["scale-3d"],skew:[{skew:xe()}],"skew-x":[{"skew-x":xe()}],"skew-y":[{"skew-y":xe()}],transform:[{transform:[be,Ne,"","none","gpu","cpu"]}],"transform-origin":[{origin:$()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:Re()}],"translate-x":[{"translate-x":Re()}],"translate-y":[{"translate-y":Re()}],"translate-z":[{"translate-z":Re()}],"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,Ne]}],"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":T()}],"scroll-mx":[{"scroll-mx":T()}],"scroll-my":[{"scroll-my":T()}],"scroll-ms":[{"scroll-ms":T()}],"scroll-me":[{"scroll-me":T()}],"scroll-mt":[{"scroll-mt":T()}],"scroll-mr":[{"scroll-mr":T()}],"scroll-mb":[{"scroll-mb":T()}],"scroll-ml":[{"scroll-ml":T()}],"scroll-p":[{"scroll-p":T()}],"scroll-px":[{"scroll-px":T()}],"scroll-py":[{"scroll-py":T()}],"scroll-ps":[{"scroll-ps":T()}],"scroll-pe":[{"scroll-pe":T()}],"scroll-pt":[{"scroll-pt":T()}],"scroll-pr":[{"scroll-pr":T()}],"scroll-pb":[{"scroll-pb":T()}],"scroll-pl":[{"scroll-pl":T()}],"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,Ne]}],fill:[{fill:["none",...I()]}],"stroke-w":[{stroke:[Le,Da,Gr,Qc]}],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"]}},ew=Ab(Zb);function Ge(...r){return ew(Tp(r))}const tw=Ip("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 oe({className:r,variant:a,size:l,asChild:o=!1,...c}){const u=o?Rp:"button";return t.jsx(u,{"data-slot":"button",className:Ge(tw({variant:a,size:l,className:r})),...c})}function ne({className:r,type:a,...l}){return t.jsx("input",{type:a,"data-slot":"input",className:Ge("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 nw(){const r=Va(),[a,l]=h.useState(""),[o,c]=h.useState(""),[u,f]=h.useState(""),[p,x]=h.useState(!1),g=async()=>{f(""),x(!0);try{const v=await jt("/api/admin",{username:a.trim(),password:o});if((v==null?void 0:v.success)!==!1&&(v!=null&&v.token)){eb(v.token),r("/dashboard",{replace:!0});return}f(v.error||"用户名或密码错误")}catch(v){const y=v;f(y.status===401?"用户名或密码错误":(y==null?void 0:y.message)||"网络错误,请重试")}finally{x(!1)}};return t.jsxs("div",{className:"min-h-screen bg-[#0a1628] flex items-center justify-center p-4",children:[t.jsxs("div",{className:"absolute inset-0 overflow-hidden",children:[t.jsx("div",{className:"absolute top-1/4 left-1/4 w-96 h-96 bg-[#38bdac]/5 rounded-full blur-3xl"}),t.jsx("div",{className:"absolute bottom-1/4 right-1/4 w-96 h-96 bg-blue-500/5 rounded-full blur-3xl"})]}),t.jsxs("div",{className:"w-full max-w-md relative z-10",children:[t.jsxs("div",{className:"text-center mb-8",children:[t.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:t.jsx(zd,{className:"w-8 h-8 text-[#38bdac]"})}),t.jsx("h1",{className:"text-2xl font-bold text-white mb-2",children:"管理后台"}),t.jsx("p",{className:"text-gray-400",children:"一场SOUL的创业实验场"})]}),t.jsxs("div",{className:"bg-[#0f2137] rounded-2xl p-8 shadow-xl border border-gray-700/50 backdrop-blur-xl",children:[t.jsx("h2",{className:"text-xl font-semibold text-white mb-6 text-center",children:"管理员登录"}),t.jsxs("div",{className:"space-y-4",children:[t.jsxs("div",{children:[t.jsx("label",{className:"block text-gray-400 text-sm mb-2",children:"用户名"}),t.jsxs("div",{className:"relative",children:[t.jsx(qr,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-5 h-5 text-gray-500"}),t.jsx(ne,{type:"text",value:a,onChange:v=>l(v.target.value),placeholder:"请输入用户名",className:"pl-10 bg-[#0a1628] border-gray-700 text-white placeholder:text-gray-500 focus:border-[#38bdac]"})]})]}),t.jsxs("div",{children:[t.jsx("label",{className:"block text-gray-400 text-sm mb-2",children:"密码"}),t.jsxs("div",{className:"relative",children:[t.jsx(mN,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-5 h-5 text-gray-500"}),t.jsx(ne,{type:"password",value:o,onChange:v=>c(v.target.value),placeholder:"请输入密码",className:"pl-10 bg-[#0a1628] border-gray-700 text-white placeholder:text-gray-500 focus:border-[#38bdac]",onKeyDown:v=>v.key==="Enter"&&g()})]})]}),u&&t.jsx("div",{className:"bg-red-500/10 text-red-400 text-sm p-3 rounded-lg border border-red-500/20",children:u}),t.jsx(oe,{onClick:g,disabled:p,className:"w-full bg-[#38bdac] hover:bg-[#2da396] text-white py-5 disabled:opacity-50",children:p?"登录中...":"登录"})]})]}),t.jsx("p",{className:"text-center text-gray-500 text-xs mt-6",children:"Soul创业实验场 · 后台管理系统"})]})]})}const ke=h.forwardRef(({className:r,...a},l)=>t.jsx("div",{ref:l,className:Ge("rounded-xl border bg-card text-card-foreground shadow",r),...a}));ke.displayName="Card";const $e=h.forwardRef(({className:r,...a},l)=>t.jsx("div",{ref:l,className:Ge("flex flex-col space-y-1.5 p-6",r),...a}));$e.displayName="CardHeader";const Be=h.forwardRef(({className:r,...a},l)=>t.jsx("h3",{ref:l,className:Ge("font-semibold leading-none tracking-tight",r),...a}));Be.displayName="CardTitle";const ot=h.forwardRef(({className:r,...a},l)=>t.jsx("p",{ref:l,className:Ge("text-sm text-muted-foreground",r),...a}));ot.displayName="CardDescription";const Ee=h.forwardRef(({className:r,...a},l)=>t.jsx("div",{ref:l,className:Ge("p-6 pt-0",r),...a}));Ee.displayName="CardContent";const rw=h.forwardRef(({className:r,...a},l)=>t.jsx("div",{ref:l,className:Ge("flex items-center p-6 pt-0",r),...a}));rw.displayName="CardFooter";function sw(){const r=Va(),[a,l]=h.useState(!0),[o,c]=h.useState([]),[u,f]=h.useState([]);async function p(){l(!0);try{const[k,w]=await Promise.all([We("/api/db/users"),We("/api/orders")]);k!=null&&k.success&&k.users&&c(k.users),w!=null&&w.success&&w.orders&&f(w.orders)}catch(k){console.error("加载数据失败",k)}finally{l(!1)}}if(h.useEffect(()=>{p()},[]),a)return t.jsxs("div",{className:"p-8 w-full",children:[t.jsx("h1",{className:"text-2xl font-bold mb-8 text-white",children:"数据概览"}),t.jsxs("div",{className:"flex flex-col items-center justify-center py-24",children:[t.jsx(Ze,{className:"w-12 h-12 text-[#38bdac] animate-spin mb-4"}),t.jsx("span",{className:"text-gray-400",children:"加载中..."})]})]});const g=u.filter(k=>k.status==="paid"||k.status==="completed"||k.status==="success").reduce((k,w)=>k+Number(w.amount||0),0),v=o.length,y=u.length,E=k=>{const w=k.productType||"",j=k.description||"";if(j){if(w==="section"&&j.includes("章节")){if(j.includes("-")){const b=j.split("-");if(b.length>=3)return{title:`第${b[1]}章 第${b[2]}节`,subtitle:"《一场Soul的创业实验》"}}return{title:j,subtitle:"章节购买"}}return w==="fullbook"||j.includes("全书")?{title:"《一场Soul的创业实验》",subtitle:"全书购买"}:w==="match"||j.includes("伙伴")?{title:"找伙伴匹配",subtitle:"功能服务"}:{title:j,subtitle:w==="section"?"单章":w==="fullbook"?"全书":"其他"}}return w==="section"?{title:`章节 ${k.productId||""}`,subtitle:"单章购买"}:w==="fullbook"?{title:"《一场Soul的创业实验》",subtitle:"全书购买"}:w==="match"?{title:"找伙伴匹配",subtitle:"功能服务"}:{title:"未知商品",subtitle:w||"其他"}},_=[{title:"总用户数",value:v,icon:vn,color:"text-blue-400",bg:"bg-blue-500/20",link:"/users"},{title:"总收入",value:`¥${Number(g).toFixed(2)}`,icon:gd,color:"text-[#38bdac]",bg:"bg-[#38bdac]/20",link:"/orders"},{title:"订单数",value:y,icon:pd,color:"text-purple-400",bg:"bg-purple-500/20",link:"/orders"},{title:"转化率",value:`${v>0?(y/v*100).toFixed(1):0}%`,icon:Wn,color:"text-orange-400",bg:"bg-orange-500/20",link:"/distribution"}];return t.jsxs("div",{className:"p-8 w-full",children:[t.jsx("h1",{className:"text-2xl font-bold mb-8 text-white",children:"数据概览"}),t.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-6 mb-8",children:_.map((k,w)=>t.jsxs(ke,{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:[t.jsxs($e,{className:"flex flex-row items-center justify-between pb-2",children:[t.jsx(Be,{className:"text-sm font-medium text-gray-400",children:k.title}),t.jsx("div",{className:`p-2 rounded-lg ${k.bg}`,children:t.jsx(k.icon,{className:`w-4 h-4 ${k.color}`})})]}),t.jsx(Ee,{children:t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsx("div",{className:"text-2xl font-bold text-white",children:k.value}),t.jsx(As,{className:"w-5 h-5 text-gray-600 group-hover:text-[#38bdac] transition-colors"})]})})]},w))}),t.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-8",children:[t.jsxs(ke,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:[t.jsx($e,{children:t.jsx(Be,{className:"text-white",children:"最近订单"})}),t.jsx(Ee,{children:t.jsxs("div",{className:"space-y-3",children:[u.slice(-5).reverse().map(k=>{var N;const w=k.referrerId?o.find(A=>A.id===k.referrerId):void 0,j=k.referralCode||(w==null?void 0:w.referralCode)||(w==null?void 0:w.nickname)||(k.referrerId?String(k.referrerId).slice(0,8):""),b=E(k),C=k.userNickname||((N=o.find(A=>A.id===k.userId))==null?void 0:N.nickname)||"匿名用户";return t.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:[t.jsxs("div",{className:"flex items-start gap-3 flex-1",children:[k.userAvatar?t.jsx("img",{src:k.userAvatar,alt:C,className:"w-9 h-9 rounded-full object-cover flex-shrink-0 mt-0.5",onError:A=>{A.currentTarget.style.display="none";const $=A.currentTarget.nextElementSibling;$&&$.classList.remove("hidden")}}):null,t.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:C.charAt(0)}),t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[t.jsx("span",{className:"text-sm text-gray-300",children:C}),t.jsx("span",{className:"text-gray-600",children:"·"}),t.jsx("span",{className:"text-sm font-medium text-white truncate",children:b.title})]}),t.jsxs("div",{className:"flex items-center gap-2 text-xs text-gray-500",children:[t.jsx("span",{className:"px-1.5 py-0.5 bg-gray-700/50 rounded",children:b.subtitle}),t.jsx("span",{children:new Date(k.createdAt||0).toLocaleString("zh-CN",{month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"})})]}),j&&t.jsxs("p",{className:"text-xs text-gray-600 mt-1",children:["推荐: ",j]})]})]}),t.jsxs("div",{className:"text-right ml-4 flex-shrink-0",children:[t.jsxs("p",{className:"text-sm font-bold text-[#38bdac]",children:["+¥",Number(k.amount).toFixed(2)]}),t.jsx("p",{className:"text-xs text-gray-500 mt-0.5",children:k.paymentMethod||"微信"})]})]},k.id)}),u.length===0&&t.jsxs("div",{className:"text-center py-12",children:[t.jsx(pd,{className:"w-12 h-12 text-gray-600 mx-auto mb-3"}),t.jsx("p",{className:"text-gray-500",children:"暂无订单数据"})]})]})})]}),t.jsxs(ke,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:[t.jsx($e,{children:t.jsx(Be,{className:"text-white",children:"新注册用户"})}),t.jsx(Ee,{children:t.jsxs("div",{className:"space-y-3",children:[o.slice(-5).reverse().map(k=>{var w;return t.jsxs("div",{className:"flex items-center justify-between p-4 bg-[#0a1628] rounded-lg border border-gray-700/30",children:[t.jsxs("div",{className:"flex items-center gap-3",children:[t.jsx("div",{className:"w-10 h-10 rounded-full bg-[#38bdac]/20 flex items-center justify-center text-sm font-medium text-[#38bdac]",children:((w=k.nickname)==null?void 0:w.charAt(0))||"?"}),t.jsxs("div",{children:[t.jsx("p",{className:"text-sm font-medium text-white",children:k.nickname||"匿名用户"}),t.jsx("p",{className:"text-xs text-gray-500",children:k.phone||"-"})]})]}),t.jsx("p",{className:"text-xs text-gray-400",children:k.createdAt?new Date(k.createdAt).toLocaleDateString():"-"})]},k.id)}),o.length===0&&t.jsx("p",{className:"text-gray-500 text-center py-8",children:"暂无用户数据"})]})})]})]})]})}const Yn=h.forwardRef(({className:r,...a},l)=>t.jsx("div",{className:"relative w-full overflow-auto",children:t.jsx("table",{ref:l,className:Ge("w-full caption-bottom text-sm",r),...a})}));Yn.displayName="Table";const Qn=h.forwardRef(({className:r,...a},l)=>t.jsx("thead",{ref:l,className:Ge("[&_tr]:border-b",r),...a}));Qn.displayName="TableHeader";const qn=h.forwardRef(({className:r,...a},l)=>t.jsx("tbody",{ref:l,className:Ge("[&_tr:last-child]:border-0",r),...a}));qn.displayName="TableBody";const rt=h.forwardRef(({className:r,...a},l)=>t.jsx("tr",{ref:l,className:Ge("border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted",r),...a}));rt.displayName="TableRow";const Pe=h.forwardRef(({className:r,...a},l)=>t.jsx("th",{ref:l,className:Ge("h-12 px-4 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0",r),...a}));Pe.displayName="TableHead";const we=h.forwardRef(({className:r,...a},l)=>t.jsx("td",{ref:l,className:Ge("p-4 align-middle [&:has([role=checkbox])]:pr-0",r),...a}));we.displayName="TableCell";const aw=Ip("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 Me({className:r,variant:a,asChild:l=!1,...o}){const c=l?Rp:"span";return t.jsx(c,{className:Ge(aw({variant:a}),r),...o})}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 lw(r,a){const l=h.createContext(a),o=u=>{const{children:f,...p}=u,x=h.useMemo(()=>p,Object.values(p));return t.jsx(l.Provider,{value:x,children:f})};o.displayName=r+"Provider";function c(u){const f=h.useContext(l);if(f)return f;if(a!==void 0)return a;throw new Error(`\`${u}\` must be used within \`${r}\``)}return[o,c]}function Rr(r,a=[]){let l=[];function o(u,f){const p=h.createContext(f),x=l.length;l=[...l,f];const g=y=>{var b;const{scope:E,children:_,...k}=y,w=((b=E==null?void 0:E[r])==null?void 0:b[x])||p,j=h.useMemo(()=>k,Object.values(k));return t.jsx(w.Provider,{value:j,children:_})};g.displayName=u+"Provider";function v(y,E){var w;const _=((w=E==null?void 0:E[r])==null?void 0:w[x])||p,k=h.useContext(_);if(k)return k;if(f!==void 0)return f;throw new Error(`\`${y}\` must be used within \`${u}\``)}return[g,v]}const c=()=>{const u=l.map(f=>h.createContext(f));return function(p){const x=(p==null?void 0:p[r])||u;return h.useMemo(()=>({[`__scope${r}`]:{...p,[r]:x}}),[p,x])}};return c.scopeName=r,[o,iw(c,...a)]}function iw(...r){const a=r[0];if(r.length===1)return a;const l=()=>{const o=r.map(c=>({useScope:c(),scopeName:c.scopeName}));return function(u){const f=o.reduce((p,{useScope:x,scopeName:g})=>{const y=x(u)[`__scope${g}`];return{...p,...y}},{});return h.useMemo(()=>({[`__scope${a.scopeName}`]:f}),[f])}};return l.scopeName=a.scopeName,l}var Rt=globalThis!=null&&globalThis.document?h.useLayoutEffect:()=>{},ow=Ii[" useId ".trim().toString()]||(()=>{}),cw=0;function wr(r){const[a,l]=h.useState(ow());return Rt(()=>{l(o=>o??String(cw++))},[r]),a?`radix-${a}`:""}var dw=Ii[" useInsertionEffect ".trim().toString()]||Rt;function Jr({prop:r,defaultProp:a,onChange:l=()=>{},caller:o}){const[c,u,f]=uw({defaultProp:a,onChange:l}),p=r!==void 0,x=p?r:c;{const v=h.useRef(r!==void 0);h.useEffect(()=>{const y=v.current;y!==p&&console.warn(`${o} is changing from ${y?"controlled":"uncontrolled"} to ${p?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),v.current=p},[p,o])}const g=h.useCallback(v=>{var y;if(p){const E=fw(v)?v(r):v;E!==r&&((y=f.current)==null||y.call(f,E))}else u(v)},[p,r,u,f]);return[x,g]}function uw({defaultProp:r,onChange:a}){const[l,o]=h.useState(r),c=h.useRef(l),u=h.useRef(a);return dw(()=>{u.current=a},[a]),h.useEffect(()=>{var f;c.current!==l&&((f=u.current)==null||f.call(u,l),c.current=l)},[l,c]),[l,o,u]}function fw(r){return typeof r=="function"}function $a(r){const a=hw(r),l=h.forwardRef((o,c)=>{const{children:u,...f}=o,p=h.Children.toArray(u),x=p.find(pw);if(x){const g=x.props.children,v=p.map(y=>y===x?h.Children.count(g)>1?h.Children.only(null):h.isValidElement(g)?g.props.children:null:y);return t.jsx(a,{...f,ref:c,children:h.isValidElement(g)?h.cloneElement(g,void 0,v):null})}return t.jsx(a,{...f,ref:c,children:u})});return l.displayName=`${r}.Slot`,l}function hw(r){const a=h.forwardRef((l,o)=>{const{children:c,...u}=l;if(h.isValidElement(c)){const f=gw(c),p=xw(u,c.props);return c.type!==h.Fragment&&(p.ref=o?Ud(o,f):f),h.cloneElement(c,p)}return h.Children.count(c)>1?h.Children.only(null):null});return a.displayName=`${r}.SlotClone`,a}var mw=Symbol("radix.slottable");function pw(r){return h.isValidElement(r)&&typeof r.type=="function"&&"__radixId"in r.type&&r.type.__radixId===mw}function xw(r,a){const l={...a};for(const o in a){const c=r[o],u=a[o];/^on[A-Z]/.test(o)?c&&u?l[o]=(...p)=>{const x=u(...p);return c(...p),x}:c&&(l[o]=c):o==="style"?l[o]={...c,...u}:o==="className"&&(l[o]=[c,u].filter(Boolean).join(" "))}return{...r,...l}}function gw(r){var o,c;let a=(o=Object.getOwnPropertyDescriptor(r.props,"ref"))==null?void 0:o.get,l=a&&"isReactWarning"in a&&a.isReactWarning;return l?r.ref:(a=(c=Object.getOwnPropertyDescriptor(r,"ref"))==null?void 0:c.get,l=a&&"isReactWarning"in a&&a.isReactWarning,l?r.props.ref:r.props.ref||r.ref)}var vw=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Oe=vw.reduce((r,a)=>{const l=$a(`Primitive.${a}`),o=h.forwardRef((c,u)=>{const{asChild:f,...p}=c,x=f?l:a;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),t.jsx(x,{...p,ref:u})});return o.displayName=`Primitive.${a}`,{...r,[a]:o}},{});function yw(r,a){r&&Ua.flushSync(()=>r.dispatchEvent(a))}function Cr(r){const a=h.useRef(r);return h.useEffect(()=>{a.current=r}),h.useMemo(()=>(...l)=>{var o;return(o=a.current)==null?void 0:o.call(a,...l)},[])}function jw(r,a=globalThis==null?void 0:globalThis.document){const l=Cr(r);h.useEffect(()=>{const o=c=>{c.key==="Escape"&&l(c)};return a.addEventListener("keydown",o,{capture:!0}),()=>a.removeEventListener("keydown",o,{capture:!0})},[l,a])}var Nw="DismissableLayer",yd="dismissableLayer.update",bw="dismissableLayer.pointerDownOutside",ww="dismissableLayer.focusOutside",Dm,Hp=h.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Wd=h.forwardRef((r,a)=>{const{disableOutsidePointerEvents:l=!1,onEscapeKeyDown:o,onPointerDownOutside:c,onFocusOutside:u,onInteractOutside:f,onDismiss:p,...x}=r,g=h.useContext(Hp),[v,y]=h.useState(null),E=(v==null?void 0:v.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,_]=h.useState({}),k=Ke(a,R=>y(R)),w=Array.from(g.layers),[j]=[...g.layersWithOutsidePointerEventsDisabled].slice(-1),b=w.indexOf(j),C=v?w.indexOf(v):-1,N=g.layersWithOutsidePointerEventsDisabled.size>0,A=C>=b,$=kw(R=>{const T=R.target,F=[...g.branches].some(Y=>Y.contains(T));!A||F||(c==null||c(R),f==null||f(R),R.defaultPrevented||p==null||p())},E),V=Ew(R=>{const T=R.target;[...g.branches].some(Y=>Y.contains(T))||(u==null||u(R),f==null||f(R),R.defaultPrevented||p==null||p())},E);return jw(R=>{C===g.layers.size-1&&(o==null||o(R),!R.defaultPrevented&&p&&(R.preventDefault(),p()))},E),h.useEffect(()=>{if(v)return l&&(g.layersWithOutsidePointerEventsDisabled.size===0&&(Dm=E.body.style.pointerEvents,E.body.style.pointerEvents="none"),g.layersWithOutsidePointerEventsDisabled.add(v)),g.layers.add(v),Lm(),()=>{l&&g.layersWithOutsidePointerEventsDisabled.size===1&&(E.body.style.pointerEvents=Dm)}},[v,E,l,g]),h.useEffect(()=>()=>{v&&(g.layers.delete(v),g.layersWithOutsidePointerEventsDisabled.delete(v),Lm())},[v,g]),h.useEffect(()=>{const R=()=>_({});return document.addEventListener(yd,R),()=>document.removeEventListener(yd,R)},[]),t.jsx(Oe.div,{...x,ref:k,style:{pointerEvents:N?A?"auto":"none":void 0,...r.style},onFocusCapture:Ae(r.onFocusCapture,V.onFocusCapture),onBlurCapture:Ae(r.onBlurCapture,V.onBlurCapture),onPointerDownCapture:Ae(r.onPointerDownCapture,$.onPointerDownCapture)})});Wd.displayName=Nw;var Sw="DismissableLayerBranch",Cw=h.forwardRef((r,a)=>{const l=h.useContext(Hp),o=h.useRef(null),c=Ke(a,o);return h.useEffect(()=>{const u=o.current;if(u)return l.branches.add(u),()=>{l.branches.delete(u)}},[l.branches]),t.jsx(Oe.div,{...r,ref:c})});Cw.displayName=Sw;function kw(r,a=globalThis==null?void 0:globalThis.document){const l=Cr(r),o=h.useRef(!1),c=h.useRef(()=>{});return h.useEffect(()=>{const u=p=>{if(p.target&&!o.current){let x=function(){Kp(bw,l,g,{discrete:!0})};const g={originalEvent:p};p.pointerType==="touch"?(a.removeEventListener("click",c.current),c.current=x,a.addEventListener("click",c.current,{once:!0})):x()}else a.removeEventListener("click",c.current);o.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:()=>o.current=!0}}function Ew(r,a=globalThis==null?void 0:globalThis.document){const l=Cr(r),o=h.useRef(!1);return h.useEffect(()=>{const c=u=>{u.target&&!o.current&&Kp(ww,l,{originalEvent:u},{discrete:!1})};return a.addEventListener("focusin",c),()=>a.removeEventListener("focusin",c)},[a,l]),{onFocusCapture:()=>o.current=!0,onBlurCapture:()=>o.current=!1}}function Lm(){const r=new CustomEvent(yd);document.dispatchEvent(r)}function Kp(r,a,l,{discrete:o}){const c=l.originalEvent.target,u=new CustomEvent(r,{bubbles:!1,cancelable:!0,detail:l});a&&c.addEventListener(r,a,{once:!0}),o?yw(c,u):c.dispatchEvent(u)}var qc="focusScope.autoFocusOnMount",Xc="focusScope.autoFocusOnUnmount",Om={bubbles:!1,cancelable:!0},Pw="FocusScope",Hd=h.forwardRef((r,a)=>{const{loop:l=!1,trapped:o=!1,onMountAutoFocus:c,onUnmountAutoFocus:u,...f}=r,[p,x]=h.useState(null),g=Cr(c),v=Cr(u),y=h.useRef(null),E=Ke(a,w=>x(w)),_=h.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;h.useEffect(()=>{if(o){let w=function(N){if(_.paused||!p)return;const A=N.target;p.contains(A)?y.current=A:yr(y.current,{select:!0})},j=function(N){if(_.paused||!p)return;const A=N.relatedTarget;A!==null&&(p.contains(A)||yr(y.current,{select:!0}))},b=function(N){if(document.activeElement===document.body)for(const $ of N)$.removedNodes.length>0&&yr(p)};document.addEventListener("focusin",w),document.addEventListener("focusout",j);const C=new MutationObserver(b);return p&&C.observe(p,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",w),document.removeEventListener("focusout",j),C.disconnect()}}},[o,p,_.paused]),h.useEffect(()=>{if(p){zm.add(_);const w=document.activeElement;if(!p.contains(w)){const b=new CustomEvent(qc,Om);p.addEventListener(qc,g),p.dispatchEvent(b),b.defaultPrevented||(Rw(Mw(Gp(p)),{select:!0}),document.activeElement===w&&yr(p))}return()=>{p.removeEventListener(qc,g),setTimeout(()=>{const b=new CustomEvent(Xc,Om);p.addEventListener(Xc,v),p.dispatchEvent(b),b.defaultPrevented||yr(w??document.body,{select:!0}),p.removeEventListener(Xc,v),zm.remove(_)},0)}}},[p,g,v,_]);const k=h.useCallback(w=>{if(!l&&!o||_.paused)return;const j=w.key==="Tab"&&!w.altKey&&!w.ctrlKey&&!w.metaKey,b=document.activeElement;if(j&&b){const C=w.currentTarget,[N,A]=_w(C);N&&A?!w.shiftKey&&b===A?(w.preventDefault(),l&&yr(N,{select:!0})):w.shiftKey&&b===N&&(w.preventDefault(),l&&yr(A,{select:!0})):b===C&&w.preventDefault()}},[l,o,_.paused]);return t.jsx(Oe.div,{tabIndex:-1,...f,ref:E,onKeyDown:k})});Hd.displayName=Pw;function Rw(r,{select:a=!1}={}){const l=document.activeElement;for(const o of r)if(yr(o,{select:a}),document.activeElement!==l)return}function _w(r){const a=Gp(r),l=Fm(a,r),o=Fm(a.reverse(),r);return[l,o]}function Gp(r){const a=[],l=document.createTreeWalker(r,NodeFilter.SHOW_ELEMENT,{acceptNode:o=>{const c=o.tagName==="INPUT"&&o.type==="hidden";return o.disabled||o.hidden||c?NodeFilter.FILTER_SKIP:o.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;l.nextNode();)a.push(l.currentNode);return a}function Fm(r,a){for(const l of r)if(!Tw(l,{upTo:a}))return l}function Tw(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 Iw(r){return r instanceof HTMLInputElement&&"select"in r}function yr(r,{select:a=!1}={}){if(r&&r.focus){const l=document.activeElement;r.focus({preventScroll:!0}),r!==l&&Iw(r)&&a&&r.select()}}var zm=Aw();function Aw(){let r=[];return{add(a){const l=r[0];a!==l&&(l==null||l.pause()),r=$m(r,a),r.unshift(a)},remove(a){var l;r=$m(r,a),(l=r[0])==null||l.resume()}}}function $m(r,a){const l=[...r],o=l.indexOf(a);return o!==-1&&l.splice(o,1),l}function Mw(r){return r.filter(a=>a.tagName!=="A")}var Dw="Portal",Kd=h.forwardRef((r,a)=>{var p;const{container:l,...o}=r,[c,u]=h.useState(!1);Rt(()=>u(!0),[]);const f=l||c&&((p=globalThis==null?void 0:globalThis.document)==null?void 0:p.body);return f?dy.createPortal(t.jsx(Oe.div,{...o,ref:a}),f):null});Kd.displayName=Dw;function Lw(r,a){return h.useReducer((l,o)=>a[l][o]??l,r)}var Ha=r=>{const{present:a,children:l}=r,o=Ow(a),c=typeof l=="function"?l({present:o.isPresent}):h.Children.only(l),u=Ke(o.ref,Fw(c));return typeof l=="function"||o.isPresent?h.cloneElement(c,{ref:u}):null};Ha.displayName="Presence";function Ow(r){const[a,l]=h.useState(),o=h.useRef(null),c=h.useRef(r),u=h.useRef("none"),f=r?"mounted":"unmounted",[p,x]=Lw(f,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return h.useEffect(()=>{const g=ai(o.current);u.current=p==="mounted"?g:"none"},[p]),Rt(()=>{const g=o.current,v=c.current;if(v!==r){const E=u.current,_=ai(g);r?x("MOUNT"):_==="none"||(g==null?void 0:g.display)==="none"?x("UNMOUNT"):x(v&&E!==_?"ANIMATION_OUT":"UNMOUNT"),c.current=r}},[r,x]),Rt(()=>{if(a){let g;const v=a.ownerDocument.defaultView??window,y=_=>{const w=ai(o.current).includes(CSS.escape(_.animationName));if(_.target===a&&w&&(x("ANIMATION_END"),!c.current)){const j=a.style.animationFillMode;a.style.animationFillMode="forwards",g=v.setTimeout(()=>{a.style.animationFillMode==="forwards"&&(a.style.animationFillMode=j)})}},E=_=>{_.target===a&&(u.current=ai(o.current))};return a.addEventListener("animationstart",E),a.addEventListener("animationcancel",y),a.addEventListener("animationend",y),()=>{v.clearTimeout(g),a.removeEventListener("animationstart",E),a.removeEventListener("animationcancel",y),a.removeEventListener("animationend",y)}}else x("ANIMATION_END")},[a,x]),{isPresent:["mounted","unmountSuspended"].includes(p),ref:h.useCallback(g=>{o.current=g?getComputedStyle(g):null,l(g)},[])}}function ai(r){return(r==null?void 0:r.animationName)||"none"}function Fw(r){var o,c;let a=(o=Object.getOwnPropertyDescriptor(r.props,"ref"))==null?void 0:o.get,l=a&&"isReactWarning"in a&&a.isReactWarning;return l?r.ref:(a=(c=Object.getOwnPropertyDescriptor(r,"ref"))==null?void 0:c.get,l=a&&"isReactWarning"in a&&a.isReactWarning,l?r.props.ref:r.props.ref||r.ref)}var Jc=0;function Yp(){h.useEffect(()=>{const r=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",r[0]??Bm()),document.body.insertAdjacentElement("beforeend",r[1]??Bm()),Jc++,()=>{Jc===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(a=>a.remove()),Jc--}},[])}function Bm(){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 En=function(){return En=Object.assign||function(a){for(var l,o=1,c=arguments.length;o"u")return t1;var a=n1(r),l=document.documentElement.clientWidth,o=window.innerWidth;return{left:a[0],top:a[1],right:a[2],gap:Math.max(0,o-l+a[2]-a[0])}},s1=Jp(),Ds="data-scroll-locked",a1=function(r,a,l,o){var c=r.left,u=r.top,f=r.right,p=r.gap;return l===void 0&&(l="margin"),` + .`.concat($w,` { + overflow: hidden `).concat(o,`; + padding-right: `).concat(p,"px ").concat(o,`; + } + body[`).concat(Ds,`] { + overflow: hidden `).concat(o,`; + overscroll-behavior: contain; + `).concat([a&&"position: relative ".concat(o,";"),l==="margin"&&` + padding-left: `.concat(c,`px; + padding-top: `).concat(u,`px; + padding-right: `).concat(f,`px; + margin-left:0; + margin-top:0; + margin-right: `).concat(p,"px ").concat(o,`; + `),l==="padding"&&"padding-right: ".concat(p,"px ").concat(o,";")].filter(Boolean).join(""),` + } + + .`).concat(hi,` { + right: `).concat(p,"px ").concat(o,`; + } + + .`).concat(mi,` { + margin-right: `).concat(p,"px ").concat(o,`; + } + + .`).concat(hi," .").concat(hi,` { + right: 0 `).concat(o,`; + } + + .`).concat(mi," .").concat(mi,` { + margin-right: 0 `).concat(o,`; + } + + body[`).concat(Ds,`] { + `).concat(Bw,": ").concat(p,`px; + } +`)},Vm=function(){var r=parseInt(document.body.getAttribute(Ds)||"0",10);return isFinite(r)?r:0},l1=function(){h.useEffect(function(){return document.body.setAttribute(Ds,(Vm()+1).toString()),function(){var r=Vm()-1;r<=0?document.body.removeAttribute(Ds):document.body.setAttribute(Ds,r.toString())}},[])},i1=function(r){var a=r.noRelative,l=r.noImportant,o=r.gapMode,c=o===void 0?"margin":o;l1();var u=h.useMemo(function(){return r1(c)},[c]);return h.createElement(s1,{styles:a1(u,!a,c,l?"":"!important")})},jd=!1;if(typeof window<"u")try{var li=Object.defineProperty({},"passive",{get:function(){return jd=!0,!0}});window.addEventListener("test",li,li),window.removeEventListener("test",li,li)}catch{jd=!1}var _s=jd?{passive:!1}:!1,o1=function(r){return r.tagName==="TEXTAREA"},Zp=function(r,a){if(!(r instanceof Element))return!1;var l=window.getComputedStyle(r);return l[a]!=="hidden"&&!(l.overflowY===l.overflowX&&!o1(r)&&l[a]==="visible")},c1=function(r){return Zp(r,"overflowY")},d1=function(r){return Zp(r,"overflowX")},Wm=function(r,a){var l=a.ownerDocument,o=a;do{typeof ShadowRoot<"u"&&o instanceof ShadowRoot&&(o=o.host);var c=ex(r,o);if(c){var u=tx(r,o),f=u[1],p=u[2];if(f>p)return!0}o=o.parentNode}while(o&&o!==l.body);return!1},u1=function(r){var a=r.scrollTop,l=r.scrollHeight,o=r.clientHeight;return[a,l,o]},f1=function(r){var a=r.scrollLeft,l=r.scrollWidth,o=r.clientWidth;return[a,l,o]},ex=function(r,a){return r==="v"?c1(a):d1(a)},tx=function(r,a){return r==="v"?u1(a):f1(a)},h1=function(r,a){return r==="h"&&a==="rtl"?-1:1},m1=function(r,a,l,o,c){var u=h1(r,window.getComputedStyle(a).direction),f=u*o,p=l.target,x=a.contains(p),g=!1,v=f>0,y=0,E=0;do{if(!p)break;var _=tx(r,p),k=_[0],w=_[1],j=_[2],b=w-j-u*k;(k||b)&&ex(r,p)&&(y+=b,E+=k);var C=p.parentNode;p=C&&C.nodeType===Node.DOCUMENT_FRAGMENT_NODE?C.host:C}while(!x&&p!==document.body||x&&(a.contains(p)||a===p));return(v&&Math.abs(y)<1||!v&&Math.abs(E)<1)&&(g=!0),g},ii=function(r){return"changedTouches"in r?[r.changedTouches[0].clientX,r.changedTouches[0].clientY]:[0,0]},Hm=function(r){return[r.deltaX,r.deltaY]},Km=function(r){return r&&"current"in r?r.current:r},p1=function(r,a){return r[0]===a[0]&&r[1]===a[1]},x1=function(r){return` + .block-interactivity-`.concat(r,` {pointer-events: none;} + .allow-interactivity-`).concat(r,` {pointer-events: all;} +`)},g1=0,Ts=[];function v1(r){var a=h.useRef([]),l=h.useRef([0,0]),o=h.useRef(),c=h.useState(g1++)[0],u=h.useState(Jp)[0],f=h.useRef(r);h.useEffect(function(){f.current=r},[r]),h.useEffect(function(){if(r.inert){document.body.classList.add("block-interactivity-".concat(c));var w=zw([r.lockRef.current],(r.shards||[]).map(Km),!0).filter(Boolean);return w.forEach(function(j){return j.classList.add("allow-interactivity-".concat(c))}),function(){document.body.classList.remove("block-interactivity-".concat(c)),w.forEach(function(j){return j.classList.remove("allow-interactivity-".concat(c))})}}},[r.inert,r.lockRef.current,r.shards]);var p=h.useCallback(function(w,j){if("touches"in w&&w.touches.length===2||w.type==="wheel"&&w.ctrlKey)return!f.current.allowPinchZoom;var b=ii(w),C=l.current,N="deltaX"in w?w.deltaX:C[0]-b[0],A="deltaY"in w?w.deltaY:C[1]-b[1],$,V=w.target,R=Math.abs(N)>Math.abs(A)?"h":"v";if("touches"in w&&R==="h"&&V.type==="range")return!1;var T=window.getSelection(),F=T&&T.anchorNode,Y=F?F===V||F.contains(V):!1;if(Y)return!1;var K=Wm(R,V);if(!K)return!0;if(K?$=R:($=R==="v"?"h":"v",K=Wm(R,V)),!K)return!1;if(!o.current&&"changedTouches"in w&&(N||A)&&(o.current=$),!$)return!0;var J=o.current||$;return m1(J,j,w,J==="h"?N:A)},[]),x=h.useCallback(function(w){var j=w;if(!(!Ts.length||Ts[Ts.length-1]!==u)){var b="deltaY"in j?Hm(j):ii(j),C=a.current.filter(function($){return $.name===j.type&&($.target===j.target||j.target===$.shadowParent)&&p1($.delta,b)})[0];if(C&&C.should){j.cancelable&&j.preventDefault();return}if(!C){var N=(f.current.shards||[]).map(Km).filter(Boolean).filter(function($){return $.contains(j.target)}),A=N.length>0?p(j,N[0]):!f.current.noIsolation;A&&j.cancelable&&j.preventDefault()}}},[]),g=h.useCallback(function(w,j,b,C){var N={name:w,delta:j,target:b,should:C,shadowParent:y1(b)};a.current.push(N),setTimeout(function(){a.current=a.current.filter(function(A){return A!==N})},1)},[]),v=h.useCallback(function(w){l.current=ii(w),o.current=void 0},[]),y=h.useCallback(function(w){g(w.type,Hm(w),w.target,p(w,r.lockRef.current))},[]),E=h.useCallback(function(w){g(w.type,ii(w),w.target,p(w,r.lockRef.current))},[]);h.useEffect(function(){return Ts.push(u),r.setCallbacks({onScrollCapture:y,onWheelCapture:y,onTouchMoveCapture:E}),document.addEventListener("wheel",x,_s),document.addEventListener("touchmove",x,_s),document.addEventListener("touchstart",v,_s),function(){Ts=Ts.filter(function(w){return w!==u}),document.removeEventListener("wheel",x,_s),document.removeEventListener("touchmove",x,_s),document.removeEventListener("touchstart",v,_s)}},[]);var _=r.removeScrollBar,k=r.inert;return h.createElement(h.Fragment,null,k?h.createElement(u,{styles:x1(c)}):null,_?h.createElement(i1,{noRelative:r.noRelative,gapMode:r.gapMode}):null)}function y1(r){for(var a=null;r!==null;)r instanceof ShadowRoot&&(a=r.host,r=r.host),r=r.parentNode;return a}const j1=Yw(Xp,v1);var Gd=h.forwardRef(function(r,a){return h.createElement(Fi,En({},r,{ref:a,sideCar:j1}))});Gd.classNames=Fi.classNames;var N1=function(r){if(typeof document>"u")return null;var a=Array.isArray(r)?r[0]:r;return a.ownerDocument.body},Is=new WeakMap,oi=new WeakMap,ci={},nd=0,nx=function(r){return r&&(r.host||nx(r.parentNode))},b1=function(r,a){return a.map(function(l){if(r.contains(l))return l;var o=nx(l);return o&&r.contains(o)?o:(console.error("aria-hidden",l,"in not contained inside",r,". Doing nothing"),null)}).filter(function(l){return!!l})},w1=function(r,a,l,o){var c=b1(a,Array.isArray(r)?r:[r]);ci[l]||(ci[l]=new WeakMap);var u=ci[l],f=[],p=new Set,x=new Set(c),g=function(y){!y||p.has(y)||(p.add(y),g(y.parentNode))};c.forEach(g);var v=function(y){!y||x.has(y)||Array.prototype.forEach.call(y.children,function(E){if(p.has(E))v(E);else try{var _=E.getAttribute(o),k=_!==null&&_!=="false",w=(Is.get(E)||0)+1,j=(u.get(E)||0)+1;Is.set(E,w),u.set(E,j),f.push(E),w===1&&k&&oi.set(E,!0),j===1&&E.setAttribute(l,"true"),k||E.setAttribute(o,"true")}catch(b){console.error("aria-hidden: cannot operate on ",E,b)}})};return v(a),p.clear(),nd++,function(){f.forEach(function(y){var E=Is.get(y)-1,_=u.get(y)-1;Is.set(y,E),u.set(y,_),E||(oi.has(y)||y.removeAttribute(o),oi.delete(y)),_||y.removeAttribute(l)}),nd--,nd||(Is=new WeakMap,Is=new WeakMap,oi=new WeakMap,ci={})}},rx=function(r,a,l){l===void 0&&(l="data-aria-hidden");var o=Array.from(Array.isArray(r)?r:[r]),c=N1(r);return c?(o.push.apply(o,Array.from(c.querySelectorAll("[aria-live], script"))),w1(o,c,l,"aria-hidden")):function(){return null}},zi="Dialog",[sx]=Rr(zi),[S1,Nn]=sx(zi),ax=r=>{const{__scopeDialog:a,children:l,open:o,defaultOpen:c,onOpenChange:u,modal:f=!0}=r,p=h.useRef(null),x=h.useRef(null),[g,v]=Jr({prop:o,defaultProp:c??!1,onChange:u,caller:zi});return t.jsx(S1,{scope:a,triggerRef:p,contentRef:x,contentId:wr(),titleId:wr(),descriptionId:wr(),open:g,onOpenChange:v,onOpenToggle:h.useCallback(()=>v(y=>!y),[v]),modal:f,children:l})};ax.displayName=zi;var lx="DialogTrigger",C1=h.forwardRef((r,a)=>{const{__scopeDialog:l,...o}=r,c=Nn(lx,l),u=Ke(a,c.triggerRef);return t.jsx(Oe.button,{type:"button","aria-haspopup":"dialog","aria-expanded":c.open,"aria-controls":c.contentId,"data-state":qd(c.open),...o,ref:u,onClick:Ae(r.onClick,c.onOpenToggle)})});C1.displayName=lx;var Yd="DialogPortal",[k1,ix]=sx(Yd,{forceMount:void 0}),ox=r=>{const{__scopeDialog:a,forceMount:l,children:o,container:c}=r,u=Nn(Yd,a);return t.jsx(k1,{scope:a,forceMount:l,children:h.Children.map(o,f=>t.jsx(Ha,{present:l||u.open,children:t.jsx(Kd,{asChild:!0,container:c,children:f})}))})};ox.displayName=Yd;var Ci="DialogOverlay",cx=h.forwardRef((r,a)=>{const l=ix(Ci,r.__scopeDialog),{forceMount:o=l.forceMount,...c}=r,u=Nn(Ci,r.__scopeDialog);return u.modal?t.jsx(Ha,{present:o||u.open,children:t.jsx(P1,{...c,ref:a})}):null});cx.displayName=Ci;var E1=$a("DialogOverlay.RemoveScroll"),P1=h.forwardRef((r,a)=>{const{__scopeDialog:l,...o}=r,c=Nn(Ci,l);return t.jsx(Gd,{as:E1,allowPinchZoom:!0,shards:[c.contentRef],children:t.jsx(Oe.div,{"data-state":qd(c.open),...o,ref:a,style:{pointerEvents:"auto",...o.style}})})}),Zr="DialogContent",dx=h.forwardRef((r,a)=>{const l=ix(Zr,r.__scopeDialog),{forceMount:o=l.forceMount,...c}=r,u=Nn(Zr,r.__scopeDialog);return t.jsx(Ha,{present:o||u.open,children:u.modal?t.jsx(R1,{...c,ref:a}):t.jsx(_1,{...c,ref:a})})});dx.displayName=Zr;var R1=h.forwardRef((r,a)=>{const l=Nn(Zr,r.__scopeDialog),o=h.useRef(null),c=Ke(a,l.contentRef,o);return h.useEffect(()=>{const u=o.current;if(u)return rx(u)},[]),t.jsx(ux,{...r,ref:c,trapFocus:l.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Ae(r.onCloseAutoFocus,u=>{var f;u.preventDefault(),(f=l.triggerRef.current)==null||f.focus()}),onPointerDownOutside:Ae(r.onPointerDownOutside,u=>{const f=u.detail.originalEvent,p=f.button===0&&f.ctrlKey===!0;(f.button===2||p)&&u.preventDefault()}),onFocusOutside:Ae(r.onFocusOutside,u=>u.preventDefault())})}),_1=h.forwardRef((r,a)=>{const l=Nn(Zr,r.__scopeDialog),o=h.useRef(!1),c=h.useRef(!1);return t.jsx(ux,{...r,ref:a,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:u=>{var f,p;(f=r.onCloseAutoFocus)==null||f.call(r,u),u.defaultPrevented||(o.current||(p=l.triggerRef.current)==null||p.focus(),u.preventDefault()),o.current=!1,c.current=!1},onInteractOutside:u=>{var x,g;(x=r.onInteractOutside)==null||x.call(r,u),u.defaultPrevented||(o.current=!0,u.detail.originalEvent.type==="pointerdown"&&(c.current=!0));const f=u.target;((g=l.triggerRef.current)==null?void 0:g.contains(f))&&u.preventDefault(),u.detail.originalEvent.type==="focusin"&&c.current&&u.preventDefault()}})}),ux=h.forwardRef((r,a)=>{const{__scopeDialog:l,trapFocus:o,onOpenAutoFocus:c,onCloseAutoFocus:u,...f}=r,p=Nn(Zr,l),x=h.useRef(null),g=Ke(a,x);return Yp(),t.jsxs(t.Fragment,{children:[t.jsx(Hd,{asChild:!0,loop:!0,trapped:o,onMountAutoFocus:c,onUnmountAutoFocus:u,children:t.jsx(Wd,{role:"dialog",id:p.contentId,"aria-describedby":p.descriptionId,"aria-labelledby":p.titleId,"data-state":qd(p.open),...f,ref:g,onDismiss:()=>p.onOpenChange(!1)})}),t.jsxs(t.Fragment,{children:[t.jsx(T1,{titleId:p.titleId}),t.jsx(A1,{contentRef:x,descriptionId:p.descriptionId})]})]})}),Qd="DialogTitle",fx=h.forwardRef((r,a)=>{const{__scopeDialog:l,...o}=r,c=Nn(Qd,l);return t.jsx(Oe.h2,{id:c.titleId,...o,ref:a})});fx.displayName=Qd;var hx="DialogDescription",mx=h.forwardRef((r,a)=>{const{__scopeDialog:l,...o}=r,c=Nn(hx,l);return t.jsx(Oe.p,{id:c.descriptionId,...o,ref:a})});mx.displayName=hx;var px="DialogClose",xx=h.forwardRef((r,a)=>{const{__scopeDialog:l,...o}=r,c=Nn(px,l);return t.jsx(Oe.button,{type:"button",...o,ref:a,onClick:Ae(r.onClick,()=>c.onOpenChange(!1))})});xx.displayName=px;function qd(r){return r?"open":"closed"}var gx="DialogTitleWarning",[g4,vx]=lw(gx,{contentName:Zr,titleName:Qd,docsSlug:"dialog"}),T1=({titleId:r})=>{const a=vx(gx),l=`\`${a.contentName}\` requires a \`${a.titleName}\` for the component to be accessible for screen reader users. + +If you want to hide the \`${a.titleName}\`, you can wrap it with our VisuallyHidden component. + +For more information, see https://radix-ui.com/primitives/docs/components/${a.docsSlug}`;return h.useEffect(()=>{r&&(document.getElementById(r)||console.error(l))},[l,r]),null},I1="DialogDescriptionWarning",A1=({contentRef:r,descriptionId:a})=>{const o=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${vx(I1).contentName}}.`;return h.useEffect(()=>{var u;const c=(u=r.current)==null?void 0:u.getAttribute("aria-describedby");a&&c&&(document.getElementById(a)||console.warn(o))},[o,r,a]),null},M1=ax,D1=ox,L1=cx,O1=dx,F1=fx,z1=mx,$1=xx;function Bt(r){return t.jsx(M1,{"data-slot":"dialog",...r})}function B1(r){return t.jsx(D1,{...r})}const yx=h.forwardRef(({className:r,...a},l)=>t.jsx(L1,{ref:l,className:Ge("fixed inset-0 z-50 bg-black/50",r),...a}));yx.displayName="DialogOverlay";const It=h.forwardRef(({className:r,children:a,showCloseButton:l=!0,...o},c)=>t.jsxs(B1,{children:[t.jsx(yx,{}),t.jsxs(O1,{ref:c,"aria-describedby":void 0,className:Ge("fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] -translate-x-1/2 -translate-y-1/2 gap-4 rounded-lg border bg-background p-6 shadow-lg sm:max-w-lg",r),...o,children:[a,l&&t.jsxs($1,{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:[t.jsx(on,{className:"h-4 w-4"}),t.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));It.displayName="DialogContent";function Ut({className:r,...a}){return t.jsx("div",{className:Ge("flex flex-col gap-2 text-center sm:text-left",r),...a})}function qt({className:r,...a}){return t.jsx("div",{className:Ge("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",r),...a})}function Vt(r){return t.jsx(F1,{className:"text-lg font-semibold leading-none",...r})}function U1(r){return t.jsx(z1,{className:"text-sm text-muted-foreground",...r})}function Xd(r,a){const[l,o]=h.useState(r);return h.useEffect(()=>{const c=setTimeout(()=>o(r),a);return()=>clearTimeout(c)},[r,a]),l}function Sr({page:r,totalPages:a,total:l,pageSize:o,onPageChange:c,onPageSizeChange:u,pageSizeOptions:f=[10,20,50,100]}){return a<=1&&!u?null:t.jsxs("div",{className:"flex items-center justify-between gap-4 py-4 px-5 border-t border-gray-700/50",children:[t.jsxs("div",{className:"flex items-center gap-2 text-sm text-gray-400",children:[t.jsxs("span",{children:["共 ",l," 条"]}),u&&t.jsx("select",{value:o,onChange:p=>u(Number(p.target.value)),className:"bg-[#0f2137] border border-gray-600 rounded px-2 py-1 text-gray-300 text-sm",children:f.map(p=>t.jsxs("option",{value:p,children:[p," 条/页"]},p))})]}),a>1&&t.jsxs("div",{className:"flex items-center gap-2",children:[t.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:"首页"}),t.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:"上一页"}),t.jsxs("span",{className:"px-3 py-1 text-gray-400 text-sm",children:[r," / ",a]}),t.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:"下一页"}),t.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 V1(){const[r,a]=h.useState([]),[l,o]=h.useState([]),[c,u]=h.useState(0),[f,p]=h.useState(0),[x,g]=h.useState(0),[v,y]=h.useState(1),[E,_]=h.useState(10),[k,w]=h.useState(""),j=Xd(k,300),[b,C]=h.useState("all"),[N,A]=h.useState(!0),[$,V]=h.useState(null),[R,T]=h.useState(null),[F,Y]=h.useState(""),[K,J]=h.useState(!1);async function ce(){A(!0),V(null);try{const B=b==="all"?"":b==="completed"?"completed":b,D=new URLSearchParams({page:String(v),pageSize:String(E),...B&&{status:B},...j&&{search:j}}),[P,W]=await Promise.all([We(`/api/orders?${D}`),We("/api/db/users?page=1&pageSize=500")]);P!=null&&P.success&&(a(P.orders||[]),u(P.total??0),p(P.totalRevenue??0),g(P.todayRevenue??0)),W!=null&&W.success&&W.users&&o(W.users)}catch(B){console.error("加载订单失败",B),V("加载订单失败,请检查网络后重试")}finally{A(!1)}}h.useEffect(()=>{y(1)},[j,b]),h.useEffect(()=>{ce()},[v,E,j,b]);const X=B=>{var D;return B.userNickname||((D=l.find(P=>P.id===B.userId))==null?void 0:D.nickname)||"匿名用户"},le=B=>{var D;return((D=l.find(P=>P.id===B))==null?void 0:D.phone)||"-"},ee=B=>{const D=B.productType||B.type||"",P=B.description||"";if(P){if(D==="section"&&P.includes("章节")){if(P.includes("-")){const W=P.split("-");if(W.length>=3)return{name:`第${W[1]}章 第${W[2]}节`,type:"《一场Soul的创业实验》"}}return{name:P,type:"章节购买"}}return D==="fullbook"||P.includes("全书")?{name:"《一场Soul的创业实验》",type:"全书购买"}:D==="vip"||P.includes("VIP")?{name:"VIP年度会员",type:"VIP"}:D==="match"||P.includes("伙伴")?{name:"找伙伴匹配",type:"功能服务"}:{name:P,type:"其他"}}return D==="section"?{name:`章节 ${B.productId||B.sectionId||""}`,type:"单章"}:D==="fullbook"?{name:"《一场Soul的创业实验》",type:"全书"}:D==="vip"?{name:"VIP年度会员",type:"VIP"}:D==="match"?{name:"找伙伴匹配",type:"功能"}:{name:"未知商品",type:D||"其他"}},q=Math.ceil(c/E)||1;async function I(){var B;if(!(!(R!=null&&R.orderSn)&&!(R!=null&&R.id))){J(!0),V(null);try{const D=await Pt("/api/admin/orders/refund",{orderSn:R.orderSn||R.id,reason:F||void 0});D!=null&&D.success?(T(null),Y(""),ce()):V((D==null?void 0:D.error)||"退款失败")}catch(D){const P=D;V(((B=P==null?void 0:P.data)==null?void 0:B.error)||"退款失败,请检查网络后重试")}finally{J(!1)}}}function Q(){if(r.length===0){alert("暂无数据可导出");return}const B=["订单号","用户","手机号","商品","金额","支付方式","状态","退款原因","分销佣金","下单时间"],D=r.map(me=>{const se=ee(me);return[me.orderSn||me.id||"",X(me),le(me.userId),se.name,Number(me.amount||0).toFixed(2),me.paymentMethod==="wechat"?"微信支付":me.paymentMethod==="alipay"?"支付宝":me.paymentMethod||"微信支付",me.status==="refunded"?"已退款":me.status==="paid"||me.status==="completed"?"已完成":me.status==="pending"||me.status==="created"?"待支付":"已失败",me.status==="refunded"&&me.refundReason?me.refundReason:"-",me.referrerEarnings?Number(me.referrerEarnings).toFixed(2):"-",me.createdAt?new Date(me.createdAt).toLocaleString("zh-CN"):""].join(",")}),P="\uFEFF"+[B.join(","),...D].join(` +`),W=new Blob([P],{type:"text/csv;charset=utf-8"}),re=URL.createObjectURL(W),he=document.createElement("a");he.href=re,he.download=`订单列表_${new Date().toISOString().slice(0,10)}.csv`,he.click(),URL.revokeObjectURL(re)}return t.jsxs("div",{className:"p-8 w-full",children:[$&&t.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:[t.jsx("span",{children:$}),t.jsx("button",{type:"button",onClick:()=>V(null),className:"hover:text-red-300",children:"×"})]}),t.jsxs("div",{className:"flex justify-between items-center mb-8",children:[t.jsxs("div",{children:[t.jsx("h2",{className:"text-2xl font-bold text-white",children:"订单管理"}),t.jsxs("p",{className:"text-gray-400 mt-1",children:["共 ",r.length," 笔订单"]})]}),t.jsxs("div",{className:"flex items-center gap-4",children:[t.jsxs(oe,{variant:"outline",onClick:ce,disabled:N,className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:[t.jsx(Ze,{className:`w-4 h-4 mr-2 ${N?"animate-spin":""}`}),"刷新"]}),t.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[t.jsx("span",{className:"text-gray-400",children:"总收入:"}),t.jsxs("span",{className:"text-[#38bdac] font-bold",children:["¥",f.toFixed(2)]}),t.jsx("span",{className:"text-gray-600",children:"|"}),t.jsx("span",{className:"text-gray-400",children:"今日:"}),t.jsxs("span",{className:"text-[#FFD700] font-bold",children:["¥",x.toFixed(2)]})]})]})]}),t.jsxs("div",{className:"flex items-center gap-4 mb-6",children:[t.jsxs("div",{className:"relative flex-1 max-w-md",children:[t.jsx(Qr,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-gray-500"}),t.jsx(ne,{type:"text",placeholder:"搜索订单号/用户/章节...",className:"pl-10 bg-[#0f2137] border-gray-700 text-white placeholder:text-gray-500",value:k,onChange:B=>w(B.target.value)})]}),t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx(Yj,{className:"w-4 h-4 text-gray-400"}),t.jsxs("select",{value:b,onChange:B=>C(B.target.value),className:"bg-[#0f2137] border border-gray-700 text-white rounded-lg px-3 py-2 text-sm",children:[t.jsx("option",{value:"all",children:"全部状态"}),t.jsx("option",{value:"completed",children:"已完成"}),t.jsx("option",{value:"pending",children:"待支付"}),t.jsx("option",{value:"created",children:"已创建"}),t.jsx("option",{value:"failed",children:"已失败"}),t.jsx("option",{value:"refunded",children:"已退款"})]})]}),t.jsxs(oe,{variant:"outline",onClick:Q,disabled:r.length===0,className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:[t.jsx(Uj,{className:"w-4 h-4 mr-2"}),"导出 CSV"]})]}),t.jsx(ke,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:t.jsx(Ee,{className:"p-0",children:N?t.jsxs("div",{className:"flex items-center justify-center py-12",children:[t.jsx(Ze,{className:"w-6 h-6 text-[#38bdac] animate-spin"}),t.jsx("span",{className:"ml-2 text-gray-400",children:"加载中..."})]}):t.jsxs("div",{children:[t.jsxs(Yn,{children:[t.jsx(Qn,{children:t.jsxs(rt,{className:"bg-[#0a1628] hover:bg-[#0a1628] border-gray-700",children:[t.jsx(Pe,{className:"text-gray-400",children:"订单号"}),t.jsx(Pe,{className:"text-gray-400",children:"用户"}),t.jsx(Pe,{className:"text-gray-400",children:"商品"}),t.jsx(Pe,{className:"text-gray-400",children:"金额"}),t.jsx(Pe,{className:"text-gray-400",children:"支付方式"}),t.jsx(Pe,{className:"text-gray-400",children:"状态"}),t.jsx(Pe,{className:"text-gray-400",children:"退款原因"}),t.jsx(Pe,{className:"text-gray-400",children:"分销佣金"}),t.jsx(Pe,{className:"text-gray-400",children:"下单时间"}),t.jsx(Pe,{className:"text-gray-400",children:"操作"})]})}),t.jsxs(qn,{children:[r.map(B=>{const D=ee(B);return t.jsxs(rt,{className:"hover:bg-[#0a1628] border-gray-700/50",children:[t.jsxs(we,{className:"font-mono text-xs text-gray-400",children:[(B.orderSn||B.id||"").slice(0,12),"..."]}),t.jsx(we,{children:t.jsxs("div",{children:[t.jsx("p",{className:"text-white text-sm",children:X(B)}),t.jsx("p",{className:"text-gray-500 text-xs",children:le(B.userId)})]})}),t.jsx(we,{children:t.jsxs("div",{children:[t.jsxs("p",{className:"text-white text-sm flex items-center gap-2",children:[D.name,(B.productType||B.type)==="vip"&&t.jsx(Me,{className:"bg-amber-500/20 text-amber-400 hover:bg-amber-500/20 border-0 text-xs",children:"VIP"})]}),t.jsx("p",{className:"text-gray-500 text-xs",children:D.type})]})}),t.jsxs(we,{className:"text-[#38bdac] font-bold",children:["¥",Number(B.amount||0).toFixed(2)]}),t.jsx(we,{className:"text-gray-300",children:B.paymentMethod==="wechat"?"微信支付":B.paymentMethod==="alipay"?"支付宝":B.paymentMethod||"微信支付"}),t.jsx(we,{children:B.status==="refunded"?t.jsx(Me,{className:"bg-gray-500/20 text-gray-400 hover:bg-gray-500/20 border-0",children:"已退款"}):B.status==="paid"||B.status==="completed"?t.jsx(Me,{className:"bg-green-500/20 text-green-400 hover:bg-green-500/20 border-0",children:"已完成"}):B.status==="pending"||B.status==="created"?t.jsx(Me,{className:"bg-yellow-500/20 text-yellow-400 hover:bg-yellow-500/20 border-0",children:"待支付"}):t.jsx(Me,{className:"bg-red-500/20 text-red-400 hover:bg-red-500/20 border-0",children:"已失败"})}),t.jsx(we,{className:"text-gray-400 text-sm max-w-[120px] truncate",title:B.refundReason,children:B.status==="refunded"&&B.refundReason?B.refundReason:"-"}),t.jsx(we,{className:"text-[#FFD700]",children:B.referrerEarnings?`¥${Number(B.referrerEarnings).toFixed(2)}`:"-"}),t.jsx(we,{className:"text-gray-400 text-sm",children:new Date(B.createdAt).toLocaleString("zh-CN")}),t.jsx(we,{children:(B.status==="paid"||B.status==="completed")&&t.jsxs(oe,{variant:"outline",size:"sm",className:"border-orange-500/50 text-orange-400 hover:bg-orange-500/20",onClick:()=>{T(B),Y("")},children:[t.jsx(kp,{className:"w-3 h-3 mr-1"}),"退款"]})})]},B.id)}),r.length===0&&t.jsx(rt,{children:t.jsx(we,{colSpan:10,className:"text-center py-12 text-gray-500",children:"暂无订单数据"})})]})]}),t.jsx(Sr,{page:v,totalPages:q,total:c,pageSize:E,onPageChange:y,onPageSizeChange:B=>{_(B),y(1)}})]})})}),t.jsx(Bt,{open:!!R,onOpenChange:B=>!B&&T(null),children:t.jsxs(It,{className:"bg-[#0f2137] border-gray-700 text-white max-w-md",children:[t.jsx(Ut,{children:t.jsx(Vt,{className:"text-white",children:"订单退款"})}),R&&t.jsxs("div",{className:"space-y-4",children:[t.jsxs("p",{className:"text-gray-400 text-sm",children:["订单号:",R.orderSn||R.id]}),t.jsxs("p",{className:"text-gray-400 text-sm",children:["退款金额:¥",Number(R.amount||0).toFixed(2)]}),t.jsxs("div",{children:[t.jsx("label",{className:"text-sm text-gray-400 block mb-2",children:"退款原因(选填)"}),t.jsx("div",{className:"form-input",children:t.jsx(ne,{className:"bg-[#0a1628] border-gray-700 text-white placeholder:text-gray-500",placeholder:"如:用户申请退款",value:F,onChange:B=>Y(B.target.value)})})]}),t.jsx("p",{className:"text-orange-400/80 text-xs",children:"退款将原路退回至用户微信,且无法撤销,请确认后再操作。"})]}),t.jsxs(qt,{children:[t.jsx(oe,{variant:"outline",className:"border-gray-600 text-gray-300",onClick:()=>T(null),disabled:K,children:"取消"}),t.jsx(oe,{className:"bg-orange-500 hover:bg-orange-600 text-white",onClick:I,disabled:K,children:K?"退款中...":"确认退款"})]})]})})]})}var W1=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],H1=W1.reduce((r,a)=>{const l=Pp(`Primitive.${a}`),o=h.forwardRef((c,u)=>{const{asChild:f,...p}=c,x=f?l:a;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),t.jsx(x,{...p,ref:u})});return o.displayName=`Primitive.${a}`,{...r,[a]:o}},{}),K1="Label",jx=h.forwardRef((r,a)=>t.jsx(H1.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())}}));jx.displayName=K1;var Nx=jx;const Z=h.forwardRef(({className:r,...a},l)=>t.jsx(Nx,{ref:l,className:Ge("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",r),...a}));Z.displayName=Nx.displayName;function Jd(r){const a=h.useRef({value:r,previous:r});return h.useMemo(()=>(a.current.value!==r&&(a.current.previous=a.current.value,a.current.value=r),a.current.previous),[r])}function Zd(r){const[a,l]=h.useState(void 0);return Rt(()=>{if(r){l({width:r.offsetWidth,height:r.offsetHeight});const o=new ResizeObserver(c=>{if(!Array.isArray(c)||!c.length)return;const u=c[0];let f,p;if("borderBoxSize"in u){const x=u.borderBoxSize,g=Array.isArray(x)?x[0]:x;f=g.inlineSize,p=g.blockSize}else f=r.offsetWidth,p=r.offsetHeight;l({width:f,height:p})});return o.observe(r,{box:"border-box"}),()=>o.unobserve(r)}else l(void 0)},[r]),a}var $i="Switch",[G1]=Rr($i),[Y1,Q1]=G1($i),bx=h.forwardRef((r,a)=>{const{__scopeSwitch:l,name:o,checked:c,defaultChecked:u,required:f,disabled:p,value:x="on",onCheckedChange:g,form:v,...y}=r,[E,_]=h.useState(null),k=Ke(a,N=>_(N)),w=h.useRef(!1),j=E?v||!!E.closest("form"):!0,[b,C]=Jr({prop:c,defaultProp:u??!1,onChange:g,caller:$i});return t.jsxs(Y1,{scope:l,checked:b,disabled:p,children:[t.jsx(Oe.button,{type:"button",role:"switch","aria-checked":b,"aria-required":f,"data-state":kx(b),"data-disabled":p?"":void 0,disabled:p,value:x,...y,ref:k,onClick:Ae(r.onClick,N=>{C(A=>!A),j&&(w.current=N.isPropagationStopped(),w.current||N.stopPropagation())})}),j&&t.jsx(Cx,{control:E,bubbles:!w.current,name:o,value:x,checked:b,required:f,disabled:p,form:v,style:{transform:"translateX(-100%)"}})]})});bx.displayName=$i;var wx="SwitchThumb",Sx=h.forwardRef((r,a)=>{const{__scopeSwitch:l,...o}=r,c=Q1(wx,l);return t.jsx(Oe.span,{"data-state":kx(c.checked),"data-disabled":c.disabled?"":void 0,...o,ref:a})});Sx.displayName=wx;var q1="SwitchBubbleInput",Cx=h.forwardRef(({__scopeSwitch:r,control:a,checked:l,bubbles:o=!0,...c},u)=>{const f=h.useRef(null),p=Ke(f,u),x=Jd(l),g=Zd(a);return h.useEffect(()=>{const v=f.current;if(!v)return;const y=window.HTMLInputElement.prototype,_=Object.getOwnPropertyDescriptor(y,"checked").set;if(x!==l&&_){const k=new Event("click",{bubbles:o});_.call(v,l),v.dispatchEvent(k)}},[x,l,o]),t.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:l,...c,tabIndex:-1,ref:p,style:{...c.style,...g,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});Cx.displayName=q1;function kx(r){return r?"checked":"unchecked"}var Ex=bx,X1=Sx;const ht=h.forwardRef(({className:r,...a},l)=>t.jsx(Ex,{className:Ge("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:t.jsx(X1,{className:Ge("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")})}));ht.displayName=Ex.displayName;function eu(r){const a=r+"CollectionProvider",[l,o]=Rr(a),[c,u]=l(a,{collectionRef:{current:null},itemMap:new Map}),f=w=>{const{scope:j,children:b}=w,C=vr.useRef(null),N=vr.useRef(new Map).current;return t.jsx(c,{scope:j,itemMap:N,collectionRef:C,children:b})};f.displayName=a;const p=r+"CollectionSlot",x=$a(p),g=vr.forwardRef((w,j)=>{const{scope:b,children:C}=w,N=u(p,b),A=Ke(j,N.collectionRef);return t.jsx(x,{ref:A,children:C})});g.displayName=p;const v=r+"CollectionItemSlot",y="data-radix-collection-item",E=$a(v),_=vr.forwardRef((w,j)=>{const{scope:b,children:C,...N}=w,A=vr.useRef(null),$=Ke(j,A),V=u(v,b);return vr.useEffect(()=>(V.itemMap.set(A,{ref:A,...N}),()=>void V.itemMap.delete(A))),t.jsx(E,{[y]:"",ref:$,children:C})});_.displayName=v;function k(w){const j=u(r+"CollectionConsumer",w);return vr.useCallback(()=>{const C=j.collectionRef.current;if(!C)return[];const N=Array.from(C.querySelectorAll(`[${y}]`));return Array.from(j.itemMap.values()).sort((V,R)=>N.indexOf(V.ref.current)-N.indexOf(R.ref.current))},[j.collectionRef,j.itemMap])}return[{Provider:f,Slot:g,ItemSlot:_},k,o]}var J1=h.createContext(void 0);function Bi(r){const a=h.useContext(J1);return r||a||"ltr"}var rd="rovingFocusGroup.onEntryFocus",Z1={bubbles:!1,cancelable:!0},Ka="RovingFocusGroup",[Nd,Px,e2]=eu(Ka),[t2,Rx]=Rr(Ka,[e2]),[n2,r2]=t2(Ka),_x=h.forwardRef((r,a)=>t.jsx(Nd.Provider,{scope:r.__scopeRovingFocusGroup,children:t.jsx(Nd.Slot,{scope:r.__scopeRovingFocusGroup,children:t.jsx(s2,{...r,ref:a})})}));_x.displayName=Ka;var s2=h.forwardRef((r,a)=>{const{__scopeRovingFocusGroup:l,orientation:o,loop:c=!1,dir:u,currentTabStopId:f,defaultCurrentTabStopId:p,onCurrentTabStopIdChange:x,onEntryFocus:g,preventScrollOnEntryFocus:v=!1,...y}=r,E=h.useRef(null),_=Ke(a,E),k=Bi(u),[w,j]=Jr({prop:f,defaultProp:p??null,onChange:x,caller:Ka}),[b,C]=h.useState(!1),N=Cr(g),A=Px(l),$=h.useRef(!1),[V,R]=h.useState(0);return h.useEffect(()=>{const T=E.current;if(T)return T.addEventListener(rd,N),()=>T.removeEventListener(rd,N)},[N]),t.jsx(n2,{scope:l,orientation:o,dir:k,loop:c,currentTabStopId:w,onItemFocus:h.useCallback(T=>j(T),[j]),onItemShiftTab:h.useCallback(()=>C(!0),[]),onFocusableItemAdd:h.useCallback(()=>R(T=>T+1),[]),onFocusableItemRemove:h.useCallback(()=>R(T=>T-1),[]),children:t.jsx(Oe.div,{tabIndex:b||V===0?-1:0,"data-orientation":o,...y,ref:_,style:{outline:"none",...r.style},onMouseDown:Ae(r.onMouseDown,()=>{$.current=!0}),onFocus:Ae(r.onFocus,T=>{const F=!$.current;if(T.target===T.currentTarget&&F&&!b){const Y=new CustomEvent(rd,Z1);if(T.currentTarget.dispatchEvent(Y),!Y.defaultPrevented){const K=A().filter(ee=>ee.focusable),J=K.find(ee=>ee.active),ce=K.find(ee=>ee.id===w),le=[J,ce,...K].filter(Boolean).map(ee=>ee.ref.current);Ax(le,v)}}$.current=!1}),onBlur:Ae(r.onBlur,()=>C(!1))})})}),Tx="RovingFocusGroupItem",Ix=h.forwardRef((r,a)=>{const{__scopeRovingFocusGroup:l,focusable:o=!0,active:c=!1,tabStopId:u,children:f,...p}=r,x=wr(),g=u||x,v=r2(Tx,l),y=v.currentTabStopId===g,E=Px(l),{onFocusableItemAdd:_,onFocusableItemRemove:k,currentTabStopId:w}=v;return h.useEffect(()=>{if(o)return _(),()=>k()},[o,_,k]),t.jsx(Nd.ItemSlot,{scope:l,id:g,focusable:o,active:c,children:t.jsx(Oe.span,{tabIndex:y?0:-1,"data-orientation":v.orientation,...p,ref:a,onMouseDown:Ae(r.onMouseDown,j=>{o?v.onItemFocus(g):j.preventDefault()}),onFocus:Ae(r.onFocus,()=>v.onItemFocus(g)),onKeyDown:Ae(r.onKeyDown,j=>{if(j.key==="Tab"&&j.shiftKey){v.onItemShiftTab();return}if(j.target!==j.currentTarget)return;const b=i2(j,v.orientation,v.dir);if(b!==void 0){if(j.metaKey||j.ctrlKey||j.altKey||j.shiftKey)return;j.preventDefault();let N=E().filter(A=>A.focusable).map(A=>A.ref.current);if(b==="last")N.reverse();else if(b==="prev"||b==="next"){b==="prev"&&N.reverse();const A=N.indexOf(j.currentTarget);N=v.loop?o2(N,A+1):N.slice(A+1)}setTimeout(()=>Ax(N))}}),children:typeof f=="function"?f({isCurrentTabStop:y,hasTabStop:w!=null}):f})})});Ix.displayName=Tx;var a2={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function l2(r,a){return a!=="rtl"?r:r==="ArrowLeft"?"ArrowRight":r==="ArrowRight"?"ArrowLeft":r}function i2(r,a,l){const o=l2(r.key,l);if(!(a==="vertical"&&["ArrowLeft","ArrowRight"].includes(o))&&!(a==="horizontal"&&["ArrowUp","ArrowDown"].includes(o)))return a2[o]}function Ax(r,a=!1){const l=document.activeElement;for(const o of r)if(o===l||(o.focus({preventScroll:a}),document.activeElement!==l))return}function o2(r,a){return r.map((l,o)=>r[(a+o)%r.length])}var c2=_x,d2=Ix,Ui="Tabs",[u2]=Rr(Ui,[Rx]),Mx=Rx(),[f2,tu]=u2(Ui),Dx=h.forwardRef((r,a)=>{const{__scopeTabs:l,value:o,onValueChange:c,defaultValue:u,orientation:f="horizontal",dir:p,activationMode:x="automatic",...g}=r,v=Bi(p),[y,E]=Jr({prop:o,onChange:c,defaultProp:u??"",caller:Ui});return t.jsx(f2,{scope:l,baseId:wr(),value:y,onValueChange:E,orientation:f,dir:v,activationMode:x,children:t.jsx(Oe.div,{dir:v,"data-orientation":f,...g,ref:a})})});Dx.displayName=Ui;var Lx="TabsList",Ox=h.forwardRef((r,a)=>{const{__scopeTabs:l,loop:o=!0,...c}=r,u=tu(Lx,l),f=Mx(l);return t.jsx(c2,{asChild:!0,...f,orientation:u.orientation,dir:u.dir,loop:o,children:t.jsx(Oe.div,{role:"tablist","aria-orientation":u.orientation,...c,ref:a})})});Ox.displayName=Lx;var Fx="TabsTrigger",zx=h.forwardRef((r,a)=>{const{__scopeTabs:l,value:o,disabled:c=!1,...u}=r,f=tu(Fx,l),p=Mx(l),x=Ux(f.baseId,o),g=Vx(f.baseId,o),v=o===f.value;return t.jsx(d2,{asChild:!0,...p,focusable:!c,active:v,children:t.jsx(Oe.button,{type:"button",role:"tab","aria-selected":v,"aria-controls":g,"data-state":v?"active":"inactive","data-disabled":c?"":void 0,disabled:c,id:x,...u,ref:a,onMouseDown:Ae(r.onMouseDown,y=>{!c&&y.button===0&&y.ctrlKey===!1?f.onValueChange(o):y.preventDefault()}),onKeyDown:Ae(r.onKeyDown,y=>{[" ","Enter"].includes(y.key)&&f.onValueChange(o)}),onFocus:Ae(r.onFocus,()=>{const y=f.activationMode!=="manual";!v&&!c&&y&&f.onValueChange(o)})})})});zx.displayName=Fx;var $x="TabsContent",Bx=h.forwardRef((r,a)=>{const{__scopeTabs:l,value:o,forceMount:c,children:u,...f}=r,p=tu($x,l),x=Ux(p.baseId,o),g=Vx(p.baseId,o),v=o===p.value,y=h.useRef(v);return h.useEffect(()=>{const E=requestAnimationFrame(()=>y.current=!1);return()=>cancelAnimationFrame(E)},[]),t.jsx(Ha,{present:c||v,children:({present:E})=>t.jsx(Oe.div,{"data-state":v?"active":"inactive","data-orientation":p.orientation,role:"tabpanel","aria-labelledby":x,hidden:!E,id:g,tabIndex:0,...f,ref:a,style:{...r.style,animationDuration:y.current?"0s":void 0},children:E&&u})})});Bx.displayName=$x;function Ux(r,a){return`${r}-trigger-${a}`}function Vx(r,a){return`${r}-content-${a}`}var h2=Dx,Wx=Ox,Hx=zx,Kx=Bx;const nu=h2,Vi=h.forwardRef(({className:r,...a},l)=>t.jsx(Wx,{ref:l,className:Ge("inline-flex h-9 items-center justify-center rounded-lg bg-muted p-1 text-muted-foreground",r),...a}));Vi.displayName=Wx.displayName;const an=h.forwardRef(({className:r,...a},l)=>t.jsx(Hx,{ref:l,className:Ge("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}));an.displayName=Hx.displayName;const ln=h.forwardRef(({className:r,...a},l)=>t.jsx(Kx,{ref:l,className:Ge("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",r),...a}));ln.displayName=Kx.displayName;function m2({open:r,onClose:a,userId:l,onUserUpdated:o}){var ee;const[c,u]=h.useState(null),[f,p]=h.useState([]),[x,g]=h.useState([]),[v,y]=h.useState(!1),[E,_]=h.useState(!1),[k,w]=h.useState(!1),[j,b]=h.useState("info"),[C,N]=h.useState(""),[A,$]=h.useState(""),[V,R]=h.useState([]),[T,F]=h.useState("");h.useEffect(()=>{r&&l&&Y()},[r,l]);async function Y(){if(l){y(!0);try{const q=await We(`/api/db/users?id=${encodeURIComponent(l)}`);if(q!=null&&q.success&&q.user){const I=q.user;u(I),N(I.phone||""),$(I.nickname||""),R(typeof I.tags=="string"?JSON.parse(I.tags||"[]"):[])}try{const I=await We(`/api/user/track?userId=${encodeURIComponent(l)}&limit=50`);I!=null&&I.success&&I.tracks&&p(I.tracks)}catch{p([])}try{const I=await We(`/api/db/users/referrals?userId=${encodeURIComponent(l)}`);I!=null&&I.success&&I.referrals&&g(I.referrals)}catch{g([])}}catch(q){console.error("Load user detail error:",q)}finally{y(!1)}}}async function K(){if(!(c!=null&&c.phone)){alert("用户未绑定手机号,无法同步");return}_(!0);try{const q=await jt("/api/ckb/sync",{action:"full_sync",phone:c.phone,userId:c.id});q!=null&&q.success?(alert("同步成功"),Y()):alert("同步失败: "+(q==null?void 0:q.error))}catch(q){console.error("Sync CKB error:",q),alert("同步失败")}finally{_(!1)}}async function J(){if(c){w(!0);try{const q={id:c.id,phone:C||void 0,nickname:A||void 0,tags:JSON.stringify(V)},I=await Pt("/api/db/users",q);I!=null&&I.success?(alert("保存成功"),Y(),o==null||o()):alert("保存失败: "+(I==null?void 0:I.error))}catch(q){console.error("Save user error:",q),alert("保存失败")}finally{w(!1)}}}const ce=()=>{T&&!V.includes(T)&&(R([...V,T]),F(""))},X=q=>{R(V.filter(I=>I!==q))},le=q=>{const Q={view_chapter:Wn,purchase:pd,match:vn,login:qr,register:qr,share:Yr,bind_phone:RN,bind_wechat:bN}[q]||Nm;return t.jsx(Q,{className:"w-4 h-4"})};return r?t.jsx(Bt,{open:r,onOpenChange:()=>a(),children:t.jsxs(It,{className:"bg-[#0f2137] border-gray-700 text-white max-w-4xl max-h-[90vh] overflow-hidden",children:[t.jsx(Ut,{children:t.jsxs(Vt,{className:"text-white flex items-center gap-2",children:[t.jsx(qr,{className:"w-5 h-5 text-[#38bdac]"}),"用户详情",(c==null?void 0:c.phone)&&t.jsx(Me,{className:"bg-green-500/20 text-green-400 border-0 ml-2",children:"已绑定手机"})]})}),v?t.jsxs("div",{className:"flex items-center justify-center py-20",children:[t.jsx(Ze,{className:"w-6 h-6 text-[#38bdac] animate-spin"}),t.jsx("span",{className:"ml-2 text-gray-400",children:"加载中..."})]}):c?t.jsxs("div",{className:"flex flex-col h-[70vh]",children:[t.jsxs("div",{className:"flex items-center gap-4 p-4 bg-[#0a1628] rounded-lg mb-4",children:[t.jsx("div",{className:"w-16 h-16 rounded-full bg-[#38bdac]/20 flex items-center justify-center text-2xl text-[#38bdac]",children:c.avatar?t.jsx("img",{src:c.avatar,className:"w-full h-full rounded-full object-cover",alt:""}):((ee=c.nickname)==null?void 0:ee.charAt(0))||"?"}),t.jsxs("div",{className:"flex-1",children:[t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx("h3",{className:"text-lg font-bold text-white",children:c.nickname}),c.isAdmin&&t.jsx(Me,{className:"bg-purple-500/20 text-purple-400 border-0",children:"管理员"}),c.hasFullBook&&t.jsx(Me,{className:"bg-green-500/20 text-green-400 border-0",children:"全书已购"})]}),t.jsxs("p",{className:"text-gray-400 text-sm mt-1",children:[c.phone?`📱 ${c.phone}`:"未绑定手机",c.wechatId&&` · 💬 ${c.wechatId}`]}),t.jsxs("p",{className:"text-gray-500 text-xs mt-1",children:["ID: ",c.id," · 推广码: ",c.referralCode??"-"]})]}),t.jsxs("div",{className:"text-right",children:[t.jsxs("p",{className:"text-[#38bdac] font-bold",children:["¥",(c.earnings||0).toFixed(2)]}),t.jsx("p",{className:"text-gray-500 text-xs",children:"累计收益"})]})]}),t.jsxs(nu,{value:j,onValueChange:b,className:"flex-1 flex flex-col overflow-hidden",children:[t.jsxs(Vi,{className:"bg-[#0a1628] border border-gray-700/50 p-1 mb-4",children:[t.jsx(an,{value:"info",className:"data-[state=active]:bg-[#38bdac]/20 data-[state=active]:text-[#38bdac]",children:"基础信息"}),t.jsx(an,{value:"tags",className:"data-[state=active]:bg-[#38bdac]/20 data-[state=active]:text-[#38bdac]",children:"标签体系"}),t.jsx(an,{value:"tracks",className:"data-[state=active]:bg-[#38bdac]/20 data-[state=active]:text-[#38bdac]",children:"行为轨迹"}),t.jsx(an,{value:"relations",className:"data-[state=active]:bg-[#38bdac]/20 data-[state=active]:text-[#38bdac]",children:"关系链路"})]}),t.jsxs(ln,{value:"info",className:"flex-1 overflow-auto space-y-4",children:[t.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[t.jsxs("div",{className:"space-y-2",children:[t.jsx(Z,{className:"text-gray-300",children:"手机号"}),t.jsx(ne,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"输入手机号",value:C,onChange:q=>N(q.target.value)})]}),t.jsxs("div",{className:"space-y-2",children:[t.jsx(Z,{className:"text-gray-300",children:"昵称"}),t.jsx(ne,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"输入昵称",value:A,onChange:q=>$(q.target.value)})]})]}),t.jsxs("div",{className:"grid grid-cols-3 gap-4",children:[t.jsxs("div",{className:"p-4 bg-[#0a1628] rounded-lg",children:[t.jsx("p",{className:"text-gray-400 text-sm",children:"推荐人数"}),t.jsx("p",{className:"text-2xl font-bold text-white",children:c.referralCount??0})]}),t.jsxs("div",{className:"p-4 bg-[#0a1628] rounded-lg",children:[t.jsx("p",{className:"text-gray-400 text-sm",children:"待提现"}),t.jsxs("p",{className:"text-2xl font-bold text-yellow-400",children:["¥",(c.pendingEarnings??0).toFixed(2)]})]}),t.jsxs("div",{className:"p-4 bg-[#0a1628] rounded-lg",children:[t.jsx("p",{className:"text-gray-400 text-sm",children:"创建时间"}),t.jsx("p",{className:"text-sm text-white",children:c.createdAt?new Date(c.createdAt).toLocaleDateString():"-"})]})]}),t.jsxs("div",{className:"p-4 bg-[#0a1628] rounded-lg",children:[t.jsxs("div",{className:"flex items-center justify-between mb-3",children:[t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx(Yr,{className:"w-4 h-4 text-[#38bdac]"}),t.jsx("span",{className:"text-white font-medium",children:"存客宝同步"})]}),t.jsx(oe,{size:"sm",onClick:K,disabled:E||!c.phone,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:E?t.jsxs(t.Fragment,{children:[t.jsx(Ze,{className:"w-4 h-4 mr-1 animate-spin"})," 同步中..."]}):t.jsxs(t.Fragment,{children:[t.jsx(Ze,{className:"w-4 h-4 mr-1"})," 同步数据"]})})]}),t.jsxs("div",{className:"grid grid-cols-2 gap-4 text-sm",children:[t.jsxs("div",{children:[t.jsx("span",{className:"text-gray-500",children:"同步状态:"}),c.ckbSyncedAt?t.jsx(Me,{className:"bg-green-500/20 text-green-400 border-0 ml-1",children:"已同步"}):t.jsx(Me,{className:"bg-gray-500/20 text-gray-400 border-0 ml-1",children:"未同步"})]}),t.jsxs("div",{children:[t.jsx("span",{className:"text-gray-500",children:"最后同步:"}),t.jsx("span",{className:"text-gray-300 ml-1",children:c.ckbSyncedAt?new Date(c.ckbSyncedAt).toLocaleString():"-"})]})]})]})]}),t.jsx(ln,{value:"tags",className:"flex-1 overflow-auto space-y-4",children:t.jsxs("div",{className:"p-4 bg-[#0a1628] rounded-lg",children:[t.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[t.jsx(UN,{className:"w-4 h-4 text-[#38bdac]"}),t.jsx("span",{className:"text-white font-medium",children:"系统标签"})]}),t.jsxs("div",{className:"flex flex-wrap gap-2 mb-3",children:[V.map((q,I)=>t.jsxs(Me,{className:"bg-[#38bdac]/20 text-[#38bdac] border-0 pr-1",children:[q,t.jsx("button",{type:"button",onClick:()=>X(q),className:"ml-1 hover:text-red-400",children:t.jsx(on,{className:"w-3 h-3"})})]},I)),V.length===0&&t.jsx("span",{className:"text-gray-500 text-sm",children:"暂无标签"})]}),t.jsxs("div",{className:"flex gap-2",children:[t.jsx(ne,{className:"bg-[#162840] border-gray-700 text-white flex-1",placeholder:"添加新标签",value:T,onChange:q=>F(q.target.value),onKeyDown:q=>q.key==="Enter"&&ce()}),t.jsx(oe,{onClick:ce,className:"bg-[#38bdac] hover:bg-[#2da396]",children:"添加"})]})]})}),t.jsx(ln,{value:"tracks",className:"flex-1 overflow-auto",children:t.jsx("div",{className:"space-y-2",children:f.length>0?f.map(q=>t.jsxs("div",{className:"flex items-start gap-3 p-3 bg-[#0a1628] rounded-lg",children:[t.jsx("div",{className:"w-8 h-8 rounded-full bg-[#38bdac]/20 flex items-center justify-center text-[#38bdac]",children:le(q.action)}),t.jsxs("div",{className:"flex-1",children:[t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx("span",{className:"text-white font-medium",children:q.actionLabel}),q.chapterTitle&&t.jsxs("span",{className:"text-gray-400 text-sm",children:["- ",q.chapterTitle]})]}),t.jsxs("p",{className:"text-gray-500 text-xs mt-1",children:[t.jsx(wp,{className:"w-3 h-3 inline mr-1"}),q.timeAgo," · ",new Date(q.createdAt).toLocaleString()]})]})]},q.id)):t.jsxs("div",{className:"text-center py-12",children:[t.jsx(Nm,{className:"w-10 h-10 text-[#38bdac]/40 mx-auto mb-4"}),t.jsx("p",{className:"text-gray-400",children:"暂无行为轨迹"})]})})}),t.jsx(ln,{value:"relations",className:"flex-1 overflow-auto space-y-4",children:t.jsxs("div",{className:"p-4 bg-[#0a1628] rounded-lg",children:[t.jsxs("div",{className:"flex items-center justify-between mb-3",children:[t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx(Yr,{className:"w-4 h-4 text-[#38bdac]"}),t.jsx("span",{className:"text-white font-medium",children:"推荐的用户"})]}),t.jsxs(Me,{className:"bg-[#38bdac]/20 text-[#38bdac] border-0",children:["共 ",x.length," 人"]})]}),t.jsx("div",{className:"space-y-2 max-h-[200px] overflow-y-auto",children:x.length>0?x.map((q,I)=>{var B;const Q=q;return t.jsxs("div",{className:"flex items-center justify-between p-2 bg-[#162840] rounded",children:[t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx("div",{className:"w-6 h-6 rounded-full bg-[#38bdac]/20 flex items-center justify-center text-xs text-[#38bdac]",children:((B=Q.nickname)==null?void 0:B.charAt(0))||"?"}),t.jsx("span",{className:"text-white text-sm",children:Q.nickname})]}),t.jsxs("div",{className:"flex items-center gap-2",children:[Q.status==="vip"&&t.jsx(Me,{className:"bg-green-500/20 text-green-400 border-0 text-xs",children:"已购"}),t.jsx("span",{className:"text-gray-500 text-xs",children:Q.createdAt?new Date(Q.createdAt).toLocaleDateString():""})]})]},Q.id||I)}):t.jsx("p",{className:"text-gray-500 text-sm text-center py-4",children:"暂无推荐用户"})})]})})]}),t.jsxs("div",{className:"flex justify-end gap-2 pt-4 border-t border-gray-700 mt-4",children:[t.jsxs(oe,{variant:"outline",onClick:a,className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:[t.jsx(on,{className:"w-4 h-4 mr-2"}),"关闭"]}),t.jsxs(oe,{onClick:J,disabled:k,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:[t.jsx(Wt,{className:"w-4 h-4 mr-2"}),k?"保存中...":"保存修改"]})]})]}):t.jsx("div",{className:"text-center py-12 text-gray-500",children:"用户不存在"})]})}):null}const sd={isVip:!1,vipExpireDate:"",vipSort:"",vipRole:"",vipRoleCustom:"",vipName:"",vipProject:"",vipContact:"",vipBio:""};function p2({open:r,onClose:a,userId:l,userNickname:o="",onSaved:c}){const[u,f]=h.useState(sd),[p,x]=h.useState([]),[g,v]=h.useState(!1),[y,E]=h.useState(!1);h.useEffect(()=>{if(!r){f(sd);return}let k=!1;return v(!0),Promise.all([We("/api/db/vip-roles"),l?We(`/api/db/users?id=${encodeURIComponent(l)}`):Promise.resolve(null)]).then(([w,j])=>{if(k)return;const b=w!=null&&w.success&&w.data?w.data:[];x(b);const C=j&&j.user?j.user:null;if(C){const N=String(C.vipRole??""),A=b.some($=>$.name===N);f({isVip:!!(C.isVip??!1),vipExpireDate:C.vipExpireDate?String(C.vipExpireDate).slice(0,10):"",vipSort:typeof C.vipSort=="number"?C.vipSort:"",vipRole:A?N:N?"__custom__":"",vipRoleCustom:A?"":N,vipName:String(C.vipName??""),vipProject:String(C.vipProject??""),vipContact:String(C.vipContact??""),vipBio:String(C.vipBio??"")})}else f(sd)}).catch(w=>{k||console.error("Load error:",w)}).finally(()=>{k||v(!1)}),()=>{k=!0}},[r,l]);async function _(){if(l){if(u.isVip&&!u.vipExpireDate.trim()){alert("开启 VIP 时请填写有效到期日");return}if(u.isVip&&u.vipExpireDate.trim()){const k=new Date(u.vipExpireDate);if(isNaN(k.getTime())){alert("到期日格式无效,请使用 YYYY-MM-DD");return}}E(!0);try{const k=u.vipRole==="__custom__"?u.vipRoleCustom.trim():u.vipRole,w={id:l,isVip:u.isVip,vipExpireDate:u.isVip?u.vipExpireDate:void 0,vipSort:u.vipSort===""?void 0:u.vipSort,vipRole:k||void 0,vipName:u.vipName||void 0,vipProject:u.vipProject||void 0,vipContact:u.vipContact||void 0,vipBio:u.vipBio||void 0},j=await Pt("/api/db/users",w);j!=null&&j.success?(alert("VIP 设置已保存"),c==null||c(),a()):alert("保存失败: "+(j==null?void 0:j.error))}catch(k){console.error("Save VIP error:",k),alert("保存失败")}finally{E(!1)}}}return r?t.jsx(Bt,{open:r,onOpenChange:()=>a(),children:t.jsxs(It,{className:"bg-[#0f2137] border-gray-700 text-white max-w-md",children:[t.jsx(Ut,{children:t.jsxs(Vt,{className:"text-white flex items-center gap-2",children:[t.jsx(Li,{className:"w-5 h-5 text-amber-400"}),"设置 VIP - ",o||l]})}),g?t.jsx("div",{className:"py-8 text-center text-gray-400",children:"加载中..."}):t.jsxs("div",{className:"space-y-4 py-4",children:[t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsx(Z,{className:"text-gray-300",children:"VIP 会员"}),t.jsx(ht,{checked:u.isVip,onCheckedChange:k=>f(w=>({...w,isVip:k}))})]}),u.isVip&&t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"space-y-2",children:[t.jsxs(Z,{className:"text-gray-300",children:["到期日 (YYYY-MM-DD) ",t.jsx("span",{className:"text-amber-400",children:"*"})]}),t.jsx(ne,{type:"date",className:"bg-[#0a1628] border-gray-700 text-white",value:u.vipExpireDate,onChange:k=>f(w=>({...w,vipExpireDate:k.target.value}))})]}),t.jsxs("div",{className:"space-y-2",children:[t.jsx(Z,{className:"text-gray-300",children:"排序"}),t.jsx(ne,{type:"number",className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"数字越小越靠前,留空按时间",value:u.vipSort===""?"":u.vipSort,onChange:k=>{const w=k.target.value;f(j=>({...j,vipSort:w===""?"":parseInt(w,10)||0}))}})]})]}),t.jsxs("div",{className:"space-y-2",children:[t.jsx(Z,{className:"text-gray-300",children:"角色"}),t.jsxs("select",{className:"w-full bg-[#0a1628] border border-gray-700 text-white rounded-md px-3 py-2",value:u.vipRole,onChange:k=>f(w=>({...w,vipRole:k.target.value})),children:[t.jsx("option",{value:"",children:"请选择或下方手动填写"}),p.map(k=>t.jsx("option",{value:k.name,children:k.name},k.id)),t.jsx("option",{value:"__custom__",children:"其他(手动填写)"})]}),u.vipRole==="__custom__"&&t.jsx(ne,{className:"bg-[#0a1628] border-gray-700 text-white mt-1",placeholder:"输入自定义角色",value:u.vipRoleCustom,onChange:k=>f(w=>({...w,vipRoleCustom:k.target.value}))})]}),t.jsxs("div",{className:"space-y-2",children:[t.jsx(Z,{className:"text-gray-300",children:"VIP 展示名"}),t.jsx(ne,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"创业老板排行展示名",value:u.vipName,onChange:k=>f(w=>({...w,vipName:k.target.value}))})]}),t.jsxs("div",{className:"space-y-2",children:[t.jsx(Z,{className:"text-gray-300",children:"项目/公司"}),t.jsx(ne,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"项目名称",value:u.vipProject,onChange:k=>f(w=>({...w,vipProject:k.target.value}))})]}),t.jsxs("div",{className:"space-y-2",children:[t.jsx(Z,{className:"text-gray-300",children:"联系方式"}),t.jsx(ne,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"微信号或手机",value:u.vipContact,onChange:k=>f(w=>({...w,vipContact:k.target.value}))})]}),t.jsxs("div",{className:"space-y-2",children:[t.jsx(Z,{className:"text-gray-300",children:"一句话简介"}),t.jsx(ne,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"简要描述业务",value:u.vipBio,onChange:k=>f(w=>({...w,vipBio:k.target.value}))})]})]}),t.jsxs(qt,{children:[t.jsxs(oe,{variant:"outline",onClick:a,className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:[t.jsx(on,{className:"w-4 h-4 mr-2"}),"取消"]}),t.jsxs(oe,{onClick:_,disabled:y||g,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:[t.jsx(Wt,{className:"w-4 h-4 mr-2"}),y?"保存中...":"保存"]})]})]})}):null}function x2(){var ss,Ys,Qs,qs,Xs;const[r,a]=h.useState([]),[l,o]=h.useState(0),[c,u]=h.useState(1),[f,p]=h.useState(10),[x,g]=h.useState(""),v=Xd(x,300),[y,E]=h.useState("all"),[_,k]=h.useState(!0),[w,j]=h.useState(null),[b,C]=h.useState(!1),[N,A]=h.useState(!1),[$,V]=h.useState(null),[R,T]=h.useState(""),[F,Y]=h.useState(""),[K,J]=h.useState(!1),[ce,X]=h.useState(!1),[le,ee]=h.useState({referrals:[],stats:{}}),[q,I]=h.useState(!1),[Q,B]=h.useState(null),[D,P]=h.useState(!1),[W,re]=h.useState(null),[he,me]=h.useState(!1),[se,pe]=h.useState(null),[L,ue]=h.useState({phone:"",nickname:"",password:"",isAdmin:!1,hasFullBook:!1});async function xe(){k(!0),j(null);try{const te=new URLSearchParams({page:String(c),pageSize:String(f),search:v,...y==="vip"&&{vip:"true"}}),Ue=await We(`/api/db/users?${te}`);Ue!=null&&Ue.success?(a(Ue.users||[]),o(Ue.total??0)):j((Ue==null?void 0:Ue.error)||"加载失败")}catch(te){console.error("Load users error:",te),j("网络错误,请检查连接")}finally{k(!1)}}h.useEffect(()=>{u(1)},[v,y]),h.useEffect(()=>{xe()},[c,f,v,y]);const Re=Math.ceil(l/f)||1;async function De(te){if(confirm("确定要删除这个用户吗?"))try{const Ue=await Wa(`/api/db/users?id=${encodeURIComponent(te)}`);Ue!=null&&Ue.success?xe():alert("删除失败: "+((Ue==null?void 0:Ue.error)||"未知错误"))}catch(Ue){console.error("Delete user error:",Ue),alert("删除失败")}}const Fe=te=>{V(te),ue({phone:te.phone||"",nickname:te.nickname||"",password:"",isAdmin:!!(te.isAdmin??!1),hasFullBook:!!(te.hasFullBook??!1)}),C(!0)},Qe=()=>{V(null),ue({phone:"",nickname:"",password:"",isAdmin:!1,hasFullBook:!1}),C(!0)};async function st(){if(!L.phone||!L.nickname){alert("请填写手机号和昵称");return}J(!0);try{if($){const te=await Pt("/api/db/users",{id:$.id,nickname:L.nickname,isAdmin:L.isAdmin,hasFullBook:L.hasFullBook,...L.password&&{password:L.password}});if(!(te!=null&&te.success)){alert("更新失败: "+((te==null?void 0:te.error)||"未知错误"));return}}else{const te=await jt("/api/db/users",{phone:L.phone,nickname:L.nickname,password:L.password,isAdmin:L.isAdmin});if(!(te!=null&&te.success)){alert("创建失败: "+((te==null?void 0:te.error)||"未知错误"));return}}C(!1),xe()}catch(te){console.error("Save user error:",te),alert("保存失败")}finally{J(!1)}}const et=te=>{V(te),T(""),Y(""),A(!0)};async function At(te){B(te),X(!0),I(!0);try{const Ue=await We(`/api/db/users/referrals?userId=${encodeURIComponent(te.id)}`);Ue!=null&&Ue.success?ee({referrals:Ue.referrals||[],stats:Ue.stats||{}}):ee({referrals:[],stats:{}})}catch(Ue){console.error("Load referrals error:",Ue),ee({referrals:[],stats:{}})}finally{I(!1)}}const Mt=te=>{re(te.id),P(!0)},Ir=te=>{pe(te),me(!0)};async function Xn(){if(!R){alert("请输入新密码");return}if(R!==F){alert("两次输入的密码不一致");return}if(R.length<6){alert("密码长度不能少于6位");return}J(!0);try{const te=await Pt("/api/db/users",{id:$==null?void 0:$.id,password:R});te!=null&&te.success?(alert("密码修改成功"),A(!1)):alert("密码修改失败: "+((te==null?void 0:te.error)||"未知错误"))}catch(te){console.error("Change password error:",te),alert("密码修改失败")}finally{J(!1)}}return t.jsxs("div",{className:"p-8 w-full",children:[w&&t.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:[t.jsx("span",{children:w}),t.jsx("button",{type:"button",onClick:()=>j(null),className:"hover:text-red-300",children:"×"})]}),t.jsxs("div",{className:"flex justify-between items-center mb-8",children:[t.jsxs("div",{children:[t.jsx("h2",{className:"text-2xl font-bold text-white",children:"用户管理"}),t.jsxs("p",{className:"text-gray-400 mt-1",children:["共 ",l," 位注册用户",y==="vip"&&",当前筛选 VIP"]})]}),t.jsxs("div",{className:"flex items-center gap-4",children:[t.jsxs(oe,{variant:"outline",onClick:xe,disabled:_,className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:[t.jsx(Ze,{className:`w-4 h-4 mr-2 ${_?"animate-spin":""}`}),"刷新"]}),t.jsxs("select",{value:y,onChange:te=>{E(te.target.value),u(1)},className:"bg-[#0f2137] border border-gray-700 text-white rounded-lg px-3 py-2 text-sm",children:[t.jsx("option",{value:"all",children:"全部用户"}),t.jsx("option",{value:"vip",children:"VIP会员"})]}),t.jsxs("div",{className:"relative",children:[t.jsx(Qr,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-gray-500"}),t.jsx(ne,{type:"text",placeholder:"搜索用户...",className:"pl-10 bg-[#0f2137] border-gray-700 text-white placeholder:text-gray-500 w-64",value:x,onChange:te=>g(te.target.value)})]}),t.jsxs(oe,{onClick:Qe,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:[t.jsx(Cm,{className:"w-4 h-4 mr-2"}),"添加用户"]})]})]}),t.jsx(Bt,{open:b,onOpenChange:C,children:t.jsxs(It,{className:"bg-[#0f2137] border-gray-700 text-white max-w-lg",children:[t.jsx(Ut,{children:t.jsxs(Vt,{className:"text-white flex items-center gap-2",children:[$?t.jsx(sn,{className:"w-5 h-5 text-[#38bdac]"}):t.jsx(Cm,{className:"w-5 h-5 text-[#38bdac]"}),$?"编辑用户":"添加用户"]})}),t.jsxs("div",{className:"space-y-4 py-4",children:[t.jsxs("div",{className:"space-y-2",children:[t.jsx(Z,{className:"text-gray-300",children:"手机号"}),t.jsx(ne,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"请输入手机号",value:L.phone,onChange:te=>ue({...L,phone:te.target.value}),disabled:!!$})]}),t.jsxs("div",{className:"space-y-2",children:[t.jsx(Z,{className:"text-gray-300",children:"昵称"}),t.jsx(ne,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"请输入昵称",value:L.nickname,onChange:te=>ue({...L,nickname:te.target.value})})]}),t.jsxs("div",{className:"space-y-2",children:[t.jsx(Z,{className:"text-gray-300",children:$?"新密码 (留空则不修改)":"密码"}),t.jsx(ne,{type:"password",className:"bg-[#0a1628] border-gray-700 text-white",placeholder:$?"留空则不修改":"请输入密码",value:L.password,onChange:te=>ue({...L,password:te.target.value})})]}),t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsx(Z,{className:"text-gray-300",children:"管理员权限"}),t.jsx(ht,{checked:L.isAdmin,onCheckedChange:te=>ue({...L,isAdmin:te})})]}),t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsx(Z,{className:"text-gray-300",children:"已购全书"}),t.jsx(ht,{checked:L.hasFullBook,onCheckedChange:te=>ue({...L,hasFullBook:te})})]})]}),t.jsxs(qt,{children:[t.jsxs(oe,{variant:"outline",onClick:()=>C(!1),className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:[t.jsx(on,{className:"w-4 h-4 mr-2"}),"取消"]}),t.jsxs(oe,{onClick:st,disabled:K,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:[t.jsx(Wt,{className:"w-4 h-4 mr-2"}),K?"保存中...":"保存"]})]})]})}),t.jsx(Bt,{open:N,onOpenChange:A,children:t.jsxs(It,{className:"bg-[#0f2137] border-gray-700 text-white max-w-md",children:[t.jsx(Ut,{children:t.jsxs(Vt,{className:"text-white flex items-center gap-2",children:[t.jsx(bm,{className:"w-5 h-5 text-[#38bdac]"}),"修改密码"]})}),t.jsxs("div",{className:"space-y-4 py-4",children:[t.jsxs("div",{className:"bg-[#0a1628] rounded-lg p-3",children:[t.jsxs("p",{className:"text-gray-400 text-sm",children:["用户:",$==null?void 0:$.nickname]}),t.jsxs("p",{className:"text-gray-400 text-sm",children:["手机号:",$==null?void 0:$.phone]})]}),t.jsxs("div",{className:"space-y-2",children:[t.jsx(Z,{className:"text-gray-300",children:"新密码"}),t.jsx(ne,{type:"password",className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"请输入新密码 (至少6位)",value:R,onChange:te=>T(te.target.value)})]}),t.jsxs("div",{className:"space-y-2",children:[t.jsx(Z,{className:"text-gray-300",children:"确认密码"}),t.jsx(ne,{type:"password",className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"请再次输入新密码",value:F,onChange:te=>Y(te.target.value)})]})]}),t.jsxs(qt,{children:[t.jsx(oe,{variant:"outline",onClick:()=>A(!1),className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:"取消"}),t.jsx(oe,{onClick:Xn,disabled:K,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:K?"保存中...":"确认修改"})]})]})}),t.jsx(m2,{open:D,onClose:()=>P(!1),userId:W,onUserUpdated:xe}),t.jsx(p2,{open:he,onClose:()=>{me(!1),pe(null)},userId:(se==null?void 0:se.id)??null,userNickname:se==null?void 0:se.nickname,onSaved:xe}),t.jsx(Bt,{open:ce,onOpenChange:X,children:t.jsxs(It,{className:"bg-[#0f2137] border-gray-700 text-white max-w-2xl max-h-[80vh] overflow-auto",children:[t.jsx(Ut,{children:t.jsxs(Vt,{className:"text-white flex items-center gap-2",children:[t.jsx(vn,{className:"w-5 h-5 text-[#38bdac]"}),"绑定关系详情 - ",Q==null?void 0:Q.nickname]})}),t.jsxs("div",{className:"space-y-4 py-4",children:[t.jsxs("div",{className:"grid grid-cols-4 gap-3",children:[t.jsxs("div",{className:"bg-[#0a1628] rounded-lg p-3 text-center",children:[t.jsx("div",{className:"text-2xl font-bold text-[#38bdac]",children:((ss=le.stats)==null?void 0:ss.total)||0}),t.jsx("div",{className:"text-xs text-gray-400",children:"绑定总数"})]}),t.jsxs("div",{className:"bg-[#0a1628] rounded-lg p-3 text-center",children:[t.jsx("div",{className:"text-2xl font-bold text-green-400",children:((Ys=le.stats)==null?void 0:Ys.purchased)||0}),t.jsx("div",{className:"text-xs text-gray-400",children:"已付费"})]}),t.jsxs("div",{className:"bg-[#0a1628] rounded-lg p-3 text-center",children:[t.jsxs("div",{className:"text-2xl font-bold text-yellow-400",children:["¥",(((Qs=le.stats)==null?void 0:Qs.earnings)||0).toFixed(2)]}),t.jsx("div",{className:"text-xs text-gray-400",children:"累计收益"})]}),t.jsxs("div",{className:"bg-[#0a1628] rounded-lg p-3 text-center",children:[t.jsxs("div",{className:"text-2xl font-bold text-orange-400",children:["¥",(((qs=le.stats)==null?void 0:qs.pendingEarnings)||0).toFixed(2)]}),t.jsx("div",{className:"text-xs text-gray-400",children:"待提现"})]})]}),q?t.jsxs("div",{className:"flex items-center justify-center py-8",children:[t.jsx(Ze,{className:"w-5 h-5 text-[#38bdac] animate-spin"}),t.jsx("span",{className:"ml-2 text-gray-400",children:"加载中..."})]}):(((Xs=le.referrals)==null?void 0:Xs.length)??0)>0?t.jsx("div",{className:"space-y-2 max-h-[300px] overflow-y-auto",children:(le.referrals??[]).map((te,Ue)=>{var cn;const Nt=te;return t.jsxs("div",{className:"flex items-center justify-between bg-[#0a1628] rounded-lg p-3",children:[t.jsxs("div",{className:"flex items-center gap-3",children:[t.jsx("div",{className:"w-8 h-8 rounded-full bg-[#38bdac]/20 flex items-center justify-center text-sm text-[#38bdac]",children:((cn=Nt.nickname)==null?void 0:cn.charAt(0))||"?"}),t.jsxs("div",{children:[t.jsx("div",{className:"text-white text-sm",children:Nt.nickname}),t.jsx("div",{className:"text-xs text-gray-500",children:Nt.phone||(Nt.hasOpenId?"微信用户":"未绑定")})]})]}),t.jsxs("div",{className:"flex items-center gap-2",children:[Nt.status==="vip"&&t.jsx(Me,{className:"bg-green-500/20 text-green-400 border-0 text-xs",children:"全书已购"}),Nt.status==="paid"&&t.jsxs(Me,{className:"bg-blue-500/20 text-blue-400 border-0 text-xs",children:["已付费",Nt.purchasedSections,"章"]}),Nt.status==="free"&&t.jsx(Me,{className:"bg-gray-500/20 text-gray-400 border-0 text-xs",children:"未付费"}),t.jsx("span",{className:"text-xs text-gray-500",children:Nt.createdAt?new Date(Nt.createdAt).toLocaleDateString():""})]})]},Nt.id||Ue)})}):t.jsx("div",{className:"text-center py-8 text-gray-500",children:"暂无绑定用户"})]}),t.jsx(qt,{children:t.jsx(oe,{variant:"outline",onClick:()=>X(!1),className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:"关闭"})})]})}),t.jsx(ke,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:t.jsx(Ee,{className:"p-0",children:_?t.jsxs("div",{className:"flex items-center justify-center py-12",children:[t.jsx(Ze,{className:"w-6 h-6 text-[#38bdac] animate-spin"}),t.jsx("span",{className:"ml-2 text-gray-400",children:"加载中..."})]}):t.jsxs("div",{children:[t.jsxs(Yn,{children:[t.jsx(Qn,{children:t.jsxs(rt,{className:"bg-[#0a1628] hover:bg-[#0a1628] border-gray-700",children:[t.jsx(Pe,{className:"text-gray-400",children:"用户信息"}),t.jsx(Pe,{className:"text-gray-400",children:"绑定信息"}),t.jsx(Pe,{className:"text-gray-400",children:"购买状态"}),t.jsx(Pe,{className:"text-gray-400",children:"分销收益"}),t.jsx(Pe,{className:"text-gray-400",children:"推广码"}),t.jsx(Pe,{className:"text-gray-400",children:"注册时间"}),t.jsx(Pe,{className:"text-right text-gray-400",children:"操作"})]})}),t.jsxs(qn,{children:[r.map(te=>{var Ue,Nt,cn;return t.jsxs(rt,{className:"hover:bg-[#0a1628] border-gray-700/50",children:[t.jsx(we,{children:t.jsxs("div",{className:"flex items-center gap-3",children:[t.jsx("div",{className:"w-10 h-10 rounded-full bg-[#38bdac]/20 flex items-center justify-center text-sm font-medium text-[#38bdac]",children:te.avatar?t.jsx("img",{src:te.avatar,className:"w-full h-full rounded-full object-cover",alt:""}):((Ue=te.nickname)==null?void 0:Ue.charAt(0))||"?"}),t.jsxs("div",{children:[t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx("p",{className:"font-medium text-white",children:te.nickname}),te.isAdmin&&t.jsx(Me,{className:"bg-purple-500/20 text-purple-400 hover:bg-purple-500/20 border-0 text-xs",children:"管理员"}),te.openId&&!((Nt=te.id)!=null&&Nt.startsWith("user_"))&&t.jsx(Me,{className:"bg-green-500/20 text-green-400 hover:bg-green-500/20 border-0 text-xs",children:"微信"})]}),t.jsx("p",{className:"text-xs text-gray-500 font-mono",children:te.openId?te.openId.slice(0,12)+"...":(cn=te.id)==null?void 0:cn.slice(0,12)})]})]})}),t.jsx(we,{children:t.jsxs("div",{className:"space-y-1",children:[te.phone&&t.jsxs("div",{className:"flex items-center gap-1 text-xs",children:[t.jsx("span",{className:"text-gray-500",children:"📱"}),t.jsx("span",{className:"text-gray-300",children:te.phone})]}),te.wechatId&&t.jsxs("div",{className:"flex items-center gap-1 text-xs",children:[t.jsx("span",{className:"text-gray-500",children:"💬"}),t.jsx("span",{className:"text-gray-300",children:te.wechatId})]}),te.openId&&t.jsxs("div",{className:"flex items-center gap-1 text-xs",children:[t.jsx("span",{className:"text-gray-500",children:"🔗"}),t.jsxs("span",{className:"text-gray-500 truncate max-w-[100px]",title:te.openId,children:[te.openId.slice(0,12),"..."]})]}),!te.phone&&!te.wechatId&&!te.openId&&t.jsx("span",{className:"text-gray-600 text-xs",children:"未绑定"})]})}),t.jsx(we,{children:te.hasFullBook?t.jsx(Me,{className:"bg-amber-500/20 text-amber-400 hover:bg-amber-500/20 border-0",children:"VIP"}):t.jsx(Me,{variant:"outline",className:"text-gray-500 border-gray-600",children:"未购买"})}),t.jsx(we,{children:t.jsxs("div",{className:"space-y-1",children:[t.jsxs("div",{className:"text-white font-medium",children:["¥",parseFloat(String(te.earnings||0)).toFixed(2)]}),parseFloat(String(te.pendingEarnings||0))>0&&t.jsxs("div",{className:"text-xs text-yellow-400",children:["待提现: ¥",parseFloat(String(te.pendingEarnings||0)).toFixed(2)]}),t.jsxs("div",{className:"text-xs text-[#38bdac] cursor-pointer hover:underline flex items-center gap-1",onClick:()=>At(te),onKeyDown:Ar=>Ar.key==="Enter"&&At(te),role:"button",tabIndex:0,children:[t.jsx(vn,{className:"w-3 h-3"}),"绑定",te.referralCount||0,"人"]})]})}),t.jsx(we,{children:t.jsx("code",{className:"text-[#38bdac] text-xs bg-[#38bdac]/10 px-2 py-0.5 rounded",children:te.referralCode||"-"})}),t.jsx(we,{className:"text-gray-400",children:te.createdAt?new Date(te.createdAt).toLocaleDateString():"-"}),t.jsx(we,{className:"text-right",children:t.jsxs("div",{className:"flex items-center justify-end gap-1",children:[t.jsx(oe,{variant:"ghost",size:"sm",onClick:()=>Ir(te),className:"text-gray-400 hover:text-amber-400 hover:bg-amber-400/10",title:"设置 VIP",children:t.jsx(Li,{className:"w-4 h-4"})}),t.jsx(oe,{variant:"ghost",size:"sm",onClick:()=>Mt(te),className:"text-gray-400 hover:text-blue-400 hover:bg-blue-400/10",title:"查看详情",children:t.jsx(Ms,{className:"w-4 h-4"})}),t.jsx(oe,{variant:"ghost",size:"sm",onClick:()=>Fe(te),className:"text-gray-400 hover:text-[#38bdac] hover:bg-[#38bdac]/10",title:"编辑",children:t.jsx(sn,{className:"w-4 h-4"})}),t.jsx(oe,{variant:"ghost",size:"sm",onClick:()=>et(te),className:"text-gray-400 hover:text-yellow-400 hover:bg-yellow-400/10",title:"修改密码",children:t.jsx(bm,{className:"w-4 h-4"})}),t.jsx(oe,{variant:"ghost",size:"sm",className:"text-red-400 hover:text-red-300 hover:bg-red-500/10",onClick:()=>De(te.id),title:"删除",children:t.jsx(Vn,{className:"w-4 h-4"})})]})})]},te.id)}),r.length===0&&t.jsx(rt,{children:t.jsx(we,{colSpan:7,className:"text-center py-12 text-gray-500",children:"暂无用户数据"})})]})]}),t.jsx(Sr,{page:c,totalPages:Re,total:l,pageSize:f,onPageChange:u,onPageSizeChange:te=>{p(te),u(1)}})]})})})]})}function g2(){const[r,a]=h.useState("overview"),[l,o]=h.useState([]),[c,u]=h.useState(null),[f,p]=h.useState([]),[x,g]=h.useState([]),[v,y]=h.useState([]),[E,_]=h.useState(!0),[k,w]=h.useState(null),[j,b]=h.useState(""),[C,N]=h.useState("all"),[A,$]=h.useState(1),[V,R]=h.useState(10),[T,F]=h.useState(0),[Y,K]=h.useState(new Set),[J,ce]=h.useState(null),[X,le]=h.useState(""),[ee,q]=h.useState(!1);h.useEffect(()=>{I()},[]),h.useEffect(()=>{$(1)},[r,C]),h.useEffect(()=>{Q(r)},[r]),h.useEffect(()=>{["orders","bindings","withdrawals"].includes(r)&&Q(r,!0)},[A,V,C,j]);async function I(){w(null);try{const L=await We("/api/admin/distribution/overview");L!=null&&L.success&&L.overview&&u(L.overview)}catch(L){console.error("[Admin] 概览接口异常:",L),w("加载概览失败")}try{const L=await We("/api/db/users");y((L==null?void 0:L.users)||[])}catch(L){console.error("[Admin] 用户数据加载失败:",L)}}async function Q(L,ue=!1){var xe;if(!(!ue&&Y.has(L))){_(!0);try{const Re=v;switch(L){case"overview":break;case"orders":{try{const De=new URLSearchParams({page:String(A),pageSize:String(V),...C!=="all"&&{status:C},...j&&{search:j}}),Fe=await We(`/api/orders?${De}`);if(Fe!=null&&Fe.success&&Fe.orders){const Qe=Fe.orders.map(st=>{const et=Re.find(Mt=>Mt.id===st.userId),At=st.referrerId?Re.find(Mt=>Mt.id===st.referrerId):null;return{...st,amount:parseFloat(String(st.amount))||0,userNickname:(et==null?void 0:et.nickname)||st.userNickname||"未知用户",userPhone:(et==null?void 0:et.phone)||st.userPhone||"-",referrerNickname:(At==null?void 0:At.nickname)||null,referrerCode:(At==null?void 0:At.referralCode)??null,type:st.productType||st.type}});o(Qe),F(Fe.total??Qe.length)}else o([]),F(0)}catch(De){console.error(De),w("加载订单失败"),o([])}break}case"bindings":{try{const De=new URLSearchParams({page:String(A),pageSize:String(V),...C!=="all"&&{status:C}}),Fe=await We(`/api/db/distribution?${De}`);p((Fe==null?void 0:Fe.bindings)||[]),F((Fe==null?void 0:Fe.total)??((xe=Fe==null?void 0:Fe.bindings)==null?void 0:xe.length)??0)}catch(De){console.error(De),w("加载绑定数据失败"),p([])}break}case"withdrawals":{try{const De=C==="completed"?"success":C==="rejected"?"failed":C,Fe=new URLSearchParams({...De&&De!=="all"&&{status:De},page:String(A),pageSize:String(V)}),Qe=await We(`/api/admin/withdrawals?${Fe}`);if(Qe!=null&&Qe.success&&Qe.withdrawals){const st=Qe.withdrawals.map(et=>({...et,account:et.account??"未绑定微信号",status:et.status==="success"?"completed":et.status==="failed"?"rejected":et.status}));g(st),F((Qe==null?void 0:Qe.total)??st.length)}else Qe!=null&&Qe.success||w(`获取提现记录失败: ${(Qe==null?void 0:Qe.error)||"未知错误"}`),g([])}catch(De){console.error(De),w("加载提现数据失败"),g([])}break}}K(De=>new Set(De).add(L))}catch(Re){console.error(Re)}finally{_(!1)}}}async function B(){w(null),K(L=>{const ue=new Set(L);return ue.delete(r),ue}),r==="overview"&&I(),await Q(r,!0)}async function D(L){if(confirm("确认审核通过并打款?"))try{const ue=await Pt("/api/admin/withdrawals",{id:L,action:"approve"});if(!(ue!=null&&ue.success)){const xe=(ue==null?void 0:ue.message)||(ue==null?void 0:ue.error)||"操作失败";alert(xe);return}await B()}catch(ue){console.error(ue),alert("操作失败")}}async function P(L){const ue=prompt("请输入拒绝原因:");if(ue)try{const xe=await Pt("/api/admin/withdrawals",{id:L,action:"reject",errorMessage:ue});if(!(xe!=null&&xe.success)){alert((xe==null?void 0:xe.error)||"操作失败");return}await B()}catch(xe){console.error(xe),alert("操作失败")}}async function W(){var L;if(!(!(J!=null&&J.orderSn)&&!(J!=null&&J.id))){q(!0),w(null);try{const ue=await Pt("/api/admin/orders/refund",{orderSn:J.orderSn||J.id,reason:X||void 0});ue!=null&&ue.success?(ce(null),le(""),await Q("orders",!0)):w((ue==null?void 0:ue.error)||"退款失败")}catch(ue){const xe=ue;w(((L=xe==null?void 0:xe.data)==null?void 0:L.error)||"退款失败,请检查网络后重试")}finally{q(!1)}}}function re(L){const ue={active:"bg-green-500/20 text-green-400",converted:"bg-blue-500/20 text-blue-400",expired:"bg-gray-500/20 text-gray-400",cancelled:"bg-red-500/20 text-red-400",pending:"bg-orange-500/20 text-orange-400",pending_confirm:"bg-orange-500/20 text-orange-400",processing:"bg-blue-500/20 text-blue-400",completed:"bg-green-500/20 text-green-400",rejected:"bg-red-500/20 text-red-400"},xe={active:"有效",converted:"已转化",expired:"已过期",cancelled:"已取消",pending:"待审核",pending_confirm:"待用户确认",processing:"处理中",completed:"已完成",rejected:"已拒绝"};return t.jsx(Me,{className:`${ue[L]||"bg-gray-500/20 text-gray-400"} border-0`,children:xe[L]||L})}const he=Math.ceil(T/V)||1,me=l,se=f.filter(L=>{var xe,Re,De,Fe;if(!j)return!0;const ue=j.toLowerCase();return((xe=L.refereeNickname)==null?void 0:xe.toLowerCase().includes(ue))||((Re=L.refereePhone)==null?void 0:Re.includes(ue))||((De=L.referrerName)==null?void 0:De.toLowerCase().includes(ue))||((Fe=L.referrerCode)==null?void 0:Fe.toLowerCase().includes(ue))}),pe=x.filter(L=>{var xe;if(!j)return!0;const ue=j.toLowerCase();return((xe=L.userName)==null?void 0:xe.toLowerCase().includes(ue))||L.account&&L.account.toLowerCase().includes(ue)});return t.jsxs("div",{className:"p-8 w-full",children:[k&&t.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:[t.jsx("span",{children:k}),t.jsx("button",{type:"button",onClick:()=>w(null),className:"hover:text-red-300",children:"×"})]}),t.jsxs("div",{className:"flex items-center justify-between mb-8",children:[t.jsxs("div",{children:[t.jsx("h1",{className:"text-2xl font-bold text-white",children:"交易中心"}),t.jsx("p",{className:"text-gray-400 mt-1",children:"统一管理:订单、分销绑定、提现审核"})]}),t.jsxs(oe,{onClick:B,disabled:E,variant:"outline",className:"border-gray-700 text-gray-300 hover:bg-gray-800",children:[t.jsx(Ze,{className:`w-4 h-4 mr-2 ${E?"animate-spin":""}`}),"刷新数据"]})]}),t.jsx("div",{className:"flex gap-2 mb-6 border-b border-gray-700 pb-4",children:[{key:"overview",label:"数据概览",icon:gd},{key:"orders",label:"订单管理",icon:yi},{key:"bindings",label:"绑定管理",icon:Yr},{key:"withdrawals",label:"提现审核",icon:Os}].map(L=>t.jsxs("button",{type:"button",onClick:()=>{a(L.key),N("all"),b("")},className:`flex items-center gap-2 px-4 py-2 rounded-lg text-sm font-medium transition-colors ${r===L.key?"bg-[#38bdac] text-white":"text-gray-400 hover:text-white hover:bg-gray-800"}`,children:[t.jsx(L.icon,{className:"w-4 h-4"}),L.label]},L.key))}),E?t.jsxs("div",{className:"flex items-center justify-center py-20",children:[t.jsx(Ze,{className:"w-8 h-8 text-[#38bdac] animate-spin"}),t.jsx("span",{className:"ml-2 text-gray-400",children:"加载中..."})]}):t.jsxs(t.Fragment,{children:[r==="overview"&&c&&t.jsxs("div",{className:"space-y-6",children:[t.jsxs("div",{className:"grid grid-cols-4 gap-4",children:[t.jsx(ke,{className:"bg-[#0f2137] border-gray-700/50",children:t.jsx(Ee,{className:"p-6",children:t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsxs("div",{children:[t.jsx("p",{className:"text-gray-400 text-sm",children:"今日点击"}),t.jsx("p",{className:"text-2xl font-bold text-white mt-1",children:c.todayClicks})]}),t.jsx("div",{className:"w-12 h-12 rounded-xl bg-blue-500/20 flex items-center justify-center",children:t.jsx(Ms,{className:"w-6 h-6 text-blue-400"})})]})})}),t.jsx(ke,{className:"bg-[#0f2137] border-gray-700/50",children:t.jsx(Ee,{className:"p-6",children:t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsxs("div",{children:[t.jsx("p",{className:"text-gray-400 text-sm",children:"今日绑定"}),t.jsx("p",{className:"text-2xl font-bold text-white mt-1",children:c.todayBindings})]}),t.jsx("div",{className:"w-12 h-12 rounded-xl bg-green-500/20 flex items-center justify-center",children:t.jsx(Yr,{className:"w-6 h-6 text-green-400"})})]})})}),t.jsx(ke,{className:"bg-[#0f2137] border-gray-700/50",children:t.jsx(Ee,{className:"p-6",children:t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsxs("div",{children:[t.jsx("p",{className:"text-gray-400 text-sm",children:"今日转化"}),t.jsx("p",{className:"text-2xl font-bold text-white mt-1",children:c.todayConversions})]}),t.jsx("div",{className:"w-12 h-12 rounded-xl bg-purple-500/20 flex items-center justify-center",children:t.jsx(ym,{className:"w-6 h-6 text-purple-400"})})]})})}),t.jsx(ke,{className:"bg-[#0f2137] border-gray-700/50",children:t.jsx(Ee,{className:"p-6",children:t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsxs("div",{children:[t.jsx("p",{className:"text-gray-400 text-sm",children:"今日佣金"}),t.jsxs("p",{className:"text-2xl font-bold text-[#38bdac] mt-1",children:["¥",c.todayEarnings.toFixed(2)]})]}),t.jsx("div",{className:"w-12 h-12 rounded-xl bg-[#38bdac]/20 flex items-center justify-center",children:t.jsx(yi,{className:"w-6 h-6 text-[#38bdac]"})})]})})})]}),t.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[t.jsx(ke,{className:"bg-orange-500/10 border-orange-500/30",children:t.jsx(Ee,{className:"p-6",children:t.jsxs("div",{className:"flex items-center gap-4",children:[t.jsx("div",{className:"w-12 h-12 rounded-xl bg-orange-500/20 flex items-center justify-center",children:t.jsx(wp,{className:"w-6 h-6 text-orange-400"})}),t.jsxs("div",{className:"flex-1",children:[t.jsx("p",{className:"text-orange-300 font-medium",children:"即将过期绑定"}),t.jsxs("p",{className:"text-2xl font-bold text-white",children:[c.expiringBindings," 个"]}),t.jsx("p",{className:"text-orange-300/60 text-sm",children:"7天内到期,需关注转化"})]})]})})}),t.jsx(ke,{className:"bg-blue-500/10 border-blue-500/30",children:t.jsx(Ee,{className:"p-6",children:t.jsxs("div",{className:"flex items-center gap-4",children:[t.jsx("div",{className:"w-12 h-12 rounded-xl bg-blue-500/20 flex items-center justify-center",children:t.jsx(Os,{className:"w-6 h-6 text-blue-400"})}),t.jsxs("div",{className:"flex-1",children:[t.jsx("p",{className:"text-blue-300 font-medium",children:"待审核提现"}),t.jsxs("p",{className:"text-2xl font-bold text-white",children:[c.pendingWithdrawals," 笔"]}),t.jsxs("p",{className:"text-blue-300/60 text-sm",children:["共 ¥",c.pendingWithdrawAmount.toFixed(2)]})]}),t.jsx(oe,{onClick:()=>a("withdrawals"),variant:"outline",className:"border-blue-500/50 text-blue-400 hover:bg-blue-500/20",children:"去审核"})]})})})]}),t.jsxs("div",{className:"grid grid-cols-2 gap-6",children:[t.jsxs(ke,{className:"bg-[#0f2137] border-gray-700/50",children:[t.jsx($e,{children:t.jsxs(Be,{className:"text-white flex items-center gap-2",children:[t.jsx(za,{className:"w-5 h-5 text-[#38bdac]"}),"本月统计"]})}),t.jsx(Ee,{children:t.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[t.jsxs("div",{className:"p-4 bg-white/5 rounded-lg",children:[t.jsx("p",{className:"text-gray-400 text-sm",children:"点击量"}),t.jsx("p",{className:"text-xl font-bold text-white",children:c.monthClicks})]}),t.jsxs("div",{className:"p-4 bg-white/5 rounded-lg",children:[t.jsx("p",{className:"text-gray-400 text-sm",children:"绑定数"}),t.jsx("p",{className:"text-xl font-bold text-white",children:c.monthBindings})]}),t.jsxs("div",{className:"p-4 bg-white/5 rounded-lg",children:[t.jsx("p",{className:"text-gray-400 text-sm",children:"转化数"}),t.jsx("p",{className:"text-xl font-bold text-white",children:c.monthConversions})]}),t.jsxs("div",{className:"p-4 bg-white/5 rounded-lg",children:[t.jsx("p",{className:"text-gray-400 text-sm",children:"佣金"}),t.jsxs("p",{className:"text-xl font-bold text-[#38bdac]",children:["¥",c.monthEarnings.toFixed(2)]})]})]})})]}),t.jsxs(ke,{className:"bg-[#0f2137] border-gray-700/50",children:[t.jsx($e,{children:t.jsxs(Be,{className:"text-white flex items-center gap-2",children:[t.jsx(gd,{className:"w-5 h-5 text-[#38bdac]"}),"累计统计"]})}),t.jsxs(Ee,{children:[t.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[t.jsxs("div",{className:"p-4 bg-white/5 rounded-lg",children:[t.jsx("p",{className:"text-gray-400 text-sm",children:"总点击"}),t.jsx("p",{className:"text-xl font-bold text-white",children:c.totalClicks.toLocaleString()})]}),t.jsxs("div",{className:"p-4 bg-white/5 rounded-lg",children:[t.jsx("p",{className:"text-gray-400 text-sm",children:"总绑定"}),t.jsx("p",{className:"text-xl font-bold text-white",children:c.totalBindings.toLocaleString()})]}),t.jsxs("div",{className:"p-4 bg-white/5 rounded-lg",children:[t.jsx("p",{className:"text-gray-400 text-sm",children:"总转化"}),t.jsx("p",{className:"text-xl font-bold text-white",children:c.totalConversions})]}),t.jsxs("div",{className:"p-4 bg-white/5 rounded-lg",children:[t.jsx("p",{className:"text-gray-400 text-sm",children:"总佣金"}),t.jsxs("p",{className:"text-xl font-bold text-[#38bdac]",children:["¥",c.totalEarnings.toFixed(2)]})]})]}),t.jsxs("div",{className:"mt-4 p-4 bg-[#38bdac]/10 rounded-lg flex items-center justify-between",children:[t.jsx("span",{className:"text-gray-300",children:"点击转化率"}),t.jsxs("span",{className:"text-[#38bdac] font-bold text-xl",children:[c.conversionRate,"%"]})]})]})]})]}),t.jsxs(ke,{className:"bg-[#0f2137] border-gray-700/50",children:[t.jsx($e,{children:t.jsxs(Be,{className:"text-white flex items-center gap-2",children:[t.jsx(vn,{className:"w-5 h-5 text-[#38bdac]"}),"推广统计"]})}),t.jsx(Ee,{children:t.jsxs("div",{className:"grid grid-cols-4 gap-4",children:[t.jsxs("div",{className:"p-4 bg-white/5 rounded-lg text-center",children:[t.jsx("p",{className:"text-3xl font-bold text-white",children:c.totalDistributors}),t.jsx("p",{className:"text-gray-400 text-sm mt-1",children:"推广用户数"})]}),t.jsxs("div",{className:"p-4 bg-white/5 rounded-lg text-center",children:[t.jsx("p",{className:"text-3xl font-bold text-green-400",children:c.activeDistributors}),t.jsx("p",{className:"text-gray-400 text-sm mt-1",children:"有收益用户"})]}),t.jsxs("div",{className:"p-4 bg-white/5 rounded-lg text-center",children:[t.jsx("p",{className:"text-3xl font-bold text-[#38bdac]",children:"90%"}),t.jsx("p",{className:"text-gray-400 text-sm mt-1",children:"佣金比例"})]}),t.jsxs("div",{className:"p-4 bg-white/5 rounded-lg text-center",children:[t.jsx("p",{className:"text-3xl font-bold text-orange-400",children:"30天"}),t.jsx("p",{className:"text-gray-400 text-sm mt-1",children:"绑定有效期"})]})]})})]})]}),r==="orders"&&t.jsxs("div",{className:"space-y-4",children:[t.jsxs("div",{className:"flex gap-4",children:[t.jsxs("div",{className:"relative flex-1",children:[t.jsx(Qr,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-gray-400"}),t.jsx(ne,{value:j,onChange:L=>b(L.target.value),placeholder:"搜索订单号、用户名、手机号...",className:"pl-10 bg-[#0f2137] border-gray-700 text-white"})]}),t.jsxs("select",{value:C,onChange:L=>N(L.target.value),className:"px-4 py-2 bg-[#0f2137] border border-gray-700 rounded-lg text-white",children:[t.jsx("option",{value:"all",children:"全部状态"}),t.jsx("option",{value:"completed",children:"已完成"}),t.jsx("option",{value:"pending",children:"待支付"}),t.jsx("option",{value:"failed",children:"已失败"}),t.jsx("option",{value:"refunded",children:"已退款"})]})]}),t.jsx(ke,{className:"bg-[#0f2137] border-gray-700/50",children:t.jsxs(Ee,{className:"p-0",children:[l.length===0?t.jsx("div",{className:"py-12 text-center text-gray-500",children:"暂无订单数据"}):t.jsx("div",{className:"overflow-x-auto",children:t.jsxs("table",{className:"w-full text-sm",children:[t.jsx("thead",{children:t.jsxs("tr",{className:"bg-[#0a1628] text-gray-400",children:[t.jsx("th",{className:"p-4 text-left font-medium",children:"订单号"}),t.jsx("th",{className:"p-4 text-left font-medium",children:"用户"}),t.jsx("th",{className:"p-4 text-left font-medium",children:"商品"}),t.jsx("th",{className:"p-4 text-left font-medium",children:"金额"}),t.jsx("th",{className:"p-4 text-left font-medium",children:"支付方式"}),t.jsx("th",{className:"p-4 text-left font-medium",children:"状态"}),t.jsx("th",{className:"p-4 text-left font-medium",children:"退款原因"}),t.jsx("th",{className:"p-4 text-left font-medium",children:"推荐人/邀请码"}),t.jsx("th",{className:"p-4 text-left font-medium",children:"分销佣金"}),t.jsx("th",{className:"p-4 text-left font-medium",children:"下单时间"}),t.jsx("th",{className:"p-4 text-left font-medium",children:"操作"})]})}),t.jsx("tbody",{className:"divide-y divide-gray-700/50",children:me.map(L=>{var ue,xe;return t.jsxs("tr",{className:"hover:bg-[#0a1628] transition-colors",children:[t.jsxs("td",{className:"p-4 font-mono text-xs text-gray-400",children:[(ue=L.id)==null?void 0:ue.slice(0,12),"..."]}),t.jsx("td",{className:"p-4",children:t.jsxs("div",{children:[t.jsx("p",{className:"text-white text-sm",children:L.userNickname}),t.jsx("p",{className:"text-gray-500 text-xs",children:L.userPhone})]})}),t.jsx("td",{className:"p-4",children:t.jsxs("div",{children:[t.jsx("p",{className:"text-white text-sm",children:(()=>{const Re=L.productType||L.type;return Re==="fullbook"?`${L.bookName||"《底层逻辑》"} - 全本`:Re==="match"?"匹配次数购买":`${L.bookName||"《底层逻辑》"} - ${L.sectionTitle||L.chapterTitle||`章节${L.productId||L.sectionId||""}`}`})()}),t.jsx("p",{className:"text-gray-500 text-xs",children:(()=>{const Re=L.productType||L.type;return Re==="fullbook"?"全书解锁":Re==="match"?"功能权益":L.chapterTitle||"单章购买"})()})]})}),t.jsxs("td",{className:"p-4 text-[#38bdac] font-bold",children:["¥",typeof L.amount=="number"?L.amount.toFixed(2):parseFloat(String(L.amount||"0")).toFixed(2)]}),t.jsx("td",{className:"p-4 text-gray-300",children:L.paymentMethod==="wechat"?"微信支付":L.paymentMethod==="alipay"?"支付宝":L.paymentMethod||"微信支付"}),t.jsx("td",{className:"p-4",children:L.status==="refunded"?t.jsx(Me,{className:"bg-gray-500/20 text-gray-400 border-0",children:"已退款"}):L.status==="completed"||L.status==="paid"?t.jsx(Me,{className:"bg-green-500/20 text-green-400 border-0",children:"已完成"}):L.status==="pending"||L.status==="created"?t.jsx(Me,{className:"bg-yellow-500/20 text-yellow-400 border-0",children:"待支付"}):t.jsx(Me,{className:"bg-red-500/20 text-red-400 border-0",children:"已失败"})}),t.jsx("td",{className:"p-4 text-gray-400 text-sm max-w-[120px]",title:L.refundReason,children:L.status==="refunded"&&L.refundReason?L.refundReason:"-"}),t.jsx("td",{className:"p-4 text-gray-300 text-sm",children:L.referrerId||L.referralCode?t.jsxs("span",{title:L.referralCode||L.referrerCode||L.referrerId||"",children:[L.referrerNickname||L.referralCode||L.referrerCode||((xe=L.referrerId)==null?void 0:xe.slice(0,8)),(L.referralCode||L.referrerCode)&&` (${L.referralCode||L.referrerCode})`]}):"-"}),t.jsx("td",{className:"p-4 text-[#FFD700]",children:L.referrerEarnings?`¥${(typeof L.referrerEarnings=="number"?L.referrerEarnings:parseFloat(String(L.referrerEarnings))).toFixed(2)}`:"-"}),t.jsx("td",{className:"p-4 text-gray-400 text-sm",children:L.createdAt?new Date(L.createdAt).toLocaleString("zh-CN"):"-"}),t.jsx("td",{className:"p-4",children:(L.status==="paid"||L.status==="completed")&&t.jsxs(oe,{variant:"outline",size:"sm",className:"border-orange-500/50 text-orange-400 hover:bg-orange-500/20",onClick:()=>{ce(L),le("")},children:[t.jsx(kp,{className:"w-3 h-3 mr-1"}),"退款"]})})]},L.id)})})]})}),r==="orders"&&t.jsx(Sr,{page:A,totalPages:he,total:T,pageSize:V,onPageChange:$,onPageSizeChange:L=>{R(L),$(1)}})]})})]}),r==="bindings"&&t.jsxs("div",{className:"space-y-4",children:[t.jsxs("div",{className:"flex gap-4",children:[t.jsxs("div",{className:"relative flex-1",children:[t.jsx(Qr,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-gray-400"}),t.jsx(ne,{value:j,onChange:L=>b(L.target.value),placeholder:"搜索用户昵称、手机号、推广码...",className:"pl-10 bg-[#0f2137] border-gray-700 text-white"})]}),t.jsxs("select",{value:C,onChange:L=>N(L.target.value),className:"px-4 py-2 bg-[#0f2137] border border-gray-700 rounded-lg text-white",children:[t.jsx("option",{value:"all",children:"全部状态"}),t.jsx("option",{value:"active",children:"有效"}),t.jsx("option",{value:"converted",children:"已转化"}),t.jsx("option",{value:"expired",children:"已过期"})]})]}),t.jsx(ke,{className:"bg-[#0f2137] border-gray-700/50",children:t.jsxs(Ee,{className:"p-0",children:[se.length===0?t.jsx("div",{className:"py-12 text-center text-gray-500",children:"暂无绑定数据"}):t.jsx("div",{className:"overflow-x-auto",children:t.jsxs("table",{className:"w-full text-sm",children:[t.jsx("thead",{children:t.jsxs("tr",{className:"bg-[#0a1628] text-gray-400",children:[t.jsx("th",{className:"p-4 text-left font-medium",children:"访客"}),t.jsx("th",{className:"p-4 text-left font-medium",children:"分销商"}),t.jsx("th",{className:"p-4 text-left font-medium",children:"绑定时间"}),t.jsx("th",{className:"p-4 text-left font-medium",children:"到期时间"}),t.jsx("th",{className:"p-4 text-left font-medium",children:"状态"}),t.jsx("th",{className:"p-4 text-left font-medium",children:"佣金"})]})}),t.jsx("tbody",{className:"divide-y divide-gray-700/50",children:se.map(L=>t.jsxs("tr",{className:"hover:bg-[#0a1628] transition-colors",children:[t.jsx("td",{className:"p-4",children:t.jsxs("div",{children:[t.jsx("p",{className:"text-white font-medium",children:L.refereeNickname||"匿名用户"}),t.jsx("p",{className:"text-gray-500 text-xs",children:L.refereePhone})]})}),t.jsx("td",{className:"p-4",children:t.jsxs("div",{children:[t.jsx("p",{className:"text-white",children:L.referrerName||"-"}),t.jsx("p",{className:"text-gray-500 text-xs font-mono",children:L.referrerCode})]})}),t.jsx("td",{className:"p-4 text-gray-400",children:L.boundAt?new Date(L.boundAt).toLocaleDateString("zh-CN"):"-"}),t.jsx("td",{className:"p-4 text-gray-400",children:L.expiresAt?new Date(L.expiresAt).toLocaleDateString("zh-CN"):"-"}),t.jsx("td",{className:"p-4",children:re(L.status)}),t.jsx("td",{className:"p-4",children:L.commission?t.jsxs("span",{className:"text-[#38bdac] font-medium",children:["¥",L.commission.toFixed(2)]}):t.jsx("span",{className:"text-gray-500",children:"-"})})]},L.id))})]})}),r==="bindings"&&t.jsx(Sr,{page:A,totalPages:he,total:T,pageSize:V,onPageChange:$,onPageSizeChange:L=>{R(L),$(1)}})]})})]}),r==="withdrawals"&&t.jsxs("div",{className:"space-y-4",children:[t.jsxs("div",{className:"flex gap-4",children:[t.jsxs("div",{className:"relative flex-1",children:[t.jsx(Qr,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-gray-400"}),t.jsx(ne,{value:j,onChange:L=>b(L.target.value),placeholder:"搜索用户名称、账号...",className:"pl-10 bg-[#0f2137] border-gray-700 text-white"})]}),t.jsxs("select",{value:C,onChange:L=>N(L.target.value),className:"px-4 py-2 bg-[#0f2137] border border-gray-700 rounded-lg text-white",children:[t.jsx("option",{value:"all",children:"全部状态"}),t.jsx("option",{value:"pending",children:"待审核"}),t.jsx("option",{value:"completed",children:"已完成"}),t.jsx("option",{value:"rejected",children:"已拒绝"})]})]}),t.jsx(ke,{className:"bg-[#0f2137] border-gray-700/50",children:t.jsxs(Ee,{className:"p-0",children:[pe.length===0?t.jsx("div",{className:"py-12 text-center text-gray-500",children:"暂无提现记录"}):t.jsx("div",{className:"overflow-x-auto",children:t.jsxs("table",{className:"w-full text-sm",children:[t.jsx("thead",{children:t.jsxs("tr",{className:"bg-[#0a1628] text-gray-400",children:[t.jsx("th",{className:"p-4 text-left font-medium",children:"申请人"}),t.jsx("th",{className:"p-4 text-left font-medium",children:"金额"}),t.jsx("th",{className:"p-4 text-left font-medium",children:"收款方式"}),t.jsx("th",{className:"p-4 text-left font-medium",children:"收款账号"}),t.jsx("th",{className:"p-4 text-left font-medium",children:"申请时间"}),t.jsx("th",{className:"p-4 text-left font-medium",children:"状态"}),t.jsx("th",{className:"p-4 text-right font-medium",children:"操作"})]})}),t.jsx("tbody",{className:"divide-y divide-gray-700/50",children:pe.map(L=>t.jsxs("tr",{className:"hover:bg-[#0a1628] transition-colors",children:[t.jsx("td",{className:"p-4",children:t.jsxs("div",{className:"flex items-center gap-2",children:[L.userAvatar?t.jsx("img",{src:L.userAvatar,alt:"",className:"w-8 h-8 rounded-full object-cover"}):t.jsx("div",{className:"w-8 h-8 rounded-full bg-gray-600 flex items-center justify-center text-white text-sm font-medium",children:(L.userName||L.name||"?").slice(0,1)}),t.jsx("p",{className:"text-white font-medium",children:L.userName||L.name})]})}),t.jsx("td",{className:"p-4",children:t.jsxs("span",{className:"text-[#38bdac] font-bold",children:["¥",L.amount.toFixed(2)]})}),t.jsx("td",{className:"p-4",children:t.jsx(Me,{className:L.method==="wechat"?"bg-green-500/20 text-green-400 border-0":"bg-blue-500/20 text-blue-400 border-0",children:L.method==="wechat"?"微信":"支付宝"})}),t.jsx("td",{className:"p-4",children:t.jsxs("div",{children:[t.jsx("p",{className:"text-white font-mono text-xs",children:L.account}),t.jsx("p",{className:"text-gray-500 text-xs",children:L.name})]})}),t.jsx("td",{className:"p-4 text-gray-400",children:L.createdAt?new Date(L.createdAt).toLocaleString("zh-CN"):"-"}),t.jsx("td",{className:"p-4",children:re(L.status)}),t.jsx("td",{className:"p-4 text-right",children:L.status==="pending"&&t.jsxs("div",{className:"flex gap-2 justify-end",children:[t.jsxs(oe,{size:"sm",onClick:()=>D(L.id),className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:[t.jsx(ym,{className:"w-4 h-4 mr-1"}),"通过"]}),t.jsxs(oe,{size:"sm",variant:"outline",onClick:()=>P(L.id),className:"border-red-500/50 text-red-400 hover:bg-red-500/20",children:[t.jsx(Dj,{className:"w-4 h-4 mr-1"}),"拒绝"]})]})})]},L.id))})]})}),r==="withdrawals"&&t.jsx(Sr,{page:A,totalPages:he,total:T,pageSize:V,onPageChange:$,onPageSizeChange:L=>{R(L),$(1)}})]})})]})]}),t.jsx(Bt,{open:!!J,onOpenChange:L=>!L&&ce(null),children:t.jsxs(It,{className:"bg-[#0f2137] border-gray-700 text-white max-w-md",children:[t.jsx(Ut,{children:t.jsx(Vt,{className:"text-white",children:"订单退款"})}),J&&t.jsxs("div",{className:"space-y-4",children:[t.jsxs("p",{className:"text-gray-400 text-sm",children:["订单号:",J.orderSn||J.id]}),t.jsxs("p",{className:"text-gray-400 text-sm",children:["退款金额:¥",typeof J.amount=="number"?J.amount.toFixed(2):parseFloat(String(J.amount||"0")).toFixed(2)]}),t.jsxs("div",{children:[t.jsx("label",{className:"text-sm text-gray-400 block mb-2",children:"退款原因(选填)"}),t.jsx("div",{className:"form-input",children:t.jsx(ne,{className:"bg-[#0a1628] border-gray-700 text-white placeholder:text-gray-500",placeholder:"如:用户申请退款",value:X,onChange:L=>le(L.target.value)})})]}),t.jsx("p",{className:"text-orange-400/80 text-xs",children:"退款将原路退回至用户微信,且无法撤销,请确认后再操作。"})]}),t.jsxs(qt,{children:[t.jsx(oe,{variant:"outline",className:"border-gray-600 text-gray-300",onClick:()=>ce(null),disabled:ee,children:"取消"}),t.jsx(oe,{className:"bg-orange-500 hover:bg-orange-600 text-white",onClick:W,disabled:ee,children:ee?"退款中...":"确认退款"})]})]})})]})}function v2(){const[r,a]=h.useState([]),[l,o]=h.useState({total:0,pendingCount:0,pendingAmount:0,successCount:0,successAmount:0,failedCount:0}),[c,u]=h.useState(!0),[f,p]=h.useState(null),[x,g]=h.useState("all"),[v,y]=h.useState(1),[E,_]=h.useState(10),[k,w]=h.useState(0),[j,b]=h.useState(null);async function C(){var R,T,F,Y,K,J,ce;u(!0),p(null);try{const X=new URLSearchParams({status:x,page:String(v),pageSize:String(E)}),le=await We(`/api/admin/withdrawals?${X}`);if(le!=null&&le.success){const ee=le.withdrawals||[];a(ee),w(le.total??((R=le.stats)==null?void 0:R.total)??ee.length),o({total:((T=le.stats)==null?void 0:T.total)??le.total??ee.length,pendingCount:((F=le.stats)==null?void 0:F.pendingCount)??0,pendingAmount:((Y=le.stats)==null?void 0:Y.pendingAmount)??0,successCount:((K=le.stats)==null?void 0:K.successCount)??0,successAmount:((J=le.stats)==null?void 0:J.successAmount)??0,failedCount:((ce=le.stats)==null?void 0:ce.failedCount)??0})}else p("加载提现记录失败")}catch(X){console.error("Load withdrawals error:",X),p("加载失败,请检查网络后重试")}finally{u(!1)}}h.useEffect(()=>{y(1)},[x]),h.useEffect(()=>{C()},[x,v,E]);const N=Math.ceil(k/E)||1;async function A(R){const T=r.find(F=>F.id===R);if(T!=null&&T.userCommissionInfo&&T.userCommissionInfo.availableAfterThis<0){if(!confirm(`⚠️ 风险警告:该用户审核后余额为负数(¥${T.userCommissionInfo.availableAfterThis.toFixed(2)}),可能存在超额提现。 + +确认已核实用户账户并完成打款?`))return}else if(!confirm("确认已完成打款?批准后将更新用户提现记录。"))return;b(R);try{const F=await Pt("/api/admin/withdrawals",{id:R,action:"approve"});F!=null&&F.success?C():alert("操作失败: "+((F==null?void 0:F.error)??""))}catch{alert("操作失败")}finally{b(null)}}async function $(R){const T=prompt("请输入拒绝原因(将返还用户余额):");if(T){b(R);try{const F=await Pt("/api/admin/withdrawals",{id:R,action:"reject",errorMessage:T});F!=null&&F.success?C():alert("操作失败: "+((F==null?void 0:F.error)??""))}catch{alert("操作失败")}finally{b(null)}}}function V(R){switch(R){case"pending":return t.jsx(Me,{className:"bg-orange-500/20 text-orange-400 hover:bg-orange-500/20 border-0",children:"待处理"});case"pending_confirm":return t.jsx(Me,{className:"bg-orange-500/20 text-orange-400 hover:bg-orange-500/20 border-0",children:"待用户确认"});case"processing":return t.jsx(Me,{className:"bg-blue-500/20 text-blue-400 hover:bg-blue-500/20 border-0",children:"已审批等待打款"});case"success":case"completed":return t.jsx(Me,{className:"bg-green-500/20 text-green-400 hover:bg-green-500/20 border-0",children:"已完成"});case"failed":case"rejected":return t.jsx(Me,{className:"bg-red-500/20 text-red-400 hover:bg-red-500/20 border-0",children:"已拒绝"});default:return t.jsx(Me,{className:"bg-gray-500/20 text-gray-400 border-0",children:R})}}return t.jsxs("div",{className:"p-8 w-full",children:[f&&t.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:[t.jsx("span",{children:f}),t.jsx("button",{type:"button",onClick:()=>p(null),className:"hover:text-red-300",children:"×"})]}),t.jsxs("div",{className:"flex justify-between items-start mb-8",children:[t.jsxs("div",{children:[t.jsx("h1",{className:"text-2xl font-bold text-white",children:"分账提现管理"}),t.jsx("p",{className:"text-gray-400 mt-1",children:"管理用户分销收益的提现申请"})]}),t.jsxs(oe,{variant:"outline",onClick:C,disabled:c,className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:[t.jsx(Ze,{className:`w-4 h-4 mr-2 ${c?"animate-spin":""}`}),"刷新"]})]}),t.jsx(ke,{className:"bg-gradient-to-r from-[#38bdac]/10 to-[#0f2137] border-[#38bdac]/30 mb-6",children:t.jsx(Ee,{className:"p-4",children:t.jsxs("div",{className:"flex items-start gap-3",children:[t.jsx(yi,{className:"w-5 h-5 text-[#38bdac] mt-0.5"}),t.jsxs("div",{children:[t.jsx("h3",{className:"text-white font-medium mb-2",children:"自动分账规则"}),t.jsxs("div",{className:"text-sm text-gray-400 space-y-1",children:[t.jsxs("p",{children:["• ",t.jsx("span",{className:"text-[#38bdac]",children:"分销比例"}),":推广者获得订单金额的"," ",t.jsx("span",{className:"text-white font-medium",children:"90%"})]}),t.jsxs("p",{children:["• ",t.jsx("span",{className:"text-[#38bdac]",children:"结算方式"}),":用户付款后,分销收益自动计入推广者账户"]}),t.jsxs("p",{children:["• ",t.jsx("span",{className:"text-[#38bdac]",children:"提现方式"}),":用户在小程序端点击提现,系统自动转账到微信零钱"]}),t.jsxs("p",{children:["• ",t.jsx("span",{className:"text-[#38bdac]",children:"审批流程"}),":待处理的提现需管理员手动确认打款后批准"]})]})]})]})})}),t.jsxs("div",{className:"grid grid-cols-4 gap-4 mb-6",children:[t.jsx(ke,{className:"bg-[#0f2137] border-gray-700/50",children:t.jsxs(Ee,{className:"p-4 text-center",children:[t.jsx("div",{className:"text-3xl font-bold text-[#38bdac]",children:l.total}),t.jsx("div",{className:"text-sm text-gray-400",children:"总申请"})]})}),t.jsx(ke,{className:"bg-[#0f2137] border-gray-700/50",children:t.jsxs(Ee,{className:"p-4 text-center",children:[t.jsx("div",{className:"text-3xl font-bold text-orange-400",children:l.pendingCount}),t.jsx("div",{className:"text-sm text-gray-400",children:"待处理"}),t.jsxs("div",{className:"text-xs text-orange-400 mt-1",children:["¥",l.pendingAmount.toFixed(2)]})]})}),t.jsx(ke,{className:"bg-[#0f2137] border-gray-700/50",children:t.jsxs(Ee,{className:"p-4 text-center",children:[t.jsx("div",{className:"text-3xl font-bold text-green-400",children:l.successCount}),t.jsx("div",{className:"text-sm text-gray-400",children:"已完成"}),t.jsxs("div",{className:"text-xs text-green-400 mt-1",children:["¥",l.successAmount.toFixed(2)]})]})}),t.jsx(ke,{className:"bg-[#0f2137] border-gray-700/50",children:t.jsxs(Ee,{className:"p-4 text-center",children:[t.jsx("div",{className:"text-3xl font-bold text-red-400",children:l.failedCount}),t.jsx("div",{className:"text-sm text-gray-400",children:"已拒绝"})]})})]}),t.jsx("div",{className:"flex gap-2 mb-4",children:["all","pending","success","failed"].map(R=>t.jsx(oe,{variant:x===R?"default":"outline",size:"sm",onClick:()=>g(R),className:x===R?"bg-[#38bdac] hover:bg-[#2da396] text-white":"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:R==="all"?"全部":R==="pending"?"待处理":R==="success"?"已完成":"已拒绝"},R))}),t.jsx(ke,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:t.jsx(Ee,{className:"p-0",children:c?t.jsxs("div",{className:"flex items-center justify-center py-12",children:[t.jsx(Ze,{className:"w-6 h-6 text-[#38bdac] animate-spin"}),t.jsx("span",{className:"ml-2 text-gray-400",children:"加载中..."})]}):r.length===0?t.jsxs("div",{className:"text-center py-12",children:[t.jsx(Os,{className:"w-12 h-12 text-gray-600 mx-auto mb-3"}),t.jsx("p",{className:"text-gray-500",children:"暂无提现记录"})]}):t.jsxs(t.Fragment,{children:[t.jsx("div",{className:"overflow-x-auto",children:t.jsxs("table",{className:"w-full text-sm",children:[t.jsx("thead",{children:t.jsxs("tr",{className:"bg-[#0a1628] text-gray-400",children:[t.jsx("th",{className:"p-4 text-left font-medium",children:"申请时间"}),t.jsx("th",{className:"p-4 text-left font-medium",children:"用户"}),t.jsx("th",{className:"p-4 text-left font-medium",children:"提现金额"}),t.jsx("th",{className:"p-4 text-left font-medium",children:"用户佣金信息"}),t.jsx("th",{className:"p-4 text-left font-medium",children:"状态"}),t.jsx("th",{className:"p-4 text-left font-medium",children:"处理时间"}),t.jsx("th",{className:"p-4 text-left font-medium",children:"确认收款"}),t.jsx("th",{className:"p-4 text-right font-medium",children:"操作"})]})}),t.jsx("tbody",{className:"divide-y divide-gray-700/50",children:r.map(R=>t.jsxs("tr",{className:"hover:bg-[#0a1628] transition-colors",children:[t.jsx("td",{className:"p-4 text-gray-400",children:new Date(R.createdAt??"").toLocaleString()}),t.jsx("td",{className:"p-4",children:t.jsxs("div",{className:"flex items-center gap-2",children:[R.userAvatar?t.jsx("img",{src:R.userAvatar,alt:R.userName??"",className:"w-8 h-8 rounded-full object-cover"}):t.jsx("div",{className:"w-8 h-8 rounded-full bg-[#38bdac]/20 flex items-center justify-center text-sm text-[#38bdac]",children:(R.userName??"?").charAt(0)}),t.jsxs("div",{children:[t.jsx("p",{className:"font-medium text-white",children:R.userName??"未知"}),t.jsx("p",{className:"text-xs text-gray-500",children:R.userPhone??R.referralCode??(R.userId??"").slice(0,10)})]})]})}),t.jsx("td",{className:"p-4",children:t.jsxs("span",{className:"font-bold text-orange-400",children:["¥",Number(R.amount).toFixed(2)]})}),t.jsx("td",{className:"p-4",children:R.userCommissionInfo?t.jsxs("div",{className:"text-xs space-y-1",children:[t.jsxs("div",{className:"flex justify-between gap-4",children:[t.jsx("span",{className:"text-gray-500",children:"累计佣金:"}),t.jsxs("span",{className:"text-[#38bdac] font-medium",children:["¥",R.userCommissionInfo.totalCommission.toFixed(2)]})]}),t.jsxs("div",{className:"flex justify-between gap-4",children:[t.jsx("span",{className:"text-gray-500",children:"已提现:"}),t.jsxs("span",{className:"text-gray-400",children:["¥",R.userCommissionInfo.withdrawnEarnings.toFixed(2)]})]}),t.jsxs("div",{className:"flex justify-between gap-4",children:[t.jsx("span",{className:"text-gray-500",children:"待审核:"}),t.jsxs("span",{className:"text-orange-400",children:["¥",R.userCommissionInfo.pendingWithdrawals.toFixed(2)]})]}),t.jsxs("div",{className:"flex justify-between gap-4 pt-1 border-t border-gray-700/30",children:[t.jsx("span",{className:"text-gray-500",children:"审核后余额:"}),t.jsxs("span",{className:R.userCommissionInfo.availableAfterThis>=0?"text-green-400 font-medium":"text-red-400 font-medium",children:["¥",R.userCommissionInfo.availableAfterThis.toFixed(2)]})]})]}):t.jsx("span",{className:"text-gray-500 text-xs",children:"暂无数据"})}),t.jsxs("td",{className:"p-4",children:[V(R.status),R.errorMessage&&t.jsx("p",{className:"text-xs text-red-400 mt-1",children:R.errorMessage})]}),t.jsx("td",{className:"p-4 text-gray-400",children:R.processedAt?new Date(R.processedAt).toLocaleString():"-"}),t.jsx("td",{className:"p-4 text-gray-400",children:R.userConfirmedAt?t.jsxs("span",{className:"text-green-400",title:R.userConfirmedAt,children:["已确认 ",new Date(R.userConfirmedAt).toLocaleString()]}):"-"}),t.jsxs("td",{className:"p-4 text-right",children:[(R.status==="pending"||R.status==="pending_confirm")&&t.jsxs("div",{className:"flex items-center justify-end gap-2",children:[t.jsxs(oe,{size:"sm",onClick:()=>A(R.id),disabled:j===R.id,className:"bg-green-600 hover:bg-green-700 text-white",children:[t.jsx(Mi,{className:"w-4 h-4 mr-1"}),"批准"]}),t.jsxs(oe,{size:"sm",variant:"outline",onClick:()=>$(R.id),disabled:j===R.id,className:"border-red-500/50 text-red-400 hover:bg-red-500/10 bg-transparent",children:[t.jsx(on,{className:"w-4 h-4 mr-1"}),"拒绝"]})]}),(R.status==="success"||R.status==="completed")&&R.transactionId&&t.jsx("span",{className:"text-xs text-gray-500 font-mono",children:R.transactionId})]})]},R.id))})]})}),t.jsx(Sr,{page:v,totalPages:N,total:k,pageSize:E,onPageChange:y,onPageSizeChange:R=>{_(R),y(1)}})]})})})]})}const Xr=h.forwardRef(({className:r,...a},l)=>t.jsx("textarea",{className:Ge("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}));Xr.displayName="Textarea";function ki(r,[a,l]){return Math.min(l,Math.max(a,r))}const y2=["top","right","bottom","left"],kr=Math.min,Qt=Math.max,Ei=Math.round,di=Math.floor,_n=r=>({x:r,y:r}),j2={left:"right",right:"left",bottom:"top",top:"bottom"},N2={start:"end",end:"start"};function bd(r,a,l){return Qt(r,kr(a,l))}function Hn(r,a){return typeof r=="function"?r(a):r}function Kn(r){return r.split("-")[0]}function Ws(r){return r.split("-")[1]}function ru(r){return r==="x"?"y":"x"}function su(r){return r==="y"?"height":"width"}const b2=new Set(["top","bottom"]);function Pn(r){return b2.has(Kn(r))?"y":"x"}function au(r){return ru(Pn(r))}function w2(r,a,l){l===void 0&&(l=!1);const o=Ws(r),c=au(r),u=su(c);let f=c==="x"?o===(l?"end":"start")?"right":"left":o==="start"?"bottom":"top";return a.reference[u]>a.floating[u]&&(f=Pi(f)),[f,Pi(f)]}function S2(r){const a=Pi(r);return[wd(r),a,wd(a)]}function wd(r){return r.replace(/start|end/g,a=>N2[a])}const Gm=["left","right"],Ym=["right","left"],C2=["top","bottom"],k2=["bottom","top"];function E2(r,a,l){switch(r){case"top":case"bottom":return l?a?Ym:Gm:a?Gm:Ym;case"left":case"right":return a?C2:k2;default:return[]}}function P2(r,a,l,o){const c=Ws(r);let u=E2(Kn(r),l==="start",o);return c&&(u=u.map(f=>f+"-"+c),a&&(u=u.concat(u.map(wd)))),u}function Pi(r){return r.replace(/left|right|bottom|top/g,a=>j2[a])}function R2(r){return{top:0,right:0,bottom:0,left:0,...r}}function Gx(r){return typeof r!="number"?R2(r):{top:r,right:r,bottom:r,left:r}}function Ri(r){const{x:a,y:l,width:o,height:c}=r;return{width:o,height:c,top:l,left:a,right:a+o,bottom:l+c,x:a,y:l}}function Qm(r,a,l){let{reference:o,floating:c}=r;const u=Pn(a),f=au(a),p=su(f),x=Kn(a),g=u==="y",v=o.x+o.width/2-c.width/2,y=o.y+o.height/2-c.height/2,E=o[p]/2-c[p]/2;let _;switch(x){case"top":_={x:v,y:o.y-c.height};break;case"bottom":_={x:v,y:o.y+o.height};break;case"right":_={x:o.x+o.width,y};break;case"left":_={x:o.x-c.width,y};break;default:_={x:o.x,y:o.y}}switch(Ws(a)){case"start":_[f]-=E*(l&&g?-1:1);break;case"end":_[f]+=E*(l&&g?-1:1);break}return _}async function _2(r,a){var l;a===void 0&&(a={});const{x:o,y:c,platform:u,rects:f,elements:p,strategy:x}=r,{boundary:g="clippingAncestors",rootBoundary:v="viewport",elementContext:y="floating",altBoundary:E=!1,padding:_=0}=Hn(a,r),k=Gx(_),j=p[E?y==="floating"?"reference":"floating":y],b=Ri(await u.getClippingRect({element:(l=await(u.isElement==null?void 0:u.isElement(j)))==null||l?j:j.contextElement||await(u.getDocumentElement==null?void 0:u.getDocumentElement(p.floating)),boundary:g,rootBoundary:v,strategy:x})),C=y==="floating"?{x:o,y:c,width:f.floating.width,height:f.floating.height}:f.reference,N=await(u.getOffsetParent==null?void 0:u.getOffsetParent(p.floating)),A=await(u.isElement==null?void 0:u.isElement(N))?await(u.getScale==null?void 0:u.getScale(N))||{x:1,y:1}:{x:1,y:1},$=Ri(u.convertOffsetParentRelativeRectToViewportRelativeRect?await u.convertOffsetParentRelativeRectToViewportRelativeRect({elements:p,rect:C,offsetParent:N,strategy:x}):C);return{top:(b.top-$.top+k.top)/A.y,bottom:($.bottom-b.bottom+k.bottom)/A.y,left:(b.left-$.left+k.left)/A.x,right:($.right-b.right+k.right)/A.x}}const T2=async(r,a,l)=>{const{placement:o="bottom",strategy:c="absolute",middleware:u=[],platform:f}=l,p=u.filter(Boolean),x=await(f.isRTL==null?void 0:f.isRTL(a));let g=await f.getElementRects({reference:r,floating:a,strategy:c}),{x:v,y}=Qm(g,o,x),E=o,_={},k=0;for(let j=0;j({name:"arrow",options:r,async fn(a){const{x:l,y:o,placement:c,rects:u,platform:f,elements:p,middlewareData:x}=a,{element:g,padding:v=0}=Hn(r,a)||{};if(g==null)return{};const y=Gx(v),E={x:l,y:o},_=au(c),k=su(_),w=await f.getDimensions(g),j=_==="y",b=j?"top":"left",C=j?"bottom":"right",N=j?"clientHeight":"clientWidth",A=u.reference[k]+u.reference[_]-E[_]-u.floating[k],$=E[_]-u.reference[_],V=await(f.getOffsetParent==null?void 0:f.getOffsetParent(g));let R=V?V[N]:0;(!R||!await(f.isElement==null?void 0:f.isElement(V)))&&(R=p.floating[N]||u.floating[k]);const T=A/2-$/2,F=R/2-w[k]/2-1,Y=kr(y[b],F),K=kr(y[C],F),J=Y,ce=R-w[k]-K,X=R/2-w[k]/2+T,le=bd(J,X,ce),ee=!x.arrow&&Ws(c)!=null&&X!==le&&u.reference[k]/2-(XX<=0)){var K,J;const X=(((K=u.flip)==null?void 0:K.index)||0)+1,le=R[X];if(le&&(!(y==="alignment"?C!==Pn(le):!1)||Y.every(I=>Pn(I.placement)===C?I.overflows[0]>0:!0)))return{data:{index:X,overflows:Y},reset:{placement:le}};let ee=(J=Y.filter(q=>q.overflows[0]<=0).sort((q,I)=>q.overflows[1]-I.overflows[1])[0])==null?void 0:J.placement;if(!ee)switch(_){case"bestFit":{var ce;const q=(ce=Y.filter(I=>{if(V){const Q=Pn(I.placement);return Q===C||Q==="y"}return!0}).map(I=>[I.placement,I.overflows.filter(Q=>Q>0).reduce((Q,B)=>Q+B,0)]).sort((I,Q)=>I[1]-Q[1])[0])==null?void 0:ce[0];q&&(ee=q);break}case"initialPlacement":ee=p;break}if(c!==ee)return{reset:{placement:ee}}}return{}}}};function qm(r,a){return{top:r.top-a.height,right:r.right-a.width,bottom:r.bottom-a.height,left:r.left-a.width}}function Xm(r){return y2.some(a=>r[a]>=0)}const M2=function(r){return r===void 0&&(r={}),{name:"hide",options:r,async fn(a){const{rects:l,platform:o}=a,{strategy:c="referenceHidden",...u}=Hn(r,a);switch(c){case"referenceHidden":{const f=await o.detectOverflow(a,{...u,elementContext:"reference"}),p=qm(f,l.reference);return{data:{referenceHiddenOffsets:p,referenceHidden:Xm(p)}}}case"escaped":{const f=await o.detectOverflow(a,{...u,altBoundary:!0}),p=qm(f,l.floating);return{data:{escapedOffsets:p,escaped:Xm(p)}}}default:return{}}}}},Yx=new Set(["left","top"]);async function D2(r,a){const{placement:l,platform:o,elements:c}=r,u=await(o.isRTL==null?void 0:o.isRTL(c.floating)),f=Kn(l),p=Ws(l),x=Pn(l)==="y",g=Yx.has(f)?-1:1,v=u&&x?-1:1,y=Hn(a,r);let{mainAxis:E,crossAxis:_,alignmentAxis:k}=typeof y=="number"?{mainAxis:y,crossAxis:0,alignmentAxis:null}:{mainAxis:y.mainAxis||0,crossAxis:y.crossAxis||0,alignmentAxis:y.alignmentAxis};return p&&typeof k=="number"&&(_=p==="end"?k*-1:k),x?{x:_*v,y:E*g}:{x:E*g,y:_*v}}const L2=function(r){return r===void 0&&(r=0),{name:"offset",options:r,async fn(a){var l,o;const{x:c,y:u,placement:f,middlewareData:p}=a,x=await D2(a,r);return f===((l=p.offset)==null?void 0:l.placement)&&(o=p.arrow)!=null&&o.alignmentOffset?{}:{x:c+x.x,y:u+x.y,data:{...x,placement:f}}}}},O2=function(r){return r===void 0&&(r={}),{name:"shift",options:r,async fn(a){const{x:l,y:o,placement:c,platform:u}=a,{mainAxis:f=!0,crossAxis:p=!1,limiter:x={fn:b=>{let{x:C,y:N}=b;return{x:C,y:N}}},...g}=Hn(r,a),v={x:l,y:o},y=await u.detectOverflow(a,g),E=Pn(Kn(c)),_=ru(E);let k=v[_],w=v[E];if(f){const b=_==="y"?"top":"left",C=_==="y"?"bottom":"right",N=k+y[b],A=k-y[C];k=bd(N,k,A)}if(p){const b=E==="y"?"top":"left",C=E==="y"?"bottom":"right",N=w+y[b],A=w-y[C];w=bd(N,w,A)}const j=x.fn({...a,[_]:k,[E]:w});return{...j,data:{x:j.x-l,y:j.y-o,enabled:{[_]:f,[E]:p}}}}}},F2=function(r){return r===void 0&&(r={}),{options:r,fn(a){const{x:l,y:o,placement:c,rects:u,middlewareData:f}=a,{offset:p=0,mainAxis:x=!0,crossAxis:g=!0}=Hn(r,a),v={x:l,y:o},y=Pn(c),E=ru(y);let _=v[E],k=v[y];const w=Hn(p,a),j=typeof w=="number"?{mainAxis:w,crossAxis:0}:{mainAxis:0,crossAxis:0,...w};if(x){const N=E==="y"?"height":"width",A=u.reference[E]-u.floating[N]+j.mainAxis,$=u.reference[E]+u.reference[N]-j.mainAxis;_$&&(_=$)}if(g){var b,C;const N=E==="y"?"width":"height",A=Yx.has(Kn(c)),$=u.reference[y]-u.floating[N]+(A&&((b=f.offset)==null?void 0:b[y])||0)+(A?0:j.crossAxis),V=u.reference[y]+u.reference[N]+(A?0:((C=f.offset)==null?void 0:C[y])||0)-(A?j.crossAxis:0);k<$?k=$:k>V&&(k=V)}return{[E]:_,[y]:k}}}},z2=function(r){return r===void 0&&(r={}),{name:"size",options:r,async fn(a){var l,o;const{placement:c,rects:u,platform:f,elements:p}=a,{apply:x=()=>{},...g}=Hn(r,a),v=await f.detectOverflow(a,g),y=Kn(c),E=Ws(c),_=Pn(c)==="y",{width:k,height:w}=u.floating;let j,b;y==="top"||y==="bottom"?(j=y,b=E===(await(f.isRTL==null?void 0:f.isRTL(p.floating))?"start":"end")?"left":"right"):(b=y,j=E==="end"?"top":"bottom");const C=w-v.top-v.bottom,N=k-v.left-v.right,A=kr(w-v[j],C),$=kr(k-v[b],N),V=!a.middlewareData.shift;let R=A,T=$;if((l=a.middlewareData.shift)!=null&&l.enabled.x&&(T=N),(o=a.middlewareData.shift)!=null&&o.enabled.y&&(R=C),V&&!E){const Y=Qt(v.left,0),K=Qt(v.right,0),J=Qt(v.top,0),ce=Qt(v.bottom,0);_?T=k-2*(Y!==0||K!==0?Y+K:Qt(v.left,v.right)):R=w-2*(J!==0||ce!==0?J+ce:Qt(v.top,v.bottom))}await x({...a,availableWidth:T,availableHeight:R});const F=await f.getDimensions(p.floating);return k!==F.width||w!==F.height?{reset:{rects:!0}}:{}}}};function Wi(){return typeof window<"u"}function Hs(r){return Qx(r)?(r.nodeName||"").toLowerCase():"#document"}function Xt(r){var a;return(r==null||(a=r.ownerDocument)==null?void 0:a.defaultView)||window}function In(r){var a;return(a=(Qx(r)?r.ownerDocument:r.document)||window.document)==null?void 0:a.documentElement}function Qx(r){return Wi()?r instanceof Node||r instanceof Xt(r).Node:!1}function yn(r){return Wi()?r instanceof Element||r instanceof Xt(r).Element:!1}function Tn(r){return Wi()?r instanceof HTMLElement||r instanceof Xt(r).HTMLElement:!1}function Jm(r){return!Wi()||typeof ShadowRoot>"u"?!1:r instanceof ShadowRoot||r instanceof Xt(r).ShadowRoot}const $2=new Set(["inline","contents"]);function Ga(r){const{overflow:a,overflowX:l,overflowY:o,display:c}=jn(r);return/auto|scroll|overlay|hidden|clip/.test(a+o+l)&&!$2.has(c)}const B2=new Set(["table","td","th"]);function U2(r){return B2.has(Hs(r))}const V2=[":popover-open",":modal"];function Hi(r){return V2.some(a=>{try{return r.matches(a)}catch{return!1}})}const W2=["transform","translate","scale","rotate","perspective"],H2=["transform","translate","scale","rotate","perspective","filter"],K2=["paint","layout","strict","content"];function lu(r){const a=iu(),l=yn(r)?jn(r):r;return W2.some(o=>l[o]?l[o]!=="none":!1)||(l.containerType?l.containerType!=="normal":!1)||!a&&(l.backdropFilter?l.backdropFilter!=="none":!1)||!a&&(l.filter?l.filter!=="none":!1)||H2.some(o=>(l.willChange||"").includes(o))||K2.some(o=>(l.contain||"").includes(o))}function G2(r){let a=Er(r);for(;Tn(a)&&!zs(a);){if(lu(a))return a;if(Hi(a))return null;a=Er(a)}return null}function iu(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const Y2=new Set(["html","body","#document"]);function zs(r){return Y2.has(Hs(r))}function jn(r){return Xt(r).getComputedStyle(r)}function Ki(r){return yn(r)?{scrollLeft:r.scrollLeft,scrollTop:r.scrollTop}:{scrollLeft:r.scrollX,scrollTop:r.scrollY}}function Er(r){if(Hs(r)==="html")return r;const a=r.assignedSlot||r.parentNode||Jm(r)&&r.host||In(r);return Jm(a)?a.host:a}function qx(r){const a=Er(r);return zs(a)?r.ownerDocument?r.ownerDocument.body:r.body:Tn(a)&&Ga(a)?a:qx(a)}function Ba(r,a,l){var o;a===void 0&&(a=[]),l===void 0&&(l=!0);const c=qx(r),u=c===((o=r.ownerDocument)==null?void 0:o.body),f=Xt(c);if(u){const p=Sd(f);return a.concat(f,f.visualViewport||[],Ga(c)?c:[],p&&l?Ba(p):[])}return a.concat(c,Ba(c,[],l))}function Sd(r){return r.parent&&Object.getPrototypeOf(r.parent)?r.frameElement:null}function Xx(r){const a=jn(r);let l=parseFloat(a.width)||0,o=parseFloat(a.height)||0;const c=Tn(r),u=c?r.offsetWidth:l,f=c?r.offsetHeight:o,p=Ei(l)!==u||Ei(o)!==f;return p&&(l=u,o=f),{width:l,height:o,$:p}}function ou(r){return yn(r)?r:r.contextElement}function Ls(r){const a=ou(r);if(!Tn(a))return _n(1);const l=a.getBoundingClientRect(),{width:o,height:c,$:u}=Xx(a);let f=(u?Ei(l.width):l.width)/o,p=(u?Ei(l.height):l.height)/c;return(!f||!Number.isFinite(f))&&(f=1),(!p||!Number.isFinite(p))&&(p=1),{x:f,y:p}}const Q2=_n(0);function Jx(r){const a=Xt(r);return!iu()||!a.visualViewport?Q2:{x:a.visualViewport.offsetLeft,y:a.visualViewport.offsetTop}}function q2(r,a,l){return a===void 0&&(a=!1),!l||a&&l!==Xt(r)?!1:a}function es(r,a,l,o){a===void 0&&(a=!1),l===void 0&&(l=!1);const c=r.getBoundingClientRect(),u=ou(r);let f=_n(1);a&&(o?yn(o)&&(f=Ls(o)):f=Ls(r));const p=q2(u,l,o)?Jx(u):_n(0);let x=(c.left+p.x)/f.x,g=(c.top+p.y)/f.y,v=c.width/f.x,y=c.height/f.y;if(u){const E=Xt(u),_=o&&yn(o)?Xt(o):o;let k=E,w=Sd(k);for(;w&&o&&_!==k;){const j=Ls(w),b=w.getBoundingClientRect(),C=jn(w),N=b.left+(w.clientLeft+parseFloat(C.paddingLeft))*j.x,A=b.top+(w.clientTop+parseFloat(C.paddingTop))*j.y;x*=j.x,g*=j.y,v*=j.x,y*=j.y,x+=N,g+=A,k=Xt(w),w=Sd(k)}}return Ri({width:v,height:y,x,y:g})}function Gi(r,a){const l=Ki(r).scrollLeft;return a?a.left+l:es(In(r)).left+l}function Zx(r,a){const l=r.getBoundingClientRect(),o=l.left+a.scrollLeft-Gi(r,l),c=l.top+a.scrollTop;return{x:o,y:c}}function X2(r){let{elements:a,rect:l,offsetParent:o,strategy:c}=r;const u=c==="fixed",f=In(o),p=a?Hi(a.floating):!1;if(o===f||p&&u)return l;let x={scrollLeft:0,scrollTop:0},g=_n(1);const v=_n(0),y=Tn(o);if((y||!y&&!u)&&((Hs(o)!=="body"||Ga(f))&&(x=Ki(o)),Tn(o))){const _=es(o);g=Ls(o),v.x=_.x+o.clientLeft,v.y=_.y+o.clientTop}const E=f&&!y&&!u?Zx(f,x):_n(0);return{width:l.width*g.x,height:l.height*g.y,x:l.x*g.x-x.scrollLeft*g.x+v.x+E.x,y:l.y*g.y-x.scrollTop*g.y+v.y+E.y}}function J2(r){return Array.from(r.getClientRects())}function Z2(r){const a=In(r),l=Ki(r),o=r.ownerDocument.body,c=Qt(a.scrollWidth,a.clientWidth,o.scrollWidth,o.clientWidth),u=Qt(a.scrollHeight,a.clientHeight,o.scrollHeight,o.clientHeight);let f=-l.scrollLeft+Gi(r);const p=-l.scrollTop;return jn(o).direction==="rtl"&&(f+=Qt(a.clientWidth,o.clientWidth)-c),{width:c,height:u,x:f,y:p}}const Zm=25;function eS(r,a){const l=Xt(r),o=In(r),c=l.visualViewport;let u=o.clientWidth,f=o.clientHeight,p=0,x=0;if(c){u=c.width,f=c.height;const v=iu();(!v||v&&a==="fixed")&&(p=c.offsetLeft,x=c.offsetTop)}const g=Gi(o);if(g<=0){const v=o.ownerDocument,y=v.body,E=getComputedStyle(y),_=v.compatMode==="CSS1Compat"&&parseFloat(E.marginLeft)+parseFloat(E.marginRight)||0,k=Math.abs(o.clientWidth-y.clientWidth-_);k<=Zm&&(u-=k)}else g<=Zm&&(u+=g);return{width:u,height:f,x:p,y:x}}const tS=new Set(["absolute","fixed"]);function nS(r,a){const l=es(r,!0,a==="fixed"),o=l.top+r.clientTop,c=l.left+r.clientLeft,u=Tn(r)?Ls(r):_n(1),f=r.clientWidth*u.x,p=r.clientHeight*u.y,x=c*u.x,g=o*u.y;return{width:f,height:p,x,y:g}}function ep(r,a,l){let o;if(a==="viewport")o=eS(r,l);else if(a==="document")o=Z2(In(r));else if(yn(a))o=nS(a,l);else{const c=Jx(r);o={x:a.x-c.x,y:a.y-c.y,width:a.width,height:a.height}}return Ri(o)}function eg(r,a){const l=Er(r);return l===a||!yn(l)||zs(l)?!1:jn(l).position==="fixed"||eg(l,a)}function rS(r,a){const l=a.get(r);if(l)return l;let o=Ba(r,[],!1).filter(p=>yn(p)&&Hs(p)!=="body"),c=null;const u=jn(r).position==="fixed";let f=u?Er(r):r;for(;yn(f)&&!zs(f);){const p=jn(f),x=lu(f);!x&&p.position==="fixed"&&(c=null),(u?!x&&!c:!x&&p.position==="static"&&!!c&&tS.has(c.position)||Ga(f)&&!x&&eg(r,f))?o=o.filter(v=>v!==f):c=p,f=Er(f)}return a.set(r,o),o}function sS(r){let{element:a,boundary:l,rootBoundary:o,strategy:c}=r;const f=[...l==="clippingAncestors"?Hi(a)?[]:rS(a,this._c):[].concat(l),o],p=f[0],x=f.reduce((g,v)=>{const y=ep(a,v,c);return g.top=Qt(y.top,g.top),g.right=kr(y.right,g.right),g.bottom=kr(y.bottom,g.bottom),g.left=Qt(y.left,g.left),g},ep(a,p,c));return{width:x.right-x.left,height:x.bottom-x.top,x:x.left,y:x.top}}function aS(r){const{width:a,height:l}=Xx(r);return{width:a,height:l}}function lS(r,a,l){const o=Tn(a),c=In(a),u=l==="fixed",f=es(r,!0,u,a);let p={scrollLeft:0,scrollTop:0};const x=_n(0);function g(){x.x=Gi(c)}if(o||!o&&!u)if((Hs(a)!=="body"||Ga(c))&&(p=Ki(a)),o){const _=es(a,!0,u,a);x.x=_.x+a.clientLeft,x.y=_.y+a.clientTop}else c&&g();u&&!o&&c&&g();const v=c&&!o&&!u?Zx(c,p):_n(0),y=f.left+p.scrollLeft-x.x-v.x,E=f.top+p.scrollTop-x.y-v.y;return{x:y,y:E,width:f.width,height:f.height}}function ad(r){return jn(r).position==="static"}function tp(r,a){if(!Tn(r)||jn(r).position==="fixed")return null;if(a)return a(r);let l=r.offsetParent;return In(r)===l&&(l=l.ownerDocument.body),l}function tg(r,a){const l=Xt(r);if(Hi(r))return l;if(!Tn(r)){let c=Er(r);for(;c&&!zs(c);){if(yn(c)&&!ad(c))return c;c=Er(c)}return l}let o=tp(r,a);for(;o&&U2(o)&&ad(o);)o=tp(o,a);return o&&zs(o)&&ad(o)&&!lu(o)?l:o||G2(r)||l}const iS=async function(r){const a=this.getOffsetParent||tg,l=this.getDimensions,o=await l(r.floating);return{reference:lS(r.reference,await a(r.floating),r.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}};function oS(r){return jn(r).direction==="rtl"}const cS={convertOffsetParentRelativeRectToViewportRelativeRect:X2,getDocumentElement:In,getClippingRect:sS,getOffsetParent:tg,getElementRects:iS,getClientRects:J2,getDimensions:aS,getScale:Ls,isElement:yn,isRTL:oS};function ng(r,a){return r.x===a.x&&r.y===a.y&&r.width===a.width&&r.height===a.height}function dS(r,a){let l=null,o;const c=In(r);function u(){var p;clearTimeout(o),(p=l)==null||p.disconnect(),l=null}function f(p,x){p===void 0&&(p=!1),x===void 0&&(x=1),u();const g=r.getBoundingClientRect(),{left:v,top:y,width:E,height:_}=g;if(p||a(),!E||!_)return;const k=di(y),w=di(c.clientWidth-(v+E)),j=di(c.clientHeight-(y+_)),b=di(v),N={rootMargin:-k+"px "+-w+"px "+-j+"px "+-b+"px",threshold:Qt(0,kr(1,x))||1};let A=!0;function $(V){const R=V[0].intersectionRatio;if(R!==x){if(!A)return f();R?f(!1,R):o=setTimeout(()=>{f(!1,1e-7)},1e3)}R===1&&!ng(g,r.getBoundingClientRect())&&f(),A=!1}try{l=new IntersectionObserver($,{...N,root:c.ownerDocument})}catch{l=new IntersectionObserver($,N)}l.observe(r)}return f(!0),u}function uS(r,a,l,o){o===void 0&&(o={});const{ancestorScroll:c=!0,ancestorResize:u=!0,elementResize:f=typeof ResizeObserver=="function",layoutShift:p=typeof IntersectionObserver=="function",animationFrame:x=!1}=o,g=ou(r),v=c||u?[...g?Ba(g):[],...Ba(a)]:[];v.forEach(b=>{c&&b.addEventListener("scroll",l,{passive:!0}),u&&b.addEventListener("resize",l)});const y=g&&p?dS(g,l):null;let E=-1,_=null;f&&(_=new ResizeObserver(b=>{let[C]=b;C&&C.target===g&&_&&(_.unobserve(a),cancelAnimationFrame(E),E=requestAnimationFrame(()=>{var N;(N=_)==null||N.observe(a)})),l()}),g&&!x&&_.observe(g),_.observe(a));let k,w=x?es(r):null;x&&j();function j(){const b=es(r);w&&!ng(w,b)&&l(),w=b,k=requestAnimationFrame(j)}return l(),()=>{var b;v.forEach(C=>{c&&C.removeEventListener("scroll",l),u&&C.removeEventListener("resize",l)}),y==null||y(),(b=_)==null||b.disconnect(),_=null,x&&cancelAnimationFrame(k)}}const fS=L2,hS=O2,mS=A2,pS=z2,xS=M2,np=I2,gS=F2,vS=(r,a,l)=>{const o=new Map,c={platform:cS,...l},u={...c.platform,_c:o};return T2(r,a,{...c,platform:u})};var yS=typeof document<"u",jS=function(){},pi=yS?h.useLayoutEffect:jS;function _i(r,a){if(r===a)return!0;if(typeof r!=typeof a)return!1;if(typeof r=="function"&&r.toString()===a.toString())return!0;let l,o,c;if(r&&a&&typeof r=="object"){if(Array.isArray(r)){if(l=r.length,l!==a.length)return!1;for(o=l;o--!==0;)if(!_i(r[o],a[o]))return!1;return!0}if(c=Object.keys(r),l=c.length,l!==Object.keys(a).length)return!1;for(o=l;o--!==0;)if(!{}.hasOwnProperty.call(a,c[o]))return!1;for(o=l;o--!==0;){const u=c[o];if(!(u==="_owner"&&r.$$typeof)&&!_i(r[u],a[u]))return!1}return!0}return r!==r&&a!==a}function rg(r){return typeof window>"u"?1:(r.ownerDocument.defaultView||window).devicePixelRatio||1}function rp(r,a){const l=rg(r);return Math.round(a*l)/l}function ld(r){const a=h.useRef(r);return pi(()=>{a.current=r}),a}function NS(r){r===void 0&&(r={});const{placement:a="bottom",strategy:l="absolute",middleware:o=[],platform:c,elements:{reference:u,floating:f}={},transform:p=!0,whileElementsMounted:x,open:g}=r,[v,y]=h.useState({x:0,y:0,strategy:l,placement:a,middlewareData:{},isPositioned:!1}),[E,_]=h.useState(o);_i(E,o)||_(o);const[k,w]=h.useState(null),[j,b]=h.useState(null),C=h.useCallback(I=>{I!==V.current&&(V.current=I,w(I))},[]),N=h.useCallback(I=>{I!==R.current&&(R.current=I,b(I))},[]),A=u||k,$=f||j,V=h.useRef(null),R=h.useRef(null),T=h.useRef(v),F=x!=null,Y=ld(x),K=ld(c),J=ld(g),ce=h.useCallback(()=>{if(!V.current||!R.current)return;const I={placement:a,strategy:l,middleware:E};K.current&&(I.platform=K.current),vS(V.current,R.current,I).then(Q=>{const B={...Q,isPositioned:J.current!==!1};X.current&&!_i(T.current,B)&&(T.current=B,Ua.flushSync(()=>{y(B)}))})},[E,a,l,K,J]);pi(()=>{g===!1&&T.current.isPositioned&&(T.current.isPositioned=!1,y(I=>({...I,isPositioned:!1})))},[g]);const X=h.useRef(!1);pi(()=>(X.current=!0,()=>{X.current=!1}),[]),pi(()=>{if(A&&(V.current=A),$&&(R.current=$),A&&$){if(Y.current)return Y.current(A,$,ce);ce()}},[A,$,ce,Y,F]);const le=h.useMemo(()=>({reference:V,floating:R,setReference:C,setFloating:N}),[C,N]),ee=h.useMemo(()=>({reference:A,floating:$}),[A,$]),q=h.useMemo(()=>{const I={position:l,left:0,top:0};if(!ee.floating)return I;const Q=rp(ee.floating,v.x),B=rp(ee.floating,v.y);return p?{...I,transform:"translate("+Q+"px, "+B+"px)",...rg(ee.floating)>=1.5&&{willChange:"transform"}}:{position:l,left:Q,top:B}},[l,p,ee.floating,v.x,v.y]);return h.useMemo(()=>({...v,update:ce,refs:le,elements:ee,floatingStyles:q}),[v,ce,le,ee,q])}const bS=r=>{function a(l){return{}.hasOwnProperty.call(l,"current")}return{name:"arrow",options:r,fn(l){const{element:o,padding:c}=typeof r=="function"?r(l):r;return o&&a(o)?o.current!=null?np({element:o.current,padding:c}).fn(l):{}:o?np({element:o,padding:c}).fn(l):{}}}},wS=(r,a)=>({...fS(r),options:[r,a]}),SS=(r,a)=>({...hS(r),options:[r,a]}),CS=(r,a)=>({...gS(r),options:[r,a]}),kS=(r,a)=>({...mS(r),options:[r,a]}),ES=(r,a)=>({...pS(r),options:[r,a]}),PS=(r,a)=>({...xS(r),options:[r,a]}),RS=(r,a)=>({...bS(r),options:[r,a]});var _S="Arrow",sg=h.forwardRef((r,a)=>{const{children:l,width:o=10,height:c=5,...u}=r;return t.jsx(Oe.svg,{...u,ref:a,width:o,height:c,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:r.asChild?l:t.jsx("polygon",{points:"0,0 30,0 15,10"})})});sg.displayName=_S;var TS=sg,cu="Popper",[ag,lg]=Rr(cu),[IS,ig]=ag(cu),og=r=>{const{__scopePopper:a,children:l}=r,[o,c]=h.useState(null);return t.jsx(IS,{scope:a,anchor:o,onAnchorChange:c,children:l})};og.displayName=cu;var cg="PopperAnchor",dg=h.forwardRef((r,a)=>{const{__scopePopper:l,virtualRef:o,...c}=r,u=ig(cg,l),f=h.useRef(null),p=Ke(a,f),x=h.useRef(null);return h.useEffect(()=>{const g=x.current;x.current=(o==null?void 0:o.current)||f.current,g!==x.current&&u.onAnchorChange(x.current)}),o?null:t.jsx(Oe.div,{...c,ref:p})});dg.displayName=cg;var du="PopperContent",[AS,MS]=ag(du),ug=h.forwardRef((r,a)=>{var se,pe,L,ue,xe,Re;const{__scopePopper:l,side:o="bottom",sideOffset:c=0,align:u="center",alignOffset:f=0,arrowPadding:p=0,avoidCollisions:x=!0,collisionBoundary:g=[],collisionPadding:v=0,sticky:y="partial",hideWhenDetached:E=!1,updatePositionStrategy:_="optimized",onPlaced:k,...w}=r,j=ig(du,l),[b,C]=h.useState(null),N=Ke(a,De=>C(De)),[A,$]=h.useState(null),V=Zd(A),R=(V==null?void 0:V.width)??0,T=(V==null?void 0:V.height)??0,F=o+(u!=="center"?"-"+u:""),Y=typeof v=="number"?v:{top:0,right:0,bottom:0,left:0,...v},K=Array.isArray(g)?g:[g],J=K.length>0,ce={padding:Y,boundary:K.filter(LS),altBoundary:J},{refs:X,floatingStyles:le,placement:ee,isPositioned:q,middlewareData:I}=NS({strategy:"fixed",placement:F,whileElementsMounted:(...De)=>uS(...De,{animationFrame:_==="always"}),elements:{reference:j.anchor},middleware:[wS({mainAxis:c+T,alignmentAxis:f}),x&&SS({mainAxis:!0,crossAxis:!1,limiter:y==="partial"?CS():void 0,...ce}),x&&kS({...ce}),ES({...ce,apply:({elements:De,rects:Fe,availableWidth:Qe,availableHeight:st})=>{const{width:et,height:At}=Fe.reference,Mt=De.floating.style;Mt.setProperty("--radix-popper-available-width",`${Qe}px`),Mt.setProperty("--radix-popper-available-height",`${st}px`),Mt.setProperty("--radix-popper-anchor-width",`${et}px`),Mt.setProperty("--radix-popper-anchor-height",`${At}px`)}}),A&&RS({element:A,padding:p}),OS({arrowWidth:R,arrowHeight:T}),E&&PS({strategy:"referenceHidden",...ce})]}),[Q,B]=mg(ee),D=Cr(k);Rt(()=>{q&&(D==null||D())},[q,D]);const P=(se=I.arrow)==null?void 0:se.x,W=(pe=I.arrow)==null?void 0:pe.y,re=((L=I.arrow)==null?void 0:L.centerOffset)!==0,[he,me]=h.useState();return Rt(()=>{b&&me(window.getComputedStyle(b).zIndex)},[b]),t.jsx("div",{ref:X.setFloating,"data-radix-popper-content-wrapper":"",style:{...le,transform:q?le.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:he,"--radix-popper-transform-origin":[(ue=I.transformOrigin)==null?void 0:ue.x,(xe=I.transformOrigin)==null?void 0:xe.y].join(" "),...((Re=I.hide)==null?void 0:Re.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:r.dir,children:t.jsx(AS,{scope:l,placedSide:Q,onArrowChange:$,arrowX:P,arrowY:W,shouldHideArrow:re,children:t.jsx(Oe.div,{"data-side":Q,"data-align":B,...w,ref:N,style:{...w.style,animation:q?void 0:"none"}})})})});ug.displayName=du;var fg="PopperArrow",DS={top:"bottom",right:"left",bottom:"top",left:"right"},hg=h.forwardRef(function(a,l){const{__scopePopper:o,...c}=a,u=MS(fg,o),f=DS[u.placedSide];return t.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:t.jsx(TS,{...c,ref:l,style:{...c.style,display:"block"}})})});hg.displayName=fg;function LS(r){return r!==null}var OS=r=>({name:"transformOrigin",options:r,fn(a){var j,b,C;const{placement:l,rects:o,middlewareData:c}=a,f=((j=c.arrow)==null?void 0:j.centerOffset)!==0,p=f?0:r.arrowWidth,x=f?0:r.arrowHeight,[g,v]=mg(l),y={start:"0%",center:"50%",end:"100%"}[v],E=(((b=c.arrow)==null?void 0:b.x)??0)+p/2,_=(((C=c.arrow)==null?void 0:C.y)??0)+x/2;let k="",w="";return g==="bottom"?(k=f?y:`${E}px`,w=`${-x}px`):g==="top"?(k=f?y:`${E}px`,w=`${o.floating.height+x}px`):g==="right"?(k=`${-x}px`,w=f?y:`${_}px`):g==="left"&&(k=`${o.floating.width+x}px`,w=f?y:`${_}px`),{data:{x:k,y:w}}}});function mg(r){const[a,l="center"]=r.split("-");return[a,l]}var FS=og,zS=dg,$S=ug,BS=hg,pg=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"}),US="VisuallyHidden",VS=h.forwardRef((r,a)=>t.jsx(Oe.span,{...r,ref:a,style:{...pg,...r.style}}));VS.displayName=US;var WS=[" ","Enter","ArrowUp","ArrowDown"],HS=[" ","Enter"],ts="Select",[Yi,Qi,KS]=eu(ts),[Ks]=Rr(ts,[KS,lg]),qi=lg(),[GS,_r]=Ks(ts),[YS,QS]=Ks(ts),xg=r=>{const{__scopeSelect:a,children:l,open:o,defaultOpen:c,onOpenChange:u,value:f,defaultValue:p,onValueChange:x,dir:g,name:v,autoComplete:y,disabled:E,required:_,form:k}=r,w=qi(a),[j,b]=h.useState(null),[C,N]=h.useState(null),[A,$]=h.useState(!1),V=Bi(g),[R,T]=Jr({prop:o,defaultProp:c??!1,onChange:u,caller:ts}),[F,Y]=Jr({prop:f,defaultProp:p,onChange:x,caller:ts}),K=h.useRef(null),J=j?k||!!j.closest("form"):!0,[ce,X]=h.useState(new Set),le=Array.from(ce).map(ee=>ee.props.value).join(";");return t.jsx(FS,{...w,children:t.jsxs(GS,{required:_,scope:a,trigger:j,onTriggerChange:b,valueNode:C,onValueNodeChange:N,valueNodeHasChildren:A,onValueNodeHasChildrenChange:$,contentId:wr(),value:F,onValueChange:Y,open:R,onOpenChange:T,dir:V,triggerPointerDownPosRef:K,disabled:E,children:[t.jsx(Yi.Provider,{scope:a,children:t.jsx(YS,{scope:r.__scopeSelect,onNativeOptionAdd:h.useCallback(ee=>{X(q=>new Set(q).add(ee))},[]),onNativeOptionRemove:h.useCallback(ee=>{X(q=>{const I=new Set(q);return I.delete(ee),I})},[]),children:l})}),J?t.jsxs(Fg,{"aria-hidden":!0,required:_,tabIndex:-1,name:v,autoComplete:y,value:F,onChange:ee=>Y(ee.target.value),disabled:E,form:k,children:[F===void 0?t.jsx("option",{value:""}):null,Array.from(ce)]},le):null]})})};xg.displayName=ts;var gg="SelectTrigger",vg=h.forwardRef((r,a)=>{const{__scopeSelect:l,disabled:o=!1,...c}=r,u=qi(l),f=_r(gg,l),p=f.disabled||o,x=Ke(a,f.onTriggerChange),g=Qi(l),v=h.useRef("touch"),[y,E,_]=$g(w=>{const j=g().filter(N=>!N.disabled),b=j.find(N=>N.value===f.value),C=Bg(j,w,b);C!==void 0&&f.onValueChange(C.value)}),k=w=>{p||(f.onOpenChange(!0),_()),w&&(f.triggerPointerDownPosRef.current={x:Math.round(w.pageX),y:Math.round(w.pageY)})};return t.jsx(zS,{asChild:!0,...u,children:t.jsx(Oe.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:p,"data-disabled":p?"":void 0,"data-placeholder":zg(f.value)?"":void 0,...c,ref:x,onClick:Ae(c.onClick,w=>{w.currentTarget.focus(),v.current!=="mouse"&&k(w)}),onPointerDown:Ae(c.onPointerDown,w=>{v.current=w.pointerType;const j=w.target;j.hasPointerCapture(w.pointerId)&&j.releasePointerCapture(w.pointerId),w.button===0&&w.ctrlKey===!1&&w.pointerType==="mouse"&&(k(w),w.preventDefault())}),onKeyDown:Ae(c.onKeyDown,w=>{const j=y.current!=="";!(w.ctrlKey||w.altKey||w.metaKey)&&w.key.length===1&&E(w.key),!(j&&w.key===" ")&&WS.includes(w.key)&&(k(),w.preventDefault())})})})});vg.displayName=gg;var yg="SelectValue",jg=h.forwardRef((r,a)=>{const{__scopeSelect:l,className:o,style:c,children:u,placeholder:f="",...p}=r,x=_r(yg,l),{onValueNodeHasChildrenChange:g}=x,v=u!==void 0,y=Ke(a,x.onValueNodeChange);return Rt(()=>{g(v)},[g,v]),t.jsx(Oe.span,{...p,ref:y,style:{pointerEvents:"none"},children:zg(x.value)?t.jsx(t.Fragment,{children:f}):u})});jg.displayName=yg;var qS="SelectIcon",Ng=h.forwardRef((r,a)=>{const{__scopeSelect:l,children:o,...c}=r;return t.jsx(Oe.span,{"aria-hidden":!0,...c,ref:a,children:o||"▼"})});Ng.displayName=qS;var XS="SelectPortal",bg=r=>t.jsx(Kd,{asChild:!0,...r});bg.displayName=XS;var ns="SelectContent",wg=h.forwardRef((r,a)=>{const l=_r(ns,r.__scopeSelect),[o,c]=h.useState();if(Rt(()=>{c(new DocumentFragment)},[]),!l.open){const u=o;return u?Ua.createPortal(t.jsx(Sg,{scope:r.__scopeSelect,children:t.jsx(Yi.Slot,{scope:r.__scopeSelect,children:t.jsx("div",{children:r.children})})}),u):null}return t.jsx(Cg,{...r,ref:a})});wg.displayName=ns;var gn=10,[Sg,Tr]=Ks(ns),JS="SelectContentImpl",ZS=$a("SelectContent.RemoveScroll"),Cg=h.forwardRef((r,a)=>{const{__scopeSelect:l,position:o="item-aligned",onCloseAutoFocus:c,onEscapeKeyDown:u,onPointerDownOutside:f,side:p,sideOffset:x,align:g,alignOffset:v,arrowPadding:y,collisionBoundary:E,collisionPadding:_,sticky:k,hideWhenDetached:w,avoidCollisions:j,...b}=r,C=_r(ns,l),[N,A]=h.useState(null),[$,V]=h.useState(null),R=Ke(a,se=>A(se)),[T,F]=h.useState(null),[Y,K]=h.useState(null),J=Qi(l),[ce,X]=h.useState(!1),le=h.useRef(!1);h.useEffect(()=>{if(N)return rx(N)},[N]),Yp();const ee=h.useCallback(se=>{const[pe,...L]=J().map(Re=>Re.ref.current),[ue]=L.slice(-1),xe=document.activeElement;for(const Re of se)if(Re===xe||(Re==null||Re.scrollIntoView({block:"nearest"}),Re===pe&&$&&($.scrollTop=0),Re===ue&&$&&($.scrollTop=$.scrollHeight),Re==null||Re.focus(),document.activeElement!==xe))return},[J,$]),q=h.useCallback(()=>ee([T,N]),[ee,T,N]);h.useEffect(()=>{ce&&q()},[ce,q]);const{onOpenChange:I,triggerPointerDownPosRef:Q}=C;h.useEffect(()=>{if(N){let se={x:0,y:0};const pe=ue=>{var xe,Re;se={x:Math.abs(Math.round(ue.pageX)-(((xe=Q.current)==null?void 0:xe.x)??0)),y:Math.abs(Math.round(ue.pageY)-(((Re=Q.current)==null?void 0:Re.y)??0))}},L=ue=>{se.x<=10&&se.y<=10?ue.preventDefault():N.contains(ue.target)||I(!1),document.removeEventListener("pointermove",pe),Q.current=null};return Q.current!==null&&(document.addEventListener("pointermove",pe),document.addEventListener("pointerup",L,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",pe),document.removeEventListener("pointerup",L,{capture:!0})}}},[N,I,Q]),h.useEffect(()=>{const se=()=>I(!1);return window.addEventListener("blur",se),window.addEventListener("resize",se),()=>{window.removeEventListener("blur",se),window.removeEventListener("resize",se)}},[I]);const[B,D]=$g(se=>{const pe=J().filter(xe=>!xe.disabled),L=pe.find(xe=>xe.ref.current===document.activeElement),ue=Bg(pe,se,L);ue&&setTimeout(()=>ue.ref.current.focus())}),P=h.useCallback((se,pe,L)=>{const ue=!le.current&&!L;(C.value!==void 0&&C.value===pe||ue)&&(F(se),ue&&(le.current=!0))},[C.value]),W=h.useCallback(()=>N==null?void 0:N.focus(),[N]),re=h.useCallback((se,pe,L)=>{const ue=!le.current&&!L;(C.value!==void 0&&C.value===pe||ue)&&K(se)},[C.value]),he=o==="popper"?Cd:kg,me=he===Cd?{side:p,sideOffset:x,align:g,alignOffset:v,arrowPadding:y,collisionBoundary:E,collisionPadding:_,sticky:k,hideWhenDetached:w,avoidCollisions:j}:{};return t.jsx(Sg,{scope:l,content:N,viewport:$,onViewportChange:V,itemRefCallback:P,selectedItem:T,onItemLeave:W,itemTextRefCallback:re,focusSelectedItem:q,selectedItemText:Y,position:o,isPositioned:ce,searchRef:B,children:t.jsx(Gd,{as:ZS,allowPinchZoom:!0,children:t.jsx(Hd,{asChild:!0,trapped:C.open,onMountAutoFocus:se=>{se.preventDefault()},onUnmountAutoFocus:Ae(c,se=>{var pe;(pe=C.trigger)==null||pe.focus({preventScroll:!0}),se.preventDefault()}),children:t.jsx(Wd,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:u,onPointerDownOutside:f,onFocusOutside:se=>se.preventDefault(),onDismiss:()=>C.onOpenChange(!1),children:t.jsx(he,{role:"listbox",id:C.contentId,"data-state":C.open?"open":"closed",dir:C.dir,onContextMenu:se=>se.preventDefault(),...b,...me,onPlaced:()=>X(!0),ref:R,style:{display:"flex",flexDirection:"column",outline:"none",...b.style},onKeyDown:Ae(b.onKeyDown,se=>{const pe=se.ctrlKey||se.altKey||se.metaKey;if(se.key==="Tab"&&se.preventDefault(),!pe&&se.key.length===1&&D(se.key),["ArrowUp","ArrowDown","Home","End"].includes(se.key)){let ue=J().filter(xe=>!xe.disabled).map(xe=>xe.ref.current);if(["ArrowUp","End"].includes(se.key)&&(ue=ue.slice().reverse()),["ArrowUp","ArrowDown"].includes(se.key)){const xe=se.target,Re=ue.indexOf(xe);ue=ue.slice(Re+1)}setTimeout(()=>ee(ue)),se.preventDefault()}})})})})})})});Cg.displayName=JS;var eC="SelectItemAlignedPosition",kg=h.forwardRef((r,a)=>{const{__scopeSelect:l,onPlaced:o,...c}=r,u=_r(ns,l),f=Tr(ns,l),[p,x]=h.useState(null),[g,v]=h.useState(null),y=Ke(a,R=>v(R)),E=Qi(l),_=h.useRef(!1),k=h.useRef(!0),{viewport:w,selectedItem:j,selectedItemText:b,focusSelectedItem:C}=f,N=h.useCallback(()=>{if(u.trigger&&u.valueNode&&p&&g&&w&&j&&b){const R=u.trigger.getBoundingClientRect(),T=g.getBoundingClientRect(),F=u.valueNode.getBoundingClientRect(),Y=b.getBoundingClientRect();if(u.dir!=="rtl"){const xe=Y.left-T.left,Re=F.left-xe,De=R.left-Re,Fe=R.width+De,Qe=Math.max(Fe,T.width),st=window.innerWidth-gn,et=ki(Re,[gn,Math.max(gn,st-Qe)]);p.style.minWidth=Fe+"px",p.style.left=et+"px"}else{const xe=T.right-Y.right,Re=window.innerWidth-F.right-xe,De=window.innerWidth-R.right-Re,Fe=R.width+De,Qe=Math.max(Fe,T.width),st=window.innerWidth-gn,et=ki(Re,[gn,Math.max(gn,st-Qe)]);p.style.minWidth=Fe+"px",p.style.right=et+"px"}const K=E(),J=window.innerHeight-gn*2,ce=w.scrollHeight,X=window.getComputedStyle(g),le=parseInt(X.borderTopWidth,10),ee=parseInt(X.paddingTop,10),q=parseInt(X.borderBottomWidth,10),I=parseInt(X.paddingBottom,10),Q=le+ee+ce+I+q,B=Math.min(j.offsetHeight*5,Q),D=window.getComputedStyle(w),P=parseInt(D.paddingTop,10),W=parseInt(D.paddingBottom,10),re=R.top+R.height/2-gn,he=J-re,me=j.offsetHeight/2,se=j.offsetTop+me,pe=le+ee+se,L=Q-pe;if(pe<=re){const xe=K.length>0&&j===K[K.length-1].ref.current;p.style.bottom="0px";const Re=g.clientHeight-w.offsetTop-w.offsetHeight,De=Math.max(he,me+(xe?W:0)+Re+q),Fe=pe+De;p.style.height=Fe+"px"}else{const xe=K.length>0&&j===K[0].ref.current;p.style.top="0px";const De=Math.max(re,le+w.offsetTop+(xe?P:0)+me)+L;p.style.height=De+"px",w.scrollTop=pe-re+w.offsetTop}p.style.margin=`${gn}px 0`,p.style.minHeight=B+"px",p.style.maxHeight=J+"px",o==null||o(),requestAnimationFrame(()=>_.current=!0)}},[E,u.trigger,u.valueNode,p,g,w,j,b,u.dir,o]);Rt(()=>N(),[N]);const[A,$]=h.useState();Rt(()=>{g&&$(window.getComputedStyle(g).zIndex)},[g]);const V=h.useCallback(R=>{R&&k.current===!0&&(N(),C==null||C(),k.current=!1)},[N,C]);return t.jsx(nC,{scope:l,contentWrapper:p,shouldExpandOnScrollRef:_,onScrollButtonChange:V,children:t.jsx("div",{ref:x,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:A},children:t.jsx(Oe.div,{...c,ref:y,style:{boxSizing:"border-box",maxHeight:"100%",...c.style}})})})});kg.displayName=eC;var tC="SelectPopperPosition",Cd=h.forwardRef((r,a)=>{const{__scopeSelect:l,align:o="start",collisionPadding:c=gn,...u}=r,f=qi(l);return t.jsx($S,{...f,...u,ref:a,align:o,collisionPadding:c,style:{boxSizing:"border-box",...u.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});Cd.displayName=tC;var[nC,uu]=Ks(ns,{}),kd="SelectViewport",Eg=h.forwardRef((r,a)=>{const{__scopeSelect:l,nonce:o,...c}=r,u=Tr(kd,l),f=uu(kd,l),p=Ke(a,u.onViewportChange),x=h.useRef(0);return t.jsxs(t.Fragment,{children:[t.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:o}),t.jsx(Yi.Slot,{scope:l,children:t.jsx(Oe.div,{"data-radix-select-viewport":"",role:"presentation",...c,ref:p,style:{position:"relative",flex:1,overflow:"hidden auto",...c.style},onScroll:Ae(c.onScroll,g=>{const v=g.currentTarget,{contentWrapper:y,shouldExpandOnScrollRef:E}=f;if(E!=null&&E.current&&y){const _=Math.abs(x.current-v.scrollTop);if(_>0){const k=window.innerHeight-gn*2,w=parseFloat(y.style.minHeight),j=parseFloat(y.style.height),b=Math.max(w,j);if(b0?A:0,y.style.justifyContent="flex-end")}}}x.current=v.scrollTop})})})]})});Eg.displayName=kd;var Pg="SelectGroup",[rC,sC]=Ks(Pg),aC=h.forwardRef((r,a)=>{const{__scopeSelect:l,...o}=r,c=wr();return t.jsx(rC,{scope:l,id:c,children:t.jsx(Oe.div,{role:"group","aria-labelledby":c,...o,ref:a})})});aC.displayName=Pg;var Rg="SelectLabel",lC=h.forwardRef((r,a)=>{const{__scopeSelect:l,...o}=r,c=sC(Rg,l);return t.jsx(Oe.div,{id:c.id,...o,ref:a})});lC.displayName=Rg;var Ti="SelectItem",[iC,_g]=Ks(Ti),Tg=h.forwardRef((r,a)=>{const{__scopeSelect:l,value:o,disabled:c=!1,textValue:u,...f}=r,p=_r(Ti,l),x=Tr(Ti,l),g=p.value===o,[v,y]=h.useState(u??""),[E,_]=h.useState(!1),k=Ke(a,C=>{var N;return(N=x.itemRefCallback)==null?void 0:N.call(x,C,o,c)}),w=wr(),j=h.useRef("touch"),b=()=>{c||(p.onValueChange(o),p.onOpenChange(!1))};if(o==="")throw new Error("A must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return t.jsx(iC,{scope:l,value:o,disabled:c,textId:w,isSelected:g,onItemTextChange:h.useCallback(C=>{y(N=>N||((C==null?void 0:C.textContent)??"").trim())},[]),children:t.jsx(Yi.ItemSlot,{scope:l,value:o,disabled:c,textValue:v,children:t.jsx(Oe.div,{role:"option","aria-labelledby":w,"data-highlighted":E?"":void 0,"aria-selected":g&&E,"data-state":g?"checked":"unchecked","aria-disabled":c||void 0,"data-disabled":c?"":void 0,tabIndex:c?void 0:-1,...f,ref:k,onFocus:Ae(f.onFocus,()=>_(!0)),onBlur:Ae(f.onBlur,()=>_(!1)),onClick:Ae(f.onClick,()=>{j.current!=="mouse"&&b()}),onPointerUp:Ae(f.onPointerUp,()=>{j.current==="mouse"&&b()}),onPointerDown:Ae(f.onPointerDown,C=>{j.current=C.pointerType}),onPointerMove:Ae(f.onPointerMove,C=>{var N;j.current=C.pointerType,c?(N=x.onItemLeave)==null||N.call(x):j.current==="mouse"&&C.currentTarget.focus({preventScroll:!0})}),onPointerLeave:Ae(f.onPointerLeave,C=>{var N;C.currentTarget===document.activeElement&&((N=x.onItemLeave)==null||N.call(x))}),onKeyDown:Ae(f.onKeyDown,C=>{var A;((A=x.searchRef)==null?void 0:A.current)!==""&&C.key===" "||(HS.includes(C.key)&&b(),C.key===" "&&C.preventDefault())})})})})});Tg.displayName=Ti;var La="SelectItemText",Ig=h.forwardRef((r,a)=>{const{__scopeSelect:l,className:o,style:c,...u}=r,f=_r(La,l),p=Tr(La,l),x=_g(La,l),g=QS(La,l),[v,y]=h.useState(null),E=Ke(a,b=>y(b),x.onItemTextChange,b=>{var C;return(C=p.itemTextRefCallback)==null?void 0:C.call(p,b,x.value,x.disabled)}),_=v==null?void 0:v.textContent,k=h.useMemo(()=>t.jsx("option",{value:x.value,disabled:x.disabled,children:_},x.value),[x.disabled,x.value,_]),{onNativeOptionAdd:w,onNativeOptionRemove:j}=g;return Rt(()=>(w(k),()=>j(k)),[w,j,k]),t.jsxs(t.Fragment,{children:[t.jsx(Oe.span,{id:x.textId,...u,ref:E}),x.isSelected&&f.valueNode&&!f.valueNodeHasChildren?Ua.createPortal(u.children,f.valueNode):null]})});Ig.displayName=La;var Ag="SelectItemIndicator",Mg=h.forwardRef((r,a)=>{const{__scopeSelect:l,...o}=r;return _g(Ag,l).isSelected?t.jsx(Oe.span,{"aria-hidden":!0,...o,ref:a}):null});Mg.displayName=Ag;var Ed="SelectScrollUpButton",Dg=h.forwardRef((r,a)=>{const l=Tr(Ed,r.__scopeSelect),o=uu(Ed,r.__scopeSelect),[c,u]=h.useState(!1),f=Ke(a,o.onScrollButtonChange);return Rt(()=>{if(l.viewport&&l.isPositioned){let p=function(){const g=x.scrollTop>0;u(g)};const x=l.viewport;return p(),x.addEventListener("scroll",p),()=>x.removeEventListener("scroll",p)}},[l.viewport,l.isPositioned]),c?t.jsx(Og,{...r,ref:f,onAutoScroll:()=>{const{viewport:p,selectedItem:x}=l;p&&x&&(p.scrollTop=p.scrollTop-x.offsetHeight)}}):null});Dg.displayName=Ed;var Pd="SelectScrollDownButton",Lg=h.forwardRef((r,a)=>{const l=Tr(Pd,r.__scopeSelect),o=uu(Pd,r.__scopeSelect),[c,u]=h.useState(!1),f=Ke(a,o.onScrollButtonChange);return Rt(()=>{if(l.viewport&&l.isPositioned){let p=function(){const g=x.scrollHeight-x.clientHeight,v=Math.ceil(x.scrollTop)x.removeEventListener("scroll",p)}},[l.viewport,l.isPositioned]),c?t.jsx(Og,{...r,ref:f,onAutoScroll:()=>{const{viewport:p,selectedItem:x}=l;p&&x&&(p.scrollTop=p.scrollTop+x.offsetHeight)}}):null});Lg.displayName=Pd;var Og=h.forwardRef((r,a)=>{const{__scopeSelect:l,onAutoScroll:o,...c}=r,u=Tr("SelectScrollButton",l),f=h.useRef(null),p=Qi(l),x=h.useCallback(()=>{f.current!==null&&(window.clearInterval(f.current),f.current=null)},[]);return h.useEffect(()=>()=>x(),[x]),Rt(()=>{var v;const g=p().find(y=>y.ref.current===document.activeElement);(v=g==null?void 0:g.ref.current)==null||v.scrollIntoView({block:"nearest"})},[p]),t.jsx(Oe.div,{"aria-hidden":!0,...c,ref:a,style:{flexShrink:0,...c.style},onPointerDown:Ae(c.onPointerDown,()=>{f.current===null&&(f.current=window.setInterval(o,50))}),onPointerMove:Ae(c.onPointerMove,()=>{var g;(g=u.onItemLeave)==null||g.call(u),f.current===null&&(f.current=window.setInterval(o,50))}),onPointerLeave:Ae(c.onPointerLeave,()=>{x()})})}),oC="SelectSeparator",cC=h.forwardRef((r,a)=>{const{__scopeSelect:l,...o}=r;return t.jsx(Oe.div,{"aria-hidden":!0,...o,ref:a})});cC.displayName=oC;var Rd="SelectArrow",dC=h.forwardRef((r,a)=>{const{__scopeSelect:l,...o}=r,c=qi(l),u=_r(Rd,l),f=Tr(Rd,l);return u.open&&f.position==="popper"?t.jsx(BS,{...c,...o,ref:a}):null});dC.displayName=Rd;var uC="SelectBubbleInput",Fg=h.forwardRef(({__scopeSelect:r,value:a,...l},o)=>{const c=h.useRef(null),u=Ke(o,c),f=Jd(a);return h.useEffect(()=>{const p=c.current;if(!p)return;const x=window.HTMLSelectElement.prototype,v=Object.getOwnPropertyDescriptor(x,"value").set;if(f!==a&&v){const y=new Event("change",{bubbles:!0});v.call(p,a),p.dispatchEvent(y)}},[f,a]),t.jsx(Oe.select,{...l,style:{...pg,...l.style},ref:u,defaultValue:a})});Fg.displayName=uC;function zg(r){return r===""||r===void 0}function $g(r){const a=Cr(r),l=h.useRef(""),o=h.useRef(0),c=h.useCallback(f=>{const p=l.current+f;a(p),(function x(g){l.current=g,window.clearTimeout(o.current),g!==""&&(o.current=window.setTimeout(()=>x(""),1e3))})(p)},[a]),u=h.useCallback(()=>{l.current="",window.clearTimeout(o.current)},[]);return h.useEffect(()=>()=>window.clearTimeout(o.current),[]),[l,c,u]}function Bg(r,a,l){const c=a.length>1&&Array.from(a).every(g=>g===a[0])?a[0]:a,u=l?r.indexOf(l):-1;let f=fC(r,Math.max(u,0));c.length===1&&(f=f.filter(g=>g!==l));const x=f.find(g=>g.textValue.toLowerCase().startsWith(c.toLowerCase()));return x!==l?x:void 0}function fC(r,a){return r.map((l,o)=>r[(a+o)%r.length])}var hC=xg,Ug=vg,mC=jg,pC=Ng,xC=bg,Vg=wg,gC=Eg,Wg=Tg,vC=Ig,yC=Mg,jC=Dg,NC=Lg;const id=hC,od=mC,xi=h.forwardRef(({className:r,children:a,...l},o)=>t.jsxs(Ug,{ref:o,className:Ge("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,t.jsx(pC,{asChild:!0,children:t.jsx(Di,{className:"h-4 w-4 opacity-50"})})]}));xi.displayName=Ug.displayName;const gi=h.forwardRef(({className:r,children:a,position:l="popper",...o},c)=>t.jsx(xC,{children:t.jsxs(Vg,{ref:c,className:Ge("relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md",l==="popper"&&"data-[side=bottom]:translate-y-1",r),position:l,...o,children:[t.jsx(jC,{className:"flex cursor-default items-center justify-center py-1",children:t.jsx(Np,{className:"h-4 w-4"})}),t.jsx(gC,{className:"p-1",children:a}),t.jsx(NC,{className:"flex cursor-default items-center justify-center py-1",children:t.jsx(Di,{className:"h-4 w-4"})})]})}));gi.displayName=Vg.displayName;const jr=h.forwardRef(({className:r,children:a,...l},o)=>t.jsxs(Wg,{ref:o,className:Ge("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:[t.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:t.jsx(yC,{children:t.jsx(Mi,{className:"h-4 w-4"})})}),t.jsx(vC,{children:a})]}));jr.displayName=Wg.displayName;const bC=["一","二","三","四","五","六","七","八","九","十"],wC=["序言","尾声","附录"];function ui(r){return r?wC.some(a=>r.includes(a)):!1}function cd(r){return r.startsWith("part:")?{type:"part",id:r.slice(5)}:r.startsWith("chapter:")?{type:"chapter",id:r.slice(8)}:r.startsWith("section:")?{type:"section",id:r.slice(8)}:null}function SC({parts:r,expandedParts:a,onTogglePart:l,onReorder:o,onReadSection:c,onDeleteSection:u}){const[f,p]=h.useState(null),[x,g]=h.useState(null),v=(j,b)=>(f==null?void 0:f.type)===j&&(f==null?void 0:f.id)===b,y=(j,b)=>(x==null?void 0:x.type)===j&&(x==null?void 0:x.id)===b,E=h.useCallback(()=>{const j=[];for(const b of r)for(const C of b.chapters)for(const N of C.sections)j.push({id:N.id,partId:b.id,partTitle:b.title,chapterId:C.id,chapterTitle:C.title});return j},[r]),_=h.useCallback(async(j,b,C,N)=>{var T;j.preventDefault(),j.stopPropagation();const A=j.dataTransfer.getData("text/plain"),$=cd(A);if(!$||$.type===b&&$.id===C)return;const V=E(),R=new Map(V.map(F=>[F.id,F]));if($.type==="section"){const F=R.get($.id);if(F&&ui(F.partTitle))return}else{const F=$.type==="part"?r.find(Y=>Y.id===$.id):r.find(Y=>Y.chapters.some(K=>K.id===$.id));if(F&&ui(F.title))return}if(!(N&&ui(N.partTitle))){if(b==="part"){const F=r.find(Y=>Y.id===C);if(F&&ui(F.title))return}if($.type==="part"&&b==="part"){const F=r.map(X=>X.id),Y=F.indexOf($.id),K=F.indexOf(C);if(Y===-1||K===-1)return;const J=[...F];J.splice(Y,1),J.splice(Yee.id===X);if(le)for(const ee of le.chapters)for(const q of ee.sections){const I=R.get(q.id);I&&ce.push(I)}}await o(ce);return}if($.type==="chapter"&&(b==="chapter"||b==="section"||b==="part")){const F=r.find(I=>I.chapters.some(Q=>Q.id===$.id)),Y=F==null?void 0:F.chapters.find(I=>I.id===$.id);if(!F||!Y)return;let K,J,ce=null;if(b==="section"){const I=R.get(C);if(!I)return;K=I.partId,J=I.partTitle,ce=C}else if(b==="chapter"){const I=r.find(D=>D.chapters.some(P=>P.id===C)),Q=I==null?void 0:I.chapters.find(D=>D.id===C);if(!I||!Q)return;K=I.id,J=I.title;const B=V.filter(D=>D.chapterId===C).pop();ce=(B==null?void 0:B.id)??null}else{const I=r.find(B=>B.id===C);if(!I||!I.chapters[0])return;K=I.id,J=I.title;const Q=V.filter(B=>B.partId===I.id&&B.chapterId===I.chapters[0].id);ce=((T=Q[Q.length-1])==null?void 0:T.id)??null}const X=Y.sections.map(I=>I.id),le=V.filter(I=>!X.includes(I.id));let ee=le.length;if(ce){const I=le.findIndex(Q=>Q.id===ce);I>=0&&(ee=I+1)}const q=X.map(I=>({...R.get(I),partId:K,partTitle:J,chapterId:Y.id,chapterTitle:Y.title}));await o([...le.slice(0,ee),...q,...le.slice(ee)]);return}if($.type==="section"&&(b==="section"||b==="chapter"||b==="part")){if(!N)return;const{partId:F,partTitle:Y,chapterId:K,chapterTitle:J}=N;let ce;if(b==="section")ce=V.findIndex(Q=>Q.id===C);else if(b==="chapter"){const Q=V.filter(B=>B.chapterId===C).pop();ce=Q?V.findIndex(B=>B.id===Q.id)+1:V.length}else{const Q=r.find(P=>P.id===C);if(!(Q!=null&&Q.chapters[0]))return;const B=V.filter(P=>P.partId===Q.id&&P.chapterId===Q.chapters[0].id),D=B[B.length-1];ce=D?V.findIndex(P=>P.id===D.id)+1:0}const X=V.findIndex(Q=>Q.id===$.id);if(X===-1)return;const le=V.filter(Q=>Q.id!==$.id),ee=X({onDragEnter:N=>{N.preventDefault(),N.stopPropagation(),N.dataTransfer.dropEffect="move",g({type:j,id:b})},onDragOver:N=>{N.preventDefault(),N.stopPropagation(),N.dataTransfer.dropEffect="move",g({type:j,id:b})},onDragLeave:()=>g(null),onDrop:N=>{g(null);const A=cd(N.dataTransfer.getData("text/plain"));if(A&&!(j==="section"&&A.type==="section"&&A.id===b))if(j==="part")if(A.type==="part")_(N,"part",b);else{const $=r.find(R=>R.id===b);($==null?void 0:$.chapters[0])&&C&&_(N,"part",b,C)}else j==="chapter"&&C?(A.type==="section"||A.type==="chapter")&&_(N,"chapter",b,C):j==="section"&&C&&_(N,"section",b,C)}}),w=j=>bC[j]??String(j+1);return t.jsx("div",{className:"space-y-3",children:r.map((j,b)=>{var F,Y;const C=j.title==="序言"||j.title.includes("序言"),N=j.title==="尾声"||j.title.includes("尾声"),A=j.title==="附录"||j.title.includes("附录"),$=a.includes(j.id),V=j.chapters.length,R=j.chapters.reduce((K,J)=>K+J.sections.length,0);if(C&&j.chapters.length===1&&j.chapters[0].sections.length===1){const K=j.chapters[0].sections[0];return t.jsxs("div",{className:"rounded-xl border border-gray-700/50 bg-[#1C1C1E] p-4 flex items-center justify-between hover:border-[#38bdac]/30 transition-colors",children:[t.jsxs("div",{className:"flex items-center gap-3 flex-1 min-w-0 select-none",children:[t.jsx("div",{className:"w-8 h-8 rounded-lg bg-gray-600/50 flex items-center justify-center shrink-0",children:t.jsx(Wn,{className:"w-4 h-4 text-gray-400"})}),t.jsxs("span",{className:"font-medium text-gray-200 truncate",children:[j.chapters[0].title," | ",K.title]})]}),t.jsxs("div",{className:"flex items-center gap-2 shrink-0",onMouseDown:J=>J.stopPropagation(),onClick:J=>J.stopPropagation(),children:[K.price===0||K.isFree?t.jsx("span",{className:"px-2 py-1 bg-[#38bdac]/20 text-[#38bdac] text-[10px] font-medium rounded",children:"免费"}):t.jsxs("span",{className:"text-xs text-gray-500",children:["¥",K.price]}),t.jsxs("div",{className:"flex gap-1",children:[t.jsx(oe,{draggable:!1,variant:"ghost",size:"sm",onClick:()=>c(K),className:"text-gray-500 hover:text-[#38bdac] h-7 px-2",children:t.jsx(Ms,{className:"w-3.5 h-3.5"})}),t.jsx(oe,{draggable:!1,variant:"ghost",size:"sm",onClick:()=>c(K),className:"text-gray-500 hover:text-[#38bdac] h-7 px-2",children:t.jsx(sn,{className:"w-3.5 h-3.5"})}),t.jsx(oe,{draggable:!1,variant:"ghost",size:"sm",onClick:()=>u(K),className:"text-gray-500 hover:text-red-400 h-7 px-2",children:t.jsx(Vn,{className:"w-3.5 h-3.5"})})]}),t.jsx(As,{className:"w-4 h-4 text-gray-500"})]})]},j.id)}if(A)return t.jsxs("div",{className:"rounded-xl border border-gray-700/50 bg-[#1C1C1E] p-5",children:[t.jsx("h3",{className:"text-sm font-medium text-gray-400 mb-4",children:"附录"}),t.jsx("div",{className:"space-y-3",children:j.chapters.map((K,J)=>t.jsxs("div",{className:"flex justify-between items-center py-2 select-none hover:bg-[#162840]/50 rounded px-2 -mx-2",children:[t.jsxs("span",{className:"text-sm text-gray-300",children:["附录",J+1," | ",K.title]}),t.jsx(As,{className:"w-4 h-4 text-gray-500 shrink-0"})]},K.id))})]},j.id);if(N&&j.chapters.length===1&&j.chapters[0].sections.length===1){const K=j.chapters[0].sections[0];return t.jsxs("div",{className:"rounded-xl border border-gray-700/50 bg-[#1C1C1E] p-4 flex items-center justify-between hover:border-[#38bdac]/30 transition-colors",children:[t.jsxs("div",{className:"flex items-center gap-3 flex-1 min-w-0 select-none",children:[t.jsx("div",{className:"w-8 h-8 rounded-lg bg-gray-600/50 flex items-center justify-center shrink-0",children:t.jsx(Wn,{className:"w-4 h-4 text-gray-400"})}),t.jsxs("span",{className:"font-medium text-gray-200 truncate",children:[j.chapters[0].title," | ",K.title]})]}),t.jsxs("div",{className:"flex items-center gap-2 shrink-0",onMouseDown:J=>J.stopPropagation(),onClick:J=>J.stopPropagation(),children:[K.price===0||K.isFree?t.jsx("span",{className:"px-2 py-1 bg-[#38bdac]/20 text-[#38bdac] text-[10px] font-medium rounded",children:"免费"}):t.jsxs("span",{className:"text-xs text-gray-500",children:["¥",K.price]}),t.jsxs("div",{className:"flex gap-1",children:[t.jsx(oe,{draggable:!1,variant:"ghost",size:"sm",onClick:()=>c(K),className:"text-gray-500 hover:text-[#38bdac] h-7 px-2",children:t.jsx(Ms,{className:"w-3.5 h-3.5"})}),t.jsx(oe,{draggable:!1,variant:"ghost",size:"sm",onClick:()=>c(K),className:"text-gray-500 hover:text-[#38bdac] h-7 px-2",children:t.jsx(sn,{className:"w-3.5 h-3.5"})}),t.jsx(oe,{draggable:!1,variant:"ghost",size:"sm",onClick:()=>u(K),className:"text-gray-500 hover:text-red-400 h-7 px-2",children:t.jsx(Vn,{className:"w-3.5 h-3.5"})})]}),t.jsx(As,{className:"w-4 h-4 text-gray-500"})]})]},j.id)}if(N)return t.jsxs("div",{className:"rounded-xl border border-gray-700/50 bg-[#1C1C1E] p-5",children:[t.jsx("h3",{className:"text-sm font-medium text-gray-400 mb-4",children:"尾声"}),t.jsx("div",{className:"space-y-3",children:j.chapters.map(K=>K.sections.map(J=>t.jsxs("div",{className:"flex justify-between items-center py-2 select-none hover:bg-[#162840]/50 rounded px-2 -mx-2",children:[t.jsxs("span",{className:"text-sm text-gray-300",children:[K.title," | ",J.title]}),t.jsxs("div",{className:"flex gap-1 shrink-0",children:[t.jsx(oe,{draggable:!1,variant:"ghost",size:"sm",onClick:()=>c(J),className:"text-gray-500 hover:text-[#38bdac] h-7 px-2",children:t.jsx(Ms,{className:"w-3.5 h-3.5"})}),t.jsx(oe,{draggable:!1,variant:"ghost",size:"sm",onClick:()=>c(J),className:"text-gray-500 hover:text-[#38bdac] h-7 px-2",children:t.jsx(sn,{className:"w-3.5 h-3.5"})}),t.jsx(oe,{draggable:!1,variant:"ghost",size:"sm",onClick:()=>u(J),className:"text-gray-500 hover:text-red-400 h-7 px-2",children:t.jsx(Vn,{className:"w-3.5 h-3.5"})})]})]},J.id)))})]},j.id);const T=y("part",j.id);return t.jsxs("div",{className:`rounded-xl border bg-[#1C1C1E] overflow-hidden transition-all duration-200 ${T?"border-[#38bdac] ring-2 ring-[#38bdac]/40 bg-[#38bdac]/5":"border-gray-700/50"}`,...k("part",j.id,{partId:j.id,partTitle:j.title,chapterId:((F=j.chapters[0])==null?void 0:F.id)??"",chapterTitle:((Y=j.chapters[0])==null?void 0:Y.title)??""}),children:[t.jsxs("div",{draggable:!0,onDragStart:K=>{K.stopPropagation(),K.dataTransfer.setData("text/plain","part:"+j.id),K.dataTransfer.effectAllowed="move",p({type:"part",id:j.id})},onDragEnd:()=>{p(null),g(null)},className:`flex items-center justify-between p-4 cursor-grab active:cursor-grabbing select-none transition-all duration-200 ${v("part",j.id)?"opacity-60 scale-[0.98] ring-2 ring-[#38bdac] rounded-xl shadow-xl shadow-[#38bdac]/20":"hover:bg-[#162840]/50"}`,onClick:()=>l(j.id),children:[t.jsxs("div",{className:"flex items-center gap-3 min-w-0",children:[t.jsx(Gc,{className:"w-5 h-5 text-gray-500 shrink-0 opacity-60"}),t.jsx("div",{className:"w-10 h-10 rounded-xl bg-[#38bdac] flex items-center justify-center text-white font-bold shadow-lg shadow-[#38bdac]/30 shrink-0",children:w(b)}),t.jsxs("div",{children:[t.jsx("h3",{className:"font-bold text-white text-base",children:j.title}),t.jsxs("p",{className:"text-xs text-gray-500 mt-0.5",children:["共 ",R," 节"]})]})]}),t.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[t.jsxs("span",{className:"text-xs text-gray-500",children:[V,"章"]}),$?t.jsx(Di,{className:"w-5 h-5 text-gray-500"}):t.jsx(As,{className:"w-5 h-5 text-gray-500"})]})]}),$&&t.jsx("div",{className:"border-t border-gray-700/50 pl-4 pr-4 pb-4 pt-3 space-y-4",children:j.chapters.map((K,J)=>{const ce=y("chapter",K.id);return t.jsxs("div",{className:"space-y-2",children:[t.jsxs("div",{draggable:!0,onDragStart:X=>{X.stopPropagation(),X.dataTransfer.setData("text/plain","chapter:"+K.id),X.dataTransfer.effectAllowed="move",p({type:"chapter",id:K.id})},onDragEnd:()=>{p(null),g(null)},onDragEnter:X=>{X.preventDefault(),X.stopPropagation(),X.dataTransfer.dropEffect="move",g({type:"chapter",id:K.id})},onDragOver:X=>{X.preventDefault(),X.stopPropagation(),X.dataTransfer.dropEffect="move",g({type:"chapter",id:K.id})},onDragLeave:()=>g(null),onDrop:X=>{g(null);const le=cd(X.dataTransfer.getData("text/plain"));if(!le)return;const ee={partId:j.id,partTitle:j.title,chapterId:K.id,chapterTitle:K.title};(le.type==="section"||le.type==="chapter")&&_(X,"chapter",K.id,ee)},className:`py-2 px-2 rounded cursor-grab active:cursor-grabbing select-none -mx-2 transition-all duration-200 flex items-center gap-2 ${ce?"bg-[#38bdac]/15 ring-1 ring-[#38bdac]/50":""} ${v("chapter",K.id)?"opacity-60 scale-[0.98] ring-2 ring-[#38bdac]":"hover:bg-[#162840]/30"}`,children:[t.jsx(Gc,{className:"w-4 h-4 text-gray-500 shrink-0 opacity-50"}),t.jsxs("p",{className:"text-xs text-gray-500 pb-1",children:["第",J+1,"章 | ",K.title]})]}),t.jsx("div",{className:"space-y-1 pl-2",children:K.sections.map(X=>{const le=y("section",X.id);return t.jsxs("div",{draggable:!0,onDragStart:ee=>{ee.stopPropagation(),ee.dataTransfer.setData("text/plain","section:"+X.id),ee.dataTransfer.effectAllowed="move",p({type:"section",id:X.id})},onDragEnd:()=>{p(null),g(null)},className:`flex items-center justify-between py-2 px-3 rounded-lg group cursor-grab active:cursor-grabbing select-none min-h-[40px] transition-all duration-200 ${le?"bg-[#38bdac]/15 ring-2 ring-[#38bdac]/50":""} ${v("section",X.id)?"opacity-60 scale-[0.98] ring-2 ring-[#38bdac] shadow-lg":"hover:bg-[#162840]/50"}`,...k("section",X.id,{partId:j.id,partTitle:j.title,chapterId:K.id,chapterTitle:K.title}),children:[t.jsxs("div",{className:"flex items-center gap-3 min-w-0 flex-1",children:[t.jsx(Gc,{className:"w-4 h-4 text-gray-500 shrink-0 opacity-50"}),t.jsx("div",{className:`w-2 h-2 rounded-full shrink-0 ${X.price===0||X.isFree?"border-2 border-[#38bdac] bg-transparent":"bg-gray-500"}`}),t.jsxs("span",{className:"text-sm text-gray-200 truncate",children:[X.id," ",X.title]})]}),t.jsxs("div",{className:"flex items-center gap-2 shrink-0",onMouseDown:ee=>ee.stopPropagation(),onClick:ee=>ee.stopPropagation(),children:[X.isNew&&t.jsx("span",{className:"px-2 py-1 bg-[#38bdac]/20 text-[#38bdac] text-[10px] font-medium rounded",children:"NEW"}),X.price===0||X.isFree?t.jsx("span",{className:"px-2 py-1 bg-[#38bdac]/20 text-[#38bdac] text-[10px] font-medium rounded",children:"免费"}):t.jsxs("span",{className:"text-xs text-gray-500",children:["¥",X.price]}),t.jsxs("div",{className:"flex gap-0.5 opacity-0 group-hover:opacity-100 transition-opacity",children:[t.jsx(oe,{draggable:!1,variant:"ghost",size:"sm",onClick:()=>c(X),className:"text-gray-500 hover:text-[#38bdac] h-7 px-1.5",children:t.jsx(Ms,{className:"w-3.5 h-3.5"})}),t.jsx(oe,{draggable:!1,variant:"ghost",size:"sm",onClick:()=>c(X),className:"text-gray-500 hover:text-[#38bdac] h-7 px-1.5",children:t.jsx(sn,{className:"w-3.5 h-3.5"})}),t.jsx(oe,{draggable:!1,variant:"ghost",size:"sm",onClick:()=>u(X),className:"text-gray-500 hover:text-red-400 h-7 px-1.5",children:t.jsx(Vn,{className:"w-3.5 h-3.5"})})]}),t.jsx(As,{className:"w-4 h-4 text-gray-500"})]})]},X.id)})})]},K.id)})})]},j.id)})})}function CC(r){const a=new Map;for(const c of r){const u=c.partId||"part-1",f=c.partTitle||"未分类",p=c.chapterId||"chapter-1",x=c.chapterTitle||"未分类";a.has(u)||a.set(u,{id:u,title:f,chapters:new Map});const g=a.get(u);g.chapters.has(p)||g.chapters.set(p,{id:p,title:x,sections:[]}),g.chapters.get(p).sections.push({id:c.id,title:c.title,price:c.price??1,filePath:c.filePath,isFree:c.isFree,isNew:c.isNew})}const l=Array.from(a.values()).map(c=>({...c,chapters:Array.from(c.chapters.values())})),o=c=>c.includes("序言")?0:c.includes("附录")?2:c.includes("尾声")?3:1;return l.sort((c,u)=>{const f=o(c.title),p=o(u.title);return f!==p?f-p:0})}function kC(){const[r,a]=h.useState([]),[l,o]=h.useState(!0),[c,u]=h.useState([]),[f,p]=h.useState(null),[x,g]=h.useState(!1),[v,y]=h.useState(!1),[E,_]=h.useState(!1),[k,w]=h.useState(""),[j,b]=h.useState([]),[C,N]=h.useState(!1),[A,$]=h.useState(!1),V=h.useRef(null),[R,T]=h.useState({id:"",title:"",price:1,partId:"part-1",chapterId:"chapter-1",content:""}),F=CC(r),Y=r.length,K=async()=>{o(!0);try{const P=await We("/api/db/book?action=list");a(Array.isArray(P==null?void 0:P.sections)?P.sections:[])}catch(P){console.error(P),a([])}finally{o(!1)}};h.useEffect(()=>{K()},[]);const J=P=>{u(W=>W.includes(P)?W.filter(re=>re!==P):[...W,P])},ce=h.useCallback(P=>{const W=r,re=P.flatMap(he=>{const me=W.find(se=>se.id===he.id);return me?[{...me,partId:he.partId,partTitle:he.partTitle,chapterId:he.chapterId,chapterTitle:he.chapterTitle}]:[]});return a(re),Pt("/api/db/book",{action:"reorder",items:P}).then(he=>{he&&he.success===!1&&(a(W),alert("排序失败: "+(he&&typeof he=="object"&&"error"in he?he.error:"未知错误")))}).catch(he=>{a(W),console.error("排序失败:",he),alert("排序失败: "+(he instanceof Error?he.message:"网络或服务异常"))}),Promise.resolve()},[r]),X=async P=>{if(confirm(`确定要删除章节「${P.title}」吗?此操作不可恢复。`))try{const W=await Wa(`/api/db/book?id=${encodeURIComponent(P.id)}`);W&&W.success!==!1?(alert("已删除"),K()):alert("删除失败: "+(W&&typeof W=="object"&&"error"in W?W.error:"未知错误"))}catch(W){console.error(W),alert("删除失败")}},le=async P=>{y(!0);try{const W=await We(`/api/db/book?action=read&id=${encodeURIComponent(P.id)}`);if(W!=null&&W.success&&W.section){const re=W.section;p({id:P.id,title:W.section.title??P.title,price:W.section.price??P.price,content:W.section.content??"",filePath:P.filePath,isFree:P.isFree||P.price===0,isNew:re.isNew??P.isNew})}else p({id:P.id,title:P.title,price:P.price,content:"",filePath:P.filePath,isFree:P.isFree,isNew:P.isNew}),W&&!W.success&&alert("无法读取文件内容: "+(W.error||"未知错误"))}catch(W){console.error(W),p({id:P.id,title:P.title,price:P.price,content:"",filePath:P.filePath,isFree:P.isFree})}finally{y(!1)}},ee=async()=>{var P;if(f){_(!0);try{let W=f.content||"";const re=[new RegExp(`^#+\\s*${f.id.replace(".","\\.")}\\s+.*$`,"gm"),new RegExp(`^#+\\s*${f.id.replace(".","\\.")}[::].*$`,"gm"),new RegExp(`^#\\s+.*${(P=f.title)==null?void 0:P.slice(0,10).replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}.*$`,"gm")];for(const me of re)W=W.replace(me,"");W=W.replace(/^\s*\n+/,"").trim();const he=await Pt("/api/db/book",{id:f.id,title:f.title,price:f.isFree?0:f.price,content:W,isFree:f.isFree||f.price===0,isNew:f.isNew,saveToFile:!0});he&&he.success!==!1?(alert(`已保存章节: ${f.title}`),p(null),K()):alert("保存失败: "+(he&&typeof he=="object"&&"error"in he?he.error:"未知错误"))}catch(W){console.error(W),alert("保存失败")}finally{_(!1)}}},q=async()=>{if(!R.id||!R.title){alert("请填写章节ID和标题");return}_(!0);try{const P=await Pt("/api/db/book",{id:R.id,title:R.title,price:R.price,content:R.content,partId:R.partId,chapterId:R.chapterId,saveToFile:!1});P&&P.success!==!1?(alert(`章节创建成功: ${R.title}`),g(!1),T({id:"",title:"",price:1,partId:"part-1",chapterId:"chapter-1",content:""}),K()):alert("创建失败: "+(P&&typeof P=="object"&&"error"in P?P.error:"未知错误"))}catch(P){console.error(P),alert("创建失败")}finally{_(!1)}},I=async P=>{var re,he;const W=(re=P.target.files)==null?void 0:re[0];if(W){$(!0);try{const me=new FormData;me.append("file",W),me.append("folder","book-images");const pe=await(await fetch(Fs("/api/upload"),{method:"POST",body:me,credentials:"include"})).json();if(pe!=null&&pe.success&&((he=pe==null?void 0:pe.data)!=null&&he.url)){const L=`![${W.name}](${pe.data.url})`;f&&p({...f,content:(f.content||"")+` + +`+L}),alert(`图片上传成功: ${pe.data.url}`)}else alert("上传失败: "+((pe==null?void 0:pe.error)||"未知错误"))}catch(me){console.error(me),alert("上传失败")}finally{$(!1),V.current&&(V.current.value="")}}},Q=async()=>{var P;if(k.trim()){N(!0);try{const W=await We(`/api/search?q=${encodeURIComponent(k)}`);W!=null&&W.success&&((P=W.data)!=null&&P.results)?b(W.data.results):(b([]),W&&!W.success&&alert("搜索失败: "+W.error))}catch(W){console.error(W),b([]),alert("搜索失败")}finally{N(!1)}}},B=F.find(P=>P.id===R.partId),D=(B==null?void 0:B.chapters)??[];return t.jsxs("div",{className:"p-8 w-full",children:[t.jsxs("div",{className:"flex justify-between items-center mb-8",children:[t.jsxs("div",{children:[t.jsx("h2",{className:"text-2xl font-bold text-white",children:"内容管理"}),t.jsxs("p",{className:"text-gray-400 mt-1",children:["共 ",F.length," 篇 · ",Y," 节内容"]})]}),t.jsx("div",{className:"flex gap-2",children:t.jsxs(oe,{onClick:()=>{const P=typeof window<"u"?`${window.location.origin}/api-doc`:"";P&&window.open(P,"_blank","noopener,noreferrer")},variant:"outline",className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:[t.jsx(Yr,{className:"w-4 h-4 mr-2"}),"API 接口"]})})]}),t.jsx(Bt,{open:x,onOpenChange:g,children:t.jsxs(It,{className:"bg-[#0f2137] border-gray-700 text-white max-w-2xl max-h-[90vh] overflow-y-auto",showCloseButton:!0,children:[t.jsx(Ut,{children:t.jsxs(Vt,{className:"text-white flex items-center gap-2",children:[t.jsx(Rn,{className:"w-5 h-5 text-[#38bdac]"}),"新建章节"]})}),t.jsxs("div",{className:"space-y-4 py-4",children:[t.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[t.jsxs("div",{className:"space-y-2",children:[t.jsx(Z,{className:"text-gray-300",children:"章节ID *"}),t.jsx(ne,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"如: 9.15",value:R.id,onChange:P=>T({...R,id:P.target.value})})]}),t.jsxs("div",{className:"space-y-2",children:[t.jsx(Z,{className:"text-gray-300",children:"价格 (元)"}),t.jsx(ne,{type:"number",className:"bg-[#0a1628] border-gray-700 text-white",value:R.price,onChange:P=>T({...R,price:Number(P.target.value)})})]})]}),t.jsxs("div",{className:"space-y-2",children:[t.jsx(Z,{className:"text-gray-300",children:"章节标题 *"}),t.jsx(ne,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"输入章节标题",value:R.title,onChange:P=>T({...R,title:P.target.value})})]}),t.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[t.jsxs("div",{className:"space-y-2",children:[t.jsx(Z,{className:"text-gray-300",children:"所属篇"}),t.jsxs(id,{value:R.partId,onValueChange:P=>T({...R,partId:P,chapterId:"chapter-1"}),children:[t.jsx(xi,{className:"bg-[#0a1628] border-gray-700 text-white",children:t.jsx(od,{})}),t.jsxs(gi,{className:"bg-[#0f2137] border-gray-700",children:[F.map(P=>t.jsx(jr,{value:P.id,className:"text-white hover:bg-[#38bdac]/20 focus:bg-[#38bdac]/20",children:P.title},P.id)),F.length===0&&t.jsx(jr,{value:"part-1",className:"text-white hover:bg-[#38bdac]/20 focus:bg-[#38bdac]/20",children:"默认篇"})]})]})]}),t.jsxs("div",{className:"space-y-2",children:[t.jsx(Z,{className:"text-gray-300",children:"所属章"}),t.jsxs(id,{value:R.chapterId,onValueChange:P=>T({...R,chapterId:P}),children:[t.jsx(xi,{className:"bg-[#0a1628] border-gray-700 text-white",children:t.jsx(od,{})}),t.jsxs(gi,{className:"bg-[#0f2137] border-gray-700",children:[D.map(P=>t.jsx(jr,{value:P.id,className:"text-white hover:bg-[#38bdac]/20 focus:bg-[#38bdac]/20",children:P.title},P.id)),D.length===0&&t.jsx(jr,{value:"chapter-1",className:"text-white hover:bg-[#38bdac]/20 focus:bg-[#38bdac]/20",children:"默认章"})]})]})]})]}),t.jsxs("div",{className:"space-y-2",children:[t.jsx(Z,{className:"text-gray-300",children:"内容 (Markdown格式)"}),t.jsx(Xr,{className:"bg-[#0a1628] border-gray-700 text-white min-h-[300px] font-mono text-sm placeholder:text-gray-500",placeholder:"输入章节内容...",value:R.content,onChange:P=>T({...R,content:P.target.value})})]})]}),t.jsxs(qt,{children:[t.jsx(oe,{variant:"outline",onClick:()=>g(!1),className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:"取消"}),t.jsx(oe,{onClick:q,disabled:E||!R.id||!R.title,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:E?t.jsxs(t.Fragment,{children:[t.jsx(Ze,{className:"w-4 h-4 mr-2 animate-spin"}),"创建中..."]}):t.jsxs(t.Fragment,{children:[t.jsx(Rn,{className:"w-4 h-4 mr-2"}),"创建章节"]})})]})]})}),t.jsx(Bt,{open:!!f,onOpenChange:()=>p(null),children:t.jsxs(It,{className:"bg-[#0f2137] border-gray-700 text-white max-w-4xl max-h-[90vh] overflow-y-auto",showCloseButton:!0,children:[t.jsx(Ut,{children:t.jsxs(Vt,{className:"text-white flex items-center gap-2",children:[t.jsx(sn,{className:"w-5 h-5 text-[#38bdac]"}),"编辑章节"]})}),f&&t.jsxs("div",{className:"space-y-4 py-4",children:[t.jsxs("div",{className:"grid grid-cols-3 gap-4",children:[t.jsxs("div",{className:"space-y-2",children:[t.jsx(Z,{className:"text-gray-300",children:"章节ID"}),t.jsx(ne,{className:"bg-[#0a1628] border-gray-700 text-white",value:f.id,disabled:!0})]}),t.jsxs("div",{className:"space-y-2",children:[t.jsx(Z,{className:"text-gray-300",children:"价格 (元)"}),t.jsx(ne,{type:"number",className:"bg-[#0a1628] border-gray-700 text-white",value:f.isFree?0:f.price,onChange:P=>p({...f,price:Number(P.target.value),isFree:Number(P.target.value)===0}),disabled:f.isFree})]}),t.jsxs("div",{className:"space-y-2",children:[t.jsx(Z,{className:"text-gray-300",children:"免费章节(唯一入口,小程序以 is_free 或 price=0 为准)"}),t.jsx("div",{className:"flex items-center h-10",children:t.jsxs("label",{className:"flex items-center cursor-pointer",children:[t.jsx("input",{type:"checkbox",checked:f.isFree||f.price===0,onChange:P=>p({...f,isFree:P.target.checked,price:P.target.checked?0:1}),className:"w-5 h-5 rounded border-gray-600 bg-[#0a1628] text-[#38bdac] focus:ring-[#38bdac]"}),t.jsx("span",{className:"ml-2 text-gray-400 text-sm",children:"设为免费"})]})})]}),t.jsxs("div",{className:"space-y-2",children:[t.jsx(Z,{className:"text-gray-300",children:"最新新增"}),t.jsx("div",{className:"flex items-center h-10",children:t.jsxs("label",{className:"flex items-center cursor-pointer",children:[t.jsx("input",{type:"checkbox",checked:f.isNew??!1,onChange:P=>p({...f,isNew:P.target.checked}),className:"w-5 h-5 rounded border-gray-600 bg-[#0a1628] text-[#38bdac] focus:ring-[#38bdac]"}),t.jsx("span",{className:"ml-2 text-gray-400 text-sm",children:"标记 NEW"})]})})]})]}),t.jsxs("div",{className:"space-y-2",children:[t.jsx(Z,{className:"text-gray-300",children:"章节标题"}),t.jsx(ne,{className:"bg-[#0a1628] border-gray-700 text-white",value:f.title,onChange:P=>p({...f,title:P.target.value})})]}),f.filePath&&t.jsxs("div",{className:"space-y-2",children:[t.jsx(Z,{className:"text-gray-300",children:"文件路径"}),t.jsx(ne,{className:"bg-[#0a1628] border-gray-700 text-gray-400 text-sm",value:f.filePath,disabled:!0})]}),t.jsxs("div",{className:"space-y-2",children:[t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsx(Z,{className:"text-gray-300",children:"内容 (Markdown格式)"}),t.jsxs("div",{className:"flex gap-2",children:[t.jsx("input",{ref:V,type:"file",accept:"image/*",onChange:I,className:"hidden"}),t.jsxs(oe,{variant:"outline",size:"sm",onClick:()=>{var P;return(P=V.current)==null?void 0:P.click()},disabled:A,className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:[A?t.jsx(Ze,{className:"w-4 h-4 mr-1 animate-spin"}):t.jsx(Cp,{className:"w-4 h-4 mr-1"}),"上传图片"]})]})]}),v?t.jsxs("div",{className:"bg-[#0a1628] border border-gray-700 rounded-md min-h-[400px] flex items-center justify-center",children:[t.jsx(Ze,{className:"w-6 h-6 text-[#38bdac] animate-spin"}),t.jsx("span",{className:"ml-2 text-gray-400",children:"加载中..."})]}):t.jsx(Xr,{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:P=>p({...f,content:P.target.value})})]})]}),t.jsxs(qt,{children:[t.jsxs(oe,{variant:"outline",onClick:()=>p(null),className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:[t.jsx(on,{className:"w-4 h-4 mr-2"}),"取消"]}),t.jsx(oe,{onClick:ee,disabled:E,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:E?t.jsxs(t.Fragment,{children:[t.jsx(Ze,{className:"w-4 h-4 mr-2 animate-spin"}),"保存中..."]}):t.jsxs(t.Fragment,{children:[t.jsx(Wt,{className:"w-4 h-4 mr-2"}),"保存修改"]})})]})]})}),t.jsxs(nu,{defaultValue:"chapters",className:"space-y-6",children:[t.jsxs(Vi,{className:"bg-[#0f2137] border border-gray-700/50 p-1",children:[t.jsxs(an,{value:"chapters",className:"data-[state=active]:bg-[#38bdac]/20 data-[state=active]:text-[#38bdac] text-gray-400",children:[t.jsx(Wn,{className:"w-4 h-4 mr-2"}),"章节管理"]}),t.jsxs(an,{value:"search",className:"data-[state=active]:bg-[#38bdac]/20 data-[state=active]:text-[#38bdac] text-gray-400",children:[t.jsx(Qr,{className:"w-4 h-4 mr-2"}),"内容搜索"]}),t.jsxs(an,{value:"hooks",className:"data-[state=active]:bg-[#38bdac]/20 data-[state=active]:text-[#38bdac] text-gray-400",children:[t.jsx(ON,{className:"w-4 h-4 mr-2"}),"钩子配置"]})]}),t.jsxs(ln,{value:"chapters",className:"space-y-4",children:[t.jsxs("div",{className:"rounded-2xl border border-gray-700/50 bg-[#1C1C1E] p-4 flex items-center justify-between shadow-sm",children:[t.jsxs("div",{className:"flex items-center gap-4",children:[t.jsx("div",{className:"w-12 h-12 rounded-xl bg-[#38bdac] flex items-center justify-center text-white shadow-lg shadow-[#38bdac]/20 shrink-0",children:t.jsx(Wn,{className:"w-6 h-6"})}),t.jsxs("div",{children:[t.jsx("h2",{className:"font-bold text-base text-white leading-tight mb-1",children:"一场SOUL的创业实验场"}),t.jsx("p",{className:"text-xs text-gray-500",children:"来自Soul派对房的真实商业故事"})]})]}),t.jsxs("div",{className:"text-center shrink-0",children:[t.jsx("span",{className:"block text-2xl font-bold text-[#38bdac]",children:Y}),t.jsx("span",{className:"text-xs text-gray-500",children:"章节"})]})]}),t.jsxs(oe,{onClick:()=>g(!0),className:"w-full bg-[#38bdac]/10 hover:bg-[#38bdac]/20 text-[#38bdac] border border-[#38bdac]/30",children:[t.jsx(Rn,{className:"w-4 h-4 mr-2"}),"新建章节"]}),l?t.jsxs("div",{className:"flex items-center justify-center py-12",children:[t.jsx(Ze,{className:"w-6 h-6 text-[#38bdac] animate-spin"}),t.jsx("span",{className:"ml-2 text-gray-400",children:"加载中..."})]}):t.jsx(SC,{parts:F,expandedParts:c,onTogglePart:J,onReorder:ce,onReadSection:le,onDeleteSection:X})]}),t.jsx(ln,{value:"search",className:"space-y-4",children:t.jsxs(ke,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:[t.jsx($e,{children:t.jsx(Be,{className:"text-white",children:"内容搜索"})}),t.jsxs(Ee,{className:"space-y-4",children:[t.jsxs("div",{className:"flex gap-2",children:[t.jsx(ne,{className:"bg-[#0a1628] border-gray-700 text-white placeholder:text-gray-500 flex-1",placeholder:"搜索标题或内容...",value:k,onChange:P=>w(P.target.value),onKeyDown:P=>P.key==="Enter"&&Q()}),t.jsx(oe,{onClick:Q,disabled:C||!k.trim(),className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:C?t.jsx(Ze,{className:"w-4 h-4 animate-spin"}):t.jsx(Qr,{className:"w-4 h-4"})})]}),j.length>0&&t.jsxs("div",{className:"space-y-2 mt-4",children:[t.jsxs("p",{className:"text-gray-400 text-sm",children:["找到 ",j.length," 个结果"]}),j.map(P=>t.jsxs("div",{className:"p-3 rounded-lg bg-[#162840] hover:bg-[#1a3050] cursor-pointer transition-colors",onClick:()=>le({id:P.id,title:P.title,price:P.price??1,filePath:""}),children:[t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsxs("div",{children:[t.jsx("span",{className:"text-[#38bdac] font-mono text-xs mr-2",children:P.id}),t.jsx("span",{className:"text-white",children:P.title})]}),t.jsx(Me,{variant:"outline",className:"text-gray-400 border-gray-600 text-xs",children:P.matchType==="title"?"标题匹配":"内容匹配"})]}),P.snippet&&t.jsx("p",{className:"text-gray-500 text-xs mt-2 line-clamp-2",children:P.snippet}),(P.partTitle||P.chapterTitle)&&t.jsxs("p",{className:"text-gray-600 text-xs mt-1",children:[P.partTitle," · ",P.chapterTitle]})]},P.id))]})]})]})}),t.jsx(ln,{value:"hooks",className:"space-y-4",children:t.jsxs(ke,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:[t.jsx($e,{children:t.jsx(Be,{className:"text-white",children:"引流钩子配置"})}),t.jsxs(Ee,{className:"space-y-4",children:[t.jsxs("div",{className:"grid w-full max-w-sm items-center gap-1.5",children:[t.jsx(Z,{htmlFor:"hook-chapter",className:"text-gray-300",children:"触发章节"}),t.jsxs(id,{defaultValue:"3",children:[t.jsx(xi,{id:"hook-chapter",className:"bg-[#0a1628] border-gray-700 text-white",children:t.jsx(od,{placeholder:"选择章节"})}),t.jsxs(gi,{className:"bg-[#0f2137] border-gray-700",children:[t.jsx(jr,{value:"1",className:"text-white hover:bg-[#38bdac]/20 focus:bg-[#38bdac]/20",children:"第一章"}),t.jsx(jr,{value:"2",className:"text-white hover:bg-[#38bdac]/20 focus:bg-[#38bdac]/20",children:"第二章"}),t.jsx(jr,{value:"3",className:"text-white hover:bg-[#38bdac]/20 focus:bg-[#38bdac]/20",children:"第三章 (默认)"})]})]})]}),t.jsxs("div",{className:"grid w-full gap-1.5",children:[t.jsx(Z,{htmlFor:"message",className:"text-gray-300",children:"引流文案"}),t.jsx(Xr,{placeholder:"输入引导用户加群的文案...",id:"message",className:"bg-[#0a1628] border-gray-700 text-white placeholder:text-gray-500",defaultValue:"阅读更多精彩内容,请加入Soul创业实验派对群..."})]}),t.jsx(oe,{className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:"保存配置"})]})]})})]})]})}var Hg=["PageUp","PageDown"],Kg=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],Gg={"from-left":["Home","PageDown","ArrowDown","ArrowLeft"],"from-right":["Home","PageDown","ArrowDown","ArrowRight"],"from-bottom":["Home","PageDown","ArrowDown","ArrowLeft"],"from-top":["Home","PageDown","ArrowUp","ArrowLeft"]},Gs="Slider",[_d,EC,PC]=eu(Gs),[Yg]=Rr(Gs,[PC]),[RC,Xi]=Yg(Gs),Qg=h.forwardRef((r,a)=>{const{name:l,min:o=0,max:c=100,step:u=1,orientation:f="horizontal",disabled:p=!1,minStepsBetweenThumbs:x=0,defaultValue:g=[o],value:v,onValueChange:y=()=>{},onValueCommit:E=()=>{},inverted:_=!1,form:k,...w}=r,j=h.useRef(new Set),b=h.useRef(0),N=f==="horizontal"?_C:TC,[A=[],$]=Jr({prop:v,defaultProp:g,onChange:K=>{var ce;(ce=[...j.current][b.current])==null||ce.focus(),y(K)}}),V=h.useRef(A);function R(K){const J=LC(A,K);Y(K,J)}function T(K){Y(K,b.current)}function F(){const K=V.current[b.current];A[b.current]!==K&&E(A)}function Y(K,J,{commit:ce}={commit:!1}){const X=$C(u),le=BC(Math.round((K-o)/u)*u+o,X),ee=ki(le,[o,c]);$((q=[])=>{const I=MC(q,ee,J);if(zC(I,x*u)){b.current=I.indexOf(ee);const Q=String(I)!==String(q);return Q&&ce&&E(I),Q?I:q}else return q})}return t.jsx(RC,{scope:r.__scopeSlider,name:l,disabled:p,min:o,max:c,valueIndexToChangeRef:b,thumbs:j.current,values:A,orientation:f,form:k,children:t.jsx(_d.Provider,{scope:r.__scopeSlider,children:t.jsx(_d.Slot,{scope:r.__scopeSlider,children:t.jsx(N,{"aria-disabled":p,"data-disabled":p?"":void 0,...w,ref:a,onPointerDown:Ae(w.onPointerDown,()=>{p||(V.current=A)}),min:o,max:c,inverted:_,onSlideStart:p?void 0:R,onSlideMove:p?void 0:T,onSlideEnd:p?void 0:F,onHomeKeyDown:()=>!p&&Y(o,0,{commit:!0}),onEndKeyDown:()=>!p&&Y(c,A.length-1,{commit:!0}),onStepKeyDown:({event:K,direction:J})=>{if(!p){const le=Hg.includes(K.key)||K.shiftKey&&Kg.includes(K.key)?10:1,ee=b.current,q=A[ee],I=u*le*J;Y(q+I,ee,{commit:!0})}}})})})})});Qg.displayName=Gs;var[qg,Xg]=Yg(Gs,{startEdge:"left",endEdge:"right",size:"width",direction:1}),_C=h.forwardRef((r,a)=>{const{min:l,max:o,dir:c,inverted:u,onSlideStart:f,onSlideMove:p,onSlideEnd:x,onStepKeyDown:g,...v}=r,[y,E]=h.useState(null),_=Ke(a,N=>E(N)),k=h.useRef(void 0),w=Bi(c),j=w==="ltr",b=j&&!u||!j&&u;function C(N){const A=k.current||y.getBoundingClientRect(),$=[0,A.width],R=fu($,b?[l,o]:[o,l]);return k.current=A,R(N-A.left)}return t.jsx(qg,{scope:r.__scopeSlider,startEdge:b?"left":"right",endEdge:b?"right":"left",direction:b?1:-1,size:"width",children:t.jsx(Jg,{dir:w,"data-orientation":"horizontal",...v,ref:_,style:{...v.style,"--radix-slider-thumb-transform":"translateX(-50%)"},onSlideStart:N=>{const A=C(N.clientX);f==null||f(A)},onSlideMove:N=>{const A=C(N.clientX);p==null||p(A)},onSlideEnd:()=>{k.current=void 0,x==null||x()},onStepKeyDown:N=>{const $=Gg[b?"from-left":"from-right"].includes(N.key);g==null||g({event:N,direction:$?-1:1})}})})}),TC=h.forwardRef((r,a)=>{const{min:l,max:o,inverted:c,onSlideStart:u,onSlideMove:f,onSlideEnd:p,onStepKeyDown:x,...g}=r,v=h.useRef(null),y=Ke(a,v),E=h.useRef(void 0),_=!c;function k(w){const j=E.current||v.current.getBoundingClientRect(),b=[0,j.height],N=fu(b,_?[o,l]:[l,o]);return E.current=j,N(w-j.top)}return t.jsx(qg,{scope:r.__scopeSlider,startEdge:_?"bottom":"top",endEdge:_?"top":"bottom",size:"height",direction:_?1:-1,children:t.jsx(Jg,{"data-orientation":"vertical",...g,ref:y,style:{...g.style,"--radix-slider-thumb-transform":"translateY(50%)"},onSlideStart:w=>{const j=k(w.clientY);u==null||u(j)},onSlideMove:w=>{const j=k(w.clientY);f==null||f(j)},onSlideEnd:()=>{E.current=void 0,p==null||p()},onStepKeyDown:w=>{const b=Gg[_?"from-bottom":"from-top"].includes(w.key);x==null||x({event:w,direction:b?-1:1})}})})}),Jg=h.forwardRef((r,a)=>{const{__scopeSlider:l,onSlideStart:o,onSlideMove:c,onSlideEnd:u,onHomeKeyDown:f,onEndKeyDown:p,onStepKeyDown:x,...g}=r,v=Xi(Gs,l);return t.jsx(Oe.span,{...g,ref:a,onKeyDown:Ae(r.onKeyDown,y=>{y.key==="Home"?(f(y),y.preventDefault()):y.key==="End"?(p(y),y.preventDefault()):Hg.concat(Kg).includes(y.key)&&(x(y),y.preventDefault())}),onPointerDown:Ae(r.onPointerDown,y=>{const E=y.target;E.setPointerCapture(y.pointerId),y.preventDefault(),v.thumbs.has(E)?E.focus():o(y)}),onPointerMove:Ae(r.onPointerMove,y=>{y.target.hasPointerCapture(y.pointerId)&&c(y)}),onPointerUp:Ae(r.onPointerUp,y=>{const E=y.target;E.hasPointerCapture(y.pointerId)&&(E.releasePointerCapture(y.pointerId),u(y))})})}),Zg="SliderTrack",e0=h.forwardRef((r,a)=>{const{__scopeSlider:l,...o}=r,c=Xi(Zg,l);return t.jsx(Oe.span,{"data-disabled":c.disabled?"":void 0,"data-orientation":c.orientation,...o,ref:a})});e0.displayName=Zg;var Td="SliderRange",t0=h.forwardRef((r,a)=>{const{__scopeSlider:l,...o}=r,c=Xi(Td,l),u=Xg(Td,l),f=h.useRef(null),p=Ke(a,f),x=c.values.length,g=c.values.map(E=>s0(E,c.min,c.max)),v=x>1?Math.min(...g):0,y=100-Math.max(...g);return t.jsx(Oe.span,{"data-orientation":c.orientation,"data-disabled":c.disabled?"":void 0,...o,ref:p,style:{...r.style,[u.startEdge]:v+"%",[u.endEdge]:y+"%"}})});t0.displayName=Td;var Id="SliderThumb",n0=h.forwardRef((r,a)=>{const l=EC(r.__scopeSlider),[o,c]=h.useState(null),u=Ke(a,p=>c(p)),f=h.useMemo(()=>o?l().findIndex(p=>p.ref.current===o):-1,[l,o]);return t.jsx(IC,{...r,ref:u,index:f})}),IC=h.forwardRef((r,a)=>{const{__scopeSlider:l,index:o,name:c,...u}=r,f=Xi(Id,l),p=Xg(Id,l),[x,g]=h.useState(null),v=Ke(a,C=>g(C)),y=x?f.form||!!x.closest("form"):!0,E=Zd(x),_=f.values[o],k=_===void 0?0:s0(_,f.min,f.max),w=DC(o,f.values.length),j=E==null?void 0:E[p.size],b=j?OC(j,k,p.direction):0;return h.useEffect(()=>{if(x)return f.thumbs.add(x),()=>{f.thumbs.delete(x)}},[x,f.thumbs]),t.jsxs("span",{style:{transform:"var(--radix-slider-thumb-transform)",position:"absolute",[p.startEdge]:`calc(${k}% + ${b}px)`},children:[t.jsx(_d.ItemSlot,{scope:r.__scopeSlider,children:t.jsx(Oe.span,{role:"slider","aria-label":r["aria-label"]||w,"aria-valuemin":f.min,"aria-valuenow":_,"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:v,style:_===void 0?{display:"none"}:r.style,onFocus:Ae(r.onFocus,()=>{f.valueIndexToChangeRef.current=o})})}),y&&t.jsx(r0,{name:c??(f.name?f.name+(f.values.length>1?"[]":""):void 0),form:f.form,value:_},o)]})});n0.displayName=Id;var AC="RadioBubbleInput",r0=h.forwardRef(({__scopeSlider:r,value:a,...l},o)=>{const c=h.useRef(null),u=Ke(c,o),f=Jd(a);return h.useEffect(()=>{const p=c.current;if(!p)return;const x=window.HTMLInputElement.prototype,v=Object.getOwnPropertyDescriptor(x,"value").set;if(f!==a&&v){const y=new Event("input",{bubbles:!0});v.call(p,a),p.dispatchEvent(y)}},[f,a]),t.jsx(Oe.input,{style:{display:"none"},...l,ref:u,defaultValue:a})});r0.displayName=AC;function MC(r=[],a,l){const o=[...r];return o[l]=a,o.sort((c,u)=>c-u)}function s0(r,a,l){const u=100/(l-a)*(r-a);return ki(u,[0,100])}function DC(r,a){return a>2?`Value ${r+1} of ${a}`:a===2?["Minimum","Maximum"][r]:void 0}function LC(r,a){if(r.length===1)return 0;const l=r.map(c=>Math.abs(c-a)),o=Math.min(...l);return l.indexOf(o)}function OC(r,a,l){const o=r/2,u=fu([0,50],[0,o]);return(o-u(a)*l)*l}function FC(r){return r.slice(0,-1).map((a,l)=>r[l+1]-a)}function zC(r,a){if(a>0){const l=FC(r);return Math.min(...l)>=a}return!0}function fu(r,a){return l=>{if(r[0]===r[1]||a[0]===a[1])return a[0];const o=(a[1]-a[0])/(r[1]-r[0]);return a[0]+o*(l-r[0])}}function $C(r){return(String(r).split(".")[1]||"").length}function BC(r,a){const l=Math.pow(10,a);return Math.round(r*l)/l}var UC=Qg,VC=e0,WC=t0,HC=n0;function KC({className:r,defaultValue:a,value:l,min:o=0,max:c=100,...u}){const f=h.useMemo(()=>Array.isArray(l)?l:Array.isArray(a)?a:[o,c],[l,a,o,c]);return t.jsxs(UC,{defaultValue:a,value:l,min:o,max:c,className:Ge("relative flex w-full touch-none items-center select-none data-[disabled]:opacity-50",r),...u,children:[t.jsx(VC,{className:"bg-gray-600 relative grow overflow-hidden rounded-full h-1.5 w-full",children:t.jsx(WC,{className:"bg-[#38bdac] absolute h-full rounded-full"})}),Array.from({length:f.length},(p,x)=>t.jsx(HC,{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 GC={distributorShare:90,minWithdrawAmount:10,bindingDays:30,userDiscount:5,enableAutoWithdraw:!1,vipOrderShareVip:20,vipOrderShareNonVip:10};function YC(){const[r,a]=h.useState(GC),[l,o]=h.useState(!0),[c,u]=h.useState(!1);h.useEffect(()=>{We("/api/admin/referral-settings").then(x=>{const g=x==null?void 0:x.data;g&&typeof g=="object"&&a({distributorShare:g.distributorShare??90,minWithdrawAmount:g.minWithdrawAmount??10,bindingDays:g.bindingDays??30,userDiscount:g.userDiscount??5,enableAutoWithdraw:g.enableAutoWithdraw??!1,vipOrderShareVip:g.vipOrderShareVip??20,vipOrderShareNonVip:g.vipOrderShareNonVip??10})}).catch(console.error).finally(()=>o(!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},g=await jt("/api/admin/referral-settings",x);if(!g||g.success===!1){alert("保存失败: "+(g&&typeof g=="object"&&"error"in g?g.error:""));return}alert(`✅ 分销配置已保存成功! + +• 小程序与网站的推广规则会一起生效 +• 绑定关系会使用新的天数配置 +• 佣金比例会立即应用到新订单 + +如有缓存,请刷新前台/小程序页面。`)}catch(x){console.error(x),alert("保存失败: "+(x instanceof Error?x.message:String(x)))}finally{u(!1)}},p=x=>g=>{const v=parseFloat(g.target.value||"0");a(y=>({...y,[x]:isNaN(v)?0:v}))};return l?t.jsx("div",{className:"p-8 text-gray-500",children:"加载中..."}):t.jsxs("div",{className:"p-8 w-full",children:[t.jsxs("div",{className:"flex justify-between items-center mb-8",children:[t.jsxs("div",{children:[t.jsxs("h2",{className:"text-2xl font-bold text-white flex items-center gap-2",children:[t.jsx(Os,{className:"w-5 h-5 text-[#38bdac]"}),"推广 / 分销设置"]}),t.jsx("p",{className:"text-gray-400 mt-1",children:"统一管理「好友优惠」「你得 90% 收益」「绑定期 30 天」「提现门槛」等规则,小程序和 Web 共用这套配置。"})]}),t.jsxs(oe,{onClick:f,disabled:c||l,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:[t.jsx(Wt,{className:"w-4 h-4 mr-2"}),c?"保存中...":"保存配置"]})]}),t.jsxs("div",{className:"space-y-6",children:[t.jsxs(ke,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:[t.jsxs($e,{children:[t.jsxs(Be,{className:"flex items-center gap-2 text-white",children:[t.jsx(EN,{className:"w-4 h-4 text-[#38bdac]"}),"推广规则"]}),t.jsx(ot,{className:"text-gray-400",children:"这三项会直接体现在小程序「推广规则」卡片上,同时影响实收佣金计算。"})]}),t.jsx(Ee,{className:"space-y-6",children:t.jsxs("div",{className:"grid grid-cols-3 gap-6",children:[t.jsxs("div",{className:"space-y-2",children:[t.jsxs(Z,{className:"text-gray-300 flex items-center gap-2",children:[t.jsx(ni,{className:"w-3 h-3 text-[#38bdac]"}),"好友优惠(%)"]}),t.jsx(ne,{type:"number",min:0,max:100,className:"bg-[#0a1628] border-gray-700 text-white",value:r.userDiscount,onChange:p("userDiscount")}),t.jsx("p",{className:"text-xs text-gray-500",children:"例如 5 表示好友立减 5%(在价格配置基础上生效)。"})]}),t.jsxs("div",{className:"space-y-2",children:[t.jsxs(Z,{className:"text-gray-300 flex items-center gap-2",children:[t.jsx(vn,{className:"w-3 h-3 text-[#38bdac]"}),"推广者分成(%)"]}),t.jsxs("div",{className:"flex items-center gap-4",children:[t.jsx(KC,{className:"flex-1",min:10,max:100,step:1,value:[r.distributorShare],onValueChange:([x])=>a(g=>({...g,distributorShare:x}))}),t.jsx(ne,{type:"number",min:0,max:100,className:"w-20 bg-[#0a1628] border-gray-700 text-white text-center",value:r.distributorShare,onChange:p("distributorShare")})]}),t.jsxs("p",{className:"text-xs text-gray-500",children:["内容订单佣金 = 订单金额 ×"," ",t.jsxs("span",{className:"text-[#38bdac] font-mono",children:[r.distributorShare,"%"]}),";会员订单见下方。"]})]}),t.jsxs("div",{className:"space-y-2",children:[t.jsxs(Z,{className:"text-gray-300 flex items-center gap-2",children:[t.jsx(ni,{className:"w-3 h-3 text-[#38bdac]"}),"会员订单分润(推广者是会员 %)"]}),t.jsx(ne,{type:"number",min:0,max:100,className:"bg-[#0a1628] border-gray-700 text-white",value:r.vipOrderShareVip,onChange:p("vipOrderShareVip")}),t.jsx("p",{className:"text-xs text-gray-500",children:"推广者已是会员时,会员订单佣金比例,默认 20%。"})]}),t.jsxs("div",{className:"space-y-2",children:[t.jsxs(Z,{className:"text-gray-300 flex items-center gap-2",children:[t.jsx(ni,{className:"w-3 h-3 text-[#38bdac]"}),"会员订单分润(推广者非会员 %)"]}),t.jsx(ne,{type:"number",min:0,max:100,className:"bg-[#0a1628] border-gray-700 text-white",value:r.vipOrderShareNonVip,onChange:p("vipOrderShareNonVip")}),t.jsx("p",{className:"text-xs text-gray-500",children:"推广者非会员时,会员订单佣金比例,默认 10%。"})]}),t.jsxs("div",{className:"space-y-2",children:[t.jsxs(Z,{className:"text-gray-300 flex items-center gap-2",children:[t.jsx(vn,{className:"w-3 h-3 text-[#38bdac]"}),"绑定有效期(天)"]}),t.jsx(ne,{type:"number",min:1,max:365,className:"bg-[#0a1628] border-gray-700 text-white",value:r.bindingDays,onChange:p("bindingDays")}),t.jsx("p",{className:"text-xs text-gray-500",children:"好友通过你的链接进来并登录后,绑定在你名下的天数。"})]})]})})]}),t.jsxs(ke,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:[t.jsxs($e,{children:[t.jsxs(Be,{className:"flex items-center gap-2 text-white",children:[t.jsx(Os,{className:"w-4 h-4 text-[#38bdac]"}),"提现规则"]}),t.jsx(ot,{className:"text-gray-400",children:"与「提现中心」「自动提现」相关的参数,影响推广者看到的可提现金额和最低门槛。"})]}),t.jsx(Ee,{className:"space-y-6",children:t.jsxs("div",{className:"grid grid-cols-2 gap-6",children:[t.jsxs("div",{className:"space-y-2",children:[t.jsx(Z,{className:"text-gray-300",children:"最低提现金额(元)"}),t.jsx(ne,{type:"number",min:0,step:1,className:"bg-[#0a1628] border-gray-700 text-white",value:r.minWithdrawAmount,onChange:p("minWithdrawAmount")}),t.jsx("p",{className:"text-xs text-gray-500",children:"小程序「满 X 元可提现」展示的门槛,同时用于后端接口校验。"})]}),t.jsxs("div",{className:"space-y-2",children:[t.jsxs(Z,{className:"text-gray-300 flex items-center gap-2",children:["自动提现开关",t.jsx(Me,{variant:"outline",className:"border-[#38bdac]/40 text-[#38bdac] text-[10px]",children:"预留"})]}),t.jsxs("div",{className:"flex items-center gap-3 mt-1",children:[t.jsx(ht,{checked:r.enableAutoWithdraw,onCheckedChange:x=>a(g=>({...g,enableAutoWithdraw:x}))}),t.jsx("span",{className:"text-sm text-gray-400",children:"开启后,可结合定时任务实现「收益自动打款到微信零钱」。"})]})]})]})})]}),t.jsxs(ke,{className:"bg-[#0f2137] border-gray-700/50",children:[t.jsx($e,{children:t.jsxs(Be,{className:"flex items-center gap-2 text-gray-200 text-sm",children:[t.jsx(ni,{className:"w-4 h-4 text-[#38bdac]"}),"使用说明"]})}),t.jsxs(Ee,{className:"space-y-2 text-xs text-gray-400 leading-relaxed",children:[t.jsxs("p",{children:["1. 以上配置会写入"," ",t.jsx("code",{className:"font-mono text-[11px] text-[#38bdac]",children:"system_config.referral_config"}),",小程序「推广中心」、Web 推广页以及支付回调都会读取同一份配置。"]}),t.jsx("p",{children:"2. 修改后新订单立即生效;旧订单的历史佣金不会自动重算,只影响之后产生的订单。"}),t.jsx("p",{children:"3. 如遇前端展示与实际结算不一致,优先以此处配置为准,再排查缓存和小程序版本。"})]})]})]})]})}const Un={name:"卡若",avatar:"K",avatarImg:"",title:"Soul派对房主理人 · 私域运营专家",bio:'每天早上6点到9点,在Soul派对房分享真实的创业故事。专注私域运营与项目变现,用"云阿米巴"模式帮助创业者构建可持续的商业体系。',stats:[{label:"商业案例",value:"62"},{label:"连续直播",value:"365天"},{label:"派对分享",value:"1000+"}],highlights:["5年私域运营经验","帮助100+品牌从0到1增长","连续创业者,擅长商业模式设计"]};function sp(r){return Array.isArray(r)?r.map(a=>a&&typeof a=="object"&&"label"in a&&"value"in a?{label:String(a.label),value:String(a.value)}:{label:"",value:""}).filter(a=>a.label||a.value):Un.stats}function ap(r){return Array.isArray(r)?r.map(a=>typeof a=="string"?a:String(a??"")).filter(Boolean):Un.highlights}function QC(){const[r,a]=h.useState(Un),[l,o]=h.useState(!0),[c,u]=h.useState(!1),[f,p]=h.useState(!1),x=h.useRef(null);h.useEffect(()=>{We("/api/admin/author-settings").then(b=>{const C=b==null?void 0:b.data;C&&typeof C=="object"&&a({name:String(C.name??Un.name),avatar:String(C.avatar??Un.avatar),avatarImg:String(C.avatarImg??""),title:String(C.title??Un.title),bio:String(C.bio??Un.bio),stats:sp(C.stats).length?sp(C.stats):Un.stats,highlights:ap(C.highlights).length?ap(C.highlights):Un.highlights})}).catch(console.error).finally(()=>o(!1))},[]);const g=async()=>{u(!0);try{const b={name:r.name,avatar:r.avatar||"K",avatarImg:r.avatarImg,title:r.title,bio:r.bio,stats:r.stats.filter(A=>A.label||A.value),highlights:r.highlights.filter(Boolean)},C=await jt("/api/admin/author-settings",b);if(!C||C.success===!1){alert("保存失败: "+(C&&typeof C=="object"&&"error"in C?C.error:""));return}u(!1);const N=document.createElement("div");N.className="fixed top-4 right-4 z-50 px-4 py-2 rounded-lg bg-[#38bdac] text-white text-sm shadow-lg",N.textContent="作者设置已保存",document.body.appendChild(N),setTimeout(()=>N.remove(),2e3)}catch(b){console.error(b),alert("保存失败: "+(b instanceof Error?b.message:String(b)))}finally{u(!1)}},v=async b=>{var N;const C=(N=b.target.files)==null?void 0:N[0];if(C){p(!0);try{const A=new FormData;A.append("file",C),A.append("folder","avatars");const $=Bd(),V={};$&&(V.Authorization=`Bearer ${$}`);const T=await(await fetch(Fs("/api/upload"),{method:"POST",body:A,credentials:"include",headers:V})).json();T!=null&&T.success&&(T!=null&&T.url)?a(F=>({...F,avatarImg:T.url})):alert("上传失败: "+((T==null?void 0:T.error)||"未知错误"))}catch(A){console.error(A),alert("上传失败")}finally{p(!1),x.current&&(x.current.value="")}}},y=()=>a(b=>({...b,stats:[...b.stats,{label:"",value:""}]})),E=b=>a(C=>({...C,stats:C.stats.filter((N,A)=>A!==b)})),_=(b,C,N)=>a(A=>({...A,stats:A.stats.map(($,V)=>V===b?{...$,[C]:N}:$)})),k=()=>a(b=>({...b,highlights:[...b.highlights,""]})),w=b=>a(C=>({...C,highlights:C.highlights.filter((N,A)=>A!==b)})),j=(b,C)=>a(N=>({...N,highlights:N.highlights.map((A,$)=>$===b?C:A)}));return l?t.jsx("div",{className:"p-8 text-gray-500",children:"加载中..."}):t.jsxs("div",{className:"p-8 w-full",children:[t.jsxs("div",{className:"flex justify-between items-center mb-8",children:[t.jsxs("div",{children:[t.jsxs("h2",{className:"text-2xl font-bold text-white flex items-center gap-2",children:[t.jsx(qr,{className:"w-5 h-5 text-[#38bdac]"}),"作者详情"]}),t.jsx("p",{className:"text-gray-400 mt-1",children:"配置小程序「关于作者」页展示的作者信息,包括头像、简介、统计数据与亮点标签。"})]}),t.jsxs(oe,{onClick:g,disabled:c||l,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:[t.jsx(Wt,{className:"w-4 h-4 mr-2"}),c?"保存中...":"保存"]})]}),t.jsxs("div",{className:"space-y-6",children:[t.jsxs(ke,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:[t.jsxs($e,{children:[t.jsxs(Be,{className:"flex items-center gap-2 text-white",children:[t.jsx(qr,{className:"w-4 h-4 text-[#38bdac]"}),"基本信息"]}),t.jsx(ot,{className:"text-gray-400",children:"作者姓名、头像、头衔与个人简介,将展示在「关于作者」页顶部。"})]}),t.jsxs(Ee,{className:"space-y-4",children:[t.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[t.jsxs("div",{className:"space-y-2",children:[t.jsx(Z,{className:"text-gray-300",children:"姓名"}),t.jsx(ne,{className:"bg-[#0a1628] border-gray-700 text-white",value:r.name,onChange:b=>a(C=>({...C,name:b.target.value})),placeholder:"卡若"})]}),t.jsxs("div",{className:"space-y-2",children:[t.jsx(Z,{className:"text-gray-300",children:"首字母占位(无头像时显示)"}),t.jsx(ne,{className:"bg-[#0a1628] border-gray-700 text-white w-20",value:r.avatar,onChange:b=>a(C=>({...C,avatar:b.target.value.slice(0,1)||"K"})),placeholder:"K"})]})]}),t.jsxs("div",{className:"space-y-2",children:[t.jsxs(Z,{className:"text-gray-300 flex items-center gap-2",children:[t.jsx(Cp,{className:"w-3 h-3 text-[#38bdac]"}),"头像图片"]}),t.jsxs("div",{className:"flex gap-3 items-center",children:[t.jsx(ne,{className:"flex-1 bg-[#0a1628] border-gray-700 text-white",value:r.avatarImg,onChange:b=>a(C=>({...C,avatarImg:b.target.value})),placeholder:"上传或粘贴 URL,如 /uploads/avatars/xxx.png"}),t.jsx("input",{ref:x,type:"file",accept:"image/*",className:"hidden",onChange:v}),t.jsxs(oe,{type:"button",variant:"outline",size:"sm",className:"border-gray-600 text-gray-400 shrink-0",disabled:f,onClick:()=>{var b;return(b=x.current)==null?void 0:b.click()},children:[t.jsx(bi,{className:"w-4 h-4 mr-2"}),f?"上传中...":"上传"]})]}),r.avatarImg&&t.jsx("div",{className:"mt-2",children:t.jsx("img",{src:r.avatarImg.startsWith("http")?r.avatarImg:Fs(r.avatarImg),alt:"头像预览",className:"w-20 h-20 rounded-full object-cover border border-gray-600"})})]}),t.jsxs("div",{className:"space-y-2",children:[t.jsx(Z,{className:"text-gray-300",children:"头衔"}),t.jsx(ne,{className:"bg-[#0a1628] border-gray-700 text-white",value:r.title,onChange:b=>a(C=>({...C,title:b.target.value})),placeholder:"Soul派对房主理人 · 私域运营专家"})]}),t.jsxs("div",{className:"space-y-2",children:[t.jsx(Z,{className:"text-gray-300",children:"个人简介"}),t.jsx(Xr,{className:"bg-[#0a1628] border-gray-700 text-white min-h-[120px]",value:r.bio,onChange:b=>a(C=>({...C,bio:b.target.value})),placeholder:"每天早上6点到9点..."})]})]})]}),t.jsxs(ke,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:[t.jsxs($e,{children:[t.jsx(Be,{className:"text-white",children:"统计数据"}),t.jsx(ot,{className:"text-gray-400",children:"展示在作者卡片中的数字指标,如「商业案例 62」「连续直播 365天」。第一个「商业案例」的值可由书籍统计自动更新。"})]}),t.jsxs(Ee,{className:"space-y-3",children:[r.stats.map((b,C)=>t.jsxs("div",{className:"flex gap-3 items-center",children:[t.jsx(ne,{className:"flex-1 bg-[#0a1628] border-gray-700 text-white",value:b.label,onChange:N=>_(C,"label",N.target.value),placeholder:"标签"}),t.jsx(ne,{className:"flex-1 bg-[#0a1628] border-gray-700 text-white",value:b.value,onChange:N=>_(C,"value",N.target.value),placeholder:"数值"}),t.jsx(oe,{variant:"ghost",size:"icon",className:"text-gray-400 hover:text-red-400",onClick:()=>E(C),children:t.jsx(on,{className:"w-4 h-4"})})]},C)),t.jsxs(oe,{variant:"outline",size:"sm",onClick:y,className:"border-gray-600 text-gray-400",children:[t.jsx(Rn,{className:"w-4 h-4 mr-2"}),"添加统计项"]})]})]}),t.jsxs(ke,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:[t.jsxs($e,{children:[t.jsx(Be,{className:"text-white",children:"亮点标签"}),t.jsx(ot,{className:"text-gray-400",children:"作者优势或成就的简短描述,以标签形式展示。"})]}),t.jsxs(Ee,{className:"space-y-3",children:[r.highlights.map((b,C)=>t.jsxs("div",{className:"flex gap-3 items-center",children:[t.jsx(ne,{className:"flex-1 bg-[#0a1628] border-gray-700 text-white",value:b,onChange:N=>j(C,N.target.value),placeholder:"5年私域运营经验"}),t.jsx(oe,{variant:"ghost",size:"icon",className:"text-gray-400 hover:text-red-400",onClick:()=>w(C),children:t.jsx(on,{className:"w-4 h-4"})})]},C)),t.jsxs(oe,{variant:"outline",size:"sm",onClick:k,className:"border-gray-600 text-gray-400",children:[t.jsx(Rn,{className:"w-4 h-4 mr-2"}),"添加亮点"]})]})]})]})]})}const qC={appId:"wxb8bbb2b10dec74aa",withdrawSubscribeTmplId:"u3MbZGPRkrZIk-I7QdpwzFxnO_CeQPaCWF2FkiIablE",mchId:"1318592501",minWithdraw:10},XC={name:"卡若",startDate:"2025年10月15日",bio:"连续创业者,私域运营专家,每天早上6-9点在Soul派对房分享真实商业故事",liveTime:"06:00-09:00",platform:"Soul派对房",description:"连续创业者,私域运营专家"},JC={sectionPrice:1,baseBookPrice:9.9,distributorShare:90,authorInfo:{...XC}},ZC={matchEnabled:!0,referralEnabled:!0,searchEnabled:!0,aboutEnabled:!0};function e4(){const[r,a]=h.useState(JC),[l,o]=h.useState(ZC),[c,u]=h.useState(qC),[f,p]=h.useState(!1),[x,g]=h.useState(!0),[v,y]=h.useState(!1),[E,_]=h.useState(""),[k,w]=h.useState(""),[j,b]=h.useState(!1),[C,N]=h.useState(!1),A=(T,F,Y=!1)=>{_(T),w(F),b(Y),y(!0)};h.useEffect(()=>{(async()=>{try{const F=await We("/api/admin/settings");if(!F||F.success===!1)return;if(F.featureConfig&&Object.keys(F.featureConfig).length&&o(Y=>({...Y,...F.featureConfig})),F.mpConfig&&typeof F.mpConfig=="object"&&u(Y=>({...Y,...F.mpConfig})),F.siteSettings&&typeof F.siteSettings=="object"){const Y=F.siteSettings;a(K=>({...K,...typeof Y.sectionPrice=="number"&&{sectionPrice:Y.sectionPrice},...typeof Y.baseBookPrice=="number"&&{baseBookPrice:Y.baseBookPrice},...typeof Y.distributorShare=="number"&&{distributorShare:Y.distributorShare},...Y.authorInfo&&typeof Y.authorInfo=="object"&&{authorInfo:{...K.authorInfo,...Y.authorInfo}}}))}}catch(F){console.error("Load settings error:",F)}finally{g(!1)}})()},[]);const $=async(T,F)=>{N(!0);try{const Y=await jt("/api/admin/settings",{featureConfig:T});if(!Y||Y.success===!1){F(),A("保存失败",(Y==null?void 0:Y.error)??"未知错误",!0);return}A("已保存","功能开关已更新,相关入口将随之显示或隐藏。")}catch(Y){console.error("Save feature config error:",Y),F(),A("保存失败",Y instanceof Error?Y.message:String(Y),!0)}finally{N(!1)}},V=(T,F)=>{const Y=l,K={...Y,[T]:F};o(K),$(K,()=>o(Y))},R=async()=>{p(!0);try{const T=await jt("/api/admin/settings",{featureConfig:l,siteSettings:{sectionPrice:r.sectionPrice,baseBookPrice:r.baseBookPrice,distributorShare:r.distributorShare,authorInfo:r.authorInfo},mpConfig:{...c,appId:c.appId||"",withdrawSubscribeTmplId:c.withdrawSubscribeTmplId||"",mchId:c.mchId||"",minWithdraw:typeof c.minWithdraw=="number"?c.minWithdraw:10}});if(!T||T.success===!1){A("保存失败",(T==null?void 0:T.error)??"未知错误",!0);return}A("已保存","设置已保存成功。")}catch(T){console.error("Save settings error:",T),A("保存失败",T instanceof Error?T.message:String(T),!0)}finally{p(!1)}};return x?t.jsx("div",{className:"p-8 text-gray-500",children:"加载中..."}):t.jsxs("div",{className:"p-8 w-full",children:[t.jsxs("div",{className:"flex justify-between items-center mb-8",children:[t.jsxs("div",{children:[t.jsx("h2",{className:"text-2xl font-bold text-white",children:"系统设置"}),t.jsx("p",{className:"text-gray-400 mt-1",children:"配置全站基础参数与开关"})]}),t.jsxs(oe,{onClick:R,disabled:f,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:[t.jsx(Wt,{className:"w-4 h-4 mr-2"}),f?"保存中...":"保存设置"]})]}),t.jsxs("div",{className:"space-y-6",children:[t.jsxs(ke,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:[t.jsxs($e,{children:[t.jsxs(Be,{className:"text-white flex items-center gap-2",children:[t.jsx(jm,{className:"w-5 h-5 text-[#38bdac]"}),"关于作者"]}),t.jsx(ot,{className:"text-gray-400",children:'配置作者信息,将在"关于作者"页面显示'})]}),t.jsxs(Ee,{className:"space-y-4",children:[t.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[t.jsxs("div",{className:"space-y-2",children:[t.jsxs(Z,{htmlFor:"author-name",className:"text-gray-300 flex items-center gap-1",children:[t.jsx(jm,{className:"w-3 h-3"}),"主理人名称"]}),t.jsx(ne,{id:"author-name",className:"bg-[#0a1628] border-gray-700 text-white",value:r.authorInfo.name??"",onChange:T=>a(F=>({...F,authorInfo:{...F.authorInfo,name:T.target.value}}))})]}),t.jsxs("div",{className:"space-y-2",children:[t.jsxs(Z,{htmlFor:"start-date",className:"text-gray-300 flex items-center gap-1",children:[t.jsx(za,{className:"w-3 h-3"}),"开播日期"]}),t.jsx(ne,{id:"start-date",className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"例如: 2025年10月15日",value:r.authorInfo.startDate??"",onChange:T=>a(F=>({...F,authorInfo:{...F.authorInfo,startDate:T.target.value}}))})]})]}),t.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[t.jsxs("div",{className:"space-y-2",children:[t.jsxs(Z,{htmlFor:"live-time",className:"text-gray-300 flex items-center gap-1",children:[t.jsx(za,{className:"w-3 h-3"}),"直播时间"]}),t.jsx(ne,{id:"live-time",className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"例如: 06:00-09:00",value:r.authorInfo.liveTime??"",onChange:T=>a(F=>({...F,authorInfo:{...F.authorInfo,liveTime:T.target.value}}))})]}),t.jsxs("div",{className:"space-y-2",children:[t.jsxs(Z,{htmlFor:"platform",className:"text-gray-300 flex items-center gap-1",children:[t.jsx(vN,{className:"w-3 h-3"}),"直播平台"]}),t.jsx(ne,{id:"platform",className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"例如: Soul派对房",value:r.authorInfo.platform??"",onChange:T=>a(F=>({...F,authorInfo:{...F.authorInfo,platform:T.target.value}}))})]})]}),t.jsxs("div",{className:"space-y-2",children:[t.jsxs(Z,{htmlFor:"description",className:"text-gray-300 flex items-center gap-1",children:[t.jsx(Wn,{className:"w-3 h-3"}),"简介描述"]}),t.jsx(ne,{id:"description",className:"bg-[#0a1628] border-gray-700 text-white",value:r.authorInfo.description??"",onChange:T=>a(F=>({...F,authorInfo:{...F.authorInfo,description:T.target.value}}))})]}),t.jsxs("div",{className:"space-y-2",children:[t.jsx(Z,{htmlFor:"bio",className:"text-gray-300",children:"详细介绍"}),t.jsx(Xr,{id:"bio",className:"bg-[#0a1628] border-gray-700 text-white min-h-[100px]",placeholder:"输入作者详细介绍...",value:r.authorInfo.bio??"",onChange:T=>a(F=>({...F,authorInfo:{...F.authorInfo,bio:T.target.value}}))})]}),t.jsxs("div",{className:"mt-4 p-4 rounded-xl bg-[#0a1628] border border-[#38bdac]/30",children:[t.jsx("p",{className:"text-xs text-gray-500 mb-2",children:"预览效果"}),t.jsxs("div",{className:"flex items-center gap-3",children:[t.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)}),t.jsxs("div",{children:[t.jsx("p",{className:"text-white font-semibold",children:r.authorInfo.name}),t.jsx("p",{className:"text-gray-400 text-xs",children:r.authorInfo.description}),t.jsxs("p",{className:"text-[#38bdac] text-xs mt-1",children:["每日 ",r.authorInfo.liveTime," · ",r.authorInfo.platform]})]})]})]})]})]}),t.jsxs(ke,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:[t.jsxs($e,{children:[t.jsxs(Be,{className:"text-white flex items-center gap-2",children:[t.jsx(yi,{className:"w-5 h-5 text-[#38bdac]"}),"价格设置"]}),t.jsx(ot,{className:"text-gray-400",children:"配置书籍和章节的定价"})]}),t.jsx(Ee,{className:"space-y-4",children:t.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[t.jsxs("div",{className:"space-y-2",children:[t.jsx(Z,{className:"text-gray-300",children:"单节价格 (元)"}),t.jsx(ne,{type:"number",className:"bg-[#0a1628] border-gray-700 text-white",value:r.sectionPrice,onChange:T=>a(F=>({...F,sectionPrice:Number.parseFloat(T.target.value)||1}))})]}),t.jsxs("div",{className:"space-y-2",children:[t.jsx(Z,{className:"text-gray-300",children:"整本价格 (元)"}),t.jsx(ne,{type:"number",className:"bg-[#0a1628] border-gray-700 text-white",value:r.baseBookPrice,onChange:T=>a(F=>({...F,baseBookPrice:Number.parseFloat(T.target.value)||9.9}))})]})]})})]}),t.jsxs(ke,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:[t.jsxs($e,{children:[t.jsxs(Be,{className:"text-white flex items-center gap-2",children:[t.jsx(xd,{className:"w-5 h-5 text-[#38bdac]"}),"小程序配置"]}),t.jsx(ot,{className:"text-gray-400",children:"订阅消息模板、支付商户号等,小程序从 /api/miniprogram/config 读取(API 地址由 app.js baseUrl 控制)"})]}),t.jsx(Ee,{className:"space-y-4",children:t.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[t.jsxs("div",{className:"space-y-2",children:[t.jsx(Z,{className:"text-gray-300",children:"小程序 AppID"}),t.jsx(ne,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"wxb8bbb2b10dec74aa",value:c.appId??"",onChange:T=>u(F=>({...F,appId:T.target.value}))})]}),t.jsxs("div",{className:"space-y-2",children:[t.jsx(Z,{className:"text-gray-300",children:"提现订阅模板 ID"}),t.jsx(ne,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"用户申请提现时需授权",value:c.withdrawSubscribeTmplId??"",onChange:T=>u(F=>({...F,withdrawSubscribeTmplId:T.target.value}))})]}),t.jsxs("div",{className:"space-y-2",children:[t.jsx(Z,{className:"text-gray-300",children:"微信支付商户号"}),t.jsx(ne,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"1318592501",value:c.mchId??"",onChange:T=>u(F=>({...F,mchId:T.target.value}))})]}),t.jsxs("div",{className:"space-y-2",children:[t.jsx(Z,{className:"text-gray-300",children:"最低提现金额 (元)"}),t.jsx(ne,{type:"number",className:"bg-[#0a1628] border-gray-700 text-white",value:c.minWithdraw??10,onChange:T=>u(F=>({...F,minWithdraw:Number.parseFloat(T.target.value)||10}))})]})]})})]}),t.jsxs(ke,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:[t.jsxs($e,{children:[t.jsxs(Be,{className:"text-white flex items-center gap-2",children:[t.jsx(Ni,{className:"w-5 h-5 text-[#38bdac]"}),"功能开关"]}),t.jsx(ot,{className:"text-gray-400",children:"控制各个功能模块的显示/隐藏"})]}),t.jsxs(Ee,{className:"space-y-4",children:[t.jsxs("div",{className:"space-y-4",children:[t.jsxs("div",{className:"flex items-center justify-between p-4 rounded-lg bg-[#0a1628] border border-gray-700/50",children:[t.jsxs("div",{className:"space-y-1",children:[t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx(vn,{className:"w-4 h-4 text-[#38bdac]"}),t.jsx(Z,{htmlFor:"match-enabled",className:"text-white font-medium cursor-pointer",children:"找伙伴功能"})]}),t.jsx("p",{className:"text-xs text-gray-400 ml-6",children:"控制小程序和Web端的找伙伴功能显示"})]}),t.jsx(ht,{id:"match-enabled",checked:l.matchEnabled,disabled:C,onCheckedChange:T=>V("matchEnabled",T)})]}),t.jsxs("div",{className:"flex items-center justify-between p-4 rounded-lg bg-[#0a1628] border border-gray-700/50",children:[t.jsxs("div",{className:"space-y-1",children:[t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx(qj,{className:"w-4 h-4 text-[#38bdac]"}),t.jsx(Z,{htmlFor:"referral-enabled",className:"text-white font-medium cursor-pointer",children:"推广功能"})]}),t.jsx("p",{className:"text-xs text-gray-400 ml-6",children:"控制推广中心的显示(我的页面入口)"})]}),t.jsx(ht,{id:"referral-enabled",checked:l.referralEnabled,disabled:C,onCheckedChange:T=>V("referralEnabled",T)})]}),t.jsxs("div",{className:"flex items-center justify-between p-4 rounded-lg bg-[#0a1628] border border-gray-700/50",children:[t.jsxs("div",{className:"space-y-1",children:[t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx(Wn,{className:"w-4 h-4 text-[#38bdac]"}),t.jsx(Z,{htmlFor:"search-enabled",className:"text-white font-medium cursor-pointer",children:"搜索功能"})]}),t.jsx("p",{className:"text-xs text-gray-400 ml-6",children:"控制首页搜索栏的显示"})]}),t.jsx(ht,{id:"search-enabled",checked:l.searchEnabled,disabled:C,onCheckedChange:T=>V("searchEnabled",T)})]}),t.jsxs("div",{className:"flex items-center justify-between p-4 rounded-lg bg-[#0a1628] border border-gray-700/50",children:[t.jsxs("div",{className:"space-y-1",children:[t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx(Ni,{className:"w-4 h-4 text-[#38bdac]"}),t.jsx(Z,{htmlFor:"about-enabled",className:"text-white font-medium cursor-pointer",children:"关于页面"})]}),t.jsx("p",{className:"text-xs text-gray-400 ml-6",children:"控制关于页面的访问"})]}),t.jsx(ht,{id:"about-enabled",checked:l.aboutEnabled,disabled:C,onCheckedChange:T=>V("aboutEnabled",T)})]})]}),t.jsx("div",{className:"p-3 rounded-lg bg-blue-500/10 border border-blue-500/30",children:t.jsx("p",{className:"text-xs text-blue-300",children:"💡 关闭功能后,相关入口会自动隐藏。建议在功能开发完成后再开启。"})})]})]})]}),t.jsx(Bt,{open:v,onOpenChange:y,children:t.jsxs(It,{className:"bg-[#0f2137] border-gray-700 text-white",showCloseButton:!0,children:[t.jsxs(Ut,{children:[t.jsx(Vt,{className:j?"text-red-400":"text-[#38bdac]",children:E}),t.jsx(U1,{className:"text-gray-400 whitespace-pre-wrap pt-2",children:k})]}),t.jsx(qt,{className:"mt-4",children:t.jsx(oe,{onClick:()=>y(!1),className:j?"bg-gray-600 hover:bg-gray-500":"bg-[#38bdac] hover:bg-[#2da396]",children:"确定"})})]})})]})}const lp={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 t4(){const[r,a]=h.useState(!1),[l,o]=h.useState(lp),[c,u]=h.useState(""),f=async()=>{a(!0);try{const b=await We("/api/config");b!=null&&b.paymentMethods&&o({...lp,...b.paymentMethods})}catch(b){console.error(b)}finally{a(!1)}};h.useEffect(()=>{f()},[]);const p=async()=>{a(!0);try{await jt("/api/db/config",{key:"payment_methods",value:l,description:"支付方式配置"}),alert("配置已保存!")}catch(b){console.error("保存失败:",b),alert("保存失败: "+(b instanceof Error?b.message:String(b)))}finally{a(!1)}},x=(b,C)=>{navigator.clipboard.writeText(b),u(C),setTimeout(()=>u(""),2e3)},g=(b,C)=>{o(N=>({...N,wechat:{...N.wechat,[b]:C}}))},v=(b,C)=>{o(N=>({...N,alipay:{...N.alipay,[b]:C}}))},y=(b,C)=>{o(N=>({...N,usdt:{...N.usdt,[b]:C}}))},E=(b,C)=>{o(N=>({...N,paypal:{...N.paypal,[b]:C}}))},_=l.wechat,k=l.alipay,w=l.usdt,j=l.paypal;return t.jsxs("div",{className:"p-8 w-full",children:[t.jsxs("div",{className:"flex justify-between items-center mb-8",children:[t.jsxs("div",{children:[t.jsx("h1",{className:"text-2xl font-bold mb-2 text-white",children:"支付配置"}),t.jsx("p",{className:"text-gray-400",children:"配置微信、支付宝、USDT、PayPal等支付参数"})]}),t.jsxs("div",{className:"flex gap-3",children:[t.jsxs(oe,{variant:"outline",onClick:f,className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:[t.jsx(Ze,{className:`w-4 h-4 mr-2 ${r?"animate-spin":""}`}),"同步配置"]}),t.jsxs(oe,{onClick:p,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:[t.jsx(Wt,{className:"w-4 h-4 mr-2"}),"保存配置"]})]})]}),t.jsx("div",{className:"mb-6 bg-[#07C160]/10 border border-[#07C160]/30 rounded-xl p-4",children:t.jsxs("div",{className:"flex items-start gap-3",children:[t.jsx(bp,{className:"w-5 h-5 text-[#07C160] flex-shrink-0 mt-0.5"}),t.jsxs("div",{className:"text-sm",children:[t.jsx("p",{className:"font-medium mb-2 text-[#07C160]",children:"如何获取微信群跳转链接?"}),t.jsxs("ol",{className:"text-[#07C160]/80 space-y-1 list-decimal list-inside",children:[t.jsx("li",{children:"打开微信,进入目标微信群"}),t.jsx("li",{children:'点击右上角"..." → "群二维码"'}),t.jsx("li",{children:'点击右上角"..." → "发送到电脑"'}),t.jsx("li",{children:"在电脑上保存二维码图片,上传到图床获取URL"}),t.jsx("li",{children:"或使用草料二维码等工具解析二维码获取链接"})]}),t.jsx("p",{className:"text-[#07C160]/60 mt-2",children:"提示:微信群二维码7天后失效,建议使用活码工具"})]})]})}),t.jsxs(nu,{defaultValue:"wechat",className:"space-y-6",children:[t.jsxs(Vi,{className:"bg-[#0f2137] border border-gray-700/50 p-1 grid grid-cols-4 w-full",children:[t.jsxs(an,{value:"wechat",className:"data-[state=active]:bg-[#07C160]/20 data-[state=active]:text-[#07C160] text-gray-400",children:[t.jsx(xd,{className:"w-4 h-4 mr-2"}),"微信"]}),t.jsxs(an,{value:"alipay",className:"data-[state=active]:bg-[#1677FF]/20 data-[state=active]:text-[#1677FF] text-gray-400",children:[t.jsx(hd,{className:"w-4 h-4 mr-2"}),"支付宝"]}),t.jsxs(an,{value:"usdt",className:"data-[state=active]:bg-[#26A17B]/20 data-[state=active]:text-[#26A17B] text-gray-400",children:[t.jsx(vm,{className:"w-4 h-4 mr-2"}),"USDT"]}),t.jsxs(an,{value:"paypal",className:"data-[state=active]:bg-[#003087]/20 data-[state=active]:text-[#169BD7] text-gray-400",children:[t.jsx(md,{className:"w-4 h-4 mr-2"}),"PayPal"]})]}),t.jsx(ln,{value:"wechat",className:"space-y-4",children:t.jsxs(ke,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:[t.jsxs($e,{className:"flex flex-row items-center justify-between pb-2",children:[t.jsxs("div",{className:"space-y-1",children:[t.jsxs(Be,{className:"text-[#07C160] flex items-center gap-2",children:[t.jsx(xd,{className:"w-5 h-5"}),"微信支付配置"]}),t.jsx(ot,{className:"text-gray-400",children:"配置微信支付参数和跳转链接"})]}),t.jsx(ht,{checked:!!_.enabled,onCheckedChange:b=>g("enabled",b)})]}),t.jsxs(Ee,{className:"space-y-4",children:[t.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[t.jsxs("div",{className:"space-y-2",children:[t.jsx(Z,{className:"text-gray-300",children:"网站AppID"}),t.jsx(ne,{className:"bg-[#0a1628] border-gray-700 text-white font-mono text-sm",value:String(_.websiteAppId??""),onChange:b=>g("websiteAppId",b.target.value)})]}),t.jsxs("div",{className:"space-y-2",children:[t.jsx(Z,{className:"text-gray-300",children:"商户号"}),t.jsx(ne,{className:"bg-[#0a1628] border-gray-700 text-white font-mono text-sm",value:String(_.merchantId??""),onChange:b=>g("merchantId",b.target.value)})]})]}),t.jsxs("div",{className:"border-t border-gray-700/50 pt-4 space-y-4",children:[t.jsxs("h4",{className:"text-white font-medium flex items-center gap-2",children:[t.jsx(ji,{className:"w-4 h-4 text-[#38bdac]"}),"跳转链接配置(核心功能)"]}),t.jsxs("div",{className:"space-y-2",children:[t.jsx(Z,{className:"text-gray-300",children:"微信收款码/支付链接"}),t.jsx(ne,{className:"bg-[#0a1628] border-gray-700 text-white placeholder:text-gray-500",placeholder:"https://收款码图片URL 或 weixin://支付链接",value:String(_.qrCode??""),onChange:b=>g("qrCode",b.target.value)}),t.jsx("p",{className:"text-xs text-gray-500",children:"用户点击微信支付后显示的二维码图片URL"})]}),t.jsxs("div",{className:"space-y-2 bg-[#07C160]/5 p-4 rounded-xl border border-[#07C160]/20",children:[t.jsx(Z,{className:"text-[#07C160] font-medium",children:"微信群跳转链接(支付成功后跳转)"}),t.jsx(ne,{className:"bg-[#0a1628] border-[#07C160]/30 text-white placeholder:text-gray-500",placeholder:"https://weixin.qq.com/g/... 或微信群二维码图片URL",value:String(_.groupQrCode??""),onChange:b=>g("groupQrCode",b.target.value)}),t.jsx("p",{className:"text-xs text-[#07C160]/70",children:"用户支付成功后将自动跳转到此链接,进入指定微信群"})]})]})]})]})}),t.jsx(ln,{value:"alipay",className:"space-y-4",children:t.jsxs(ke,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:[t.jsxs($e,{className:"flex flex-row items-center justify-between pb-2",children:[t.jsxs("div",{className:"space-y-1",children:[t.jsxs(Be,{className:"text-[#1677FF] flex items-center gap-2",children:[t.jsx(hd,{className:"w-5 h-5"}),"支付宝配置"]}),t.jsx(ot,{className:"text-gray-400",children:"已加载真实支付宝参数"})]}),t.jsx(ht,{checked:!!k.enabled,onCheckedChange:b=>v("enabled",b)})]}),t.jsxs(Ee,{className:"space-y-4",children:[t.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[t.jsxs("div",{className:"space-y-2",children:[t.jsx(Z,{className:"text-gray-300",children:"合作者身份 (PID)"}),t.jsxs("div",{className:"flex gap-2",children:[t.jsx(ne,{className:"bg-[#0a1628] border-gray-700 text-white font-mono text-sm",value:String(k.partnerId??""),onChange:b=>v("partnerId",b.target.value)}),t.jsx(oe,{size:"icon",variant:"outline",className:"border-gray-700 bg-transparent",onClick:()=>x(String(k.partnerId??""),"pid"),children:c==="pid"?t.jsx(Mi,{className:"w-4 h-4 text-green-500"}):t.jsx(Sp,{className:"w-4 h-4 text-gray-400"})})]})]}),t.jsxs("div",{className:"space-y-2",children:[t.jsx(Z,{className:"text-gray-300",children:"安全校验码 (Key)"}),t.jsx(ne,{type:"password",className:"bg-[#0a1628] border-gray-700 text-white font-mono text-sm",value:String(k.securityKey??""),onChange:b=>v("securityKey",b.target.value)})]})]}),t.jsxs("div",{className:"border-t border-gray-700/50 pt-4 space-y-4",children:[t.jsxs("h4",{className:"text-white font-medium flex items-center gap-2",children:[t.jsx(ji,{className:"w-4 h-4 text-[#38bdac]"}),"跳转链接配置"]}),t.jsxs("div",{className:"space-y-2",children:[t.jsx(Z,{className:"text-gray-300",children:"支付宝收款码/跳转链接"}),t.jsx(ne,{className:"bg-[#0a1628] border-gray-700 text-white placeholder:text-gray-500",placeholder:"https://qr.alipay.com/... 或收款码图片URL",value:String(k.qrCode??""),onChange:b=>v("qrCode",b.target.value)}),t.jsx("p",{className:"text-xs text-gray-500",children:"用户点击支付宝支付后显示的二维码"})]})]})]})]})}),t.jsx(ln,{value:"usdt",className:"space-y-4",children:t.jsxs(ke,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:[t.jsxs($e,{className:"flex flex-row items-center justify-between pb-2",children:[t.jsxs("div",{className:"space-y-1",children:[t.jsxs(Be,{className:"text-[#26A17B] flex items-center gap-2",children:[t.jsx(vm,{className:"w-5 h-5"}),"USDT配置"]}),t.jsx(ot,{className:"text-gray-400",children:"配置加密货币收款地址"})]}),t.jsx(ht,{checked:!!w.enabled,onCheckedChange:b=>y("enabled",b)})]}),t.jsxs(Ee,{className:"space-y-4",children:[t.jsxs("div",{className:"space-y-2",children:[t.jsx(Z,{className:"text-gray-300",children:"网络类型"}),t.jsxs("select",{className:"w-full bg-[#0a1628] border border-gray-700 text-white rounded-md p-2",value:String(w.network??"TRC20"),onChange:b=>y("network",b.target.value),children:[t.jsx("option",{value:"TRC20",children:"TRC20 (波场)"}),t.jsx("option",{value:"ERC20",children:"ERC20 (以太坊)"}),t.jsx("option",{value:"BEP20",children:"BEP20 (币安链)"})]})]}),t.jsxs("div",{className:"space-y-2",children:[t.jsx(Z,{className:"text-gray-300",children:"收款地址"}),t.jsx(ne,{className:"bg-[#0a1628] border-gray-700 text-white font-mono text-sm",placeholder:"T... (TRC20地址)",value:String(w.address??""),onChange:b=>y("address",b.target.value)})]}),t.jsxs("div",{className:"space-y-2",children:[t.jsx(Z,{className:"text-gray-300",children:"汇率 (1 USD = ? CNY)"}),t.jsx(ne,{type:"number",className:"bg-[#0a1628] border-gray-700 text-white",value:Number(w.exchangeRate)??7.2,onChange:b=>y("exchangeRate",Number.parseFloat(b.target.value)||7.2)})]})]})]})}),t.jsx(ln,{value:"paypal",className:"space-y-4",children:t.jsxs(ke,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:[t.jsxs($e,{className:"flex flex-row items-center justify-between pb-2",children:[t.jsxs("div",{className:"space-y-1",children:[t.jsxs(Be,{className:"text-[#169BD7] flex items-center gap-2",children:[t.jsx(md,{className:"w-5 h-5"}),"PayPal配置"]}),t.jsx(ot,{className:"text-gray-400",children:"配置PayPal收款账户"})]}),t.jsx(ht,{checked:!!j.enabled,onCheckedChange:b=>E("enabled",b)})]}),t.jsxs(Ee,{className:"space-y-4",children:[t.jsxs("div",{className:"space-y-2",children:[t.jsx(Z,{className:"text-gray-300",children:"PayPal邮箱"}),t.jsx(ne,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"your@email.com",value:String(j.email??""),onChange:b=>E("email",b.target.value)})]}),t.jsxs("div",{className:"space-y-2",children:[t.jsx(Z,{className:"text-gray-300",children:"汇率 (1 USD = ? CNY)"}),t.jsx(ne,{type:"number",className:"bg-[#0a1628] border-gray-700 text-white",value:Number(j.exchangeRate)??7.2,onChange:b=>E("exchangeRate",Number(b.target.value)||7.2)})]})]})]})})]})]})}const n4={siteName:"卡若日记",siteTitle:"一场SOUL的创业实验场",siteDescription:"来自Soul派对房的真实商业故事",logo:"/logo.png",favicon:"/favicon.ico",primaryColor:"#00CED1"},r4={home:{enabled:!0,label:"首页"},chapters:{enabled:!0,label:"目录"},match:{enabled:!0,label:"匹配"},my:{enabled:!0,label:"我的"}},s4={homeTitle:"一场SOUL的创业实验场",homeSubtitle:"来自Soul派对房的真实商业故事",chaptersTitle:"我要看",matchTitle:"语音匹配",myTitle:"我的",aboutTitle:"关于作者"};function a4(){const[r,a]=h.useState({siteConfig:{...n4},menuConfig:{...r4},pageConfig:{...s4}}),[l,o]=h.useState(!1),[c,u]=h.useState(!1);h.useEffect(()=>{We("/api/config").then(v=>{v!=null&&v.siteConfig&&a(y=>({...y,siteConfig:{...y.siteConfig,...v.siteConfig}})),v!=null&&v.menuConfig&&a(y=>({...y,menuConfig:{...y.menuConfig,...v.menuConfig}})),v!=null&&v.pageConfig&&a(y=>({...y,pageConfig:{...y.pageConfig,...v.pageConfig}}))}).catch(console.error)},[]);const f=async()=>{u(!0);try{await jt("/api/db/config",{key:"site_config",value:r.siteConfig,description:"网站基础配置"}),await jt("/api/db/config",{key:"menu_config",value:r.menuConfig,description:"底部菜单配置"}),await jt("/api/db/config",{key:"page_config",value:r.pageConfig,description:"页面标题配置"}),o(!0),setTimeout(()=>o(!1),2e3),alert("配置已保存")}catch(v){console.error(v),alert("保存失败: "+(v instanceof Error?v.message:String(v)))}finally{u(!1)}},p=r.siteConfig,x=r.menuConfig,g=r.pageConfig;return t.jsxs("div",{className:"p-8 w-full",children:[t.jsxs("div",{className:"flex justify-between items-center mb-8",children:[t.jsxs("div",{children:[t.jsx("h2",{className:"text-2xl font-bold text-white",children:"网站配置"}),t.jsx("p",{className:"text-gray-400 mt-1",children:"配置网站名称、图标、菜单和页面标题"})]}),t.jsxs(oe,{onClick:f,disabled:c,className:`${l?"bg-green-500":"bg-[#00CED1]"} hover:bg-[#20B2AA] text-white transition-colors`,children:[t.jsx(Wt,{className:"w-4 h-4 mr-2"}),c?"保存中...":l?"已保存":"保存设置"]})]}),t.jsxs("div",{className:"space-y-6",children:[t.jsxs(ke,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:[t.jsxs($e,{children:[t.jsxs(Be,{className:"text-white flex items-center gap-2",children:[t.jsx(md,{className:"w-5 h-5 text-[#00CED1]"}),"网站基础信息"]}),t.jsx(ot,{className:"text-gray-400",children:"配置网站名称、标题和描述"})]}),t.jsxs(Ee,{className:"space-y-4",children:[t.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[t.jsxs("div",{className:"space-y-2",children:[t.jsx(Z,{htmlFor:"site-name",className:"text-gray-300",children:"网站名称"}),t.jsx(ne,{id:"site-name",className:"bg-[#0a1628] border-gray-700 text-white",value:p.siteName??"",onChange:v=>a(y=>({...y,siteConfig:{...y.siteConfig,siteName:v.target.value}}))})]}),t.jsxs("div",{className:"space-y-2",children:[t.jsx(Z,{htmlFor:"site-title",className:"text-gray-300",children:"网站标题"}),t.jsx(ne,{id:"site-title",className:"bg-[#0a1628] border-gray-700 text-white",value:p.siteTitle??"",onChange:v=>a(y=>({...y,siteConfig:{...y.siteConfig,siteTitle:v.target.value}}))})]})]}),t.jsxs("div",{className:"space-y-2",children:[t.jsx(Z,{htmlFor:"site-desc",className:"text-gray-300",children:"网站描述"}),t.jsx(ne,{id:"site-desc",className:"bg-[#0a1628] border-gray-700 text-white",value:p.siteDescription??"",onChange:v=>a(y=>({...y,siteConfig:{...y.siteConfig,siteDescription:v.target.value}}))})]}),t.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[t.jsxs("div",{className:"space-y-2",children:[t.jsx(Z,{htmlFor:"logo",className:"text-gray-300",children:"Logo地址"}),t.jsx(ne,{id:"logo",className:"bg-[#0a1628] border-gray-700 text-white",value:p.logo??"",onChange:v=>a(y=>({...y,siteConfig:{...y.siteConfig,logo:v.target.value}}))})]}),t.jsxs("div",{className:"space-y-2",children:[t.jsx(Z,{htmlFor:"favicon",className:"text-gray-300",children:"Favicon地址"}),t.jsx(ne,{id:"favicon",className:"bg-[#0a1628] border-gray-700 text-white",value:p.favicon??"",onChange:v=>a(y=>({...y,siteConfig:{...y.siteConfig,favicon:v.target.value}}))})]})]})]})]}),t.jsxs(ke,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:[t.jsxs($e,{children:[t.jsxs(Be,{className:"text-white flex items-center gap-2",children:[t.jsx(SN,{className:"w-5 h-5 text-[#00CED1]"}),"主题颜色"]}),t.jsx(ot,{className:"text-gray-400",children:"配置网站主题色"})]}),t.jsx(Ee,{children:t.jsxs("div",{className:"flex items-center gap-4",children:[t.jsxs("div",{className:"space-y-2 flex-1",children:[t.jsx(Z,{htmlFor:"primary-color",className:"text-gray-300",children:"主色调"}),t.jsxs("div",{className:"flex items-center gap-3",children:[t.jsx(ne,{id:"primary-color",type:"color",className:"w-16 h-10 bg-[#0a1628] border-gray-700 cursor-pointer p-1",value:p.primaryColor??"#00CED1",onChange:v=>a(y=>({...y,siteConfig:{...y.siteConfig,primaryColor:v.target.value}}))}),t.jsx(ne,{className:"bg-[#0a1628] border-gray-700 text-white flex-1",value:p.primaryColor??"#00CED1",onChange:v=>a(y=>({...y,siteConfig:{...y.siteConfig,primaryColor:v.target.value}}))})]})]}),t.jsx("div",{className:"w-24 h-24 rounded-xl flex items-center justify-center text-white font-bold",style:{backgroundColor:p.primaryColor??"#00CED1"},children:"预览"})]})})]}),t.jsxs(ke,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:[t.jsxs($e,{children:[t.jsxs(Be,{className:"text-white flex items-center gap-2",children:[t.jsx(jN,{className:"w-5 h-5 text-[#00CED1]"}),"底部菜单配置"]}),t.jsx(ot,{className:"text-gray-400",children:"控制底部导航栏菜单的显示和名称"})]}),t.jsx(Ee,{className:"space-y-4",children:Object.entries(x).map(([v,y])=>t.jsxs("div",{className:"flex items-center justify-between p-4 bg-[#0a1628] rounded-lg",children:[t.jsxs("div",{className:"flex items-center gap-4 flex-1",children:[t.jsx(ht,{checked:(y==null?void 0:y.enabled)??!0,onCheckedChange:E=>a(_=>({..._,menuConfig:{..._.menuConfig,[v]:{...y,enabled:E}}}))}),t.jsx("span",{className:"text-gray-300 w-16 capitalize",children:v}),t.jsx(ne,{className:"bg-[#0f2137] border-gray-700 text-white max-w-[200px]",value:(y==null?void 0:y.label)??"",onChange:E=>a(_=>({..._,menuConfig:{..._.menuConfig,[v]:{...y,label:E.target.value}}}))})]}),t.jsx("span",{className:`text-sm ${y!=null&&y.enabled?"text-green-400":"text-gray-500"}`,children:y!=null&&y.enabled?"显示":"隐藏"})]},v))})]}),t.jsxs(ke,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:[t.jsxs($e,{children:[t.jsxs(Be,{className:"text-white flex items-center gap-2",children:[t.jsx(Kj,{className:"w-5 h-5 text-[#00CED1]"}),"页面标题配置"]}),t.jsx(ot,{className:"text-gray-400",children:"配置各个页面的标题和副标题"})]}),t.jsxs(Ee,{className:"space-y-4",children:[t.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[t.jsxs("div",{className:"space-y-2",children:[t.jsx(Z,{className:"text-gray-300",children:"首页标题"}),t.jsx(ne,{className:"bg-[#0a1628] border-gray-700 text-white",value:g.homeTitle??"",onChange:v=>a(y=>({...y,pageConfig:{...y.pageConfig,homeTitle:v.target.value}}))})]}),t.jsxs("div",{className:"space-y-2",children:[t.jsx(Z,{className:"text-gray-300",children:"首页副标题"}),t.jsx(ne,{className:"bg-[#0a1628] border-gray-700 text-white",value:g.homeSubtitle??"",onChange:v=>a(y=>({...y,pageConfig:{...y.pageConfig,homeSubtitle:v.target.value}}))})]})]}),t.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[t.jsxs("div",{className:"space-y-2",children:[t.jsx(Z,{className:"text-gray-300",children:"目录页标题"}),t.jsx(ne,{className:"bg-[#0a1628] border-gray-700 text-white",value:g.chaptersTitle??"",onChange:v=>a(y=>({...y,pageConfig:{...y.pageConfig,chaptersTitle:v.target.value}}))})]}),t.jsxs("div",{className:"space-y-2",children:[t.jsx(Z,{className:"text-gray-300",children:"匹配页标题"}),t.jsx(ne,{className:"bg-[#0a1628] border-gray-700 text-white",value:g.matchTitle??"",onChange:v=>a(y=>({...y,pageConfig:{...y.pageConfig,matchTitle:v.target.value}}))})]})]}),t.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[t.jsxs("div",{className:"space-y-2",children:[t.jsx(Z,{className:"text-gray-300",children:"我的页标题"}),t.jsx(ne,{className:"bg-[#0a1628] border-gray-700 text-white",value:g.myTitle??"",onChange:v=>a(y=>({...y,pageConfig:{...y.pageConfig,myTitle:v.target.value}}))})]}),t.jsxs("div",{className:"space-y-2",children:[t.jsx(Z,{className:"text-gray-300",children:"关于作者标题"}),t.jsx(ne,{className:"bg-[#0a1628] border-gray-700 text-white",value:g.aboutTitle??"",onChange:v=>a(y=>({...y,pageConfig:{...y.pageConfig,aboutTitle:v.target.value}}))})]})]})]})]})]})]})}function l4(){const[r,a]=h.useState(""),[l,o]=h.useState(""),[c,u]=h.useState(""),[f,p]=h.useState({}),x=async()=>{var _,k,w,j;try{const b=await We("/api/config"),C=(k=(_=b==null?void 0:b.liveQRCodes)==null?void 0:_[0])==null?void 0:k.urls;Array.isArray(C)&&a(C.join(` +`));const N=(j=(w=b==null?void 0:b.paymentMethods)==null?void 0:w.wechat)==null?void 0:j.groupQrCode;N&&o(N),p({paymentMethods:b==null?void 0:b.paymentMethods,liveQRCodes:b==null?void 0:b.liveQRCodes})}catch(b){console.error(b)}};h.useEffect(()=>{x()},[]);const g=(_,k)=>{navigator.clipboard.writeText(_),u(k),setTimeout(()=>u(""),2e3)},v=async()=>{try{const _=r.split(` +`).map(w=>w.trim()).filter(Boolean),k=[...f.liveQRCodes||[]];k[0]?k[0].urls=_:k.push({id:"live-1",name:"微信群活码",urls:_,clickCount:0}),await jt("/api/db/config",{key:"live_qr_codes",value:k,description:"群活码配置"}),alert("群活码配置已保存!"),await x()}catch(_){console.error(_),alert("保存失败: "+(_ instanceof Error?_.message:String(_)))}},y=async()=>{var _;try{await jt("/api/db/config",{key:"payment_methods",value:{...f.paymentMethods||{},wechat:{...((_=f.paymentMethods)==null?void 0:_.wechat)||{},groupQrCode:l}},description:"支付方式配置"}),alert("微信群链接已保存!用户支付成功后将自动跳转"),await x()}catch(k){console.error(k),alert("保存失败: "+(k instanceof Error?k.message:String(k)))}},E=()=>{l?window.open(l,"_blank"):alert("请先配置微信群链接")};return t.jsxs("div",{className:"p-8 w-full",children:[t.jsxs("div",{className:"mb-8",children:[t.jsx("h2",{className:"text-2xl font-bold text-white",children:"微信群活码管理"}),t.jsx("p",{className:"text-gray-400 mt-1",children:"配置微信群跳转链接,用户支付后自动跳转加群"})]}),t.jsx("div",{className:"mb-6 bg-[#07C160]/10 border border-[#07C160]/30 rounded-xl p-4",children:t.jsxs("div",{className:"flex items-start gap-3",children:[t.jsx(bp,{className:"w-5 h-5 text-[#07C160] flex-shrink-0 mt-0.5"}),t.jsxs("div",{className:"text-sm",children:[t.jsx("p",{className:"font-medium mb-2 text-[#07C160]",children:"微信群活码配置指南"}),t.jsxs("div",{className:"text-[#07C160]/80 space-y-2",children:[t.jsx("p",{className:"font-medium",children:"方法一:使用草料活码(推荐)"}),t.jsxs("ol",{className:"list-decimal list-inside space-y-1 pl-2",children:[t.jsx("li",{children:"访问草料二维码创建活码"}),t.jsx("li",{children:"上传微信群二维码图片,生成永久链接"}),t.jsx("li",{children:"复制生成的短链接填入下方配置"}),t.jsx("li",{children:"群满后可直接在草料后台更换新群码,链接不变"})]}),t.jsx("p",{className:"font-medium mt-3",children:"方法二:直接使用微信群链接"}),t.jsxs("ol",{className:"list-decimal list-inside space-y-1 pl-2",children:[t.jsx("li",{children:'微信打开目标群 → 右上角"..." → 群二维码'}),t.jsx("li",{children:"长按二维码 → 识别二维码 → 复制链接"})]}),t.jsx("p",{className:"text-[#07C160]/60 mt-2",children:"注意:微信原生群二维码7天后失效,建议使用草料活码"})]})]})]})}),t.jsxs("div",{className:"grid gap-6 md:grid-cols-2",children:[t.jsxs(ke,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl md:col-span-2",children:[t.jsxs($e,{children:[t.jsxs(Be,{className:"text-[#07C160] flex items-center gap-2",children:[t.jsx(Sm,{className:"w-5 h-5"}),"支付成功跳转链接(核心配置)"]}),t.jsx(ot,{className:"text-gray-400",children:"用户支付完成后自动跳转到此链接,进入指定微信群"})]}),t.jsxs(Ee,{className:"space-y-4",children:[t.jsxs("div",{className:"space-y-2",children:[t.jsxs(Z,{className:"text-gray-300 flex items-center gap-2",children:[t.jsx(wm,{className:"w-4 h-4"}),"微信群链接 / 活码链接"]}),t.jsxs("div",{className:"flex gap-2",children:[t.jsx(ne,{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:_=>o(_.target.value)}),t.jsx(oe,{variant:"outline",size:"icon",className:"border-gray-700 bg-transparent hover:bg-gray-700/50",onClick:()=>g(l,"group"),children:c==="group"?t.jsx(Mi,{className:"w-4 h-4 text-green-500"}):t.jsx(Sp,{className:"w-4 h-4 text-gray-400"})})]}),t.jsxs("p",{className:"text-xs text-gray-500 flex items-center gap-1",children:[t.jsx(ji,{className:"w-3 h-3"}),"支持格式:草料短链、微信群链接(https://weixin.qq.com/g/...)、企业微信链接等"]})]}),t.jsxs("div",{className:"flex gap-3",children:[t.jsxs(oe,{onClick:y,className:"flex-1 bg-[#07C160] hover:bg-[#06AD51] text-white",children:[t.jsx(bi,{className:"w-4 h-4 mr-2"}),"保存配置"]}),t.jsxs(oe,{onClick:E,variant:"outline",className:"border-[#07C160] text-[#07C160] hover:bg-[#07C160]/10 bg-transparent",children:[t.jsx(ji,{className:"w-4 h-4 mr-2"}),"测试跳转"]})]})]})]}),t.jsxs(ke,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl md:col-span-2",children:[t.jsxs($e,{children:[t.jsxs(Be,{className:"text-white flex items-center gap-2",children:[t.jsx(Sm,{className:"w-5 h-5 text-[#38bdac]"}),"多群轮换(高级配置)"]}),t.jsx(ot,{className:"text-gray-400",children:"配置多个群链接,系统自动轮换分配,避免单群满员"})]}),t.jsxs(Ee,{className:"space-y-4",children:[t.jsxs("div",{className:"space-y-2",children:[t.jsxs(Z,{className:"text-gray-300 flex items-center gap-2",children:[t.jsx(wm,{className:"w-4 h-4"}),"多个群链接(每行一个)"]}),t.jsx(Xr,{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:_=>a(_.target.value)}),t.jsx("p",{className:"text-xs text-gray-500",children:"每行填写一个群链接,系统将按顺序或随机分配"})]}),t.jsxs("div",{className:"flex items-center justify-between p-3 bg-[#0a1628] rounded-lg border border-gray-700/50",children:[t.jsx("span",{className:"text-sm text-gray-400",children:"已配置群数量"}),t.jsxs("span",{className:"font-bold text-[#38bdac]",children:[r.split(` +`).filter(Boolean).length," 个"]})]}),t.jsxs(oe,{onClick:v,className:"w-full bg-[#38bdac] hover:bg-[#2da396] text-white",children:[t.jsx(bi,{className:"w-4 h-4 mr-2"}),"保存多群配置"]})]})]})]}),t.jsxs("div",{className:"mt-6 bg-[#0f2137] rounded-xl p-4 border border-gray-700/50",children:[t.jsx("h4",{className:"text-white font-medium mb-3",children:"常见问题"}),t.jsxs("div",{className:"space-y-3 text-sm",children:[t.jsxs("div",{children:[t.jsx("p",{className:"text-[#38bdac]",children:"Q: 为什么推荐使用草料活码?"}),t.jsx("p",{className:"text-gray-400",children:"A: 草料活码是永久链接,群满后可直接在后台更换新群码,无需修改网站配置。微信原生群码7天失效。"})]}),t.jsxs("div",{children:[t.jsx("p",{className:"text-[#38bdac]",children:"Q: 支付后没有跳转怎么办?"}),t.jsx("p",{className:"text-gray-400",children:"A: 1) 检查链接是否正确填写 2) 部分浏览器可能拦截弹窗,用户需手动允许 3) 建议使用https开头的链接"})]})]})]})]})}const ip={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}},i4=["⭐","👥","❤️","🎮","💼","🚀","💡","🎯","🔥","✨"];function o4(){const[r,a]=h.useState(ip),[l,o]=h.useState(!0),[c,u]=h.useState(!1),[f,p]=h.useState(!1),[x,g]=h.useState(null),[v,y]=h.useState({id:"",label:"",matchLabel:"",icon:"⭐",matchFromDB:!1,showJoinAfterMatch:!0,price:1,enabled:!0}),E=async()=>{o(!0);try{const N=await We("/api/db/config/full?key=match_config"),A=(N==null?void 0:N.data)??(N==null?void 0:N.config);A&&a({...ip,...A})}catch(N){console.error("加载匹配配置失败:",N)}finally{o(!1)}};h.useEffect(()=>{E()},[]);const _=async()=>{u(!0);try{const N=await jt("/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{u(!1)}},k=N=>{g(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}),p(!0)},w=()=>{g(null),y({id:"",label:"",matchLabel:"",icon:"⭐",matchFromDB:!1,showJoinAfterMatch:!0,price:1,enabled:!0}),p(!0)},j=()=>{if(!v.id||!v.label){alert("请填写类型ID和名称");return}const N=[...r.matchTypes];if(x){const A=N.findIndex($=>$.id===x.id);A!==-1&&(N[A]={...v})}else{if(N.some(A=>A.id===v.id)){alert("类型ID已存在");return}N.push({...v})}a({...r,matchTypes:N}),p(!1)},b=N=>{confirm("确定要删除这个匹配类型吗?")&&a({...r,matchTypes:r.matchTypes.filter(A=>A.id!==N)})},C=N=>{a({...r,matchTypes:r.matchTypes.map(A=>A.id===N?{...A,enabled:!A.enabled}:A)})};return t.jsxs("div",{className:"p-8 w-full space-y-6",children:[t.jsxs("div",{className:"flex justify-between items-center",children:[t.jsxs("div",{children:[t.jsxs("h2",{className:"text-2xl font-bold text-white flex items-center gap-2",children:[t.jsx(Ni,{className:"w-6 h-6 text-[#38bdac]"}),"匹配功能配置"]}),t.jsx("p",{className:"text-gray-400 mt-1",children:"管理找伙伴功能的匹配类型和价格"})]}),t.jsxs("div",{className:"flex gap-3",children:[t.jsxs(oe,{variant:"outline",onClick:E,disabled:l,className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:[t.jsx(Ze,{className:`w-4 h-4 mr-2 ${l?"animate-spin":""}`}),"刷新"]}),t.jsxs(oe,{onClick:_,disabled:c,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:[t.jsx(Wt,{className:"w-4 h-4 mr-2"}),c?"保存中...":"保存配置"]})]})]}),t.jsxs(ke,{className:"bg-[#0f2137] border-gray-700/50",children:[t.jsxs($e,{children:[t.jsxs(Be,{className:"text-white flex items-center gap-2",children:[t.jsx(ZN,{className:"w-5 h-5 text-yellow-400"}),"基础设置"]}),t.jsx(ot,{className:"text-gray-400",children:"配置免费匹配次数和付费规则"})]}),t.jsxs(Ee,{className:"space-y-6",children:[t.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-6",children:[t.jsxs("div",{className:"space-y-2",children:[t.jsx(Z,{className:"text-gray-300",children:"每日免费匹配次数"}),t.jsx(ne,{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})}),t.jsx("p",{className:"text-xs text-gray-500",children:"用户每天可免费匹配的次数"})]}),t.jsxs("div",{className:"space-y-2",children:[t.jsx(Z,{className:"text-gray-300",children:"付费匹配价格(元)"}),t.jsx(ne,{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})}),t.jsx("p",{className:"text-xs text-gray-500",children:"免费次数用完后的单次匹配价格"})]}),t.jsxs("div",{className:"space-y-2",children:[t.jsx(Z,{className:"text-gray-300",children:"每日最大匹配次数"}),t.jsx(ne,{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}})}),t.jsx("p",{className:"text-xs text-gray-500",children:"包含免费和付费的总次数"})]})]}),t.jsxs("div",{className:"flex gap-8 pt-4 border-t border-gray-700/50",children:[t.jsxs("div",{className:"flex items-center gap-3",children:[t.jsx(ht,{checked:r.settings.enableFreeMatches,onCheckedChange:N=>a({...r,settings:{...r.settings,enableFreeMatches:N}})}),t.jsx(Z,{className:"text-gray-300",children:"启用免费匹配"})]}),t.jsxs("div",{className:"flex items-center gap-3",children:[t.jsx(ht,{checked:r.settings.enablePaidMatches,onCheckedChange:N=>a({...r,settings:{...r.settings,enablePaidMatches:N}})}),t.jsx(Z,{className:"text-gray-300",children:"启用付费匹配"})]})]})]})]}),t.jsxs(ke,{className:"bg-[#0f2137] border-gray-700/50",children:[t.jsxs($e,{className:"flex flex-row items-center justify-between",children:[t.jsxs("div",{children:[t.jsxs(Be,{className:"text-white flex items-center gap-2",children:[t.jsx(vn,{className:"w-5 h-5 text-[#38bdac]"}),"匹配类型管理"]}),t.jsx(ot,{className:"text-gray-400",children:"配置不同的匹配类型及其价格"})]}),t.jsxs(oe,{onClick:w,size:"sm",className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:[t.jsx(Rn,{className:"w-4 h-4 mr-1"}),"添加类型"]})]}),t.jsx(Ee,{children:t.jsxs(Yn,{children:[t.jsx(Qn,{children:t.jsxs(rt,{className:"bg-[#0a1628] hover:bg-[#0a1628] border-gray-700",children:[t.jsx(Pe,{className:"text-gray-400",children:"图标"}),t.jsx(Pe,{className:"text-gray-400",children:"类型ID"}),t.jsx(Pe,{className:"text-gray-400",children:"显示名称"}),t.jsx(Pe,{className:"text-gray-400",children:"匹配标签"}),t.jsx(Pe,{className:"text-gray-400",children:"价格"}),t.jsx(Pe,{className:"text-gray-400",children:"数据库匹配"}),t.jsx(Pe,{className:"text-gray-400",children:"状态"}),t.jsx(Pe,{className:"text-right text-gray-400",children:"操作"})]})}),t.jsx(qn,{children:r.matchTypes.map(N=>t.jsxs(rt,{className:"hover:bg-[#0a1628] border-gray-700/50",children:[t.jsx(we,{children:t.jsx("span",{className:"text-2xl",children:N.icon})}),t.jsx(we,{className:"font-mono text-gray-300",children:N.id}),t.jsx(we,{className:"text-white font-medium",children:N.label}),t.jsx(we,{className:"text-gray-300",children:N.matchLabel}),t.jsx(we,{children:t.jsxs(Me,{className:"bg-yellow-500/20 text-yellow-400 hover:bg-yellow-500/20 border-0",children:["¥",N.price]})}),t.jsx(we,{children:N.matchFromDB?t.jsx(Me,{className:"bg-green-500/20 text-green-400 hover:bg-green-500/20 border-0",children:"是"}):t.jsx(Me,{variant:"outline",className:"text-gray-500 border-gray-600",children:"否"})}),t.jsx(we,{children:t.jsx(ht,{checked:N.enabled,onCheckedChange:()=>C(N.id)})}),t.jsx(we,{className:"text-right",children:t.jsxs("div",{className:"flex items-center justify-end gap-1",children:[t.jsx(oe,{variant:"ghost",size:"sm",onClick:()=>k(N),className:"text-gray-400 hover:text-[#38bdac] hover:bg-[#38bdac]/10",children:t.jsx(sn,{className:"w-4 h-4"})}),t.jsx(oe,{variant:"ghost",size:"sm",onClick:()=>b(N.id),className:"text-red-400 hover:text-red-300 hover:bg-red-500/10",children:t.jsx(Vn,{className:"w-4 h-4"})})]})})]},N.id))})]})})]}),t.jsx(Bt,{open:f,onOpenChange:p,children:t.jsxs(It,{className:"bg-[#0f2137] border-gray-700 text-white max-w-lg",showCloseButton:!0,children:[t.jsx(Ut,{children:t.jsxs(Vt,{className:"text-white flex items-center gap-2",children:[x?t.jsx(sn,{className:"w-5 h-5 text-[#38bdac]"}):t.jsx(Rn,{className:"w-5 h-5 text-[#38bdac]"}),x?"编辑匹配类型":"添加匹配类型"]})}),t.jsxs("div",{className:"space-y-4 py-4",children:[t.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[t.jsxs("div",{className:"space-y-2",children:[t.jsx(Z,{className:"text-gray-300",children:"类型ID(英文)"}),t.jsx(ne,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"如: partner",value:v.id,onChange:N=>y({...v,id:N.target.value}),disabled:!!x})]}),t.jsxs("div",{className:"space-y-2",children:[t.jsx(Z,{className:"text-gray-300",children:"图标"}),t.jsx("div",{className:"flex gap-1 flex-wrap",children:i4.map(N=>t.jsx("button",{type:"button",className:`w-8 h-8 text-lg rounded ${v.icon===N?"bg-[#38bdac]/30 ring-1 ring-[#38bdac]":"bg-[#0a1628]"}`,onClick:()=>y({...v,icon:N}),children:N},N))})]})]}),t.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[t.jsxs("div",{className:"space-y-2",children:[t.jsx(Z,{className:"text-gray-300",children:"显示名称"}),t.jsx(ne,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"如: 创业合伙",value:v.label,onChange:N=>y({...v,label:N.target.value})})]}),t.jsxs("div",{className:"space-y-2",children:[t.jsx(Z,{className:"text-gray-300",children:"匹配标签"}),t.jsx(ne,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"如: 创业伙伴",value:v.matchLabel,onChange:N=>y({...v,matchLabel:N.target.value})})]})]}),t.jsxs("div",{className:"space-y-2",children:[t.jsx(Z,{className:"text-gray-300",children:"单次匹配价格(元)"}),t.jsx(ne,{type:"number",min:.01,step:.01,className:"bg-[#0a1628] border-gray-700 text-white",value:v.price,onChange:N=>y({...v,price:parseFloat(N.target.value)||1})})]}),t.jsxs("div",{className:"flex gap-6 pt-2",children:[t.jsxs("div",{className:"flex items-center gap-3",children:[t.jsx(ht,{checked:v.matchFromDB,onCheckedChange:N=>y({...v,matchFromDB:N})}),t.jsx(Z,{className:"text-gray-300 text-sm",children:"从数据库匹配"})]}),t.jsxs("div",{className:"flex items-center gap-3",children:[t.jsx(ht,{checked:v.showJoinAfterMatch,onCheckedChange:N=>y({...v,showJoinAfterMatch:N})}),t.jsx(Z,{className:"text-gray-300 text-sm",children:"匹配后显示加入"})]}),t.jsxs("div",{className:"flex items-center gap-3",children:[t.jsx(ht,{checked:v.enabled,onCheckedChange:N=>y({...v,enabled:N})}),t.jsx(Z,{className:"text-gray-300 text-sm",children:"启用"})]})]})]}),t.jsxs(qt,{children:[t.jsx(oe,{variant:"outline",onClick:()=>p(!1),className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:"取消"}),t.jsxs(oe,{onClick:j,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:[t.jsx(Wt,{className:"w-4 h-4 mr-2"}),"保存"]})]})]})})]})}const op={partner:"找伙伴",investor:"资源对接",mentor:"导师顾问",team:"团队招募"};function c4(){const[r,a]=h.useState([]),[l,o]=h.useState(0),[c,u]=h.useState(1),[f,p]=h.useState(10),[x,g]=h.useState(""),[v,y]=h.useState(!0),[E,_]=h.useState(null);async function k(){y(!0),_(null);try{const j=new URLSearchParams({page:String(c),pageSize:String(f)});x&&j.set("matchType",x);const b=await We(`/api/db/match-records?${j}`);b!=null&&b.success?(a(b.records||[]),o(b.total??0)):_("加载匹配记录失败")}catch(j){console.error("加载匹配记录失败",j),_("加载失败,请检查网络后重试")}finally{y(!1)}}h.useEffect(()=>{k()},[c,x]);const w=Math.ceil(l/f)||1;return t.jsxs("div",{className:"p-8 w-full",children:[E&&t.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:[t.jsx("span",{children:E}),t.jsx("button",{type:"button",onClick:()=>_(null),className:"hover:text-red-300",children:"×"})]}),t.jsxs("div",{className:"flex justify-between items-center mb-8",children:[t.jsxs("div",{children:[t.jsx("h2",{className:"text-2xl font-bold text-white",children:"匹配记录"}),t.jsxs("p",{className:"text-gray-400 mt-1",children:["找伙伴匹配统计,共 ",l," 条记录"]})]}),t.jsxs("div",{className:"flex items-center gap-4",children:[t.jsxs("select",{value:x,onChange:j=>{g(j.target.value),u(1)},className:"bg-[#0f2137] border border-gray-700 text-white rounded-lg px-3 py-2 text-sm",children:[t.jsx("option",{value:"",children:"全部类型"}),Object.entries(op).map(([j,b])=>t.jsx("option",{value:j,children:b},j))]}),t.jsxs("button",{type:"button",onClick:k,disabled:v,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:[t.jsx(Ze,{className:`w-4 h-4 ${v?"animate-spin":""}`}),"刷新"]})]})]}),t.jsx(ke,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:t.jsx(Ee,{className:"p-0",children:v?t.jsxs("div",{className:"flex justify-center py-12",children:[t.jsx(Ze,{className:"w-6 h-6 text-[#38bdac] animate-spin"}),t.jsx("span",{className:"ml-2 text-gray-400",children:"加载中..."})]}):t.jsxs(t.Fragment,{children:[t.jsxs(Yn,{children:[t.jsx(Qn,{children:t.jsxs(rt,{className:"bg-[#0a1628] hover:bg-[#0a1628] border-gray-700",children:[t.jsx(Pe,{className:"text-gray-400",children:"发起人"}),t.jsx(Pe,{className:"text-gray-400",children:"匹配到"}),t.jsx(Pe,{className:"text-gray-400",children:"类型"}),t.jsx(Pe,{className:"text-gray-400",children:"联系方式"}),t.jsx(Pe,{className:"text-gray-400",children:"匹配时间"})]})}),t.jsxs(qn,{children:[r.map(j=>t.jsxs(rt,{className:"hover:bg-[#0a1628] border-gray-700/50",children:[t.jsx(we,{children:t.jsxs("div",{className:"flex items-center gap-3",children:[t.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:[j.userAvatar?t.jsx("img",{src:j.userAvatar,alt:"",className:"w-full h-full object-cover",onError:b=>{b.currentTarget.style.display="none";const C=b.currentTarget.nextElementSibling;C&&C.classList.remove("hidden")}}):null,t.jsx("span",{className:j.userAvatar?"hidden":"",children:(j.userNickname||j.userId||"?").charAt(0)})]}),t.jsxs("div",{children:[t.jsx("div",{className:"text-white",children:j.userNickname||j.userId}),t.jsxs("div",{className:"text-xs text-gray-500 font-mono",children:[j.userId.slice(0,16),"..."]})]})]})}),t.jsx(we,{children:t.jsxs("div",{className:"flex items-center gap-3",children:[t.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:[j.matchedUserAvatar?t.jsx("img",{src:j.matchedUserAvatar,alt:"",className:"w-full h-full object-cover",onError:b=>{b.currentTarget.style.display="none";const C=b.currentTarget.nextElementSibling;C&&C.classList.remove("hidden")}}):null,t.jsx("span",{className:j.matchedUserAvatar?"hidden":"",children:(j.matchedNickname||j.matchedUserId||"?").charAt(0)})]}),t.jsxs("div",{children:[t.jsx("div",{className:"text-white",children:j.matchedNickname||j.matchedUserId}),t.jsxs("div",{className:"text-xs text-gray-500 font-mono",children:[j.matchedUserId.slice(0,16),"..."]})]})]})}),t.jsx(we,{children:t.jsx(Me,{className:"bg-[#38bdac]/20 text-[#38bdac] border-0",children:op[j.matchType]||j.matchType})}),t.jsxs(we,{className:"text-gray-400 text-sm",children:[j.phone&&t.jsxs("div",{children:["📱 ",j.phone]}),j.wechatId&&t.jsxs("div",{children:["💬 ",j.wechatId]}),!j.phone&&!j.wechatId&&"-"]}),t.jsx(we,{className:"text-gray-400",children:j.createdAt?new Date(j.createdAt).toLocaleString():"-"})]},j.id)),r.length===0&&t.jsx(rt,{children:t.jsx(we,{colSpan:5,className:"text-center py-12 text-gray-500",children:"暂无匹配记录"})})]})]}),t.jsx(Sr,{page:c,totalPages:w,total:l,pageSize:f,onPageChange:u,onPageSizeChange:j=>{p(j),u(1)}})]})})})]})}function d4(){const[r,a]=h.useState([]),[l,o]=h.useState(!0),[c,u]=h.useState(!1),[f,p]=h.useState(null),[x,g]=h.useState(""),[v,y]=h.useState(0),[E,_]=h.useState(!1);async function k(){o(!0);try{const N=await We("/api/db/vip-roles");N!=null&&N.success&&N.data&&a(N.data)}catch(N){console.error("Load roles error:",N)}finally{o(!1)}}h.useEffect(()=>{k()},[]);const w=()=>{p(null),g(""),y(r.length>0?Math.max(...r.map(N=>N.sort))+1:0),u(!0)},j=N=>{p(N),g(N.name),y(N.sort),u(!0)},b=async()=>{if(!x.trim()){alert("角色名称不能为空");return}_(!0);try{if(f){const N=await Pt("/api/db/vip-roles",{id:f.id,name:x.trim(),sort:v});N!=null&&N.success?(u(!1),k()):alert("更新失败: "+(N==null?void 0:N.error))}else{const N=await jt("/api/db/vip-roles",{name:x.trim(),sort:v});N!=null&&N.success?(u(!1),k()):alert("新增失败: "+(N==null?void 0:N.error))}}catch(N){console.error("Save error:",N),alert("保存失败")}finally{_(!1)}},C=async N=>{if(confirm("确定删除该角色?已设置该角色的 VIP 用户将保留角色名称。"))try{const A=await Wa(`/api/db/vip-roles?id=${N}`);A!=null&&A.success?k():alert("删除失败: "+(A==null?void 0:A.error))}catch(A){console.error("Delete error:",A),alert("删除失败")}};return t.jsxs("div",{className:"p-8 w-full",children:[t.jsxs("div",{className:"flex justify-between items-center mb-8",children:[t.jsxs("div",{children:[t.jsxs("h2",{className:"text-2xl font-bold text-white flex items-center gap-2",children:[t.jsx(Li,{className:"w-5 h-5 text-amber-400"}),"VIP 角色管理"]}),t.jsx("p",{className:"text-gray-400 mt-1",children:"超级个体固定角色,在「设置 VIP」时可选择或手动填写"})]}),t.jsxs(oe,{onClick:w,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:[t.jsx(Rn,{className:"w-4 h-4 mr-2"}),"新增角色"]})]}),t.jsx(ke,{className:"bg-[#0f2137] border-gray-700/50",children:t.jsx(Ee,{className:"p-0",children:l?t.jsx("div",{className:"py-12 text-center text-gray-400",children:"加载中..."}):t.jsxs(Yn,{children:[t.jsx(Qn,{children:t.jsxs(rt,{className:"bg-[#0a1628] border-gray-700",children:[t.jsx(Pe,{className:"text-gray-400",children:"ID"}),t.jsx(Pe,{className:"text-gray-400",children:"角色名称"}),t.jsx(Pe,{className:"text-gray-400",children:"排序"}),t.jsx(Pe,{className:"text-right text-gray-400",children:"操作"})]})}),t.jsxs(qn,{children:[r.map(N=>t.jsxs(rt,{className:"border-gray-700/50",children:[t.jsx(we,{className:"text-gray-300",children:N.id}),t.jsx(we,{className:"text-white",children:N.name}),t.jsx(we,{className:"text-gray-400",children:N.sort}),t.jsxs(we,{className:"text-right",children:[t.jsx(oe,{variant:"ghost",size:"sm",onClick:()=>j(N),className:"text-gray-400 hover:text-[#38bdac]",children:t.jsx(sn,{className:"w-4 h-4"})}),t.jsx(oe,{variant:"ghost",size:"sm",onClick:()=>C(N.id),className:"text-gray-400 hover:text-red-400",children:t.jsx(Vn,{className:"w-4 h-4"})})]})]},N.id)),r.length===0&&t.jsx(rt,{children:t.jsx(we,{colSpan:4,className:"text-center py-12 text-gray-500",children:"暂无角色,点击「新增角色」添加"})})]})]})})}),t.jsx(Bt,{open:c,onOpenChange:u,children:t.jsxs(It,{className:"bg-[#0f2137] border-gray-700 text-white max-w-sm",children:[t.jsx(Ut,{children:t.jsx(Vt,{className:"text-white",children:f?"编辑角色":"新增角色"})}),t.jsxs("div",{className:"space-y-4 py-4",children:[t.jsxs("div",{className:"space-y-2",children:[t.jsx(Z,{className:"text-gray-300",children:"角色名称"}),t.jsx(ne,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"如:创始人、投资人",value:x,onChange:N=>g(N.target.value)})]}),t.jsxs("div",{className:"space-y-2",children:[t.jsx(Z,{className:"text-gray-300",children:"排序(下拉展示顺序,越小越前)"}),t.jsx(ne,{type:"number",className:"bg-[#0a1628] border-gray-700 text-white",value:v,onChange:N=>y(parseInt(N.target.value,10)||0)})]})]}),t.jsxs(qt,{children:[t.jsxs(oe,{variant:"outline",onClick:()=>u(!1),className:"border-gray-600 text-gray-300",children:[t.jsx(on,{className:"w-4 h-4 mr-2"}),"取消"]}),t.jsxs(oe,{onClick:b,disabled:E,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:[t.jsx(Wt,{className:"w-4 h-4 mr-2"}),E?"保存中...":"保存"]})]})]})})]})}function u4(){const[r,a]=h.useState([]),[l,o]=h.useState(!0),[c,u]=h.useState(!1),[f,p]=h.useState(null),[x,g]=h.useState({name:"",avatar:"",intro:"",tags:"",priceSingle:"",priceHalfYear:"",priceYear:"",quote:"",whyFind:"",offering:"",judgmentStyle:"",sort:0,enabled:!0}),[v,y]=h.useState(!1),[E,_]=h.useState(!1),k=h.useRef(null),w=async R=>{var F;const T=(F=R.target.files)==null?void 0:F[0];if(T){_(!0);try{const Y=new FormData;Y.append("file",T),Y.append("folder","mentors");const K=Bd(),J={};K&&(J.Authorization=`Bearer ${K}`);const X=await(await fetch(Fs("/api/upload"),{method:"POST",body:Y,credentials:"include",headers:J})).json();X!=null&&X.success&&(X!=null&&X.url)?g(le=>({...le,avatar:X.url})):alert("上传失败: "+((X==null?void 0:X.error)||"未知错误"))}catch(Y){console.error(Y),alert("上传失败")}finally{_(!1),k.current&&(k.current.value="")}}};async function j(){o(!0);try{const R=await We("/api/db/mentors");R!=null&&R.success&&R.data&&a(R.data)}catch(R){console.error("Load mentors error:",R)}finally{o(!1)}}h.useEffect(()=>{j()},[]);const b=()=>{g({name:"",avatar:"",intro:"",tags:"",priceSingle:"",priceHalfYear:"",priceYear:"",quote:"",whyFind:"",offering:"",judgmentStyle:"",sort:r.length>0?Math.max(...r.map(R=>R.sort))+1:0,enabled:!0})},C=()=>{p(null),b(),u(!0)},N=R=>{p(R),g({name:R.name,avatar:R.avatar||"",intro:R.intro||"",tags:R.tags||"",priceSingle:R.priceSingle!=null?String(R.priceSingle):"",priceHalfYear:R.priceHalfYear!=null?String(R.priceHalfYear):"",priceYear:R.priceYear!=null?String(R.priceYear):"",quote:R.quote||"",whyFind:R.whyFind||"",offering:R.offering||"",judgmentStyle:R.judgmentStyle||"",sort:R.sort,enabled:R.enabled??!0}),u(!0)},A=async()=>{if(!x.name.trim()){alert("导师姓名不能为空");return}y(!0);try{const R=F=>F===""?void 0:parseFloat(F),T={name:x.name.trim(),avatar:x.avatar.trim()||void 0,intro:x.intro.trim()||void 0,tags:x.tags.trim()||void 0,priceSingle:R(x.priceSingle),priceHalfYear:R(x.priceHalfYear),priceYear:R(x.priceYear),quote:x.quote.trim()||void 0,whyFind:x.whyFind.trim()||void 0,offering:x.offering.trim()||void 0,judgmentStyle:x.judgmentStyle.trim()||void 0,sort:x.sort,enabled:x.enabled};if(f){const F=await Pt("/api/db/mentors",{id:f.id,...T});F!=null&&F.success?(u(!1),j()):alert("更新失败: "+(F==null?void 0:F.error))}else{const F=await jt("/api/db/mentors",T);F!=null&&F.success?(u(!1),j()):alert("新增失败: "+(F==null?void 0:F.error))}}catch(R){console.error("Save error:",R),alert("保存失败")}finally{y(!1)}},$=async R=>{if(confirm("确定删除该导师?"))try{const T=await Wa(`/api/db/mentors?id=${R}`);T!=null&&T.success?j():alert("删除失败: "+(T==null?void 0:T.error))}catch(T){console.error("Delete error:",T),alert("删除失败")}},V=R=>R!=null?`¥${R}`:"-";return t.jsxs("div",{className:"p-8 w-full",children:[t.jsxs("div",{className:"flex justify-between items-center mb-8",children:[t.jsxs("div",{children:[t.jsxs("h2",{className:"text-2xl font-bold text-white flex items-center gap-2",children:[t.jsx(vn,{className:"w-5 h-5 text-[#38bdac]"}),"导师管理"]}),t.jsx("p",{className:"text-gray-400 mt-1",children:"stitch_soul 导师列表,支持每个导师独立配置单次/半年/年度价格"})]}),t.jsxs(oe,{onClick:C,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:[t.jsx(Rn,{className:"w-4 h-4 mr-2"}),"新增导师"]})]}),t.jsx(ke,{className:"bg-[#0f2137] border-gray-700/50",children:t.jsx(Ee,{className:"p-0",children:l?t.jsx("div",{className:"py-12 text-center text-gray-400",children:"加载中..."}):t.jsxs(Yn,{children:[t.jsx(Qn,{children:t.jsxs(rt,{className:"bg-[#0a1628] border-gray-700",children:[t.jsx(Pe,{className:"text-gray-400",children:"ID"}),t.jsx(Pe,{className:"text-gray-400",children:"姓名"}),t.jsx(Pe,{className:"text-gray-400",children:"简介"}),t.jsx(Pe,{className:"text-gray-400",children:"单次"}),t.jsx(Pe,{className:"text-gray-400",children:"半年"}),t.jsx(Pe,{className:"text-gray-400",children:"年度"}),t.jsx(Pe,{className:"text-gray-400",children:"排序"}),t.jsx(Pe,{className:"text-right text-gray-400",children:"操作"})]})}),t.jsxs(qn,{children:[r.map(R=>t.jsxs(rt,{className:"border-gray-700/50",children:[t.jsx(we,{className:"text-gray-300",children:R.id}),t.jsx(we,{className:"text-white",children:R.name}),t.jsx(we,{className:"text-gray-400 max-w-[200px] truncate",children:R.intro||"-"}),t.jsx(we,{className:"text-gray-400",children:V(R.priceSingle)}),t.jsx(we,{className:"text-gray-400",children:V(R.priceHalfYear)}),t.jsx(we,{className:"text-gray-400",children:V(R.priceYear)}),t.jsx(we,{className:"text-gray-400",children:R.sort}),t.jsxs(we,{className:"text-right",children:[t.jsx(oe,{variant:"ghost",size:"sm",onClick:()=>N(R),className:"text-gray-400 hover:text-[#38bdac]",children:t.jsx(sn,{className:"w-4 h-4"})}),t.jsx(oe,{variant:"ghost",size:"sm",onClick:()=>$(R.id),className:"text-gray-400 hover:text-red-400",children:t.jsx(Vn,{className:"w-4 h-4"})})]})]},R.id)),r.length===0&&t.jsx(rt,{children:t.jsx(we,{colSpan:8,className:"text-center py-12 text-gray-500",children:"暂无导师,点击「新增导师」添加"})})]})]})})}),t.jsx(Bt,{open:c,onOpenChange:u,children:t.jsxs(It,{className:"bg-[#0f2137] border-gray-700 text-white max-w-lg max-h-[90vh] overflow-y-auto",children:[t.jsx(Ut,{children:t.jsx(Vt,{className:"text-white",children:f?"编辑导师":"新增导师"})}),t.jsxs("div",{className:"space-y-4 py-4",children:[t.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[t.jsxs("div",{className:"space-y-2",children:[t.jsx(Z,{className:"text-gray-300",children:"姓名 *"}),t.jsx(ne,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"如:卡若",value:x.name,onChange:R=>g(T=>({...T,name:R.target.value}))})]}),t.jsxs("div",{className:"space-y-2",children:[t.jsx(Z,{className:"text-gray-300",children:"排序"}),t.jsx(ne,{type:"number",className:"bg-[#0a1628] border-gray-700 text-white",value:x.sort,onChange:R=>g(T=>({...T,sort:parseInt(R.target.value,10)||0}))})]})]}),t.jsxs("div",{className:"space-y-2",children:[t.jsx(Z,{className:"text-gray-300",children:"头像"}),t.jsxs("div",{className:"flex gap-3 items-center",children:[t.jsx(ne,{className:"flex-1 bg-[#0a1628] border-gray-700 text-white",value:x.avatar,onChange:R=>g(T=>({...T,avatar:R.target.value})),placeholder:"点击上传或粘贴图片地址"}),t.jsx("input",{ref:k,type:"file",accept:"image/*",className:"hidden",onChange:w}),t.jsxs(oe,{type:"button",variant:"outline",size:"sm",className:"border-gray-600 text-gray-400 shrink-0",disabled:E,onClick:()=>{var R;return(R=k.current)==null?void 0:R.click()},children:[t.jsx(bi,{className:"w-4 h-4 mr-2"}),E?"上传中...":"上传"]})]}),x.avatar&&t.jsx("div",{className:"mt-2",children:t.jsx("img",{src:x.avatar.startsWith("http")?x.avatar:Fs(x.avatar),alt:"头像预览",className:"w-20 h-20 rounded-full object-cover border border-gray-600"})})]}),t.jsxs("div",{className:"space-y-2",children:[t.jsx(Z,{className:"text-gray-300",children:"简介"}),t.jsx(ne,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"如:结构判断型咨询 · Decision > Execution",value:x.intro,onChange:R=>g(T=>({...T,intro:R.target.value}))})]}),t.jsxs("div",{className:"space-y-2",children:[t.jsx(Z,{className:"text-gray-300",children:"技能标签(逗号分隔)"}),t.jsx(ne,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"如:项目结构判断、风险止损、人×项目匹配",value:x.tags,onChange:R=>g(T=>({...T,tags:R.target.value}))})]}),t.jsxs("div",{className:"border-t border-gray-700 pt-4",children:[t.jsx(Z,{className:"text-gray-300 block mb-2",children:"价格配置(每个导师独立)"}),t.jsxs("div",{className:"grid grid-cols-3 gap-4",children:[t.jsxs("div",{className:"space-y-2",children:[t.jsx(Z,{className:"text-gray-500 text-xs",children:"单次咨询 ¥"}),t.jsx(ne,{type:"number",step:"0.01",className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"980",value:x.priceSingle,onChange:R=>g(T=>({...T,priceSingle:R.target.value}))})]}),t.jsxs("div",{className:"space-y-2",children:[t.jsx(Z,{className:"text-gray-500 text-xs",children:"半年咨询 ¥"}),t.jsx(ne,{type:"number",step:"0.01",className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"19800",value:x.priceHalfYear,onChange:R=>g(T=>({...T,priceHalfYear:R.target.value}))})]}),t.jsxs("div",{className:"space-y-2",children:[t.jsx(Z,{className:"text-gray-500 text-xs",children:"年度咨询 ¥"}),t.jsx(ne,{type:"number",step:"0.01",className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"29800",value:x.priceYear,onChange:R=>g(T=>({...T,priceYear:R.target.value}))})]})]})]}),t.jsxs("div",{className:"space-y-2",children:[t.jsx(Z,{className:"text-gray-300",children:"引言"}),t.jsx(ne,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"如:大多数人失败,不是因为不努力...",value:x.quote,onChange:R=>g(T=>({...T,quote:R.target.value}))})]}),t.jsxs("div",{className:"space-y-2",children:[t.jsx(Z,{className:"text-gray-300",children:"为什么找(文本)"}),t.jsx(ne,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"",value:x.whyFind,onChange:R=>g(T=>({...T,whyFind:R.target.value}))})]}),t.jsxs("div",{className:"space-y-2",children:[t.jsx(Z,{className:"text-gray-300",children:"提供什么(文本)"}),t.jsx(ne,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"",value:x.offering,onChange:R=>g(T=>({...T,offering:R.target.value}))})]}),t.jsxs("div",{className:"space-y-2",children:[t.jsx(Z,{className:"text-gray-300",children:"判断风格(逗号分隔)"}),t.jsx(ne,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"如:冷静、克制、偏风险视角",value:x.judgmentStyle,onChange:R=>g(T=>({...T,judgmentStyle:R.target.value}))})]}),t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx("input",{type:"checkbox",id:"enabled",checked:x.enabled,onChange:R=>g(T=>({...T,enabled:R.target.checked})),className:"rounded border-gray-600 bg-[#0a1628]"}),t.jsx(Z,{htmlFor:"enabled",className:"text-gray-300 cursor-pointer",children:"上架(小程序可见)"})]})]}),t.jsxs(qt,{children:[t.jsxs(oe,{variant:"outline",onClick:()=>u(!1),className:"border-gray-600 text-gray-300",children:[t.jsx(on,{className:"w-4 h-4 mr-2"}),"取消"]}),t.jsxs(oe,{onClick:A,disabled:v,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:[t.jsx(Wt,{className:"w-4 h-4 mr-2"}),v?"保存中...":"保存"]})]})]})})]})}function f4(){const[r,a]=h.useState([]),[l,o]=h.useState(!0),[c,u]=h.useState("");async function f(){o(!0);try{const g=c?`/api/db/mentor-consultations?status=${c}`:"/api/db/mentor-consultations",v=await We(g);v!=null&&v.success&&v.data&&a(v.data)}catch(g){console.error("Load consultations error:",g)}finally{o(!1)}}h.useEffect(()=>{f()},[c]);const p={created:"已创建",pending_pay:"待支付",paid:"已支付",completed:"已完成",cancelled:"已取消"},x={single:"单次",half_year:"半年",year:"年度"};return t.jsxs("div",{className:"p-8 w-full",children:[t.jsxs("div",{className:"flex justify-between items-center mb-8",children:[t.jsxs("div",{children:[t.jsxs("h2",{className:"text-2xl font-bold text-white flex items-center gap-2",children:[t.jsx(za,{className:"w-5 h-5 text-[#38bdac]"}),"导师预约列表"]}),t.jsx("p",{className:"text-gray-400 mt-1",children:"stitch_soul 导师咨询预约记录"})]}),t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsxs("select",{value:c,onChange:g=>u(g.target.value),className:"bg-[#0f2137] border border-gray-700 rounded-lg px-3 py-2 text-gray-300 text-sm",children:[t.jsx("option",{value:"",children:"全部状态"}),Object.entries(p).map(([g,v])=>t.jsx("option",{value:g,children:v},g))]}),t.jsxs(oe,{onClick:f,disabled:l,variant:"outline",className:"border-gray-600 text-gray-300",children:[t.jsx(Ze,{className:`w-4 h-4 mr-2 ${l?"animate-spin":""}`}),"刷新"]})]})]}),t.jsx(ke,{className:"bg-[#0f2137] border-gray-700/50",children:t.jsx(Ee,{className:"p-0",children:l?t.jsx("div",{className:"py-12 text-center text-gray-400",children:"加载中..."}):t.jsxs(Yn,{children:[t.jsx(Qn,{children:t.jsxs(rt,{className:"bg-[#0a1628] border-gray-700",children:[t.jsx(Pe,{className:"text-gray-400",children:"ID"}),t.jsx(Pe,{className:"text-gray-400",children:"用户ID"}),t.jsx(Pe,{className:"text-gray-400",children:"导师ID"}),t.jsx(Pe,{className:"text-gray-400",children:"类型"}),t.jsx(Pe,{className:"text-gray-400",children:"金额"}),t.jsx(Pe,{className:"text-gray-400",children:"状态"}),t.jsx(Pe,{className:"text-gray-400",children:"创建时间"})]})}),t.jsxs(qn,{children:[r.map(g=>t.jsxs(rt,{className:"border-gray-700/50",children:[t.jsx(we,{className:"text-gray-300",children:g.id}),t.jsx(we,{className:"text-gray-400",children:g.userId}),t.jsx(we,{className:"text-gray-400",children:g.mentorId}),t.jsx(we,{className:"text-gray-400",children:x[g.consultationType]||g.consultationType}),t.jsxs(we,{className:"text-white",children:["¥",g.amount]}),t.jsx(we,{className:"text-gray-400",children:p[g.status]||g.status}),t.jsx(we,{className:"text-gray-500 text-sm",children:g.createdAt})]},g.id)),r.length===0&&t.jsx(rt,{children:t.jsx(we,{colSpan:7,className:"text-center py-12 text-gray-500",children:"暂无预约记录"})})]})]})})})]})}function h4(){const[r,a]=h.useState([]),[l,o]=h.useState(0),[c,u]=h.useState(1),[f]=h.useState(10),[p,x]=h.useState(0),[g,v]=h.useState(""),y=Xd(g,300),[E,_]=h.useState(!0),[k,w]=h.useState(null),[j,b]=h.useState(!1),[C,N]=h.useState(null),[A,$]=h.useState(""),[V,R]=h.useState(""),[T,F]=h.useState(""),[Y,K]=h.useState("admin"),[J,ce]=h.useState("active"),[X,le]=h.useState(!1);async function ee(){var P;_(!0),w(null);try{const W=new URLSearchParams({page:String(c),pageSize:String(f)});y.trim()&&W.set("search",y.trim());const re=await We(`/api/admin/users?${W}`);re!=null&&re.success?(a(re.records||[]),o(re.total??0),x(re.totalPages??0)):w(re.error||"加载失败")}catch(W){const re=W;w(re.status===403?"无权限访问":((P=re==null?void 0:re.data)==null?void 0:P.error)||"加载失败"),a([])}finally{_(!1)}}h.useEffect(()=>{ee()},[c,f,y]);const q=()=>{N(null),$(""),R(""),F(""),K("admin"),ce("active"),b(!0)},I=P=>{N(P),$(P.username),R(""),F(P.name||""),K(P.role==="super_admin"?"super_admin":"admin"),ce(P.status==="disabled"?"disabled":"active"),b(!0)},Q=async()=>{var P;if(!A.trim()){w("用户名不能为空");return}if(!C&&!V){w("新建时密码必填,至少 6 位");return}if(V&&V.length<6){w("密码至少 6 位");return}w(null),le(!0);try{if(C){const W=await Pt("/api/admin/users",{id:C.id,password:V||void 0,name:T.trim(),role:Y,status:J});W!=null&&W.success?(b(!1),ee()):w((W==null?void 0:W.error)||"保存失败")}else{const W=await jt("/api/admin/users",{username:A.trim(),password:V,name:T.trim(),role:Y});W!=null&&W.success?(b(!1),ee()):w((W==null?void 0:W.error)||"保存失败")}}catch(W){const re=W;w(((P=re==null?void 0:re.data)==null?void 0:P.error)||"保存失败")}finally{le(!1)}},B=async P=>{var W;if(confirm("确定删除该管理员?"))try{const re=await Wa(`/api/admin/users?id=${P}`);re!=null&&re.success?ee():w((re==null?void 0:re.error)||"删除失败")}catch(re){const he=re;w(((W=he==null?void 0:he.data)==null?void 0:W.error)||"删除失败")}},D=P=>{if(!P)return"-";try{const W=new Date(P);return isNaN(W.getTime())?P:W.toLocaleString("zh-CN")}catch{return P}};return t.jsxs("div",{className:"p-8 w-full",children:[t.jsxs("div",{className:"flex justify-between items-center mb-6",children:[t.jsxs("div",{children:[t.jsxs("h2",{className:"text-2xl font-bold text-white flex items-center gap-2",children:[t.jsx(zd,{className:"w-5 h-5 text-[#38bdac]"}),"管理员用户"]}),t.jsx("p",{className:"text-gray-400 mt-1",children:"后台登录账号管理,仅超级管理员可操作"})]}),t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx(ne,{placeholder:"搜索用户名/昵称",value:g,onChange:P=>v(P.target.value),className:"w-48 bg-[#0f2137] border-gray-700 text-white placeholder:text-gray-500"}),t.jsx(oe,{variant:"outline",size:"sm",onClick:ee,disabled:E,className:"border-gray-600 text-gray-300",children:t.jsx(Ze,{className:`w-4 h-4 ${E?"animate-spin":""}`})}),t.jsxs(oe,{onClick:q,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:[t.jsx(Rn,{className:"w-4 h-4 mr-2"}),"新增管理员"]})]})]}),k&&t.jsxs("div",{className:"mb-4 p-3 rounded-lg bg-red-500/10 border border-red-500/20 text-red-400 text-sm flex justify-between items-center",children:[t.jsx("span",{children:k}),t.jsx("button",{type:"button",onClick:()=>w(null),className:"text-red-400 hover:text-red-300",children:"×"})]}),t.jsx(ke,{className:"bg-[#0f2137] border-gray-700/50",children:t.jsx(Ee,{className:"p-0",children:E?t.jsx("div",{className:"py-12 text-center text-gray-400",children:"加载中..."}):t.jsxs(t.Fragment,{children:[t.jsxs(Yn,{children:[t.jsx(Qn,{children:t.jsxs(rt,{className:"bg-[#0a1628] border-gray-700",children:[t.jsx(Pe,{className:"text-gray-400",children:"ID"}),t.jsx(Pe,{className:"text-gray-400",children:"用户名"}),t.jsx(Pe,{className:"text-gray-400",children:"昵称"}),t.jsx(Pe,{className:"text-gray-400",children:"角色"}),t.jsx(Pe,{className:"text-gray-400",children:"状态"}),t.jsx(Pe,{className:"text-gray-400",children:"创建时间"}),t.jsx(Pe,{className:"text-right text-gray-400",children:"操作"})]})}),t.jsxs(qn,{children:[r.map(P=>t.jsxs(rt,{className:"border-gray-700/50",children:[t.jsx(we,{className:"text-gray-300",children:P.id}),t.jsx(we,{className:"text-white font-medium",children:P.username}),t.jsx(we,{className:"text-gray-400",children:P.name||"-"}),t.jsx(we,{children:t.jsx(Me,{variant:"outline",className:P.role==="super_admin"?"border-amber-500/50 text-amber-400":"border-gray-600 text-gray-400",children:P.role==="super_admin"?"超级管理员":"管理员"})}),t.jsx(we,{children:t.jsx(Me,{variant:"outline",className:P.status==="active"?"border-[#38bdac]/50 text-[#38bdac]":"border-gray-500 text-gray-500",children:P.status==="active"?"正常":"已禁用"})}),t.jsx(we,{className:"text-gray-500 text-sm",children:D(P.createdAt)}),t.jsxs(we,{className:"text-right",children:[t.jsx(oe,{variant:"ghost",size:"sm",onClick:()=>I(P),className:"text-gray-400 hover:text-[#38bdac]",children:t.jsx(sn,{className:"w-4 h-4"})}),t.jsx(oe,{variant:"ghost",size:"sm",onClick:()=>B(P.id),className:"text-gray-400 hover:text-red-400",children:t.jsx(Vn,{className:"w-4 h-4"})})]})]},P.id)),r.length===0&&!E&&t.jsx(rt,{children:t.jsx(we,{colSpan:7,className:"text-center py-12 text-gray-500",children:k==="无权限访问"?"仅超级管理员可查看":"暂无管理员"})})]})]}),p>1&&t.jsx("div",{className:"p-4 border-t border-gray-700/50",children:t.jsx(Sr,{page:c,pageSize:f,total:l,totalPages:p,onPageChange:u})})]})})}),t.jsx(Bt,{open:j,onOpenChange:b,children:t.jsxs(It,{className:"bg-[#0f2137] border-gray-700 text-white max-w-sm",children:[t.jsx(Ut,{children:t.jsx(Vt,{className:"text-white",children:C?"编辑管理员":"新增管理员"})}),t.jsxs("div",{className:"space-y-4 py-4",children:[t.jsxs("div",{className:"space-y-2",children:[t.jsx(Z,{className:"text-gray-300",children:"用户名"}),t.jsx(ne,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"登录用户名",value:A,onChange:P=>$(P.target.value),disabled:!!C}),C&&t.jsx("p",{className:"text-xs text-gray-500",children:"用户名不可修改"})]}),t.jsxs("div",{className:"space-y-2",children:[t.jsx(Z,{className:"text-gray-300",children:C?"新密码(留空不改)":"密码"}),t.jsx(ne,{type:"password",className:"bg-[#0a1628] border-gray-700 text-white",placeholder:C?"留空表示不修改":"至少 6 位",value:V,onChange:P=>R(P.target.value)})]}),t.jsxs("div",{className:"space-y-2",children:[t.jsx(Z,{className:"text-gray-300",children:"昵称"}),t.jsx(ne,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"显示名称",value:T,onChange:P=>F(P.target.value)})]}),t.jsxs("div",{className:"space-y-2",children:[t.jsx(Z,{className:"text-gray-300",children:"角色"}),t.jsxs("select",{value:Y,onChange:P=>K(P.target.value),className:"w-full h-10 px-3 rounded-md bg-[#0a1628] border border-gray-700 text-white",children:[t.jsx("option",{value:"admin",children:"管理员"}),t.jsx("option",{value:"super_admin",children:"超级管理员"})]})]}),C&&t.jsxs("div",{className:"space-y-2",children:[t.jsx(Z,{className:"text-gray-300",children:"状态"}),t.jsxs("select",{value:J,onChange:P=>ce(P.target.value),className:"w-full h-10 px-3 rounded-md bg-[#0a1628] border border-gray-700 text-white",children:[t.jsx("option",{value:"active",children:"正常"}),t.jsx("option",{value:"disabled",children:"禁用"})]})]})]}),t.jsxs(qt,{children:[t.jsxs(oe,{variant:"outline",onClick:()=>b(!1),className:"border-gray-600 text-gray-300",children:[t.jsx(on,{className:"w-4 h-4 mr-2"}),"取消"]}),t.jsxs(oe,{onClick:Q,disabled:X,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:[t.jsx(Wt,{className:"w-4 h-4 mr-2"}),X?"保存中...":"保存"]})]})]})})]})}function m4(){return t.jsxs("div",{className:"p-8 w-full",children:[t.jsxs("div",{className:"flex items-center gap-2 mb-8",children:[t.jsx(Yr,{className:"w-8 h-8 text-[#38bdac]"}),t.jsx("h1",{className:"text-2xl font-bold text-white",children:"API 接口文档"})]}),t.jsx("p",{className:"text-gray-400 mb-6",children:"API 风格:RESTful · 版本 v1.0 · 基础路径 /api · 简单、清晰、易用。"}),t.jsxs(ke,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl mb-6",children:[t.jsx($e,{children:t.jsx(Be,{className:"text-white",children:"1. 接口总览"})}),t.jsxs(Ee,{className:"space-y-4 text-sm",children:[t.jsxs("div",{children:[t.jsx("p",{className:"text-gray-400 mb-2",children:"接口分类"}),t.jsxs("ul",{className:"space-y-1 text-gray-300 font-mono",children:[t.jsx("li",{children:"/api/book — 书籍内容(章节列表、内容获取、同步)"}),t.jsx("li",{children:"/api/payment — 支付系统(订单创建、回调、状态查询)"}),t.jsx("li",{children:"/api/referral — 分销系统(邀请码、收益、提现)"}),t.jsx("li",{children:"/api/user — 用户系统(登录、注册、信息更新)"}),t.jsx("li",{children:"/api/match — 匹配系统(寻找匹配、匹配历史)"}),t.jsx("li",{children:"/api/admin — 管理后台(内容/订单/用户/分销管理)"}),t.jsx("li",{children:"/api/config — 配置系统"})]})]}),t.jsxs("div",{children:[t.jsx("p",{className:"text-gray-400 mb-2",children:"认证方式"}),t.jsx("p",{className:"text-gray-300",children:"用户:Cookie session_id(可选)"}),t.jsx("p",{className:"text-gray-300",children:"管理端:Authorization: Bearer admin-token-secret"})]})]})]}),t.jsxs(ke,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl mb-6",children:[t.jsx($e,{children:t.jsx(Be,{className:"text-white",children:"2. 书籍内容"})}),t.jsxs(Ee,{className:"space-y-2 text-sm text-gray-300 font-mono",children:[t.jsx("p",{children:"GET /api/book/all-chapters — 获取所有章节"}),t.jsx("p",{children:"GET /api/book/chapter/:id — 获取单章内容"}),t.jsx("p",{children:"POST /api/book/sync — 同步章节(需管理员认证)"})]})]}),t.jsxs(ke,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl mb-6",children:[t.jsx($e,{children:t.jsx(Be,{className:"text-white",children:"3. 支付"})}),t.jsxs(Ee,{className:"space-y-2 text-sm text-gray-300 font-mono",children:[t.jsx("p",{children:"POST /api/payment/create-order — 创建订单"}),t.jsx("p",{children:"POST /api/payment/alipay/notify — 支付宝回调"}),t.jsx("p",{children:"POST /api/payment/wechat/notify — 微信回调"})]})]}),t.jsxs(ke,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl mb-6",children:[t.jsx($e,{children:t.jsx(Be,{className:"text-white",children:"4. 分销与用户"})}),t.jsxs(Ee,{className:"space-y-2 text-sm text-gray-300 font-mono",children:[t.jsx("p",{children:"/api/referral/* — 邀请码、收益查询、提现"}),t.jsx("p",{children:"/api/user/* — 登录、注册、信息更新"}),t.jsx("p",{children:"/api/match/* — 匹配、匹配历史"})]})]}),t.jsxs(ke,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl mb-6",children:[t.jsx($e,{children:t.jsx(Be,{className:"text-white",children:"5. 管理后台"})}),t.jsxs(Ee,{className:"space-y-2 text-sm text-gray-300 font-mono",children:[t.jsx("p",{children:"GET/POST /api/admin/referral-settings — 推广/分销设置(含 VIP 配置)"}),t.jsx("p",{children:"GET /api/db/users、/api/db/book — 用户与章节数据"}),t.jsx("p",{children:"GET /api/orders — 订单列表"})]})]}),t.jsx("p",{className:"text-gray-500 text-xs",children:"完整说明见项目内 开发文档/5、接口/API接口完整文档.md"})]})}function p4(){const r=rs();return t.jsx("div",{className:"min-h-screen bg-[#0a1628] flex items-center justify-center p-8",children:t.jsxs("div",{className:"text-center max-w-md",children:[t.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:t.jsx(_j,{className:"w-10 h-10"})}),t.jsx("h1",{className:"text-4xl font-bold text-white mb-2",children:"404"}),t.jsx("p",{className:"text-gray-400 mb-1",children:"页面不存在"}),t.jsx("p",{className:"text-sm text-gray-500 font-mono mb-8 break-all",children:r.pathname}),t.jsx(oe,{asChild:!0,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:t.jsxs(fi,{to:"/",children:[t.jsx(aN,{className:"w-4 h-4 mr-2"}),"返回首页"]})})]})})}function x4(){return t.jsxs(lj,{children:[t.jsx(nt,{path:"/login",element:t.jsx(nw,{})}),t.jsxs(nt,{path:"/",element:t.jsx(ab,{}),children:[t.jsx(nt,{index:!0,element:t.jsx(rj,{to:"/dashboard",replace:!0})}),t.jsx(nt,{path:"dashboard",element:t.jsx(sw,{})}),t.jsx(nt,{path:"orders",element:t.jsx(V1,{})}),t.jsx(nt,{path:"users",element:t.jsx(x2,{})}),t.jsx(nt,{path:"distribution",element:t.jsx(g2,{})}),t.jsx(nt,{path:"withdrawals",element:t.jsx(v2,{})}),t.jsx(nt,{path:"content",element:t.jsx(kC,{})}),t.jsx(nt,{path:"referral-settings",element:t.jsx(YC,{})}),t.jsx(nt,{path:"author-settings",element:t.jsx(QC,{})}),t.jsx(nt,{path:"vip-roles",element:t.jsx(d4,{})}),t.jsx(nt,{path:"mentors",element:t.jsx(u4,{})}),t.jsx(nt,{path:"mentor-consultations",element:t.jsx(f4,{})}),t.jsx(nt,{path:"admin-users",element:t.jsx(h4,{})}),t.jsx(nt,{path:"settings",element:t.jsx(e4,{})}),t.jsx(nt,{path:"payment",element:t.jsx(t4,{})}),t.jsx(nt,{path:"site",element:t.jsx(a4,{})}),t.jsx(nt,{path:"qrcodes",element:t.jsx(l4,{})}),t.jsx(nt,{path:"match",element:t.jsx(o4,{})}),t.jsx(nt,{path:"match-records",element:t.jsx(c4,{})}),t.jsx(nt,{path:"api-doc",element:t.jsx(m4,{})})]}),t.jsx(nt,{path:"*",element:t.jsx(p4,{})})]})}cy.createRoot(document.getElementById("root")).render(t.jsx(h.StrictMode,{children:t.jsx(hj,{future:{v7_startTransition:!0,v7_relativeSplatPath:!0},children:t.jsx(x4,{})})})); diff --git a/soul-admin/dist/assets/index-CKRjkwdJ.js b/soul-admin/dist/assets/index-CKRjkwdJ.js deleted file mode 100644 index 49cad72b..00000000 --- a/soul-admin/dist/assets/index-CKRjkwdJ.js +++ /dev/null @@ -1,465 +0,0 @@ -function Hv(r,a){for(var l=0;lo[c]})}}}return Object.freeze(Object.defineProperty(r,Symbol.toStringTag,{value:"Module"}))}(function(){const a=document.createElement("link").relList;if(a&&a.supports&&a.supports("modulepreload"))return;for(const c of document.querySelectorAll('link[rel="modulepreload"]'))o(c);new MutationObserver(c=>{for(const u of c)if(u.type==="childList")for(const f of u.addedNodes)f.tagName==="LINK"&&f.rel==="modulepreload"&&o(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 o(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 Ac={exports:{}},Pa={},Mc={exports:{}},ze={};/** - * @license React - * react.production.min.js - * - * Copyright (c) Facebook, Inc. and its affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */var Vh;function Kv(){if(Vh)return ze;Vh=1;var r=Symbol.for("react.element"),a=Symbol.for("react.portal"),l=Symbol.for("react.fragment"),o=Symbol.for("react.strict_mode"),c=Symbol.for("react.profiler"),u=Symbol.for("react.provider"),f=Symbol.for("react.context"),m=Symbol.for("react.forward_ref"),x=Symbol.for("react.suspense"),g=Symbol.for("react.memo"),v=Symbol.for("react.lazy"),y=Symbol.iterator;function E(S){return S===null||typeof S!="object"?null:(S=y&&S[y]||S["@@iterator"],typeof S=="function"?S:null)}var P={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},C=Object.assign,N={};function b(S,D,ae){this.props=S,this.context=D,this.refs=N,this.updater=ae||P}b.prototype.isReactComponent={},b.prototype.setState=function(S,D){if(typeof S!="object"&&typeof S!="function"&&S!=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,S,D,"setState")},b.prototype.forceUpdate=function(S){this.updater.enqueueForceUpdate(this,S,"forceUpdate")};function k(){}k.prototype=b.prototype;function R(S,D,ae){this.props=S,this.context=D,this.refs=N,this.updater=ae||P}var j=R.prototype=new k;j.constructor=R,C(j,b.prototype),j.isPureReactComponent=!0;var _=Array.isArray,F=Object.prototype.hasOwnProperty,G={current:null},M={key:!0,ref:!0,__self:!0,__source:!0};function V(S,D,ae){var oe,Ne={},me=null,Q=null;if(D!=null)for(oe in D.ref!==void 0&&(Q=D.ref),D.key!==void 0&&(me=""+D.key),D)F.call(D,oe)&&!M.hasOwnProperty(oe)&&(Ne[oe]=D[oe]);var xe=arguments.length-2;if(xe===1)Ne.children=ae;else if(1>>1,D=A[S];if(0>>1;Sc(Ne,B))mec(Q,Ne)?(A[S]=Q,A[me]=B,S=me):(A[S]=Ne,A[oe]=B,S=oe);else if(mec(Q,B))A[S]=Q,A[me]=B,S=me;else break e}}return J}function c(A,J){var B=A.sortIndex-J.sortIndex;return B!==0?B:A.id-J.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=[],g=[],v=1,y=null,E=3,P=!1,C=!1,N=!1,b=typeof setTimeout=="function"?setTimeout:null,k=typeof clearTimeout=="function"?clearTimeout:null,R=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function j(A){for(var J=l(g);J!==null;){if(J.callback===null)o(g);else if(J.startTime<=A)o(g),J.sortIndex=J.expirationTime,a(x,J);else break;J=l(g)}}function _(A){if(N=!1,j(A),!C)if(l(x)!==null)C=!0,Y(F);else{var J=l(g);J!==null&&K(_,J.startTime-A)}}function F(A,J){C=!1,N&&(N=!1,k(V),V=-1),P=!0;var B=E;try{for(j(J),y=l(x);y!==null&&(!(y.expirationTime>J)||A&&!ce());){var S=y.callback;if(typeof S=="function"){y.callback=null,E=y.priorityLevel;var D=S(y.expirationTime<=J);J=r.unstable_now(),typeof D=="function"?y.callback=D:y===l(x)&&o(x),j(J)}else o(x);y=l(x)}if(y!==null)var ae=!0;else{var oe=l(g);oe!==null&&K(_,oe.startTime-J),ae=!1}return ae}finally{y=null,E=B,P=!1}}var G=!1,M=null,V=-1,te=5,ue=-1;function ce(){return!(r.unstable_now()-ueA||125S?(A.sortIndex=B,a(g,A),l(x)===null&&A===l(g)&&(N?(k(V),V=-1):N=!0,K(_,B-S))):(A.sortIndex=D,a(x,A),C||P||(C=!0,Y(F))),A},r.unstable_shouldYield=ce,r.unstable_wrapCallback=function(A){var J=E;return function(){var B=E;E=J;try{return A.apply(this,arguments)}finally{E=B}}}})(Oc)),Oc}var Gh;function qv(){return Gh||(Gh=1,Dc.exports=Qv()),Dc.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 Yh;function Xv(){if(Yh)return Ft;Yh=1;var r=Sd(),a=qv();function l(e){for(var n="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,g=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,v={},y={};function E(e){return x.call(y,e)?!0:x.call(v,e)?!1:g.test(e)?y[e]=!0:(v[e]=!0,!1)}function P(e,n,s,i){if(s!==null&&s.type===0)return!1;switch(typeof n){case"function":case"symbol":return!0;case"boolean":return i?!1:s!==null?!s.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function C(e,n,s,i){if(n===null||typeof n>"u"||P(e,n,s,i))return!0;if(i)return!1;if(s!==null)switch(s.type){case 3:return!n;case 4:return n===!1;case 5:return isNaN(n);case 6:return isNaN(n)||1>n}return!1}function N(e,n,s,i,d,h,w){this.acceptsBooleans=n===2||n===3||n===4,this.attributeName=i,this.attributeNamespace=d,this.mustUseProperty=s,this.propertyName=e,this.type=n,this.sanitizeURL=h,this.removeEmptyString=w}var b={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){b[e]=new N(e,0,!1,e,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var n=e[0];b[n]=new N(n,1,!1,e[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(e){b[e]=new N(e,2,!1,e.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){b[e]=new N(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 N(e,3,!1,e.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(e){b[e]=new N(e,3,!0,e,null,!1,!1)}),["capture","download"].forEach(function(e){b[e]=new N(e,4,!1,e,null,!1,!1)}),["cols","rows","size","span"].forEach(function(e){b[e]=new N(e,6,!1,e,null,!1,!1)}),["rowSpan","start"].forEach(function(e){b[e]=new N(e,5,!1,e.toLowerCase(),null,!1,!1)});var k=/[\-:]([a-z])/g;function R(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 n=e.replace(k,R);b[n]=new N(n,1,!1,e,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var n=e.replace(k,R);b[n]=new N(n,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(e){var n=e.replace(k,R);b[n]=new N(n,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(e){b[e]=new N(e,1,!1,e.toLowerCase(),null,!1,!1)}),b.xlinkHref=new N("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(e){b[e]=new N(e,1,!1,e.toLowerCase(),null,!0,!0)});function j(e,n,s,i){var d=b.hasOwnProperty(n)?b[n]:null;(d!==null?d.type!==0:i||!(2T||d[w]!==h[T]){var L=` -`+d[w].replace(" at new "," at ");return e.displayName&&L.includes("")&&(L=L.replace("",e.displayName)),L}while(1<=w&&0<=T);break}}}finally{ae=!1,Error.prepareStackTrace=s}return(e=e?e.displayName||e.name:"")?D(e):""}function Ne(e){switch(e.tag){case 5:return D(e.type);case 16:return D("Lazy");case 13:return D("Suspense");case 19:return D("SuspenseList");case 0:case 2:case 15:return e=oe(e.type,!1),e;case 11:return e=oe(e.type.render,!1),e;case 1:return e=oe(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 M:return"Fragment";case G:return"Portal";case te:return"Profiler";case V:return"StrictMode";case fe:return"Suspense";case H:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case ce:return(e.displayName||"Context")+".Consumer";case ue:return(e._context.displayName||"Context")+".Provider";case ie:var n=e.render;return e=e.displayName,e||(e=n.displayName||n.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case W:return n=e.displayName||null,n!==null?n:me(e.type)||"Memo";case Y:n=e._payload,e=e._init;try{return me(e(n))}catch{}}return null}function Q(e){var n=e.type;switch(e.tag){case 24:return"Cache";case 9:return(n.displayName||"Context")+".Consumer";case 10:return(n._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=n.render,e=e.displayName||e.name||"",n.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return n;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return me(n);case 8:return n===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 n=="function")return n.displayName||n.name||null;if(typeof n=="string")return n}return null}function xe(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function I(e){var n=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(n==="checkbox"||n==="radio")}function se(e){var n=I(e)?"checked":"value",s=Object.getOwnPropertyDescriptor(e.constructor.prototype,n),i=""+e[n];if(!e.hasOwnProperty(n)&&typeof s<"u"&&typeof s.get=="function"&&typeof s.set=="function"){var d=s.get,h=s.set;return Object.defineProperty(e,n,{configurable:!0,get:function(){return d.call(this)},set:function(w){i=""+w,h.call(this,w)}}),Object.defineProperty(e,n,{enumerable:s.enumerable}),{getValue:function(){return i},setValue:function(w){i=""+w},stopTracking:function(){e._valueTracker=null,delete e[n]}}}}function he(e){e._valueTracker||(e._valueTracker=se(e))}function Pe(e){if(!e)return!1;var n=e._valueTracker;if(!n)return!0;var s=n.getValue(),i="";return e&&(i=I(e)?e.checked?"true":"false":e.value),e=i,e!==s?(n.setValue(e),!0):!1}function Me(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 Fe(e,n){var s=n.checked;return B({},n,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:s??e._wrapperState.initialChecked})}function Qe(e,n){var s=n.defaultValue==null?"":n.defaultValue,i=n.checked!=null?n.checked:n.defaultChecked;s=xe(n.value!=null?n.value:s),e._wrapperState={initialChecked:i,initialValue:s,controlled:n.type==="checkbox"||n.type==="radio"?n.checked!=null:n.value!=null}}function nt(e,n){n=n.checked,n!=null&&j(e,"checked",n,!1)}function Ze(e,n){nt(e,n);var s=xe(n.value),i=n.type;if(s!=null)i==="number"?(s===0&&e.value===""||e.value!=s)&&(e.value=""+s):e.value!==""+s&&(e.value=""+s);else if(i==="submit"||i==="reset"){e.removeAttribute("value");return}n.hasOwnProperty("value")?It(e,n.type,s):n.hasOwnProperty("defaultValue")&&It(e,n.type,xe(n.defaultValue)),n.checked==null&&n.defaultChecked!=null&&(e.defaultChecked=!!n.defaultChecked)}function Tt(e,n,s){if(n.hasOwnProperty("value")||n.hasOwnProperty("defaultValue")){var i=n.type;if(!(i!=="submit"&&i!=="reset"||n.value!==void 0&&n.value!==null))return;n=""+e._wrapperState.initialValue,s||n===e.value||(e.value=n),e.defaultValue=n}s=e.name,s!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,s!==""&&(e.name=s)}function It(e,n,s){(n!=="number"||Me(e.ownerDocument)!==e)&&(s==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+s&&(e.defaultValue=""+s))}var Pr=Array.isArray;function Un(e,n,s,i){if(e=e.options,n){n={};for(var d=0;d"+n.valueOf().toString()+"",n=$e.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;n.firstChild;)e.appendChild(n.firstChild)}});function ln(e,n){if(n){var s=e.firstChild;if(s&&s===e.lastChild&&s.nodeType===3){s.nodeValue=n;return}}e.textContent=n}var Rr={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(Rr).forEach(function(e){Qg.forEach(function(n){n=n+e.charAt(0).toUpperCase()+e.substring(1),Rr[n]=Rr[e]})});function nu(e,n,s){return n==null||typeof n=="boolean"||n===""?"":s||typeof n!="number"||n===0||Rr.hasOwnProperty(e)&&Rr[e]?(""+n).trim():n+"px"}function ru(e,n){e=e.style;for(var s in n)if(n.hasOwnProperty(s)){var i=s.indexOf("--")===0,d=nu(s,n[s],i);s==="float"&&(s="cssFloat"),i?e.setProperty(s,d):e[s]=d}}var qg=B({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 Wi(e,n){if(n){if(qg[e]&&(n.children!=null||n.dangerouslySetInnerHTML!=null))throw Error(l(137,e));if(n.dangerouslySetInnerHTML!=null){if(n.children!=null)throw Error(l(60));if(typeof n.dangerouslySetInnerHTML!="object"||!("__html"in n.dangerouslySetInnerHTML))throw Error(l(61))}if(n.style!=null&&typeof n.style!="object")throw Error(l(62))}}function Hi(e,n){if(e.indexOf("-")===-1)return typeof n.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 Ki=null;function Gi(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Yi=null,es=null,ts=null;function su(e){if(e=ha(e)){if(typeof Yi!="function")throw Error(l(280));var n=e.stateNode;n&&(n=dl(n),Yi(e.stateNode,e.type,n))}}function au(e){es?ts?ts.push(e):ts=[e]:es=e}function lu(){if(es){var e=es,n=ts;if(ts=es=null,su(e),n)for(e=0;e>>=0,e===0?32:31-(i0(e)/o0|0)|0}var Ka=64,Ga=4194304;function Qs(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 Ya(e,n){var s=e.pendingLanes;if(s===0)return 0;var i=0,d=e.suspendedLanes,h=e.pingedLanes,w=s&268435455;if(w!==0){var T=w&~d;T!==0?i=Qs(T):(h&=w,h!==0&&(i=Qs(h)))}else w=s&~d,w!==0?i=Qs(w):h!==0&&(i=Qs(h));if(i===0)return 0;if(n!==0&&n!==i&&(n&d)===0&&(d=i&-i,h=n&-n,d>=h||d===16&&(h&4194240)!==0))return n;if((i&4)!==0&&(i|=s&16),n=e.entangledLanes,n!==0)for(e=e.entanglements,n&=i;0s;s++)n.push(e);return n}function qs(e,n,s){e.pendingLanes|=n,n!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,n=31-on(n),e[n]=s}function f0(e,n){var s=e.pendingLanes&~n;e.pendingLanes=n,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=n,e.mutableReadLanes&=n,e.entangledLanes&=n,n=e.entanglements;var i=e.eventTimes;for(e=e.expirationTimes;0=sa),Mu=" ",Lu=!1;function Du(e,n){switch(e){case"keyup":return $0.indexOf(n.keyCode)!==-1;case"keydown":return n.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Ou(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var ss=!1;function V0(e,n){switch(e){case"compositionend":return Ou(n);case"keypress":return n.which!==32?null:(Lu=!0,Mu);case"textInput":return e=n.data,e===Mu&&Lu?null:e;default:return null}}function U0(e,n){if(ss)return e==="compositionend"||!ho&&Du(e,n)?(e=Pu(),Za=lo=Yn=null,ss=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(n.ctrlKey||n.altKey||n.metaKey)||n.ctrlKey&&n.altKey){if(n.char&&1=n)return{node:s,offset:n-e};e=i}e:{for(;s;){if(s.nextSibling){s=s.nextSibling;break e}s=s.parentNode}s=void 0}s=Wu(s)}}function Ku(e,n){return e&&n?e===n?!0:e&&e.nodeType===3?!1:n&&n.nodeType===3?Ku(e,n.parentNode):"contains"in e?e.contains(n):e.compareDocumentPosition?!!(e.compareDocumentPosition(n)&16):!1:!1}function Gu(){for(var e=window,n=Me();n instanceof e.HTMLIFrameElement;){try{var s=typeof n.contentWindow.location.href=="string"}catch{s=!1}if(s)e=n.contentWindow;else break;n=Me(e.document)}return n}function xo(e){var n=e&&e.nodeName&&e.nodeName.toLowerCase();return n&&(n==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||n==="textarea"||e.contentEditable==="true")}function J0(e){var n=Gu(),s=e.focusedElem,i=e.selectionRange;if(n!==s&&s&&s.ownerDocument&&Ku(s.ownerDocument.documentElement,s)){if(i!==null&&xo(s)){if(n=i.start,e=i.end,e===void 0&&(e=n),"selectionStart"in s)s.selectionStart=n,s.selectionEnd=Math.min(e,s.value.length);else if(e=(n=s.ownerDocument||document)&&n.defaultView||window,e.getSelection){e=e.getSelection();var d=s.textContent.length,h=Math.min(i.start,d);i=i.end===void 0?h:Math.min(i.end,d),!e.extend&&h>i&&(d=i,i=h,h=d),d=Hu(s,h);var w=Hu(s,i);d&&w&&(e.rangeCount!==1||e.anchorNode!==d.node||e.anchorOffset!==d.offset||e.focusNode!==w.node||e.focusOffset!==w.offset)&&(n=n.createRange(),n.setStart(d.node,d.offset),e.removeAllRanges(),h>i?(e.addRange(n),e.extend(w.node,w.offset)):(n.setEnd(w.node,w.offset),e.addRange(n)))}}for(n=[],e=s;e=e.parentNode;)e.nodeType===1&&n.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof s.focus=="function"&&s.focus(),s=0;s=document.documentMode,as=null,go=null,oa=null,vo=!1;function Yu(e,n,s){var i=s.window===s?s.document:s.nodeType===9?s:s.ownerDocument;vo||as==null||as!==Me(i)||(i=as,"selectionStart"in i&&xo(i)?i={start:i.selectionStart,end:i.selectionEnd}:(i=(i.ownerDocument&&i.ownerDocument.defaultView||window).getSelection(),i={anchorNode:i.anchorNode,anchorOffset:i.anchorOffset,focusNode:i.focusNode,focusOffset:i.focusOffset}),oa&&ia(oa,i)||(oa=i,i=il(go,"onSelect"),0ds||(e.current=_o[ds],_o[ds]=null,ds--)}function qe(e,n){ds++,_o[ds]=e.current,e.current=n}var Jn={},St=Xn(Jn),At=Xn(!1),Ir=Jn;function us(e,n){var s=e.type.contextTypes;if(!s)return Jn;var i=e.stateNode;if(i&&i.__reactInternalMemoizedUnmaskedChildContext===n)return i.__reactInternalMemoizedMaskedChildContext;var d={},h;for(h in s)d[h]=n[h];return i&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=n,e.__reactInternalMemoizedMaskedChildContext=d),d}function Mt(e){return e=e.childContextTypes,e!=null}function ul(){Je(At),Je(St)}function df(e,n,s){if(St.current!==Jn)throw Error(l(168));qe(St,n),qe(At,s)}function uf(e,n,s){var i=e.stateNode;if(n=n.childContextTypes,typeof i.getChildContext!="function")return s;i=i.getChildContext();for(var d in i)if(!(d in n))throw Error(l(108,Q(e)||"Unknown",d));return B({},s,i)}function fl(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Jn,Ir=St.current,qe(St,e),qe(At,At.current),!0}function ff(e,n,s){var i=e.stateNode;if(!i)throw Error(l(169));s?(e=uf(e,n,Ir),i.__reactInternalMemoizedMergedChildContext=e,Je(At),Je(St),qe(St,e)):Je(At),qe(At,s)}var In=null,hl=!1,To=!1;function hf(e){In===null?In=[e]:In.push(e)}function dv(e){hl=!0,hf(e)}function Zn(){if(!To&&In!==null){To=!0;var e=0,n=Ye;try{var s=In;for(Ye=1;e>=w,d-=w,An=1<<32-on(n)+d|s<Ie?(yt=_e,_e=null):yt=_e.sibling;var We=Z(z,_e,$[Ie],le);if(We===null){_e===null&&(_e=yt);break}e&&_e&&We.alternate===null&&n(z,_e),O=h(We,O,Ie),Re===null?Se=We:Re.sibling=We,Re=We,_e=yt}if(Ie===$.length)return s(z,_e),et&&Mr(z,Ie),Se;if(_e===null){for(;Ie<$.length;Ie++)_e=re(z,$[Ie],le),_e!==null&&(O=h(_e,O,Ie),Re===null?Se=_e:Re.sibling=_e,Re=_e);return et&&Mr(z,Ie),Se}for(_e=i(z,_e);Ie<$.length;Ie++)yt=pe(_e,z,Ie,$[Ie],le),yt!==null&&(e&&yt.alternate!==null&&_e.delete(yt.key===null?Ie:yt.key),O=h(yt,O,Ie),Re===null?Se=yt:Re.sibling=yt,Re=yt);return e&&_e.forEach(function(or){return n(z,or)}),et&&Mr(z,Ie),Se}function be(z,O,$,le){var Se=J($);if(typeof Se!="function")throw Error(l(150));if($=Se.call($),$==null)throw Error(l(151));for(var Re=Se=null,_e=O,Ie=O=0,yt=null,We=$.next();_e!==null&&!We.done;Ie++,We=$.next()){_e.index>Ie?(yt=_e,_e=null):yt=_e.sibling;var or=Z(z,_e,We.value,le);if(or===null){_e===null&&(_e=yt);break}e&&_e&&or.alternate===null&&n(z,_e),O=h(or,O,Ie),Re===null?Se=or:Re.sibling=or,Re=or,_e=yt}if(We.done)return s(z,_e),et&&Mr(z,Ie),Se;if(_e===null){for(;!We.done;Ie++,We=$.next())We=re(z,We.value,le),We!==null&&(O=h(We,O,Ie),Re===null?Se=We:Re.sibling=We,Re=We);return et&&Mr(z,Ie),Se}for(_e=i(z,_e);!We.done;Ie++,We=$.next())We=pe(_e,z,Ie,We.value,le),We!==null&&(e&&We.alternate!==null&&_e.delete(We.key===null?Ie:We.key),O=h(We,O,Ie),Re===null?Se=We:Re.sibling=We,Re=We);return e&&_e.forEach(function(Wv){return n(z,Wv)}),et&&Mr(z,Ie),Se}function ot(z,O,$,le){if(typeof $=="object"&&$!==null&&$.type===M&&$.key===null&&($=$.props.children),typeof $=="object"&&$!==null){switch($.$$typeof){case F:e:{for(var Se=$.key,Re=O;Re!==null;){if(Re.key===Se){if(Se=$.type,Se===M){if(Re.tag===7){s(z,Re.sibling),O=d(Re,$.props.children),O.return=z,z=O;break e}}else if(Re.elementType===Se||typeof Se=="object"&&Se!==null&&Se.$$typeof===Y&&yf(Se)===Re.type){s(z,Re.sibling),O=d(Re,$.props),O.ref=ma(z,Re,$),O.return=z,z=O;break e}s(z,Re);break}else n(z,Re);Re=Re.sibling}$.type===M?(O=Vr($.props.children,z.mode,le,$.key),O.return=z,z=O):(le=Bl($.type,$.key,$.props,null,z.mode,le),le.ref=ma(z,O,$),le.return=z,z=le)}return w(z);case G:e:{for(Re=$.key;O!==null;){if(O.key===Re)if(O.tag===4&&O.stateNode.containerInfo===$.containerInfo&&O.stateNode.implementation===$.implementation){s(z,O.sibling),O=d(O,$.children||[]),O.return=z,z=O;break e}else{s(z,O);break}else n(z,O);O=O.sibling}O=Pc($,z.mode,le),O.return=z,z=O}return w(z);case Y:return Re=$._init,ot(z,O,Re($._payload),le)}if(Pr($))return ve(z,O,$,le);if(J($))return be(z,O,$,le);gl(z,$)}return typeof $=="string"&&$!==""||typeof $=="number"?($=""+$,O!==null&&O.tag===6?(s(z,O.sibling),O=d(O,$),O.return=z,z=O):(s(z,O),O=Ec($,z.mode,le),O.return=z,z=O),w(z)):s(z,O)}return ot}var ps=jf(!0),wf=jf(!1),vl=Xn(null),yl=null,xs=null,Oo=null;function Fo(){Oo=xs=yl=null}function zo(e){var n=vl.current;Je(vl),e._currentValue=n}function $o(e,n,s){for(;e!==null;){var i=e.alternate;if((e.childLanes&n)!==n?(e.childLanes|=n,i!==null&&(i.childLanes|=n)):i!==null&&(i.childLanes&n)!==n&&(i.childLanes|=n),e===s)break;e=e.return}}function gs(e,n){yl=e,Oo=xs=null,e=e.dependencies,e!==null&&e.firstContext!==null&&((e.lanes&n)!==0&&(Lt=!0),e.firstContext=null)}function Jt(e){var n=e._currentValue;if(Oo!==e)if(e={context:e,memoizedValue:n,next:null},xs===null){if(yl===null)throw Error(l(308));xs=e,yl.dependencies={lanes:0,firstContext:e}}else xs=xs.next=e;return n}var Lr=null;function Bo(e){Lr===null?Lr=[e]:Lr.push(e)}function Nf(e,n,s,i){var d=n.interleaved;return d===null?(s.next=s,Bo(n)):(s.next=d.next,d.next=s),n.interleaved=s,Ln(e,i)}function Ln(e,n){e.lanes|=n;var s=e.alternate;for(s!==null&&(s.lanes|=n),s=e,e=e.return;e!==null;)e.childLanes|=n,s=e.alternate,s!==null&&(s.childLanes|=n),s=e,e=e.return;return s.tag===3?s.stateNode:null}var er=!1;function Vo(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function bf(e,n){e=e.updateQueue,n.updateQueue===e&&(n.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function Dn(e,n){return{eventTime:e,lane:n,tag:0,payload:null,callback:null,next:null}}function tr(e,n,s){var i=e.updateQueue;if(i===null)return null;if(i=i.shared,(Ue&2)!==0){var d=i.pending;return d===null?n.next=n:(n.next=d.next,d.next=n),i.pending=n,Ln(e,s)}return d=i.interleaved,d===null?(n.next=n,Bo(i)):(n.next=d.next,d.next=n),i.interleaved=n,Ln(e,s)}function jl(e,n,s){if(n=n.updateQueue,n!==null&&(n=n.shared,(s&4194240)!==0)){var i=n.lanes;i&=e.pendingLanes,s|=i,n.lanes=s,to(e,s)}}function Sf(e,n){var s=e.updateQueue,i=e.alternate;if(i!==null&&(i=i.updateQueue,s===i)){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=n:h=h.next=n}else d=h=n;s={baseState:i.baseState,firstBaseUpdate:d,lastBaseUpdate:h,shared:i.shared,effects:i.effects},e.updateQueue=s;return}e=s.lastBaseUpdate,e===null?s.firstBaseUpdate=n:e.next=n,s.lastBaseUpdate=n}function wl(e,n,s,i){var d=e.updateQueue;er=!1;var h=d.firstBaseUpdate,w=d.lastBaseUpdate,T=d.shared.pending;if(T!==null){d.shared.pending=null;var L=T,U=L.next;L.next=null,w===null?h=U:w.next=U,w=L;var ee=e.alternate;ee!==null&&(ee=ee.updateQueue,T=ee.lastBaseUpdate,T!==w&&(T===null?ee.firstBaseUpdate=U:T.next=U,ee.lastBaseUpdate=L))}if(h!==null){var re=d.baseState;w=0,ee=U=L=null,T=h;do{var Z=T.lane,pe=T.eventTime;if((i&Z)===Z){ee!==null&&(ee=ee.next={eventTime:pe,lane:0,tag:T.tag,payload:T.payload,callback:T.callback,next:null});e:{var ve=e,be=T;switch(Z=n,pe=s,be.tag){case 1:if(ve=be.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=be.payload,Z=typeof ve=="function"?ve.call(pe,re,Z):ve,Z==null)break e;re=B({},re,Z);break e;case 2:er=!0}}T.callback!==null&&T.lane!==0&&(e.flags|=64,Z=d.effects,Z===null?d.effects=[T]:Z.push(T))}else pe={eventTime:pe,lane:Z,tag:T.tag,payload:T.payload,callback:T.callback,next:null},ee===null?(U=ee=pe,L=re):ee=ee.next=pe,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&&(L=re),d.baseState=L,d.firstBaseUpdate=U,d.lastBaseUpdate=ee,n=d.shared.interleaved,n!==null){d=n;do w|=d.lane,d=d.next;while(d!==n)}else h===null&&(d.shared.lanes=0);Fr|=w,e.lanes=w,e.memoizedState=re}}function Cf(e,n,s){if(e=n.effects,n.effects=null,e!==null)for(n=0;ns?s:4,e(!0);var i=Go.transition;Go.transition={};try{e(!1),n()}finally{Ye=s,Go.transition=i}}function Wf(){return Zt().memoizedState}function mv(e,n,s){var i=ar(e);if(s={lane:i,action:s,hasEagerState:!1,eagerState:null,next:null},Hf(e))Kf(n,s);else if(s=Nf(e,n,s,i),s!==null){var d=_t();mn(s,e,i,d),Gf(s,n,i)}}function pv(e,n,s){var i=ar(e),d={lane:i,action:s,hasEagerState:!1,eagerState:null,next:null};if(Hf(e))Kf(n,d);else{var h=e.alternate;if(e.lanes===0&&(h===null||h.lanes===0)&&(h=n.lastRenderedReducer,h!==null))try{var w=n.lastRenderedState,T=h(w,s);if(d.hasEagerState=!0,d.eagerState=T,cn(T,w)){var L=n.interleaved;L===null?(d.next=d,Bo(n)):(d.next=L.next,L.next=d),n.interleaved=d;return}}catch{}finally{}s=Nf(e,n,d,i),s!==null&&(d=_t(),mn(s,e,i,d),Gf(s,n,i))}}function Hf(e){var n=e.alternate;return e===st||n!==null&&n===st}function Kf(e,n){va=Sl=!0;var s=e.pending;s===null?n.next=n:(n.next=s.next,s.next=n),e.pending=n}function Gf(e,n,s){if((s&4194240)!==0){var i=n.lanes;i&=e.pendingLanes,s|=i,n.lanes=s,to(e,s)}}var El={readContext:Jt,useCallback:Ct,useContext:Ct,useEffect:Ct,useImperativeHandle:Ct,useInsertionEffect:Ct,useLayoutEffect:Ct,useMemo:Ct,useReducer:Ct,useRef:Ct,useState:Ct,useDebugValue:Ct,useDeferredValue:Ct,useTransition:Ct,useMutableSource:Ct,useSyncExternalStore:Ct,useId:Ct,unstable_isNewReconciler:!1},xv={readContext:Jt,useCallback:function(e,n){return bn().memoizedState=[e,n===void 0?null:n],e},useContext:Jt,useEffect:Df,useImperativeHandle:function(e,n,s){return s=s!=null?s.concat([e]):null,Cl(4194308,4,zf.bind(null,n,e),s)},useLayoutEffect:function(e,n){return Cl(4194308,4,e,n)},useInsertionEffect:function(e,n){return Cl(4,2,e,n)},useMemo:function(e,n){var s=bn();return n=n===void 0?null:n,e=e(),s.memoizedState=[e,n],e},useReducer:function(e,n,s){var i=bn();return n=s!==void 0?s(n):n,i.memoizedState=i.baseState=n,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:n},i.queue=e,e=e.dispatch=mv.bind(null,st,e),[i.memoizedState,e]},useRef:function(e){var n=bn();return e={current:e},n.memoizedState=e},useState:Mf,useDebugValue:ec,useDeferredValue:function(e){return bn().memoizedState=e},useTransition:function(){var e=Mf(!1),n=e[0];return e=hv.bind(null,e[1]),bn().memoizedState=e,[n,e]},useMutableSource:function(){},useSyncExternalStore:function(e,n,s){var i=st,d=bn();if(et){if(s===void 0)throw Error(l(407));s=s()}else{if(s=n(),vt===null)throw Error(l(349));(Or&30)!==0||Rf(i,n,s)}d.memoizedState=s;var h={value:s,getSnapshot:n};return d.queue=h,Df(Tf.bind(null,i,h,e),[e]),i.flags|=2048,wa(9,_f.bind(null,i,h,s,n),void 0,null),s},useId:function(){var e=bn(),n=vt.identifierPrefix;if(et){var s=Mn,i=An;s=(i&~(1<<32-on(i)-1)).toString(32)+s,n=":"+n+"R"+s,s=ya++,0<\/script>",e=e.removeChild(e.firstChild)):typeof i.is=="string"?e=w.createElement(s,{is:i.is}):(e=w.createElement(s),s==="select"&&(w=e,i.multiple?w.multiple=!0:i.size&&(w.size=i.size))):e=w.createElementNS(e,s),e[wn]=n,e[fa]=i,hh(e,n,!1,!1),n.stateNode=e;e:{switch(w=Hi(s,i),s){case"dialog":Xe("cancel",e),Xe("close",e),d=i;break;case"iframe":case"object":case"embed":Xe("load",e),d=i;break;case"video":case"audio":for(d=0;dNs&&(n.flags|=128,i=!0,Na(h,!1),n.lanes=4194304)}else{if(!i)if(e=Nl(w),e!==null){if(n.flags|=128,i=!0,s=e.updateQueue,s!==null&&(n.updateQueue=s,n.flags|=4),Na(h,!0),h.tail===null&&h.tailMode==="hidden"&&!w.alternate&&!et)return kt(n),null}else 2*it()-h.renderingStartTime>Ns&&s!==1073741824&&(n.flags|=128,i=!0,Na(h,!1),n.lanes=4194304);h.isBackwards?(w.sibling=n.child,n.child=w):(s=h.last,s!==null?s.sibling=w:n.child=w,h.last=w)}return h.tail!==null?(n=h.tail,h.rendering=n,h.tail=n.sibling,h.renderingStartTime=it(),n.sibling=null,s=rt.current,qe(rt,i?s&1|2:s&1),n):(kt(n),null);case 22:case 23:return Sc(),i=n.memoizedState!==null,e!==null&&e.memoizedState!==null!==i&&(n.flags|=8192),i&&(n.mode&1)!==0?(Wt&1073741824)!==0&&(kt(n),n.subtreeFlags&6&&(n.flags|=8192)):kt(n),null;case 24:return null;case 25:return null}throw Error(l(156,n.tag))}function Sv(e,n){switch(Ao(n),n.tag){case 1:return Mt(n.type)&&ul(),e=n.flags,e&65536?(n.flags=e&-65537|128,n):null;case 3:return vs(),Je(At),Je(St),Ko(),e=n.flags,(e&65536)!==0&&(e&128)===0?(n.flags=e&-65537|128,n):null;case 5:return Wo(n),null;case 13:if(Je(rt),e=n.memoizedState,e!==null&&e.dehydrated!==null){if(n.alternate===null)throw Error(l(340));ms()}return e=n.flags,e&65536?(n.flags=e&-65537|128,n):null;case 19:return Je(rt),null;case 4:return vs(),null;case 10:return zo(n.type._context),null;case 22:case 23:return Sc(),null;case 24:return null;default:return null}}var Tl=!1,Et=!1,Cv=typeof WeakSet=="function"?WeakSet:Set,ge=null;function js(e,n){var s=e.ref;if(s!==null)if(typeof s=="function")try{s(null)}catch(i){lt(e,n,i)}else s.current=null}function fc(e,n,s){try{s()}catch(i){lt(e,n,i)}}var xh=!1;function kv(e,n){if(So=Xa,e=Gu(),xo(e)){if("selectionStart"in e)var s={start:e.selectionStart,end:e.selectionEnd};else e:{s=(s=e.ownerDocument)&&s.defaultView||window;var i=s.getSelection&&s.getSelection();if(i&&i.rangeCount!==0){s=i.anchorNode;var d=i.anchorOffset,h=i.focusNode;i=i.focusOffset;try{s.nodeType,h.nodeType}catch{s=null;break e}var w=0,T=-1,L=-1,U=0,ee=0,re=e,Z=null;t:for(;;){for(var pe;re!==s||d!==0&&re.nodeType!==3||(T=w+d),re!==h||i!==0&&re.nodeType!==3||(L=w+i),re.nodeType===3&&(w+=re.nodeValue.length),(pe=re.firstChild)!==null;)Z=re,re=pe;for(;;){if(re===e)break t;if(Z===s&&++U===d&&(T=w),Z===h&&++ee===i&&(L=w),(pe=re.nextSibling)!==null)break;re=Z,Z=re.parentNode}re=pe}s=T===-1||L===-1?null:{start:T,end:L}}else s=null}s=s||{start:0,end:0}}else s=null;for(Co={focusedElem:e,selectionRange:s},Xa=!1,ge=n;ge!==null;)if(n=ge,e=n.child,(n.subtreeFlags&1028)!==0&&e!==null)e.return=n,ge=e;else for(;ge!==null;){n=ge;try{var ve=n.alternate;if((n.flags&1024)!==0)switch(n.tag){case 0:case 11:case 15:break;case 1:if(ve!==null){var be=ve.memoizedProps,ot=ve.memoizedState,z=n.stateNode,O=z.getSnapshotBeforeUpdate(n.elementType===n.type?be:un(n.type,be),ot);z.__reactInternalSnapshotBeforeUpdate=O}break;case 3:var $=n.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(le){lt(n,n.return,le)}if(e=n.sibling,e!==null){e.return=n.return,ge=e;break}ge=n.return}return ve=xh,xh=!1,ve}function ba(e,n,s){var i=n.updateQueue;if(i=i!==null?i.lastEffect:null,i!==null){var d=i=i.next;do{if((d.tag&e)===e){var h=d.destroy;d.destroy=void 0,h!==void 0&&fc(n,s,h)}d=d.next}while(d!==i)}}function Il(e,n){if(n=n.updateQueue,n=n!==null?n.lastEffect:null,n!==null){var s=n=n.next;do{if((s.tag&e)===e){var i=s.create;s.destroy=i()}s=s.next}while(s!==n)}}function hc(e){var n=e.ref;if(n!==null){var s=e.stateNode;switch(e.tag){case 5:e=s;break;default:e=s}typeof n=="function"?n(e):n.current=e}}function gh(e){var n=e.alternate;n!==null&&(e.alternate=null,gh(n)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(n=e.stateNode,n!==null&&(delete n[wn],delete n[fa],delete n[Ro],delete n[ov],delete n[cv])),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 mc(e,n,s){var i=e.tag;if(i===5||i===6)e=e.stateNode,n?s.nodeType===8?s.parentNode.insertBefore(e,n):s.insertBefore(e,n):(s.nodeType===8?(n=s.parentNode,n.insertBefore(e,s)):(n=s,n.appendChild(e)),s=s._reactRootContainer,s!=null||n.onclick!==null||(n.onclick=cl));else if(i!==4&&(e=e.child,e!==null))for(mc(e,n,s),e=e.sibling;e!==null;)mc(e,n,s),e=e.sibling}function pc(e,n,s){var i=e.tag;if(i===5||i===6)e=e.stateNode,n?s.insertBefore(e,n):s.appendChild(e);else if(i!==4&&(e=e.child,e!==null))for(pc(e,n,s),e=e.sibling;e!==null;)pc(e,n,s),e=e.sibling}var Nt=null,fn=!1;function nr(e,n,s){for(s=s.child;s!==null;)jh(e,n,s),s=s.sibling}function jh(e,n,s){if(jn&&typeof jn.onCommitFiberUnmount=="function")try{jn.onCommitFiberUnmount(Ha,s)}catch{}switch(s.tag){case 5:Et||js(s,n);case 6:var i=Nt,d=fn;Nt=null,nr(e,n,s),Nt=i,fn=d,Nt!==null&&(fn?(e=Nt,s=s.stateNode,e.nodeType===8?e.parentNode.removeChild(s):e.removeChild(s)):Nt.removeChild(s.stateNode));break;case 18:Nt!==null&&(fn?(e=Nt,s=s.stateNode,e.nodeType===8?Po(e.parentNode,s):e.nodeType===1&&Po(e,s),ta(e)):Po(Nt,s.stateNode));break;case 4:i=Nt,d=fn,Nt=s.stateNode.containerInfo,fn=!0,nr(e,n,s),Nt=i,fn=d;break;case 0:case 11:case 14:case 15:if(!Et&&(i=s.updateQueue,i!==null&&(i=i.lastEffect,i!==null))){d=i=i.next;do{var h=d,w=h.destroy;h=h.tag,w!==void 0&&((h&2)!==0||(h&4)!==0)&&fc(s,n,w),d=d.next}while(d!==i)}nr(e,n,s);break;case 1:if(!Et&&(js(s,n),i=s.stateNode,typeof i.componentWillUnmount=="function"))try{i.props=s.memoizedProps,i.state=s.memoizedState,i.componentWillUnmount()}catch(T){lt(s,n,T)}nr(e,n,s);break;case 21:nr(e,n,s);break;case 22:s.mode&1?(Et=(i=Et)||s.memoizedState!==null,nr(e,n,s),Et=i):nr(e,n,s);break;default:nr(e,n,s)}}function wh(e){var n=e.updateQueue;if(n!==null){e.updateQueue=null;var s=e.stateNode;s===null&&(s=e.stateNode=new Cv),n.forEach(function(i){var d=Lv.bind(null,e,i);s.has(i)||(s.add(i),i.then(d,d))})}}function hn(e,n){var s=n.deletions;if(s!==null)for(var i=0;id&&(d=w),i&=~h}if(i=d,i=it()-i,i=(120>i?120:480>i?480:1080>i?1080:1920>i?1920:3e3>i?3e3:4320>i?4320:1960*Pv(i/1960))-i,10e?16:e,sr===null)var i=!1;else{if(e=sr,sr=null,Ol=0,(Ue&6)!==0)throw Error(l(331));var d=Ue;for(Ue|=4,ge=e.current;ge!==null;){var h=ge,w=h.child;if((ge.flags&16)!==0){var T=h.deletions;if(T!==null){for(var L=0;Lit()-vc?$r(e,0):gc|=s),Ot(e,n)}function Mh(e,n){n===0&&((e.mode&1)===0?n=1:(n=Ga,Ga<<=1,(Ga&130023424)===0&&(Ga=4194304)));var s=_t();e=Ln(e,n),e!==null&&(qs(e,n,s),Ot(e,s))}function Mv(e){var n=e.memoizedState,s=0;n!==null&&(s=n.retryLane),Mh(e,s)}function Lv(e,n){var s=0;switch(e.tag){case 13:var i=e.stateNode,d=e.memoizedState;d!==null&&(s=d.retryLane);break;case 19:i=e.stateNode;break;default:throw Error(l(314))}i!==null&&i.delete(n),Mh(e,s)}var Lh;Lh=function(e,n,s){if(e!==null)if(e.memoizedProps!==n.pendingProps||At.current)Lt=!0;else{if((e.lanes&s)===0&&(n.flags&128)===0)return Lt=!1,Nv(e,n,s);Lt=(e.flags&131072)!==0}else Lt=!1,et&&(n.flags&1048576)!==0&&mf(n,pl,n.index);switch(n.lanes=0,n.tag){case 2:var i=n.type;_l(e,n),e=n.pendingProps;var d=us(n,St.current);gs(n,s),d=Qo(null,n,i,e,d,s);var h=qo();return n.flags|=1,typeof d=="object"&&d!==null&&typeof d.render=="function"&&d.$$typeof===void 0?(n.tag=1,n.memoizedState=null,n.updateQueue=null,Mt(i)?(h=!0,fl(n)):h=!1,n.memoizedState=d.state!==null&&d.state!==void 0?d.state:null,Vo(n),d.updater=Pl,n.stateNode=d,d._reactInternals=n,nc(n,i,e,s),n=lc(null,n,i,!0,h,s)):(n.tag=0,et&&h&&Io(n),Rt(null,n,d,s),n=n.child),n;case 16:i=n.elementType;e:{switch(_l(e,n),e=n.pendingProps,d=i._init,i=d(i._payload),n.type=i,d=n.tag=Ov(i),e=un(i,e),d){case 0:n=ac(null,n,i,e,s);break e;case 1:n=ih(null,n,i,e,s);break e;case 11:n=nh(null,n,i,e,s);break e;case 14:n=rh(null,n,i,un(i.type,e),s);break e}throw Error(l(306,i,""))}return n;case 0:return i=n.type,d=n.pendingProps,d=n.elementType===i?d:un(i,d),ac(e,n,i,d,s);case 1:return i=n.type,d=n.pendingProps,d=n.elementType===i?d:un(i,d),ih(e,n,i,d,s);case 3:e:{if(oh(n),e===null)throw Error(l(387));i=n.pendingProps,h=n.memoizedState,d=h.element,bf(e,n),wl(n,i,null,s);var w=n.memoizedState;if(i=w.element,h.isDehydrated)if(h={element:i,isDehydrated:!1,cache:w.cache,pendingSuspenseBoundaries:w.pendingSuspenseBoundaries,transitions:w.transitions},n.updateQueue.baseState=h,n.memoizedState=h,n.flags&256){d=ys(Error(l(423)),n),n=ch(e,n,i,s,d);break e}else if(i!==d){d=ys(Error(l(424)),n),n=ch(e,n,i,s,d);break e}else for(Ut=qn(n.stateNode.containerInfo.firstChild),Vt=n,et=!0,dn=null,s=wf(n,null,i,s),n.child=s;s;)s.flags=s.flags&-3|4096,s=s.sibling;else{if(ms(),i===d){n=On(e,n,s);break e}Rt(e,n,i,s)}n=n.child}return n;case 5:return kf(n),e===null&&Lo(n),i=n.type,d=n.pendingProps,h=e!==null?e.memoizedProps:null,w=d.children,ko(i,d)?w=null:h!==null&&ko(i,h)&&(n.flags|=32),lh(e,n),Rt(e,n,w,s),n.child;case 6:return e===null&&Lo(n),null;case 13:return dh(e,n,s);case 4:return Uo(n,n.stateNode.containerInfo),i=n.pendingProps,e===null?n.child=ps(n,null,i,s):Rt(e,n,i,s),n.child;case 11:return i=n.type,d=n.pendingProps,d=n.elementType===i?d:un(i,d),nh(e,n,i,d,s);case 7:return Rt(e,n,n.pendingProps,s),n.child;case 8:return Rt(e,n,n.pendingProps.children,s),n.child;case 12:return Rt(e,n,n.pendingProps.children,s),n.child;case 10:e:{if(i=n.type._context,d=n.pendingProps,h=n.memoizedProps,w=d.value,qe(vl,i._currentValue),i._currentValue=w,h!==null)if(cn(h.value,w)){if(h.children===d.children&&!At.current){n=On(e,n,s);break e}}else for(h=n.child,h!==null&&(h.return=n);h!==null;){var T=h.dependencies;if(T!==null){w=h.child;for(var L=T.firstContext;L!==null;){if(L.context===i){if(h.tag===1){L=Dn(-1,s&-s),L.tag=2;var U=h.updateQueue;if(U!==null){U=U.shared;var ee=U.pending;ee===null?L.next=L:(L.next=ee.next,ee.next=L),U.pending=L}}h.lanes|=s,L=h.alternate,L!==null&&(L.lanes|=s),$o(h.return,s,n),T.lanes|=s;break}L=L.next}}else if(h.tag===10)w=h.type===n.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),$o(w,s,n),w=h.sibling}else w=h.child;if(w!==null)w.return=h;else for(w=h;w!==null;){if(w===n){w=null;break}if(h=w.sibling,h!==null){h.return=w.return,w=h;break}w=w.return}h=w}Rt(e,n,d.children,s),n=n.child}return n;case 9:return d=n.type,i=n.pendingProps.children,gs(n,s),d=Jt(d),i=i(d),n.flags|=1,Rt(e,n,i,s),n.child;case 14:return i=n.type,d=un(i,n.pendingProps),d=un(i.type,d),rh(e,n,i,d,s);case 15:return sh(e,n,n.type,n.pendingProps,s);case 17:return i=n.type,d=n.pendingProps,d=n.elementType===i?d:un(i,d),_l(e,n),n.tag=1,Mt(i)?(e=!0,fl(n)):e=!1,gs(n,s),Qf(n,i,d),nc(n,i,d,s),lc(null,n,i,!0,e,s);case 19:return fh(e,n,s);case 22:return ah(e,n,s)}throw Error(l(156,n.tag))};function Dh(e,n){return mu(e,n)}function Dv(e,n,s,i){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=n,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=i,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function tn(e,n,s,i){return new Dv(e,n,s,i)}function kc(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Ov(e){if(typeof e=="function")return kc(e)?1:0;if(e!=null){if(e=e.$$typeof,e===ie)return 11;if(e===W)return 14}return 2}function ir(e,n){var s=e.alternate;return s===null?(s=tn(e.tag,n,e.key,e.mode),s.elementType=e.elementType,s.type=e.type,s.stateNode=e.stateNode,s.alternate=e,e.alternate=s):(s.pendingProps=n,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,n=e.dependencies,s.dependencies=n===null?null:{lanes:n.lanes,firstContext:n.firstContext},s.sibling=e.sibling,s.index=e.index,s.ref=e.ref,s}function Bl(e,n,s,i,d,h){var w=2;if(i=e,typeof e=="function")kc(e)&&(w=1);else if(typeof e=="string")w=5;else e:switch(e){case M:return Vr(s.children,d,h,n);case V:w=8,d|=8;break;case te:return e=tn(12,s,n,d|2),e.elementType=te,e.lanes=h,e;case fe:return e=tn(13,s,n,d),e.elementType=fe,e.lanes=h,e;case H:return e=tn(19,s,n,d),e.elementType=H,e.lanes=h,e;case K:return Vl(s,d,h,n);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case ue:w=10;break e;case ce:w=9;break e;case ie:w=11;break e;case W:w=14;break e;case Y:w=16,i=null;break e}throw Error(l(130,e==null?e:typeof e,""))}return n=tn(w,s,n,d),n.elementType=e,n.type=i,n.lanes=h,n}function Vr(e,n,s,i){return e=tn(7,e,i,n),e.lanes=s,e}function Vl(e,n,s,i){return e=tn(22,e,i,n),e.elementType=K,e.lanes=s,e.stateNode={isHidden:!1},e}function Ec(e,n,s){return e=tn(6,e,null,n),e.lanes=s,e}function Pc(e,n,s){return n=tn(4,e.children!==null?e.children:[],e.key,n),n.lanes=s,n.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},n}function Fv(e,n,s,i,d){this.tag=n,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=eo(0),this.expirationTimes=eo(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=eo(0),this.identifierPrefix=i,this.onRecoverableError=d,this.mutableSourceEagerHydrationData=null}function Rc(e,n,s,i,d,h,w,T,L){return e=new Fv(e,n,s,T,L),n===1?(n=1,h===!0&&(n|=8)):n=0,h=tn(3,null,null,n),e.current=h,h.stateNode=e,h.memoizedState={element:i,isDehydrated:s,cache:null,transitions:null,pendingSuspenseBoundaries:null},Vo(h),e}function zv(e,n,s){var i=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(r)}catch(a){console.error(a)}}return r(),Lc.exports=Xv(),Lc.exports}var qh;function Jv(){if(qh)return Ql;qh=1;var r=Xm();return Ql.createRoot=r.createRoot,Ql.hydrateRoot=r.hydrateRoot,Ql}var Zv=Jv(),Da=Xm();const ey=qm(Da);/** - * @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 Cd(r,a){if(!r){typeof console<"u"&&console.warn(a);try{throw new Error(a)}catch{}}}function ny(){return Math.random().toString(36).substr(2,8)}function Jh(r,a){return{usr:r.state,key:r.key,idx:a}}function ed(r,a,l,o){return l===void 0&&(l=null),Ta({pathname:typeof r=="string"?r:r.pathname,search:"",hash:""},typeof a=="string"?Ms(a):a,{state:l,key:a&&a.key||o||ny()})}function ui(r){let{pathname:a="/",search:l="",hash:o=""}=r;return l&&l!=="?"&&(a+=l.charAt(0)==="?"?l:"?"+l),o&&o!=="#"&&(a+=o.charAt(0)==="#"?o:"#"+o),a}function Ms(r){let a={};if(r){let l=r.indexOf("#");l>=0&&(a.hash=r.substr(l),r=r.substr(0,l));let o=r.indexOf("?");o>=0&&(a.search=r.substr(o),r=r.substr(0,o)),r&&(a.pathname=r)}return a}function ry(r,a,l,o){o===void 0&&(o={});let{window:c=document.defaultView,v5Compat:u=!1}=o,f=c.history,m=hr.Pop,x=null,g=v();g==null&&(g=0,f.replaceState(Ta({},f.state,{idx:g}),""));function v(){return(f.state||{idx:null}).idx}function y(){m=hr.Pop;let b=v(),k=b==null?null:b-g;g=b,x&&x({action:m,location:N.location,delta:k})}function E(b,k){m=hr.Push;let R=ed(N.location,b,k);g=v()+1;let j=Jh(R,g),_=N.createHref(R);try{f.pushState(j,"",_)}catch(F){if(F instanceof DOMException&&F.name==="DataCloneError")throw F;c.location.assign(_)}u&&x&&x({action:m,location:N.location,delta:1})}function P(b,k){m=hr.Replace;let R=ed(N.location,b,k);g=v();let j=Jh(R,g),_=N.createHref(R);f.replaceState(j,"",_),u&&x&&x({action:m,location:N.location,delta:0})}function C(b){let k=c.location.origin!=="null"?c.location.origin:c.location.href,R=typeof b=="string"?b:ui(b);return R=R.replace(/ $/,"%20"),ct(k,"No window.location.(origin|href) available to create URL for href: "+R),new URL(R,k)}let N={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(Xh,y),x=b,()=>{c.removeEventListener(Xh,y),x=null}},createHref(b){return a(c,b)},createURL:C,encodeLocation(b){let k=C(b);return{pathname:k.pathname,search:k.search,hash:k.hash}},push:E,replace:P,go(b){return f.go(b)}};return N}var Zh;(function(r){r.data="data",r.deferred="deferred",r.redirect="redirect",r.error="error"})(Zh||(Zh={}));function sy(r,a,l){return l===void 0&&(l="/"),ay(r,a,l)}function ay(r,a,l,o){let c=typeof a=="string"?Ms(a):a,u=kd(c.pathname||"/",l);if(u==null)return null;let f=Jm(r);ly(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("/")&&(ct(x.relativePath.startsWith(o),'Absolute route path "'+x.relativePath+'" nested under path '+('"'+o+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),x.relativePath=x.relativePath.slice(o.length));let g=mr([o,x.relativePath]),v=l.concat(x);u.children&&u.children.length>0&&(ct(u.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+g+'".')),Jm(u.children,a,v,g)),!(u.path==null&&!u.index)&&a.push({path:g,score:hy(g,u.index),routesMeta:v})};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,...o]=a,c=l.endsWith("?"),u=l.replace(/\?$/,"");if(o.length===0)return c?[u,""]:[u];let f=Zm(o.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 ly(r){r.sort((a,l)=>a.score!==l.score?l.score-a.score:my(a.routesMeta.map(o=>o.childrenIndex),l.routesMeta.map(o=>o.childrenIndex)))}const iy=/^:[\w-]+$/,oy=3,cy=2,dy=1,uy=10,fy=-2,em=r=>r==="*";function hy(r,a){let l=r.split("/"),o=l.length;return l.some(em)&&(o+=fy),a&&(o+=cy),l.filter(c=>!em(c)).reduce((c,u)=>c+(iy.test(u)?oy:u===""?dy:uy),o)}function my(r,a){return r.length===a.length&&r.slice(0,-1).every((o,c)=>o===a[c])?r[r.length-1]-a[a.length-1]:0}function py(r,a,l){let{routesMeta:o}=r,c={},u="/",f=[];for(let m=0;m{let{paramName:E,isOptional:P}=v;if(E==="*"){let N=m[y]||"";f=u.slice(0,u.length-N.length).replace(/(.)\/+$/,"$1")}const C=m[y];return P&&!C?g[E]=void 0:g[E]=(C||"").replace(/%2F/g,"/"),g},{}),pathname:u,pathnameBase:f,pattern:r}}function gy(r,a,l){a===void 0&&(a=!1),l===void 0&&(l=!0),Cd(r==="*"||!r.endsWith("*")||r.endsWith("/*"),'Route path "'+r+'" will be treated as if it were '+('"'+r.replace(/\*$/,"/*")+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+('please change the route path to "'+r.replace(/\*$/,"/*")+'".'));let o=[],c="^"+r.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(f,m,x)=>(o.push({paramName:m,isOptional:x!=null}),x?"/?([^\\/]+)?":"/([^\\/]+)"));return r.endsWith("*")?(o.push({paramName:"*"}),c+=r==="*"||r==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):l?c+="\\/*$":r!==""&&r!=="/"&&(c+="(?:(?=\\/|$))"),[new RegExp(c,a?void 0:"i"),o]}function vy(r){try{return r.split("/").map(a=>decodeURIComponent(a).replace(/\//g,"%2F")).join("/")}catch(a){return Cd(!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 kd(r,a){if(a==="/")return r;if(!r.toLowerCase().startsWith(a.toLowerCase()))return null;let l=a.endsWith("/")?a.length-1:a.length,o=r.charAt(l);return o&&o!=="/"?null:r.slice(l)||"/"}const yy=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,jy=r=>yy.test(r);function wy(r,a){a===void 0&&(a="/");let{pathname:l,search:o="",hash:c=""}=typeof r=="string"?Ms(r):r,u;if(l)if(jy(l))u=l;else{if(l.includes("//")){let f=l;l=l.replace(/\/\/+/g,"/"),Cd(!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:Sy(o),hash:Cy(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 Fc(r,a,l,o){return"Cannot include a '"+r+"' character in a manually specified "+("`to."+a+"` field ["+JSON.stringify(o)+"]. Please separate it out to the ")+("`to."+l+"` field. Alternatively you may provide the full path as ")+'a string in and the router will parse it for you.'}function Ny(r){return r.filter((a,l)=>l===0||a.route.path&&a.route.path.length>0)}function Ed(r,a){let l=Ny(r);return a?l.map((o,c)=>c===l.length-1?o.pathname:o.pathnameBase):l.map(o=>o.pathnameBase)}function Pd(r,a,l,o){o===void 0&&(o=!1);let c;typeof r=="string"?c=Ms(r):(c=Ta({},r),ct(!c.pathname||!c.pathname.includes("?"),Fc("?","pathname","search",c)),ct(!c.pathname||!c.pathname.includes("#"),Fc("#","pathname","hash",c)),ct(!c.search||!c.search.includes("#"),Fc("#","search","hash",c)));let u=r===""||c.pathname==="",f=u?"/":c.pathname,m;if(f==null)m=l;else{let y=a.length-1;if(!o&&f.startsWith("..")){let E=f.split("/");for(;E[0]==="..";)E.shift(),y-=1;c.pathname=E.join("/")}m=y>=0?a[y]:"/"}let x=wy(c,m),g=f&&f!=="/"&&f.endsWith("/"),v=(u||f===".")&&l.endsWith("/");return!x.pathname.endsWith("/")&&(g||v)&&(x.pathname+="/"),x}const mr=r=>r.join("/").replace(/\/\/+/g,"/"),by=r=>r.replace(/\/+$/,"").replace(/^\/*/,"/"),Sy=r=>!r||r==="?"?"":r.startsWith("?")?r:"?"+r,Cy=r=>!r||r==="#"?"":r.startsWith("#")?r:"#"+r;function ky(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 Ey=["get",...ep];new Set(Ey);/** - * 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(g,v){if(v===void 0&&(v={}),!m.current)return;if(typeof g=="number"){o.go(g);return}let y=Pd(g,JSON.parse(f),u,v.relative==="path");r==null&&a!=="/"&&(y.pathname=y.pathname==="/"?a:mr([a,y.pathname])),(v.replace?o.replace:o.push)(y,v.state,v)},[a,o,f,u,r])}const Ty=p.createContext(null);function Iy(r){let a=p.useContext(Vn).outlet;return a&&p.createElement(Ty.Provider,{value:r},a)}function rp(r,a){let{relative:l}=a===void 0?{}:a,{future:o}=p.useContext(wr),{matches:c}=p.useContext(Vn),{pathname:u}=Jr(),f=JSON.stringify(Ed(c,o.v7_relativeSplatPath));return p.useMemo(()=>Pd(r,JSON.parse(f),u,l==="path"),[r,f,u,l])}function Ay(r,a){return My(r,a)}function My(r,a,l,o){Ls()||ct(!1);let{navigator:c}=p.useContext(wr),{matches:u}=p.useContext(Vn),f=u[u.length-1],m=f?f.params:{};f&&f.pathname;let x=f?f.pathnameBase:"/";f&&f.route;let g=Jr(),v;if(a){var y;let b=typeof a=="string"?Ms(a):a;x==="/"||(y=b.pathname)!=null&&y.startsWith(x)||ct(!1),v=b}else v=g;let E=v.pathname||"/",P=E;if(x!=="/"){let b=x.replace(/^\//,"").split("/");P="/"+E.replace(/^\//,"").split("/").slice(b.length).join("/")}let C=sy(r,{pathname:P}),N=zy(C&&C.map(b=>Object.assign({},b,{params:Object.assign({},m,b.params),pathname:mr([x,c.encodeLocation?c.encodeLocation(b.pathname).pathname:b.pathname]),pathnameBase:b.pathnameBase==="/"?x:mr([x,c.encodeLocation?c.encodeLocation(b.pathnameBase).pathname:b.pathnameBase])})),u,l,o);return a&&N?p.createElement(Ci.Provider,{value:{location:Ia({pathname:"/",search:"",hash:"",state:null,key:"default"},v),navigationType:hr.Pop}},N):N}function Ly(){let r=Uy(),a=ky(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 Dy=p.createElement(Ly,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(Vn.Provider,{value:this.props.routeContext},p.createElement(tp.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function Fy(r){let{routeContext:a,match:l,children:o}=r,c=p.useContext(Rd);return c&&c.static&&c.staticContext&&(l.route.errorElement||l.route.ErrorBoundary)&&(c.staticContext._deepestRenderedBoundaryId=l.route.id),p.createElement(Vn.Provider,{value:a},o)}function zy(r,a,l,o){var c;if(a===void 0&&(a=[]),l===void 0&&(l=null),o===void 0&&(o=null),r==null){var u;if(!l)return null;if(l.errors)r=l.matches;else if((u=o)!=null&&u.v7_partialHydration&&a.length===0&&!l.initialized&&l.matches.length>0)r=l.matches;else return null}let f=r,m=(c=l)==null?void 0:c.errors;if(m!=null){let v=f.findIndex(y=>y.route.id&&(m==null?void 0:m[y.route.id])!==void 0);v>=0||ct(!1),f=f.slice(0,Math.min(f.length,v+1))}let x=!1,g=-1;if(l&&o&&o.v7_partialHydration)for(let v=0;v=0?f=f.slice(0,g+1):f=[f[0]];break}}}return f.reduceRight((v,y,E)=>{let P,C=!1,N=null,b=null;l&&(P=m&&y.route.id?m[y.route.id]:void 0,N=y.route.errorElement||Dy,x&&(g<0&&E===0?(Hy("route-fallback"),C=!0,b=null):g===E&&(C=!0,b=y.route.hydrateFallbackElement||null)));let k=a.concat(f.slice(0,E+1)),R=()=>{let j;return P?j=N:C?j=b:y.route.Component?j=p.createElement(y.route.Component,null):y.route.element?j=y.route.element:j=v,p.createElement(Fy,{match:y,routeContext:{outlet:v,matches:k,isDataRoute:l!=null},children:j})};return l&&(y.route.ErrorBoundary||y.route.errorElement||E===0)?p.createElement(Oy,{location:l.location,revalidation:l.revalidation,component:N,error:P,children:R(),routeContext:{outlet:null,matches:k,isDataRoute:!0}}):R()},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 $y(r){let a=p.useContext(Rd);return a||ct(!1),a}function By(r){let a=p.useContext(Py);return a||ct(!1),a}function Vy(r){let a=p.useContext(Vn);return a||ct(!1),a}function lp(r){let a=Vy(),l=a.matches[a.matches.length-1];return l.route.id||ct(!1),l.route.id}function Uy(){var r;let a=p.useContext(tp),l=By(),o=lp();return a!==void 0?a:(r=l.errors)==null?void 0:r[o]}function Wy(){let{router:r}=$y(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 Hy(r,a,l){nm[r]||(nm[r]=!0)}function Ky(r,a){r==null||r.v7_startTransition,r==null||r.v7_relativeSplatPath}function Gy(r){let{to:a,replace:l,state:o,relative:c}=r;Ls()||ct(!1);let{future:u,static:f}=p.useContext(wr),{matches:m}=p.useContext(Vn),{pathname:x}=Jr(),g=Oa(),v=Pd(a,Ed(m,u.v7_relativeSplatPath),x,c==="path"),y=JSON.stringify(v);return p.useEffect(()=>g(JSON.parse(y),{replace:l,state:o,relative:c}),[g,y,c,l,o]),null}function Yy(r){return Iy(r.context)}function at(r){ct(!1)}function Qy(r){let{basename:a="/",children:l=null,location:o,navigationType:c=hr.Pop,navigator:u,static:f=!1,future:m}=r;Ls()&&ct(!1);let x=a.replace(/^\/*/,"/"),g=p.useMemo(()=>({basename:x,navigator:u,static:f,future:Ia({v7_relativeSplatPath:!1},m)}),[x,m,u,f]);typeof o=="string"&&(o=Ms(o));let{pathname:v="/",search:y="",hash:E="",state:P=null,key:C="default"}=o,N=p.useMemo(()=>{let b=kd(v,x);return b==null?null:{location:{pathname:b,search:y,hash:E,state:P,key:C},navigationType:c}},[x,v,y,E,P,C,c]);return N==null?null:p.createElement(wr.Provider,{value:g},p.createElement(Ci.Provider,{children:l,value:N}))}function qy(r){let{children:a,location:l}=r;return Ay(td(a),l)}new Promise(()=>{});function td(r,a){a===void 0&&(a=[]);let l=[];return p.Children.forEach(r,(o,c)=>{if(!p.isValidElement(o))return;let u=[...a,c];if(o.type===p.Fragment){l.push.apply(l,td(o.props.children,u));return}o.type!==at&&ct(!1),!o.props.index||!o.props.children||ct(!1);let f={id:o.props.id||u.join("-"),caseSensitive:o.props.caseSensitive,element:o.props.element,Component:o.props.Component,index:o.props.index,path:o.props.path,loader:o.props.loader,action:o.props.action,errorElement:o.props.errorElement,ErrorBoundary:o.props.ErrorBoundary,hasErrorBoundary:o.props.ErrorBoundary!=null||o.props.errorElement!=null,shouldRevalidate:o.props.shouldRevalidate,handle:o.props.handle,lazy:o.props.lazy};o.props.children&&(f.children=td(o.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 nd(){return nd=Object.assign?Object.assign.bind():function(r){for(var a=1;a=0)&&(l[c]=r[c]);return l}function Jy(r){return!!(r.metaKey||r.altKey||r.ctrlKey||r.shiftKey)}function Zy(r,a){return r.button===0&&(!a||a==="_self")&&!Jy(r)}const ej=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","viewTransition"],tj="6";try{window.__reactRouterVersion=tj}catch{}const nj="startTransition",rm=Si[nj];function rj(r){let{basename:a,children:l,future:o,window:c}=r,u=p.useRef();u.current==null&&(u.current=ty({window:c,v5Compat:!0}));let f=u.current,[m,x]=p.useState({action:f.action,location:f.location}),{v7_startTransition:g}=o||{},v=p.useCallback(y=>{g&&rm?rm(()=>x(y)):x(y)},[x,g]);return p.useLayoutEffect(()=>f.listen(v),[f,v]),p.useEffect(()=>Ky(o),[o]),p.createElement(Qy,{basename:a,children:l,location:m.location,navigationType:m.action,navigator:f,future:o})}const sj=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",aj=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,ip=p.forwardRef(function(a,l){let{onClick:o,relative:c,reloadDocument:u,replace:f,state:m,target:x,to:g,preventScrollReset:v,viewTransition:y}=a,E=Xy(a,ej),{basename:P}=p.useContext(wr),C,N=!1;if(typeof g=="string"&&aj.test(g)&&(C=g,sj))try{let j=new URL(window.location.href),_=g.startsWith("//")?new URL(j.protocol+g):new URL(g),F=kd(_.pathname,P);_.origin===j.origin&&F!=null?g=F+_.search+_.hash:N=!0}catch{}let b=Ry(g,{relative:c}),k=lj(g,{replace:f,state:m,target:x,preventScrollReset:v,relative:c,viewTransition:y});function R(j){o&&o(j),j.defaultPrevented||k(j)}return p.createElement("a",nd({},E,{href:C||b,onClick:N||u?o:R,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 lj(r,a){let{target:l,replace:o,state:c,preventScrollReset:u,relative:f,viewTransition:m}=a===void 0?{}:a,x=Oa(),g=Jr(),v=rp(r,{relative:f});return p.useCallback(y=>{if(Zy(y,l)){y.preventDefault();let E=o!==void 0?o:ui(g)===ui(v);x(r,{replace:E,state:c,preventScrollReset:u,relative:f,viewTransition:m})}},[g,x,v,o,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 ij=r=>r.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),oj=r=>r.replace(/^([A-Z])|[\s-_]+(\w)/g,(a,l,o)=>o?o.toUpperCase():l.toLowerCase()),lm=r=>{const a=oj(r);return a.charAt(0).toUpperCase()+a.slice(1)},op=(...r)=>r.filter((a,l,o)=>!!a&&a.trim()!==""&&o.indexOf(a)===l).join(" ").trim(),cj=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 dj={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 uj=p.forwardRef(({color:r="currentColor",size:a=24,strokeWidth:l=2,absoluteStrokeWidth:o,className:c="",children:u,iconNode:f,...m},x)=>p.createElement("svg",{ref:x,...dj,width:a,height:a,stroke:r,strokeWidth:o?Number(l)*24/Number(a):l,className:op("lucide",c),...!u&&!cj(m)&&{"aria-hidden":"true"},...m},[...f.map(([g,v])=>p.createElement(g,v)),...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 we=(r,a)=>{const l=p.forwardRef(({className:o,...c},u)=>p.createElement(uj,{ref:u,iconNode:a,className:op(`lucide-${ij(lm(r))}`,`lucide-${r}`,o),...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 fj=[["path",{d:"M11.767 19.089c4.924.868 6.14-6.025 1.216-6.894m-1.216 6.894L5.86 18.047m5.908 1.042-.347 1.97m1.563-8.864c4.924.869 6.14-6.025 1.215-6.893m-1.215 6.893-3.94-.694m5.155-6.2L8.29 4.26m5.908 1.042.348-1.97M7.48 20.364l3.126-17.727",key:"yr8idg"}]],im=we("bitcoin",fj);/** - * @license lucide-react v0.562.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const hj=[["path",{d:"M12 7v14",key:"1akyts"}],["path",{d:"M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z",key:"ruj8y"}]],Ts=we("book-open",hj);/** - * @license lucide-react v0.562.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const mj=[["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"}]],Aa=we("calendar",mj);/** - * @license lucide-react v0.562.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const pj=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],ki=we("check",pj);/** - * @license lucide-react v0.562.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const xj=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],cp=we("chevron-down",xj);/** - * @license lucide-react v0.562.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const gj=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],dp=we("chevron-right",gj);/** - * @license lucide-react v0.562.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const vj=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],yj=we("chevron-up",vj);/** - * @license lucide-react v0.562.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const jj=[["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"}]],wj=we("circle-alert",jj);/** - * @license lucide-react v0.562.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Nj=[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]],rd=we("circle-check-big",Nj);/** - * @license lucide-react v0.562.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const bj=[["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=we("circle-question-mark",bj);/** - * @license lucide-react v0.562.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Sj=[["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"}]],om=we("circle-user",Sj);/** - * @license lucide-react v0.562.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Cj=[["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"}]],kj=we("circle-x",Cj);/** - * @license lucide-react v0.562.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Ej=[["path",{d:"M12 6v6l4 2",key:"mmk7yg"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],fp=we("clock",Ej);/** - * @license lucide-react v0.562.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Pj=[["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=we("copy",Pj);/** - * @license lucide-react v0.562.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Rj=[["rect",{width:"20",height:"14",x:"2",y:"5",rx:"2",key:"ynyp8z"}],["line",{x1:"2",x2:"22",y1:"10",y2:"10",key:"1b3vmo"}]],sd=we("credit-card",Rj);/** - * @license lucide-react v0.562.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const _j=[["path",{d:"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"}]],Ei=we("crown",_j);/** - * @license lucide-react v0.562.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Tj=[["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"}]],fi=we("dollar-sign",Tj);/** - * @license lucide-react v0.562.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Ij=[["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"}]],Aj=we("download",Ij);/** - * @license lucide-react v0.562.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Mj=[["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"}]],hi=we("external-link",Mj);/** - * @license lucide-react v0.562.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Lj=[["path",{d:"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"}]],_d=we("eye",Lj);/** - * @license lucide-react v0.562.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Dj=[["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"}]],Oj=we("file-text",Dj);/** - * @license lucide-react v0.562.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Fj=[["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"}]],zj=we("funnel",Fj);/** - * @license lucide-react v0.562.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const $j=[["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=we("gift",$j);/** - * @license lucide-react v0.562.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Bj=[["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"}]],Vj=we("git-merge",Bj);/** - * @license lucide-react v0.562.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Uj=[["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"}]],ad=we("globe",Uj);/** - * @license lucide-react v0.562.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Wj=[["path",{d:"M21.42 10.922a1 1 0 0 0-.019-1.838L12.83 5.18a2 2 0 0 0-1.66 0L2.6 9.08a1 1 0 0 0 0 1.832l8.57 3.908a2 2 0 0 0 1.66 0z",key:"j76jl0"}],["path",{d:"M22 10v6",key:"1lu8f3"}],["path",{d:"M6 12.5V16a6 3 0 0 0 12 0v-3.5",key:"1r8lef"}]],Hj=we("graduation-cap",Wj);/** - * @license lucide-react v0.562.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Kj=[["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=we("history",Kj);/** - * @license lucide-react v0.562.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Gj=[["path",{d:"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"}]],Yj=we("house",Gj);/** - * @license lucide-react v0.562.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Qj=[["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"}]],qj=we("image",Qj);/** - * @license lucide-react v0.562.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Xj=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],ql=we("info",Xj);/** - * @license lucide-react v0.562.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Jj=[["path",{d:"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=we("key",Jj);/** - * @license lucide-react v0.562.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Zj=[["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"}]],ew=we("layout-dashboard",Zj);/** - * @license lucide-react v0.562.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const tw=[["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"}]],Wr=we("link-2",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 nw=[["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=we("link",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 rw=[["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"}]],sw=we("lock",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 aw=[["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"}]],lw=we("log-out",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 iw=[["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"}]],ow=we("map-pin",iw);/** - * @license lucide-react v0.562.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const cw=[["path",{d:"M4 5h16",key:"1tepv9"}],["path",{d:"M4 12h16",key:"1lakjw"}],["path",{d:"M4 19h16",key:"1djgab"}]],dw=we("menu",cw);/** - * @license lucide-react v0.562.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const uw=[["path",{d:"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"}]],fw=we("message-circle",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 hw=[["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"}]],mw=we("palette",hw);/** - * @license lucide-react v0.562.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const pw=[["path",{d:"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"}]],gr=we("pen-line",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=[["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"}]],gw=we("percent",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 vw=[["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"}]],yw=we("phone",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 jw=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],pr=we("plus",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 ww=[["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=we("qr-code",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 Nw=[["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"}]],tt=we("refresh-cw",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 bw=[["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=we("save",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 Sw=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],Hr=we("search",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 Cw=[["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"}]],mi=we("settings",Cw);/** - * @license lucide-react v0.562.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const kw=[["path",{d:"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"}]],Ew=we("settings-2",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 Pw=[["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"}]],Rw=we("shield-check",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=[["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"}]],ld=we("shopping-bag",_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=[["rect",{width:"14",height:"20",x:"5",y:"2",rx:"2",ry:"2",key:"1yt0o3"}],["path",{d:"M12 18h.01",key:"mhygvu"}]],id=we("smartphone",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:"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"}]],Aw=we("tag",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 Mw=[["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"}]],Fa=we("trash-2",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:"M16 7h6v6",key:"box55l"}],["path",{d:"m22 7-8.5 8.5-5-5L2 17",key:"1t1m79"}]],od=we("trending-up",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:"M9 14 4 9l5-5",key:"102s5s"}],["path",{d:"M4 9h10.5a5.5 5.5 0 0 1 5.5 5.5a5.5 5.5 0 0 1-5.5 5.5H11",key:"f3b9sd"}]],mp=we("undo-2",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 Ow=[["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=we("upload",Ow);/** - * @license lucide-react v0.562.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Fw=[["path",{d:"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=we("user-plus",Fw);/** - * @license lucide-react v0.562.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const zw=[["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"}]],ai=we("user",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=[["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"}]],xn=we("users",$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:"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"}]],Is=we("wallet",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 Vw=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],Pn=we("x",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:"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"}]],Ww=we("zap",Uw),Td="admin_token";function Hw(){try{return localStorage.getItem(Td)}catch{return null}}function Kw(r){try{localStorage.setItem(Td,r)}catch{}}function Gw(){try{localStorage.removeItem(Td)}catch{}}const Yw="https://soulapi.quwanzhi.com",Qw=()=>{const r="https://soulapi.quwanzhi.com";return r.length>0?r.replace(/\/$/,""):Yw};function pp(r){const a=Qw(),l=r.startsWith("/")?r:`/${r}`;return a?`${a}${l}`:l}async function Pi(r,a={}){const{data:l,...o}=a,c=pp(r),u=new Headers(o.headers),f=Hw();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):o.body,x=await fetch(c,{...o,headers:u,body:m,credentials:"include"}),v=(x.headers.get("Content-Type")||"").includes("application/json")?await x.json():x;if(!x.ok){const y=new Error((v==null?void 0:v.error)||`HTTP ${x.status}`);throw y.status=x.status,y.data=v,y}return v}function He(r,a){return Pi(r,{...a,method:"GET"})}function jt(r,a,l){return Pi(r,{...l,method:"POST",data:a})}function zt(r,a,l){return Pi(r,{...l,method:"PUT",data:a})}function Ri(r,a){return Pi(r,{...a,method:"DELETE"})}const qw=[{icon:ew,label:"数据概览",href:"/dashboard"},{icon:Ts,label:"内容管理",href:"/content"},{icon:xn,label:"用户管理",href:"/users"},{icon:Ei,label:"VIP 角色",href:"/vip-roles"},{icon:Hj,label:"导师管理",href:"/mentors"},{icon:Aa,label:"导师预约",href:"/mentor-consultations"},{icon:Is,label:"交易中心",href:"/distribution"},{icon:Vj,label:"匹配记录",href:"/match-records"},{icon:sd,label:"推广设置",href:"/referral-settings"},{icon:mi,label:"系统设置",href:"/settings"}];function Xw(){const r=Jr(),a=Oa(),[l,o]=p.useState(!1),[c,u]=p.useState(!1);p.useEffect(()=>{o(!0)},[]),p.useEffect(()=>{if(!l)return;u(!1);let m=!1;return He("/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()=>{Gw();try{await jt("/api/admin/logout",{})}catch{}a("/login",{replace:!0})};return!l||!c?t.jsxs("div",{className:"flex min-h-screen bg-[#0a1628]",children:[t.jsx("div",{className:"w-64 bg-[#0f2137] border-r border-gray-700/50"}),t.jsx("div",{className:"flex-1 flex items-center justify-center",children:t.jsx("div",{className:"text-[#38bdac]",children:"加载中..."})})]}):t.jsxs("div",{className:"flex min-h-screen bg-[#0a1628]",children:[t.jsxs("div",{className:"w-64 bg-[#0f2137] flex flex-col border-r border-gray-700/50 shadow-xl",children:[t.jsxs("div",{className:"p-6 border-b border-gray-700/50",children:[t.jsx("h1",{className:"text-xl font-bold text-[#38bdac]",children:"管理后台"}),t.jsx("p",{className:"text-xs text-gray-400 mt-1",children:"Soul创业派对"})]}),t.jsx("nav",{className:"flex-1 p-4 space-y-1",children:qw.map(m=>{const x=r.pathname===m.href;return t.jsxs(ip,{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:[t.jsx(m.icon,{className:"w-5 h-5"}),t.jsx("span",{className:"text-sm",children:m.label})]},m.href)})}),t.jsx("div",{className:"p-4 border-t border-gray-700/50 space-y-1",children:t.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:[t.jsx(lw,{className:"w-5 h-5"}),t.jsx("span",{className:"text-sm",children:"退出登录"})]})})]}),t.jsx("div",{className:"flex-1 overflow-auto bg-[#0a1628] min-w-0",children:t.jsx("div",{className:"w-full min-w-[1024px] min-h-full",children:t.jsx(Yy,{})})})]})}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 o=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}=o;xp(u)&&typeof pi=="function"&&(u=pi(u._payload));const m=p.Children.toArray(u),x=m.find(nN);if(x){const g=x.props.children,v=m.map(y=>y===x?p.Children.count(g)>1?p.Children.only(null):p.isValidElement(g)?g.props.children:null:y);return t.jsx(a,{...f,ref:c,children:p.isValidElement(g)?p.cloneElement(g,void 0,v):null})}return t.jsx(a,{...f,ref:c,children:u})});return l.displayName=`${r}.Slot`,l}var vp=gp("Slot");function eN(r){const a=p.forwardRef((l,o)=>{let{children:c,...u}=l;if(xp(c)&&typeof pi=="function"&&(c=pi(c._payload)),p.isValidElement(c)){const f=sN(c),m=rN(u,c.props);return c.type!==p.Fragment&&(m.ref=o?Id(o,f):f),p.cloneElement(c,m)}return p.Children.count(c)>1?p.Children.only(null):null});return a.displayName=`${r}.SlotClone`,a}var tN=Symbol("radix.slottable");function nN(r){return p.isValidElement(r)&&typeof r.type=="function"&&"__radixId"in r.type&&r.type.__radixId===tN}function rN(r,a){const l={...a};for(const o in a){const c=r[o],u=a[o];/^on[A-Z]/.test(o)?c&&u?l[o]=(...m)=>{const x=u(...m);return c(...m),x}:c&&(l[o]=c):o==="style"?l[o]={...c,...u}:o==="className"&&(l[o]=[c,u].filter(Boolean).join(" "))}return{...r,...l}}function sN(r){var o,c;let a=(o=Object.getOwnPropertyDescriptor(r.props,"ref"))==null?void 0:o.get,l=a&&"isReactWarning"in a&&a.isReactWarning;return l?r.ref:(a=(c=Object.getOwnPropertyDescriptor(r,"ref"))==null?void 0:c.get,l=a&&"isReactWarning"in a&&a.isReactWarning,l?r.props.ref:r.props.ref||r.ref)}function yp(r){var a,l,o="";if(typeof r=="string"||typeof r=="number")o+=r;else if(typeof r=="object")if(Array.isArray(r)){var c=r.length;for(a=0;atypeof r=="boolean"?`${r}`:r===0?"0":r,vm=jp,wp=(r,a)=>l=>{var o;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(g=>{const v=l==null?void 0:l[g],y=u==null?void 0:u[g];if(v===null)return null;const E=gm(v)||gm(y);return c[g][E]}),m=l&&Object.entries(l).reduce((g,v)=>{let[y,E]=v;return E===void 0||(g[y]=E),g},{}),x=a==null||(o=a.compoundVariants)===null||o===void 0?void 0:o.reduce((g,v)=>{let{class:y,className:E,...P}=v;return Object.entries(P).every(C=>{let[N,b]=C;return Array.isArray(b)?b.includes({...u,...m}[N]):{...u,...m}[N]===b})?[...g,y,E]:g},[]);return vm(r,f,x,l==null?void 0:l.class,l==null?void 0:l.className)},aN=(r,a)=>{const l=new Array(r.length+a.length);for(let o=0;o({classGroupId:r,validator:a}),Np=(r=new Map,a=null,l)=>({nextPart:r,validators:a,classGroupId:l}),xi="-",ym=[],iN="arbitrary..",oN=r=>{const a=dN(r),{conflictingClassGroups:l,conflictingClassGroupModifiers:o}=r;return{getClassGroupId:f=>{if(f.startsWith("[")&&f.endsWith("]"))return cN(f);const m=f.split(xi),x=m[0]===""&&m.length>1?1:0;return bp(m,x,a)},getConflictingClassGroupIds:(f,m)=>{if(m){const x=o[f],g=l[f];return x?g?aN(g,x):x:g||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 g=bp(r,a+1,u);if(g)return g}const f=l.validators;if(f===null)return;const m=a===0?r.join(xi):r.slice(a).join(xi),x=f.length;for(let g=0;gr.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const a=r.slice(1,-1),l=a.indexOf(":"),o=a.slice(0,l);return o?iN+o:void 0})(),dN=r=>{const{theme:a,classGroups:l}=r;return uN(l,a)},uN=(r,a)=>{const l=Np();for(const o in r){const c=r[o];Ad(c,l,o,a)}return l},Ad=(r,a,l,o)=>{const c=r.length;for(let u=0;u{if(typeof r=="string"){hN(r,a,l);return}if(typeof r=="function"){mN(r,a,l,o);return}pN(r,a,l,o)},hN=(r,a,l)=>{const o=r===""?a:Sp(a,r);o.classGroupId=l},mN=(r,a,l,o)=>{if(xN(r)){Ad(r(o),a,l,o);return}a.validators===null&&(a.validators=[]),a.validators.push(lN(l,r))},pN=(r,a,l,o)=>{const c=Object.entries(r),u=c.length;for(let f=0;f{let l=r;const o=a.split(xi),c=o.length;for(let u=0;u"isThemeGetter"in r&&r.isThemeGetter===!0,gN=r=>{if(r<1)return{get:()=>{},set:()=>{}};let a=0,l=Object.create(null),o=Object.create(null);const c=(u,f)=>{l[u]=f,a++,a>r&&(a=0,o=l,l=Object.create(null))};return{get(u){let f=l[u];if(f!==void 0)return f;if((f=o[u])!==void 0)return c(u,f),f},set(u,f){u in l?l[u]=f:c(u,f)}}},cd="!",jm=":",vN=[],wm=(r,a,l,o,c)=>({modifiers:r,hasImportantModifier:a,baseClassName:l,maybePostfixModifierPosition:o,isExternal:c}),yN=r=>{const{prefix:a,experimentalParseClassName:l}=r;let o=c=>{const u=[];let f=0,m=0,x=0,g;const v=c.length;for(let N=0;Nx?g-x:void 0;return wm(u,P,E,C)};if(a){const c=a+jm,u=o;o=f=>f.startsWith(c)?u(f.slice(c.length)):wm(vN,!1,f,void 0,!0)}if(l){const c=o;o=u=>l({className:u,parseClassName:c})}return o},jN=r=>{const a=new Map;return r.orderSensitiveModifiers.forEach((l,o)=>{a.set(l,1e6+o)}),l=>{const o=[];let c=[];for(let u=0;u0&&(c.sort(),o.push(...c),c=[]),o.push(f)):c.push(f)}return c.length>0&&(c.sort(),o.push(...c)),o}},wN=r=>({cache:gN(r.cacheSize),parseClassName:yN(r),sortModifiers:jN(r),...oN(r)}),NN=/\s+/,bN=(r,a)=>{const{parseClassName:l,getClassGroupId:o,getConflictingClassGroupIds:c,sortModifiers:u}=a,f=[],m=r.trim().split(NN);let x="";for(let g=m.length-1;g>=0;g-=1){const v=m[g],{isExternal:y,modifiers:E,hasImportantModifier:P,baseClassName:C,maybePostfixModifierPosition:N}=l(v);if(y){x=v+(x.length>0?" "+x:x);continue}let b=!!N,k=o(b?C.substring(0,N):C);if(!k){if(!b){x=v+(x.length>0?" "+x:x);continue}if(k=o(C),!k){x=v+(x.length>0?" "+x:x);continue}b=!1}const R=E.length===0?"":E.length===1?E[0]:u(E).join(":"),j=P?R+cd:R,_=j+k;if(f.indexOf(_)>-1)continue;f.push(_);const F=c(k,b);for(let G=0;G0?" "+x:x)}return x},SN=(...r)=>{let a=0,l,o,c="";for(;a{if(typeof r=="string")return r;let a,l="";for(let o=0;o{let l,o,c,u;const f=x=>{const g=a.reduce((v,y)=>y(v),r());return l=wN(g),o=l.cache.get,c=l.cache.set,u=m,m(x)},m=x=>{const g=o(x);if(g)return g;const v=bN(x,l);return c(x,v),v};return u=f,(...x)=>u(SN(...x))},kN=[],xt=r=>{const a=l=>l[r]||kN;return a.isThemeGetter=!0,a},kp=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,Ep=/^\((?:(\w[\w-]*):)?(.+)\)$/i,EN=/^\d+\/\d+$/,PN=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,RN=/\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$/,_N=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,TN=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,IN=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Ss=r=>EN.test(r),Le=r=>!!r&&!Number.isNaN(Number(r)),cr=r=>!!r&&Number.isInteger(Number(r)),zc=r=>r.endsWith("%")&&Le(r.slice(0,-1)),zn=r=>PN.test(r),AN=()=>!0,MN=r=>RN.test(r)&&!_N.test(r),Pp=()=>!1,LN=r=>TN.test(r),DN=r=>IN.test(r),ON=r=>!ye(r)&&!je(r),FN=r=>Ds(r,Tp,Pp),ye=r=>kp.test(r),Ur=r=>Ds(r,Ip,MN),$c=r=>Ds(r,UN,Le),Nm=r=>Ds(r,Rp,Pp),zN=r=>Ds(r,_p,DN),Xl=r=>Ds(r,Ap,LN),je=r=>Ep.test(r),Ra=r=>Os(r,Ip),$N=r=>Os(r,WN),bm=r=>Os(r,Rp),BN=r=>Os(r,Tp),VN=r=>Os(r,_p),Jl=r=>Os(r,Ap,!0),Ds=(r,a,l)=>{const o=kp.exec(r);return o?o[1]?a(o[1]):l(o[2]):!1},Os=(r,a,l=!1)=>{const o=Ep.exec(r);return o?o[1]?a(o[1]):l:!1},Rp=r=>r==="position"||r==="percentage",_p=r=>r==="image"||r==="url",Tp=r=>r==="length"||r==="size"||r==="bg-size",Ip=r=>r==="length",UN=r=>r==="number",WN=r=>r==="family-name",Ap=r=>r==="shadow",HN=()=>{const r=xt("color"),a=xt("font"),l=xt("text"),o=xt("font-weight"),c=xt("tracking"),u=xt("leading"),f=xt("breakpoint"),m=xt("container"),x=xt("spacing"),g=xt("radius"),v=xt("shadow"),y=xt("inset-shadow"),E=xt("text-shadow"),P=xt("drop-shadow"),C=xt("blur"),N=xt("perspective"),b=xt("aspect"),k=xt("ease"),R=xt("animate"),j=()=>["auto","avoid","all","avoid-page","page","left","right","column"],_=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],F=()=>[..._(),je,ye],G=()=>["auto","hidden","clip","visible","scroll"],M=()=>["auto","contain","none"],V=()=>[je,ye,x],te=()=>[Ss,"full","auto",...V()],ue=()=>[cr,"none","subgrid",je,ye],ce=()=>["auto",{span:["full",cr,je,ye]},cr,je,ye],ie=()=>[cr,"auto",je,ye],fe=()=>["auto","min","max","fr",je,ye],H=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],W=()=>["start","end","center","stretch","center-safe","end-safe"],Y=()=>["auto",...V()],K=()=>[Ss,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...V()],A=()=>[r,je,ye],J=()=>[..._(),bm,Nm,{position:[je,ye]}],B=()=>["no-repeat",{repeat:["","x","y","space","round"]}],S=()=>["auto","cover","contain",BN,FN,{size:[je,ye]}],D=()=>[zc,Ra,Ur],ae=()=>["","none","full",g,je,ye],oe=()=>["",Le,Ra,Ur],Ne=()=>["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"],Q=()=>[Le,zc,bm,Nm],xe=()=>["","none",C,je,ye],I=()=>["none",Le,je,ye],se=()=>["none",Le,je,ye],he=()=>[Le,je,ye],Pe=()=>[Ss,"full",...V()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[zn],breakpoint:[zn],color:[AN],container:[zn],"drop-shadow":[zn],ease:["in","out","in-out"],font:[ON],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[zn],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[zn],shadow:[zn],spacing:["px",Le],text:[zn],"text-shadow":[zn],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",Ss,ye,je,b]}],container:["container"],columns:[{columns:[Le,ye,je,m]}],"break-after":[{"break-after":j()}],"break-before":[{"break-before":j()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:F()}],overflow:[{overflow:G()}],"overflow-x":[{"overflow-x":G()}],"overflow-y":[{"overflow-y":G()}],overscroll:[{overscroll:M()}],"overscroll-x":[{"overscroll-x":M()}],"overscroll-y":[{"overscroll-y":M()}],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:[cr,"auto",je,ye]}],basis:[{basis:[Ss,"full","auto",m,...V()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[Le,Ss,"auto","initial","none",ye]}],grow:[{grow:["",Le,je,ye]}],shrink:[{shrink:["",Le,je,ye]}],order:[{order:[cr,"first","last","none",je,ye]}],"grid-cols":[{"grid-cols":ue()}],"col-start-end":[{col:ce()}],"col-start":[{"col-start":ie()}],"col-end":[{"col-end":ie()}],"grid-rows":[{"grid-rows":ue()}],"row-start-end":[{row:ce()}],"row-start":[{"row-start":ie()}],"row-end":[{"row-end":ie()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":fe()}],"auto-rows":[{"auto-rows":fe()}],gap:[{gap:V()}],"gap-x":[{"gap-x":V()}],"gap-y":[{"gap-y":V()}],"justify-content":[{justify:[...H(),"normal"]}],"justify-items":[{"justify-items":[...W(),"normal"]}],"justify-self":[{"justify-self":["auto",...W()]}],"align-content":[{content:["normal",...H()]}],"align-items":[{items:[...W(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...W(),{baseline:["","last"]}]}],"place-content":[{"place-content":H()}],"place-items":[{"place-items":[...W(),"baseline"]}],"place-self":[{"place-self":["auto",...W()]}],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:Y()}],mx:[{mx:Y()}],my:[{my:Y()}],ms:[{ms:Y()}],me:[{me:Y()}],mt:[{mt:Y()}],mr:[{mr:Y()}],mb:[{mb:Y()}],ml:[{ml:Y()}],"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,Ur]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[o,je,$c]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",zc,ye]}],"font-family":[{font:[$N,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,je,ye]}],"line-clamp":[{"line-clamp":[Le,"none",je,$c]}],leading:[{leading:[u,...V()]}],"list-image":[{"list-image":["none",je,ye]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",je,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:[...Ne(),"wavy"]}],"text-decoration-thickness":[{decoration:[Le,"from-font","auto",je,Ur]}],"text-decoration-color":[{decoration:A()}],"underline-offset":[{"underline-offset":[Le,"auto",je,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",je,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",je,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:J()}],"bg-repeat":[{bg:B()}],"bg-size":[{bg:S()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},cr,je,ye],radial:["",je,ye],conic:[cr,je,ye]},VN,zN]}],"bg-color":[{bg:A()}],"gradient-from-pos":[{from:D()}],"gradient-via-pos":[{via:D()}],"gradient-to-pos":[{to:D()}],"gradient-from":[{from:A()}],"gradient-via":[{via:A()}],"gradient-to":[{to:A()}],rounded:[{rounded:ae()}],"rounded-s":[{"rounded-s":ae()}],"rounded-e":[{"rounded-e":ae()}],"rounded-t":[{"rounded-t":ae()}],"rounded-r":[{"rounded-r":ae()}],"rounded-b":[{"rounded-b":ae()}],"rounded-l":[{"rounded-l":ae()}],"rounded-ss":[{"rounded-ss":ae()}],"rounded-se":[{"rounded-se":ae()}],"rounded-ee":[{"rounded-ee":ae()}],"rounded-es":[{"rounded-es":ae()}],"rounded-tl":[{"rounded-tl":ae()}],"rounded-tr":[{"rounded-tr":ae()}],"rounded-br":[{"rounded-br":ae()}],"rounded-bl":[{"rounded-bl":ae()}],"border-w":[{border:oe()}],"border-w-x":[{"border-x":oe()}],"border-w-y":[{"border-y":oe()}],"border-w-s":[{"border-s":oe()}],"border-w-e":[{"border-e":oe()}],"border-w-t":[{"border-t":oe()}],"border-w-r":[{"border-r":oe()}],"border-w-b":[{"border-b":oe()}],"border-w-l":[{"border-l":oe()}],"divide-x":[{"divide-x":oe()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":oe()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...Ne(),"hidden","none"]}],"divide-style":[{divide:[...Ne(),"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:[...Ne(),"none","hidden"]}],"outline-offset":[{"outline-offset":[Le,je,ye]}],"outline-w":[{outline:["",Le,Ra,Ur]}],"outline-color":[{outline:A()}],shadow:[{shadow:["","none",v,Jl,Xl]}],"shadow-color":[{shadow:A()}],"inset-shadow":[{"inset-shadow":["none",y,Jl,Xl]}],"inset-shadow-color":[{"inset-shadow":A()}],"ring-w":[{ring:oe()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:A()}],"ring-offset-w":[{"ring-offset":[Le,Ur]}],"ring-offset-color":[{"ring-offset":A()}],"inset-ring-w":[{"inset-ring":oe()}],"inset-ring-color":[{"inset-ring":A()}],"text-shadow":[{"text-shadow":["none",E,Jl,Xl]}],"text-shadow-color":[{"text-shadow":A()}],opacity:[{opacity:[Le,je,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":[Le]}],"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":A()}],"mask-image-linear-to-color":[{"mask-linear-to":A()}],"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":A()}],"mask-image-t-to-color":[{"mask-t-to":A()}],"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":A()}],"mask-image-r-to-color":[{"mask-r-to":A()}],"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":A()}],"mask-image-b-to-color":[{"mask-b-to":A()}],"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":A()}],"mask-image-l-to-color":[{"mask-l-to":A()}],"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":A()}],"mask-image-x-to-color":[{"mask-x-to":A()}],"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":A()}],"mask-image-y-to-color":[{"mask-y-to":A()}],"mask-image-radial":[{"mask-radial":[je,ye]}],"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":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":_()}],"mask-image-conic-pos":[{"mask-conic":[Le]}],"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":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:J()}],"mask-repeat":[{mask:B()}],"mask-size":[{mask:S()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",je,ye]}],filter:[{filter:["","none",je,ye]}],blur:[{blur:xe()}],brightness:[{brightness:[Le,je,ye]}],contrast:[{contrast:[Le,je,ye]}],"drop-shadow":[{"drop-shadow":["","none",P,Jl,Xl]}],"drop-shadow-color":[{"drop-shadow":A()}],grayscale:[{grayscale:["",Le,je,ye]}],"hue-rotate":[{"hue-rotate":[Le,je,ye]}],invert:[{invert:["",Le,je,ye]}],saturate:[{saturate:[Le,je,ye]}],sepia:[{sepia:["",Le,je,ye]}],"backdrop-filter":[{"backdrop-filter":["","none",je,ye]}],"backdrop-blur":[{"backdrop-blur":xe()}],"backdrop-brightness":[{"backdrop-brightness":[Le,je,ye]}],"backdrop-contrast":[{"backdrop-contrast":[Le,je,ye]}],"backdrop-grayscale":[{"backdrop-grayscale":["",Le,je,ye]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[Le,je,ye]}],"backdrop-invert":[{"backdrop-invert":["",Le,je,ye]}],"backdrop-opacity":[{"backdrop-opacity":[Le,je,ye]}],"backdrop-saturate":[{"backdrop-saturate":[Le,je,ye]}],"backdrop-sepia":[{"backdrop-sepia":["",Le,je,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",je,ye]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[Le,"initial",je,ye]}],ease:[{ease:["linear","initial",k,je,ye]}],delay:[{delay:[Le,je,ye]}],animate:[{animate:["none",R,je,ye]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[N,je,ye]}],"perspective-origin":[{"perspective-origin":F()}],rotate:[{rotate:I()}],"rotate-x":[{"rotate-x":I()}],"rotate-y":[{"rotate-y":I()}],"rotate-z":[{"rotate-z":I()}],scale:[{scale:se()}],"scale-x":[{"scale-x":se()}],"scale-y":[{"scale-y":se()}],"scale-z":[{"scale-z":se()}],"scale-3d":["scale-3d"],skew:[{skew:he()}],"skew-x":[{"skew-x":he()}],"skew-y":[{"skew-y":he()}],transform:[{transform:[je,ye,"","none","gpu","cpu"]}],"transform-origin":[{origin:F()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:Pe()}],"translate-x":[{"translate-x":Pe()}],"translate-y":[{"translate-y":Pe()}],"translate-z":[{"translate-z":Pe()}],"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",je,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",je,ye]}],fill:[{fill:["none",...A()]}],"stroke-w":[{stroke:[Le,Ra,Ur,$c]}],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"]}},KN=CN(HN);function Ge(...r){return KN(jp(r))}const GN=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 de({className:r,variant:a,size:l,asChild:o=!1,...c}){const u=o?vp:"button";return t.jsx(u,{"data-slot":"button",className:Ge(GN({variant:a,size:l,className:r})),...c})}function ne({className:r,type:a,...l}){return t.jsx("input",{type:a,"data-slot":"input",className:Ge("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 YN(){const r=Oa(),[a,l]=p.useState(""),[o,c]=p.useState(""),[u,f]=p.useState(""),[m,x]=p.useState(!1),g=async()=>{f(""),x(!0);try{const v=await jt("/api/admin",{username:a.trim(),password:o});if((v==null?void 0:v.success)!==!1&&(v!=null&&v.token)){Kw(v.token),r("/dashboard",{replace:!0});return}f(v.error||"用户名或密码错误")}catch(v){const y=v;f(y.status===401?"用户名或密码错误":(y==null?void 0:y.message)||"网络错误,请重试")}finally{x(!1)}};return t.jsxs("div",{className:"min-h-screen bg-[#0a1628] flex items-center justify-center p-4",children:[t.jsxs("div",{className:"absolute inset-0 overflow-hidden",children:[t.jsx("div",{className:"absolute top-1/4 left-1/4 w-96 h-96 bg-[#38bdac]/5 rounded-full blur-3xl"}),t.jsx("div",{className:"absolute bottom-1/4 right-1/4 w-96 h-96 bg-blue-500/5 rounded-full blur-3xl"})]}),t.jsxs("div",{className:"w-full max-w-md relative z-10",children:[t.jsxs("div",{className:"text-center mb-8",children:[t.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:t.jsx(Rw,{className:"w-8 h-8 text-[#38bdac]"})}),t.jsx("h1",{className:"text-2xl font-bold text-white mb-2",children:"管理后台"}),t.jsx("p",{className:"text-gray-400",children:"一场SOUL的创业实验场"})]}),t.jsxs("div",{className:"bg-[#0f2137] rounded-2xl p-8 shadow-xl border border-gray-700/50 backdrop-blur-xl",children:[t.jsx("h2",{className:"text-xl font-semibold text-white mb-6 text-center",children:"管理员登录"}),t.jsxs("div",{className:"space-y-4",children:[t.jsxs("div",{children:[t.jsx("label",{className:"block text-gray-400 text-sm mb-2",children:"用户名"}),t.jsxs("div",{className:"relative",children:[t.jsx(ai,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-5 h-5 text-gray-500"}),t.jsx(ne,{type:"text",value:a,onChange:v=>l(v.target.value),placeholder:"请输入用户名",className:"pl-10 bg-[#0a1628] border-gray-700 text-white placeholder:text-gray-500 focus:border-[#38bdac]"})]})]}),t.jsxs("div",{children:[t.jsx("label",{className:"block text-gray-400 text-sm mb-2",children:"密码"}),t.jsxs("div",{className:"relative",children:[t.jsx(sw,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-5 h-5 text-gray-500"}),t.jsx(ne,{type:"password",value:o,onChange:v=>c(v.target.value),placeholder:"请输入密码",className:"pl-10 bg-[#0a1628] border-gray-700 text-white placeholder:text-gray-500 focus:border-[#38bdac]",onKeyDown:v=>v.key==="Enter"&&g()})]})]}),u&&t.jsx("div",{className:"bg-red-500/10 text-red-400 text-sm p-3 rounded-lg border border-red-500/20",children:u}),t.jsx(de,{onClick:g,disabled:m,className:"w-full bg-[#38bdac] hover:bg-[#2da396] text-white py-5 disabled:opacity-50",children:m?"登录中...":"登录"})]})]}),t.jsx("p",{className:"text-center text-gray-500 text-xs mt-6",children:"Soul创业实验场 · 后台管理系统"})]})]})}const Ce=p.forwardRef(({className:r,...a},l)=>t.jsx("div",{ref:l,className:Ge("rounded-xl border bg-card text-card-foreground shadow",r),...a}));Ce.displayName="Card";const Be=p.forwardRef(({className:r,...a},l)=>t.jsx("div",{ref:l,className:Ge("flex flex-col space-y-1.5 p-6",r),...a}));Be.displayName="CardHeader";const Ve=p.forwardRef(({className:r,...a},l)=>t.jsx("h3",{ref:l,className:Ge("font-semibold leading-none tracking-tight",r),...a}));Ve.displayName="CardTitle";const ht=p.forwardRef(({className:r,...a},l)=>t.jsx("p",{ref:l,className:Ge("text-sm text-muted-foreground",r),...a}));ht.displayName="CardDescription";const ke=p.forwardRef(({className:r,...a},l)=>t.jsx("div",{ref:l,className:Ge("p-6 pt-0",r),...a}));ke.displayName="CardContent";const QN=p.forwardRef(({className:r,...a},l)=>t.jsx("div",{ref:l,className:Ge("flex items-center p-6 pt-0",r),...a}));QN.displayName="CardFooter";function qN(){const r=Oa(),[a,l]=p.useState(!0),[o,c]=p.useState([]),[u,f]=p.useState([]);async function m(){l(!0);try{const[C,N]=await Promise.all([He("/api/db/users"),He("/api/orders")]);C!=null&&C.success&&C.users&&c(C.users),N!=null&&N.success&&N.orders&&f(N.orders)}catch(C){console.error("加载数据失败",C)}finally{l(!1)}}if(p.useEffect(()=>{m()},[]),a)return t.jsxs("div",{className:"p-8 w-full",children:[t.jsx("h1",{className:"text-2xl font-bold mb-8 text-white",children:"数据概览"}),t.jsxs("div",{className:"flex flex-col items-center justify-center py-24",children:[t.jsx(tt,{className:"w-12 h-12 text-[#38bdac] animate-spin mb-4"}),t.jsx("span",{className:"text-gray-400",children:"加载中..."})]})]});const g=u.filter(C=>C.status==="paid"||C.status==="completed"||C.status==="success").reduce((C,N)=>C+Number(N.amount||0),0),v=o.length,y=u.length,E=C=>{const N=C.productType||"",b=C.description||"";if(b){if(N==="section"&&b.includes("章节")){if(b.includes("-")){const k=b.split("-");if(k.length>=3)return{title:`第${k[1]}章 第${k[2]}节`,subtitle:"《一场Soul的创业实验》"}}return{title:b,subtitle:"章节购买"}}return N==="fullbook"||b.includes("全书")?{title:"《一场Soul的创业实验》",subtitle:"全书购买"}:N==="match"||b.includes("伙伴")?{title:"找伙伴匹配",subtitle:"功能服务"}:{title:b,subtitle:N==="section"?"单章":N==="fullbook"?"全书":"其他"}}return N==="section"?{title:`章节 ${C.productId||""}`,subtitle:"单章购买"}:N==="fullbook"?{title:"《一场Soul的创业实验》",subtitle:"全书购买"}:N==="match"?{title:"找伙伴匹配",subtitle:"功能服务"}:{title:"未知商品",subtitle:N||"其他"}},P=[{title:"总用户数",value:v,icon:xn,color:"text-blue-400",bg:"bg-blue-500/20",link:"/users"},{title:"总收入",value:`¥${Number(g).toFixed(2)}`,icon:od,color:"text-[#38bdac]",bg:"bg-[#38bdac]/20",link:"/orders"},{title:"订单数",value:y,icon:ld,color:"text-purple-400",bg:"bg-purple-500/20",link:"/orders"},{title:"转化率",value:`${v>0?(y/v*100).toFixed(1):0}%`,icon:Ts,color:"text-orange-400",bg:"bg-orange-500/20",link:"/distribution"}];return t.jsxs("div",{className:"p-8 w-full",children:[t.jsx("h1",{className:"text-2xl font-bold mb-8 text-white",children:"数据概览"}),t.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-6 mb-8",children:P.map((C,N)=>t.jsxs(Ce,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl cursor-pointer hover:border-[#38bdac]/50 transition-colors group",onClick:()=>C.link&&r(C.link),children:[t.jsxs(Be,{className:"flex flex-row items-center justify-between pb-2",children:[t.jsx(Ve,{className:"text-sm font-medium text-gray-400",children:C.title}),t.jsx("div",{className:`p-2 rounded-lg ${C.bg}`,children:t.jsx(C.icon,{className:`w-4 h-4 ${C.color}`})})]}),t.jsx(ke,{children:t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsx("div",{className:"text-2xl font-bold text-white",children:C.value}),t.jsx(dp,{className:"w-5 h-5 text-gray-600 group-hover:text-[#38bdac] transition-colors"})]})})]},N))}),t.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-8",children:[t.jsxs(Ce,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:[t.jsx(Be,{children:t.jsx(Ve,{className:"text-white",children:"最近订单"})}),t.jsx(ke,{children:t.jsxs("div",{className:"space-y-3",children:[u.slice(-5).reverse().map(C=>{var j;const N=C.referrerId?o.find(_=>_.id===C.referrerId):void 0,b=C.referralCode||(N==null?void 0:N.referralCode)||(N==null?void 0:N.nickname)||(C.referrerId?String(C.referrerId).slice(0,8):""),k=E(C),R=C.userNickname||((j=o.find(_=>_.id===C.userId))==null?void 0:j.nickname)||"匿名用户";return t.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:[t.jsxs("div",{className:"flex items-start gap-3 flex-1",children:[C.userAvatar?t.jsx("img",{src:C.userAvatar,alt:R,className:"w-9 h-9 rounded-full object-cover flex-shrink-0 mt-0.5",onError:_=>{_.currentTarget.style.display="none";const F=_.currentTarget.nextElementSibling;F&&F.classList.remove("hidden")}}):null,t.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 ${C.userAvatar?"hidden":""}`,children:R.charAt(0)}),t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[t.jsx("span",{className:"text-sm text-gray-300",children:R}),t.jsx("span",{className:"text-gray-600",children:"·"}),t.jsx("span",{className:"text-sm font-medium text-white truncate",children:k.title})]}),t.jsxs("div",{className:"flex items-center gap-2 text-xs text-gray-500",children:[t.jsx("span",{className:"px-1.5 py-0.5 bg-gray-700/50 rounded",children:k.subtitle}),t.jsx("span",{children:new Date(C.createdAt||0).toLocaleString("zh-CN",{month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"})})]}),b&&t.jsxs("p",{className:"text-xs text-gray-600 mt-1",children:["推荐: ",b]})]})]}),t.jsxs("div",{className:"text-right ml-4 flex-shrink-0",children:[t.jsxs("p",{className:"text-sm font-bold text-[#38bdac]",children:["+¥",Number(C.amount).toFixed(2)]}),t.jsx("p",{className:"text-xs text-gray-500 mt-0.5",children:C.paymentMethod||"微信"})]})]},C.id)}),u.length===0&&t.jsxs("div",{className:"text-center py-12",children:[t.jsx(ld,{className:"w-12 h-12 text-gray-600 mx-auto mb-3"}),t.jsx("p",{className:"text-gray-500",children:"暂无订单数据"})]})]})})]}),t.jsxs(Ce,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:[t.jsx(Be,{children:t.jsx(Ve,{className:"text-white",children:"新注册用户"})}),t.jsx(ke,{children:t.jsxs("div",{className:"space-y-3",children:[o.slice(-5).reverse().map(C=>{var N;return t.jsxs("div",{className:"flex items-center justify-between p-4 bg-[#0a1628] rounded-lg border border-gray-700/30",children:[t.jsxs("div",{className:"flex items-center gap-3",children:[t.jsx("div",{className:"w-10 h-10 rounded-full bg-[#38bdac]/20 flex items-center justify-center text-sm font-medium text-[#38bdac]",children:((N=C.nickname)==null?void 0:N.charAt(0))||"?"}),t.jsxs("div",{children:[t.jsx("p",{className:"text-sm font-medium text-white",children:C.nickname||"匿名用户"}),t.jsx("p",{className:"text-xs text-gray-500",children:C.phone||"-"})]})]}),t.jsx("p",{className:"text-xs text-gray-400",children:C.createdAt?new Date(C.createdAt).toLocaleDateString():"-"})]},C.id)}),o.length===0&&t.jsx("p",{className:"text-gray-500 text-center py-8",children:"暂无用户数据"})]})})]})]})]})}const Nr=p.forwardRef(({className:r,...a},l)=>t.jsx("div",{className:"relative w-full overflow-auto",children:t.jsx("table",{ref:l,className:Ge("w-full caption-bottom text-sm",r),...a})}));Nr.displayName="Table";const br=p.forwardRef(({className:r,...a},l)=>t.jsx("thead",{ref:l,className:Ge("[&_tr]:border-b",r),...a}));br.displayName="TableHeader";const Sr=p.forwardRef(({className:r,...a},l)=>t.jsx("tbody",{ref:l,className:Ge("[&_tr:last-child]:border-0",r),...a}));Sr.displayName="TableBody";const dt=p.forwardRef(({className:r,...a},l)=>t.jsx("tr",{ref:l,className:Ge("border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted",r),...a}));dt.displayName="TableRow";const Te=p.forwardRef(({className:r,...a},l)=>t.jsx("th",{ref:l,className:Ge("h-12 px-4 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0",r),...a}));Te.displayName="TableHead";const Ee=p.forwardRef(({className:r,...a},l)=>t.jsx("td",{ref:l,className:Ge("p-4 align-middle [&:has([role=checkbox])]:pr-0",r),...a}));Ee.displayName="TableCell";const XN=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 De({className:r,variant:a,asChild:l=!1,...o}){const c=l?vp:"span";return t.jsx(c,{className:Ge(XN({variant:a}),r),...o})}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 JN(r,a){const l=p.createContext(a),o=u=>{const{children:f,...m}=u,x=p.useMemo(()=>m,Object.values(m));return t.jsx(l.Provider,{value:x,children:f})};o.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[o,c]}function Cr(r,a=[]){let l=[];function o(u,f){const m=p.createContext(f),x=l.length;l=[...l,f];const g=y=>{var k;const{scope:E,children:P,...C}=y,N=((k=E==null?void 0:E[r])==null?void 0:k[x])||m,b=p.useMemo(()=>C,Object.values(C));return t.jsx(N.Provider,{value:b,children:P})};g.displayName=u+"Provider";function v(y,E){var N;const P=((N=E==null?void 0:E[r])==null?void 0:N[x])||m,C=p.useContext(P);if(C)return C;if(f!==void 0)return f;throw new Error(`\`${y}\` must be used within \`${u}\``)}return[g,v]}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,[o,ZN(c,...a)]}function ZN(...r){const a=r[0];if(r.length===1)return a;const l=()=>{const o=r.map(c=>({useScope:c(),scopeName:c.scopeName}));return function(u){const f=o.reduce((m,{useScope:x,scopeName:g})=>{const y=x(u)[`__scope${g}`];return{...m,...y}},{});return p.useMemo(()=>({[`__scope${a.scopeName}`]:f}),[f])}};return l.scopeName=a.scopeName,l}var Pt=globalThis!=null&&globalThis.document?p.useLayoutEffect:()=>{},eb=Si[" useId ".trim().toString()]||(()=>{}),tb=0;function xr(r){const[a,l]=p.useState(eb());return Pt(()=>{l(o=>o??String(tb++))},[r]),a?`radix-${a}`:""}var nb=Si[" useInsertionEffect ".trim().toString()]||Pt;function Gr({prop:r,defaultProp:a,onChange:l=()=>{},caller:o}){const[c,u,f]=rb({defaultProp:a,onChange:l}),m=r!==void 0,x=m?r:c;{const v=p.useRef(r!==void 0);p.useEffect(()=>{const y=v.current;y!==m&&console.warn(`${o} 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.`),v.current=m},[m,o])}const g=p.useCallback(v=>{var y;if(m){const E=sb(v)?v(r):v;E!==r&&((y=f.current)==null||y.call(f,E))}else u(v)},[m,r,u,f]);return[x,g]}function rb({defaultProp:r,onChange:a}){const[l,o]=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,o,u]}function sb(r){return typeof r=="function"}function Ma(r){const a=ab(r),l=p.forwardRef((o,c)=>{const{children:u,...f}=o,m=p.Children.toArray(u),x=m.find(ib);if(x){const g=x.props.children,v=m.map(y=>y===x?p.Children.count(g)>1?p.Children.only(null):p.isValidElement(g)?g.props.children:null:y);return t.jsx(a,{...f,ref:c,children:p.isValidElement(g)?p.cloneElement(g,void 0,v):null})}return t.jsx(a,{...f,ref:c,children:u})});return l.displayName=`${r}.Slot`,l}function ab(r){const a=p.forwardRef((l,o)=>{const{children:c,...u}=l;if(p.isValidElement(c)){const f=cb(c),m=ob(u,c.props);return c.type!==p.Fragment&&(m.ref=o?Id(o,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 ib(r){return p.isValidElement(r)&&typeof r.type=="function"&&"__radixId"in r.type&&r.type.__radixId===lb}function ob(r,a){const l={...a};for(const o in a){const c=r[o],u=a[o];/^on[A-Z]/.test(o)?c&&u?l[o]=(...m)=>{const x=u(...m);return c(...m),x}:c&&(l[o]=c):o==="style"?l[o]={...c,...u}:o==="className"&&(l[o]=[c,u].filter(Boolean).join(" "))}return{...r,...l}}function cb(r){var o,c;let a=(o=Object.getOwnPropertyDescriptor(r.props,"ref"))==null?void 0:o.get,l=a&&"isReactWarning"in a&&a.isReactWarning;return l?r.ref:(a=(c=Object.getOwnPropertyDescriptor(r,"ref"))==null?void 0:c.get,l=a&&"isReactWarning"in a&&a.isReactWarning,l?r.props.ref:r.props.ref||r.ref)}var db=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Oe=db.reduce((r,a)=>{const l=Ma(`Primitive.${a}`),o=p.forwardRef((c,u)=>{const{asChild:f,...m}=c,x=f?l:a;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),t.jsx(x,{...m,ref:u})});return o.displayName=`Primitive.${a}`,{...r,[a]:o}},{});function ub(r,a){r&&Da.flushSync(()=>r.dispatchEvent(a))}function vr(r){const a=p.useRef(r);return p.useEffect(()=>{a.current=r}),p.useMemo(()=>(...l)=>{var o;return(o=a.current)==null?void 0:o.call(a,...l)},[])}function fb(r,a=globalThis==null?void 0:globalThis.document){const l=vr(r);p.useEffect(()=>{const o=c=>{c.key==="Escape"&&l(c)};return a.addEventListener("keydown",o,{capture:!0}),()=>a.removeEventListener("keydown",o,{capture:!0})},[l,a])}var hb="DismissableLayer",dd="dismissableLayer.update",mb="dismissableLayer.pointerDownOutside",pb="dismissableLayer.focusOutside",Sm,Mp=p.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Md=p.forwardRef((r,a)=>{const{disableOutsidePointerEvents:l=!1,onEscapeKeyDown:o,onPointerDownOutside:c,onFocusOutside:u,onInteractOutside:f,onDismiss:m,...x}=r,g=p.useContext(Mp),[v,y]=p.useState(null),E=(v==null?void 0:v.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,P]=p.useState({}),C=Ke(a,M=>y(M)),N=Array.from(g.layers),[b]=[...g.layersWithOutsidePointerEventsDisabled].slice(-1),k=N.indexOf(b),R=v?N.indexOf(v):-1,j=g.layersWithOutsidePointerEventsDisabled.size>0,_=R>=k,F=vb(M=>{const V=M.target,te=[...g.branches].some(ue=>ue.contains(V));!_||te||(c==null||c(M),f==null||f(M),M.defaultPrevented||m==null||m())},E),G=yb(M=>{const V=M.target;[...g.branches].some(ue=>ue.contains(V))||(u==null||u(M),f==null||f(M),M.defaultPrevented||m==null||m())},E);return fb(M=>{R===g.layers.size-1&&(o==null||o(M),!M.defaultPrevented&&m&&(M.preventDefault(),m()))},E),p.useEffect(()=>{if(v)return l&&(g.layersWithOutsidePointerEventsDisabled.size===0&&(Sm=E.body.style.pointerEvents,E.body.style.pointerEvents="none"),g.layersWithOutsidePointerEventsDisabled.add(v)),g.layers.add(v),Cm(),()=>{l&&g.layersWithOutsidePointerEventsDisabled.size===1&&(E.body.style.pointerEvents=Sm)}},[v,E,l,g]),p.useEffect(()=>()=>{v&&(g.layers.delete(v),g.layersWithOutsidePointerEventsDisabled.delete(v),Cm())},[v,g]),p.useEffect(()=>{const M=()=>P({});return document.addEventListener(dd,M),()=>document.removeEventListener(dd,M)},[]),t.jsx(Oe.div,{...x,ref:C,style:{pointerEvents:j?_?"auto":"none":void 0,...r.style},onFocusCapture:Ae(r.onFocusCapture,G.onFocusCapture),onBlurCapture:Ae(r.onBlurCapture,G.onBlurCapture),onPointerDownCapture:Ae(r.onPointerDownCapture,F.onPointerDownCapture)})});Md.displayName=hb;var xb="DismissableLayerBranch",gb=p.forwardRef((r,a)=>{const l=p.useContext(Mp),o=p.useRef(null),c=Ke(a,o);return p.useEffect(()=>{const u=o.current;if(u)return l.branches.add(u),()=>{l.branches.delete(u)}},[l.branches]),t.jsx(Oe.div,{...r,ref:c})});gb.displayName=xb;function vb(r,a=globalThis==null?void 0:globalThis.document){const l=vr(r),o=p.useRef(!1),c=p.useRef(()=>{});return p.useEffect(()=>{const u=m=>{if(m.target&&!o.current){let x=function(){Lp(mb,l,g,{discrete:!0})};const g={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);o.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:()=>o.current=!0}}function yb(r,a=globalThis==null?void 0:globalThis.document){const l=vr(r),o=p.useRef(!1);return p.useEffect(()=>{const c=u=>{u.target&&!o.current&&Lp(pb,l,{originalEvent:u},{discrete:!1})};return a.addEventListener("focusin",c),()=>a.removeEventListener("focusin",c)},[a,l]),{onFocusCapture:()=>o.current=!0,onBlurCapture:()=>o.current=!1}}function Cm(){const r=new CustomEvent(dd);document.dispatchEvent(r)}function Lp(r,a,l,{discrete:o}){const c=l.originalEvent.target,u=new CustomEvent(r,{bubbles:!1,cancelable:!0,detail:l});a&&c.addEventListener(r,a,{once:!0}),o?ub(c,u):c.dispatchEvent(u)}var Bc="focusScope.autoFocusOnMount",Vc="focusScope.autoFocusOnUnmount",km={bubbles:!1,cancelable:!0},jb="FocusScope",Ld=p.forwardRef((r,a)=>{const{loop:l=!1,trapped:o=!1,onMountAutoFocus:c,onUnmountAutoFocus:u,...f}=r,[m,x]=p.useState(null),g=vr(c),v=vr(u),y=p.useRef(null),E=Ke(a,N=>x(N)),P=p.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;p.useEffect(()=>{if(o){let N=function(j){if(P.paused||!m)return;const _=j.target;m.contains(_)?y.current=_:ur(y.current,{select:!0})},b=function(j){if(P.paused||!m)return;const _=j.relatedTarget;_!==null&&(m.contains(_)||ur(y.current,{select:!0}))},k=function(j){if(document.activeElement===document.body)for(const F of j)F.removedNodes.length>0&&ur(m)};document.addEventListener("focusin",N),document.addEventListener("focusout",b);const R=new MutationObserver(k);return m&&R.observe(m,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",N),document.removeEventListener("focusout",b),R.disconnect()}}},[o,m,P.paused]),p.useEffect(()=>{if(m){Pm.add(P);const N=document.activeElement;if(!m.contains(N)){const k=new CustomEvent(Bc,km);m.addEventListener(Bc,g),m.dispatchEvent(k),k.defaultPrevented||(wb(kb(Dp(m)),{select:!0}),document.activeElement===N&&ur(m))}return()=>{m.removeEventListener(Bc,g),setTimeout(()=>{const k=new CustomEvent(Vc,km);m.addEventListener(Vc,v),m.dispatchEvent(k),k.defaultPrevented||ur(N??document.body,{select:!0}),m.removeEventListener(Vc,v),Pm.remove(P)},0)}}},[m,g,v,P]);const C=p.useCallback(N=>{if(!l&&!o||P.paused)return;const b=N.key==="Tab"&&!N.altKey&&!N.ctrlKey&&!N.metaKey,k=document.activeElement;if(b&&k){const R=N.currentTarget,[j,_]=Nb(R);j&&_?!N.shiftKey&&k===_?(N.preventDefault(),l&&ur(j,{select:!0})):N.shiftKey&&k===j&&(N.preventDefault(),l&&ur(_,{select:!0})):k===R&&N.preventDefault()}},[l,o,P.paused]);return t.jsx(Oe.div,{tabIndex:-1,...f,ref:E,onKeyDown:C})});Ld.displayName=jb;function wb(r,{select:a=!1}={}){const l=document.activeElement;for(const o of r)if(ur(o,{select:a}),document.activeElement!==l)return}function Nb(r){const a=Dp(r),l=Em(a,r),o=Em(a.reverse(),r);return[l,o]}function Dp(r){const a=[],l=document.createTreeWalker(r,NodeFilter.SHOW_ELEMENT,{acceptNode:o=>{const c=o.tagName==="INPUT"&&o.type==="hidden";return o.disabled||o.hidden||c?NodeFilter.FILTER_SKIP:o.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;l.nextNode();)a.push(l.currentNode);return a}function Em(r,a){for(const l of r)if(!bb(l,{upTo:a}))return l}function bb(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 ur(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],o=l.indexOf(a);return o!==-1&&l.splice(o,1),l}function kb(r){return r.filter(a=>a.tagName!=="A")}var Eb="Portal",Dd=p.forwardRef((r,a)=>{var m;const{container:l,...o}=r,[c,u]=p.useState(!1);Pt(()=>u(!0),[]);const f=l||c&&((m=globalThis==null?void 0:globalThis.document)==null?void 0:m.body);return f?ey.createPortal(t.jsx(Oe.div,{...o,ref:a}),f):null});Dd.displayName=Eb;function Pb(r,a){return p.useReducer((l,o)=>a[l][o]??l,r)}var za=r=>{const{present:a,children:l}=r,o=Rb(a),c=typeof l=="function"?l({present:o.isPresent}):p.Children.only(l),u=Ke(o.ref,_b(c));return typeof l=="function"||o.isPresent?p.cloneElement(c,{ref:u}):null};za.displayName="Presence";function Rb(r){const[a,l]=p.useState(),o=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 g=Zl(o.current);u.current=m==="mounted"?g:"none"},[m]),Pt(()=>{const g=o.current,v=c.current;if(v!==r){const E=u.current,P=Zl(g);r?x("MOUNT"):P==="none"||(g==null?void 0:g.display)==="none"?x("UNMOUNT"):x(v&&E!==P?"ANIMATION_OUT":"UNMOUNT"),c.current=r}},[r,x]),Pt(()=>{if(a){let g;const v=a.ownerDocument.defaultView??window,y=P=>{const N=Zl(o.current).includes(CSS.escape(P.animationName));if(P.target===a&&N&&(x("ANIMATION_END"),!c.current)){const b=a.style.animationFillMode;a.style.animationFillMode="forwards",g=v.setTimeout(()=>{a.style.animationFillMode==="forwards"&&(a.style.animationFillMode=b)})}},E=P=>{P.target===a&&(u.current=Zl(o.current))};return a.addEventListener("animationstart",E),a.addEventListener("animationcancel",y),a.addEventListener("animationend",y),()=>{v.clearTimeout(g),a.removeEventListener("animationstart",E),a.removeEventListener("animationcancel",y),a.removeEventListener("animationend",y)}}else x("ANIMATION_END")},[a,x]),{isPresent:["mounted","unmountSuspended"].includes(m),ref:p.useCallback(g=>{o.current=g?getComputedStyle(g):null,l(g)},[])}}function Zl(r){return(r==null?void 0:r.animationName)||"none"}function _b(r){var o,c;let a=(o=Object.getOwnPropertyDescriptor(r.props,"ref"))==null?void 0:o.get,l=a&&"isReactWarning"in a&&a.isReactWarning;return l?r.ref:(a=(c=Object.getOwnPropertyDescriptor(r,"ref"))==null?void 0:c.get,l=a&&"isReactWarning"in a&&a.isReactWarning,l?r.props.ref:r.props.ref||r.ref)}var Uc=0;function Op(){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()),Uc++,()=>{Uc===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(a=>a.remove()),Uc--}},[])}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 Cn=function(){return Cn=Object.assign||function(a){for(var l,o=1,c=arguments.length;o"u")return Gb;var a=Yb(r),l=document.documentElement.clientWidth,o=window.innerWidth;return{left:a[0],top:a[1],right:a[2],gap:Math.max(0,o-l+a[2]-a[0])}},qb=Bp(),Ps="data-scroll-locked",Xb=function(r,a,l,o){var c=r.left,u=r.top,f=r.right,m=r.gap;return l===void 0&&(l="margin"),` - .`.concat(Ib,` { - overflow: hidden `).concat(o,`; - padding-right: `).concat(m,"px ").concat(o,`; - } - body[`).concat(Ps,`] { - overflow: hidden `).concat(o,`; - overscroll-behavior: contain; - `).concat([a&&"position: relative ".concat(o,";"),l==="margin"&&` - padding-left: `.concat(c,`px; - padding-top: `).concat(u,`px; - padding-right: `).concat(f,`px; - margin-left:0; - margin-top:0; - margin-right: `).concat(m,"px ").concat(o,`; - `),l==="padding"&&"padding-right: ".concat(m,"px ").concat(o,";")].filter(Boolean).join(""),` - } - - .`).concat(li,` { - right: `).concat(m,"px ").concat(o,`; - } - - .`).concat(ii,` { - margin-right: `).concat(m,"px ").concat(o,`; - } - - .`).concat(li," .").concat(li,` { - right: 0 `).concat(o,`; - } - - .`).concat(ii," .").concat(ii,` { - margin-right: 0 `).concat(o,`; - } - - body[`).concat(Ps,`] { - `).concat(Ab,": ").concat(m,`px; - } -`)},Im=function(){var r=parseInt(document.body.getAttribute(Ps)||"0",10);return isFinite(r)?r:0},Jb=function(){p.useEffect(function(){return document.body.setAttribute(Ps,(Im()+1).toString()),function(){var r=Im()-1;r<=0?document.body.removeAttribute(Ps):document.body.setAttribute(Ps,r.toString())}},[])},Zb=function(r){var a=r.noRelative,l=r.noImportant,o=r.gapMode,c=o===void 0?"margin":o;Jb();var u=p.useMemo(function(){return Qb(c)},[c]);return p.createElement(qb,{styles:Xb(u,!a,c,l?"":"!important")})},ud=!1;if(typeof window<"u")try{var ei=Object.defineProperty({},"passive",{get:function(){return ud=!0,!0}});window.addEventListener("test",ei,ei),window.removeEventListener("test",ei,ei)}catch{ud=!1}var Cs=ud?{passive:!1}:!1,e1=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&&!e1(r)&&l[a]==="visible")},t1=function(r){return Vp(r,"overflowY")},n1=function(r){return Vp(r,"overflowX")},Am=function(r,a){var l=a.ownerDocument,o=a;do{typeof ShadowRoot<"u"&&o instanceof ShadowRoot&&(o=o.host);var c=Up(r,o);if(c){var u=Wp(r,o),f=u[1],m=u[2];if(f>m)return!0}o=o.parentNode}while(o&&o!==l.body);return!1},r1=function(r){var a=r.scrollTop,l=r.scrollHeight,o=r.clientHeight;return[a,l,o]},s1=function(r){var a=r.scrollLeft,l=r.scrollWidth,o=r.clientWidth;return[a,l,o]},Up=function(r,a){return r==="v"?t1(a):n1(a)},Wp=function(r,a){return r==="v"?r1(a):s1(a)},a1=function(r,a){return r==="h"&&a==="rtl"?-1:1},l1=function(r,a,l,o,c){var u=a1(r,window.getComputedStyle(a).direction),f=u*o,m=l.target,x=a.contains(m),g=!1,v=f>0,y=0,E=0;do{if(!m)break;var P=Wp(r,m),C=P[0],N=P[1],b=P[2],k=N-b-u*C;(C||k)&&Up(r,m)&&(y+=k,E+=C);var R=m.parentNode;m=R&&R.nodeType===Node.DOCUMENT_FRAGMENT_NODE?R.host:R}while(!x&&m!==document.body||x&&(a.contains(m)||a===m));return(v&&Math.abs(y)<1||!v&&Math.abs(E)<1)&&(g=!0),g},ti=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},i1=function(r,a){return r[0]===a[0]&&r[1]===a[1]},o1=function(r){return` - .block-interactivity-`.concat(r,` {pointer-events: none;} - .allow-interactivity-`).concat(r,` {pointer-events: all;} -`)},c1=0,ks=[];function d1(r){var a=p.useRef([]),l=p.useRef([0,0]),o=p.useRef(),c=p.useState(c1++)[0],u=p.useState(Bp)[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 N=Tb([r.lockRef.current],(r.shards||[]).map(Lm),!0).filter(Boolean);return N.forEach(function(b){return b.classList.add("allow-interactivity-".concat(c))}),function(){document.body.classList.remove("block-interactivity-".concat(c)),N.forEach(function(b){return b.classList.remove("allow-interactivity-".concat(c))})}}},[r.inert,r.lockRef.current,r.shards]);var m=p.useCallback(function(N,b){if("touches"in N&&N.touches.length===2||N.type==="wheel"&&N.ctrlKey)return!f.current.allowPinchZoom;var k=ti(N),R=l.current,j="deltaX"in N?N.deltaX:R[0]-k[0],_="deltaY"in N?N.deltaY:R[1]-k[1],F,G=N.target,M=Math.abs(j)>Math.abs(_)?"h":"v";if("touches"in N&&M==="h"&&G.type==="range")return!1;var V=window.getSelection(),te=V&&V.anchorNode,ue=te?te===G||te.contains(G):!1;if(ue)return!1;var ce=Am(M,G);if(!ce)return!0;if(ce?F=M:(F=M==="v"?"h":"v",ce=Am(M,G)),!ce)return!1;if(!o.current&&"changedTouches"in N&&(j||_)&&(o.current=F),!F)return!0;var ie=o.current||F;return l1(ie,b,N,ie==="h"?j:_)},[]),x=p.useCallback(function(N){var b=N;if(!(!ks.length||ks[ks.length-1]!==u)){var k="deltaY"in b?Mm(b):ti(b),R=a.current.filter(function(F){return F.name===b.type&&(F.target===b.target||b.target===F.shadowParent)&&i1(F.delta,k)})[0];if(R&&R.should){b.cancelable&&b.preventDefault();return}if(!R){var j=(f.current.shards||[]).map(Lm).filter(Boolean).filter(function(F){return F.contains(b.target)}),_=j.length>0?m(b,j[0]):!f.current.noIsolation;_&&b.cancelable&&b.preventDefault()}}},[]),g=p.useCallback(function(N,b,k,R){var j={name:N,delta:b,target:k,should:R,shadowParent:u1(k)};a.current.push(j),setTimeout(function(){a.current=a.current.filter(function(_){return _!==j})},1)},[]),v=p.useCallback(function(N){l.current=ti(N),o.current=void 0},[]),y=p.useCallback(function(N){g(N.type,Mm(N),N.target,m(N,r.lockRef.current))},[]),E=p.useCallback(function(N){g(N.type,ti(N),N.target,m(N,r.lockRef.current))},[]);p.useEffect(function(){return ks.push(u),r.setCallbacks({onScrollCapture:y,onWheelCapture:y,onTouchMoveCapture:E}),document.addEventListener("wheel",x,Cs),document.addEventListener("touchmove",x,Cs),document.addEventListener("touchstart",v,Cs),function(){ks=ks.filter(function(N){return N!==u}),document.removeEventListener("wheel",x,Cs),document.removeEventListener("touchmove",x,Cs),document.removeEventListener("touchstart",v,Cs)}},[]);var P=r.removeScrollBar,C=r.inert;return p.createElement(p.Fragment,null,C?p.createElement(u,{styles:o1(c)}):null,P?p.createElement(Zb,{noRelative:r.noRelative,gapMode:r.gapMode}):null)}function u1(r){for(var a=null;r!==null;)r instanceof ShadowRoot&&(a=r.host,r=r.host),r=r.parentNode;return a}const f1=$b($p,d1);var Od=p.forwardRef(function(r,a){return p.createElement(_i,Cn({},r,{ref:a,sideCar:f1}))});Od.classNames=_i.classNames;var h1=function(r){if(typeof document>"u")return null;var a=Array.isArray(r)?r[0]:r;return a.ownerDocument.body},Es=new WeakMap,ni=new WeakMap,ri={},Gc=0,Hp=function(r){return r&&(r.host||Hp(r.parentNode))},m1=function(r,a){return a.map(function(l){if(r.contains(l))return l;var o=Hp(l);return o&&r.contains(o)?o:(console.error("aria-hidden",l,"in not contained inside",r,". Doing nothing"),null)}).filter(function(l){return!!l})},p1=function(r,a,l,o){var c=m1(a,Array.isArray(r)?r:[r]);ri[l]||(ri[l]=new WeakMap);var u=ri[l],f=[],m=new Set,x=new Set(c),g=function(y){!y||m.has(y)||(m.add(y),g(y.parentNode))};c.forEach(g);var v=function(y){!y||x.has(y)||Array.prototype.forEach.call(y.children,function(E){if(m.has(E))v(E);else try{var P=E.getAttribute(o),C=P!==null&&P!=="false",N=(Es.get(E)||0)+1,b=(u.get(E)||0)+1;Es.set(E,N),u.set(E,b),f.push(E),N===1&&C&&ni.set(E,!0),b===1&&E.setAttribute(l,"true"),C||E.setAttribute(o,"true")}catch(k){console.error("aria-hidden: cannot operate on ",E,k)}})};return v(a),m.clear(),Gc++,function(){f.forEach(function(y){var E=Es.get(y)-1,P=u.get(y)-1;Es.set(y,E),u.set(y,P),E||(ni.has(y)||y.removeAttribute(o),ni.delete(y)),P||y.removeAttribute(l)}),Gc--,Gc||(Es=new WeakMap,Es=new WeakMap,ni=new WeakMap,ri={})}},Kp=function(r,a,l){l===void 0&&(l="data-aria-hidden");var o=Array.from(Array.isArray(r)?r:[r]),c=h1(r);return c?(o.push.apply(o,Array.from(c.querySelectorAll("[aria-live], script"))),p1(o,c,l,"aria-hidden")):function(){return null}},Ti="Dialog",[Gp]=Cr(Ti),[x1,yn]=Gp(Ti),Yp=r=>{const{__scopeDialog:a,children:l,open:o,defaultOpen:c,onOpenChange:u,modal:f=!0}=r,m=p.useRef(null),x=p.useRef(null),[g,v]=Gr({prop:o,defaultProp:c??!1,onChange:u,caller:Ti});return t.jsx(x1,{scope:a,triggerRef:m,contentRef:x,contentId:xr(),titleId:xr(),descriptionId:xr(),open:g,onOpenChange:v,onOpenToggle:p.useCallback(()=>v(y=>!y),[v]),modal:f,children:l})};Yp.displayName=Ti;var Qp="DialogTrigger",g1=p.forwardRef((r,a)=>{const{__scopeDialog:l,...o}=r,c=yn(Qp,l),u=Ke(a,c.triggerRef);return t.jsx(Oe.button,{type:"button","aria-haspopup":"dialog","aria-expanded":c.open,"aria-controls":c.contentId,"data-state":$d(c.open),...o,ref:u,onClick:Ae(r.onClick,c.onOpenToggle)})});g1.displayName=Qp;var Fd="DialogPortal",[v1,qp]=Gp(Fd,{forceMount:void 0}),Xp=r=>{const{__scopeDialog:a,forceMount:l,children:o,container:c}=r,u=yn(Fd,a);return t.jsx(v1,{scope:a,forceMount:l,children:p.Children.map(o,f=>t.jsx(za,{present:l||u.open,children:t.jsx(Dd,{asChild:!0,container:c,children:f})}))})};Xp.displayName=Fd;var gi="DialogOverlay",Jp=p.forwardRef((r,a)=>{const l=qp(gi,r.__scopeDialog),{forceMount:o=l.forceMount,...c}=r,u=yn(gi,r.__scopeDialog);return u.modal?t.jsx(za,{present:o||u.open,children:t.jsx(j1,{...c,ref:a})}):null});Jp.displayName=gi;var y1=Ma("DialogOverlay.RemoveScroll"),j1=p.forwardRef((r,a)=>{const{__scopeDialog:l,...o}=r,c=yn(gi,l);return t.jsx(Od,{as:y1,allowPinchZoom:!0,shards:[c.contentRef],children:t.jsx(Oe.div,{"data-state":$d(c.open),...o,ref:a,style:{pointerEvents:"auto",...o.style}})})}),Yr="DialogContent",Zp=p.forwardRef((r,a)=>{const l=qp(Yr,r.__scopeDialog),{forceMount:o=l.forceMount,...c}=r,u=yn(Yr,r.__scopeDialog);return t.jsx(za,{present:o||u.open,children:u.modal?t.jsx(w1,{...c,ref:a}):t.jsx(N1,{...c,ref:a})})});Zp.displayName=Yr;var w1=p.forwardRef((r,a)=>{const l=yn(Yr,r.__scopeDialog),o=p.useRef(null),c=Ke(a,l.contentRef,o);return p.useEffect(()=>{const u=o.current;if(u)return Kp(u)},[]),t.jsx(ex,{...r,ref:c,trapFocus:l.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Ae(r.onCloseAutoFocus,u=>{var f;u.preventDefault(),(f=l.triggerRef.current)==null||f.focus()}),onPointerDownOutside:Ae(r.onPointerDownOutside,u=>{const f=u.detail.originalEvent,m=f.button===0&&f.ctrlKey===!0;(f.button===2||m)&&u.preventDefault()}),onFocusOutside:Ae(r.onFocusOutside,u=>u.preventDefault())})}),N1=p.forwardRef((r,a)=>{const l=yn(Yr,r.__scopeDialog),o=p.useRef(!1),c=p.useRef(!1);return t.jsx(ex,{...r,ref:a,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:u=>{var f,m;(f=r.onCloseAutoFocus)==null||f.call(r,u),u.defaultPrevented||(o.current||(m=l.triggerRef.current)==null||m.focus(),u.preventDefault()),o.current=!1,c.current=!1},onInteractOutside:u=>{var x,g;(x=r.onInteractOutside)==null||x.call(r,u),u.defaultPrevented||(o.current=!0,u.detail.originalEvent.type==="pointerdown"&&(c.current=!0));const f=u.target;((g=l.triggerRef.current)==null?void 0:g.contains(f))&&u.preventDefault(),u.detail.originalEvent.type==="focusin"&&c.current&&u.preventDefault()}})}),ex=p.forwardRef((r,a)=>{const{__scopeDialog:l,trapFocus:o,onOpenAutoFocus:c,onCloseAutoFocus:u,...f}=r,m=yn(Yr,l),x=p.useRef(null),g=Ke(a,x);return Op(),t.jsxs(t.Fragment,{children:[t.jsx(Ld,{asChild:!0,loop:!0,trapped:o,onMountAutoFocus:c,onUnmountAutoFocus:u,children:t.jsx(Md,{role:"dialog",id:m.contentId,"aria-describedby":m.descriptionId,"aria-labelledby":m.titleId,"data-state":$d(m.open),...f,ref:g,onDismiss:()=>m.onOpenChange(!1)})}),t.jsxs(t.Fragment,{children:[t.jsx(b1,{titleId:m.titleId}),t.jsx(C1,{contentRef:x,descriptionId:m.descriptionId})]})]})}),zd="DialogTitle",tx=p.forwardRef((r,a)=>{const{__scopeDialog:l,...o}=r,c=yn(zd,l);return t.jsx(Oe.h2,{id:c.titleId,...o,ref:a})});tx.displayName=zd;var nx="DialogDescription",rx=p.forwardRef((r,a)=>{const{__scopeDialog:l,...o}=r,c=yn(nx,l);return t.jsx(Oe.p,{id:c.descriptionId,...o,ref:a})});rx.displayName=nx;var sx="DialogClose",ax=p.forwardRef((r,a)=>{const{__scopeDialog:l,...o}=r,c=yn(sx,l);return t.jsx(Oe.button,{type:"button",...o,ref:a,onClick:Ae(r.onClick,()=>c.onOpenChange(!1))})});ax.displayName=sx;function $d(r){return r?"open":"closed"}var lx="DialogTitleWarning",[a4,ix]=JN(lx,{contentName:Yr,titleName:zd,docsSlug:"dialog"}),b1=({titleId:r})=>{const a=ix(lx),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},S1="DialogDescriptionWarning",C1=({contentRef:r,descriptionId:a})=>{const o=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${ix(S1).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(o))},[o,r,a]),null},k1=Yp,E1=Xp,P1=Jp,R1=Zp,_1=tx,T1=rx,I1=ax;function Kt(r){return t.jsx(k1,{"data-slot":"dialog",...r})}function A1(r){return t.jsx(E1,{...r})}const ox=p.forwardRef(({className:r,...a},l)=>t.jsx(P1,{ref:l,className:Ge("fixed inset-0 z-50 bg-black/50",r),...a}));ox.displayName="DialogOverlay";const $t=p.forwardRef(({className:r,children:a,showCloseButton:l=!0,...o},c)=>t.jsxs(A1,{children:[t.jsx(ox,{}),t.jsxs(R1,{ref:c,className:Ge("fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] -translate-x-1/2 -translate-y-1/2 gap-4 rounded-lg border bg-background p-6 shadow-lg sm:max-w-lg",r),...o,children:[a,l&&t.jsxs(I1,{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:[t.jsx(Pn,{className:"h-4 w-4"}),t.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));$t.displayName="DialogContent";function Gt({className:r,...a}){return t.jsx("div",{className:Ge("flex flex-col gap-2 text-center sm:text-left",r),...a})}function sn({className:r,...a}){return t.jsx("div",{className:Ge("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",r),...a})}function Yt(r){return t.jsx(_1,{className:"text-lg font-semibold leading-none",...r})}function M1(r){return t.jsx(T1,{className:"text-sm text-muted-foreground",...r})}function cx(r,a){const[l,o]=p.useState(r);return p.useEffect(()=>{const c=setTimeout(()=>o(r),a);return()=>clearTimeout(c)},[r,a]),l}function Kr({page:r,totalPages:a,total:l,pageSize:o,onPageChange:c,onPageSizeChange:u,pageSizeOptions:f=[10,20,50,100]}){return a<=1&&!u?null:t.jsxs("div",{className:"flex items-center justify-between gap-4 py-4 px-5 border-t border-gray-700/50",children:[t.jsxs("div",{className:"flex items-center gap-2 text-sm text-gray-400",children:[t.jsxs("span",{children:["共 ",l," 条"]}),u&&t.jsx("select",{value:o,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=>t.jsxs("option",{value:m,children:[m," 条/页"]},m))})]}),a>1&&t.jsxs("div",{className:"flex items-center gap-2",children:[t.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:"首页"}),t.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:"上一页"}),t.jsxs("span",{className:"px-3 py-1 text-gray-400 text-sm",children:[r," / ",a]}),t.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:"下一页"}),t.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 L1(){const[r,a]=p.useState([]),[l,o]=p.useState([]),[c,u]=p.useState(0),[f,m]=p.useState(0),[x,g]=p.useState(0),[v,y]=p.useState(1),[E,P]=p.useState(10),[C,N]=p.useState(""),b=cx(C,300),[k,R]=p.useState("all"),[j,_]=p.useState(!0),[F,G]=p.useState(null),[M,V]=p.useState(null),[te,ue]=p.useState(""),[ce,ie]=p.useState(!1);async function fe(){_(!0),G(null);try{const B=k==="all"?"":k==="completed"?"completed":k,S=new URLSearchParams({page:String(v),pageSize:String(E),...B&&{status:B},...b&&{search:b}}),[D,ae]=await Promise.all([He(`/api/orders?${S}`),He("/api/db/users?page=1&pageSize=500")]);D!=null&&D.success&&(a(D.orders||[]),u(D.total??0),m(D.totalRevenue??0),g(D.todayRevenue??0)),ae!=null&&ae.success&&ae.users&&o(ae.users)}catch(B){console.error("加载订单失败",B),G("加载订单失败,请检查网络后重试")}finally{_(!1)}}p.useEffect(()=>{y(1)},[b,k]),p.useEffect(()=>{fe()},[v,E,b,k]);const H=B=>{var S;return B.userNickname||((S=l.find(D=>D.id===B.userId))==null?void 0:S.nickname)||"匿名用户"},W=B=>{var S;return((S=l.find(D=>D.id===B))==null?void 0:S.phone)||"-"},Y=B=>{const S=B.productType||B.type||"",D=B.description||"";if(D){if(S==="section"&&D.includes("章节")){if(D.includes("-")){const ae=D.split("-");if(ae.length>=3)return{name:`第${ae[1]}章 第${ae[2]}节`,type:"《一场Soul的创业实验》"}}return{name:D,type:"章节购买"}}return S==="fullbook"||D.includes("全书")?{name:"《一场Soul的创业实验》",type:"全书购买"}:S==="vip"||D.includes("VIP")?{name:"VIP年度会员",type:"VIP"}:S==="match"||D.includes("伙伴")?{name:"找伙伴匹配",type:"功能服务"}:{name:D,type:"其他"}}return S==="section"?{name:`章节 ${B.productId||B.sectionId||""}`,type:"单章"}:S==="fullbook"?{name:"《一场Soul的创业实验》",type:"全书"}:S==="vip"?{name:"VIP年度会员",type:"VIP"}:S==="match"?{name:"找伙伴匹配",type:"功能"}:{name:"未知商品",type:S||"其他"}},K=Math.ceil(c/E)||1;async function A(){var B;if(!(!(M!=null&&M.orderSn)&&!(M!=null&&M.id))){ie(!0),G(null);try{const S=await zt("/api/admin/orders/refund",{orderSn:M.orderSn||M.id,reason:te||void 0});S!=null&&S.success?(V(null),ue(""),fe()):G((S==null?void 0:S.error)||"退款失败")}catch(S){const D=S;G(((B=D==null?void 0:D.data)==null?void 0:B.error)||"退款失败,请检查网络后重试")}finally{ie(!1)}}}function J(){if(r.length===0){alert("暂无数据可导出");return}const B=["订单号","用户","手机号","商品","金额","支付方式","状态","退款原因","分销佣金","下单时间"],S=r.map(me=>{const Q=Y(me);return[me.orderSn||me.id||"",H(me),W(me.userId),Q.name,Number(me.amount||0).toFixed(2),me.paymentMethod==="wechat"?"微信支付":me.paymentMethod==="alipay"?"支付宝":me.paymentMethod||"微信支付",me.status==="refunded"?"已退款":me.status==="paid"||me.status==="completed"?"已完成":me.status==="pending"||me.status==="created"?"待支付":"已失败",me.status==="refunded"&&me.refundReason?me.refundReason:"-",me.referrerEarnings?Number(me.referrerEarnings).toFixed(2):"-",me.createdAt?new Date(me.createdAt).toLocaleString("zh-CN"):""].join(",")}),D="\uFEFF"+[B.join(","),...S].join(` -`),ae=new Blob([D],{type:"text/csv;charset=utf-8"}),oe=URL.createObjectURL(ae),Ne=document.createElement("a");Ne.href=oe,Ne.download=`订单列表_${new Date().toISOString().slice(0,10)}.csv`,Ne.click(),URL.revokeObjectURL(oe)}return t.jsxs("div",{className:"p-8 w-full",children:[F&&t.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:[t.jsx("span",{children:F}),t.jsx("button",{type:"button",onClick:()=>G(null),className:"hover:text-red-300",children:"×"})]}),t.jsxs("div",{className:"flex justify-between items-center mb-8",children:[t.jsxs("div",{children:[t.jsx("h2",{className:"text-2xl font-bold text-white",children:"订单管理"}),t.jsxs("p",{className:"text-gray-400 mt-1",children:["共 ",r.length," 笔订单"]})]}),t.jsxs("div",{className:"flex items-center gap-4",children:[t.jsxs(de,{variant:"outline",onClick:fe,disabled:j,className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:[t.jsx(tt,{className:`w-4 h-4 mr-2 ${j?"animate-spin":""}`}),"刷新"]}),t.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[t.jsx("span",{className:"text-gray-400",children:"总收入:"}),t.jsxs("span",{className:"text-[#38bdac] font-bold",children:["¥",f.toFixed(2)]}),t.jsx("span",{className:"text-gray-600",children:"|"}),t.jsx("span",{className:"text-gray-400",children:"今日:"}),t.jsxs("span",{className:"text-[#FFD700] font-bold",children:["¥",x.toFixed(2)]})]})]})]}),t.jsxs("div",{className:"flex items-center gap-4 mb-6",children:[t.jsxs("div",{className:"relative flex-1 max-w-md",children:[t.jsx(Hr,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-gray-500"}),t.jsx(ne,{type:"text",placeholder:"搜索订单号/用户/章节...",className:"pl-10 bg-[#0f2137] border-gray-700 text-white placeholder:text-gray-500",value:C,onChange:B=>N(B.target.value)})]}),t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx(zj,{className:"w-4 h-4 text-gray-400"}),t.jsxs("select",{value:k,onChange:B=>R(B.target.value),className:"bg-[#0f2137] border border-gray-700 text-white rounded-lg px-3 py-2 text-sm",children:[t.jsx("option",{value:"all",children:"全部状态"}),t.jsx("option",{value:"completed",children:"已完成"}),t.jsx("option",{value:"pending",children:"待支付"}),t.jsx("option",{value:"created",children:"已创建"}),t.jsx("option",{value:"failed",children:"已失败"}),t.jsx("option",{value:"refunded",children:"已退款"})]})]}),t.jsxs(de,{variant:"outline",onClick:J,disabled:r.length===0,className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:[t.jsx(Aj,{className:"w-4 h-4 mr-2"}),"导出 CSV"]})]}),t.jsx(Ce,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:t.jsx(ke,{className:"p-0",children:j?t.jsxs("div",{className:"flex items-center justify-center py-12",children:[t.jsx(tt,{className:"w-6 h-6 text-[#38bdac] animate-spin"}),t.jsx("span",{className:"ml-2 text-gray-400",children:"加载中..."})]}):t.jsxs("div",{children:[t.jsxs(Nr,{children:[t.jsx(br,{children:t.jsxs(dt,{className:"bg-[#0a1628] hover:bg-[#0a1628] border-gray-700",children:[t.jsx(Te,{className:"text-gray-400",children:"订单号"}),t.jsx(Te,{className:"text-gray-400",children:"用户"}),t.jsx(Te,{className:"text-gray-400",children:"商品"}),t.jsx(Te,{className:"text-gray-400",children:"金额"}),t.jsx(Te,{className:"text-gray-400",children:"支付方式"}),t.jsx(Te,{className:"text-gray-400",children:"状态"}),t.jsx(Te,{className:"text-gray-400",children:"退款原因"}),t.jsx(Te,{className:"text-gray-400",children:"分销佣金"}),t.jsx(Te,{className:"text-gray-400",children:"下单时间"}),t.jsx(Te,{className:"text-gray-400",children:"操作"})]})}),t.jsxs(Sr,{children:[r.map(B=>{const S=Y(B);return t.jsxs(dt,{className:"hover:bg-[#0a1628] border-gray-700/50",children:[t.jsxs(Ee,{className:"font-mono text-xs text-gray-400",children:[(B.orderSn||B.id||"").slice(0,12),"..."]}),t.jsx(Ee,{children:t.jsxs("div",{children:[t.jsx("p",{className:"text-white text-sm",children:H(B)}),t.jsx("p",{className:"text-gray-500 text-xs",children:W(B.userId)})]})}),t.jsx(Ee,{children:t.jsxs("div",{children:[t.jsxs("p",{className:"text-white text-sm flex items-center gap-2",children:[S.name,(B.productType||B.type)==="vip"&&t.jsx(De,{className:"bg-amber-500/20 text-amber-400 hover:bg-amber-500/20 border-0 text-xs",children:"VIP"})]}),t.jsx("p",{className:"text-gray-500 text-xs",children:S.type})]})}),t.jsxs(Ee,{className:"text-[#38bdac] font-bold",children:["¥",Number(B.amount||0).toFixed(2)]}),t.jsx(Ee,{className:"text-gray-300",children:B.paymentMethod==="wechat"?"微信支付":B.paymentMethod==="alipay"?"支付宝":B.paymentMethod||"微信支付"}),t.jsx(Ee,{children:B.status==="refunded"?t.jsx(De,{className:"bg-gray-500/20 text-gray-400 hover:bg-gray-500/20 border-0",children:"已退款"}):B.status==="paid"||B.status==="completed"?t.jsx(De,{className:"bg-green-500/20 text-green-400 hover:bg-green-500/20 border-0",children:"已完成"}):B.status==="pending"||B.status==="created"?t.jsx(De,{className:"bg-yellow-500/20 text-yellow-400 hover:bg-yellow-500/20 border-0",children:"待支付"}):t.jsx(De,{className:"bg-red-500/20 text-red-400 hover:bg-red-500/20 border-0",children:"已失败"})}),t.jsx(Ee,{className:"text-gray-400 text-sm max-w-[120px] truncate",title:B.refundReason,children:B.status==="refunded"&&B.refundReason?B.refundReason:"-"}),t.jsx(Ee,{className:"text-[#FFD700]",children:B.referrerEarnings?`¥${Number(B.referrerEarnings).toFixed(2)}`:"-"}),t.jsx(Ee,{className:"text-gray-400 text-sm",children:new Date(B.createdAt).toLocaleString("zh-CN")}),t.jsx(Ee,{children:(B.status==="paid"||B.status==="completed")&&t.jsxs(de,{variant:"outline",size:"sm",className:"border-orange-500/50 text-orange-400 hover:bg-orange-500/20",onClick:()=>{V(B),ue("")},children:[t.jsx(mp,{className:"w-3 h-3 mr-1"}),"退款"]})})]},B.id)}),r.length===0&&t.jsx(dt,{children:t.jsx(Ee,{colSpan:10,className:"text-center py-12 text-gray-500",children:"暂无订单数据"})})]})]}),t.jsx(Kr,{page:v,totalPages:K,total:c,pageSize:E,onPageChange:y,onPageSizeChange:B=>{P(B),y(1)}})]})})}),t.jsx(Kt,{open:!!M,onOpenChange:B=>!B&&V(null),children:t.jsxs($t,{className:"bg-[#0f2137] border-gray-700 text-white max-w-md",children:[t.jsx(Gt,{children:t.jsx(Yt,{className:"text-white",children:"订单退款"})}),M&&t.jsxs("div",{className:"space-y-4",children:[t.jsxs("p",{className:"text-gray-400 text-sm",children:["订单号:",M.orderSn||M.id]}),t.jsxs("p",{className:"text-gray-400 text-sm",children:["退款金额:¥",Number(M.amount||0).toFixed(2)]}),t.jsxs("div",{children:[t.jsx("label",{className:"text-sm text-gray-400 block mb-2",children:"退款原因(选填)"}),t.jsx("div",{className:"form-input",children:t.jsx(ne,{className:"bg-[#0a1628] border-gray-700 text-white placeholder:text-gray-500",placeholder:"如:用户申请退款",value:te,onChange:B=>ue(B.target.value)})})]}),t.jsx("p",{className:"text-orange-400/80 text-xs",children:"退款将原路退回至用户微信,且无法撤销,请确认后再操作。"})]}),t.jsxs(sn,{children:[t.jsx(de,{variant:"outline",className:"border-gray-600 text-gray-300",onClick:()=>V(null),disabled:ce,children:"取消"}),t.jsx(de,{className:"bg-orange-500 hover:bg-orange-600 text-white",onClick:A,disabled:ce,children:ce?"退款中...":"确认退款"})]})]})})]})}var D1=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],O1=D1.reduce((r,a)=>{const l=gp(`Primitive.${a}`),o=p.forwardRef((c,u)=>{const{asChild:f,...m}=c,x=f?l:a;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),t.jsx(x,{...m,ref:u})});return o.displayName=`Primitive.${a}`,{...r,[a]:o}},{}),F1="Label",dx=p.forwardRef((r,a)=>t.jsx(O1.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())}}));dx.displayName=F1;var ux=dx;const q=p.forwardRef(({className:r,...a},l)=>t.jsx(ux,{ref:l,className:Ge("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",r),...a}));q.displayName=ux.displayName;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 Pt(()=>{if(r){l({width:r.offsetWidth,height:r.offsetHeight});const o=new ResizeObserver(c=>{if(!Array.isArray(c)||!c.length)return;const u=c[0];let f,m;if("borderBoxSize"in u){const x=u.borderBoxSize,g=Array.isArray(x)?x[0]:x;f=g.inlineSize,m=g.blockSize}else f=r.offsetWidth,m=r.offsetHeight;l({width:f,height:m})});return o.observe(r,{box:"border-box"}),()=>o.unobserve(r)}else l(void 0)},[r]),a}var Ii="Switch",[z1]=Cr(Ii),[$1,B1]=z1(Ii),fx=p.forwardRef((r,a)=>{const{__scopeSwitch:l,name:o,checked:c,defaultChecked:u,required:f,disabled:m,value:x="on",onCheckedChange:g,form:v,...y}=r,[E,P]=p.useState(null),C=Ke(a,j=>P(j)),N=p.useRef(!1),b=E?v||!!E.closest("form"):!0,[k,R]=Gr({prop:c,defaultProp:u??!1,onChange:g,caller:Ii});return t.jsxs($1,{scope:l,checked:k,disabled:m,children:[t.jsx(Oe.button,{type:"button",role:"switch","aria-checked":k,"aria-required":f,"data-state":xx(k),"data-disabled":m?"":void 0,disabled:m,value:x,...y,ref:C,onClick:Ae(r.onClick,j=>{R(_=>!_),b&&(N.current=j.isPropagationStopped(),N.current||j.stopPropagation())})}),b&&t.jsx(px,{control:E,bubbles:!N.current,name:o,value:x,checked:k,required:f,disabled:m,form:v,style:{transform:"translateX(-100%)"}})]})});fx.displayName=Ii;var hx="SwitchThumb",mx=p.forwardRef((r,a)=>{const{__scopeSwitch:l,...o}=r,c=B1(hx,l);return t.jsx(Oe.span,{"data-state":xx(c.checked),"data-disabled":c.disabled?"":void 0,...o,ref:a})});mx.displayName=hx;var V1="SwitchBubbleInput",px=p.forwardRef(({__scopeSwitch:r,control:a,checked:l,bubbles:o=!0,...c},u)=>{const f=p.useRef(null),m=Ke(f,u),x=Bd(l),g=Vd(a);return p.useEffect(()=>{const v=f.current;if(!v)return;const y=window.HTMLInputElement.prototype,P=Object.getOwnPropertyDescriptor(y,"checked").set;if(x!==l&&P){const C=new Event("click",{bubbles:o});P.call(v,l),v.dispatchEvent(C)}},[x,l,o]),t.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:l,...c,tabIndex:-1,ref:m,style:{...c.style,...g,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});px.displayName=V1;function xx(r){return r?"checked":"unchecked"}var gx=fx,U1=mx;const ft=p.forwardRef(({className:r,...a},l)=>t.jsx(gx,{className:Ge("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:t.jsx(U1,{className:Ge("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")})}));ft.displayName=gx.displayName;function Ud(r){const a=r+"CollectionProvider",[l,o]=Cr(a),[c,u]=l(a,{collectionRef:{current:null},itemMap:new Map}),f=N=>{const{scope:b,children:k}=N,R=dr.useRef(null),j=dr.useRef(new Map).current;return t.jsx(c,{scope:b,itemMap:j,collectionRef:R,children:k})};f.displayName=a;const m=r+"CollectionSlot",x=Ma(m),g=dr.forwardRef((N,b)=>{const{scope:k,children:R}=N,j=u(m,k),_=Ke(b,j.collectionRef);return t.jsx(x,{ref:_,children:R})});g.displayName=m;const v=r+"CollectionItemSlot",y="data-radix-collection-item",E=Ma(v),P=dr.forwardRef((N,b)=>{const{scope:k,children:R,...j}=N,_=dr.useRef(null),F=Ke(b,_),G=u(v,k);return dr.useEffect(()=>(G.itemMap.set(_,{ref:_,...j}),()=>void G.itemMap.delete(_))),t.jsx(E,{[y]:"",ref:F,children:R})});P.displayName=v;function C(N){const b=u(r+"CollectionConsumer",N);return dr.useCallback(()=>{const R=b.collectionRef.current;if(!R)return[];const j=Array.from(R.querySelectorAll(`[${y}]`));return Array.from(b.itemMap.values()).sort((G,M)=>j.indexOf(G.ref.current)-j.indexOf(M.ref.current))},[b.collectionRef,b.itemMap])}return[{Provider:f,Slot:g,ItemSlot:P},C,o]}var W1=p.createContext(void 0);function Ai(r){const a=p.useContext(W1);return r||a||"ltr"}var Yc="rovingFocusGroup.onEntryFocus",H1={bubbles:!1,cancelable:!0},$a="RovingFocusGroup",[fd,vx,K1]=Ud($a),[G1,yx]=Cr($a,[K1]),[Y1,Q1]=G1($a),jx=p.forwardRef((r,a)=>t.jsx(fd.Provider,{scope:r.__scopeRovingFocusGroup,children:t.jsx(fd.Slot,{scope:r.__scopeRovingFocusGroup,children:t.jsx(q1,{...r,ref:a})})}));jx.displayName=$a;var q1=p.forwardRef((r,a)=>{const{__scopeRovingFocusGroup:l,orientation:o,loop:c=!1,dir:u,currentTabStopId:f,defaultCurrentTabStopId:m,onCurrentTabStopIdChange:x,onEntryFocus:g,preventScrollOnEntryFocus:v=!1,...y}=r,E=p.useRef(null),P=Ke(a,E),C=Ai(u),[N,b]=Gr({prop:f,defaultProp:m??null,onChange:x,caller:$a}),[k,R]=p.useState(!1),j=vr(g),_=vx(l),F=p.useRef(!1),[G,M]=p.useState(0);return p.useEffect(()=>{const V=E.current;if(V)return V.addEventListener(Yc,j),()=>V.removeEventListener(Yc,j)},[j]),t.jsx(Y1,{scope:l,orientation:o,dir:C,loop:c,currentTabStopId:N,onItemFocus:p.useCallback(V=>b(V),[b]),onItemShiftTab:p.useCallback(()=>R(!0),[]),onFocusableItemAdd:p.useCallback(()=>M(V=>V+1),[]),onFocusableItemRemove:p.useCallback(()=>M(V=>V-1),[]),children:t.jsx(Oe.div,{tabIndex:k||G===0?-1:0,"data-orientation":o,...y,ref:P,style:{outline:"none",...r.style},onMouseDown:Ae(r.onMouseDown,()=>{F.current=!0}),onFocus:Ae(r.onFocus,V=>{const te=!F.current;if(V.target===V.currentTarget&&te&&!k){const ue=new CustomEvent(Yc,H1);if(V.currentTarget.dispatchEvent(ue),!ue.defaultPrevented){const ce=_().filter(Y=>Y.focusable),ie=ce.find(Y=>Y.active),fe=ce.find(Y=>Y.id===N),W=[ie,fe,...ce].filter(Boolean).map(Y=>Y.ref.current);bx(W,v)}}F.current=!1}),onBlur:Ae(r.onBlur,()=>R(!1))})})}),wx="RovingFocusGroupItem",Nx=p.forwardRef((r,a)=>{const{__scopeRovingFocusGroup:l,focusable:o=!0,active:c=!1,tabStopId:u,children:f,...m}=r,x=xr(),g=u||x,v=Q1(wx,l),y=v.currentTabStopId===g,E=vx(l),{onFocusableItemAdd:P,onFocusableItemRemove:C,currentTabStopId:N}=v;return p.useEffect(()=>{if(o)return P(),()=>C()},[o,P,C]),t.jsx(fd.ItemSlot,{scope:l,id:g,focusable:o,active:c,children:t.jsx(Oe.span,{tabIndex:y?0:-1,"data-orientation":v.orientation,...m,ref:a,onMouseDown:Ae(r.onMouseDown,b=>{o?v.onItemFocus(g):b.preventDefault()}),onFocus:Ae(r.onFocus,()=>v.onItemFocus(g)),onKeyDown:Ae(r.onKeyDown,b=>{if(b.key==="Tab"&&b.shiftKey){v.onItemShiftTab();return}if(b.target!==b.currentTarget)return;const k=Z1(b,v.orientation,v.dir);if(k!==void 0){if(b.metaKey||b.ctrlKey||b.altKey||b.shiftKey)return;b.preventDefault();let j=E().filter(_=>_.focusable).map(_=>_.ref.current);if(k==="last")j.reverse();else if(k==="prev"||k==="next"){k==="prev"&&j.reverse();const _=j.indexOf(b.currentTarget);j=v.loop?e2(j,_+1):j.slice(_+1)}setTimeout(()=>bx(j))}}),children:typeof f=="function"?f({isCurrentTabStop:y,hasTabStop:N!=null}):f})})});Nx.displayName=wx;var X1={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function J1(r,a){return a!=="rtl"?r:r==="ArrowLeft"?"ArrowRight":r==="ArrowRight"?"ArrowLeft":r}function Z1(r,a,l){const o=J1(r.key,l);if(!(a==="vertical"&&["ArrowLeft","ArrowRight"].includes(o))&&!(a==="horizontal"&&["ArrowUp","ArrowDown"].includes(o)))return X1[o]}function bx(r,a=!1){const l=document.activeElement;for(const o of r)if(o===l||(o.focus({preventScroll:a}),document.activeElement!==l))return}function e2(r,a){return r.map((l,o)=>r[(a+o)%r.length])}var t2=jx,n2=Nx,Mi="Tabs",[r2]=Cr(Mi,[yx]),Sx=yx(),[s2,Wd]=r2(Mi),Cx=p.forwardRef((r,a)=>{const{__scopeTabs:l,value:o,onValueChange:c,defaultValue:u,orientation:f="horizontal",dir:m,activationMode:x="automatic",...g}=r,v=Ai(m),[y,E]=Gr({prop:o,onChange:c,defaultProp:u??"",caller:Mi});return t.jsx(s2,{scope:l,baseId:xr(),value:y,onValueChange:E,orientation:f,dir:v,activationMode:x,children:t.jsx(Oe.div,{dir:v,"data-orientation":f,...g,ref:a})})});Cx.displayName=Mi;var kx="TabsList",Ex=p.forwardRef((r,a)=>{const{__scopeTabs:l,loop:o=!0,...c}=r,u=Wd(kx,l),f=Sx(l);return t.jsx(t2,{asChild:!0,...f,orientation:u.orientation,dir:u.dir,loop:o,children:t.jsx(Oe.div,{role:"tablist","aria-orientation":u.orientation,...c,ref:a})})});Ex.displayName=kx;var Px="TabsTrigger",Rx=p.forwardRef((r,a)=>{const{__scopeTabs:l,value:o,disabled:c=!1,...u}=r,f=Wd(Px,l),m=Sx(l),x=Ix(f.baseId,o),g=Ax(f.baseId,o),v=o===f.value;return t.jsx(n2,{asChild:!0,...m,focusable:!c,active:v,children:t.jsx(Oe.button,{type:"button",role:"tab","aria-selected":v,"aria-controls":g,"data-state":v?"active":"inactive","data-disabled":c?"":void 0,disabled:c,id:x,...u,ref:a,onMouseDown:Ae(r.onMouseDown,y=>{!c&&y.button===0&&y.ctrlKey===!1?f.onValueChange(o):y.preventDefault()}),onKeyDown:Ae(r.onKeyDown,y=>{[" ","Enter"].includes(y.key)&&f.onValueChange(o)}),onFocus:Ae(r.onFocus,()=>{const y=f.activationMode!=="manual";!v&&!c&&y&&f.onValueChange(o)})})})});Rx.displayName=Px;var _x="TabsContent",Tx=p.forwardRef((r,a)=>{const{__scopeTabs:l,value:o,forceMount:c,children:u,...f}=r,m=Wd(_x,l),x=Ix(m.baseId,o),g=Ax(m.baseId,o),v=o===m.value,y=p.useRef(v);return p.useEffect(()=>{const E=requestAnimationFrame(()=>y.current=!1);return()=>cancelAnimationFrame(E)},[]),t.jsx(za,{present:c||v,children:({present:E})=>t.jsx(Oe.div,{"data-state":v?"active":"inactive","data-orientation":m.orientation,role:"tabpanel","aria-labelledby":x,hidden:!E,id:g,tabIndex:0,...f,ref:a,style:{...r.style,animationDuration:y.current?"0s":void 0},children:E&&u})})});Tx.displayName=_x;function Ix(r,a){return`${r}-trigger-${a}`}function Ax(r,a){return`${r}-content-${a}`}var a2=Cx,Mx=Ex,Lx=Rx,Dx=Tx;const Hd=a2,Li=p.forwardRef(({className:r,...a},l)=>t.jsx(Mx,{ref:l,className:Ge("inline-flex h-9 items-center justify-center rounded-lg bg-muted p-1 text-muted-foreground",r),...a}));Li.displayName=Mx.displayName;const nn=p.forwardRef(({className:r,...a},l)=>t.jsx(Lx,{ref:l,className:Ge("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}));nn.displayName=Lx.displayName;const rn=p.forwardRef(({className:r,...a},l)=>t.jsx(Dx,{ref:l,className:Ge("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",r),...a}));rn.displayName=Dx.displayName;function l2({open:r,onClose:a,userId:l,onUserUpdated:o}){var Y;const[c,u]=p.useState(null),[f,m]=p.useState([]),[x,g]=p.useState([]),[v,y]=p.useState(!1),[E,P]=p.useState(!1),[C,N]=p.useState(!1),[b,k]=p.useState("info"),[R,j]=p.useState(""),[_,F]=p.useState(""),[G,M]=p.useState([]),[V,te]=p.useState("");p.useEffect(()=>{r&&l&&ue()},[r,l]);async function ue(){if(l){y(!0);try{const K=await He(`/api/db/users?id=${encodeURIComponent(l)}`);if(K!=null&&K.success&&K.user){const A=K.user;u(A),j(A.phone||""),F(A.nickname||""),M(typeof A.tags=="string"?JSON.parse(A.tags||"[]"):[])}try{const A=await He(`/api/user/track?userId=${encodeURIComponent(l)}&limit=50`);A!=null&&A.success&&A.tracks&&m(A.tracks)}catch{m([])}try{const A=await He(`/api/db/users/referrals?userId=${encodeURIComponent(l)}`);A!=null&&A.success&&A.referrals&&g(A.referrals)}catch{g([])}}catch(K){console.error("Load user detail error:",K)}finally{y(!1)}}}async function ce(){if(!(c!=null&&c.phone)){alert("用户未绑定手机号,无法同步");return}P(!0);try{const K=await jt("/api/ckb/sync",{action:"full_sync",phone:c.phone,userId:c.id});K!=null&&K.success?(alert("同步成功"),ue()):alert("同步失败: "+(K==null?void 0:K.error))}catch(K){console.error("Sync CKB error:",K),alert("同步失败")}finally{P(!1)}}async function ie(){if(c){N(!0);try{const K={id:c.id,phone:R||void 0,nickname:_||void 0,tags:JSON.stringify(G)},A=await zt("/api/db/users",K);A!=null&&A.success?(alert("保存成功"),ue(),o==null||o()):alert("保存失败: "+(A==null?void 0:A.error))}catch(K){console.error("Save user error:",K),alert("保存失败")}finally{N(!1)}}}const fe=()=>{V&&!G.includes(V)&&(M([...G,V]),te(""))},H=K=>{M(G.filter(A=>A!==K))},W=K=>{const J={view_chapter:Ts,purchase:ld,match:xn,login:ai,register:ai,share:Wr,bind_phone:yw,bind_wechat:fw}[K]||dm;return t.jsx(J,{className:"w-4 h-4"})};return r?t.jsx(Kt,{open:r,onOpenChange:()=>a(),children:t.jsxs($t,{className:"bg-[#0f2137] border-gray-700 text-white max-w-4xl max-h-[90vh] overflow-hidden",children:[t.jsx(Gt,{children:t.jsxs(Yt,{className:"text-white flex items-center gap-2",children:[t.jsx(ai,{className:"w-5 h-5 text-[#38bdac]"}),"用户详情",(c==null?void 0:c.phone)&&t.jsx(De,{className:"bg-green-500/20 text-green-400 border-0 ml-2",children:"已绑定手机"})]})}),v?t.jsxs("div",{className:"flex items-center justify-center py-20",children:[t.jsx(tt,{className:"w-6 h-6 text-[#38bdac] animate-spin"}),t.jsx("span",{className:"ml-2 text-gray-400",children:"加载中..."})]}):c?t.jsxs("div",{className:"flex flex-col h-[70vh]",children:[t.jsxs("div",{className:"flex items-center gap-4 p-4 bg-[#0a1628] rounded-lg mb-4",children:[t.jsx("div",{className:"w-16 h-16 rounded-full bg-[#38bdac]/20 flex items-center justify-center text-2xl text-[#38bdac]",children:c.avatar?t.jsx("img",{src:c.avatar,className:"w-full h-full rounded-full object-cover",alt:""}):((Y=c.nickname)==null?void 0:Y.charAt(0))||"?"}),t.jsxs("div",{className:"flex-1",children:[t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx("h3",{className:"text-lg font-bold text-white",children:c.nickname}),c.isAdmin&&t.jsx(De,{className:"bg-purple-500/20 text-purple-400 border-0",children:"管理员"}),c.hasFullBook&&t.jsx(De,{className:"bg-green-500/20 text-green-400 border-0",children:"全书已购"})]}),t.jsxs("p",{className:"text-gray-400 text-sm mt-1",children:[c.phone?`📱 ${c.phone}`:"未绑定手机",c.wechatId&&` · 💬 ${c.wechatId}`]}),t.jsxs("p",{className:"text-gray-500 text-xs mt-1",children:["ID: ",c.id," · 推广码: ",c.referralCode??"-"]})]}),t.jsxs("div",{className:"text-right",children:[t.jsxs("p",{className:"text-[#38bdac] font-bold",children:["¥",(c.earnings||0).toFixed(2)]}),t.jsx("p",{className:"text-gray-500 text-xs",children:"累计收益"})]})]}),t.jsxs(Hd,{value:b,onValueChange:k,className:"flex-1 flex flex-col overflow-hidden",children:[t.jsxs(Li,{className:"bg-[#0a1628] border border-gray-700/50 p-1 mb-4",children:[t.jsx(nn,{value:"info",className:"data-[state=active]:bg-[#38bdac]/20 data-[state=active]:text-[#38bdac]",children:"基础信息"}),t.jsx(nn,{value:"tags",className:"data-[state=active]:bg-[#38bdac]/20 data-[state=active]:text-[#38bdac]",children:"标签体系"}),t.jsx(nn,{value:"tracks",className:"data-[state=active]:bg-[#38bdac]/20 data-[state=active]:text-[#38bdac]",children:"行为轨迹"}),t.jsx(nn,{value:"relations",className:"data-[state=active]:bg-[#38bdac]/20 data-[state=active]:text-[#38bdac]",children:"关系链路"})]}),t.jsxs(rn,{value:"info",className:"flex-1 overflow-auto space-y-4",children:[t.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[t.jsxs("div",{className:"space-y-2",children:[t.jsx(q,{className:"text-gray-300",children:"手机号"}),t.jsx(ne,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"输入手机号",value:R,onChange:K=>j(K.target.value)})]}),t.jsxs("div",{className:"space-y-2",children:[t.jsx(q,{className:"text-gray-300",children:"昵称"}),t.jsx(ne,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"输入昵称",value:_,onChange:K=>F(K.target.value)})]})]}),t.jsxs("div",{className:"grid grid-cols-3 gap-4",children:[t.jsxs("div",{className:"p-4 bg-[#0a1628] rounded-lg",children:[t.jsx("p",{className:"text-gray-400 text-sm",children:"推荐人数"}),t.jsx("p",{className:"text-2xl font-bold text-white",children:c.referralCount??0})]}),t.jsxs("div",{className:"p-4 bg-[#0a1628] rounded-lg",children:[t.jsx("p",{className:"text-gray-400 text-sm",children:"待提现"}),t.jsxs("p",{className:"text-2xl font-bold text-yellow-400",children:["¥",(c.pendingEarnings??0).toFixed(2)]})]}),t.jsxs("div",{className:"p-4 bg-[#0a1628] rounded-lg",children:[t.jsx("p",{className:"text-gray-400 text-sm",children:"创建时间"}),t.jsx("p",{className:"text-sm text-white",children:c.createdAt?new Date(c.createdAt).toLocaleDateString():"-"})]})]}),t.jsxs("div",{className:"p-4 bg-[#0a1628] rounded-lg",children:[t.jsxs("div",{className:"flex items-center justify-between mb-3",children:[t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx(Wr,{className:"w-4 h-4 text-[#38bdac]"}),t.jsx("span",{className:"text-white font-medium",children:"存客宝同步"})]}),t.jsx(de,{size:"sm",onClick:ce,disabled:E||!c.phone,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:E?t.jsxs(t.Fragment,{children:[t.jsx(tt,{className:"w-4 h-4 mr-1 animate-spin"})," 同步中..."]}):t.jsxs(t.Fragment,{children:[t.jsx(tt,{className:"w-4 h-4 mr-1"})," 同步数据"]})})]}),t.jsxs("div",{className:"grid grid-cols-2 gap-4 text-sm",children:[t.jsxs("div",{children:[t.jsx("span",{className:"text-gray-500",children:"同步状态:"}),c.ckbSyncedAt?t.jsx(De,{className:"bg-green-500/20 text-green-400 border-0 ml-1",children:"已同步"}):t.jsx(De,{className:"bg-gray-500/20 text-gray-400 border-0 ml-1",children:"未同步"})]}),t.jsxs("div",{children:[t.jsx("span",{className:"text-gray-500",children:"最后同步:"}),t.jsx("span",{className:"text-gray-300 ml-1",children:c.ckbSyncedAt?new Date(c.ckbSyncedAt).toLocaleString():"-"})]})]})]})]}),t.jsx(rn,{value:"tags",className:"flex-1 overflow-auto space-y-4",children:t.jsxs("div",{className:"p-4 bg-[#0a1628] rounded-lg",children:[t.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[t.jsx(Aw,{className:"w-4 h-4 text-[#38bdac]"}),t.jsx("span",{className:"text-white font-medium",children:"系统标签"})]}),t.jsxs("div",{className:"flex flex-wrap gap-2 mb-3",children:[G.map((K,A)=>t.jsxs(De,{className:"bg-[#38bdac]/20 text-[#38bdac] border-0 pr-1",children:[K,t.jsx("button",{type:"button",onClick:()=>H(K),className:"ml-1 hover:text-red-400",children:t.jsx(Pn,{className:"w-3 h-3"})})]},A)),G.length===0&&t.jsx("span",{className:"text-gray-500 text-sm",children:"暂无标签"})]}),t.jsxs("div",{className:"flex gap-2",children:[t.jsx(ne,{className:"bg-[#162840] border-gray-700 text-white flex-1",placeholder:"添加新标签",value:V,onChange:K=>te(K.target.value),onKeyDown:K=>K.key==="Enter"&&fe()}),t.jsx(de,{onClick:fe,className:"bg-[#38bdac] hover:bg-[#2da396]",children:"添加"})]})]})}),t.jsx(rn,{value:"tracks",className:"flex-1 overflow-auto",children:t.jsx("div",{className:"space-y-2",children:f.length>0?f.map(K=>t.jsxs("div",{className:"flex items-start gap-3 p-3 bg-[#0a1628] rounded-lg",children:[t.jsx("div",{className:"w-8 h-8 rounded-full bg-[#38bdac]/20 flex items-center justify-center text-[#38bdac]",children:W(K.action)}),t.jsxs("div",{className:"flex-1",children:[t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx("span",{className:"text-white font-medium",children:K.actionLabel}),K.chapterTitle&&t.jsxs("span",{className:"text-gray-400 text-sm",children:["- ",K.chapterTitle]})]}),t.jsxs("p",{className:"text-gray-500 text-xs mt-1",children:[t.jsx(fp,{className:"w-3 h-3 inline mr-1"}),K.timeAgo," · ",new Date(K.createdAt).toLocaleString()]})]})]},K.id)):t.jsxs("div",{className:"text-center py-12",children:[t.jsx(dm,{className:"w-10 h-10 text-[#38bdac]/40 mx-auto mb-4"}),t.jsx("p",{className:"text-gray-400",children:"暂无行为轨迹"})]})})}),t.jsx(rn,{value:"relations",className:"flex-1 overflow-auto space-y-4",children:t.jsxs("div",{className:"p-4 bg-[#0a1628] rounded-lg",children:[t.jsxs("div",{className:"flex items-center justify-between mb-3",children:[t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx(Wr,{className:"w-4 h-4 text-[#38bdac]"}),t.jsx("span",{className:"text-white font-medium",children:"推荐的用户"})]}),t.jsxs(De,{className:"bg-[#38bdac]/20 text-[#38bdac] border-0",children:["共 ",x.length," 人"]})]}),t.jsx("div",{className:"space-y-2 max-h-[200px] overflow-y-auto",children:x.length>0?x.map((K,A)=>{var B;const J=K;return t.jsxs("div",{className:"flex items-center justify-between p-2 bg-[#162840] rounded",children:[t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx("div",{className:"w-6 h-6 rounded-full bg-[#38bdac]/20 flex items-center justify-center text-xs text-[#38bdac]",children:((B=J.nickname)==null?void 0:B.charAt(0))||"?"}),t.jsx("span",{className:"text-white text-sm",children:J.nickname})]}),t.jsxs("div",{className:"flex items-center gap-2",children:[J.status==="vip"&&t.jsx(De,{className:"bg-green-500/20 text-green-400 border-0 text-xs",children:"已购"}),t.jsx("span",{className:"text-gray-500 text-xs",children:J.createdAt?new Date(J.createdAt).toLocaleDateString():""})]})]},J.id||A)}):t.jsx("p",{className:"text-gray-500 text-sm text-center py-4",children:"暂无推荐用户"})})]})})]}),t.jsxs("div",{className:"flex justify-end gap-2 pt-4 border-t border-gray-700 mt-4",children:[t.jsxs(de,{variant:"outline",onClick:a,className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:[t.jsx(Pn,{className:"w-4 h-4 mr-2"}),"关闭"]}),t.jsxs(de,{onClick:ie,disabled:C,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:[t.jsx(an,{className:"w-4 h-4 mr-2"}),C?"保存中...":"保存修改"]})]})]}):t.jsx("div",{className:"text-center py-12 text-gray-500",children:"用户不存在"})]})}):null}const Qc={isVip:!1,vipExpireDate:"",vipSort:"",vipRole:"",vipRoleCustom:"",vipName:"",vipProject:"",vipContact:"",vipBio:""};function i2({open:r,onClose:a,userId:l,userNickname:o="",onSaved:c}){const[u,f]=p.useState(Qc),[m,x]=p.useState([]),[g,v]=p.useState(!1),[y,E]=p.useState(!1);p.useEffect(()=>{if(!r){f(Qc);return}let C=!1;return v(!0),Promise.all([He("/api/db/vip-roles"),l?He(`/api/db/users?id=${encodeURIComponent(l)}`):Promise.resolve(null)]).then(([N,b])=>{if(C)return;const k=N!=null&&N.success&&N.data?N.data:[];x(k);const R=b&&b.user?b.user:null;if(R){const j=String(R.vipRole??""),_=k.some(F=>F.name===j);f({isVip:!!(R.isVip??!1),vipExpireDate:R.vipExpireDate?String(R.vipExpireDate).slice(0,10):"",vipSort:typeof R.vipSort=="number"?R.vipSort:"",vipRole:_?j:j?"__custom__":"",vipRoleCustom:_?"":j,vipName:String(R.vipName??""),vipProject:String(R.vipProject??""),vipContact:String(R.vipContact??""),vipBio:String(R.vipBio??"")})}else f(Qc)}).catch(N=>{C||console.error("Load error:",N)}).finally(()=>{C||v(!1)}),()=>{C=!0}},[r,l]);async function P(){if(l){if(u.isVip&&!u.vipExpireDate.trim()){alert("开启 VIP 时请填写有效到期日");return}if(u.isVip&&u.vipExpireDate.trim()){const C=new Date(u.vipExpireDate);if(isNaN(C.getTime())){alert("到期日格式无效,请使用 YYYY-MM-DD");return}}E(!0);try{const C=u.vipRole==="__custom__"?u.vipRoleCustom.trim():u.vipRole,N={id:l,isVip:u.isVip,vipExpireDate:u.isVip?u.vipExpireDate:void 0,vipSort:u.vipSort===""?void 0:u.vipSort,vipRole:C||void 0,vipName:u.vipName||void 0,vipProject:u.vipProject||void 0,vipContact:u.vipContact||void 0,vipBio:u.vipBio||void 0},b=await zt("/api/db/users",N);b!=null&&b.success?(alert("VIP 设置已保存"),c==null||c(),a()):alert("保存失败: "+(b==null?void 0:b.error))}catch(C){console.error("Save VIP error:",C),alert("保存失败")}finally{E(!1)}}}return r?t.jsx(Kt,{open:r,onOpenChange:()=>a(),children:t.jsxs($t,{className:"bg-[#0f2137] border-gray-700 text-white max-w-md",children:[t.jsx(Gt,{children:t.jsxs(Yt,{className:"text-white flex items-center gap-2",children:[t.jsx(Ei,{className:"w-5 h-5 text-amber-400"}),"设置 VIP - ",o||l]})}),g?t.jsx("div",{className:"py-8 text-center text-gray-400",children:"加载中..."}):t.jsxs("div",{className:"space-y-4 py-4",children:[t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsx(q,{className:"text-gray-300",children:"VIP 会员"}),t.jsx(ft,{checked:u.isVip,onCheckedChange:C=>f(N=>({...N,isVip:C}))})]}),u.isVip&&t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"space-y-2",children:[t.jsxs(q,{className:"text-gray-300",children:["到期日 (YYYY-MM-DD) ",t.jsx("span",{className:"text-amber-400",children:"*"})]}),t.jsx(ne,{type:"date",className:"bg-[#0a1628] border-gray-700 text-white",value:u.vipExpireDate,onChange:C=>f(N=>({...N,vipExpireDate:C.target.value}))})]}),t.jsxs("div",{className:"space-y-2",children:[t.jsx(q,{className:"text-gray-300",children:"排序"}),t.jsx(ne,{type:"number",className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"数字越小越靠前,留空按时间",value:u.vipSort===""?"":u.vipSort,onChange:C=>{const N=C.target.value;f(b=>({...b,vipSort:N===""?"":parseInt(N,10)||0}))}})]})]}),t.jsxs("div",{className:"space-y-2",children:[t.jsx(q,{className:"text-gray-300",children:"角色"}),t.jsxs("select",{className:"w-full bg-[#0a1628] border border-gray-700 text-white rounded-md px-3 py-2",value:u.vipRole,onChange:C=>f(N=>({...N,vipRole:C.target.value})),children:[t.jsx("option",{value:"",children:"请选择或下方手动填写"}),m.map(C=>t.jsx("option",{value:C.name,children:C.name},C.id)),t.jsx("option",{value:"__custom__",children:"其他(手动填写)"})]}),u.vipRole==="__custom__"&&t.jsx(ne,{className:"bg-[#0a1628] border-gray-700 text-white mt-1",placeholder:"输入自定义角色",value:u.vipRoleCustom,onChange:C=>f(N=>({...N,vipRoleCustom:C.target.value}))})]}),t.jsxs("div",{className:"space-y-2",children:[t.jsx(q,{className:"text-gray-300",children:"VIP 展示名"}),t.jsx(ne,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"创业老板排行展示名",value:u.vipName,onChange:C=>f(N=>({...N,vipName:C.target.value}))})]}),t.jsxs("div",{className:"space-y-2",children:[t.jsx(q,{className:"text-gray-300",children:"项目/公司"}),t.jsx(ne,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"项目名称",value:u.vipProject,onChange:C=>f(N=>({...N,vipProject:C.target.value}))})]}),t.jsxs("div",{className:"space-y-2",children:[t.jsx(q,{className:"text-gray-300",children:"联系方式"}),t.jsx(ne,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"微信号或手机",value:u.vipContact,onChange:C=>f(N=>({...N,vipContact:C.target.value}))})]}),t.jsxs("div",{className:"space-y-2",children:[t.jsx(q,{className:"text-gray-300",children:"一句话简介"}),t.jsx(ne,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"简要描述业务",value:u.vipBio,onChange:C=>f(N=>({...N,vipBio:C.target.value}))})]})]}),t.jsxs(sn,{children:[t.jsxs(de,{variant:"outline",onClick:a,className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:[t.jsx(Pn,{className:"w-4 h-4 mr-2"}),"取消"]}),t.jsxs(de,{onClick:P,disabled:y||g,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:[t.jsx(an,{className:"w-4 h-4 mr-2"}),y?"保存中...":"保存"]})]})]})}):null}function o2(){var Zr,Vs,Us,Ws,Hs;const[r,a]=p.useState([]),[l,o]=p.useState(0),[c,u]=p.useState(1),[f,m]=p.useState(10),[x,g]=p.useState(""),v=cx(x,300),[y,E]=p.useState("all"),[P,C]=p.useState(!0),[N,b]=p.useState(null),[k,R]=p.useState(!1),[j,_]=p.useState(!1),[F,G]=p.useState(null),[M,V]=p.useState(""),[te,ue]=p.useState(""),[ce,ie]=p.useState(!1),[fe,H]=p.useState(!1),[W,Y]=p.useState({referrals:[],stats:{}}),[K,A]=p.useState(!1),[J,B]=p.useState(null),[S,D]=p.useState(!1),[ae,oe]=p.useState(null),[Ne,me]=p.useState(!1),[Q,xe]=p.useState(null),[I,se]=p.useState({phone:"",nickname:"",password:"",isAdmin:!1,hasFullBook:!1});async function he(){C(!0),b(null);try{const X=new URLSearchParams({page:String(c),pageSize:String(f),search:v,...y==="vip"&&{vip:"true"}}),$e=await He(`/api/db/users?${X}`);$e!=null&&$e.success?(a($e.users||[]),o($e.total??0)):b(($e==null?void 0:$e.error)||"加载失败")}catch(X){console.error("Load users error:",X),b("网络错误,请检查连接")}finally{C(!1)}}p.useEffect(()=>{u(1)},[v,y]),p.useEffect(()=>{he()},[c,f,v,y]);const Pe=Math.ceil(l/f)||1;async function Me(X){if(confirm("确定要删除这个用户吗?"))try{const $e=await Ri(`/api/db/users?id=${encodeURIComponent(X)}`);$e!=null&&$e.success?he():alert("删除失败: "+(($e==null?void 0:$e.error)||"未知错误"))}catch($e){console.error("Delete user error:",$e),alert("删除失败")}}const Fe=X=>{G(X),se({phone:X.phone||"",nickname:X.nickname||"",password:"",isAdmin:!!(X.isAdmin??!1),hasFullBook:!!(X.hasFullBook??!1)}),R(!0)},Qe=()=>{G(null),se({phone:"",nickname:"",password:"",isAdmin:!1,hasFullBook:!1}),R(!0)};async function nt(){if(!I.phone||!I.nickname){alert("请填写手机号和昵称");return}ie(!0);try{if(F){const X=await zt("/api/db/users",{id:F.id,nickname:I.nickname,isAdmin:I.isAdmin,hasFullBook:I.hasFullBook,...I.password&&{password:I.password}});if(!(X!=null&&X.success)){alert("更新失败: "+((X==null?void 0:X.error)||"未知错误"));return}}else{const X=await jt("/api/db/users",{phone:I.phone,nickname:I.nickname,password:I.password,isAdmin:I.isAdmin});if(!(X!=null&&X.success)){alert("创建失败: "+((X==null?void 0:X.error)||"未知错误"));return}}R(!1),he()}catch(X){console.error("Save user error:",X),alert("保存失败")}finally{ie(!1)}}const Ze=X=>{G(X),V(""),ue(""),_(!0)};async function Tt(X){B(X),H(!0),A(!0);try{const $e=await He(`/api/db/users/referrals?userId=${encodeURIComponent(X.id)}`);$e!=null&&$e.success?Y({referrals:$e.referrals||[],stats:$e.stats||{}}):Y({referrals:[],stats:{}})}catch($e){console.error("Load referrals error:",$e),Y({referrals:[],stats:{}})}finally{A(!1)}}const It=X=>{oe(X.id),D(!0)},Pr=X=>{xe(X),me(!0)};async function Un(){if(!M){alert("请输入新密码");return}if(M!==te){alert("两次输入的密码不一致");return}if(M.length<6){alert("密码长度不能少于6位");return}ie(!0);try{const X=await zt("/api/db/users",{id:F==null?void 0:F.id,password:M});X!=null&&X.success?(alert("密码修改成功"),_(!1)):alert("密码修改失败: "+((X==null?void 0:X.error)||"未知错误"))}catch(X){console.error("Change password error:",X),alert("密码修改失败")}finally{ie(!1)}}return t.jsxs("div",{className:"p-8 w-full",children:[N&&t.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:[t.jsx("span",{children:N}),t.jsx("button",{type:"button",onClick:()=>b(null),className:"hover:text-red-300",children:"×"})]}),t.jsxs("div",{className:"flex justify-between items-center mb-8",children:[t.jsxs("div",{children:[t.jsx("h2",{className:"text-2xl font-bold text-white",children:"用户管理"}),t.jsxs("p",{className:"text-gray-400 mt-1",children:["共 ",l," 位注册用户",y==="vip"&&",当前筛选 VIP"]})]}),t.jsxs("div",{className:"flex items-center gap-4",children:[t.jsxs(de,{variant:"outline",onClick:he,disabled:P,className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:[t.jsx(tt,{className:`w-4 h-4 mr-2 ${P?"animate-spin":""}`}),"刷新"]}),t.jsxs("select",{value:y,onChange:X=>{E(X.target.value),u(1)},className:"bg-[#0f2137] border border-gray-700 text-white rounded-lg px-3 py-2 text-sm",children:[t.jsx("option",{value:"all",children:"全部用户"}),t.jsx("option",{value:"vip",children:"VIP会员"})]}),t.jsxs("div",{className:"relative",children:[t.jsx(Hr,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-gray-500"}),t.jsx(ne,{type:"text",placeholder:"搜索用户...",className:"pl-10 bg-[#0f2137] border-gray-700 text-white placeholder:text-gray-500 w-64",value:x,onChange:X=>g(X.target.value)})]}),t.jsxs(de,{onClick:Qe,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:[t.jsx(pm,{className:"w-4 h-4 mr-2"}),"添加用户"]})]})]}),t.jsx(Kt,{open:k,onOpenChange:R,children:t.jsxs($t,{className:"bg-[#0f2137] border-gray-700 text-white max-w-lg",children:[t.jsx(Gt,{children:t.jsxs(Yt,{className:"text-white flex items-center gap-2",children:[F?t.jsx(gr,{className:"w-5 h-5 text-[#38bdac]"}):t.jsx(pm,{className:"w-5 h-5 text-[#38bdac]"}),F?"编辑用户":"添加用户"]})}),t.jsxs("div",{className:"space-y-4 py-4",children:[t.jsxs("div",{className:"space-y-2",children:[t.jsx(q,{className:"text-gray-300",children:"手机号"}),t.jsx(ne,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"请输入手机号",value:I.phone,onChange:X=>se({...I,phone:X.target.value}),disabled:!!F})]}),t.jsxs("div",{className:"space-y-2",children:[t.jsx(q,{className:"text-gray-300",children:"昵称"}),t.jsx(ne,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"请输入昵称",value:I.nickname,onChange:X=>se({...I,nickname:X.target.value})})]}),t.jsxs("div",{className:"space-y-2",children:[t.jsx(q,{className:"text-gray-300",children:F?"新密码 (留空则不修改)":"密码"}),t.jsx(ne,{type:"password",className:"bg-[#0a1628] border-gray-700 text-white",placeholder:F?"留空则不修改":"请输入密码",value:I.password,onChange:X=>se({...I,password:X.target.value})})]}),t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsx(q,{className:"text-gray-300",children:"管理员权限"}),t.jsx(ft,{checked:I.isAdmin,onCheckedChange:X=>se({...I,isAdmin:X})})]}),t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsx(q,{className:"text-gray-300",children:"已购全书"}),t.jsx(ft,{checked:I.hasFullBook,onCheckedChange:X=>se({...I,hasFullBook:X})})]})]}),t.jsxs(sn,{children:[t.jsxs(de,{variant:"outline",onClick:()=>R(!1),className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:[t.jsx(Pn,{className:"w-4 h-4 mr-2"}),"取消"]}),t.jsxs(de,{onClick:nt,disabled:ce,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:[t.jsx(an,{className:"w-4 h-4 mr-2"}),ce?"保存中...":"保存"]})]})]})}),t.jsx(Kt,{open:j,onOpenChange:_,children:t.jsxs($t,{className:"bg-[#0f2137] border-gray-700 text-white max-w-md",children:[t.jsx(Gt,{children:t.jsxs(Yt,{className:"text-white flex items-center gap-2",children:[t.jsx(um,{className:"w-5 h-5 text-[#38bdac]"}),"修改密码"]})}),t.jsxs("div",{className:"space-y-4 py-4",children:[t.jsxs("div",{className:"bg-[#0a1628] rounded-lg p-3",children:[t.jsxs("p",{className:"text-gray-400 text-sm",children:["用户:",F==null?void 0:F.nickname]}),t.jsxs("p",{className:"text-gray-400 text-sm",children:["手机号:",F==null?void 0:F.phone]})]}),t.jsxs("div",{className:"space-y-2",children:[t.jsx(q,{className:"text-gray-300",children:"新密码"}),t.jsx(ne,{type:"password",className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"请输入新密码 (至少6位)",value:M,onChange:X=>V(X.target.value)})]}),t.jsxs("div",{className:"space-y-2",children:[t.jsx(q,{className:"text-gray-300",children:"确认密码"}),t.jsx(ne,{type:"password",className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"请再次输入新密码",value:te,onChange:X=>ue(X.target.value)})]})]}),t.jsxs(sn,{children:[t.jsx(de,{variant:"outline",onClick:()=>_(!1),className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:"取消"}),t.jsx(de,{onClick:Un,disabled:ce,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:ce?"保存中...":"确认修改"})]})]})}),t.jsx(l2,{open:S,onClose:()=>D(!1),userId:ae,onUserUpdated:he}),t.jsx(i2,{open:Ne,onClose:()=>{me(!1),xe(null)},userId:(Q==null?void 0:Q.id)??null,userNickname:Q==null?void 0:Q.nickname,onSaved:he}),t.jsx(Kt,{open:fe,onOpenChange:H,children:t.jsxs($t,{className:"bg-[#0f2137] border-gray-700 text-white max-w-2xl max-h-[80vh] overflow-auto",children:[t.jsx(Gt,{children:t.jsxs(Yt,{className:"text-white flex items-center gap-2",children:[t.jsx(xn,{className:"w-5 h-5 text-[#38bdac]"}),"绑定关系详情 - ",J==null?void 0:J.nickname]})}),t.jsxs("div",{className:"space-y-4 py-4",children:[t.jsxs("div",{className:"grid grid-cols-4 gap-3",children:[t.jsxs("div",{className:"bg-[#0a1628] rounded-lg p-3 text-center",children:[t.jsx("div",{className:"text-2xl font-bold text-[#38bdac]",children:((Zr=W.stats)==null?void 0:Zr.total)||0}),t.jsx("div",{className:"text-xs text-gray-400",children:"绑定总数"})]}),t.jsxs("div",{className:"bg-[#0a1628] rounded-lg p-3 text-center",children:[t.jsx("div",{className:"text-2xl font-bold text-green-400",children:((Vs=W.stats)==null?void 0:Vs.purchased)||0}),t.jsx("div",{className:"text-xs text-gray-400",children:"已付费"})]}),t.jsxs("div",{className:"bg-[#0a1628] rounded-lg p-3 text-center",children:[t.jsxs("div",{className:"text-2xl font-bold text-yellow-400",children:["¥",(((Us=W.stats)==null?void 0:Us.earnings)||0).toFixed(2)]}),t.jsx("div",{className:"text-xs text-gray-400",children:"累计收益"})]}),t.jsxs("div",{className:"bg-[#0a1628] rounded-lg p-3 text-center",children:[t.jsxs("div",{className:"text-2xl font-bold text-orange-400",children:["¥",(((Ws=W.stats)==null?void 0:Ws.pendingEarnings)||0).toFixed(2)]}),t.jsx("div",{className:"text-xs text-gray-400",children:"待提现"})]})]}),K?t.jsxs("div",{className:"flex items-center justify-center py-8",children:[t.jsx(tt,{className:"w-5 h-5 text-[#38bdac] animate-spin"}),t.jsx("span",{className:"ml-2 text-gray-400",children:"加载中..."})]}):(((Hs=W.referrals)==null?void 0:Hs.length)??0)>0?t.jsx("div",{className:"space-y-2 max-h-[300px] overflow-y-auto",children:(W.referrals??[]).map((X,$e)=>{var ln;const wt=X;return t.jsxs("div",{className:"flex items-center justify-between bg-[#0a1628] rounded-lg p-3",children:[t.jsxs("div",{className:"flex items-center gap-3",children:[t.jsx("div",{className:"w-8 h-8 rounded-full bg-[#38bdac]/20 flex items-center justify-center text-sm text-[#38bdac]",children:((ln=wt.nickname)==null?void 0:ln.charAt(0))||"?"}),t.jsxs("div",{children:[t.jsx("div",{className:"text-white text-sm",children:wt.nickname}),t.jsx("div",{className:"text-xs text-gray-500",children:wt.phone||(wt.hasOpenId?"微信用户":"未绑定")})]})]}),t.jsxs("div",{className:"flex items-center gap-2",children:[wt.status==="vip"&&t.jsx(De,{className:"bg-green-500/20 text-green-400 border-0 text-xs",children:"全书已购"}),wt.status==="paid"&&t.jsxs(De,{className:"bg-blue-500/20 text-blue-400 border-0 text-xs",children:["已付费",wt.purchasedSections,"章"]}),wt.status==="free"&&t.jsx(De,{className:"bg-gray-500/20 text-gray-400 border-0 text-xs",children:"未付费"}),t.jsx("span",{className:"text-xs text-gray-500",children:wt.createdAt?new Date(wt.createdAt).toLocaleDateString():""})]})]},wt.id||$e)})}):t.jsx("div",{className:"text-center py-8 text-gray-500",children:"暂无绑定用户"})]}),t.jsx(sn,{children:t.jsx(de,{variant:"outline",onClick:()=>H(!1),className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:"关闭"})})]})}),t.jsx(Ce,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:t.jsx(ke,{className:"p-0",children:P?t.jsxs("div",{className:"flex items-center justify-center py-12",children:[t.jsx(tt,{className:"w-6 h-6 text-[#38bdac] animate-spin"}),t.jsx("span",{className:"ml-2 text-gray-400",children:"加载中..."})]}):t.jsxs("div",{children:[t.jsxs(Nr,{children:[t.jsx(br,{children:t.jsxs(dt,{className:"bg-[#0a1628] hover:bg-[#0a1628] border-gray-700",children:[t.jsx(Te,{className:"text-gray-400",children:"用户信息"}),t.jsx(Te,{className:"text-gray-400",children:"绑定信息"}),t.jsx(Te,{className:"text-gray-400",children:"购买状态"}),t.jsx(Te,{className:"text-gray-400",children:"分销收益"}),t.jsx(Te,{className:"text-gray-400",children:"推广码"}),t.jsx(Te,{className:"text-gray-400",children:"注册时间"}),t.jsx(Te,{className:"text-right text-gray-400",children:"操作"})]})}),t.jsxs(Sr,{children:[r.map(X=>{var $e,wt,ln;return t.jsxs(dt,{className:"hover:bg-[#0a1628] border-gray-700/50",children:[t.jsx(Ee,{children:t.jsxs("div",{className:"flex items-center gap-3",children:[t.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?t.jsx("img",{src:X.avatar,className:"w-full h-full rounded-full object-cover",alt:""}):(($e=X.nickname)==null?void 0:$e.charAt(0))||"?"}),t.jsxs("div",{children:[t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx("p",{className:"font-medium text-white",children:X.nickname}),X.isAdmin&&t.jsx(De,{className:"bg-purple-500/20 text-purple-400 hover:bg-purple-500/20 border-0 text-xs",children:"管理员"}),X.openId&&!((wt=X.id)!=null&&wt.startsWith("user_"))&&t.jsx(De,{className:"bg-green-500/20 text-green-400 hover:bg-green-500/20 border-0 text-xs",children:"微信"})]}),t.jsx("p",{className:"text-xs text-gray-500 font-mono",children:X.openId?X.openId.slice(0,12)+"...":(ln=X.id)==null?void 0:ln.slice(0,12)})]})]})}),t.jsx(Ee,{children:t.jsxs("div",{className:"space-y-1",children:[X.phone&&t.jsxs("div",{className:"flex items-center gap-1 text-xs",children:[t.jsx("span",{className:"text-gray-500",children:"📱"}),t.jsx("span",{className:"text-gray-300",children:X.phone})]}),X.wechatId&&t.jsxs("div",{className:"flex items-center gap-1 text-xs",children:[t.jsx("span",{className:"text-gray-500",children:"💬"}),t.jsx("span",{className:"text-gray-300",children:X.wechatId})]}),X.openId&&t.jsxs("div",{className:"flex items-center gap-1 text-xs",children:[t.jsx("span",{className:"text-gray-500",children:"🔗"}),t.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&&t.jsx("span",{className:"text-gray-600 text-xs",children:"未绑定"})]})}),t.jsx(Ee,{children:X.hasFullBook?t.jsx(De,{className:"bg-amber-500/20 text-amber-400 hover:bg-amber-500/20 border-0",children:"VIP"}):t.jsx(De,{variant:"outline",className:"text-gray-500 border-gray-600",children:"未购买"})}),t.jsx(Ee,{children:t.jsxs("div",{className:"space-y-1",children:[t.jsxs("div",{className:"text-white font-medium",children:["¥",parseFloat(String(X.earnings||0)).toFixed(2)]}),parseFloat(String(X.pendingEarnings||0))>0&&t.jsxs("div",{className:"text-xs text-yellow-400",children:["待提现: ¥",parseFloat(String(X.pendingEarnings||0)).toFixed(2)]}),t.jsxs("div",{className:"text-xs text-[#38bdac] cursor-pointer hover:underline flex items-center gap-1",onClick:()=>Tt(X),onKeyDown:Rr=>Rr.key==="Enter"&&Tt(X),role:"button",tabIndex:0,children:[t.jsx(xn,{className:"w-3 h-3"}),"绑定",X.referralCount||0,"人"]})]})}),t.jsx(Ee,{children:t.jsx("code",{className:"text-[#38bdac] text-xs bg-[#38bdac]/10 px-2 py-0.5 rounded",children:X.referralCode||"-"})}),t.jsx(Ee,{className:"text-gray-400",children:X.createdAt?new Date(X.createdAt).toLocaleDateString():"-"}),t.jsx(Ee,{className:"text-right",children:t.jsxs("div",{className:"flex items-center justify-end gap-1",children:[t.jsx(de,{variant:"ghost",size:"sm",onClick:()=>Pr(X),className:"text-gray-400 hover:text-amber-400 hover:bg-amber-400/10",title:"设置 VIP",children:t.jsx(Ei,{className:"w-4 h-4"})}),t.jsx(de,{variant:"ghost",size:"sm",onClick:()=>It(X),className:"text-gray-400 hover:text-blue-400 hover:bg-blue-400/10",title:"查看详情",children:t.jsx(_d,{className:"w-4 h-4"})}),t.jsx(de,{variant:"ghost",size:"sm",onClick:()=>Fe(X),className:"text-gray-400 hover:text-[#38bdac] hover:bg-[#38bdac]/10",title:"编辑",children:t.jsx(gr,{className:"w-4 h-4"})}),t.jsx(de,{variant:"ghost",size:"sm",onClick:()=>Ze(X),className:"text-gray-400 hover:text-yellow-400 hover:bg-yellow-400/10",title:"修改密码",children:t.jsx(um,{className:"w-4 h-4"})}),t.jsx(de,{variant:"ghost",size:"sm",className:"text-red-400 hover:text-red-300 hover:bg-red-500/10",onClick:()=>Me(X.id),title:"删除",children:t.jsx(Fa,{className:"w-4 h-4"})})]})})]},X.id)}),r.length===0&&t.jsx(dt,{children:t.jsx(Ee,{colSpan:7,className:"text-center py-12 text-gray-500",children:"暂无用户数据"})})]})]}),t.jsx(Kr,{page:c,totalPages:Pe,total:l,pageSize:f,onPageChange:u,onPageSizeChange:X=>{m(X),u(1)}})]})})})]})}function c2(){const[r,a]=p.useState("overview"),[l,o]=p.useState([]),[c,u]=p.useState(null),[f,m]=p.useState([]),[x,g]=p.useState([]),[v,y]=p.useState([]),[E,P]=p.useState(!0),[C,N]=p.useState(null),[b,k]=p.useState(""),[R,j]=p.useState("all"),[_,F]=p.useState(1),[G,M]=p.useState(10),[V,te]=p.useState(0),[ue,ce]=p.useState(new Set),[ie,fe]=p.useState(null),[H,W]=p.useState(""),[Y,K]=p.useState(!1);p.useEffect(()=>{A()},[]),p.useEffect(()=>{F(1)},[r,R]),p.useEffect(()=>{J(r)},[r]),p.useEffect(()=>{["orders","bindings","withdrawals"].includes(r)&&J(r,!0)},[_,G,R,b]);async function A(){N(null);try{const I=await He("/api/admin/distribution/overview");I!=null&&I.success&&I.overview&&u(I.overview)}catch(I){console.error("[Admin] 概览接口异常:",I),N("加载概览失败")}try{const I=await He("/api/db/users");y((I==null?void 0:I.users)||[])}catch(I){console.error("[Admin] 用户数据加载失败:",I)}}async function J(I,se=!1){var he;if(!(!se&&ue.has(I))){P(!0);try{const Pe=v;switch(I){case"overview":break;case"orders":{try{const Me=new URLSearchParams({page:String(_),pageSize:String(G),...R!=="all"&&{status:R},...b&&{search:b}}),Fe=await He(`/api/orders?${Me}`);if(Fe!=null&&Fe.success&&Fe.orders){const Qe=Fe.orders.map(nt=>{const Ze=Pe.find(It=>It.id===nt.userId),Tt=nt.referrerId?Pe.find(It=>It.id===nt.referrerId):null;return{...nt,amount:parseFloat(String(nt.amount))||0,userNickname:(Ze==null?void 0:Ze.nickname)||nt.userNickname||"未知用户",userPhone:(Ze==null?void 0:Ze.phone)||nt.userPhone||"-",referrerNickname:(Tt==null?void 0:Tt.nickname)||null,referrerCode:(Tt==null?void 0:Tt.referralCode)??null,type:nt.productType||nt.type}});o(Qe),te(Fe.total??Qe.length)}else o([]),te(0)}catch(Me){console.error(Me),N("加载订单失败"),o([])}break}case"bindings":{try{const Me=new URLSearchParams({page:String(_),pageSize:String(G),...R!=="all"&&{status:R}}),Fe=await He(`/api/db/distribution?${Me}`);m((Fe==null?void 0:Fe.bindings)||[]),te((Fe==null?void 0:Fe.total)??((he=Fe==null?void 0:Fe.bindings)==null?void 0:he.length)??0)}catch(Me){console.error(Me),N("加载绑定数据失败"),m([])}break}case"withdrawals":{try{const Me=R==="completed"?"success":R==="rejected"?"failed":R,Fe=new URLSearchParams({...Me&&Me!=="all"&&{status:Me},page:String(_),pageSize:String(G)}),Qe=await He(`/api/admin/withdrawals?${Fe}`);if(Qe!=null&&Qe.success&&Qe.withdrawals){const nt=Qe.withdrawals.map(Ze=>({...Ze,account:Ze.account??"未绑定微信号",status:Ze.status==="success"?"completed":Ze.status==="failed"?"rejected":Ze.status}));g(nt),te((Qe==null?void 0:Qe.total)??nt.length)}else Qe!=null&&Qe.success||N(`获取提现记录失败: ${(Qe==null?void 0:Qe.error)||"未知错误"}`),g([])}catch(Me){console.error(Me),N("加载提现数据失败"),g([])}break}}ce(Me=>new Set(Me).add(I))}catch(Pe){console.error(Pe)}finally{P(!1)}}}async function B(){N(null),ce(I=>{const se=new Set(I);return se.delete(r),se}),r==="overview"&&A(),await J(r,!0)}async function S(I){if(confirm("确认审核通过并打款?"))try{const se=await zt("/api/admin/withdrawals",{id:I,action:"approve"});if(!(se!=null&&se.success)){const he=(se==null?void 0:se.message)||(se==null?void 0:se.error)||"操作失败";alert(he);return}await B()}catch(se){console.error(se),alert("操作失败")}}async function D(I){const se=prompt("请输入拒绝原因:");if(se)try{const he=await zt("/api/admin/withdrawals",{id:I,action:"reject",errorMessage:se});if(!(he!=null&&he.success)){alert((he==null?void 0:he.error)||"操作失败");return}await B()}catch(he){console.error(he),alert("操作失败")}}async function ae(){var I;if(!(!(ie!=null&&ie.orderSn)&&!(ie!=null&&ie.id))){K(!0),N(null);try{const se=await zt("/api/admin/orders/refund",{orderSn:ie.orderSn||ie.id,reason:H||void 0});se!=null&&se.success?(fe(null),W(""),await J("orders",!0)):N((se==null?void 0:se.error)||"退款失败")}catch(se){const he=se;N(((I=he==null?void 0:he.data)==null?void 0:I.error)||"退款失败,请检查网络后重试")}finally{K(!1)}}}function oe(I){const se={active:"bg-green-500/20 text-green-400",converted:"bg-blue-500/20 text-blue-400",expired:"bg-gray-500/20 text-gray-400",cancelled:"bg-red-500/20 text-red-400",pending:"bg-orange-500/20 text-orange-400",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"},he={active:"有效",converted:"已转化",expired:"已过期",cancelled:"已取消",pending:"待审核",pending_confirm:"待用户确认",processing:"处理中",completed:"已完成",rejected:"已拒绝"};return t.jsx(De,{className:`${se[I]||"bg-gray-500/20 text-gray-400"} border-0`,children:he[I]||I})}const Ne=Math.ceil(V/G)||1,me=l,Q=f.filter(I=>{var he,Pe,Me,Fe;if(!b)return!0;const se=b.toLowerCase();return((he=I.refereeNickname)==null?void 0:he.toLowerCase().includes(se))||((Pe=I.refereePhone)==null?void 0:Pe.includes(se))||((Me=I.referrerName)==null?void 0:Me.toLowerCase().includes(se))||((Fe=I.referrerCode)==null?void 0:Fe.toLowerCase().includes(se))}),xe=x.filter(I=>{var he;if(!b)return!0;const se=b.toLowerCase();return((he=I.userName)==null?void 0:he.toLowerCase().includes(se))||I.account&&I.account.toLowerCase().includes(se)});return t.jsxs("div",{className:"p-8 w-full",children:[C&&t.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:[t.jsx("span",{children:C}),t.jsx("button",{type:"button",onClick:()=>N(null),className:"hover:text-red-300",children:"×"})]}),t.jsxs("div",{className:"flex items-center justify-between mb-8",children:[t.jsxs("div",{children:[t.jsx("h1",{className:"text-2xl font-bold text-white",children:"交易中心"}),t.jsx("p",{className:"text-gray-400 mt-1",children:"统一管理:订单、分销绑定、提现审核"})]}),t.jsxs(de,{onClick:B,disabled:E,variant:"outline",className:"border-gray-700 text-gray-300 hover:bg-gray-800",children:[t.jsx(tt,{className:`w-4 h-4 mr-2 ${E?"animate-spin":""}`}),"刷新数据"]})]}),t.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:fi},{key:"bindings",label:"绑定管理",icon:Wr},{key:"withdrawals",label:"提现审核",icon:Is}].map(I=>t.jsxs("button",{type:"button",onClick:()=>{a(I.key),j("all"),k("")},className:`flex items-center gap-2 px-4 py-2 rounded-lg text-sm font-medium transition-colors ${r===I.key?"bg-[#38bdac] text-white":"text-gray-400 hover:text-white hover:bg-gray-800"}`,children:[t.jsx(I.icon,{className:"w-4 h-4"}),I.label]},I.key))}),E?t.jsxs("div",{className:"flex items-center justify-center py-20",children:[t.jsx(tt,{className:"w-8 h-8 text-[#38bdac] animate-spin"}),t.jsx("span",{className:"ml-2 text-gray-400",children:"加载中..."})]}):t.jsxs(t.Fragment,{children:[r==="overview"&&c&&t.jsxs("div",{className:"space-y-6",children:[t.jsxs("div",{className:"grid grid-cols-4 gap-4",children:[t.jsx(Ce,{className:"bg-[#0f2137] border-gray-700/50",children:t.jsx(ke,{className:"p-6",children:t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsxs("div",{children:[t.jsx("p",{className:"text-gray-400 text-sm",children:"今日点击"}),t.jsx("p",{className:"text-2xl font-bold text-white mt-1",children:c.todayClicks})]}),t.jsx("div",{className:"w-12 h-12 rounded-xl bg-blue-500/20 flex items-center justify-center",children:t.jsx(_d,{className:"w-6 h-6 text-blue-400"})})]})})}),t.jsx(Ce,{className:"bg-[#0f2137] border-gray-700/50",children:t.jsx(ke,{className:"p-6",children:t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsxs("div",{children:[t.jsx("p",{className:"text-gray-400 text-sm",children:"今日绑定"}),t.jsx("p",{className:"text-2xl font-bold text-white mt-1",children:c.todayBindings})]}),t.jsx("div",{className:"w-12 h-12 rounded-xl bg-green-500/20 flex items-center justify-center",children:t.jsx(Wr,{className:"w-6 h-6 text-green-400"})})]})})}),t.jsx(Ce,{className:"bg-[#0f2137] border-gray-700/50",children:t.jsx(ke,{className:"p-6",children:t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsxs("div",{children:[t.jsx("p",{className:"text-gray-400 text-sm",children:"今日转化"}),t.jsx("p",{className:"text-2xl font-bold text-white mt-1",children:c.todayConversions})]}),t.jsx("div",{className:"w-12 h-12 rounded-xl bg-purple-500/20 flex items-center justify-center",children:t.jsx(rd,{className:"w-6 h-6 text-purple-400"})})]})})}),t.jsx(Ce,{className:"bg-[#0f2137] border-gray-700/50",children:t.jsx(ke,{className:"p-6",children:t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsxs("div",{children:[t.jsx("p",{className:"text-gray-400 text-sm",children:"今日佣金"}),t.jsxs("p",{className:"text-2xl font-bold text-[#38bdac] mt-1",children:["¥",c.todayEarnings.toFixed(2)]})]}),t.jsx("div",{className:"w-12 h-12 rounded-xl bg-[#38bdac]/20 flex items-center justify-center",children:t.jsx(fi,{className:"w-6 h-6 text-[#38bdac]"})})]})})})]}),t.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[t.jsx(Ce,{className:"bg-orange-500/10 border-orange-500/30",children:t.jsx(ke,{className:"p-6",children:t.jsxs("div",{className:"flex items-center gap-4",children:[t.jsx("div",{className:"w-12 h-12 rounded-xl bg-orange-500/20 flex items-center justify-center",children:t.jsx(fp,{className:"w-6 h-6 text-orange-400"})}),t.jsxs("div",{className:"flex-1",children:[t.jsx("p",{className:"text-orange-300 font-medium",children:"即将过期绑定"}),t.jsxs("p",{className:"text-2xl font-bold text-white",children:[c.expiringBindings," 个"]}),t.jsx("p",{className:"text-orange-300/60 text-sm",children:"7天内到期,需关注转化"})]})]})})}),t.jsx(Ce,{className:"bg-blue-500/10 border-blue-500/30",children:t.jsx(ke,{className:"p-6",children:t.jsxs("div",{className:"flex items-center gap-4",children:[t.jsx("div",{className:"w-12 h-12 rounded-xl bg-blue-500/20 flex items-center justify-center",children:t.jsx(Is,{className:"w-6 h-6 text-blue-400"})}),t.jsxs("div",{className:"flex-1",children:[t.jsx("p",{className:"text-blue-300 font-medium",children:"待审核提现"}),t.jsxs("p",{className:"text-2xl font-bold text-white",children:[c.pendingWithdrawals," 笔"]}),t.jsxs("p",{className:"text-blue-300/60 text-sm",children:["共 ¥",c.pendingWithdrawAmount.toFixed(2)]})]}),t.jsx(de,{onClick:()=>a("withdrawals"),variant:"outline",className:"border-blue-500/50 text-blue-400 hover:bg-blue-500/20",children:"去审核"})]})})})]}),t.jsxs("div",{className:"grid grid-cols-2 gap-6",children:[t.jsxs(Ce,{className:"bg-[#0f2137] border-gray-700/50",children:[t.jsx(Be,{children:t.jsxs(Ve,{className:"text-white flex items-center gap-2",children:[t.jsx(Aa,{className:"w-5 h-5 text-[#38bdac]"}),"本月统计"]})}),t.jsx(ke,{children:t.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[t.jsxs("div",{className:"p-4 bg-white/5 rounded-lg",children:[t.jsx("p",{className:"text-gray-400 text-sm",children:"点击量"}),t.jsx("p",{className:"text-xl font-bold text-white",children:c.monthClicks})]}),t.jsxs("div",{className:"p-4 bg-white/5 rounded-lg",children:[t.jsx("p",{className:"text-gray-400 text-sm",children:"绑定数"}),t.jsx("p",{className:"text-xl font-bold text-white",children:c.monthBindings})]}),t.jsxs("div",{className:"p-4 bg-white/5 rounded-lg",children:[t.jsx("p",{className:"text-gray-400 text-sm",children:"转化数"}),t.jsx("p",{className:"text-xl font-bold text-white",children:c.monthConversions})]}),t.jsxs("div",{className:"p-4 bg-white/5 rounded-lg",children:[t.jsx("p",{className:"text-gray-400 text-sm",children:"佣金"}),t.jsxs("p",{className:"text-xl font-bold text-[#38bdac]",children:["¥",c.monthEarnings.toFixed(2)]})]})]})})]}),t.jsxs(Ce,{className:"bg-[#0f2137] border-gray-700/50",children:[t.jsx(Be,{children:t.jsxs(Ve,{className:"text-white flex items-center gap-2",children:[t.jsx(od,{className:"w-5 h-5 text-[#38bdac]"}),"累计统计"]})}),t.jsxs(ke,{children:[t.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[t.jsxs("div",{className:"p-4 bg-white/5 rounded-lg",children:[t.jsx("p",{className:"text-gray-400 text-sm",children:"总点击"}),t.jsx("p",{className:"text-xl font-bold text-white",children:c.totalClicks.toLocaleString()})]}),t.jsxs("div",{className:"p-4 bg-white/5 rounded-lg",children:[t.jsx("p",{className:"text-gray-400 text-sm",children:"总绑定"}),t.jsx("p",{className:"text-xl font-bold text-white",children:c.totalBindings.toLocaleString()})]}),t.jsxs("div",{className:"p-4 bg-white/5 rounded-lg",children:[t.jsx("p",{className:"text-gray-400 text-sm",children:"总转化"}),t.jsx("p",{className:"text-xl font-bold text-white",children:c.totalConversions})]}),t.jsxs("div",{className:"p-4 bg-white/5 rounded-lg",children:[t.jsx("p",{className:"text-gray-400 text-sm",children:"总佣金"}),t.jsxs("p",{className:"text-xl font-bold text-[#38bdac]",children:["¥",c.totalEarnings.toFixed(2)]})]})]}),t.jsxs("div",{className:"mt-4 p-4 bg-[#38bdac]/10 rounded-lg flex items-center justify-between",children:[t.jsx("span",{className:"text-gray-300",children:"点击转化率"}),t.jsxs("span",{className:"text-[#38bdac] font-bold text-xl",children:[c.conversionRate,"%"]})]})]})]})]}),t.jsxs(Ce,{className:"bg-[#0f2137] border-gray-700/50",children:[t.jsx(Be,{children:t.jsxs(Ve,{className:"text-white flex items-center gap-2",children:[t.jsx(xn,{className:"w-5 h-5 text-[#38bdac]"}),"推广统计"]})}),t.jsx(ke,{children:t.jsxs("div",{className:"grid grid-cols-4 gap-4",children:[t.jsxs("div",{className:"p-4 bg-white/5 rounded-lg text-center",children:[t.jsx("p",{className:"text-3xl font-bold text-white",children:c.totalDistributors}),t.jsx("p",{className:"text-gray-400 text-sm mt-1",children:"推广用户数"})]}),t.jsxs("div",{className:"p-4 bg-white/5 rounded-lg text-center",children:[t.jsx("p",{className:"text-3xl font-bold text-green-400",children:c.activeDistributors}),t.jsx("p",{className:"text-gray-400 text-sm mt-1",children:"有收益用户"})]}),t.jsxs("div",{className:"p-4 bg-white/5 rounded-lg text-center",children:[t.jsx("p",{className:"text-3xl font-bold text-[#38bdac]",children:"90%"}),t.jsx("p",{className:"text-gray-400 text-sm mt-1",children:"佣金比例"})]}),t.jsxs("div",{className:"p-4 bg-white/5 rounded-lg text-center",children:[t.jsx("p",{className:"text-3xl font-bold text-orange-400",children:"30天"}),t.jsx("p",{className:"text-gray-400 text-sm mt-1",children:"绑定有效期"})]})]})})]})]}),r==="orders"&&t.jsxs("div",{className:"space-y-4",children:[t.jsxs("div",{className:"flex gap-4",children:[t.jsxs("div",{className:"relative flex-1",children:[t.jsx(Hr,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-gray-400"}),t.jsx(ne,{value:b,onChange:I=>k(I.target.value),placeholder:"搜索订单号、用户名、手机号...",className:"pl-10 bg-[#0f2137] border-gray-700 text-white"})]}),t.jsxs("select",{value:R,onChange:I=>j(I.target.value),className:"px-4 py-2 bg-[#0f2137] border border-gray-700 rounded-lg text-white",children:[t.jsx("option",{value:"all",children:"全部状态"}),t.jsx("option",{value:"completed",children:"已完成"}),t.jsx("option",{value:"pending",children:"待支付"}),t.jsx("option",{value:"failed",children:"已失败"}),t.jsx("option",{value:"refunded",children:"已退款"})]})]}),t.jsx(Ce,{className:"bg-[#0f2137] border-gray-700/50",children:t.jsxs(ke,{className:"p-0",children:[l.length===0?t.jsx("div",{className:"py-12 text-center text-gray-500",children:"暂无订单数据"}):t.jsx("div",{className:"overflow-x-auto",children:t.jsxs("table",{className:"w-full text-sm",children:[t.jsx("thead",{children:t.jsxs("tr",{className:"bg-[#0a1628] text-gray-400",children:[t.jsx("th",{className:"p-4 text-left font-medium",children:"订单号"}),t.jsx("th",{className:"p-4 text-left font-medium",children:"用户"}),t.jsx("th",{className:"p-4 text-left font-medium",children:"商品"}),t.jsx("th",{className:"p-4 text-left font-medium",children:"金额"}),t.jsx("th",{className:"p-4 text-left font-medium",children:"支付方式"}),t.jsx("th",{className:"p-4 text-left font-medium",children:"状态"}),t.jsx("th",{className:"p-4 text-left font-medium",children:"退款原因"}),t.jsx("th",{className:"p-4 text-left font-medium",children:"推荐人/邀请码"}),t.jsx("th",{className:"p-4 text-left font-medium",children:"分销佣金"}),t.jsx("th",{className:"p-4 text-left font-medium",children:"下单时间"}),t.jsx("th",{className:"p-4 text-left font-medium",children:"操作"})]})}),t.jsx("tbody",{className:"divide-y divide-gray-700/50",children:me.map(I=>{var se,he;return t.jsxs("tr",{className:"hover:bg-[#0a1628] transition-colors",children:[t.jsxs("td",{className:"p-4 font-mono text-xs text-gray-400",children:[(se=I.id)==null?void 0:se.slice(0,12),"..."]}),t.jsx("td",{className:"p-4",children:t.jsxs("div",{children:[t.jsx("p",{className:"text-white text-sm",children:I.userNickname}),t.jsx("p",{className:"text-gray-500 text-xs",children:I.userPhone})]})}),t.jsx("td",{className:"p-4",children:t.jsxs("div",{children:[t.jsx("p",{className:"text-white text-sm",children:(()=>{const Pe=I.productType||I.type;return Pe==="fullbook"?`${I.bookName||"《底层逻辑》"} - 全本`:Pe==="match"?"匹配次数购买":`${I.bookName||"《底层逻辑》"} - ${I.sectionTitle||I.chapterTitle||`章节${I.productId||I.sectionId||""}`}`})()}),t.jsx("p",{className:"text-gray-500 text-xs",children:(()=>{const Pe=I.productType||I.type;return Pe==="fullbook"?"全书解锁":Pe==="match"?"功能权益":I.chapterTitle||"单章购买"})()})]})}),t.jsxs("td",{className:"p-4 text-[#38bdac] font-bold",children:["¥",typeof I.amount=="number"?I.amount.toFixed(2):parseFloat(String(I.amount||"0")).toFixed(2)]}),t.jsx("td",{className:"p-4 text-gray-300",children:I.paymentMethod==="wechat"?"微信支付":I.paymentMethod==="alipay"?"支付宝":I.paymentMethod||"微信支付"}),t.jsx("td",{className:"p-4",children:I.status==="refunded"?t.jsx(De,{className:"bg-gray-500/20 text-gray-400 border-0",children:"已退款"}):I.status==="completed"||I.status==="paid"?t.jsx(De,{className:"bg-green-500/20 text-green-400 border-0",children:"已完成"}):I.status==="pending"||I.status==="created"?t.jsx(De,{className:"bg-yellow-500/20 text-yellow-400 border-0",children:"待支付"}):t.jsx(De,{className:"bg-red-500/20 text-red-400 border-0",children:"已失败"})}),t.jsx("td",{className:"p-4 text-gray-400 text-sm max-w-[120px]",title:I.refundReason,children:I.status==="refunded"&&I.refundReason?I.refundReason:"-"}),t.jsx("td",{className:"p-4 text-gray-300 text-sm",children:I.referrerId||I.referralCode?t.jsxs("span",{title:I.referralCode||I.referrerCode||I.referrerId||"",children:[I.referrerNickname||I.referralCode||I.referrerCode||((he=I.referrerId)==null?void 0:he.slice(0,8)),(I.referralCode||I.referrerCode)&&` (${I.referralCode||I.referrerCode})`]}):"-"}),t.jsx("td",{className:"p-4 text-[#FFD700]",children:I.referrerEarnings?`¥${(typeof I.referrerEarnings=="number"?I.referrerEarnings:parseFloat(String(I.referrerEarnings))).toFixed(2)}`:"-"}),t.jsx("td",{className:"p-4 text-gray-400 text-sm",children:I.createdAt?new Date(I.createdAt).toLocaleString("zh-CN"):"-"}),t.jsx("td",{className:"p-4",children:(I.status==="paid"||I.status==="completed")&&t.jsxs(de,{variant:"outline",size:"sm",className:"border-orange-500/50 text-orange-400 hover:bg-orange-500/20",onClick:()=>{fe(I),W("")},children:[t.jsx(mp,{className:"w-3 h-3 mr-1"}),"退款"]})})]},I.id)})})]})}),r==="orders"&&t.jsx(Kr,{page:_,totalPages:Ne,total:V,pageSize:G,onPageChange:F,onPageSizeChange:I=>{M(I),F(1)}})]})})]}),r==="bindings"&&t.jsxs("div",{className:"space-y-4",children:[t.jsxs("div",{className:"flex gap-4",children:[t.jsxs("div",{className:"relative flex-1",children:[t.jsx(Hr,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-gray-400"}),t.jsx(ne,{value:b,onChange:I=>k(I.target.value),placeholder:"搜索用户昵称、手机号、推广码...",className:"pl-10 bg-[#0f2137] border-gray-700 text-white"})]}),t.jsxs("select",{value:R,onChange:I=>j(I.target.value),className:"px-4 py-2 bg-[#0f2137] border border-gray-700 rounded-lg text-white",children:[t.jsx("option",{value:"all",children:"全部状态"}),t.jsx("option",{value:"active",children:"有效"}),t.jsx("option",{value:"converted",children:"已转化"}),t.jsx("option",{value:"expired",children:"已过期"})]})]}),t.jsx(Ce,{className:"bg-[#0f2137] border-gray-700/50",children:t.jsxs(ke,{className:"p-0",children:[Q.length===0?t.jsx("div",{className:"py-12 text-center text-gray-500",children:"暂无绑定数据"}):t.jsx("div",{className:"overflow-x-auto",children:t.jsxs("table",{className:"w-full text-sm",children:[t.jsx("thead",{children:t.jsxs("tr",{className:"bg-[#0a1628] text-gray-400",children:[t.jsx("th",{className:"p-4 text-left font-medium",children:"访客"}),t.jsx("th",{className:"p-4 text-left font-medium",children:"分销商"}),t.jsx("th",{className:"p-4 text-left font-medium",children:"绑定时间"}),t.jsx("th",{className:"p-4 text-left font-medium",children:"到期时间"}),t.jsx("th",{className:"p-4 text-left font-medium",children:"状态"}),t.jsx("th",{className:"p-4 text-left font-medium",children:"佣金"})]})}),t.jsx("tbody",{className:"divide-y divide-gray-700/50",children:Q.map(I=>t.jsxs("tr",{className:"hover:bg-[#0a1628] transition-colors",children:[t.jsx("td",{className:"p-4",children:t.jsxs("div",{children:[t.jsx("p",{className:"text-white font-medium",children:I.refereeNickname||"匿名用户"}),t.jsx("p",{className:"text-gray-500 text-xs",children:I.refereePhone})]})}),t.jsx("td",{className:"p-4",children:t.jsxs("div",{children:[t.jsx("p",{className:"text-white",children:I.referrerName||"-"}),t.jsx("p",{className:"text-gray-500 text-xs font-mono",children:I.referrerCode})]})}),t.jsx("td",{className:"p-4 text-gray-400",children:I.boundAt?new Date(I.boundAt).toLocaleDateString("zh-CN"):"-"}),t.jsx("td",{className:"p-4 text-gray-400",children:I.expiresAt?new Date(I.expiresAt).toLocaleDateString("zh-CN"):"-"}),t.jsx("td",{className:"p-4",children:oe(I.status)}),t.jsx("td",{className:"p-4",children:I.commission?t.jsxs("span",{className:"text-[#38bdac] font-medium",children:["¥",I.commission.toFixed(2)]}):t.jsx("span",{className:"text-gray-500",children:"-"})})]},I.id))})]})}),r==="bindings"&&t.jsx(Kr,{page:_,totalPages:Ne,total:V,pageSize:G,onPageChange:F,onPageSizeChange:I=>{M(I),F(1)}})]})})]}),r==="withdrawals"&&t.jsxs("div",{className:"space-y-4",children:[t.jsxs("div",{className:"flex gap-4",children:[t.jsxs("div",{className:"relative flex-1",children:[t.jsx(Hr,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-gray-400"}),t.jsx(ne,{value:b,onChange:I=>k(I.target.value),placeholder:"搜索用户名称、账号...",className:"pl-10 bg-[#0f2137] border-gray-700 text-white"})]}),t.jsxs("select",{value:R,onChange:I=>j(I.target.value),className:"px-4 py-2 bg-[#0f2137] border border-gray-700 rounded-lg text-white",children:[t.jsx("option",{value:"all",children:"全部状态"}),t.jsx("option",{value:"pending",children:"待审核"}),t.jsx("option",{value:"completed",children:"已完成"}),t.jsx("option",{value:"rejected",children:"已拒绝"})]})]}),t.jsx(Ce,{className:"bg-[#0f2137] border-gray-700/50",children:t.jsxs(ke,{className:"p-0",children:[xe.length===0?t.jsx("div",{className:"py-12 text-center text-gray-500",children:"暂无提现记录"}):t.jsx("div",{className:"overflow-x-auto",children:t.jsxs("table",{className:"w-full text-sm",children:[t.jsx("thead",{children:t.jsxs("tr",{className:"bg-[#0a1628] text-gray-400",children:[t.jsx("th",{className:"p-4 text-left font-medium",children:"申请人"}),t.jsx("th",{className:"p-4 text-left font-medium",children:"金额"}),t.jsx("th",{className:"p-4 text-left font-medium",children:"收款方式"}),t.jsx("th",{className:"p-4 text-left font-medium",children:"收款账号"}),t.jsx("th",{className:"p-4 text-left font-medium",children:"申请时间"}),t.jsx("th",{className:"p-4 text-left font-medium",children:"状态"}),t.jsx("th",{className:"p-4 text-right font-medium",children:"操作"})]})}),t.jsx("tbody",{className:"divide-y divide-gray-700/50",children:xe.map(I=>t.jsxs("tr",{className:"hover:bg-[#0a1628] transition-colors",children:[t.jsx("td",{className:"p-4",children:t.jsxs("div",{className:"flex items-center gap-2",children:[I.userAvatar?t.jsx("img",{src:I.userAvatar,alt:"",className:"w-8 h-8 rounded-full object-cover"}):t.jsx("div",{className:"w-8 h-8 rounded-full bg-gray-600 flex items-center justify-center text-white text-sm font-medium",children:(I.userName||I.name||"?").slice(0,1)}),t.jsx("p",{className:"text-white font-medium",children:I.userName||I.name})]})}),t.jsx("td",{className:"p-4",children:t.jsxs("span",{className:"text-[#38bdac] font-bold",children:["¥",I.amount.toFixed(2)]})}),t.jsx("td",{className:"p-4",children:t.jsx(De,{className:I.method==="wechat"?"bg-green-500/20 text-green-400 border-0":"bg-blue-500/20 text-blue-400 border-0",children:I.method==="wechat"?"微信":"支付宝"})}),t.jsx("td",{className:"p-4",children:t.jsxs("div",{children:[t.jsx("p",{className:"text-white font-mono text-xs",children:I.account}),t.jsx("p",{className:"text-gray-500 text-xs",children:I.name})]})}),t.jsx("td",{className:"p-4 text-gray-400",children:I.createdAt?new Date(I.createdAt).toLocaleString("zh-CN"):"-"}),t.jsx("td",{className:"p-4",children:oe(I.status)}),t.jsx("td",{className:"p-4 text-right",children:I.status==="pending"&&t.jsxs("div",{className:"flex gap-2 justify-end",children:[t.jsxs(de,{size:"sm",onClick:()=>S(I.id),className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:[t.jsx(rd,{className:"w-4 h-4 mr-1"}),"通过"]}),t.jsxs(de,{size:"sm",variant:"outline",onClick:()=>D(I.id),className:"border-red-500/50 text-red-400 hover:bg-red-500/20",children:[t.jsx(kj,{className:"w-4 h-4 mr-1"}),"拒绝"]})]})})]},I.id))})]})}),r==="withdrawals"&&t.jsx(Kr,{page:_,totalPages:Ne,total:V,pageSize:G,onPageChange:F,onPageSizeChange:I=>{M(I),F(1)}})]})})]})]}),t.jsx(Kt,{open:!!ie,onOpenChange:I=>!I&&fe(null),children:t.jsxs($t,{className:"bg-[#0f2137] border-gray-700 text-white max-w-md",children:[t.jsx(Gt,{children:t.jsx(Yt,{className:"text-white",children:"订单退款"})}),ie&&t.jsxs("div",{className:"space-y-4",children:[t.jsxs("p",{className:"text-gray-400 text-sm",children:["订单号:",ie.orderSn||ie.id]}),t.jsxs("p",{className:"text-gray-400 text-sm",children:["退款金额:¥",typeof ie.amount=="number"?ie.amount.toFixed(2):parseFloat(String(ie.amount||"0")).toFixed(2)]}),t.jsxs("div",{children:[t.jsx("label",{className:"text-sm text-gray-400 block mb-2",children:"退款原因(选填)"}),t.jsx("div",{className:"form-input",children:t.jsx(ne,{className:"bg-[#0a1628] border-gray-700 text-white placeholder:text-gray-500",placeholder:"如:用户申请退款",value:H,onChange:I=>W(I.target.value)})})]}),t.jsx("p",{className:"text-orange-400/80 text-xs",children:"退款将原路退回至用户微信,且无法撤销,请确认后再操作。"})]}),t.jsxs(sn,{children:[t.jsx(de,{variant:"outline",className:"border-gray-600 text-gray-300",onClick:()=>fe(null),disabled:Y,children:"取消"}),t.jsx(de,{className:"bg-orange-500 hover:bg-orange-600 text-white",onClick:ae,disabled:Y,children:Y?"退款中...":"确认退款"})]})]})})]})}function d2(){const[r,a]=p.useState([]),[l,o]=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,g]=p.useState("all"),[v,y]=p.useState(1),[E,P]=p.useState(10),[C,N]=p.useState(0),[b,k]=p.useState(null);async function R(){var M,V,te,ue,ce,ie,fe;u(!0),m(null);try{const H=new URLSearchParams({status:x,page:String(v),pageSize:String(E)}),W=await He(`/api/admin/withdrawals?${H}`);if(W!=null&&W.success){const Y=W.withdrawals||[];a(Y),N(W.total??((M=W.stats)==null?void 0:M.total)??Y.length),o({total:((V=W.stats)==null?void 0:V.total)??W.total??Y.length,pendingCount:((te=W.stats)==null?void 0:te.pendingCount)??0,pendingAmount:((ue=W.stats)==null?void 0:ue.pendingAmount)??0,successCount:((ce=W.stats)==null?void 0:ce.successCount)??0,successAmount:((ie=W.stats)==null?void 0:ie.successAmount)??0,failedCount:((fe=W.stats)==null?void 0:fe.failedCount)??0})}else m("加载提现记录失败")}catch(H){console.error("Load withdrawals error:",H),m("加载失败,请检查网络后重试")}finally{u(!1)}}p.useEffect(()=>{y(1)},[x]),p.useEffect(()=>{R()},[x,v,E]);const j=Math.ceil(C/E)||1;async function _(M){const V=r.find(te=>te.id===M);if(V!=null&&V.userCommissionInfo&&V.userCommissionInfo.availableAfterThis<0){if(!confirm(`⚠️ 风险警告:该用户审核后余额为负数(¥${V.userCommissionInfo.availableAfterThis.toFixed(2)}),可能存在超额提现。 - -确认已核实用户账户并完成打款?`))return}else if(!confirm("确认已完成打款?批准后将更新用户提现记录。"))return;k(M);try{const te=await zt("/api/admin/withdrawals",{id:M,action:"approve"});te!=null&&te.success?R():alert("操作失败: "+((te==null?void 0:te.error)??""))}catch{alert("操作失败")}finally{k(null)}}async function F(M){const V=prompt("请输入拒绝原因(将返还用户余额):");if(V){k(M);try{const te=await zt("/api/admin/withdrawals",{id:M,action:"reject",errorMessage:V});te!=null&&te.success?R():alert("操作失败: "+((te==null?void 0:te.error)??""))}catch{alert("操作失败")}finally{k(null)}}}function G(M){switch(M){case"pending":return t.jsx(De,{className:"bg-orange-500/20 text-orange-400 hover:bg-orange-500/20 border-0",children:"待处理"});case"pending_confirm":return t.jsx(De,{className:"bg-orange-500/20 text-orange-400 hover:bg-orange-500/20 border-0",children:"待用户确认"});case"processing":return t.jsx(De,{className:"bg-blue-500/20 text-blue-400 hover:bg-blue-500/20 border-0",children:"已审批等待打款"});case"success":case"completed":return t.jsx(De,{className:"bg-green-500/20 text-green-400 hover:bg-green-500/20 border-0",children:"已完成"});case"failed":case"rejected":return t.jsx(De,{className:"bg-red-500/20 text-red-400 hover:bg-red-500/20 border-0",children:"已拒绝"});default:return t.jsx(De,{className:"bg-gray-500/20 text-gray-400 border-0",children:M})}}return t.jsxs("div",{className:"p-8 w-full",children:[f&&t.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:[t.jsx("span",{children:f}),t.jsx("button",{type:"button",onClick:()=>m(null),className:"hover:text-red-300",children:"×"})]}),t.jsxs("div",{className:"flex justify-between items-start mb-8",children:[t.jsxs("div",{children:[t.jsx("h1",{className:"text-2xl font-bold text-white",children:"分账提现管理"}),t.jsx("p",{className:"text-gray-400 mt-1",children:"管理用户分销收益的提现申请"})]}),t.jsxs(de,{variant:"outline",onClick:R,disabled:c,className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:[t.jsx(tt,{className:`w-4 h-4 mr-2 ${c?"animate-spin":""}`}),"刷新"]})]}),t.jsx(Ce,{className:"bg-gradient-to-r from-[#38bdac]/10 to-[#0f2137] border-[#38bdac]/30 mb-6",children:t.jsx(ke,{className:"p-4",children:t.jsxs("div",{className:"flex items-start gap-3",children:[t.jsx(fi,{className:"w-5 h-5 text-[#38bdac] mt-0.5"}),t.jsxs("div",{children:[t.jsx("h3",{className:"text-white font-medium mb-2",children:"自动分账规则"}),t.jsxs("div",{className:"text-sm text-gray-400 space-y-1",children:[t.jsxs("p",{children:["• ",t.jsx("span",{className:"text-[#38bdac]",children:"分销比例"}),":推广者获得订单金额的"," ",t.jsx("span",{className:"text-white font-medium",children:"90%"})]}),t.jsxs("p",{children:["• ",t.jsx("span",{className:"text-[#38bdac]",children:"结算方式"}),":用户付款后,分销收益自动计入推广者账户"]}),t.jsxs("p",{children:["• ",t.jsx("span",{className:"text-[#38bdac]",children:"提现方式"}),":用户在小程序端点击提现,系统自动转账到微信零钱"]}),t.jsxs("p",{children:["• ",t.jsx("span",{className:"text-[#38bdac]",children:"审批流程"}),":待处理的提现需管理员手动确认打款后批准"]})]})]})]})})}),t.jsxs("div",{className:"grid grid-cols-4 gap-4 mb-6",children:[t.jsx(Ce,{className:"bg-[#0f2137] border-gray-700/50",children:t.jsxs(ke,{className:"p-4 text-center",children:[t.jsx("div",{className:"text-3xl font-bold text-[#38bdac]",children:l.total}),t.jsx("div",{className:"text-sm text-gray-400",children:"总申请"})]})}),t.jsx(Ce,{className:"bg-[#0f2137] border-gray-700/50",children:t.jsxs(ke,{className:"p-4 text-center",children:[t.jsx("div",{className:"text-3xl font-bold text-orange-400",children:l.pendingCount}),t.jsx("div",{className:"text-sm text-gray-400",children:"待处理"}),t.jsxs("div",{className:"text-xs text-orange-400 mt-1",children:["¥",l.pendingAmount.toFixed(2)]})]})}),t.jsx(Ce,{className:"bg-[#0f2137] border-gray-700/50",children:t.jsxs(ke,{className:"p-4 text-center",children:[t.jsx("div",{className:"text-3xl font-bold text-green-400",children:l.successCount}),t.jsx("div",{className:"text-sm text-gray-400",children:"已完成"}),t.jsxs("div",{className:"text-xs text-green-400 mt-1",children:["¥",l.successAmount.toFixed(2)]})]})}),t.jsx(Ce,{className:"bg-[#0f2137] border-gray-700/50",children:t.jsxs(ke,{className:"p-4 text-center",children:[t.jsx("div",{className:"text-3xl font-bold text-red-400",children:l.failedCount}),t.jsx("div",{className:"text-sm text-gray-400",children:"已拒绝"})]})})]}),t.jsx("div",{className:"flex gap-2 mb-4",children:["all","pending","success","failed"].map(M=>t.jsx(de,{variant:x===M?"default":"outline",size:"sm",onClick:()=>g(M),className:x===M?"bg-[#38bdac] hover:bg-[#2da396] text-white":"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:M==="all"?"全部":M==="pending"?"待处理":M==="success"?"已完成":"已拒绝"},M))}),t.jsx(Ce,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:t.jsx(ke,{className:"p-0",children:c?t.jsxs("div",{className:"flex items-center justify-center py-12",children:[t.jsx(tt,{className:"w-6 h-6 text-[#38bdac] animate-spin"}),t.jsx("span",{className:"ml-2 text-gray-400",children:"加载中..."})]}):r.length===0?t.jsxs("div",{className:"text-center py-12",children:[t.jsx(Is,{className:"w-12 h-12 text-gray-600 mx-auto mb-3"}),t.jsx("p",{className:"text-gray-500",children:"暂无提现记录"})]}):t.jsxs(t.Fragment,{children:[t.jsx("div",{className:"overflow-x-auto",children:t.jsxs("table",{className:"w-full text-sm",children:[t.jsx("thead",{children:t.jsxs("tr",{className:"bg-[#0a1628] text-gray-400",children:[t.jsx("th",{className:"p-4 text-left font-medium",children:"申请时间"}),t.jsx("th",{className:"p-4 text-left font-medium",children:"用户"}),t.jsx("th",{className:"p-4 text-left font-medium",children:"提现金额"}),t.jsx("th",{className:"p-4 text-left font-medium",children:"用户佣金信息"}),t.jsx("th",{className:"p-4 text-left font-medium",children:"状态"}),t.jsx("th",{className:"p-4 text-left font-medium",children:"处理时间"}),t.jsx("th",{className:"p-4 text-left font-medium",children:"确认收款"}),t.jsx("th",{className:"p-4 text-right font-medium",children:"操作"})]})}),t.jsx("tbody",{className:"divide-y divide-gray-700/50",children:r.map(M=>t.jsxs("tr",{className:"hover:bg-[#0a1628] transition-colors",children:[t.jsx("td",{className:"p-4 text-gray-400",children:new Date(M.createdAt??"").toLocaleString()}),t.jsx("td",{className:"p-4",children:t.jsxs("div",{className:"flex items-center gap-2",children:[M.userAvatar?t.jsx("img",{src:M.userAvatar,alt:M.userName??"",className:"w-8 h-8 rounded-full object-cover"}):t.jsx("div",{className:"w-8 h-8 rounded-full bg-[#38bdac]/20 flex items-center justify-center text-sm text-[#38bdac]",children:(M.userName??"?").charAt(0)}),t.jsxs("div",{children:[t.jsx("p",{className:"font-medium text-white",children:M.userName??"未知"}),t.jsx("p",{className:"text-xs text-gray-500",children:M.userPhone??M.referralCode??(M.userId??"").slice(0,10)})]})]})}),t.jsx("td",{className:"p-4",children:t.jsxs("span",{className:"font-bold text-orange-400",children:["¥",Number(M.amount).toFixed(2)]})}),t.jsx("td",{className:"p-4",children:M.userCommissionInfo?t.jsxs("div",{className:"text-xs space-y-1",children:[t.jsxs("div",{className:"flex justify-between gap-4",children:[t.jsx("span",{className:"text-gray-500",children:"累计佣金:"}),t.jsxs("span",{className:"text-[#38bdac] font-medium",children:["¥",M.userCommissionInfo.totalCommission.toFixed(2)]})]}),t.jsxs("div",{className:"flex justify-between gap-4",children:[t.jsx("span",{className:"text-gray-500",children:"已提现:"}),t.jsxs("span",{className:"text-gray-400",children:["¥",M.userCommissionInfo.withdrawnEarnings.toFixed(2)]})]}),t.jsxs("div",{className:"flex justify-between gap-4",children:[t.jsx("span",{className:"text-gray-500",children:"待审核:"}),t.jsxs("span",{className:"text-orange-400",children:["¥",M.userCommissionInfo.pendingWithdrawals.toFixed(2)]})]}),t.jsxs("div",{className:"flex justify-between gap-4 pt-1 border-t border-gray-700/30",children:[t.jsx("span",{className:"text-gray-500",children:"审核后余额:"}),t.jsxs("span",{className:M.userCommissionInfo.availableAfterThis>=0?"text-green-400 font-medium":"text-red-400 font-medium",children:["¥",M.userCommissionInfo.availableAfterThis.toFixed(2)]})]})]}):t.jsx("span",{className:"text-gray-500 text-xs",children:"暂无数据"})}),t.jsxs("td",{className:"p-4",children:[G(M.status),M.errorMessage&&t.jsx("p",{className:"text-xs text-red-400 mt-1",children:M.errorMessage})]}),t.jsx("td",{className:"p-4 text-gray-400",children:M.processedAt?new Date(M.processedAt).toLocaleString():"-"}),t.jsx("td",{className:"p-4 text-gray-400",children:M.userConfirmedAt?t.jsxs("span",{className:"text-green-400",title:M.userConfirmedAt,children:["已确认 ",new Date(M.userConfirmedAt).toLocaleString()]}):"-"}),t.jsxs("td",{className:"p-4 text-right",children:[(M.status==="pending"||M.status==="pending_confirm")&&t.jsxs("div",{className:"flex items-center justify-end gap-2",children:[t.jsxs(de,{size:"sm",onClick:()=>_(M.id),disabled:b===M.id,className:"bg-green-600 hover:bg-green-700 text-white",children:[t.jsx(ki,{className:"w-4 h-4 mr-1"}),"批准"]}),t.jsxs(de,{size:"sm",variant:"outline",onClick:()=>F(M.id),disabled:b===M.id,className:"border-red-500/50 text-red-400 hover:bg-red-500/10 bg-transparent",children:[t.jsx(Pn,{className:"w-4 h-4 mr-1"}),"拒绝"]})]}),(M.status==="success"||M.status==="completed")&&M.transactionId&&t.jsx("span",{className:"text-xs text-gray-500 font-mono",children:M.transactionId})]})]},M.id))})]})}),t.jsx(Kr,{page:v,totalPages:j,total:C,pageSize:E,onPageChange:y,onPageSizeChange:M=>{P(M),y(1)}})]})})})]})}const Rs=p.forwardRef(({className:r,...a},l)=>t.jsx("textarea",{className:Ge("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}));Rs.displayName="Textarea";function vi(r,[a,l]){return Math.min(l,Math.max(a,r))}const u2=["top","right","bottom","left"],yr=Math.min,Ht=Math.max,yi=Math.round,si=Math.floor,En=r=>({x:r,y:r}),f2={left:"right",right:"left",bottom:"top",top:"bottom"},h2={start:"end",end:"start"};function hd(r,a,l){return Ht(r,yr(a,l))}function $n(r,a){return typeof r=="function"?r(a):r}function Bn(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 m2=new Set(["top","bottom"]);function kn(r){return m2.has(Bn(r))?"y":"x"}function Yd(r){return Kd(kn(r))}function p2(r,a,l){l===void 0&&(l=!1);const o=Fs(r),c=Yd(r),u=Gd(c);let f=c==="x"?o===(l?"end":"start")?"right":"left":o==="start"?"bottom":"top";return a.reference[u]>a.floating[u]&&(f=ji(f)),[f,ji(f)]}function x2(r){const a=ji(r);return[md(r),a,md(a)]}function md(r){return r.replace(/start|end/g,a=>h2[a])}const Dm=["left","right"],Om=["right","left"],g2=["top","bottom"],v2=["bottom","top"];function y2(r,a,l){switch(r){case"top":case"bottom":return l?a?Om:Dm:a?Dm:Om;case"left":case"right":return a?g2:v2;default:return[]}}function j2(r,a,l,o){const c=Fs(r);let u=y2(Bn(r),l==="start",o);return c&&(u=u.map(f=>f+"-"+c),a&&(u=u.concat(u.map(md)))),u}function ji(r){return r.replace(/left|right|bottom|top/g,a=>f2[a])}function w2(r){return{top:0,right:0,bottom:0,left:0,...r}}function Ox(r){return typeof r!="number"?w2(r):{top:r,right:r,bottom:r,left:r}}function wi(r){const{x:a,y:l,width:o,height:c}=r;return{width:o,height:c,top:l,left:a,right:a+o,bottom:l+c,x:a,y:l}}function Fm(r,a,l){let{reference:o,floating:c}=r;const u=kn(a),f=Yd(a),m=Gd(f),x=Bn(a),g=u==="y",v=o.x+o.width/2-c.width/2,y=o.y+o.height/2-c.height/2,E=o[m]/2-c[m]/2;let P;switch(x){case"top":P={x:v,y:o.y-c.height};break;case"bottom":P={x:v,y:o.y+o.height};break;case"right":P={x:o.x+o.width,y};break;case"left":P={x:o.x-c.width,y};break;default:P={x:o.x,y:o.y}}switch(Fs(a)){case"start":P[f]-=E*(l&&g?-1:1);break;case"end":P[f]+=E*(l&&g?-1:1);break}return P}async function N2(r,a){var l;a===void 0&&(a={});const{x:o,y:c,platform:u,rects:f,elements:m,strategy:x}=r,{boundary:g="clippingAncestors",rootBoundary:v="viewport",elementContext:y="floating",altBoundary:E=!1,padding:P=0}=$n(a,r),C=Ox(P),b=m[E?y==="floating"?"reference":"floating":y],k=wi(await u.getClippingRect({element:(l=await(u.isElement==null?void 0:u.isElement(b)))==null||l?b:b.contextElement||await(u.getDocumentElement==null?void 0:u.getDocumentElement(m.floating)),boundary:g,rootBoundary:v,strategy:x})),R=y==="floating"?{x:o,y:c,width:f.floating.width,height:f.floating.height}:f.reference,j=await(u.getOffsetParent==null?void 0:u.getOffsetParent(m.floating)),_=await(u.isElement==null?void 0:u.isElement(j))?await(u.getScale==null?void 0:u.getScale(j))||{x:1,y:1}:{x:1,y:1},F=wi(u.convertOffsetParentRelativeRectToViewportRelativeRect?await u.convertOffsetParentRelativeRectToViewportRelativeRect({elements:m,rect:R,offsetParent:j,strategy:x}):R);return{top:(k.top-F.top+C.top)/_.y,bottom:(F.bottom-k.bottom+C.bottom)/_.y,left:(k.left-F.left+C.left)/_.x,right:(F.right-k.right+C.right)/_.x}}const b2=async(r,a,l)=>{const{placement:o="bottom",strategy:c="absolute",middleware:u=[],platform:f}=l,m=u.filter(Boolean),x=await(f.isRTL==null?void 0:f.isRTL(a));let g=await f.getElementRects({reference:r,floating:a,strategy:c}),{x:v,y}=Fm(g,o,x),E=o,P={},C=0;for(let b=0;b({name:"arrow",options:r,async fn(a){const{x:l,y:o,placement:c,rects:u,platform:f,elements:m,middlewareData:x}=a,{element:g,padding:v=0}=$n(r,a)||{};if(g==null)return{};const y=Ox(v),E={x:l,y:o},P=Yd(c),C=Gd(P),N=await f.getDimensions(g),b=P==="y",k=b?"top":"left",R=b?"bottom":"right",j=b?"clientHeight":"clientWidth",_=u.reference[C]+u.reference[P]-E[P]-u.floating[C],F=E[P]-u.reference[P],G=await(f.getOffsetParent==null?void 0:f.getOffsetParent(g));let M=G?G[j]:0;(!M||!await(f.isElement==null?void 0:f.isElement(G)))&&(M=m.floating[j]||u.floating[C]);const V=_/2-F/2,te=M/2-N[C]/2-1,ue=yr(y[k],te),ce=yr(y[R],te),ie=ue,fe=M-N[C]-ce,H=M/2-N[C]/2+V,W=hd(ie,H,fe),Y=!x.arrow&&Fs(c)!=null&&H!==W&&u.reference[C]/2-(HH<=0)){var ce,ie;const H=(((ce=u.flip)==null?void 0:ce.index)||0)+1,W=M[H];if(W&&(!(y==="alignment"?R!==kn(W):!1)||ue.every(A=>kn(A.placement)===R?A.overflows[0]>0:!0)))return{data:{index:H,overflows:ue},reset:{placement:W}};let Y=(ie=ue.filter(K=>K.overflows[0]<=0).sort((K,A)=>K.overflows[1]-A.overflows[1])[0])==null?void 0:ie.placement;if(!Y)switch(P){case"bestFit":{var fe;const K=(fe=ue.filter(A=>{if(G){const J=kn(A.placement);return J===R||J==="y"}return!0}).map(A=>[A.placement,A.overflows.filter(J=>J>0).reduce((J,B)=>J+B,0)]).sort((A,J)=>A[1]-J[1])[0])==null?void 0:fe[0];K&&(Y=K);break}case"initialPlacement":Y=m;break}if(c!==Y)return{reset:{placement:Y}}}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 u2.some(a=>r[a]>=0)}const k2=function(r){return r===void 0&&(r={}),{name:"hide",options:r,async fn(a){const{rects:l,platform:o}=a,{strategy:c="referenceHidden",...u}=$n(r,a);switch(c){case"referenceHidden":{const f=await o.detectOverflow(a,{...u,elementContext:"reference"}),m=zm(f,l.reference);return{data:{referenceHiddenOffsets:m,referenceHidden:$m(m)}}}case"escaped":{const f=await o.detectOverflow(a,{...u,altBoundary:!0}),m=zm(f,l.floating);return{data:{escapedOffsets:m,escaped:$m(m)}}}default:return{}}}}},Fx=new Set(["left","top"]);async function E2(r,a){const{placement:l,platform:o,elements:c}=r,u=await(o.isRTL==null?void 0:o.isRTL(c.floating)),f=Bn(l),m=Fs(l),x=kn(l)==="y",g=Fx.has(f)?-1:1,v=u&&x?-1:1,y=$n(a,r);let{mainAxis:E,crossAxis:P,alignmentAxis:C}=typeof y=="number"?{mainAxis:y,crossAxis:0,alignmentAxis:null}:{mainAxis:y.mainAxis||0,crossAxis:y.crossAxis||0,alignmentAxis:y.alignmentAxis};return m&&typeof C=="number"&&(P=m==="end"?C*-1:C),x?{x:P*v,y:E*g}:{x:E*g,y:P*v}}const P2=function(r){return r===void 0&&(r=0),{name:"offset",options:r,async fn(a){var l,o;const{x:c,y:u,placement:f,middlewareData:m}=a,x=await E2(a,r);return f===((l=m.offset)==null?void 0:l.placement)&&(o=m.arrow)!=null&&o.alignmentOffset?{}:{x:c+x.x,y:u+x.y,data:{...x,placement:f}}}}},R2=function(r){return r===void 0&&(r={}),{name:"shift",options:r,async fn(a){const{x:l,y:o,placement:c,platform:u}=a,{mainAxis:f=!0,crossAxis:m=!1,limiter:x={fn:k=>{let{x:R,y:j}=k;return{x:R,y:j}}},...g}=$n(r,a),v={x:l,y:o},y=await u.detectOverflow(a,g),E=kn(Bn(c)),P=Kd(E);let C=v[P],N=v[E];if(f){const k=P==="y"?"top":"left",R=P==="y"?"bottom":"right",j=C+y[k],_=C-y[R];C=hd(j,C,_)}if(m){const k=E==="y"?"top":"left",R=E==="y"?"bottom":"right",j=N+y[k],_=N-y[R];N=hd(j,N,_)}const b=x.fn({...a,[P]:C,[E]:N});return{...b,data:{x:b.x-l,y:b.y-o,enabled:{[P]:f,[E]:m}}}}}},_2=function(r){return r===void 0&&(r={}),{options:r,fn(a){const{x:l,y:o,placement:c,rects:u,middlewareData:f}=a,{offset:m=0,mainAxis:x=!0,crossAxis:g=!0}=$n(r,a),v={x:l,y:o},y=kn(c),E=Kd(y);let P=v[E],C=v[y];const N=$n(m,a),b=typeof N=="number"?{mainAxis:N,crossAxis:0}:{mainAxis:0,crossAxis:0,...N};if(x){const j=E==="y"?"height":"width",_=u.reference[E]-u.floating[j]+b.mainAxis,F=u.reference[E]+u.reference[j]-b.mainAxis;P<_?P=_:P>F&&(P=F)}if(g){var k,R;const j=E==="y"?"width":"height",_=Fx.has(Bn(c)),F=u.reference[y]-u.floating[j]+(_&&((k=f.offset)==null?void 0:k[y])||0)+(_?0:b.crossAxis),G=u.reference[y]+u.reference[j]+(_?0:((R=f.offset)==null?void 0:R[y])||0)-(_?b.crossAxis:0);CG&&(C=G)}return{[E]:P,[y]:C}}}},T2=function(r){return r===void 0&&(r={}),{name:"size",options:r,async fn(a){var l,o;const{placement:c,rects:u,platform:f,elements:m}=a,{apply:x=()=>{},...g}=$n(r,a),v=await f.detectOverflow(a,g),y=Bn(c),E=Fs(c),P=kn(c)==="y",{width:C,height:N}=u.floating;let b,k;y==="top"||y==="bottom"?(b=y,k=E===(await(f.isRTL==null?void 0:f.isRTL(m.floating))?"start":"end")?"left":"right"):(k=y,b=E==="end"?"top":"bottom");const R=N-v.top-v.bottom,j=C-v.left-v.right,_=yr(N-v[b],R),F=yr(C-v[k],j),G=!a.middlewareData.shift;let M=_,V=F;if((l=a.middlewareData.shift)!=null&&l.enabled.x&&(V=j),(o=a.middlewareData.shift)!=null&&o.enabled.y&&(M=R),G&&!E){const ue=Ht(v.left,0),ce=Ht(v.right,0),ie=Ht(v.top,0),fe=Ht(v.bottom,0);P?V=C-2*(ue!==0||ce!==0?ue+ce:Ht(v.left,v.right)):M=N-2*(ie!==0||fe!==0?ie+fe:Ht(v.top,v.bottom))}await x({...a,availableWidth:V,availableHeight:M});const te=await f.getDimensions(m.floating);return C!==te.width||N!==te.height?{reset:{rects:!0}}:{}}}};function Di(){return typeof window<"u"}function zs(r){return zx(r)?(r.nodeName||"").toLowerCase():"#document"}function Qt(r){var a;return(r==null||(a=r.ownerDocument)==null?void 0:a.defaultView)||window}function _n(r){var a;return(a=(zx(r)?r.ownerDocument:r.document)||window.document)==null?void 0:a.documentElement}function zx(r){return Di()?r instanceof Node||r instanceof Qt(r).Node:!1}function gn(r){return Di()?r instanceof Element||r instanceof Qt(r).Element:!1}function Rn(r){return Di()?r instanceof HTMLElement||r instanceof Qt(r).HTMLElement:!1}function Bm(r){return!Di()||typeof ShadowRoot>"u"?!1:r instanceof ShadowRoot||r instanceof Qt(r).ShadowRoot}const I2=new Set(["inline","contents"]);function Ba(r){const{overflow:a,overflowX:l,overflowY:o,display:c}=vn(r);return/auto|scroll|overlay|hidden|clip/.test(a+o+l)&&!I2.has(c)}const A2=new Set(["table","td","th"]);function M2(r){return A2.has(zs(r))}const L2=[":popover-open",":modal"];function Oi(r){return L2.some(a=>{try{return r.matches(a)}catch{return!1}})}const D2=["transform","translate","scale","rotate","perspective"],O2=["transform","translate","scale","rotate","perspective","filter"],F2=["paint","layout","strict","content"];function Qd(r){const a=qd(),l=gn(r)?vn(r):r;return D2.some(o=>l[o]?l[o]!=="none":!1)||(l.containerType?l.containerType!=="normal":!1)||!a&&(l.backdropFilter?l.backdropFilter!=="none":!1)||!a&&(l.filter?l.filter!=="none":!1)||O2.some(o=>(l.willChange||"").includes(o))||F2.some(o=>(l.contain||"").includes(o))}function z2(r){let a=jr(r);for(;Rn(a)&&!As(a);){if(Qd(a))return a;if(Oi(a))return null;a=jr(a)}return null}function qd(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const $2=new Set(["html","body","#document"]);function As(r){return $2.has(zs(r))}function vn(r){return Qt(r).getComputedStyle(r)}function Fi(r){return gn(r)?{scrollLeft:r.scrollLeft,scrollTop:r.scrollTop}:{scrollLeft:r.scrollX,scrollTop:r.scrollY}}function jr(r){if(zs(r)==="html")return r;const a=r.assignedSlot||r.parentNode||Bm(r)&&r.host||_n(r);return Bm(a)?a.host:a}function $x(r){const a=jr(r);return As(a)?r.ownerDocument?r.ownerDocument.body:r.body:Rn(a)&&Ba(a)?a:$x(a)}function La(r,a,l){var o;a===void 0&&(a=[]),l===void 0&&(l=!0);const c=$x(r),u=c===((o=r.ownerDocument)==null?void 0:o.body),f=Qt(c);if(u){const m=pd(f);return a.concat(f,f.visualViewport||[],Ba(c)?c:[],m&&l?La(m):[])}return a.concat(c,La(c,[],l))}function pd(r){return r.parent&&Object.getPrototypeOf(r.parent)?r.frameElement:null}function Bx(r){const a=vn(r);let l=parseFloat(a.width)||0,o=parseFloat(a.height)||0;const c=Rn(r),u=c?r.offsetWidth:l,f=c?r.offsetHeight:o,m=yi(l)!==u||yi(o)!==f;return m&&(l=u,o=f),{width:l,height:o,$:m}}function Xd(r){return gn(r)?r:r.contextElement}function _s(r){const a=Xd(r);if(!Rn(a))return En(1);const l=a.getBoundingClientRect(),{width:o,height:c,$:u}=Bx(a);let f=(u?yi(l.width):l.width)/o,m=(u?yi(l.height):l.height)/c;return(!f||!Number.isFinite(f))&&(f=1),(!m||!Number.isFinite(m))&&(m=1),{x:f,y:m}}const B2=En(0);function Vx(r){const a=Qt(r);return!qd()||!a.visualViewport?B2:{x:a.visualViewport.offsetLeft,y:a.visualViewport.offsetTop}}function V2(r,a,l){return a===void 0&&(a=!1),!l||a&&l!==Qt(r)?!1:a}function Qr(r,a,l,o){a===void 0&&(a=!1),l===void 0&&(l=!1);const c=r.getBoundingClientRect(),u=Xd(r);let f=En(1);a&&(o?gn(o)&&(f=_s(o)):f=_s(r));const m=V2(u,l,o)?Vx(u):En(0);let x=(c.left+m.x)/f.x,g=(c.top+m.y)/f.y,v=c.width/f.x,y=c.height/f.y;if(u){const E=Qt(u),P=o&&gn(o)?Qt(o):o;let C=E,N=pd(C);for(;N&&o&&P!==C;){const b=_s(N),k=N.getBoundingClientRect(),R=vn(N),j=k.left+(N.clientLeft+parseFloat(R.paddingLeft))*b.x,_=k.top+(N.clientTop+parseFloat(R.paddingTop))*b.y;x*=b.x,g*=b.y,v*=b.x,y*=b.y,x+=j,g+=_,C=Qt(N),N=pd(C)}}return wi({width:v,height:y,x,y:g})}function zi(r,a){const l=Fi(r).scrollLeft;return a?a.left+l:Qr(_n(r)).left+l}function Ux(r,a){const l=r.getBoundingClientRect(),o=l.left+a.scrollLeft-zi(r,l),c=l.top+a.scrollTop;return{x:o,y:c}}function U2(r){let{elements:a,rect:l,offsetParent:o,strategy:c}=r;const u=c==="fixed",f=_n(o),m=a?Oi(a.floating):!1;if(o===f||m&&u)return l;let x={scrollLeft:0,scrollTop:0},g=En(1);const v=En(0),y=Rn(o);if((y||!y&&!u)&&((zs(o)!=="body"||Ba(f))&&(x=Fi(o)),Rn(o))){const P=Qr(o);g=_s(o),v.x=P.x+o.clientLeft,v.y=P.y+o.clientTop}const E=f&&!y&&!u?Ux(f,x):En(0);return{width:l.width*g.x,height:l.height*g.y,x:l.x*g.x-x.scrollLeft*g.x+v.x+E.x,y:l.y*g.y-x.scrollTop*g.y+v.y+E.y}}function W2(r){return Array.from(r.getClientRects())}function H2(r){const a=_n(r),l=Fi(r),o=r.ownerDocument.body,c=Ht(a.scrollWidth,a.clientWidth,o.scrollWidth,o.clientWidth),u=Ht(a.scrollHeight,a.clientHeight,o.scrollHeight,o.clientHeight);let f=-l.scrollLeft+zi(r);const m=-l.scrollTop;return vn(o).direction==="rtl"&&(f+=Ht(a.clientWidth,o.clientWidth)-c),{width:c,height:u,x:f,y:m}}const Vm=25;function K2(r,a){const l=Qt(r),o=_n(r),c=l.visualViewport;let u=o.clientWidth,f=o.clientHeight,m=0,x=0;if(c){u=c.width,f=c.height;const v=qd();(!v||v&&a==="fixed")&&(m=c.offsetLeft,x=c.offsetTop)}const g=zi(o);if(g<=0){const v=o.ownerDocument,y=v.body,E=getComputedStyle(y),P=v.compatMode==="CSS1Compat"&&parseFloat(E.marginLeft)+parseFloat(E.marginRight)||0,C=Math.abs(o.clientWidth-y.clientWidth-P);C<=Vm&&(u-=C)}else g<=Vm&&(u+=g);return{width:u,height:f,x:m,y:x}}const G2=new Set(["absolute","fixed"]);function Y2(r,a){const l=Qr(r,!0,a==="fixed"),o=l.top+r.clientTop,c=l.left+r.clientLeft,u=Rn(r)?_s(r):En(1),f=r.clientWidth*u.x,m=r.clientHeight*u.y,x=c*u.x,g=o*u.y;return{width:f,height:m,x,y:g}}function Um(r,a,l){let o;if(a==="viewport")o=K2(r,l);else if(a==="document")o=H2(_n(r));else if(gn(a))o=Y2(a,l);else{const c=Vx(r);o={x:a.x-c.x,y:a.y-c.y,width:a.width,height:a.height}}return wi(o)}function Wx(r,a){const l=jr(r);return l===a||!gn(l)||As(l)?!1:vn(l).position==="fixed"||Wx(l,a)}function Q2(r,a){const l=a.get(r);if(l)return l;let o=La(r,[],!1).filter(m=>gn(m)&&zs(m)!=="body"),c=null;const u=vn(r).position==="fixed";let f=u?jr(r):r;for(;gn(f)&&!As(f);){const m=vn(f),x=Qd(f);!x&&m.position==="fixed"&&(c=null),(u?!x&&!c:!x&&m.position==="static"&&!!c&&G2.has(c.position)||Ba(f)&&!x&&Wx(r,f))?o=o.filter(v=>v!==f):c=m,f=jr(f)}return a.set(r,o),o}function q2(r){let{element:a,boundary:l,rootBoundary:o,strategy:c}=r;const f=[...l==="clippingAncestors"?Oi(a)?[]:Q2(a,this._c):[].concat(l),o],m=f[0],x=f.reduce((g,v)=>{const y=Um(a,v,c);return g.top=Ht(y.top,g.top),g.right=yr(y.right,g.right),g.bottom=yr(y.bottom,g.bottom),g.left=Ht(y.left,g.left),g},Um(a,m,c));return{width:x.right-x.left,height:x.bottom-x.top,x:x.left,y:x.top}}function X2(r){const{width:a,height:l}=Bx(r);return{width:a,height:l}}function J2(r,a,l){const o=Rn(a),c=_n(a),u=l==="fixed",f=Qr(r,!0,u,a);let m={scrollLeft:0,scrollTop:0};const x=En(0);function g(){x.x=zi(c)}if(o||!o&&!u)if((zs(a)!=="body"||Ba(c))&&(m=Fi(a)),o){const P=Qr(a,!0,u,a);x.x=P.x+a.clientLeft,x.y=P.y+a.clientTop}else c&&g();u&&!o&&c&&g();const v=c&&!o&&!u?Ux(c,m):En(0),y=f.left+m.scrollLeft-x.x-v.x,E=f.top+m.scrollTop-x.y-v.y;return{x:y,y:E,width:f.width,height:f.height}}function qc(r){return vn(r).position==="static"}function Wm(r,a){if(!Rn(r)||vn(r).position==="fixed")return null;if(a)return a(r);let l=r.offsetParent;return _n(r)===l&&(l=l.ownerDocument.body),l}function Hx(r,a){const l=Qt(r);if(Oi(r))return l;if(!Rn(r)){let c=jr(r);for(;c&&!As(c);){if(gn(c)&&!qc(c))return c;c=jr(c)}return l}let o=Wm(r,a);for(;o&&M2(o)&&qc(o);)o=Wm(o,a);return o&&As(o)&&qc(o)&&!Qd(o)?l:o||z2(r)||l}const Z2=async function(r){const a=this.getOffsetParent||Hx,l=this.getDimensions,o=await l(r.floating);return{reference:J2(r.reference,await a(r.floating),r.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}};function eS(r){return vn(r).direction==="rtl"}const tS={convertOffsetParentRelativeRectToViewportRelativeRect:U2,getDocumentElement:_n,getClippingRect:q2,getOffsetParent:Hx,getElementRects:Z2,getClientRects:W2,getDimensions:X2,getScale:_s,isElement:gn,isRTL:eS};function Kx(r,a){return r.x===a.x&&r.y===a.y&&r.width===a.width&&r.height===a.height}function nS(r,a){let l=null,o;const c=_n(r);function u(){var m;clearTimeout(o),(m=l)==null||m.disconnect(),l=null}function f(m,x){m===void 0&&(m=!1),x===void 0&&(x=1),u();const g=r.getBoundingClientRect(),{left:v,top:y,width:E,height:P}=g;if(m||a(),!E||!P)return;const C=si(y),N=si(c.clientWidth-(v+E)),b=si(c.clientHeight-(y+P)),k=si(v),j={rootMargin:-C+"px "+-N+"px "+-b+"px "+-k+"px",threshold:Ht(0,yr(1,x))||1};let _=!0;function F(G){const M=G[0].intersectionRatio;if(M!==x){if(!_)return f();M?f(!1,M):o=setTimeout(()=>{f(!1,1e-7)},1e3)}M===1&&!Kx(g,r.getBoundingClientRect())&&f(),_=!1}try{l=new IntersectionObserver(F,{...j,root:c.ownerDocument})}catch{l=new IntersectionObserver(F,j)}l.observe(r)}return f(!0),u}function rS(r,a,l,o){o===void 0&&(o={});const{ancestorScroll:c=!0,ancestorResize:u=!0,elementResize:f=typeof ResizeObserver=="function",layoutShift:m=typeof IntersectionObserver=="function",animationFrame:x=!1}=o,g=Xd(r),v=c||u?[...g?La(g):[],...La(a)]:[];v.forEach(k=>{c&&k.addEventListener("scroll",l,{passive:!0}),u&&k.addEventListener("resize",l)});const y=g&&m?nS(g,l):null;let E=-1,P=null;f&&(P=new ResizeObserver(k=>{let[R]=k;R&&R.target===g&&P&&(P.unobserve(a),cancelAnimationFrame(E),E=requestAnimationFrame(()=>{var j;(j=P)==null||j.observe(a)})),l()}),g&&!x&&P.observe(g),P.observe(a));let C,N=x?Qr(r):null;x&&b();function b(){const k=Qr(r);N&&!Kx(N,k)&&l(),N=k,C=requestAnimationFrame(b)}return l(),()=>{var k;v.forEach(R=>{c&&R.removeEventListener("scroll",l),u&&R.removeEventListener("resize",l)}),y==null||y(),(k=P)==null||k.disconnect(),P=null,x&&cancelAnimationFrame(C)}}const sS=P2,aS=R2,lS=C2,iS=T2,oS=k2,Hm=S2,cS=_2,dS=(r,a,l)=>{const o=new Map,c={platform:tS,...l},u={...c.platform,_c:o};return b2(r,a,{...c,platform:u})};var uS=typeof document<"u",fS=function(){},oi=uS?p.useLayoutEffect:fS;function Ni(r,a){if(r===a)return!0;if(typeof r!=typeof a)return!1;if(typeof r=="function"&&r.toString()===a.toString())return!0;let l,o,c;if(r&&a&&typeof r=="object"){if(Array.isArray(r)){if(l=r.length,l!==a.length)return!1;for(o=l;o--!==0;)if(!Ni(r[o],a[o]))return!1;return!0}if(c=Object.keys(r),l=c.length,l!==Object.keys(a).length)return!1;for(o=l;o--!==0;)if(!{}.hasOwnProperty.call(a,c[o]))return!1;for(o=l;o--!==0;){const u=c[o];if(!(u==="_owner"&&r.$$typeof)&&!Ni(r[u],a[u]))return!1}return!0}return r!==r&&a!==a}function Gx(r){return typeof window>"u"?1:(r.ownerDocument.defaultView||window).devicePixelRatio||1}function Km(r,a){const l=Gx(r);return Math.round(a*l)/l}function Xc(r){const a=p.useRef(r);return oi(()=>{a.current=r}),a}function hS(r){r===void 0&&(r={});const{placement:a="bottom",strategy:l="absolute",middleware:o=[],platform:c,elements:{reference:u,floating:f}={},transform:m=!0,whileElementsMounted:x,open:g}=r,[v,y]=p.useState({x:0,y:0,strategy:l,placement:a,middlewareData:{},isPositioned:!1}),[E,P]=p.useState(o);Ni(E,o)||P(o);const[C,N]=p.useState(null),[b,k]=p.useState(null),R=p.useCallback(A=>{A!==G.current&&(G.current=A,N(A))},[]),j=p.useCallback(A=>{A!==M.current&&(M.current=A,k(A))},[]),_=u||C,F=f||b,G=p.useRef(null),M=p.useRef(null),V=p.useRef(v),te=x!=null,ue=Xc(x),ce=Xc(c),ie=Xc(g),fe=p.useCallback(()=>{if(!G.current||!M.current)return;const A={placement:a,strategy:l,middleware:E};ce.current&&(A.platform=ce.current),dS(G.current,M.current,A).then(J=>{const B={...J,isPositioned:ie.current!==!1};H.current&&!Ni(V.current,B)&&(V.current=B,Da.flushSync(()=>{y(B)}))})},[E,a,l,ce,ie]);oi(()=>{g===!1&&V.current.isPositioned&&(V.current.isPositioned=!1,y(A=>({...A,isPositioned:!1})))},[g]);const H=p.useRef(!1);oi(()=>(H.current=!0,()=>{H.current=!1}),[]),oi(()=>{if(_&&(G.current=_),F&&(M.current=F),_&&F){if(ue.current)return ue.current(_,F,fe);fe()}},[_,F,fe,ue,te]);const W=p.useMemo(()=>({reference:G,floating:M,setReference:R,setFloating:j}),[R,j]),Y=p.useMemo(()=>({reference:_,floating:F}),[_,F]),K=p.useMemo(()=>{const A={position:l,left:0,top:0};if(!Y.floating)return A;const J=Km(Y.floating,v.x),B=Km(Y.floating,v.y);return m?{...A,transform:"translate("+J+"px, "+B+"px)",...Gx(Y.floating)>=1.5&&{willChange:"transform"}}:{position:l,left:J,top:B}},[l,m,Y.floating,v.x,v.y]);return p.useMemo(()=>({...v,update:fe,refs:W,elements:Y,floatingStyles:K}),[v,fe,W,Y,K])}const mS=r=>{function a(l){return{}.hasOwnProperty.call(l,"current")}return{name:"arrow",options:r,fn(l){const{element:o,padding:c}=typeof r=="function"?r(l):r;return o&&a(o)?o.current!=null?Hm({element:o.current,padding:c}).fn(l):{}:o?Hm({element:o,padding:c}).fn(l):{}}}},pS=(r,a)=>({...sS(r),options:[r,a]}),xS=(r,a)=>({...aS(r),options:[r,a]}),gS=(r,a)=>({...cS(r),options:[r,a]}),vS=(r,a)=>({...lS(r),options:[r,a]}),yS=(r,a)=>({...iS(r),options:[r,a]}),jS=(r,a)=>({...oS(r),options:[r,a]}),wS=(r,a)=>({...mS(r),options:[r,a]});var NS="Arrow",Yx=p.forwardRef((r,a)=>{const{children:l,width:o=10,height:c=5,...u}=r;return t.jsx(Oe.svg,{...u,ref:a,width:o,height:c,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:r.asChild?l:t.jsx("polygon",{points:"0,0 30,0 15,10"})})});Yx.displayName=NS;var bS=Yx,Jd="Popper",[Qx,qx]=Cr(Jd),[SS,Xx]=Qx(Jd),Jx=r=>{const{__scopePopper:a,children:l}=r,[o,c]=p.useState(null);return t.jsx(SS,{scope:a,anchor:o,onAnchorChange:c,children:l})};Jx.displayName=Jd;var Zx="PopperAnchor",eg=p.forwardRef((r,a)=>{const{__scopePopper:l,virtualRef:o,...c}=r,u=Xx(Zx,l),f=p.useRef(null),m=Ke(a,f),x=p.useRef(null);return p.useEffect(()=>{const g=x.current;x.current=(o==null?void 0:o.current)||f.current,g!==x.current&&u.onAnchorChange(x.current)}),o?null:t.jsx(Oe.div,{...c,ref:m})});eg.displayName=Zx;var Zd="PopperContent",[CS,kS]=Qx(Zd),tg=p.forwardRef((r,a)=>{var Q,xe,I,se,he,Pe;const{__scopePopper:l,side:o="bottom",sideOffset:c=0,align:u="center",alignOffset:f=0,arrowPadding:m=0,avoidCollisions:x=!0,collisionBoundary:g=[],collisionPadding:v=0,sticky:y="partial",hideWhenDetached:E=!1,updatePositionStrategy:P="optimized",onPlaced:C,...N}=r,b=Xx(Zd,l),[k,R]=p.useState(null),j=Ke(a,Me=>R(Me)),[_,F]=p.useState(null),G=Vd(_),M=(G==null?void 0:G.width)??0,V=(G==null?void 0:G.height)??0,te=o+(u!=="center"?"-"+u:""),ue=typeof v=="number"?v:{top:0,right:0,bottom:0,left:0,...v},ce=Array.isArray(g)?g:[g],ie=ce.length>0,fe={padding:ue,boundary:ce.filter(PS),altBoundary:ie},{refs:H,floatingStyles:W,placement:Y,isPositioned:K,middlewareData:A}=hS({strategy:"fixed",placement:te,whileElementsMounted:(...Me)=>rS(...Me,{animationFrame:P==="always"}),elements:{reference:b.anchor},middleware:[pS({mainAxis:c+V,alignmentAxis:f}),x&&xS({mainAxis:!0,crossAxis:!1,limiter:y==="partial"?gS():void 0,...fe}),x&&vS({...fe}),yS({...fe,apply:({elements:Me,rects:Fe,availableWidth:Qe,availableHeight:nt})=>{const{width:Ze,height:Tt}=Fe.reference,It=Me.floating.style;It.setProperty("--radix-popper-available-width",`${Qe}px`),It.setProperty("--radix-popper-available-height",`${nt}px`),It.setProperty("--radix-popper-anchor-width",`${Ze}px`),It.setProperty("--radix-popper-anchor-height",`${Tt}px`)}}),_&&wS({element:_,padding:m}),RS({arrowWidth:M,arrowHeight:V}),E&&jS({strategy:"referenceHidden",...fe})]}),[J,B]=sg(Y),S=vr(C);Pt(()=>{K&&(S==null||S())},[K,S]);const D=(Q=A.arrow)==null?void 0:Q.x,ae=(xe=A.arrow)==null?void 0:xe.y,oe=((I=A.arrow)==null?void 0:I.centerOffset)!==0,[Ne,me]=p.useState();return Pt(()=>{k&&me(window.getComputedStyle(k).zIndex)},[k]),t.jsx("div",{ref:H.setFloating,"data-radix-popper-content-wrapper":"",style:{...W,transform:K?W.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:Ne,"--radix-popper-transform-origin":[(se=A.transformOrigin)==null?void 0:se.x,(he=A.transformOrigin)==null?void 0:he.y].join(" "),...((Pe=A.hide)==null?void 0:Pe.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:r.dir,children:t.jsx(CS,{scope:l,placedSide:J,onArrowChange:F,arrowX:D,arrowY:ae,shouldHideArrow:oe,children:t.jsx(Oe.div,{"data-side":J,"data-align":B,...N,ref:j,style:{...N.style,animation:K?void 0:"none"}})})})});tg.displayName=Zd;var ng="PopperArrow",ES={top:"bottom",right:"left",bottom:"top",left:"right"},rg=p.forwardRef(function(a,l){const{__scopePopper:o,...c}=a,u=kS(ng,o),f=ES[u.placedSide];return t.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:t.jsx(bS,{...c,ref:l,style:{...c.style,display:"block"}})})});rg.displayName=ng;function PS(r){return r!==null}var RS=r=>({name:"transformOrigin",options:r,fn(a){var b,k,R;const{placement:l,rects:o,middlewareData:c}=a,f=((b=c.arrow)==null?void 0:b.centerOffset)!==0,m=f?0:r.arrowWidth,x=f?0:r.arrowHeight,[g,v]=sg(l),y={start:"0%",center:"50%",end:"100%"}[v],E=(((k=c.arrow)==null?void 0:k.x)??0)+m/2,P=(((R=c.arrow)==null?void 0:R.y)??0)+x/2;let C="",N="";return g==="bottom"?(C=f?y:`${E}px`,N=`${-x}px`):g==="top"?(C=f?y:`${E}px`,N=`${o.floating.height+x}px`):g==="right"?(C=`${-x}px`,N=f?y:`${P}px`):g==="left"&&(C=`${o.floating.width+x}px`,N=f?y:`${P}px`),{data:{x:C,y:N}}}});function sg(r){const[a,l="center"]=r.split("-");return[a,l]}var _S=Jx,TS=eg,IS=tg,AS=rg,ag=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"}),MS="VisuallyHidden",LS=p.forwardRef((r,a)=>t.jsx(Oe.span,{...r,ref:a,style:{...ag,...r.style}}));LS.displayName=MS;var DS=[" ","Enter","ArrowUp","ArrowDown"],OS=[" ","Enter"],qr="Select",[$i,Bi,FS]=Ud(qr),[$s]=Cr(qr,[FS,qx]),Vi=qx(),[zS,kr]=$s(qr),[$S,BS]=$s(qr),lg=r=>{const{__scopeSelect:a,children:l,open:o,defaultOpen:c,onOpenChange:u,value:f,defaultValue:m,onValueChange:x,dir:g,name:v,autoComplete:y,disabled:E,required:P,form:C}=r,N=Vi(a),[b,k]=p.useState(null),[R,j]=p.useState(null),[_,F]=p.useState(!1),G=Ai(g),[M,V]=Gr({prop:o,defaultProp:c??!1,onChange:u,caller:qr}),[te,ue]=Gr({prop:f,defaultProp:m,onChange:x,caller:qr}),ce=p.useRef(null),ie=b?C||!!b.closest("form"):!0,[fe,H]=p.useState(new Set),W=Array.from(fe).map(Y=>Y.props.value).join(";");return t.jsx(_S,{...N,children:t.jsxs(zS,{required:P,scope:a,trigger:b,onTriggerChange:k,valueNode:R,onValueNodeChange:j,valueNodeHasChildren:_,onValueNodeHasChildrenChange:F,contentId:xr(),value:te,onValueChange:ue,open:M,onOpenChange:V,dir:G,triggerPointerDownPosRef:ce,disabled:E,children:[t.jsx($i.Provider,{scope:a,children:t.jsx($S,{scope:r.__scopeSelect,onNativeOptionAdd:p.useCallback(Y=>{H(K=>new Set(K).add(Y))},[]),onNativeOptionRemove:p.useCallback(Y=>{H(K=>{const A=new Set(K);return A.delete(Y),A})},[]),children:l})}),ie?t.jsxs(Pg,{"aria-hidden":!0,required:P,tabIndex:-1,name:v,autoComplete:y,value:te,onChange:Y=>ue(Y.target.value),disabled:E,form:C,children:[te===void 0?t.jsx("option",{value:""}):null,Array.from(fe)]},W):null]})})};lg.displayName=qr;var ig="SelectTrigger",og=p.forwardRef((r,a)=>{const{__scopeSelect:l,disabled:o=!1,...c}=r,u=Vi(l),f=kr(ig,l),m=f.disabled||o,x=Ke(a,f.onTriggerChange),g=Bi(l),v=p.useRef("touch"),[y,E,P]=_g(N=>{const b=g().filter(j=>!j.disabled),k=b.find(j=>j.value===f.value),R=Tg(b,N,k);R!==void 0&&f.onValueChange(R.value)}),C=N=>{m||(f.onOpenChange(!0),P()),N&&(f.triggerPointerDownPosRef.current={x:Math.round(N.pageX),y:Math.round(N.pageY)})};return t.jsx(TS,{asChild:!0,...u,children:t.jsx(Oe.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":Rg(f.value)?"":void 0,...c,ref:x,onClick:Ae(c.onClick,N=>{N.currentTarget.focus(),v.current!=="mouse"&&C(N)}),onPointerDown:Ae(c.onPointerDown,N=>{v.current=N.pointerType;const b=N.target;b.hasPointerCapture(N.pointerId)&&b.releasePointerCapture(N.pointerId),N.button===0&&N.ctrlKey===!1&&N.pointerType==="mouse"&&(C(N),N.preventDefault())}),onKeyDown:Ae(c.onKeyDown,N=>{const b=y.current!=="";!(N.ctrlKey||N.altKey||N.metaKey)&&N.key.length===1&&E(N.key),!(b&&N.key===" ")&&DS.includes(N.key)&&(C(),N.preventDefault())})})})});og.displayName=ig;var cg="SelectValue",dg=p.forwardRef((r,a)=>{const{__scopeSelect:l,className:o,style:c,children:u,placeholder:f="",...m}=r,x=kr(cg,l),{onValueNodeHasChildrenChange:g}=x,v=u!==void 0,y=Ke(a,x.onValueNodeChange);return Pt(()=>{g(v)},[g,v]),t.jsx(Oe.span,{...m,ref:y,style:{pointerEvents:"none"},children:Rg(x.value)?t.jsx(t.Fragment,{children:f}):u})});dg.displayName=cg;var VS="SelectIcon",ug=p.forwardRef((r,a)=>{const{__scopeSelect:l,children:o,...c}=r;return t.jsx(Oe.span,{"aria-hidden":!0,...c,ref:a,children:o||"▼"})});ug.displayName=VS;var US="SelectPortal",fg=r=>t.jsx(Dd,{asChild:!0,...r});fg.displayName=US;var Xr="SelectContent",hg=p.forwardRef((r,a)=>{const l=kr(Xr,r.__scopeSelect),[o,c]=p.useState();if(Pt(()=>{c(new DocumentFragment)},[]),!l.open){const u=o;return u?Da.createPortal(t.jsx(mg,{scope:r.__scopeSelect,children:t.jsx($i.Slot,{scope:r.__scopeSelect,children:t.jsx("div",{children:r.children})})}),u):null}return t.jsx(pg,{...r,ref:a})});hg.displayName=Xr;var pn=10,[mg,Er]=$s(Xr),WS="SelectContentImpl",HS=Ma("SelectContent.RemoveScroll"),pg=p.forwardRef((r,a)=>{const{__scopeSelect:l,position:o="item-aligned",onCloseAutoFocus:c,onEscapeKeyDown:u,onPointerDownOutside:f,side:m,sideOffset:x,align:g,alignOffset:v,arrowPadding:y,collisionBoundary:E,collisionPadding:P,sticky:C,hideWhenDetached:N,avoidCollisions:b,...k}=r,R=kr(Xr,l),[j,_]=p.useState(null),[F,G]=p.useState(null),M=Ke(a,Q=>_(Q)),[V,te]=p.useState(null),[ue,ce]=p.useState(null),ie=Bi(l),[fe,H]=p.useState(!1),W=p.useRef(!1);p.useEffect(()=>{if(j)return Kp(j)},[j]),Op();const Y=p.useCallback(Q=>{const[xe,...I]=ie().map(Pe=>Pe.ref.current),[se]=I.slice(-1),he=document.activeElement;for(const Pe of Q)if(Pe===he||(Pe==null||Pe.scrollIntoView({block:"nearest"}),Pe===xe&&F&&(F.scrollTop=0),Pe===se&&F&&(F.scrollTop=F.scrollHeight),Pe==null||Pe.focus(),document.activeElement!==he))return},[ie,F]),K=p.useCallback(()=>Y([V,j]),[Y,V,j]);p.useEffect(()=>{fe&&K()},[fe,K]);const{onOpenChange:A,triggerPointerDownPosRef:J}=R;p.useEffect(()=>{if(j){let Q={x:0,y:0};const xe=se=>{var he,Pe;Q={x:Math.abs(Math.round(se.pageX)-(((he=J.current)==null?void 0:he.x)??0)),y:Math.abs(Math.round(se.pageY)-(((Pe=J.current)==null?void 0:Pe.y)??0))}},I=se=>{Q.x<=10&&Q.y<=10?se.preventDefault():j.contains(se.target)||A(!1),document.removeEventListener("pointermove",xe),J.current=null};return J.current!==null&&(document.addEventListener("pointermove",xe),document.addEventListener("pointerup",I,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",xe),document.removeEventListener("pointerup",I,{capture:!0})}}},[j,A,J]),p.useEffect(()=>{const Q=()=>A(!1);return window.addEventListener("blur",Q),window.addEventListener("resize",Q),()=>{window.removeEventListener("blur",Q),window.removeEventListener("resize",Q)}},[A]);const[B,S]=_g(Q=>{const xe=ie().filter(he=>!he.disabled),I=xe.find(he=>he.ref.current===document.activeElement),se=Tg(xe,Q,I);se&&setTimeout(()=>se.ref.current.focus())}),D=p.useCallback((Q,xe,I)=>{const se=!W.current&&!I;(R.value!==void 0&&R.value===xe||se)&&(te(Q),se&&(W.current=!0))},[R.value]),ae=p.useCallback(()=>j==null?void 0:j.focus(),[j]),oe=p.useCallback((Q,xe,I)=>{const se=!W.current&&!I;(R.value!==void 0&&R.value===xe||se)&&ce(Q)},[R.value]),Ne=o==="popper"?xd:xg,me=Ne===xd?{side:m,sideOffset:x,align:g,alignOffset:v,arrowPadding:y,collisionBoundary:E,collisionPadding:P,sticky:C,hideWhenDetached:N,avoidCollisions:b}:{};return t.jsx(mg,{scope:l,content:j,viewport:F,onViewportChange:G,itemRefCallback:D,selectedItem:V,onItemLeave:ae,itemTextRefCallback:oe,focusSelectedItem:K,selectedItemText:ue,position:o,isPositioned:fe,searchRef:B,children:t.jsx(Od,{as:HS,allowPinchZoom:!0,children:t.jsx(Ld,{asChild:!0,trapped:R.open,onMountAutoFocus:Q=>{Q.preventDefault()},onUnmountAutoFocus:Ae(c,Q=>{var xe;(xe=R.trigger)==null||xe.focus({preventScroll:!0}),Q.preventDefault()}),children:t.jsx(Md,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:u,onPointerDownOutside:f,onFocusOutside:Q=>Q.preventDefault(),onDismiss:()=>R.onOpenChange(!1),children:t.jsx(Ne,{role:"listbox",id:R.contentId,"data-state":R.open?"open":"closed",dir:R.dir,onContextMenu:Q=>Q.preventDefault(),...k,...me,onPlaced:()=>H(!0),ref:M,style:{display:"flex",flexDirection:"column",outline:"none",...k.style},onKeyDown:Ae(k.onKeyDown,Q=>{const xe=Q.ctrlKey||Q.altKey||Q.metaKey;if(Q.key==="Tab"&&Q.preventDefault(),!xe&&Q.key.length===1&&S(Q.key),["ArrowUp","ArrowDown","Home","End"].includes(Q.key)){let se=ie().filter(he=>!he.disabled).map(he=>he.ref.current);if(["ArrowUp","End"].includes(Q.key)&&(se=se.slice().reverse()),["ArrowUp","ArrowDown"].includes(Q.key)){const he=Q.target,Pe=se.indexOf(he);se=se.slice(Pe+1)}setTimeout(()=>Y(se)),Q.preventDefault()}})})})})})})});pg.displayName=WS;var KS="SelectItemAlignedPosition",xg=p.forwardRef((r,a)=>{const{__scopeSelect:l,onPlaced:o,...c}=r,u=kr(Xr,l),f=Er(Xr,l),[m,x]=p.useState(null),[g,v]=p.useState(null),y=Ke(a,M=>v(M)),E=Bi(l),P=p.useRef(!1),C=p.useRef(!0),{viewport:N,selectedItem:b,selectedItemText:k,focusSelectedItem:R}=f,j=p.useCallback(()=>{if(u.trigger&&u.valueNode&&m&&g&&N&&b&&k){const M=u.trigger.getBoundingClientRect(),V=g.getBoundingClientRect(),te=u.valueNode.getBoundingClientRect(),ue=k.getBoundingClientRect();if(u.dir!=="rtl"){const he=ue.left-V.left,Pe=te.left-he,Me=M.left-Pe,Fe=M.width+Me,Qe=Math.max(Fe,V.width),nt=window.innerWidth-pn,Ze=vi(Pe,[pn,Math.max(pn,nt-Qe)]);m.style.minWidth=Fe+"px",m.style.left=Ze+"px"}else{const he=V.right-ue.right,Pe=window.innerWidth-te.right-he,Me=window.innerWidth-M.right-Pe,Fe=M.width+Me,Qe=Math.max(Fe,V.width),nt=window.innerWidth-pn,Ze=vi(Pe,[pn,Math.max(pn,nt-Qe)]);m.style.minWidth=Fe+"px",m.style.right=Ze+"px"}const ce=E(),ie=window.innerHeight-pn*2,fe=N.scrollHeight,H=window.getComputedStyle(g),W=parseInt(H.borderTopWidth,10),Y=parseInt(H.paddingTop,10),K=parseInt(H.borderBottomWidth,10),A=parseInt(H.paddingBottom,10),J=W+Y+fe+A+K,B=Math.min(b.offsetHeight*5,J),S=window.getComputedStyle(N),D=parseInt(S.paddingTop,10),ae=parseInt(S.paddingBottom,10),oe=M.top+M.height/2-pn,Ne=ie-oe,me=b.offsetHeight/2,Q=b.offsetTop+me,xe=W+Y+Q,I=J-xe;if(xe<=oe){const he=ce.length>0&&b===ce[ce.length-1].ref.current;m.style.bottom="0px";const Pe=g.clientHeight-N.offsetTop-N.offsetHeight,Me=Math.max(Ne,me+(he?ae:0)+Pe+K),Fe=xe+Me;m.style.height=Fe+"px"}else{const he=ce.length>0&&b===ce[0].ref.current;m.style.top="0px";const Me=Math.max(oe,W+N.offsetTop+(he?D:0)+me)+I;m.style.height=Me+"px",N.scrollTop=xe-oe+N.offsetTop}m.style.margin=`${pn}px 0`,m.style.minHeight=B+"px",m.style.maxHeight=ie+"px",o==null||o(),requestAnimationFrame(()=>P.current=!0)}},[E,u.trigger,u.valueNode,m,g,N,b,k,u.dir,o]);Pt(()=>j(),[j]);const[_,F]=p.useState();Pt(()=>{g&&F(window.getComputedStyle(g).zIndex)},[g]);const G=p.useCallback(M=>{M&&C.current===!0&&(j(),R==null||R(),C.current=!1)},[j,R]);return t.jsx(YS,{scope:l,contentWrapper:m,shouldExpandOnScrollRef:P,onScrollButtonChange:G,children:t.jsx("div",{ref:x,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:_},children:t.jsx(Oe.div,{...c,ref:y,style:{boxSizing:"border-box",maxHeight:"100%",...c.style}})})})});xg.displayName=KS;var GS="SelectPopperPosition",xd=p.forwardRef((r,a)=>{const{__scopeSelect:l,align:o="start",collisionPadding:c=pn,...u}=r,f=Vi(l);return t.jsx(IS,{...f,...u,ref:a,align:o,collisionPadding:c,style:{boxSizing:"border-box",...u.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});xd.displayName=GS;var[YS,eu]=$s(Xr,{}),gd="SelectViewport",gg=p.forwardRef((r,a)=>{const{__scopeSelect:l,nonce:o,...c}=r,u=Er(gd,l),f=eu(gd,l),m=Ke(a,u.onViewportChange),x=p.useRef(0);return t.jsxs(t.Fragment,{children:[t.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:o}),t.jsx($i.Slot,{scope:l,children:t.jsx(Oe.div,{"data-radix-select-viewport":"",role:"presentation",...c,ref:m,style:{position:"relative",flex:1,overflow:"hidden auto",...c.style},onScroll:Ae(c.onScroll,g=>{const v=g.currentTarget,{contentWrapper:y,shouldExpandOnScrollRef:E}=f;if(E!=null&&E.current&&y){const P=Math.abs(x.current-v.scrollTop);if(P>0){const C=window.innerHeight-pn*2,N=parseFloat(y.style.minHeight),b=parseFloat(y.style.height),k=Math.max(N,b);if(k0?_:0,y.style.justifyContent="flex-end")}}}x.current=v.scrollTop})})})]})});gg.displayName=gd;var vg="SelectGroup",[QS,qS]=$s(vg),XS=p.forwardRef((r,a)=>{const{__scopeSelect:l,...o}=r,c=xr();return t.jsx(QS,{scope:l,id:c,children:t.jsx(Oe.div,{role:"group","aria-labelledby":c,...o,ref:a})})});XS.displayName=vg;var yg="SelectLabel",JS=p.forwardRef((r,a)=>{const{__scopeSelect:l,...o}=r,c=qS(yg,l);return t.jsx(Oe.div,{id:c.id,...o,ref:a})});JS.displayName=yg;var bi="SelectItem",[ZS,jg]=$s(bi),wg=p.forwardRef((r,a)=>{const{__scopeSelect:l,value:o,disabled:c=!1,textValue:u,...f}=r,m=kr(bi,l),x=Er(bi,l),g=m.value===o,[v,y]=p.useState(u??""),[E,P]=p.useState(!1),C=Ke(a,R=>{var j;return(j=x.itemRefCallback)==null?void 0:j.call(x,R,o,c)}),N=xr(),b=p.useRef("touch"),k=()=>{c||(m.onValueChange(o),m.onOpenChange(!1))};if(o==="")throw new Error("A must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return t.jsx(ZS,{scope:l,value:o,disabled:c,textId:N,isSelected:g,onItemTextChange:p.useCallback(R=>{y(j=>j||((R==null?void 0:R.textContent)??"").trim())},[]),children:t.jsx($i.ItemSlot,{scope:l,value:o,disabled:c,textValue:v,children:t.jsx(Oe.div,{role:"option","aria-labelledby":N,"data-highlighted":E?"":void 0,"aria-selected":g&&E,"data-state":g?"checked":"unchecked","aria-disabled":c||void 0,"data-disabled":c?"":void 0,tabIndex:c?void 0:-1,...f,ref:C,onFocus:Ae(f.onFocus,()=>P(!0)),onBlur:Ae(f.onBlur,()=>P(!1)),onClick:Ae(f.onClick,()=>{b.current!=="mouse"&&k()}),onPointerUp:Ae(f.onPointerUp,()=>{b.current==="mouse"&&k()}),onPointerDown:Ae(f.onPointerDown,R=>{b.current=R.pointerType}),onPointerMove:Ae(f.onPointerMove,R=>{var j;b.current=R.pointerType,c?(j=x.onItemLeave)==null||j.call(x):b.current==="mouse"&&R.currentTarget.focus({preventScroll:!0})}),onPointerLeave:Ae(f.onPointerLeave,R=>{var j;R.currentTarget===document.activeElement&&((j=x.onItemLeave)==null||j.call(x))}),onKeyDown:Ae(f.onKeyDown,R=>{var _;((_=x.searchRef)==null?void 0:_.current)!==""&&R.key===" "||(OS.includes(R.key)&&k(),R.key===" "&&R.preventDefault())})})})})});wg.displayName=bi;var _a="SelectItemText",Ng=p.forwardRef((r,a)=>{const{__scopeSelect:l,className:o,style:c,...u}=r,f=kr(_a,l),m=Er(_a,l),x=jg(_a,l),g=BS(_a,l),[v,y]=p.useState(null),E=Ke(a,k=>y(k),x.onItemTextChange,k=>{var R;return(R=m.itemTextRefCallback)==null?void 0:R.call(m,k,x.value,x.disabled)}),P=v==null?void 0:v.textContent,C=p.useMemo(()=>t.jsx("option",{value:x.value,disabled:x.disabled,children:P},x.value),[x.disabled,x.value,P]),{onNativeOptionAdd:N,onNativeOptionRemove:b}=g;return Pt(()=>(N(C),()=>b(C)),[N,b,C]),t.jsxs(t.Fragment,{children:[t.jsx(Oe.span,{id:x.textId,...u,ref:E}),x.isSelected&&f.valueNode&&!f.valueNodeHasChildren?Da.createPortal(u.children,f.valueNode):null]})});Ng.displayName=_a;var bg="SelectItemIndicator",Sg=p.forwardRef((r,a)=>{const{__scopeSelect:l,...o}=r;return jg(bg,l).isSelected?t.jsx(Oe.span,{"aria-hidden":!0,...o,ref:a}):null});Sg.displayName=bg;var vd="SelectScrollUpButton",Cg=p.forwardRef((r,a)=>{const l=Er(vd,r.__scopeSelect),o=eu(vd,r.__scopeSelect),[c,u]=p.useState(!1),f=Ke(a,o.onScrollButtonChange);return Pt(()=>{if(l.viewport&&l.isPositioned){let m=function(){const g=x.scrollTop>0;u(g)};const x=l.viewport;return m(),x.addEventListener("scroll",m),()=>x.removeEventListener("scroll",m)}},[l.viewport,l.isPositioned]),c?t.jsx(Eg,{...r,ref:f,onAutoScroll:()=>{const{viewport:m,selectedItem:x}=l;m&&x&&(m.scrollTop=m.scrollTop-x.offsetHeight)}}):null});Cg.displayName=vd;var yd="SelectScrollDownButton",kg=p.forwardRef((r,a)=>{const l=Er(yd,r.__scopeSelect),o=eu(yd,r.__scopeSelect),[c,u]=p.useState(!1),f=Ke(a,o.onScrollButtonChange);return Pt(()=>{if(l.viewport&&l.isPositioned){let m=function(){const g=x.scrollHeight-x.clientHeight,v=Math.ceil(x.scrollTop)x.removeEventListener("scroll",m)}},[l.viewport,l.isPositioned]),c?t.jsx(Eg,{...r,ref:f,onAutoScroll:()=>{const{viewport:m,selectedItem:x}=l;m&&x&&(m.scrollTop=m.scrollTop+x.offsetHeight)}}):null});kg.displayName=yd;var Eg=p.forwardRef((r,a)=>{const{__scopeSelect:l,onAutoScroll:o,...c}=r,u=Er("SelectScrollButton",l),f=p.useRef(null),m=Bi(l),x=p.useCallback(()=>{f.current!==null&&(window.clearInterval(f.current),f.current=null)},[]);return p.useEffect(()=>()=>x(),[x]),Pt(()=>{var v;const g=m().find(y=>y.ref.current===document.activeElement);(v=g==null?void 0:g.ref.current)==null||v.scrollIntoView({block:"nearest"})},[m]),t.jsx(Oe.div,{"aria-hidden":!0,...c,ref:a,style:{flexShrink:0,...c.style},onPointerDown:Ae(c.onPointerDown,()=>{f.current===null&&(f.current=window.setInterval(o,50))}),onPointerMove:Ae(c.onPointerMove,()=>{var g;(g=u.onItemLeave)==null||g.call(u),f.current===null&&(f.current=window.setInterval(o,50))}),onPointerLeave:Ae(c.onPointerLeave,()=>{x()})})}),eC="SelectSeparator",tC=p.forwardRef((r,a)=>{const{__scopeSelect:l,...o}=r;return t.jsx(Oe.div,{"aria-hidden":!0,...o,ref:a})});tC.displayName=eC;var jd="SelectArrow",nC=p.forwardRef((r,a)=>{const{__scopeSelect:l,...o}=r,c=Vi(l),u=kr(jd,l),f=Er(jd,l);return u.open&&f.position==="popper"?t.jsx(AS,{...c,...o,ref:a}):null});nC.displayName=jd;var rC="SelectBubbleInput",Pg=p.forwardRef(({__scopeSelect:r,value:a,...l},o)=>{const c=p.useRef(null),u=Ke(o,c),f=Bd(a);return p.useEffect(()=>{const m=c.current;if(!m)return;const x=window.HTMLSelectElement.prototype,v=Object.getOwnPropertyDescriptor(x,"value").set;if(f!==a&&v){const y=new Event("change",{bubbles:!0});v.call(m,a),m.dispatchEvent(y)}},[f,a]),t.jsx(Oe.select,{...l,style:{...ag,...l.style},ref:u,defaultValue:a})});Pg.displayName=rC;function Rg(r){return r===""||r===void 0}function _g(r){const a=vr(r),l=p.useRef(""),o=p.useRef(0),c=p.useCallback(f=>{const m=l.current+f;a(m),(function x(g){l.current=g,window.clearTimeout(o.current),g!==""&&(o.current=window.setTimeout(()=>x(""),1e3))})(m)},[a]),u=p.useCallback(()=>{l.current="",window.clearTimeout(o.current)},[]);return p.useEffect(()=>()=>window.clearTimeout(o.current),[]),[l,c,u]}function Tg(r,a,l){const c=a.length>1&&Array.from(a).every(g=>g===a[0])?a[0]:a,u=l?r.indexOf(l):-1;let f=sC(r,Math.max(u,0));c.length===1&&(f=f.filter(g=>g!==l));const x=f.find(g=>g.textValue.toLowerCase().startsWith(c.toLowerCase()));return x!==l?x:void 0}function sC(r,a){return r.map((l,o)=>r[(a+o)%r.length])}var aC=lg,Ig=og,lC=dg,iC=ug,oC=fg,Ag=hg,cC=gg,Mg=wg,dC=Ng,uC=Sg,fC=Cg,hC=kg;const Jc=aC,Zc=lC,ci=p.forwardRef(({className:r,children:a,...l},o)=>t.jsxs(Ig,{ref:o,className:Ge("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,t.jsx(iC,{asChild:!0,children:t.jsx(cp,{className:"h-4 w-4 opacity-50"})})]}));ci.displayName=Ig.displayName;const di=p.forwardRef(({className:r,children:a,position:l="popper",...o},c)=>t.jsx(oC,{children:t.jsxs(Ag,{ref:c,className:Ge("relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md",l==="popper"&&"data-[side=bottom]:translate-y-1",r),position:l,...o,children:[t.jsx(fC,{className:"flex cursor-default items-center justify-center py-1",children:t.jsx(yj,{className:"h-4 w-4"})}),t.jsx(cC,{className:"p-1",children:a}),t.jsx(hC,{className:"flex cursor-default items-center justify-center py-1",children:t.jsx(cp,{className:"h-4 w-4"})})]})}));di.displayName=Ag.displayName;const fr=p.forwardRef(({className:r,children:a,...l},o)=>t.jsxs(Mg,{ref:o,className:Ge("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:[t.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:t.jsx(uC,{children:t.jsx(ki,{className:"h-4 w-4"})})}),t.jsx(dC,{children:a})]}));fr.displayName=Mg.displayName;function mC(r){const a=new Map;for(const l of r){const o=l.partId||"part-1",c=l.partTitle||"未分类",u=l.chapterId||"chapter-1",f=l.chapterTitle||"未分类";a.has(o)||a.set(o,{id:o,title:c,chapters:new Map});const m=a.get(o);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,isNew:l.isNew})}return Array.from(a.values()).map(l=>({...l,chapters:Array.from(l.chapters.values())}))}function pC(){const[r,a]=p.useState([]),[l,o]=p.useState(!0),[c,u]=p.useState([]),[f,m]=p.useState(null),[x,g]=p.useState(!1),[v,y]=p.useState(!1),[E,P]=p.useState(!1),[C,N]=p.useState(""),[b,k]=p.useState([]),[R,j]=p.useState(!1),[_,F]=p.useState(!1),G=p.useRef(null),[M,V]=p.useState({id:"",title:"",price:1,partId:"part-1",chapterId:"chapter-1",content:""}),te=mC(r),ue=r.length,ce=async()=>{o(!0);try{const S=await He("/api/db/book?action=list");a(Array.isArray(S==null?void 0:S.sections)?S.sections:[]),c.length===0&&te.length>0&&u([te[0].id])}catch(S){console.error(S),a([])}finally{o(!1)}};p.useEffect(()=>{ce()},[]),p.useEffect(()=>{!l&&te.length>0&&c.length===0&&u([te[0].id])},[l,te.length,c.length]);const ie=S=>{u(D=>D.includes(S)?D.filter(ae=>ae!==S):[...D,S])},fe=async S=>{if(confirm(`确定要删除章节「${S.title}」吗?此操作不可恢复。`))try{const D=await Ri(`/api/db/book?id=${encodeURIComponent(S.id)}`);D&&D.success!==!1?(alert("已删除"),ce()):alert("删除失败: "+(D&&typeof D=="object"&&"error"in D?D.error:"未知错误"))}catch(D){console.error(D),alert("删除失败")}},H=async S=>{y(!0);try{const D=await He(`/api/db/book?action=read&id=${encodeURIComponent(S.id)}`);if(D!=null&&D.success&&D.section){const ae=D.section;m({id:S.id,title:D.section.title??S.title,price:D.section.price??S.price,content:D.section.content??"",filePath:S.filePath,isFree:S.isFree||S.price===0,isNew:ae.isNew??S.isNew})}else m({id:S.id,title:S.title,price:S.price,content:"",filePath:S.filePath,isFree:S.isFree,isNew:S.isNew}),D&&!D.success&&alert("无法读取文件内容: "+(D.error||"未知错误"))}catch(D){console.error(D),m({id:S.id,title:S.title,price:S.price,content:"",filePath:S.filePath,isFree:S.isFree})}finally{y(!1)}},W=async()=>{var S;if(f){P(!0);try{let D=f.content||"";const ae=[new RegExp(`^#+\\s*${f.id.replace(".","\\.")}\\s+.*$`,"gm"),new RegExp(`^#+\\s*${f.id.replace(".","\\.")}[::].*$`,"gm"),new RegExp(`^#\\s+.*${(S=f.title)==null?void 0:S.slice(0,10).replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}.*$`,"gm")];for(const Ne of ae)D=D.replace(Ne,"");D=D.replace(/^\s*\n+/,"").trim();const oe=await zt("/api/db/book",{id:f.id,title:f.title,price:f.isFree?0:f.price,content:D,isFree:f.isFree||f.price===0,isNew:f.isNew,saveToFile:!0});oe&&oe.success!==!1?(alert(`已保存章节: ${f.title}`),m(null),ce()):alert("保存失败: "+(oe&&typeof oe=="object"&&"error"in oe?oe.error:"未知错误"))}catch(D){console.error(D),alert("保存失败")}finally{P(!1)}}},Y=async()=>{if(!M.id||!M.title){alert("请填写章节ID和标题");return}P(!0);try{const S=await zt("/api/db/book",{id:M.id,title:M.title,price:M.price,content:M.content,partId:M.partId,chapterId:M.chapterId,saveToFile:!1});S&&S.success!==!1?(alert(`章节创建成功: ${M.title}`),g(!1),V({id:"",title:"",price:1,partId:"part-1",chapterId:"chapter-1",content:""}),ce()):alert("创建失败: "+(S&&typeof S=="object"&&"error"in S?S.error:"未知错误"))}catch(S){console.error(S),alert("创建失败")}finally{P(!1)}},K=async S=>{var ae,oe;const D=(ae=S.target.files)==null?void 0:ae[0];if(D){F(!0);try{const Ne=new FormData;Ne.append("file",D),Ne.append("folder","book-images");const Q=await(await fetch(pp("/api/upload"),{method:"POST",body:Ne,credentials:"include"})).json();if(Q!=null&&Q.success&&((oe=Q==null?void 0:Q.data)!=null&&oe.url)){const xe=`![${D.name}](${Q.data.url})`;f&&m({...f,content:(f.content||"")+` - -`+xe}),alert(`图片上传成功: ${Q.data.url}`)}else alert("上传失败: "+((Q==null?void 0:Q.error)||"未知错误"))}catch(Ne){console.error(Ne),alert("上传失败")}finally{F(!1),G.current&&(G.current.value="")}}},A=async()=>{var S;if(C.trim()){j(!0);try{const D=await He(`/api/search?q=${encodeURIComponent(C)}`);D!=null&&D.success&&((S=D.data)!=null&&S.results)?k(D.data.results):(k([]),D&&!D.success&&alert("搜索失败: "+D.error))}catch(D){console.error(D),k([]),alert("搜索失败")}finally{j(!1)}}},J=te.find(S=>S.id===M.partId),B=(J==null?void 0:J.chapters)??[];return t.jsxs("div",{className:"p-8 w-full",children:[t.jsxs("div",{className:"flex justify-between items-center mb-8",children:[t.jsxs("div",{children:[t.jsx("h2",{className:"text-2xl font-bold text-white",children:"内容管理"}),t.jsxs("p",{className:"text-gray-400 mt-1",children:["共 ",te.length," 篇 · ",ue," 节内容"]})]}),t.jsx("div",{className:"flex gap-2",children:t.jsxs(de,{onClick:()=>{const S=typeof window<"u"?`${window.location.origin}/api-doc`:"";S&&window.open(S,"_blank","noopener,noreferrer")},variant:"outline",className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:[t.jsx(Wr,{className:"w-4 h-4 mr-2"}),"API 接口"]})})]}),t.jsx(Kt,{open:x,onOpenChange:g,children:t.jsxs($t,{className:"bg-[#0f2137] border-gray-700 text-white max-w-2xl max-h-[90vh] overflow-y-auto",showCloseButton:!0,children:[t.jsx(Gt,{children:t.jsxs(Yt,{className:"text-white flex items-center gap-2",children:[t.jsx(pr,{className:"w-5 h-5 text-[#38bdac]"}),"新建章节"]})}),t.jsxs("div",{className:"space-y-4 py-4",children:[t.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[t.jsxs("div",{className:"space-y-2",children:[t.jsx(q,{className:"text-gray-300",children:"章节ID *"}),t.jsx(ne,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"如: 9.15",value:M.id,onChange:S=>V({...M,id:S.target.value})})]}),t.jsxs("div",{className:"space-y-2",children:[t.jsx(q,{className:"text-gray-300",children:"价格 (元)"}),t.jsx(ne,{type:"number",className:"bg-[#0a1628] border-gray-700 text-white",value:M.price,onChange:S=>V({...M,price:Number(S.target.value)})})]})]}),t.jsxs("div",{className:"space-y-2",children:[t.jsx(q,{className:"text-gray-300",children:"章节标题 *"}),t.jsx(ne,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"输入章节标题",value:M.title,onChange:S=>V({...M,title:S.target.value})})]}),t.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[t.jsxs("div",{className:"space-y-2",children:[t.jsx(q,{className:"text-gray-300",children:"所属篇"}),t.jsxs(Jc,{value:M.partId,onValueChange:S=>V({...M,partId:S,chapterId:"chapter-1"}),children:[t.jsx(ci,{className:"bg-[#0a1628] border-gray-700 text-white",children:t.jsx(Zc,{})}),t.jsxs(di,{className:"bg-[#0f2137] border-gray-700",children:[te.map(S=>t.jsx(fr,{value:S.id,className:"text-white hover:bg-[#38bdac]/20 focus:bg-[#38bdac]/20",children:S.title},S.id)),te.length===0&&t.jsx(fr,{value:"part-1",className:"text-white hover:bg-[#38bdac]/20 focus:bg-[#38bdac]/20",children:"默认篇"})]})]})]}),t.jsxs("div",{className:"space-y-2",children:[t.jsx(q,{className:"text-gray-300",children:"所属章"}),t.jsxs(Jc,{value:M.chapterId,onValueChange:S=>V({...M,chapterId:S}),children:[t.jsx(ci,{className:"bg-[#0a1628] border-gray-700 text-white",children:t.jsx(Zc,{})}),t.jsxs(di,{className:"bg-[#0f2137] border-gray-700",children:[B.map(S=>t.jsx(fr,{value:S.id,className:"text-white hover:bg-[#38bdac]/20 focus:bg-[#38bdac]/20",children:S.title},S.id)),B.length===0&&t.jsx(fr,{value:"chapter-1",className:"text-white hover:bg-[#38bdac]/20 focus:bg-[#38bdac]/20",children:"默认章"})]})]})]})]}),t.jsxs("div",{className:"space-y-2",children:[t.jsx(q,{className:"text-gray-300",children:"内容 (Markdown格式)"}),t.jsx(Rs,{className:"bg-[#0a1628] border-gray-700 text-white min-h-[300px] font-mono text-sm placeholder:text-gray-500",placeholder:"输入章节内容...",value:M.content,onChange:S=>V({...M,content:S.target.value})})]})]}),t.jsxs(sn,{children:[t.jsx(de,{variant:"outline",onClick:()=>g(!1),className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:"取消"}),t.jsx(de,{onClick:Y,disabled:E||!M.id||!M.title,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:E?t.jsxs(t.Fragment,{children:[t.jsx(tt,{className:"w-4 h-4 mr-2 animate-spin"}),"创建中..."]}):t.jsxs(t.Fragment,{children:[t.jsx(pr,{className:"w-4 h-4 mr-2"}),"创建章节"]})})]})]})}),t.jsx(Kt,{open:!!f,onOpenChange:()=>m(null),children:t.jsxs($t,{className:"bg-[#0f2137] border-gray-700 text-white max-w-4xl max-h-[90vh] overflow-y-auto",showCloseButton:!0,children:[t.jsx(Gt,{children:t.jsxs(Yt,{className:"text-white flex items-center gap-2",children:[t.jsx(gr,{className:"w-5 h-5 text-[#38bdac]"}),"编辑章节"]})}),f&&t.jsxs("div",{className:"space-y-4 py-4",children:[t.jsxs("div",{className:"grid grid-cols-3 gap-4",children:[t.jsxs("div",{className:"space-y-2",children:[t.jsx(q,{className:"text-gray-300",children:"章节ID"}),t.jsx(ne,{className:"bg-[#0a1628] border-gray-700 text-white",value:f.id,disabled:!0})]}),t.jsxs("div",{className:"space-y-2",children:[t.jsx(q,{className:"text-gray-300",children:"价格 (元)"}),t.jsx(ne,{type:"number",className:"bg-[#0a1628] border-gray-700 text-white",value:f.isFree?0:f.price,onChange:S=>m({...f,price:Number(S.target.value),isFree:Number(S.target.value)===0}),disabled:f.isFree})]}),t.jsxs("div",{className:"space-y-2",children:[t.jsx(q,{className:"text-gray-300",children:"免费章节"}),t.jsx("div",{className:"flex items-center h-10",children:t.jsxs("label",{className:"flex items-center cursor-pointer",children:[t.jsx("input",{type:"checkbox",checked:f.isFree||f.price===0,onChange:S=>m({...f,isFree:S.target.checked,price:S.target.checked?0:1}),className:"w-5 h-5 rounded border-gray-600 bg-[#0a1628] text-[#38bdac] focus:ring-[#38bdac]"}),t.jsx("span",{className:"ml-2 text-gray-400 text-sm",children:"设为免费"})]})})]}),t.jsxs("div",{className:"space-y-2",children:[t.jsx(q,{className:"text-gray-300",children:"最新新增"}),t.jsx("div",{className:"flex items-center h-10",children:t.jsxs("label",{className:"flex items-center cursor-pointer",children:[t.jsx("input",{type:"checkbox",checked:f.isNew??!1,onChange:S=>m({...f,isNew:S.target.checked}),className:"w-5 h-5 rounded border-gray-600 bg-[#0a1628] text-[#38bdac] focus:ring-[#38bdac]"}),t.jsx("span",{className:"ml-2 text-gray-400 text-sm",children:"标记 NEW"})]})})]})]}),t.jsxs("div",{className:"space-y-2",children:[t.jsx(q,{className:"text-gray-300",children:"章节标题"}),t.jsx(ne,{className:"bg-[#0a1628] border-gray-700 text-white",value:f.title,onChange:S=>m({...f,title:S.target.value})})]}),f.filePath&&t.jsxs("div",{className:"space-y-2",children:[t.jsx(q,{className:"text-gray-300",children:"文件路径"}),t.jsx(ne,{className:"bg-[#0a1628] border-gray-700 text-gray-400 text-sm",value:f.filePath,disabled:!0})]}),t.jsxs("div",{className:"space-y-2",children:[t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsx(q,{className:"text-gray-300",children:"内容 (Markdown格式)"}),t.jsxs("div",{className:"flex gap-2",children:[t.jsx("input",{ref:G,type:"file",accept:"image/*",onChange:K,className:"hidden"}),t.jsxs(de,{variant:"outline",size:"sm",onClick:()=>{var S;return(S=G.current)==null?void 0:S.click()},disabled:_,className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:[_?t.jsx(tt,{className:"w-4 h-4 mr-1 animate-spin"}):t.jsx(qj,{className:"w-4 h-4 mr-1"}),"上传图片"]})]})]}),v?t.jsxs("div",{className:"bg-[#0a1628] border border-gray-700 rounded-md min-h-[400px] flex items-center justify-center",children:[t.jsx(tt,{className:"w-6 h-6 text-[#38bdac] animate-spin"}),t.jsx("span",{className:"ml-2 text-gray-400",children:"加载中..."})]}):t.jsx(Rs,{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:S=>m({...f,content:S.target.value})})]})]}),t.jsxs(sn,{children:[t.jsxs(de,{variant:"outline",onClick:()=>m(null),className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:[t.jsx(Pn,{className:"w-4 h-4 mr-2"}),"取消"]}),t.jsx(de,{onClick:W,disabled:E,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:E?t.jsxs(t.Fragment,{children:[t.jsx(tt,{className:"w-4 h-4 mr-2 animate-spin"}),"保存中..."]}):t.jsxs(t.Fragment,{children:[t.jsx(an,{className:"w-4 h-4 mr-2"}),"保存修改"]})})]})]})}),t.jsxs(Hd,{defaultValue:"chapters",className:"space-y-6",children:[t.jsxs(Li,{className:"bg-[#0f2137] border border-gray-700/50 p-1",children:[t.jsxs(nn,{value:"chapters",className:"data-[state=active]:bg-[#38bdac]/20 data-[state=active]:text-[#38bdac] text-gray-400",children:[t.jsx(Ts,{className:"w-4 h-4 mr-2"}),"章节管理"]}),t.jsxs(nn,{value:"search",className:"data-[state=active]:bg-[#38bdac]/20 data-[state=active]:text-[#38bdac] text-gray-400",children:[t.jsx(Hr,{className:"w-4 h-4 mr-2"}),"内容搜索"]}),t.jsxs(nn,{value:"hooks",className:"data-[state=active]:bg-[#38bdac]/20 data-[state=active]:text-[#38bdac] text-gray-400",children:[t.jsx(Ew,{className:"w-4 h-4 mr-2"}),"钩子配置"]})]}),t.jsxs(rn,{value:"chapters",className:"space-y-4",children:[t.jsxs(de,{onClick:()=>g(!0),className:"w-full bg-[#38bdac]/10 hover:bg-[#38bdac]/20 text-[#38bdac] border border-[#38bdac]/30",children:[t.jsx(pr,{className:"w-4 h-4 mr-2"}),"新建章节"]}),l?t.jsxs("div",{className:"flex items-center justify-center py-12",children:[t.jsx(tt,{className:"w-6 h-6 text-[#38bdac] animate-spin"}),t.jsx("span",{className:"ml-2 text-gray-400",children:"加载中..."})]}):te.map((S,D)=>t.jsxs(Ce,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl overflow-hidden",children:[t.jsx(Be,{className:"cursor-pointer hover:bg-[#162840] transition-colors",onClick:()=>ie(S.id),children:t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsxs("div",{className:"flex items-center gap-3",children:[t.jsxs("span",{className:"text-[#38bdac] font-mono text-sm",children:["0",D+1]}),t.jsx(Ve,{className:"text-white",children:S.title}),t.jsxs(De,{variant:"outline",className:"text-gray-400 border-gray-600",children:[S.chapters.reduce((ae,oe)=>ae+oe.sections.length,0)," 节"]})]}),t.jsx(dp,{className:`w-5 h-5 text-gray-400 transition-transform ${c.includes(S.id)?"rotate-90":""}`})]})}),c.includes(S.id)&&t.jsx(ke,{className:"pt-0 pb-4",children:t.jsx("div",{className:"space-y-3 pl-8 border-l-2 border-gray-700",children:S.chapters.map(ae=>t.jsxs("div",{className:"space-y-2",children:[t.jsx("h4",{className:"font-medium text-gray-300",children:ae.title}),t.jsx("div",{className:"space-y-1",children:ae.sections.map(oe=>t.jsxs("div",{className:"flex items-center justify-between py-2 px-3 rounded-lg hover:bg-[#162840] text-sm group transition-colors",children:[t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx(rd,{className:"w-4 h-4 text-[#38bdac]"}),t.jsx("span",{className:"text-gray-400",children:oe.title})]}),t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx("span",{className:"text-[#38bdac] font-medium",children:oe.price===0?"免费":`¥${oe.price}`}),t.jsxs(de,{variant:"ghost",size:"sm",onClick:()=>H(oe),className:"text-gray-500 hover:text-[#38bdac] hover:bg-[#38bdac]/10 opacity-0 group-hover:opacity-100 transition-opacity",children:[t.jsx(_d,{className:"w-4 h-4 mr-1"}),"读取"]}),t.jsxs(de,{variant:"ghost",size:"sm",onClick:()=>H(oe),className:"text-gray-500 hover:text-[#38bdac] hover:bg-[#38bdac]/10 opacity-0 group-hover:opacity-100 transition-opacity",children:[t.jsx(gr,{className:"w-4 h-4 mr-1"}),"编辑"]}),t.jsxs(de,{variant:"ghost",size:"sm",onClick:()=>fe(oe),className:"text-gray-500 hover:text-red-400 hover:bg-red-500/10 opacity-0 group-hover:opacity-100 transition-opacity",children:[t.jsx(Fa,{className:"w-4 h-4 mr-1"}),"删除"]})]})]},oe.id))})]},ae.id))})})]},S.id))]}),t.jsx(rn,{value:"search",className:"space-y-4",children:t.jsxs(Ce,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:[t.jsx(Be,{children:t.jsx(Ve,{className:"text-white",children:"内容搜索"})}),t.jsxs(ke,{className:"space-y-4",children:[t.jsxs("div",{className:"flex gap-2",children:[t.jsx(ne,{className:"bg-[#0a1628] border-gray-700 text-white placeholder:text-gray-500 flex-1",placeholder:"搜索标题或内容...",value:C,onChange:S=>N(S.target.value),onKeyDown:S=>S.key==="Enter"&&A()}),t.jsx(de,{onClick:A,disabled:R||!C.trim(),className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:R?t.jsx(tt,{className:"w-4 h-4 animate-spin"}):t.jsx(Hr,{className:"w-4 h-4"})})]}),b.length>0&&t.jsxs("div",{className:"space-y-2 mt-4",children:[t.jsxs("p",{className:"text-gray-400 text-sm",children:["找到 ",b.length," 个结果"]}),b.map(S=>t.jsxs("div",{className:"p-3 rounded-lg bg-[#162840] hover:bg-[#1a3050] cursor-pointer transition-colors",onClick:()=>H({id:S.id,title:S.title,price:S.price??1,filePath:""}),children:[t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsxs("div",{children:[t.jsx("span",{className:"text-[#38bdac] font-mono text-xs mr-2",children:S.id}),t.jsx("span",{className:"text-white",children:S.title})]}),t.jsx(De,{variant:"outline",className:"text-gray-400 border-gray-600 text-xs",children:S.matchType==="title"?"标题匹配":"内容匹配"})]}),S.snippet&&t.jsx("p",{className:"text-gray-500 text-xs mt-2 line-clamp-2",children:S.snippet}),(S.partTitle||S.chapterTitle)&&t.jsxs("p",{className:"text-gray-600 text-xs mt-1",children:[S.partTitle," · ",S.chapterTitle]})]},S.id))]})]})]})}),t.jsx(rn,{value:"hooks",className:"space-y-4",children:t.jsxs(Ce,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:[t.jsx(Be,{children:t.jsx(Ve,{className:"text-white",children:"引流钩子配置"})}),t.jsxs(ke,{className:"space-y-4",children:[t.jsxs("div",{className:"grid w-full max-w-sm items-center gap-1.5",children:[t.jsx(q,{htmlFor:"hook-chapter",className:"text-gray-300",children:"触发章节"}),t.jsxs(Jc,{defaultValue:"3",children:[t.jsx(ci,{id:"hook-chapter",className:"bg-[#0a1628] border-gray-700 text-white",children:t.jsx(Zc,{placeholder:"选择章节"})}),t.jsxs(di,{className:"bg-[#0f2137] border-gray-700",children:[t.jsx(fr,{value:"1",className:"text-white hover:bg-[#38bdac]/20 focus:bg-[#38bdac]/20",children:"第一章"}),t.jsx(fr,{value:"2",className:"text-white hover:bg-[#38bdac]/20 focus:bg-[#38bdac]/20",children:"第二章"}),t.jsx(fr,{value:"3",className:"text-white hover:bg-[#38bdac]/20 focus:bg-[#38bdac]/20",children:"第三章 (默认)"})]})]})]}),t.jsxs("div",{className:"grid w-full gap-1.5",children:[t.jsx(q,{htmlFor:"message",className:"text-gray-300",children:"引流文案"}),t.jsx(Rs,{placeholder:"输入引导用户加群的文案...",id:"message",className:"bg-[#0a1628] border-gray-700 text-white placeholder:text-gray-500",defaultValue:"阅读更多精彩内容,请加入Soul创业实验派对群..."})]}),t.jsx(de,{className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:"保存配置"})]})]})})]})]})}function xC(){const[r,a]=p.useState([]),[l,o]=p.useState(null),[c,u]=p.useState(!0),[f,m]=p.useState(null),[x,g]=p.useState([]),[v,y]=p.useState(null),[E,P]=p.useState(1);async function C(){u(!0),m(null);try{const R=await He("/api/admin/chapters");R!=null&&R.success&&R.data?(a(R.data.structure??[]),o(R.data.stats??null)):m("加载章节失败")}catch(R){console.error("加载章节失败:",R),m("加载失败,请检查网络后重试")}finally{u(!1)}}p.useEffect(()=>{C()},[]);const N=R=>{g(j=>j.includes(R)?j.filter(_=>_!==R):[...j,R])},b=async R=>{try{const j=await jt("/api/admin/chapters",{action:"updatePrice",chapterId:R,data:{price:E}});j!=null&&j.success&&(alert("价格更新成功"),y(null),C())}catch(j){console.error("更新价格失败:",j)}},k=async(R,j)=>{try{const _=await jt("/api/admin/chapters",{action:"toggleFree",chapterId:R,data:{isFree:!j}});_!=null&&_.success&&(alert("状态更新成功"),C())}catch(_){console.error("更新状态失败:",_)}};return c?t.jsx("div",{className:"min-h-[60vh] flex items-center justify-center",children:t.jsx("div",{className:"text-xl text-gray-400",children:"加载中..."})}):t.jsxs("div",{className:"min-h-screen bg-black text-white",children:[t.jsx("div",{className:"sticky top-0 bg-black/90 backdrop-blur border-b border-white/10 z-50",children:t.jsxs("div",{className:"w-full min-w-[1024px] px-4 py-4 flex items-center justify-between",children:[t.jsx("h1",{className:"text-xl font-bold",children:"章节管理"}),t.jsxs("div",{className:"flex items-center gap-4",children:[t.jsx("button",{type:"button",onClick:C,disabled:c,className:"px-4 py-2 bg-white/10 rounded-lg hover:bg-white/20 text-white disabled:opacity-50",children:"刷新"}),t.jsx("button",{type:"button",onClick:()=>g(r.map(R=>R.id)),className:"px-4 py-2 bg-white/10 rounded-lg hover:bg-white/20 text-white",children:"展开全部"}),t.jsx("button",{type:"button",onClick:()=>g([]),className:"px-4 py-2 bg-white/10 rounded-lg hover:bg-white/20 text-white",children:"收起全部"})]})]})}),t.jsxs("div",{className:"w-full min-w-[1024px] px-4 py-8",children:[f&&t.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:[t.jsx("span",{children:f}),t.jsx("button",{type:"button",onClick:()=>m(null),className:"hover:text-red-300",children:"×"})]}),l&&t.jsxs("div",{className:"grid grid-cols-4 gap-4 mb-8",children:[t.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:[t.jsx("div",{className:"text-3xl font-bold text-cyan-400",children:l.totalSections}),t.jsx("div",{className:"text-white/60 text-sm mt-1",children:"总章节数"})]}),t.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:[t.jsx("div",{className:"text-3xl font-bold text-green-400",children:l.freeSections}),t.jsx("div",{className:"text-white/60 text-sm mt-1",children:"免费章节"})]}),t.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:[t.jsx("div",{className:"text-3xl font-bold text-yellow-400",children:l.paidSections}),t.jsx("div",{className:"text-white/60 text-sm mt-1",children:"付费章节"})]}),t.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:[t.jsx("div",{className:"text-3xl font-bold text-purple-400",children:l.totalParts}),t.jsx("div",{className:"text-white/60 text-sm mt-1",children:"篇章数"})]})]}),t.jsx("div",{className:"space-y-4",children:r.map(R=>t.jsxs("div",{className:"bg-white/5 border border-white/10 rounded-xl overflow-hidden",children:[t.jsxs("div",{className:"flex items-center justify-between p-4 cursor-pointer hover:bg-white/5",onClick:()=>N(R.id),onKeyDown:j=>j.key==="Enter"&&N(R.id),role:"button",tabIndex:0,children:[t.jsxs("div",{className:"flex items-center gap-3",children:[t.jsx("span",{className:"text-2xl",children:R.type==="preface"?"📖":R.type==="epilogue"?"🎬":R.type==="appendix"?"📎":"📚"}),t.jsx("span",{className:"font-semibold text-white",children:R.title}),t.jsxs("span",{className:"text-white/40 text-sm",children:["(",R.chapters.reduce((j,_)=>{var F;return j+(((F=_.sections)==null?void 0:F.length)||1)},0)," 节)"]})]}),t.jsx("span",{className:"text-white/40",children:x.includes(R.id)?"▲":"▼"})]}),x.includes(R.id)&&t.jsx("div",{className:"border-t border-white/10",children:R.chapters.map(j=>t.jsx("div",{className:"border-b border-white/5 last:border-b-0",children:j.sections?t.jsxs(t.Fragment,{children:[t.jsx("div",{className:"px-6 py-3 bg-white/5 text-white/70 font-medium",children:j.title}),t.jsx("div",{className:"divide-y divide-white/5",children:j.sections.map(_=>t.jsxs("div",{className:"flex items-center justify-between px-6 py-3 hover:bg-white/5",children:[t.jsxs("div",{className:"flex items-center gap-3",children:[t.jsx("span",{className:_.isFree?"text-green-400":"text-yellow-400",children:_.isFree?"🔓":"🔒"}),t.jsx("span",{className:"text-white/80",children:_.id}),t.jsx("span",{className:"text-white/60",children:_.title})]}),t.jsx("div",{className:"flex items-center gap-3",children:v===_.id?t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx("input",{type:"number",value:E,onChange:F=>P(Number(F.target.value)),className:"w-20 px-2 py-1 bg-white/10 border border-white/20 rounded text-white",min:0,step:.1}),t.jsx("button",{type:"button",onClick:()=>b(_.id),className:"px-3 py-1 bg-cyan-500 text-black rounded text-sm",children:"保存"}),t.jsx("button",{type:"button",onClick:()=>y(null),className:"px-3 py-1 bg-white/20 rounded text-sm text-white",children:"取消"})]}):t.jsxs(t.Fragment,{children:[t.jsx("span",{className:`px-2 py-1 rounded text-xs ${_.isFree?"bg-green-500/20 text-green-400":"bg-yellow-500/20 text-yellow-400"}`,children:_.isFree?"免费":`¥${_.price}`}),t.jsx("button",{type:"button",onClick:()=>{y(_.id),P(_.price)},className:"px-2 py-1 text-xs bg-white/10 rounded hover:bg-white/20 text-white",children:"编辑价格"}),t.jsx("button",{type:"button",onClick:()=>k(_.id,_.isFree),className:"px-2 py-1 text-xs bg-white/10 rounded hover:bg-white/20 text-white",children:_.isFree?"设为付费":"设为免费"})]})})]},_.id))})]}):t.jsxs("div",{className:"flex items-center justify-between px-6 py-3 hover:bg-white/5",children:[t.jsxs("div",{className:"flex items-center gap-3",children:[t.jsx("span",{className:j.isFree?"text-green-400":"text-yellow-400",children:j.isFree?"🔓":"🔒"}),t.jsx("span",{className:"text-white/80",children:j.title})]}),t.jsx("span",{className:`px-2 py-1 rounded text-xs ${j.isFree?"bg-green-500/20 text-green-400":"bg-yellow-500/20 text-yellow-400"}`,children:j.isFree?"免费":`¥${j.price??1}`})]})},j.id))})]},R.id))})]})]})}var Lg=["PageUp","PageDown"],Dg=["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,gC,vC]=Ud(Bs),[Fg]=Cr(Bs,[vC]),[yC,Ui]=Fg(Bs),zg=p.forwardRef((r,a)=>{const{name:l,min:o=0,max:c=100,step:u=1,orientation:f="horizontal",disabled:m=!1,minStepsBetweenThumbs:x=0,defaultValue:g=[o],value:v,onValueChange:y=()=>{},onValueCommit:E=()=>{},inverted:P=!1,form:C,...N}=r,b=p.useRef(new Set),k=p.useRef(0),j=f==="horizontal"?jC:wC,[_=[],F]=Gr({prop:v,defaultProp:g,onChange:ce=>{var fe;(fe=[...b.current][k.current])==null||fe.focus(),y(ce)}}),G=p.useRef(_);function M(ce){const ie=kC(_,ce);ue(ce,ie)}function V(ce){ue(ce,k.current)}function te(){const ce=G.current[k.current];_[k.current]!==ce&&E(_)}function ue(ce,ie,{commit:fe}={commit:!1}){const H=_C(u),W=TC(Math.round((ce-o)/u)*u+o,H),Y=vi(W,[o,c]);F((K=[])=>{const A=SC(K,Y,ie);if(RC(A,x*u)){k.current=A.indexOf(Y);const J=String(A)!==String(K);return J&&fe&&E(A),J?A:K}else return K})}return t.jsx(yC,{scope:r.__scopeSlider,name:l,disabled:m,min:o,max:c,valueIndexToChangeRef:k,thumbs:b.current,values:_,orientation:f,form:C,children:t.jsx(wd.Provider,{scope:r.__scopeSlider,children:t.jsx(wd.Slot,{scope:r.__scopeSlider,children:t.jsx(j,{"aria-disabled":m,"data-disabled":m?"":void 0,...N,ref:a,onPointerDown:Ae(N.onPointerDown,()=>{m||(G.current=_)}),min:o,max:c,inverted:P,onSlideStart:m?void 0:M,onSlideMove:m?void 0:V,onSlideEnd:m?void 0:te,onHomeKeyDown:()=>!m&&ue(o,0,{commit:!0}),onEndKeyDown:()=>!m&&ue(c,_.length-1,{commit:!0}),onStepKeyDown:({event:ce,direction:ie})=>{if(!m){const W=Lg.includes(ce.key)||ce.shiftKey&&Dg.includes(ce.key)?10:1,Y=k.current,K=_[Y],A=u*W*ie;ue(K+A,Y,{commit:!0})}}})})})})});zg.displayName=Bs;var[$g,Bg]=Fg(Bs,{startEdge:"left",endEdge:"right",size:"width",direction:1}),jC=p.forwardRef((r,a)=>{const{min:l,max:o,dir:c,inverted:u,onSlideStart:f,onSlideMove:m,onSlideEnd:x,onStepKeyDown:g,...v}=r,[y,E]=p.useState(null),P=Ke(a,j=>E(j)),C=p.useRef(void 0),N=Ai(c),b=N==="ltr",k=b&&!u||!b&&u;function R(j){const _=C.current||y.getBoundingClientRect(),F=[0,_.width],M=tu(F,k?[l,o]:[o,l]);return C.current=_,M(j-_.left)}return t.jsx($g,{scope:r.__scopeSlider,startEdge:k?"left":"right",endEdge:k?"right":"left",direction:k?1:-1,size:"width",children:t.jsx(Vg,{dir:N,"data-orientation":"horizontal",...v,ref:P,style:{...v.style,"--radix-slider-thumb-transform":"translateX(-50%)"},onSlideStart:j=>{const _=R(j.clientX);f==null||f(_)},onSlideMove:j=>{const _=R(j.clientX);m==null||m(_)},onSlideEnd:()=>{C.current=void 0,x==null||x()},onStepKeyDown:j=>{const F=Og[k?"from-left":"from-right"].includes(j.key);g==null||g({event:j,direction:F?-1:1})}})})}),wC=p.forwardRef((r,a)=>{const{min:l,max:o,inverted:c,onSlideStart:u,onSlideMove:f,onSlideEnd:m,onStepKeyDown:x,...g}=r,v=p.useRef(null),y=Ke(a,v),E=p.useRef(void 0),P=!c;function C(N){const b=E.current||v.current.getBoundingClientRect(),k=[0,b.height],j=tu(k,P?[o,l]:[l,o]);return E.current=b,j(N-b.top)}return t.jsx($g,{scope:r.__scopeSlider,startEdge:P?"bottom":"top",endEdge:P?"top":"bottom",size:"height",direction:P?1:-1,children:t.jsx(Vg,{"data-orientation":"vertical",...g,ref:y,style:{...g.style,"--radix-slider-thumb-transform":"translateY(50%)"},onSlideStart:N=>{const b=C(N.clientY);u==null||u(b)},onSlideMove:N=>{const b=C(N.clientY);f==null||f(b)},onSlideEnd:()=>{E.current=void 0,m==null||m()},onStepKeyDown:N=>{const k=Og[P?"from-bottom":"from-top"].includes(N.key);x==null||x({event:N,direction:k?-1:1})}})})}),Vg=p.forwardRef((r,a)=>{const{__scopeSlider:l,onSlideStart:o,onSlideMove:c,onSlideEnd:u,onHomeKeyDown:f,onEndKeyDown:m,onStepKeyDown:x,...g}=r,v=Ui(Bs,l);return t.jsx(Oe.span,{...g,ref:a,onKeyDown:Ae(r.onKeyDown,y=>{y.key==="Home"?(f(y),y.preventDefault()):y.key==="End"?(m(y),y.preventDefault()):Lg.concat(Dg).includes(y.key)&&(x(y),y.preventDefault())}),onPointerDown:Ae(r.onPointerDown,y=>{const E=y.target;E.setPointerCapture(y.pointerId),y.preventDefault(),v.thumbs.has(E)?E.focus():o(y)}),onPointerMove:Ae(r.onPointerMove,y=>{y.target.hasPointerCapture(y.pointerId)&&c(y)}),onPointerUp:Ae(r.onPointerUp,y=>{const E=y.target;E.hasPointerCapture(y.pointerId)&&(E.releasePointerCapture(y.pointerId),u(y))})})}),Ug="SliderTrack",Wg=p.forwardRef((r,a)=>{const{__scopeSlider:l,...o}=r,c=Ui(Ug,l);return t.jsx(Oe.span,{"data-disabled":c.disabled?"":void 0,"data-orientation":c.orientation,...o,ref:a})});Wg.displayName=Ug;var Nd="SliderRange",Hg=p.forwardRef((r,a)=>{const{__scopeSlider:l,...o}=r,c=Ui(Nd,l),u=Bg(Nd,l),f=p.useRef(null),m=Ke(a,f),x=c.values.length,g=c.values.map(E=>Yg(E,c.min,c.max)),v=x>1?Math.min(...g):0,y=100-Math.max(...g);return t.jsx(Oe.span,{"data-orientation":c.orientation,"data-disabled":c.disabled?"":void 0,...o,ref:m,style:{...r.style,[u.startEdge]:v+"%",[u.endEdge]:y+"%"}})});Hg.displayName=Nd;var bd="SliderThumb",Kg=p.forwardRef((r,a)=>{const l=gC(r.__scopeSlider),[o,c]=p.useState(null),u=Ke(a,m=>c(m)),f=p.useMemo(()=>o?l().findIndex(m=>m.ref.current===o):-1,[l,o]);return t.jsx(NC,{...r,ref:u,index:f})}),NC=p.forwardRef((r,a)=>{const{__scopeSlider:l,index:o,name:c,...u}=r,f=Ui(bd,l),m=Bg(bd,l),[x,g]=p.useState(null),v=Ke(a,R=>g(R)),y=x?f.form||!!x.closest("form"):!0,E=Vd(x),P=f.values[o],C=P===void 0?0:Yg(P,f.min,f.max),N=CC(o,f.values.length),b=E==null?void 0:E[m.size],k=b?EC(b,C,m.direction):0;return p.useEffect(()=>{if(x)return f.thumbs.add(x),()=>{f.thumbs.delete(x)}},[x,f.thumbs]),t.jsxs("span",{style:{transform:"var(--radix-slider-thumb-transform)",position:"absolute",[m.startEdge]:`calc(${C}% + ${k}px)`},children:[t.jsx(wd.ItemSlot,{scope:r.__scopeSlider,children:t.jsx(Oe.span,{role:"slider","aria-label":r["aria-label"]||N,"aria-valuemin":f.min,"aria-valuenow":P,"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:v,style:P===void 0?{display:"none"}:r.style,onFocus:Ae(r.onFocus,()=>{f.valueIndexToChangeRef.current=o})})}),y&&t.jsx(Gg,{name:c??(f.name?f.name+(f.values.length>1?"[]":""):void 0),form:f.form,value:P},o)]})});Kg.displayName=bd;var bC="RadioBubbleInput",Gg=p.forwardRef(({__scopeSlider:r,value:a,...l},o)=>{const c=p.useRef(null),u=Ke(c,o),f=Bd(a);return p.useEffect(()=>{const m=c.current;if(!m)return;const x=window.HTMLInputElement.prototype,v=Object.getOwnPropertyDescriptor(x,"value").set;if(f!==a&&v){const y=new Event("input",{bubbles:!0});v.call(m,a),m.dispatchEvent(y)}},[f,a]),t.jsx(Oe.input,{style:{display:"none"},...l,ref:u,defaultValue:a})});Gg.displayName=bC;function SC(r=[],a,l){const o=[...r];return o[l]=a,o.sort((c,u)=>c-u)}function Yg(r,a,l){const u=100/(l-a)*(r-a);return vi(u,[0,100])}function CC(r,a){return a>2?`Value ${r+1} of ${a}`:a===2?["Minimum","Maximum"][r]:void 0}function kC(r,a){if(r.length===1)return 0;const l=r.map(c=>Math.abs(c-a)),o=Math.min(...l);return l.indexOf(o)}function EC(r,a,l){const o=r/2,u=tu([0,50],[0,o]);return(o-u(a)*l)*l}function PC(r){return r.slice(0,-1).map((a,l)=>r[l+1]-a)}function RC(r,a){if(a>0){const l=PC(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 o=(a[1]-a[0])/(r[1]-r[0]);return a[0]+o*(l-r[0])}}function _C(r){return(String(r).split(".")[1]||"").length}function TC(r,a){const l=Math.pow(10,a);return Math.round(r*l)/l}var IC=zg,AC=Wg,MC=Hg,LC=Kg;function DC({className:r,defaultValue:a,value:l,min:o=0,max:c=100,...u}){const f=p.useMemo(()=>Array.isArray(l)?l:Array.isArray(a)?a:[o,c],[l,a,o,c]);return t.jsxs(IC,{defaultValue:a,value:l,min:o,max:c,className:Ge("relative flex w-full touch-none items-center select-none data-[disabled]:opacity-50",r),...u,children:[t.jsx(AC,{className:"bg-gray-600 relative grow overflow-hidden rounded-full h-1.5 w-full",children:t.jsx(MC,{className:"bg-[#38bdac] absolute h-full rounded-full"})}),Array.from({length:f.length},(m,x)=>t.jsx(LC,{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 OC={distributorShare:90,minWithdrawAmount:10,bindingDays:30,userDiscount:5,enableAutoWithdraw:!1,vipOrderShareVip:20,vipOrderShareNonVip:10};function FC(){const[r,a]=p.useState(OC),[l,o]=p.useState(!0),[c,u]=p.useState(!1);p.useEffect(()=>{He("/api/admin/referral-settings").then(x=>{const g=x==null?void 0:x.data;g&&typeof g=="object"&&a({distributorShare:g.distributorShare??90,minWithdrawAmount:g.minWithdrawAmount??10,bindingDays:g.bindingDays??30,userDiscount:g.userDiscount??5,enableAutoWithdraw:g.enableAutoWithdraw??!1,vipOrderShareVip:g.vipOrderShareVip??20,vipOrderShareNonVip:g.vipOrderShareNonVip??10})}).catch(console.error).finally(()=>o(!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},g=await jt("/api/admin/referral-settings",x);if(!g||g.success===!1){alert("保存失败: "+(g&&typeof g=="object"&&"error"in g?g.error:""));return}alert(`✅ 分销配置已保存成功! - -• 小程序与网站的推广规则会一起生效 -• 绑定关系会使用新的天数配置 -• 佣金比例会立即应用到新订单 - -如有缓存,请刷新前台/小程序页面。`)}catch(x){console.error(x),alert("保存失败: "+(x instanceof Error?x.message:String(x)))}finally{u(!1)}},m=x=>g=>{const v=parseFloat(g.target.value||"0");a(y=>({...y,[x]:isNaN(v)?0:v}))};return l?t.jsx("div",{className:"p-8 text-gray-500",children:"加载中..."}):t.jsxs("div",{className:"p-8 w-full",children:[t.jsxs("div",{className:"flex justify-between items-center mb-8",children:[t.jsxs("div",{children:[t.jsxs("h2",{className:"text-2xl font-bold text-white flex items-center gap-2",children:[t.jsx(Is,{className:"w-5 h-5 text-[#38bdac]"}),"推广 / 分销设置"]}),t.jsx("p",{className:"text-gray-400 mt-1",children:"统一管理「好友优惠」「你得 90% 收益」「绑定期 30 天」「提现门槛」等规则,小程序和 Web 共用这套配置。"})]}),t.jsxs(de,{onClick:f,disabled:c||l,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:[t.jsx(an,{className:"w-4 h-4 mr-2"}),c?"保存中...":"保存配置"]})]}),t.jsxs("div",{className:"space-y-6",children:[t.jsxs(Ce,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:[t.jsxs(Be,{children:[t.jsxs(Ve,{className:"flex items-center gap-2 text-white",children:[t.jsx(gw,{className:"w-4 h-4 text-[#38bdac]"}),"推广规则"]}),t.jsx(ht,{className:"text-gray-400",children:"这三项会直接体现在小程序「推广规则」卡片上,同时影响实收佣金计算。"})]}),t.jsx(ke,{className:"space-y-6",children:t.jsxs("div",{className:"grid grid-cols-3 gap-6",children:[t.jsxs("div",{className:"space-y-2",children:[t.jsxs(q,{className:"text-gray-300 flex items-center gap-2",children:[t.jsx(ql,{className:"w-3 h-3 text-[#38bdac]"}),"好友优惠(%)"]}),t.jsx(ne,{type:"number",min:0,max:100,className:"bg-[#0a1628] border-gray-700 text-white",value:r.userDiscount,onChange:m("userDiscount")}),t.jsx("p",{className:"text-xs text-gray-500",children:"例如 5 表示好友立减 5%(在价格配置基础上生效)。"})]}),t.jsxs("div",{className:"space-y-2",children:[t.jsxs(q,{className:"text-gray-300 flex items-center gap-2",children:[t.jsx(xn,{className:"w-3 h-3 text-[#38bdac]"}),"推广者分成(%)"]}),t.jsxs("div",{className:"flex items-center gap-4",children:[t.jsx(DC,{className:"flex-1",min:10,max:100,step:1,value:[r.distributorShare],onValueChange:([x])=>a(g=>({...g,distributorShare:x}))}),t.jsx(ne,{type:"number",min:0,max:100,className:"w-20 bg-[#0a1628] border-gray-700 text-white text-center",value:r.distributorShare,onChange:m("distributorShare")})]}),t.jsxs("p",{className:"text-xs text-gray-500",children:["内容订单佣金 = 订单金额 ×"," ",t.jsxs("span",{className:"text-[#38bdac] font-mono",children:[r.distributorShare,"%"]}),";会员订单见下方。"]})]}),t.jsxs("div",{className:"space-y-2",children:[t.jsxs(q,{className:"text-gray-300 flex items-center gap-2",children:[t.jsx(ql,{className:"w-3 h-3 text-[#38bdac]"}),"会员订单分润(推广者是会员 %)"]}),t.jsx(ne,{type:"number",min:0,max:100,className:"bg-[#0a1628] border-gray-700 text-white",value:r.vipOrderShareVip,onChange:m("vipOrderShareVip")}),t.jsx("p",{className:"text-xs text-gray-500",children:"推广者已是会员时,会员订单佣金比例,默认 20%。"})]}),t.jsxs("div",{className:"space-y-2",children:[t.jsxs(q,{className:"text-gray-300 flex items-center gap-2",children:[t.jsx(ql,{className:"w-3 h-3 text-[#38bdac]"}),"会员订单分润(推广者非会员 %)"]}),t.jsx(ne,{type:"number",min:0,max:100,className:"bg-[#0a1628] border-gray-700 text-white",value:r.vipOrderShareNonVip,onChange:m("vipOrderShareNonVip")}),t.jsx("p",{className:"text-xs text-gray-500",children:"推广者非会员时,会员订单佣金比例,默认 10%。"})]}),t.jsxs("div",{className:"space-y-2",children:[t.jsxs(q,{className:"text-gray-300 flex items-center gap-2",children:[t.jsx(xn,{className:"w-3 h-3 text-[#38bdac]"}),"绑定有效期(天)"]}),t.jsx(ne,{type:"number",min:1,max:365,className:"bg-[#0a1628] border-gray-700 text-white",value:r.bindingDays,onChange:m("bindingDays")}),t.jsx("p",{className:"text-xs text-gray-500",children:"好友通过你的链接进来并登录后,绑定在你名下的天数。"})]})]})})]}),t.jsxs(Ce,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:[t.jsxs(Be,{children:[t.jsxs(Ve,{className:"flex items-center gap-2 text-white",children:[t.jsx(Is,{className:"w-4 h-4 text-[#38bdac]"}),"提现规则"]}),t.jsx(ht,{className:"text-gray-400",children:"与「提现中心」「自动提现」相关的参数,影响推广者看到的可提现金额和最低门槛。"})]}),t.jsx(ke,{className:"space-y-6",children:t.jsxs("div",{className:"grid grid-cols-2 gap-6",children:[t.jsxs("div",{className:"space-y-2",children:[t.jsx(q,{className:"text-gray-300",children:"最低提现金额(元)"}),t.jsx(ne,{type:"number",min:0,step:1,className:"bg-[#0a1628] border-gray-700 text-white",value:r.minWithdrawAmount,onChange:m("minWithdrawAmount")}),t.jsx("p",{className:"text-xs text-gray-500",children:"小程序「满 X 元可提现」展示的门槛,同时用于后端接口校验。"})]}),t.jsxs("div",{className:"space-y-2",children:[t.jsxs(q,{className:"text-gray-300 flex items-center gap-2",children:["自动提现开关",t.jsx(De,{variant:"outline",className:"border-[#38bdac]/40 text-[#38bdac] text-[10px]",children:"预留"})]}),t.jsxs("div",{className:"flex items-center gap-3 mt-1",children:[t.jsx(ft,{checked:r.enableAutoWithdraw,onCheckedChange:x=>a(g=>({...g,enableAutoWithdraw:x}))}),t.jsx("span",{className:"text-sm text-gray-400",children:"开启后,可结合定时任务实现「收益自动打款到微信零钱」。"})]})]})]})})]}),t.jsxs(Ce,{className:"bg-[#0f2137] border-gray-700/50",children:[t.jsx(Be,{children:t.jsxs(Ve,{className:"flex items-center gap-2 text-gray-200 text-sm",children:[t.jsx(ql,{className:"w-4 h-4 text-[#38bdac]"}),"使用说明"]})}),t.jsxs(ke,{className:"space-y-2 text-xs text-gray-400 leading-relaxed",children:[t.jsxs("p",{children:["1. 以上配置会写入"," ",t.jsx("code",{className:"font-mono text-[11px] text-[#38bdac]",children:"system_config.referral_config"}),",小程序「推广中心」、Web 推广页以及支付回调都会读取同一份配置。"]}),t.jsx("p",{children:"2. 修改后新订单立即生效;旧订单的历史佣金不会自动重算,只影响之后产生的订单。"}),t.jsx("p",{children:"3. 如遇前端展示与实际结算不一致,优先以此处配置为准,再排查缓存和小程序版本。"})]})]})]})]})}const zC={appId:"wxb8bbb2b10dec74aa",withdrawSubscribeTmplId:"u3MbZGPRkrZIk-I7QdpwzFxnO_CeQPaCWF2FkiIablE",mchId:"1318592501",minWithdraw:10},$C={name:"卡若",startDate:"2025年10月15日",bio:"连续创业者,私域运营专家,每天早上6-9点在Soul派对房分享真实商业故事",liveTime:"06:00-09:00",platform:"Soul派对房",description:"连续创业者,私域运营专家"},BC={sectionPrice:1,baseBookPrice:9.9,distributorShare:90,authorInfo:{...$C}},VC={matchEnabled:!0,referralEnabled:!0,searchEnabled:!0,aboutEnabled:!0};function UC(){const[r,a]=p.useState(BC),[l,o]=p.useState(["preface","epilogue","1.1","appendix-1","appendix-2","appendix-3"]),[c,u]=p.useState(""),[f,m]=p.useState(VC),[x,g]=p.useState(zC),[v,y]=p.useState(!1),[E,P]=p.useState(!0),[C,N]=p.useState(!1),[b,k]=p.useState(""),[R,j]=p.useState(""),[_,F]=p.useState(!1),[G,M]=p.useState(!1),V=(H,W,Y=!1)=>{k(H),j(W),F(Y),N(!0)};p.useEffect(()=>{(async()=>{try{const W=await He("/api/admin/settings");if(!W||W.success===!1)return;if(Array.isArray(W.freeChapters)&&W.freeChapters.length&&o(W.freeChapters),W.featureConfig&&Object.keys(W.featureConfig).length&&m(Y=>({...Y,...W.featureConfig})),W.mpConfig&&typeof W.mpConfig=="object"&&g(Y=>({...Y,...W.mpConfig})),W.siteSettings&&typeof W.siteSettings=="object"){const Y=W.siteSettings;a(K=>({...K,...typeof Y.sectionPrice=="number"&&{sectionPrice:Y.sectionPrice},...typeof Y.baseBookPrice=="number"&&{baseBookPrice:Y.baseBookPrice},...typeof Y.distributorShare=="number"&&{distributorShare:Y.distributorShare},...Y.authorInfo&&typeof Y.authorInfo=="object"&&{authorInfo:{...K.authorInfo,...Y.authorInfo}}}))}}catch(W){console.error("Load settings error:",W)}finally{P(!1)}})()},[]);const te=async(H,W)=>{M(!0);try{const Y=await jt("/api/admin/settings",{featureConfig:H});if(!Y||Y.success===!1){W(),V("保存失败",(Y==null?void 0:Y.error)??"未知错误",!0);return}V("已保存","功能开关已更新,相关入口将随之显示或隐藏。")}catch(Y){console.error("Save feature config error:",Y),W(),V("保存失败",Y instanceof Error?Y.message:String(Y),!0)}finally{M(!1)}},ue=(H,W)=>{const Y=f,K={...Y,[H]:W};m(K),te(K,()=>m(Y))},ce=async()=>{y(!0);try{const H=await jt("/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(!H||H.success===!1){V("保存失败",(H==null?void 0:H.error)??"未知错误",!0);return}V("已保存","设置已保存成功。")}catch(H){console.error("Save settings error:",H),V("保存失败",H instanceof Error?H.message:String(H),!0)}finally{y(!1)}},ie=()=>{c&&!l.includes(c)&&(o([...l,c]),u(""))},fe=H=>{o(l.filter(W=>W!==H))};return E?t.jsx("div",{className:"p-8 text-gray-500",children:"加载中..."}):t.jsxs("div",{className:"p-8 w-full",children:[t.jsxs("div",{className:"flex justify-between items-center mb-8",children:[t.jsxs("div",{children:[t.jsx("h2",{className:"text-2xl font-bold text-white",children:"系统设置"}),t.jsx("p",{className:"text-gray-400 mt-1",children:"配置全站基础参数与开关"})]}),t.jsxs(de,{onClick:ce,disabled:v,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:[t.jsx(an,{className:"w-4 h-4 mr-2"}),v?"保存中...":"保存设置"]})]}),t.jsxs("div",{className:"space-y-6",children:[t.jsxs(Ce,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:[t.jsxs(Be,{children:[t.jsxs(Ve,{className:"text-white flex items-center gap-2",children:[t.jsx(om,{className:"w-5 h-5 text-[#38bdac]"}),"关于作者"]}),t.jsx(ht,{className:"text-gray-400",children:'配置作者信息,将在"关于作者"页面显示'})]}),t.jsxs(ke,{className:"space-y-4",children:[t.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[t.jsxs("div",{className:"space-y-2",children:[t.jsxs(q,{htmlFor:"author-name",className:"text-gray-300 flex items-center gap-1",children:[t.jsx(om,{className:"w-3 h-3"}),"主理人名称"]}),t.jsx(ne,{id:"author-name",className:"bg-[#0a1628] border-gray-700 text-white",value:r.authorInfo.name??"",onChange:H=>a(W=>({...W,authorInfo:{...W.authorInfo,name:H.target.value}}))})]}),t.jsxs("div",{className:"space-y-2",children:[t.jsxs(q,{htmlFor:"start-date",className:"text-gray-300 flex items-center gap-1",children:[t.jsx(Aa,{className:"w-3 h-3"}),"开播日期"]}),t.jsx(ne,{id:"start-date",className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"例如: 2025年10月15日",value:r.authorInfo.startDate??"",onChange:H=>a(W=>({...W,authorInfo:{...W.authorInfo,startDate:H.target.value}}))})]})]}),t.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[t.jsxs("div",{className:"space-y-2",children:[t.jsxs(q,{htmlFor:"live-time",className:"text-gray-300 flex items-center gap-1",children:[t.jsx(Aa,{className:"w-3 h-3"}),"直播时间"]}),t.jsx(ne,{id:"live-time",className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"例如: 06:00-09:00",value:r.authorInfo.liveTime??"",onChange:H=>a(W=>({...W,authorInfo:{...W.authorInfo,liveTime:H.target.value}}))})]}),t.jsxs("div",{className:"space-y-2",children:[t.jsxs(q,{htmlFor:"platform",className:"text-gray-300 flex items-center gap-1",children:[t.jsx(ow,{className:"w-3 h-3"}),"直播平台"]}),t.jsx(ne,{id:"platform",className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"例如: Soul派对房",value:r.authorInfo.platform??"",onChange:H=>a(W=>({...W,authorInfo:{...W.authorInfo,platform:H.target.value}}))})]})]}),t.jsxs("div",{className:"space-y-2",children:[t.jsxs(q,{htmlFor:"description",className:"text-gray-300 flex items-center gap-1",children:[t.jsx(Ts,{className:"w-3 h-3"}),"简介描述"]}),t.jsx(ne,{id:"description",className:"bg-[#0a1628] border-gray-700 text-white",value:r.authorInfo.description??"",onChange:H=>a(W=>({...W,authorInfo:{...W.authorInfo,description:H.target.value}}))})]}),t.jsxs("div",{className:"space-y-2",children:[t.jsx(q,{htmlFor:"bio",className:"text-gray-300",children:"详细介绍"}),t.jsx(Rs,{id:"bio",className:"bg-[#0a1628] border-gray-700 text-white min-h-[100px]",placeholder:"输入作者详细介绍...",value:r.authorInfo.bio??"",onChange:H=>a(W=>({...W,authorInfo:{...W.authorInfo,bio:H.target.value}}))})]}),t.jsxs("div",{className:"mt-4 p-4 rounded-xl bg-[#0a1628] border border-[#38bdac]/30",children:[t.jsx("p",{className:"text-xs text-gray-500 mb-2",children:"预览效果"}),t.jsxs("div",{className:"flex items-center gap-3",children:[t.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)}),t.jsxs("div",{children:[t.jsx("p",{className:"text-white font-semibold",children:r.authorInfo.name}),t.jsx("p",{className:"text-gray-400 text-xs",children:r.authorInfo.description}),t.jsxs("p",{className:"text-[#38bdac] text-xs mt-1",children:["每日 ",r.authorInfo.liveTime," · ",r.authorInfo.platform]})]})]})]})]})]}),t.jsxs(Ce,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:[t.jsxs(Be,{children:[t.jsxs(Ve,{className:"text-white flex items-center gap-2",children:[t.jsx(fi,{className:"w-5 h-5 text-[#38bdac]"}),"价格设置"]}),t.jsx(ht,{className:"text-gray-400",children:"配置书籍和章节的定价"})]}),t.jsx(ke,{className:"space-y-4",children:t.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[t.jsxs("div",{className:"space-y-2",children:[t.jsx(q,{className:"text-gray-300",children:"单节价格 (元)"}),t.jsx(ne,{type:"number",className:"bg-[#0a1628] border-gray-700 text-white",value:r.sectionPrice,onChange:H=>a(W=>({...W,sectionPrice:Number.parseFloat(H.target.value)||1}))})]}),t.jsxs("div",{className:"space-y-2",children:[t.jsx(q,{className:"text-gray-300",children:"整本价格 (元)"}),t.jsx(ne,{type:"number",className:"bg-[#0a1628] border-gray-700 text-white",value:r.baseBookPrice,onChange:H=>a(W=>({...W,baseBookPrice:Number.parseFloat(H.target.value)||9.9}))})]})]})})]}),t.jsxs(Ce,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:[t.jsxs(Be,{children:[t.jsxs(Ve,{className:"text-white flex items-center gap-2",children:[t.jsx(id,{className:"w-5 h-5 text-[#38bdac]"}),"小程序配置"]}),t.jsx(ht,{className:"text-gray-400",children:"订阅消息模板、支付商户号等,小程序从 /api/miniprogram/config 读取(API 地址由 app.js baseUrl 控制)"})]}),t.jsx(ke,{className:"space-y-4",children:t.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[t.jsxs("div",{className:"space-y-2",children:[t.jsx(q,{className:"text-gray-300",children:"小程序 AppID"}),t.jsx(ne,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"wxb8bbb2b10dec74aa",value:x.appId??"",onChange:H=>g(W=>({...W,appId:H.target.value}))})]}),t.jsxs("div",{className:"space-y-2",children:[t.jsx(q,{className:"text-gray-300",children:"提现订阅模板 ID"}),t.jsx(ne,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"用户申请提现时需授权",value:x.withdrawSubscribeTmplId??"",onChange:H=>g(W=>({...W,withdrawSubscribeTmplId:H.target.value}))})]}),t.jsxs("div",{className:"space-y-2",children:[t.jsx(q,{className:"text-gray-300",children:"微信支付商户号"}),t.jsx(ne,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"1318592501",value:x.mchId??"",onChange:H=>g(W=>({...W,mchId:H.target.value}))})]}),t.jsxs("div",{className:"space-y-2",children:[t.jsx(q,{className:"text-gray-300",children:"最低提现金额 (元)"}),t.jsx(ne,{type:"number",className:"bg-[#0a1628] border-gray-700 text-white",value:x.minWithdraw??10,onChange:H=>g(W=>({...W,minWithdraw:Number.parseFloat(H.target.value)||10}))})]})]})})]}),t.jsxs(Ce,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:[t.jsxs(Be,{children:[t.jsxs(Ve,{className:"text-white flex items-center gap-2",children:[t.jsx(cm,{className:"w-5 h-5 text-[#38bdac]"}),"免费章节"]}),t.jsx(ht,{className:"text-gray-400",children:"设置哪些章节对所有用户免费开放"})]}),t.jsxs(ke,{className:"space-y-4",children:[t.jsx("div",{className:"flex flex-wrap gap-2",children:l.map(H=>t.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:[H,t.jsx("button",{type:"button",onClick:()=>fe(H),className:"ml-1 hover:text-red-400",children:t.jsx(Pn,{className:"w-3 h-3"})})]},H))}),t.jsxs("div",{className:"flex gap-2",children:[t.jsx(ne,{className:"bg-[#0a1628] border-gray-700 text-white flex-1",placeholder:"输入章节ID,如 1.2、2.1、preface",value:c,onChange:H=>u(H.target.value),onKeyDown:H=>H.key==="Enter"&&ie()}),t.jsxs(de,{onClick:ie,className:"bg-[#38bdac] hover:bg-[#2da396]",children:[t.jsx(pr,{className:"w-4 h-4 mr-1"}),"添加"]})]}),t.jsx("p",{className:"text-xs text-gray-500",children:"常用ID: preface(序言), epilogue(尾声), appendix-1/2/3(附录), 1.1/1.2等(章节)"})]})]}),t.jsxs(Ce,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:[t.jsxs(Be,{children:[t.jsxs(Ve,{className:"text-white flex items-center gap-2",children:[t.jsx(mi,{className:"w-5 h-5 text-[#38bdac]"}),"功能开关"]}),t.jsx(ht,{className:"text-gray-400",children:"控制各个功能模块的显示/隐藏"})]}),t.jsxs(ke,{className:"space-y-4",children:[t.jsxs("div",{className:"space-y-4",children:[t.jsxs("div",{className:"flex items-center justify-between p-4 rounded-lg bg-[#0a1628] border border-gray-700/50",children:[t.jsxs("div",{className:"space-y-1",children:[t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx(xn,{className:"w-4 h-4 text-[#38bdac]"}),t.jsx(q,{htmlFor:"match-enabled",className:"text-white font-medium cursor-pointer",children:"找伙伴功能"})]}),t.jsx("p",{className:"text-xs text-gray-400 ml-6",children:"控制小程序和Web端的找伙伴功能显示"})]}),t.jsx(ft,{id:"match-enabled",checked:f.matchEnabled,disabled:G,onCheckedChange:H=>ue("matchEnabled",H)})]}),t.jsxs("div",{className:"flex items-center justify-between p-4 rounded-lg bg-[#0a1628] border border-gray-700/50",children:[t.jsxs("div",{className:"space-y-1",children:[t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx(cm,{className:"w-4 h-4 text-[#38bdac]"}),t.jsx(q,{htmlFor:"referral-enabled",className:"text-white font-medium cursor-pointer",children:"推广功能"})]}),t.jsx("p",{className:"text-xs text-gray-400 ml-6",children:"控制推广中心的显示(我的页面入口)"})]}),t.jsx(ft,{id:"referral-enabled",checked:f.referralEnabled,disabled:G,onCheckedChange:H=>ue("referralEnabled",H)})]}),t.jsxs("div",{className:"flex items-center justify-between p-4 rounded-lg bg-[#0a1628] border border-gray-700/50",children:[t.jsxs("div",{className:"space-y-1",children:[t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx(Ts,{className:"w-4 h-4 text-[#38bdac]"}),t.jsx(q,{htmlFor:"search-enabled",className:"text-white font-medium cursor-pointer",children:"搜索功能"})]}),t.jsx("p",{className:"text-xs text-gray-400 ml-6",children:"控制首页搜索栏的显示"})]}),t.jsx(ft,{id:"search-enabled",checked:f.searchEnabled,disabled:G,onCheckedChange:H=>ue("searchEnabled",H)})]}),t.jsxs("div",{className:"flex items-center justify-between p-4 rounded-lg bg-[#0a1628] border border-gray-700/50",children:[t.jsxs("div",{className:"space-y-1",children:[t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx(mi,{className:"w-4 h-4 text-[#38bdac]"}),t.jsx(q,{htmlFor:"about-enabled",className:"text-white font-medium cursor-pointer",children:"关于页面"})]}),t.jsx("p",{className:"text-xs text-gray-400 ml-6",children:"控制关于页面的访问"})]}),t.jsx(ft,{id:"about-enabled",checked:f.aboutEnabled,disabled:G,onCheckedChange:H=>ue("aboutEnabled",H)})]})]}),t.jsx("div",{className:"p-3 rounded-lg bg-blue-500/10 border border-blue-500/30",children:t.jsx("p",{className:"text-xs text-blue-300",children:"💡 关闭功能后,相关入口会自动隐藏。建议在功能开发完成后再开启。"})})]})]})]}),t.jsx(Kt,{open:C,onOpenChange:N,children:t.jsxs($t,{className:"bg-[#0f2137] border-gray-700 text-white",showCloseButton:!0,children:[t.jsxs(Gt,{children:[t.jsx(Yt,{className:_?"text-red-400":"text-[#38bdac]",children:b}),t.jsx(M1,{className:"text-gray-400 whitespace-pre-wrap pt-2",children:R})]}),t.jsx(sn,{className:"mt-4",children:t.jsx(de,{onClick:()=>N(!1),className:_?"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 WC(){const[r,a]=p.useState(!1),[l,o]=p.useState(Gm),[c,u]=p.useState(""),f=async()=>{a(!0);try{const k=await He("/api/config");k!=null&&k.paymentMethods&&o({...Gm,...k.paymentMethods})}catch(k){console.error(k)}finally{a(!1)}};p.useEffect(()=>{f()},[]);const m=async()=>{a(!0);try{await jt("/api/db/config",{key:"payment_methods",value:l,description:"支付方式配置"}),alert("配置已保存!")}catch(k){console.error("保存失败:",k),alert("保存失败: "+(k instanceof Error?k.message:String(k)))}finally{a(!1)}},x=(k,R)=>{navigator.clipboard.writeText(k),u(R),setTimeout(()=>u(""),2e3)},g=(k,R)=>{o(j=>({...j,wechat:{...j.wechat,[k]:R}}))},v=(k,R)=>{o(j=>({...j,alipay:{...j.alipay,[k]:R}}))},y=(k,R)=>{o(j=>({...j,usdt:{...j.usdt,[k]:R}}))},E=(k,R)=>{o(j=>({...j,paypal:{...j.paypal,[k]:R}}))},P=l.wechat,C=l.alipay,N=l.usdt,b=l.paypal;return t.jsxs("div",{className:"p-8 w-full",children:[t.jsxs("div",{className:"flex justify-between items-center mb-8",children:[t.jsxs("div",{children:[t.jsx("h1",{className:"text-2xl font-bold mb-2 text-white",children:"支付配置"}),t.jsx("p",{className:"text-gray-400",children:"配置微信、支付宝、USDT、PayPal等支付参数"})]}),t.jsxs("div",{className:"flex gap-3",children:[t.jsxs(de,{variant:"outline",onClick:f,className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:[t.jsx(tt,{className:`w-4 h-4 mr-2 ${r?"animate-spin":""}`}),"同步配置"]}),t.jsxs(de,{onClick:m,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:[t.jsx(an,{className:"w-4 h-4 mr-2"}),"保存配置"]})]})]}),t.jsx("div",{className:"mb-6 bg-[#07C160]/10 border border-[#07C160]/30 rounded-xl p-4",children:t.jsxs("div",{className:"flex items-start gap-3",children:[t.jsx(up,{className:"w-5 h-5 text-[#07C160] flex-shrink-0 mt-0.5"}),t.jsxs("div",{className:"text-sm",children:[t.jsx("p",{className:"font-medium mb-2 text-[#07C160]",children:"如何获取微信群跳转链接?"}),t.jsxs("ol",{className:"text-[#07C160]/80 space-y-1 list-decimal list-inside",children:[t.jsx("li",{children:"打开微信,进入目标微信群"}),t.jsx("li",{children:'点击右上角"..." → "群二维码"'}),t.jsx("li",{children:'点击右上角"..." → "发送到电脑"'}),t.jsx("li",{children:"在电脑上保存二维码图片,上传到图床获取URL"}),t.jsx("li",{children:"或使用草料二维码等工具解析二维码获取链接"})]}),t.jsx("p",{className:"text-[#07C160]/60 mt-2",children:"提示:微信群二维码7天后失效,建议使用活码工具"})]})]})}),t.jsxs(Hd,{defaultValue:"wechat",className:"space-y-6",children:[t.jsxs(Li,{className:"bg-[#0f2137] border border-gray-700/50 p-1 grid grid-cols-4 w-full",children:[t.jsxs(nn,{value:"wechat",className:"data-[state=active]:bg-[#07C160]/20 data-[state=active]:text-[#07C160] text-gray-400",children:[t.jsx(id,{className:"w-4 h-4 mr-2"}),"微信"]}),t.jsxs(nn,{value:"alipay",className:"data-[state=active]:bg-[#1677FF]/20 data-[state=active]:text-[#1677FF] text-gray-400",children:[t.jsx(sd,{className:"w-4 h-4 mr-2"}),"支付宝"]}),t.jsxs(nn,{value:"usdt",className:"data-[state=active]:bg-[#26A17B]/20 data-[state=active]:text-[#26A17B] text-gray-400",children:[t.jsx(im,{className:"w-4 h-4 mr-2"}),"USDT"]}),t.jsxs(nn,{value:"paypal",className:"data-[state=active]:bg-[#003087]/20 data-[state=active]:text-[#169BD7] text-gray-400",children:[t.jsx(ad,{className:"w-4 h-4 mr-2"}),"PayPal"]})]}),t.jsx(rn,{value:"wechat",className:"space-y-4",children:t.jsxs(Ce,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:[t.jsxs(Be,{className:"flex flex-row items-center justify-between pb-2",children:[t.jsxs("div",{className:"space-y-1",children:[t.jsxs(Ve,{className:"text-[#07C160] flex items-center gap-2",children:[t.jsx(id,{className:"w-5 h-5"}),"微信支付配置"]}),t.jsx(ht,{className:"text-gray-400",children:"配置微信支付参数和跳转链接"})]}),t.jsx(ft,{checked:!!P.enabled,onCheckedChange:k=>g("enabled",k)})]}),t.jsxs(ke,{className:"space-y-4",children:[t.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[t.jsxs("div",{className:"space-y-2",children:[t.jsx(q,{className:"text-gray-300",children:"网站AppID"}),t.jsx(ne,{className:"bg-[#0a1628] border-gray-700 text-white font-mono text-sm",value:String(P.websiteAppId??""),onChange:k=>g("websiteAppId",k.target.value)})]}),t.jsxs("div",{className:"space-y-2",children:[t.jsx(q,{className:"text-gray-300",children:"商户号"}),t.jsx(ne,{className:"bg-[#0a1628] border-gray-700 text-white font-mono text-sm",value:String(P.merchantId??""),onChange:k=>g("merchantId",k.target.value)})]})]}),t.jsxs("div",{className:"border-t border-gray-700/50 pt-4 space-y-4",children:[t.jsxs("h4",{className:"text-white font-medium flex items-center gap-2",children:[t.jsx(hi,{className:"w-4 h-4 text-[#38bdac]"}),"跳转链接配置(核心功能)"]}),t.jsxs("div",{className:"space-y-2",children:[t.jsx(q,{className:"text-gray-300",children:"微信收款码/支付链接"}),t.jsx(ne,{className:"bg-[#0a1628] border-gray-700 text-white placeholder:text-gray-500",placeholder:"https://收款码图片URL 或 weixin://支付链接",value:String(P.qrCode??""),onChange:k=>g("qrCode",k.target.value)}),t.jsx("p",{className:"text-xs text-gray-500",children:"用户点击微信支付后显示的二维码图片URL"})]}),t.jsxs("div",{className:"space-y-2 bg-[#07C160]/5 p-4 rounded-xl border border-[#07C160]/20",children:[t.jsx(q,{className:"text-[#07C160] font-medium",children:"微信群跳转链接(支付成功后跳转)"}),t.jsx(ne,{className:"bg-[#0a1628] border-[#07C160]/30 text-white placeholder:text-gray-500",placeholder:"https://weixin.qq.com/g/... 或微信群二维码图片URL",value:String(P.groupQrCode??""),onChange:k=>g("groupQrCode",k.target.value)}),t.jsx("p",{className:"text-xs text-[#07C160]/70",children:"用户支付成功后将自动跳转到此链接,进入指定微信群"})]})]})]})]})}),t.jsx(rn,{value:"alipay",className:"space-y-4",children:t.jsxs(Ce,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:[t.jsxs(Be,{className:"flex flex-row items-center justify-between pb-2",children:[t.jsxs("div",{className:"space-y-1",children:[t.jsxs(Ve,{className:"text-[#1677FF] flex items-center gap-2",children:[t.jsx(sd,{className:"w-5 h-5"}),"支付宝配置"]}),t.jsx(ht,{className:"text-gray-400",children:"已加载真实支付宝参数"})]}),t.jsx(ft,{checked:!!C.enabled,onCheckedChange:k=>v("enabled",k)})]}),t.jsxs(ke,{className:"space-y-4",children:[t.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[t.jsxs("div",{className:"space-y-2",children:[t.jsx(q,{className:"text-gray-300",children:"合作者身份 (PID)"}),t.jsxs("div",{className:"flex gap-2",children:[t.jsx(ne,{className:"bg-[#0a1628] border-gray-700 text-white font-mono text-sm",value:String(C.partnerId??""),onChange:k=>v("partnerId",k.target.value)}),t.jsx(de,{size:"icon",variant:"outline",className:"border-gray-700 bg-transparent",onClick:()=>x(String(C.partnerId??""),"pid"),children:c==="pid"?t.jsx(ki,{className:"w-4 h-4 text-green-500"}):t.jsx(hp,{className:"w-4 h-4 text-gray-400"})})]})]}),t.jsxs("div",{className:"space-y-2",children:[t.jsx(q,{className:"text-gray-300",children:"安全校验码 (Key)"}),t.jsx(ne,{type:"password",className:"bg-[#0a1628] border-gray-700 text-white font-mono text-sm",value:String(C.securityKey??""),onChange:k=>v("securityKey",k.target.value)})]})]}),t.jsxs("div",{className:"border-t border-gray-700/50 pt-4 space-y-4",children:[t.jsxs("h4",{className:"text-white font-medium flex items-center gap-2",children:[t.jsx(hi,{className:"w-4 h-4 text-[#38bdac]"}),"跳转链接配置"]}),t.jsxs("div",{className:"space-y-2",children:[t.jsx(q,{className:"text-gray-300",children:"支付宝收款码/跳转链接"}),t.jsx(ne,{className:"bg-[#0a1628] border-gray-700 text-white placeholder:text-gray-500",placeholder:"https://qr.alipay.com/... 或收款码图片URL",value:String(C.qrCode??""),onChange:k=>v("qrCode",k.target.value)}),t.jsx("p",{className:"text-xs text-gray-500",children:"用户点击支付宝支付后显示的二维码"})]})]})]})]})}),t.jsx(rn,{value:"usdt",className:"space-y-4",children:t.jsxs(Ce,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:[t.jsxs(Be,{className:"flex flex-row items-center justify-between pb-2",children:[t.jsxs("div",{className:"space-y-1",children:[t.jsxs(Ve,{className:"text-[#26A17B] flex items-center gap-2",children:[t.jsx(im,{className:"w-5 h-5"}),"USDT配置"]}),t.jsx(ht,{className:"text-gray-400",children:"配置加密货币收款地址"})]}),t.jsx(ft,{checked:!!N.enabled,onCheckedChange:k=>y("enabled",k)})]}),t.jsxs(ke,{className:"space-y-4",children:[t.jsxs("div",{className:"space-y-2",children:[t.jsx(q,{className:"text-gray-300",children:"网络类型"}),t.jsxs("select",{className:"w-full bg-[#0a1628] border border-gray-700 text-white rounded-md p-2",value:String(N.network??"TRC20"),onChange:k=>y("network",k.target.value),children:[t.jsx("option",{value:"TRC20",children:"TRC20 (波场)"}),t.jsx("option",{value:"ERC20",children:"ERC20 (以太坊)"}),t.jsx("option",{value:"BEP20",children:"BEP20 (币安链)"})]})]}),t.jsxs("div",{className:"space-y-2",children:[t.jsx(q,{className:"text-gray-300",children:"收款地址"}),t.jsx(ne,{className:"bg-[#0a1628] border-gray-700 text-white font-mono text-sm",placeholder:"T... (TRC20地址)",value:String(N.address??""),onChange:k=>y("address",k.target.value)})]}),t.jsxs("div",{className:"space-y-2",children:[t.jsx(q,{className:"text-gray-300",children:"汇率 (1 USD = ? CNY)"}),t.jsx(ne,{type:"number",className:"bg-[#0a1628] border-gray-700 text-white",value:Number(N.exchangeRate)??7.2,onChange:k=>y("exchangeRate",Number.parseFloat(k.target.value)||7.2)})]})]})]})}),t.jsx(rn,{value:"paypal",className:"space-y-4",children:t.jsxs(Ce,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:[t.jsxs(Be,{className:"flex flex-row items-center justify-between pb-2",children:[t.jsxs("div",{className:"space-y-1",children:[t.jsxs(Ve,{className:"text-[#169BD7] flex items-center gap-2",children:[t.jsx(ad,{className:"w-5 h-5"}),"PayPal配置"]}),t.jsx(ht,{className:"text-gray-400",children:"配置PayPal收款账户"})]}),t.jsx(ft,{checked:!!b.enabled,onCheckedChange:k=>E("enabled",k)})]}),t.jsxs(ke,{className:"space-y-4",children:[t.jsxs("div",{className:"space-y-2",children:[t.jsx(q,{className:"text-gray-300",children:"PayPal邮箱"}),t.jsx(ne,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"your@email.com",value:String(b.email??""),onChange:k=>E("email",k.target.value)})]}),t.jsxs("div",{className:"space-y-2",children:[t.jsx(q,{className:"text-gray-300",children:"汇率 (1 USD = ? CNY)"}),t.jsx(ne,{type:"number",className:"bg-[#0a1628] border-gray-700 text-white",value:Number(b.exchangeRate)??7.2,onChange:k=>E("exchangeRate",Number(k.target.value)||7.2)})]})]})]})})]})]})}const HC={siteName:"卡若日记",siteTitle:"一场SOUL的创业实验场",siteDescription:"来自Soul派对房的真实商业故事",logo:"/logo.png",favicon:"/favicon.ico",primaryColor:"#00CED1"},KC={home:{enabled:!0,label:"首页"},chapters:{enabled:!0,label:"目录"},match:{enabled:!0,label:"匹配"},my:{enabled:!0,label:"我的"}},GC={homeTitle:"一场SOUL的创业实验场",homeSubtitle:"来自Soul派对房的真实商业故事",chaptersTitle:"我要看",matchTitle:"语音匹配",myTitle:"我的",aboutTitle:"关于作者"};function YC(){const[r,a]=p.useState({siteConfig:{...HC},menuConfig:{...KC},pageConfig:{...GC}}),[l,o]=p.useState(!1),[c,u]=p.useState(!1);p.useEffect(()=>{He("/api/config").then(v=>{v!=null&&v.siteConfig&&a(y=>({...y,siteConfig:{...y.siteConfig,...v.siteConfig}})),v!=null&&v.menuConfig&&a(y=>({...y,menuConfig:{...y.menuConfig,...v.menuConfig}})),v!=null&&v.pageConfig&&a(y=>({...y,pageConfig:{...y.pageConfig,...v.pageConfig}}))}).catch(console.error)},[]);const f=async()=>{u(!0);try{await jt("/api/db/config",{key:"site_config",value:r.siteConfig,description:"网站基础配置"}),await jt("/api/db/config",{key:"menu_config",value:r.menuConfig,description:"底部菜单配置"}),await jt("/api/db/config",{key:"page_config",value:r.pageConfig,description:"页面标题配置"}),o(!0),setTimeout(()=>o(!1),2e3),alert("配置已保存")}catch(v){console.error(v),alert("保存失败: "+(v instanceof Error?v.message:String(v)))}finally{u(!1)}},m=r.siteConfig,x=r.menuConfig,g=r.pageConfig;return t.jsxs("div",{className:"p-8 w-full",children:[t.jsxs("div",{className:"flex justify-between items-center mb-8",children:[t.jsxs("div",{children:[t.jsx("h2",{className:"text-2xl font-bold text-white",children:"网站配置"}),t.jsx("p",{className:"text-gray-400 mt-1",children:"配置网站名称、图标、菜单和页面标题"})]}),t.jsxs(de,{onClick:f,disabled:c,className:`${l?"bg-green-500":"bg-[#00CED1]"} hover:bg-[#20B2AA] text-white transition-colors`,children:[t.jsx(an,{className:"w-4 h-4 mr-2"}),c?"保存中...":l?"已保存":"保存设置"]})]}),t.jsxs("div",{className:"space-y-6",children:[t.jsxs(Ce,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:[t.jsxs(Be,{children:[t.jsxs(Ve,{className:"text-white flex items-center gap-2",children:[t.jsx(ad,{className:"w-5 h-5 text-[#00CED1]"}),"网站基础信息"]}),t.jsx(ht,{className:"text-gray-400",children:"配置网站名称、标题和描述"})]}),t.jsxs(ke,{className:"space-y-4",children:[t.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[t.jsxs("div",{className:"space-y-2",children:[t.jsx(q,{htmlFor:"site-name",className:"text-gray-300",children:"网站名称"}),t.jsx(ne,{id:"site-name",className:"bg-[#0a1628] border-gray-700 text-white",value:m.siteName??"",onChange:v=>a(y=>({...y,siteConfig:{...y.siteConfig,siteName:v.target.value}}))})]}),t.jsxs("div",{className:"space-y-2",children:[t.jsx(q,{htmlFor:"site-title",className:"text-gray-300",children:"网站标题"}),t.jsx(ne,{id:"site-title",className:"bg-[#0a1628] border-gray-700 text-white",value:m.siteTitle??"",onChange:v=>a(y=>({...y,siteConfig:{...y.siteConfig,siteTitle:v.target.value}}))})]})]}),t.jsxs("div",{className:"space-y-2",children:[t.jsx(q,{htmlFor:"site-desc",className:"text-gray-300",children:"网站描述"}),t.jsx(ne,{id:"site-desc",className:"bg-[#0a1628] border-gray-700 text-white",value:m.siteDescription??"",onChange:v=>a(y=>({...y,siteConfig:{...y.siteConfig,siteDescription:v.target.value}}))})]}),t.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[t.jsxs("div",{className:"space-y-2",children:[t.jsx(q,{htmlFor:"logo",className:"text-gray-300",children:"Logo地址"}),t.jsx(ne,{id:"logo",className:"bg-[#0a1628] border-gray-700 text-white",value:m.logo??"",onChange:v=>a(y=>({...y,siteConfig:{...y.siteConfig,logo:v.target.value}}))})]}),t.jsxs("div",{className:"space-y-2",children:[t.jsx(q,{htmlFor:"favicon",className:"text-gray-300",children:"Favicon地址"}),t.jsx(ne,{id:"favicon",className:"bg-[#0a1628] border-gray-700 text-white",value:m.favicon??"",onChange:v=>a(y=>({...y,siteConfig:{...y.siteConfig,favicon:v.target.value}}))})]})]})]})]}),t.jsxs(Ce,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:[t.jsxs(Be,{children:[t.jsxs(Ve,{className:"text-white flex items-center gap-2",children:[t.jsx(mw,{className:"w-5 h-5 text-[#00CED1]"}),"主题颜色"]}),t.jsx(ht,{className:"text-gray-400",children:"配置网站主题色"})]}),t.jsx(ke,{children:t.jsxs("div",{className:"flex items-center gap-4",children:[t.jsxs("div",{className:"space-y-2 flex-1",children:[t.jsx(q,{htmlFor:"primary-color",className:"text-gray-300",children:"主色调"}),t.jsxs("div",{className:"flex items-center gap-3",children:[t.jsx(ne,{id:"primary-color",type:"color",className:"w-16 h-10 bg-[#0a1628] border-gray-700 cursor-pointer p-1",value:m.primaryColor??"#00CED1",onChange:v=>a(y=>({...y,siteConfig:{...y.siteConfig,primaryColor:v.target.value}}))}),t.jsx(ne,{className:"bg-[#0a1628] border-gray-700 text-white flex-1",value:m.primaryColor??"#00CED1",onChange:v=>a(y=>({...y,siteConfig:{...y.siteConfig,primaryColor:v.target.value}}))})]})]}),t.jsx("div",{className:"w-24 h-24 rounded-xl flex items-center justify-center text-white font-bold",style:{backgroundColor:m.primaryColor??"#00CED1"},children:"预览"})]})})]}),t.jsxs(Ce,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:[t.jsxs(Be,{children:[t.jsxs(Ve,{className:"text-white flex items-center gap-2",children:[t.jsx(dw,{className:"w-5 h-5 text-[#00CED1]"}),"底部菜单配置"]}),t.jsx(ht,{className:"text-gray-400",children:"控制底部导航栏菜单的显示和名称"})]}),t.jsx(ke,{className:"space-y-4",children:Object.entries(x).map(([v,y])=>t.jsxs("div",{className:"flex items-center justify-between p-4 bg-[#0a1628] rounded-lg",children:[t.jsxs("div",{className:"flex items-center gap-4 flex-1",children:[t.jsx(ft,{checked:(y==null?void 0:y.enabled)??!0,onCheckedChange:E=>a(P=>({...P,menuConfig:{...P.menuConfig,[v]:{...y,enabled:E}}}))}),t.jsx("span",{className:"text-gray-300 w-16 capitalize",children:v}),t.jsx(ne,{className:"bg-[#0f2137] border-gray-700 text-white max-w-[200px]",value:(y==null?void 0:y.label)??"",onChange:E=>a(P=>({...P,menuConfig:{...P.menuConfig,[v]:{...y,label:E.target.value}}}))})]}),t.jsx("span",{className:`text-sm ${y!=null&&y.enabled?"text-green-400":"text-gray-500"}`,children:y!=null&&y.enabled?"显示":"隐藏"})]},v))})]}),t.jsxs(Ce,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:[t.jsxs(Be,{children:[t.jsxs(Ve,{className:"text-white flex items-center gap-2",children:[t.jsx(Oj,{className:"w-5 h-5 text-[#00CED1]"}),"页面标题配置"]}),t.jsx(ht,{className:"text-gray-400",children:"配置各个页面的标题和副标题"})]}),t.jsxs(ke,{className:"space-y-4",children:[t.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[t.jsxs("div",{className:"space-y-2",children:[t.jsx(q,{className:"text-gray-300",children:"首页标题"}),t.jsx(ne,{className:"bg-[#0a1628] border-gray-700 text-white",value:g.homeTitle??"",onChange:v=>a(y=>({...y,pageConfig:{...y.pageConfig,homeTitle:v.target.value}}))})]}),t.jsxs("div",{className:"space-y-2",children:[t.jsx(q,{className:"text-gray-300",children:"首页副标题"}),t.jsx(ne,{className:"bg-[#0a1628] border-gray-700 text-white",value:g.homeSubtitle??"",onChange:v=>a(y=>({...y,pageConfig:{...y.pageConfig,homeSubtitle:v.target.value}}))})]})]}),t.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[t.jsxs("div",{className:"space-y-2",children:[t.jsx(q,{className:"text-gray-300",children:"目录页标题"}),t.jsx(ne,{className:"bg-[#0a1628] border-gray-700 text-white",value:g.chaptersTitle??"",onChange:v=>a(y=>({...y,pageConfig:{...y.pageConfig,chaptersTitle:v.target.value}}))})]}),t.jsxs("div",{className:"space-y-2",children:[t.jsx(q,{className:"text-gray-300",children:"匹配页标题"}),t.jsx(ne,{className:"bg-[#0a1628] border-gray-700 text-white",value:g.matchTitle??"",onChange:v=>a(y=>({...y,pageConfig:{...y.pageConfig,matchTitle:v.target.value}}))})]})]}),t.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[t.jsxs("div",{className:"space-y-2",children:[t.jsx(q,{className:"text-gray-300",children:"我的页标题"}),t.jsx(ne,{className:"bg-[#0a1628] border-gray-700 text-white",value:g.myTitle??"",onChange:v=>a(y=>({...y,pageConfig:{...y.pageConfig,myTitle:v.target.value}}))})]}),t.jsxs("div",{className:"space-y-2",children:[t.jsx(q,{className:"text-gray-300",children:"关于作者标题"}),t.jsx(ne,{className:"bg-[#0a1628] border-gray-700 text-white",value:g.aboutTitle??"",onChange:v=>a(y=>({...y,pageConfig:{...y.pageConfig,aboutTitle:v.target.value}}))})]})]})]})]})]})]})}function QC(){const[r,a]=p.useState(""),[l,o]=p.useState(""),[c,u]=p.useState(""),[f,m]=p.useState({}),x=async()=>{var P,C,N,b;try{const k=await He("/api/config"),R=(C=(P=k==null?void 0:k.liveQRCodes)==null?void 0:P[0])==null?void 0:C.urls;Array.isArray(R)&&a(R.join(` -`));const j=(b=(N=k==null?void 0:k.paymentMethods)==null?void 0:N.wechat)==null?void 0:b.groupQrCode;j&&o(j),m({paymentMethods:k==null?void 0:k.paymentMethods,liveQRCodes:k==null?void 0:k.liveQRCodes})}catch(k){console.error(k)}};p.useEffect(()=>{x()},[]);const g=(P,C)=>{navigator.clipboard.writeText(P),u(C),setTimeout(()=>u(""),2e3)},v=async()=>{try{const P=r.split(` -`).map(N=>N.trim()).filter(Boolean),C=[...f.liveQRCodes||[]];C[0]?C[0].urls=P:C.push({id:"live-1",name:"微信群活码",urls:P,clickCount:0}),await jt("/api/db/config",{key:"live_qr_codes",value:C,description:"群活码配置"}),alert("群活码配置已保存!"),await x()}catch(P){console.error(P),alert("保存失败: "+(P instanceof Error?P.message:String(P)))}},y=async()=>{var P;try{await jt("/api/db/config",{key:"payment_methods",value:{...f.paymentMethods||{},wechat:{...((P=f.paymentMethods)==null?void 0:P.wechat)||{},groupQrCode:l}},description:"支付方式配置"}),alert("微信群链接已保存!用户支付成功后将自动跳转"),await x()}catch(C){console.error(C),alert("保存失败: "+(C instanceof Error?C.message:String(C)))}},E=()=>{l?window.open(l,"_blank"):alert("请先配置微信群链接")};return t.jsxs("div",{className:"p-8 w-full",children:[t.jsxs("div",{className:"mb-8",children:[t.jsx("h2",{className:"text-2xl font-bold text-white",children:"微信群活码管理"}),t.jsx("p",{className:"text-gray-400 mt-1",children:"配置微信群跳转链接,用户支付后自动跳转加群"})]}),t.jsx("div",{className:"mb-6 bg-[#07C160]/10 border border-[#07C160]/30 rounded-xl p-4",children:t.jsxs("div",{className:"flex items-start gap-3",children:[t.jsx(up,{className:"w-5 h-5 text-[#07C160] flex-shrink-0 mt-0.5"}),t.jsxs("div",{className:"text-sm",children:[t.jsx("p",{className:"font-medium mb-2 text-[#07C160]",children:"微信群活码配置指南"}),t.jsxs("div",{className:"text-[#07C160]/80 space-y-2",children:[t.jsx("p",{className:"font-medium",children:"方法一:使用草料活码(推荐)"}),t.jsxs("ol",{className:"list-decimal list-inside space-y-1 pl-2",children:[t.jsx("li",{children:"访问草料二维码创建活码"}),t.jsx("li",{children:"上传微信群二维码图片,生成永久链接"}),t.jsx("li",{children:"复制生成的短链接填入下方配置"}),t.jsx("li",{children:"群满后可直接在草料后台更换新群码,链接不变"})]}),t.jsx("p",{className:"font-medium mt-3",children:"方法二:直接使用微信群链接"}),t.jsxs("ol",{className:"list-decimal list-inside space-y-1 pl-2",children:[t.jsx("li",{children:'微信打开目标群 → 右上角"..." → 群二维码'}),t.jsx("li",{children:"长按二维码 → 识别二维码 → 复制链接"})]}),t.jsx("p",{className:"text-[#07C160]/60 mt-2",children:"注意:微信原生群二维码7天后失效,建议使用草料活码"})]})]})]})}),t.jsxs("div",{className:"grid gap-6 md:grid-cols-2",children:[t.jsxs(Ce,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl md:col-span-2",children:[t.jsxs(Be,{children:[t.jsxs(Ve,{className:"text-[#07C160] flex items-center gap-2",children:[t.jsx(hm,{className:"w-5 h-5"}),"支付成功跳转链接(核心配置)"]}),t.jsx(ht,{className:"text-gray-400",children:"用户支付完成后自动跳转到此链接,进入指定微信群"})]}),t.jsxs(ke,{className:"space-y-4",children:[t.jsxs("div",{className:"space-y-2",children:[t.jsxs(q,{className:"text-gray-300 flex items-center gap-2",children:[t.jsx(fm,{className:"w-4 h-4"}),"微信群链接 / 活码链接"]}),t.jsxs("div",{className:"flex gap-2",children:[t.jsx(ne,{placeholder:"https://cli.im/xxxxx 或 https://weixin.qq.com/g/...",className:"bg-[#0a1628] border-gray-700 text-white placeholder:text-gray-500 flex-1",value:l,onChange:P=>o(P.target.value)}),t.jsx(de,{variant:"outline",size:"icon",className:"border-gray-700 bg-transparent hover:bg-gray-700/50",onClick:()=>g(l,"group"),children:c==="group"?t.jsx(ki,{className:"w-4 h-4 text-green-500"}):t.jsx(hp,{className:"w-4 h-4 text-gray-400"})})]}),t.jsxs("p",{className:"text-xs text-gray-500 flex items-center gap-1",children:[t.jsx(hi,{className:"w-3 h-3"}),"支持格式:草料短链、微信群链接(https://weixin.qq.com/g/...)、企业微信链接等"]})]}),t.jsxs("div",{className:"flex gap-3",children:[t.jsxs(de,{onClick:y,className:"flex-1 bg-[#07C160] hover:bg-[#06AD51] text-white",children:[t.jsx(mm,{className:"w-4 h-4 mr-2"}),"保存配置"]}),t.jsxs(de,{onClick:E,variant:"outline",className:"border-[#07C160] text-[#07C160] hover:bg-[#07C160]/10 bg-transparent",children:[t.jsx(hi,{className:"w-4 h-4 mr-2"}),"测试跳转"]})]})]})]}),t.jsxs(Ce,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl md:col-span-2",children:[t.jsxs(Be,{children:[t.jsxs(Ve,{className:"text-white flex items-center gap-2",children:[t.jsx(hm,{className:"w-5 h-5 text-[#38bdac]"}),"多群轮换(高级配置)"]}),t.jsx(ht,{className:"text-gray-400",children:"配置多个群链接,系统自动轮换分配,避免单群满员"})]}),t.jsxs(ke,{className:"space-y-4",children:[t.jsxs("div",{className:"space-y-2",children:[t.jsxs(q,{className:"text-gray-300 flex items-center gap-2",children:[t.jsx(fm,{className:"w-4 h-4"}),"多个群链接(每行一个)"]}),t.jsx(Rs,{placeholder:"https://cli.im/group1\\nhttps://cli.im/group2",className:"bg-[#0a1628] border-gray-700 text-white placeholder:text-gray-500 min-h-[120px] font-mono text-sm",value:r,onChange:P=>a(P.target.value)}),t.jsx("p",{className:"text-xs text-gray-500",children:"每行填写一个群链接,系统将按顺序或随机分配"})]}),t.jsxs("div",{className:"flex items-center justify-between p-3 bg-[#0a1628] rounded-lg border border-gray-700/50",children:[t.jsx("span",{className:"text-sm text-gray-400",children:"已配置群数量"}),t.jsxs("span",{className:"font-bold text-[#38bdac]",children:[r.split(` -`).filter(Boolean).length," 个"]})]}),t.jsxs(de,{onClick:v,className:"w-full bg-[#38bdac] hover:bg-[#2da396] text-white",children:[t.jsx(mm,{className:"w-4 h-4 mr-2"}),"保存多群配置"]})]})]})]}),t.jsxs("div",{className:"mt-6 bg-[#0f2137] rounded-xl p-4 border border-gray-700/50",children:[t.jsx("h4",{className:"text-white font-medium mb-3",children:"常见问题"}),t.jsxs("div",{className:"space-y-3 text-sm",children:[t.jsxs("div",{children:[t.jsx("p",{className:"text-[#38bdac]",children:"Q: 为什么推荐使用草料活码?"}),t.jsx("p",{className:"text-gray-400",children:"A: 草料活码是永久链接,群满后可直接在后台更换新群码,无需修改网站配置。微信原生群码7天失效。"})]}),t.jsxs("div",{children:[t.jsx("p",{className:"text-[#38bdac]",children:"Q: 支付后没有跳转怎么办?"}),t.jsx("p",{className:"text-gray-400",children:"A: 1) 检查链接是否正确填写 2) 部分浏览器可能拦截弹窗,用户需手动允许 3) 建议使用https开头的链接"})]})]})]})]})}const Ym={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}},qC=["⭐","👥","❤️","🎮","💼","🚀","💡","🎯","🔥","✨"];function XC(){const[r,a]=p.useState(Ym),[l,o]=p.useState(!0),[c,u]=p.useState(!1),[f,m]=p.useState(!1),[x,g]=p.useState(null),[v,y]=p.useState({id:"",label:"",matchLabel:"",icon:"⭐",matchFromDB:!1,showJoinAfterMatch:!0,price:1,enabled:!0}),E=async()=>{o(!0);try{const j=await He("/api/db/config/full?key=match_config"),_=(j==null?void 0:j.data)??(j==null?void 0:j.config);_&&a({...Ym,..._})}catch(j){console.error("加载匹配配置失败:",j)}finally{o(!1)}};p.useEffect(()=>{E()},[]);const P=async()=>{u(!0);try{const j=await jt("/api/db/config",{key:"match_config",value:r,description:"匹配功能配置"});j&&j.success!==!1?alert("配置保存成功!"):alert("保存失败: "+(j&&typeof j=="object"&&"error"in j?j.error:"未知错误"))}catch(j){console.error("保存配置失败:",j),alert("保存失败")}finally{u(!1)}},C=j=>{g(j),y({id:j.id,label:j.label,matchLabel:j.matchLabel,icon:j.icon,matchFromDB:j.matchFromDB,showJoinAfterMatch:j.showJoinAfterMatch,price:j.price,enabled:j.enabled}),m(!0)},N=()=>{g(null),y({id:"",label:"",matchLabel:"",icon:"⭐",matchFromDB:!1,showJoinAfterMatch:!0,price:1,enabled:!0}),m(!0)},b=()=>{if(!v.id||!v.label){alert("请填写类型ID和名称");return}const j=[...r.matchTypes];if(x){const _=j.findIndex(F=>F.id===x.id);_!==-1&&(j[_]={...v})}else{if(j.some(_=>_.id===v.id)){alert("类型ID已存在");return}j.push({...v})}a({...r,matchTypes:j}),m(!1)},k=j=>{confirm("确定要删除这个匹配类型吗?")&&a({...r,matchTypes:r.matchTypes.filter(_=>_.id!==j)})},R=j=>{a({...r,matchTypes:r.matchTypes.map(_=>_.id===j?{..._,enabled:!_.enabled}:_)})};return t.jsxs("div",{className:"p-8 w-full space-y-6",children:[t.jsxs("div",{className:"flex justify-between items-center",children:[t.jsxs("div",{children:[t.jsxs("h2",{className:"text-2xl font-bold text-white flex items-center gap-2",children:[t.jsx(mi,{className:"w-6 h-6 text-[#38bdac]"}),"匹配功能配置"]}),t.jsx("p",{className:"text-gray-400 mt-1",children:"管理找伙伴功能的匹配类型和价格"})]}),t.jsxs("div",{className:"flex gap-3",children:[t.jsxs(de,{variant:"outline",onClick:E,disabled:l,className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:[t.jsx(tt,{className:`w-4 h-4 mr-2 ${l?"animate-spin":""}`}),"刷新"]}),t.jsxs(de,{onClick:P,disabled:c,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:[t.jsx(an,{className:"w-4 h-4 mr-2"}),c?"保存中...":"保存配置"]})]})]}),t.jsxs(Ce,{className:"bg-[#0f2137] border-gray-700/50",children:[t.jsxs(Be,{children:[t.jsxs(Ve,{className:"text-white flex items-center gap-2",children:[t.jsx(Ww,{className:"w-5 h-5 text-yellow-400"}),"基础设置"]}),t.jsx(ht,{className:"text-gray-400",children:"配置免费匹配次数和付费规则"})]}),t.jsxs(ke,{className:"space-y-6",children:[t.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-6",children:[t.jsxs("div",{className:"space-y-2",children:[t.jsx(q,{className:"text-gray-300",children:"每日免费匹配次数"}),t.jsx(ne,{type:"number",min:0,max:100,className:"bg-[#0a1628] border-gray-700 text-white",value:r.freeMatchLimit,onChange:j=>a({...r,freeMatchLimit:parseInt(j.target.value,10)||0})}),t.jsx("p",{className:"text-xs text-gray-500",children:"用户每天可免费匹配的次数"})]}),t.jsxs("div",{className:"space-y-2",children:[t.jsx(q,{className:"text-gray-300",children:"付费匹配价格(元)"}),t.jsx(ne,{type:"number",min:.01,step:.01,className:"bg-[#0a1628] border-gray-700 text-white",value:r.matchPrice,onChange:j=>a({...r,matchPrice:parseFloat(j.target.value)||1})}),t.jsx("p",{className:"text-xs text-gray-500",children:"免费次数用完后的单次匹配价格"})]}),t.jsxs("div",{className:"space-y-2",children:[t.jsx(q,{className:"text-gray-300",children:"每日最大匹配次数"}),t.jsx(ne,{type:"number",min:1,max:100,className:"bg-[#0a1628] border-gray-700 text-white",value:r.settings.maxMatchesPerDay,onChange:j=>a({...r,settings:{...r.settings,maxMatchesPerDay:parseInt(j.target.value,10)||10}})}),t.jsx("p",{className:"text-xs text-gray-500",children:"包含免费和付费的总次数"})]})]}),t.jsxs("div",{className:"flex gap-8 pt-4 border-t border-gray-700/50",children:[t.jsxs("div",{className:"flex items-center gap-3",children:[t.jsx(ft,{checked:r.settings.enableFreeMatches,onCheckedChange:j=>a({...r,settings:{...r.settings,enableFreeMatches:j}})}),t.jsx(q,{className:"text-gray-300",children:"启用免费匹配"})]}),t.jsxs("div",{className:"flex items-center gap-3",children:[t.jsx(ft,{checked:r.settings.enablePaidMatches,onCheckedChange:j=>a({...r,settings:{...r.settings,enablePaidMatches:j}})}),t.jsx(q,{className:"text-gray-300",children:"启用付费匹配"})]})]})]})]}),t.jsxs(Ce,{className:"bg-[#0f2137] border-gray-700/50",children:[t.jsxs(Be,{className:"flex flex-row items-center justify-between",children:[t.jsxs("div",{children:[t.jsxs(Ve,{className:"text-white flex items-center gap-2",children:[t.jsx(xn,{className:"w-5 h-5 text-[#38bdac]"}),"匹配类型管理"]}),t.jsx(ht,{className:"text-gray-400",children:"配置不同的匹配类型及其价格"})]}),t.jsxs(de,{onClick:N,size:"sm",className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:[t.jsx(pr,{className:"w-4 h-4 mr-1"}),"添加类型"]})]}),t.jsx(ke,{children:t.jsxs(Nr,{children:[t.jsx(br,{children:t.jsxs(dt,{className:"bg-[#0a1628] hover:bg-[#0a1628] border-gray-700",children:[t.jsx(Te,{className:"text-gray-400",children:"图标"}),t.jsx(Te,{className:"text-gray-400",children:"类型ID"}),t.jsx(Te,{className:"text-gray-400",children:"显示名称"}),t.jsx(Te,{className:"text-gray-400",children:"匹配标签"}),t.jsx(Te,{className:"text-gray-400",children:"价格"}),t.jsx(Te,{className:"text-gray-400",children:"数据库匹配"}),t.jsx(Te,{className:"text-gray-400",children:"状态"}),t.jsx(Te,{className:"text-right text-gray-400",children:"操作"})]})}),t.jsx(Sr,{children:r.matchTypes.map(j=>t.jsxs(dt,{className:"hover:bg-[#0a1628] border-gray-700/50",children:[t.jsx(Ee,{children:t.jsx("span",{className:"text-2xl",children:j.icon})}),t.jsx(Ee,{className:"font-mono text-gray-300",children:j.id}),t.jsx(Ee,{className:"text-white font-medium",children:j.label}),t.jsx(Ee,{className:"text-gray-300",children:j.matchLabel}),t.jsx(Ee,{children:t.jsxs(De,{className:"bg-yellow-500/20 text-yellow-400 hover:bg-yellow-500/20 border-0",children:["¥",j.price]})}),t.jsx(Ee,{children:j.matchFromDB?t.jsx(De,{className:"bg-green-500/20 text-green-400 hover:bg-green-500/20 border-0",children:"是"}):t.jsx(De,{variant:"outline",className:"text-gray-500 border-gray-600",children:"否"})}),t.jsx(Ee,{children:t.jsx(ft,{checked:j.enabled,onCheckedChange:()=>R(j.id)})}),t.jsx(Ee,{className:"text-right",children:t.jsxs("div",{className:"flex items-center justify-end gap-1",children:[t.jsx(de,{variant:"ghost",size:"sm",onClick:()=>C(j),className:"text-gray-400 hover:text-[#38bdac] hover:bg-[#38bdac]/10",children:t.jsx(gr,{className:"w-4 h-4"})}),t.jsx(de,{variant:"ghost",size:"sm",onClick:()=>k(j.id),className:"text-red-400 hover:text-red-300 hover:bg-red-500/10",children:t.jsx(Fa,{className:"w-4 h-4"})})]})})]},j.id))})]})})]}),t.jsx(Kt,{open:f,onOpenChange:m,children:t.jsxs($t,{className:"bg-[#0f2137] border-gray-700 text-white max-w-lg",showCloseButton:!0,children:[t.jsx(Gt,{children:t.jsxs(Yt,{className:"text-white flex items-center gap-2",children:[x?t.jsx(gr,{className:"w-5 h-5 text-[#38bdac]"}):t.jsx(pr,{className:"w-5 h-5 text-[#38bdac]"}),x?"编辑匹配类型":"添加匹配类型"]})}),t.jsxs("div",{className:"space-y-4 py-4",children:[t.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[t.jsxs("div",{className:"space-y-2",children:[t.jsx(q,{className:"text-gray-300",children:"类型ID(英文)"}),t.jsx(ne,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"如: partner",value:v.id,onChange:j=>y({...v,id:j.target.value}),disabled:!!x})]}),t.jsxs("div",{className:"space-y-2",children:[t.jsx(q,{className:"text-gray-300",children:"图标"}),t.jsx("div",{className:"flex gap-1 flex-wrap",children:qC.map(j=>t.jsx("button",{type:"button",className:`w-8 h-8 text-lg rounded ${v.icon===j?"bg-[#38bdac]/30 ring-1 ring-[#38bdac]":"bg-[#0a1628]"}`,onClick:()=>y({...v,icon:j}),children:j},j))})]})]}),t.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[t.jsxs("div",{className:"space-y-2",children:[t.jsx(q,{className:"text-gray-300",children:"显示名称"}),t.jsx(ne,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"如: 创业合伙",value:v.label,onChange:j=>y({...v,label:j.target.value})})]}),t.jsxs("div",{className:"space-y-2",children:[t.jsx(q,{className:"text-gray-300",children:"匹配标签"}),t.jsx(ne,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"如: 创业伙伴",value:v.matchLabel,onChange:j=>y({...v,matchLabel:j.target.value})})]})]}),t.jsxs("div",{className:"space-y-2",children:[t.jsx(q,{className:"text-gray-300",children:"单次匹配价格(元)"}),t.jsx(ne,{type:"number",min:.01,step:.01,className:"bg-[#0a1628] border-gray-700 text-white",value:v.price,onChange:j=>y({...v,price:parseFloat(j.target.value)||1})})]}),t.jsxs("div",{className:"flex gap-6 pt-2",children:[t.jsxs("div",{className:"flex items-center gap-3",children:[t.jsx(ft,{checked:v.matchFromDB,onCheckedChange:j=>y({...v,matchFromDB:j})}),t.jsx(q,{className:"text-gray-300 text-sm",children:"从数据库匹配"})]}),t.jsxs("div",{className:"flex items-center gap-3",children:[t.jsx(ft,{checked:v.showJoinAfterMatch,onCheckedChange:j=>y({...v,showJoinAfterMatch:j})}),t.jsx(q,{className:"text-gray-300 text-sm",children:"匹配后显示加入"})]}),t.jsxs("div",{className:"flex items-center gap-3",children:[t.jsx(ft,{checked:v.enabled,onCheckedChange:j=>y({...v,enabled:j})}),t.jsx(q,{className:"text-gray-300 text-sm",children:"启用"})]})]})]}),t.jsxs(sn,{children:[t.jsx(de,{variant:"outline",onClick:()=>m(!1),className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:"取消"}),t.jsxs(de,{onClick:b,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:[t.jsx(an,{className:"w-4 h-4 mr-2"}),"保存"]})]})]})})]})}const Qm={partner:"找伙伴",investor:"资源对接",mentor:"导师顾问",team:"团队招募"};function JC(){const[r,a]=p.useState([]),[l,o]=p.useState(0),[c,u]=p.useState(1),[f,m]=p.useState(10),[x,g]=p.useState(""),[v,y]=p.useState(!0),[E,P]=p.useState(null);async function C(){y(!0),P(null);try{const b=new URLSearchParams({page:String(c),pageSize:String(f)});x&&b.set("matchType",x);const k=await He(`/api/db/match-records?${b}`);k!=null&&k.success?(a(k.records||[]),o(k.total??0)):P("加载匹配记录失败")}catch(b){console.error("加载匹配记录失败",b),P("加载失败,请检查网络后重试")}finally{y(!1)}}p.useEffect(()=>{C()},[c,x]);const N=Math.ceil(l/f)||1;return t.jsxs("div",{className:"p-8 w-full",children:[E&&t.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:[t.jsx("span",{children:E}),t.jsx("button",{type:"button",onClick:()=>P(null),className:"hover:text-red-300",children:"×"})]}),t.jsxs("div",{className:"flex justify-between items-center mb-8",children:[t.jsxs("div",{children:[t.jsx("h2",{className:"text-2xl font-bold text-white",children:"匹配记录"}),t.jsxs("p",{className:"text-gray-400 mt-1",children:["找伙伴匹配统计,共 ",l," 条记录"]})]}),t.jsxs("div",{className:"flex items-center gap-4",children:[t.jsxs("select",{value:x,onChange:b=>{g(b.target.value),u(1)},className:"bg-[#0f2137] border border-gray-700 text-white rounded-lg px-3 py-2 text-sm",children:[t.jsx("option",{value:"",children:"全部类型"}),Object.entries(Qm).map(([b,k])=>t.jsx("option",{value:b,children:k},b))]}),t.jsxs("button",{type:"button",onClick:C,disabled:v,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:[t.jsx(tt,{className:`w-4 h-4 ${v?"animate-spin":""}`}),"刷新"]})]})]}),t.jsx(Ce,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:t.jsx(ke,{className:"p-0",children:v?t.jsxs("div",{className:"flex justify-center py-12",children:[t.jsx(tt,{className:"w-6 h-6 text-[#38bdac] animate-spin"}),t.jsx("span",{className:"ml-2 text-gray-400",children:"加载中..."})]}):t.jsxs(t.Fragment,{children:[t.jsxs(Nr,{children:[t.jsx(br,{children:t.jsxs(dt,{className:"bg-[#0a1628] hover:bg-[#0a1628] border-gray-700",children:[t.jsx(Te,{className:"text-gray-400",children:"发起人"}),t.jsx(Te,{className:"text-gray-400",children:"匹配到"}),t.jsx(Te,{className:"text-gray-400",children:"类型"}),t.jsx(Te,{className:"text-gray-400",children:"联系方式"}),t.jsx(Te,{className:"text-gray-400",children:"匹配时间"})]})}),t.jsxs(Sr,{children:[r.map(b=>t.jsxs(dt,{className:"hover:bg-[#0a1628] border-gray-700/50",children:[t.jsx(Ee,{children:t.jsxs("div",{className:"flex items-center gap-3",children:[t.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?t.jsx("img",{src:b.userAvatar,alt:"",className:"w-full h-full object-cover",onError:k=>{k.currentTarget.style.display="none";const R=k.currentTarget.nextElementSibling;R&&R.classList.remove("hidden")}}):null,t.jsx("span",{className:b.userAvatar?"hidden":"",children:(b.userNickname||b.userId||"?").charAt(0)})]}),t.jsxs("div",{children:[t.jsx("div",{className:"text-white",children:b.userNickname||b.userId}),t.jsxs("div",{className:"text-xs text-gray-500 font-mono",children:[b.userId.slice(0,16),"..."]})]})]})}),t.jsx(Ee,{children:t.jsxs("div",{className:"flex items-center gap-3",children:[t.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?t.jsx("img",{src:b.matchedUserAvatar,alt:"",className:"w-full h-full object-cover",onError:k=>{k.currentTarget.style.display="none";const R=k.currentTarget.nextElementSibling;R&&R.classList.remove("hidden")}}):null,t.jsx("span",{className:b.matchedUserAvatar?"hidden":"",children:(b.matchedNickname||b.matchedUserId||"?").charAt(0)})]}),t.jsxs("div",{children:[t.jsx("div",{className:"text-white",children:b.matchedNickname||b.matchedUserId}),t.jsxs("div",{className:"text-xs text-gray-500 font-mono",children:[b.matchedUserId.slice(0,16),"..."]})]})]})}),t.jsx(Ee,{children:t.jsx(De,{className:"bg-[#38bdac]/20 text-[#38bdac] border-0",children:Qm[b.matchType]||b.matchType})}),t.jsxs(Ee,{className:"text-gray-400 text-sm",children:[b.phone&&t.jsxs("div",{children:["📱 ",b.phone]}),b.wechatId&&t.jsxs("div",{children:["💬 ",b.wechatId]}),!b.phone&&!b.wechatId&&"-"]}),t.jsx(Ee,{className:"text-gray-400",children:b.createdAt?new Date(b.createdAt).toLocaleString():"-"})]},b.id)),r.length===0&&t.jsx(dt,{children:t.jsx(Ee,{colSpan:5,className:"text-center py-12 text-gray-500",children:"暂无匹配记录"})})]})]}),t.jsx(Kr,{page:c,totalPages:N,total:l,pageSize:f,onPageChange:u,onPageSizeChange:b=>{m(b),u(1)}})]})})})]})}function ZC(){const[r,a]=p.useState([]),[l,o]=p.useState(!0),[c,u]=p.useState(!1),[f,m]=p.useState(null),[x,g]=p.useState(""),[v,y]=p.useState(0),[E,P]=p.useState(!1);async function C(){o(!0);try{const j=await He("/api/db/vip-roles");j!=null&&j.success&&j.data&&a(j.data)}catch(j){console.error("Load roles error:",j)}finally{o(!1)}}p.useEffect(()=>{C()},[]);const N=()=>{m(null),g(""),y(r.length>0?Math.max(...r.map(j=>j.sort))+1:0),u(!0)},b=j=>{m(j),g(j.name),y(j.sort),u(!0)},k=async()=>{if(!x.trim()){alert("角色名称不能为空");return}P(!0);try{if(f){const j=await zt("/api/db/vip-roles",{id:f.id,name:x.trim(),sort:v});j!=null&&j.success?(u(!1),C()):alert("更新失败: "+(j==null?void 0:j.error))}else{const j=await jt("/api/db/vip-roles",{name:x.trim(),sort:v});j!=null&&j.success?(u(!1),C()):alert("新增失败: "+(j==null?void 0:j.error))}}catch(j){console.error("Save error:",j),alert("保存失败")}finally{P(!1)}},R=async j=>{if(confirm("确定删除该角色?已设置该角色的 VIP 用户将保留角色名称。"))try{const _=await Ri(`/api/db/vip-roles?id=${j}`);_!=null&&_.success?C():alert("删除失败: "+(_==null?void 0:_.error))}catch(_){console.error("Delete error:",_),alert("删除失败")}};return t.jsxs("div",{className:"p-8 w-full",children:[t.jsxs("div",{className:"flex justify-between items-center mb-8",children:[t.jsxs("div",{children:[t.jsxs("h2",{className:"text-2xl font-bold text-white flex items-center gap-2",children:[t.jsx(Ei,{className:"w-5 h-5 text-amber-400"}),"VIP 角色管理"]}),t.jsx("p",{className:"text-gray-400 mt-1",children:"超级个体固定角色,在「设置 VIP」时可选择或手动填写"})]}),t.jsxs(de,{onClick:N,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:[t.jsx(pr,{className:"w-4 h-4 mr-2"}),"新增角色"]})]}),t.jsx(Ce,{className:"bg-[#0f2137] border-gray-700/50",children:t.jsx(ke,{className:"p-0",children:l?t.jsx("div",{className:"py-12 text-center text-gray-400",children:"加载中..."}):t.jsxs(Nr,{children:[t.jsx(br,{children:t.jsxs(dt,{className:"bg-[#0a1628] border-gray-700",children:[t.jsx(Te,{className:"text-gray-400",children:"ID"}),t.jsx(Te,{className:"text-gray-400",children:"角色名称"}),t.jsx(Te,{className:"text-gray-400",children:"排序"}),t.jsx(Te,{className:"text-right text-gray-400",children:"操作"})]})}),t.jsxs(Sr,{children:[r.map(j=>t.jsxs(dt,{className:"border-gray-700/50",children:[t.jsx(Ee,{className:"text-gray-300",children:j.id}),t.jsx(Ee,{className:"text-white",children:j.name}),t.jsx(Ee,{className:"text-gray-400",children:j.sort}),t.jsxs(Ee,{className:"text-right",children:[t.jsx(de,{variant:"ghost",size:"sm",onClick:()=>b(j),className:"text-gray-400 hover:text-[#38bdac]",children:t.jsx(gr,{className:"w-4 h-4"})}),t.jsx(de,{variant:"ghost",size:"sm",onClick:()=>R(j.id),className:"text-gray-400 hover:text-red-400",children:t.jsx(Fa,{className:"w-4 h-4"})})]})]},j.id)),r.length===0&&t.jsx(dt,{children:t.jsx(Ee,{colSpan:4,className:"text-center py-12 text-gray-500",children:"暂无角色,点击「新增角色」添加"})})]})]})})}),t.jsx(Kt,{open:c,onOpenChange:u,children:t.jsxs($t,{className:"bg-[#0f2137] border-gray-700 text-white max-w-sm",children:[t.jsx(Gt,{children:t.jsx(Yt,{className:"text-white",children:f?"编辑角色":"新增角色"})}),t.jsxs("div",{className:"space-y-4 py-4",children:[t.jsxs("div",{className:"space-y-2",children:[t.jsx(q,{className:"text-gray-300",children:"角色名称"}),t.jsx(ne,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"如:创始人、投资人",value:x,onChange:j=>g(j.target.value)})]}),t.jsxs("div",{className:"space-y-2",children:[t.jsx(q,{className:"text-gray-300",children:"排序(下拉展示顺序,越小越前)"}),t.jsx(ne,{type:"number",className:"bg-[#0a1628] border-gray-700 text-white",value:v,onChange:j=>y(parseInt(j.target.value,10)||0)})]})]}),t.jsxs(sn,{children:[t.jsxs(de,{variant:"outline",onClick:()=>u(!1),className:"border-gray-600 text-gray-300",children:[t.jsx(Pn,{className:"w-4 h-4 mr-2"}),"取消"]}),t.jsxs(de,{onClick:k,disabled:E,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:[t.jsx(an,{className:"w-4 h-4 mr-2"}),E?"保存中...":"保存"]})]})]})})]})}function e4(){const[r,a]=p.useState([]),[l,o]=p.useState(!0),[c,u]=p.useState(!1),[f,m]=p.useState(null),[x,g]=p.useState({name:"",avatar:"",intro:"",tags:"",priceSingle:"",priceHalfYear:"",priceYear:"",quote:"",whyFind:"",offering:"",judgmentStyle:"",sort:0,enabled:!0}),[v,y]=p.useState(!1);async function E(){o(!0);try{const j=await He("/api/db/mentors");j!=null&&j.success&&j.data&&a(j.data)}catch(j){console.error("Load mentors error:",j)}finally{o(!1)}}p.useEffect(()=>{E()},[]);const P=()=>{g({name:"",avatar:"",intro:"",tags:"",priceSingle:"",priceHalfYear:"",priceYear:"",quote:"",whyFind:"",offering:"",judgmentStyle:"",sort:r.length>0?Math.max(...r.map(j=>j.sort))+1:0,enabled:!0})},C=()=>{m(null),P(),u(!0)},N=j=>{m(j),g({name:j.name,avatar:j.avatar||"",intro:j.intro||"",tags:j.tags||"",priceSingle:j.priceSingle!=null?String(j.priceSingle):"",priceHalfYear:j.priceHalfYear!=null?String(j.priceHalfYear):"",priceYear:j.priceYear!=null?String(j.priceYear):"",quote:j.quote||"",whyFind:j.whyFind||"",offering:j.offering||"",judgmentStyle:j.judgmentStyle||"",sort:j.sort,enabled:j.enabled??!0}),u(!0)},b=async()=>{if(!x.name.trim()){alert("导师姓名不能为空");return}y(!0);try{const j=F=>F===""?void 0:parseFloat(F),_={name:x.name.trim(),avatar:x.avatar.trim()||void 0,intro:x.intro.trim()||void 0,tags:x.tags.trim()||void 0,priceSingle:j(x.priceSingle),priceHalfYear:j(x.priceHalfYear),priceYear:j(x.priceYear),quote:x.quote.trim()||void 0,whyFind:x.whyFind.trim()||void 0,offering:x.offering.trim()||void 0,judgmentStyle:x.judgmentStyle.trim()||void 0,sort:x.sort,enabled:x.enabled};if(f){const F=await zt("/api/db/mentors",{id:f.id,..._});F!=null&&F.success?(u(!1),E()):alert("更新失败: "+(F==null?void 0:F.error))}else{const F=await jt("/api/db/mentors",_);F!=null&&F.success?(u(!1),E()):alert("新增失败: "+(F==null?void 0:F.error))}}catch(j){console.error("Save error:",j),alert("保存失败")}finally{y(!1)}},k=async j=>{if(confirm("确定删除该导师?"))try{const _=await Ri(`/api/db/mentors?id=${j}`);_!=null&&_.success?E():alert("删除失败: "+(_==null?void 0:_.error))}catch(_){console.error("Delete error:",_),alert("删除失败")}},R=j=>j!=null?`¥${j}`:"-";return t.jsxs("div",{className:"p-8 w-full",children:[t.jsxs("div",{className:"flex justify-between items-center mb-8",children:[t.jsxs("div",{children:[t.jsxs("h2",{className:"text-2xl font-bold text-white flex items-center gap-2",children:[t.jsx(xn,{className:"w-5 h-5 text-[#38bdac]"}),"导师管理"]}),t.jsx("p",{className:"text-gray-400 mt-1",children:"stitch_soul 导师列表,支持每个导师独立配置单次/半年/年度价格"})]}),t.jsxs(de,{onClick:C,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:[t.jsx(pr,{className:"w-4 h-4 mr-2"}),"新增导师"]})]}),t.jsx(Ce,{className:"bg-[#0f2137] border-gray-700/50",children:t.jsx(ke,{className:"p-0",children:l?t.jsx("div",{className:"py-12 text-center text-gray-400",children:"加载中..."}):t.jsxs(Nr,{children:[t.jsx(br,{children:t.jsxs(dt,{className:"bg-[#0a1628] border-gray-700",children:[t.jsx(Te,{className:"text-gray-400",children:"ID"}),t.jsx(Te,{className:"text-gray-400",children:"姓名"}),t.jsx(Te,{className:"text-gray-400",children:"简介"}),t.jsx(Te,{className:"text-gray-400",children:"单次"}),t.jsx(Te,{className:"text-gray-400",children:"半年"}),t.jsx(Te,{className:"text-gray-400",children:"年度"}),t.jsx(Te,{className:"text-gray-400",children:"排序"}),t.jsx(Te,{className:"text-right text-gray-400",children:"操作"})]})}),t.jsxs(Sr,{children:[r.map(j=>t.jsxs(dt,{className:"border-gray-700/50",children:[t.jsx(Ee,{className:"text-gray-300",children:j.id}),t.jsx(Ee,{className:"text-white",children:j.name}),t.jsx(Ee,{className:"text-gray-400 max-w-[200px] truncate",children:j.intro||"-"}),t.jsx(Ee,{className:"text-gray-400",children:R(j.priceSingle)}),t.jsx(Ee,{className:"text-gray-400",children:R(j.priceHalfYear)}),t.jsx(Ee,{className:"text-gray-400",children:R(j.priceYear)}),t.jsx(Ee,{className:"text-gray-400",children:j.sort}),t.jsxs(Ee,{className:"text-right",children:[t.jsx(de,{variant:"ghost",size:"sm",onClick:()=>N(j),className:"text-gray-400 hover:text-[#38bdac]",children:t.jsx(gr,{className:"w-4 h-4"})}),t.jsx(de,{variant:"ghost",size:"sm",onClick:()=>k(j.id),className:"text-gray-400 hover:text-red-400",children:t.jsx(Fa,{className:"w-4 h-4"})})]})]},j.id)),r.length===0&&t.jsx(dt,{children:t.jsx(Ee,{colSpan:8,className:"text-center py-12 text-gray-500",children:"暂无导师,点击「新增导师」添加"})})]})]})})}),t.jsx(Kt,{open:c,onOpenChange:u,children:t.jsxs($t,{className:"bg-[#0f2137] border-gray-700 text-white max-w-lg max-h-[90vh] overflow-y-auto",children:[t.jsx(Gt,{children:t.jsx(Yt,{className:"text-white",children:f?"编辑导师":"新增导师"})}),t.jsxs("div",{className:"space-y-4 py-4",children:[t.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[t.jsxs("div",{className:"space-y-2",children:[t.jsx(q,{className:"text-gray-300",children:"姓名 *"}),t.jsx(ne,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"如:卡若",value:x.name,onChange:j=>g(_=>({..._,name:j.target.value}))})]}),t.jsxs("div",{className:"space-y-2",children:[t.jsx(q,{className:"text-gray-300",children:"排序"}),t.jsx(ne,{type:"number",className:"bg-[#0a1628] border-gray-700 text-white",value:x.sort,onChange:j=>g(_=>({..._,sort:parseInt(j.target.value,10)||0}))})]})]}),t.jsxs("div",{className:"space-y-2",children:[t.jsx(q,{className:"text-gray-300",children:"头像 URL"}),t.jsx(ne,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"https://...",value:x.avatar,onChange:j=>g(_=>({..._,avatar:j.target.value}))})]}),t.jsxs("div",{className:"space-y-2",children:[t.jsx(q,{className:"text-gray-300",children:"简介"}),t.jsx(ne,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"如:结构判断型咨询 · Decision > Execution",value:x.intro,onChange:j=>g(_=>({..._,intro:j.target.value}))})]}),t.jsxs("div",{className:"space-y-2",children:[t.jsx(q,{className:"text-gray-300",children:"技能标签(逗号分隔)"}),t.jsx(ne,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"如:项目结构判断、风险止损、人×项目匹配",value:x.tags,onChange:j=>g(_=>({..._,tags:j.target.value}))})]}),t.jsxs("div",{className:"border-t border-gray-700 pt-4",children:[t.jsx(q,{className:"text-gray-300 block mb-2",children:"价格配置(每个导师独立)"}),t.jsxs("div",{className:"grid grid-cols-3 gap-4",children:[t.jsxs("div",{className:"space-y-2",children:[t.jsx(q,{className:"text-gray-500 text-xs",children:"单次咨询 ¥"}),t.jsx(ne,{type:"number",step:"0.01",className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"980",value:x.priceSingle,onChange:j=>g(_=>({..._,priceSingle:j.target.value}))})]}),t.jsxs("div",{className:"space-y-2",children:[t.jsx(q,{className:"text-gray-500 text-xs",children:"半年咨询 ¥"}),t.jsx(ne,{type:"number",step:"0.01",className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"19800",value:x.priceHalfYear,onChange:j=>g(_=>({..._,priceHalfYear:j.target.value}))})]}),t.jsxs("div",{className:"space-y-2",children:[t.jsx(q,{className:"text-gray-500 text-xs",children:"年度咨询 ¥"}),t.jsx(ne,{type:"number",step:"0.01",className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"29800",value:x.priceYear,onChange:j=>g(_=>({..._,priceYear:j.target.value}))})]})]})]}),t.jsxs("div",{className:"space-y-2",children:[t.jsx(q,{className:"text-gray-300",children:"引言"}),t.jsx(ne,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"如:大多数人失败,不是因为不努力...",value:x.quote,onChange:j=>g(_=>({..._,quote:j.target.value}))})]}),t.jsxs("div",{className:"space-y-2",children:[t.jsx(q,{className:"text-gray-300",children:"为什么找(文本)"}),t.jsx(ne,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"",value:x.whyFind,onChange:j=>g(_=>({..._,whyFind:j.target.value}))})]}),t.jsxs("div",{className:"space-y-2",children:[t.jsx(q,{className:"text-gray-300",children:"提供什么(文本)"}),t.jsx(ne,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"",value:x.offering,onChange:j=>g(_=>({..._,offering:j.target.value}))})]}),t.jsxs("div",{className:"space-y-2",children:[t.jsx(q,{className:"text-gray-300",children:"判断风格(逗号分隔)"}),t.jsx(ne,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"如:冷静、克制、偏风险视角",value:x.judgmentStyle,onChange:j=>g(_=>({..._,judgmentStyle:j.target.value}))})]}),t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx("input",{type:"checkbox",id:"enabled",checked:x.enabled,onChange:j=>g(_=>({..._,enabled:j.target.checked})),className:"rounded border-gray-600 bg-[#0a1628]"}),t.jsx(q,{htmlFor:"enabled",className:"text-gray-300 cursor-pointer",children:"上架(小程序可见)"})]})]}),t.jsxs(sn,{children:[t.jsxs(de,{variant:"outline",onClick:()=>u(!1),className:"border-gray-600 text-gray-300",children:[t.jsx(Pn,{className:"w-4 h-4 mr-2"}),"取消"]}),t.jsxs(de,{onClick:b,disabled:v,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:[t.jsx(an,{className:"w-4 h-4 mr-2"}),v?"保存中...":"保存"]})]})]})})]})}function t4(){const[r,a]=p.useState([]),[l,o]=p.useState(!0),[c,u]=p.useState("");async function f(){o(!0);try{const g=c?`/api/db/mentor-consultations?status=${c}`:"/api/db/mentor-consultations",v=await He(g);v!=null&&v.success&&v.data&&a(v.data)}catch(g){console.error("Load consultations error:",g)}finally{o(!1)}}p.useEffect(()=>{f()},[c]);const m={created:"已创建",pending_pay:"待支付",paid:"已支付",completed:"已完成",cancelled:"已取消"},x={single:"单次",half_year:"半年",year:"年度"};return t.jsxs("div",{className:"p-8 w-full",children:[t.jsxs("div",{className:"flex justify-between items-center mb-8",children:[t.jsxs("div",{children:[t.jsxs("h2",{className:"text-2xl font-bold text-white flex items-center gap-2",children:[t.jsx(Aa,{className:"w-5 h-5 text-[#38bdac]"}),"导师预约列表"]}),t.jsx("p",{className:"text-gray-400 mt-1",children:"stitch_soul 导师咨询预约记录"})]}),t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsxs("select",{value:c,onChange:g=>u(g.target.value),className:"bg-[#0f2137] border border-gray-700 rounded-lg px-3 py-2 text-gray-300 text-sm",children:[t.jsx("option",{value:"",children:"全部状态"}),Object.entries(m).map(([g,v])=>t.jsx("option",{value:g,children:v},g))]}),t.jsxs(de,{onClick:f,disabled:l,variant:"outline",className:"border-gray-600 text-gray-300",children:[t.jsx(tt,{className:`w-4 h-4 mr-2 ${l?"animate-spin":""}`}),"刷新"]})]})]}),t.jsx(Ce,{className:"bg-[#0f2137] border-gray-700/50",children:t.jsx(ke,{className:"p-0",children:l?t.jsx("div",{className:"py-12 text-center text-gray-400",children:"加载中..."}):t.jsxs(Nr,{children:[t.jsx(br,{children:t.jsxs(dt,{className:"bg-[#0a1628] border-gray-700",children:[t.jsx(Te,{className:"text-gray-400",children:"ID"}),t.jsx(Te,{className:"text-gray-400",children:"用户ID"}),t.jsx(Te,{className:"text-gray-400",children:"导师ID"}),t.jsx(Te,{className:"text-gray-400",children:"类型"}),t.jsx(Te,{className:"text-gray-400",children:"金额"}),t.jsx(Te,{className:"text-gray-400",children:"状态"}),t.jsx(Te,{className:"text-gray-400",children:"创建时间"})]})}),t.jsxs(Sr,{children:[r.map(g=>t.jsxs(dt,{className:"border-gray-700/50",children:[t.jsx(Ee,{className:"text-gray-300",children:g.id}),t.jsx(Ee,{className:"text-gray-400",children:g.userId}),t.jsx(Ee,{className:"text-gray-400",children:g.mentorId}),t.jsx(Ee,{className:"text-gray-400",children:x[g.consultationType]||g.consultationType}),t.jsxs(Ee,{className:"text-white",children:["¥",g.amount]}),t.jsx(Ee,{className:"text-gray-400",children:m[g.status]||g.status}),t.jsx(Ee,{className:"text-gray-500 text-sm",children:g.createdAt})]},g.id)),r.length===0&&t.jsx(dt,{children:t.jsx(Ee,{colSpan:7,className:"text-center py-12 text-gray-500",children:"暂无预约记录"})})]})]})})})]})}function n4(){return t.jsxs("div",{className:"p-8 w-full",children:[t.jsxs("div",{className:"flex items-center gap-2 mb-8",children:[t.jsx(Wr,{className:"w-8 h-8 text-[#38bdac]"}),t.jsx("h1",{className:"text-2xl font-bold text-white",children:"API 接口文档"})]}),t.jsx("p",{className:"text-gray-400 mb-6",children:"API 风格:RESTful · 版本 v1.0 · 基础路径 /api · 简单、清晰、易用。"}),t.jsxs(Ce,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl mb-6",children:[t.jsx(Be,{children:t.jsx(Ve,{className:"text-white",children:"1. 接口总览"})}),t.jsxs(ke,{className:"space-y-4 text-sm",children:[t.jsxs("div",{children:[t.jsx("p",{className:"text-gray-400 mb-2",children:"接口分类"}),t.jsxs("ul",{className:"space-y-1 text-gray-300 font-mono",children:[t.jsx("li",{children:"/api/book — 书籍内容(章节列表、内容获取、同步)"}),t.jsx("li",{children:"/api/payment — 支付系统(订单创建、回调、状态查询)"}),t.jsx("li",{children:"/api/referral — 分销系统(邀请码、收益、提现)"}),t.jsx("li",{children:"/api/user — 用户系统(登录、注册、信息更新)"}),t.jsx("li",{children:"/api/match — 匹配系统(寻找匹配、匹配历史)"}),t.jsx("li",{children:"/api/admin — 管理后台(内容/订单/用户/分销管理)"}),t.jsx("li",{children:"/api/config — 配置系统"})]})]}),t.jsxs("div",{children:[t.jsx("p",{className:"text-gray-400 mb-2",children:"认证方式"}),t.jsx("p",{className:"text-gray-300",children:"用户:Cookie session_id(可选)"}),t.jsx("p",{className:"text-gray-300",children:"管理端:Authorization: Bearer admin-token-secret"})]})]})]}),t.jsxs(Ce,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl mb-6",children:[t.jsx(Be,{children:t.jsx(Ve,{className:"text-white",children:"2. 书籍内容"})}),t.jsxs(ke,{className:"space-y-2 text-sm text-gray-300 font-mono",children:[t.jsx("p",{children:"GET /api/book/all-chapters — 获取所有章节"}),t.jsx("p",{children:"GET /api/book/chapter/:id — 获取单章内容"}),t.jsx("p",{children:"POST /api/book/sync — 同步章节(需管理员认证)"})]})]}),t.jsxs(Ce,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl mb-6",children:[t.jsx(Be,{children:t.jsx(Ve,{className:"text-white",children:"3. 支付"})}),t.jsxs(ke,{className:"space-y-2 text-sm text-gray-300 font-mono",children:[t.jsx("p",{children:"POST /api/payment/create-order — 创建订单"}),t.jsx("p",{children:"POST /api/payment/alipay/notify — 支付宝回调"}),t.jsx("p",{children:"POST /api/payment/wechat/notify — 微信回调"})]})]}),t.jsxs(Ce,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl mb-6",children:[t.jsx(Be,{children:t.jsx(Ve,{className:"text-white",children:"4. 分销与用户"})}),t.jsxs(ke,{className:"space-y-2 text-sm text-gray-300 font-mono",children:[t.jsx("p",{children:"/api/referral/* — 邀请码、收益查询、提现"}),t.jsx("p",{children:"/api/user/* — 登录、注册、信息更新"}),t.jsx("p",{children:"/api/match/* — 匹配、匹配历史"})]})]}),t.jsxs(Ce,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl mb-6",children:[t.jsx(Be,{children:t.jsx(Ve,{className:"text-white",children:"5. 管理后台"})}),t.jsxs(ke,{className:"space-y-2 text-sm text-gray-300 font-mono",children:[t.jsx("p",{children:"GET/POST /api/admin/referral-settings — 推广/分销设置(含 VIP 配置)"}),t.jsx("p",{children:"GET /api/db/users、/api/db/book — 用户与章节数据"}),t.jsx("p",{children:"GET /api/orders — 订单列表"})]})]}),t.jsx("p",{className:"text-gray-500 text-xs",children:"完整说明见项目内 开发文档/5、接口/API接口完整文档.md"})]})}function r4(){const r=Jr();return t.jsx("div",{className:"min-h-screen bg-[#0a1628] flex items-center justify-center p-8",children:t.jsxs("div",{className:"text-center max-w-md",children:[t.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:t.jsx(wj,{className:"w-10 h-10"})}),t.jsx("h1",{className:"text-4xl font-bold text-white mb-2",children:"404"}),t.jsx("p",{className:"text-gray-400 mb-1",children:"页面不存在"}),t.jsx("p",{className:"text-sm text-gray-500 font-mono mb-8 break-all",children:r.pathname}),t.jsx(de,{asChild:!0,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:t.jsxs(ip,{to:"/",children:[t.jsx(Yj,{className:"w-4 h-4 mr-2"}),"返回首页"]})})]})})}function s4(){return t.jsxs(qy,{children:[t.jsx(at,{path:"/login",element:t.jsx(YN,{})}),t.jsxs(at,{path:"/",element:t.jsx(Xw,{}),children:[t.jsx(at,{index:!0,element:t.jsx(Gy,{to:"/dashboard",replace:!0})}),t.jsx(at,{path:"dashboard",element:t.jsx(qN,{})}),t.jsx(at,{path:"orders",element:t.jsx(L1,{})}),t.jsx(at,{path:"users",element:t.jsx(o2,{})}),t.jsx(at,{path:"distribution",element:t.jsx(c2,{})}),t.jsx(at,{path:"withdrawals",element:t.jsx(d2,{})}),t.jsx(at,{path:"content",element:t.jsx(pC,{})}),t.jsx(at,{path:"chapters",element:t.jsx(xC,{})}),t.jsx(at,{path:"referral-settings",element:t.jsx(FC,{})}),t.jsx(at,{path:"vip-roles",element:t.jsx(ZC,{})}),t.jsx(at,{path:"mentors",element:t.jsx(e4,{})}),t.jsx(at,{path:"mentor-consultations",element:t.jsx(t4,{})}),t.jsx(at,{path:"settings",element:t.jsx(UC,{})}),t.jsx(at,{path:"payment",element:t.jsx(WC,{})}),t.jsx(at,{path:"site",element:t.jsx(YC,{})}),t.jsx(at,{path:"qrcodes",element:t.jsx(QC,{})}),t.jsx(at,{path:"match",element:t.jsx(XC,{})}),t.jsx(at,{path:"match-records",element:t.jsx(JC,{})}),t.jsx(at,{path:"api-doc",element:t.jsx(n4,{})})]}),t.jsx(at,{path:"*",element:t.jsx(r4,{})})]})}Zv.createRoot(document.getElementById("root")).render(t.jsx(p.StrictMode,{children:t.jsx(rj,{future:{v7_startTransition:!0,v7_relativeSplatPath:!0},children:t.jsx(s4,{})})})); diff --git a/soul-admin/dist/assets/index-D0nEGm4H.css b/soul-admin/dist/assets/index-D0nEGm4H.css deleted file mode 100644 index c5f31fa8..00000000 --- a/soul-admin/dist/assets/index-D0nEGm4H.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-orange-600:oklch(64.6% .222 41.116);--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;--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-full{min-height:100%}.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-\[100px\]{max-width:100px}.max-w-\[120px\]{max-width:120px}.max-w-\[200px\]{max-width:200px}.max-w-\[calc\(100\%-2rem\)\]{max-width:calc(100% - 2rem)}.max-w-lg{max-width:var(--container-lg)}.max-w-md{max-width:var(--container-md)}.max-w-sm{max-width:var(--container-sm)}.min-w-0{min-width:calc(var(--spacing)*0)}.min-w-\[8rem\]{min-width:8rem}.min-w-\[1024px\]{min-width:1024px}.flex-1{flex:1}.flex-shrink-0{flex-shrink:0}.shrink{flex-shrink:1}.shrink-0{flex-shrink:0}.grow{flex-grow:1}.caption-bottom{caption-side:bottom}.border-collapse{border-collapse:collapse}.-translate-x-1\/2{--tw-translate-x: -50% ;translate:var(--tw-translate-x)var(--tw-translate-y)}.-translate-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-orange-500\/50{border-color:#fe6e0080}@supports (color:color-mix(in lab,red,red)){.border-orange-500\/50{border-color:color-mix(in oklab,var(--color-orange-500)50%,transparent)}}.border-purple-500\/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{background-color:var(--color-orange-500)}.bg-orange-500\/10{background-color:#fe6e001a}@supports (color:color-mix(in lab,red,red)){.bg-orange-500\/10{background-color:color-mix(in oklab,var(--color-orange-500)10%,transparent)}}.bg-orange-500\/20{background-color:#fe6e0033}@supports (color:color-mix(in lab,red,red)){.bg-orange-500\/20{background-color:color-mix(in oklab,var(--color-orange-500)20%,transparent)}}.bg-purple-500\/20{background-color:#ac4bff33}@supports (color:color-mix(in lab,red,red)){.bg-purple-500\/20{background-color:color-mix(in oklab,var(--color-purple-500)20%,transparent)}}.bg-red-500\/10{background-color:#fb2c361a}@supports (color:color-mix(in lab,red,red)){.bg-red-500\/10{background-color:color-mix(in oklab,var(--color-red-500)10%,transparent)}}.bg-red-500\/20{background-color:#fb2c3633}@supports (color:color-mix(in lab,red,red)){.bg-red-500\/20{background-color:color-mix(in oklab,var(--color-red-500)20%,transparent)}}.bg-transparent{background-color:#0000}.bg-white{background-color:var(--color-white)}.bg-white\/5{background-color:#ffffff0d}@supports (color:color-mix(in lab,red,red)){.bg-white\/5{background-color:color-mix(in oklab,var(--color-white)5%,transparent)}}.bg-white\/10{background-color:#ffffff1a}@supports (color:color-mix(in lab,red,red)){.bg-white\/10{background-color:color-mix(in oklab,var(--color-white)10%,transparent)}}.bg-white\/20{background-color:#fff3}@supports (color:color-mix(in lab,red,red)){.bg-white\/20{background-color:color-mix(in oklab,var(--color-white)20%,transparent)}}.bg-yellow-500\/20{background-color:#edb20033}@supports (color:color-mix(in lab,red,red)){.bg-yellow-500\/20{background-color:color-mix(in oklab,var(--color-yellow-500)20%,transparent)}}.bg-gradient-to-br{--tw-gradient-position:to bottom right in oklab;background-image:linear-gradient(var(--tw-gradient-stops))}.bg-gradient-to-r{--tw-gradient-position:to right in oklab;background-image:linear-gradient(var(--tw-gradient-stops))}.from-\[\#00CED1\]{--tw-gradient-from:#00ced1;--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.from-\[\#38bdac\]\/10{--tw-gradient-from:oklab(72.378% -.11483 -.0053193/.1);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.from-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-orange-400\/80{color:#ff8b1acc}@supports (color:color-mix(in lab,red,red)){.text-orange-400\/80{color:color-mix(in oklab,var(--color-orange-400)80%,transparent)}}.text-purple-400{color:var(--color-purple-400)}.text-red-400{color:var(--color-red-400)}.text-white{color:var(--color-white)}.text-white\/40{color:#fff6}@supports (color:color-mix(in lab,red,red)){.text-white\/40{color:color-mix(in oklab,var(--color-white)40%,transparent)}}.text-white\/60{color:#fff9}@supports (color:color-mix(in lab,red,red)){.text-white\/60{color:color-mix(in oklab,var(--color-white)60%,transparent)}}.text-white\/70{color:#ffffffb3}@supports (color:color-mix(in lab,red,red)){.text-white\/70{color:color-mix(in oklab,var(--color-white)70%,transparent)}}.text-white\/80{color:#fffc}@supports (color:color-mix(in lab,red,red)){.text-white\/80{color:color-mix(in oklab,var(--color-white)80%,transparent)}}.text-yellow-400{color:var(--color-yellow-400)}.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-500\/20:hover{background-color:#6a728233}@supports (color:color-mix(in lab,red,red)){.hover\:bg-gray-500\/20:hover{background-color:color-mix(in oklab,var(--color-gray-500)20%,transparent)}}.hover\:bg-gray-700\/50:hover{background-color:#36415380}@supports (color:color-mix(in lab,red,red)){.hover\:bg-gray-700\/50:hover{background-color:color-mix(in oklab,var(--color-gray-700)50%,transparent)}}.hover\:bg-gray-800:hover{background-color:var(--color-gray-800)}.hover\:bg-green-500\/20:hover{background-color:#00c75833}@supports (color:color-mix(in lab,red,red)){.hover\:bg-green-500\/20:hover{background-color:color-mix(in oklab,var(--color-green-500)20%,transparent)}}.hover\:bg-green-700:hover{background-color:var(--color-green-700)}.hover\:bg-orange-500\/20:hover{background-color:#fe6e0033}@supports (color:color-mix(in lab,red,red)){.hover\:bg-orange-500\/20:hover{background-color:color-mix(in oklab,var(--color-orange-500)20%,transparent)}}.hover\:bg-orange-600:hover{background-color:var(--color-orange-600)}.hover\:bg-purple-500\/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-DP984f3K.css b/soul-admin/dist/assets/index-DP984f3K.css new file mode 100644 index 00000000..79eee7ca --- /dev/null +++ b/soul-admin/dist/assets/index-DP984f3K.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;--tw-duration:initial}}}@layer theme{:root,:host{--font-sans:-apple-system,BlinkMacSystemFont,"Segoe UI","PingFang SC","Microsoft YaHei",sans-serif;--font-mono:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace;--color-red-300:oklch(80.8% .114 19.571);--color-red-400:oklch(70.4% .191 22.216);--color-red-500:oklch(63.7% .237 25.331);--color-orange-300:oklch(83.7% .128 66.29);--color-orange-400:oklch(75% .183 55.934);--color-orange-500:oklch(70.5% .213 47.604);--color-orange-600:oklch(64.6% .222 41.116);--color-amber-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-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;--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-tight:1.25;--leading-relaxed:1.625;--radius-sm:.25rem;--radius-md:.375rem;--radius-lg:.5rem;--radius-xl:.75rem;--radius-2xl:1rem;--animate-spin:spin 1s linear infinite;--blur-xl:24px;--blur-3xl:64px;--default-transition-duration:.15s;--default-transition-timing-function:cubic-bezier(.4,0,.2,1);--default-font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","PingFang SC","Microsoft YaHei",sans-serif;--default-mono-font-family:var(--font-mono)}}@layer base{*,:after,:before,::backdrop{box-sizing:border-box;border:0 solid;margin:0;padding:0}::file-selector-button{box-sizing:border-box;border:0 solid;margin:0;padding:0}html,:host{-webkit-text-size-adjust:100%;-moz-tab-size:4;tab-size:4;line-height:1.5;font-family:var(--default-font-family,ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji");font-feature-settings:var(--default-font-feature-settings,normal);font-variation-settings:var(--default-font-variation-settings,normal);-webkit-tap-highlight-color:transparent}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:var(--default-mono-font-family,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace);font-feature-settings:var(--default-mono-font-feature-settings,normal);font-variation-settings:var(--default-mono-font-variation-settings,normal);font-size:1em}small{font-size:80%}sub,sup{vertical-align:baseline;font-size:75%;line-height:0;position:relative}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}:-moz-focusring{outline:auto}progress{vertical-align:baseline}summary{display:list-item}ol,ul,menu{list-style:none}img,svg,video,canvas,audio,iframe,embed,object{vertical-align:middle;display:block}img,video{max-width:100%;height:auto}button,input,select,optgroup,textarea{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}::file-selector-button{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}:where(select:is([multiple],[size])) optgroup{font-weight:bolder}:where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}::file-selector-button{margin-inline-end:4px}::placeholder{opacity:1}@supports (not ((-webkit-appearance:-apple-pay-button))) or (contain-intrinsic-size:1px){::placeholder{color:currentColor}@supports (color:color-mix(in lab,red,red)){::placeholder{color:color-mix(in oklab,currentcolor 50%,transparent)}}}textarea{resize:vertical}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}::-webkit-datetime-edit{display:inline-flex}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-datetime-edit{padding-block:0}::-webkit-datetime-edit-year-field{padding-block:0}::-webkit-datetime-edit-month-field{padding-block:0}::-webkit-datetime-edit-day-field{padding-block:0}::-webkit-datetime-edit-hour-field{padding-block:0}::-webkit-datetime-edit-minute-field{padding-block:0}::-webkit-datetime-edit-second-field{padding-block:0}::-webkit-datetime-edit-millisecond-field{padding-block:0}::-webkit-datetime-edit-meridiem-field{padding-block:0}::-webkit-calendar-picker-indicator{line-height:1}:-moz-ui-invalid{box-shadow:none}button,input:where([type=button],[type=reset],[type=submit]){-webkit-appearance:button;-moz-appearance:button;appearance:button}::file-selector-button{-webkit-appearance:button;-moz-appearance:button;appearance:button}::-webkit-inner-spin-button{height:auto}::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}}@layer components;@layer utilities{.pointer-events-none{pointer-events:none}.collapse{visibility:collapse}.invisible{visibility:hidden}.visible{visibility:visible}.sr-only{clip-path:inset(50%);white-space:nowrap;border-width:0;width:1px;height:1px;margin:-1px;padding:0;position:absolute;overflow:hidden}.not-sr-only{clip-path:none;white-space:normal;width:auto;height:auto;margin:0;padding:0;position:static;overflow:visible}.absolute{position:absolute}.fixed{position:fixed}.relative{position:relative}.static{position:static}.sticky{position:sticky}.inset-0{inset:calc(var(--spacing)*0)}.top-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-2{margin-inline:calc(var(--spacing)*-2)}.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-2{height:calc(var(--spacing)*2)}.h-3{height:calc(var(--spacing)*3)}.h-3\.5{height:calc(var(--spacing)*3.5)}.h-4{height:calc(var(--spacing)*4)}.h-5{height:calc(var(--spacing)*5)}.h-6{height:calc(var(--spacing)*6)}.h-7{height:calc(var(--spacing)*7)}.h-8{height:calc(var(--spacing)*8)}.h-9{height:calc(var(--spacing)*9)}.h-10{height:calc(var(--spacing)*10)}.h-12{height:calc(var(--spacing)*12)}.h-16{height:calc(var(--spacing)*16)}.h-20{height:calc(var(--spacing)*20)}.h-24{height:calc(var(--spacing)*24)}.h-96{height:calc(var(--spacing)*96)}.h-\[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-\[40px\]{min-height:40px}.min-h-\[80px\]{min-height:80px}.min-h-\[100px\]{min-height:100px}.min-h-\[120px\]{min-height:120px}.min-h-\[300px\]{min-height:300px}.min-h-\[400px\]{min-height:400px}.min-h-full{min-height:100%}.min-h-screen{min-height:100vh}.w-2{width:calc(var(--spacing)*2)}.w-3{width:calc(var(--spacing)*3)}.w-3\.5{width:calc(var(--spacing)*3.5)}.w-4{width:calc(var(--spacing)*4)}.w-5{width:calc(var(--spacing)*5)}.w-6{width:calc(var(--spacing)*6)}.w-8{width:calc(var(--spacing)*8)}.w-9{width:calc(var(--spacing)*9)}.w-10{width:calc(var(--spacing)*10)}.w-12{width:calc(var(--spacing)*12)}.w-16{width:calc(var(--spacing)*16)}.w-20{width:calc(var(--spacing)*20)}.w-24{width:calc(var(--spacing)*24)}.w-48{width:calc(var(--spacing)*48)}.w-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-\[100px\]{max-width:100px}.max-w-\[120px\]{max-width:120px}.max-w-\[200px\]{max-width:200px}.max-w-\[calc\(100\%-2rem\)\]{max-width:calc(100% - 2rem)}.max-w-lg{max-width:var(--container-lg)}.max-w-md{max-width:var(--container-md)}.max-w-sm{max-width:var(--container-sm)}.min-w-0{min-width:calc(var(--spacing)*0)}.min-w-\[8rem\]{min-width:8rem}.min-w-\[1024px\]{min-width:1024px}.flex-1{flex:1}.flex-shrink-0{flex-shrink:0}.shrink{flex-shrink:1}.shrink-0{flex-shrink:0}.grow{flex-grow:1}.caption-bottom{caption-side:bottom}.border-collapse{border-collapse:collapse}.-translate-x-1\/2{--tw-translate-x: -50% ;translate:var(--tw-translate-x)var(--tw-translate-y)}.-translate-y-1\/2{--tw-translate-y: -50% ;translate:var(--tw-translate-x)var(--tw-translate-y)}.translate-none{translate:none}.scale-3d{scale:var(--tw-scale-x)var(--tw-scale-y)var(--tw-scale-z)}.scale-\[0\.98\]{scale:.98}.transform{transform:var(--tw-rotate-x,)var(--tw-rotate-y,)var(--tw-rotate-z,)var(--tw-skew-x,)var(--tw-skew-y,)}.animate-spin{animation:var(--animate-spin)}.cursor-default{cursor:default}.cursor-grab{cursor:grab}.cursor-pointer{cursor:pointer}.touch-pinch-zoom{--tw-pinch-zoom:pinch-zoom;touch-action:var(--tw-pan-x,)var(--tw-pan-y,)var(--tw-pinch-zoom,)}.touch-none{touch-action:none}.resize{resize:both}.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-0\.5{gap:calc(var(--spacing)*.5)}.gap-1{gap:calc(var(--spacing)*1)}.gap-1\.5{gap:calc(var(--spacing)*1.5)}.gap-2{gap:calc(var(--spacing)*2)}.gap-3{gap:calc(var(--spacing)*3)}.gap-4{gap:calc(var(--spacing)*4)}.gap-6{gap:calc(var(--spacing)*6)}.gap-8{gap:calc(var(--spacing)*8)}:where(.space-y-1>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*1)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*1)*calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-1\.5>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*1.5)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*1.5)*calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-2>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*2)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*2)*calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-3>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*3)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*3)*calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-4>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*4)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*4)*calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-6>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*6)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*6)*calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-reverse>:not(:last-child)){--tw-space-y-reverse:1}:where(.space-x-reverse>:not(:last-child)){--tw-space-x-reverse:1}:where(.divide-x>:not(:last-child)){--tw-divide-x-reverse:0;border-inline-style:var(--tw-border-style);border-inline-start-width:calc(1px*var(--tw-divide-x-reverse));border-inline-end-width:calc(1px*calc(1 - var(--tw-divide-x-reverse)))}:where(.divide-y>:not(:last-child)){--tw-divide-y-reverse:0;border-bottom-style:var(--tw-border-style);border-top-style:var(--tw-border-style);border-top-width:calc(1px*var(--tw-divide-y-reverse));border-bottom-width:calc(1px*calc(1 - var(--tw-divide-y-reverse)))}:where(.divide-y-reverse>:not(:last-child)){--tw-divide-y-reverse:1}:where(.divide-gray-700\/50>:not(:last-child)){border-color:#36415380}@supports (color:color-mix(in lab,red,red)){:where(.divide-gray-700\/50>:not(:last-child)){border-color:color-mix(in oklab,var(--color-gray-700)50%,transparent)}}.truncate{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.overflow-auto{overflow:auto}.overflow-hidden{overflow:hidden}.overflow-x-auto{overflow-x:auto}.overflow-y-auto{overflow-y:auto}.rounded{border-radius:.25rem}.rounded-2xl{border-radius:var(--radius-2xl)}.rounded-full{border-radius:3.40282e38px}.rounded-lg{border-radius:var(--radius-lg)}.rounded-md{border-radius:var(--radius-md)}.rounded-sm{border-radius:var(--radius-sm)}.rounded-xl{border-radius:var(--radius-xl)}.rounded-s{border-start-start-radius:.25rem;border-end-start-radius:.25rem}.rounded-ss{border-start-start-radius:.25rem}.rounded-e{border-start-end-radius:.25rem;border-end-end-radius:.25rem}.rounded-se{border-start-end-radius:.25rem}.rounded-ee{border-end-end-radius:.25rem}.rounded-es{border-end-start-radius:.25rem}.rounded-t{border-top-left-radius:.25rem;border-top-right-radius:.25rem}.rounded-l{border-top-left-radius:.25rem;border-bottom-left-radius:.25rem}.rounded-tl{border-top-left-radius:.25rem}.rounded-r{border-top-right-radius:.25rem;border-bottom-right-radius:.25rem}.rounded-tr{border-top-right-radius:.25rem}.rounded-b{border-bottom-right-radius:.25rem;border-bottom-left-radius:.25rem}.rounded-br{border-bottom-right-radius:.25rem}.rounded-bl{border-bottom-left-radius:.25rem}.border{border-style:var(--tw-border-style);border-width:1px}.border-0{border-style:var(--tw-border-style);border-width:0}.border-2{border-style:var(--tw-border-style);border-width:2px}.border-x{border-inline-style:var(--tw-border-style);border-inline-width:1px}.border-y{border-block-style:var(--tw-border-style);border-block-width:1px}.border-s{border-inline-start-style:var(--tw-border-style);border-inline-start-width:1px}.border-e{border-inline-end-style:var(--tw-border-style);border-inline-end-width:1px}.border-t{border-top-style:var(--tw-border-style);border-top-width:1px}.border-r{border-right-style:var(--tw-border-style);border-right-width:1px}.border-b{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}.border-l{border-left-style:var(--tw-border-style);border-left-width:1px}.border-\[\#07C160\]{border-color:#07c160}.border-\[\#07C160\]\/20{border-color:#07c16033}.border-\[\#07C160\]\/30{border-color:#07c1604d}.border-\[\#38bdac\]{border-color:#38bdac}.border-\[\#38bdac\]\/30{border-color:#38bdac4d}.border-\[\#38bdac\]\/40{border-color:#38bdac66}.border-\[\#38bdac\]\/50{border-color:#38bdac80}.border-amber-500\/50{border-color:#f99c0080}@supports (color:color-mix(in lab,red,red)){.border-amber-500\/50{border-color:color-mix(in oklab,var(--color-amber-500)50%,transparent)}}.border-blue-500\/30{border-color:#3080ff4d}@supports (color:color-mix(in lab,red,red)){.border-blue-500\/30{border-color:color-mix(in oklab,var(--color-blue-500)30%,transparent)}}.border-blue-500\/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-gray-500{border-color:var(--color-gray-500)}.border-gray-600{border-color:var(--color-gray-600)}.border-gray-700{border-color:var(--color-gray-700)}.border-gray-700\/30{border-color:#3641534d}@supports (color:color-mix(in lab,red,red)){.border-gray-700\/30{border-color:color-mix(in oklab,var(--color-gray-700)30%,transparent)}}.border-gray-700\/50{border-color:#36415380}@supports (color:color-mix(in lab,red,red)){.border-gray-700\/50{border-color:color-mix(in oklab,var(--color-gray-700)50%,transparent)}}.border-orange-500\/30{border-color:#fe6e004d}@supports (color:color-mix(in lab,red,red)){.border-orange-500\/30{border-color:color-mix(in oklab,var(--color-orange-500)30%,transparent)}}.border-orange-500\/50{border-color:#fe6e0080}@supports (color:color-mix(in lab,red,red)){.border-orange-500\/50{border-color:color-mix(in oklab,var(--color-orange-500)50%,transparent)}}.border-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}.bg-\[\#0a1628\]{background-color:#0a1628}.bg-\[\#0f2137\]{background-color:#0f2137}.bg-\[\#00CED1\]{background-color:#00ced1}.bg-\[\#1C1C1E\]{background-color:#1c1c1e}.bg-\[\#07C160\]{background-color:#07c160}.bg-\[\#07C160\]\/5{background-color:#07c1600d}.bg-\[\#07C160\]\/10{background-color:#07c1601a}.bg-\[\#38bdac\]{background-color:#38bdac}.bg-\[\#38bdac\]\/5{background-color:#38bdac0d}.bg-\[\#38bdac\]\/10{background-color:#38bdac1a}.bg-\[\#38bdac\]\/15{background-color:#38bdac26}.bg-\[\#38bdac\]\/20{background-color:#38bdac33}.bg-\[\#38bdac\]\/30{background-color:#38bdac4d}.bg-\[\#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\/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-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-gray-500{background-color:var(--color-gray-500)}.bg-gray-500\/20{background-color:#6a728233}@supports (color:color-mix(in lab,red,red)){.bg-gray-500\/20{background-color:color-mix(in oklab,var(--color-gray-500)20%,transparent)}}.bg-gray-600{background-color:var(--color-gray-600)}.bg-gray-600\/50{background-color:#4a556580}@supports (color:color-mix(in lab,red,red)){.bg-gray-600\/50{background-color:color-mix(in oklab,var(--color-gray-600)50%,transparent)}}.bg-gray-700\/50{background-color:#36415380}@supports (color:color-mix(in lab,red,red)){.bg-gray-700\/50{background-color:color-mix(in oklab,var(--color-gray-700)50%,transparent)}}.bg-green-500{background-color:var(--color-green-500)}.bg-green-500\/20{background-color:#00c75833}@supports (color:color-mix(in lab,red,red)){.bg-green-500\/20{background-color:color-mix(in oklab,var(--color-green-500)20%,transparent)}}.bg-green-600{background-color:var(--color-green-600)}.bg-orange-500{background-color:var(--color-orange-500)}.bg-orange-500\/10{background-color:#fe6e001a}@supports (color:color-mix(in lab,red,red)){.bg-orange-500\/10{background-color:color-mix(in oklab,var(--color-orange-500)10%,transparent)}}.bg-orange-500\/20{background-color:#fe6e0033}@supports (color:color-mix(in lab,red,red)){.bg-orange-500\/20{background-color:color-mix(in oklab,var(--color-orange-500)20%,transparent)}}.bg-purple-500\/20{background-color:#ac4bff33}@supports (color:color-mix(in lab,red,red)){.bg-purple-500\/20{background-color:color-mix(in oklab,var(--color-purple-500)20%,transparent)}}.bg-red-500\/10{background-color:#fb2c361a}@supports (color:color-mix(in lab,red,red)){.bg-red-500\/10{background-color:color-mix(in oklab,var(--color-red-500)10%,transparent)}}.bg-red-500\/20{background-color:#fb2c3633}@supports (color:color-mix(in lab,red,red)){.bg-red-500\/20{background-color:color-mix(in oklab,var(--color-red-500)20%,transparent)}}.bg-transparent{background-color:#0000}.bg-white{background-color:var(--color-white)}.bg-white\/5{background-color:#ffffff0d}@supports (color:color-mix(in lab,red,red)){.bg-white\/5{background-color:color-mix(in oklab,var(--color-white)5%,transparent)}}.bg-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))}.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))}.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-5{padding:calc(var(--spacing)*5)}.p-6{padding:calc(var(--spacing)*6)}.p-8{padding:calc(var(--spacing)*8)}.px-1\.5{padding-inline:calc(var(--spacing)*1.5)}.px-2{padding-inline:calc(var(--spacing)*2)}.px-3{padding-inline:calc(var(--spacing)*3)}.px-4{padding-inline:calc(var(--spacing)*4)}.px-5{padding-inline:calc(var(--spacing)*5)}.px-6{padding-inline:calc(var(--spacing)*6)}.py-0\.5{padding-block:calc(var(--spacing)*.5)}.py-1{padding-block:calc(var(--spacing)*1)}.py-1\.5{padding-block:calc(var(--spacing)*1.5)}.py-2{padding-block:calc(var(--spacing)*2)}.py-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-3{padding-top:calc(var(--spacing)*3)}.pt-4{padding-top:calc(var(--spacing)*4)}.pr-1{padding-right:calc(var(--spacing)*1)}.pr-2{padding-right:calc(var(--spacing)*2)}.pr-4{padding-right:calc(var(--spacing)*4)}.pb-1{padding-bottom:calc(var(--spacing)*1)}.pb-2{padding-bottom:calc(var(--spacing)*2)}.pb-4{padding-bottom:calc(var(--spacing)*4)}.pl-2{padding-left:calc(var(--spacing)*2)}.pl-4{padding-left:calc(var(--spacing)*4)}.pl-8{padding-left:calc(var(--spacing)*8)}.pl-10{padding-left:calc(var(--spacing)*10)}.text-center{text-align:center}.text-left{text-align:left}.text-right{text-align:right}.align-middle{vertical-align:middle}.font-mono{font-family:var(--font-mono)}.text-2xl{font-size:var(--text-2xl);line-height:var(--tw-leading,var(--text-2xl--line-height))}.text-3xl{font-size:var(--text-3xl);line-height:var(--tw-leading,var(--text-3xl--line-height))}.text-4xl{font-size:var(--text-4xl);line-height:var(--tw-leading,var(--text-4xl--line-height))}.text-base{font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height))}.text-lg{font-size:var(--text-lg);line-height:var(--tw-leading,var(--text-lg--line-height))}.text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.text-xl{font-size:var(--text-xl);line-height:var(--tw-leading,var(--text-xl--line-height))}.text-xs{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.text-\[10px\]{font-size:10px}.text-\[11px\]{font-size:11px}.leading-none{--tw-leading:1;line-height:1}.leading-relaxed{--tw-leading:var(--leading-relaxed);line-height:var(--leading-relaxed)}.leading-tight{--tw-leading:var(--leading-tight);line-height:var(--leading-tight)}.font-bold{--tw-font-weight:var(--font-weight-bold);font-weight:var(--font-weight-bold)}.font-medium{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.font-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-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-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-orange-400\/80{color:#ff8b1acc}@supports (color:color-mix(in lab,red,red)){.text-orange-400\/80{color:color-mix(in oklab,var(--color-orange-400)80%,transparent)}}.text-purple-400{color:var(--color-purple-400)}.text-red-400{color:var(--color-red-400)}.text-white{color:var(--color-white)}.text-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-60{opacity:.6}.opacity-70{opacity:.7}.shadow{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a),0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-lg{--tw-shadow:0 10px 15px -3px var(--tw-shadow-color,#0000001a),0 4px 6px -4px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-md{--tw-shadow:0 4px 6px -1px var(--tw-shadow-color,#0000001a),0 2px 4px -2px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-sm{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a),0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-xl{--tw-shadow:0 20px 25px -5px var(--tw-shadow-color,#0000001a),0 8px 10px -6px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-xs{--tw-shadow:0 1px 2px 0 var(--tw-shadow-color,#0000000d);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.ring-0{--tw-ring-shadow:var(--tw-ring-inset,)0 0 0 calc(0px + var(--tw-ring-offset-width))var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.ring-1{--tw-ring-shadow:var(--tw-ring-inset,)0 0 0 calc(1px + var(--tw-ring-offset-width))var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.ring-2{--tw-ring-shadow:var(--tw-ring-inset,)0 0 0 calc(2px + var(--tw-ring-offset-width))var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.inset-ring{--tw-inset-ring-shadow:inset 0 0 0 1px var(--tw-inset-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[\#38bdac\]\/20{--tw-shadow-color:#38bdac33}@supports (color:color-mix(in lab,red,red)){.shadow-\[\#38bdac\]\/20{--tw-shadow-color:color-mix(in oklab,oklab(72.378% -.11483 -.0053193/.2) var(--tw-shadow-alpha),transparent)}}.shadow-\[\#38bdac\]\/30{--tw-shadow-color:#38bdac4d}@supports (color:color-mix(in lab,red,red)){.shadow-\[\#38bdac\]\/30{--tw-shadow-color:color-mix(in oklab,oklab(72.378% -.11483 -.0053193/.3) var(--tw-shadow-alpha),transparent)}}.ring-\[\#38bdac\]{--tw-ring-color:#38bdac}.ring-\[\#38bdac\]\/40{--tw-ring-color:oklab(72.378% -.11483 -.0053193/.4)}.ring-\[\#38bdac\]\/50{--tw-ring-color:oklab(72.378% -.11483 -.0053193/.5)}.outline{outline-style:var(--tw-outline-style);outline-width:1px}.blur{--tw-blur:blur(8px);filter:var(--tw-blur,)var(--tw-brightness,)var(--tw-contrast,)var(--tw-grayscale,)var(--tw-hue-rotate,)var(--tw-invert,)var(--tw-saturate,)var(--tw-sepia,)var(--tw-drop-shadow,)}.blur-3xl{--tw-blur:blur(var(--blur-3xl));filter:var(--tw-blur,)var(--tw-brightness,)var(--tw-contrast,)var(--tw-grayscale,)var(--tw-hue-rotate,)var(--tw-invert,)var(--tw-saturate,)var(--tw-sepia,)var(--tw-drop-shadow,)}.drop-shadow{--tw-drop-shadow-size:drop-shadow(0 1px 2px var(--tw-drop-shadow-color,#0000001a))drop-shadow(0 1px 1px var(--tw-drop-shadow-color,#0000000f));--tw-drop-shadow:drop-shadow(0 1px 2px #0000001a)drop-shadow(0 1px 1px #0000000f);filter:var(--tw-blur,)var(--tw-brightness,)var(--tw-contrast,)var(--tw-grayscale,)var(--tw-hue-rotate,)var(--tw-invert,)var(--tw-saturate,)var(--tw-sepia,)var(--tw-drop-shadow,)}.filter{filter:var(--tw-blur,)var(--tw-brightness,)var(--tw-contrast,)var(--tw-grayscale,)var(--tw-hue-rotate,)var(--tw-invert,)var(--tw-saturate,)var(--tw-sepia,)var(--tw-drop-shadow,)}.filter\!{filter:var(--tw-blur,)var(--tw-brightness,)var(--tw-contrast,)var(--tw-grayscale,)var(--tw-hue-rotate,)var(--tw-invert,)var(--tw-saturate,)var(--tw-sepia,)var(--tw-drop-shadow,)!important}.backdrop-blur{--tw-backdrop-blur:blur(8px);-webkit-backdrop-filter:var(--tw-backdrop-blur,)var(--tw-backdrop-brightness,)var(--tw-backdrop-contrast,)var(--tw-backdrop-grayscale,)var(--tw-backdrop-hue-rotate,)var(--tw-backdrop-invert,)var(--tw-backdrop-opacity,)var(--tw-backdrop-saturate,)var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,)var(--tw-backdrop-brightness,)var(--tw-backdrop-contrast,)var(--tw-backdrop-grayscale,)var(--tw-backdrop-hue-rotate,)var(--tw-backdrop-invert,)var(--tw-backdrop-opacity,)var(--tw-backdrop-saturate,)var(--tw-backdrop-sepia,)}.backdrop-blur-xl{--tw-backdrop-blur:blur(var(--blur-xl));-webkit-backdrop-filter:var(--tw-backdrop-blur,)var(--tw-backdrop-brightness,)var(--tw-backdrop-contrast,)var(--tw-backdrop-grayscale,)var(--tw-backdrop-hue-rotate,)var(--tw-backdrop-invert,)var(--tw-backdrop-opacity,)var(--tw-backdrop-saturate,)var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,)var(--tw-backdrop-brightness,)var(--tw-backdrop-contrast,)var(--tw-backdrop-grayscale,)var(--tw-backdrop-hue-rotate,)var(--tw-backdrop-invert,)var(--tw-backdrop-opacity,)var(--tw-backdrop-saturate,)var(--tw-backdrop-sepia,)}.backdrop-grayscale{--tw-backdrop-grayscale:grayscale(100%);-webkit-backdrop-filter:var(--tw-backdrop-blur,)var(--tw-backdrop-brightness,)var(--tw-backdrop-contrast,)var(--tw-backdrop-grayscale,)var(--tw-backdrop-hue-rotate,)var(--tw-backdrop-invert,)var(--tw-backdrop-opacity,)var(--tw-backdrop-saturate,)var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,)var(--tw-backdrop-brightness,)var(--tw-backdrop-contrast,)var(--tw-backdrop-grayscale,)var(--tw-backdrop-hue-rotate,)var(--tw-backdrop-invert,)var(--tw-backdrop-opacity,)var(--tw-backdrop-saturate,)var(--tw-backdrop-sepia,)}.backdrop-invert{--tw-backdrop-invert:invert(100%);-webkit-backdrop-filter:var(--tw-backdrop-blur,)var(--tw-backdrop-brightness,)var(--tw-backdrop-contrast,)var(--tw-backdrop-grayscale,)var(--tw-backdrop-hue-rotate,)var(--tw-backdrop-invert,)var(--tw-backdrop-opacity,)var(--tw-backdrop-saturate,)var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,)var(--tw-backdrop-brightness,)var(--tw-backdrop-contrast,)var(--tw-backdrop-grayscale,)var(--tw-backdrop-hue-rotate,)var(--tw-backdrop-invert,)var(--tw-backdrop-opacity,)var(--tw-backdrop-saturate,)var(--tw-backdrop-sepia,)}.backdrop-sepia{--tw-backdrop-sepia:sepia(100%);-webkit-backdrop-filter:var(--tw-backdrop-blur,)var(--tw-backdrop-brightness,)var(--tw-backdrop-contrast,)var(--tw-backdrop-grayscale,)var(--tw-backdrop-hue-rotate,)var(--tw-backdrop-invert,)var(--tw-backdrop-opacity,)var(--tw-backdrop-saturate,)var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,)var(--tw-backdrop-brightness,)var(--tw-backdrop-contrast,)var(--tw-backdrop-grayscale,)var(--tw-backdrop-hue-rotate,)var(--tw-backdrop-invert,)var(--tw-backdrop-opacity,)var(--tw-backdrop-saturate,)var(--tw-backdrop-sepia,)}.backdrop-filter{-webkit-backdrop-filter:var(--tw-backdrop-blur,)var(--tw-backdrop-brightness,)var(--tw-backdrop-contrast,)var(--tw-backdrop-grayscale,)var(--tw-backdrop-hue-rotate,)var(--tw-backdrop-invert,)var(--tw-backdrop-opacity,)var(--tw-backdrop-saturate,)var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,)var(--tw-backdrop-brightness,)var(--tw-backdrop-contrast,)var(--tw-backdrop-grayscale,)var(--tw-backdrop-hue-rotate,)var(--tw-backdrop-invert,)var(--tw-backdrop-opacity,)var(--tw-backdrop-saturate,)var(--tw-backdrop-sepia,)}.transition{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to,opacity,box-shadow,transform,translate,scale,rotate,filter,-webkit-backdrop-filter,backdrop-filter,display,content-visibility,overlay,pointer-events;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition\!{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to,opacity,box-shadow,transform,translate,scale,rotate,filter,-webkit-backdrop-filter,backdrop-filter,display,content-visibility,overlay,pointer-events!important;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function))!important;transition-duration:var(--tw-duration,var(--default-transition-duration))!important}.transition-all{transition-property:all;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-colors{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-opacity{transition-property:opacity;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-transform{transition-property:transform,translate,scale,rotate;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.duration-200{--tw-duration:.2s;transition-duration:.2s}.outline-none{--tw-outline-style:none;outline-style:none}.select-none{-webkit-user-select:none;user-select:none}:where(.divide-x-reverse>:not(:last-child)){--tw-divide-x-reverse:1}.ring-inset{--tw-ring-inset:inset}@media(hover:hover){.group-hover\:text-\[\#38bdac\]:is(:where(.group):hover *){color:#38bdac}.group-hover\: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)}@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\]\/30:hover{background-color:#1628404d}.hover\:bg-\[\#162840\]\/50:hover{background-color:#16284080}.hover\:bg-amber-400\/10:hover{background-color:#fcbb001a}@supports (color:color-mix(in lab,red,red)){.hover\:bg-amber-400\/10:hover{background-color:color-mix(in oklab,var(--color-amber-400)10%,transparent)}}.hover\:bg-amber-500\/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-500\/20:hover{background-color:#6a728233}@supports (color:color-mix(in lab,red,red)){.hover\:bg-gray-500\/20:hover{background-color:color-mix(in oklab,var(--color-gray-500)20%,transparent)}}.hover\:bg-gray-700\/50:hover{background-color:#36415380}@supports (color:color-mix(in lab,red,red)){.hover\:bg-gray-700\/50:hover{background-color:color-mix(in oklab,var(--color-gray-700)50%,transparent)}}.hover\:bg-gray-800:hover{background-color:var(--color-gray-800)}.hover\:bg-green-500\/20:hover{background-color:#00c75833}@supports (color:color-mix(in lab,red,red)){.hover\:bg-green-500\/20:hover{background-color:color-mix(in oklab,var(--color-green-500)20%,transparent)}}.hover\:bg-green-700:hover{background-color:var(--color-green-700)}.hover\:bg-orange-500\/20:hover{background-color:#fe6e0033}@supports (color:color-mix(in lab,red,red)){.hover\:bg-orange-500\/20:hover{background-color:color-mix(in oklab,var(--color-orange-500)20%,transparent)}}.hover\:bg-orange-600:hover{background-color:var(--color-orange-600)}.hover\:bg-purple-500\/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-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}.active\:cursor-grabbing:active{cursor:grabbing}.disabled\:pointer-events-none:disabled{pointer-events:none}.disabled\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\:opacity-40:disabled{opacity:.4}.disabled\:opacity-50:disabled{opacity:.5}.has-\[\>svg\]\:px-2\.5:has(>svg){padding-inline:calc(var(--spacing)*2.5)}.has-\[\>svg\]\:px-3:has(>svg){padding-inline:calc(var(--spacing)*3)}.has-\[\>svg\]\:px-4:has(>svg){padding-inline:calc(var(--spacing)*4)}.data-\[disabled\]\:pointer-events-none[data-disabled]{pointer-events:none}.data-\[disabled\]\:opacity-50[data-disabled]{opacity:.5}.data-\[side\=bottom\]\:translate-y-1[data-side=bottom]{--tw-translate-y:calc(var(--spacing)*1);translate:var(--tw-translate-x)var(--tw-translate-y)}.data-\[state\=active\]\:bg-\[\#07C160\]\/20[data-state=active]{background-color:#07c16033}.data-\[state\=active\]\:bg-\[\#26A17B\]\/20[data-state=active]{background-color:#26a17b33}.data-\[state\=active\]\:bg-\[\#38bdac\]\/20[data-state=active]{background-color:#38bdac33}.data-\[state\=active\]\:bg-\[\#1677FF\]\/20[data-state=active]{background-color:#1677ff33}.data-\[state\=active\]\:bg-\[\#003087\]\/20[data-state=active]{background-color:#00308733}.data-\[state\=active\]\: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}@property --tw-duration{syntax:"*";inherits:false}@keyframes spin{to{transform:rotate(360deg)}} diff --git a/soul-admin/dist/index.html b/soul-admin/dist/index.html index 474a4839..2a388810 100644 --- a/soul-admin/dist/index.html +++ b/soul-admin/dist/index.html @@ -4,8 +4,8 @@ 管理后台 - Soul创业派对 - - + +
diff --git a/soul-admin/src/layouts/AdminLayout.tsx b/soul-admin/src/layouts/AdminLayout.tsx index 469f84d6..21a291f7 100644 --- a/soul-admin/src/layouts/AdminLayout.tsx +++ b/soul-admin/src/layouts/AdminLayout.tsx @@ -20,20 +20,20 @@ import { import { get, post } from '@/api/client' import { clearAdminToken } from '@/api/auth' -// 主菜单(折叠后可见 4-5 项) +// 主菜单(核心运营 3 项) const primaryMenuItems = [ { icon: LayoutDashboard, label: '数据概览', href: '/dashboard' }, { icon: BookOpen, label: '内容管理', href: '/content' }, { icon: Users, label: '用户管理', href: '/users' }, +] +// 折叠区「更多」(字典类 + 业务) +const moreMenuItems = [ { icon: Crown, label: 'VIP 角色', href: '/vip-roles' }, { icon: User, label: '作者详情', href: '/author-settings' }, -] -// 折叠区「更多」 -const moreMenuItems = [ { icon: ShieldCheck, label: '管理员', href: '/admin-users' }, { icon: GraduationCap, label: '导师管理', href: '/mentors' }, { icon: Calendar, label: '导师预约', href: '/mentor-consultations' }, - { icon: Wallet, label: '交易中心', href: '/distribution' }, + { icon: Wallet, label: '推广中心', href: '/distribution' }, { icon: GitMerge, label: '匹配记录', href: '/match-records' }, { icon: CreditCard, label: '推广设置', href: '/referral-settings' }, ] diff --git a/soul-admin/src/pages/content/ChapterTree.tsx b/soul-admin/src/pages/content/ChapterTree.tsx index 7dee0fe7..8f3d167f 100644 --- a/soul-admin/src/pages/content/ChapterTree.tsx +++ b/soul-admin/src/pages/content/ChapterTree.tsx @@ -2,8 +2,8 @@ * 章节树 - 仿照 catalog 设计,支持篇、章、节拖拽排序 * 整行可拖拽;节和章可跨篇 */ -import { useCallback } from 'react' -import { ChevronRight, ChevronDown, BookOpen, Eye, Edit3, Trash2 } from 'lucide-react' +import { useCallback, useState } from 'react' +import { ChevronRight, ChevronDown, BookOpen, Eye, Edit3, Trash2, GripVertical, Plus } from 'lucide-react' import { Button } from '@/components/ui/button' const PART_LABELS = ['一', '二', '三', '四', '五', '六', '七', '八', '九', '十'] @@ -51,6 +51,9 @@ interface ChapterTreeProps { onReorder: (items: { id: string; partId: string; partTitle: string; chapterId: string; chapterTitle: string }[]) => Promise onReadSection: (s: SectionItem) => void onDeleteSection: (s: SectionItem) => void + onAddSectionInPart?: (part: PartItem) => void + onEditPart?: (part: PartItem) => void + onDeletePart?: (part: PartItem) => void } export function ChapterTree({ @@ -60,7 +63,16 @@ export function ChapterTree({ onReorder, onReadSection, onDeleteSection, + onAddSectionInPart, + onEditPart, + onDeletePart, }: ChapterTreeProps) { + const [draggingItem, setDraggingItem] = useState<{ type: DragType; id: string } | null>(null) + const [dragOverTarget, setDragOverTarget] = useState<{ type: DragType; id: string } | null>(null) + + const isDragging = (type: DragType, id: string) => draggingItem?.type === type && draggingItem?.id === id + const isDragOver = (type: DragType, id: string) => dragOverTarget?.type === type && dragOverTarget?.id === id + const buildSectionsList = useCallback( (): { id: string; partId: string; partTitle: string; chapterId: string; chapterTitle: string }[] => { const list: { id: string; partId: string; partTitle: string; chapterId: string; chapterTitle: string }[] = [] @@ -223,13 +235,17 @@ export function ChapterTree({ e.preventDefault() e.stopPropagation() e.dataTransfer.dropEffect = 'move' + setDragOverTarget({ type, id }) }, onDragOver: (e: React.DragEvent) => { e.preventDefault() e.stopPropagation() e.dataTransfer.dropEffect = 'move' + setDragOverTarget({ type, id }) }, + onDragLeave: () => setDragOverTarget(null), onDrop: (e: React.DragEvent) => { + setDragOverTarget(null) const from = parseDragData(e.dataTransfer.getData('text/plain')) if (!from) return if (type === 'section' && from.type === 'section' && from.id === id) return @@ -395,10 +411,11 @@ export function ChapterTree({ } // 普通篇:卡片 + 章/节 + const partDragOver = isDragOver('part', part.id) return (
{ setDraggingItem(null); setDragOverTarget(null) }} + className={`flex items-center justify-between p-4 cursor-grab active:cursor-grabbing select-none transition-all duration-200 ${isDragging('part', part.id) ? 'opacity-60 scale-[0.98] ring-2 ring-[#38bdac] rounded-xl shadow-xl shadow-[#38bdac]/20' : 'hover:bg-[#162840]/50'}`} onClick={() => onTogglePart(part.id)} >
+
{partLabel(partIndex)}
@@ -425,7 +445,26 @@ export function ChapterTree({

共 {sectionCount} 节

-
+
e.stopPropagation()} + onClick={(e) => e.stopPropagation()} + > + {onAddSectionInPart && ( + + )} + {onEditPart && ( + + )} + {onDeletePart && ( + + )} {chapterCount}章 {isExpanded ? ( @@ -437,7 +476,9 @@ export function ChapterTree({ {isExpanded && (
- {part.chapters.map((chapter, chIndex) => ( + {part.chapters.map((chapter, chIndex) => { + const chDragOver = isDragOver('chapter', chapter.id) + return (
{ setDraggingItem(null); setDragOverTarget(null) }} onDragEnter={(e) => { e.preventDefault() e.stopPropagation() e.dataTransfer.dropEffect = 'move' + setDragOverTarget({ type: 'chapter', id: chapter.id }) }} onDragOver={(e) => { e.preventDefault() e.stopPropagation() e.dataTransfer.dropEffect = 'move' + setDragOverTarget({ type: 'chapter', id: chapter.id }) }} + onDragLeave={() => setDragOverTarget(null)} onDrop={(e) => { + setDragOverTarget(null) const from = parseDragData(e.dataTransfer.getData('text/plain')) if (!from) return const ctx = { partId: part.id, partTitle: part.title, chapterId: chapter.id, chapterTitle: chapter.title } if (from.type === 'section') handleDrop(e, 'chapter', chapter.id, ctx) else if (from.type === 'chapter') handleDrop(e, 'chapter', chapter.id, ctx) }} + className={`py-2 px-2 rounded cursor-grab active:cursor-grabbing select-none -mx-2 transition-all duration-200 flex items-center gap-2 ${chDragOver ? 'bg-[#38bdac]/15 ring-1 ring-[#38bdac]/50' : ''} ${isDragging('chapter', chapter.id) ? 'opacity-60 scale-[0.98] ring-2 ring-[#38bdac]' : 'hover:bg-[#162840]/30'}`} > +

第{chIndex + 1}章 | {chapter.title}

- {chapter.sections.map((section) => ( + {chapter.sections.map((section) => { + const secDragOver = isDragOver('section', section.id) + return (
{ setDraggingItem(null); setDragOverTarget(null) }} + className={`flex items-center justify-between py-2 px-3 rounded-lg group cursor-grab active:cursor-grabbing select-none min-h-[40px] transition-all duration-200 ${secDragOver ? 'bg-[#38bdac]/15 ring-2 ring-[#38bdac]/50' : ''} ${isDragging('section', section.id) ? 'opacity-60 scale-[0.98] ring-2 ring-[#38bdac] shadow-lg' : 'hover:bg-[#162840]/50'}`} {...droppableHandlers('section', section.id, { partId: part.id, partTitle: part.title, @@ -486,6 +538,7 @@ export function ChapterTree({ })} >
+
@@ -520,10 +573,12 @@ export function ChapterTree({
- ))} + ) + })}
- ))} + ) + })}
)}
diff --git a/soul-admin/src/pages/content/ContentPage.tsx b/soul-admin/src/pages/content/ContentPage.tsx index f121c083..62ef491d 100644 --- a/soul-admin/src/pages/content/ContentPage.tsx +++ b/soul-admin/src/pages/content/ContentPage.tsx @@ -33,7 +33,6 @@ import { X, RefreshCw, Link2, - Eye, Plus, Image as ImageIcon, Search, @@ -154,6 +153,9 @@ export function ContentPage() { content: '', }) + const [editingPart, setEditingPart] = useState<{ id: string; title: string } | null>(null) + const [isSavingPartTitle, setIsSavingPartTitle] = useState(false) + const tree = buildTree(sectionsList) const totalSections = sectionsList.length @@ -342,6 +344,63 @@ export function ContentPage() { } } + const handleAddSectionInPart = (part: Part) => { + setNewSection((prev) => ({ + ...prev, + partId: part.id, + chapterId: part.chapters[0]?.id ?? 'chapter-1', + })) + setShowNewSectionModal(true) + } + + const handleEditPartTitle = (part: Part) => { + setEditingPart({ id: part.id, title: part.title }) + } + + const handleSavePartTitle = async () => { + if (!editingPart?.title?.trim()) return + setIsSavingPartTitle(true) + try { + const items = sectionsList.map((s) => ({ + id: s.id, + partId: s.partId || 'part-1', + partTitle: s.partId === editingPart.id ? editingPart.title.trim() : (s.partTitle || ''), + chapterId: s.chapterId || 'chapter-1', + chapterTitle: s.chapterTitle || '', + })) + const res = await put<{ success?: boolean; error?: string }>('/api/db/book', { + action: 'reorder', + items, + }) + if (res && (res as { success?: boolean }).success !== false) { + setEditingPart(null) + loadList() + } else { + alert('更新篇名失败: ' + (res && typeof res === 'object' && 'error' in res ? (res as { error?: string }).error : '未知错误')) + } + } catch (e) { + console.error(e) + alert('更新篇名失败') + } finally { + setIsSavingPartTitle(false) + } + } + + const handleDeletePart = async (part: Part) => { + const sectionIds = sectionsList.filter((s) => s.partId === part.id).map((s) => s.id) + if (sectionIds.length === 0) return + if (!confirm(`确定要删除「${part.title}」整篇吗?将删除共 ${sectionIds.length} 节内容,此操作不可恢复。`)) return + try { + for (const id of sectionIds) { + await del<{ success?: boolean; error?: string }>(`/api/db/book?id=${encodeURIComponent(id)}`) + } + loadList() + } catch (e) { + console.error(e) + alert('删除失败') + } + } + const handleImageUpload = async (e: React.ChangeEvent) => { const file = e.target.files?.[0] if (!file) return @@ -542,6 +601,57 @@ export function ContentPage() { + {/* 编辑篇名弹窗 */} + !open && setEditingPart(null)}> + + + + + 编辑篇名 + + + {editingPart && ( +
+
+ + setEditingPart({ ...editingPart, title: e.target.value })} + placeholder="输入篇名" + /> +
+
+ )} + + + + +
+
+ {/* 章节编辑弹窗 */} setEditingSection(null)}> @@ -752,6 +862,9 @@ export function ContentPage() { onReorder={handleReorderTree} onReadSection={handleReadSection} onDeleteSection={handleDeleteSection} + onAddSectionInPart={handleAddSectionInPart} + onEditPart={handleEditPartTitle} + onDeletePart={handleDeletePart} /> )} diff --git a/soul-admin/src/pages/mentors/MentorsPage.tsx b/soul-admin/src/pages/mentors/MentorsPage.tsx index 2b7790d9..cd9f68fb 100644 --- a/soul-admin/src/pages/mentors/MentorsPage.tsx +++ b/soul-admin/src/pages/mentors/MentorsPage.tsx @@ -1,4 +1,4 @@ -import { useState, useEffect } from 'react' +import { useState, useEffect, useRef } from 'react' import { Card, CardContent } from '@/components/ui/card' import { Input } from '@/components/ui/input' import { Button } from '@/components/ui/button' @@ -18,8 +18,9 @@ import { DialogTitle, DialogFooter, } from '@/components/ui/dialog' -import { Users, Plus, Edit3, Trash2, X, Save } from 'lucide-react' -import { get, post, put, del } from '@/api/client' +import { Users, Plus, Edit3, Trash2, X, Save, Upload } from 'lucide-react' +import { get, post, put, del, apiUrl } from '@/api/client' +import { getAdminToken } from '@/api/auth' interface Mentor { id: number @@ -59,6 +60,40 @@ export function MentorsPage() { enabled: true, }) const [saving, setSaving] = useState(false) + const [uploadingAvatar, setUploadingAvatar] = useState(false) + const avatarInputRef = useRef(null) + + const handleAvatarUpload = async (e: React.ChangeEvent) => { + const file = e.target.files?.[0] + if (!file) return + setUploadingAvatar(true) + try { + const formData = new FormData() + formData.append('file', file) + formData.append('folder', 'mentors') + const token = getAdminToken() + const headers: HeadersInit = {} + if (token) headers['Authorization'] = `Bearer ${token}` + const res = await fetch(apiUrl('/api/upload'), { + method: 'POST', + body: formData, + credentials: 'include', + headers, + }) + const data = await res.json() + if (data?.success && data?.url) { + setForm((f) => ({ ...f, avatar: data.url })) + } else { + alert('上传失败: ' + (data?.error || '未知错误')) + } + } catch (err) { + console.error(err) + alert('上传失败') + } finally { + setUploadingAvatar(false) + if (avatarInputRef.current) avatarInputRef.current.value = '' + } + } async function load() { setLoading(true) @@ -293,13 +328,42 @@ export function MentorsPage() {
- - setForm((f) => ({ ...f, avatar: e.target.value }))} - /> + +
+ setForm((f) => ({ ...f, avatar: e.target.value }))} + placeholder="点击上传或粘贴图片地址" + /> + + +
+ {form.avatar && ( +
+ 头像预览 +
+ )}
diff --git a/soul-admin/tsconfig.tsbuildinfo b/soul-admin/tsconfig.tsbuildinfo index c6a81f75..7456e496 100644 --- a/soul-admin/tsconfig.tsbuildinfo +++ b/soul-admin/tsconfig.tsbuildinfo @@ -1 +1 @@ -{"root":["./src/app.tsx","./src/main.tsx","./src/vite-env.d.ts","./src/api/auth.ts","./src/api/client.ts","./src/components/modules/user/setvipmodal.tsx","./src/components/modules/user/userdetailmodal.tsx","./src/components/ui/pagination.tsx","./src/components/ui/badge.tsx","./src/components/ui/button.tsx","./src/components/ui/card.tsx","./src/components/ui/dialog.tsx","./src/components/ui/input.tsx","./src/components/ui/label.tsx","./src/components/ui/select.tsx","./src/components/ui/slider.tsx","./src/components/ui/switch.tsx","./src/components/ui/table.tsx","./src/components/ui/tabs.tsx","./src/components/ui/textarea.tsx","./src/hooks/usedebounce.ts","./src/layouts/adminlayout.tsx","./src/lib/utils.ts","./src/pages/admin-users/adminuserspage.tsx","./src/pages/api-doc/apidocpage.tsx","./src/pages/author-settings/authorsettingspage.tsx","./src/pages/content/chaptertree.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/mentor-consultations/mentorconsultationspage.tsx","./src/pages/mentors/mentorspage.tsx","./src/pages/not-found/notfoundpage.tsx","./src/pages/orders/orderspage.tsx","./src/pages/payment/paymentpage.tsx","./src/pages/qrcodes/qrcodespage.tsx","./src/pages/referral-settings/referralsettingspage.tsx","./src/pages/settings/settingspage.tsx","./src/pages/site/sitepage.tsx","./src/pages/users/userspage.tsx","./src/pages/vip-roles/viprolespage.tsx","./src/pages/withdrawals/withdrawalspage.tsx"],"errors":true,"version":"5.6.3"} \ No newline at end of file +{"root":["./src/app.tsx","./src/main.tsx","./src/vite-env.d.ts","./src/api/auth.ts","./src/api/client.ts","./src/components/modules/user/setvipmodal.tsx","./src/components/modules/user/userdetailmodal.tsx","./src/components/ui/pagination.tsx","./src/components/ui/badge.tsx","./src/components/ui/button.tsx","./src/components/ui/card.tsx","./src/components/ui/dialog.tsx","./src/components/ui/input.tsx","./src/components/ui/label.tsx","./src/components/ui/select.tsx","./src/components/ui/slider.tsx","./src/components/ui/switch.tsx","./src/components/ui/table.tsx","./src/components/ui/tabs.tsx","./src/components/ui/textarea.tsx","./src/hooks/usedebounce.ts","./src/layouts/adminlayout.tsx","./src/lib/utils.ts","./src/pages/admin-users/adminuserspage.tsx","./src/pages/api-doc/apidocpage.tsx","./src/pages/author-settings/authorsettingspage.tsx","./src/pages/content/chaptertree.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/mentor-consultations/mentorconsultationspage.tsx","./src/pages/mentors/mentorspage.tsx","./src/pages/not-found/notfoundpage.tsx","./src/pages/orders/orderspage.tsx","./src/pages/payment/paymentpage.tsx","./src/pages/qrcodes/qrcodespage.tsx","./src/pages/referral-settings/referralsettingspage.tsx","./src/pages/settings/settingspage.tsx","./src/pages/site/sitepage.tsx","./src/pages/users/userspage.tsx","./src/pages/vip-roles/viprolespage.tsx","./src/pages/withdrawals/withdrawalspage.tsx"],"version":"5.6.3"} \ No newline at end of file diff --git a/临时需求池/soul20260228/stitch_soul/catalog_with_new_additions_v1/code.html b/临时需求池/soul20260228/stitch_soul/catalog_with_new_additions_v1/code.html deleted file mode 100644 index 12d2fc51..00000000 --- a/临时需求池/soul20260228/stitch_soul/catalog_with_new_additions_v1/code.html +++ /dev/null @@ -1,291 +0,0 @@ - - - - -Clean Dark Mode Catalog with NEW Tags - - - - - - - - - -
- -

目录

-
- - -
-
-
-
-
-
-menu_book -
-
-

一场SOUL的创业实验场

-

来自Soul派对房的真实商业故事

-
-
-
-73 -章节 -
-
-
-
-
-import_contacts -
-

序言 | 为什么我每天早上6点在...

-
-
-免费 -arrow_forward -
-
-
-
-
-
- 一 -
-
-

真实的人

-

人与人之间的底层逻辑

-
-
-
-2章 -arrow_downward -
-
-
-

第1章 | 人与人之间的底层逻辑

-
-
-
-1.1 荷包:电动车出租的被动收入模式 -
-
-免费 -chevron_right -
-
-
-
-
-1.2 老墨:资源整合高手的社交方法 -
-
-¥1 -chevron_right -
-
-
-
-
-1.3 笑声背后的MBTI:为什么ENTJ适合做... -
-
-¥1 -chevron_right -
-
-
-
-
-1.4 人性的三角结构:利益、情感、价值观 -
-
-¥1 -chevron_right -
-
-
-
-
-1.5 沟通差的问题:为什么你说的别人听... -
-
-¥1 -chevron_right -
-
-

第2章 | 人性困境案例

-
-
-
-2.1 相亲故事:你以为找的是人,实际是在找... -
-
-NEW -¥1 -chevron_right -
-
-
-
-
-2.2 找工作迷茫者:为什么简历解决不了人生 -
-
-¥1 -chevron_right -
-
-
-
-
-2.3 撸运费险:小钱困住大脑的真实心理 -
-
-NEW -¥1 -chevron_right -
-
-
-
-
-
-
- 二 -
-
-

真实的行业

-

电商、内容、传统行业解析

-
-
-
-3章 -arrow_forward -
-
-
-
-
- 三 -
-
-

真实的错误

-

我和别人犯过的错

-
-
-
-2章 -arrow_forward -
-
-
-
-
- 四 -
-
-

真实的赚钱

-

底层结构与真实案例

-
-
-
-2章 -arrow_forward -
-
-
-

附录

-
-
-附录1 | Soul派对房精选对话 -arrow_forward -
-
-
-附录2 | 创业者自检清单 -arrow_forward -
-
-
-附录3 | 本书提到的工具和资源 -arrow_forward -
-
-
-
- -
- - \ No newline at end of file diff --git a/临时需求池/soul20260228/stitch_soul/catalog_with_new_additions_v1/screen.png b/临时需求池/soul20260228/stitch_soul/catalog_with_new_additions_v1/screen.png deleted file mode 100644 index a271c1cb..00000000 Binary files a/临时需求池/soul20260228/stitch_soul/catalog_with_new_additions_v1/screen.png and /dev/null differ diff --git a/临时需求池/soul20260228/stitch_soul/comprehensive_profile_editor_v1_1/code.html b/临时需求池/soul20260228/stitch_soul/comprehensive_profile_editor_v1_1/code.html deleted file mode 100644 index 16813784..00000000 --- a/临时需求池/soul20260228/stitch_soul/comprehensive_profile_editor_v1_1/code.html +++ /dev/null @@ -1,215 +0,0 @@ - - - - -Comprehensive Profile Editor V1 - - - - - - - -
-
-chevron_left -

编辑资料

-
-
-
-more_horiz -
-
-
-
-
-
-
-info -

- 温馨提示:需完善手机号和微信号才能使用提现和找伙伴功能 -

-
-
-
-
-User Avatar -
-
-photo_camera -
-
- -
-
-
-
- -
-
- - -
-
- - - -
-
-
-

-contact_phone - 核心联系方式 -

-
- - -
-
-
-

-emoji_objects - 个人故事 -

- - - -
-
-

-handshake - 互助需求 -

- - -
-
-

-rocket_launch - 项目介绍 -

- -
-
- -
-
-
- - - \ No newline at end of file diff --git a/临时需求池/soul20260228/stitch_soul/comprehensive_profile_editor_v1_1/screen.png b/临时需求池/soul20260228/stitch_soul/comprehensive_profile_editor_v1_1/screen.png deleted file mode 100644 index 47bec69f..00000000 Binary files a/临时需求池/soul20260228/stitch_soul/comprehensive_profile_editor_v1_1/screen.png and /dev/null differ diff --git a/临时需求池/soul20260228/stitch_soul/comprehensive_profile_editor_v1_2/code.html b/临时需求池/soul20260228/stitch_soul/comprehensive_profile_editor_v1_2/code.html deleted file mode 100644 index 613f82bc..00000000 --- a/临时需求池/soul20260228/stitch_soul/comprehensive_profile_editor_v1_2/code.html +++ /dev/null @@ -1,158 +0,0 @@ - - - -Simplified Info Completion Popup - - - - - - - -
-
-chevron_left -

编辑资料

-
-
-
-more_horiz -
-
-
-
-
-
-
-info -

- 温馨提示:需完善手机号和微信号才能使用提现和找伙伴功能 -

-
-
-
-
-User Avatar -
-
-
-
-
- -
- - -
-
-
-
- - - - \ No newline at end of file diff --git a/临时需求池/soul20260228/stitch_soul/comprehensive_profile_editor_v1_2/screen.png b/临时需求池/soul20260228/stitch_soul/comprehensive_profile_editor_v1_2/screen.png deleted file mode 100644 index 811abf35..00000000 Binary files a/临时需求池/soul20260228/stitch_soul/comprehensive_profile_editor_v1_2/screen.png and /dev/null differ diff --git a/临时需求池/soul20260228/stitch_soul/enhanced_professional_profile/code.html b/临时需求池/soul20260228/stitch_soul/enhanced_professional_profile/code.html deleted file mode 100644 index 3a50800b..00000000 --- a/临时需求池/soul20260228/stitch_soul/enhanced_professional_profile/code.html +++ /dev/null @@ -1,206 +0,0 @@ - - - - -Profile with Hidden Info Icons - - - - - - - - - -
- -

个人资料

-
- - -
-
-
-
-
-
-
-Profile Picture -
-

乘风

-
-INFP - -push_pin 杭州 - -
-
-
-
-
-person -

基本信息

-
-
-
-

行业

-

新媒体 / 电商

-
-
-

职位

-

创始人

-
-
-

业务体量

-

年GMV 5000万+

-
-
-
-

我擅长

-

- 短视频制作、IP打造、私域运营 -

-
-
-

联系方式

-
-139****02 -visibility_off -
-
-
-

微信号

-
-wxid_****abc -visibility_off -
-
-
-
-
-
-lightbulb -

个人故事

-
-
-
-
-🏆 -

最赚钱的一个月做的是什么

-
-

- 旅游账号30天涨粉10万,带货佣金收入12万 -

-
-
-
-
-⭐️ -

最有成就感的一件事

-
-

- 帮助3个素人打造个人IP,每个月稳定变现5万+ -

-
-
-
-
-restart_alt -

人生的转折点

-
-

- 辞去互联网大厂工作开始做自媒体,第三个月就超过原薪资 -

-
-
-
-
-
-🤝 -

互助需求

-
-
-
- - 我能帮你 - -

- 短视频脚本、账号冷启动、私域转化设计 -

-
-
- - 我需要帮助 - -

- 寻找供应链资源和线下活动合作 -

-
-
-
-
-
-rocket_launch -

项目介绍

-
-

- 旅游+生活方式自媒体矩阵,全网粉丝50万+ -

-
-
-
-
- -
-
- - \ No newline at end of file diff --git a/临时需求池/soul20260228/stitch_soul/enhanced_professional_profile/screen.png b/临时需求池/soul20260228/stitch_soul/enhanced_professional_profile/screen.png deleted file mode 100644 index bda173c5..00000000 Binary files a/临时需求池/soul20260228/stitch_soul/enhanced_professional_profile/screen.png and /dev/null differ diff --git a/临时需求池/soul20260228/stitch_soul/mentor_detail_profile_1/code.html b/临时需求池/soul20260228/stitch_soul/mentor_detail_profile_1/code.html deleted file mode 100644 index b33be6ea..00000000 --- a/临时需求池/soul20260228/stitch_soul/mentor_detail_profile_1/code.html +++ /dev/null @@ -1,227 +0,0 @@ - - - -Mentor Detail Profile - - - - - - - - - -
- -

导师详情

- -
-
-
-
-
-Mentor Avatar -
-
-

卡若

-

结构判断型咨询 · Decision > Execution

-
-

- 大多数人失败,不是因为不努力,而是把精力投进了一个一开始就不该参与的结构里。 -

-
-
-
-
-01 -

为什么找卡若?

-
-
-
-

做事的人

-

方向始终不对

-
-
-

犹豫的人

-

始终不敢决定

-
-
-

已投入的人

-

越投越不确定

-
-
-

共同问题不是能力,而是缺乏一次高质量的判断

-
-
-
-02 -

提供什么?

-
-

不做激励,不做陪伴 · 专注「决策前的结构判断」

-
-
-
-
1
-

项目结构判断

-
-
-是否真实存在赚钱结构 -回报是否可持续 -普通人成功概率 -
-
-
-
-
2
-

人 × 项目匹配

-
-
-性格资源阶段是否匹配 -最大优势与致命短板 -最可能失败节点 -
-
-
-
-
3
-

风险止损判断

-
-
-哪一步是不可逆风险 -什么时候必须停 -避免沉没成本陷阱 -
-
-
-
-
-
-03 -

收费标准

-
-
-
-
咨询项目
-
时长
-
价格
-
-
-
单次咨询
-
1小时
-
¥980
-
-
-
半年咨询
-
-
-
-
98000
-
¥19,800
-
-
-
-
年度咨询
-
-
-
-
196000
-
¥29,800
-
-
-
-
-项目/副业决策 -转型选择 -投资判断 -关键节点 -
-
-
-
-04 -

判断风格

-
-
-
- 冷静 -
-
- 克制 -
-
- 偏风险视角 -
-
- 偏长期主义 -
-
-
-


-
-
-
- -
-
-
- - - \ No newline at end of file diff --git a/临时需求池/soul20260228/stitch_soul/mentor_detail_profile_1/screen.png b/临时需求池/soul20260228/stitch_soul/mentor_detail_profile_1/screen.png deleted file mode 100644 index 67db2f64..00000000 Binary files a/临时需求池/soul20260228/stitch_soul/mentor_detail_profile_1/screen.png and /dev/null differ diff --git a/临时需求池/soul20260228/stitch_soul/mentor_detail_profile_2/code.html b/临时需求池/soul20260228/stitch_soul/mentor_detail_profile_2/code.html deleted file mode 100644 index 9facdde1..00000000 --- a/临时需求池/soul20260228/stitch_soul/mentor_detail_profile_2/code.html +++ /dev/null @@ -1,312 +0,0 @@ - - - - -Mentor Detail Profile - - - - - - - - - - -
- -

导师详情

- -
-
-
-
-
-Mentor Avatar -
-
-

卡若

-

结构判断型咨询 · Decision > Execution

-
-

- 大多数人失败,不是因为不努力,而是把精力投进了一个一开始就不该参与的结构里。 -

-
-
-
-
-01 -

为什么找卡若?

-
-
-
-

做事的人

-

方向始终不对

-
-
-

犹豫的人

-

始终不敢决定

-
-
-

已投入的人

-

越投越不确定

-
-
-

共同问题不是能力,而是缺乏一次高质量的判断

-
-
-
-02 -

提供什么?

-
-

不做激励,不做陪伴 · 专注「决策前的结构判断」

-
-
-
-
1
-

项目结构判断

-
-
-是否真实存在赚钱结构 -回报是否可持续 -普通人成功概率 -
-
-
-
-
2
-

人 × 项目匹配

-
-
-性格资源阶段是否匹配 -最大优势与致命短板 -最可能失败节点 -
-
-
-
-
3
-

风险止损判断

-
-
-哪一步是不可逆风险 -什么时候必须停 -避免沉没成本陷阱 -
-
-
-
-
-
-03 -

收费标准

-
-
-
-
咨询项目
-
时长
-
价格
-
-
-
单次咨询
-
1小时
-
¥980
-
-
-
半年咨询
-
-
-
-
98000
-
¥19,800
-
-
-
-
年度咨询
-
-
-
-
196000
-
¥29,800
-
-
-
-
-项目/副业决策 -转型选择 -投资判断 -关键节点 -
-
-
-
-04 -

判断风格

-
-
-
- 冷静 -
-
- 克制 -
-
- 偏风险视角 -
-
- 偏长期主义 -
-
-
-
-

扫码预约咨询

-
-qr_code_2 -
-

卡若 | 结构判断咨询

-
-

- 判断的价值,往往体现在你"没做"的那一步 -

-
-
-
- - -
-
-
-
-
-
-

选择咨询项目

- -
-
- - - -
-
- -

点击确认即代表同意 服务协议

-
-
-
- - - \ No newline at end of file diff --git a/临时需求池/soul20260228/stitch_soul/mentor_detail_profile_2/screen.png b/临时需求池/soul20260228/stitch_soul/mentor_detail_profile_2/screen.png deleted file mode 100644 index 7464d8c1..00000000 Binary files a/临时需求池/soul20260228/stitch_soul/mentor_detail_profile_2/screen.png and /dev/null differ diff --git a/临时需求池/soul20260228/stitch_soul/mentor_listing_screen/code.html b/临时需求池/soul20260228/stitch_soul/mentor_listing_screen/code.html deleted file mode 100644 index 8cf7250d..00000000 --- a/临时需求池/soul20260228/stitch_soul/mentor_listing_screen/code.html +++ /dev/null @@ -1,200 +0,0 @@ - - - - -导师列表页 - - - - - - - - -
-
- -

选择导师

- -
-
-
-search -
- -
-
- - - - -
-
-
-
-

推荐导师

-查看全部 chevron_right -
-
-
-
-Mentor Profile -
-
-
-
-

卡若

-

结构判断型咨询 · Decision > Execution

-
-
-
-项目结构判断 -风险止损 -人×项目匹配 -
-
-
-¥980 -起 / 单次咨询 -
- -
-
-
-
-
-
-
-Mentor Profile -
-
-
-
-

林晓雯

-

资深产品经理 · 10年互联网经验

-
-
-
-产品架构 -MVP落地 -
-
-
-¥1,200 -起 / 单次咨询 -
- -
-
-
-
-
-
-
-Mentor Profile -
-
-
-
-

张伟

-

连续创业者 · 融资顾问

-
-
-
-BP梳理 -股权设计 -路演辅导 -
-
-
-¥2,500 -起 / 单次咨询 -
- -
-
-
-
-
-
-
-Mentor Profile -
-
-
-
-

Sarah Chen

-

跨国企业HRD · 职业规划

-
-
-
-职业转型 -面试辅导 -
-
-
-¥600 -起 / 单次咨询 -
- -
-
-
-
-
- - - \ No newline at end of file diff --git a/临时需求池/soul20260228/stitch_soul/mentor_listing_screen/screen.png b/临时需求池/soul20260228/stitch_soul/mentor_listing_screen/screen.png deleted file mode 100644 index 93ba59e2..00000000 Binary files a/临时需求池/soul20260228/stitch_soul/mentor_listing_screen/screen.png and /dev/null differ diff --git a/临时需求池/soul20260228/stitch_soul/optimized_home_content_feed_v1/code.html b/临时需求池/soul20260228/stitch_soul/optimized_home_content_feed_v1/code.html deleted file mode 100644 index b2122111..00000000 --- a/临时需求池/soul20260228/stitch_soul/optimized_home_content_feed_v1/code.html +++ /dev/null @@ -1,269 +0,0 @@ - - - -Clean Home with Contact Author Link - - - - - - - - - -
-
-
-
- S -
-
-
-

Soul创业派对

-
-Author - -
-
-

来自派对房的真实故事

-
-
-
- 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/临时需求池/soul20260228/stitch_soul/optimized_home_content_feed_v1/screen.png b/临时需求池/soul20260228/stitch_soul/optimized_home_content_feed_v1/screen.png deleted file mode 100644 index d3725318..00000000 Binary files a/临时需求池/soul20260228/stitch_soul/optimized_home_content_feed_v1/screen.png and /dev/null differ diff --git a/临时需求池/soul20260228/stitch_soul/premium_membership_landing_v1/code.html b/临时需求池/soul20260228/stitch_soul/premium_membership_landing_v1/code.html deleted file mode 100644 index 0eb4e9d0..00000000 --- a/临时需求池/soul20260228/stitch_soul/premium_membership_landing_v1/code.html +++ /dev/null @@ -1,183 +0,0 @@ - - - -Premium Membership Landing - - - - - - - - - -
-
-
-卡若创业派对 -
-
-

加入卡若的

-

创业派对 会员

-
-

一次加入 尊享终身陪伴与成长

-
-
-
-
- -

内容权益

-
-
-
-auto_stories -
-

解锁全部章节

-

365天全案精读

-
-
-
-database -
-

案例库

-

100+创业实战案例

-
-
-
-psychology -
-

智能纪要

-

AI每日精华推送

-
-
-
-folder_open -
-

会议纪要库

-

往期完整沉淀

-
-
-
-
-
-
- -

社交权益

-
-
-
-group_add -
-

匹配创业伙伴

-

精准人脉匹配

-
-
-
-leaderboard -
-

创业老板排行

-

项目曝光展示

-
-
-
-hub -
-

链接资源

-

深度私域资源池

-
-
-
-verified -
-

专属VIP标识

-

金色尊享光圈

-
-
-
-
-
-
-
-
- -
-
- - \ No newline at end of file diff --git a/临时需求池/soul20260228/stitch_soul/premium_membership_landing_v1/screen.png b/临时需求池/soul20260228/stitch_soul/premium_membership_landing_v1/screen.png deleted file mode 100644 index eeced562..00000000 Binary files a/临时需求池/soul20260228/stitch_soul/premium_membership_landing_v1/screen.png and /dev/null differ diff --git a/临时需求池/soul20260228/stitch_soul/professional_profile_with_earnings_vip/code.html b/临时需求池/soul20260228/stitch_soul/professional_profile_with_earnings_vip/code.html deleted file mode 100644 index 191e7d73..00000000 --- a/临时需求池/soul20260228/stitch_soul/professional_profile_with_earnings_vip/code.html +++ /dev/null @@ -1,221 +0,0 @@ - - - -Updated Community Profile Screen - - - - - - - - -
-9:41 -
-signal_cellular_alt -wifi -battery_full -
-
-
-
-

我的

-
- -
-
-
-
-
-User Avatar -
-
-VIP -
-
-
-
-

卡若

-
-会员 -匹配 -排行 -
-
-
- ID: ogpTW5Wbbo...6EGc-g -
-
- 会员到期时间:2025-12-31 -
-
-
-
-
-
-
-account_balance_wallet -

分享收益

-
-
-
-0 -推荐好友 -
-
-0.00 -我的收益 -
-
--- -可提现金额 -
-
-
-
-
-visibility -

阅读统计

-
-
-
-menu_book -2 -已读章节 -
-
-timer -97 -阅读分钟 -
-
-group -0 -匹配伙伴 -
-
-
-
-
-history_edu -

最近阅读

-
-
-
-
-1 -章节 preface -
-继续阅读 -
-
-
-2 -章节 1.1 -
-继续阅读 -
-
-
- -
- -
- - - \ No newline at end of file diff --git a/临时需求池/soul20260228/stitch_soul/professional_profile_with_earnings_vip/screen.png b/临时需求池/soul20260228/stitch_soul/professional_profile_with_earnings_vip/screen.png deleted file mode 100644 index e6c35462..00000000 Binary files a/临时需求池/soul20260228/stitch_soul/professional_profile_with_earnings_vip/screen.png and /dev/null differ diff --git a/开发文档/api_v1.md b/开发文档/api_v1.md new file mode 100644 index 00000000..7a1c2636 --- /dev/null +++ b/开发文档/api_v1.md @@ -0,0 +1,413 @@ +# 对外获客线索上报接口文档(V1) + +## 一、接口概述 + +- **接口名称**:对外获客线索上报接口 +- **接口用途**:供第三方系统向【存客宝】上报客户线索(手机号 / 微信号等),用于后续的跟进、标签管理和画像分析。 +- **接口协议**:HTTP +- **请求方式**:`POST` +- **请求地址**: `https://ckbapi.quwanzhi.com/v1/api/scenarios` + +> 具体 URL 以实际环境配置为准。 + +- **数据格式**: + - 推荐:`application/json` + - 兼容:`application/x-www-form-urlencoded` +- **字符编码**:`UTF-8` + +--- + +## 二、鉴权与签名 + +### 2.1 必填鉴权字段 + +| 字段名 | 类型 | 必填 | 说明 | +|-------------|--------|------|---------------------------------------| +| `apiKey` | string | 是 | 分配给第三方的接口密钥(每个任务唯一)| +| `sign` | string | 是 | 签名值 | +| `timestamp` | int | 是 | 秒级时间戳(与服务器时间差不超过 5 分钟) | + +### 2.2 时间戳校验 + +服务器会校验 `timestamp` 是否在当前时间前后 **5 分钟** 内: + +- 通过条件:`|server_time - timestamp| <= 300` +- 超出范围则返回:`请求已过期` + +### 2.3 签名生成规则 + +接口采用自定义签名机制。**签名字段为 `sign`,生成步骤如下:** + +假设本次请求的所有参数为 `params`,其中包括业务参数 + `apiKey` + `timestamp` + `sign` + 可能存在的 `portrait` 对象。 + +#### 第一步:移除特定字段 + +从 `params` 中移除以下字段: + +- `sign` —— 自身不参与签名 +- `apiKey` —— 不参与参数拼接,仅在最后一步参与二次 MD5 +- `portrait` —— 整个画像对象不参与签名(即使内部还有子字段) + +> 说明:`portrait` 通常是一个 JSON 对象,字段较多,为避免签名实现复杂且双方难以对齐,统一不参与签名。 + +#### 第二步:移除空值字段 + +从剩余参数中,移除值为: + +- `null` +- 空字符串 `''` + +的字段,这些字段不参与签名。 + +#### 第三步:按参数名升序排序 + +对剩余参数按**参数名(键名)升序排序**,排序规则为标准的 ASCII 升序: + +```text +例如: name, phone, source, timestamp +``` + +#### 第四步:拼接参数值 + +将排序后的参数 **只取“值”**,按顺序直接拼接为一个字符串,中间不加任何分隔符: + +- 示例: + 排序后参数为: + + ```text + name = 张三 + phone = 13800000000 + source = 微信广告 + timestamp = 1710000000 + ``` + + 则拼接: + + ```text + stringToSign = "张三13800000000微信广告1710000000" + ``` + +#### 第五步:第一次 MD5 + +对上一步拼接得到的字符串做一次 MD5: + +\[ +\text{firstMd5} = \text{MD5}(\text{stringToSign}) +\] + +#### 第六步:拼接 apiKey 再次 MD5 + +将第一步的结果与 `apiKey` 直接拼接,再做一次 MD5,得到最终签名值: + +\[ +\text{sign} = \text{MD5}(\text{firstMd5} + \text{apiKey}) +\] + +#### 第七步:放入请求 + +将第六步得到的 `sign` 填入请求参数中的 `sign` 字段即可。 + +> 建议: +> - 使用小写 MD5 字符串(双方约定统一即可)。 +> - 请确保参与签名的参数与最终请求发送的参数一致(包括是否传空值)。 + +### 2.4 签名示例(PHP 伪代码) + +```php +$params = [ + 'apiKey' => 'YOUR_API_KEY', + 'timestamp' => '1710000000', + 'phone' => '13800000000', + 'name' => '张三', + 'source' => '微信广告', + 'remark' => '通过H5落地页留资', + // 'portrait' => [...], // 如有画像,这里会存在,但不参与签名 + // 'sign' => '待生成', +]; + +// 1. 去掉 sign、apiKey、portrait +unset($params['sign'], $params['apiKey'], $params['portrait']); + +// 2. 去掉空值 +$params = array_filter($params, function($value) { + return !is_null($value) && $value !== ''; +}); + +// 3. 按键名升序排序 +ksort($params); + +// 4. 拼接参数值 +$stringToSign = implode('', array_values($params)); + +// 5. 第一次 MD5 +$firstMd5 = md5($stringToSign); + +// 6. 第二次 MD5(拼接 apiKey) +$apiKey = 'YOUR_API_KEY'; +$sign = md5($firstMd5 . $apiKey); + +// 将 $sign 作为字段发送 +$params['sign'] = $sign; +``` + +--- + +## 三、请求参数说明 + +### 3.1 主标识字段(至少传一个) + +| 字段名 | 类型 | 必填 | 说明 | +|-----------|--------|------|-------------------------------------------| +| `wechatId`| string | 否 | 微信号,存在时优先作为主标识 | +| `phone` | string | 否 | 手机号,当 `wechatId` 为空时用作主标识 | + +### 3.2 基础信息字段 + +| 字段名 | 类型 | 必填 | 说明 | +|------------|--------|------|-------------------------| +| `name` | string | 否 | 客户姓名 | +| `source` | string | 否 | 线索来源描述,如“百度推广”、“抖音直播间” | +| `remark` | string | 否 | 备注信息 | +| `tags` | string | 否 | 逗号分隔的“微信标签”,如:`"高意向,电商,女装"` | +| `siteTags` | string | 否 | 逗号分隔的“站内标签”,用于站内进一步细分 | + + +### 3.3 用户画像字段 `portrait`(可选) + +`portrait` 为一个对象(JSON),用于记录用户的行为画像数据。 + +#### 3.3.1 基本示例 + +```json +"portrait": { + "type": 1, + "source": 1, + "sourceData": { + "age": 28, + "gender": "female", + "city": "上海", + "productId": "P12345", + "pageUrl": "https://example.com/product/123" + }, + "remark": "画像-基础属性", + "uniqueId": "user_13800000000_20250301_001" +} +``` + +#### 3.3.2 字段详细说明 + +| 字段名 | 类型 | 必填 | 说明 | +|-----------------------|--------|------|----------------------------------------| +| `portrait.type` | int | 否 | 画像类型,枚举值:
0-浏览
1-点击
2-下单/购买
3-注册
4-互动
默认值:0 | +| `portrait.source` | int | 否 | 画像来源,枚举值:
0-本站
1-老油条
2-老坑爹
默认值:0 | +| `portrait.sourceData` | object | 否 | 画像明细数据(键值对,会存储为 JSON 格式)
可包含任意业务相关的键值对,如:年龄、性别、城市、商品ID、页面URL等 | +| `portrait.remark` | string | 否 | 画像备注信息,最大长度100字符 | +| `portrait.uniqueId` | string | 否 | 画像去重用唯一 ID
用于防止重复记录,相同 `uniqueId` 的画像数据在半小时内会被合并统计(count字段累加)
建议格式:`{来源标识}_{用户标识}_{时间戳}_{序号}` | + +#### 3.3.3 画像类型(type)说明 + +| 值 | 类型 | 说明 | 适用场景 | +|---|------|------|---------| +| 0 | 浏览 | 用户浏览了页面或内容 | 页面访问、商品浏览、文章阅读等 | +| 1 | 点击 | 用户点击了某个元素 | 按钮点击、链接点击、广告点击等 | +| 2 | 下单/购买 | 用户完成了购买行为 | 订单提交、支付完成等 | +| 3 | 注册 | 用户完成了注册 | 账号注册、会员注册等 | +| 4 | 互动 | 用户进行了互动行为 | 点赞、评论、分享、咨询等 | + +#### 3.3.4 画像来源(source)说明 + +| 值 | 来源 | 说明 | +|---|------|------| +| 0 | 本站 | 来自本站的数据 | +| 1 | 老油条 | 来自"老油条"系统的数据 | +| 2 | 老坑爹 | 来自"老坑爹"系统的数据 | + +#### 3.3.5 sourceData 数据格式说明 + +`sourceData` 是一个 JSON 对象,可以包含任意业务相关的键值对。常见字段示例: + +```json +{ + "age": 28, + "gender": "female", + "city": "上海", + "province": "上海市", + "productId": "P12345", + "productName": "商品名称", + "category": "女装", + "price": 299.00, + "pageUrl": "https://example.com/product/123", + "referrer": "https://www.baidu.com", + "device": "mobile", + "browser": "WeChat" +} +``` + +> **注意**: +> - `sourceData` 中的数据类型可以是字符串、数字、布尔值等 +> - 嵌套对象会被序列化为 JSON 字符串存储 +> - 建议根据实际业务需求定义字段结构 + +#### 3.3.6 uniqueId 去重机制说明 + +- **作用**:防止重复记录相同的画像数据 +- **规则**:相同 `uniqueId` 的画像数据在 **半小时内** 会被合并统计,`count` 字段会自动累加 +- **建议格式**:`{来源标识}_{用户标识}_{时间戳}_{序号}` + - 示例:`site_13800000000_1710000000_001` + - 示例:`wechat_wxid_abc123_1710000000_001` +- **注意事项**: + - 如果不传 `uniqueId`,系统会为每条画像数据创建新记录 + - 如果需要在半小时内多次统计同一行为,应使用相同的 `uniqueId` + - 如果需要在半小时后重新统计,应使用不同的 `uniqueId`(建议修改时间戳部分) + +> **重要提示**:`portrait` **整体不参与签名计算**,但会参与业务处理。系统会根据 `uniqueId` 自动处理去重和统计。 + +--- + +## 四、请求示例 + +### 4.1 JSON 请求示例(无画像) + +```json +{ + "apiKey": "YOUR_API_KEY", + "timestamp": 1710000000, + "phone": "13800000000", + "name": "张三", + "source": "微信广告", + "remark": "通过H5落地页留资", + "tags": "高意向,电商", + "siteTags": "新客,女装", + "sign": "根据签名规则生成的MD5字符串" +} +``` + +### 4.2 JSON 请求示例(带微信号与画像) + +```json +{ + "apiKey": "YOUR_API_KEY", + "timestamp": 1710000000, + "wechatId": "wxid_abcdefg123", + "phone": "13800000001", + "name": "李四", + "source": "小程序落地页", + "remark": "点击【立即咨询】按钮", + "tags": "中意向,直播", + "siteTags": "复购,高客单", + "portrait": { + "type": 1, + "source": 0, + "sourceData": { + "age": 28, + "gender": "female", + "city": "上海", + "pageUrl": "https://example.com/product/123", + "productId": "P12345" + }, + "remark": "画像-点击行为", + "uniqueId": "site_13800000001_1710000000_001" + }, + "sign": "根据签名规则生成的MD5字符串" +} +``` + +### 4.3 JSON 请求示例(多种画像类型) + +#### 4.3.1 浏览行为画像 + +```json +{ + "apiKey": "YOUR_API_KEY", + "timestamp": 1710000000, + "phone": "13800000002", + "name": "王五", + "source": "百度推广", + "portrait": { + "type": 0, + "source": 0, + "sourceData": { + "pageUrl": "https://example.com/product/456", + "productName": "商品名称", + "category": "女装", + "stayTime": 120, + "device": "mobile" + }, + "remark": "商品浏览", + "uniqueId": "site_13800000002_1710000000_001" + }, + "sign": "根据签名规则生成的MD5字符串" +} +``` + + +``` + +--- + +## 五、响应说明 + +### 5.1 成功响应 + +**1)新增线索成功** + +```json +{ + "code": 200, + "message": "新增成功", + "data": "13800000000" +} +``` + +**2)线索已存在** + +```json +{ + "code": 200, + "message": "已存在", + "data": "13800000000" +} +``` + +> `data` 字段返回本次线索的主标识 `wechatId` 或 `phone`。 + +### 5.2 常见错误响应 + +```json +{ "code": 400, "message": "apiKey不能为空", "data": null } +{ "code": 400, "message": "sign不能为空", "data": null } +{ "code": 400, "message": "timestamp不能为空", "data": null } +{ "code": 400, "message": "请求已过期", "data": null } + +{ "code": 401, "message": "无效的apiKey", "data": null } +{ "code": 401, "message": "签名验证失败", "data": null } + +{ "code": 500, "message": "系统错误: 具体错误信息", "data": null } +``` + +--- + + +## 六、常见问题(FAQ) + +### Q1: 如果同一个用户多次上报相同的行为,会如何处理? + +**A**: 如果使用相同的 `uniqueId`,系统会在半小时内合并统计,`count` 字段会累加。如果使用不同的 `uniqueId`,会创建多条记录。 + +### Q2: portrait 字段是否必须传递? + +**A**: 不是必须的。`portrait` 字段是可选的,只有在需要记录用户画像数据时才传递。 + +### Q3: sourceData 中可以存储哪些类型的数据? + +**A**: `sourceData` 是一个 JSON 对象,可以存储任意键值对。支持字符串、数字、布尔值等基本类型,嵌套对象会被序列化为 JSON 字符串。 + +### Q4: uniqueId 的作用是什么? + +**A**: `uniqueId` 用于防止重复记录。相同 `uniqueId` 的画像数据在半小时内会被合并统计,避免重复数据。 + +### Q5: 画像数据如何与用户关联? + +**A**: 系统会根据请求中的 `wechatId` 或 `phone` 自动匹配 `traffic_pool` 表中的用户,并将画像数据关联到对应的 `trafficPoolId`。 + +---