diff --git a/Gitea同步说明.md b/Gitea同步说明.md new file mode 100644 index 00000000..f5db4ca4 --- /dev/null +++ b/Gitea同步说明.md @@ -0,0 +1,54 @@ +# 一场soul的创业实验-永平 → Gitea 同步说明 + +**Gitea 仓库**:`fnvtk/soul-yongping` +**地址**: + +本仓库已配置:**每次 `git commit` 后自动推送到 Gitea**(见 `.git/hooks/post-commit`),有更新即同步。 + +--- + +## 一、首次使用(完成一次推送后,之后都会自动同步) + +本仓库的 **gitea 远程已使用与卡若AI 相同的 Gitea Token**,只需在 Gitea 上建仓后推送即可。 + +### 1. 在 Gitea 上创建仓库(若还没有) + +1. 打开 ,登录 **fnvtk**。 +2. 点击「新建仓库」。 +3. **仓库名称**填:`soul-yongping`。 +4. 描述可填:`一场soul的创业实验-永平 网站与小程序`。 +5. 不要勾选「使用自述文件初始化」,创建空仓库。 + +### 2. 执行首次推送 + +```bash +cd "/Users/karuo/Documents/开发/3、自营项目/一场soul的创业实验-永平" +git push -u gitea main +``` + +外网需代理时先设置再推送: + +```bash +export GITEA_HTTP_PROXY=http://127.0.0.1:7897 +git push -u gitea main +``` + +首次推送成功后,**之后每次在本项目里 `git commit`,都会自动执行 `git push gitea main`**,无需再手动上传。 + +--- + +## 二、自动同步机制 + +- **触发条件**:在本项目执行 `git commit`(任意分支的提交都会触发 hook,但推送的是 `main`)。 +- **执行动作**:`post-commit` 钩子会执行 `git push gitea main`。 +- **关闭自动推送**:删除或改名 `.git/hooks/post-commit` 即可。 + +--- + +## 三、手动推送(可选) + +若需要单独推送到 Gitea(不依赖 commit): + +```bash +git push gitea main +``` diff --git a/miniprogram/app.js b/miniprogram/app.js index 1abc1ba6..d729c443 100644 --- a/miniprogram/app.js +++ b/miniprogram/app.js @@ -141,15 +141,22 @@ App({ } }, - // 绑定推荐码到用户 + // 绑定推荐码到用户(自己的推荐码不请求接口,避免 400 与控制台报错) async bindReferralCode(refCode) { try { const userId = this.globalData.userInfo?.id if (!userId || !refCode) return - + + const myCode = this.getMyReferralCode() + if (myCode && this._normalizeReferralCode(refCode) === this._normalizeReferralCode(myCode)) { + console.log('[App] 跳过绑定:不能使用自己的推荐码') + this.globalData.pendingReferralCode = null + wx.removeStorageSync('pendingReferralCode') + return + } + console.log('[App] 绑定推荐码:', refCode, '到用户:', userId) - - // 调用API绑定推荐关系 + const res = await this.request('/api/miniprogram/referral/bind', { method: 'POST', data: { @@ -158,19 +165,31 @@ App({ }, silent: true }) - + if (res.success) { console.log('[App] 推荐码绑定成功') - // 仅记录当前已绑定的推荐码,用于展示/调试;是否允许更换由后端根据30天规则判断 wx.setStorageSync('boundReferralCode', refCode) this.globalData.pendingReferralCode = null wx.removeStorageSync('pendingReferralCode') } } catch (e) { - console.error('[App] 绑定推荐码失败:', e) + const msg = (e && e.message) ? String(e.message) : '' + if (msg.indexOf('不能使用自己的推荐码') !== -1) { + console.log('[App] 跳过绑定:不能使用自己的推荐码') + this.globalData.pendingReferralCode = null + wx.removeStorageSync('pendingReferralCode') + } else { + console.error('[App] 绑定推荐码失败:', e) + } } }, + // 推荐码归一化后比较(忽略大小写、短横线等) + _normalizeReferralCode(code) { + if (!code || typeof code !== 'string') return '' + return code.replace(/[\s\-_]/g, '').toUpperCase().trim() + }, + // 根据业务 id 从 bookData 查 mid(用于跳转) getSectionMid(sectionId) { const list = this.globalData.bookData || [] diff --git a/miniprogram/pages/chapters/chapters.js b/miniprogram/pages/chapters/chapters.js index 7a897317..3cacd4c2 100644 --- a/miniprogram/pages/chapters/chapters.js +++ b/miniprogram/pages/chapters/chapters.js @@ -18,178 +18,9 @@ Page({ hasFullBook: false, purchasedSections: [], - // 书籍数据 - 完整真实标题 - totalSections: 62, - bookData: [ - { - id: 'part-1', - number: '一', - title: '真实的人', - subtitle: '人与人之间的底层逻辑', - chapters: [ - { - id: 'chapter-1', - title: '第1章|人与人之间的底层逻辑', - sections: [ - { id: '1.1', title: '荷包:电动车出租的被动收入模式', isFree: true, price: 1 }, - { id: '1.2', title: '老墨:资源整合高手的社交方法', isFree: false, price: 1 }, - { id: '1.3', title: '笑声背后的MBTI:为什么ENTJ适合做资源,INTP适合做系统', isFree: false, price: 1 }, - { id: '1.4', title: '人性的三角结构:利益、情感、价值观', isFree: false, price: 1 }, - { id: '1.5', title: '沟通差的问题:为什么你说的别人听不懂', isFree: false, price: 1 } - ] - }, - { - id: 'chapter-2', - title: '第2章|人性困境案例', - sections: [ - { id: '2.1', title: '相亲故事:你以为找的是人,实际是在找模式', isFree: false, price: 1 }, - { id: '2.2', title: '找工作迷茫者:为什么简历解决不了人生', isFree: false, price: 1 }, - { id: '2.3', title: '撸运费险:小钱困住大脑的真实心理', isFree: false, price: 1 }, - { id: '2.4', title: '游戏上瘾的年轻人:不是游戏吸引他,是生活没吸引力', isFree: false, price: 1 }, - { id: '2.5', title: '健康焦虑(我的糖尿病经历):疾病是人生的第一次清醒', isFree: false, price: 1 } - ] - } - ] - }, - { - id: 'part-2', - number: '二', - title: '真实的行业', - subtitle: '电商、内容、传统行业解析', - chapters: [ - { - id: 'chapter-3', - title: '第3章|电商篇', - sections: [ - { id: '3.1', title: '3000万流水如何跑出来(退税模式解析)', isFree: false, price: 1 }, - { id: '3.2', title: '供应链之王 vs 打工人:利润不在前端', isFree: false, price: 1 }, - { id: '3.3', title: '社区团购的底层逻辑', isFree: false, price: 1 }, - { id: '3.4', title: '跨境电商与退税套利', isFree: false, price: 1 } - ] - }, - { - id: 'chapter-4', - title: '第4章|内容商业篇', - sections: [ - { id: '4.1', title: '旅游号:30天10万粉的真实逻辑', isFree: false, price: 1 }, - { id: '4.2', title: '做号工厂:如何让一个号变成一个机器', isFree: false, price: 1 }, - { id: '4.3', title: '情绪内容为什么比专业内容更赚钱', isFree: false, price: 1 }, - { id: '4.4', title: '猫与宠物号:为什么宠物赛道永不过时', isFree: false, price: 1 }, - { id: '4.5', title: '直播间里的三种人:演员、技术工、系统流', isFree: false, price: 1 } - ] - }, - { - id: 'chapter-5', - title: '第5章|传统行业篇', - sections: [ - { id: '5.1', title: '拍卖行抱朴:一天240万的摇号生意', isFree: false, price: 1 }, - { id: '5.2', title: '土地拍卖:招拍挂背后的游戏规则', isFree: false, price: 1 }, - { id: '5.3', title: '地摊经济数字化:一个月900块的餐车生意', isFree: false, price: 1 }, - { id: '5.4', title: '不良资产拍卖:我错过的一个亿佣金', isFree: false, price: 1 }, - { id: '5.5', title: '桶装水李总:跟物业合作的轻资产模式', isFree: false, price: 1 } - ] - } - ] - }, - { - id: 'part-3', - number: '三', - title: '真实的错误', - subtitle: '我和别人犯过的错', - chapters: [ - { - id: 'chapter-6', - title: '第6章|我人生错过的4件大钱', - sections: [ - { id: '6.1', title: '电商财税窗口:2016年的千万级机会', isFree: false, price: 1 }, - { id: '6.2', title: '供应链金融:我不懂的杠杆游戏', isFree: false, price: 1 }, - { id: '6.3', title: '内容红利:2019年我为什么没做抖音', isFree: false, price: 1 }, - { id: '6.4', title: '数据资产化:我还在观望的未来机会', isFree: false, price: 1 } - ] - }, - { - id: 'chapter-7', - title: '第7章|别人犯的错误', - sections: [ - { id: '7.1', title: '投资房年轻人的迷茫:资金 vs 能力', isFree: false, price: 1 }, - { id: '7.2', title: '信息差骗局:永远有人靠卖学习赚钱', isFree: false, price: 1 }, - { id: '7.3', title: '在Soul找恋爱但想赚钱的人', isFree: false, price: 1 }, - { id: '7.4', title: '创业者的三种死法:冲动、轻信、没结构', isFree: false, price: 1 }, - { id: '7.5', title: '人情生意的终点:关系越多亏得越多', isFree: false, price: 1 } - ] - } - ] - }, - { - id: 'part-4', - number: '四', - title: '真实的赚钱', - subtitle: '底层结构与真实案例', - chapters: [ - { - id: 'chapter-8', - title: '第8章|底层结构', - sections: [ - { id: '8.1', title: '流量杠杆:抖音、Soul、飞书', isFree: false, price: 1 }, - { id: '8.2', title: '价格杠杆:供应链与信息差', isFree: false, price: 1 }, - { id: '8.3', title: '时间杠杆:自动化 + AI', isFree: false, price: 1 }, - { id: '8.4', title: '情绪杠杆:咨询、婚恋、生意场', isFree: false, price: 1 }, - { id: '8.5', title: '社交杠杆:认识谁比你会什么更重要', isFree: false, price: 1 }, - { id: '8.6', title: '云阿米巴:分不属于自己的钱', isFree: false, price: 1 } - ] - }, - { - id: 'chapter-9', - title: '第9章|我在Soul上亲访的赚钱案例', - sections: [ - { id: '9.1', title: '游戏账号私域:账号即资产', isFree: false, price: 1 }, - { id: '9.2', title: '健康包模式:高复购、高毛利', isFree: false, price: 1 }, - { id: '9.3', title: '药物私域:长期关系赛道', isFree: false, price: 1 }, - { id: '9.4', title: '残疾机构合作:退税 × AI × 人力成本', isFree: false, price: 1 }, - { id: '9.5', title: '私域银行:粉丝即小股东', isFree: false, price: 1 }, - { id: '9.6', title: 'Soul派对房:陌生人成交的最快场景', isFree: false, price: 1 }, - { id: '9.7', title: '飞书中台:从聊天到成交的流程化体系', isFree: false, price: 1 }, - { id: '9.8', title: '餐饮女孩:6万营收、1万利润的死撑生意', isFree: false, price: 1 }, - { id: '9.9', title: '电竞生态:从陪玩到签约到酒店的完整链条', isFree: false, price: 1 }, - { id: '9.10', title: '淘客大佬:损耗30%的白色通道', isFree: false, price: 1 }, - { id: '9.11', title: '蔬菜供应链:农户才是最赚钱的人', isFree: false, price: 1 }, - { id: '9.12', title: '美业整合:一个人的公司如何月入十万', isFree: false, price: 1 }, - { id: '9.13', title: 'AI工具推广:一个隐藏的高利润赛道', isFree: false, price: 1 }, - { id: '9.14', title: '大健康私域:一个月150万的70后', isFree: false, price: 1 } - ] - } - ] - }, - { - id: 'part-5', - number: '五', - title: '真实的社会', - subtitle: '未来职业与商业生态', - chapters: [ - { - id: 'chapter-10', - title: '第10章|未来职业的变化趋势', - sections: [ - { id: '10.1', title: 'AI时代:哪些工作会消失,哪些会崛起', isFree: false, price: 1 }, - { id: '10.2', title: '一人公司:为什么越来越多人选择单干', isFree: false, price: 1 }, - { id: '10.3', title: '为什么链接能力会成为第一价值', isFree: false, price: 1 }, - { id: '10.4', title: '新型公司:Soul-飞书-线下的三位一体', isFree: false, price: 1 } - ] - }, - { - id: 'chapter-11', - title: '第11章|中国社会商业生态的未来', - sections: [ - { id: '11.1', title: '私域经济:为什么流量越来越贵', isFree: false, price: 1 }, - { id: '11.2', title: '银发经济与孤独经济:两个被忽视的万亿市场', isFree: false, price: 1 }, - { id: '11.3', title: '流量红利的终局', isFree: false, price: 1 }, - { id: '11.4', title: '大模型 + 供应链的组合拳', isFree: false, price: 1 }, - { id: '11.5', title: '社会分层的最终逻辑', isFree: false, price: 1 } - ] - } - ] - } - ], + // 书籍数据:以后台内容管理为准,仅用接口 /api/miniprogram/book/all-chapters 返回的数据 + totalSections: 0, + bookData: [], // 展开状态:默认不展开任何篇章,直接显示目录 expandedPart: null, @@ -222,23 +53,37 @@ Page({ return p.includes('序言') || p.includes('尾声') || p.includes('附录') }, - // 一次请求拉取全量目录,同时更新 totalSections / bookData / dailyChapters + // 一次请求拉取全量目录,以后台内容管理为准;同时更新 totalSections / bookData / dailyChapters async loadChaptersOnce() { try { const res = await app.request({ url: '/api/miniprogram/book/all-chapters', silent: true }) const rows = (res && res.data) || (res && res.chapters) || [] - if (rows.length === 0) return - // 1. totalSections + // 无数据时清空目录,避免展示旧数据 + if (rows.length === 0) { + app.globalData.bookData = [] + wx.setStorageSync('bookData', []) + this.setData({ + bookData: [], + totalSections: 0, + dailyChapters: [], + expandedPart: null + }) + return + } + const totalSections = res.total ?? rows.length + app.globalData.bookData = rows + wx.setStorageSync('bookData', rows) - // 2. bookData(过滤序言/尾声/附录,中间篇章按 part 聚合) + // bookData:过滤序言/尾声/附录,按 part 聚合,篇章顺序按 sort_order 与后台一致(含「2026每日派对干货」等) const filtered = rows.filter(r => !this._isFixedPart(r.partTitle || r.part_title)) const partMap = new Map() const numbers = ['一', '二', '三', '四', '五', '六', '七', '八', '九', '十', '十一', '十二'] filtered.forEach((r) => { const pid = r.partId || r.part_id || 'part-1' const cid = r.chapterId || r.chapter_id || 'chapter-1' + const sortOrder = r.sectionOrder ?? r.sort_order ?? 999999 if (!partMap.has(pid)) { const partIdx = partMap.size partMap.set(pid, { @@ -246,10 +91,12 @@ Page({ number: numbers[partIdx] || String(partIdx + 1), title: r.partTitle || r.part_title || '未分类', subtitle: r.chapterTitle || r.chapter_title || '', - chapters: new Map() + chapters: new Map(), + minSortOrder: sortOrder }) } const part = partMap.get(pid) + if (sortOrder < part.minSortOrder) part.minSortOrder = sortOrder if (!part.chapters.has(cid)) { part.chapters.set(cid, { id: cid, @@ -267,13 +114,16 @@ Page({ isNew: r.isNew === true || r.is_new === true }) }) - const bookData = Array.from(partMap.values()).map(p => ({ - ...p, + const partList = Array.from(partMap.values()) + partList.sort((a, b) => (a.minSortOrder ?? 999999) - (b.minSortOrder ?? 999999)) + const bookData = partList.map((p, idx) => ({ + id: p.id, + number: numbers[idx] || String(idx + 1), + title: p.title, + subtitle: p.subtitle, chapters: Array.from(p.chapters.values()) })) - const firstPart = bookData[0] && bookData[0].id - // 3. dailyChapters(sort_order > 62 的新增章节,按更新时间取前20) const baseSort = 62 const daily = rows .filter(r => (r.sectionOrder ?? r.sort_order ?? 0) > baseSort) @@ -296,7 +146,14 @@ Page({ dailyChapters: daily, expandedPart: this.data.expandedPart }) - } catch (e) { console.log('[Chapters] 加载目录失败:', e) } + } catch (e) { + console.log('[Chapters] 加载目录失败:', e) + this.setData({ bookData: [], totalSections: 0 }) + } + }, + + onPullDownRefresh() { + this.loadChaptersOnce().then(() => wx.stopPullDownRefresh()).catch(() => wx.stopPullDownRefresh()) }, onShow() { diff --git a/miniprogram/pages/chapters/chapters.json b/miniprogram/pages/chapters/chapters.json index e7696321..1246275b 100644 --- a/miniprogram/pages/chapters/chapters.json +++ b/miniprogram/pages/chapters/chapters.json @@ -1,6 +1,6 @@ { "usingComponents": {}, - "enablePullDownRefresh": false, + "enablePullDownRefresh": true, "backgroundTextStyle": "light", "backgroundColor": "#000000" } diff --git a/miniprogram/pages/index/index.js b/miniprogram/pages/index/index.js index 0d12adec..76c22c98 100644 --- a/miniprogram/pages/index/index.js +++ b/miniprogram/pages/index/index.js @@ -23,12 +23,8 @@ Page({ totalSections: 62, bookData: [], - // 推荐章节 - featuredSections: [ - { id: '1.1', title: '荷包:电动车出租的被动收入模式', tag: '免费', tagClass: 'tag-free', part: '真实的人' }, - { id: '3.1', title: '3000万流水如何跑出来', tag: '热门', tagClass: 'tag-pink', part: '真实的行业' }, - { id: '8.1', title: '流量杠杆:抖音、Soul、飞书', tag: '推荐', tagClass: 'tag-purple', part: '真实的赚钱' } - ], + // 推荐章节:以服务端推荐算法为准,不再预置写死内容 + featuredSections: [], // 最新章节(动态计算) latestSection: null, diff --git a/miniprogram/pages/index/index.wxml b/miniprogram/pages/index/index.wxml index d42f7c00..8f29c74d 100644 --- a/miniprogram/pages/index/index.wxml +++ b/miniprogram/pages/index/index.wxml @@ -4,7 +4,7 @@ - + @@ -21,7 +21,6 @@ 点击链接卡若 - {{totalSections}}章 @@ -53,37 +52,6 @@ - - - - 我的阅读 - {{readCount}}/{{totalSections}}章 - - - - - - - - - {{readCount}} - 已读 - - - {{totalSections - readCount}} - 待读 - - - {{partCount}} - 篇章 - - - {{totalSections}} - 章节 - - - - @@ -170,7 +138,6 @@ ¥{{item.price}} - {{item.dateStr}} diff --git a/miniprogram/pages/match/match.js b/miniprogram/pages/match/match.js index e1c8821a..326b3e76 100644 --- a/miniprogram/pages/match/match.js +++ b/miniprogram/pages/match/match.js @@ -12,7 +12,7 @@ const app = getApp() // 导师顾问:跳转到存客宝添加微信 // 团队招募:跳转到存客宝添加微信 let MATCH_TYPES = [ - { id: 'partner', label: '找伙伴', matchLabel: '找伙伴', icon: '⭐', matchFromDB: true, showJoinAfterMatch: false }, + { 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: 'team', label: '团队招募', matchLabel: '团队招募', icon: '🎮', matchFromDB: true, showJoinAfterMatch: true } @@ -27,7 +27,7 @@ Page({ // 匹配类型 matchTypes: MATCH_TYPES, selectedType: 'partner', - currentTypeLabel: '找伙伴', + currentTypeLabel: '超级个体', // 用户状态 isLoggedIn: false, diff --git a/miniprogram/pages/my/my.js b/miniprogram/pages/my/my.js index 8b934c9b..73362134 100644 --- a/miniprogram/pages/my/my.js +++ b/miniprogram/pages/my/my.js @@ -111,31 +111,26 @@ Page({ const { isLoggedIn, userInfo } = app.globalData if (isLoggedIn && userInfo) { - const readIds = app.globalData.readSectionIds || [] - const recentList = readIds.slice(-5).reverse().map(id => ({ - id, - mid: app.getSectionMid(id), - title: `章节 ${id}` - })) - const userId = userInfo.id || '' const userIdShort = userId.length > 20 ? userId.slice(0, 10) + '...' + userId.slice(-6) : userId const userWechat = wx.getStorageSync('user_wechat') || userInfo.wechat || '' - // 先设基础信息;收益由 loadMyEarnings 专用接口拉取,加载前用 - 占位 + // 先设基础信息;阅读统计与收益再分别从后端刷新 this.setData({ isLoggedIn: true, userInfo, userIdShort, userWechat, - readCount: Math.min(app.getReadCount(), this.data.totalSections || 62), + readCount: 0, referralCount: userInfo.referralCount || 0, earnings: '-', pendingEarnings: '-', earningsLoading: true, - recentChapters: recentList, - totalReadTime: Math.floor(Math.random() * 200) + 50 + recentChapters: [], + totalReadTime: 0, + matchHistory: 0 }) + this.loadDashboardStats() this.loadMyEarnings() this.loadPendingConfirm() this.loadVipStatus() @@ -149,11 +144,48 @@ Page({ earnings: '-', pendingEarnings: '-', earningsLoading: false, - recentChapters: [] + recentChapters: [], + totalReadTime: 0, + matchHistory: 0 }) } }, + async loadDashboardStats() { + const userId = app.globalData.userInfo?.id + if (!userId) return + + try { + const res = await app.request({ + url: `/api/miniprogram/user/dashboard-stats?userId=${encodeURIComponent(userId)}`, + silent: true + }) + + if (!res?.success || !res.data) return + + const readSectionIds = Array.isArray(res.data.readSectionIds) ? res.data.readSectionIds : [] + app.globalData.readSectionIds = readSectionIds + wx.setStorageSync('readSectionIds', readSectionIds) + + const recentChapters = Array.isArray(res.data.recentChapters) + ? res.data.recentChapters.map((item) => ({ + id: item.id, + mid: item.mid || app.getSectionMid(item.id), + title: item.title || `章节 ${item.id}` + })) + : [] + + this.setData({ + readCount: Number(res.data.readCount || 0), + totalReadTime: Number(res.data.totalReadMinutes || 0), + matchHistory: Number(res.data.matchHistory || 0), + recentChapters + }) + } catch (e) { + console.log('[My] 拉取阅读统计失败:', e && e.message) + } + }, + // 拉取待确认收款列表(用于「确认收款」按钮) async loadPendingConfirm() { const userInfo = app.globalData.userInfo diff --git a/miniprogram/pages/read/read.js b/miniprogram/pages/read/read.js index c061d106..9862b698 100644 --- a/miniprogram/pages/read/read.js +++ b/miniprogram/pages/read/read.js @@ -442,31 +442,54 @@ Page({ }, - // 加载导航 - loadNavigation(id) { - const sectionOrder = [ - 'preface', '1.1', '1.2', '1.3', '1.4', '1.5', - '2.1', '2.2', '2.3', '2.4', '2.5', - '3.1', '3.2', '3.3', '3.4', - '4.1', '4.2', '4.3', '4.4', '4.5', - '5.1', '5.2', '5.3', '5.4', '5.5', - '6.1', '6.2', '6.3', '6.4', - '7.1', '7.2', '7.3', '7.4', '7.5', - '8.1', '8.2', '8.3', '8.4', '8.5', '8.6', - '9.1', '9.2', '9.3', '9.4', '9.5', '9.6', '9.7', '9.8', '9.9', '9.10', '9.11', '9.12', '9.13', '9.14', - '10.1', '10.2', '10.3', '10.4', - '11.1', '11.2', '11.3', '11.4', '11.5', - 'epilogue' - ] - - const currentIndex = sectionOrder.indexOf(id) - const prevId = currentIndex > 0 ? sectionOrder[currentIndex - 1] : null - const nextId = currentIndex < sectionOrder.length - 1 ? sectionOrder[currentIndex + 1] : null - - this.setData({ - prevSection: prevId ? { id: prevId, title: this.getSectionTitle(prevId) } : null, - nextSection: nextId ? { id: nextId, title: this.getSectionTitle(nextId) } : null - }) + // 加载导航:以后台章节真实 sort_order 为准 + async loadNavigation(id) { + try { + let rows = app.globalData.bookData || [] + if (!Array.isArray(rows) || rows.length === 0) { + const res = await app.request({ url: '/api/miniprogram/book/all-chapters', silent: true }) + rows = (res && (res.data || res.chapters)) || [] + if (Array.isArray(rows) && rows.length > 0) { + app.globalData.bookData = rows + } + } + + if (!Array.isArray(rows) || rows.length === 0) { + this.setData({ prevSection: null, nextSection: null }) + return + } + + const orderedSections = rows + .slice() + .sort((a, b) => { + const sortA = a.sortOrder ?? a.sort_order ?? 999999 + const sortB = b.sortOrder ?? b.sort_order ?? 999999 + if (sortA !== sortB) return sortA - sortB + const midA = a.mid ?? a.MID ?? 0 + const midB = b.mid ?? b.MID ?? 0 + if (midA !== midB) return midA - midB + return String(a.id || '').localeCompare(String(b.id || '')) + }) + .map((item) => ({ + id: item.id, + mid: item.mid ?? item.MID ?? 0, + title: item.sectionTitle || item.section_title || item.title || item.chapterTitle || this.getSectionTitle(item.id) + })) + + const currentIndex = orderedSections.findIndex((item) => item.id === id) + if (currentIndex === -1) { + this.setData({ prevSection: null, nextSection: null }) + return + } + + const prevSection = currentIndex > 0 ? orderedSections[currentIndex - 1] : null + const nextSection = currentIndex < orderedSections.length - 1 ? orderedSections[currentIndex + 1] : null + + this.setData({ prevSection, nextSection }) + } catch (e) { + console.error('[Read] 加载上下篇导航失败:', e) + this.setData({ prevSection: null, nextSection: null }) + } }, // 返回(从分享进入无栈时回首页) @@ -523,8 +546,9 @@ Page({ const { section, sectionId, sectionMid } = this.data const ref = app.getMyReferralCode() const q = sectionMid ? `mid=${sectionMid}` : `id=${sectionId}` - const shareTitle = section?.title - ? `📚 ${section.title.length > 20 ? section.title.slice(0, 20) + '...' : section.title}` + const safeSectionTitle = this.getSafeShareText(section?.title || '') + const shareTitle = safeSectionTitle + ? `📚 ${safeSectionTitle.length > 20 ? safeSectionTitle.slice(0, 20) + '...' : safeSectionTitle}` : '📚 Soul创业派对 - 真实商业故事' return { title: shareTitle, @@ -533,17 +557,51 @@ Page({ } }, - // 分享到朋友圈:文案用本章节正文前文,便于不折叠时展示(朋友圈卡片标题约 64 字节) + // 分享到朋友圈:使用安全模板,避免正文敏感词触发平台风控提示 onShareTimeline() { const { sectionId, sectionMid, shareTimelineTitle, section } = this.data const ref = app.getMyReferralCode() const q = sectionMid ? `mid=${sectionMid}` : `id=${sectionId}` - const title = (shareTimelineTitle && shareTimelineTitle.trim()) - ? (shareTimelineTitle.length > 32 ? shareTimelineTitle.slice(0, 32) + '...' : shareTimelineTitle) - : ((section?.title || '').trim().slice(0, 32) || 'Soul创业派对 - 真实商业故事') + const safeSectionTitle = this.getSafeShareText(section?.title || '') + const safePreviewTitle = this.getSafeShareText(shareTimelineTitle || '') + // 优先使用章节名,兜底使用预览文案;都为空时使用固定安全标题 + const baseTitle = safeSectionTitle || safePreviewTitle || 'Soul创业派对|真实商业案例' + const title = baseTitle.length > 32 ? `${baseTitle.slice(0, 32)}...` : baseTitle return { title, query: ref ? `${q}&ref=${ref}` : q } }, + // 清洗分享文案,规避高风险收益承诺类词汇,降低平台风控误判 + getSafeShareText(text = '') { + let safeText = String(text || '').trim() + if (!safeText) return '' + + // 统一替换常见风险词 + const riskyPatterns = [ + /90%\s*收益/gi, + /百分之九十\s*收益/gi, + /收益/gi, + /锁定\s*\d+\s*天/gi, + /锁定期/gi, + /稳赚/gi, + /保本/gi, + /高回报/gi, + /返利/gi, + /理财/gi, + /投资/gi + ] + riskyPatterns.forEach((pattern) => { + safeText = safeText.replace(pattern, '') + }) + + // 去掉多余空白和标点残留 + safeText = safeText + .replace(/[,。;、,::\-\s]{2,}/g, ' ') + .replace(/^[,。;、,::\-\s]+|[,。;、,::\-\s]+$/g, '') + .trim() + + return safeText + }, + // 显示登录弹窗(每次打开协议未勾选,符合审核要求) showLoginModal() { try { @@ -992,14 +1050,16 @@ Page({ // 跳转到上一篇 goToPrev() { if (this.data.prevSection) { - wx.redirectTo({ url: `/pages/read/read?id=${this.data.prevSection.id}` }) + const q = this.data.prevSection.mid ? `mid=${this.data.prevSection.mid}` : `id=${this.data.prevSection.id}` + wx.redirectTo({ url: `/pages/read/read?${q}` }) } }, // 跳转到下一篇 goToNext() { if (this.data.nextSection) { - wx.redirectTo({ url: `/pages/read/read?id=${this.data.nextSection.id}` }) + const q = this.data.nextSection.mid ? `mid=${this.data.nextSection.mid}` : `id=${this.data.nextSection.id}` + wx.redirectTo({ url: `/pages/read/read?${q}` }) } }, diff --git a/miniprogram/pages/read/read.wxml b/miniprogram/pages/read/read.wxml index 9daf7eb5..44b2d21f 100644 --- a/miniprogram/pages/read/read.wxml +++ b/miniprogram/pages/read/read.wxml @@ -81,8 +81,8 @@ 🖼️ diff --git a/miniprogram/utils/readingTracker.js b/miniprogram/utils/readingTracker.js index a52fb896..611d154a 100644 --- a/miniprogram/utils/readingTracker.js +++ b/miniprogram/utils/readingTracker.js @@ -37,6 +37,9 @@ class ReadingTracker { // 开始定期上报(每30秒) this.startProgressReport() + + // 立即上报一次「打开/点击」,确保内容管理后台的「点击」数据有记录(与 reading_progress 表直接捆绑) + setTimeout(() => this.reportProgressToServer(false), 0) } /** diff --git a/scripts/gitea_push_once.sh b/scripts/gitea_push_once.sh new file mode 100755 index 00000000..3fe3388e --- /dev/null +++ b/scripts/gitea_push_once.sh @@ -0,0 +1,7 @@ +#!/bin/bash +# 首次推送 Gitea:先设置 export GITEA_TOKEN=你的Token 再执行本脚本 +[ -z "$GITEA_TOKEN" ] && echo "请先执行: export GITEA_TOKEN=你的Gitea的Token" && exit 1 +cd "$(dirname "$0")/.." +git remote set-url gitea "http://fnvtk:${GITEA_TOKEN}@open.quwanzhi.com:3000/fnvtk/soul-yongping.git" +export HTTP_PROXY=http://127.0.0.1:7897 HTTPS_PROXY=http://127.0.0.1:7897 +git push -u gitea main diff --git a/soul-admin/dist/assets/index-Cnf4LXuY.css b/soul-admin/dist/assets/index-Cnf4LXuY.css new file mode 100644 index 00000000..5ca8f3a4 --- /dev/null +++ b/soul-admin/dist/assets/index-Cnf4LXuY.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-200:oklch(92.4% .12 95.746);--color-amber-300:oklch(87.9% .169 91.605);--color-amber-400:oklch(82.8% .189 84.429);--color-amber-500:oklch(76.9% .188 70.08);--color-amber-600:oklch(66.6% .179 58.318);--color-yellow-400:oklch(85.2% .199 91.936);--color-yellow-500:oklch(79.5% .184 86.047);--color-green-400:oklch(79.2% .209 151.711);--color-green-500:oklch(72.3% .219 149.579);--color-green-600:oklch(62.7% .194 149.214);--color-green-700:oklch(52.7% .154 150.069);--color-cyan-400:oklch(78.9% .154 211.53);--color-cyan-500:oklch(71.5% .143 215.221);--color-blue-300:oklch(80.9% .105 251.813);--color-blue-400:oklch(70.7% .165 254.624);--color-blue-500:oklch(62.3% .214 259.815);--color-purple-400:oklch(71.4% .203 305.504);--color-purple-500:oklch(62.7% .265 303.9);--color-gray-200:oklch(92.8% .006 264.531);--color-gray-300:oklch(87.2% .01 258.338);--color-gray-400:oklch(70.7% .022 261.325);--color-gray-500:oklch(55.1% .027 264.364);--color-gray-600:oklch(44.6% .03 256.802);--color-gray-700:oklch(37.3% .034 259.733);--color-gray-800:oklch(27.8% .033 256.848);--color-black:#000;--color-white:#fff;--spacing:.25rem;--container-sm:24rem;--container-md:28rem;--container-lg:32rem;--container-2xl:42rem;--container-3xl:48rem;--container-4xl:56rem;--text-xs:.75rem;--text-xs--line-height:calc(1/.75);--text-sm:.875rem;--text-sm--line-height:calc(1.25/.875);--text-base:1rem;--text-base--line-height: 1.5 ;--text-lg:1.125rem;--text-lg--line-height:calc(1.75/1.125);--text-xl:1.25rem;--text-xl--line-height:calc(1.75/1.25);--text-2xl:1.5rem;--text-2xl--line-height:calc(2/1.5);--text-3xl:1.875rem;--text-3xl--line-height: 1.2 ;--text-4xl:2.25rem;--text-4xl--line-height:calc(2.5/2.25);--font-weight-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-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-2{margin-inline:calc(var(--spacing)*-2)}.mx-auto{margin-inline:auto}.mt-0{margin-top:calc(var(--spacing)*0)}.mt-0\.5{margin-top:calc(var(--spacing)*.5)}.mt-1{margin-top:calc(var(--spacing)*1)}.mt-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-\[85vh\]{max-height:85vh}.max-h-\[90vh\]{max-height:90vh}.max-h-\[200px\]{max-height:200px}.max-h-\[300px\]{max-height:300px}.min-h-0{min-height:calc(var(--spacing)*0)}.min-h-\[40px\]{min-height:40px}.min-h-\[60vh\]{min-height:60vh}.min-h-\[80px\]{min-height:80px}.min-h-\[100px\]{min-height:100px}.min-h-\[120px\]{min-height:120px}.min-h-\[300px\]{min-height:300px}.min-h-\[400px\]{min-height:400px}.min-h-full{min-height:100%}.min-h-screen{min-height:100vh}.w-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-3xl{max-width:var(--container-3xl)}.max-w-4xl{max-width:var(--container-4xl)}.max-w-\[100px\]{max-width:100px}.max-w-\[120px\]{max-width:120px}.max-w-\[200px\]{max-width:200px}.max-w-\[calc\(100\%-2rem\)\]{max-width:calc(100% - 2rem)}.max-w-lg{max-width:var(--container-lg)}.max-w-md{max-width:var(--container-md)}.max-w-sm{max-width:var(--container-sm)}.min-w-0{min-width:calc(var(--spacing)*0)}.min-w-\[8rem\]{min-width:8rem}.min-w-\[120px\]{min-width:120px}.min-w-\[1024px\]{min-width:1024px}.flex-1{flex:1}.flex-shrink-0{flex-shrink:0}.shrink{flex-shrink:1}.shrink-0{flex-shrink:0}.grow{flex-grow:1}.caption-bottom{caption-side:bottom}.border-collapse{border-collapse:collapse}.-translate-x-1\/2{--tw-translate-x: -50% ;translate:var(--tw-translate-x)var(--tw-translate-y)}.-translate-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}.list-disc{list-style-type:disc}.grid-cols-1{grid-template-columns:repeat(1,minmax(0,1fr))}.grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.flex-col{flex-direction:column}.flex-col-reverse{flex-direction:column-reverse}.flex-row{flex-direction:row}.flex-wrap{flex-wrap:wrap}.items-center{align-items:center}.items-start{align-items:flex-start}.justify-between{justify-content:space-between}.justify-center{justify-content:center}.justify-end{justify-content:flex-end}.gap-0{gap:calc(var(--spacing)*0)}.gap-0\.5{gap:calc(var(--spacing)*.5)}.gap-1{gap:calc(var(--spacing)*1)}.gap-1\.5{gap:calc(var(--spacing)*1.5)}.gap-2{gap:calc(var(--spacing)*2)}.gap-3{gap:calc(var(--spacing)*3)}.gap-4{gap:calc(var(--spacing)*4)}.gap-6{gap:calc(var(--spacing)*6)}.gap-8{gap:calc(var(--spacing)*8)}:where(.space-y-1>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*1)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*1)*calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-1\.5>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*1.5)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*1.5)*calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-2>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*2)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*2)*calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-3>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*3)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*3)*calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-4>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*4)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*4)*calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-6>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*6)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*6)*calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-reverse>:not(:last-child)){--tw-space-y-reverse:1}:where(.space-x-reverse>:not(:last-child)){--tw-space-x-reverse:1}:where(.divide-x>:not(:last-child)){--tw-divide-x-reverse:0;border-inline-style:var(--tw-border-style);border-inline-start-width:calc(1px*var(--tw-divide-x-reverse));border-inline-end-width:calc(1px*calc(1 - var(--tw-divide-x-reverse)))}:where(.divide-y>:not(:last-child)){--tw-divide-y-reverse:0;border-bottom-style:var(--tw-border-style);border-top-style:var(--tw-border-style);border-top-width:calc(1px*var(--tw-divide-y-reverse));border-bottom-width:calc(1px*calc(1 - var(--tw-divide-y-reverse)))}:where(.divide-y-reverse>:not(:last-child)){--tw-divide-y-reverse:1}:where(.divide-gray-700\/50>:not(:last-child)){border-color:#36415380}@supports (color:color-mix(in lab,red,red)){:where(.divide-gray-700\/50>:not(:last-child)){border-color:color-mix(in oklab,var(--color-gray-700)50%,transparent)}}:where(.divide-white\/5>:not(:last-child)){border-color:#ffffff0d}@supports (color:color-mix(in lab,red,red)){:where(.divide-white\/5>:not(:last-child)){border-color:color-mix(in oklab,var(--color-white)5%,transparent)}}.truncate{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.overflow-auto{overflow:auto}.overflow-hidden{overflow:hidden}.overflow-x-auto{overflow-x:auto}.overflow-y-auto{overflow-y:auto}.rounded{border-radius:.25rem}.rounded-2xl{border-radius:var(--radius-2xl)}.rounded-full{border-radius:3.40282e38px}.rounded-lg{border-radius:var(--radius-lg)}.rounded-md{border-radius:var(--radius-md)}.rounded-sm{border-radius:var(--radius-sm)}.rounded-xl{border-radius:var(--radius-xl)}.rounded-s{border-start-start-radius:.25rem;border-end-start-radius:.25rem}.rounded-ss{border-start-start-radius:.25rem}.rounded-e{border-start-end-radius:.25rem;border-end-end-radius:.25rem}.rounded-se{border-start-end-radius:.25rem}.rounded-ee{border-end-end-radius:.25rem}.rounded-es{border-end-start-radius:.25rem}.rounded-t{border-top-left-radius:.25rem;border-top-right-radius:.25rem}.rounded-l{border-top-left-radius:.25rem;border-bottom-left-radius:.25rem}.rounded-tl{border-top-left-radius:.25rem}.rounded-r{border-top-right-radius:.25rem;border-bottom-right-radius:.25rem}.rounded-tr{border-top-right-radius:.25rem}.rounded-b{border-bottom-right-radius:.25rem;border-bottom-left-radius:.25rem}.rounded-br{border-bottom-right-radius:.25rem}.rounded-bl{border-bottom-left-radius:.25rem}.border{border-style:var(--tw-border-style);border-width:1px}.border-0{border-style:var(--tw-border-style);border-width:0}.border-2{border-style:var(--tw-border-style);border-width:2px}.border-x{border-inline-style:var(--tw-border-style);border-inline-width:1px}.border-y{border-block-style:var(--tw-border-style);border-block-width:1px}.border-s{border-inline-start-style:var(--tw-border-style);border-inline-start-width:1px}.border-e{border-inline-end-style:var(--tw-border-style);border-inline-end-width:1px}.border-t{border-top-style:var(--tw-border-style);border-top-width:1px}.border-r{border-right-style:var(--tw-border-style);border-right-width:1px}.border-b{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}.border-l{border-left-style:var(--tw-border-style);border-left-width:1px}.border-\[\#07C160\]{border-color:#07c160}.border-\[\#07C160\]\/20{border-color:#07c16033}.border-\[\#07C160\]\/30{border-color:#07c1604d}.border-\[\#38bdac\]{border-color:#38bdac}.border-\[\#38bdac\]\/30{border-color:#38bdac4d}.border-\[\#38bdac\]\/40{border-color:#38bdac66}.border-\[\#38bdac\]\/50{border-color:#38bdac80}.border-amber-500\/30{border-color:#f99c004d}@supports (color:color-mix(in lab,red,red)){.border-amber-500\/30{border-color:color-mix(in oklab,var(--color-amber-500)30%,transparent)}}.border-amber-500\/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-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-500{border-color:var(--color-gray-500)}.border-gray-600{border-color:var(--color-gray-600)}.border-gray-700{border-color:var(--color-gray-700)}.border-gray-700\/30{border-color:#3641534d}@supports (color:color-mix(in lab,red,red)){.border-gray-700\/30{border-color:color-mix(in oklab,var(--color-gray-700)30%,transparent)}}.border-gray-700\/50{border-color:#36415380}@supports (color:color-mix(in lab,red,red)){.border-gray-700\/50{border-color:color-mix(in oklab,var(--color-gray-700)50%,transparent)}}.border-green-500\/30{border-color:#00c7584d}@supports (color:color-mix(in lab,red,red)){.border-green-500\/30{border-color:color-mix(in oklab,var(--color-green-500)30%,transparent)}}.border-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-\[\#1C1C1E\]{background-color:#1c1c1e}.bg-\[\#07C160\]{background-color:#07c160}.bg-\[\#07C160\]\/5{background-color:#07c1600d}.bg-\[\#07C160\]\/10{background-color:#07c1601a}.bg-\[\#38bdac\]{background-color:#38bdac}.bg-\[\#38bdac\]\/5{background-color:#38bdac0d}.bg-\[\#38bdac\]\/10{background-color:#38bdac1a}.bg-\[\#38bdac\]\/15{background-color:#38bdac26}.bg-\[\#38bdac\]\/20{background-color:#38bdac33}.bg-\[\#38bdac\]\/30{background-color:#38bdac4d}.bg-\[\#38bdac\]\/80{background-color:#38bdaccc}.bg-\[\#162840\]{background-color:#162840}.bg-amber-500{background-color:var(--color-amber-500)}.bg-amber-500\/10{background-color:#f99c001a}@supports (color:color-mix(in lab,red,red)){.bg-amber-500\/10{background-color:color-mix(in oklab,var(--color-amber-500)10%,transparent)}}.bg-amber-500\/20{background-color:#f99c0033}@supports (color:color-mix(in lab,red,red)){.bg-amber-500\/20{background-color:color-mix(in oklab,var(--color-amber-500)20%,transparent)}}.bg-black{background-color:var(--color-black)}.bg-black\/50{background-color:#00000080}@supports (color:color-mix(in lab,red,red)){.bg-black\/50{background-color:color-mix(in oklab,var(--color-black)50%,transparent)}}.bg-black\/90{background-color:#000000e6}@supports (color:color-mix(in lab,red,red)){.bg-black\/90{background-color:color-mix(in oklab,var(--color-black)90%,transparent)}}.bg-blue-500\/5{background-color:#3080ff0d}@supports (color:color-mix(in lab,red,red)){.bg-blue-500\/5{background-color:color-mix(in oklab,var(--color-blue-500)5%,transparent)}}.bg-blue-500\/10{background-color:#3080ff1a}@supports (color:color-mix(in lab,red,red)){.bg-blue-500\/10{background-color:color-mix(in oklab,var(--color-blue-500)10%,transparent)}}.bg-blue-500\/20{background-color:#3080ff33}@supports (color:color-mix(in lab,red,red)){.bg-blue-500\/20{background-color:color-mix(in oklab,var(--color-blue-500)20%,transparent)}}.bg-cyan-500{background-color:var(--color-cyan-500)}.bg-cyan-500\/20{background-color:#00b7d733}@supports (color:color-mix(in lab,red,red)){.bg-cyan-500\/20{background-color:color-mix(in oklab,var(--color-cyan-500)20%,transparent)}}.bg-gray-500{background-color:var(--color-gray-500)}.bg-gray-500\/20{background-color:#6a728233}@supports (color:color-mix(in lab,red,red)){.bg-gray-500\/20{background-color:color-mix(in oklab,var(--color-gray-500)20%,transparent)}}.bg-gray-600{background-color:var(--color-gray-600)}.bg-gray-600\/50{background-color:#4a556580}@supports (color:color-mix(in lab,red,red)){.bg-gray-600\/50{background-color:color-mix(in oklab,var(--color-gray-600)50%,transparent)}}.bg-gray-700{background-color:var(--color-gray-700)}.bg-gray-700\/50{background-color:#36415380}@supports (color:color-mix(in lab,red,red)){.bg-gray-700\/50{background-color:color-mix(in oklab,var(--color-gray-700)50%,transparent)}}.bg-green-500{background-color:var(--color-green-500)}.bg-green-500\/20{background-color:#00c75833}@supports (color:color-mix(in lab,red,red)){.bg-green-500\/20{background-color:color-mix(in oklab,var(--color-green-500)20%,transparent)}}.bg-green-600{background-color:var(--color-green-600)}.bg-orange-500{background-color:var(--color-orange-500)}.bg-orange-500\/10{background-color:#fe6e001a}@supports (color:color-mix(in lab,red,red)){.bg-orange-500\/10{background-color:color-mix(in oklab,var(--color-orange-500)10%,transparent)}}.bg-orange-500\/20{background-color:#fe6e0033}@supports (color:color-mix(in lab,red,red)){.bg-orange-500\/20{background-color:color-mix(in oklab,var(--color-orange-500)20%,transparent)}}.bg-purple-500\/20{background-color:#ac4bff33}@supports (color:color-mix(in lab,red,red)){.bg-purple-500\/20{background-color:color-mix(in oklab,var(--color-purple-500)20%,transparent)}}.bg-red-500\/10{background-color:#fb2c361a}@supports (color:color-mix(in lab,red,red)){.bg-red-500\/10{background-color:color-mix(in oklab,var(--color-red-500)10%,transparent)}}.bg-red-500\/20{background-color:#fb2c3633}@supports (color:color-mix(in lab,red,red)){.bg-red-500\/20{background-color:color-mix(in oklab,var(--color-red-500)20%,transparent)}}.bg-transparent{background-color:#0000}.bg-white{background-color:var(--color-white)}.bg-white\/5{background-color:#ffffff0d}@supports (color:color-mix(in lab,red,red)){.bg-white\/5{background-color:color-mix(in oklab,var(--color-white)5%,transparent)}}.bg-white\/10{background-color:#ffffff1a}@supports (color:color-mix(in lab,red,red)){.bg-white\/10{background-color:color-mix(in oklab,var(--color-white)10%,transparent)}}.bg-white\/20{background-color:#fff3}@supports (color:color-mix(in lab,red,red)){.bg-white\/20{background-color:color-mix(in oklab,var(--color-white)20%,transparent)}}.bg-yellow-500\/20{background-color:#edb20033}@supports (color:color-mix(in lab,red,red)){.bg-yellow-500\/20{background-color:color-mix(in oklab,var(--color-yellow-500)20%,transparent)}}.bg-gradient-to-br{--tw-gradient-position:to bottom right in oklab;background-image:linear-gradient(var(--tw-gradient-stops))}.bg-gradient-to-r{--tw-gradient-position:to right in oklab;background-image:linear-gradient(var(--tw-gradient-stops))}.from-\[\#00CED1\]{--tw-gradient-from:#00ced1;--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.from-\[\#38bdac\]\/10{--tw-gradient-from:oklab(72.378% -.11483 -.0053193/.1);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.from-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-5{padding:calc(var(--spacing)*5)}.p-6{padding:calc(var(--spacing)*6)}.p-8{padding:calc(var(--spacing)*8)}.px-1\.5{padding-inline:calc(var(--spacing)*1.5)}.px-2{padding-inline:calc(var(--spacing)*2)}.px-3{padding-inline:calc(var(--spacing)*3)}.px-4{padding-inline:calc(var(--spacing)*4)}.px-5{padding-inline:calc(var(--spacing)*5)}.px-6{padding-inline:calc(var(--spacing)*6)}.py-0\.5{padding-block:calc(var(--spacing)*.5)}.py-1{padding-block:calc(var(--spacing)*1)}.py-1\.5{padding-block:calc(var(--spacing)*1.5)}.py-2{padding-block:calc(var(--spacing)*2)}.py-2\.5{padding-block:calc(var(--spacing)*2.5)}.py-3{padding-block:calc(var(--spacing)*3)}.py-4{padding-block:calc(var(--spacing)*4)}.py-5{padding-block:calc(var(--spacing)*5)}.py-6{padding-block:calc(var(--spacing)*6)}.py-8{padding-block:calc(var(--spacing)*8)}.py-12{padding-block:calc(var(--spacing)*12)}.py-20{padding-block:calc(var(--spacing)*20)}.py-24{padding-block:calc(var(--spacing)*24)}.pt-0{padding-top:calc(var(--spacing)*0)}.pt-1{padding-top:calc(var(--spacing)*1)}.pt-2{padding-top:calc(var(--spacing)*2)}.pt-3{padding-top:calc(var(--spacing)*3)}.pt-4{padding-top:calc(var(--spacing)*4)}.pt-6{padding-top:calc(var(--spacing)*6)}.pr-1{padding-right:calc(var(--spacing)*1)}.pr-2{padding-right:calc(var(--spacing)*2)}.pr-4{padding-right:calc(var(--spacing)*4)}.pb-1{padding-bottom:calc(var(--spacing)*1)}.pb-2{padding-bottom:calc(var(--spacing)*2)}.pb-3{padding-bottom:calc(var(--spacing)*3)}.pb-4{padding-bottom:calc(var(--spacing)*4)}.pl-2{padding-left:calc(var(--spacing)*2)}.pl-4{padding-left:calc(var(--spacing)*4)}.pl-8{padding-left:calc(var(--spacing)*8)}.pl-10{padding-left:calc(var(--spacing)*10)}.text-center{text-align:center}.text-left{text-align:left}.text-right{text-align:right}.align-middle{vertical-align:middle}.font-mono{font-family:var(--font-mono)}.text-2xl{font-size:var(--text-2xl);line-height:var(--tw-leading,var(--text-2xl--line-height))}.text-3xl{font-size:var(--text-3xl);line-height:var(--tw-leading,var(--text-3xl--line-height))}.text-4xl{font-size:var(--text-4xl);line-height:var(--tw-leading,var(--text-4xl--line-height))}.text-base{font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height))}.text-lg{font-size:var(--text-lg);line-height:var(--tw-leading,var(--text-lg--line-height))}.text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.text-xl{font-size:var(--text-xl);line-height:var(--tw-leading,var(--text-xl--line-height))}.text-xs{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.text-\[10px\]{font-size:10px}.text-\[11px\]{font-size:11px}.leading-none{--tw-leading:1;line-height:1}.leading-relaxed{--tw-leading:var(--leading-relaxed);line-height:var(--leading-relaxed)}.leading-tight{--tw-leading:var(--leading-tight);line-height:var(--leading-tight)}.font-bold{--tw-font-weight:var(--font-weight-bold);font-weight:var(--font-weight-bold)}.font-medium{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.font-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-\[\#38bdac\]\/50{color:#38bdac80}.text-\[\#169BD7\]{color:#169bd7}.text-\[\#1677FF\]{color:#1677ff}.text-\[\#FFD700\]{color:gold}.text-amber-200{color:var(--color-amber-200)}.text-amber-400{color:var(--color-amber-400)}.text-amber-400\/90{color:#fcbb00e6}@supports (color:color-mix(in lab,red,red)){.text-amber-400\/90{color:color-mix(in oklab,var(--color-amber-400)90%,transparent)}}.text-black{color:var(--color-black)}.text-blue-300{color:var(--color-blue-300)}.text-blue-300\/60{color:#90c5ff99}@supports (color:color-mix(in lab,red,red)){.text-blue-300\/60{color:color-mix(in oklab,var(--color-blue-300)60%,transparent)}}.text-blue-400{color:var(--color-blue-400)}.text-blue-400\/50{color:#54a2ff80}@supports (color:color-mix(in lab,red,red)){.text-blue-400\/50{color:color-mix(in oklab,var(--color-blue-400)50%,transparent)}}.text-cyan-400{color:var(--color-cyan-400)}.text-gray-200{color:var(--color-gray-200)}.text-gray-300{color:var(--color-gray-300)}.text-gray-400{color:var(--color-gray-400)}.text-gray-500{color:var(--color-gray-500)}.text-gray-600{color:var(--color-gray-600)}.text-green-400{color:var(--color-green-400)}.text-green-400\/50{color:#05df7280}@supports (color:color-mix(in lab,red,red)){.text-green-400\/50{color:color-mix(in oklab,var(--color-green-400)50%,transparent)}}.text-green-500{color:var(--color-green-500)}.text-orange-300{color:var(--color-orange-300)}.text-orange-300\/60{color:#ffb96d99}@supports (color:color-mix(in lab,red,red)){.text-orange-300\/60{color:color-mix(in oklab,var(--color-orange-300)60%,transparent)}}.text-orange-400{color:var(--color-orange-400)}.text-orange-400\/80{color:#ff8b1acc}@supports (color:color-mix(in lab,red,red)){.text-orange-400\/80{color:color-mix(in oklab,var(--color-orange-400)80%,transparent)}}.text-purple-400{color:var(--color-purple-400)}.text-red-400{color:var(--color-red-400)}.text-white{color:var(--color-white)}.text-white\/40{color:#fff6}@supports (color:color-mix(in lab,red,red)){.text-white\/40{color:color-mix(in oklab,var(--color-white)40%,transparent)}}.text-white\/60{color:#fff9}@supports (color:color-mix(in lab,red,red)){.text-white\/60{color:color-mix(in oklab,var(--color-white)60%,transparent)}}.text-white\/70{color:#ffffffb3}@supports (color:color-mix(in lab,red,red)){.text-white\/70{color:color-mix(in oklab,var(--color-white)70%,transparent)}}.text-white\/80{color:#fffc}@supports (color:color-mix(in lab,red,red)){.text-white\/80{color:color-mix(in oklab,var(--color-white)80%,transparent)}}.text-yellow-400{color:var(--color-yellow-400)}.text-yellow-400\/50{color:#fac80080}@supports (color:color-mix(in lab,red,red)){.text-yellow-400\/50{color:color-mix(in oklab,var(--color-yellow-400)50%,transparent)}}.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)}.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\]\/30:hover{background-color:#1628404d}.hover\:bg-\[\#162840\]\/50:hover{background-color:#16284080}.hover\:bg-amber-400\/10:hover{background-color:#fcbb001a}@supports (color:color-mix(in lab,red,red)){.hover\:bg-amber-400\/10:hover{background-color:color-mix(in oklab,var(--color-amber-400)10%,transparent)}}.hover\:bg-amber-500\/10:hover{background-color:#f99c001a}@supports (color:color-mix(in lab,red,red)){.hover\:bg-amber-500\/10:hover{background-color:color-mix(in oklab,var(--color-amber-500)10%,transparent)}}.hover\:bg-amber-500\/20:hover{background-color:#f99c0033}@supports (color:color-mix(in lab,red,red)){.hover\:bg-amber-500\/20:hover{background-color:color-mix(in oklab,var(--color-amber-500)20%,transparent)}}.hover\:bg-amber-600:hover{background-color:var(--color-amber-600)}.hover\:bg-blue-400\/10:hover{background-color:#54a2ff1a}@supports (color:color-mix(in lab,red,red)){.hover\:bg-blue-400\/10:hover{background-color:color-mix(in oklab,var(--color-blue-400)10%,transparent)}}.hover\:bg-blue-500\/20:hover{background-color:#3080ff33}@supports (color:color-mix(in lab,red,red)){.hover\:bg-blue-500\/20:hover{background-color:color-mix(in oklab,var(--color-blue-500)20%,transparent)}}.hover\:bg-gray-500:hover{background-color:var(--color-gray-500)}.hover\:bg-gray-500\/20:hover{background-color:#6a728233}@supports (color:color-mix(in lab,red,red)){.hover\:bg-gray-500\/20:hover{background-color:color-mix(in oklab,var(--color-gray-500)20%,transparent)}}.hover\:bg-gray-700\/50:hover{background-color:#36415380}@supports (color:color-mix(in lab,red,red)){.hover\:bg-gray-700\/50:hover{background-color:color-mix(in oklab,var(--color-gray-700)50%,transparent)}}.hover\:bg-gray-800:hover{background-color:var(--color-gray-800)}.hover\:bg-green-500\/20:hover{background-color:#00c75833}@supports (color:color-mix(in lab,red,red)){.hover\:bg-green-500\/20:hover{background-color:color-mix(in oklab,var(--color-green-500)20%,transparent)}}.hover\:bg-green-700:hover{background-color:var(--color-green-700)}.hover\:bg-orange-500\/20:hover{background-color:#fe6e0033}@supports (color:color-mix(in lab,red,red)){.hover\:bg-orange-500\/20:hover{background-color:color-mix(in oklab,var(--color-orange-500)20%,transparent)}}.hover\:bg-orange-600:hover{background-color:var(--color-orange-600)}.hover\:bg-purple-500\/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-300:hover{color:var(--color-amber-300)}.hover\:text-amber-400:hover{color:var(--color-amber-400)}.hover\:text-blue-400:hover{color:var(--color-blue-400)}.hover\:text-red-300:hover{color:var(--color-red-300)}.hover\:text-red-400:hover{color:var(--color-red-400)}.hover\:text-white:hover{color:var(--color-white)}.hover\:text-yellow-400:hover{color:var(--color-yellow-400)}.hover\:underline:hover{text-decoration-line:underline}.hover\:opacity-100:hover{opacity:1}}.focus\:border-\[\#38bdac\]:focus{border-color:#38bdac}.focus\:bg-\[\#38bdac\]\/20:focus{background-color:#38bdac33}.focus\:ring-2:focus{--tw-ring-shadow:var(--tw-ring-inset,)0 0 0 calc(2px + var(--tw-ring-offset-width))var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.focus\:ring-\[\#38bdac\]:focus{--tw-ring-color:#38bdac}.focus\:ring-offset-2:focus{--tw-ring-offset-width:2px;--tw-ring-offset-shadow:var(--tw-ring-inset,)0 0 0 var(--tw-ring-offset-width)var(--tw-ring-offset-color)}.focus\:outline-none:focus{--tw-outline-style:none;outline-style:none}.focus-visible\:ring-2:focus-visible{--tw-ring-shadow:var(--tw-ring-inset,)0 0 0 calc(2px + var(--tw-ring-offset-width))var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.focus-visible\:ring-\[3px\]:focus-visible{--tw-ring-shadow:var(--tw-ring-inset,)0 0 0 calc(3px + var(--tw-ring-offset-width))var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.focus-visible\:ring-\[\#38bdac\]:focus-visible{--tw-ring-color:#38bdac}.focus-visible\:ring-offset-2:focus-visible{--tw-ring-offset-width:2px;--tw-ring-offset-shadow:var(--tw-ring-inset,)0 0 0 var(--tw-ring-offset-width)var(--tw-ring-offset-color)}.focus-visible\:ring-offset-\[\#0a1628\]:focus-visible{--tw-ring-offset-color:#0a1628}.focus-visible\:outline-none:focus-visible{--tw-outline-style:none;outline-style:none}.active\:cursor-grabbing:active{cursor:grabbing}.disabled\:pointer-events-none:disabled{pointer-events:none}.disabled\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\:opacity-40:disabled{opacity:.4}.disabled\:opacity-50:disabled{opacity:.5}.has-\[\>svg\]\:px-2\.5:has(>svg){padding-inline:calc(var(--spacing)*2.5)}.has-\[\>svg\]\:px-3:has(>svg){padding-inline:calc(var(--spacing)*3)}.has-\[\>svg\]\:px-4:has(>svg){padding-inline:calc(var(--spacing)*4)}.data-\[disabled\]\:pointer-events-none[data-disabled]{pointer-events:none}.data-\[disabled\]\:opacity-50[data-disabled]{opacity:.5}.data-\[side\=bottom\]\:translate-y-1[data-side=bottom]{--tw-translate-y:calc(var(--spacing)*1);translate:var(--tw-translate-x)var(--tw-translate-y)}.data-\[state\=active\]\:bg-\[\#07C160\]\/20[data-state=active]{background-color:#07c16033}.data-\[state\=active\]\:bg-\[\#26A17B\]\/20[data-state=active]{background-color:#26a17b33}.data-\[state\=active\]\:bg-\[\#38bdac\]\/20[data-state=active]{background-color:#38bdac33}.data-\[state\=active\]\:bg-\[\#1677FF\]\/20[data-state=active]{background-color:#1677ff33}.data-\[state\=active\]\:bg-\[\#003087\]\/20[data-state=active]{background-color:#00308733}.data-\[state\=active\]\:font-medium[data-state=active]{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.data-\[state\=active\]\:text-\[\#07C160\][data-state=active]{color:#07c160}.data-\[state\=active\]\:text-\[\#26A17B\][data-state=active]{color:#26a17b}.data-\[state\=active\]\:text-\[\#38bdac\][data-state=active]{color:#38bdac}.data-\[state\=active\]\:text-\[\#169BD7\][data-state=active]{color:#169bd7}.data-\[state\=active\]\:text-\[\#1677FF\][data-state=active]{color:#1677ff}.data-\[state\=active\]\:shadow[data-state=active]{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a),0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.data-\[state\=checked\]\:translate-x-4[data-state=checked]{--tw-translate-x:calc(var(--spacing)*4);translate:var(--tw-translate-x)var(--tw-translate-y)}.data-\[state\=checked\]\:bg-\[\#38bdac\][data-state=checked]{background-color:#38bdac}.data-\[state\=unchecked\]\:translate-x-0[data-state=unchecked]{--tw-translate-x:calc(var(--spacing)*0);translate:var(--tw-translate-x)var(--tw-translate-y)}.data-\[state\=unchecked\]\:bg-gray-600[data-state=unchecked]{background-color:var(--color-gray-600)}@media(min-width:40rem){.sm\:max-w-lg{max-width:var(--container-lg)}.sm\:flex-row{flex-direction:row}.sm\:justify-end{justify-content:flex-end}.sm\:text-left{text-align:left}}@media(min-width:48rem){.md\:col-span-2{grid-column:span 2/span 2}.md\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.md\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.md\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.md\:text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}}@media(min-width:64rem){.lg\: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/assets/index-Cw3R8GlJ.css b/soul-admin/dist/assets/index-Cw3R8GlJ.css deleted file mode 100644 index 3f23835a..00000000 --- a/soul-admin/dist/assets/index-Cw3R8GlJ.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;--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-amber-600:oklch(66.6% .179 58.318);--color-yellow-400:oklch(85.2% .199 91.936);--color-yellow-500:oklch(79.5% .184 86.047);--color-green-400:oklch(79.2% .209 151.711);--color-green-500:oklch(72.3% .219 149.579);--color-green-600:oklch(62.7% .194 149.214);--color-green-700:oklch(52.7% .154 150.069);--color-cyan-400:oklch(78.9% .154 211.53);--color-cyan-500:oklch(71.5% .143 215.221);--color-blue-300:oklch(80.9% .105 251.813);--color-blue-400:oklch(70.7% .165 254.624);--color-blue-500:oklch(62.3% .214 259.815);--color-purple-400:oklch(71.4% .203 305.504);--color-purple-500:oklch(62.7% .265 303.9);--color-gray-200:oklch(92.8% .006 264.531);--color-gray-300:oklch(87.2% .01 258.338);--color-gray-400:oklch(70.7% .022 261.325);--color-gray-500:oklch(55.1% .027 264.364);--color-gray-600:oklch(44.6% .03 256.802);--color-gray-700:oklch(37.3% .034 259.733);--color-gray-800:oklch(27.8% .033 256.848);--color-black:#000;--color-white:#fff;--spacing:.25rem;--container-sm:24rem;--container-md:28rem;--container-lg:32rem;--container-2xl:42rem;--container-4xl:56rem;--container-5xl:64rem;--container-6xl:72rem;--container-7xl:80rem;--text-xs:.75rem;--text-xs--line-height:calc(1/.75);--text-sm:.875rem;--text-sm--line-height:calc(1.25/.875);--text-base:1rem;--text-base--line-height: 1.5 ;--text-lg:1.125rem;--text-lg--line-height:calc(1.75/1.125);--text-xl:1.25rem;--text-xl--line-height:calc(1.75/1.25);--text-2xl:1.5rem;--text-2xl--line-height:calc(2/1.5);--text-3xl:1.875rem;--text-3xl--line-height: 1.2 ;--text-4xl:2.25rem;--text-4xl--line-height:calc(2.5/2.25);--font-weight-medium:500;--font-weight-semibold:600;--font-weight-bold:700;--tracking-tight:-.025em;--leading-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;--animate-pulse:pulse 2s cubic-bezier(.4,0,.6,1)infinite;--blur-xl:24px;--blur-3xl:64px;--default-transition-duration:.15s;--default-transition-timing-function:cubic-bezier(.4,0,.2,1);--default-font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","PingFang SC","Microsoft YaHei",sans-serif;--default-mono-font-family:var(--font-mono)}}@layer base{*,:after,:before,::backdrop{box-sizing:border-box;border:0 solid;margin:0;padding:0}::file-selector-button{box-sizing:border-box;border:0 solid;margin:0;padding:0}html,:host{-webkit-text-size-adjust:100%;-moz-tab-size:4;tab-size:4;line-height:1.5;font-family:var(--default-font-family,ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji");font-feature-settings:var(--default-font-feature-settings,normal);font-variation-settings:var(--default-font-variation-settings,normal);-webkit-tap-highlight-color:transparent}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:var(--default-mono-font-family,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace);font-feature-settings:var(--default-mono-font-feature-settings,normal);font-variation-settings:var(--default-mono-font-variation-settings,normal);font-size:1em}small{font-size:80%}sub,sup{vertical-align:baseline;font-size:75%;line-height:0;position:relative}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}:-moz-focusring{outline:auto}progress{vertical-align:baseline}summary{display:list-item}ol,ul,menu{list-style:none}img,svg,video,canvas,audio,iframe,embed,object{vertical-align:middle;display:block}img,video{max-width:100%;height:auto}button,input,select,optgroup,textarea{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}::file-selector-button{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}:where(select:is([multiple],[size])) optgroup{font-weight:bolder}:where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}::file-selector-button{margin-inline-end:4px}::placeholder{opacity:1}@supports (not ((-webkit-appearance:-apple-pay-button))) or (contain-intrinsic-size:1px){::placeholder{color:currentColor}@supports (color:color-mix(in lab,red,red)){::placeholder{color:color-mix(in oklab,currentcolor 50%,transparent)}}}textarea{resize:vertical}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}::-webkit-datetime-edit{display:inline-flex}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-datetime-edit{padding-block:0}::-webkit-datetime-edit-year-field{padding-block:0}::-webkit-datetime-edit-month-field{padding-block:0}::-webkit-datetime-edit-day-field{padding-block:0}::-webkit-datetime-edit-hour-field{padding-block:0}::-webkit-datetime-edit-minute-field{padding-block:0}::-webkit-datetime-edit-second-field{padding-block:0}::-webkit-datetime-edit-millisecond-field{padding-block:0}::-webkit-datetime-edit-meridiem-field{padding-block:0}::-webkit-calendar-picker-indicator{line-height:1}:-moz-ui-invalid{box-shadow:none}button,input:where([type=button],[type=reset],[type=submit]){-webkit-appearance:button;-moz-appearance:button;appearance:button}::file-selector-button{-webkit-appearance:button;-moz-appearance:button;appearance:button}::-webkit-inner-spin-button{height:auto}::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}}@layer components;@layer utilities{.pointer-events-none{pointer-events:none}.collapse{visibility:collapse}.invisible{visibility:hidden}.visible{visibility:visible}.sr-only{clip-path:inset(50%);white-space:nowrap;border-width:0;width:1px;height:1px;margin:-1px;padding:0;position:absolute;overflow:hidden}.not-sr-only{clip-path:none;white-space:normal;width:auto;height:auto;margin:0;padding:0;position:static;overflow:visible}.absolute{position:absolute}.fixed{position:fixed}.relative{position:relative}.static{position:static}.sticky{position:sticky}.inset-0{inset:calc(var(--spacing)*0)}.top-0{top:calc(var(--spacing)*0)}.top-1\/2{top:50%}.top-1\/4{top:25%}.top-4{top:calc(var(--spacing)*4)}.top-\[50\%\]{top:50%}.right-1\/4{right:25%}.right-4{right:calc(var(--spacing)*4)}.bottom-1\/4{bottom:25%}.left-1\/4{left:25%}.left-2{left:calc(var(--spacing)*2)}.left-3{left:calc(var(--spacing)*3)}.left-\[50\%\]{left:50%}.isolate{isolation:isolate}.isolation-auto{isolation:auto}.z-10{z-index:10}.z-50{z-index:50}.container{width:100%}@media(min-width:40rem){.container{max-width:40rem}}@media(min-width:48rem){.container{max-width:48rem}}@media(min-width:64rem){.container{max-width:64rem}}@media(min-width:80rem){.container{max-width:80rem}}@media(min-width:96rem){.container{max-width:96rem}}.-mx-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-\[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-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-5xl{max-width:var(--container-5xl)}.max-w-6xl{max-width:var(--container-6xl)}.max-w-7xl{max-width:var(--container-7xl)}.max-w-\[100px\]{max-width:100px}.max-w-\[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}.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-pulse{animation:var(--animate-pulse)}.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)}}: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-\[\#38bdac\]\/50{border-color:#38bdac80}.border-amber-500\/30{border-color:#f99c004d}@supports (color:color-mix(in lab,red,red)){.border-amber-500\/30{border-color:color-mix(in oklab,var(--color-amber-500)30%,transparent)}}.border-amber-500\/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-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-500{border-color:var(--color-gray-500)}.border-gray-600{border-color:var(--color-gray-600)}.border-gray-700{border-color:var(--color-gray-700)}.border-gray-700\/30{border-color:#3641534d}@supports (color:color-mix(in lab,red,red)){.border-gray-700\/30{border-color:color-mix(in oklab,var(--color-gray-700)30%,transparent)}}.border-gray-700\/50{border-color:#36415380}@supports (color:color-mix(in lab,red,red)){.border-gray-700\/50{border-color:color-mix(in oklab,var(--color-gray-700)50%,transparent)}}.border-green-500\/30{border-color:#00c7584d}@supports (color:color-mix(in lab,red,red)){.border-green-500\/30{border-color:color-mix(in oklab,var(--color-green-500)30%,transparent)}}.border-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-\[\#1C1C1E\]{background-color:#1c1c1e}.bg-\[\#07C160\]{background-color:#07c160}.bg-\[\#07C160\]\/5{background-color:#07c1600d}.bg-\[\#07C160\]\/10{background-color:#07c1601a}.bg-\[\#38bdac\]{background-color:#38bdac}.bg-\[\#38bdac\]\/5{background-color:#38bdac0d}.bg-\[\#38bdac\]\/10{background-color:#38bdac1a}.bg-\[\#38bdac\]\/15{background-color:#38bdac26}.bg-\[\#38bdac\]\/20{background-color:#38bdac33}.bg-\[\#38bdac\]\/30{background-color:#38bdac4d}.bg-\[\#38bdac\]\/80{background-color:#38bdaccc}.bg-\[\#162840\]{background-color:#162840}.bg-amber-500{background-color:var(--color-amber-500)}.bg-amber-500\/10{background-color:#f99c001a}@supports (color:color-mix(in lab,red,red)){.bg-amber-500\/10{background-color:color-mix(in oklab,var(--color-amber-500)10%,transparent)}}.bg-amber-500\/20{background-color:#f99c0033}@supports (color:color-mix(in lab,red,red)){.bg-amber-500\/20{background-color:color-mix(in oklab,var(--color-amber-500)20%,transparent)}}.bg-black{background-color:var(--color-black)}.bg-black\/50{background-color:#00000080}@supports (color:color-mix(in lab,red,red)){.bg-black\/50{background-color:color-mix(in oklab,var(--color-black)50%,transparent)}}.bg-black\/90{background-color:#000000e6}@supports (color:color-mix(in lab,red,red)){.bg-black\/90{background-color:color-mix(in oklab,var(--color-black)90%,transparent)}}.bg-blue-500\/5{background-color:#3080ff0d}@supports (color:color-mix(in lab,red,red)){.bg-blue-500\/5{background-color:color-mix(in oklab,var(--color-blue-500)5%,transparent)}}.bg-blue-500\/10{background-color:#3080ff1a}@supports (color:color-mix(in lab,red,red)){.bg-blue-500\/10{background-color:color-mix(in oklab,var(--color-blue-500)10%,transparent)}}.bg-blue-500\/20{background-color:#3080ff33}@supports (color:color-mix(in lab,red,red)){.bg-blue-500\/20{background-color:color-mix(in oklab,var(--color-blue-500)20%,transparent)}}.bg-cyan-500{background-color:var(--color-cyan-500)}.bg-gray-500{background-color:var(--color-gray-500)}.bg-gray-500\/20{background-color:#6a728233}@supports (color:color-mix(in lab,red,red)){.bg-gray-500\/20{background-color:color-mix(in oklab,var(--color-gray-500)20%,transparent)}}.bg-gray-600{background-color:var(--color-gray-600)}.bg-gray-600\/50{background-color:#4a556580}@supports (color:color-mix(in lab,red,red)){.bg-gray-600\/50{background-color:color-mix(in oklab,var(--color-gray-600)50%,transparent)}}.bg-gray-700{background-color:var(--color-gray-700)}.bg-gray-700\/50{background-color:#36415380}@supports (color:color-mix(in lab,red,red)){.bg-gray-700\/50{background-color:color-mix(in oklab,var(--color-gray-700)50%,transparent)}}.bg-green-500{background-color:var(--color-green-500)}.bg-green-500\/20{background-color:#00c75833}@supports (color:color-mix(in lab,red,red)){.bg-green-500\/20{background-color:color-mix(in oklab,var(--color-green-500)20%,transparent)}}.bg-green-600{background-color:var(--color-green-600)}.bg-orange-500{background-color:var(--color-orange-500)}.bg-orange-500\/10{background-color:#fe6e001a}@supports (color:color-mix(in lab,red,red)){.bg-orange-500\/10{background-color:color-mix(in oklab,var(--color-orange-500)10%,transparent)}}.bg-orange-500\/20{background-color:#fe6e0033}@supports (color:color-mix(in lab,red,red)){.bg-orange-500\/20{background-color:color-mix(in oklab,var(--color-orange-500)20%,transparent)}}.bg-purple-500\/20{background-color:#ac4bff33}@supports (color:color-mix(in lab,red,red)){.bg-purple-500\/20{background-color:color-mix(in oklab,var(--color-purple-500)20%,transparent)}}.bg-red-500\/10{background-color:#fb2c361a}@supports (color:color-mix(in lab,red,red)){.bg-red-500\/10{background-color:color-mix(in oklab,var(--color-red-500)10%,transparent)}}.bg-red-500\/20{background-color:#fb2c3633}@supports (color:color-mix(in lab,red,red)){.bg-red-500\/20{background-color:color-mix(in oklab,var(--color-red-500)20%,transparent)}}.bg-transparent{background-color:#0000}.bg-white{background-color:var(--color-white)}.bg-white\/5{background-color:#ffffff0d}@supports (color:color-mix(in lab,red,red)){.bg-white\/5{background-color:color-mix(in oklab,var(--color-white)5%,transparent)}}.bg-white\/10{background-color:#ffffff1a}@supports (color:color-mix(in lab,red,red)){.bg-white\/10{background-color:color-mix(in oklab,var(--color-white)10%,transparent)}}.bg-white\/20{background-color:#fff3}@supports (color:color-mix(in lab,red,red)){.bg-white\/20{background-color:color-mix(in oklab,var(--color-white)20%,transparent)}}.bg-yellow-500\/20{background-color:#edb20033}@supports (color:color-mix(in lab,red,red)){.bg-yellow-500\/20{background-color:color-mix(in oklab,var(--color-yellow-500)20%,transparent)}}.bg-gradient-to-br{--tw-gradient-position:to bottom right in oklab;background-image:linear-gradient(var(--tw-gradient-stops))}.bg-gradient-to-r{--tw-gradient-position:to right in oklab;background-image:linear-gradient(var(--tw-gradient-stops))}.from-\[\#00CED1\]{--tw-gradient-from:#00ced1;--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.from-\[\#38bdac\]\/10{--tw-gradient-from:oklab(72.378% -.11483 -.0053193/.1);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.from-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-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-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-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)}.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-\[\#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-amber-600:hover{background-color:var(--color-amber-600)}.hover\:bg-blue-400\/10:hover{background-color:#54a2ff1a}@supports (color:color-mix(in lab,red,red)){.hover\:bg-blue-400\/10:hover{background-color:color-mix(in oklab,var(--color-blue-400)10%,transparent)}}.hover\:bg-blue-500\/20:hover{background-color:#3080ff33}@supports (color:color-mix(in lab,red,red)){.hover\:bg-blue-500\/20:hover{background-color:color-mix(in oklab,var(--color-blue-500)20%,transparent)}}.hover\:bg-gray-500:hover{background-color:var(--color-gray-500)}.hover\:bg-gray-500\/20:hover{background-color:#6a728233}@supports (color:color-mix(in lab,red,red)){.hover\:bg-gray-500\/20:hover{background-color:color-mix(in oklab,var(--color-gray-500)20%,transparent)}}.hover\:bg-gray-700\/50:hover{background-color:#36415380}@supports (color:color-mix(in lab,red,red)){.hover\:bg-gray-700\/50:hover{background-color:color-mix(in oklab,var(--color-gray-700)50%,transparent)}}.hover\:bg-gray-800:hover{background-color:var(--color-gray-800)}.hover\:bg-green-500\/20:hover{background-color:#00c75833}@supports (color:color-mix(in lab,red,red)){.hover\:bg-green-500\/20:hover{background-color:color-mix(in oklab,var(--color-green-500)20%,transparent)}}.hover\:bg-green-700:hover{background-color:var(--color-green-700)}.hover\:bg-orange-500\/20:hover{background-color:#fe6e0033}@supports (color:color-mix(in lab,red,red)){.hover\:bg-orange-500\/20:hover{background-color:color-mix(in oklab,var(--color-orange-500)20%,transparent)}}.hover\:bg-orange-600:hover{background-color:var(--color-orange-600)}.hover\:bg-purple-500\/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}.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)}}@keyframes pulse{50%{opacity:.5}} diff --git a/soul-admin/dist/assets/index-DL1oFSEm.js b/soul-admin/dist/assets/index-DL1oFSEm.js deleted file mode 100644 index 3d504b9d..00000000 --- a/soul-admin/dist/assets/index-DL1oFSEm.js +++ /dev/null @@ -1,470 +0,0 @@ -function ty(n,a){for(var l=0;lo[c]})}}}return Object.freeze(Object.defineProperty(n,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(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var Bc={exports:{}},Da={},Uc={exports:{}},Ve={};/** - * @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 ry(){if(Zh)return Ve;Zh=1;var n=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 P(A){return A===null||typeof A!="object"?null:(A=y&&A[y]||A["@@iterator"],typeof A=="function"?A:null)}var R={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},C=Object.assign,j={};function b(A,F,G){this.props=A,this.context=F,this.refs=j,this.updater=G||R}b.prototype.isReactComponent={},b.prototype.setState=function(A,F){if(typeof A!="object"&&typeof A!="function"&&A!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,A,F,"setState")},b.prototype.forceUpdate=function(A){this.updater.enqueueForceUpdate(this,A,"forceUpdate")};function S(){}S.prototype=b.prototype;function E(A,F,G){this.props=A,this.context=F,this.refs=j,this.updater=G||R}var w=E.prototype=new S;w.constructor=E,C(w,b.prototype),w.isPureReactComponent=!0;var M=Array.isArray,D=Object.prototype.hasOwnProperty,V={current:null},k={key:!0,ref:!0,__self:!0,__source:!0};function T(A,F,G){var J,xe={},me=null,re=null;if(F!=null)for(J in F.ref!==void 0&&(re=F.ref),F.key!==void 0&&(me=""+F.key),F)D.call(F,J)&&!k.hasOwnProperty(J)&&(xe[J]=F[J]);var ye=arguments.length-2;if(ye===1)xe.children=G;else if(1>>1,F=_[A];if(0>>1;Ac(xe,z))mec(re,xe)?(_[A]=re,_[me]=z,A=me):(_[A]=xe,_[J]=z,A=J);else if(mec(re,z))_[A]=re,_[me]=z,A=me;else break e}}return q}function c(_,q){var z=_.sortIndex-q.sortIndex;return z!==0?z:_.id-q.id}if(typeof performance=="object"&&typeof performance.now=="function"){var u=performance;n.unstable_now=function(){return u.now()}}else{var f=Date,p=f.now();n.unstable_now=function(){return f.now()-p}}var x=[],g=[],v=1,y=null,P=3,R=!1,C=!1,j=!1,b=typeof setTimeout=="function"?setTimeout:null,S=typeof clearTimeout=="function"?clearTimeout:null,E=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function w(_){for(var q=l(g);q!==null;){if(q.callback===null)o(g);else if(q.startTime<=_)o(g),q.sortIndex=q.expirationTime,a(x,q);else break;q=l(g)}}function M(_){if(j=!1,w(_),!C)if(l(x)!==null)C=!0,Z(D);else{var q=l(g);q!==null&&$(M,q.startTime-_)}}function D(_,q){C=!1,j&&(j=!1,S(T),T=-1),R=!0;var z=P;try{for(w(q),y=l(x);y!==null&&(!(y.expirationTime>q)||_&&!te());){var A=y.callback;if(typeof A=="function"){y.callback=null,P=y.priorityLevel;var F=A(y.expirationTime<=q);q=n.unstable_now(),typeof F=="function"?y.callback=F:y===l(x)&&o(x),w(q)}else o(x);y=l(x)}if(y!==null)var G=!0;else{var J=l(g);J!==null&&$(M,J.startTime-q),G=!1}return G}finally{y=null,P=z,R=!1}}var V=!1,k=null,T=-1,U=5,Q=-1;function te(){return!(n.unstable_now()-Q_||125<_?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):U=0<_?Math.floor(1e3/_):5},n.unstable_getCurrentPriorityLevel=function(){return P},n.unstable_getFirstCallbackNode=function(){return l(x)},n.unstable_next=function(_){switch(P){case 1:case 2:case 3:var q=3;break;default:q=P}var z=P;P=q;try{return _()}finally{P=z}},n.unstable_pauseExecution=function(){},n.unstable_requestPaint=function(){},n.unstable_runWithPriority=function(_,q){switch(_){case 1:case 2:case 3:case 4:case 5:break;default:_=3}var z=P;P=_;try{return q()}finally{P=z}},n.unstable_scheduleCallback=function(_,q,z){var A=n.unstable_now();switch(typeof z=="object"&&z!==null?(z=z.delay,z=typeof z=="number"&&0A?(_.sortIndex=z,a(g,_),l(x)===null&&_===l(g)&&(j?(S(T),T=-1):j=!0,$(M,z-A))):(_.sortIndex=F,a(x,_),C||R||(C=!0,Z(D))),_},n.unstable_shouldYield=te,n.unstable_wrapCallback=function(_){var q=P;return function(){var z=P;P=q;try{return _.apply(this,arguments)}finally{P=z}}}})(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 Zt;am=1;var n=Ad(),a=ly();function l(e){for(var r="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 P(e){return x.call(y,e)?!0:x.call(v,e)?!1:g.test(e)?y[e]=!0:(v[e]=!0,!1)}function R(e,r,s,i){if(s!==null&&s.type===0)return!1;switch(typeof r){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,r,s,i){if(r===null||typeof r>"u"||R(e,r,s,i))return!0;if(i)return!1;if(s!==null)switch(s.type){case 3:return!r;case 4:return r===!1;case 5:return isNaN(r);case 6:return isNaN(r)||1>r}return!1}function j(e,r,s,i,d,m,N){this.acceptsBooleans=r===2||r===3||r===4,this.attributeName=i,this.attributeNamespace=d,this.mustUseProperty=s,this.propertyName=e,this.type=r,this.sanitizeURL=m,this.removeEmptyString=N}var b={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){b[e]=new j(e,0,!1,e,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var r=e[0];b[r]=new j(r,1,!1,e[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(e){b[e]=new j(e,2,!1,e.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){b[e]=new j(e,2,!1,e,null,!1,!1)}),"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){b[e]=new j(e,3,!1,e.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(e){b[e]=new j(e,3,!0,e,null,!1,!1)}),["capture","download"].forEach(function(e){b[e]=new j(e,4,!1,e,null,!1,!1)}),["cols","rows","size","span"].forEach(function(e){b[e]=new j(e,6,!1,e,null,!1,!1)}),["rowSpan","start"].forEach(function(e){b[e]=new j(e,5,!1,e.toLowerCase(),null,!1,!1)});var S=/[\-:]([a-z])/g;function E(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 r=e.replace(S,E);b[r]=new j(r,1,!1,e,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var r=e.replace(S,E);b[r]=new j(r,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(e){var r=e.replace(S,E);b[r]=new j(r,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(e){b[e]=new j(e,1,!1,e.toLowerCase(),null,!1,!1)}),b.xlinkHref=new j("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(e){b[e]=new j(e,1,!1,e.toLowerCase(),null,!0,!0)});function w(e,r,s,i){var d=b.hasOwnProperty(r)?b[r]:null;(d!==null?d.type!==0:i||!(2I||d[N]!==m[I]){var O=` -`+d[N].replace(" at new "," at ");return e.displayName&&O.includes("")&&(O=O.replace("",e.displayName)),O}while(1<=N&&0<=I);break}}}finally{G=!1,Error.prepareStackTrace=s}return(e=e?e.displayName||e.name:"")?F(e):""}function xe(e){switch(e.tag){case 5:return F(e.type);case 16:return F("Lazy");case 13:return F("Suspense");case 19:return F("SuspenseList");case 0:case 2:case 15:return e=J(e.type,!1),e;case 11:return e=J(e.type.render,!1),e;case 1:return e=J(e.type,!0),e;default:return""}}function me(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case k:return"Fragment";case V:return"Portal";case U:return"Profiler";case T:return"StrictMode";case he:return"Suspense";case ne:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case te:return(e.displayName||"Context")+".Consumer";case Q:return(e._context.displayName||"Context")+".Provider";case oe:var r=e.render;return e=e.displayName,e||(e=r.displayName||r.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case le:return r=e.displayName||null,r!==null?r:me(e.type)||"Memo";case Z:r=e._payload,e=e._init;try{return me(e(r))}catch{}}return null}function re(e){var r=e.type;switch(e.tag){case 24:return"Cache";case 9:return(r.displayName||"Context")+".Consumer";case 10:return(r._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=r.render,e=e.displayName||e.name||"",r.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return r;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return me(r);case 8:return r===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 r=="function")return r.displayName||r.name||null;if(typeof r=="string")return r}return null}function ye(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function L(e){var r=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(r==="checkbox"||r==="radio")}function de(e){var r=L(e)?"checked":"value",s=Object.getOwnPropertyDescriptor(e.constructor.prototype,r),i=""+e[r];if(!e.hasOwnProperty(r)&&typeof s<"u"&&typeof s.get=="function"&&typeof s.set=="function"){var d=s.get,m=s.set;return Object.defineProperty(e,r,{configurable:!0,get:function(){return d.call(this)},set:function(N){i=""+N,m.call(this,N)}}),Object.defineProperty(e,r,{enumerable:s.enumerable}),{getValue:function(){return i},setValue:function(N){i=""+N},stopTracking:function(){e._valueTracker=null,delete e[r]}}}}function ge(e){e._valueTracker||(e._valueTracker=de(e))}function _e(e){if(!e)return!1;var r=e._valueTracker;if(!r)return!0;var s=r.getValue(),i="";return e&&(i=L(e)?e.checked?"true":"false":e.value),e=i,e!==s?(r.setValue(e),!0):!1}function Oe(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 ze(e,r){var s=r.checked;return z({},r,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:s??e._wrapperState.initialChecked})}function qe(e,r){var s=r.defaultValue==null?"":r.defaultValue,i=r.checked!=null?r.checked:r.defaultChecked;s=ye(r.value!=null?r.value:s),e._wrapperState={initialChecked:i,initialValue:s,controlled:r.type==="checkbox"||r.type==="radio"?r.checked!=null:r.value!=null}}function rt(e,r){r=r.checked,r!=null&&w(e,"checked",r,!1)}function et(e,r){rt(e,r);var s=ye(r.value),i=r.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}r.hasOwnProperty("value")?Et(e,r.type,s):r.hasOwnProperty("defaultValue")&&Et(e,r.type,ye(r.defaultValue)),r.checked==null&&r.defaultChecked!=null&&(e.defaultChecked=!!r.defaultChecked)}function kt(e,r,s){if(r.hasOwnProperty("value")||r.hasOwnProperty("defaultValue")){var i=r.type;if(!(i!=="submit"&&i!=="reset"||r.value!==void 0&&r.value!==null))return;r=""+e._wrapperState.initialValue,s||r===e.value||(e.value=r),e.defaultValue=r}s=e.name,s!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,s!==""&&(e.name=s)}function Et(e,r,s){(r!=="number"||Oe(e.ownerDocument)!==e)&&(s==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+s&&(e.defaultValue=""+s))}var K=Array.isArray;function pe(e,r,s,i){if(e=e.options,r){r={};for(var d=0;d"+r.valueOf().toString()+"",r=Ke.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;r.firstChild;)e.appendChild(r.firstChild)}});function xr(e,r){if(r){var s=e.firstChild;if(s&&s===e.lastChild&&s.nodeType===3){s.nodeValue=r;return}}e.textContent=r}var $n={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($n).forEach(function(e){a0.forEach(function(r){r=r+e.charAt(0).toUpperCase()+e.substring(1),$n[r]=$n[e]})});function hu(e,r,s){return r==null||typeof r=="boolean"||r===""?"":s||typeof r!="number"||r===0||$n.hasOwnProperty(e)&&$n[e]?(""+r).trim():r+"px"}function mu(e,r){e=e.style;for(var s in r)if(r.hasOwnProperty(s)){var i=s.indexOf("--")===0,d=hu(s,r[s],i);s==="float"&&(s="cssFloat"),i?e.setProperty(s,d):e[s]=d}}var l0=z({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,r){if(r){if(l0[e]&&(r.children!=null||r.dangerouslySetInnerHTML!=null))throw Error(l(137,e));if(r.dangerouslySetInnerHTML!=null){if(r.children!=null)throw Error(l(60));if(typeof r.dangerouslySetInnerHTML!="object"||!("__html"in r.dangerouslySetInnerHTML))throw Error(l(61))}if(r.style!=null&&typeof r.style!="object")throw Error(l(62))}}function Zi(e,r){if(e.indexOf("-")===-1)return typeof r.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 ro=null,fs=null,hs=null;function pu(e){if(e=ja(e)){if(typeof ro!="function")throw Error(l(280));var r=e.stateNode;r&&(r=gl(r),ro(e.stateNode,e.type,r))}}function xu(e){fs?hs?hs.push(e):hs=[e]:fs=e}function gu(){if(fs){var e=fs,r=hs;if(hs=fs=null,pu(e),r)for(e=0;e>>=0,e===0?32:31-(g0(e)/v0|0)|0}var Za=64,el=4194304;function ra(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 tl(e,r){var s=e.pendingLanes;if(s===0)return 0;var i=0,d=e.suspendedLanes,m=e.pingedLanes,N=s&268435455;if(N!==0){var I=N&~d;I!==0?i=ra(I):(m&=N,m!==0&&(i=ra(m)))}else N=s&~d,N!==0?i=ra(N):m!==0&&(i=ra(m));if(i===0)return 0;if(r!==0&&r!==i&&(r&d)===0&&(d=i&-i,m=r&-r,d>=m||d===16&&(m&4194240)!==0))return r;if((i&4)!==0&&(i|=s&16),r=e.entangledLanes,r!==0)for(e=e.entanglements,r&=i;0s;s++)r.push(e);return r}function na(e,r,s){e.pendingLanes|=r,r!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,r=31-gr(r),e[r]=s}function b0(e,r){var s=e.pendingLanes&~r;e.pendingLanes=r,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=r,e.mutableReadLanes&=r,e.entangledLanes&=r,r=e.entanglements;var i=e.eventTimes;for(e=e.expirationTimes;0=ua),Hu=" ",Ku=!1;function Yu(e,r){switch(e){case"keyup":return q0.indexOf(r.keyCode)!==-1;case"keydown":return r.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Gu(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var xs=!1;function J0(e,r){switch(e){case"compositionend":return Gu(r);case"keypress":return r.which!==32?null:(Ku=!0,Hu);case"textInput":return e=r.data,e===Hu&&Ku?null:e;default:return null}}function Z0(e,r){if(xs)return e==="compositionend"||!No&&Yu(e,r)?(e=zu(),ll=po=on=null,xs=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(r.ctrlKey||r.altKey||r.metaKey)||r.ctrlKey&&r.altKey){if(r.char&&1=r)return{node:s,offset:r-e};e=i}e:{for(;s;){if(s.nextSibling){s=s.nextSibling;break e}s=s.parentNode}s=void 0}s=tf(s)}}function nf(e,r){return e&&r?e===r?!0:e&&e.nodeType===3?!1:r&&r.nodeType===3?nf(e,r.parentNode):"contains"in e?e.contains(r):e.compareDocumentPosition?!!(e.compareDocumentPosition(r)&16):!1:!1}function sf(){for(var e=window,r=Oe();r instanceof e.HTMLIFrameElement;){try{var s=typeof r.contentWindow.location.href=="string"}catch{s=!1}if(s)e=r.contentWindow;else break;r=Oe(e.document)}return r}function So(e){var r=e&&e.nodeName&&e.nodeName.toLowerCase();return r&&(r==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||r==="textarea"||e.contentEditable==="true")}function ov(e){var r=sf(),s=e.focusedElem,i=e.selectionRange;if(r!==s&&s&&s.ownerDocument&&nf(s.ownerDocument.documentElement,s)){if(i!==null&&So(s)){if(r=i.start,e=i.end,e===void 0&&(e=r),"selectionStart"in s)s.selectionStart=r,s.selectionEnd=Math.min(e,s.value.length);else if(e=(r=s.ownerDocument||document)&&r.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=rf(s,m);var N=rf(s,i);d&&N&&(e.rangeCount!==1||e.anchorNode!==d.node||e.anchorOffset!==d.offset||e.focusNode!==N.node||e.focusOffset!==N.offset)&&(r=r.createRange(),r.setStart(d.node,d.offset),e.removeAllRanges(),m>i?(e.addRange(r),e.extend(N.node,N.offset)):(r.setEnd(N.node,N.offset),e.addRange(r)))}}for(r=[],e=s;e=e.parentNode;)e.nodeType===1&&r.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof s.focus=="function"&&s.focus(),s=0;s=document.documentMode,gs=null,Co=null,pa=null,ko=!1;function af(e,r,s){var i=s.window===s?s.document:s.nodeType===9?s:s.ownerDocument;ko||gs==null||gs!==Oe(i)||(i=gs,"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}),pa&&ma(pa,i)||(pa=i,i=ml(Co,"onSelect"),0bs||(e.current=Fo[bs],Fo[bs]=null,bs--)}function nt(e,r){bs++,Fo[bs]=e.current,e.current=r}var fn={},Mt=un(fn),Gt=un(!1),Vn=fn;function ws(e,r){var s=e.type.contextTypes;if(!s)return fn;var i=e.stateNode;if(i&&i.__reactInternalMemoizedUnmaskedChildContext===r)return i.__reactInternalMemoizedMaskedChildContext;var d={},m;for(m in s)d[m]=r[m];return i&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=r,e.__reactInternalMemoizedMaskedChildContext=d),d}function Qt(e){return e=e.childContextTypes,e!=null}function vl(){at(Gt),at(Mt)}function Nf(e,r,s){if(Mt.current!==fn)throw Error(l(168));nt(Mt,r),nt(Gt,s)}function bf(e,r,s){var i=e.stateNode;if(r=r.childContextTypes,typeof i.getChildContext!="function")return s;i=i.getChildContext();for(var d in i)if(!(d in r))throw Error(l(108,re(e)||"Unknown",d));return z({},s,i)}function yl(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||fn,Vn=Mt.current,nt(Mt,e),nt(Gt,Gt.current),!0}function wf(e,r,s){var i=e.stateNode;if(!i)throw Error(l(169));s?(e=bf(e,r,Vn),i.__reactInternalMemoizedMergedChildContext=e,at(Gt),at(Mt),nt(Mt,e)):at(Gt),nt(Gt,s)}var $r=null,jl=!1,zo=!1;function Sf(e){$r===null?$r=[e]:$r.push(e)}function jv(e){jl=!0,Sf(e)}function hn(){if(!zo&&$r!==null){zo=!0;var e=0,r=Ze;try{var s=$r;for(Ze=1;e>=N,d-=N,Br=1<<32-gr(r)+d|s<De?(wt=Me,Me=null):wt=Me.sibling;var Qe=ie(W,Me,H[De],fe);if(Qe===null){Me===null&&(Me=wt);break}e&&Me&&Qe.alternate===null&&r(W,Me),B=m(Qe,B,De),Ae===null?Ee=Qe:Ae.sibling=Qe,Ae=Qe,Me=wt}if(De===H.length)return s(W,Me),lt&&Hn(W,De),Ee;if(Me===null){for(;DeDe?(wt=Me,Me=null):wt=Me.sibling;var bn=ie(W,Me,Qe.value,fe);if(bn===null){Me===null&&(Me=wt);break}e&&Me&&bn.alternate===null&&r(W,Me),B=m(bn,B,De),Ae===null?Ee=bn:Ae.sibling=bn,Ae=bn,Me=wt}if(Qe.done)return s(W,Me),lt&&Hn(W,De),Ee;if(Me===null){for(;!Qe.done;De++,Qe=H.next())Qe=ue(W,Qe.value,fe),Qe!==null&&(B=m(Qe,B,De),Ae===null?Ee=Qe:Ae.sibling=Qe,Ae=Qe);return lt&&Hn(W,De),Ee}for(Me=i(W,Me);!Qe.done;De++,Qe=H.next())Qe=ve(Me,W,De,Qe.value,fe),Qe!==null&&(e&&Qe.alternate!==null&&Me.delete(Qe.key===null?De:Qe.key),B=m(Qe,B,De),Ae===null?Ee=Qe:Ae.sibling=Qe,Ae=Qe);return e&&Me.forEach(function(ey){return r(W,ey)}),lt&&Hn(W,De),Ee}function mt(W,B,H,fe){if(typeof H=="object"&&H!==null&&H.type===k&&H.key===null&&(H=H.props.children),typeof H=="object"&&H!==null){switch(H.$$typeof){case D:e:{for(var Ee=H.key,Ae=B;Ae!==null;){if(Ae.key===Ee){if(Ee=H.type,Ee===k){if(Ae.tag===7){s(W,Ae.sibling),B=d(Ae,H.props.children),B.return=W,W=B;break e}}else if(Ae.elementType===Ee||typeof Ee=="object"&&Ee!==null&&Ee.$$typeof===Z&&Tf(Ee)===Ae.type){s(W,Ae.sibling),B=d(Ae,H.props),B.ref=Na(W,Ae,H),B.return=W,W=B;break e}s(W,Ae);break}else r(W,Ae);Ae=Ae.sibling}H.type===k?(B=Zn(H.props.children,W.mode,fe,H.key),B.return=W,W=B):(fe=Gl(H.type,H.key,H.props,null,W.mode,fe),fe.ref=Na(W,B,H),fe.return=W,W=fe)}return N(W);case V:e:{for(Ae=H.key;B!==null;){if(B.key===Ae)if(B.tag===4&&B.stateNode.containerInfo===H.containerInfo&&B.stateNode.implementation===H.implementation){s(W,B.sibling),B=d(B,H.children||[]),B.return=W,W=B;break e}else{s(W,B);break}else r(W,B);B=B.sibling}B=Lc(H,W.mode,fe),B.return=W,W=B}return N(W);case Z:return Ae=H._init,mt(W,B,Ae(H._payload),fe)}if(K(H))return be(W,B,H,fe);if(q(H))return ke(W,B,H,fe);Sl(W,H)}return typeof H=="string"&&H!==""||typeof H=="number"?(H=""+H,B!==null&&B.tag===6?(s(W,B.sibling),B=d(B,H),B.return=W,W=B):(s(W,B),B=Dc(H,W.mode,fe),B.return=W,W=B),N(W)):s(W,B)}return mt}var Es=_f(!0),If=_f(!1),Cl=un(null),kl=null,Ps=null,Ho=null;function Ko(){Ho=Ps=kl=null}function Yo(e){var r=Cl.current;at(Cl),e._currentValue=r}function Go(e,r,s){for(;e!==null;){var i=e.alternate;if((e.childLanes&r)!==r?(e.childLanes|=r,i!==null&&(i.childLanes|=r)):i!==null&&(i.childLanes&r)!==r&&(i.childLanes|=r),e===s)break;e=e.return}}function Rs(e,r){kl=e,Ho=Ps=null,e=e.dependencies,e!==null&&e.firstContext!==null&&((e.lanes&r)!==0&&(qt=!0),e.firstContext=null)}function cr(e){var r=e._currentValue;if(Ho!==e)if(e={context:e,memoizedValue:r,next:null},Ps===null){if(kl===null)throw Error(l(308));Ps=e,kl.dependencies={lanes:0,firstContext:e}}else Ps=Ps.next=e;return r}var Kn=null;function Qo(e){Kn===null?Kn=[e]:Kn.push(e)}function Af(e,r,s,i){var d=r.interleaved;return d===null?(s.next=s,Qo(r)):(s.next=d.next,d.next=s),r.interleaved=s,Vr(e,i)}function Vr(e,r){e.lanes|=r;var s=e.alternate;for(s!==null&&(s.lanes|=r),s=e,e=e.return;e!==null;)e.childLanes|=r,s=e.alternate,s!==null&&(s.childLanes|=r),s=e,e=e.return;return s.tag===3?s.stateNode:null}var mn=!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,r){e=e.updateQueue,r.updateQueue===e&&(r.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function Wr(e,r){return{eventTime:e,lane:r,tag:0,payload:null,callback:null,next:null}}function pn(e,r,s){var i=e.updateQueue;if(i===null)return null;if(i=i.shared,(Ye&2)!==0){var d=i.pending;return d===null?r.next=r:(r.next=d.next,d.next=r),i.pending=r,Vr(e,s)}return d=i.interleaved,d===null?(r.next=r,Qo(i)):(r.next=d.next,d.next=r),i.interleaved=r,Vr(e,s)}function El(e,r,s){if(r=r.updateQueue,r!==null&&(r=r.shared,(s&4194240)!==0)){var i=r.lanes;i&=e.pendingLanes,s|=i,r.lanes=s,co(e,s)}}function Df(e,r){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 N={eventTime:s.eventTime,lane:s.lane,tag:s.tag,payload:s.payload,callback:s.callback,next:null};m===null?d=m=N:m=m.next=N,s=s.next}while(s!==null);m===null?d=m=r:m=m.next=r}else d=m=r;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=r:e.next=r,s.lastBaseUpdate=r}function Pl(e,r,s,i){var d=e.updateQueue;mn=!1;var m=d.firstBaseUpdate,N=d.lastBaseUpdate,I=d.shared.pending;if(I!==null){d.shared.pending=null;var O=I,Y=O.next;O.next=null,N===null?m=Y:N.next=Y,N=O;var ce=e.alternate;ce!==null&&(ce=ce.updateQueue,I=ce.lastBaseUpdate,I!==N&&(I===null?ce.firstBaseUpdate=Y:I.next=Y,ce.lastBaseUpdate=O))}if(m!==null){var ue=d.baseState;N=0,ce=Y=O=null,I=m;do{var ie=I.lane,ve=I.eventTime;if((i&ie)===ie){ce!==null&&(ce=ce.next={eventTime:ve,lane:0,tag:I.tag,payload:I.payload,callback:I.callback,next:null});e:{var be=e,ke=I;switch(ie=r,ve=s,ke.tag){case 1:if(be=ke.payload,typeof be=="function"){ue=be.call(ve,ue,ie);break e}ue=be;break e;case 3:be.flags=be.flags&-65537|128;case 0:if(be=ke.payload,ie=typeof be=="function"?be.call(ve,ue,ie):be,ie==null)break e;ue=z({},ue,ie);break e;case 2:mn=!0}}I.callback!==null&&I.lane!==0&&(e.flags|=64,ie=d.effects,ie===null?d.effects=[I]:ie.push(I))}else ve={eventTime:ve,lane:ie,tag:I.tag,payload:I.payload,callback:I.callback,next:null},ce===null?(Y=ce=ve,O=ue):ce=ce.next=ve,N|=ie;if(I=I.next,I===null){if(I=d.shared.pending,I===null)break;ie=I,I=ie.next,ie.next=null,d.lastBaseUpdate=ie,d.shared.pending=null}}while(!0);if(ce===null&&(O=ue),d.baseState=O,d.firstBaseUpdate=Y,d.lastBaseUpdate=ce,r=d.shared.interleaved,r!==null){d=r;do N|=d.lane,d=d.next;while(d!==r)}else m===null&&(d.shared.lanes=0);Qn|=N,e.lanes=N,e.memoizedState=ue}}function Lf(e,r,s){if(e=r.effects,r.effects=null,e!==null)for(r=0;rs?s:4,e(!0);var i=tc.transition;tc.transition={};try{e(!1),r()}finally{Ze=s,tc.transition=i}}function th(){return dr().memoizedState}function Sv(e,r,s){var i=yn(e);if(s={lane:i,action:s,hasEagerState:!1,eagerState:null,next:null},rh(e))nh(r,s);else if(s=Af(e,r,s,i),s!==null){var d=Ht();wr(s,e,i,d),sh(s,r,i)}}function Cv(e,r,s){var i=yn(e),d={lane:i,action:s,hasEagerState:!1,eagerState:null,next:null};if(rh(e))nh(r,d);else{var m=e.alternate;if(e.lanes===0&&(m===null||m.lanes===0)&&(m=r.lastRenderedReducer,m!==null))try{var N=r.lastRenderedState,I=m(N,s);if(d.hasEagerState=!0,d.eagerState=I,vr(I,N)){var O=r.interleaved;O===null?(d.next=d,Qo(r)):(d.next=O.next,O.next=d),r.interleaved=d;return}}catch{}finally{}s=Af(e,r,d,i),s!==null&&(d=Ht(),wr(s,e,i,d),sh(s,r,i))}}function rh(e){var r=e.alternate;return e===dt||r!==null&&r===dt}function nh(e,r){Ca=_l=!0;var s=e.pending;s===null?r.next=r:(r.next=s.next,s.next=r),e.pending=r}function sh(e,r,s){if((s&4194240)!==0){var i=r.lanes;i&=e.pendingLanes,s|=i,r.lanes=s,co(e,s)}}var Ml={readContext:cr,useCallback:Dt,useContext:Dt,useEffect:Dt,useImperativeHandle:Dt,useInsertionEffect:Dt,useLayoutEffect:Dt,useMemo:Dt,useReducer:Dt,useRef:Dt,useState:Dt,useDebugValue:Dt,useDeferredValue:Dt,useTransition:Dt,useMutableSource:Dt,useSyncExternalStore:Dt,useId:Dt,unstable_isNewReconciler:!1},kv={readContext:cr,useCallback:function(e,r){return Ir().memoizedState=[e,r===void 0?null:r],e},useContext:cr,useEffect:Yf,useImperativeHandle:function(e,r,s){return s=s!=null?s.concat([e]):null,Il(4194308,4,qf.bind(null,r,e),s)},useLayoutEffect:function(e,r){return Il(4194308,4,e,r)},useInsertionEffect:function(e,r){return Il(4,2,e,r)},useMemo:function(e,r){var s=Ir();return r=r===void 0?null:r,e=e(),s.memoizedState=[e,r],e},useReducer:function(e,r,s){var i=Ir();return r=s!==void 0?s(r):r,i.memoizedState=i.baseState=r,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:r},i.queue=e,e=e.dispatch=Sv.bind(null,dt,e),[i.memoizedState,e]},useRef:function(e){var r=Ir();return e={current:e},r.memoizedState=e},useState:Hf,useDebugValue:oc,useDeferredValue:function(e){return Ir().memoizedState=e},useTransition:function(){var e=Hf(!1),r=e[0];return e=wv.bind(null,e[1]),Ir().memoizedState=e,[r,e]},useMutableSource:function(){},useSyncExternalStore:function(e,r,s){var i=dt,d=Ir();if(lt){if(s===void 0)throw Error(l(407));s=s()}else{if(s=r(),bt===null)throw Error(l(349));(Gn&30)!==0||$f(i,r,s)}d.memoizedState=s;var m={value:s,getSnapshot:r};return d.queue=m,Yf(Uf.bind(null,i,m,e),[e]),i.flags|=2048,Pa(9,Bf.bind(null,i,m,s,r),void 0,null),s},useId:function(){var e=Ir(),r=bt.identifierPrefix;if(lt){var s=Ur,i=Br;s=(i&~(1<<32-gr(i)-1)).toString(32)+s,r=":"+r+"R"+s,s=ka++,0<\/script>",e=e.removeChild(e.firstChild)):typeof i.is=="string"?e=N.createElement(s,{is:i.is}):(e=N.createElement(s),s==="select"&&(N=e,i.multiple?N.multiple=!0:i.size&&(N.size=i.size))):e=N.createElementNS(e,s),e[Tr]=r,e[ya]=i,Sh(e,r,!1,!1),r.stateNode=e;e:{switch(N=Zi(s,i),s){case"dialog":st("cancel",e),st("close",e),d=i;break;case"iframe":case"object":case"embed":st("load",e),d=i;break;case"video":case"audio":for(d=0;dMs&&(r.flags|=128,i=!0,Ra(m,!1),r.lanes=4194304)}else{if(!i)if(e=Rl(N),e!==null){if(r.flags|=128,i=!0,s=e.updateQueue,s!==null&&(r.updateQueue=s,r.flags|=4),Ra(m,!0),m.tail===null&&m.tailMode==="hidden"&&!N.alternate&&!lt)return Lt(r),null}else 2*ht()-m.renderingStartTime>Ms&&s!==1073741824&&(r.flags|=128,i=!0,Ra(m,!1),r.lanes=4194304);m.isBackwards?(N.sibling=r.child,r.child=N):(s=m.last,s!==null?s.sibling=N:r.child=N,m.last=N)}return m.tail!==null?(r=m.tail,m.rendering=r,m.tail=r.sibling,m.renderingStartTime=ht(),r.sibling=null,s=ct.current,nt(ct,i?s&1|2:s&1),r):(Lt(r),null);case 22:case 23:return Ic(),i=r.memoizedState!==null,e!==null&&e.memoizedState!==null!==i&&(r.flags|=8192),i&&(r.mode&1)!==0?(nr&1073741824)!==0&&(Lt(r),r.subtreeFlags&6&&(r.flags|=8192)):Lt(r),null;case 24:return null;case 25:return null}throw Error(l(156,r.tag))}function Mv(e,r){switch(Bo(r),r.tag){case 1:return Qt(r.type)&&vl(),e=r.flags,e&65536?(r.flags=e&-65537|128,r):null;case 3:return Ts(),at(Gt),at(Mt),ec(),e=r.flags,(e&65536)!==0&&(e&128)===0?(r.flags=e&-65537|128,r):null;case 5:return Jo(r),null;case 13:if(at(ct),e=r.memoizedState,e!==null&&e.dehydrated!==null){if(r.alternate===null)throw Error(l(340));ks()}return e=r.flags,e&65536?(r.flags=e&-65537|128,r):null;case 19:return at(ct),null;case 4:return Ts(),null;case 10:return Yo(r.type._context),null;case 22:case 23:return Ic(),null;case 24:return null;default:return null}}var Fl=!1,Ot=!1,Dv=typeof WeakSet=="function"?WeakSet:Set,je=null;function Is(e,r){var s=e.ref;if(s!==null)if(typeof s=="function")try{s(null)}catch(i){ut(e,r,i)}else s.current=null}function jc(e,r,s){try{s()}catch(i){ut(e,r,i)}}var Eh=!1;function Lv(e,r){if(Io=sl,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 N=0,I=-1,O=-1,Y=0,ce=0,ue=e,ie=null;t:for(;;){for(var ve;ue!==s||d!==0&&ue.nodeType!==3||(I=N+d),ue!==m||i!==0&&ue.nodeType!==3||(O=N+i),ue.nodeType===3&&(N+=ue.nodeValue.length),(ve=ue.firstChild)!==null;)ie=ue,ue=ve;for(;;){if(ue===e)break t;if(ie===s&&++Y===d&&(I=N),ie===m&&++ce===i&&(O=N),(ve=ue.nextSibling)!==null)break;ue=ie,ie=ue.parentNode}ue=ve}s=I===-1||O===-1?null:{start:I,end:O}}else s=null}s=s||{start:0,end:0}}else s=null;for(Ao={focusedElem:e,selectionRange:s},sl=!1,je=r;je!==null;)if(r=je,e=r.child,(r.subtreeFlags&1028)!==0&&e!==null)e.return=r,je=e;else for(;je!==null;){r=je;try{var be=r.alternate;if((r.flags&1024)!==0)switch(r.tag){case 0:case 11:case 15:break;case 1:if(be!==null){var ke=be.memoizedProps,mt=be.memoizedState,W=r.stateNode,B=W.getSnapshotBeforeUpdate(r.elementType===r.type?ke:jr(r.type,ke),mt);W.__reactInternalSnapshotBeforeUpdate=B}break;case 3:var H=r.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){ut(r,r.return,fe)}if(e=r.sibling,e!==null){e.return=r.return,je=e;break}je=r.return}return be=Eh,Eh=!1,be}function Ta(e,r,s){var i=r.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(r,s,m)}d=d.next}while(d!==i)}}function zl(e,r){if(r=r.updateQueue,r=r!==null?r.lastEffect:null,r!==null){var s=r=r.next;do{if((s.tag&e)===e){var i=s.create;s.destroy=i()}s=s.next}while(s!==r)}}function Nc(e){var r=e.ref;if(r!==null){var s=e.stateNode;switch(e.tag){case 5:e=s;break;default:e=s}typeof r=="function"?r(e):r.current=e}}function Ph(e){var r=e.alternate;r!==null&&(e.alternate=null,Ph(r)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(r=e.stateNode,r!==null&&(delete r[Tr],delete r[ya],delete r[Oo],delete r[vv],delete r[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 Th(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,r,s){var i=e.tag;if(i===5||i===6)e=e.stateNode,r?s.nodeType===8?s.parentNode.insertBefore(e,r):s.insertBefore(e,r):(s.nodeType===8?(r=s.parentNode,r.insertBefore(e,s)):(r=s,r.appendChild(e)),s=s._reactRootContainer,s!=null||r.onclick!==null||(r.onclick=xl));else if(i!==4&&(e=e.child,e!==null))for(bc(e,r,s),e=e.sibling;e!==null;)bc(e,r,s),e=e.sibling}function wc(e,r,s){var i=e.tag;if(i===5||i===6)e=e.stateNode,r?s.insertBefore(e,r):s.appendChild(e);else if(i!==4&&(e=e.child,e!==null))for(wc(e,r,s),e=e.sibling;e!==null;)wc(e,r,s),e=e.sibling}var Tt=null,Nr=!1;function xn(e,r,s){for(s=s.child;s!==null;)_h(e,r,s),s=s.sibling}function _h(e,r,s){if(Rr&&typeof Rr.onCommitFiberUnmount=="function")try{Rr.onCommitFiberUnmount(Ja,s)}catch{}switch(s.tag){case 5:Ot||Is(s,r);case 6:var i=Tt,d=Nr;Tt=null,xn(e,r,s),Tt=i,Nr=d,Tt!==null&&(Nr?(e=Tt,s=s.stateNode,e.nodeType===8?e.parentNode.removeChild(s):e.removeChild(s)):Tt.removeChild(s.stateNode));break;case 18:Tt!==null&&(Nr?(e=Tt,s=s.stateNode,e.nodeType===8?Lo(e.parentNode,s):e.nodeType===1&&Lo(e,s),oa(e)):Lo(Tt,s.stateNode));break;case 4:i=Tt,d=Nr,Tt=s.stateNode.containerInfo,Nr=!0,xn(e,r,s),Tt=i,Nr=d;break;case 0:case 11:case 14:case 15:if(!Ot&&(i=s.updateQueue,i!==null&&(i=i.lastEffect,i!==null))){d=i=i.next;do{var m=d,N=m.destroy;m=m.tag,N!==void 0&&((m&2)!==0||(m&4)!==0)&&jc(s,r,N),d=d.next}while(d!==i)}xn(e,r,s);break;case 1:if(!Ot&&(Is(s,r),i=s.stateNode,typeof i.componentWillUnmount=="function"))try{i.props=s.memoizedProps,i.state=s.memoizedState,i.componentWillUnmount()}catch(I){ut(s,r,I)}xn(e,r,s);break;case 21:xn(e,r,s);break;case 22:s.mode&1?(Ot=(i=Ot)||s.memoizedState!==null,xn(e,r,s),Ot=i):xn(e,r,s);break;default:xn(e,r,s)}}function Ih(e){var r=e.updateQueue;if(r!==null){e.updateQueue=null;var s=e.stateNode;s===null&&(s=e.stateNode=new Dv),r.forEach(function(i){var d=Hv.bind(null,e,i);s.has(i)||(s.add(i),i.then(d,d))})}}function br(e,r){var s=r.deletions;if(s!==null)for(var i=0;id&&(d=N),i&=~m}if(i=d,i=ht()-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,vn===null)var i=!1;else{if(e=vn,vn=null,Wl=0,(Ye&6)!==0)throw Error(l(331));var d=Ye;for(Ye|=4,je=e.current;je!==null;){var m=je,N=m.child;if((je.flags&16)!==0){var I=m.deletions;if(I!==null){for(var O=0;Oht()-kc?Xn(e,0):Cc|=s),Jt(e,r)}function Hh(e,r){r===0&&((e.mode&1)===0?r=1:(r=el,el<<=1,(el&130023424)===0&&(el=4194304)));var s=Ht();e=Vr(e,r),e!==null&&(na(e,r,s),Jt(e,s))}function Wv(e){var r=e.memoizedState,s=0;r!==null&&(s=r.retryLane),Hh(e,s)}function Hv(e,r){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(r),Hh(e,s)}var Kh;Kh=function(e,r,s){if(e!==null)if(e.memoizedProps!==r.pendingProps||Gt.current)qt=!0;else{if((e.lanes&s)===0&&(r.flags&128)===0)return qt=!1,Iv(e,r,s);qt=(e.flags&131072)!==0}else qt=!1,lt&&(r.flags&1048576)!==0&&Cf(r,bl,r.index);switch(r.lanes=0,r.tag){case 2:var i=r.type;Ol(e,r),e=r.pendingProps;var d=ws(r,Mt.current);Rs(r,s),d=nc(null,r,i,e,d,s);var m=sc();return r.flags|=1,typeof d=="object"&&d!==null&&typeof d.render=="function"&&d.$$typeof===void 0?(r.tag=1,r.memoizedState=null,r.updateQueue=null,Qt(i)?(m=!0,yl(r)):m=!1,r.memoizedState=d.state!==null&&d.state!==void 0?d.state:null,qo(r),d.updater=Dl,r.stateNode=d,d._reactInternals=r,dc(r,i,e,s),r=mc(null,r,i,!0,m,s)):(r.tag=0,lt&&m&&$o(r),Wt(null,r,d,s),r=r.child),r;case 16:i=r.elementType;e:{switch(Ol(e,r),e=r.pendingProps,d=i._init,i=d(i._payload),r.type=i,d=r.tag=Yv(i),e=jr(i,e),d){case 0:r=hc(null,r,i,e,s);break e;case 1:r=vh(null,r,i,e,s);break e;case 11:r=hh(null,r,i,e,s);break e;case 14:r=mh(null,r,i,jr(i.type,e),s);break e}throw Error(l(306,i,""))}return r;case 0:return i=r.type,d=r.pendingProps,d=r.elementType===i?d:jr(i,d),hc(e,r,i,d,s);case 1:return i=r.type,d=r.pendingProps,d=r.elementType===i?d:jr(i,d),vh(e,r,i,d,s);case 3:e:{if(yh(r),e===null)throw Error(l(387));i=r.pendingProps,m=r.memoizedState,d=m.element,Mf(e,r),Pl(r,i,null,s);var N=r.memoizedState;if(i=N.element,m.isDehydrated)if(m={element:i,isDehydrated:!1,cache:N.cache,pendingSuspenseBoundaries:N.pendingSuspenseBoundaries,transitions:N.transitions},r.updateQueue.baseState=m,r.memoizedState=m,r.flags&256){d=_s(Error(l(423)),r),r=jh(e,r,i,s,d);break e}else if(i!==d){d=_s(Error(l(424)),r),r=jh(e,r,i,s,d);break e}else for(rr=dn(r.stateNode.containerInfo.firstChild),tr=r,lt=!0,yr=null,s=If(r,null,i,s),r.child=s;s;)s.flags=s.flags&-3|4096,s=s.sibling;else{if(ks(),i===d){r=Hr(e,r,s);break e}Wt(e,r,i,s)}r=r.child}return r;case 5:return Of(r),e===null&&Vo(r),i=r.type,d=r.pendingProps,m=e!==null?e.memoizedProps:null,N=d.children,Mo(i,d)?N=null:m!==null&&Mo(i,m)&&(r.flags|=32),gh(e,r),Wt(e,r,N,s),r.child;case 6:return e===null&&Vo(r),null;case 13:return Nh(e,r,s);case 4:return Xo(r,r.stateNode.containerInfo),i=r.pendingProps,e===null?r.child=Es(r,null,i,s):Wt(e,r,i,s),r.child;case 11:return i=r.type,d=r.pendingProps,d=r.elementType===i?d:jr(i,d),hh(e,r,i,d,s);case 7:return Wt(e,r,r.pendingProps,s),r.child;case 8:return Wt(e,r,r.pendingProps.children,s),r.child;case 12:return Wt(e,r,r.pendingProps.children,s),r.child;case 10:e:{if(i=r.type._context,d=r.pendingProps,m=r.memoizedProps,N=d.value,nt(Cl,i._currentValue),i._currentValue=N,m!==null)if(vr(m.value,N)){if(m.children===d.children&&!Gt.current){r=Hr(e,r,s);break e}}else for(m=r.child,m!==null&&(m.return=r);m!==null;){var I=m.dependencies;if(I!==null){N=m.child;for(var O=I.firstContext;O!==null;){if(O.context===i){if(m.tag===1){O=Wr(-1,s&-s),O.tag=2;var Y=m.updateQueue;if(Y!==null){Y=Y.shared;var ce=Y.pending;ce===null?O.next=O:(O.next=ce.next,ce.next=O),Y.pending=O}}m.lanes|=s,O=m.alternate,O!==null&&(O.lanes|=s),Go(m.return,s,r),I.lanes|=s;break}O=O.next}}else if(m.tag===10)N=m.type===r.type?null:m.child;else if(m.tag===18){if(N=m.return,N===null)throw Error(l(341));N.lanes|=s,I=N.alternate,I!==null&&(I.lanes|=s),Go(N,s,r),N=m.sibling}else N=m.child;if(N!==null)N.return=m;else for(N=m;N!==null;){if(N===r){N=null;break}if(m=N.sibling,m!==null){m.return=N.return,N=m;break}N=N.return}m=N}Wt(e,r,d.children,s),r=r.child}return r;case 9:return d=r.type,i=r.pendingProps.children,Rs(r,s),d=cr(d),i=i(d),r.flags|=1,Wt(e,r,i,s),r.child;case 14:return i=r.type,d=jr(i,r.pendingProps),d=jr(i.type,d),mh(e,r,i,d,s);case 15:return ph(e,r,r.type,r.pendingProps,s);case 17:return i=r.type,d=r.pendingProps,d=r.elementType===i?d:jr(i,d),Ol(e,r),r.tag=1,Qt(i)?(e=!0,yl(r)):e=!1,Rs(r,s),lh(r,i,d),dc(r,i,d,s),mc(null,r,i,!0,e,s);case 19:return wh(e,r,s);case 22:return xh(e,r,s)}throw Error(l(156,r.tag))};function Yh(e,r){return Cu(e,r)}function Kv(e,r,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=r,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 fr(e,r,s,i){return new Kv(e,r,s,i)}function Mc(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Yv(e){if(typeof e=="function")return Mc(e)?1:0;if(e!=null){if(e=e.$$typeof,e===oe)return 11;if(e===le)return 14}return 2}function Nn(e,r){var s=e.alternate;return s===null?(s=fr(e.tag,r,e.key,e.mode),s.elementType=e.elementType,s.type=e.type,s.stateNode=e.stateNode,s.alternate=e,e.alternate=s):(s.pendingProps=r,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,r=e.dependencies,s.dependencies=r===null?null:{lanes:r.lanes,firstContext:r.firstContext},s.sibling=e.sibling,s.index=e.index,s.ref=e.ref,s}function Gl(e,r,s,i,d,m){var N=2;if(i=e,typeof e=="function")Mc(e)&&(N=1);else if(typeof e=="string")N=5;else e:switch(e){case k:return Zn(s.children,d,m,r);case T:N=8,d|=8;break;case U:return e=fr(12,s,r,d|2),e.elementType=U,e.lanes=m,e;case he:return e=fr(13,s,r,d),e.elementType=he,e.lanes=m,e;case ne:return e=fr(19,s,r,d),e.elementType=ne,e.lanes=m,e;case $:return Ql(s,d,m,r);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case Q:N=10;break e;case te:N=9;break e;case oe:N=11;break e;case le:N=14;break e;case Z:N=16,i=null;break e}throw Error(l(130,e==null?e:typeof e,""))}return r=fr(N,s,r,d),r.elementType=e,r.type=i,r.lanes=m,r}function Zn(e,r,s,i){return e=fr(7,e,i,r),e.lanes=s,e}function Ql(e,r,s,i){return e=fr(22,e,i,r),e.elementType=$,e.lanes=s,e.stateNode={isHidden:!1},e}function Dc(e,r,s){return e=fr(6,e,null,r),e.lanes=s,e}function Lc(e,r,s){return r=fr(4,e.children!==null?e.children:[],e.key,r),r.lanes=s,r.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},r}function Gv(e,r,s,i,d){this.tag=r,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,r,s,i,d,m,N,I,O){return e=new Gv(e,r,s,I,O),r===1?(r=1,m===!0&&(r|=8)):r=0,m=fr(3,null,null,r),e.current=m,m.stateNode=e,m.memoizedState={element:i,isDehydrated:s,cache:null,transitions:null,pendingSuspenseBoundaries:null},qo(m),e}function Qv(e,r,s){var i=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(a){console.error(a)}}return n(),Vc.exports=iy(),Vc.exports}var im;function oy(){if(im)return ri;im=1;var n=dp();return ri.createRoot=n.createRoot,ri.hydrateRoot=n.hydrateRoot,ri}var cy=oy(),Wa=dp();const dy=cp(Wa);/** - * @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 Fa(){return Fa=Object.assign?Object.assign.bind():function(n){for(var a=1;a"u")throw new Error(a)}function Md(n,a){if(!n){typeof console<"u"&&console.warn(a);try{throw new Error(a)}catch{}}}function fy(){return Math.random().toString(36).substr(2,8)}function cm(n,a){return{usr:n.state,key:n.key,idx:a}}function dd(n,a,l,o){return l===void 0&&(l=null),Fa({pathname:typeof n=="string"?n:n.pathname,search:"",hash:""},typeof a=="string"?Hs(a):a,{state:l,key:a&&a.key||o||fy()})}function yi(n){let{pathname:a="/",search:l="",hash:o=""}=n;return l&&l!=="?"&&(a+=l.charAt(0)==="?"?l:"?"+l),o&&o!=="#"&&(a+=o.charAt(0)==="#"?o:"#"+o),a}function Hs(n){let a={};if(n){let l=n.indexOf("#");l>=0&&(a.hash=n.substr(l),n=n.substr(0,l));let o=n.indexOf("?");o>=0&&(a.search=n.substr(o),n=n.substr(0,o)),n&&(a.pathname=n)}return a}function hy(n,a,l,o){o===void 0&&(o={});let{window:c=document.defaultView,v5Compat:u=!1}=o,f=c.history,p=Rn.Pop,x=null,g=v();g==null&&(g=0,f.replaceState(Fa({},f.state,{idx:g}),""));function v(){return(f.state||{idx:null}).idx}function y(){p=Rn.Pop;let b=v(),S=b==null?null:b-g;g=b,x&&x({action:p,location:j.location,delta:S})}function P(b,S){p=Rn.Push;let E=dd(j.location,b,S);g=v()+1;let w=cm(E,g),M=j.createHref(E);try{f.pushState(w,"",M)}catch(D){if(D instanceof DOMException&&D.name==="DataCloneError")throw D;c.location.assign(M)}u&&x&&x({action:p,location:j.location,delta:1})}function R(b,S){p=Rn.Replace;let E=dd(j.location,b,S);g=v();let w=cm(E,g),M=j.createHref(E);f.replaceState(w,"",M),u&&x&&x({action:p,location:j.location,delta:0})}function C(b){let S=c.location.origin!=="null"?c.location.origin:c.location.href,E=typeof b=="string"?b:yi(b);return E=E.replace(/ $/,"%20"),pt(S,"No window.location.(origin|href) available to create URL for href: "+E),new URL(E,S)}let j={get action(){return p},get location(){return n(c,f)},listen(b){if(x)throw new Error("A history only accepts one active listener");return c.addEventListener(om,y),x=b,()=>{c.removeEventListener(om,y),x=null}},createHref(b){return a(c,b)},createURL:C,encodeLocation(b){let S=C(b);return{pathname:S.pathname,search:S.search,hash:S.hash}},push:P,replace:R,go(b){return f.go(b)}};return j}var dm;(function(n){n.data="data",n.deferred="deferred",n.redirect="redirect",n.error="error"})(dm||(dm={}));function my(n,a,l){return l===void 0&&(l="/"),py(n,a,l)}function py(n,a,l,o){let c=typeof a=="string"?Hs(a):a,u=Dd(c.pathname||"/",l);if(u==null)return null;let f=up(n);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("/")&&(pt(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=Tn([o,x.relativePath]),v=l.concat(x);u.children&&u.children.length>0&&(pt(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 n.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(n){let a=n.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=>n.startsWith("/")&&x===""?"/":x)}function xy(n){n.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=n=>n==="*";function wy(n,a){let l=n.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(n,a){return n.length===a.length&&n.slice(0,-1).every((o,c)=>o===a[c])?n[n.length-1]-a[a.length-1]:0}function Cy(n,a,l){let{routesMeta:o}=n,c={},u="/",f=[];for(let p=0;p{let{paramName:P,isOptional:R}=v;if(P==="*"){let j=p[y]||"";f=u.slice(0,u.length-j.length).replace(/(.)\/+$/,"$1")}const C=p[y];return R&&!C?g[P]=void 0:g[P]=(C||"").replace(/%2F/g,"/"),g},{}),pathname:u,pathnameBase:f,pattern:n}}function Ey(n,a,l){a===void 0&&(a=!1),l===void 0&&(l=!0),Md(n==="*"||!n.endsWith("*")||n.endsWith("/*"),'Route path "'+n+'" will be treated as if it were '+('"'+n.replace(/\*$/,"/*")+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+('please change the route path to "'+n.replace(/\*$/,"/*")+'".'));let o=[],c="^"+n.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(f,p,x)=>(o.push({paramName:p,isOptional:x!=null}),x?"/?([^\\/]+)?":"/([^\\/]+)"));return n.endsWith("*")?(o.push({paramName:"*"}),c+=n==="*"||n==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):l?c+="\\/*$":n!==""&&n!=="/"&&(c+="(?:(?=\\/|$))"),[new RegExp(c,a?void 0:"i"),o]}function Py(n){try{return n.split("/").map(a=>decodeURIComponent(a).replace(/\//g,"%2F")).join("/")}catch(a){return Md(!1,'The URL path "'+n+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent '+("encoding ("+a+").")),n}}function Dd(n,a){if(a==="/")return n;if(!n.toLowerCase().startsWith(a.toLowerCase()))return null;let l=a.endsWith("/")?a.length-1:a.length,o=n.charAt(l);return o&&o!=="/"?null:n.slice(l)||"/"}const Ry=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Ty=n=>Ry.test(n);function _y(n,a){a===void 0&&(a="/");let{pathname:l,search:o="",hash:c=""}=typeof n=="string"?Hs(n):n,u;if(l)if(Ty(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(n,a){let l=a.replace(/\/+$/,"").split("/");return n.split("/").forEach(c=>{c===".."?l.length>1&&l.pop():c!=="."&&l.push(c)}),l.length>1?l.join("/"):"/"}function Kc(n,a,l,o){return"Cannot include a '"+n+"' 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(n){return n.filter((a,l)=>l===0||a.route.path&&a.route.path.length>0)}function Ld(n,a){let l=Iy(n);return a?l.map((o,c)=>c===l.length-1?o.pathname:o.pathnameBase):l.map(o=>o.pathnameBase)}function Od(n,a,l,o){o===void 0&&(o=!1);let c;typeof n=="string"?c=Hs(n):(c=Fa({},n),pt(!c.pathname||!c.pathname.includes("?"),Kc("?","pathname","search",c)),pt(!c.pathname||!c.pathname.includes("#"),Kc("#","pathname","hash",c)),pt(!c.search||!c.search.includes("#"),Kc("#","search","hash",c)));let u=n===""||c.pathname==="",f=u?"/":c.pathname,p;if(f==null)p=l;else{let y=a.length-1;if(!o&&f.startsWith("..")){let P=f.split("/");for(;P[0]==="..";)P.shift(),y-=1;c.pathname=P.join("/")}p=y>=0?a[y]:"/"}let x=_y(c,p),g=f&&f!=="/"&&f.endsWith("/"),v=(u||f===".")&&l.endsWith("/");return!x.pathname.endsWith("/")&&(g||v)&&(x.pathname+="/"),x}const Tn=n=>n.join("/").replace(/\/\/+/g,"/"),Ay=n=>n.replace(/\/+$/,"").replace(/^\/*/,"/"),My=n=>!n||n==="?"?"":n.startsWith("?")?n:"?"+n,Dy=n=>!n||n==="#"?"":n.startsWith("#")?n:"#"+n;function Ly(n){return n!=null&&typeof n.status=="number"&&typeof n.statusText=="string"&&typeof n.internal=="boolean"&&"data"in n}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 za(){return za=Object.assign?Object.assign.bind():function(n){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");n==null&&a!=="/"&&(y.pathname=y.pathname==="/"?a:Tn([a,y.pathname])),(v.replace?o.replace:o.push)(y,v.state,v)},[a,o,f,u,n])}const By=h.createContext(null);function Uy(n){let a=h.useContext(Jr).outlet;return a&&h.createElement(By.Provider,{value:n},a)}function xp(n,a){let{relative:l}=a===void 0?{}:a,{future:o}=h.useContext(Ln),{matches:c}=h.useContext(Jr),{pathname:u}=us(),f=JSON.stringify(Ld(c,o.v7_relativeSplatPath));return h.useMemo(()=>Od(n,JSON.parse(f),u,l==="path"),[n,f,u,l])}function Vy(n,a){return Wy(n,a)}function Wy(n,a,l,o){Ks()||pt(!1);let{navigator:c}=h.useContext(Ln),{matches:u}=h.useContext(Jr),f=u[u.length-1],p=f?f.params:{};f&&f.pathname;let x=f?f.pathnameBase:"/";f&&f.route;let g=us(),v;if(a){var y;let b=typeof a=="string"?Hs(a):a;x==="/"||(y=b.pathname)!=null&&y.startsWith(x)||pt(!1),v=b}else v=g;let P=v.pathname||"/",R=P;if(x!=="/"){let b=x.replace(/^\//,"").split("/");R="/"+P.replace(/^\//,"").split("/").slice(b.length).join("/")}let C=my(n,{pathname:R}),j=Qy(C&&C.map(b=>Object.assign({},b,{params:Object.assign({},p,b.params),pathname:Tn([x,c.encodeLocation?c.encodeLocation(b.pathname).pathname:b.pathname]),pathnameBase:b.pathnameBase==="/"?x:Tn([x,c.encodeLocation?c.encodeLocation(b.pathnameBase).pathname:b.pathnameBase])})),u,l,o);return a&&j?h.createElement(Mi.Provider,{value:{location:za({pathname:"/",search:"",hash:"",state:null,key:"default"},v),navigationType:Rn.Pop}},j):j}function Hy(){let n=Zy(),a=Ly(n)?n.status+" "+n.statusText:n instanceof Error?n.message:JSON.stringify(n),l=n instanceof Error?n.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 Yy 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(Jr.Provider,{value:this.props.routeContext},h.createElement(mp.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function Gy(n){let{routeContext:a,match:l,children:o}=n,c=h.useContext(Fd);return c&&c.static&&c.staticContext&&(l.route.errorElement||l.route.ErrorBoundary)&&(c.staticContext._deepestRenderedBoundaryId=l.route.id),h.createElement(Jr.Provider,{value:a},o)}function Qy(n,a,l,o){var c;if(a===void 0&&(a=[]),l===void 0&&(l=null),o===void 0&&(o=null),n==null){var u;if(!l)return null;if(l.errors)n=l.matches;else if((u=o)!=null&&u.v7_partialHydration&&a.length===0&&!l.initialized&&l.matches.length>0)n=l.matches;else return null}let f=n,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||pt(!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,P)=>{let R,C=!1,j=null,b=null;l&&(R=p&&y.route.id?p[y.route.id]:void 0,j=y.route.errorElement||Ky,x&&(g<0&&P===0?(tj("route-fallback"),C=!0,b=null):g===P&&(C=!0,b=y.route.hydrateFallbackElement||null)));let S=a.concat(f.slice(0,P+1)),E=()=>{let w;return R?w=j:C?w=b:y.route.Component?w=h.createElement(y.route.Component,null):y.route.element?w=y.route.element:w=v,h.createElement(Gy,{match:y,routeContext:{outlet:v,matches:S,isDataRoute:l!=null},children:w})};return l&&(y.route.ErrorBoundary||y.route.errorElement||P===0)?h.createElement(Yy,{location:l.location,revalidation:l.revalidation,component:j,error:R,children:E(),routeContext:{outlet:null,matches:S,isDataRoute:!0}}):E()},null)}var gp=(function(n){return n.UseBlocker="useBlocker",n.UseRevalidator="useRevalidator",n.UseNavigateStable="useNavigate",n})(gp||{}),vp=(function(n){return n.UseBlocker="useBlocker",n.UseLoaderData="useLoaderData",n.UseActionData="useActionData",n.UseRouteError="useRouteError",n.UseNavigation="useNavigation",n.UseRouteLoaderData="useRouteLoaderData",n.UseMatches="useMatches",n.UseRevalidator="useRevalidator",n.UseNavigateStable="useNavigate",n.UseRouteId="useRouteId",n})(vp||{});function qy(n){let a=h.useContext(Fd);return a||pt(!1),a}function Xy(n){let a=h.useContext(Fy);return a||pt(!1),a}function Jy(n){let a=h.useContext(Jr);return a||pt(!1),a}function yp(n){let a=Jy(),l=a.matches[a.matches.length-1];return l.route.id||pt(!1),l.route.id}function Zy(){var n;let a=h.useContext(mp),l=Xy(),o=yp();return a!==void 0?a:(n=l.errors)==null?void 0:n[o]}function ej(){let{router:n}=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"?n.navigate(c):n.navigate(c,za({fromRouteId:a},u)))},[n,a])}const hm={};function tj(n,a,l){hm[n]||(hm[n]=!0)}function rj(n,a){n==null||n.v7_startTransition,n==null||n.v7_relativeSplatPath}function nj(n){let{to:a,replace:l,state:o,relative:c}=n;Ks()||pt(!1);let{future:u,static:f}=h.useContext(Ln),{matches:p}=h.useContext(Jr),{pathname:x}=us(),g=Ha(),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(n){return Uy(n.context)}function it(n){pt(!1)}function aj(n){let{basename:a="/",children:l=null,location:o,navigationType:c=Rn.Pop,navigator:u,static:f=!1,future:p}=n;Ks()&&pt(!1);let x=a.replace(/^\/*/,"/"),g=h.useMemo(()=>({basename:x,navigator:u,static:f,future:za({v7_relativeSplatPath:!1},p)}),[x,p,u,f]);typeof o=="string"&&(o=Hs(o));let{pathname:v="/",search:y="",hash:P="",state:R=null,key:C="default"}=o,j=h.useMemo(()=>{let b=Dd(v,x);return b==null?null:{location:{pathname:b,search:y,hash:P,state:R,key:C},navigationType:c}},[x,v,y,P,R,C,c]);return j==null?null:h.createElement(Ln.Provider,{value:g},h.createElement(Mi.Provider,{children:l,value:j}))}function lj(n){let{children:a,location:l}=n;return Vy(ud(a),l)}new Promise(()=>{});function ud(n,a){a===void 0&&(a=[]);let l=[];return h.Children.forEach(n,(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!==it&&pt(!1),!o.props.index||!o.props.children||pt(!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(n){for(var a=1;a=0)&&(l[c]=n[c]);return l}function oj(n){return!!(n.metaKey||n.altKey||n.ctrlKey||n.shiftKey)}function cj(n,a){return n.button===0&&(!a||a==="_self")&&!oj(n)}const dj=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","viewTransition"],uj="6";try{window.__reactRouterVersion=uj}catch{}const fj="startTransition",mm=Ai[fj];function hj(n){let{basename:a,children:l,future:o,window:c}=n,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(()=>rj(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,hi=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,P=ij(a,dj),{basename:R}=h.useContext(Ln),C,j=!1;if(typeof g=="string"&&pj.test(g)&&(C=g,mj))try{let w=new URL(window.location.href),M=g.startsWith("//")?new URL(w.protocol+g):new URL(g),D=Dd(M.pathname,R);M.origin===w.origin&&D!=null?g=D+M.search+M.hash:j=!0}catch{}let b=zy(g,{relative:c}),S=xj(g,{replace:f,state:p,target:x,preventScrollReset:v,relative:c,viewTransition:y});function E(w){o&&o(w),w.defaultPrevented||S(w)}return h.createElement("a",fd({},P,{href:C||b,onClick:j||u?o:E,ref:l,target:x}))});var pm;(function(n){n.UseScrollRestoration="useScrollRestoration",n.UseSubmit="useSubmit",n.UseSubmitFetcher="useSubmitFetcher",n.UseFetcher="useFetcher",n.useViewTransitionState="useViewTransitionState"})(pm||(pm={}));var xm;(function(n){n.UseFetcher="useFetcher",n.UseFetchers="useFetchers",n.UseScrollRestoration="useScrollRestoration"})(xm||(xm={}));function xj(n,a){let{target:l,replace:o,state:c,preventScrollReset:u,relative:f,viewTransition:p}=a===void 0?{}:a,x=Ha(),g=us(),v=xp(n,{relative:f});return h.useCallback(y=>{if(cj(y,l)){y.preventDefault();let P=o!==void 0?o:yi(g)===yi(v);x(n,{replace:P,state:c,preventScrollReset:u,relative:f,viewTransition:p})}},[g,x,v,o,c,l,n,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=n=>n.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),vj=n=>n.replace(/^([A-Z])|[\s-_]+(\w)/g,(a,l,o)=>o?o.toUpperCase():l.toLowerCase()),gm=n=>{const a=vj(n);return a.charAt(0).toUpperCase()+a.slice(1)},jp=(...n)=>n.filter((a,l,o)=>!!a&&a.trim()!==""&&o.indexOf(a)===l).join(" ").trim(),yj=n=>{for(const a in n)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:n="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:n,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 Ne=(n,a)=>{const l=h.forwardRef(({className:o,...c},u)=>h.createElement(Nj,{ref:u,iconNode:a,className:jp(`lucide-${gj(gm(n))}`,`lucide-${n}`,o),...c}));return l.displayName=gm(n),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=Ne("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"}]],Qr=Ne("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"}]],$a=Ne("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"}]],Di=Ne("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"}]],Ba=Ne("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"}]],Cn=Ne("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=Ne("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"}]],Tj=Ne("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 _j=[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]],ym=Ne("circle-check-big",_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 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=Ne("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=Ne("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=Ne("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=Ne("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=Ne("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=Ne("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=Ne("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"}]],ji=Ne("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=Ne("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"}]],Ni=Ne("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"}]],Pn=Ne("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=Ne("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 Yj=[["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"}]],Gj=Ne("funnel",Yj);/** - * @license lucide-react v0.562.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const 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=Ne("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=Ne("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=Ne("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=Ne("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 rN=[["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"}]],Yc=Ne("grip-vertical",rN);/** - * @license lucide-react v0.562.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const nN=[["path",{d:"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=Ne("history",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 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=Ne("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=Ne("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=Ne("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=Ne("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=Ne("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"}]],ts=Ne("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=Ne("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=Ne("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=Ne("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=Ne("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=Ne("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=Ne("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=Ne("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"}]],Ft=Ne("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=Ne("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=Ne("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 TN=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],zt=Ne("plus",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 _N=[["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=Ne("qr-code",_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 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"}]],tt=Ne("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"}]],Yt=Ne("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"}]],rs=Ne("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"}]],bi=Ne("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=Ne("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=Ne("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=Ne("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=Ne("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=Ne("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"}]],sr=Ne("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=Ne("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=Ne("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"}]],wi=Ne("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 YN=[["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=Ne("user-plus",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 GN=[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]],ns=Ne("user",GN);/** - * @license lucide-react v0.562.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const 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"}]],Cr=Ne("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"}]],Us=Ne("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"}]],pr=Ne("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=Ne("zap",JN),$d="admin_token";function Bd(){try{return localStorage.getItem($d)}catch{return null}}function eb(n){try{localStorage.setItem($d,n)}catch{}}function tb(){try{localStorage.removeItem($d)}catch{}}const rb="https://soulapi.quwanzhi.com",nb=()=>{const n="https://soulapi.quwanzhi.com";return n.length>0?n.replace(/\/$/,""):rb};function Vs(n){const a=nb(),l=n.startsWith("/")?n:`/${n}`;return a?`${a}${l}`:l}async function Oi(n,a={}){const{data:l,...o}=a,c=Vs(n),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 Ge(n,a){return Oi(n,{...a,method:"GET"})}function Ct(n,a,l){return Oi(n,{...l,method:"POST",data:a})}function St(n,a,l){return Oi(n,{...l,method:"PUT",data:a})}function ss(n,a){return Oi(n,{...a,method:"DELETE"})}const sb=[{icon:dN,label:"数据概览",href:"/dashboard"},{icon:Qr,label:"内容管理",href:"/content"},{icon:Cr,label:"用户管理",href:"/users"}],km=[{icon:Li,label:"VIP 角色",href:"/vip-roles"},{icon:ns,label:"作者详情",href:"/author-settings"},{icon:zd,label:"管理员",href:"/admin-users"},{icon:tN,label:"导师管理",href:"/mentors"},{icon:$a,label:"导师预约",href:"/mentor-consultations"},{icon:Us,label:"推广中心",href:"/distribution"},{icon:Jj,label:"匹配记录",href:"/match-records"},{icon:hd,label:"推广设置",href:"/referral-settings"}];function ab(){const n=us(),a=Ha(),[l,o]=h.useState(!1),[c,u]=h.useState(!1),[f,p]=h.useState(!1);h.useEffect(()=>{o(!0)},[]),h.useEffect(()=>{km.some(v=>n.pathname===v.href)&&p(!0)},[n.pathname]),h.useEffect(()=>{if(!l)return;u(!1);let g=!1;return Ge("/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 Ct("/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=n.pathname===g.href;return t.jsxs(hi,{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(Ba,{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=n.pathname===g.href;return t.jsxs(hi,{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(hi,{to:"/settings",className:`flex items-center gap-3 px-4 py-3 rounded-lg transition-colors ${n.pathname==="/settings"?"bg-[#38bdac]/20 text-[#38bdac] font-medium":"text-gray-400 hover:bg-gray-700/50 hover:text-white"}`,children:[t.jsx(bi,{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(n,a){if(typeof n=="function")return n(a);n!=null&&(n.current=a)}function Ud(...n){return a=>{let l=!1;const o=n.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 Si=="function"&&(u=Si(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=`${n}.Slot`,l}var Rp=Pp("Slot");function ob(n){const a=h.forwardRef((l,o)=>{let{children:c,...u}=l;if(Ep(c)&&typeof Si=="function"&&(c=Si(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=`${n}.SlotClone`,a}var cb=Symbol("radix.slottable");function db(n){return h.isValidElement(n)&&typeof n.type=="function"&&"__radixId"in n.type&&n.type.__radixId===cb}function ub(n,a){const l={...a};for(const o in a){const c=n[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{...n,...l}}function fb(n){var o,c;let a=(o=Object.getOwnPropertyDescriptor(n.props,"ref"))==null?void 0:o.get,l=a&&"isReactWarning"in a&&a.isReactWarning;return l?n.ref:(a=(c=Object.getOwnPropertyDescriptor(n,"ref"))==null?void 0:c.get,l=a&&"isReactWarning"in a&&a.isReactWarning,l?n.props.ref:n.props.ref||n.ref)}function Tp(n){var a,l,o="";if(typeof n=="string"||typeof n=="number")o+=n;else if(typeof n=="object")if(Array.isArray(n)){var c=n.length;for(a=0;atypeof n=="boolean"?`${n}`:n===0?"0":n,Rm=_p,Ip=(n,a)=>l=>{var o;if((a==null?void 0:a.variants)==null)return Rm(n,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 P=Pm(v)||Pm(y);return c[g][P]}),p=l&&Object.entries(l).reduce((g,v)=>{let[y,P]=v;return P===void 0||(g[y]=P),g},{}),x=a==null||(o=a.compoundVariants)===null||o===void 0?void 0:o.reduce((g,v)=>{let{class:y,className:P,...R}=v;return Object.entries(R).every(C=>{let[j,b]=C;return Array.isArray(b)?b.includes({...u,...p}[j]):{...u,...p}[j]===b})?[...g,y,P]:g},[]);return Rm(n,f,x,l==null?void 0:l.class,l==null?void 0:l.className)},hb=(n,a)=>{const l=new Array(n.length+a.length);for(let o=0;o({classGroupId:n,validator:a}),Ap=(n=new Map,a=null,l)=>({nextPart:n,validators:a,classGroupId:l}),Ci="-",Tm=[],pb="arbitrary..",xb=n=>{const a=vb(n),{conflictingClassGroups:l,conflictingClassGroupModifiers:o}=n;return{getClassGroupId:f=>{if(f.startsWith("[")&&f.endsWith("]"))return gb(f);const p=f.split(Ci),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||Tm}return l[f]||Tm}}},Mp=(n,a,l)=>{if(n.length-a===0)return l.classGroupId;const c=n[a],u=l.nextPart.get(c);if(u){const g=Mp(n,a+1,u);if(g)return g}const f=l.validators;if(f===null)return;const p=a===0?n.join(Ci):n.slice(a).join(Ci),x=f.length;for(let g=0;gn.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const a=n.slice(1,-1),l=a.indexOf(":"),o=a.slice(0,l);return o?pb+o:void 0})(),vb=n=>{const{theme:a,classGroups:l}=n;return yb(l,a)},yb=(n,a)=>{const l=Ap();for(const o in n){const c=n[o];Vd(c,l,o,a)}return l},Vd=(n,a,l,o)=>{const c=n.length;for(let u=0;u{if(typeof n=="string"){Nb(n,a,l);return}if(typeof n=="function"){bb(n,a,l,o);return}wb(n,a,l,o)},Nb=(n,a,l)=>{const o=n===""?a:Dp(a,n);o.classGroupId=l},bb=(n,a,l,o)=>{if(Sb(n)){Vd(n(o),a,l,o);return}a.validators===null&&(a.validators=[]),a.validators.push(mb(l,n))},wb=(n,a,l,o)=>{const c=Object.entries(n),u=c.length;for(let f=0;f{let l=n;const o=a.split(Ci),c=o.length;for(let u=0;u"isThemeGetter"in n&&n.isThemeGetter===!0,Cb=n=>{if(n<1)return{get:()=>{},set:()=>{}};let a=0,l=Object.create(null),o=Object.create(null);const c=(u,f)=>{l[u]=f,a++,a>n&&(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="!",_m=":",kb=[],Im=(n,a,l,o,c)=>({modifiers:n,hasImportantModifier:a,baseClassName:l,maybePostfixModifierPosition:o,isExternal:c}),Eb=n=>{const{prefix:a,experimentalParseClassName:l}=n;let o=c=>{const u=[];let f=0,p=0,x=0,g;const v=c.length;for(let j=0;jx?g-x:void 0;return Im(u,R,P,C)};if(a){const c=a+_m,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=n=>{const a=new Map;return n.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=n=>({cache:Cb(n.cacheSize),parseClassName:Eb(n),sortModifiers:Pb(n),...xb(n)}),Tb=/\s+/,_b=(n,a)=>{const{parseClassName:l,getClassGroupId:o,getConflictingClassGroupIds:c,sortModifiers:u}=a,f=[],p=n.trim().split(Tb);let x="";for(let g=p.length-1;g>=0;g-=1){const v=p[g],{isExternal:y,modifiers:P,hasImportantModifier:R,baseClassName:C,maybePostfixModifierPosition:j}=l(v);if(y){x=v+(x.length>0?" "+x:x);continue}let b=!!j,S=o(b?C.substring(0,j):C);if(!S){if(!b){x=v+(x.length>0?" "+x:x);continue}if(S=o(C),!S){x=v+(x.length>0?" "+x:x);continue}b=!1}const E=P.length===0?"":P.length===1?P[0]:u(P).join(":"),w=R?E+vd:E,M=w+S;if(f.indexOf(M)>-1)continue;f.push(M);const D=c(S,b);for(let V=0;V0?" "+x:x)}return x},Ib=(...n)=>{let a=0,l,o,c="";for(;a{if(typeof n=="string")return n;let a,l="";for(let o=0;o{let l,o,c,u;const f=x=>{const g=a.reduce((v,y)=>y(v),n());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=_b(x,l);return c(x,v),v};return u=f,(...x)=>u(Ib(...x))},Mb=[],jt=n=>{const a=l=>l[n]||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)\(.+\)$/,Ls=n=>Db.test(n),Be=n=>!!n&&!Number.isNaN(Number(n)),wn=n=>!!n&&Number.isInteger(Number(n)),Gc=n=>n.endsWith("%")&&Be(n.slice(0,-1)),Yr=n=>Lb.test(n),Bb=()=>!0,Ub=n=>Ob.test(n)&&!Fb.test(n),zp=()=>!1,Vb=n=>zb.test(n),Wb=n=>$b.test(n),Hb=n=>!we(n)&&!Se(n),Kb=n=>Ys(n,Up,zp),we=n=>Op.test(n),es=n=>Ys(n,Vp,Ub),Qc=n=>Ys(n,Xb,Be),Am=n=>Ys(n,$p,zp),Yb=n=>Ys(n,Bp,Wb),si=n=>Ys(n,Wp,Vb),Se=n=>Fp.test(n),La=n=>Gs(n,Vp),Gb=n=>Gs(n,Jb),Mm=n=>Gs(n,$p),Qb=n=>Gs(n,Up),qb=n=>Gs(n,Bp),ai=n=>Gs(n,Wp,!0),Ys=(n,a,l)=>{const o=Op.exec(n);return o?o[1]?a(o[1]):l(o[2]):!1},Gs=(n,a,l=!1)=>{const o=Fp.exec(n);return o?o[1]?a(o[1]):l:!1},$p=n=>n==="position"||n==="percentage",Bp=n=>n==="image"||n==="url",Up=n=>n==="length"||n==="size"||n==="bg-size",Vp=n=>n==="length",Xb=n=>n==="number",Jb=n=>n==="family-name",Wp=n=>n==="shadow",Zb=()=>{const n=jt("color"),a=jt("font"),l=jt("text"),o=jt("font-weight"),c=jt("tracking"),u=jt("leading"),f=jt("breakpoint"),p=jt("container"),x=jt("spacing"),g=jt("radius"),v=jt("shadow"),y=jt("inset-shadow"),P=jt("text-shadow"),R=jt("drop-shadow"),C=jt("blur"),j=jt("perspective"),b=jt("aspect"),S=jt("ease"),E=jt("animate"),w=()=>["auto","avoid","all","avoid-page","page","left","right","column"],M=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],D=()=>[...M(),Se,we],V=()=>["auto","hidden","clip","visible","scroll"],k=()=>["auto","contain","none"],T=()=>[Se,we,x],U=()=>[Ls,"full","auto",...T()],Q=()=>[wn,"none","subgrid",Se,we],te=()=>["auto",{span:["full",wn,Se,we]},wn,Se,we],oe=()=>[wn,"auto",Se,we],he=()=>["auto","min","max","fr",Se,we],ne=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],le=()=>["start","end","center","stretch","center-safe","end-safe"],Z=()=>["auto",...T()],$=()=>[Ls,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...T()],_=()=>[n,Se,we],q=()=>[...M(),Mm,Am,{position:[Se,we]}],z=()=>["no-repeat",{repeat:["","x","y","space","round"]}],A=()=>["auto","cover","contain",Qb,Kb,{size:[Se,we]}],F=()=>[Gc,La,es],G=()=>["","none","full",g,Se,we],J=()=>["",Be,La,es],xe=()=>["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"],re=()=>[Be,Gc,Mm,Am],ye=()=>["","none",C,Se,we],L=()=>["none",Be,Se,we],de=()=>["none",Be,Se,we],ge=()=>[Be,Se,we],_e=()=>[Ls,"full",...T()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[Yr],breakpoint:[Yr],color:[Bb],container:[Yr],"drop-shadow":[Yr],ease:["in","out","in-out"],font:[Hb],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[Yr],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[Yr],shadow:[Yr],spacing:["px",Be],text:[Yr],"text-shadow":[Yr],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",Ls,we,Se,b]}],container:["container"],columns:[{columns:[Be,we,Se,p]}],"break-after":[{"break-after":w()}],"break-before":[{"break-before":w()}],"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:D()}],overflow:[{overflow:V()}],"overflow-x":[{"overflow-x":V()}],"overflow-y":[{"overflow-y":V()}],overscroll:[{overscroll:k()}],"overscroll-x":[{"overscroll-x":k()}],"overscroll-y":[{"overscroll-y":k()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:U()}],"inset-x":[{"inset-x":U()}],"inset-y":[{"inset-y":U()}],start:[{start:U()}],end:[{end:U()}],top:[{top:U()}],right:[{right:U()}],bottom:[{bottom:U()}],left:[{left:U()}],visibility:["visible","invisible","collapse"],z:[{z:[wn,"auto",Se,we]}],basis:[{basis:[Ls,"full","auto",p,...T()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[Be,Ls,"auto","initial","none",we]}],grow:[{grow:["",Be,Se,we]}],shrink:[{shrink:["",Be,Se,we]}],order:[{order:[wn,"first","last","none",Se,we]}],"grid-cols":[{"grid-cols":Q()}],"col-start-end":[{col:te()}],"col-start":[{"col-start":oe()}],"col-end":[{"col-end":oe()}],"grid-rows":[{"grid-rows":Q()}],"row-start-end":[{row:te()}],"row-start":[{"row-start":oe()}],"row-end":[{"row-end":oe()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":he()}],"auto-rows":[{"auto-rows":he()}],gap:[{gap:T()}],"gap-x":[{"gap-x":T()}],"gap-y":[{"gap-y":T()}],"justify-content":[{justify:[...ne(),"normal"]}],"justify-items":[{"justify-items":[...le(),"normal"]}],"justify-self":[{"justify-self":["auto",...le()]}],"align-content":[{content:["normal",...ne()]}],"align-items":[{items:[...le(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...le(),{baseline:["","last"]}]}],"place-content":[{"place-content":ne()}],"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:Z()}],mx:[{mx:Z()}],my:[{my:Z()}],ms:[{ms:Z()}],me:[{me:Z()}],mt:[{mt:Z()}],mr:[{mr:Z()}],mb:[{mb:Z()}],ml:[{ml:Z()}],"space-x":[{"space-x":T()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":T()}],"space-y-reverse":["space-y-reverse"],size:[{size:$()}],w:[{w:[p,"screen",...$()]}],"min-w":[{"min-w":[p,"screen","none",...$()]}],"max-w":[{"max-w":[p,"screen","none","prose",{screen:[f]},...$()]}],h:[{h:["screen","lh",...$()]}],"min-h":[{"min-h":["screen","lh","none",...$()]}],"max-h":[{"max-h":["screen","lh",...$()]}],"font-size":[{text:["base",l,La,es]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[o,Se,Qc]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",Gc,we]}],"font-family":[{font:[Gb,we,a]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[c,Se,we]}],"line-clamp":[{"line-clamp":[Be,"none",Se,Qc]}],leading:[{leading:[u,...T()]}],"list-image":[{"list-image":["none",Se,we]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",Se,we]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:_()}],"text-color":[{text:_()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...xe(),"wavy"]}],"text-decoration-thickness":[{decoration:[Be,"from-font","auto",Se,es]}],"text-decoration-color":[{decoration:_()}],"underline-offset":[{"underline-offset":[Be,"auto",Se,we]}],"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",Se,we]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",Se,we]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:q()}],"bg-repeat":[{bg:z()}],"bg-size":[{bg:A()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},wn,Se,we],radial:["",Se,we],conic:[wn,Se,we]},qb,Yb]}],"bg-color":[{bg:_()}],"gradient-from-pos":[{from:F()}],"gradient-via-pos":[{via:F()}],"gradient-to-pos":[{to:F()}],"gradient-from":[{from:_()}],"gradient-via":[{via:_()}],"gradient-to":[{to:_()}],rounded:[{rounded:G()}],"rounded-s":[{"rounded-s":G()}],"rounded-e":[{"rounded-e":G()}],"rounded-t":[{"rounded-t":G()}],"rounded-r":[{"rounded-r":G()}],"rounded-b":[{"rounded-b":G()}],"rounded-l":[{"rounded-l":G()}],"rounded-ss":[{"rounded-ss":G()}],"rounded-se":[{"rounded-se":G()}],"rounded-ee":[{"rounded-ee":G()}],"rounded-es":[{"rounded-es":G()}],"rounded-tl":[{"rounded-tl":G()}],"rounded-tr":[{"rounded-tr":G()}],"rounded-br":[{"rounded-br":G()}],"rounded-bl":[{"rounded-bl":G()}],"border-w":[{border:J()}],"border-w-x":[{"border-x":J()}],"border-w-y":[{"border-y":J()}],"border-w-s":[{"border-s":J()}],"border-w-e":[{"border-e":J()}],"border-w-t":[{"border-t":J()}],"border-w-r":[{"border-r":J()}],"border-w-b":[{"border-b":J()}],"border-w-l":[{"border-l":J()}],"divide-x":[{"divide-x":J()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":J()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...xe(),"hidden","none"]}],"divide-style":[{divide:[...xe(),"hidden","none"]}],"border-color":[{border:_()}],"border-color-x":[{"border-x":_()}],"border-color-y":[{"border-y":_()}],"border-color-s":[{"border-s":_()}],"border-color-e":[{"border-e":_()}],"border-color-t":[{"border-t":_()}],"border-color-r":[{"border-r":_()}],"border-color-b":[{"border-b":_()}],"border-color-l":[{"border-l":_()}],"divide-color":[{divide:_()}],"outline-style":[{outline:[...xe(),"none","hidden"]}],"outline-offset":[{"outline-offset":[Be,Se,we]}],"outline-w":[{outline:["",Be,La,es]}],"outline-color":[{outline:_()}],shadow:[{shadow:["","none",v,ai,si]}],"shadow-color":[{shadow:_()}],"inset-shadow":[{"inset-shadow":["none",y,ai,si]}],"inset-shadow-color":[{"inset-shadow":_()}],"ring-w":[{ring:J()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:_()}],"ring-offset-w":[{"ring-offset":[Be,es]}],"ring-offset-color":[{"ring-offset":_()}],"inset-ring-w":[{"inset-ring":J()}],"inset-ring-color":[{"inset-ring":_()}],"text-shadow":[{"text-shadow":["none",P,ai,si]}],"text-shadow-color":[{"text-shadow":_()}],opacity:[{opacity:[Be,Se,we]}],"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":[Be]}],"mask-image-linear-from-pos":[{"mask-linear-from":re()}],"mask-image-linear-to-pos":[{"mask-linear-to":re()}],"mask-image-linear-from-color":[{"mask-linear-from":_()}],"mask-image-linear-to-color":[{"mask-linear-to":_()}],"mask-image-t-from-pos":[{"mask-t-from":re()}],"mask-image-t-to-pos":[{"mask-t-to":re()}],"mask-image-t-from-color":[{"mask-t-from":_()}],"mask-image-t-to-color":[{"mask-t-to":_()}],"mask-image-r-from-pos":[{"mask-r-from":re()}],"mask-image-r-to-pos":[{"mask-r-to":re()}],"mask-image-r-from-color":[{"mask-r-from":_()}],"mask-image-r-to-color":[{"mask-r-to":_()}],"mask-image-b-from-pos":[{"mask-b-from":re()}],"mask-image-b-to-pos":[{"mask-b-to":re()}],"mask-image-b-from-color":[{"mask-b-from":_()}],"mask-image-b-to-color":[{"mask-b-to":_()}],"mask-image-l-from-pos":[{"mask-l-from":re()}],"mask-image-l-to-pos":[{"mask-l-to":re()}],"mask-image-l-from-color":[{"mask-l-from":_()}],"mask-image-l-to-color":[{"mask-l-to":_()}],"mask-image-x-from-pos":[{"mask-x-from":re()}],"mask-image-x-to-pos":[{"mask-x-to":re()}],"mask-image-x-from-color":[{"mask-x-from":_()}],"mask-image-x-to-color":[{"mask-x-to":_()}],"mask-image-y-from-pos":[{"mask-y-from":re()}],"mask-image-y-to-pos":[{"mask-y-to":re()}],"mask-image-y-from-color":[{"mask-y-from":_()}],"mask-image-y-to-color":[{"mask-y-to":_()}],"mask-image-radial":[{"mask-radial":[Se,we]}],"mask-image-radial-from-pos":[{"mask-radial-from":re()}],"mask-image-radial-to-pos":[{"mask-radial-to":re()}],"mask-image-radial-from-color":[{"mask-radial-from":_()}],"mask-image-radial-to-color":[{"mask-radial-to":_()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":M()}],"mask-image-conic-pos":[{"mask-conic":[Be]}],"mask-image-conic-from-pos":[{"mask-conic-from":re()}],"mask-image-conic-to-pos":[{"mask-conic-to":re()}],"mask-image-conic-from-color":[{"mask-conic-from":_()}],"mask-image-conic-to-color":[{"mask-conic-to":_()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:q()}],"mask-repeat":[{mask:z()}],"mask-size":[{mask:A()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",Se,we]}],filter:[{filter:["","none",Se,we]}],blur:[{blur:ye()}],brightness:[{brightness:[Be,Se,we]}],contrast:[{contrast:[Be,Se,we]}],"drop-shadow":[{"drop-shadow":["","none",R,ai,si]}],"drop-shadow-color":[{"drop-shadow":_()}],grayscale:[{grayscale:["",Be,Se,we]}],"hue-rotate":[{"hue-rotate":[Be,Se,we]}],invert:[{invert:["",Be,Se,we]}],saturate:[{saturate:[Be,Se,we]}],sepia:[{sepia:["",Be,Se,we]}],"backdrop-filter":[{"backdrop-filter":["","none",Se,we]}],"backdrop-blur":[{"backdrop-blur":ye()}],"backdrop-brightness":[{"backdrop-brightness":[Be,Se,we]}],"backdrop-contrast":[{"backdrop-contrast":[Be,Se,we]}],"backdrop-grayscale":[{"backdrop-grayscale":["",Be,Se,we]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[Be,Se,we]}],"backdrop-invert":[{"backdrop-invert":["",Be,Se,we]}],"backdrop-opacity":[{"backdrop-opacity":[Be,Se,we]}],"backdrop-saturate":[{"backdrop-saturate":[Be,Se,we]}],"backdrop-sepia":[{"backdrop-sepia":["",Be,Se,we]}],"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",Se,we]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[Be,"initial",Se,we]}],ease:[{ease:["linear","initial",S,Se,we]}],delay:[{delay:[Be,Se,we]}],animate:[{animate:["none",E,Se,we]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[j,Se,we]}],"perspective-origin":[{"perspective-origin":D()}],rotate:[{rotate:L()}],"rotate-x":[{"rotate-x":L()}],"rotate-y":[{"rotate-y":L()}],"rotate-z":[{"rotate-z":L()}],scale:[{scale:de()}],"scale-x":[{"scale-x":de()}],"scale-y":[{"scale-y":de()}],"scale-z":[{"scale-z":de()}],"scale-3d":["scale-3d"],skew:[{skew:ge()}],"skew-x":[{"skew-x":ge()}],"skew-y":[{"skew-y":ge()}],transform:[{transform:[Se,we,"","none","gpu","cpu"]}],"transform-origin":[{origin:D()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:_e()}],"translate-x":[{"translate-x":_e()}],"translate-y":[{"translate-y":_e()}],"translate-z":[{"translate-z":_e()}],"translate-none":["translate-none"],accent:[{accent:_()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:_()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",Se,we]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":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",Se,we]}],fill:[{fill:["none",..._()]}],"stroke-w":[{stroke:[Be,La,es,Qc]}],stroke:[{stroke:["none",..._()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},ew=Ab(Zb);function Je(...n){return ew(_p(n))}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 ee({className:n,variant:a,size:l,asChild:o=!1,...c}){const u=o?Rp:"button";return t.jsx(u,{"data-slot":"button",className:Je(tw({variant:a,size:l,className:n})),...c})}function ae({className:n,type:a,...l}){return t.jsx("input",{type:a,"data-slot":"input",className:Je("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",n),...l})}function rw(){const n=Ha(),[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 Ct("/api/admin",{username:a.trim(),password:o});if((v==null?void 0:v.success)!==!1&&(v!=null&&v.token)){eb(v.token),n("/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(ns,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-5 h-5 text-gray-500"}),t.jsx(ae,{type:"text",value:a,onChange:v=>l(v.target.value),placeholder:"请输入用户名",className:"pl-10 bg-[#0a1628] border-gray-700 text-white placeholder:text-gray-500 focus:border-[#38bdac]"})]})]}),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(ae,{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(ee,{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 Pe=h.forwardRef(({className:n,...a},l)=>t.jsx("div",{ref:l,className:Je("rounded-xl border bg-card text-card-foreground shadow",n),...a}));Pe.displayName="Card";const We=h.forwardRef(({className:n,...a},l)=>t.jsx("div",{ref:l,className:Je("flex flex-col space-y-1.5 p-6",n),...a}));We.displayName="CardHeader";const He=h.forwardRef(({className:n,...a},l)=>t.jsx("h3",{ref:l,className:Je("font-semibold leading-none tracking-tight",n),...a}));He.displayName="CardTitle";const ft=h.forwardRef(({className:n,...a},l)=>t.jsx("p",{ref:l,className:Je("text-sm text-muted-foreground",n),...a}));ft.displayName="CardDescription";const Re=h.forwardRef(({className:n,...a},l)=>t.jsx("div",{ref:l,className:Je("p-6 pt-0",n),...a}));Re.displayName="CardContent";const nw=h.forwardRef(({className:n,...a},l)=>t.jsx("div",{ref:l,className:Je("flex items-center p-6 pt-0",n),...a}));nw.displayName="CardFooter";function sw(){const n=Ha(),[a,l]=h.useState(!0),[o,c]=h.useState([]),[u,f]=h.useState([]);async function p(){l(!0);try{const[C,j]=await Promise.all([Ge("/api/db/users"),Ge("/api/orders")]);C!=null&&C.success&&C.users&&c(C.users),j!=null&&j.success&&j.orders&&f(j.orders)}catch(C){console.error("加载数据失败",C)}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(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,j)=>C+Number(j.amount||0),0),v=o.length,y=u.length,P=C=>{const j=C.productType||"",b=C.description||"";if(b){if(j==="section"&&b.includes("章节")){if(b.includes("-")){const S=b.split("-");if(S.length>=3)return{title:`第${S[1]}章 第${S[2]}节`,subtitle:"《一场Soul的创业实验》"}}return{title:b,subtitle:"章节购买"}}return j==="fullbook"||b.includes("全书")?{title:"《一场Soul的创业实验》",subtitle:"全书购买"}:j==="match"||b.includes("伙伴")?{title:"找伙伴匹配",subtitle:"功能服务"}:{title:b,subtitle:j==="section"?"单章":j==="fullbook"?"全书":"其他"}}return j==="section"?{title:`章节 ${C.productId||""}`,subtitle:"单章购买"}:j==="fullbook"?{title:"《一场Soul的创业实验》",subtitle:"全书购买"}:j==="match"?{title:"找伙伴匹配",subtitle:"功能服务"}:{title:"未知商品",subtitle:j||"其他"}},R=[{title:"总用户数",value:v,icon:Cr,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:Qr,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:R.map((C,j)=>t.jsxs(Pe,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl cursor-pointer hover:border-[#38bdac]/50 transition-colors group",onClick:()=>C.link&&n(C.link),children:[t.jsxs(We,{className:"flex flex-row items-center justify-between pb-2",children:[t.jsx(He,{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(Re,{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(Cn,{className:"w-5 h-5 text-gray-600 group-hover:text-[#38bdac] transition-colors"})]})})]},j))}),t.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-8",children:[t.jsxs(Pe,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:[t.jsx(We,{children:t.jsx(He,{className:"text-white",children:"最近订单"})}),t.jsx(Re,{children:t.jsxs("div",{className:"space-y-3",children:[u.slice(-5).reverse().map(C=>{var w;const j=C.referrerId?o.find(M=>M.id===C.referrerId):void 0,b=C.referralCode||(j==null?void 0:j.referralCode)||(j==null?void 0:j.nickname)||(C.referrerId?String(C.referrerId).slice(0,8):""),S=P(C),E=C.userNickname||((w=o.find(M=>M.id===C.userId))==null?void 0:w.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:E,className:"w-9 h-9 rounded-full object-cover flex-shrink-0 mt-0.5",onError:M=>{M.currentTarget.style.display="none";const D=M.currentTarget.nextElementSibling;D&&D.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:E.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:E}),t.jsx("span",{className:"text-gray-600",children:"·"}),t.jsx("span",{className:"text-sm font-medium text-white truncate",children:S.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:S.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(pd,{className:"w-12 h-12 text-gray-600 mx-auto mb-3"}),t.jsx("p",{className:"text-gray-500",children:"暂无订单数据"})]})]})})]}),t.jsxs(Pe,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:[t.jsx(We,{children:t.jsx(He,{className:"text-white",children:"新注册用户"})}),t.jsx(Re,{children:t.jsxs("div",{className:"space-y-3",children:[o.slice(-5).reverse().map(C=>{var j;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:((j=C.nickname)==null?void 0:j.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 Zr=h.forwardRef(({className:n,...a},l)=>t.jsx("div",{className:"relative w-full overflow-auto",children:t.jsx("table",{ref:l,className:Je("w-full caption-bottom text-sm",n),...a})}));Zr.displayName="Table";const en=h.forwardRef(({className:n,...a},l)=>t.jsx("thead",{ref:l,className:Je("[&_tr]:border-b",n),...a}));en.displayName="TableHeader";const tn=h.forwardRef(({className:n,...a},l)=>t.jsx("tbody",{ref:l,className:Je("[&_tr:last-child]:border-0",n),...a}));tn.displayName="TableBody";const ot=h.forwardRef(({className:n,...a},l)=>t.jsx("tr",{ref:l,className:Je("border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted",n),...a}));ot.displayName="TableRow";const Te=h.forwardRef(({className:n,...a},l)=>t.jsx("th",{ref:l,className:Je("h-12 px-4 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0",n),...a}));Te.displayName="TableHead";const Ce=h.forwardRef(({className:n,...a},l)=>t.jsx("td",{ref:l,className:Je("p-4 align-middle [&:has([role=checkbox])]:pr-0",n),...a}));Ce.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 $e({className:n,variant:a,asChild:l=!1,...o}){const c=l?Rp:"span";return t.jsx(c,{className:Je(aw({variant:a}),n),...o})}function Fe(n,a,{checkForDefaultPrevented:l=!0}={}){return function(c){if(n==null||n(c),l===!1||!c.defaultPrevented)return a==null?void 0:a(c)}}function lw(n,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=n+"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 \`${n}\``)}return[o,c]}function On(n,a=[]){let l=[];function o(u,f){const p=h.createContext(f),x=l.length;l=[...l,f];const g=y=>{var S;const{scope:P,children:R,...C}=y,j=((S=P==null?void 0:P[n])==null?void 0:S[x])||p,b=h.useMemo(()=>C,Object.values(C));return t.jsx(j.Provider,{value:b,children:R})};g.displayName=u+"Provider";function v(y,P){var j;const R=((j=P==null?void 0:P[n])==null?void 0:j[x])||p,C=h.useContext(R);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=>h.createContext(f));return function(p){const x=(p==null?void 0:p[n])||u;return h.useMemo(()=>({[`__scope${n}`]:{...p,[n]:x}}),[p,x])}};return c.scopeName=n,[o,iw(c,...a)]}function iw(...n){const a=n[0];if(n.length===1)return a;const l=()=>{const o=n.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 Vt=globalThis!=null&&globalThis.document?h.useLayoutEffect:()=>{},ow=Ai[" useId ".trim().toString()]||(()=>{}),cw=0;function _n(n){const[a,l]=h.useState(ow());return Vt(()=>{l(o=>o??String(cw++))},[n]),a?`radix-${a}`:""}var dw=Ai[" useInsertionEffect ".trim().toString()]||Vt;function ls({prop:n,defaultProp:a,onChange:l=()=>{},caller:o}){const[c,u,f]=uw({defaultProp:a,onChange:l}),p=n!==void 0,x=p?n:c;{const v=h.useRef(n!==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 P=fw(v)?v(n):v;P!==n&&((y=f.current)==null||y.call(f,P))}else u(v)},[p,n,u,f]);return[x,g]}function uw({defaultProp:n,onChange:a}){const[l,o]=h.useState(n),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(n){return typeof n=="function"}function Ua(n){const a=hw(n),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=`${n}.Slot`,l}function hw(n){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=`${n}.SlotClone`,a}var mw=Symbol("radix.slottable");function pw(n){return h.isValidElement(n)&&typeof n.type=="function"&&"__radixId"in n.type&&n.type.__radixId===mw}function xw(n,a){const l={...a};for(const o in a){const c=n[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{...n,...l}}function gw(n){var o,c;let a=(o=Object.getOwnPropertyDescriptor(n.props,"ref"))==null?void 0:o.get,l=a&&"isReactWarning"in a&&a.isReactWarning;return l?n.ref:(a=(c=Object.getOwnPropertyDescriptor(n,"ref"))==null?void 0:c.get,l=a&&"isReactWarning"in a&&a.isReactWarning,l?n.props.ref:n.props.ref||n.ref)}var vw=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Ue=vw.reduce((n,a)=>{const l=Ua(`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}`,{...n,[a]:o}},{});function yw(n,a){n&&Wa.flushSync(()=>n.dispatchEvent(a))}function An(n){const a=h.useRef(n);return h.useEffect(()=>{a.current=n}),h.useMemo(()=>(...l)=>{var o;return(o=a.current)==null?void 0:o.call(a,...l)},[])}function jw(n,a=globalThis==null?void 0:globalThis.document){const l=An(n);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((n,a)=>{const{disableOutsidePointerEvents:l=!1,onEscapeKeyDown:o,onPointerDownOutside:c,onFocusOutside:u,onInteractOutside:f,onDismiss:p,...x}=n,g=h.useContext(Hp),[v,y]=h.useState(null),P=(v==null?void 0:v.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,R]=h.useState({}),C=Xe(a,k=>y(k)),j=Array.from(g.layers),[b]=[...g.layersWithOutsidePointerEventsDisabled].slice(-1),S=j.indexOf(b),E=v?j.indexOf(v):-1,w=g.layersWithOutsidePointerEventsDisabled.size>0,M=E>=S,D=kw(k=>{const T=k.target,U=[...g.branches].some(Q=>Q.contains(T));!M||U||(c==null||c(k),f==null||f(k),k.defaultPrevented||p==null||p())},P),V=Ew(k=>{const T=k.target;[...g.branches].some(Q=>Q.contains(T))||(u==null||u(k),f==null||f(k),k.defaultPrevented||p==null||p())},P);return jw(k=>{E===g.layers.size-1&&(o==null||o(k),!k.defaultPrevented&&p&&(k.preventDefault(),p()))},P),h.useEffect(()=>{if(v)return l&&(g.layersWithOutsidePointerEventsDisabled.size===0&&(Dm=P.body.style.pointerEvents,P.body.style.pointerEvents="none"),g.layersWithOutsidePointerEventsDisabled.add(v)),g.layers.add(v),Lm(),()=>{l&&g.layersWithOutsidePointerEventsDisabled.size===1&&(P.body.style.pointerEvents=Dm)}},[v,P,l,g]),h.useEffect(()=>()=>{v&&(g.layers.delete(v),g.layersWithOutsidePointerEventsDisabled.delete(v),Lm())},[v,g]),h.useEffect(()=>{const k=()=>R({});return document.addEventListener(yd,k),()=>document.removeEventListener(yd,k)},[]),t.jsx(Ue.div,{...x,ref:C,style:{pointerEvents:w?M?"auto":"none":void 0,...n.style},onFocusCapture:Fe(n.onFocusCapture,V.onFocusCapture),onBlurCapture:Fe(n.onBlurCapture,V.onBlurCapture),onPointerDownCapture:Fe(n.onPointerDownCapture,D.onPointerDownCapture)})});Wd.displayName=Nw;var Sw="DismissableLayerBranch",Cw=h.forwardRef((n,a)=>{const l=h.useContext(Hp),o=h.useRef(null),c=Xe(a,o);return h.useEffect(()=>{const u=o.current;if(u)return l.branches.add(u),()=>{l.branches.delete(u)}},[l.branches]),t.jsx(Ue.div,{...n,ref:c})});Cw.displayName=Sw;function kw(n,a=globalThis==null?void 0:globalThis.document){const l=An(n),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(n,a=globalThis==null?void 0:globalThis.document){const l=An(n),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 n=new CustomEvent(yd);document.dispatchEvent(n)}function Kp(n,a,l,{discrete:o}){const c=l.originalEvent.target,u=new CustomEvent(n,{bubbles:!1,cancelable:!0,detail:l});a&&c.addEventListener(n,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((n,a)=>{const{loop:l=!1,trapped:o=!1,onMountAutoFocus:c,onUnmountAutoFocus:u,...f}=n,[p,x]=h.useState(null),g=An(c),v=An(u),y=h.useRef(null),P=Xe(a,j=>x(j)),R=h.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;h.useEffect(()=>{if(o){let j=function(w){if(R.paused||!p)return;const M=w.target;p.contains(M)?y.current=M:kn(y.current,{select:!0})},b=function(w){if(R.paused||!p)return;const M=w.relatedTarget;M!==null&&(p.contains(M)||kn(y.current,{select:!0}))},S=function(w){if(document.activeElement===document.body)for(const D of w)D.removedNodes.length>0&&kn(p)};document.addEventListener("focusin",j),document.addEventListener("focusout",b);const E=new MutationObserver(S);return p&&E.observe(p,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",j),document.removeEventListener("focusout",b),E.disconnect()}}},[o,p,R.paused]),h.useEffect(()=>{if(p){zm.add(R);const j=document.activeElement;if(!p.contains(j)){const S=new CustomEvent(qc,Om);p.addEventListener(qc,g),p.dispatchEvent(S),S.defaultPrevented||(Rw(Mw(Yp(p)),{select:!0}),document.activeElement===j&&kn(p))}return()=>{p.removeEventListener(qc,g),setTimeout(()=>{const S=new CustomEvent(Xc,Om);p.addEventListener(Xc,v),p.dispatchEvent(S),S.defaultPrevented||kn(j??document.body,{select:!0}),p.removeEventListener(Xc,v),zm.remove(R)},0)}}},[p,g,v,R]);const C=h.useCallback(j=>{if(!l&&!o||R.paused)return;const b=j.key==="Tab"&&!j.altKey&&!j.ctrlKey&&!j.metaKey,S=document.activeElement;if(b&&S){const E=j.currentTarget,[w,M]=Tw(E);w&&M?!j.shiftKey&&S===M?(j.preventDefault(),l&&kn(w,{select:!0})):j.shiftKey&&S===w&&(j.preventDefault(),l&&kn(M,{select:!0})):S===E&&j.preventDefault()}},[l,o,R.paused]);return t.jsx(Ue.div,{tabIndex:-1,...f,ref:P,onKeyDown:C})});Hd.displayName=Pw;function Rw(n,{select:a=!1}={}){const l=document.activeElement;for(const o of n)if(kn(o,{select:a}),document.activeElement!==l)return}function Tw(n){const a=Yp(n),l=Fm(a,n),o=Fm(a.reverse(),n);return[l,o]}function Yp(n){const a=[],l=document.createTreeWalker(n,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(n,a){for(const l of n)if(!_w(l,{upTo:a}))return l}function _w(n,{upTo:a}){if(getComputedStyle(n).visibility==="hidden")return!0;for(;n;){if(a!==void 0&&n===a)return!1;if(getComputedStyle(n).display==="none")return!0;n=n.parentElement}return!1}function Iw(n){return n instanceof HTMLInputElement&&"select"in n}function kn(n,{select:a=!1}={}){if(n&&n.focus){const l=document.activeElement;n.focus({preventScroll:!0}),n!==l&&Iw(n)&&a&&n.select()}}var zm=Aw();function Aw(){let n=[];return{add(a){const l=n[0];a!==l&&(l==null||l.pause()),n=$m(n,a),n.unshift(a)},remove(a){var l;n=$m(n,a),(l=n[0])==null||l.resume()}}}function $m(n,a){const l=[...n],o=l.indexOf(a);return o!==-1&&l.splice(o,1),l}function Mw(n){return n.filter(a=>a.tagName!=="A")}var Dw="Portal",Kd=h.forwardRef((n,a)=>{var p;const{container:l,...o}=n,[c,u]=h.useState(!1);Vt(()=>u(!0),[]);const f=l||c&&((p=globalThis==null?void 0:globalThis.document)==null?void 0:p.body);return f?dy.createPortal(t.jsx(Ue.div,{...o,ref:a}),f):null});Kd.displayName=Dw;function Lw(n,a){return h.useReducer((l,o)=>a[l][o]??l,n)}var Ka=n=>{const{present:a,children:l}=n,o=Ow(a),c=typeof l=="function"?l({present:o.isPresent}):h.Children.only(l),u=Xe(o.ref,Fw(c));return typeof l=="function"||o.isPresent?h.cloneElement(c,{ref:u}):null};Ka.displayName="Presence";function Ow(n){const[a,l]=h.useState(),o=h.useRef(null),c=h.useRef(n),u=h.useRef("none"),f=n?"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=li(o.current);u.current=p==="mounted"?g:"none"},[p]),Vt(()=>{const g=o.current,v=c.current;if(v!==n){const P=u.current,R=li(g);n?x("MOUNT"):R==="none"||(g==null?void 0:g.display)==="none"?x("UNMOUNT"):x(v&&P!==R?"ANIMATION_OUT":"UNMOUNT"),c.current=n}},[n,x]),Vt(()=>{if(a){let g;const v=a.ownerDocument.defaultView??window,y=R=>{const j=li(o.current).includes(CSS.escape(R.animationName));if(R.target===a&&j&&(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)})}},P=R=>{R.target===a&&(u.current=li(o.current))};return a.addEventListener("animationstart",P),a.addEventListener("animationcancel",y),a.addEventListener("animationend",y),()=>{v.clearTimeout(g),a.removeEventListener("animationstart",P),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 li(n){return(n==null?void 0:n.animationName)||"none"}function Fw(n){var o,c;let a=(o=Object.getOwnPropertyDescriptor(n.props,"ref"))==null?void 0:o.get,l=a&&"isReactWarning"in a&&a.isReactWarning;return l?n.ref:(a=(c=Object.getOwnPropertyDescriptor(n,"ref"))==null?void 0:c.get,l=a&&"isReactWarning"in a&&a.isReactWarning,l?n.props.ref:n.props.ref||n.ref)}var Jc=0;function Gp(){h.useEffect(()=>{const n=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",n[0]??Bm()),document.body.insertAdjacentElement("beforeend",n[1]??Bm()),Jc++,()=>{Jc===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(a=>a.remove()),Jc--}},[])}function Bm(){const n=document.createElement("span");return n.setAttribute("data-radix-focus-guard",""),n.tabIndex=0,n.style.outline="none",n.style.opacity="0",n.style.position="fixed",n.style.pointerEvents="none",n}var Mr=function(){return Mr=Object.assign||function(a){for(var l,o=1,c=arguments.length;o"u")return t1;var a=r1(n),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(),$s="data-scroll-locked",a1=function(n,a,l,o){var c=n.left,u=n.top,f=n.right,p=n.gap;return l===void 0&&(l="margin"),` - .`.concat($w,` { - overflow: hidden `).concat(o,`; - padding-right: `).concat(p,"px ").concat(o,`; - } - body[`).concat($s,`] { - 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(mi,` { - right: `).concat(p,"px ").concat(o,`; - } - - .`).concat(pi,` { - margin-right: `).concat(p,"px ").concat(o,`; - } - - .`).concat(mi," .").concat(mi,` { - right: 0 `).concat(o,`; - } - - .`).concat(pi," .").concat(pi,` { - margin-right: 0 `).concat(o,`; - } - - body[`).concat($s,`] { - `).concat(Bw,": ").concat(p,`px; - } -`)},Vm=function(){var n=parseInt(document.body.getAttribute($s)||"0",10);return isFinite(n)?n:0},l1=function(){h.useEffect(function(){return document.body.setAttribute($s,(Vm()+1).toString()),function(){var n=Vm()-1;n<=0?document.body.removeAttribute($s):document.body.setAttribute($s,n.toString())}},[])},i1=function(n){var a=n.noRelative,l=n.noImportant,o=n.gapMode,c=o===void 0?"margin":o;l1();var u=h.useMemo(function(){return n1(c)},[c]);return h.createElement(s1,{styles:a1(u,!a,c,l?"":"!important")})},jd=!1;if(typeof window<"u")try{var ii=Object.defineProperty({},"passive",{get:function(){return jd=!0,!0}});window.addEventListener("test",ii,ii),window.removeEventListener("test",ii,ii)}catch{jd=!1}var Os=jd?{passive:!1}:!1,o1=function(n){return n.tagName==="TEXTAREA"},Zp=function(n,a){if(!(n instanceof Element))return!1;var l=window.getComputedStyle(n);return l[a]!=="hidden"&&!(l.overflowY===l.overflowX&&!o1(n)&&l[a]==="visible")},c1=function(n){return Zp(n,"overflowY")},d1=function(n){return Zp(n,"overflowX")},Wm=function(n,a){var l=a.ownerDocument,o=a;do{typeof ShadowRoot<"u"&&o instanceof ShadowRoot&&(o=o.host);var c=ex(n,o);if(c){var u=tx(n,o),f=u[1],p=u[2];if(f>p)return!0}o=o.parentNode}while(o&&o!==l.body);return!1},u1=function(n){var a=n.scrollTop,l=n.scrollHeight,o=n.clientHeight;return[a,l,o]},f1=function(n){var a=n.scrollLeft,l=n.scrollWidth,o=n.clientWidth;return[a,l,o]},ex=function(n,a){return n==="v"?c1(a):d1(a)},tx=function(n,a){return n==="v"?u1(a):f1(a)},h1=function(n,a){return n==="h"&&a==="rtl"?-1:1},m1=function(n,a,l,o,c){var u=h1(n,window.getComputedStyle(a).direction),f=u*o,p=l.target,x=a.contains(p),g=!1,v=f>0,y=0,P=0;do{if(!p)break;var R=tx(n,p),C=R[0],j=R[1],b=R[2],S=j-b-u*C;(C||S)&&ex(n,p)&&(y+=S,P+=C);var E=p.parentNode;p=E&&E.nodeType===Node.DOCUMENT_FRAGMENT_NODE?E.host:E}while(!x&&p!==document.body||x&&(a.contains(p)||a===p));return(v&&Math.abs(y)<1||!v&&Math.abs(P)<1)&&(g=!0),g},oi=function(n){return"changedTouches"in n?[n.changedTouches[0].clientX,n.changedTouches[0].clientY]:[0,0]},Hm=function(n){return[n.deltaX,n.deltaY]},Km=function(n){return n&&"current"in n?n.current:n},p1=function(n,a){return n[0]===a[0]&&n[1]===a[1]},x1=function(n){return` - .block-interactivity-`.concat(n,` {pointer-events: none;} - .allow-interactivity-`).concat(n,` {pointer-events: all;} -`)},g1=0,Fs=[];function v1(n){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(n);h.useEffect(function(){f.current=n},[n]),h.useEffect(function(){if(n.inert){document.body.classList.add("block-interactivity-".concat(c));var j=zw([n.lockRef.current],(n.shards||[]).map(Km),!0).filter(Boolean);return j.forEach(function(b){return b.classList.add("allow-interactivity-".concat(c))}),function(){document.body.classList.remove("block-interactivity-".concat(c)),j.forEach(function(b){return b.classList.remove("allow-interactivity-".concat(c))})}}},[n.inert,n.lockRef.current,n.shards]);var p=h.useCallback(function(j,b){if("touches"in j&&j.touches.length===2||j.type==="wheel"&&j.ctrlKey)return!f.current.allowPinchZoom;var S=oi(j),E=l.current,w="deltaX"in j?j.deltaX:E[0]-S[0],M="deltaY"in j?j.deltaY:E[1]-S[1],D,V=j.target,k=Math.abs(w)>Math.abs(M)?"h":"v";if("touches"in j&&k==="h"&&V.type==="range")return!1;var T=window.getSelection(),U=T&&T.anchorNode,Q=U?U===V||U.contains(V):!1;if(Q)return!1;var te=Wm(k,V);if(!te)return!0;if(te?D=k:(D=k==="v"?"h":"v",te=Wm(k,V)),!te)return!1;if(!o.current&&"changedTouches"in j&&(w||M)&&(o.current=D),!D)return!0;var oe=o.current||D;return m1(oe,b,j,oe==="h"?w:M)},[]),x=h.useCallback(function(j){var b=j;if(!(!Fs.length||Fs[Fs.length-1]!==u)){var S="deltaY"in b?Hm(b):oi(b),E=a.current.filter(function(D){return D.name===b.type&&(D.target===b.target||b.target===D.shadowParent)&&p1(D.delta,S)})[0];if(E&&E.should){b.cancelable&&b.preventDefault();return}if(!E){var w=(f.current.shards||[]).map(Km).filter(Boolean).filter(function(D){return D.contains(b.target)}),M=w.length>0?p(b,w[0]):!f.current.noIsolation;M&&b.cancelable&&b.preventDefault()}}},[]),g=h.useCallback(function(j,b,S,E){var w={name:j,delta:b,target:S,should:E,shadowParent:y1(S)};a.current.push(w),setTimeout(function(){a.current=a.current.filter(function(M){return M!==w})},1)},[]),v=h.useCallback(function(j){l.current=oi(j),o.current=void 0},[]),y=h.useCallback(function(j){g(j.type,Hm(j),j.target,p(j,n.lockRef.current))},[]),P=h.useCallback(function(j){g(j.type,oi(j),j.target,p(j,n.lockRef.current))},[]);h.useEffect(function(){return Fs.push(u),n.setCallbacks({onScrollCapture:y,onWheelCapture:y,onTouchMoveCapture:P}),document.addEventListener("wheel",x,Os),document.addEventListener("touchmove",x,Os),document.addEventListener("touchstart",v,Os),function(){Fs=Fs.filter(function(j){return j!==u}),document.removeEventListener("wheel",x,Os),document.removeEventListener("touchmove",x,Os),document.removeEventListener("touchstart",v,Os)}},[]);var R=n.removeScrollBar,C=n.inert;return h.createElement(h.Fragment,null,C?h.createElement(u,{styles:x1(c)}):null,R?h.createElement(i1,{noRelative:n.noRelative,gapMode:n.gapMode}):null)}function y1(n){for(var a=null;n!==null;)n instanceof ShadowRoot&&(a=n.host,n=n.host),n=n.parentNode;return a}const j1=Gw(Xp,v1);var Yd=h.forwardRef(function(n,a){return h.createElement(Fi,Mr({},n,{ref:a,sideCar:j1}))});Yd.classNames=Fi.classNames;var N1=function(n){if(typeof document>"u")return null;var a=Array.isArray(n)?n[0]:n;return a.ownerDocument.body},zs=new WeakMap,ci=new WeakMap,di={},rd=0,rx=function(n){return n&&(n.host||rx(n.parentNode))},b1=function(n,a){return a.map(function(l){if(n.contains(l))return l;var o=rx(l);return o&&n.contains(o)?o:(console.error("aria-hidden",l,"in not contained inside",n,". Doing nothing"),null)}).filter(function(l){return!!l})},w1=function(n,a,l,o){var c=b1(a,Array.isArray(n)?n:[n]);di[l]||(di[l]=new WeakMap);var u=di[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(P){if(p.has(P))v(P);else try{var R=P.getAttribute(o),C=R!==null&&R!=="false",j=(zs.get(P)||0)+1,b=(u.get(P)||0)+1;zs.set(P,j),u.set(P,b),f.push(P),j===1&&C&&ci.set(P,!0),b===1&&P.setAttribute(l,"true"),C||P.setAttribute(o,"true")}catch(S){console.error("aria-hidden: cannot operate on ",P,S)}})};return v(a),p.clear(),rd++,function(){f.forEach(function(y){var P=zs.get(y)-1,R=u.get(y)-1;zs.set(y,P),u.set(y,R),P||(ci.has(y)||y.removeAttribute(o),ci.delete(y)),R||y.removeAttribute(l)}),rd--,rd||(zs=new WeakMap,zs=new WeakMap,ci=new WeakMap,di={})}},nx=function(n,a,l){l===void 0&&(l="data-aria-hidden");var o=Array.from(Array.isArray(n)?n:[n]),c=N1(n);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]=On(zi),[S1,Pr]=sx(zi),ax=n=>{const{__scopeDialog:a,children:l,open:o,defaultOpen:c,onOpenChange:u,modal:f=!0}=n,p=h.useRef(null),x=h.useRef(null),[g,v]=ls({prop:o,defaultProp:c??!1,onChange:u,caller:zi});return t.jsx(S1,{scope:a,triggerRef:p,contentRef:x,contentId:_n(),titleId:_n(),descriptionId:_n(),open:g,onOpenChange:v,onOpenToggle:h.useCallback(()=>v(y=>!y),[v]),modal:f,children:l})};ax.displayName=zi;var lx="DialogTrigger",C1=h.forwardRef((n,a)=>{const{__scopeDialog:l,...o}=n,c=Pr(lx,l),u=Xe(a,c.triggerRef);return t.jsx(Ue.button,{type:"button","aria-haspopup":"dialog","aria-expanded":c.open,"aria-controls":c.contentId,"data-state":qd(c.open),...o,ref:u,onClick:Fe(n.onClick,c.onOpenToggle)})});C1.displayName=lx;var Gd="DialogPortal",[k1,ix]=sx(Gd,{forceMount:void 0}),ox=n=>{const{__scopeDialog:a,forceMount:l,children:o,container:c}=n,u=Pr(Gd,a);return t.jsx(k1,{scope:a,forceMount:l,children:h.Children.map(o,f=>t.jsx(Ka,{present:l||u.open,children:t.jsx(Kd,{asChild:!0,container:c,children:f})}))})};ox.displayName=Gd;var ki="DialogOverlay",cx=h.forwardRef((n,a)=>{const l=ix(ki,n.__scopeDialog),{forceMount:o=l.forceMount,...c}=n,u=Pr(ki,n.__scopeDialog);return u.modal?t.jsx(Ka,{present:o||u.open,children:t.jsx(P1,{...c,ref:a})}):null});cx.displayName=ki;var E1=Ua("DialogOverlay.RemoveScroll"),P1=h.forwardRef((n,a)=>{const{__scopeDialog:l,...o}=n,c=Pr(ki,l);return t.jsx(Yd,{as:E1,allowPinchZoom:!0,shards:[c.contentRef],children:t.jsx(Ue.div,{"data-state":qd(c.open),...o,ref:a,style:{pointerEvents:"auto",...o.style}})})}),is="DialogContent",dx=h.forwardRef((n,a)=>{const l=ix(is,n.__scopeDialog),{forceMount:o=l.forceMount,...c}=n,u=Pr(is,n.__scopeDialog);return t.jsx(Ka,{present:o||u.open,children:u.modal?t.jsx(R1,{...c,ref:a}):t.jsx(T1,{...c,ref:a})})});dx.displayName=is;var R1=h.forwardRef((n,a)=>{const l=Pr(is,n.__scopeDialog),o=h.useRef(null),c=Xe(a,l.contentRef,o);return h.useEffect(()=>{const u=o.current;if(u)return nx(u)},[]),t.jsx(ux,{...n,ref:c,trapFocus:l.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Fe(n.onCloseAutoFocus,u=>{var f;u.preventDefault(),(f=l.triggerRef.current)==null||f.focus()}),onPointerDownOutside:Fe(n.onPointerDownOutside,u=>{const f=u.detail.originalEvent,p=f.button===0&&f.ctrlKey===!0;(f.button===2||p)&&u.preventDefault()}),onFocusOutside:Fe(n.onFocusOutside,u=>u.preventDefault())})}),T1=h.forwardRef((n,a)=>{const l=Pr(is,n.__scopeDialog),o=h.useRef(!1),c=h.useRef(!1);return t.jsx(ux,{...n,ref:a,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:u=>{var f,p;(f=n.onCloseAutoFocus)==null||f.call(n,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=n.onInteractOutside)==null||x.call(n,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((n,a)=>{const{__scopeDialog:l,trapFocus:o,onOpenAutoFocus:c,onCloseAutoFocus:u,...f}=n,p=Pr(is,l),x=h.useRef(null),g=Xe(a,x);return Gp(),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(_1,{titleId:p.titleId}),t.jsx(A1,{contentRef:x,descriptionId:p.descriptionId})]})]})}),Qd="DialogTitle",fx=h.forwardRef((n,a)=>{const{__scopeDialog:l,...o}=n,c=Pr(Qd,l);return t.jsx(Ue.h2,{id:c.titleId,...o,ref:a})});fx.displayName=Qd;var hx="DialogDescription",mx=h.forwardRef((n,a)=>{const{__scopeDialog:l,...o}=n,c=Pr(hx,l);return t.jsx(Ue.p,{id:c.descriptionId,...o,ref:a})});mx.displayName=hx;var px="DialogClose",xx=h.forwardRef((n,a)=>{const{__scopeDialog:l,...o}=n,c=Pr(px,l);return t.jsx(Ue.button,{type:"button",...o,ref:a,onClick:Fe(n.onClick,()=>c.onOpenChange(!1))})});xx.displayName=px;function qd(n){return n?"open":"closed"}var gx="DialogTitleWarning",[g4,vx]=lw(gx,{contentName:is,titleName:Qd,docsSlug:"dialog"}),_1=({titleId:n})=>{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(()=>{n&&(document.getElementById(n)||console.error(l))},[l,n]),null},I1="DialogDescriptionWarning",A1=({contentRef:n,descriptionId:a})=>{const o=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${vx(I1).contentName}}.`;return h.useEffect(()=>{var u;const c=(u=n.current)==null?void 0:u.getAttribute("aria-describedby");a&&c&&(document.getElementById(a)||console.warn(o))},[o,n,a]),null},M1=ax,D1=ox,L1=cx,O1=dx,F1=fx,z1=mx,$1=xx;function $t(n){return t.jsx(M1,{"data-slot":"dialog",...n})}function B1(n){return t.jsx(D1,{...n})}const yx=h.forwardRef(({className:n,...a},l)=>t.jsx(L1,{ref:l,className:Je("fixed inset-0 z-50 bg-black/50",n),...a}));yx.displayName="DialogOverlay";const It=h.forwardRef(({className:n,children:a,showCloseButton:l=!0,...o},c)=>t.jsxs(B1,{children:[t.jsx(yx,{}),t.jsxs(O1,{ref:c,"aria-describedby":void 0,className:Je("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",n),...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(pr,{className:"h-4 w-4"}),t.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));It.displayName="DialogContent";function Bt({className:n,...a}){return t.jsx("div",{className:Je("flex flex-col gap-2 text-center sm:text-left",n),...a})}function Kt({className:n,...a}){return t.jsx("div",{className:Je("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",n),...a})}function Ut(n){return t.jsx(F1,{className:"text-lg font-semibold leading-none",...n})}function U1(n){return t.jsx(z1,{className:"text-sm text-muted-foreground",...n})}function Xd(n,a){const[l,o]=h.useState(n);return h.useEffect(()=>{const c=setTimeout(()=>o(n),a);return()=>clearTimeout(c)},[n,a]),l}function In({page:n,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:n<=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(n-1),disabled:n<=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:[n," / ",a]}),t.jsx("button",{type:"button",onClick:()=>c(n+1),disabled:n>=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:n>=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[n,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),[P,R]=h.useState(10),[C,j]=h.useState(""),b=Xd(C,300),[S,E]=h.useState("all"),[w,M]=h.useState(!0),[D,V]=h.useState(null),[k,T]=h.useState(null),[U,Q]=h.useState(""),[te,oe]=h.useState(!1);async function he(){M(!0),V(null);try{const z=S==="all"?"":S==="completed"?"completed":S,A=new URLSearchParams({page:String(v),pageSize:String(P),...z&&{status:z},...b&&{search:b}}),[F,G]=await Promise.all([Ge(`/api/orders?${A}`),Ge("/api/db/users?page=1&pageSize=500")]);F!=null&&F.success&&(a(F.orders||[]),u(F.total??0),p(F.totalRevenue??0),g(F.todayRevenue??0)),G!=null&&G.success&&G.users&&o(G.users)}catch(z){console.error("加载订单失败",z),V("加载订单失败,请检查网络后重试")}finally{M(!1)}}h.useEffect(()=>{y(1)},[b,S]),h.useEffect(()=>{he()},[v,P,b,S]);const ne=z=>{var A;return z.userNickname||((A=l.find(F=>F.id===z.userId))==null?void 0:A.nickname)||"匿名用户"},le=z=>{var A;return((A=l.find(F=>F.id===z))==null?void 0:A.phone)||"-"},Z=z=>{const A=z.productType||z.type||"",F=z.description||"";if(F){if(A==="section"&&F.includes("章节")){if(F.includes("-")){const G=F.split("-");if(G.length>=3)return{name:`第${G[1]}章 第${G[2]}节`,type:"《一场Soul的创业实验》"}}return{name:F,type:"章节购买"}}return A==="fullbook"||F.includes("全书")?{name:"《一场Soul的创业实验》",type:"全书购买"}:A==="vip"||F.includes("VIP")?{name:"VIP年度会员",type:"VIP"}:A==="match"||F.includes("伙伴")?{name:"找伙伴匹配",type:"功能服务"}:{name:F,type:"其他"}}return A==="section"?{name:`章节 ${z.productId||z.sectionId||""}`,type:"单章"}:A==="fullbook"?{name:"《一场Soul的创业实验》",type:"全书"}:A==="vip"?{name:"VIP年度会员",type:"VIP"}:A==="match"?{name:"找伙伴匹配",type:"功能"}:{name:"未知商品",type:A||"其他"}},$=Math.ceil(c/P)||1;async function _(){var z;if(!(!(k!=null&&k.orderSn)&&!(k!=null&&k.id))){oe(!0),V(null);try{const A=await St("/api/admin/orders/refund",{orderSn:k.orderSn||k.id,reason:U||void 0});A!=null&&A.success?(T(null),Q(""),he()):V((A==null?void 0:A.error)||"退款失败")}catch(A){const F=A;V(((z=F==null?void 0:F.data)==null?void 0:z.error)||"退款失败,请检查网络后重试")}finally{oe(!1)}}}function q(){if(n.length===0){alert("暂无数据可导出");return}const z=["订单号","用户","手机号","商品","金额","支付方式","状态","退款原因","分销佣金","下单时间"],A=n.map(me=>{const re=Z(me);return[me.orderSn||me.id||"",ne(me),le(me.userId),re.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(",")}),F="\uFEFF"+[z.join(","),...A].join(` -`),G=new Blob([F],{type:"text/csv;charset=utf-8"}),J=URL.createObjectURL(G),xe=document.createElement("a");xe.href=J,xe.download=`订单列表_${new Date().toISOString().slice(0,10)}.csv`,xe.click(),URL.revokeObjectURL(J)}return t.jsxs("div",{className:"p-8 w-full",children:[D&&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:D}),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:["共 ",n.length," 笔订单"]})]}),t.jsxs("div",{className:"flex items-center gap-4",children:[t.jsxs(ee,{variant:"outline",onClick:he,disabled:w,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 ${w?"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(rs,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-gray-500"}),t.jsx(ae,{type:"text",placeholder:"搜索订单号/用户/章节...",className:"pl-10 bg-[#0f2137] border-gray-700 text-white placeholder:text-gray-500",value:C,onChange:z=>j(z.target.value)})]}),t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx(Gj,{className:"w-4 h-4 text-gray-400"}),t.jsxs("select",{value:S,onChange:z=>E(z.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(ee,{variant:"outline",onClick:q,disabled:n.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(Pe,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:t.jsx(Re,{className:"p-0",children:w?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(Zr,{children:[t.jsx(en,{children:t.jsxs(ot,{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(tn,{children:[n.map(z=>{const A=Z(z);return t.jsxs(ot,{className:"hover:bg-[#0a1628] border-gray-700/50",children:[t.jsxs(Ce,{className:"font-mono text-xs text-gray-400",children:[(z.orderSn||z.id||"").slice(0,12),"..."]}),t.jsx(Ce,{children:t.jsxs("div",{children:[t.jsx("p",{className:"text-white text-sm",children:ne(z)}),t.jsx("p",{className:"text-gray-500 text-xs",children:le(z.userId)})]})}),t.jsx(Ce,{children:t.jsxs("div",{children:[t.jsxs("p",{className:"text-white text-sm flex items-center gap-2",children:[A.name,(z.productType||z.type)==="vip"&&t.jsx($e,{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:A.type})]})}),t.jsxs(Ce,{className:"text-[#38bdac] font-bold",children:["¥",Number(z.amount||0).toFixed(2)]}),t.jsx(Ce,{className:"text-gray-300",children:z.paymentMethod==="wechat"?"微信支付":z.paymentMethod==="alipay"?"支付宝":z.paymentMethod||"微信支付"}),t.jsx(Ce,{children:z.status==="refunded"?t.jsx($e,{className:"bg-gray-500/20 text-gray-400 hover:bg-gray-500/20 border-0",children:"已退款"}):z.status==="paid"||z.status==="completed"?t.jsx($e,{className:"bg-green-500/20 text-green-400 hover:bg-green-500/20 border-0",children:"已完成"}):z.status==="pending"||z.status==="created"?t.jsx($e,{className:"bg-yellow-500/20 text-yellow-400 hover:bg-yellow-500/20 border-0",children:"待支付"}):t.jsx($e,{className:"bg-red-500/20 text-red-400 hover:bg-red-500/20 border-0",children:"已失败"})}),t.jsx(Ce,{className:"text-gray-400 text-sm max-w-[120px] truncate",title:z.refundReason,children:z.status==="refunded"&&z.refundReason?z.refundReason:"-"}),t.jsx(Ce,{className:"text-[#FFD700]",children:z.referrerEarnings?`¥${Number(z.referrerEarnings).toFixed(2)}`:"-"}),t.jsx(Ce,{className:"text-gray-400 text-sm",children:new Date(z.createdAt).toLocaleString("zh-CN")}),t.jsx(Ce,{children:(z.status==="paid"||z.status==="completed")&&t.jsxs(ee,{variant:"outline",size:"sm",className:"border-orange-500/50 text-orange-400 hover:bg-orange-500/20",onClick:()=>{T(z),Q("")},children:[t.jsx(kp,{className:"w-3 h-3 mr-1"}),"退款"]})})]},z.id)}),n.length===0&&t.jsx(ot,{children:t.jsx(Ce,{colSpan:10,className:"text-center py-12 text-gray-500",children:"暂无订单数据"})})]})]}),t.jsx(In,{page:v,totalPages:$,total:c,pageSize:P,onPageChange:y,onPageSizeChange:z=>{R(z),y(1)}})]})})}),t.jsx($t,{open:!!k,onOpenChange:z=>!z&&T(null),children:t.jsxs(It,{className:"bg-[#0f2137] border-gray-700 text-white max-w-md",children:[t.jsx(Bt,{children:t.jsx(Ut,{className:"text-white",children:"订单退款"})}),k&&t.jsxs("div",{className:"space-y-4",children:[t.jsxs("p",{className:"text-gray-400 text-sm",children:["订单号:",k.orderSn||k.id]}),t.jsxs("p",{className:"text-gray-400 text-sm",children:["退款金额:¥",Number(k.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(ae,{className:"bg-[#0a1628] border-gray-700 text-white placeholder:text-gray-500",placeholder:"如:用户申请退款",value:U,onChange:z=>Q(z.target.value)})})]}),t.jsx("p",{className:"text-orange-400/80 text-xs",children:"退款将原路退回至用户微信,且无法撤销,请确认后再操作。"})]}),t.jsxs(Kt,{children:[t.jsx(ee,{variant:"outline",className:"border-gray-600 text-gray-300",onClick:()=>T(null),disabled:te,children:"取消"}),t.jsx(ee,{className:"bg-orange-500 hover:bg-orange-600 text-white",onClick:_,disabled:te,children:te?"退款中...":"确认退款"})]})]})})]})}var W1=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],H1=W1.reduce((n,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}`,{...n,[a]:o}},{}),K1="Label",jx=h.forwardRef((n,a)=>t.jsx(H1.label,{...n,ref:a,onMouseDown:l=>{var c;l.target.closest("button, input, select, textarea")||((c=n.onMouseDown)==null||c.call(n,l),!l.defaultPrevented&&l.detail>1&&l.preventDefault())}}));jx.displayName=K1;var Nx=jx;const X=h.forwardRef(({className:n,...a},l)=>t.jsx(Nx,{ref:l,className:Je("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",n),...a}));X.displayName=Nx.displayName;function Jd(n){const a=h.useRef({value:n,previous:n});return h.useMemo(()=>(a.current.value!==n&&(a.current.previous=a.current.value,a.current.value=n),a.current.previous),[n])}function Zd(n){const[a,l]=h.useState(void 0);return Vt(()=>{if(n){l({width:n.offsetWidth,height:n.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=n.offsetWidth,p=n.offsetHeight;l({width:f,height:p})});return o.observe(n,{box:"border-box"}),()=>o.unobserve(n)}else l(void 0)},[n]),a}var $i="Switch",[Y1]=On($i),[G1,Q1]=Y1($i),bx=h.forwardRef((n,a)=>{const{__scopeSwitch:l,name:o,checked:c,defaultChecked:u,required:f,disabled:p,value:x="on",onCheckedChange:g,form:v,...y}=n,[P,R]=h.useState(null),C=Xe(a,w=>R(w)),j=h.useRef(!1),b=P?v||!!P.closest("form"):!0,[S,E]=ls({prop:c,defaultProp:u??!1,onChange:g,caller:$i});return t.jsxs(G1,{scope:l,checked:S,disabled:p,children:[t.jsx(Ue.button,{type:"button",role:"switch","aria-checked":S,"aria-required":f,"data-state":kx(S),"data-disabled":p?"":void 0,disabled:p,value:x,...y,ref:C,onClick:Fe(n.onClick,w=>{E(M=>!M),b&&(j.current=w.isPropagationStopped(),j.current||w.stopPropagation())})}),b&&t.jsx(Cx,{control:P,bubbles:!j.current,name:o,value:x,checked:S,required:f,disabled:p,form:v,style:{transform:"translateX(-100%)"}})]})});bx.displayName=$i;var wx="SwitchThumb",Sx=h.forwardRef((n,a)=>{const{__scopeSwitch:l,...o}=n,c=Q1(wx,l);return t.jsx(Ue.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:n,control:a,checked:l,bubbles:o=!0,...c},u)=>{const f=h.useRef(null),p=Xe(f,u),x=Jd(l),g=Zd(a);return h.useEffect(()=>{const v=f.current;if(!v)return;const y=window.HTMLInputElement.prototype,R=Object.getOwnPropertyDescriptor(y,"checked").set;if(x!==l&&R){const C=new Event("click",{bubbles:o});R.call(v,l),v.dispatchEvent(C)}},[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(n){return n?"checked":"unchecked"}var Ex=bx,X1=Sx;const gt=h.forwardRef(({className:n,...a},l)=>t.jsx(Ex,{className:Je("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]",n),...a,ref:l,children:t.jsx(X1,{className:Je("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")})}));gt.displayName=Ex.displayName;function eu(n){const a=n+"CollectionProvider",[l,o]=On(a),[c,u]=l(a,{collectionRef:{current:null},itemMap:new Map}),f=j=>{const{scope:b,children:S}=j,E=Sn.useRef(null),w=Sn.useRef(new Map).current;return t.jsx(c,{scope:b,itemMap:w,collectionRef:E,children:S})};f.displayName=a;const p=n+"CollectionSlot",x=Ua(p),g=Sn.forwardRef((j,b)=>{const{scope:S,children:E}=j,w=u(p,S),M=Xe(b,w.collectionRef);return t.jsx(x,{ref:M,children:E})});g.displayName=p;const v=n+"CollectionItemSlot",y="data-radix-collection-item",P=Ua(v),R=Sn.forwardRef((j,b)=>{const{scope:S,children:E,...w}=j,M=Sn.useRef(null),D=Xe(b,M),V=u(v,S);return Sn.useEffect(()=>(V.itemMap.set(M,{ref:M,...w}),()=>void V.itemMap.delete(M))),t.jsx(P,{[y]:"",ref:D,children:E})});R.displayName=v;function C(j){const b=u(n+"CollectionConsumer",j);return Sn.useCallback(()=>{const E=b.collectionRef.current;if(!E)return[];const w=Array.from(E.querySelectorAll(`[${y}]`));return Array.from(b.itemMap.values()).sort((V,k)=>w.indexOf(V.ref.current)-w.indexOf(k.ref.current))},[b.collectionRef,b.itemMap])}return[{Provider:f,Slot:g,ItemSlot:R},C,o]}var J1=h.createContext(void 0);function Bi(n){const a=h.useContext(J1);return n||a||"ltr"}var nd="rovingFocusGroup.onEntryFocus",Z1={bubbles:!1,cancelable:!0},Ya="RovingFocusGroup",[Nd,Px,e2]=eu(Ya),[t2,Rx]=On(Ya,[e2]),[r2,n2]=t2(Ya),Tx=h.forwardRef((n,a)=>t.jsx(Nd.Provider,{scope:n.__scopeRovingFocusGroup,children:t.jsx(Nd.Slot,{scope:n.__scopeRovingFocusGroup,children:t.jsx(s2,{...n,ref:a})})}));Tx.displayName=Ya;var s2=h.forwardRef((n,a)=>{const{__scopeRovingFocusGroup:l,orientation:o,loop:c=!1,dir:u,currentTabStopId:f,defaultCurrentTabStopId:p,onCurrentTabStopIdChange:x,onEntryFocus:g,preventScrollOnEntryFocus:v=!1,...y}=n,P=h.useRef(null),R=Xe(a,P),C=Bi(u),[j,b]=ls({prop:f,defaultProp:p??null,onChange:x,caller:Ya}),[S,E]=h.useState(!1),w=An(g),M=Px(l),D=h.useRef(!1),[V,k]=h.useState(0);return h.useEffect(()=>{const T=P.current;if(T)return T.addEventListener(nd,w),()=>T.removeEventListener(nd,w)},[w]),t.jsx(r2,{scope:l,orientation:o,dir:C,loop:c,currentTabStopId:j,onItemFocus:h.useCallback(T=>b(T),[b]),onItemShiftTab:h.useCallback(()=>E(!0),[]),onFocusableItemAdd:h.useCallback(()=>k(T=>T+1),[]),onFocusableItemRemove:h.useCallback(()=>k(T=>T-1),[]),children:t.jsx(Ue.div,{tabIndex:S||V===0?-1:0,"data-orientation":o,...y,ref:R,style:{outline:"none",...n.style},onMouseDown:Fe(n.onMouseDown,()=>{D.current=!0}),onFocus:Fe(n.onFocus,T=>{const U=!D.current;if(T.target===T.currentTarget&&U&&!S){const Q=new CustomEvent(nd,Z1);if(T.currentTarget.dispatchEvent(Q),!Q.defaultPrevented){const te=M().filter(Z=>Z.focusable),oe=te.find(Z=>Z.active),he=te.find(Z=>Z.id===j),le=[oe,he,...te].filter(Boolean).map(Z=>Z.ref.current);Ax(le,v)}}D.current=!1}),onBlur:Fe(n.onBlur,()=>E(!1))})})}),_x="RovingFocusGroupItem",Ix=h.forwardRef((n,a)=>{const{__scopeRovingFocusGroup:l,focusable:o=!0,active:c=!1,tabStopId:u,children:f,...p}=n,x=_n(),g=u||x,v=n2(_x,l),y=v.currentTabStopId===g,P=Px(l),{onFocusableItemAdd:R,onFocusableItemRemove:C,currentTabStopId:j}=v;return h.useEffect(()=>{if(o)return R(),()=>C()},[o,R,C]),t.jsx(Nd.ItemSlot,{scope:l,id:g,focusable:o,active:c,children:t.jsx(Ue.span,{tabIndex:y?0:-1,"data-orientation":v.orientation,...p,ref:a,onMouseDown:Fe(n.onMouseDown,b=>{o?v.onItemFocus(g):b.preventDefault()}),onFocus:Fe(n.onFocus,()=>v.onItemFocus(g)),onKeyDown:Fe(n.onKeyDown,b=>{if(b.key==="Tab"&&b.shiftKey){v.onItemShiftTab();return}if(b.target!==b.currentTarget)return;const S=i2(b,v.orientation,v.dir);if(S!==void 0){if(b.metaKey||b.ctrlKey||b.altKey||b.shiftKey)return;b.preventDefault();let w=P().filter(M=>M.focusable).map(M=>M.ref.current);if(S==="last")w.reverse();else if(S==="prev"||S==="next"){S==="prev"&&w.reverse();const M=w.indexOf(b.currentTarget);w=v.loop?o2(w,M+1):w.slice(M+1)}setTimeout(()=>Ax(w))}}),children:typeof f=="function"?f({isCurrentTabStop:y,hasTabStop:j!=null}):f})})});Ix.displayName=_x;var a2={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function l2(n,a){return a!=="rtl"?n:n==="ArrowLeft"?"ArrowRight":n==="ArrowRight"?"ArrowLeft":n}function i2(n,a,l){const o=l2(n.key,l);if(!(a==="vertical"&&["ArrowLeft","ArrowRight"].includes(o))&&!(a==="horizontal"&&["ArrowUp","ArrowDown"].includes(o)))return a2[o]}function Ax(n,a=!1){const l=document.activeElement;for(const o of n)if(o===l||(o.focus({preventScroll:a}),document.activeElement!==l))return}function o2(n,a){return n.map((l,o)=>n[(a+o)%n.length])}var c2=Tx,d2=Ix,Ui="Tabs",[u2]=On(Ui,[Rx]),Mx=Rx(),[f2,tu]=u2(Ui),Dx=h.forwardRef((n,a)=>{const{__scopeTabs:l,value:o,onValueChange:c,defaultValue:u,orientation:f="horizontal",dir:p,activationMode:x="automatic",...g}=n,v=Bi(p),[y,P]=ls({prop:o,onChange:c,defaultProp:u??"",caller:Ui});return t.jsx(f2,{scope:l,baseId:_n(),value:y,onValueChange:P,orientation:f,dir:v,activationMode:x,children:t.jsx(Ue.div,{dir:v,"data-orientation":f,...g,ref:a})})});Dx.displayName=Ui;var Lx="TabsList",Ox=h.forwardRef((n,a)=>{const{__scopeTabs:l,loop:o=!0,...c}=n,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(Ue.div,{role:"tablist","aria-orientation":u.orientation,...c,ref:a})})});Ox.displayName=Lx;var Fx="TabsTrigger",zx=h.forwardRef((n,a)=>{const{__scopeTabs:l,value:o,disabled:c=!1,...u}=n,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(Ue.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:Fe(n.onMouseDown,y=>{!c&&y.button===0&&y.ctrlKey===!1?f.onValueChange(o):y.preventDefault()}),onKeyDown:Fe(n.onKeyDown,y=>{[" ","Enter"].includes(y.key)&&f.onValueChange(o)}),onFocus:Fe(n.onFocus,()=>{const y=f.activationMode!=="manual";!v&&!c&&y&&f.onValueChange(o)})})})});zx.displayName=Fx;var $x="TabsContent",Bx=h.forwardRef((n,a)=>{const{__scopeTabs:l,value:o,forceMount:c,children:u,...f}=n,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 P=requestAnimationFrame(()=>y.current=!1);return()=>cancelAnimationFrame(P)},[]),t.jsx(Ka,{present:c||v,children:({present:P})=>t.jsx(Ue.div,{"data-state":v?"active":"inactive","data-orientation":p.orientation,role:"tabpanel","aria-labelledby":x,hidden:!P,id:g,tabIndex:0,...f,ref:a,style:{...n.style,animationDuration:y.current?"0s":void 0},children:P&&u})})});Bx.displayName=$x;function Ux(n,a){return`${n}-trigger-${a}`}function Vx(n,a){return`${n}-content-${a}`}var h2=Dx,Wx=Ox,Hx=zx,Kx=Bx;const ru=h2,Vi=h.forwardRef(({className:n,...a},l)=>t.jsx(Wx,{ref:l,className:Je("inline-flex h-9 items-center justify-center rounded-lg bg-muted p-1 text-muted-foreground",n),...a}));Vi.displayName=Wx.displayName;const hr=h.forwardRef(({className:n,...a},l)=>t.jsx(Hx,{ref:l,className:Je("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",n),...a}));hr.displayName=Hx.displayName;const mr=h.forwardRef(({className:n,...a},l)=>t.jsx(Kx,{ref:l,className:Je("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",n),...a}));mr.displayName=Kx.displayName;function m2({open:n,onClose:a,userId:l,onUserUpdated:o}){var Z;const[c,u]=h.useState(null),[f,p]=h.useState([]),[x,g]=h.useState([]),[v,y]=h.useState(!1),[P,R]=h.useState(!1),[C,j]=h.useState(!1),[b,S]=h.useState("info"),[E,w]=h.useState(""),[M,D]=h.useState(""),[V,k]=h.useState([]),[T,U]=h.useState("");h.useEffect(()=>{n&&l&&Q()},[n,l]);async function Q(){if(l){y(!0);try{const $=await Ge(`/api/db/users?id=${encodeURIComponent(l)}`);if($!=null&&$.success&&$.user){const _=$.user;u(_),w(_.phone||""),D(_.nickname||""),k(typeof _.tags=="string"?JSON.parse(_.tags||"[]"):[])}try{const _=await Ge(`/api/user/track?userId=${encodeURIComponent(l)}&limit=50`);_!=null&&_.success&&_.tracks&&p(_.tracks)}catch{p([])}try{const _=await Ge(`/api/db/users/referrals?userId=${encodeURIComponent(l)}`);_!=null&&_.success&&_.referrals&&g(_.referrals)}catch{g([])}}catch($){console.error("Load user detail error:",$)}finally{y(!1)}}}async function te(){if(!(c!=null&&c.phone)){alert("用户未绑定手机号,无法同步");return}R(!0);try{const $=await Ct("/api/ckb/sync",{action:"full_sync",phone:c.phone,userId:c.id});$!=null&&$.success?(alert("同步成功"),Q()):alert("同步失败: "+($==null?void 0:$.error))}catch($){console.error("Sync CKB error:",$),alert("同步失败")}finally{R(!1)}}async function oe(){if(c){j(!0);try{const $={id:c.id,phone:E||void 0,nickname:M||void 0,tags:JSON.stringify(V)},_=await St("/api/db/users",$);_!=null&&_.success?(alert("保存成功"),Q(),o==null||o()):alert("保存失败: "+(_==null?void 0:_.error))}catch($){console.error("Save user error:",$),alert("保存失败")}finally{j(!1)}}}const he=()=>{T&&!V.includes(T)&&(k([...V,T]),U(""))},ne=$=>{k(V.filter(_=>_!==$))},le=$=>{const q={view_chapter:Qr,purchase:pd,match:Cr,login:ns,register:ns,share:ts,bind_phone:RN,bind_wechat:bN}[$]||Nm;return t.jsx(q,{className:"w-4 h-4"})};return n?t.jsx($t,{open:n,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(Bt,{children:t.jsxs(Ut,{className:"text-white flex items-center gap-2",children:[t.jsx(ns,{className:"w-5 h-5 text-[#38bdac]"}),"用户详情",(c==null?void 0:c.phone)&&t.jsx($e,{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:""}):((Z=c.nickname)==null?void 0:Z.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($e,{className:"bg-purple-500/20 text-purple-400 border-0",children:"管理员"}),c.hasFullBook&&t.jsx($e,{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(ru,{value:b,onValueChange:S,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(hr,{value:"info",className:"data-[state=active]:bg-[#38bdac]/20 data-[state=active]:text-[#38bdac]",children:"基础信息"}),t.jsx(hr,{value:"tags",className:"data-[state=active]:bg-[#38bdac]/20 data-[state=active]:text-[#38bdac]",children:"标签体系"}),t.jsx(hr,{value:"tracks",className:"data-[state=active]:bg-[#38bdac]/20 data-[state=active]:text-[#38bdac]",children:"行为轨迹"}),t.jsx(hr,{value:"relations",className:"data-[state=active]:bg-[#38bdac]/20 data-[state=active]:text-[#38bdac]",children:"关系链路"})]}),t.jsxs(mr,{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(X,{className:"text-gray-300",children:"手机号"}),t.jsx(ae,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"输入手机号",value:E,onChange:$=>w($.target.value)})]}),t.jsxs("div",{className:"space-y-2",children:[t.jsx(X,{className:"text-gray-300",children:"昵称"}),t.jsx(ae,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"输入昵称",value:M,onChange:$=>D($.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(ts,{className:"w-4 h-4 text-[#38bdac]"}),t.jsx("span",{className:"text-white font-medium",children:"存客宝同步"})]}),t.jsx(ee,{size:"sm",onClick:te,disabled:P||!c.phone,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:P?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($e,{className:"bg-green-500/20 text-green-400 border-0 ml-1",children:"已同步"}):t.jsx($e,{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(mr,{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(($,_)=>t.jsxs($e,{className:"bg-[#38bdac]/20 text-[#38bdac] border-0 pr-1",children:[$,t.jsx("button",{type:"button",onClick:()=>ne($),className:"ml-1 hover:text-red-400",children:t.jsx(pr,{className:"w-3 h-3"})})]},_)),V.length===0&&t.jsx("span",{className:"text-gray-500 text-sm",children:"暂无标签"})]}),t.jsxs("div",{className:"flex gap-2",children:[t.jsx(ae,{className:"bg-[#162840] border-gray-700 text-white flex-1",placeholder:"添加新标签",value:T,onChange:$=>U($.target.value),onKeyDown:$=>$.key==="Enter"&&he()}),t.jsx(ee,{onClick:he,className:"bg-[#38bdac] hover:bg-[#2da396]",children:"添加"})]})]})}),t.jsx(mr,{value:"tracks",className:"flex-1 overflow-auto",children:t.jsx("div",{className:"space-y-2",children:f.length>0?f.map($=>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($.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:$.actionLabel}),$.chapterTitle&&t.jsxs("span",{className:"text-gray-400 text-sm",children:["- ",$.chapterTitle]})]}),t.jsxs("p",{className:"text-gray-500 text-xs mt-1",children:[t.jsx(wp,{className:"w-3 h-3 inline mr-1"}),$.timeAgo," · ",new Date($.createdAt).toLocaleString()]})]})]},$.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(mr,{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(ts,{className:"w-4 h-4 text-[#38bdac]"}),t.jsx("span",{className:"text-white font-medium",children:"推荐的用户"})]}),t.jsxs($e,{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(($,_)=>{var z;const 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:((z=q.nickname)==null?void 0:z.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($e,{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||_)}):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(ee,{variant:"outline",onClick:a,className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:[t.jsx(pr,{className:"w-4 h-4 mr-2"}),"关闭"]}),t.jsxs(ee,{onClick:oe,disabled:C,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:[t.jsx(Yt,{className:"w-4 h-4 mr-2"}),C?"保存中...":"保存修改"]})]})]}):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:n,onClose:a,userId:l,userNickname:o="",onSaved:c}){const[u,f]=h.useState(sd),[p,x]=h.useState([]),[g,v]=h.useState(!1),[y,P]=h.useState(!1);h.useEffect(()=>{if(!n){f(sd);return}let C=!1;return v(!0),Promise.all([Ge("/api/db/vip-roles"),l?Ge(`/api/db/users?id=${encodeURIComponent(l)}`):Promise.resolve(null)]).then(([j,b])=>{if(C)return;const S=j!=null&&j.success&&j.data?j.data:[];x(S);const E=b&&b.user?b.user:null;if(E){const w=String(E.vipRole??""),M=S.some(D=>D.name===w);f({isVip:!!(E.isVip??!1),vipExpireDate:E.vipExpireDate?String(E.vipExpireDate).slice(0,10):"",vipSort:typeof E.vipSort=="number"?E.vipSort:"",vipRole:M?w:w?"__custom__":"",vipRoleCustom:M?"":w,vipName:String(E.vipName??""),vipProject:String(E.vipProject??""),vipContact:String(E.vipContact??""),vipBio:String(E.vipBio??"")})}else f(sd)}).catch(j=>{C||console.error("Load error:",j)}).finally(()=>{C||v(!1)}),()=>{C=!0}},[n,l]);async function R(){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}}P(!0);try{const C=u.vipRole==="__custom__"?u.vipRoleCustom.trim():u.vipRole,j={id:l,isVip:u.isVip,vipExpireDate:u.isVip?u.vipExpireDate:void 0,vipSort:u.vipSort===""?void 0:u.vipSort,vipRole: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 St("/api/db/users",j);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{P(!1)}}}return n?t.jsx($t,{open:n,onOpenChange:()=>a(),children:t.jsxs(It,{className:"bg-[#0f2137] border-gray-700 text-white max-w-md",children:[t.jsx(Bt,{children:t.jsxs(Ut,{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(X,{className:"text-gray-300",children:"VIP 会员"}),t.jsx(gt,{checked:u.isVip,onCheckedChange:C=>f(j=>({...j,isVip:C}))})]}),u.isVip&&t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"space-y-2",children:[t.jsxs(X,{className:"text-gray-300",children:["到期日 (YYYY-MM-DD) ",t.jsx("span",{className:"text-amber-400",children:"*"})]}),t.jsx(ae,{type:"date",className:"bg-[#0a1628] border-gray-700 text-white",value:u.vipExpireDate,onChange:C=>f(j=>({...j,vipExpireDate:C.target.value}))})]}),t.jsxs("div",{className:"space-y-2",children:[t.jsx(X,{className:"text-gray-300",children:"排序"}),t.jsx(ae,{type:"number",className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"数字越小越靠前,留空按时间",value:u.vipSort===""?"":u.vipSort,onChange:C=>{const j=C.target.value;f(b=>({...b,vipSort:j===""?"":parseInt(j,10)||0}))}})]})]}),t.jsxs("div",{className:"space-y-2",children:[t.jsx(X,{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(j=>({...j,vipRole:C.target.value})),children:[t.jsx("option",{value:"",children:"请选择或下方手动填写"}),p.map(C=>t.jsx("option",{value:C.name,children:C.name},C.id)),t.jsx("option",{value:"__custom__",children:"其他(手动填写)"})]}),u.vipRole==="__custom__"&&t.jsx(ae,{className:"bg-[#0a1628] border-gray-700 text-white mt-1",placeholder:"输入自定义角色",value:u.vipRoleCustom,onChange:C=>f(j=>({...j,vipRoleCustom:C.target.value}))})]}),t.jsxs("div",{className:"space-y-2",children:[t.jsx(X,{className:"text-gray-300",children:"VIP 展示名"}),t.jsx(ae,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"创业老板排行展示名",value:u.vipName,onChange:C=>f(j=>({...j,vipName:C.target.value}))})]}),t.jsxs("div",{className:"space-y-2",children:[t.jsx(X,{className:"text-gray-300",children:"项目/公司"}),t.jsx(ae,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"项目名称",value:u.vipProject,onChange:C=>f(j=>({...j,vipProject:C.target.value}))})]}),t.jsxs("div",{className:"space-y-2",children:[t.jsx(X,{className:"text-gray-300",children:"联系方式"}),t.jsx(ae,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"微信号或手机",value:u.vipContact,onChange:C=>f(j=>({...j,vipContact:C.target.value}))})]}),t.jsxs("div",{className:"space-y-2",children:[t.jsx(X,{className:"text-gray-300",children:"一句话简介"}),t.jsx(ae,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"简要描述业务",value:u.vipBio,onChange:C=>f(j=>({...j,vipBio:C.target.value}))})]})]}),t.jsxs(Kt,{children:[t.jsxs(ee,{variant:"outline",onClick:a,className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:[t.jsx(pr,{className:"w-4 h-4 mr-2"}),"取消"]}),t.jsxs(ee,{onClick:R,disabled:y||g,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:[t.jsx(Yt,{className:"w-4 h-4 mr-2"}),y?"保存中...":"保存"]})]})]})}):null}function x2(){var Le,Ie,At,rn,Pt;const[n,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,P]=h.useState("all"),[R,C]=h.useState(!0),[j,b]=h.useState(null),[S,E]=h.useState(!1),[w,M]=h.useState(!1),[D,V]=h.useState(null),[k,T]=h.useState(""),[U,Q]=h.useState(""),[te,oe]=h.useState(!1),[he,ne]=h.useState(!1),[le,Z]=h.useState({referrals:[],stats:{}}),[$,_]=h.useState(!1),[q,z]=h.useState(null),[A,F]=h.useState(!1),[G,J]=h.useState(null),[xe,me]=h.useState(!1),[re,ye]=h.useState(null),[L,de]=h.useState({phone:"",nickname:"",password:"",isAdmin:!1,hasFullBook:!1});async function ge(){C(!0),b(null);try{const se=new URLSearchParams({page:String(c),pageSize:String(f),search:v,...y==="vip"&&{vip:"true"}}),Ke=await Ge(`/api/db/users?${se}`);Ke!=null&&Ke.success?(a(Ke.users||[]),o(Ke.total??0)):b((Ke==null?void 0:Ke.error)||"加载失败")}catch(se){console.error("Load users error:",se),b("网络错误,请检查连接")}finally{C(!1)}}h.useEffect(()=>{u(1)},[v,y]),h.useEffect(()=>{ge()},[c,f,v,y]);const _e=Math.ceil(l/f)||1;async function Oe(se){if(confirm("确定要删除这个用户吗?"))try{const Ke=await ss(`/api/db/users?id=${encodeURIComponent(se)}`);Ke!=null&&Ke.success?ge():alert("删除失败: "+((Ke==null?void 0:Ke.error)||"未知错误"))}catch(Ke){console.error("Delete user error:",Ke),alert("删除失败")}}const ze=se=>{V(se),de({phone:se.phone||"",nickname:se.nickname||"",password:"",isAdmin:!!(se.isAdmin??!1),hasFullBook:!!(se.hasFullBook??!1)}),E(!0)},qe=()=>{V(null),de({phone:"",nickname:"",password:"",isAdmin:!1,hasFullBook:!1}),E(!0)};async function rt(){if(!L.phone||!L.nickname){alert("请填写手机号和昵称");return}oe(!0);try{if(D){const se=await St("/api/db/users",{id:D.id,nickname:L.nickname,isAdmin:L.isAdmin,hasFullBook:L.hasFullBook,...L.password&&{password:L.password}});if(!(se!=null&&se.success)){alert("更新失败: "+((se==null?void 0:se.error)||"未知错误"));return}}else{const se=await Ct("/api/db/users",{phone:L.phone,nickname:L.nickname,password:L.password,isAdmin:L.isAdmin});if(!(se!=null&&se.success)){alert("创建失败: "+((se==null?void 0:se.error)||"未知错误"));return}}E(!1),ge()}catch(se){console.error("Save user error:",se),alert("保存失败")}finally{oe(!1)}}const et=se=>{V(se),T(""),Q(""),M(!0)};async function kt(se){z(se),ne(!0),_(!0);try{const Ke=await Ge(`/api/db/users/referrals?userId=${encodeURIComponent(se.id)}`);Ke!=null&&Ke.success?Z({referrals:Ke.referrals||[],stats:Ke.stats||{}}):Z({referrals:[],stats:{}})}catch(Ke){console.error("Load referrals error:",Ke),Z({referrals:[],stats:{}})}finally{_(!1)}}const Et=se=>{J(se.id),F(!0)},K=se=>{ye(se),me(!0)};async function pe(){if(!k){alert("请输入新密码");return}if(k!==U){alert("两次输入的密码不一致");return}if(k.length<6){alert("密码长度不能少于6位");return}oe(!0);try{const se=await St("/api/db/users",{id:D==null?void 0:D.id,password:k});se!=null&&se.success?(alert("密码修改成功"),M(!1)):alert("密码修改失败: "+((se==null?void 0:se.error)||"未知错误"))}catch(se){console.error("Change password error:",se),alert("密码修改失败")}finally{oe(!1)}}return t.jsxs("div",{className:"p-8 w-full",children:[j&&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:j}),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(ee,{variant:"outline",onClick:ge,disabled:R,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("select",{value:y,onChange:se=>{P(se.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(rs,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-gray-500"}),t.jsx(ae,{type:"text",placeholder:"搜索用户...",className:"pl-10 bg-[#0f2137] border-gray-700 text-white placeholder:text-gray-500 w-64",value:x,onChange:se=>g(se.target.value)})]}),t.jsxs(ee,{onClick:qe,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:[t.jsx(Cm,{className:"w-4 h-4 mr-2"}),"添加用户"]})]})]}),t.jsx($t,{open:S,onOpenChange:E,children:t.jsxs(It,{className:"bg-[#0f2137] border-gray-700 text-white max-w-lg",children:[t.jsx(Bt,{children:t.jsxs(Ut,{className:"text-white flex items-center gap-2",children:[D?t.jsx(Ft,{className:"w-5 h-5 text-[#38bdac]"}):t.jsx(Cm,{className:"w-5 h-5 text-[#38bdac]"}),D?"编辑用户":"添加用户"]})}),t.jsxs("div",{className:"space-y-4 py-4",children:[t.jsxs("div",{className:"space-y-2",children:[t.jsx(X,{className:"text-gray-300",children:"手机号"}),t.jsx(ae,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"请输入手机号",value:L.phone,onChange:se=>de({...L,phone:se.target.value}),disabled:!!D})]}),t.jsxs("div",{className:"space-y-2",children:[t.jsx(X,{className:"text-gray-300",children:"昵称"}),t.jsx(ae,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"请输入昵称",value:L.nickname,onChange:se=>de({...L,nickname:se.target.value})})]}),t.jsxs("div",{className:"space-y-2",children:[t.jsx(X,{className:"text-gray-300",children:D?"新密码 (留空则不修改)":"密码"}),t.jsx(ae,{type:"password",className:"bg-[#0a1628] border-gray-700 text-white",placeholder:D?"留空则不修改":"请输入密码",value:L.password,onChange:se=>de({...L,password:se.target.value})})]}),t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsx(X,{className:"text-gray-300",children:"管理员权限"}),t.jsx(gt,{checked:L.isAdmin,onCheckedChange:se=>de({...L,isAdmin:se})})]}),t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsx(X,{className:"text-gray-300",children:"已购全书"}),t.jsx(gt,{checked:L.hasFullBook,onCheckedChange:se=>de({...L,hasFullBook:se})})]})]}),t.jsxs(Kt,{children:[t.jsxs(ee,{variant:"outline",onClick:()=>E(!1),className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:[t.jsx(pr,{className:"w-4 h-4 mr-2"}),"取消"]}),t.jsxs(ee,{onClick:rt,disabled:te,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:[t.jsx(Yt,{className:"w-4 h-4 mr-2"}),te?"保存中...":"保存"]})]})]})}),t.jsx($t,{open:w,onOpenChange:M,children:t.jsxs(It,{className:"bg-[#0f2137] border-gray-700 text-white max-w-md",children:[t.jsx(Bt,{children:t.jsxs(Ut,{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:["用户:",D==null?void 0:D.nickname]}),t.jsxs("p",{className:"text-gray-400 text-sm",children:["手机号:",D==null?void 0:D.phone]})]}),t.jsxs("div",{className:"space-y-2",children:[t.jsx(X,{className:"text-gray-300",children:"新密码"}),t.jsx(ae,{type:"password",className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"请输入新密码 (至少6位)",value:k,onChange:se=>T(se.target.value)})]}),t.jsxs("div",{className:"space-y-2",children:[t.jsx(X,{className:"text-gray-300",children:"确认密码"}),t.jsx(ae,{type:"password",className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"请再次输入新密码",value:U,onChange:se=>Q(se.target.value)})]})]}),t.jsxs(Kt,{children:[t.jsx(ee,{variant:"outline",onClick:()=>M(!1),className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:"取消"}),t.jsx(ee,{onClick:pe,disabled:te,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:te?"保存中...":"确认修改"})]})]})}),t.jsx(m2,{open:A,onClose:()=>F(!1),userId:G,onUserUpdated:ge}),t.jsx(p2,{open:xe,onClose:()=>{me(!1),ye(null)},userId:(re==null?void 0:re.id)??null,userNickname:re==null?void 0:re.nickname,onSaved:ge}),t.jsx($t,{open:he,onOpenChange:ne,children:t.jsxs(It,{className:"bg-[#0f2137] border-gray-700 text-white max-w-2xl max-h-[80vh] overflow-auto",children:[t.jsx(Bt,{children:t.jsxs(Ut,{className:"text-white flex items-center gap-2",children:[t.jsx(Cr,{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:((Le=le.stats)==null?void 0:Le.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:((Ie=le.stats)==null?void 0:Ie.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:["¥",(((At=le.stats)==null?void 0:At.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:["¥",(((rn=le.stats)==null?void 0:rn.pendingEarnings)||0).toFixed(2)]}),t.jsx("div",{className:"text-xs text-gray-400",children:"待提现"})]})]}),$?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:"加载中..."})]}):(((Pt=le.referrals)==null?void 0:Pt.length)??0)>0?t.jsx("div",{className:"space-y-2 max-h-[300px] overflow-y-auto",children:(le.referrals??[]).map((se,Ke)=>{var xr;const Rt=se;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:((xr=Rt.nickname)==null?void 0:xr.charAt(0))||"?"}),t.jsxs("div",{children:[t.jsx("div",{className:"text-white text-sm",children:Rt.nickname}),t.jsx("div",{className:"text-xs text-gray-500",children:Rt.phone||(Rt.hasOpenId?"微信用户":"未绑定")})]})]}),t.jsxs("div",{className:"flex items-center gap-2",children:[Rt.status==="vip"&&t.jsx($e,{className:"bg-green-500/20 text-green-400 border-0 text-xs",children:"全书已购"}),Rt.status==="paid"&&t.jsxs($e,{className:"bg-blue-500/20 text-blue-400 border-0 text-xs",children:["已付费",Rt.purchasedSections,"章"]}),Rt.status==="free"&&t.jsx($e,{className:"bg-gray-500/20 text-gray-400 border-0 text-xs",children:"未付费"}),t.jsx("span",{className:"text-xs text-gray-500",children:Rt.createdAt?new Date(Rt.createdAt).toLocaleDateString():""})]})]},Rt.id||Ke)})}):t.jsx("div",{className:"text-center py-8 text-gray-500",children:"暂无绑定用户"})]}),t.jsx(Kt,{children:t.jsx(ee,{variant:"outline",onClick:()=>ne(!1),className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:"关闭"})})]})}),t.jsx(Pe,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:t.jsx(Re,{className:"p-0",children:R?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(Zr,{children:[t.jsx(en,{children:t.jsxs(ot,{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(tn,{children:[n.map(se=>{var Ke,Rt,xr;return t.jsxs(ot,{className:"hover:bg-[#0a1628] border-gray-700/50",children:[t.jsx(Ce,{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:se.avatar?t.jsx("img",{src:se.avatar,className:"w-full h-full rounded-full object-cover",alt:""}):((Ke=se.nickname)==null?void 0:Ke.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:se.nickname}),se.isAdmin&&t.jsx($e,{className:"bg-purple-500/20 text-purple-400 hover:bg-purple-500/20 border-0 text-xs",children:"管理员"}),se.openId&&!((Rt=se.id)!=null&&Rt.startsWith("user_"))&&t.jsx($e,{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:se.openId?se.openId.slice(0,12)+"...":(xr=se.id)==null?void 0:xr.slice(0,12)})]})]})}),t.jsx(Ce,{children:t.jsxs("div",{className:"space-y-1",children:[se.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:se.phone})]}),se.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:se.wechatId})]}),se.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:se.openId,children:[se.openId.slice(0,12),"..."]})]}),!se.phone&&!se.wechatId&&!se.openId&&t.jsx("span",{className:"text-gray-600 text-xs",children:"未绑定"})]})}),t.jsx(Ce,{children:se.hasFullBook?t.jsx($e,{className:"bg-amber-500/20 text-amber-400 hover:bg-amber-500/20 border-0",children:"VIP"}):t.jsx($e,{variant:"outline",className:"text-gray-500 border-gray-600",children:"未购买"})}),t.jsx(Ce,{children:t.jsxs("div",{className:"space-y-1",children:[t.jsxs("div",{className:"text-white font-medium",children:["¥",parseFloat(String(se.earnings||0)).toFixed(2)]}),parseFloat(String(se.pendingEarnings||0))>0&&t.jsxs("div",{className:"text-xs text-yellow-400",children:["待提现: ¥",parseFloat(String(se.pendingEarnings||0)).toFixed(2)]}),t.jsxs("div",{className:"text-xs text-[#38bdac] cursor-pointer hover:underline flex items-center gap-1",onClick:()=>kt(se),onKeyDown:$n=>$n.key==="Enter"&&kt(se),role:"button",tabIndex:0,children:[t.jsx(Cr,{className:"w-3 h-3"}),"绑定",se.referralCount||0,"人"]})]})}),t.jsx(Ce,{children:t.jsx("code",{className:"text-[#38bdac] text-xs bg-[#38bdac]/10 px-2 py-0.5 rounded",children:se.referralCode||"-"})}),t.jsx(Ce,{className:"text-gray-400",children:se.createdAt?new Date(se.createdAt).toLocaleDateString():"-"}),t.jsx(Ce,{className:"text-right",children:t.jsxs("div",{className:"flex items-center justify-end gap-1",children:[t.jsx(ee,{variant:"ghost",size:"sm",onClick:()=>K(se),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(ee,{variant:"ghost",size:"sm",onClick:()=>Et(se),className:"text-gray-400 hover:text-blue-400 hover:bg-blue-400/10",title:"查看详情",children:t.jsx(Pn,{className:"w-4 h-4"})}),t.jsx(ee,{variant:"ghost",size:"sm",onClick:()=>ze(se),className:"text-gray-400 hover:text-[#38bdac] hover:bg-[#38bdac]/10",title:"编辑",children:t.jsx(Ft,{className:"w-4 h-4"})}),t.jsx(ee,{variant:"ghost",size:"sm",onClick:()=>et(se),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(ee,{variant:"ghost",size:"sm",className:"text-red-400 hover:text-red-300 hover:bg-red-500/10",onClick:()=>Oe(se.id),title:"删除",children:t.jsx(sr,{className:"w-4 h-4"})})]})})]},se.id)}),n.length===0&&t.jsx(ot,{children:t.jsx(Ce,{colSpan:7,className:"text-center py-12 text-gray-500",children:"暂无用户数据"})})]})]}),t.jsx(In,{page:c,totalPages:_e,total:l,pageSize:f,onPageChange:u,onPageSizeChange:se=>{p(se),u(1)}})]})})})]})}function g2(){const[n,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([]),[P,R]=h.useState(!0),[C,j]=h.useState(null),[b,S]=h.useState(""),[E,w]=h.useState("all"),[M,D]=h.useState(1),[V,k]=h.useState(10),[T,U]=h.useState(0),[Q,te]=h.useState(new Set),[oe,he]=h.useState(null),[ne,le]=h.useState(""),[Z,$]=h.useState(!1);h.useEffect(()=>{_()},[]),h.useEffect(()=>{D(1)},[n,E]),h.useEffect(()=>{q(n)},[n]),h.useEffect(()=>{["orders","bindings","withdrawals"].includes(n)&&q(n,!0)},[M,V,E,b]);async function _(){j(null);try{const L=await Ge("/api/admin/distribution/overview");L!=null&&L.success&&L.overview&&u(L.overview)}catch(L){console.error("[Admin] 概览接口异常:",L),j("加载概览失败")}try{const L=await Ge("/api/db/users");y((L==null?void 0:L.users)||[])}catch(L){console.error("[Admin] 用户数据加载失败:",L)}}async function q(L,de=!1){var ge;if(!(!de&&Q.has(L))){R(!0);try{const _e=v;switch(L){case"overview":break;case"orders":{try{const Oe=new URLSearchParams({page:String(M),pageSize:String(V),...E!=="all"&&{status:E},...b&&{search:b}}),ze=await Ge(`/api/orders?${Oe}`);if(ze!=null&&ze.success&&ze.orders){const qe=ze.orders.map(rt=>{const et=_e.find(Et=>Et.id===rt.userId),kt=rt.referrerId?_e.find(Et=>Et.id===rt.referrerId):null;return{...rt,amount:parseFloat(String(rt.amount))||0,userNickname:(et==null?void 0:et.nickname)||rt.userNickname||"未知用户",userPhone:(et==null?void 0:et.phone)||rt.userPhone||"-",referrerNickname:(kt==null?void 0:kt.nickname)||null,referrerCode:(kt==null?void 0:kt.referralCode)??null,type:rt.productType||rt.type}});o(qe),U(ze.total??qe.length)}else o([]),U(0)}catch(Oe){console.error(Oe),j("加载订单失败"),o([])}break}case"bindings":{try{const Oe=new URLSearchParams({page:String(M),pageSize:String(V),...E!=="all"&&{status:E}}),ze=await Ge(`/api/db/distribution?${Oe}`);p((ze==null?void 0:ze.bindings)||[]),U((ze==null?void 0:ze.total)??((ge=ze==null?void 0:ze.bindings)==null?void 0:ge.length)??0)}catch(Oe){console.error(Oe),j("加载绑定数据失败"),p([])}break}case"withdrawals":{try{const Oe=E==="completed"?"success":E==="rejected"?"failed":E,ze=new URLSearchParams({...Oe&&Oe!=="all"&&{status:Oe},page:String(M),pageSize:String(V)}),qe=await Ge(`/api/admin/withdrawals?${ze}`);if(qe!=null&&qe.success&&qe.withdrawals){const rt=qe.withdrawals.map(et=>({...et,account:et.account??"未绑定微信号",status:et.status==="success"?"completed":et.status==="failed"?"rejected":et.status}));g(rt),U((qe==null?void 0:qe.total)??rt.length)}else qe!=null&&qe.success||j(`获取提现记录失败: ${(qe==null?void 0:qe.error)||"未知错误"}`),g([])}catch(Oe){console.error(Oe),j("加载提现数据失败"),g([])}break}}te(Oe=>new Set(Oe).add(L))}catch(_e){console.error(_e)}finally{R(!1)}}}async function z(){j(null),te(L=>{const de=new Set(L);return de.delete(n),de}),n==="overview"&&_(),await q(n,!0)}async function A(L){if(confirm("确认审核通过并打款?"))try{const de=await St("/api/admin/withdrawals",{id:L,action:"approve"});if(!(de!=null&&de.success)){const ge=(de==null?void 0:de.message)||(de==null?void 0:de.error)||"操作失败";alert(ge);return}await z()}catch(de){console.error(de),alert("操作失败")}}async function F(L){const de=prompt("请输入拒绝原因:");if(de)try{const ge=await St("/api/admin/withdrawals",{id:L,action:"reject",errorMessage:de});if(!(ge!=null&&ge.success)){alert((ge==null?void 0:ge.error)||"操作失败");return}await z()}catch(ge){console.error(ge),alert("操作失败")}}async function G(){var L;if(!(!(oe!=null&&oe.orderSn)&&!(oe!=null&&oe.id))){$(!0),j(null);try{const de=await St("/api/admin/orders/refund",{orderSn:oe.orderSn||oe.id,reason:ne||void 0});de!=null&&de.success?(he(null),le(""),await q("orders",!0)):j((de==null?void 0:de.error)||"退款失败")}catch(de){const ge=de;j(((L=ge==null?void 0:ge.data)==null?void 0:L.error)||"退款失败,请检查网络后重试")}finally{$(!1)}}}function J(L){const de={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"},ge={active:"有效",converted:"已转化",expired:"已过期",cancelled:"已取消",pending:"待审核",pending_confirm:"待用户确认",processing:"处理中",completed:"已完成",rejected:"已拒绝"};return t.jsx($e,{className:`${de[L]||"bg-gray-500/20 text-gray-400"} border-0`,children:ge[L]||L})}const xe=Math.ceil(T/V)||1,me=l,re=f.filter(L=>{var ge,_e,Oe,ze;if(!b)return!0;const de=b.toLowerCase();return((ge=L.refereeNickname)==null?void 0:ge.toLowerCase().includes(de))||((_e=L.refereePhone)==null?void 0:_e.includes(de))||((Oe=L.referrerName)==null?void 0:Oe.toLowerCase().includes(de))||((ze=L.referrerCode)==null?void 0:ze.toLowerCase().includes(de))}),ye=x.filter(L=>{var ge;if(!b)return!0;const de=b.toLowerCase();return((ge=L.userName)==null?void 0:ge.toLowerCase().includes(de))||L.account&&L.account.toLowerCase().includes(de)});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:()=>j(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(ee,{onClick:z,disabled:P,variant:"outline",className:"border-gray-700 text-gray-300 hover:bg-gray-800",children:[t.jsx(tt,{className:`w-4 h-4 mr-2 ${P?"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:ji},{key:"bindings",label:"绑定管理",icon:ts},{key:"withdrawals",label:"提现审核",icon:Us}].map(L=>t.jsxs("button",{type:"button",onClick:()=>{a(L.key),w("all"),S("")},className:`flex items-center gap-2 px-4 py-2 rounded-lg text-sm font-medium transition-colors ${n===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))}),P?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:[n==="overview"&&c&&t.jsxs("div",{className:"space-y-6",children:[t.jsxs("div",{className:"grid grid-cols-4 gap-4",children:[t.jsx(Pe,{className:"bg-[#0f2137] border-gray-700/50",children:t.jsx(Re,{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(Pn,{className:"w-6 h-6 text-blue-400"})})]})})}),t.jsx(Pe,{className:"bg-[#0f2137] border-gray-700/50",children:t.jsx(Re,{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(ts,{className:"w-6 h-6 text-green-400"})})]})})}),t.jsx(Pe,{className:"bg-[#0f2137] border-gray-700/50",children:t.jsx(Re,{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(Pe,{className:"bg-[#0f2137] border-gray-700/50",children:t.jsx(Re,{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(ji,{className:"w-6 h-6 text-[#38bdac]"})})]})})})]}),t.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[t.jsx(Pe,{className:"bg-orange-500/10 border-orange-500/30",children:t.jsx(Re,{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(Pe,{className:"bg-blue-500/10 border-blue-500/30",children:t.jsx(Re,{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(Us,{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(ee,{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(Pe,{className:"bg-[#0f2137] border-gray-700/50",children:[t.jsx(We,{children:t.jsxs(He,{className:"text-white flex items-center gap-2",children:[t.jsx($a,{className:"w-5 h-5 text-[#38bdac]"}),"本月统计"]})}),t.jsx(Re,{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(Pe,{className:"bg-[#0f2137] border-gray-700/50",children:[t.jsx(We,{children:t.jsxs(He,{className:"text-white flex items-center gap-2",children:[t.jsx(gd,{className:"w-5 h-5 text-[#38bdac]"}),"累计统计"]})}),t.jsxs(Re,{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(Pe,{className:"bg-[#0f2137] border-gray-700/50",children:[t.jsx(We,{children:t.jsxs(He,{className:"text-white flex items-center gap-2",children:[t.jsx(Cr,{className:"w-5 h-5 text-[#38bdac]"}),"推广统计"]})}),t.jsx(Re,{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:"绑定有效期"})]})]})})]})]}),n==="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(rs,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-gray-400"}),t.jsx(ae,{value:b,onChange:L=>S(L.target.value),placeholder:"搜索订单号、用户名、手机号...",className:"pl-10 bg-[#0f2137] border-gray-700 text-white"})]}),t.jsxs("select",{value:E,onChange:L=>w(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(Pe,{className:"bg-[#0f2137] border-gray-700/50",children:t.jsxs(Re,{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 de,ge;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:[(de=L.id)==null?void 0:de.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 _e=L.productType||L.type;return _e==="fullbook"?`${L.bookName||"《底层逻辑》"} - 全本`:_e==="match"?"匹配次数购买":`${L.bookName||"《底层逻辑》"} - ${L.sectionTitle||L.chapterTitle||`章节${L.productId||L.sectionId||""}`}`})()}),t.jsx("p",{className:"text-gray-500 text-xs",children:(()=>{const _e=L.productType||L.type;return _e==="fullbook"?"全书解锁":_e==="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($e,{className:"bg-gray-500/20 text-gray-400 border-0",children:"已退款"}):L.status==="completed"||L.status==="paid"?t.jsx($e,{className:"bg-green-500/20 text-green-400 border-0",children:"已完成"}):L.status==="pending"||L.status==="created"?t.jsx($e,{className:"bg-yellow-500/20 text-yellow-400 border-0",children:"待支付"}):t.jsx($e,{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||((ge=L.referrerId)==null?void 0:ge.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(ee,{variant:"outline",size:"sm",className:"border-orange-500/50 text-orange-400 hover:bg-orange-500/20",onClick:()=>{he(L),le("")},children:[t.jsx(kp,{className:"w-3 h-3 mr-1"}),"退款"]})})]},L.id)})})]})}),n==="orders"&&t.jsx(In,{page:M,totalPages:xe,total:T,pageSize:V,onPageChange:D,onPageSizeChange:L=>{k(L),D(1)}})]})})]}),n==="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(rs,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-gray-400"}),t.jsx(ae,{value:b,onChange:L=>S(L.target.value),placeholder:"搜索用户昵称、手机号、推广码...",className:"pl-10 bg-[#0f2137] border-gray-700 text-white"})]}),t.jsxs("select",{value:E,onChange:L=>w(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(Pe,{className:"bg-[#0f2137] border-gray-700/50",children:t.jsxs(Re,{className:"p-0",children:[re.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:re.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:J(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))})]})}),n==="bindings"&&t.jsx(In,{page:M,totalPages:xe,total:T,pageSize:V,onPageChange:D,onPageSizeChange:L=>{k(L),D(1)}})]})})]}),n==="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(rs,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-gray-400"}),t.jsx(ae,{value:b,onChange:L=>S(L.target.value),placeholder:"搜索用户名称、账号...",className:"pl-10 bg-[#0f2137] border-gray-700 text-white"})]}),t.jsxs("select",{value:E,onChange:L=>w(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(Pe,{className:"bg-[#0f2137] border-gray-700/50",children:t.jsxs(Re,{className:"p-0",children:[ye.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:ye.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($e,{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:J(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(ee,{size:"sm",onClick:()=>A(L.id),className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:[t.jsx(ym,{className:"w-4 h-4 mr-1"}),"通过"]}),t.jsxs(ee,{size:"sm",variant:"outline",onClick:()=>F(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))})]})}),n==="withdrawals"&&t.jsx(In,{page:M,totalPages:xe,total:T,pageSize:V,onPageChange:D,onPageSizeChange:L=>{k(L),D(1)}})]})})]})]}),t.jsx($t,{open:!!oe,onOpenChange:L=>!L&&he(null),children:t.jsxs(It,{className:"bg-[#0f2137] border-gray-700 text-white max-w-md",children:[t.jsx(Bt,{children:t.jsx(Ut,{className:"text-white",children:"订单退款"})}),oe&&t.jsxs("div",{className:"space-y-4",children:[t.jsxs("p",{className:"text-gray-400 text-sm",children:["订单号:",oe.orderSn||oe.id]}),t.jsxs("p",{className:"text-gray-400 text-sm",children:["退款金额:¥",typeof oe.amount=="number"?oe.amount.toFixed(2):parseFloat(String(oe.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(ae,{className:"bg-[#0a1628] border-gray-700 text-white placeholder:text-gray-500",placeholder:"如:用户申请退款",value:ne,onChange:L=>le(L.target.value)})})]}),t.jsx("p",{className:"text-orange-400/80 text-xs",children:"退款将原路退回至用户微信,且无法撤销,请确认后再操作。"})]}),t.jsxs(Kt,{children:[t.jsx(ee,{variant:"outline",className:"border-gray-600 text-gray-300",onClick:()=>he(null),disabled:Z,children:"取消"}),t.jsx(ee,{className:"bg-orange-500 hover:bg-orange-600 text-white",onClick:G,disabled:Z,children:Z?"退款中...":"确认退款"})]})]})})]})}function v2(){const[n,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),[P,R]=h.useState(10),[C,j]=h.useState(0),[b,S]=h.useState(null);async function E(){var k,T,U,Q,te,oe,he;u(!0),p(null);try{const ne=new URLSearchParams({status:x,page:String(v),pageSize:String(P)}),le=await Ge(`/api/admin/withdrawals?${ne}`);if(le!=null&&le.success){const Z=le.withdrawals||[];a(Z),j(le.total??((k=le.stats)==null?void 0:k.total)??Z.length),o({total:((T=le.stats)==null?void 0:T.total)??le.total??Z.length,pendingCount:((U=le.stats)==null?void 0:U.pendingCount)??0,pendingAmount:((Q=le.stats)==null?void 0:Q.pendingAmount)??0,successCount:((te=le.stats)==null?void 0:te.successCount)??0,successAmount:((oe=le.stats)==null?void 0:oe.successAmount)??0,failedCount:((he=le.stats)==null?void 0:he.failedCount)??0})}else p("加载提现记录失败")}catch(ne){console.error("Load withdrawals error:",ne),p("加载失败,请检查网络后重试")}finally{u(!1)}}h.useEffect(()=>{y(1)},[x]),h.useEffect(()=>{E()},[x,v,P]);const w=Math.ceil(C/P)||1;async function M(k){const T=n.find(U=>U.id===k);if(T!=null&&T.userCommissionInfo&&T.userCommissionInfo.availableAfterThis<0){if(!confirm(`⚠️ 风险警告:该用户审核后余额为负数(¥${T.userCommissionInfo.availableAfterThis.toFixed(2)}),可能存在超额提现。 - -确认已核实用户账户并完成打款?`))return}else if(!confirm("确认已完成打款?批准后将更新用户提现记录。"))return;S(k);try{const U=await St("/api/admin/withdrawals",{id:k,action:"approve"});U!=null&&U.success?E():alert("操作失败: "+((U==null?void 0:U.error)??""))}catch{alert("操作失败")}finally{S(null)}}async function D(k){const T=prompt("请输入拒绝原因(将返还用户余额):");if(T){S(k);try{const U=await St("/api/admin/withdrawals",{id:k,action:"reject",errorMessage:T});U!=null&&U.success?E():alert("操作失败: "+((U==null?void 0:U.error)??""))}catch{alert("操作失败")}finally{S(null)}}}function V(k){switch(k){case"pending":return t.jsx($e,{className:"bg-orange-500/20 text-orange-400 hover:bg-orange-500/20 border-0",children:"待处理"});case"pending_confirm":return t.jsx($e,{className:"bg-orange-500/20 text-orange-400 hover:bg-orange-500/20 border-0",children:"待用户确认"});case"processing":return t.jsx($e,{className:"bg-blue-500/20 text-blue-400 hover:bg-blue-500/20 border-0",children:"已审批等待打款"});case"success":case"completed":return t.jsx($e,{className:"bg-green-500/20 text-green-400 hover:bg-green-500/20 border-0",children:"已完成"});case"failed":case"rejected":return t.jsx($e,{className:"bg-red-500/20 text-red-400 hover:bg-red-500/20 border-0",children:"已拒绝"});default:return t.jsx($e,{className:"bg-gray-500/20 text-gray-400 border-0",children:k})}}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(ee,{variant:"outline",onClick:E,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(Pe,{className:"bg-gradient-to-r from-[#38bdac]/10 to-[#0f2137] border-[#38bdac]/30 mb-6",children:t.jsx(Re,{className:"p-4",children:t.jsxs("div",{className:"flex items-start gap-3",children:[t.jsx(ji,{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(Pe,{className:"bg-[#0f2137] border-gray-700/50",children:t.jsxs(Re,{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(Pe,{className:"bg-[#0f2137] border-gray-700/50",children:t.jsxs(Re,{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(Pe,{className:"bg-[#0f2137] border-gray-700/50",children:t.jsxs(Re,{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(Pe,{className:"bg-[#0f2137] border-gray-700/50",children:t.jsxs(Re,{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(k=>t.jsx(ee,{variant:x===k?"default":"outline",size:"sm",onClick:()=>g(k),className:x===k?"bg-[#38bdac] hover:bg-[#2da396] text-white":"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:k==="all"?"全部":k==="pending"?"待处理":k==="success"?"已完成":"已拒绝"},k))}),t.jsx(Pe,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:t.jsx(Re,{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:"加载中..."})]}):n.length===0?t.jsxs("div",{className:"text-center py-12",children:[t.jsx(Us,{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:n.map(k=>t.jsxs("tr",{className:"hover:bg-[#0a1628] transition-colors",children:[t.jsx("td",{className:"p-4 text-gray-400",children:new Date(k.createdAt??"").toLocaleString()}),t.jsx("td",{className:"p-4",children:t.jsxs("div",{className:"flex items-center gap-2",children:[k.userAvatar?t.jsx("img",{src:k.userAvatar,alt:k.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:(k.userName??"?").charAt(0)}),t.jsxs("div",{children:[t.jsx("p",{className:"font-medium text-white",children:k.userName??"未知"}),t.jsx("p",{className:"text-xs text-gray-500",children:k.userPhone??k.referralCode??(k.userId??"").slice(0,10)})]})]})}),t.jsx("td",{className:"p-4",children:t.jsxs("span",{className:"font-bold text-orange-400",children:["¥",Number(k.amount).toFixed(2)]})}),t.jsx("td",{className:"p-4",children:k.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:["¥",k.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:["¥",k.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:["¥",k.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:k.userCommissionInfo.availableAfterThis>=0?"text-green-400 font-medium":"text-red-400 font-medium",children:["¥",k.userCommissionInfo.availableAfterThis.toFixed(2)]})]})]}):t.jsx("span",{className:"text-gray-500 text-xs",children:"暂无数据"})}),t.jsxs("td",{className:"p-4",children:[V(k.status),k.errorMessage&&t.jsx("p",{className:"text-xs text-red-400 mt-1",children:k.errorMessage})]}),t.jsx("td",{className:"p-4 text-gray-400",children:k.processedAt?new Date(k.processedAt).toLocaleString():"-"}),t.jsx("td",{className:"p-4 text-gray-400",children:k.userConfirmedAt?t.jsxs("span",{className:"text-green-400",title:k.userConfirmedAt,children:["已确认 ",new Date(k.userConfirmedAt).toLocaleString()]}):"-"}),t.jsxs("td",{className:"p-4 text-right",children:[(k.status==="pending"||k.status==="pending_confirm")&&t.jsxs("div",{className:"flex items-center justify-end gap-2",children:[t.jsxs(ee,{size:"sm",onClick:()=>M(k.id),disabled:b===k.id,className:"bg-green-600 hover:bg-green-700 text-white",children:[t.jsx(Di,{className:"w-4 h-4 mr-1"}),"批准"]}),t.jsxs(ee,{size:"sm",variant:"outline",onClick:()=>D(k.id),disabled:b===k.id,className:"border-red-500/50 text-red-400 hover:bg-red-500/10 bg-transparent",children:[t.jsx(pr,{className:"w-4 h-4 mr-1"}),"拒绝"]})]}),(k.status==="success"||k.status==="completed")&&k.transactionId&&t.jsx("span",{className:"text-xs text-gray-500 font-mono",children:k.transactionId})]})]},k.id))})]})}),t.jsx(In,{page:v,totalPages:w,total:C,pageSize:P,onPageChange:y,onPageSizeChange:k=>{R(k),y(1)}})]})})})]})}const as=h.forwardRef(({className:n,...a},l)=>t.jsx("textarea",{className:Je("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",n),ref:l,...a}));as.displayName="Textarea";function Ei(n,[a,l]){return Math.min(l,Math.max(a,n))}const y2=["top","right","bottom","left"],Mn=Math.min,ar=Math.max,Pi=Math.round,ui=Math.floor,Lr=n=>({x:n,y:n}),j2={left:"right",right:"left",bottom:"top",top:"bottom"},N2={start:"end",end:"start"};function bd(n,a,l){return ar(n,Mn(a,l))}function qr(n,a){return typeof n=="function"?n(a):n}function Xr(n){return n.split("-")[0]}function Qs(n){return n.split("-")[1]}function nu(n){return n==="x"?"y":"x"}function su(n){return n==="y"?"height":"width"}const b2=new Set(["top","bottom"]);function Dr(n){return b2.has(Xr(n))?"y":"x"}function au(n){return nu(Dr(n))}function w2(n,a,l){l===void 0&&(l=!1);const o=Qs(n),c=au(n),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=Ri(f)),[f,Ri(f)]}function S2(n){const a=Ri(n);return[wd(n),a,wd(a)]}function wd(n){return n.replace(/start|end/g,a=>N2[a])}const Ym=["left","right"],Gm=["right","left"],C2=["top","bottom"],k2=["bottom","top"];function E2(n,a,l){switch(n){case"top":case"bottom":return l?a?Gm:Ym:a?Ym:Gm;case"left":case"right":return a?C2:k2;default:return[]}}function P2(n,a,l,o){const c=Qs(n);let u=E2(Xr(n),l==="start",o);return c&&(u=u.map(f=>f+"-"+c),a&&(u=u.concat(u.map(wd)))),u}function Ri(n){return n.replace(/left|right|bottom|top/g,a=>j2[a])}function R2(n){return{top:0,right:0,bottom:0,left:0,...n}}function Yx(n){return typeof n!="number"?R2(n):{top:n,right:n,bottom:n,left:n}}function Ti(n){const{x:a,y:l,width:o,height:c}=n;return{width:o,height:c,top:l,left:a,right:a+o,bottom:l+c,x:a,y:l}}function Qm(n,a,l){let{reference:o,floating:c}=n;const u=Dr(a),f=au(a),p=su(f),x=Xr(a),g=u==="y",v=o.x+o.width/2-c.width/2,y=o.y+o.height/2-c.height/2,P=o[p]/2-c[p]/2;let R;switch(x){case"top":R={x:v,y:o.y-c.height};break;case"bottom":R={x:v,y:o.y+o.height};break;case"right":R={x:o.x+o.width,y};break;case"left":R={x:o.x-c.width,y};break;default:R={x:o.x,y:o.y}}switch(Qs(a)){case"start":R[f]-=P*(l&&g?-1:1);break;case"end":R[f]+=P*(l&&g?-1:1);break}return R}async function T2(n,a){var l;a===void 0&&(a={});const{x:o,y:c,platform:u,rects:f,elements:p,strategy:x}=n,{boundary:g="clippingAncestors",rootBoundary:v="viewport",elementContext:y="floating",altBoundary:P=!1,padding:R=0}=qr(a,n),C=Yx(R),b=p[P?y==="floating"?"reference":"floating":y],S=Ti(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(p.floating)),boundary:g,rootBoundary:v,strategy:x})),E=y==="floating"?{x:o,y:c,width:f.floating.width,height:f.floating.height}:f.reference,w=await(u.getOffsetParent==null?void 0:u.getOffsetParent(p.floating)),M=await(u.isElement==null?void 0:u.isElement(w))?await(u.getScale==null?void 0:u.getScale(w))||{x:1,y:1}:{x:1,y:1},D=Ti(u.convertOffsetParentRelativeRectToViewportRelativeRect?await u.convertOffsetParentRelativeRectToViewportRelativeRect({elements:p,rect:E,offsetParent:w,strategy:x}):E);return{top:(S.top-D.top+C.top)/M.y,bottom:(D.bottom-S.bottom+C.bottom)/M.y,left:(S.left-D.left+C.left)/M.x,right:(D.right-S.right+C.right)/M.x}}const _2=async(n,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:n,floating:a,strategy:c}),{x:v,y}=Qm(g,o,x),P=o,R={},C=0;for(let b=0;b({name:"arrow",options:n,async fn(a){const{x:l,y:o,placement:c,rects:u,platform:f,elements:p,middlewareData:x}=a,{element:g,padding:v=0}=qr(n,a)||{};if(g==null)return{};const y=Yx(v),P={x:l,y:o},R=au(c),C=su(R),j=await f.getDimensions(g),b=R==="y",S=b?"top":"left",E=b?"bottom":"right",w=b?"clientHeight":"clientWidth",M=u.reference[C]+u.reference[R]-P[R]-u.floating[C],D=P[R]-u.reference[R],V=await(f.getOffsetParent==null?void 0:f.getOffsetParent(g));let k=V?V[w]:0;(!k||!await(f.isElement==null?void 0:f.isElement(V)))&&(k=p.floating[w]||u.floating[C]);const T=M/2-D/2,U=k/2-j[C]/2-1,Q=Mn(y[S],U),te=Mn(y[E],U),oe=Q,he=k-j[C]-te,ne=k/2-j[C]/2+T,le=bd(oe,ne,he),Z=!x.arrow&&Qs(c)!=null&&ne!==le&&u.reference[C]/2-(nene<=0)){var te,oe;const ne=(((te=u.flip)==null?void 0:te.index)||0)+1,le=k[ne];if(le&&(!(y==="alignment"?E!==Dr(le):!1)||Q.every(_=>Dr(_.placement)===E?_.overflows[0]>0:!0)))return{data:{index:ne,overflows:Q},reset:{placement:le}};let Z=(oe=Q.filter($=>$.overflows[0]<=0).sort(($,_)=>$.overflows[1]-_.overflows[1])[0])==null?void 0:oe.placement;if(!Z)switch(R){case"bestFit":{var he;const $=(he=Q.filter(_=>{if(V){const q=Dr(_.placement);return q===E||q==="y"}return!0}).map(_=>[_.placement,_.overflows.filter(q=>q>0).reduce((q,z)=>q+z,0)]).sort((_,q)=>_[1]-q[1])[0])==null?void 0:he[0];$&&(Z=$);break}case"initialPlacement":Z=p;break}if(c!==Z)return{reset:{placement:Z}}}return{}}}};function qm(n,a){return{top:n.top-a.height,right:n.right-a.width,bottom:n.bottom-a.height,left:n.left-a.width}}function Xm(n){return y2.some(a=>n[a]>=0)}const M2=function(n){return n===void 0&&(n={}),{name:"hide",options:n,async fn(a){const{rects:l,platform:o}=a,{strategy:c="referenceHidden",...u}=qr(n,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{}}}}},Gx=new Set(["left","top"]);async function D2(n,a){const{placement:l,platform:o,elements:c}=n,u=await(o.isRTL==null?void 0:o.isRTL(c.floating)),f=Xr(l),p=Qs(l),x=Dr(l)==="y",g=Gx.has(f)?-1:1,v=u&&x?-1:1,y=qr(a,n);let{mainAxis:P,crossAxis:R,alignmentAxis:C}=typeof y=="number"?{mainAxis:y,crossAxis:0,alignmentAxis:null}:{mainAxis:y.mainAxis||0,crossAxis:y.crossAxis||0,alignmentAxis:y.alignmentAxis};return p&&typeof C=="number"&&(R=p==="end"?C*-1:C),x?{x:R*v,y:P*g}:{x:P*g,y:R*v}}const L2=function(n){return n===void 0&&(n=0),{name:"offset",options:n,async fn(a){var l,o;const{x:c,y:u,placement:f,middlewareData:p}=a,x=await D2(a,n);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(n){return n===void 0&&(n={}),{name:"shift",options:n,async fn(a){const{x:l,y:o,placement:c,platform:u}=a,{mainAxis:f=!0,crossAxis:p=!1,limiter:x={fn:S=>{let{x:E,y:w}=S;return{x:E,y:w}}},...g}=qr(n,a),v={x:l,y:o},y=await u.detectOverflow(a,g),P=Dr(Xr(c)),R=nu(P);let C=v[R],j=v[P];if(f){const S=R==="y"?"top":"left",E=R==="y"?"bottom":"right",w=C+y[S],M=C-y[E];C=bd(w,C,M)}if(p){const S=P==="y"?"top":"left",E=P==="y"?"bottom":"right",w=j+y[S],M=j-y[E];j=bd(w,j,M)}const b=x.fn({...a,[R]:C,[P]:j});return{...b,data:{x:b.x-l,y:b.y-o,enabled:{[R]:f,[P]:p}}}}}},F2=function(n){return n===void 0&&(n={}),{options:n,fn(a){const{x:l,y:o,placement:c,rects:u,middlewareData:f}=a,{offset:p=0,mainAxis:x=!0,crossAxis:g=!0}=qr(n,a),v={x:l,y:o},y=Dr(c),P=nu(y);let R=v[P],C=v[y];const j=qr(p,a),b=typeof j=="number"?{mainAxis:j,crossAxis:0}:{mainAxis:0,crossAxis:0,...j};if(x){const w=P==="y"?"height":"width",M=u.reference[P]-u.floating[w]+b.mainAxis,D=u.reference[P]+u.reference[w]-b.mainAxis;RD&&(R=D)}if(g){var S,E;const w=P==="y"?"width":"height",M=Gx.has(Xr(c)),D=u.reference[y]-u.floating[w]+(M&&((S=f.offset)==null?void 0:S[y])||0)+(M?0:b.crossAxis),V=u.reference[y]+u.reference[w]+(M?0:((E=f.offset)==null?void 0:E[y])||0)-(M?b.crossAxis:0);CV&&(C=V)}return{[P]:R,[y]:C}}}},z2=function(n){return n===void 0&&(n={}),{name:"size",options:n,async fn(a){var l,o;const{placement:c,rects:u,platform:f,elements:p}=a,{apply:x=()=>{},...g}=qr(n,a),v=await f.detectOverflow(a,g),y=Xr(c),P=Qs(c),R=Dr(c)==="y",{width:C,height:j}=u.floating;let b,S;y==="top"||y==="bottom"?(b=y,S=P===(await(f.isRTL==null?void 0:f.isRTL(p.floating))?"start":"end")?"left":"right"):(S=y,b=P==="end"?"top":"bottom");const E=j-v.top-v.bottom,w=C-v.left-v.right,M=Mn(j-v[b],E),D=Mn(C-v[S],w),V=!a.middlewareData.shift;let k=M,T=D;if((l=a.middlewareData.shift)!=null&&l.enabled.x&&(T=w),(o=a.middlewareData.shift)!=null&&o.enabled.y&&(k=E),V&&!P){const Q=ar(v.left,0),te=ar(v.right,0),oe=ar(v.top,0),he=ar(v.bottom,0);R?T=C-2*(Q!==0||te!==0?Q+te:ar(v.left,v.right)):k=j-2*(oe!==0||he!==0?oe+he:ar(v.top,v.bottom))}await x({...a,availableWidth:T,availableHeight:k});const U=await f.getDimensions(p.floating);return C!==U.width||j!==U.height?{reset:{rects:!0}}:{}}}};function Wi(){return typeof window<"u"}function qs(n){return Qx(n)?(n.nodeName||"").toLowerCase():"#document"}function lr(n){var a;return(n==null||(a=n.ownerDocument)==null?void 0:a.defaultView)||window}function Fr(n){var a;return(a=(Qx(n)?n.ownerDocument:n.document)||window.document)==null?void 0:a.documentElement}function Qx(n){return Wi()?n instanceof Node||n instanceof lr(n).Node:!1}function kr(n){return Wi()?n instanceof Element||n instanceof lr(n).Element:!1}function Or(n){return Wi()?n instanceof HTMLElement||n instanceof lr(n).HTMLElement:!1}function Jm(n){return!Wi()||typeof ShadowRoot>"u"?!1:n instanceof ShadowRoot||n instanceof lr(n).ShadowRoot}const $2=new Set(["inline","contents"]);function Ga(n){const{overflow:a,overflowX:l,overflowY:o,display:c}=Er(n);return/auto|scroll|overlay|hidden|clip/.test(a+o+l)&&!$2.has(c)}const B2=new Set(["table","td","th"]);function U2(n){return B2.has(qs(n))}const V2=[":popover-open",":modal"];function Hi(n){return V2.some(a=>{try{return n.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(n){const a=iu(),l=kr(n)?Er(n):n;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 Y2(n){let a=Dn(n);for(;Or(a)&&!Ws(a);){if(lu(a))return a;if(Hi(a))return null;a=Dn(a)}return null}function iu(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const G2=new Set(["html","body","#document"]);function Ws(n){return G2.has(qs(n))}function Er(n){return lr(n).getComputedStyle(n)}function Ki(n){return kr(n)?{scrollLeft:n.scrollLeft,scrollTop:n.scrollTop}:{scrollLeft:n.scrollX,scrollTop:n.scrollY}}function Dn(n){if(qs(n)==="html")return n;const a=n.assignedSlot||n.parentNode||Jm(n)&&n.host||Fr(n);return Jm(a)?a.host:a}function qx(n){const a=Dn(n);return Ws(a)?n.ownerDocument?n.ownerDocument.body:n.body:Or(a)&&Ga(a)?a:qx(a)}function Va(n,a,l){var o;a===void 0&&(a=[]),l===void 0&&(l=!0);const c=qx(n),u=c===((o=n.ownerDocument)==null?void 0:o.body),f=lr(c);if(u){const p=Sd(f);return a.concat(f,f.visualViewport||[],Ga(c)?c:[],p&&l?Va(p):[])}return a.concat(c,Va(c,[],l))}function Sd(n){return n.parent&&Object.getPrototypeOf(n.parent)?n.frameElement:null}function Xx(n){const a=Er(n);let l=parseFloat(a.width)||0,o=parseFloat(a.height)||0;const c=Or(n),u=c?n.offsetWidth:l,f=c?n.offsetHeight:o,p=Pi(l)!==u||Pi(o)!==f;return p&&(l=u,o=f),{width:l,height:o,$:p}}function ou(n){return kr(n)?n:n.contextElement}function Bs(n){const a=ou(n);if(!Or(a))return Lr(1);const l=a.getBoundingClientRect(),{width:o,height:c,$:u}=Xx(a);let f=(u?Pi(l.width):l.width)/o,p=(u?Pi(l.height):l.height)/c;return(!f||!Number.isFinite(f))&&(f=1),(!p||!Number.isFinite(p))&&(p=1),{x:f,y:p}}const Q2=Lr(0);function Jx(n){const a=lr(n);return!iu()||!a.visualViewport?Q2:{x:a.visualViewport.offsetLeft,y:a.visualViewport.offsetTop}}function q2(n,a,l){return a===void 0&&(a=!1),!l||a&&l!==lr(n)?!1:a}function os(n,a,l,o){a===void 0&&(a=!1),l===void 0&&(l=!1);const c=n.getBoundingClientRect(),u=ou(n);let f=Lr(1);a&&(o?kr(o)&&(f=Bs(o)):f=Bs(n));const p=q2(u,l,o)?Jx(u):Lr(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 P=lr(u),R=o&&kr(o)?lr(o):o;let C=P,j=Sd(C);for(;j&&o&&R!==C;){const b=Bs(j),S=j.getBoundingClientRect(),E=Er(j),w=S.left+(j.clientLeft+parseFloat(E.paddingLeft))*b.x,M=S.top+(j.clientTop+parseFloat(E.paddingTop))*b.y;x*=b.x,g*=b.y,v*=b.x,y*=b.y,x+=w,g+=M,C=lr(j),j=Sd(C)}}return Ti({width:v,height:y,x,y:g})}function Yi(n,a){const l=Ki(n).scrollLeft;return a?a.left+l:os(Fr(n)).left+l}function Zx(n,a){const l=n.getBoundingClientRect(),o=l.left+a.scrollLeft-Yi(n,l),c=l.top+a.scrollTop;return{x:o,y:c}}function X2(n){let{elements:a,rect:l,offsetParent:o,strategy:c}=n;const u=c==="fixed",f=Fr(o),p=a?Hi(a.floating):!1;if(o===f||p&&u)return l;let x={scrollLeft:0,scrollTop:0},g=Lr(1);const v=Lr(0),y=Or(o);if((y||!y&&!u)&&((qs(o)!=="body"||Ga(f))&&(x=Ki(o)),Or(o))){const R=os(o);g=Bs(o),v.x=R.x+o.clientLeft,v.y=R.y+o.clientTop}const P=f&&!y&&!u?Zx(f,x):Lr(0);return{width:l.width*g.x,height:l.height*g.y,x:l.x*g.x-x.scrollLeft*g.x+v.x+P.x,y:l.y*g.y-x.scrollTop*g.y+v.y+P.y}}function J2(n){return Array.from(n.getClientRects())}function Z2(n){const a=Fr(n),l=Ki(n),o=n.ownerDocument.body,c=ar(a.scrollWidth,a.clientWidth,o.scrollWidth,o.clientWidth),u=ar(a.scrollHeight,a.clientHeight,o.scrollHeight,o.clientHeight);let f=-l.scrollLeft+Yi(n);const p=-l.scrollTop;return Er(o).direction==="rtl"&&(f+=ar(a.clientWidth,o.clientWidth)-c),{width:c,height:u,x:f,y:p}}const Zm=25;function eS(n,a){const l=lr(n),o=Fr(n),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=Yi(o);if(g<=0){const v=o.ownerDocument,y=v.body,P=getComputedStyle(y),R=v.compatMode==="CSS1Compat"&&parseFloat(P.marginLeft)+parseFloat(P.marginRight)||0,C=Math.abs(o.clientWidth-y.clientWidth-R);C<=Zm&&(u-=C)}else g<=Zm&&(u+=g);return{width:u,height:f,x:p,y:x}}const tS=new Set(["absolute","fixed"]);function rS(n,a){const l=os(n,!0,a==="fixed"),o=l.top+n.clientTop,c=l.left+n.clientLeft,u=Or(n)?Bs(n):Lr(1),f=n.clientWidth*u.x,p=n.clientHeight*u.y,x=c*u.x,g=o*u.y;return{width:f,height:p,x,y:g}}function ep(n,a,l){let o;if(a==="viewport")o=eS(n,l);else if(a==="document")o=Z2(Fr(n));else if(kr(a))o=rS(a,l);else{const c=Jx(n);o={x:a.x-c.x,y:a.y-c.y,width:a.width,height:a.height}}return Ti(o)}function eg(n,a){const l=Dn(n);return l===a||!kr(l)||Ws(l)?!1:Er(l).position==="fixed"||eg(l,a)}function nS(n,a){const l=a.get(n);if(l)return l;let o=Va(n,[],!1).filter(p=>kr(p)&&qs(p)!=="body"),c=null;const u=Er(n).position==="fixed";let f=u?Dn(n):n;for(;kr(f)&&!Ws(f);){const p=Er(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(n,f))?o=o.filter(v=>v!==f):c=p,f=Dn(f)}return a.set(n,o),o}function sS(n){let{element:a,boundary:l,rootBoundary:o,strategy:c}=n;const f=[...l==="clippingAncestors"?Hi(a)?[]:nS(a,this._c):[].concat(l),o],p=f[0],x=f.reduce((g,v)=>{const y=ep(a,v,c);return g.top=ar(y.top,g.top),g.right=Mn(y.right,g.right),g.bottom=Mn(y.bottom,g.bottom),g.left=ar(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(n){const{width:a,height:l}=Xx(n);return{width:a,height:l}}function lS(n,a,l){const o=Or(a),c=Fr(a),u=l==="fixed",f=os(n,!0,u,a);let p={scrollLeft:0,scrollTop:0};const x=Lr(0);function g(){x.x=Yi(c)}if(o||!o&&!u)if((qs(a)!=="body"||Ga(c))&&(p=Ki(a)),o){const R=os(a,!0,u,a);x.x=R.x+a.clientLeft,x.y=R.y+a.clientTop}else c&&g();u&&!o&&c&&g();const v=c&&!o&&!u?Zx(c,p):Lr(0),y=f.left+p.scrollLeft-x.x-v.x,P=f.top+p.scrollTop-x.y-v.y;return{x:y,y:P,width:f.width,height:f.height}}function ad(n){return Er(n).position==="static"}function tp(n,a){if(!Or(n)||Er(n).position==="fixed")return null;if(a)return a(n);let l=n.offsetParent;return Fr(n)===l&&(l=l.ownerDocument.body),l}function tg(n,a){const l=lr(n);if(Hi(n))return l;if(!Or(n)){let c=Dn(n);for(;c&&!Ws(c);){if(kr(c)&&!ad(c))return c;c=Dn(c)}return l}let o=tp(n,a);for(;o&&U2(o)&&ad(o);)o=tp(o,a);return o&&Ws(o)&&ad(o)&&!lu(o)?l:o||Y2(n)||l}const iS=async function(n){const a=this.getOffsetParent||tg,l=this.getDimensions,o=await l(n.floating);return{reference:lS(n.reference,await a(n.floating),n.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}};function oS(n){return Er(n).direction==="rtl"}const cS={convertOffsetParentRelativeRectToViewportRelativeRect:X2,getDocumentElement:Fr,getClippingRect:sS,getOffsetParent:tg,getElementRects:iS,getClientRects:J2,getDimensions:aS,getScale:Bs,isElement:kr,isRTL:oS};function rg(n,a){return n.x===a.x&&n.y===a.y&&n.width===a.width&&n.height===a.height}function dS(n,a){let l=null,o;const c=Fr(n);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=n.getBoundingClientRect(),{left:v,top:y,width:P,height:R}=g;if(p||a(),!P||!R)return;const C=ui(y),j=ui(c.clientWidth-(v+P)),b=ui(c.clientHeight-(y+R)),S=ui(v),w={rootMargin:-C+"px "+-j+"px "+-b+"px "+-S+"px",threshold:ar(0,Mn(1,x))||1};let M=!0;function D(V){const k=V[0].intersectionRatio;if(k!==x){if(!M)return f();k?f(!1,k):o=setTimeout(()=>{f(!1,1e-7)},1e3)}k===1&&!rg(g,n.getBoundingClientRect())&&f(),M=!1}try{l=new IntersectionObserver(D,{...w,root:c.ownerDocument})}catch{l=new IntersectionObserver(D,w)}l.observe(n)}return f(!0),u}function uS(n,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(n),v=c||u?[...g?Va(g):[],...Va(a)]:[];v.forEach(S=>{c&&S.addEventListener("scroll",l,{passive:!0}),u&&S.addEventListener("resize",l)});const y=g&&p?dS(g,l):null;let P=-1,R=null;f&&(R=new ResizeObserver(S=>{let[E]=S;E&&E.target===g&&R&&(R.unobserve(a),cancelAnimationFrame(P),P=requestAnimationFrame(()=>{var w;(w=R)==null||w.observe(a)})),l()}),g&&!x&&R.observe(g),R.observe(a));let C,j=x?os(n):null;x&&b();function b(){const S=os(n);j&&!rg(j,S)&&l(),j=S,C=requestAnimationFrame(b)}return l(),()=>{var S;v.forEach(E=>{c&&E.removeEventListener("scroll",l),u&&E.removeEventListener("resize",l)}),y==null||y(),(S=R)==null||S.disconnect(),R=null,x&&cancelAnimationFrame(C)}}const fS=L2,hS=O2,mS=A2,pS=z2,xS=M2,rp=I2,gS=F2,vS=(n,a,l)=>{const o=new Map,c={platform:cS,...l},u={...c.platform,_c:o};return _2(n,a,{...c,platform:u})};var yS=typeof document<"u",jS=function(){},xi=yS?h.useLayoutEffect:jS;function _i(n,a){if(n===a)return!0;if(typeof n!=typeof a)return!1;if(typeof n=="function"&&n.toString()===a.toString())return!0;let l,o,c;if(n&&a&&typeof n=="object"){if(Array.isArray(n)){if(l=n.length,l!==a.length)return!1;for(o=l;o--!==0;)if(!_i(n[o],a[o]))return!1;return!0}if(c=Object.keys(n),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"&&n.$$typeof)&&!_i(n[u],a[u]))return!1}return!0}return n!==n&&a!==a}function ng(n){return typeof window>"u"?1:(n.ownerDocument.defaultView||window).devicePixelRatio||1}function np(n,a){const l=ng(n);return Math.round(a*l)/l}function ld(n){const a=h.useRef(n);return xi(()=>{a.current=n}),a}function NS(n){n===void 0&&(n={});const{placement:a="bottom",strategy:l="absolute",middleware:o=[],platform:c,elements:{reference:u,floating:f}={},transform:p=!0,whileElementsMounted:x,open:g}=n,[v,y]=h.useState({x:0,y:0,strategy:l,placement:a,middlewareData:{},isPositioned:!1}),[P,R]=h.useState(o);_i(P,o)||R(o);const[C,j]=h.useState(null),[b,S]=h.useState(null),E=h.useCallback(_=>{_!==V.current&&(V.current=_,j(_))},[]),w=h.useCallback(_=>{_!==k.current&&(k.current=_,S(_))},[]),M=u||C,D=f||b,V=h.useRef(null),k=h.useRef(null),T=h.useRef(v),U=x!=null,Q=ld(x),te=ld(c),oe=ld(g),he=h.useCallback(()=>{if(!V.current||!k.current)return;const _={placement:a,strategy:l,middleware:P};te.current&&(_.platform=te.current),vS(V.current,k.current,_).then(q=>{const z={...q,isPositioned:oe.current!==!1};ne.current&&!_i(T.current,z)&&(T.current=z,Wa.flushSync(()=>{y(z)}))})},[P,a,l,te,oe]);xi(()=>{g===!1&&T.current.isPositioned&&(T.current.isPositioned=!1,y(_=>({..._,isPositioned:!1})))},[g]);const ne=h.useRef(!1);xi(()=>(ne.current=!0,()=>{ne.current=!1}),[]),xi(()=>{if(M&&(V.current=M),D&&(k.current=D),M&&D){if(Q.current)return Q.current(M,D,he);he()}},[M,D,he,Q,U]);const le=h.useMemo(()=>({reference:V,floating:k,setReference:E,setFloating:w}),[E,w]),Z=h.useMemo(()=>({reference:M,floating:D}),[M,D]),$=h.useMemo(()=>{const _={position:l,left:0,top:0};if(!Z.floating)return _;const q=np(Z.floating,v.x),z=np(Z.floating,v.y);return p?{..._,transform:"translate("+q+"px, "+z+"px)",...ng(Z.floating)>=1.5&&{willChange:"transform"}}:{position:l,left:q,top:z}},[l,p,Z.floating,v.x,v.y]);return h.useMemo(()=>({...v,update:he,refs:le,elements:Z,floatingStyles:$}),[v,he,le,Z,$])}const bS=n=>{function a(l){return{}.hasOwnProperty.call(l,"current")}return{name:"arrow",options:n,fn(l){const{element:o,padding:c}=typeof n=="function"?n(l):n;return o&&a(o)?o.current!=null?rp({element:o.current,padding:c}).fn(l):{}:o?rp({element:o,padding:c}).fn(l):{}}}},wS=(n,a)=>({...fS(n),options:[n,a]}),SS=(n,a)=>({...hS(n),options:[n,a]}),CS=(n,a)=>({...gS(n),options:[n,a]}),kS=(n,a)=>({...mS(n),options:[n,a]}),ES=(n,a)=>({...pS(n),options:[n,a]}),PS=(n,a)=>({...xS(n),options:[n,a]}),RS=(n,a)=>({...bS(n),options:[n,a]});var TS="Arrow",sg=h.forwardRef((n,a)=>{const{children:l,width:o=10,height:c=5,...u}=n;return t.jsx(Ue.svg,{...u,ref:a,width:o,height:c,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:n.asChild?l:t.jsx("polygon",{points:"0,0 30,0 15,10"})})});sg.displayName=TS;var _S=sg,cu="Popper",[ag,lg]=On(cu),[IS,ig]=ag(cu),og=n=>{const{__scopePopper:a,children:l}=n,[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((n,a)=>{const{__scopePopper:l,virtualRef:o,...c}=n,u=ig(cg,l),f=h.useRef(null),p=Xe(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(Ue.div,{...c,ref:p})});dg.displayName=cg;var du="PopperContent",[AS,MS]=ag(du),ug=h.forwardRef((n,a)=>{var re,ye,L,de,ge,_e;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:P=!1,updatePositionStrategy:R="optimized",onPlaced:C,...j}=n,b=ig(du,l),[S,E]=h.useState(null),w=Xe(a,Oe=>E(Oe)),[M,D]=h.useState(null),V=Zd(M),k=(V==null?void 0:V.width)??0,T=(V==null?void 0:V.height)??0,U=o+(u!=="center"?"-"+u:""),Q=typeof v=="number"?v:{top:0,right:0,bottom:0,left:0,...v},te=Array.isArray(g)?g:[g],oe=te.length>0,he={padding:Q,boundary:te.filter(LS),altBoundary:oe},{refs:ne,floatingStyles:le,placement:Z,isPositioned:$,middlewareData:_}=NS({strategy:"fixed",placement:U,whileElementsMounted:(...Oe)=>uS(...Oe,{animationFrame:R==="always"}),elements:{reference:b.anchor},middleware:[wS({mainAxis:c+T,alignmentAxis:f}),x&&SS({mainAxis:!0,crossAxis:!1,limiter:y==="partial"?CS():void 0,...he}),x&&kS({...he}),ES({...he,apply:({elements:Oe,rects:ze,availableWidth:qe,availableHeight:rt})=>{const{width:et,height:kt}=ze.reference,Et=Oe.floating.style;Et.setProperty("--radix-popper-available-width",`${qe}px`),Et.setProperty("--radix-popper-available-height",`${rt}px`),Et.setProperty("--radix-popper-anchor-width",`${et}px`),Et.setProperty("--radix-popper-anchor-height",`${kt}px`)}}),M&&RS({element:M,padding:p}),OS({arrowWidth:k,arrowHeight:T}),P&&PS({strategy:"referenceHidden",...he})]}),[q,z]=mg(Z),A=An(C);Vt(()=>{$&&(A==null||A())},[$,A]);const F=(re=_.arrow)==null?void 0:re.x,G=(ye=_.arrow)==null?void 0:ye.y,J=((L=_.arrow)==null?void 0:L.centerOffset)!==0,[xe,me]=h.useState();return Vt(()=>{S&&me(window.getComputedStyle(S).zIndex)},[S]),t.jsx("div",{ref:ne.setFloating,"data-radix-popper-content-wrapper":"",style:{...le,transform:$?le.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:xe,"--radix-popper-transform-origin":[(de=_.transformOrigin)==null?void 0:de.x,(ge=_.transformOrigin)==null?void 0:ge.y].join(" "),...((_e=_.hide)==null?void 0:_e.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:n.dir,children:t.jsx(AS,{scope:l,placedSide:q,onArrowChange:D,arrowX:F,arrowY:G,shouldHideArrow:J,children:t.jsx(Ue.div,{"data-side":q,"data-align":z,...j,ref:w,style:{...j.style,animation:$?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(_S,{...c,ref:l,style:{...c.style,display:"block"}})})});hg.displayName=fg;function LS(n){return n!==null}var OS=n=>({name:"transformOrigin",options:n,fn(a){var b,S,E;const{placement:l,rects:o,middlewareData:c}=a,f=((b=c.arrow)==null?void 0:b.centerOffset)!==0,p=f?0:n.arrowWidth,x=f?0:n.arrowHeight,[g,v]=mg(l),y={start:"0%",center:"50%",end:"100%"}[v],P=(((S=c.arrow)==null?void 0:S.x)??0)+p/2,R=(((E=c.arrow)==null?void 0:E.y)??0)+x/2;let C="",j="";return g==="bottom"?(C=f?y:`${P}px`,j=`${-x}px`):g==="top"?(C=f?y:`${P}px`,j=`${o.floating.height+x}px`):g==="right"?(C=`${-x}px`,j=f?y:`${R}px`):g==="left"&&(C=`${o.floating.width+x}px`,j=f?y:`${R}px`),{data:{x:C,y:j}}}});function mg(n){const[a,l="center"]=n.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((n,a)=>t.jsx(Ue.span,{...n,ref:a,style:{...pg,...n.style}}));VS.displayName=US;var WS=[" ","Enter","ArrowUp","ArrowDown"],HS=[" ","Enter"],cs="Select",[Gi,Qi,KS]=eu(cs),[Xs]=On(cs,[KS,lg]),qi=lg(),[YS,Fn]=Xs(cs),[GS,QS]=Xs(cs),xg=n=>{const{__scopeSelect:a,children:l,open:o,defaultOpen:c,onOpenChange:u,value:f,defaultValue:p,onValueChange:x,dir:g,name:v,autoComplete:y,disabled:P,required:R,form:C}=n,j=qi(a),[b,S]=h.useState(null),[E,w]=h.useState(null),[M,D]=h.useState(!1),V=Bi(g),[k,T]=ls({prop:o,defaultProp:c??!1,onChange:u,caller:cs}),[U,Q]=ls({prop:f,defaultProp:p,onChange:x,caller:cs}),te=h.useRef(null),oe=b?C||!!b.closest("form"):!0,[he,ne]=h.useState(new Set),le=Array.from(he).map(Z=>Z.props.value).join(";");return t.jsx(FS,{...j,children:t.jsxs(YS,{required:R,scope:a,trigger:b,onTriggerChange:S,valueNode:E,onValueNodeChange:w,valueNodeHasChildren:M,onValueNodeHasChildrenChange:D,contentId:_n(),value:U,onValueChange:Q,open:k,onOpenChange:T,dir:V,triggerPointerDownPosRef:te,disabled:P,children:[t.jsx(Gi.Provider,{scope:a,children:t.jsx(GS,{scope:n.__scopeSelect,onNativeOptionAdd:h.useCallback(Z=>{ne($=>new Set($).add(Z))},[]),onNativeOptionRemove:h.useCallback(Z=>{ne($=>{const _=new Set($);return _.delete(Z),_})},[]),children:l})}),oe?t.jsxs(Fg,{"aria-hidden":!0,required:R,tabIndex:-1,name:v,autoComplete:y,value:U,onChange:Z=>Q(Z.target.value),disabled:P,form:C,children:[U===void 0?t.jsx("option",{value:""}):null,Array.from(he)]},le):null]})})};xg.displayName=cs;var gg="SelectTrigger",vg=h.forwardRef((n,a)=>{const{__scopeSelect:l,disabled:o=!1,...c}=n,u=qi(l),f=Fn(gg,l),p=f.disabled||o,x=Xe(a,f.onTriggerChange),g=Qi(l),v=h.useRef("touch"),[y,P,R]=$g(j=>{const b=g().filter(w=>!w.disabled),S=b.find(w=>w.value===f.value),E=Bg(b,j,S);E!==void 0&&f.onValueChange(E.value)}),C=j=>{p||(f.onOpenChange(!0),R()),j&&(f.triggerPointerDownPosRef.current={x:Math.round(j.pageX),y:Math.round(j.pageY)})};return t.jsx(zS,{asChild:!0,...u,children:t.jsx(Ue.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:Fe(c.onClick,j=>{j.currentTarget.focus(),v.current!=="mouse"&&C(j)}),onPointerDown:Fe(c.onPointerDown,j=>{v.current=j.pointerType;const b=j.target;b.hasPointerCapture(j.pointerId)&&b.releasePointerCapture(j.pointerId),j.button===0&&j.ctrlKey===!1&&j.pointerType==="mouse"&&(C(j),j.preventDefault())}),onKeyDown:Fe(c.onKeyDown,j=>{const b=y.current!=="";!(j.ctrlKey||j.altKey||j.metaKey)&&j.key.length===1&&P(j.key),!(b&&j.key===" ")&&WS.includes(j.key)&&(C(),j.preventDefault())})})})});vg.displayName=gg;var yg="SelectValue",jg=h.forwardRef((n,a)=>{const{__scopeSelect:l,className:o,style:c,children:u,placeholder:f="",...p}=n,x=Fn(yg,l),{onValueNodeHasChildrenChange:g}=x,v=u!==void 0,y=Xe(a,x.onValueNodeChange);return Vt(()=>{g(v)},[g,v]),t.jsx(Ue.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((n,a)=>{const{__scopeSelect:l,children:o,...c}=n;return t.jsx(Ue.span,{"aria-hidden":!0,...c,ref:a,children:o||"▼"})});Ng.displayName=qS;var XS="SelectPortal",bg=n=>t.jsx(Kd,{asChild:!0,...n});bg.displayName=XS;var ds="SelectContent",wg=h.forwardRef((n,a)=>{const l=Fn(ds,n.__scopeSelect),[o,c]=h.useState();if(Vt(()=>{c(new DocumentFragment)},[]),!l.open){const u=o;return u?Wa.createPortal(t.jsx(Sg,{scope:n.__scopeSelect,children:t.jsx(Gi.Slot,{scope:n.__scopeSelect,children:t.jsx("div",{children:n.children})})}),u):null}return t.jsx(Cg,{...n,ref:a})});wg.displayName=ds;var Sr=10,[Sg,zn]=Xs(ds),JS="SelectContentImpl",ZS=Ua("SelectContent.RemoveScroll"),Cg=h.forwardRef((n,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:P,collisionPadding:R,sticky:C,hideWhenDetached:j,avoidCollisions:b,...S}=n,E=Fn(ds,l),[w,M]=h.useState(null),[D,V]=h.useState(null),k=Xe(a,re=>M(re)),[T,U]=h.useState(null),[Q,te]=h.useState(null),oe=Qi(l),[he,ne]=h.useState(!1),le=h.useRef(!1);h.useEffect(()=>{if(w)return nx(w)},[w]),Gp();const Z=h.useCallback(re=>{const[ye,...L]=oe().map(_e=>_e.ref.current),[de]=L.slice(-1),ge=document.activeElement;for(const _e of re)if(_e===ge||(_e==null||_e.scrollIntoView({block:"nearest"}),_e===ye&&D&&(D.scrollTop=0),_e===de&&D&&(D.scrollTop=D.scrollHeight),_e==null||_e.focus(),document.activeElement!==ge))return},[oe,D]),$=h.useCallback(()=>Z([T,w]),[Z,T,w]);h.useEffect(()=>{he&&$()},[he,$]);const{onOpenChange:_,triggerPointerDownPosRef:q}=E;h.useEffect(()=>{if(w){let re={x:0,y:0};const ye=de=>{var ge,_e;re={x:Math.abs(Math.round(de.pageX)-(((ge=q.current)==null?void 0:ge.x)??0)),y:Math.abs(Math.round(de.pageY)-(((_e=q.current)==null?void 0:_e.y)??0))}},L=de=>{re.x<=10&&re.y<=10?de.preventDefault():w.contains(de.target)||_(!1),document.removeEventListener("pointermove",ye),q.current=null};return q.current!==null&&(document.addEventListener("pointermove",ye),document.addEventListener("pointerup",L,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",ye),document.removeEventListener("pointerup",L,{capture:!0})}}},[w,_,q]),h.useEffect(()=>{const re=()=>_(!1);return window.addEventListener("blur",re),window.addEventListener("resize",re),()=>{window.removeEventListener("blur",re),window.removeEventListener("resize",re)}},[_]);const[z,A]=$g(re=>{const ye=oe().filter(ge=>!ge.disabled),L=ye.find(ge=>ge.ref.current===document.activeElement),de=Bg(ye,re,L);de&&setTimeout(()=>de.ref.current.focus())}),F=h.useCallback((re,ye,L)=>{const de=!le.current&&!L;(E.value!==void 0&&E.value===ye||de)&&(U(re),de&&(le.current=!0))},[E.value]),G=h.useCallback(()=>w==null?void 0:w.focus(),[w]),J=h.useCallback((re,ye,L)=>{const de=!le.current&&!L;(E.value!==void 0&&E.value===ye||de)&&te(re)},[E.value]),xe=o==="popper"?Cd:kg,me=xe===Cd?{side:p,sideOffset:x,align:g,alignOffset:v,arrowPadding:y,collisionBoundary:P,collisionPadding:R,sticky:C,hideWhenDetached:j,avoidCollisions:b}:{};return t.jsx(Sg,{scope:l,content:w,viewport:D,onViewportChange:V,itemRefCallback:F,selectedItem:T,onItemLeave:G,itemTextRefCallback:J,focusSelectedItem:$,selectedItemText:Q,position:o,isPositioned:he,searchRef:z,children:t.jsx(Yd,{as:ZS,allowPinchZoom:!0,children:t.jsx(Hd,{asChild:!0,trapped:E.open,onMountAutoFocus:re=>{re.preventDefault()},onUnmountAutoFocus:Fe(c,re=>{var ye;(ye=E.trigger)==null||ye.focus({preventScroll:!0}),re.preventDefault()}),children:t.jsx(Wd,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:u,onPointerDownOutside:f,onFocusOutside:re=>re.preventDefault(),onDismiss:()=>E.onOpenChange(!1),children:t.jsx(xe,{role:"listbox",id:E.contentId,"data-state":E.open?"open":"closed",dir:E.dir,onContextMenu:re=>re.preventDefault(),...S,...me,onPlaced:()=>ne(!0),ref:k,style:{display:"flex",flexDirection:"column",outline:"none",...S.style},onKeyDown:Fe(S.onKeyDown,re=>{const ye=re.ctrlKey||re.altKey||re.metaKey;if(re.key==="Tab"&&re.preventDefault(),!ye&&re.key.length===1&&A(re.key),["ArrowUp","ArrowDown","Home","End"].includes(re.key)){let de=oe().filter(ge=>!ge.disabled).map(ge=>ge.ref.current);if(["ArrowUp","End"].includes(re.key)&&(de=de.slice().reverse()),["ArrowUp","ArrowDown"].includes(re.key)){const ge=re.target,_e=de.indexOf(ge);de=de.slice(_e+1)}setTimeout(()=>Z(de)),re.preventDefault()}})})})})})})});Cg.displayName=JS;var eC="SelectItemAlignedPosition",kg=h.forwardRef((n,a)=>{const{__scopeSelect:l,onPlaced:o,...c}=n,u=Fn(ds,l),f=zn(ds,l),[p,x]=h.useState(null),[g,v]=h.useState(null),y=Xe(a,k=>v(k)),P=Qi(l),R=h.useRef(!1),C=h.useRef(!0),{viewport:j,selectedItem:b,selectedItemText:S,focusSelectedItem:E}=f,w=h.useCallback(()=>{if(u.trigger&&u.valueNode&&p&&g&&j&&b&&S){const k=u.trigger.getBoundingClientRect(),T=g.getBoundingClientRect(),U=u.valueNode.getBoundingClientRect(),Q=S.getBoundingClientRect();if(u.dir!=="rtl"){const ge=Q.left-T.left,_e=U.left-ge,Oe=k.left-_e,ze=k.width+Oe,qe=Math.max(ze,T.width),rt=window.innerWidth-Sr,et=Ei(_e,[Sr,Math.max(Sr,rt-qe)]);p.style.minWidth=ze+"px",p.style.left=et+"px"}else{const ge=T.right-Q.right,_e=window.innerWidth-U.right-ge,Oe=window.innerWidth-k.right-_e,ze=k.width+Oe,qe=Math.max(ze,T.width),rt=window.innerWidth-Sr,et=Ei(_e,[Sr,Math.max(Sr,rt-qe)]);p.style.minWidth=ze+"px",p.style.right=et+"px"}const te=P(),oe=window.innerHeight-Sr*2,he=j.scrollHeight,ne=window.getComputedStyle(g),le=parseInt(ne.borderTopWidth,10),Z=parseInt(ne.paddingTop,10),$=parseInt(ne.borderBottomWidth,10),_=parseInt(ne.paddingBottom,10),q=le+Z+he+_+$,z=Math.min(b.offsetHeight*5,q),A=window.getComputedStyle(j),F=parseInt(A.paddingTop,10),G=parseInt(A.paddingBottom,10),J=k.top+k.height/2-Sr,xe=oe-J,me=b.offsetHeight/2,re=b.offsetTop+me,ye=le+Z+re,L=q-ye;if(ye<=J){const ge=te.length>0&&b===te[te.length-1].ref.current;p.style.bottom="0px";const _e=g.clientHeight-j.offsetTop-j.offsetHeight,Oe=Math.max(xe,me+(ge?G:0)+_e+$),ze=ye+Oe;p.style.height=ze+"px"}else{const ge=te.length>0&&b===te[0].ref.current;p.style.top="0px";const Oe=Math.max(J,le+j.offsetTop+(ge?F:0)+me)+L;p.style.height=Oe+"px",j.scrollTop=ye-J+j.offsetTop}p.style.margin=`${Sr}px 0`,p.style.minHeight=z+"px",p.style.maxHeight=oe+"px",o==null||o(),requestAnimationFrame(()=>R.current=!0)}},[P,u.trigger,u.valueNode,p,g,j,b,S,u.dir,o]);Vt(()=>w(),[w]);const[M,D]=h.useState();Vt(()=>{g&&D(window.getComputedStyle(g).zIndex)},[g]);const V=h.useCallback(k=>{k&&C.current===!0&&(w(),E==null||E(),C.current=!1)},[w,E]);return t.jsx(rC,{scope:l,contentWrapper:p,shouldExpandOnScrollRef:R,onScrollButtonChange:V,children:t.jsx("div",{ref:x,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:M},children:t.jsx(Ue.div,{...c,ref:y,style:{boxSizing:"border-box",maxHeight:"100%",...c.style}})})})});kg.displayName=eC;var tC="SelectPopperPosition",Cd=h.forwardRef((n,a)=>{const{__scopeSelect:l,align:o="start",collisionPadding:c=Sr,...u}=n,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[rC,uu]=Xs(ds,{}),kd="SelectViewport",Eg=h.forwardRef((n,a)=>{const{__scopeSelect:l,nonce:o,...c}=n,u=zn(kd,l),f=uu(kd,l),p=Xe(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(Gi.Slot,{scope:l,children:t.jsx(Ue.div,{"data-radix-select-viewport":"",role:"presentation",...c,ref:p,style:{position:"relative",flex:1,overflow:"hidden auto",...c.style},onScroll:Fe(c.onScroll,g=>{const v=g.currentTarget,{contentWrapper:y,shouldExpandOnScrollRef:P}=f;if(P!=null&&P.current&&y){const R=Math.abs(x.current-v.scrollTop);if(R>0){const C=window.innerHeight-Sr*2,j=parseFloat(y.style.minHeight),b=parseFloat(y.style.height),S=Math.max(j,b);if(S0?M:0,y.style.justifyContent="flex-end")}}}x.current=v.scrollTop})})})]})});Eg.displayName=kd;var Pg="SelectGroup",[nC,sC]=Xs(Pg),aC=h.forwardRef((n,a)=>{const{__scopeSelect:l,...o}=n,c=_n();return t.jsx(nC,{scope:l,id:c,children:t.jsx(Ue.div,{role:"group","aria-labelledby":c,...o,ref:a})})});aC.displayName=Pg;var Rg="SelectLabel",lC=h.forwardRef((n,a)=>{const{__scopeSelect:l,...o}=n,c=sC(Rg,l);return t.jsx(Ue.div,{id:c.id,...o,ref:a})});lC.displayName=Rg;var Ii="SelectItem",[iC,Tg]=Xs(Ii),_g=h.forwardRef((n,a)=>{const{__scopeSelect:l,value:o,disabled:c=!1,textValue:u,...f}=n,p=Fn(Ii,l),x=zn(Ii,l),g=p.value===o,[v,y]=h.useState(u??""),[P,R]=h.useState(!1),C=Xe(a,E=>{var w;return(w=x.itemRefCallback)==null?void 0:w.call(x,E,o,c)}),j=_n(),b=h.useRef("touch"),S=()=>{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:j,isSelected:g,onItemTextChange:h.useCallback(E=>{y(w=>w||((E==null?void 0:E.textContent)??"").trim())},[]),children:t.jsx(Gi.ItemSlot,{scope:l,value:o,disabled:c,textValue:v,children:t.jsx(Ue.div,{role:"option","aria-labelledby":j,"data-highlighted":P?"":void 0,"aria-selected":g&&P,"data-state":g?"checked":"unchecked","aria-disabled":c||void 0,"data-disabled":c?"":void 0,tabIndex:c?void 0:-1,...f,ref:C,onFocus:Fe(f.onFocus,()=>R(!0)),onBlur:Fe(f.onBlur,()=>R(!1)),onClick:Fe(f.onClick,()=>{b.current!=="mouse"&&S()}),onPointerUp:Fe(f.onPointerUp,()=>{b.current==="mouse"&&S()}),onPointerDown:Fe(f.onPointerDown,E=>{b.current=E.pointerType}),onPointerMove:Fe(f.onPointerMove,E=>{var w;b.current=E.pointerType,c?(w=x.onItemLeave)==null||w.call(x):b.current==="mouse"&&E.currentTarget.focus({preventScroll:!0})}),onPointerLeave:Fe(f.onPointerLeave,E=>{var w;E.currentTarget===document.activeElement&&((w=x.onItemLeave)==null||w.call(x))}),onKeyDown:Fe(f.onKeyDown,E=>{var M;((M=x.searchRef)==null?void 0:M.current)!==""&&E.key===" "||(HS.includes(E.key)&&S(),E.key===" "&&E.preventDefault())})})})})});_g.displayName=Ii;var Oa="SelectItemText",Ig=h.forwardRef((n,a)=>{const{__scopeSelect:l,className:o,style:c,...u}=n,f=Fn(Oa,l),p=zn(Oa,l),x=Tg(Oa,l),g=QS(Oa,l),[v,y]=h.useState(null),P=Xe(a,S=>y(S),x.onItemTextChange,S=>{var E;return(E=p.itemTextRefCallback)==null?void 0:E.call(p,S,x.value,x.disabled)}),R=v==null?void 0:v.textContent,C=h.useMemo(()=>t.jsx("option",{value:x.value,disabled:x.disabled,children:R},x.value),[x.disabled,x.value,R]),{onNativeOptionAdd:j,onNativeOptionRemove:b}=g;return Vt(()=>(j(C),()=>b(C)),[j,b,C]),t.jsxs(t.Fragment,{children:[t.jsx(Ue.span,{id:x.textId,...u,ref:P}),x.isSelected&&f.valueNode&&!f.valueNodeHasChildren?Wa.createPortal(u.children,f.valueNode):null]})});Ig.displayName=Oa;var Ag="SelectItemIndicator",Mg=h.forwardRef((n,a)=>{const{__scopeSelect:l,...o}=n;return Tg(Ag,l).isSelected?t.jsx(Ue.span,{"aria-hidden":!0,...o,ref:a}):null});Mg.displayName=Ag;var Ed="SelectScrollUpButton",Dg=h.forwardRef((n,a)=>{const l=zn(Ed,n.__scopeSelect),o=uu(Ed,n.__scopeSelect),[c,u]=h.useState(!1),f=Xe(a,o.onScrollButtonChange);return Vt(()=>{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,{...n,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((n,a)=>{const l=zn(Pd,n.__scopeSelect),o=uu(Pd,n.__scopeSelect),[c,u]=h.useState(!1),f=Xe(a,o.onScrollButtonChange);return Vt(()=>{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,{...n,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((n,a)=>{const{__scopeSelect:l,onAutoScroll:o,...c}=n,u=zn("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]),Vt(()=>{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(Ue.div,{"aria-hidden":!0,...c,ref:a,style:{flexShrink:0,...c.style},onPointerDown:Fe(c.onPointerDown,()=>{f.current===null&&(f.current=window.setInterval(o,50))}),onPointerMove:Fe(c.onPointerMove,()=>{var g;(g=u.onItemLeave)==null||g.call(u),f.current===null&&(f.current=window.setInterval(o,50))}),onPointerLeave:Fe(c.onPointerLeave,()=>{x()})})}),oC="SelectSeparator",cC=h.forwardRef((n,a)=>{const{__scopeSelect:l,...o}=n;return t.jsx(Ue.div,{"aria-hidden":!0,...o,ref:a})});cC.displayName=oC;var Rd="SelectArrow",dC=h.forwardRef((n,a)=>{const{__scopeSelect:l,...o}=n,c=qi(l),u=Fn(Rd,l),f=zn(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:n,value:a,...l},o)=>{const c=h.useRef(null),u=Xe(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(Ue.select,{...l,style:{...pg,...l.style},ref:u,defaultValue:a})});Fg.displayName=uC;function zg(n){return n===""||n===void 0}function $g(n){const a=An(n),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(n,a,l){const c=a.length>1&&Array.from(a).every(g=>g===a[0])?a[0]:a,u=l?n.indexOf(l):-1;let f=fC(n,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(n,a){return n.map((l,o)=>n[(a+o)%n.length])}var hC=xg,Ug=vg,mC=jg,pC=Ng,xC=bg,Vg=wg,gC=Eg,Wg=_g,vC=Ig,yC=Mg,jC=Dg,NC=Lg;const id=hC,od=mC,gi=h.forwardRef(({className:n,children:a,...l},o)=>t.jsxs(Ug,{ref:o,className:Je("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",n),...l,children:[a,t.jsx(pC,{asChild:!0,children:t.jsx(Ba,{className:"h-4 w-4 opacity-50"})})]}));gi.displayName=Ug.displayName;const vi=h.forwardRef(({className:n,children:a,position:l="popper",...o},c)=>t.jsx(xC,{children:t.jsxs(Vg,{ref:c,className:Je("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",n),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(Ba,{className:"h-4 w-4"})})]})}));vi.displayName=Vg.displayName;const En=h.forwardRef(({className:n,children:a,...l},o)=>t.jsxs(Wg,{ref:o,className:Je("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",n),...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(Di,{className:"h-4 w-4"})})}),t.jsx(vC,{children:a})]}));En.displayName=Wg.displayName;const bC=["一","二","三","四","五","六","七","八","九","十"],wC=["序言","尾声","附录","2026每日派对干货"];function fi(n){return n?wC.some(a=>n.includes(a)):!1}function cd(n){return n.startsWith("part:")?{type:"part",id:n.slice(5)}:n.startsWith("chapter:")?{type:"chapter",id:n.slice(8)}:n.startsWith("section:")?{type:"section",id:n.slice(8)}:null}function SC({parts:n,expandedParts:a,onTogglePart:l,onReorder:o,onReadSection:c,onDeleteSection:u,onAddSectionInPart:f,onAddChapterInPart:p,onDeleteChapter:x,onEditPart:g,onDeletePart:v}){const[y,P]=h.useState(null),[R,C]=h.useState(null),j=(D,V)=>(y==null?void 0:y.type)===D&&(y==null?void 0:y.id)===V,b=(D,V)=>(R==null?void 0:R.type)===D&&(R==null?void 0:R.id)===V,S=h.useCallback(()=>{const D=[];for(const V of n)for(const k of V.chapters)for(const T of k.sections)D.push({id:T.id,partId:V.id,partTitle:V.title,chapterId:k.id,chapterTitle:k.title});return D},[n]),E=h.useCallback(async(D,V,k,T)=>{var he;D.preventDefault(),D.stopPropagation();const U=D.dataTransfer.getData("text/plain"),Q=cd(U);if(!Q||Q.type===V&&Q.id===k)return;const te=S(),oe=new Map(te.map(ne=>[ne.id,ne]));if(Q.type==="section"){const ne=oe.get(Q.id);if(ne&&fi(ne.partTitle))return}else{const ne=Q.type==="part"?n.find(le=>le.id===Q.id):n.find(le=>le.chapters.some(Z=>Z.id===Q.id));if(ne&&fi(ne.title))return}if(!(T&&fi(T.partTitle))){if(V==="part"){const ne=n.find(le=>le.id===k);if(ne&&fi(ne.title))return}if(Q.type==="part"&&V==="part"){const ne=n.map(q=>q.id),le=ne.indexOf(Q.id),Z=ne.indexOf(k);if(le===-1||Z===-1)return;const $=[...ne];$.splice(le,1),$.splice(leA.id===q);if(z)for(const A of z.chapters)for(const F of A.sections){const G=oe.get(F.id);G&&_.push(G)}}await o(_);return}if(Q.type==="chapter"&&(V==="chapter"||V==="section"||V==="part")){const ne=n.find(G=>G.chapters.some(J=>J.id===Q.id)),le=ne==null?void 0:ne.chapters.find(G=>G.id===Q.id);if(!ne||!le)return;let Z,$,_=null;if(V==="section"){const G=oe.get(k);if(!G)return;Z=G.partId,$=G.partTitle,_=k}else if(V==="chapter"){const G=n.find(me=>me.chapters.some(re=>re.id===k)),J=G==null?void 0:G.chapters.find(me=>me.id===k);if(!G||!J)return;Z=G.id,$=G.title;const xe=te.filter(me=>me.chapterId===k).pop();_=(xe==null?void 0:xe.id)??null}else{const G=n.find(xe=>xe.id===k);if(!G||!G.chapters[0])return;Z=G.id,$=G.title;const J=te.filter(xe=>xe.partId===G.id&&xe.chapterId===G.chapters[0].id);_=((he=J[J.length-1])==null?void 0:he.id)??null}const q=le.sections.map(G=>G.id),z=te.filter(G=>!q.includes(G.id));let A=z.length;if(_){const G=z.findIndex(J=>J.id===_);G>=0&&(A=G+1)}const F=q.map(G=>({...oe.get(G),partId:Z,partTitle:$,chapterId:le.id,chapterTitle:le.title}));await o([...z.slice(0,A),...F,...z.slice(A)]);return}if(Q.type==="section"&&(V==="section"||V==="chapter"||V==="part")){if(!T)return;const{partId:ne,partTitle:le,chapterId:Z,chapterTitle:$}=T;let _;if(V==="section")_=te.findIndex(J=>J.id===k);else if(V==="chapter"){const J=te.filter(xe=>xe.chapterId===k).pop();_=J?te.findIndex(xe=>xe.id===J.id)+1:te.length}else{const J=n.find(re=>re.id===k);if(!(J!=null&&J.chapters[0]))return;const xe=te.filter(re=>re.partId===J.id&&re.chapterId===J.chapters[0].id),me=xe[xe.length-1];_=me?te.findIndex(re=>re.id===me.id)+1:0}const q=te.findIndex(J=>J.id===Q.id);if(q===-1)return;const z=te.filter(J=>J.id!==Q.id),A=q<_?_-1:_,G={...te[q],partId:ne,partTitle:le,chapterId:Z,chapterTitle:$};z.splice(A,0,G),await o(z)}}},[n,S,o]),w=(D,V,k)=>({onDragEnter:T=>{T.preventDefault(),T.stopPropagation(),T.dataTransfer.dropEffect="move",C({type:D,id:V})},onDragOver:T=>{T.preventDefault(),T.stopPropagation(),T.dataTransfer.dropEffect="move",C({type:D,id:V})},onDragLeave:()=>C(null),onDrop:T=>{C(null);const U=cd(T.dataTransfer.getData("text/plain"));if(U&&!(D==="section"&&U.type==="section"&&U.id===V))if(D==="part")if(U.type==="part")E(T,"part",V);else{const Q=n.find(oe=>oe.id===V);(Q==null?void 0:Q.chapters[0])&&k&&E(T,"part",V,k)}else D==="chapter"&&k?(U.type==="section"||U.type==="chapter")&&E(T,"chapter",V,k):D==="section"&&k&&E(T,"section",V,k)}}),M=D=>bC[D]??String(D+1);return t.jsx("div",{className:"space-y-3",children:n.map((D,V)=>{var le,Z;const k=D.title==="序言"||D.title.includes("序言"),T=D.title==="尾声"||D.title.includes("尾声"),U=D.title==="附录"||D.title.includes("附录"),Q=b("part",D.id),te=a.includes(D.id),oe=D.chapters.length,he=D.chapters.reduce(($,_)=>$+_.sections.length,0);if(k&&D.chapters.length===1&&D.chapters[0].sections.length===1){const $=D.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(Qr,{className:"w-4 h-4 text-gray-400"})}),t.jsxs("span",{className:"font-medium text-gray-200 truncate",children:[D.chapters[0].title," | ",$.title]})]}),t.jsxs("div",{className:"flex items-center gap-2 shrink-0",onMouseDown:_=>_.stopPropagation(),onClick:_=>_.stopPropagation(),children:[$.price===0||$.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:["¥",$.price]}),t.jsxs("div",{className:"flex gap-1",children:[t.jsx(ee,{draggable:!1,variant:"ghost",size:"sm",onClick:()=>c($),className:"text-gray-500 hover:text-[#38bdac] h-7 px-2",children:t.jsx(Pn,{className:"w-3.5 h-3.5"})}),t.jsx(ee,{draggable:!1,variant:"ghost",size:"sm",onClick:()=>c($),className:"text-gray-500 hover:text-[#38bdac] h-7 px-2",children:t.jsx(Ft,{className:"w-3.5 h-3.5"})}),t.jsx(ee,{draggable:!1,variant:"ghost",size:"sm",onClick:()=>u($),className:"text-gray-500 hover:text-red-400 h-7 px-2",children:t.jsx(sr,{className:"w-3.5 h-3.5"})})]}),t.jsx(Cn,{className:"w-4 h-4 text-gray-500"})]})]},D.id)}if(D.title==="2026每日派对干货"||D.title.includes("2026每日派对干货"))return t.jsxs("div",{className:"rounded-xl border border-gray-700/50 bg-[#1C1C1E] overflow-hidden",children:[t.jsxs("div",{className:"flex items-center justify-between p-4 cursor-pointer select-none hover:bg-[#162840]/50 transition-all",onClick:()=>l(D.id),children:[t.jsxs("div",{className:"flex items-center gap-3 min-w-0",children:[t.jsx("div",{className:"w-10 h-10 rounded-xl bg-[#38bdac]/80 flex items-center justify-center text-white font-bold shrink-0",children:"派"}),t.jsxs("div",{children:[t.jsx("h3",{className:"font-bold text-white text-base",children:D.title}),t.jsxs("p",{className:"text-xs text-gray-500 mt-0.5",children:["共 ",he," 节"]})]})]}),t.jsxs("div",{className:"flex items-center gap-2 shrink-0",onMouseDown:$=>$.stopPropagation(),onClick:$=>$.stopPropagation(),children:[f&&t.jsx(ee,{draggable:!1,variant:"ghost",size:"sm",onClick:()=>f(D),className:"text-gray-500 hover:text-[#38bdac] h-7 px-2",title:"在本篇下新增章节",children:t.jsx(zt,{className:"w-3.5 h-3.5"})}),te?t.jsx(Ba,{className:"w-5 h-5 text-gray-500"}):t.jsx(Cn,{className:"w-5 h-5 text-gray-500"})]})]}),te&&D.chapters.length>0&&t.jsx("div",{className:"border-t border-gray-700/50 pl-4 pr-4 pb-4 pt-3 space-y-4",children:D.chapters.map(($,_)=>t.jsxs("div",{className:"space-y-2",children:[t.jsxs("p",{className:"text-xs text-gray-500 pb-1",children:["第",_+1,"章 | ",$.title]}),t.jsx("div",{className:"space-y-1 pl-2",children:$.sections.map(q=>t.jsxs("div",{className:"flex items-center justify-between py-2 px-3 rounded-lg hover:bg-[#162840]/50 min-h-[40px]",children:[t.jsxs("span",{className:"text-sm text-gray-200 truncate",children:[q.id," ",q.title]}),t.jsxs("div",{className:"flex gap-1 shrink-0",children:[t.jsx(ee,{draggable:!1,variant:"ghost",size:"sm",onClick:()=>c(q),className:"text-gray-500 hover:text-[#38bdac] h-7 px-1.5",children:t.jsx(Pn,{className:"w-3.5 h-3.5"})}),t.jsx(ee,{draggable:!1,variant:"ghost",size:"sm",onClick:()=>c(q),className:"text-gray-500 hover:text-[#38bdac] h-7 px-1.5",children:t.jsx(Ft,{className:"w-3.5 h-3.5"})}),t.jsx(ee,{draggable:!1,variant:"ghost",size:"sm",onClick:()=>u(q),className:"text-gray-500 hover:text-red-400 h-7 px-1.5",children:t.jsx(sr,{className:"w-3.5 h-3.5"})})]})]},q.id))})]},$.id))})]},D.id);if(U)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:D.chapters.map(($,_)=>$.sections.length>0?$.sections.map(q=>t.jsxs("div",{className:"flex justify-between items-center py-2 select-none hover:bg-[#162840]/50 rounded px-2 -mx-2 group",children:[t.jsxs("span",{className:"text-sm text-gray-300 truncate",children:["附录",_+1," | ",$.title," | ",q.title]}),t.jsxs("div",{className:"flex gap-1 shrink-0 opacity-0 group-hover:opacity-100 transition-opacity",children:[t.jsx(ee,{variant:"ghost",size:"sm",onClick:()=>c(q),className:"text-gray-500 hover:text-[#38bdac] h-7 px-1.5",children:t.jsx(Pn,{className:"w-3.5 h-3.5"})}),t.jsx(ee,{variant:"ghost",size:"sm",onClick:()=>c(q),className:"text-gray-500 hover:text-[#38bdac] h-7 px-1.5",children:t.jsx(Ft,{className:"w-3.5 h-3.5"})}),t.jsx(ee,{variant:"ghost",size:"sm",onClick:()=>u(q),className:"text-gray-500 hover:text-red-400 h-7 px-1.5",children:t.jsx(sr,{className:"w-3.5 h-3.5"})})]}),t.jsx(Cn,{className:"w-4 h-4 text-gray-500 shrink-0"})]},q.id)):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-500",children:["附录",_+1," | ",$.title,"(空)"]}),t.jsx(Cn,{className:"w-4 h-4 text-gray-500 shrink-0"})]},$.id))})]},D.id);if(T&&D.chapters.length===1&&D.chapters[0].sections.length===1){const $=D.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(Qr,{className:"w-4 h-4 text-gray-400"})}),t.jsxs("span",{className:"font-medium text-gray-200 truncate",children:[D.chapters[0].title," | ",$.title]})]}),t.jsxs("div",{className:"flex items-center gap-2 shrink-0",onMouseDown:_=>_.stopPropagation(),onClick:_=>_.stopPropagation(),children:[$.price===0||$.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:["¥",$.price]}),t.jsxs("div",{className:"flex gap-1",children:[t.jsx(ee,{draggable:!1,variant:"ghost",size:"sm",onClick:()=>c($),className:"text-gray-500 hover:text-[#38bdac] h-7 px-2",children:t.jsx(Pn,{className:"w-3.5 h-3.5"})}),t.jsx(ee,{draggable:!1,variant:"ghost",size:"sm",onClick:()=>c($),className:"text-gray-500 hover:text-[#38bdac] h-7 px-2",children:t.jsx(Ft,{className:"w-3.5 h-3.5"})}),t.jsx(ee,{draggable:!1,variant:"ghost",size:"sm",onClick:()=>u($),className:"text-gray-500 hover:text-red-400 h-7 px-2",children:t.jsx(sr,{className:"w-3.5 h-3.5"})})]}),t.jsx(Cn,{className:"w-4 h-4 text-gray-500"})]})]},D.id)}return T?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:D.chapters.map($=>$.sections.map(_=>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:[$.title," | ",_.title]}),t.jsxs("div",{className:"flex gap-1 shrink-0",children:[t.jsx(ee,{draggable:!1,variant:"ghost",size:"sm",onClick:()=>c(_),className:"text-gray-500 hover:text-[#38bdac] h-7 px-2",children:t.jsx(Pn,{className:"w-3.5 h-3.5"})}),t.jsx(ee,{draggable:!1,variant:"ghost",size:"sm",onClick:()=>c(_),className:"text-gray-500 hover:text-[#38bdac] h-7 px-2",children:t.jsx(Ft,{className:"w-3.5 h-3.5"})}),t.jsx(ee,{draggable:!1,variant:"ghost",size:"sm",onClick:()=>u(_),className:"text-gray-500 hover:text-red-400 h-7 px-2",children:t.jsx(sr,{className:"w-3.5 h-3.5"})})]})]},_.id)))})]},D.id):t.jsxs("div",{className:`rounded-xl border bg-[#1C1C1E] overflow-hidden transition-all duration-200 ${Q?"border-[#38bdac] ring-2 ring-[#38bdac]/40 bg-[#38bdac]/5":"border-gray-700/50"}`,...w("part",D.id,{partId:D.id,partTitle:D.title,chapterId:((le=D.chapters[0])==null?void 0:le.id)??"",chapterTitle:((Z=D.chapters[0])==null?void 0:Z.title)??""}),children:[t.jsxs("div",{draggable:!0,onDragStart:$=>{$.stopPropagation(),$.dataTransfer.setData("text/plain","part:"+D.id),$.dataTransfer.effectAllowed="move",P({type:"part",id:D.id})},onDragEnd:()=>{P(null),C(null)},className:`flex items-center justify-between p-4 cursor-grab active:cursor-grabbing select-none transition-all duration-200 ${j("part",D.id)?"opacity-60 scale-[0.98] ring-2 ring-[#38bdac] rounded-xl shadow-xl shadow-[#38bdac]/20":"hover:bg-[#162840]/50"}`,onClick:()=>l(D.id),children:[t.jsxs("div",{className:"flex items-center gap-3 min-w-0",children:[t.jsx(Yc,{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:M(V)}),t.jsxs("div",{children:[t.jsx("h3",{className:"font-bold text-white text-base",children:D.title}),t.jsxs("p",{className:"text-xs text-gray-500 mt-0.5",children:["共 ",he," 节"]})]})]}),t.jsxs("div",{className:"flex items-center gap-2 shrink-0",onMouseDown:$=>$.stopPropagation(),onClick:$=>$.stopPropagation(),children:[f&&t.jsx(ee,{draggable:!1,variant:"ghost",size:"sm",onClick:()=>f(D),className:"text-gray-500 hover:text-[#38bdac] h-7 px-2",title:"在本篇下新增章节",children:t.jsx(zt,{className:"w-3.5 h-3.5"})}),g&&t.jsx(ee,{draggable:!1,variant:"ghost",size:"sm",onClick:()=>g(D),className:"text-gray-500 hover:text-[#38bdac] h-7 px-2",title:"编辑篇名",children:t.jsx(Ft,{className:"w-3.5 h-3.5"})}),v&&t.jsx(ee,{draggable:!1,variant:"ghost",size:"sm",onClick:()=>v(D),className:"text-gray-500 hover:text-red-400 h-7 px-2",title:"删除本篇",children:t.jsx(sr,{className:"w-3.5 h-3.5"})}),t.jsxs("span",{className:"text-xs text-gray-500",children:[oe,"章"]}),te?t.jsx(Ba,{className:"w-5 h-5 text-gray-500"}):t.jsx(Cn,{className:"w-5 h-5 text-gray-500"})]})]}),te&&t.jsx("div",{className:"border-t border-gray-700/50 pl-4 pr-4 pb-4 pt-3 space-y-4",children:D.chapters.map(($,_)=>{const q=b("chapter",$.id);return t.jsxs("div",{className:"space-y-2",children:[t.jsxs("div",{className:"flex items-center gap-2 w-full",children:[t.jsxs("div",{draggable:!0,onDragStart:z=>{z.stopPropagation(),z.dataTransfer.setData("text/plain","chapter:"+$.id),z.dataTransfer.effectAllowed="move",P({type:"chapter",id:$.id})},onDragEnd:()=>{P(null),C(null)},onDragEnter:z=>{z.preventDefault(),z.stopPropagation(),z.dataTransfer.dropEffect="move",C({type:"chapter",id:$.id})},onDragOver:z=>{z.preventDefault(),z.stopPropagation(),z.dataTransfer.dropEffect="move",C({type:"chapter",id:$.id})},onDragLeave:()=>C(null),onDrop:z=>{C(null);const A=cd(z.dataTransfer.getData("text/plain"));if(!A)return;const F={partId:D.id,partTitle:D.title,chapterId:$.id,chapterTitle:$.title};(A.type==="section"||A.type==="chapter")&&E(z,"chapter",$.id,F)},className:`flex-1 min-w-0 py-2 px-2 rounded cursor-grab active:cursor-grabbing select-none -mx-2 transition-all duration-200 flex items-center gap-2 ${q?"bg-[#38bdac]/15 ring-1 ring-[#38bdac]/50":""} ${j("chapter",$.id)?"opacity-60 scale-[0.98] ring-2 ring-[#38bdac]":"hover:bg-[#162840]/30"}`,children:[t.jsx(Yc,{className:"w-4 h-4 text-gray-500 shrink-0 opacity-50"}),t.jsxs("p",{className:"text-xs text-gray-500 pb-1 flex-1",children:["第",_+1,"章 | ",$.title]})]}),t.jsxs("div",{className:"flex gap-0.5 shrink-0",onClick:z=>z.stopPropagation(),children:[p&&t.jsx(ee,{variant:"ghost",size:"sm",onClick:()=>p(D),className:"text-gray-500 hover:text-[#38bdac] h-7 px-1.5",title:"新增第X章",children:t.jsx(zt,{className:"w-3.5 h-3.5"})}),x&&t.jsx(ee,{variant:"ghost",size:"sm",onClick:()=>x(D,$),className:"text-gray-500 hover:text-red-400 h-7 px-1.5",title:"删除本章",children:t.jsx(sr,{className:"w-3.5 h-3.5"})})]})]}),t.jsx("div",{className:"space-y-1 pl-2",children:$.sections.map(z=>{const A=b("section",z.id);return t.jsxs("div",{draggable:!0,onDragStart:F=>{F.stopPropagation(),F.dataTransfer.setData("text/plain","section:"+z.id),F.dataTransfer.effectAllowed="move",P({type:"section",id:z.id})},onDragEnd:()=>{P(null),C(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 ${A?"bg-[#38bdac]/15 ring-2 ring-[#38bdac]/50":""} ${j("section",z.id)?"opacity-60 scale-[0.98] ring-2 ring-[#38bdac] shadow-lg":"hover:bg-[#162840]/50"}`,...w("section",z.id,{partId:D.id,partTitle:D.title,chapterId:$.id,chapterTitle:$.title}),children:[t.jsxs("div",{className:"flex items-center gap-3 min-w-0 flex-1",children:[t.jsx(Yc,{className:"w-4 h-4 text-gray-500 shrink-0 opacity-50"}),t.jsx("div",{className:`w-2 h-2 rounded-full shrink-0 ${z.price===0||z.isFree?"border-2 border-[#38bdac] bg-transparent":"bg-gray-500"}`}),t.jsxs("span",{className:"text-sm text-gray-200 truncate",children:[z.id," ",z.title]})]}),t.jsxs("div",{className:"flex items-center gap-2 shrink-0",onMouseDown:F=>F.stopPropagation(),onClick:F=>F.stopPropagation(),children:[z.isNew&&t.jsx("span",{className:"px-2 py-1 bg-[#38bdac]/20 text-[#38bdac] text-[10px] font-medium rounded",children:"NEW"}),z.price===0||z.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:["¥",z.price]}),t.jsxs("div",{className:"flex gap-0.5 opacity-0 group-hover:opacity-100 transition-opacity",children:[t.jsx(ee,{draggable:!1,variant:"ghost",size:"sm",onClick:()=>c(z),className:"text-gray-500 hover:text-[#38bdac] h-7 px-1.5",children:t.jsx(Pn,{className:"w-3.5 h-3.5"})}),t.jsx(ee,{draggable:!1,variant:"ghost",size:"sm",onClick:()=>c(z),className:"text-gray-500 hover:text-[#38bdac] h-7 px-1.5",children:t.jsx(Ft,{className:"w-3.5 h-3.5"})}),t.jsx(ee,{draggable:!1,variant:"ghost",size:"sm",onClick:()=>u(z),className:"text-gray-500 hover:text-red-400 h-7 px-1.5",children:t.jsx(sr,{className:"w-3.5 h-3.5"})})]}),t.jsx(Cn,{className:"w-4 h-4 text-gray-500"})]})]},z.id)})})]},$.id)})})]},D.id)})})}function CC(n){const a=new Map;for(const f of n){const p=f.partId||"part-1",x=f.partTitle||"未分类",g=f.chapterId||"chapter-1",v=f.chapterTitle||"未分类";a.has(p)||a.set(p,{id:p,title:x,chapters:new Map});const y=a.get(p);y.chapters.has(g)||y.chapters.set(g,{id:g,title:v,sections:[]}),y.chapters.get(g).sections.push({id:f.id,title:f.title,price:f.price??1,filePath:f.filePath,isFree:f.isFree,isNew:f.isNew})}const l="part-2026-daily",o="2026每日派对干货";a.has(l)||a.set(l,{id:l,title:o,chapters:new Map([["chapter-2026-daily",{id:"chapter-2026-daily",title:o,sections:[]}]])});const c=Array.from(a.values()).map(f=>({...f,chapters:Array.from(f.chapters.values())})),u=f=>f.includes("序言")?0:f.includes(o)?1.5:f.includes("附录")?2:f.includes("尾声")?3:1;return c.sort((f,p)=>{const x=u(f.title),g=u(p.title);return x!==g?x-g:0})}function kC(){var Et;const[n,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),[P,R]=h.useState(!1),[C,j]=h.useState(""),[b,S]=h.useState([]),[E,w]=h.useState(!1),[M,D]=h.useState(!1),V=h.useRef(null),[k,T]=h.useState({id:"",title:"",price:1,partId:"part-1",chapterId:"chapter-1",content:""}),[U,Q]=h.useState(null),[te,oe]=h.useState(!1),[he,ne]=h.useState(!1),[le,Z]=h.useState(""),[$,_]=h.useState(!1),q=CC(n),z=n.length,A=async()=>{o(!0);try{const K=await Ge("/api/db/book?action=list");a(Array.isArray(K==null?void 0:K.sections)?K.sections:[])}catch(K){console.error(K),a([])}finally{o(!1)}};h.useEffect(()=>{A()},[]);const F=K=>{u(pe=>pe.includes(K)?pe.filter(Le=>Le!==K):[...pe,K])},G=h.useCallback(K=>{const pe=n,Le=K.flatMap(Ie=>{const At=pe.find(rn=>rn.id===Ie.id);return At?[{...At,partId:Ie.partId,partTitle:Ie.partTitle,chapterId:Ie.chapterId,chapterTitle:Ie.chapterTitle}]:[]});return a(Le),St("/api/db/book",{action:"reorder",items:K}).then(Ie=>{Ie&&Ie.success===!1&&(a(pe),alert("排序失败: "+(Ie&&typeof Ie=="object"&&"error"in Ie?Ie.error:"未知错误")))}).catch(Ie=>{a(pe),console.error("排序失败:",Ie),alert("排序失败: "+(Ie instanceof Error?Ie.message:"网络或服务异常"))}),Promise.resolve()},[n]),J=async K=>{if(confirm(`确定要删除章节「${K.title}」吗?此操作不可恢复。`))try{const pe=await ss(`/api/db/book?id=${encodeURIComponent(K.id)}`);pe&&pe.success!==!1?(alert("已删除"),A()):alert("删除失败: "+(pe&&typeof pe=="object"&&"error"in pe?pe.error:"未知错误"))}catch(pe){console.error(pe),alert("删除失败")}},xe=async K=>{y(!0);try{const pe=await Ge(`/api/db/book?action=read&id=${encodeURIComponent(K.id)}`);if(pe!=null&&pe.success&&pe.section){const Le=pe.section;p({id:K.id,title:pe.section.title??K.title,price:pe.section.price??K.price,content:pe.section.content??"",filePath:K.filePath,isFree:K.isFree||K.price===0,isNew:Le.isNew??K.isNew})}else p({id:K.id,title:K.title,price:K.price,content:"",filePath:K.filePath,isFree:K.isFree,isNew:K.isNew}),pe&&!pe.success&&alert("无法读取文件内容: "+(pe.error||"未知错误"))}catch(pe){console.error(pe),p({id:K.id,title:K.title,price:K.price,content:"",filePath:K.filePath,isFree:K.isFree})}finally{y(!1)}},me=async()=>{var K;if(f){R(!0);try{let pe=f.content||"";const Le=[new RegExp(`^#+\\s*${f.id.replace(".","\\.")}\\s+.*$`,"gm"),new RegExp(`^#+\\s*${f.id.replace(".","\\.")}[::].*$`,"gm"),new RegExp(`^#\\s+.*${(K=f.title)==null?void 0:K.slice(0,10).replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}.*$`,"gm")];for(const At of Le)pe=pe.replace(At,"");pe=pe.replace(/^\s*\n+/,"").trim();const Ie=await St("/api/db/book",{id:f.id,title:f.title,price:f.isFree?0:f.price,content:pe,isFree:f.isFree||f.price===0,isNew:f.isNew,saveToFile:!0});Ie&&Ie.success!==!1?(alert(`已保存章节: ${f.title}`),p(null),A()):alert("保存失败: "+(Ie&&typeof Ie=="object"&&"error"in Ie?Ie.error:"未知错误"))}catch(pe){console.error(pe),alert("保存失败")}finally{R(!1)}}},re=async()=>{if(!k.id||!k.title){alert("请填写章节ID和标题");return}R(!0);try{const K=await St("/api/db/book",{id:k.id,title:k.title,price:k.price,content:k.content,partId:k.partId,chapterId:k.chapterId,saveToFile:!1});K&&K.success!==!1?(alert(`章节创建成功: ${k.title}`),g(!1),T({id:"",title:"",price:1,partId:"part-1",chapterId:"chapter-1",content:""}),A()):alert("创建失败: "+(K&&typeof K=="object"&&"error"in K?K.error:"未知错误"))}catch(K){console.error(K),alert("创建失败")}finally{R(!1)}},ye=K=>{T(pe=>{var Le;return{...pe,partId:K.id,chapterId:((Le=K.chapters[0])==null?void 0:Le.id)??"chapter-1"}}),g(!0)},L=K=>{Q({id:K.id,title:K.title})},de=async()=>{var K;if((K=U==null?void 0:U.title)!=null&&K.trim()){oe(!0);try{const pe=n.map(Ie=>({id:Ie.id,partId:Ie.partId||"part-1",partTitle:Ie.partId===U.id?U.title.trim():Ie.partTitle||"",chapterId:Ie.chapterId||"chapter-1",chapterTitle:Ie.chapterTitle||""})),Le=await St("/api/db/book",{action:"reorder",items:pe});Le&&Le.success!==!1?(Q(null),A()):alert("更新篇名失败: "+(Le&&typeof Le=="object"&&"error"in Le?Le.error:"未知错误"))}catch(pe){console.error(pe),alert("更新篇名失败")}finally{oe(!1)}}},ge=K=>{const pe=K.chapters.length+1,Le=`chapter-${K.id}-${pe}-${Date.now()}`;T({id:`${pe}.1`,title:"新章节",price:1,partId:K.id,chapterId:Le,content:""}),g(!0)},_e=async(K,pe)=>{const Le=pe.sections.map(Ie=>Ie.id);if(Le.length===0){alert("该章下无小节,无需删除");return}if(confirm(`确定要删除「第${K.chapters.indexOf(pe)+1}章 | ${pe.title}」吗?将删除共 ${Le.length} 节,此操作不可恢复。`))try{for(const Ie of Le)await ss(`/api/db/book?id=${encodeURIComponent(Ie)}`);A()}catch(Ie){console.error(Ie),alert("删除失败")}},Oe=async()=>{if(!le.trim()){alert("请输入篇名");return}_(!0);try{const K=`part-new-${Date.now()}`,pe="chapter-1",Le=`part-placeholder-${Date.now()}`,Ie=await St("/api/db/book",{id:Le,title:"占位节(可编辑)",price:0,content:"",partId:K,partTitle:le.trim(),chapterId:pe,chapterTitle:"第1章 | 待编辑",saveToFile:!1});Ie&&Ie.success!==!1?(alert(`篇「${le}」创建成功,请编辑占位节`),ne(!1),Z(""),A()):alert("创建失败: "+(Ie&&typeof Ie=="object"&&"error"in Ie?Ie.error:"未知错误"))}catch(K){console.error(K),alert("创建失败")}finally{_(!1)}},ze=async K=>{const pe=n.filter(Le=>Le.partId===K.id).map(Le=>Le.id);if(pe.length!==0&&confirm(`确定要删除「${K.title}」整篇吗?将删除共 ${pe.length} 节内容,此操作不可恢复。`))try{for(const Le of pe)await ss(`/api/db/book?id=${encodeURIComponent(Le)}`);A()}catch(Le){console.error(Le),alert("删除失败")}},qe=async K=>{var Le,Ie;const pe=(Le=K.target.files)==null?void 0:Le[0];if(pe){D(!0);try{const At=new FormData;At.append("file",pe),At.append("folder","book-images");const Pt=await(await fetch(Vs("/api/upload"),{method:"POST",body:At,credentials:"include"})).json();if(Pt!=null&&Pt.success&&((Ie=Pt==null?void 0:Pt.data)!=null&&Ie.url)){const se=`![${pe.name}](${Pt.data.url})`;f&&p({...f,content:(f.content||"")+` - -`+se}),alert(`图片上传成功: ${Pt.data.url}`)}else alert("上传失败: "+((Pt==null?void 0:Pt.error)||"未知错误"))}catch(At){console.error(At),alert("上传失败")}finally{D(!1),V.current&&(V.current.value="")}}},rt=async()=>{var K;if(C.trim()){w(!0);try{const pe=await Ge(`/api/search?q=${encodeURIComponent(C)}`);pe!=null&&pe.success&&((K=pe.data)!=null&&K.results)?S(pe.data.results):(S([]),pe&&!pe.success&&alert("搜索失败: "+pe.error))}catch(pe){console.error(pe),S([]),alert("搜索失败")}finally{w(!1)}}},et=q.find(K=>K.id===k.partId),kt=(et==null?void 0:et.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:["共 ",q.length," 篇 · ",z," 节内容"]})]}),t.jsx("div",{className:"flex gap-2",children:t.jsxs(ee,{onClick:()=>{const K=typeof window<"u"?`${window.location.origin}/api-doc`:"";K&&window.open(K,"_blank","noopener,noreferrer")},variant:"outline",className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:[t.jsx(ts,{className:"w-4 h-4 mr-2"}),"API 接口"]})})]}),t.jsx($t,{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(Bt,{children:t.jsxs(Ut,{className:"text-white flex items-center gap-2",children:[t.jsx(zt,{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(X,{className:"text-gray-300",children:"章节ID *"}),t.jsx(ae,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"如: 9.15",value:k.id,onChange:K=>T({...k,id:K.target.value})})]}),t.jsxs("div",{className:"space-y-2",children:[t.jsx(X,{className:"text-gray-300",children:"价格 (元)"}),t.jsx(ae,{type:"number",className:"bg-[#0a1628] border-gray-700 text-white",value:k.price,onChange:K=>T({...k,price:Number(K.target.value)})})]})]}),t.jsxs("div",{className:"space-y-2",children:[t.jsx(X,{className:"text-gray-300",children:"章节标题 *"}),t.jsx(ae,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"输入章节标题",value:k.title,onChange:K=>T({...k,title:K.target.value})})]}),t.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[t.jsxs("div",{className:"space-y-2",children:[t.jsx(X,{className:"text-gray-300",children:"所属篇"}),t.jsxs(id,{value:k.partId,onValueChange:K=>T({...k,partId:K,chapterId:"chapter-1"}),children:[t.jsx(gi,{className:"bg-[#0a1628] border-gray-700 text-white",children:t.jsx(od,{})}),t.jsxs(vi,{className:"bg-[#0f2137] border-gray-700",children:[q.map(K=>t.jsx(En,{value:K.id,className:"text-white hover:bg-[#38bdac]/20 focus:bg-[#38bdac]/20",children:K.title},K.id)),q.length===0&&t.jsx(En,{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(X,{className:"text-gray-300",children:"所属章"}),t.jsxs(id,{value:k.chapterId,onValueChange:K=>T({...k,chapterId:K}),children:[t.jsx(gi,{className:"bg-[#0a1628] border-gray-700 text-white",children:t.jsx(od,{})}),t.jsxs(vi,{className:"bg-[#0f2137] border-gray-700",children:[kt.map(K=>t.jsx(En,{value:K.id,className:"text-white hover:bg-[#38bdac]/20 focus:bg-[#38bdac]/20",children:K.title},K.id)),kt.length===0&&t.jsx(En,{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(X,{className:"text-gray-300",children:"内容 (Markdown格式)"}),t.jsx(as,{className:"bg-[#0a1628] border-gray-700 text-white min-h-[300px] font-mono text-sm placeholder:text-gray-500",placeholder:"输入章节内容...",value:k.content,onChange:K=>T({...k,content:K.target.value})})]})]}),t.jsxs(Kt,{children:[t.jsx(ee,{variant:"outline",onClick:()=>g(!1),className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:"取消"}),t.jsx(ee,{onClick:re,disabled:P||!k.id||!k.title,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:P?t.jsxs(t.Fragment,{children:[t.jsx(tt,{className:"w-4 h-4 mr-2 animate-spin"}),"创建中..."]}):t.jsxs(t.Fragment,{children:[t.jsx(zt,{className:"w-4 h-4 mr-2"}),"创建章节"]})})]})]})}),t.jsx($t,{open:!!U,onOpenChange:K=>!K&&Q(null),children:t.jsxs(It,{className:"bg-[#0f2137] border-gray-700 text-white max-w-md",showCloseButton:!0,children:[t.jsx(Bt,{children:t.jsxs(Ut,{className:"text-white flex items-center gap-2",children:[t.jsx(Ft,{className:"w-5 h-5 text-[#38bdac]"}),"编辑篇名"]})}),U&&t.jsx("div",{className:"space-y-4 py-4",children:t.jsxs("div",{className:"space-y-2",children:[t.jsx(X,{className:"text-gray-300",children:"篇名"}),t.jsx(ae,{className:"bg-[#0a1628] border-gray-700 text-white",value:U.title,onChange:K=>Q({...U,title:K.target.value}),placeholder:"输入篇名"})]})}),t.jsxs(Kt,{children:[t.jsx(ee,{variant:"outline",onClick:()=>Q(null),className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:"取消"}),t.jsx(ee,{onClick:de,disabled:te||!((Et=U==null?void 0:U.title)!=null&&Et.trim()),className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:te?t.jsxs(t.Fragment,{children:[t.jsx(tt,{className:"w-4 h-4 mr-2 animate-spin"}),"保存中..."]}):t.jsxs(t.Fragment,{children:[t.jsx(Yt,{className:"w-4 h-4 mr-2"}),"保存"]})})]})]})}),t.jsx($t,{open:he,onOpenChange:ne,children:t.jsxs(It,{className:"bg-[#0f2137] border-gray-700 text-white max-w-md",showCloseButton:!0,children:[t.jsx(Bt,{children:t.jsxs(Ut,{className:"text-white flex items-center gap-2",children:[t.jsx(zt,{className:"w-5 h-5 text-amber-400"}),"新建篇"]})}),t.jsx("div",{className:"space-y-4 py-4",children:t.jsxs("div",{className:"space-y-2",children:[t.jsx(X,{className:"text-gray-300",children:"篇名(如:第六篇|真实的社会)"}),t.jsx(ae,{className:"bg-[#0a1628] border-gray-700 text-white",value:le,onChange:K=>Z(K.target.value),placeholder:"输入篇名"})]})}),t.jsxs(Kt,{children:[t.jsx(ee,{variant:"outline",onClick:()=>{ne(!1),Z("")},className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:"取消"}),t.jsx(ee,{onClick:Oe,disabled:$||!le.trim(),className:"bg-amber-500 hover:bg-amber-600 text-white",children:$?t.jsxs(t.Fragment,{children:[t.jsx(tt,{className:"w-4 h-4 mr-2 animate-spin"}),"创建中..."]}):t.jsxs(t.Fragment,{children:[t.jsx(zt,{className:"w-4 h-4 mr-2"}),"创建篇"]})})]})]})}),t.jsx($t,{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(Bt,{children:t.jsxs(Ut,{className:"text-white flex items-center gap-2",children:[t.jsx(Ft,{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(X,{className:"text-gray-300",children:"章节ID"}),t.jsx(ae,{className:"bg-[#0a1628] border-gray-700 text-white",value:f.id,disabled:!0})]}),t.jsxs("div",{className:"space-y-2",children:[t.jsx(X,{className:"text-gray-300",children:"价格 (元)"}),t.jsx(ae,{type:"number",className:"bg-[#0a1628] border-gray-700 text-white",value:f.isFree?0:f.price,onChange:K=>p({...f,price:Number(K.target.value),isFree:Number(K.target.value)===0}),disabled:f.isFree})]}),t.jsxs("div",{className:"space-y-2",children:[t.jsx(X,{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:K=>p({...f,isFree:K.target.checked,price:K.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(X,{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:K=>p({...f,isNew:K.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(X,{className:"text-gray-300",children:"章节标题"}),t.jsx(ae,{className:"bg-[#0a1628] border-gray-700 text-white",value:f.title,onChange:K=>p({...f,title:K.target.value})})]}),f.filePath&&t.jsxs("div",{className:"space-y-2",children:[t.jsx(X,{className:"text-gray-300",children:"文件路径"}),t.jsx(ae,{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(X,{className:"text-gray-300",children:"内容 (Markdown格式)"}),t.jsxs("div",{className:"flex gap-2",children:[t.jsx("input",{ref:V,type:"file",accept:"image/*",onChange:qe,className:"hidden"}),t.jsxs(ee,{variant:"outline",size:"sm",onClick:()=>{var K;return(K=V.current)==null?void 0:K.click()},disabled:M,className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:[M?t.jsx(tt,{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(tt,{className:"w-6 h-6 text-[#38bdac] animate-spin"}),t.jsx("span",{className:"ml-2 text-gray-400",children:"加载中..."})]}):t.jsx(as,{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:K=>p({...f,content:K.target.value})})]})]}),t.jsxs(Kt,{children:[t.jsxs(ee,{variant:"outline",onClick:()=>p(null),className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:[t.jsx(pr,{className:"w-4 h-4 mr-2"}),"取消"]}),t.jsx(ee,{onClick:me,disabled:P,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:P?t.jsxs(t.Fragment,{children:[t.jsx(tt,{className:"w-4 h-4 mr-2 animate-spin"}),"保存中..."]}):t.jsxs(t.Fragment,{children:[t.jsx(Yt,{className:"w-4 h-4 mr-2"}),"保存修改"]})})]})]})}),t.jsxs(ru,{defaultValue:"chapters",className:"space-y-6",children:[t.jsxs(Vi,{className:"bg-[#0f2137] border border-gray-700/50 p-1",children:[t.jsxs(hr,{value:"chapters",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(hr,{value:"search",className:"data-[state=active]:bg-[#38bdac]/20 data-[state=active]:text-[#38bdac] text-gray-400",children:[t.jsx(rs,{className:"w-4 h-4 mr-2"}),"内容搜索"]}),t.jsxs(hr,{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(mr,{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(Qr,{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:z}),t.jsx("span",{className:"text-xs text-gray-500",children:"章节"})]})]}),t.jsxs("div",{className:"flex gap-2",children:[t.jsxs(ee,{onClick:()=>g(!0),className:"flex-1 bg-[#38bdac]/10 hover:bg-[#38bdac]/20 text-[#38bdac] border border-[#38bdac]/30",children:[t.jsx(zt,{className:"w-4 h-4 mr-2"}),"新建章节"]}),t.jsxs(ee,{onClick:()=>ne(!0),className:"flex-1 bg-amber-500/10 hover:bg-amber-500/20 text-amber-400 border border-amber-500/30",children:[t.jsx(zt,{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:"加载中..."})]}):t.jsx(SC,{parts:q,expandedParts:c,onTogglePart:F,onReorder:G,onReadSection:xe,onDeleteSection:J,onAddSectionInPart:ye,onAddChapterInPart:ge,onDeleteChapter:_e,onEditPart:L,onDeletePart:ze})]}),t.jsx(mr,{value:"search",className:"space-y-4",children:t.jsxs(Pe,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:[t.jsx(We,{children:t.jsx(He,{className:"text-white",children:"内容搜索"})}),t.jsxs(Re,{className:"space-y-4",children:[t.jsxs("div",{className:"flex gap-2",children:[t.jsx(ae,{className:"bg-[#0a1628] border-gray-700 text-white placeholder:text-gray-500 flex-1",placeholder:"搜索标题或内容...",value:C,onChange:K=>j(K.target.value),onKeyDown:K=>K.key==="Enter"&&rt()}),t.jsx(ee,{onClick:rt,disabled:E||!C.trim(),className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:E?t.jsx(tt,{className:"w-4 h-4 animate-spin"}):t.jsx(rs,{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(K=>t.jsxs("div",{className:"p-3 rounded-lg bg-[#162840] hover:bg-[#1a3050] cursor-pointer transition-colors",onClick:()=>xe({id:K.id,title:K.title,price:K.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:K.id}),t.jsx("span",{className:"text-white",children:K.title})]}),t.jsx($e,{variant:"outline",className:"text-gray-400 border-gray-600 text-xs",children:K.matchType==="title"?"标题匹配":"内容匹配"})]}),K.snippet&&t.jsx("p",{className:"text-gray-500 text-xs mt-2 line-clamp-2",children:K.snippet}),(K.partTitle||K.chapterTitle)&&t.jsxs("p",{className:"text-gray-600 text-xs mt-1",children:[K.partTitle," · ",K.chapterTitle]})]},K.id))]})]})]})}),t.jsx(mr,{value:"hooks",className:"space-y-4",children:t.jsxs(Pe,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:[t.jsx(We,{children:t.jsx(He,{className:"text-white",children:"引流钩子配置"})}),t.jsxs(Re,{className:"space-y-4",children:[t.jsxs("div",{className:"grid w-full max-w-sm items-center gap-1.5",children:[t.jsx(X,{htmlFor:"hook-chapter",className:"text-gray-300",children:"触发章节"}),t.jsxs(id,{defaultValue:"3",children:[t.jsx(gi,{id:"hook-chapter",className:"bg-[#0a1628] border-gray-700 text-white",children:t.jsx(od,{placeholder:"选择章节"})}),t.jsxs(vi,{className:"bg-[#0f2137] border-gray-700",children:[t.jsx(En,{value:"1",className:"text-white hover:bg-[#38bdac]/20 focus:bg-[#38bdac]/20",children:"第一章"}),t.jsx(En,{value:"2",className:"text-white hover:bg-[#38bdac]/20 focus:bg-[#38bdac]/20",children:"第二章"}),t.jsx(En,{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(X,{htmlFor:"message",className:"text-gray-300",children:"引流文案"}),t.jsx(as,{placeholder:"输入引导用户加群的文案...",id:"message",className:"bg-[#0a1628] border-gray-700 text-white placeholder:text-gray-500",defaultValue:"阅读更多精彩内容,请加入Soul创业实验派对群..."})]}),t.jsx(ee,{className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:"保存配置"})]})]})})]})]})}var Hg=["PageUp","PageDown"],Kg=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],Yg={"from-left":["Home","PageDown","ArrowDown","ArrowLeft"],"from-right":["Home","PageDown","ArrowDown","ArrowRight"],"from-bottom":["Home","PageDown","ArrowDown","ArrowLeft"],"from-top":["Home","PageDown","ArrowUp","ArrowLeft"]},Js="Slider",[Td,EC,PC]=eu(Js),[Gg]=On(Js,[PC]),[RC,Xi]=Gg(Js),Qg=h.forwardRef((n,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:P=()=>{},inverted:R=!1,form:C,...j}=n,b=h.useRef(new Set),S=h.useRef(0),w=f==="horizontal"?TC:_C,[M=[],D]=ls({prop:v,defaultProp:g,onChange:te=>{var he;(he=[...b.current][S.current])==null||he.focus(),y(te)}}),V=h.useRef(M);function k(te){const oe=LC(M,te);Q(te,oe)}function T(te){Q(te,S.current)}function U(){const te=V.current[S.current];M[S.current]!==te&&P(M)}function Q(te,oe,{commit:he}={commit:!1}){const ne=$C(u),le=BC(Math.round((te-o)/u)*u+o,ne),Z=Ei(le,[o,c]);D(($=[])=>{const _=MC($,Z,oe);if(zC(_,x*u)){S.current=_.indexOf(Z);const q=String(_)!==String($);return q&&he&&P(_),q?_:$}else return $})}return t.jsx(RC,{scope:n.__scopeSlider,name:l,disabled:p,min:o,max:c,valueIndexToChangeRef:S,thumbs:b.current,values:M,orientation:f,form:C,children:t.jsx(Td.Provider,{scope:n.__scopeSlider,children:t.jsx(Td.Slot,{scope:n.__scopeSlider,children:t.jsx(w,{"aria-disabled":p,"data-disabled":p?"":void 0,...j,ref:a,onPointerDown:Fe(j.onPointerDown,()=>{p||(V.current=M)}),min:o,max:c,inverted:R,onSlideStart:p?void 0:k,onSlideMove:p?void 0:T,onSlideEnd:p?void 0:U,onHomeKeyDown:()=>!p&&Q(o,0,{commit:!0}),onEndKeyDown:()=>!p&&Q(c,M.length-1,{commit:!0}),onStepKeyDown:({event:te,direction:oe})=>{if(!p){const le=Hg.includes(te.key)||te.shiftKey&&Kg.includes(te.key)?10:1,Z=S.current,$=M[Z],_=u*le*oe;Q($+_,Z,{commit:!0})}}})})})})});Qg.displayName=Js;var[qg,Xg]=Gg(Js,{startEdge:"left",endEdge:"right",size:"width",direction:1}),TC=h.forwardRef((n,a)=>{const{min:l,max:o,dir:c,inverted:u,onSlideStart:f,onSlideMove:p,onSlideEnd:x,onStepKeyDown:g,...v}=n,[y,P]=h.useState(null),R=Xe(a,w=>P(w)),C=h.useRef(void 0),j=Bi(c),b=j==="ltr",S=b&&!u||!b&&u;function E(w){const M=C.current||y.getBoundingClientRect(),D=[0,M.width],k=fu(D,S?[l,o]:[o,l]);return C.current=M,k(w-M.left)}return t.jsx(qg,{scope:n.__scopeSlider,startEdge:S?"left":"right",endEdge:S?"right":"left",direction:S?1:-1,size:"width",children:t.jsx(Jg,{dir:j,"data-orientation":"horizontal",...v,ref:R,style:{...v.style,"--radix-slider-thumb-transform":"translateX(-50%)"},onSlideStart:w=>{const M=E(w.clientX);f==null||f(M)},onSlideMove:w=>{const M=E(w.clientX);p==null||p(M)},onSlideEnd:()=>{C.current=void 0,x==null||x()},onStepKeyDown:w=>{const D=Yg[S?"from-left":"from-right"].includes(w.key);g==null||g({event:w,direction:D?-1:1})}})})}),_C=h.forwardRef((n,a)=>{const{min:l,max:o,inverted:c,onSlideStart:u,onSlideMove:f,onSlideEnd:p,onStepKeyDown:x,...g}=n,v=h.useRef(null),y=Xe(a,v),P=h.useRef(void 0),R=!c;function C(j){const b=P.current||v.current.getBoundingClientRect(),S=[0,b.height],w=fu(S,R?[o,l]:[l,o]);return P.current=b,w(j-b.top)}return t.jsx(qg,{scope:n.__scopeSlider,startEdge:R?"bottom":"top",endEdge:R?"top":"bottom",size:"height",direction:R?1:-1,children:t.jsx(Jg,{"data-orientation":"vertical",...g,ref:y,style:{...g.style,"--radix-slider-thumb-transform":"translateY(50%)"},onSlideStart:j=>{const b=C(j.clientY);u==null||u(b)},onSlideMove:j=>{const b=C(j.clientY);f==null||f(b)},onSlideEnd:()=>{P.current=void 0,p==null||p()},onStepKeyDown:j=>{const S=Yg[R?"from-bottom":"from-top"].includes(j.key);x==null||x({event:j,direction:S?-1:1})}})})}),Jg=h.forwardRef((n,a)=>{const{__scopeSlider:l,onSlideStart:o,onSlideMove:c,onSlideEnd:u,onHomeKeyDown:f,onEndKeyDown:p,onStepKeyDown:x,...g}=n,v=Xi(Js,l);return t.jsx(Ue.span,{...g,ref:a,onKeyDown:Fe(n.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:Fe(n.onPointerDown,y=>{const P=y.target;P.setPointerCapture(y.pointerId),y.preventDefault(),v.thumbs.has(P)?P.focus():o(y)}),onPointerMove:Fe(n.onPointerMove,y=>{y.target.hasPointerCapture(y.pointerId)&&c(y)}),onPointerUp:Fe(n.onPointerUp,y=>{const P=y.target;P.hasPointerCapture(y.pointerId)&&(P.releasePointerCapture(y.pointerId),u(y))})})}),Zg="SliderTrack",e0=h.forwardRef((n,a)=>{const{__scopeSlider:l,...o}=n,c=Xi(Zg,l);return t.jsx(Ue.span,{"data-disabled":c.disabled?"":void 0,"data-orientation":c.orientation,...o,ref:a})});e0.displayName=Zg;var _d="SliderRange",t0=h.forwardRef((n,a)=>{const{__scopeSlider:l,...o}=n,c=Xi(_d,l),u=Xg(_d,l),f=h.useRef(null),p=Xe(a,f),x=c.values.length,g=c.values.map(P=>s0(P,c.min,c.max)),v=x>1?Math.min(...g):0,y=100-Math.max(...g);return t.jsx(Ue.span,{"data-orientation":c.orientation,"data-disabled":c.disabled?"":void 0,...o,ref:p,style:{...n.style,[u.startEdge]:v+"%",[u.endEdge]:y+"%"}})});t0.displayName=_d;var Id="SliderThumb",r0=h.forwardRef((n,a)=>{const l=EC(n.__scopeSlider),[o,c]=h.useState(null),u=Xe(a,p=>c(p)),f=h.useMemo(()=>o?l().findIndex(p=>p.ref.current===o):-1,[l,o]);return t.jsx(IC,{...n,ref:u,index:f})}),IC=h.forwardRef((n,a)=>{const{__scopeSlider:l,index:o,name:c,...u}=n,f=Xi(Id,l),p=Xg(Id,l),[x,g]=h.useState(null),v=Xe(a,E=>g(E)),y=x?f.form||!!x.closest("form"):!0,P=Zd(x),R=f.values[o],C=R===void 0?0:s0(R,f.min,f.max),j=DC(o,f.values.length),b=P==null?void 0:P[p.size],S=b?OC(b,C,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(${C}% + ${S}px)`},children:[t.jsx(Td.ItemSlot,{scope:n.__scopeSlider,children:t.jsx(Ue.span,{role:"slider","aria-label":n["aria-label"]||j,"aria-valuemin":f.min,"aria-valuenow":R,"aria-valuemax":f.max,"aria-orientation":f.orientation,"data-orientation":f.orientation,"data-disabled":f.disabled?"":void 0,tabIndex:f.disabled?void 0:0,...u,ref:v,style:R===void 0?{display:"none"}:n.style,onFocus:Fe(n.onFocus,()=>{f.valueIndexToChangeRef.current=o})})}),y&&t.jsx(n0,{name:c??(f.name?f.name+(f.values.length>1?"[]":""):void 0),form:f.form,value:R},o)]})});r0.displayName=Id;var AC="RadioBubbleInput",n0=h.forwardRef(({__scopeSlider:n,value:a,...l},o)=>{const c=h.useRef(null),u=Xe(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(Ue.input,{style:{display:"none"},...l,ref:u,defaultValue:a})});n0.displayName=AC;function MC(n=[],a,l){const o=[...n];return o[l]=a,o.sort((c,u)=>c-u)}function s0(n,a,l){const u=100/(l-a)*(n-a);return Ei(u,[0,100])}function DC(n,a){return a>2?`Value ${n+1} of ${a}`:a===2?["Minimum","Maximum"][n]:void 0}function LC(n,a){if(n.length===1)return 0;const l=n.map(c=>Math.abs(c-a)),o=Math.min(...l);return l.indexOf(o)}function OC(n,a,l){const o=n/2,u=fu([0,50],[0,o]);return(o-u(a)*l)*l}function FC(n){return n.slice(0,-1).map((a,l)=>n[l+1]-a)}function zC(n,a){if(a>0){const l=FC(n);return Math.min(...l)>=a}return!0}function fu(n,a){return l=>{if(n[0]===n[1]||a[0]===a[1])return a[0];const o=(a[1]-a[0])/(n[1]-n[0]);return a[0]+o*(l-n[0])}}function $C(n){return(String(n).split(".")[1]||"").length}function BC(n,a){const l=Math.pow(10,a);return Math.round(n*l)/l}var UC=Qg,VC=e0,WC=t0,HC=r0;function KC({className:n,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:Je("relative flex w-full touch-none items-center select-none data-[disabled]:opacity-50",n),...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 YC={distributorShare:90,minWithdrawAmount:10,bindingDays:30,userDiscount:5,enableAutoWithdraw:!1,vipOrderShareVip:20,vipOrderShareNonVip:10};function GC(){const[n,a]=h.useState(YC),[l,o]=h.useState(!0),[c,u]=h.useState(!1);h.useEffect(()=>{Ge("/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(n.distributorShare)||0,minWithdrawAmount:Number(n.minWithdrawAmount)||0,bindingDays:Number(n.bindingDays)||0,userDiscount:Number(n.userDiscount)||0,enableAutoWithdraw:!!n.enableAutoWithdraw,vipOrderShareVip:Number(n.vipOrderShareVip)||20,vipOrderShareNonVip:Number(n.vipOrderShareNonVip)||10},g=await Ct("/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(Us,{className:"w-5 h-5 text-[#38bdac]"}),"推广 / 分销设置"]}),t.jsx("p",{className:"text-gray-400 mt-1",children:"统一管理「好友优惠」「你得 90% 收益」「绑定期 30 天」「提现门槛」等规则,小程序和 Web 共用这套配置。"})]}),t.jsxs(ee,{onClick:f,disabled:c||l,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:[t.jsx(Yt,{className:"w-4 h-4 mr-2"}),c?"保存中...":"保存配置"]})]}),t.jsxs("div",{className:"space-y-6",children:[t.jsxs(Pe,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:[t.jsxs(We,{children:[t.jsxs(He,{className:"flex items-center gap-2 text-white",children:[t.jsx(EN,{className:"w-4 h-4 text-[#38bdac]"}),"推广规则"]}),t.jsx(ft,{className:"text-gray-400",children:"这三项会直接体现在小程序「推广规则」卡片上,同时影响实收佣金计算。"})]}),t.jsx(Re,{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(X,{className:"text-gray-300 flex items-center gap-2",children:[t.jsx(ni,{className:"w-3 h-3 text-[#38bdac]"}),"好友优惠(%)"]}),t.jsx(ae,{type:"number",min:0,max:100,className:"bg-[#0a1628] border-gray-700 text-white",value:n.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(X,{className:"text-gray-300 flex items-center gap-2",children:[t.jsx(Cr,{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:[n.distributorShare],onValueChange:([x])=>a(g=>({...g,distributorShare:x}))}),t.jsx(ae,{type:"number",min:0,max:100,className:"w-20 bg-[#0a1628] border-gray-700 text-white text-center",value:n.distributorShare,onChange:p("distributorShare")})]}),t.jsxs("p",{className:"text-xs text-gray-500",children:["内容订单佣金 = 订单金额 ×"," ",t.jsxs("span",{className:"text-[#38bdac] font-mono",children:[n.distributorShare,"%"]}),";会员订单见下方。"]})]}),t.jsxs("div",{className:"space-y-2",children:[t.jsxs(X,{className:"text-gray-300 flex items-center gap-2",children:[t.jsx(ni,{className:"w-3 h-3 text-[#38bdac]"}),"会员订单分润(推广者是会员 %)"]}),t.jsx(ae,{type:"number",min:0,max:100,className:"bg-[#0a1628] border-gray-700 text-white",value:n.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(X,{className:"text-gray-300 flex items-center gap-2",children:[t.jsx(ni,{className:"w-3 h-3 text-[#38bdac]"}),"会员订单分润(推广者非会员 %)"]}),t.jsx(ae,{type:"number",min:0,max:100,className:"bg-[#0a1628] border-gray-700 text-white",value:n.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(X,{className:"text-gray-300 flex items-center gap-2",children:[t.jsx(Cr,{className:"w-3 h-3 text-[#38bdac]"}),"绑定有效期(天)"]}),t.jsx(ae,{type:"number",min:1,max:365,className:"bg-[#0a1628] border-gray-700 text-white",value:n.bindingDays,onChange:p("bindingDays")}),t.jsx("p",{className:"text-xs text-gray-500",children:"好友通过你的链接进来并登录后,绑定在你名下的天数。"})]})]})})]}),t.jsxs(Pe,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:[t.jsxs(We,{children:[t.jsxs(He,{className:"flex items-center gap-2 text-white",children:[t.jsx(Us,{className:"w-4 h-4 text-[#38bdac]"}),"提现规则"]}),t.jsx(ft,{className:"text-gray-400",children:"与「提现中心」「自动提现」相关的参数,影响推广者看到的可提现金额和最低门槛。"})]}),t.jsx(Re,{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(X,{className:"text-gray-300",children:"最低提现金额(元)"}),t.jsx(ae,{type:"number",min:0,step:1,className:"bg-[#0a1628] border-gray-700 text-white",value:n.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(X,{className:"text-gray-300 flex items-center gap-2",children:["自动提现开关",t.jsx($e,{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(gt,{checked:n.enableAutoWithdraw,onCheckedChange:x=>a(g=>({...g,enableAutoWithdraw:x}))}),t.jsx("span",{className:"text-sm text-gray-400",children:"开启后,可结合定时任务实现「收益自动打款到微信零钱」。"})]})]})]})})]}),t.jsxs(Pe,{className:"bg-[#0f2137] border-gray-700/50",children:[t.jsx(We,{children:t.jsxs(He,{className:"flex items-center gap-2 text-gray-200 text-sm",children:[t.jsx(ni,{className:"w-4 h-4 text-[#38bdac]"}),"使用说明"]})}),t.jsxs(Re,{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 Gr={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(n){return Array.isArray(n)?n.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):Gr.stats}function ap(n){return Array.isArray(n)?n.map(a=>typeof a=="string"?a:String(a??"")).filter(Boolean):Gr.highlights}function QC(){const[n,a]=h.useState(Gr),[l,o]=h.useState(!0),[c,u]=h.useState(!1),[f,p]=h.useState(!1),x=h.useRef(null);h.useEffect(()=>{Ge("/api/admin/author-settings").then(S=>{const E=S==null?void 0:S.data;E&&typeof E=="object"&&a({name:String(E.name??Gr.name),avatar:String(E.avatar??Gr.avatar),avatarImg:String(E.avatarImg??""),title:String(E.title??Gr.title),bio:String(E.bio??Gr.bio),stats:sp(E.stats).length?sp(E.stats):Gr.stats,highlights:ap(E.highlights).length?ap(E.highlights):Gr.highlights})}).catch(console.error).finally(()=>o(!1))},[]);const g=async()=>{u(!0);try{const S={name:n.name,avatar:n.avatar||"K",avatarImg:n.avatarImg,title:n.title,bio:n.bio,stats:n.stats.filter(M=>M.label||M.value),highlights:n.highlights.filter(Boolean)},E=await Ct("/api/admin/author-settings",S);if(!E||E.success===!1){alert("保存失败: "+(E&&typeof E=="object"&&"error"in E?E.error:""));return}u(!1);const w=document.createElement("div");w.className="fixed top-4 right-4 z-50 px-4 py-2 rounded-lg bg-[#38bdac] text-white text-sm shadow-lg",w.textContent="作者设置已保存",document.body.appendChild(w),setTimeout(()=>w.remove(),2e3)}catch(S){console.error(S),alert("保存失败: "+(S instanceof Error?S.message:String(S)))}finally{u(!1)}},v=async S=>{var w;const E=(w=S.target.files)==null?void 0:w[0];if(E){p(!0);try{const M=new FormData;M.append("file",E),M.append("folder","avatars");const D=Bd(),V={};D&&(V.Authorization=`Bearer ${D}`);const T=await(await fetch(Vs("/api/upload"),{method:"POST",body:M,credentials:"include",headers:V})).json();T!=null&&T.success&&(T!=null&&T.url)?a(U=>({...U,avatarImg:T.url})):alert("上传失败: "+((T==null?void 0:T.error)||"未知错误"))}catch(M){console.error(M),alert("上传失败")}finally{p(!1),x.current&&(x.current.value="")}}},y=()=>a(S=>({...S,stats:[...S.stats,{label:"",value:""}]})),P=S=>a(E=>({...E,stats:E.stats.filter((w,M)=>M!==S)})),R=(S,E,w)=>a(M=>({...M,stats:M.stats.map((D,V)=>V===S?{...D,[E]:w}:D)})),C=()=>a(S=>({...S,highlights:[...S.highlights,""]})),j=S=>a(E=>({...E,highlights:E.highlights.filter((w,M)=>M!==S)})),b=(S,E)=>a(w=>({...w,highlights:w.highlights.map((M,D)=>D===S?E:M)}));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(ns,{className:"w-5 h-5 text-[#38bdac]"}),"作者详情"]}),t.jsx("p",{className:"text-gray-400 mt-1",children:"配置小程序「关于作者」页展示的作者信息,包括头像、简介、统计数据与亮点标签。"})]}),t.jsxs(ee,{onClick:g,disabled:c||l,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:[t.jsx(Yt,{className:"w-4 h-4 mr-2"}),c?"保存中...":"保存"]})]}),t.jsxs("div",{className:"space-y-6",children:[t.jsxs(Pe,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:[t.jsxs(We,{children:[t.jsxs(He,{className:"flex items-center gap-2 text-white",children:[t.jsx(ns,{className:"w-4 h-4 text-[#38bdac]"}),"基本信息"]}),t.jsx(ft,{className:"text-gray-400",children:"作者姓名、头像、头衔与个人简介,将展示在「关于作者」页顶部。"})]}),t.jsxs(Re,{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(X,{className:"text-gray-300",children:"姓名"}),t.jsx(ae,{className:"bg-[#0a1628] border-gray-700 text-white",value:n.name,onChange:S=>a(E=>({...E,name:S.target.value})),placeholder:"卡若"})]}),t.jsxs("div",{className:"space-y-2",children:[t.jsx(X,{className:"text-gray-300",children:"首字母占位(无头像时显示)"}),t.jsx(ae,{className:"bg-[#0a1628] border-gray-700 text-white w-20",value:n.avatar,onChange:S=>a(E=>({...E,avatar:S.target.value.slice(0,1)||"K"})),placeholder:"K"})]})]}),t.jsxs("div",{className:"space-y-2",children:[t.jsxs(X,{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(ae,{className:"flex-1 bg-[#0a1628] border-gray-700 text-white",value:n.avatarImg,onChange:S=>a(E=>({...E,avatarImg:S.target.value})),placeholder:"上传或粘贴 URL,如 /uploads/avatars/xxx.png"}),t.jsx("input",{ref:x,type:"file",accept:"image/*",className:"hidden",onChange:v}),t.jsxs(ee,{type:"button",variant:"outline",size:"sm",className:"border-gray-600 text-gray-400 shrink-0",disabled:f,onClick:()=>{var S;return(S=x.current)==null?void 0:S.click()},children:[t.jsx(wi,{className:"w-4 h-4 mr-2"}),f?"上传中...":"上传"]})]}),n.avatarImg&&t.jsx("div",{className:"mt-2",children:t.jsx("img",{src:n.avatarImg.startsWith("http")?n.avatarImg:Vs(n.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(X,{className:"text-gray-300",children:"头衔"}),t.jsx(ae,{className:"bg-[#0a1628] border-gray-700 text-white",value:n.title,onChange:S=>a(E=>({...E,title:S.target.value})),placeholder:"Soul派对房主理人 · 私域运营专家"})]}),t.jsxs("div",{className:"space-y-2",children:[t.jsx(X,{className:"text-gray-300",children:"个人简介"}),t.jsx(as,{className:"bg-[#0a1628] border-gray-700 text-white min-h-[120px]",value:n.bio,onChange:S=>a(E=>({...E,bio:S.target.value})),placeholder:"每天早上6点到9点..."})]})]})]}),t.jsxs(Pe,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:[t.jsxs(We,{children:[t.jsx(He,{className:"text-white",children:"统计数据"}),t.jsx(ft,{className:"text-gray-400",children:"展示在作者卡片中的数字指标,如「商业案例 62」「连续直播 365天」。第一个「商业案例」的值可由书籍统计自动更新。"})]}),t.jsxs(Re,{className:"space-y-3",children:[n.stats.map((S,E)=>t.jsxs("div",{className:"flex gap-3 items-center",children:[t.jsx(ae,{className:"flex-1 bg-[#0a1628] border-gray-700 text-white",value:S.label,onChange:w=>R(E,"label",w.target.value),placeholder:"标签"}),t.jsx(ae,{className:"flex-1 bg-[#0a1628] border-gray-700 text-white",value:S.value,onChange:w=>R(E,"value",w.target.value),placeholder:"数值"}),t.jsx(ee,{variant:"ghost",size:"icon",className:"text-gray-400 hover:text-red-400",onClick:()=>P(E),children:t.jsx(pr,{className:"w-4 h-4"})})]},E)),t.jsxs(ee,{variant:"outline",size:"sm",onClick:y,className:"border-gray-600 text-gray-400",children:[t.jsx(zt,{className:"w-4 h-4 mr-2"}),"添加统计项"]})]})]}),t.jsxs(Pe,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:[t.jsxs(We,{children:[t.jsx(He,{className:"text-white",children:"亮点标签"}),t.jsx(ft,{className:"text-gray-400",children:"作者优势或成就的简短描述,以标签形式展示。"})]}),t.jsxs(Re,{className:"space-y-3",children:[n.highlights.map((S,E)=>t.jsxs("div",{className:"flex gap-3 items-center",children:[t.jsx(ae,{className:"flex-1 bg-[#0a1628] border-gray-700 text-white",value:S,onChange:w=>b(E,w.target.value),placeholder:"5年私域运营经验"}),t.jsx(ee,{variant:"ghost",size:"icon",className:"text-gray-400 hover:text-red-400",onClick:()=>j(E),children:t.jsx(pr,{className:"w-4 h-4"})})]},E)),t.jsxs(ee,{variant:"outline",size:"sm",onClick:C,className:"border-gray-600 text-gray-400",children:[t.jsx(zt,{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[n,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),[P,R]=h.useState(""),[C,j]=h.useState(""),[b,S]=h.useState(!1),[E,w]=h.useState(!1),M=(T,U,Q=!1)=>{R(T),j(U),S(Q),y(!0)};h.useEffect(()=>{(async()=>{try{const U=await Ge("/api/admin/settings");if(!U||U.success===!1)return;if(U.featureConfig&&Object.keys(U.featureConfig).length&&o(Q=>({...Q,...U.featureConfig})),U.mpConfig&&typeof U.mpConfig=="object"&&u(Q=>({...Q,...U.mpConfig})),U.siteSettings&&typeof U.siteSettings=="object"){const Q=U.siteSettings;a(te=>({...te,...typeof Q.sectionPrice=="number"&&{sectionPrice:Q.sectionPrice},...typeof Q.baseBookPrice=="number"&&{baseBookPrice:Q.baseBookPrice},...typeof Q.distributorShare=="number"&&{distributorShare:Q.distributorShare},...Q.authorInfo&&typeof Q.authorInfo=="object"&&{authorInfo:{...te.authorInfo,...Q.authorInfo}}}))}}catch(U){console.error("Load settings error:",U)}finally{g(!1)}})()},[]);const D=async(T,U)=>{w(!0);try{const Q=await Ct("/api/admin/settings",{featureConfig:T});if(!Q||Q.success===!1){U(),M("保存失败",(Q==null?void 0:Q.error)??"未知错误",!0);return}M("已保存","功能开关已更新,相关入口将随之显示或隐藏。")}catch(Q){console.error("Save feature config error:",Q),U(),M("保存失败",Q instanceof Error?Q.message:String(Q),!0)}finally{w(!1)}},V=(T,U)=>{const Q=l,te={...Q,[T]:U};o(te),D(te,()=>o(Q))},k=async()=>{p(!0);try{const T=await Ct("/api/admin/settings",{featureConfig:l,siteSettings:{sectionPrice:n.sectionPrice,baseBookPrice:n.baseBookPrice,distributorShare:n.distributorShare,authorInfo:n.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){M("保存失败",(T==null?void 0:T.error)??"未知错误",!0);return}M("已保存","设置已保存成功。")}catch(T){console.error("Save settings error:",T),M("保存失败",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(ee,{onClick:k,disabled:f,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:[t.jsx(Yt,{className:"w-4 h-4 mr-2"}),f?"保存中...":"保存设置"]})]}),t.jsxs("div",{className:"space-y-6",children:[t.jsxs(Pe,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:[t.jsxs(We,{children:[t.jsxs(He,{className:"text-white flex items-center gap-2",children:[t.jsx(jm,{className:"w-5 h-5 text-[#38bdac]"}),"关于作者"]}),t.jsx(ft,{className:"text-gray-400",children:'配置作者信息,将在"关于作者"页面显示'})]}),t.jsxs(Re,{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(X,{htmlFor:"author-name",className:"text-gray-300 flex items-center gap-1",children:[t.jsx(jm,{className:"w-3 h-3"}),"主理人名称"]}),t.jsx(ae,{id:"author-name",className:"bg-[#0a1628] border-gray-700 text-white",value:n.authorInfo.name??"",onChange:T=>a(U=>({...U,authorInfo:{...U.authorInfo,name:T.target.value}}))})]}),t.jsxs("div",{className:"space-y-2",children:[t.jsxs(X,{htmlFor:"start-date",className:"text-gray-300 flex items-center gap-1",children:[t.jsx($a,{className:"w-3 h-3"}),"开播日期"]}),t.jsx(ae,{id:"start-date",className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"例如: 2025年10月15日",value:n.authorInfo.startDate??"",onChange:T=>a(U=>({...U,authorInfo:{...U.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(X,{htmlFor:"live-time",className:"text-gray-300 flex items-center gap-1",children:[t.jsx($a,{className:"w-3 h-3"}),"直播时间"]}),t.jsx(ae,{id:"live-time",className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"例如: 06:00-09:00",value:n.authorInfo.liveTime??"",onChange:T=>a(U=>({...U,authorInfo:{...U.authorInfo,liveTime:T.target.value}}))})]}),t.jsxs("div",{className:"space-y-2",children:[t.jsxs(X,{htmlFor:"platform",className:"text-gray-300 flex items-center gap-1",children:[t.jsx(vN,{className:"w-3 h-3"}),"直播平台"]}),t.jsx(ae,{id:"platform",className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"例如: Soul派对房",value:n.authorInfo.platform??"",onChange:T=>a(U=>({...U,authorInfo:{...U.authorInfo,platform:T.target.value}}))})]})]}),t.jsxs("div",{className:"space-y-2",children:[t.jsxs(X,{htmlFor:"description",className:"text-gray-300 flex items-center gap-1",children:[t.jsx(Qr,{className:"w-3 h-3"}),"简介描述"]}),t.jsx(ae,{id:"description",className:"bg-[#0a1628] border-gray-700 text-white",value:n.authorInfo.description??"",onChange:T=>a(U=>({...U,authorInfo:{...U.authorInfo,description:T.target.value}}))})]}),t.jsxs("div",{className:"space-y-2",children:[t.jsx(X,{htmlFor:"bio",className:"text-gray-300",children:"详细介绍"}),t.jsx(as,{id:"bio",className:"bg-[#0a1628] border-gray-700 text-white min-h-[100px]",placeholder:"输入作者详细介绍...",value:n.authorInfo.bio??"",onChange:T=>a(U=>({...U,authorInfo:{...U.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:(n.authorInfo.name??"K").charAt(0)}),t.jsxs("div",{children:[t.jsx("p",{className:"text-white font-semibold",children:n.authorInfo.name}),t.jsx("p",{className:"text-gray-400 text-xs",children:n.authorInfo.description}),t.jsxs("p",{className:"text-[#38bdac] text-xs mt-1",children:["每日 ",n.authorInfo.liveTime," · ",n.authorInfo.platform]})]})]})]})]})]}),t.jsxs(Pe,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:[t.jsxs(We,{children:[t.jsxs(He,{className:"text-white flex items-center gap-2",children:[t.jsx(ji,{className:"w-5 h-5 text-[#38bdac]"}),"价格设置"]}),t.jsx(ft,{className:"text-gray-400",children:"配置书籍和章节的定价"})]}),t.jsx(Re,{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(X,{className:"text-gray-300",children:"单节价格 (元)"}),t.jsx(ae,{type:"number",className:"bg-[#0a1628] border-gray-700 text-white",value:n.sectionPrice,onChange:T=>a(U=>({...U,sectionPrice:Number.parseFloat(T.target.value)||1}))})]}),t.jsxs("div",{className:"space-y-2",children:[t.jsx(X,{className:"text-gray-300",children:"整本价格 (元)"}),t.jsx(ae,{type:"number",className:"bg-[#0a1628] border-gray-700 text-white",value:n.baseBookPrice,onChange:T=>a(U=>({...U,baseBookPrice:Number.parseFloat(T.target.value)||9.9}))})]})]})})]}),t.jsxs(Pe,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:[t.jsxs(We,{children:[t.jsxs(He,{className:"text-white flex items-center gap-2",children:[t.jsx(xd,{className:"w-5 h-5 text-[#38bdac]"}),"小程序配置"]}),t.jsx(ft,{className:"text-gray-400",children:"订阅消息模板、支付商户号等,小程序从 /api/miniprogram/config 读取(API 地址由 app.js baseUrl 控制)"})]}),t.jsx(Re,{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(X,{className:"text-gray-300",children:"小程序 AppID"}),t.jsx(ae,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"wxb8bbb2b10dec74aa",value:c.appId??"",onChange:T=>u(U=>({...U,appId:T.target.value}))})]}),t.jsxs("div",{className:"space-y-2",children:[t.jsx(X,{className:"text-gray-300",children:"提现订阅模板 ID"}),t.jsx(ae,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"用户申请提现时需授权",value:c.withdrawSubscribeTmplId??"",onChange:T=>u(U=>({...U,withdrawSubscribeTmplId:T.target.value}))})]}),t.jsxs("div",{className:"space-y-2",children:[t.jsx(X,{className:"text-gray-300",children:"微信支付商户号"}),t.jsx(ae,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"1318592501",value:c.mchId??"",onChange:T=>u(U=>({...U,mchId:T.target.value}))})]}),t.jsxs("div",{className:"space-y-2",children:[t.jsx(X,{className:"text-gray-300",children:"最低提现金额 (元)"}),t.jsx(ae,{type:"number",className:"bg-[#0a1628] border-gray-700 text-white",value:c.minWithdraw??10,onChange:T=>u(U=>({...U,minWithdraw:Number.parseFloat(T.target.value)||10}))})]})]})})]}),t.jsxs(Pe,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:[t.jsxs(We,{children:[t.jsxs(He,{className:"text-white flex items-center gap-2",children:[t.jsx(bi,{className:"w-5 h-5 text-[#38bdac]"}),"功能开关"]}),t.jsx(ft,{className:"text-gray-400",children:"控制各个功能模块的显示/隐藏"})]}),t.jsxs(Re,{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(Cr,{className:"w-4 h-4 text-[#38bdac]"}),t.jsx(X,{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(gt,{id:"match-enabled",checked:l.matchEnabled,disabled:E,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(X,{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(gt,{id:"referral-enabled",checked:l.referralEnabled,disabled:E,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(Qr,{className:"w-4 h-4 text-[#38bdac]"}),t.jsx(X,{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(gt,{id:"search-enabled",checked:l.searchEnabled,disabled:E,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(bi,{className:"w-4 h-4 text-[#38bdac]"}),t.jsx(X,{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(gt,{id:"about-enabled",checked:l.aboutEnabled,disabled:E,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($t,{open:v,onOpenChange:y,children:t.jsxs(It,{className:"bg-[#0f2137] border-gray-700 text-white",showCloseButton:!0,children:[t.jsxs(Bt,{children:[t.jsx(Ut,{className:b?"text-red-400":"text-[#38bdac]",children:P}),t.jsx(U1,{className:"text-gray-400 whitespace-pre-wrap pt-2",children:C})]}),t.jsx(Kt,{className:"mt-4",children:t.jsx(ee,{onClick:()=>y(!1),className:b?"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[n,a]=h.useState(!1),[l,o]=h.useState(lp),[c,u]=h.useState(""),f=async()=>{a(!0);try{const S=await Ge("/api/config");S!=null&&S.paymentMethods&&o({...lp,...S.paymentMethods})}catch(S){console.error(S)}finally{a(!1)}};h.useEffect(()=>{f()},[]);const p=async()=>{a(!0);try{await Ct("/api/db/config",{key:"payment_methods",value:l,description:"支付方式配置"}),alert("配置已保存!")}catch(S){console.error("保存失败:",S),alert("保存失败: "+(S instanceof Error?S.message:String(S)))}finally{a(!1)}},x=(S,E)=>{navigator.clipboard.writeText(S),u(E),setTimeout(()=>u(""),2e3)},g=(S,E)=>{o(w=>({...w,wechat:{...w.wechat,[S]:E}}))},v=(S,E)=>{o(w=>({...w,alipay:{...w.alipay,[S]:E}}))},y=(S,E)=>{o(w=>({...w,usdt:{...w.usdt,[S]:E}}))},P=(S,E)=>{o(w=>({...w,paypal:{...w.paypal,[S]:E}}))},R=l.wechat,C=l.alipay,j=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(ee,{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 ${n?"animate-spin":""}`}),"同步配置"]}),t.jsxs(ee,{onClick:p,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:[t.jsx(Yt,{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(ru,{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(hr,{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(hr,{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(hr,{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(hr,{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(mr,{value:"wechat",className:"space-y-4",children:t.jsxs(Pe,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:[t.jsxs(We,{className:"flex flex-row items-center justify-between pb-2",children:[t.jsxs("div",{className:"space-y-1",children:[t.jsxs(He,{className:"text-[#07C160] flex items-center gap-2",children:[t.jsx(xd,{className:"w-5 h-5"}),"微信支付配置"]}),t.jsx(ft,{className:"text-gray-400",children:"配置微信支付参数和跳转链接"})]}),t.jsx(gt,{checked:!!R.enabled,onCheckedChange:S=>g("enabled",S)})]}),t.jsxs(Re,{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(X,{className:"text-gray-300",children:"网站AppID"}),t.jsx(ae,{className:"bg-[#0a1628] border-gray-700 text-white font-mono text-sm",value:String(R.websiteAppId??""),onChange:S=>g("websiteAppId",S.target.value)})]}),t.jsxs("div",{className:"space-y-2",children:[t.jsx(X,{className:"text-gray-300",children:"商户号"}),t.jsx(ae,{className:"bg-[#0a1628] border-gray-700 text-white font-mono text-sm",value:String(R.merchantId??""),onChange:S=>g("merchantId",S.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(Ni,{className:"w-4 h-4 text-[#38bdac]"}),"跳转链接配置(核心功能)"]}),t.jsxs("div",{className:"space-y-2",children:[t.jsx(X,{className:"text-gray-300",children:"微信收款码/支付链接"}),t.jsx(ae,{className:"bg-[#0a1628] border-gray-700 text-white placeholder:text-gray-500",placeholder:"https://收款码图片URL 或 weixin://支付链接",value:String(R.qrCode??""),onChange:S=>g("qrCode",S.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(X,{className:"text-[#07C160] font-medium",children:"微信群跳转链接(支付成功后跳转)"}),t.jsx(ae,{className:"bg-[#0a1628] border-[#07C160]/30 text-white placeholder:text-gray-500",placeholder:"https://weixin.qq.com/g/... 或微信群二维码图片URL",value:String(R.groupQrCode??""),onChange:S=>g("groupQrCode",S.target.value)}),t.jsx("p",{className:"text-xs text-[#07C160]/70",children:"用户支付成功后将自动跳转到此链接,进入指定微信群"})]})]})]})]})}),t.jsx(mr,{value:"alipay",className:"space-y-4",children:t.jsxs(Pe,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:[t.jsxs(We,{className:"flex flex-row items-center justify-between pb-2",children:[t.jsxs("div",{className:"space-y-1",children:[t.jsxs(He,{className:"text-[#1677FF] flex items-center gap-2",children:[t.jsx(hd,{className:"w-5 h-5"}),"支付宝配置"]}),t.jsx(ft,{className:"text-gray-400",children:"已加载真实支付宝参数"})]}),t.jsx(gt,{checked:!!C.enabled,onCheckedChange:S=>v("enabled",S)})]}),t.jsxs(Re,{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(X,{className:"text-gray-300",children:"合作者身份 (PID)"}),t.jsxs("div",{className:"flex gap-2",children:[t.jsx(ae,{className:"bg-[#0a1628] border-gray-700 text-white font-mono text-sm",value:String(C.partnerId??""),onChange:S=>v("partnerId",S.target.value)}),t.jsx(ee,{size:"icon",variant:"outline",className:"border-gray-700 bg-transparent",onClick:()=>x(String(C.partnerId??""),"pid"),children:c==="pid"?t.jsx(Di,{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(X,{className:"text-gray-300",children:"安全校验码 (Key)"}),t.jsx(ae,{type:"password",className:"bg-[#0a1628] border-gray-700 text-white font-mono text-sm",value:String(C.securityKey??""),onChange:S=>v("securityKey",S.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(Ni,{className:"w-4 h-4 text-[#38bdac]"}),"跳转链接配置"]}),t.jsxs("div",{className:"space-y-2",children:[t.jsx(X,{className:"text-gray-300",children:"支付宝收款码/跳转链接"}),t.jsx(ae,{className:"bg-[#0a1628] border-gray-700 text-white placeholder:text-gray-500",placeholder:"https://qr.alipay.com/... 或收款码图片URL",value:String(C.qrCode??""),onChange:S=>v("qrCode",S.target.value)}),t.jsx("p",{className:"text-xs text-gray-500",children:"用户点击支付宝支付后显示的二维码"})]})]})]})]})}),t.jsx(mr,{value:"usdt",className:"space-y-4",children:t.jsxs(Pe,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:[t.jsxs(We,{className:"flex flex-row items-center justify-between pb-2",children:[t.jsxs("div",{className:"space-y-1",children:[t.jsxs(He,{className:"text-[#26A17B] flex items-center gap-2",children:[t.jsx(vm,{className:"w-5 h-5"}),"USDT配置"]}),t.jsx(ft,{className:"text-gray-400",children:"配置加密货币收款地址"})]}),t.jsx(gt,{checked:!!j.enabled,onCheckedChange:S=>y("enabled",S)})]}),t.jsxs(Re,{className:"space-y-4",children:[t.jsxs("div",{className:"space-y-2",children:[t.jsx(X,{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(j.network??"TRC20"),onChange:S=>y("network",S.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(X,{className:"text-gray-300",children:"收款地址"}),t.jsx(ae,{className:"bg-[#0a1628] border-gray-700 text-white font-mono text-sm",placeholder:"T... (TRC20地址)",value:String(j.address??""),onChange:S=>y("address",S.target.value)})]}),t.jsxs("div",{className:"space-y-2",children:[t.jsx(X,{className:"text-gray-300",children:"汇率 (1 USD = ? CNY)"}),t.jsx(ae,{type:"number",className:"bg-[#0a1628] border-gray-700 text-white",value:Number(j.exchangeRate)??7.2,onChange:S=>y("exchangeRate",Number.parseFloat(S.target.value)||7.2)})]})]})]})}),t.jsx(mr,{value:"paypal",className:"space-y-4",children:t.jsxs(Pe,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:[t.jsxs(We,{className:"flex flex-row items-center justify-between pb-2",children:[t.jsxs("div",{className:"space-y-1",children:[t.jsxs(He,{className:"text-[#169BD7] flex items-center gap-2",children:[t.jsx(md,{className:"w-5 h-5"}),"PayPal配置"]}),t.jsx(ft,{className:"text-gray-400",children:"配置PayPal收款账户"})]}),t.jsx(gt,{checked:!!b.enabled,onCheckedChange:S=>P("enabled",S)})]}),t.jsxs(Re,{className:"space-y-4",children:[t.jsxs("div",{className:"space-y-2",children:[t.jsx(X,{className:"text-gray-300",children:"PayPal邮箱"}),t.jsx(ae,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"your@email.com",value:String(b.email??""),onChange:S=>P("email",S.target.value)})]}),t.jsxs("div",{className:"space-y-2",children:[t.jsx(X,{className:"text-gray-300",children:"汇率 (1 USD = ? CNY)"}),t.jsx(ae,{type:"number",className:"bg-[#0a1628] border-gray-700 text-white",value:Number(b.exchangeRate)??7.2,onChange:S=>P("exchangeRate",Number(S.target.value)||7.2)})]})]})]})})]})]})}const r4={siteName:"卡若日记",siteTitle:"一场SOUL的创业实验场",siteDescription:"来自Soul派对房的真实商业故事",logo:"/logo.png",favicon:"/favicon.ico",primaryColor:"#00CED1"},n4={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[n,a]=h.useState({siteConfig:{...r4},menuConfig:{...n4},pageConfig:{...s4}}),[l,o]=h.useState(!1),[c,u]=h.useState(!1);h.useEffect(()=>{Ge("/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 Ct("/api/db/config",{key:"site_config",value:n.siteConfig,description:"网站基础配置"}),await Ct("/api/db/config",{key:"menu_config",value:n.menuConfig,description:"底部菜单配置"}),await Ct("/api/db/config",{key:"page_config",value:n.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=n.siteConfig,x=n.menuConfig,g=n.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(ee,{onClick:f,disabled:c,className:`${l?"bg-green-500":"bg-[#00CED1]"} hover:bg-[#20B2AA] text-white transition-colors`,children:[t.jsx(Yt,{className:"w-4 h-4 mr-2"}),c?"保存中...":l?"已保存":"保存设置"]})]}),t.jsxs("div",{className:"space-y-6",children:[t.jsxs(Pe,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:[t.jsxs(We,{children:[t.jsxs(He,{className:"text-white flex items-center gap-2",children:[t.jsx(md,{className:"w-5 h-5 text-[#00CED1]"}),"网站基础信息"]}),t.jsx(ft,{className:"text-gray-400",children:"配置网站名称、标题和描述"})]}),t.jsxs(Re,{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(X,{htmlFor:"site-name",className:"text-gray-300",children:"网站名称"}),t.jsx(ae,{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(X,{htmlFor:"site-title",className:"text-gray-300",children:"网站标题"}),t.jsx(ae,{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(X,{htmlFor:"site-desc",className:"text-gray-300",children:"网站描述"}),t.jsx(ae,{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(X,{htmlFor:"logo",className:"text-gray-300",children:"Logo地址"}),t.jsx(ae,{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(X,{htmlFor:"favicon",className:"text-gray-300",children:"Favicon地址"}),t.jsx(ae,{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(Pe,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:[t.jsxs(We,{children:[t.jsxs(He,{className:"text-white flex items-center gap-2",children:[t.jsx(SN,{className:"w-5 h-5 text-[#00CED1]"}),"主题颜色"]}),t.jsx(ft,{className:"text-gray-400",children:"配置网站主题色"})]}),t.jsx(Re,{children:t.jsxs("div",{className:"flex items-center gap-4",children:[t.jsxs("div",{className:"space-y-2 flex-1",children:[t.jsx(X,{htmlFor:"primary-color",className:"text-gray-300",children:"主色调"}),t.jsxs("div",{className:"flex items-center gap-3",children:[t.jsx(ae,{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(ae,{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(Pe,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:[t.jsxs(We,{children:[t.jsxs(He,{className:"text-white flex items-center gap-2",children:[t.jsx(jN,{className:"w-5 h-5 text-[#00CED1]"}),"底部菜单配置"]}),t.jsx(ft,{className:"text-gray-400",children:"控制底部导航栏菜单的显示和名称"})]}),t.jsx(Re,{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(gt,{checked:(y==null?void 0:y.enabled)??!0,onCheckedChange:P=>a(R=>({...R,menuConfig:{...R.menuConfig,[v]:{...y,enabled:P}}}))}),t.jsx("span",{className:"text-gray-300 w-16 capitalize",children:v}),t.jsx(ae,{className:"bg-[#0f2137] border-gray-700 text-white max-w-[200px]",value:(y==null?void 0:y.label)??"",onChange:P=>a(R=>({...R,menuConfig:{...R.menuConfig,[v]:{...y,label:P.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(Pe,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:[t.jsxs(We,{children:[t.jsxs(He,{className:"text-white flex items-center gap-2",children:[t.jsx(Kj,{className:"w-5 h-5 text-[#00CED1]"}),"页面标题配置"]}),t.jsx(ft,{className:"text-gray-400",children:"配置各个页面的标题和副标题"})]}),t.jsxs(Re,{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(X,{className:"text-gray-300",children:"首页标题"}),t.jsx(ae,{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(X,{className:"text-gray-300",children:"首页副标题"}),t.jsx(ae,{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(X,{className:"text-gray-300",children:"目录页标题"}),t.jsx(ae,{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(X,{className:"text-gray-300",children:"匹配页标题"}),t.jsx(ae,{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(X,{className:"text-gray-300",children:"我的页标题"}),t.jsx(ae,{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(X,{className:"text-gray-300",children:"关于作者标题"}),t.jsx(ae,{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[n,a]=h.useState(""),[l,o]=h.useState(""),[c,u]=h.useState(""),[f,p]=h.useState({}),x=async()=>{var R,C,j,b;try{const S=await Ge("/api/config"),E=(C=(R=S==null?void 0:S.liveQRCodes)==null?void 0:R[0])==null?void 0:C.urls;Array.isArray(E)&&a(E.join(` -`));const w=(b=(j=S==null?void 0:S.paymentMethods)==null?void 0:j.wechat)==null?void 0:b.groupQrCode;w&&o(w),p({paymentMethods:S==null?void 0:S.paymentMethods,liveQRCodes:S==null?void 0:S.liveQRCodes})}catch(S){console.error(S)}};h.useEffect(()=>{x()},[]);const g=(R,C)=>{navigator.clipboard.writeText(R),u(C),setTimeout(()=>u(""),2e3)},v=async()=>{try{const R=n.split(` -`).map(j=>j.trim()).filter(Boolean),C=[...f.liveQRCodes||[]];C[0]?C[0].urls=R:C.push({id:"live-1",name:"微信群活码",urls:R,clickCount:0}),await Ct("/api/db/config",{key:"live_qr_codes",value:C,description:"群活码配置"}),alert("群活码配置已保存!"),await x()}catch(R){console.error(R),alert("保存失败: "+(R instanceof Error?R.message:String(R)))}},y=async()=>{var R;try{await Ct("/api/db/config",{key:"payment_methods",value:{...f.paymentMethods||{},wechat:{...((R=f.paymentMethods)==null?void 0:R.wechat)||{},groupQrCode:l}},description:"支付方式配置"}),alert("微信群链接已保存!用户支付成功后将自动跳转"),await x()}catch(C){console.error(C),alert("保存失败: "+(C instanceof Error?C.message:String(C)))}},P=()=>{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(Pe,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl md:col-span-2",children:[t.jsxs(We,{children:[t.jsxs(He,{className:"text-[#07C160] flex items-center gap-2",children:[t.jsx(Sm,{className:"w-5 h-5"}),"支付成功跳转链接(核心配置)"]}),t.jsx(ft,{className:"text-gray-400",children:"用户支付完成后自动跳转到此链接,进入指定微信群"})]}),t.jsxs(Re,{className:"space-y-4",children:[t.jsxs("div",{className:"space-y-2",children:[t.jsxs(X,{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(ae,{placeholder:"https://cli.im/xxxxx 或 https://weixin.qq.com/g/...",className:"bg-[#0a1628] border-gray-700 text-white placeholder:text-gray-500 flex-1",value:l,onChange:R=>o(R.target.value)}),t.jsx(ee,{variant:"outline",size:"icon",className:"border-gray-700 bg-transparent hover:bg-gray-700/50",onClick:()=>g(l,"group"),children:c==="group"?t.jsx(Di,{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(Ni,{className:"w-3 h-3"}),"支持格式:草料短链、微信群链接(https://weixin.qq.com/g/...)、企业微信链接等"]})]}),t.jsxs("div",{className:"flex gap-3",children:[t.jsxs(ee,{onClick:y,className:"flex-1 bg-[#07C160] hover:bg-[#06AD51] text-white",children:[t.jsx(wi,{className:"w-4 h-4 mr-2"}),"保存配置"]}),t.jsxs(ee,{onClick:P,variant:"outline",className:"border-[#07C160] text-[#07C160] hover:bg-[#07C160]/10 bg-transparent",children:[t.jsx(Ni,{className:"w-4 h-4 mr-2"}),"测试跳转"]})]})]})]}),t.jsxs(Pe,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl md:col-span-2",children:[t.jsxs(We,{children:[t.jsxs(He,{className:"text-white flex items-center gap-2",children:[t.jsx(Sm,{className:"w-5 h-5 text-[#38bdac]"}),"多群轮换(高级配置)"]}),t.jsx(ft,{className:"text-gray-400",children:"配置多个群链接,系统自动轮换分配,避免单群满员"})]}),t.jsxs(Re,{className:"space-y-4",children:[t.jsxs("div",{className:"space-y-2",children:[t.jsxs(X,{className:"text-gray-300 flex items-center gap-2",children:[t.jsx(wm,{className:"w-4 h-4"}),"多个群链接(每行一个)"]}),t.jsx(as,{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:n,onChange:R=>a(R.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:[n.split(` -`).filter(Boolean).length," 个"]})]}),t.jsxs(ee,{onClick:v,className:"w-full bg-[#38bdac] hover:bg-[#2da396] text-white",children:[t.jsx(wi,{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[n,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}),P=async()=>{o(!0);try{const w=await Ge("/api/db/config/full?key=match_config"),M=(w==null?void 0:w.data)??(w==null?void 0:w.config);M&&a({...ip,...M})}catch(w){console.error("加载匹配配置失败:",w)}finally{o(!1)}};h.useEffect(()=>{P()},[]);const R=async()=>{u(!0);try{const w=await Ct("/api/db/config",{key:"match_config",value:n,description:"匹配功能配置"});w&&w.success!==!1?alert("配置保存成功!"):alert("保存失败: "+(w&&typeof w=="object"&&"error"in w?w.error:"未知错误"))}catch(w){console.error("保存配置失败:",w),alert("保存失败")}finally{u(!1)}},C=w=>{g(w),y({id:w.id,label:w.label,matchLabel:w.matchLabel,icon:w.icon,matchFromDB:w.matchFromDB,showJoinAfterMatch:w.showJoinAfterMatch,price:w.price,enabled:w.enabled}),p(!0)},j=()=>{g(null),y({id:"",label:"",matchLabel:"",icon:"⭐",matchFromDB:!1,showJoinAfterMatch:!0,price:1,enabled:!0}),p(!0)},b=()=>{if(!v.id||!v.label){alert("请填写类型ID和名称");return}const w=[...n.matchTypes];if(x){const M=w.findIndex(D=>D.id===x.id);M!==-1&&(w[M]={...v})}else{if(w.some(M=>M.id===v.id)){alert("类型ID已存在");return}w.push({...v})}a({...n,matchTypes:w}),p(!1)},S=w=>{confirm("确定要删除这个匹配类型吗?")&&a({...n,matchTypes:n.matchTypes.filter(M=>M.id!==w)})},E=w=>{a({...n,matchTypes:n.matchTypes.map(M=>M.id===w?{...M,enabled:!M.enabled}:M)})};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(bi,{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(ee,{variant:"outline",onClick:P,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(ee,{onClick:R,disabled:c,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:[t.jsx(Yt,{className:"w-4 h-4 mr-2"}),c?"保存中...":"保存配置"]})]})]}),t.jsxs(Pe,{className:"bg-[#0f2137] border-gray-700/50",children:[t.jsxs(We,{children:[t.jsxs(He,{className:"text-white flex items-center gap-2",children:[t.jsx(ZN,{className:"w-5 h-5 text-yellow-400"}),"基础设置"]}),t.jsx(ft,{className:"text-gray-400",children:"配置免费匹配次数和付费规则"})]}),t.jsxs(Re,{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(X,{className:"text-gray-300",children:"每日免费匹配次数"}),t.jsx(ae,{type:"number",min:0,max:100,className:"bg-[#0a1628] border-gray-700 text-white",value:n.freeMatchLimit,onChange:w=>a({...n,freeMatchLimit:parseInt(w.target.value,10)||0})}),t.jsx("p",{className:"text-xs text-gray-500",children:"用户每天可免费匹配的次数"})]}),t.jsxs("div",{className:"space-y-2",children:[t.jsx(X,{className:"text-gray-300",children:"付费匹配价格(元)"}),t.jsx(ae,{type:"number",min:.01,step:.01,className:"bg-[#0a1628] border-gray-700 text-white",value:n.matchPrice,onChange:w=>a({...n,matchPrice:parseFloat(w.target.value)||1})}),t.jsx("p",{className:"text-xs text-gray-500",children:"免费次数用完后的单次匹配价格"})]}),t.jsxs("div",{className:"space-y-2",children:[t.jsx(X,{className:"text-gray-300",children:"每日最大匹配次数"}),t.jsx(ae,{type:"number",min:1,max:100,className:"bg-[#0a1628] border-gray-700 text-white",value:n.settings.maxMatchesPerDay,onChange:w=>a({...n,settings:{...n.settings,maxMatchesPerDay:parseInt(w.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(gt,{checked:n.settings.enableFreeMatches,onCheckedChange:w=>a({...n,settings:{...n.settings,enableFreeMatches:w}})}),t.jsx(X,{className:"text-gray-300",children:"启用免费匹配"})]}),t.jsxs("div",{className:"flex items-center gap-3",children:[t.jsx(gt,{checked:n.settings.enablePaidMatches,onCheckedChange:w=>a({...n,settings:{...n.settings,enablePaidMatches:w}})}),t.jsx(X,{className:"text-gray-300",children:"启用付费匹配"})]})]})]})]}),t.jsxs(Pe,{className:"bg-[#0f2137] border-gray-700/50",children:[t.jsxs(We,{className:"flex flex-row items-center justify-between",children:[t.jsxs("div",{children:[t.jsxs(He,{className:"text-white flex items-center gap-2",children:[t.jsx(Cr,{className:"w-5 h-5 text-[#38bdac]"}),"匹配类型管理"]}),t.jsx(ft,{className:"text-gray-400",children:"配置不同的匹配类型及其价格"})]}),t.jsxs(ee,{onClick:j,size:"sm",className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:[t.jsx(zt,{className:"w-4 h-4 mr-1"}),"添加类型"]})]}),t.jsx(Re,{children:t.jsxs(Zr,{children:[t.jsx(en,{children:t.jsxs(ot,{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(tn,{children:n.matchTypes.map(w=>t.jsxs(ot,{className:"hover:bg-[#0a1628] border-gray-700/50",children:[t.jsx(Ce,{children:t.jsx("span",{className:"text-2xl",children:w.icon})}),t.jsx(Ce,{className:"font-mono text-gray-300",children:w.id}),t.jsx(Ce,{className:"text-white font-medium",children:w.label}),t.jsx(Ce,{className:"text-gray-300",children:w.matchLabel}),t.jsx(Ce,{children:t.jsxs($e,{className:"bg-yellow-500/20 text-yellow-400 hover:bg-yellow-500/20 border-0",children:["¥",w.price]})}),t.jsx(Ce,{children:w.matchFromDB?t.jsx($e,{className:"bg-green-500/20 text-green-400 hover:bg-green-500/20 border-0",children:"是"}):t.jsx($e,{variant:"outline",className:"text-gray-500 border-gray-600",children:"否"})}),t.jsx(Ce,{children:t.jsx(gt,{checked:w.enabled,onCheckedChange:()=>E(w.id)})}),t.jsx(Ce,{className:"text-right",children:t.jsxs("div",{className:"flex items-center justify-end gap-1",children:[t.jsx(ee,{variant:"ghost",size:"sm",onClick:()=>C(w),className:"text-gray-400 hover:text-[#38bdac] hover:bg-[#38bdac]/10",children:t.jsx(Ft,{className:"w-4 h-4"})}),t.jsx(ee,{variant:"ghost",size:"sm",onClick:()=>S(w.id),className:"text-red-400 hover:text-red-300 hover:bg-red-500/10",children:t.jsx(sr,{className:"w-4 h-4"})})]})})]},w.id))})]})})]}),t.jsx($t,{open:f,onOpenChange:p,children:t.jsxs(It,{className:"bg-[#0f2137] border-gray-700 text-white max-w-lg",showCloseButton:!0,children:[t.jsx(Bt,{children:t.jsxs(Ut,{className:"text-white flex items-center gap-2",children:[x?t.jsx(Ft,{className:"w-5 h-5 text-[#38bdac]"}):t.jsx(zt,{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(X,{className:"text-gray-300",children:"类型ID(英文)"}),t.jsx(ae,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"如: partner",value:v.id,onChange:w=>y({...v,id:w.target.value}),disabled:!!x})]}),t.jsxs("div",{className:"space-y-2",children:[t.jsx(X,{className:"text-gray-300",children:"图标"}),t.jsx("div",{className:"flex gap-1 flex-wrap",children:i4.map(w=>t.jsx("button",{type:"button",className:`w-8 h-8 text-lg rounded ${v.icon===w?"bg-[#38bdac]/30 ring-1 ring-[#38bdac]":"bg-[#0a1628]"}`,onClick:()=>y({...v,icon:w}),children:w},w))})]})]}),t.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[t.jsxs("div",{className:"space-y-2",children:[t.jsx(X,{className:"text-gray-300",children:"显示名称"}),t.jsx(ae,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"如: 创业合伙",value:v.label,onChange:w=>y({...v,label:w.target.value})})]}),t.jsxs("div",{className:"space-y-2",children:[t.jsx(X,{className:"text-gray-300",children:"匹配标签"}),t.jsx(ae,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"如: 创业伙伴",value:v.matchLabel,onChange:w=>y({...v,matchLabel:w.target.value})})]})]}),t.jsxs("div",{className:"space-y-2",children:[t.jsx(X,{className:"text-gray-300",children:"单次匹配价格(元)"}),t.jsx(ae,{type:"number",min:.01,step:.01,className:"bg-[#0a1628] border-gray-700 text-white",value:v.price,onChange:w=>y({...v,price:parseFloat(w.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(gt,{checked:v.matchFromDB,onCheckedChange:w=>y({...v,matchFromDB:w})}),t.jsx(X,{className:"text-gray-300 text-sm",children:"从数据库匹配"})]}),t.jsxs("div",{className:"flex items-center gap-3",children:[t.jsx(gt,{checked:v.showJoinAfterMatch,onCheckedChange:w=>y({...v,showJoinAfterMatch:w})}),t.jsx(X,{className:"text-gray-300 text-sm",children:"匹配后显示加入"})]}),t.jsxs("div",{className:"flex items-center gap-3",children:[t.jsx(gt,{checked:v.enabled,onCheckedChange:w=>y({...v,enabled:w})}),t.jsx(X,{className:"text-gray-300 text-sm",children:"启用"})]})]})]}),t.jsxs(Kt,{children:[t.jsx(ee,{variant:"outline",onClick:()=>p(!1),className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:"取消"}),t.jsxs(ee,{onClick:b,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:[t.jsx(Yt,{className:"w-4 h-4 mr-2"}),"保存"]})]})]})})]})}const op={partner:"找伙伴",investor:"资源对接",mentor:"导师顾问",team:"团队招募"};function c4(){const[n,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),[P,R]=h.useState(null);async function C(){y(!0),R(null);try{const b=new URLSearchParams({page:String(c),pageSize:String(f)});x&&b.set("matchType",x);const S=await Ge(`/api/db/match-records?${b}`);S!=null&&S.success?(a(S.records||[]),o(S.total??0)):R("加载匹配记录失败")}catch(b){console.error("加载匹配记录失败",b),R("加载失败,请检查网络后重试")}finally{y(!1)}}h.useEffect(()=>{C()},[c,x]);const j=Math.ceil(l/f)||1;return t.jsxs("div",{className:"p-8 w-full",children:[P&&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:P}),t.jsx("button",{type:"button",onClick:()=>R(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(op).map(([b,S])=>t.jsx("option",{value:b,children:S},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(Pe,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:t.jsx(Re,{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(Zr,{children:[t.jsx(en,{children:t.jsxs(ot,{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(tn,{children:[n.map(b=>t.jsxs(ot,{className:"hover:bg-[#0a1628] border-gray-700/50",children:[t.jsx(Ce,{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:S=>{S.currentTarget.style.display="none";const E=S.currentTarget.nextElementSibling;E&&E.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(Ce,{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:S=>{S.currentTarget.style.display="none";const E=S.currentTarget.nextElementSibling;E&&E.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(Ce,{children:t.jsx($e,{className:"bg-[#38bdac]/20 text-[#38bdac] border-0",children:op[b.matchType]||b.matchType})}),t.jsxs(Ce,{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(Ce,{className:"text-gray-400",children:b.createdAt?new Date(b.createdAt).toLocaleString():"-"})]},b.id)),n.length===0&&t.jsx(ot,{children:t.jsx(Ce,{colSpan:5,className:"text-center py-12 text-gray-500",children:"暂无匹配记录"})})]})]}),t.jsx(In,{page:c,totalPages:j,total:l,pageSize:f,onPageChange:u,onPageSizeChange:b=>{p(b),u(1)}})]})})})]})}function d4(){const[n,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),[P,R]=h.useState(!1);async function C(){o(!0);try{const w=await Ge("/api/db/vip-roles");w!=null&&w.success&&w.data&&a(w.data)}catch(w){console.error("Load roles error:",w)}finally{o(!1)}}h.useEffect(()=>{C()},[]);const j=()=>{p(null),g(""),y(n.length>0?Math.max(...n.map(w=>w.sort))+1:0),u(!0)},b=w=>{p(w),g(w.name),y(w.sort),u(!0)},S=async()=>{if(!x.trim()){alert("角色名称不能为空");return}R(!0);try{if(f){const w=await St("/api/db/vip-roles",{id:f.id,name:x.trim(),sort:v});w!=null&&w.success?(u(!1),C()):alert("更新失败: "+(w==null?void 0:w.error))}else{const w=await Ct("/api/db/vip-roles",{name:x.trim(),sort:v});w!=null&&w.success?(u(!1),C()):alert("新增失败: "+(w==null?void 0:w.error))}}catch(w){console.error("Save error:",w),alert("保存失败")}finally{R(!1)}},E=async w=>{if(confirm("确定删除该角色?已设置该角色的 VIP 用户将保留角色名称。"))try{const M=await ss(`/api/db/vip-roles?id=${w}`);M!=null&&M.success?C():alert("删除失败: "+(M==null?void 0:M.error))}catch(M){console.error("Delete error:",M),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(ee,{onClick:j,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:[t.jsx(zt,{className:"w-4 h-4 mr-2"}),"新增角色"]})]}),t.jsx(Pe,{className:"bg-[#0f2137] border-gray-700/50",children:t.jsx(Re,{className:"p-0",children:l?t.jsx("div",{className:"py-12 text-center text-gray-400",children:"加载中..."}):t.jsxs(Zr,{children:[t.jsx(en,{children:t.jsxs(ot,{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(tn,{children:[n.map(w=>t.jsxs(ot,{className:"border-gray-700/50",children:[t.jsx(Ce,{className:"text-gray-300",children:w.id}),t.jsx(Ce,{className:"text-white",children:w.name}),t.jsx(Ce,{className:"text-gray-400",children:w.sort}),t.jsxs(Ce,{className:"text-right",children:[t.jsx(ee,{variant:"ghost",size:"sm",onClick:()=>b(w),className:"text-gray-400 hover:text-[#38bdac]",children:t.jsx(Ft,{className:"w-4 h-4"})}),t.jsx(ee,{variant:"ghost",size:"sm",onClick:()=>E(w.id),className:"text-gray-400 hover:text-red-400",children:t.jsx(sr,{className:"w-4 h-4"})})]})]},w.id)),n.length===0&&t.jsx(ot,{children:t.jsx(Ce,{colSpan:4,className:"text-center py-12 text-gray-500",children:"暂无角色,点击「新增角色」添加"})})]})]})})}),t.jsx($t,{open:c,onOpenChange:u,children:t.jsxs(It,{className:"bg-[#0f2137] border-gray-700 text-white max-w-sm",children:[t.jsx(Bt,{children:t.jsx(Ut,{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(X,{className:"text-gray-300",children:"角色名称"}),t.jsx(ae,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"如:创始人、投资人",value:x,onChange:w=>g(w.target.value)})]}),t.jsxs("div",{className:"space-y-2",children:[t.jsx(X,{className:"text-gray-300",children:"排序(下拉展示顺序,越小越前)"}),t.jsx(ae,{type:"number",className:"bg-[#0a1628] border-gray-700 text-white",value:v,onChange:w=>y(parseInt(w.target.value,10)||0)})]})]}),t.jsxs(Kt,{children:[t.jsxs(ee,{variant:"outline",onClick:()=>u(!1),className:"border-gray-600 text-gray-300",children:[t.jsx(pr,{className:"w-4 h-4 mr-2"}),"取消"]}),t.jsxs(ee,{onClick:S,disabled:P,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:[t.jsx(Yt,{className:"w-4 h-4 mr-2"}),P?"保存中...":"保存"]})]})]})})]})}function u4(){const[n,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),[P,R]=h.useState(!1),C=h.useRef(null),j=async k=>{var U;const T=(U=k.target.files)==null?void 0:U[0];if(T){R(!0);try{const Q=new FormData;Q.append("file",T),Q.append("folder","mentors");const te=Bd(),oe={};te&&(oe.Authorization=`Bearer ${te}`);const ne=await(await fetch(Vs("/api/upload"),{method:"POST",body:Q,credentials:"include",headers:oe})).json();ne!=null&&ne.success&&(ne!=null&&ne.url)?g(le=>({...le,avatar:ne.url})):alert("上传失败: "+((ne==null?void 0:ne.error)||"未知错误"))}catch(Q){console.error(Q),alert("上传失败")}finally{R(!1),C.current&&(C.current.value="")}}};async function b(){o(!0);try{const k=await Ge("/api/db/mentors");k!=null&&k.success&&k.data&&a(k.data)}catch(k){console.error("Load mentors error:",k)}finally{o(!1)}}h.useEffect(()=>{b()},[]);const S=()=>{g({name:"",avatar:"",intro:"",tags:"",priceSingle:"",priceHalfYear:"",priceYear:"",quote:"",whyFind:"",offering:"",judgmentStyle:"",sort:n.length>0?Math.max(...n.map(k=>k.sort))+1:0,enabled:!0})},E=()=>{p(null),S(),u(!0)},w=k=>{p(k),g({name:k.name,avatar:k.avatar||"",intro:k.intro||"",tags:k.tags||"",priceSingle:k.priceSingle!=null?String(k.priceSingle):"",priceHalfYear:k.priceHalfYear!=null?String(k.priceHalfYear):"",priceYear:k.priceYear!=null?String(k.priceYear):"",quote:k.quote||"",whyFind:k.whyFind||"",offering:k.offering||"",judgmentStyle:k.judgmentStyle||"",sort:k.sort,enabled:k.enabled??!0}),u(!0)},M=async()=>{if(!x.name.trim()){alert("导师姓名不能为空");return}y(!0);try{const k=U=>U===""?void 0:parseFloat(U),T={name:x.name.trim(),avatar:x.avatar.trim()||void 0,intro:x.intro.trim()||void 0,tags:x.tags.trim()||void 0,priceSingle:k(x.priceSingle),priceHalfYear:k(x.priceHalfYear),priceYear:k(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 U=await St("/api/db/mentors",{id:f.id,...T});U!=null&&U.success?(u(!1),b()):alert("更新失败: "+(U==null?void 0:U.error))}else{const U=await Ct("/api/db/mentors",T);U!=null&&U.success?(u(!1),b()):alert("新增失败: "+(U==null?void 0:U.error))}}catch(k){console.error("Save error:",k),alert("保存失败")}finally{y(!1)}},D=async k=>{if(confirm("确定删除该导师?"))try{const T=await ss(`/api/db/mentors?id=${k}`);T!=null&&T.success?b():alert("删除失败: "+(T==null?void 0:T.error))}catch(T){console.error("Delete error:",T),alert("删除失败")}},V=k=>k!=null?`¥${k}`:"-";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(Cr,{className:"w-5 h-5 text-[#38bdac]"}),"导师管理"]}),t.jsx("p",{className:"text-gray-400 mt-1",children:"stitch_soul 导师列表,支持每个导师独立配置单次/半年/年度价格"})]}),t.jsxs(ee,{onClick:E,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:[t.jsx(zt,{className:"w-4 h-4 mr-2"}),"新增导师"]})]}),t.jsx(Pe,{className:"bg-[#0f2137] border-gray-700/50",children:t.jsx(Re,{className:"p-0",children:l?t.jsx("div",{className:"py-12 text-center text-gray-400",children:"加载中..."}):t.jsxs(Zr,{children:[t.jsx(en,{children:t.jsxs(ot,{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(tn,{children:[n.map(k=>t.jsxs(ot,{className:"border-gray-700/50",children:[t.jsx(Ce,{className:"text-gray-300",children:k.id}),t.jsx(Ce,{className:"text-white",children:k.name}),t.jsx(Ce,{className:"text-gray-400 max-w-[200px] truncate",children:k.intro||"-"}),t.jsx(Ce,{className:"text-gray-400",children:V(k.priceSingle)}),t.jsx(Ce,{className:"text-gray-400",children:V(k.priceHalfYear)}),t.jsx(Ce,{className:"text-gray-400",children:V(k.priceYear)}),t.jsx(Ce,{className:"text-gray-400",children:k.sort}),t.jsxs(Ce,{className:"text-right",children:[t.jsx(ee,{variant:"ghost",size:"sm",onClick:()=>w(k),className:"text-gray-400 hover:text-[#38bdac]",children:t.jsx(Ft,{className:"w-4 h-4"})}),t.jsx(ee,{variant:"ghost",size:"sm",onClick:()=>D(k.id),className:"text-gray-400 hover:text-red-400",children:t.jsx(sr,{className:"w-4 h-4"})})]})]},k.id)),n.length===0&&t.jsx(ot,{children:t.jsx(Ce,{colSpan:8,className:"text-center py-12 text-gray-500",children:"暂无导师,点击「新增导师」添加"})})]})]})})}),t.jsx($t,{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(Bt,{children:t.jsx(Ut,{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(X,{className:"text-gray-300",children:"姓名 *"}),t.jsx(ae,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"如:卡若",value:x.name,onChange:k=>g(T=>({...T,name:k.target.value}))})]}),t.jsxs("div",{className:"space-y-2",children:[t.jsx(X,{className:"text-gray-300",children:"排序"}),t.jsx(ae,{type:"number",className:"bg-[#0a1628] border-gray-700 text-white",value:x.sort,onChange:k=>g(T=>({...T,sort:parseInt(k.target.value,10)||0}))})]})]}),t.jsxs("div",{className:"space-y-2",children:[t.jsx(X,{className:"text-gray-300",children:"头像"}),t.jsxs("div",{className:"flex gap-3 items-center",children:[t.jsx(ae,{className:"flex-1 bg-[#0a1628] border-gray-700 text-white",value:x.avatar,onChange:k=>g(T=>({...T,avatar:k.target.value})),placeholder:"点击上传或粘贴图片地址"}),t.jsx("input",{ref:C,type:"file",accept:"image/*",className:"hidden",onChange:j}),t.jsxs(ee,{type:"button",variant:"outline",size:"sm",className:"border-gray-600 text-gray-400 shrink-0",disabled:P,onClick:()=>{var k;return(k=C.current)==null?void 0:k.click()},children:[t.jsx(wi,{className:"w-4 h-4 mr-2"}),P?"上传中...":"上传"]})]}),x.avatar&&t.jsx("div",{className:"mt-2",children:t.jsx("img",{src:x.avatar.startsWith("http")?x.avatar:Vs(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(X,{className:"text-gray-300",children:"简介"}),t.jsx(ae,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"如:结构判断型咨询 · Decision > Execution",value:x.intro,onChange:k=>g(T=>({...T,intro:k.target.value}))})]}),t.jsxs("div",{className:"space-y-2",children:[t.jsx(X,{className:"text-gray-300",children:"技能标签(逗号分隔)"}),t.jsx(ae,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"如:项目结构判断、风险止损、人×项目匹配",value:x.tags,onChange:k=>g(T=>({...T,tags:k.target.value}))})]}),t.jsxs("div",{className:"border-t border-gray-700 pt-4",children:[t.jsx(X,{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(X,{className:"text-gray-500 text-xs",children:"单次咨询 ¥"}),t.jsx(ae,{type:"number",step:"0.01",className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"980",value:x.priceSingle,onChange:k=>g(T=>({...T,priceSingle:k.target.value}))})]}),t.jsxs("div",{className:"space-y-2",children:[t.jsx(X,{className:"text-gray-500 text-xs",children:"半年咨询 ¥"}),t.jsx(ae,{type:"number",step:"0.01",className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"19800",value:x.priceHalfYear,onChange:k=>g(T=>({...T,priceHalfYear:k.target.value}))})]}),t.jsxs("div",{className:"space-y-2",children:[t.jsx(X,{className:"text-gray-500 text-xs",children:"年度咨询 ¥"}),t.jsx(ae,{type:"number",step:"0.01",className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"29800",value:x.priceYear,onChange:k=>g(T=>({...T,priceYear:k.target.value}))})]})]})]}),t.jsxs("div",{className:"space-y-2",children:[t.jsx(X,{className:"text-gray-300",children:"引言"}),t.jsx(ae,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"如:大多数人失败,不是因为不努力...",value:x.quote,onChange:k=>g(T=>({...T,quote:k.target.value}))})]}),t.jsxs("div",{className:"space-y-2",children:[t.jsx(X,{className:"text-gray-300",children:"为什么找(文本)"}),t.jsx(ae,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"",value:x.whyFind,onChange:k=>g(T=>({...T,whyFind:k.target.value}))})]}),t.jsxs("div",{className:"space-y-2",children:[t.jsx(X,{className:"text-gray-300",children:"提供什么(文本)"}),t.jsx(ae,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"",value:x.offering,onChange:k=>g(T=>({...T,offering:k.target.value}))})]}),t.jsxs("div",{className:"space-y-2",children:[t.jsx(X,{className:"text-gray-300",children:"判断风格(逗号分隔)"}),t.jsx(ae,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"如:冷静、克制、偏风险视角",value:x.judgmentStyle,onChange:k=>g(T=>({...T,judgmentStyle:k.target.value}))})]}),t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx("input",{type:"checkbox",id:"enabled",checked:x.enabled,onChange:k=>g(T=>({...T,enabled:k.target.checked})),className:"rounded border-gray-600 bg-[#0a1628]"}),t.jsx(X,{htmlFor:"enabled",className:"text-gray-300 cursor-pointer",children:"上架(小程序可见)"})]})]}),t.jsxs(Kt,{children:[t.jsxs(ee,{variant:"outline",onClick:()=>u(!1),className:"border-gray-600 text-gray-300",children:[t.jsx(pr,{className:"w-4 h-4 mr-2"}),"取消"]}),t.jsxs(ee,{onClick:M,disabled:v,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:[t.jsx(Yt,{className:"w-4 h-4 mr-2"}),v?"保存中...":"保存"]})]})]})})]})}function f4(){const[n,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 Ge(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($a,{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(ee,{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(Pe,{className:"bg-[#0f2137] border-gray-700/50",children:t.jsx(Re,{className:"p-0",children:l?t.jsx("div",{className:"py-12 text-center text-gray-400",children:"加载中..."}):t.jsxs(Zr,{children:[t.jsx(en,{children:t.jsxs(ot,{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(tn,{children:[n.map(g=>t.jsxs(ot,{className:"border-gray-700/50",children:[t.jsx(Ce,{className:"text-gray-300",children:g.id}),t.jsx(Ce,{className:"text-gray-400",children:g.userId}),t.jsx(Ce,{className:"text-gray-400",children:g.mentorId}),t.jsx(Ce,{className:"text-gray-400",children:x[g.consultationType]||g.consultationType}),t.jsxs(Ce,{className:"text-white",children:["¥",g.amount]}),t.jsx(Ce,{className:"text-gray-400",children:p[g.status]||g.status}),t.jsx(Ce,{className:"text-gray-500 text-sm",children:g.createdAt})]},g.id)),n.length===0&&t.jsx(ot,{children:t.jsx(Ce,{colSpan:7,className:"text-center py-12 text-gray-500",children:"暂无预约记录"})})]})]})})})]})}function h4(){const[n,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),[P,R]=h.useState(!0),[C,j]=h.useState(null),[b,S]=h.useState(!1),[E,w]=h.useState(null),[M,D]=h.useState(""),[V,k]=h.useState(""),[T,U]=h.useState(""),[Q,te]=h.useState("admin"),[oe,he]=h.useState("active"),[ne,le]=h.useState(!1);async function Z(){var F;R(!0),j(null);try{const G=new URLSearchParams({page:String(c),pageSize:String(f)});y.trim()&&G.set("search",y.trim());const J=await Ge(`/api/admin/users?${G}`);J!=null&&J.success?(a(J.records||[]),o(J.total??0),x(J.totalPages??0)):j(J.error||"加载失败")}catch(G){const J=G;j(J.status===403?"无权限访问":((F=J==null?void 0:J.data)==null?void 0:F.error)||"加载失败"),a([])}finally{R(!1)}}h.useEffect(()=>{Z()},[c,f,y]);const $=()=>{w(null),D(""),k(""),U(""),te("admin"),he("active"),S(!0)},_=F=>{w(F),D(F.username),k(""),U(F.name||""),te(F.role==="super_admin"?"super_admin":"admin"),he(F.status==="disabled"?"disabled":"active"),S(!0)},q=async()=>{var F;if(!M.trim()){j("用户名不能为空");return}if(!E&&!V){j("新建时密码必填,至少 6 位");return}if(V&&V.length<6){j("密码至少 6 位");return}j(null),le(!0);try{if(E){const G=await St("/api/admin/users",{id:E.id,password:V||void 0,name:T.trim(),role:Q,status:oe});G!=null&&G.success?(S(!1),Z()):j((G==null?void 0:G.error)||"保存失败")}else{const G=await Ct("/api/admin/users",{username:M.trim(),password:V,name:T.trim(),role:Q});G!=null&&G.success?(S(!1),Z()):j((G==null?void 0:G.error)||"保存失败")}}catch(G){const J=G;j(((F=J==null?void 0:J.data)==null?void 0:F.error)||"保存失败")}finally{le(!1)}},z=async F=>{var G;if(confirm("确定删除该管理员?"))try{const J=await ss(`/api/admin/users?id=${F}`);J!=null&&J.success?Z():j((J==null?void 0:J.error)||"删除失败")}catch(J){const xe=J;j(((G=xe==null?void 0:xe.data)==null?void 0:G.error)||"删除失败")}},A=F=>{if(!F)return"-";try{const G=new Date(F);return isNaN(G.getTime())?F:G.toLocaleString("zh-CN")}catch{return F}};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(ae,{placeholder:"搜索用户名/昵称",value:g,onChange:F=>v(F.target.value),className:"w-48 bg-[#0f2137] border-gray-700 text-white placeholder:text-gray-500"}),t.jsx(ee,{variant:"outline",size:"sm",onClick:Z,disabled:P,className:"border-gray-600 text-gray-300",children:t.jsx(tt,{className:`w-4 h-4 ${P?"animate-spin":""}`})}),t.jsxs(ee,{onClick:$,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:[t.jsx(zt,{className:"w-4 h-4 mr-2"}),"新增管理员"]})]})]}),C&&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:C}),t.jsx("button",{type:"button",onClick:()=>j(null),className:"text-red-400 hover:text-red-300",children:"×"})]}),t.jsx(Pe,{className:"bg-[#0f2137] border-gray-700/50",children:t.jsx(Re,{className:"p-0",children:P?t.jsx("div",{className:"py-12 text-center text-gray-400",children:"加载中..."}):t.jsxs(t.Fragment,{children:[t.jsxs(Zr,{children:[t.jsx(en,{children:t.jsxs(ot,{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-right text-gray-400",children:"操作"})]})}),t.jsxs(tn,{children:[n.map(F=>t.jsxs(ot,{className:"border-gray-700/50",children:[t.jsx(Ce,{className:"text-gray-300",children:F.id}),t.jsx(Ce,{className:"text-white font-medium",children:F.username}),t.jsx(Ce,{className:"text-gray-400",children:F.name||"-"}),t.jsx(Ce,{children:t.jsx($e,{variant:"outline",className:F.role==="super_admin"?"border-amber-500/50 text-amber-400":"border-gray-600 text-gray-400",children:F.role==="super_admin"?"超级管理员":"管理员"})}),t.jsx(Ce,{children:t.jsx($e,{variant:"outline",className:F.status==="active"?"border-[#38bdac]/50 text-[#38bdac]":"border-gray-500 text-gray-500",children:F.status==="active"?"正常":"已禁用"})}),t.jsx(Ce,{className:"text-gray-500 text-sm",children:A(F.createdAt)}),t.jsxs(Ce,{className:"text-right",children:[t.jsx(ee,{variant:"ghost",size:"sm",onClick:()=>_(F),className:"text-gray-400 hover:text-[#38bdac]",children:t.jsx(Ft,{className:"w-4 h-4"})}),t.jsx(ee,{variant:"ghost",size:"sm",onClick:()=>z(F.id),className:"text-gray-400 hover:text-red-400",children:t.jsx(sr,{className:"w-4 h-4"})})]})]},F.id)),n.length===0&&!P&&t.jsx(ot,{children:t.jsx(Ce,{colSpan:7,className:"text-center py-12 text-gray-500",children:C==="无权限访问"?"仅超级管理员可查看":"暂无管理员"})})]})]}),p>1&&t.jsx("div",{className:"p-4 border-t border-gray-700/50",children:t.jsx(In,{page:c,pageSize:f,total:l,totalPages:p,onPageChange:u})})]})})}),t.jsx($t,{open:b,onOpenChange:S,children:t.jsxs(It,{className:"bg-[#0f2137] border-gray-700 text-white max-w-sm",children:[t.jsx(Bt,{children:t.jsx(Ut,{className:"text-white",children:E?"编辑管理员":"新增管理员"})}),t.jsxs("div",{className:"space-y-4 py-4",children:[t.jsxs("div",{className:"space-y-2",children:[t.jsx(X,{className:"text-gray-300",children:"用户名"}),t.jsx(ae,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"登录用户名",value:M,onChange:F=>D(F.target.value),disabled:!!E}),E&&t.jsx("p",{className:"text-xs text-gray-500",children:"用户名不可修改"})]}),t.jsxs("div",{className:"space-y-2",children:[t.jsx(X,{className:"text-gray-300",children:E?"新密码(留空不改)":"密码"}),t.jsx(ae,{type:"password",className:"bg-[#0a1628] border-gray-700 text-white",placeholder:E?"留空表示不修改":"至少 6 位",value:V,onChange:F=>k(F.target.value)})]}),t.jsxs("div",{className:"space-y-2",children:[t.jsx(X,{className:"text-gray-300",children:"昵称"}),t.jsx(ae,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"显示名称",value:T,onChange:F=>U(F.target.value)})]}),t.jsxs("div",{className:"space-y-2",children:[t.jsx(X,{className:"text-gray-300",children:"角色"}),t.jsxs("select",{value:Q,onChange:F=>te(F.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:"超级管理员"})]})]}),E&&t.jsxs("div",{className:"space-y-2",children:[t.jsx(X,{className:"text-gray-300",children:"状态"}),t.jsxs("select",{value:oe,onChange:F=>he(F.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(Kt,{children:[t.jsxs(ee,{variant:"outline",onClick:()=>S(!1),className:"border-gray-600 text-gray-300",children:[t.jsx(pr,{className:"w-4 h-4 mr-2"}),"取消"]}),t.jsxs(ee,{onClick:q,disabled:ne,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:[t.jsx(Yt,{className:"w-4 h-4 mr-2"}),ne?"保存中...":"保存"]})]})]})})]})}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(ts,{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(Pe,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl mb-6",children:[t.jsx(We,{children:t.jsx(He,{className:"text-white",children:"1. 接口总览"})}),t.jsxs(Re,{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(Pe,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl mb-6",children:[t.jsx(We,{children:t.jsx(He,{className:"text-white",children:"2. 书籍内容"})}),t.jsxs(Re,{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(Pe,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl mb-6",children:[t.jsx(We,{children:t.jsx(He,{className:"text-white",children:"3. 支付"})}),t.jsxs(Re,{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(Pe,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl mb-6",children:[t.jsx(We,{children:t.jsx(He,{className:"text-white",children:"4. 分销与用户"})}),t.jsxs(Re,{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(Pe,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl mb-6",children:[t.jsx(We,{children:t.jsx(He,{className:"text-white",children:"5. 管理后台"})}),t.jsxs(Re,{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 n=us();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(Tj,{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:n.pathname}),t.jsx(ee,{asChild:!0,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:t.jsxs(hi,{to:"/",children:[t.jsx(aN,{className:"w-4 h-4 mr-2"}),"返回首页"]})})]})})}function x4(){return t.jsxs(lj,{children:[t.jsx(it,{path:"/login",element:t.jsx(rw,{})}),t.jsxs(it,{path:"/",element:t.jsx(ab,{}),children:[t.jsx(it,{index:!0,element:t.jsx(nj,{to:"/dashboard",replace:!0})}),t.jsx(it,{path:"dashboard",element:t.jsx(sw,{})}),t.jsx(it,{path:"orders",element:t.jsx(V1,{})}),t.jsx(it,{path:"users",element:t.jsx(x2,{})}),t.jsx(it,{path:"distribution",element:t.jsx(g2,{})}),t.jsx(it,{path:"withdrawals",element:t.jsx(v2,{})}),t.jsx(it,{path:"content",element:t.jsx(kC,{})}),t.jsx(it,{path:"referral-settings",element:t.jsx(GC,{})}),t.jsx(it,{path:"author-settings",element:t.jsx(QC,{})}),t.jsx(it,{path:"vip-roles",element:t.jsx(d4,{})}),t.jsx(it,{path:"mentors",element:t.jsx(u4,{})}),t.jsx(it,{path:"mentor-consultations",element:t.jsx(f4,{})}),t.jsx(it,{path:"admin-users",element:t.jsx(h4,{})}),t.jsx(it,{path:"settings",element:t.jsx(e4,{})}),t.jsx(it,{path:"payment",element:t.jsx(t4,{})}),t.jsx(it,{path:"site",element:t.jsx(a4,{})}),t.jsx(it,{path:"qrcodes",element:t.jsx(l4,{})}),t.jsx(it,{path:"match",element:t.jsx(o4,{})}),t.jsx(it,{path:"match-records",element:t.jsx(c4,{})}),t.jsx(it,{path:"api-doc",element:t.jsx(m4,{})})]}),t.jsx(it,{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-V947pMyG.js b/soul-admin/dist/assets/index-V947pMyG.js new file mode 100644 index 00000000..1a1279b6 --- /dev/null +++ b/soul-admin/dist/assets/index-V947pMyG.js @@ -0,0 +1,495 @@ +function cv(s,a){for(var l=0;lo[c]})}}}return Object.freeze(Object.defineProperty(s,Symbol.toStringTag,{value:"Module"}))}(function(){const a=document.createElement("link").relList;if(a&&a.supports&&a.supports("modulepreload"))return;for(const c of document.querySelectorAll('link[rel="modulepreload"]'))o(c);new MutationObserver(c=>{for(const d of c)if(d.type==="childList")for(const h of d.addedNodes)h.tagName==="LINK"&&h.rel==="modulepreload"&&o(h)}).observe(document,{childList:!0,subtree:!0});function l(c){const d={};return c.integrity&&(d.integrity=c.integrity),c.referrerPolicy&&(d.referrerPolicy=c.referrerPolicy),c.crossOrigin==="use-credentials"?d.credentials="include":c.crossOrigin==="anonymous"?d.credentials="omit":d.credentials="same-origin",d}function o(c){if(c.ep)return;c.ep=!0;const d=l(c);fetch(c.href,d)}})();function Nx(s){return s&&s.__esModule&&Object.prototype.hasOwnProperty.call(s,"default")?s.default:s}var hd={exports:{}},al={},fd={exports:{}},Ye={};/** + * @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 um;function dv(){if(um)return Ye;um=1;var s=Symbol.for("react.element"),a=Symbol.for("react.portal"),l=Symbol.for("react.fragment"),o=Symbol.for("react.strict_mode"),c=Symbol.for("react.profiler"),d=Symbol.for("react.provider"),h=Symbol.for("react.context"),m=Symbol.for("react.forward_ref"),p=Symbol.for("react.suspense"),y=Symbol.for("react.memo"),g=Symbol.for("react.lazy"),v=Symbol.iterator;function C(M){return M===null||typeof M!="object"?null:(M=v&&M[v]||M["@@iterator"],typeof M=="function"?M:null)}var P={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},T=Object.assign,S={};function b(M,O,F){this.props=M,this.context=O,this.refs=S,this.updater=F||P}b.prototype.isReactComponent={},b.prototype.setState=function(M,O){if(typeof M!="object"&&typeof M!="function"&&M!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,M,O,"setState")},b.prototype.forceUpdate=function(M){this.updater.enqueueForceUpdate(this,M,"forceUpdate")};function N(){}N.prototype=b.prototype;function E(M,O,F){this.props=M,this.context=O,this.refs=S,this.updater=F||P}var j=E.prototype=new N;j.constructor=E,T(j,b.prototype),j.isPureReactComponent=!0;var R=Array.isArray,B=Object.prototype.hasOwnProperty,U={current:null},k={key:!0,ref:!0,__self:!0,__source:!0};function L(M,O,F){var X,H={},ue=null,K=null;if(O!=null)for(X in O.ref!==void 0&&(K=O.ref),O.key!==void 0&&(ue=""+O.key),O)B.call(O,X)&&!k.hasOwnProperty(X)&&(H[X]=O[X]);var ye=arguments.length-2;if(ye===1)H.children=F;else if(1>>1,O=A[M];if(0>>1;Mc(H,W))uec(K,H)?(A[M]=K,A[ue]=W,M=ue):(A[M]=H,A[X]=W,M=X);else if(uec(K,W))A[M]=K,A[ue]=W,M=ue;else break e}}return ne}function c(A,ne){var W=A.sortIndex-ne.sortIndex;return W!==0?W:A.id-ne.id}if(typeof performance=="object"&&typeof performance.now=="function"){var d=performance;s.unstable_now=function(){return d.now()}}else{var h=Date,m=h.now();s.unstable_now=function(){return h.now()-m}}var p=[],y=[],g=1,v=null,C=3,P=!1,T=!1,S=!1,b=typeof setTimeout=="function"?setTimeout:null,N=typeof clearTimeout=="function"?clearTimeout:null,E=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function j(A){for(var ne=l(y);ne!==null;){if(ne.callback===null)o(y);else if(ne.startTime<=A)o(y),ne.sortIndex=ne.expirationTime,a(p,ne);else break;ne=l(y)}}function R(A){if(S=!1,j(A),!T)if(l(p)!==null)T=!0,ce(B);else{var ne=l(y);ne!==null&&re(R,ne.startTime-A)}}function B(A,ne){T=!1,S&&(S=!1,N(L),L=-1),P=!0;var W=C;try{for(j(ne),v=l(p);v!==null&&(!(v.expirationTime>ne)||A&&!le());){var M=v.callback;if(typeof M=="function"){v.callback=null,C=v.priorityLevel;var O=M(v.expirationTime<=ne);ne=s.unstable_now(),typeof O=="function"?v.callback=O:v===l(p)&&o(p),j(ne)}else o(p);v=l(p)}if(v!==null)var F=!0;else{var X=l(y);X!==null&&re(R,X.startTime-ne),F=!1}return F}finally{v=null,C=W,P=!1}}var U=!1,k=null,L=-1,_=5,se=-1;function le(){return!(s.unstable_now()-se<_)}function ie(){if(k!==null){var A=s.unstable_now();se=A;var ne=!0;try{ne=k(!0,A)}finally{ne?ee():(U=!1,k=null)}}else U=!1}var ee;if(typeof E=="function")ee=function(){E(ie)};else if(typeof MessageChannel<"u"){var G=new MessageChannel,Q=G.port2;G.port1.onmessage=ie,ee=function(){Q.postMessage(null)}}else ee=function(){b(ie,0)};function ce(A){k=A,U||(U=!0,ee())}function re(A,ne){L=b(function(){A(s.unstable_now())},ne)}s.unstable_IdlePriority=5,s.unstable_ImmediatePriority=1,s.unstable_LowPriority=4,s.unstable_NormalPriority=3,s.unstable_Profiling=null,s.unstable_UserBlockingPriority=2,s.unstable_cancelCallback=function(A){A.callback=null},s.unstable_continueExecution=function(){T||P||(T=!0,ce(B))},s.unstable_forceFrameRate=function(A){0>A||125M?(A.sortIndex=W,a(y,A),l(p)===null&&A===l(y)&&(S?(N(L),L=-1):S=!0,re(R,W-M))):(A.sortIndex=O,a(p,A),T||P||(T=!0,ce(B))),A},s.unstable_shouldYield=le,s.unstable_wrapCallback=function(A){var ne=C;return function(){var W=C;C=ne;try{return A.apply(this,arguments)}finally{C=W}}}})(pd)),pd}var pm;function mv(){return pm||(pm=1,xd.exports=fv()),xd.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 gm;function xv(){if(gm)return lr;gm=1;var s=au(),a=mv();function l(t){for(var r="https://reactjs.org/docs/error-decoder.html?invariant="+t,n=1;n"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),p=Object.prototype.hasOwnProperty,y=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,g={},v={};function C(t){return p.call(v,t)?!0:p.call(g,t)?!1:y.test(t)?v[t]=!0:(g[t]=!0,!1)}function P(t,r,n,i){if(n!==null&&n.type===0)return!1;switch(typeof r){case"function":case"symbol":return!0;case"boolean":return i?!1:n!==null?!n.acceptsBooleans:(t=t.toLowerCase().slice(0,5),t!=="data-"&&t!=="aria-");default:return!1}}function T(t,r,n,i){if(r===null||typeof r>"u"||P(t,r,n,i))return!0;if(i)return!1;if(n!==null)switch(n.type){case 3:return!r;case 4:return r===!1;case 5:return isNaN(r);case 6:return isNaN(r)||1>r}return!1}function S(t,r,n,i,u,x,w){this.acceptsBooleans=r===2||r===3||r===4,this.attributeName=i,this.attributeNamespace=u,this.mustUseProperty=n,this.propertyName=t,this.type=r,this.sanitizeURL=x,this.removeEmptyString=w}var b={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(t){b[t]=new S(t,0,!1,t,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(t){var r=t[0];b[r]=new S(r,1,!1,t[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(t){b[t]=new S(t,2,!1,t.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(t){b[t]=new S(t,2,!1,t,null,!1,!1)}),"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(t){b[t]=new S(t,3,!1,t.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(t){b[t]=new S(t,3,!0,t,null,!1,!1)}),["capture","download"].forEach(function(t){b[t]=new S(t,4,!1,t,null,!1,!1)}),["cols","rows","size","span"].forEach(function(t){b[t]=new S(t,6,!1,t,null,!1,!1)}),["rowSpan","start"].forEach(function(t){b[t]=new S(t,5,!1,t.toLowerCase(),null,!1,!1)});var N=/[\-:]([a-z])/g;function E(t){return t[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(t){var r=t.replace(N,E);b[r]=new S(r,1,!1,t,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(t){var r=t.replace(N,E);b[r]=new S(r,1,!1,t,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(t){var r=t.replace(N,E);b[r]=new S(r,1,!1,t,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(t){b[t]=new S(t,1,!1,t.toLowerCase(),null,!1,!1)}),b.xlinkHref=new S("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(t){b[t]=new S(t,1,!1,t.toLowerCase(),null,!0,!0)});function j(t,r,n,i){var u=b.hasOwnProperty(r)?b[r]:null;(u!==null?u.type!==0:i||!(2I||u[w]!==x[I]){var $=` +`+u[w].replace(" at new "," at ");return t.displayName&&$.includes("")&&($=$.replace("",t.displayName)),$}while(1<=w&&0<=I);break}}}finally{F=!1,Error.prepareStackTrace=n}return(t=t?t.displayName||t.name:"")?O(t):""}function H(t){switch(t.tag){case 5:return O(t.type);case 16:return O("Lazy");case 13:return O("Suspense");case 19:return O("SuspenseList");case 0:case 2:case 15:return t=X(t.type,!1),t;case 11:return t=X(t.type.render,!1),t;case 1:return t=X(t.type,!0),t;default:return""}}function ue(t){if(t==null)return null;if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t;switch(t){case k:return"Fragment";case U:return"Portal";case _:return"Profiler";case L:return"StrictMode";case ee:return"Suspense";case G:return"SuspenseList"}if(typeof t=="object")switch(t.$$typeof){case le:return(t.displayName||"Context")+".Consumer";case se:return(t._context.displayName||"Context")+".Provider";case ie:var r=t.render;return t=t.displayName,t||(t=r.displayName||r.name||"",t=t!==""?"ForwardRef("+t+")":"ForwardRef"),t;case Q:return r=t.displayName||null,r!==null?r:ue(t.type)||"Memo";case ce:r=t._payload,t=t._init;try{return ue(t(r))}catch{}}return null}function K(t){var r=t.type;switch(t.tag){case 24:return"Cache";case 9:return(r.displayName||"Context")+".Consumer";case 10:return(r._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return t=r.render,t=t.displayName||t.name||"",r.displayName||(t!==""?"ForwardRef("+t+")":"ForwardRef");case 7:return"Fragment";case 5:return r;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return ue(r);case 8:return r===L?"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 r=="function")return r.displayName||r.name||null;if(typeof r=="string")return r}return null}function ye(t){switch(typeof t){case"boolean":case"number":case"string":case"undefined":return t;case"object":return t;default:return""}}function ge(t){var r=t.type;return(t=t.nodeName)&&t.toLowerCase()==="input"&&(r==="checkbox"||r==="radio")}function D(t){var r=ge(t)?"checked":"value",n=Object.getOwnPropertyDescriptor(t.constructor.prototype,r),i=""+t[r];if(!t.hasOwnProperty(r)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var u=n.get,x=n.set;return Object.defineProperty(t,r,{configurable:!0,get:function(){return u.call(this)},set:function(w){i=""+w,x.call(this,w)}}),Object.defineProperty(t,r,{enumerable:n.enumerable}),{getValue:function(){return i},setValue:function(w){i=""+w},stopTracking:function(){t._valueTracker=null,delete t[r]}}}}function fe(t){t._valueTracker||(t._valueTracker=D(t))}function Se(t){if(!t)return!1;var r=t._valueTracker;if(!r)return!0;var n=r.getValue(),i="";return t&&(i=ge(t)?t.checked?"true":"false":t.value),t=i,t!==n?(r.setValue(t),!0):!1}function ze(t){if(t=t||(typeof document<"u"?document:void 0),typeof t>"u")return null;try{return t.activeElement||t.body}catch{return t.body}}function We(t,r){var n=r.checked;return W({},r,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??t._wrapperState.initialChecked})}function qe(t,r){var n=r.defaultValue==null?"":r.defaultValue,i=r.checked!=null?r.checked:r.defaultChecked;n=ye(r.value!=null?r.value:n),t._wrapperState={initialChecked:i,initialValue:n,controlled:r.type==="checkbox"||r.type==="radio"?r.checked!=null:r.value!=null}}function Ze(t,r){r=r.checked,r!=null&&j(t,"checked",r,!1)}function st(t,r){Ze(t,r);var n=ye(r.value),i=r.type;if(n!=null)i==="number"?(n===0&&t.value===""||t.value!=n)&&(t.value=""+n):t.value!==""+n&&(t.value=""+n);else if(i==="submit"||i==="reset"){t.removeAttribute("value");return}r.hasOwnProperty("value")?nt(t,r.type,n):r.hasOwnProperty("defaultValue")&&nt(t,r.type,ye(r.defaultValue)),r.checked==null&&r.defaultChecked!=null&&(t.defaultChecked=!!r.defaultChecked)}function ft(t,r,n){if(r.hasOwnProperty("value")||r.hasOwnProperty("defaultValue")){var i=r.type;if(!(i!=="submit"&&i!=="reset"||r.value!==void 0&&r.value!==null))return;r=""+t._wrapperState.initialValue,n||r===t.value||(t.value=r),t.defaultValue=r}n=t.name,n!==""&&(t.name=""),t.defaultChecked=!!t._wrapperState.initialChecked,n!==""&&(t.name=n)}function nt(t,r,n){(r!=="number"||ze(t.ownerDocument)!==t)&&(n==null?t.defaultValue=""+t._wrapperState.initialValue:t.defaultValue!==""+n&&(t.defaultValue=""+n))}var Vt=Array.isArray;function Fr(t,r,n,i){if(t=t.options,r){r={};for(var u=0;u"+r.valueOf().toString()+"",r=Qe.firstChild;t.firstChild;)t.removeChild(t.firstChild);for(;r.firstChild;)t.appendChild(r.firstChild)}});function dr(t,r){if(r){var n=t.firstChild;if(n&&n===t.lastChild&&n.nodeType===3){n.nodeValue=r;return}}t.textContent=r}var zr={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},Ro=["Webkit","ms","Moz","O"];Object.keys(zr).forEach(function(t){Ro.forEach(function(r){r=r+t.charAt(0).toUpperCase()+t.substring(1),zr[r]=zr[t]})});function Nl(t,r,n){return r==null||typeof r=="boolean"||r===""?"":n||typeof r!="number"||r===0||zr.hasOwnProperty(t)&&zr[t]?(""+r).trim():r+"px"}function ga(t,r){t=t.style;for(var n in r)if(r.hasOwnProperty(n)){var i=n.indexOf("--")===0,u=Nl(n,r[n],i);n==="float"&&(n="cssFloat"),i?t.setProperty(n,u):t[n]=u}}var Io=W({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 ya(t,r){if(r){if(Io[t]&&(r.children!=null||r.dangerouslySetInnerHTML!=null))throw Error(l(137,t));if(r.dangerouslySetInnerHTML!=null){if(r.children!=null)throw Error(l(60));if(typeof r.dangerouslySetInnerHTML!="object"||!("__html"in r.dangerouslySetInnerHTML))throw Error(l(61))}if(r.style!=null&&typeof r.style!="object")throw Error(l(62))}}function va(t,r){if(t.indexOf("-")===-1)return typeof r.is=="string";switch(t){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var ja=null;function ba(t){return t=t.target||t.srcElement||window,t.correspondingUseElement&&(t=t.correspondingUseElement),t.nodeType===3?t.parentNode:t}var Na=null,ys=null,vs=null;function wl(t){if(t=Wa(t)){if(typeof Na!="function")throw Error(l(280));var r=t.stateNode;r&&(r=ql(r),Na(t.stateNode,t.type,r))}}function Sl(t){ys?vs?vs.push(t):vs=[t]:ys=t}function Cl(){if(ys){var t=ys,r=vs;if(vs=ys=null,wl(t),r)for(t=0;t>>=0,t===0?32:31-(C0(t)/k0|0)|0}var _l=64,Ml=4194304;function ka(t){switch(t&-t){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return t&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return t}}function Al(t,r){var n=t.pendingLanes;if(n===0)return 0;var i=0,u=t.suspendedLanes,x=t.pingedLanes,w=n&268435455;if(w!==0){var I=w&~u;I!==0?i=ka(I):(x&=w,x!==0&&(i=ka(x)))}else w=n&~u,w!==0?i=ka(w):x!==0&&(i=ka(x));if(i===0)return 0;if(r!==0&&r!==i&&(r&u)===0&&(u=i&-i,x=r&-r,u>=x||u===16&&(x&4194240)!==0))return r;if((i&4)!==0&&(i|=n&16),r=t.entangledLanes,r!==0)for(t=t.entanglements,r&=i;0n;n++)r.push(t);return r}function Ea(t,r,n){t.pendingLanes|=r,r!==536870912&&(t.suspendedLanes=0,t.pingedLanes=0),t=t.eventTimes,r=31-kr(r),t[r]=n}function R0(t,r){var n=t.pendingLanes&~r;t.pendingLanes=r,t.suspendedLanes=0,t.pingedLanes=0,t.expiredLanes&=r,t.mutableReadLanes&=r,t.entangledLanes&=r,r=t.entanglements;var i=t.eventTimes;for(t=t.expirationTimes;0=Da),sh=" ",nh=!1;function ah(t,r){switch(t){case"keyup":return ny.indexOf(r.keyCode)!==-1;case"keydown":return r.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function lh(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var Rn=!1;function ly(t,r){switch(t){case"compositionend":return lh(r);case"keypress":return r.which!==32?null:(nh=!0,sh);case"textInput":return t=r.data,t===sh&&nh?null:t;default:return null}}function iy(t,r){if(Rn)return t==="compositionend"||!Ko&&ah(t,r)?(t=Xu(),zl=$o=ks=null,Rn=!1,t):null;switch(t){case"paste":return null;case"keypress":if(!(r.ctrlKey||r.altKey||r.metaKey)||r.ctrlKey&&r.altKey){if(r.char&&1=r)return{node:n,offset:r-t};t=i}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=fh(n)}}function xh(t,r){return t&&r?t===r?!0:t&&t.nodeType===3?!1:r&&r.nodeType===3?xh(t,r.parentNode):"contains"in t?t.contains(r):t.compareDocumentPosition?!!(t.compareDocumentPosition(r)&16):!1:!1}function ph(){for(var t=window,r=ze();r instanceof t.HTMLIFrameElement;){try{var n=typeof r.contentWindow.location.href=="string"}catch{n=!1}if(n)t=r.contentWindow;else break;r=ze(t.document)}return r}function Qo(t){var r=t&&t.nodeName&&t.nodeName.toLowerCase();return r&&(r==="input"&&(t.type==="text"||t.type==="search"||t.type==="tel"||t.type==="url"||t.type==="password")||r==="textarea"||t.contentEditable==="true")}function py(t){var r=ph(),n=t.focusedElem,i=t.selectionRange;if(r!==n&&n&&n.ownerDocument&&xh(n.ownerDocument.documentElement,n)){if(i!==null&&Qo(n)){if(r=i.start,t=i.end,t===void 0&&(t=r),"selectionStart"in n)n.selectionStart=r,n.selectionEnd=Math.min(t,n.value.length);else if(t=(r=n.ownerDocument||document)&&r.defaultView||window,t.getSelection){t=t.getSelection();var u=n.textContent.length,x=Math.min(i.start,u);i=i.end===void 0?x:Math.min(i.end,u),!t.extend&&x>i&&(u=i,i=x,x=u),u=mh(n,x);var w=mh(n,i);u&&w&&(t.rangeCount!==1||t.anchorNode!==u.node||t.anchorOffset!==u.offset||t.focusNode!==w.node||t.focusOffset!==w.offset)&&(r=r.createRange(),r.setStart(u.node,u.offset),t.removeAllRanges(),x>i?(t.addRange(r),t.extend(w.node,w.offset)):(r.setEnd(w.node,w.offset),t.addRange(r)))}}for(r=[],t=n;t=t.parentNode;)t.nodeType===1&&r.push({element:t,left:t.scrollLeft,top:t.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n=document.documentMode,In=null,qo=null,za=null,Xo=!1;function gh(t,r,n){var i=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Xo||In==null||In!==ze(i)||(i=In,"selectionStart"in i&&Qo(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}),za&&Fa(za,i)||(za=i,i=Yl(qo,"onSelect"),0Ln||(t.current=cc[Ln],cc[Ln]=null,Ln--)}function lt(t,r){Ln++,cc[Ln]=t.current,t.current=r}var Rs={},Wt=Ts(Rs),tr=Ts(!1),an=Rs;function On(t,r){var n=t.type.contextTypes;if(!n)return Rs;var i=t.stateNode;if(i&&i.__reactInternalMemoizedUnmaskedChildContext===r)return i.__reactInternalMemoizedMaskedChildContext;var u={},x;for(x in n)u[x]=r[x];return i&&(t=t.stateNode,t.__reactInternalMemoizedUnmaskedChildContext=r,t.__reactInternalMemoizedMaskedChildContext=u),u}function rr(t){return t=t.childContextTypes,t!=null}function Xl(){ct(tr),ct(Wt)}function _h(t,r,n){if(Wt.current!==Rs)throw Error(l(168));lt(Wt,r),lt(tr,n)}function Mh(t,r,n){var i=t.stateNode;if(r=r.childContextTypes,typeof i.getChildContext!="function")return n;i=i.getChildContext();for(var u in i)if(!(u in r))throw Error(l(108,K(t)||"Unknown",u));return W({},n,i)}function Jl(t){return t=(t=t.stateNode)&&t.__reactInternalMemoizedMergedChildContext||Rs,an=Wt.current,lt(Wt,t),lt(tr,tr.current),!0}function Ah(t,r,n){var i=t.stateNode;if(!i)throw Error(l(169));n?(t=Mh(t,r,an),i.__reactInternalMemoizedMergedChildContext=t,ct(tr),ct(Wt),lt(Wt,t)):ct(tr),lt(tr,n)}var es=null,Zl=!1,dc=!1;function Dh(t){es===null?es=[t]:es.push(t)}function Py(t){Zl=!0,Dh(t)}function Is(){if(!dc&&es!==null){dc=!0;var t=0,r=rt;try{var n=es;for(rt=1;t>=w,u-=w,ts=1<<32-kr(r)+u|n<Le?(Ot=De,De=null):Ot=De.sibling;var Je=he(Y,De,q[Le],ve);if(Je===null){De===null&&(De=Ot);break}t&&De&&Je.alternate===null&&r(Y,De),V=x(Je,V,Le),Ae===null?Me=Je:Ae.sibling=Je,Ae=Je,De=Ot}if(Le===q.length)return n(Y,De),ut&&on(Y,Le),Me;if(De===null){for(;LeLe?(Ot=De,De=null):Ot=De.sibling;var $s=he(Y,De,Je.value,ve);if($s===null){De===null&&(De=Ot);break}t&&De&&$s.alternate===null&&r(Y,De),V=x($s,V,Le),Ae===null?Me=$s:Ae.sibling=$s,Ae=$s,De=Ot}if(Je.done)return n(Y,De),ut&&on(Y,Le),Me;if(De===null){for(;!Je.done;Le++,Je=q.next())Je=xe(Y,Je.value,ve),Je!==null&&(V=x(Je,V,Le),Ae===null?Me=Je:Ae.sibling=Je,Ae=Je);return ut&&on(Y,Le),Me}for(De=i(Y,De);!Je.done;Le++,Je=q.next())Je=Ce(De,Y,Le,Je.value,ve),Je!==null&&(t&&Je.alternate!==null&&De.delete(Je.key===null?Le:Je.key),V=x(Je,V,Le),Ae===null?Me=Je:Ae.sibling=Je,Ae=Je);return t&&De.forEach(function(ov){return r(Y,ov)}),ut&&on(Y,Le),Me}function bt(Y,V,q,ve){if(typeof q=="object"&&q!==null&&q.type===k&&q.key===null&&(q=q.props.children),typeof q=="object"&&q!==null){switch(q.$$typeof){case B:e:{for(var Me=q.key,Ae=V;Ae!==null;){if(Ae.key===Me){if(Me=q.type,Me===k){if(Ae.tag===7){n(Y,Ae.sibling),V=u(Ae,q.props.children),V.return=Y,Y=V;break e}}else if(Ae.elementType===Me||typeof Me=="object"&&Me!==null&&Me.$$typeof===ce&&Bh(Me)===Ae.type){n(Y,Ae.sibling),V=u(Ae,q.props),V.ref=Ha(Y,Ae,q),V.return=Y,Y=V;break e}n(Y,Ae);break}else r(Y,Ae);Ae=Ae.sibling}q.type===k?(V=pn(q.props.children,Y.mode,ve,q.key),V.return=Y,Y=V):(ve=Ei(q.type,q.key,q.props,null,Y.mode,ve),ve.ref=Ha(Y,V,q),ve.return=Y,Y=ve)}return w(Y);case U:e:{for(Ae=q.key;V!==null;){if(V.key===Ae)if(V.tag===4&&V.stateNode.containerInfo===q.containerInfo&&V.stateNode.implementation===q.implementation){n(Y,V.sibling),V=u(V,q.children||[]),V.return=Y,Y=V;break e}else{n(Y,V);break}else r(Y,V);V=V.sibling}V=id(q,Y.mode,ve),V.return=Y,Y=V}return w(Y);case ce:return Ae=q._init,bt(Y,V,Ae(q._payload),ve)}if(Vt(q))return Te(Y,V,q,ve);if(ne(q))return _e(Y,V,q,ve);si(Y,q)}return typeof q=="string"&&q!==""||typeof q=="number"?(q=""+q,V!==null&&V.tag===6?(n(Y,V.sibling),V=u(V,q),V.return=Y,Y=V):(n(Y,V),V=ld(q,Y.mode,ve),V.return=Y,Y=V),w(Y)):n(Y,V)}return bt}var Bn=Uh(!0),Vh=Uh(!1),ni=Ts(null),ai=null,Un=null,pc=null;function gc(){pc=Un=ai=null}function yc(t){var r=ni.current;ct(ni),t._currentValue=r}function vc(t,r,n){for(;t!==null;){var i=t.alternate;if((t.childLanes&r)!==r?(t.childLanes|=r,i!==null&&(i.childLanes|=r)):i!==null&&(i.childLanes&r)!==r&&(i.childLanes|=r),t===n)break;t=t.return}}function Vn(t,r){ai=t,pc=Un=null,t=t.dependencies,t!==null&&t.firstContext!==null&&((t.lanes&r)!==0&&(sr=!0),t.firstContext=null)}function jr(t){var r=t._currentValue;if(pc!==t)if(t={context:t,memoizedValue:r,next:null},Un===null){if(ai===null)throw Error(l(308));Un=t,ai.dependencies={lanes:0,firstContext:t}}else Un=Un.next=t;return r}var cn=null;function jc(t){cn===null?cn=[t]:cn.push(t)}function Wh(t,r,n,i){var u=r.interleaved;return u===null?(n.next=n,jc(r)):(n.next=u.next,u.next=n),r.interleaved=n,ss(t,i)}function ss(t,r){t.lanes|=r;var n=t.alternate;for(n!==null&&(n.lanes|=r),n=t,t=t.return;t!==null;)t.childLanes|=r,n=t.alternate,n!==null&&(n.childLanes|=r),n=t,t=t.return;return n.tag===3?n.stateNode:null}var _s=!1;function bc(t){t.updateQueue={baseState:t.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Hh(t,r){t=t.updateQueue,r.updateQueue===t&&(r.updateQueue={baseState:t.baseState,firstBaseUpdate:t.firstBaseUpdate,lastBaseUpdate:t.lastBaseUpdate,shared:t.shared,effects:t.effects})}function ns(t,r){return{eventTime:t,lane:r,tag:0,payload:null,callback:null,next:null}}function Ms(t,r,n){var i=t.updateQueue;if(i===null)return null;if(i=i.shared,(Xe&2)!==0){var u=i.pending;return u===null?r.next=r:(r.next=u.next,u.next=r),i.pending=r,ss(t,n)}return u=i.interleaved,u===null?(r.next=r,jc(i)):(r.next=u.next,u.next=r),i.interleaved=r,ss(t,n)}function li(t,r,n){if(r=r.updateQueue,r!==null&&(r=r.shared,(n&4194240)!==0)){var i=r.lanes;i&=t.pendingLanes,n|=i,r.lanes=n,Do(t,n)}}function Kh(t,r){var n=t.updateQueue,i=t.alternate;if(i!==null&&(i=i.updateQueue,n===i)){var u=null,x=null;if(n=n.firstBaseUpdate,n!==null){do{var w={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};x===null?u=x=w:x=x.next=w,n=n.next}while(n!==null);x===null?u=x=r:x=x.next=r}else u=x=r;n={baseState:i.baseState,firstBaseUpdate:u,lastBaseUpdate:x,shared:i.shared,effects:i.effects},t.updateQueue=n;return}t=n.lastBaseUpdate,t===null?n.firstBaseUpdate=r:t.next=r,n.lastBaseUpdate=r}function ii(t,r,n,i){var u=t.updateQueue;_s=!1;var x=u.firstBaseUpdate,w=u.lastBaseUpdate,I=u.shared.pending;if(I!==null){u.shared.pending=null;var $=I,J=$.next;$.next=null,w===null?x=J:w.next=J,w=$;var me=t.alternate;me!==null&&(me=me.updateQueue,I=me.lastBaseUpdate,I!==w&&(I===null?me.firstBaseUpdate=J:I.next=J,me.lastBaseUpdate=$))}if(x!==null){var xe=u.baseState;w=0,me=J=$=null,I=x;do{var he=I.lane,Ce=I.eventTime;if((i&he)===he){me!==null&&(me=me.next={eventTime:Ce,lane:0,tag:I.tag,payload:I.payload,callback:I.callback,next:null});e:{var Te=t,_e=I;switch(he=r,Ce=n,_e.tag){case 1:if(Te=_e.payload,typeof Te=="function"){xe=Te.call(Ce,xe,he);break e}xe=Te;break e;case 3:Te.flags=Te.flags&-65537|128;case 0:if(Te=_e.payload,he=typeof Te=="function"?Te.call(Ce,xe,he):Te,he==null)break e;xe=W({},xe,he);break e;case 2:_s=!0}}I.callback!==null&&I.lane!==0&&(t.flags|=64,he=u.effects,he===null?u.effects=[I]:he.push(I))}else Ce={eventTime:Ce,lane:he,tag:I.tag,payload:I.payload,callback:I.callback,next:null},me===null?(J=me=Ce,$=xe):me=me.next=Ce,w|=he;if(I=I.next,I===null){if(I=u.shared.pending,I===null)break;he=I,I=he.next,he.next=null,u.lastBaseUpdate=he,u.shared.pending=null}}while(!0);if(me===null&&($=xe),u.baseState=$,u.firstBaseUpdate=J,u.lastBaseUpdate=me,r=u.shared.interleaved,r!==null){u=r;do w|=u.lane,u=u.next;while(u!==r)}else x===null&&(u.shared.lanes=0);hn|=w,t.lanes=w,t.memoizedState=xe}}function Yh(t,r,n){if(t=r.effects,r.effects=null,t!==null)for(r=0;rn?n:4,t(!0);var i=kc.transition;kc.transition={};try{t(!1),r()}finally{rt=n,kc.transition=i}}function ff(){return br().memoizedState}function _y(t,r,n){var i=Os(t);if(n={lane:i,action:n,hasEagerState:!1,eagerState:null,next:null},mf(t))xf(r,n);else if(n=Wh(t,r,n,i),n!==null){var u=Jt();_r(n,t,i,u),pf(n,r,i)}}function My(t,r,n){var i=Os(t),u={lane:i,action:n,hasEagerState:!1,eagerState:null,next:null};if(mf(t))xf(r,u);else{var x=t.alternate;if(t.lanes===0&&(x===null||x.lanes===0)&&(x=r.lastRenderedReducer,x!==null))try{var w=r.lastRenderedState,I=x(w,n);if(u.hasEagerState=!0,u.eagerState=I,Er(I,w)){var $=r.interleaved;$===null?(u.next=u,jc(r)):(u.next=$.next,$.next=u),r.interleaved=u;return}}catch{}finally{}n=Wh(t,r,u,i),n!==null&&(u=Jt(),_r(n,t,i,u),pf(n,r,i))}}function mf(t){var r=t.alternate;return t===pt||r!==null&&r===pt}function xf(t,r){Qa=di=!0;var n=t.pending;n===null?r.next=r:(r.next=n.next,n.next=r),t.pending=r}function pf(t,r,n){if((n&4194240)!==0){var i=r.lanes;i&=t.pendingLanes,n|=i,r.lanes=n,Do(t,n)}}var fi={readContext:jr,useCallback:Ht,useContext:Ht,useEffect:Ht,useImperativeHandle:Ht,useInsertionEffect:Ht,useLayoutEffect:Ht,useMemo:Ht,useReducer:Ht,useRef:Ht,useState:Ht,useDebugValue:Ht,useDeferredValue:Ht,useTransition:Ht,useMutableSource:Ht,useSyncExternalStore:Ht,useId:Ht,unstable_isNewReconciler:!1},Ay={readContext:jr,useCallback:function(t,r){return Vr().memoizedState=[t,r===void 0?null:r],t},useContext:jr,useEffect:nf,useImperativeHandle:function(t,r,n){return n=n!=null?n.concat([t]):null,ui(4194308,4,of.bind(null,r,t),n)},useLayoutEffect:function(t,r){return ui(4194308,4,t,r)},useInsertionEffect:function(t,r){return ui(4,2,t,r)},useMemo:function(t,r){var n=Vr();return r=r===void 0?null:r,t=t(),n.memoizedState=[t,r],t},useReducer:function(t,r,n){var i=Vr();return r=n!==void 0?n(r):r,i.memoizedState=i.baseState=r,t={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:t,lastRenderedState:r},i.queue=t,t=t.dispatch=_y.bind(null,pt,t),[i.memoizedState,t]},useRef:function(t){var r=Vr();return t={current:t},r.memoizedState=t},useState:rf,useDebugValue:Mc,useDeferredValue:function(t){return Vr().memoizedState=t},useTransition:function(){var t=rf(!1),r=t[0];return t=Iy.bind(null,t[1]),Vr().memoizedState=t,[r,t]},useMutableSource:function(){},useSyncExternalStore:function(t,r,n){var i=pt,u=Vr();if(ut){if(n===void 0)throw Error(l(407));n=n()}else{if(n=r(),Lt===null)throw Error(l(349));(un&30)!==0||Xh(i,r,n)}u.memoizedState=n;var x={value:n,getSnapshot:r};return u.queue=x,nf(Zh.bind(null,i,x,t),[t]),i.flags|=2048,Ja(9,Jh.bind(null,i,x,n,r),void 0,null),n},useId:function(){var t=Vr(),r=Lt.identifierPrefix;if(ut){var n=rs,i=ts;n=(i&~(1<<32-kr(i)-1)).toString(32)+n,r=":"+r+"R"+n,n=qa++,0<\/script>",t=t.removeChild(t.firstChild)):typeof i.is=="string"?t=w.createElement(n,{is:i.is}):(t=w.createElement(n),n==="select"&&(w=t,i.multiple?w.multiple=!0:i.size&&(w.size=i.size))):t=w.createElementNS(t,n),t[Br]=r,t[Va]=i,Lf(t,r,!1,!1),r.stateNode=t;e:{switch(w=va(n,i),n){case"dialog":ot("cancel",t),ot("close",t),u=i;break;case"iframe":case"object":case"embed":ot("load",t),u=i;break;case"video":case"audio":for(u=0;u<$a.length;u++)ot($a[u],t);u=i;break;case"source":ot("error",t),u=i;break;case"img":case"image":case"link":ot("error",t),ot("load",t),u=i;break;case"details":ot("toggle",t),u=i;break;case"input":qe(t,i),u=We(t,i),ot("invalid",t);break;case"option":u=i;break;case"select":t._wrapperState={wasMultiple:!!i.multiple},u=W({},i,{value:void 0}),ot("invalid",t);break;case"textarea":xs(t,i),u=Xr(t,i),ot("invalid",t);break;default:u=i}ya(n,u),I=u;for(x in I)if(I.hasOwnProperty(x)){var $=I[x];x==="style"?ga(t,$):x==="dangerouslySetInnerHTML"?($=$?$.__html:void 0,$!=null&&Tt(t,$)):x==="children"?typeof $=="string"?(n!=="textarea"||$!=="")&&dr(t,$):typeof $=="number"&&dr(t,""+$):x!=="suppressContentEditableWarning"&&x!=="suppressHydrationWarning"&&x!=="autoFocus"&&(c.hasOwnProperty(x)?$!=null&&x==="onScroll"&&ot("scroll",t):$!=null&&j(t,x,$,w))}switch(n){case"input":fe(t),ft(t,i,!1);break;case"textarea":fe(t),$t(t);break;case"option":i.value!=null&&t.setAttribute("value",""+ye(i.value));break;case"select":t.multiple=!!i.multiple,x=i.value,x!=null?Fr(t,!!i.multiple,x,!1):i.defaultValue!=null&&Fr(t,!!i.multiple,i.defaultValue,!0);break;default:typeof u.onClick=="function"&&(t.onclick=Ql)}switch(n){case"button":case"input":case"select":case"textarea":i=!!i.autoFocus;break e;case"img":i=!0;break e;default:i=!1}}i&&(r.flags|=4)}r.ref!==null&&(r.flags|=512,r.flags|=2097152)}return Kt(r),null;case 6:if(t&&r.stateNode!=null)Ff(t,r,t.memoizedProps,i);else{if(typeof i!="string"&&r.stateNode===null)throw Error(l(166));if(n=dn(Ga.current),dn(Ur.current),ri(r)){if(i=r.stateNode,n=r.memoizedProps,i[Br]=r,(x=i.nodeValue!==n)&&(t=hr,t!==null))switch(t.tag){case 3:Gl(i.nodeValue,n,(t.mode&1)!==0);break;case 5:t.memoizedProps.suppressHydrationWarning!==!0&&Gl(i.nodeValue,n,(t.mode&1)!==0)}x&&(r.flags|=4)}else i=(n.nodeType===9?n:n.ownerDocument).createTextNode(i),i[Br]=r,r.stateNode=i}return Kt(r),null;case 13:if(ct(xt),i=r.memoizedState,t===null||t.memoizedState!==null&&t.memoizedState.dehydrated!==null){if(ut&&fr!==null&&(r.mode&1)!==0&&(r.flags&128)===0)$h(),$n(),r.flags|=98560,x=!1;else if(x=ri(r),i!==null&&i.dehydrated!==null){if(t===null){if(!x)throw Error(l(318));if(x=r.memoizedState,x=x!==null?x.dehydrated:null,!x)throw Error(l(317));x[Br]=r}else $n(),(r.flags&128)===0&&(r.memoizedState=null),r.flags|=4;Kt(r),x=!1}else Pr!==null&&(td(Pr),Pr=null),x=!0;if(!x)return r.flags&65536?r:null}return(r.flags&128)!==0?(r.lanes=n,r):(i=i!==null,i!==(t!==null&&t.memoizedState!==null)&&i&&(r.child.flags|=8192,(r.mode&1)!==0&&(t===null||(xt.current&1)!==0?_t===0&&(_t=3):nd())),r.updateQueue!==null&&(r.flags|=4),Kt(r),null);case 4:return Wn(),Wc(t,r),t===null&&Ba(r.stateNode.containerInfo),Kt(r),null;case 10:return yc(r.type._context),Kt(r),null;case 17:return rr(r.type)&&Xl(),Kt(r),null;case 19:if(ct(xt),x=r.memoizedState,x===null)return Kt(r),null;if(i=(r.flags&128)!==0,w=x.rendering,w===null)if(i)Za(x,!1);else{if(_t!==0||t!==null&&(t.flags&128)!==0)for(t=r.child;t!==null;){if(w=oi(t),w!==null){for(r.flags|=128,Za(x,!1),i=w.updateQueue,i!==null&&(r.updateQueue=i,r.flags|=4),r.subtreeFlags=0,i=n,n=r.child;n!==null;)x=n,t=i,x.flags&=14680066,w=x.alternate,w===null?(x.childLanes=0,x.lanes=t,x.child=null,x.subtreeFlags=0,x.memoizedProps=null,x.memoizedState=null,x.updateQueue=null,x.dependencies=null,x.stateNode=null):(x.childLanes=w.childLanes,x.lanes=w.lanes,x.child=w.child,x.subtreeFlags=0,x.deletions=null,x.memoizedProps=w.memoizedProps,x.memoizedState=w.memoizedState,x.updateQueue=w.updateQueue,x.type=w.type,t=w.dependencies,x.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),n=n.sibling;return lt(xt,xt.current&1|2),r.child}t=t.sibling}x.tail!==null&&jt()>Gn&&(r.flags|=128,i=!0,Za(x,!1),r.lanes=4194304)}else{if(!i)if(t=oi(w),t!==null){if(r.flags|=128,i=!0,n=t.updateQueue,n!==null&&(r.updateQueue=n,r.flags|=4),Za(x,!0),x.tail===null&&x.tailMode==="hidden"&&!w.alternate&&!ut)return Kt(r),null}else 2*jt()-x.renderingStartTime>Gn&&n!==1073741824&&(r.flags|=128,i=!0,Za(x,!1),r.lanes=4194304);x.isBackwards?(w.sibling=r.child,r.child=w):(n=x.last,n!==null?n.sibling=w:r.child=w,x.last=w)}return x.tail!==null?(r=x.tail,x.rendering=r,x.tail=r.sibling,x.renderingStartTime=jt(),r.sibling=null,n=xt.current,lt(xt,i?n&1|2:n&1),r):(Kt(r),null);case 22:case 23:return sd(),i=r.memoizedState!==null,t!==null&&t.memoizedState!==null!==i&&(r.flags|=8192),i&&(r.mode&1)!==0?(mr&1073741824)!==0&&(Kt(r),r.subtreeFlags&6&&(r.flags|=8192)):Kt(r),null;case 24:return null;case 25:return null}throw Error(l(156,r.tag))}function Uy(t,r){switch(hc(r),r.tag){case 1:return rr(r.type)&&Xl(),t=r.flags,t&65536?(r.flags=t&-65537|128,r):null;case 3:return Wn(),ct(tr),ct(Wt),Cc(),t=r.flags,(t&65536)!==0&&(t&128)===0?(r.flags=t&-65537|128,r):null;case 5:return wc(r),null;case 13:if(ct(xt),t=r.memoizedState,t!==null&&t.dehydrated!==null){if(r.alternate===null)throw Error(l(340));$n()}return t=r.flags,t&65536?(r.flags=t&-65537|128,r):null;case 19:return ct(xt),null;case 4:return Wn(),null;case 10:return yc(r.type._context),null;case 22:case 23:return sd(),null;case 24:return null;default:return null}}var gi=!1,Yt=!1,Vy=typeof WeakSet=="function"?WeakSet:Set,Pe=null;function Kn(t,r){var n=t.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(i){gt(t,r,i)}else n.current=null}function Hc(t,r,n){try{n()}catch(i){gt(t,r,i)}}var zf=!1;function Wy(t,r){if(sc=Ol,t=ph(),Qo(t)){if("selectionStart"in t)var n={start:t.selectionStart,end:t.selectionEnd};else e:{n=(n=t.ownerDocument)&&n.defaultView||window;var i=n.getSelection&&n.getSelection();if(i&&i.rangeCount!==0){n=i.anchorNode;var u=i.anchorOffset,x=i.focusNode;i=i.focusOffset;try{n.nodeType,x.nodeType}catch{n=null;break e}var w=0,I=-1,$=-1,J=0,me=0,xe=t,he=null;t:for(;;){for(var Ce;xe!==n||u!==0&&xe.nodeType!==3||(I=w+u),xe!==x||i!==0&&xe.nodeType!==3||($=w+i),xe.nodeType===3&&(w+=xe.nodeValue.length),(Ce=xe.firstChild)!==null;)he=xe,xe=Ce;for(;;){if(xe===t)break t;if(he===n&&++J===u&&(I=w),he===x&&++me===i&&($=w),(Ce=xe.nextSibling)!==null)break;xe=he,he=xe.parentNode}xe=Ce}n=I===-1||$===-1?null:{start:I,end:$}}else n=null}n=n||{start:0,end:0}}else n=null;for(nc={focusedElem:t,selectionRange:n},Ol=!1,Pe=r;Pe!==null;)if(r=Pe,t=r.child,(r.subtreeFlags&1028)!==0&&t!==null)t.return=r,Pe=t;else for(;Pe!==null;){r=Pe;try{var Te=r.alternate;if((r.flags&1024)!==0)switch(r.tag){case 0:case 11:case 15:break;case 1:if(Te!==null){var _e=Te.memoizedProps,bt=Te.memoizedState,Y=r.stateNode,V=Y.getSnapshotBeforeUpdate(r.elementType===r.type?_e:Tr(r.type,_e),bt);Y.__reactInternalSnapshotBeforeUpdate=V}break;case 3:var q=r.stateNode.containerInfo;q.nodeType===1?q.textContent="":q.nodeType===9&&q.documentElement&&q.removeChild(q.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(l(163))}}catch(ve){gt(r,r.return,ve)}if(t=r.sibling,t!==null){t.return=r.return,Pe=t;break}Pe=r.return}return Te=zf,zf=!1,Te}function el(t,r,n){var i=r.updateQueue;if(i=i!==null?i.lastEffect:null,i!==null){var u=i=i.next;do{if((u.tag&t)===t){var x=u.destroy;u.destroy=void 0,x!==void 0&&Hc(r,n,x)}u=u.next}while(u!==i)}}function yi(t,r){if(r=r.updateQueue,r=r!==null?r.lastEffect:null,r!==null){var n=r=r.next;do{if((n.tag&t)===t){var i=n.create;n.destroy=i()}n=n.next}while(n!==r)}}function Kc(t){var r=t.ref;if(r!==null){var n=t.stateNode;switch(t.tag){case 5:t=n;break;default:t=n}typeof r=="function"?r(t):r.current=t}}function $f(t){var r=t.alternate;r!==null&&(t.alternate=null,$f(r)),t.child=null,t.deletions=null,t.sibling=null,t.tag===5&&(r=t.stateNode,r!==null&&(delete r[Br],delete r[Va],delete r[oc],delete r[ky],delete r[Ey])),t.stateNode=null,t.return=null,t.dependencies=null,t.memoizedProps=null,t.memoizedState=null,t.pendingProps=null,t.stateNode=null,t.updateQueue=null}function Bf(t){return t.tag===5||t.tag===3||t.tag===4}function Uf(t){e:for(;;){for(;t.sibling===null;){if(t.return===null||Bf(t.return))return null;t=t.return}for(t.sibling.return=t.return,t=t.sibling;t.tag!==5&&t.tag!==6&&t.tag!==18;){if(t.flags&2||t.child===null||t.tag===4)continue e;t.child.return=t,t=t.child}if(!(t.flags&2))return t.stateNode}}function Yc(t,r,n){var i=t.tag;if(i===5||i===6)t=t.stateNode,r?n.nodeType===8?n.parentNode.insertBefore(t,r):n.insertBefore(t,r):(n.nodeType===8?(r=n.parentNode,r.insertBefore(t,n)):(r=n,r.appendChild(t)),n=n._reactRootContainer,n!=null||r.onclick!==null||(r.onclick=Ql));else if(i!==4&&(t=t.child,t!==null))for(Yc(t,r,n),t=t.sibling;t!==null;)Yc(t,r,n),t=t.sibling}function Gc(t,r,n){var i=t.tag;if(i===5||i===6)t=t.stateNode,r?n.insertBefore(t,r):n.appendChild(t);else if(i!==4&&(t=t.child,t!==null))for(Gc(t,r,n),t=t.sibling;t!==null;)Gc(t,r,n),t=t.sibling}var Bt=null,Rr=!1;function As(t,r,n){for(n=n.child;n!==null;)Vf(t,r,n),n=n.sibling}function Vf(t,r,n){if($r&&typeof $r.onCommitFiberUnmount=="function")try{$r.onCommitFiberUnmount(Il,n)}catch{}switch(n.tag){case 5:Yt||Kn(n,r);case 6:var i=Bt,u=Rr;Bt=null,As(t,r,n),Bt=i,Rr=u,Bt!==null&&(Rr?(t=Bt,n=n.stateNode,t.nodeType===8?t.parentNode.removeChild(n):t.removeChild(n)):Bt.removeChild(n.stateNode));break;case 18:Bt!==null&&(Rr?(t=Bt,n=n.stateNode,t.nodeType===8?ic(t.parentNode,n):t.nodeType===1&&ic(t,n),_a(t)):ic(Bt,n.stateNode));break;case 4:i=Bt,u=Rr,Bt=n.stateNode.containerInfo,Rr=!0,As(t,r,n),Bt=i,Rr=u;break;case 0:case 11:case 14:case 15:if(!Yt&&(i=n.updateQueue,i!==null&&(i=i.lastEffect,i!==null))){u=i=i.next;do{var x=u,w=x.destroy;x=x.tag,w!==void 0&&((x&2)!==0||(x&4)!==0)&&Hc(n,r,w),u=u.next}while(u!==i)}As(t,r,n);break;case 1:if(!Yt&&(Kn(n,r),i=n.stateNode,typeof i.componentWillUnmount=="function"))try{i.props=n.memoizedProps,i.state=n.memoizedState,i.componentWillUnmount()}catch(I){gt(n,r,I)}As(t,r,n);break;case 21:As(t,r,n);break;case 22:n.mode&1?(Yt=(i=Yt)||n.memoizedState!==null,As(t,r,n),Yt=i):As(t,r,n);break;default:As(t,r,n)}}function Wf(t){var r=t.updateQueue;if(r!==null){t.updateQueue=null;var n=t.stateNode;n===null&&(n=t.stateNode=new Vy),r.forEach(function(i){var u=Zy.bind(null,t,i);n.has(i)||(n.add(i),i.then(u,u))})}}function Ir(t,r){var n=r.deletions;if(n!==null)for(var i=0;iu&&(u=w),i&=~x}if(i=u,i=jt()-i,i=(120>i?120:480>i?480:1080>i?1080:1920>i?1920:3e3>i?3e3:4320>i?4320:1960*Ky(i/1960))-i,10t?16:t,Ls===null)var i=!1;else{if(t=Ls,Ls=null,wi=0,(Xe&6)!==0)throw Error(l(331));var u=Xe;for(Xe|=4,Pe=t.current;Pe!==null;){var x=Pe,w=x.child;if((Pe.flags&16)!==0){var I=x.deletions;if(I!==null){for(var $=0;$jt()-Xc?mn(t,0):qc|=n),ar(t,r)}function sm(t,r){r===0&&((t.mode&1)===0?r=1:(r=Ml,Ml<<=1,(Ml&130023424)===0&&(Ml=4194304)));var n=Jt();t=ss(t,r),t!==null&&(Ea(t,r,n),ar(t,n))}function Jy(t){var r=t.memoizedState,n=0;r!==null&&(n=r.retryLane),sm(t,n)}function Zy(t,r){var n=0;switch(t.tag){case 13:var i=t.stateNode,u=t.memoizedState;u!==null&&(n=u.retryLane);break;case 19:i=t.stateNode;break;default:throw Error(l(314))}i!==null&&i.delete(r),sm(t,n)}var nm;nm=function(t,r,n){if(t!==null)if(t.memoizedProps!==r.pendingProps||tr.current)sr=!0;else{if((t.lanes&n)===0&&(r.flags&128)===0)return sr=!1,$y(t,r,n);sr=(t.flags&131072)!==0}else sr=!1,ut&&(r.flags&1048576)!==0&&Lh(r,ti,r.index);switch(r.lanes=0,r.tag){case 2:var i=r.type;pi(t,r),t=r.pendingProps;var u=On(r,Wt.current);Vn(r,n),u=Pc(null,r,i,t,u,n);var x=Tc();return r.flags|=1,typeof u=="object"&&u!==null&&typeof u.render=="function"&&u.$$typeof===void 0?(r.tag=1,r.memoizedState=null,r.updateQueue=null,rr(i)?(x=!0,Jl(r)):x=!1,r.memoizedState=u.state!==null&&u.state!==void 0?u.state:null,bc(r),u.updater=mi,r.stateNode=u,u._reactInternals=r,Dc(r,i,t,n),r=zc(null,r,i,!0,x,n)):(r.tag=0,ut&&x&&uc(r),Xt(null,r,u,n),r=r.child),r;case 16:i=r.elementType;e:{switch(pi(t,r),t=r.pendingProps,u=i._init,i=u(i._payload),r.type=i,u=r.tag=tv(i),t=Tr(i,t),u){case 0:r=Fc(null,r,i,t,n);break e;case 1:r=Rf(null,r,i,t,n);break e;case 11:r=Cf(null,r,i,t,n);break e;case 14:r=kf(null,r,i,Tr(i.type,t),n);break e}throw Error(l(306,i,""))}return r;case 0:return i=r.type,u=r.pendingProps,u=r.elementType===i?u:Tr(i,u),Fc(t,r,i,u,n);case 1:return i=r.type,u=r.pendingProps,u=r.elementType===i?u:Tr(i,u),Rf(t,r,i,u,n);case 3:e:{if(If(r),t===null)throw Error(l(387));i=r.pendingProps,x=r.memoizedState,u=x.element,Hh(t,r),ii(r,i,null,n);var w=r.memoizedState;if(i=w.element,x.isDehydrated)if(x={element:i,isDehydrated:!1,cache:w.cache,pendingSuspenseBoundaries:w.pendingSuspenseBoundaries,transitions:w.transitions},r.updateQueue.baseState=x,r.memoizedState=x,r.flags&256){u=Hn(Error(l(423)),r),r=_f(t,r,i,n,u);break e}else if(i!==u){u=Hn(Error(l(424)),r),r=_f(t,r,i,n,u);break e}else for(fr=Ps(r.stateNode.containerInfo.firstChild),hr=r,ut=!0,Pr=null,n=Vh(r,null,i,n),r.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if($n(),i===u){r=as(t,r,n);break e}Xt(t,r,i,n)}r=r.child}return r;case 5:return Gh(r),t===null&&mc(r),i=r.type,u=r.pendingProps,x=t!==null?t.memoizedProps:null,w=u.children,ac(i,u)?w=null:x!==null&&ac(i,x)&&(r.flags|=32),Tf(t,r),Xt(t,r,w,n),r.child;case 6:return t===null&&mc(r),null;case 13:return Mf(t,r,n);case 4:return Nc(r,r.stateNode.containerInfo),i=r.pendingProps,t===null?r.child=Bn(r,null,i,n):Xt(t,r,i,n),r.child;case 11:return i=r.type,u=r.pendingProps,u=r.elementType===i?u:Tr(i,u),Cf(t,r,i,u,n);case 7:return Xt(t,r,r.pendingProps,n),r.child;case 8:return Xt(t,r,r.pendingProps.children,n),r.child;case 12:return Xt(t,r,r.pendingProps.children,n),r.child;case 10:e:{if(i=r.type._context,u=r.pendingProps,x=r.memoizedProps,w=u.value,lt(ni,i._currentValue),i._currentValue=w,x!==null)if(Er(x.value,w)){if(x.children===u.children&&!tr.current){r=as(t,r,n);break e}}else for(x=r.child,x!==null&&(x.return=r);x!==null;){var I=x.dependencies;if(I!==null){w=x.child;for(var $=I.firstContext;$!==null;){if($.context===i){if(x.tag===1){$=ns(-1,n&-n),$.tag=2;var J=x.updateQueue;if(J!==null){J=J.shared;var me=J.pending;me===null?$.next=$:($.next=me.next,me.next=$),J.pending=$}}x.lanes|=n,$=x.alternate,$!==null&&($.lanes|=n),vc(x.return,n,r),I.lanes|=n;break}$=$.next}}else if(x.tag===10)w=x.type===r.type?null:x.child;else if(x.tag===18){if(w=x.return,w===null)throw Error(l(341));w.lanes|=n,I=w.alternate,I!==null&&(I.lanes|=n),vc(w,n,r),w=x.sibling}else w=x.child;if(w!==null)w.return=x;else for(w=x;w!==null;){if(w===r){w=null;break}if(x=w.sibling,x!==null){x.return=w.return,w=x;break}w=w.return}x=w}Xt(t,r,u.children,n),r=r.child}return r;case 9:return u=r.type,i=r.pendingProps.children,Vn(r,n),u=jr(u),i=i(u),r.flags|=1,Xt(t,r,i,n),r.child;case 14:return i=r.type,u=Tr(i,r.pendingProps),u=Tr(i.type,u),kf(t,r,i,u,n);case 15:return Ef(t,r,r.type,r.pendingProps,n);case 17:return i=r.type,u=r.pendingProps,u=r.elementType===i?u:Tr(i,u),pi(t,r),r.tag=1,rr(i)?(t=!0,Jl(r)):t=!1,Vn(r,n),yf(r,i,u),Dc(r,i,u,n),zc(null,r,i,!0,t,n);case 19:return Df(t,r,n);case 22:return Pf(t,r,n)}throw Error(l(156,r.tag))};function am(t,r){return Ca(t,r)}function ev(t,r,n,i){this.tag=t,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=r,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 wr(t,r,n,i){return new ev(t,r,n,i)}function ad(t){return t=t.prototype,!(!t||!t.isReactComponent)}function tv(t){if(typeof t=="function")return ad(t)?1:0;if(t!=null){if(t=t.$$typeof,t===ie)return 11;if(t===Q)return 14}return 2}function zs(t,r){var n=t.alternate;return n===null?(n=wr(t.tag,r,t.key,t.mode),n.elementType=t.elementType,n.type=t.type,n.stateNode=t.stateNode,n.alternate=t,t.alternate=n):(n.pendingProps=r,n.type=t.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=t.flags&14680064,n.childLanes=t.childLanes,n.lanes=t.lanes,n.child=t.child,n.memoizedProps=t.memoizedProps,n.memoizedState=t.memoizedState,n.updateQueue=t.updateQueue,r=t.dependencies,n.dependencies=r===null?null:{lanes:r.lanes,firstContext:r.firstContext},n.sibling=t.sibling,n.index=t.index,n.ref=t.ref,n}function Ei(t,r,n,i,u,x){var w=2;if(i=t,typeof t=="function")ad(t)&&(w=1);else if(typeof t=="string")w=5;else e:switch(t){case k:return pn(n.children,u,x,r);case L:w=8,u|=8;break;case _:return t=wr(12,n,r,u|2),t.elementType=_,t.lanes=x,t;case ee:return t=wr(13,n,r,u),t.elementType=ee,t.lanes=x,t;case G:return t=wr(19,n,r,u),t.elementType=G,t.lanes=x,t;case re:return Pi(n,u,x,r);default:if(typeof t=="object"&&t!==null)switch(t.$$typeof){case se:w=10;break e;case le:w=9;break e;case ie:w=11;break e;case Q:w=14;break e;case ce:w=16,i=null;break e}throw Error(l(130,t==null?t:typeof t,""))}return r=wr(w,n,r,u),r.elementType=t,r.type=i,r.lanes=x,r}function pn(t,r,n,i){return t=wr(7,t,i,r),t.lanes=n,t}function Pi(t,r,n,i){return t=wr(22,t,i,r),t.elementType=re,t.lanes=n,t.stateNode={isHidden:!1},t}function ld(t,r,n){return t=wr(6,t,null,r),t.lanes=n,t}function id(t,r,n){return r=wr(4,t.children!==null?t.children:[],t.key,r),r.lanes=n,r.stateNode={containerInfo:t.containerInfo,pendingChildren:null,implementation:t.implementation},r}function rv(t,r,n,i,u){this.tag=r,this.containerInfo=t,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Ao(0),this.expirationTimes=Ao(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Ao(0),this.identifierPrefix=i,this.onRecoverableError=u,this.mutableSourceEagerHydrationData=null}function od(t,r,n,i,u,x,w,I,$){return t=new rv(t,r,n,I,$),r===1?(r=1,x===!0&&(r|=8)):r=0,x=wr(3,null,null,r),t.current=x,x.stateNode=t,x.memoizedState={element:i,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},bc(x),t}function sv(t,r,n){var i=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(s)}catch(a){console.error(a)}}return s(),md.exports=xv(),md.exports}var vm;function pv(){if(vm)return Di;vm=1;var s=wx();return Di.createRoot=s.createRoot,Di.hydrateRoot=s.hydrateRoot,Di}var gv=pv(),gl=wx();const yv=Nx(gl);/** + * @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 hl(){return hl=Object.assign?Object.assign.bind():function(s){for(var a=1;a"u")throw new Error(a)}function lu(s,a){if(!s){typeof console<"u"&&console.warn(a);try{throw new Error(a)}catch{}}}function jv(){return Math.random().toString(36).substr(2,8)}function bm(s,a){return{usr:s.state,key:s.key,idx:a}}function Dd(s,a,l,o){return l===void 0&&(l=null),hl({pathname:typeof s=="string"?s:s.pathname,search:"",hash:""},typeof a=="string"?oa(a):a,{state:l,key:a&&a.key||o||jv()})}function Qi(s){let{pathname:a="/",search:l="",hash:o=""}=s;return l&&l!=="?"&&(a+=l.charAt(0)==="?"?l:"?"+l),o&&o!=="#"&&(a+=o.charAt(0)==="#"?o:"#"+o),a}function oa(s){let a={};if(s){let l=s.indexOf("#");l>=0&&(a.hash=s.substr(l),s=s.substr(0,l));let o=s.indexOf("?");o>=0&&(a.search=s.substr(o),s=s.substr(0,o)),s&&(a.pathname=s)}return a}function bv(s,a,l,o){o===void 0&&(o={});let{window:c=document.defaultView,v5Compat:d=!1}=o,h=c.history,m=Hs.Pop,p=null,y=g();y==null&&(y=0,h.replaceState(hl({},h.state,{idx:y}),""));function g(){return(h.state||{idx:null}).idx}function v(){m=Hs.Pop;let b=g(),N=b==null?null:b-y;y=b,p&&p({action:m,location:S.location,delta:N})}function C(b,N){m=Hs.Push;let E=Dd(S.location,b,N);y=g()+1;let j=bm(E,y),R=S.createHref(E);try{h.pushState(j,"",R)}catch(B){if(B instanceof DOMException&&B.name==="DataCloneError")throw B;c.location.assign(R)}d&&p&&p({action:m,location:S.location,delta:1})}function P(b,N){m=Hs.Replace;let E=Dd(S.location,b,N);y=g();let j=bm(E,y),R=S.createHref(E);h.replaceState(j,"",R),d&&p&&p({action:m,location:S.location,delta:0})}function T(b){let N=c.location.origin!=="null"?c.location.origin:c.location.href,E=typeof b=="string"?b:Qi(b);return E=E.replace(/ $/,"%20"),kt(N,"No window.location.(origin|href) available to create URL for href: "+E),new URL(E,N)}let S={get action(){return m},get location(){return s(c,h)},listen(b){if(p)throw new Error("A history only accepts one active listener");return c.addEventListener(jm,v),p=b,()=>{c.removeEventListener(jm,v),p=null}},createHref(b){return a(c,b)},createURL:T,encodeLocation(b){let N=T(b);return{pathname:N.pathname,search:N.search,hash:N.hash}},push:C,replace:P,go(b){return h.go(b)}};return S}var Nm;(function(s){s.data="data",s.deferred="deferred",s.redirect="redirect",s.error="error"})(Nm||(Nm={}));function Nv(s,a,l){return l===void 0&&(l="/"),wv(s,a,l)}function wv(s,a,l,o){let c=typeof a=="string"?oa(a):a,d=iu(c.pathname||"/",l);if(d==null)return null;let h=Sx(s);Sv(h);let m=null;for(let p=0;m==null&&p{let p={relativePath:m===void 0?d.path||"":m,caseSensitive:d.caseSensitive===!0,childrenIndex:h,route:d};p.relativePath.startsWith("/")&&(kt(p.relativePath.startsWith(o),'Absolute route path "'+p.relativePath+'" nested under path '+('"'+o+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),p.relativePath=p.relativePath.slice(o.length));let y=Ks([o,p.relativePath]),g=l.concat(p);d.children&&d.children.length>0&&(kt(d.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+y+'".')),Sx(d.children,a,g,y)),!(d.path==null&&!d.index)&&a.push({path:y,score:Iv(y,d.index),routesMeta:g})};return s.forEach((d,h)=>{var m;if(d.path===""||!((m=d.path)!=null&&m.includes("?")))c(d,h);else for(let p of Cx(d.path))c(d,h,p)}),a}function Cx(s){let a=s.split("/");if(a.length===0)return[];let[l,...o]=a,c=l.endsWith("?"),d=l.replace(/\?$/,"");if(o.length===0)return c?[d,""]:[d];let h=Cx(o.join("/")),m=[];return m.push(...h.map(p=>p===""?d:[d,p].join("/"))),c&&m.push(...h),m.map(p=>s.startsWith("/")&&p===""?"/":p)}function Sv(s){s.sort((a,l)=>a.score!==l.score?l.score-a.score:_v(a.routesMeta.map(o=>o.childrenIndex),l.routesMeta.map(o=>o.childrenIndex)))}const Cv=/^:[\w-]+$/,kv=3,Ev=2,Pv=1,Tv=10,Rv=-2,wm=s=>s==="*";function Iv(s,a){let l=s.split("/"),o=l.length;return l.some(wm)&&(o+=Rv),a&&(o+=Ev),l.filter(c=>!wm(c)).reduce((c,d)=>c+(Cv.test(d)?kv:d===""?Pv:Tv),o)}function _v(s,a){return s.length===a.length&&s.slice(0,-1).every((o,c)=>o===a[c])?s[s.length-1]-a[a.length-1]:0}function Mv(s,a,l){let{routesMeta:o}=s,c={},d="/",h=[];for(let m=0;m{let{paramName:C,isOptional:P}=g;if(C==="*"){let S=m[v]||"";h=d.slice(0,d.length-S.length).replace(/(.)\/+$/,"$1")}const T=m[v];return P&&!T?y[C]=void 0:y[C]=(T||"").replace(/%2F/g,"/"),y},{}),pathname:d,pathnameBase:h,pattern:s}}function Dv(s,a,l){a===void 0&&(a=!1),l===void 0&&(l=!0),lu(s==="*"||!s.endsWith("*")||s.endsWith("/*"),'Route path "'+s+'" will be treated as if it were '+('"'+s.replace(/\*$/,"/*")+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+('please change the route path to "'+s.replace(/\*$/,"/*")+'".'));let o=[],c="^"+s.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(h,m,p)=>(o.push({paramName:m,isOptional:p!=null}),p?"/?([^\\/]+)?":"/([^\\/]+)"));return s.endsWith("*")?(o.push({paramName:"*"}),c+=s==="*"||s==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):l?c+="\\/*$":s!==""&&s!=="/"&&(c+="(?:(?=\\/|$))"),[new RegExp(c,a?void 0:"i"),o]}function Lv(s){try{return s.split("/").map(a=>decodeURIComponent(a).replace(/\//g,"%2F")).join("/")}catch(a){return lu(!1,'The URL path "'+s+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent '+("encoding ("+a+").")),s}}function iu(s,a){if(a==="/")return s;if(!s.toLowerCase().startsWith(a.toLowerCase()))return null;let l=a.endsWith("/")?a.length-1:a.length,o=s.charAt(l);return o&&o!=="/"?null:s.slice(l)||"/"}const Ov=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Fv=s=>Ov.test(s);function zv(s,a){a===void 0&&(a="/");let{pathname:l,search:o="",hash:c=""}=typeof s=="string"?oa(s):s,d;if(l)if(Fv(l))d=l;else{if(l.includes("//")){let h=l;l=l.replace(/\/\/+/g,"/"),lu(!1,"Pathnames cannot have embedded double slashes - normalizing "+(h+" -> "+l))}l.startsWith("/")?d=Sm(l.substring(1),"/"):d=Sm(l,a)}else d=a;return{pathname:d,search:Uv(o),hash:Vv(c)}}function Sm(s,a){let l=a.replace(/\/+$/,"").split("/");return s.split("/").forEach(c=>{c===".."?l.length>1&&l.pop():c!=="."&&l.push(c)}),l.length>1?l.join("/"):"/"}function gd(s,a,l,o){return"Cannot include a '"+s+"' 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 $v(s){return s.filter((a,l)=>l===0||a.route.path&&a.route.path.length>0)}function ou(s,a){let l=$v(s);return a?l.map((o,c)=>c===l.length-1?o.pathname:o.pathnameBase):l.map(o=>o.pathnameBase)}function cu(s,a,l,o){o===void 0&&(o=!1);let c;typeof s=="string"?c=oa(s):(c=hl({},s),kt(!c.pathname||!c.pathname.includes("?"),gd("?","pathname","search",c)),kt(!c.pathname||!c.pathname.includes("#"),gd("#","pathname","hash",c)),kt(!c.search||!c.search.includes("#"),gd("#","search","hash",c)));let d=s===""||c.pathname==="",h=d?"/":c.pathname,m;if(h==null)m=l;else{let v=a.length-1;if(!o&&h.startsWith("..")){let C=h.split("/");for(;C[0]==="..";)C.shift(),v-=1;c.pathname=C.join("/")}m=v>=0?a[v]:"/"}let p=zv(c,m),y=h&&h!=="/"&&h.endsWith("/"),g=(d||h===".")&&l.endsWith("/");return!p.pathname.endsWith("/")&&(y||g)&&(p.pathname+="/"),p}const Ks=s=>s.join("/").replace(/\/\/+/g,"/"),Bv=s=>s.replace(/\/+$/,"").replace(/^\/*/,"/"),Uv=s=>!s||s==="?"?"":s.startsWith("?")?s:"?"+s,Vv=s=>!s||s==="#"?"":s.startsWith("#")?s:"#"+s;function Wv(s){return s!=null&&typeof s.status=="number"&&typeof s.statusText=="string"&&typeof s.internal=="boolean"&&"data"in s}const kx=["post","put","patch","delete"];new Set(kx);const Hv=["get",...kx];new Set(Hv);/** + * 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 fl(){return fl=Object.assign?Object.assign.bind():function(s){for(var a=1;a{m.current=!0}),f.useCallback(function(y,g){if(g===void 0&&(g={}),!m.current)return;if(typeof y=="number"){o.go(y);return}let v=cu(y,JSON.parse(h),d,g.relative==="path");s==null&&a!=="/"&&(v.pathname=v.pathname==="/"?a:Ks([a,v.pathname])),(g.replace?o.replace:o.push)(v,g.state,g)},[a,o,h,d,s])}const Qv=f.createContext(null);function qv(s){let a=f.useContext(ms).outlet;return a&&f.createElement(Qv.Provider,{value:s},a)}function Tx(s,a){let{relative:l}=a===void 0?{}:a,{future:o}=f.useContext(Js),{matches:c}=f.useContext(ms),{pathname:d}=Zs(),h=JSON.stringify(ou(c,o.v7_relativeSplatPath));return f.useMemo(()=>cu(s,JSON.parse(h),d,l==="path"),[s,h,d,l])}function Xv(s,a){return Jv(s,a)}function Jv(s,a,l,o){ca()||kt(!1);let{navigator:c}=f.useContext(Js),{matches:d}=f.useContext(ms),h=d[d.length-1],m=h?h.params:{};h&&h.pathname;let p=h?h.pathnameBase:"/";h&&h.route;let y=Zs(),g;if(a){var v;let b=typeof a=="string"?oa(a):a;p==="/"||(v=b.pathname)!=null&&v.startsWith(p)||kt(!1),g=b}else g=y;let C=g.pathname||"/",P=C;if(p!=="/"){let b=p.replace(/^\//,"").split("/");P="/"+C.replace(/^\//,"").split("/").slice(b.length).join("/")}let T=Nv(s,{pathname:P}),S=sj(T&&T.map(b=>Object.assign({},b,{params:Object.assign({},m,b.params),pathname:Ks([p,c.encodeLocation?c.encodeLocation(b.pathname).pathname:b.pathname]),pathnameBase:b.pathnameBase==="/"?p:Ks([p,c.encodeLocation?c.encodeLocation(b.pathnameBase).pathname:b.pathnameBase])})),d,l,o);return a&&S?f.createElement(ho.Provider,{value:{location:fl({pathname:"/",search:"",hash:"",state:null,key:"default"},g),navigationType:Hs.Pop}},S):S}function Zv(){let s=ij(),a=Wv(s)?s.status+" "+s.statusText:s instanceof Error?s.message:JSON.stringify(s),l=s instanceof Error?s.stack:null,c={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return f.createElement(f.Fragment,null,f.createElement("h2",null,"Unexpected Application Error!"),f.createElement("h3",{style:{fontStyle:"italic"}},a),l?f.createElement("pre",{style:c},l):null,null)}const ej=f.createElement(Zv,null);class tj extends f.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?f.createElement(ms.Provider,{value:this.props.routeContext},f.createElement(Ex.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function rj(s){let{routeContext:a,match:l,children:o}=s,c=f.useContext(du);return c&&c.static&&c.staticContext&&(l.route.errorElement||l.route.ErrorBoundary)&&(c.staticContext._deepestRenderedBoundaryId=l.route.id),f.createElement(ms.Provider,{value:a},o)}function sj(s,a,l,o){var c;if(a===void 0&&(a=[]),l===void 0&&(l=null),o===void 0&&(o=null),s==null){var d;if(!l)return null;if(l.errors)s=l.matches;else if((d=o)!=null&&d.v7_partialHydration&&a.length===0&&!l.initialized&&l.matches.length>0)s=l.matches;else return null}let h=s,m=(c=l)==null?void 0:c.errors;if(m!=null){let g=h.findIndex(v=>v.route.id&&(m==null?void 0:m[v.route.id])!==void 0);g>=0||kt(!1),h=h.slice(0,Math.min(h.length,g+1))}let p=!1,y=-1;if(l&&o&&o.v7_partialHydration)for(let g=0;g=0?h=h.slice(0,y+1):h=[h[0]];break}}}return h.reduceRight((g,v,C)=>{let P,T=!1,S=null,b=null;l&&(P=m&&v.route.id?m[v.route.id]:void 0,S=v.route.errorElement||ej,p&&(y<0&&C===0?(cj("route-fallback"),T=!0,b=null):y===C&&(T=!0,b=v.route.hydrateFallbackElement||null)));let N=a.concat(h.slice(0,C+1)),E=()=>{let j;return P?j=S:T?j=b:v.route.Component?j=f.createElement(v.route.Component,null):v.route.element?j=v.route.element:j=g,f.createElement(rj,{match:v,routeContext:{outlet:g,matches:N,isDataRoute:l!=null},children:j})};return l&&(v.route.ErrorBoundary||v.route.errorElement||C===0)?f.createElement(tj,{location:l.location,revalidation:l.revalidation,component:S,error:P,children:E(),routeContext:{outlet:null,matches:N,isDataRoute:!0}}):E()},null)}var Rx=(function(s){return s.UseBlocker="useBlocker",s.UseRevalidator="useRevalidator",s.UseNavigateStable="useNavigate",s})(Rx||{}),Ix=(function(s){return s.UseBlocker="useBlocker",s.UseLoaderData="useLoaderData",s.UseActionData="useActionData",s.UseRouteError="useRouteError",s.UseNavigation="useNavigation",s.UseRouteLoaderData="useRouteLoaderData",s.UseMatches="useMatches",s.UseRevalidator="useRevalidator",s.UseNavigateStable="useNavigate",s.UseRouteId="useRouteId",s})(Ix||{});function nj(s){let a=f.useContext(du);return a||kt(!1),a}function aj(s){let a=f.useContext(Kv);return a||kt(!1),a}function lj(s){let a=f.useContext(ms);return a||kt(!1),a}function _x(s){let a=lj(),l=a.matches[a.matches.length-1];return l.route.id||kt(!1),l.route.id}function ij(){var s;let a=f.useContext(Ex),l=aj(),o=_x();return a!==void 0?a:(s=l.errors)==null?void 0:s[o]}function oj(){let{router:s}=nj(Rx.UseNavigateStable),a=_x(Ix.UseNavigateStable),l=f.useRef(!1);return Px(()=>{l.current=!0}),f.useCallback(function(c,d){d===void 0&&(d={}),l.current&&(typeof c=="number"?s.navigate(c):s.navigate(c,fl({fromRouteId:a},d)))},[s,a])}const Cm={};function cj(s,a,l){Cm[s]||(Cm[s]=!0)}function dj(s,a){s==null||s.v7_startTransition,s==null||s.v7_relativeSplatPath}function yd(s){let{to:a,replace:l,state:o,relative:c}=s;ca()||kt(!1);let{future:d,static:h}=f.useContext(Js),{matches:m}=f.useContext(ms),{pathname:p}=Zs(),y=da(),g=cu(a,ou(m,d.v7_relativeSplatPath),p,c==="path"),v=JSON.stringify(g);return f.useEffect(()=>y(JSON.parse(v),{replace:l,state:o,relative:c}),[y,v,c,l,o]),null}function uj(s){return qv(s.context)}function dt(s){kt(!1)}function hj(s){let{basename:a="/",children:l=null,location:o,navigationType:c=Hs.Pop,navigator:d,static:h=!1,future:m}=s;ca()&&kt(!1);let p=a.replace(/^\/*/,"/"),y=f.useMemo(()=>({basename:p,navigator:d,static:h,future:fl({v7_relativeSplatPath:!1},m)}),[p,m,d,h]);typeof o=="string"&&(o=oa(o));let{pathname:g="/",search:v="",hash:C="",state:P=null,key:T="default"}=o,S=f.useMemo(()=>{let b=iu(g,p);return b==null?null:{location:{pathname:b,search:v,hash:C,state:P,key:T},navigationType:c}},[p,g,v,C,P,T,c]);return S==null?null:f.createElement(Js.Provider,{value:y},f.createElement(ho.Provider,{children:l,value:S}))}function fj(s){let{children:a,location:l}=s;return Xv(Ld(a),l)}new Promise(()=>{});function Ld(s,a){a===void 0&&(a=[]);let l=[];return f.Children.forEach(s,(o,c)=>{if(!f.isValidElement(o))return;let d=[...a,c];if(o.type===f.Fragment){l.push.apply(l,Ld(o.props.children,d));return}o.type!==dt&&kt(!1),!o.props.index||!o.props.children||kt(!1);let h={id:o.props.id||d.join("-"),caseSensitive:o.props.caseSensitive,element:o.props.element,Component:o.props.Component,index:o.props.index,path:o.props.path,loader:o.props.loader,action:o.props.action,errorElement:o.props.errorElement,ErrorBoundary:o.props.ErrorBoundary,hasErrorBoundary:o.props.ErrorBoundary!=null||o.props.errorElement!=null,shouldRevalidate:o.props.shouldRevalidate,handle:o.props.handle,lazy:o.props.lazy};o.props.children&&(h.children=Ld(o.props.children,d)),l.push(h)}),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 Od(){return Od=Object.assign?Object.assign.bind():function(s){for(var a=1;a=0)&&(l[c]=s[c]);return l}function xj(s){return!!(s.metaKey||s.altKey||s.ctrlKey||s.shiftKey)}function pj(s,a){return s.button===0&&(!a||a==="_self")&&!xj(s)}function Fd(s){return s===void 0&&(s=""),new URLSearchParams(typeof s=="string"||Array.isArray(s)||s instanceof URLSearchParams?s:Object.keys(s).reduce((a,l)=>{let o=s[l];return a.concat(Array.isArray(o)?o.map(c=>[l,c]):[[l,o]])},[]))}function gj(s,a){let l=Fd(s);return a&&a.forEach((o,c)=>{l.has(c)||a.getAll(c).forEach(d=>{l.append(c,d)})}),l}const yj=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","viewTransition"],vj="6";try{window.__reactRouterVersion=vj}catch{}const jj="startTransition",km=uo[jj];function bj(s){let{basename:a,children:l,future:o,window:c}=s,d=f.useRef();d.current==null&&(d.current=vv({window:c,v5Compat:!0}));let h=d.current,[m,p]=f.useState({action:h.action,location:h.location}),{v7_startTransition:y}=o||{},g=f.useCallback(v=>{y&&km?km(()=>p(v)):p(v)},[p,y]);return f.useLayoutEffect(()=>h.listen(g),[h,g]),f.useEffect(()=>dj(o),[o]),f.createElement(hj,{basename:a,children:l,location:m.location,navigationType:m.action,navigator:h,future:o})}const Nj=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",wj=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Hi=f.forwardRef(function(a,l){let{onClick:o,relative:c,reloadDocument:d,replace:h,state:m,target:p,to:y,preventScrollReset:g,viewTransition:v}=a,C=mj(a,yj),{basename:P}=f.useContext(Js),T,S=!1;if(typeof y=="string"&&wj.test(y)&&(T=y,Nj))try{let j=new URL(window.location.href),R=y.startsWith("//")?new URL(j.protocol+y):new URL(y),B=iu(R.pathname,P);R.origin===j.origin&&B!=null?y=B+R.search+R.hash:S=!0}catch{}let b=Yv(y,{relative:c}),N=Sj(y,{replace:h,state:m,target:p,preventScrollReset:g,relative:c,viewTransition:v});function E(j){o&&o(j),j.defaultPrevented||N(j)}return f.createElement("a",Od({},C,{href:T||b,onClick:S||d?o:E,ref:l,target:p}))});var Em;(function(s){s.UseScrollRestoration="useScrollRestoration",s.UseSubmit="useSubmit",s.UseSubmitFetcher="useSubmitFetcher",s.UseFetcher="useFetcher",s.useViewTransitionState="useViewTransitionState"})(Em||(Em={}));var Pm;(function(s){s.UseFetcher="useFetcher",s.UseFetchers="useFetchers",s.UseScrollRestoration="useScrollRestoration"})(Pm||(Pm={}));function Sj(s,a){let{target:l,replace:o,state:c,preventScrollReset:d,relative:h,viewTransition:m}=a===void 0?{}:a,p=da(),y=Zs(),g=Tx(s,{relative:h});return f.useCallback(v=>{if(pj(v,l)){v.preventDefault();let C=o!==void 0?o:Qi(y)===Qi(g);p(s,{replace:C,state:c,preventScrollReset:d,relative:h,viewTransition:m})}},[y,p,g,o,c,l,s,d,h,m])}function Cj(s){let a=f.useRef(Fd(s)),l=f.useRef(!1),o=Zs(),c=f.useMemo(()=>gj(o.search,l.current?null:a.current),[o.search]),d=da(),h=f.useCallback((m,p)=>{const y=Fd(typeof m=="function"?m(c):m);l.current=!0,d("?"+y,p)},[d,c]);return[c,h]}/** + * @license lucide-react v0.562.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=s=>s.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),Ej=s=>s.replace(/^([A-Z])|[\s-_]+(\w)/g,(a,l,o)=>o?o.toUpperCase():l.toLowerCase()),Tm=s=>{const a=Ej(s);return a.charAt(0).toUpperCase()+a.slice(1)},Mx=(...s)=>s.filter((a,l,o)=>!!a&&a.trim()!==""&&o.indexOf(a)===l).join(" ").trim(),Pj=s=>{for(const a in s)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 Tj={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 Rj=f.forwardRef(({color:s="currentColor",size:a=24,strokeWidth:l=2,absoluteStrokeWidth:o,className:c="",children:d,iconNode:h,...m},p)=>f.createElement("svg",{ref:p,...Tj,width:a,height:a,stroke:s,strokeWidth:o?Number(l)*24/Number(a):l,className:Mx("lucide",c),...!d&&!Pj(m)&&{"aria-hidden":"true"},...m},[...h.map(([y,g])=>f.createElement(y,g)),...Array.isArray(d)?d:[d]]));/** + * @license lucide-react v0.562.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const ke=(s,a)=>{const l=f.forwardRef(({className:o,...c},d)=>f.createElement(Rj,{ref:d,iconNode:a,className:Mx(`lucide-${kj(Tm(s))}`,`lucide-${s}`,o),...c}));return l.displayName=Tm(s),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 Ij=[["path",{d:"M11.767 19.089c4.924.868 6.14-6.025 1.216-6.894m-1.216 6.894L5.86 18.047m5.908 1.042-.347 1.97m1.563-8.864c4.924.869 6.14-6.025 1.215-6.893m-1.215 6.893-3.94-.694m5.155-6.2L8.29 4.26m5.908 1.042.348-1.97M7.48 20.364l3.126-17.727",key:"yr8idg"}]],Rm=ke("bitcoin",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 _j=[["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"}]],us=ke("book-open",_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 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"}]],qi=ke("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 Aj=[["path",{d:"M3 3v16a2 2 0 0 0 2 2h16",key:"c24i48"}],["path",{d:"M18 17V9",key:"2bz60n"}],["path",{d:"M13 17V5",key:"1frdt8"}],["path",{d:"M8 17v-3",key:"17ska0"}]],Dj=ke("chart-column",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 Lj=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],fo=ke("check",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=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],ml=ke("chevron-down",Oj);/** + * @license lucide-react v0.562.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Fj=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],Vs=ke("chevron-right",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:"m18 15-6-6-6 6",key:"153udz"}]],Ax=ke("chevron-up",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=[["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"}]],Bj=ke("circle-alert",$j);/** + * @license lucide-react v0.562.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Uj=[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]],Im=ke("circle-check-big",Uj);/** + * @license lucide-react v0.562.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Vj=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],Wj=ke("circle-check",Vj);/** + * @license lucide-react v0.562.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Hj=[["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"}]],Dx=ke("circle-question-mark",Hj);/** + * @license lucide-react v0.562.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Kj=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["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"}]],vd=ke("circle-user",Kj);/** + * @license lucide-react v0.562.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Yj=[["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"}]],Lx=ke("circle-x",Yj);/** + * @license lucide-react v0.562.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Gj=[["path",{d:"M12 6v6l4 2",key:"mmk7yg"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],Ox=ke("clock",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:"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"}]],Fx=ke("copy",Qj);/** + * @license lucide-react v0.562.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const qj=[["rect",{width:"20",height:"14",x:"2",y:"5",rx:"2",key:"ynyp8z"}],["line",{x1:"2",x2:"22",y1:"10",y2:"10",key:"1b3vmo"}]],zd=ke("credit-card",qj);/** + * @license lucide-react v0.562.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Xj=[["path",{d:"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"}]],mo=ke("crown",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=[["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"}]],Xi=ke("dollar-sign",Jj);/** + * @license lucide-react v0.562.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Zj=[["path",{d:"M12 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"}]],eb=ke("download",Zj);/** + * @license lucide-react v0.562.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const tb=[["path",{d:"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=ke("external-link",tb);/** + * @license lucide-react v0.562.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const rb=[["path",{d:"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"}]],ds=ke("eye",rb);/** + * @license lucide-react v0.562.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const sb=[["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"}]],nb=ke("file-text",sb);/** + * @license lucide-react v0.562.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const ab=[["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"}]],lb=ke("funnel",ab);/** + * @license lucide-react v0.562.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const ib=[["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"}]],ob=ke("gift",ib);/** + * @license lucide-react v0.562.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const cb=[["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"}]],db=ke("git-merge",cb);/** + * @license lucide-react v0.562.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const ub=[["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"}]],$d=ke("globe",ub);/** + * @license lucide-react v0.562.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const hb=[["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"}]],zx=ke("graduation-cap",hb);/** + * @license lucide-react v0.562.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const fb=[["circle",{cx:"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"}]],is=ke("grip-vertical",fb);/** + * @license lucide-react v0.562.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const mb=[["path",{d:"m11 17 2 2a1 1 0 1 0 3-3",key:"efffak"}],["path",{d:"m14 14 2.5 2.5a1 1 0 1 0 3-3l-3.88-3.88a3 3 0 0 0-4.24 0l-.88.88a1 1 0 1 1-3-3l2.81-2.81a5.79 5.79 0 0 1 7.06-.87l.47.28a2 2 0 0 0 1.42.25L21 4",key:"9pr0kb"}],["path",{d:"m21 3 1 11h-2",key:"1tisrp"}],["path",{d:"M3 3 2 14l6.5 6.5a1 1 0 1 0 3-3",key:"1uvwmv"}],["path",{d:"M3 4h8",key:"1ep09j"}]],xb=ke("handshake",mb);/** + * @license lucide-react v0.562.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const pb=[["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"}]],_m=ke("history",pb);/** + * @license lucide-react v0.562.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const gb=[["path",{d:"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"}]],yb=ke("house",gb);/** + * @license lucide-react v0.562.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const vb=[["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"}]],$x=ke("image",vb);/** + * @license lucide-react v0.562.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const jb=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],Li=ke("info",jb);/** + * @license lucide-react v0.562.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const bb=[["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"}]],Mm=ke("key",bb);/** + * @license lucide-react v0.562.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Nb=[["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"}]],wb=ke("layout-dashboard",Nb);/** + * @license lucide-react v0.562.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Sb=[["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"}]],Ys=ke("link-2",Sb);/** + * @license lucide-react v0.562.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Cb=[["path",{d:"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"}]],Am=ke("link",Cb);/** + * @license lucide-react v0.562.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const kb=[["path",{d:"M3 5h.01",key:"18ugdj"}],["path",{d:"M3 12h.01",key:"nlz23k"}],["path",{d:"M3 19h.01",key:"noohij"}],["path",{d:"M8 5h13",key:"1pao27"}],["path",{d:"M8 12h13",key:"1za7za"}],["path",{d:"M8 19h13",key:"m83p4d"}]],Eb=ke("list",kb);/** + * @license lucide-react v0.562.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Pb=[["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"}]],Tb=ke("lock",Pb);/** + * @license lucide-react v0.562.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Rb=[["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"}]],Ib=ke("log-out",Rb);/** + * @license lucide-react v0.562.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const _b=[["path",{d:"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"}]],Mb=ke("map-pin",_b);/** + * @license lucide-react v0.562.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Ab=[["path",{d:"M4 5h16",key:"1tepv9"}],["path",{d:"M4 12h16",key:"1lakjw"}],["path",{d:"M4 19h16",key:"1djgab"}]],Db=ke("menu",Ab);/** + * @license lucide-react v0.562.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Lb=[["path",{d:"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"}]],Ob=ke("message-circle",Lb);/** + * @license lucide-react v0.562.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Fb=[["path",{d:"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"}]],zb=ke("palette",Fb);/** + * @license lucide-react v0.562.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const $b=[["path",{d:"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"}]],yt=ke("pen-line",$b);/** + * @license lucide-react v0.562.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Bb=[["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"}]],Ub=ke("percent",Bb);/** + * @license lucide-react v0.562.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Vb=[["path",{d:"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"}]],Wb=ke("phone",Vb);/** + * @license lucide-react v0.562.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Hb=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],At=ke("plus",Hb);/** + * @license lucide-react v0.562.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Kb=[["rect",{width:"5",height:"5",x:"3",y:"3",rx:"1",key:"1tu5fj"}],["rect",{width:"5",height:"5",x:"16",y:"3",rx:"1",key:"1v8r4q"}],["rect",{width:"5",height:"5",x:"3",y:"16",rx:"1",key:"1x03jg"}],["path",{d:"M21 16h-3a2 2 0 0 0-2 2v3",key:"177gqh"}],["path",{d:"M21 21v.01",key:"ents32"}],["path",{d:"M12 7v3a2 2 0 0 1-2 2H7",key:"8crl2c"}],["path",{d:"M3 12h.01",key:"nlz23k"}],["path",{d:"M12 3h.01",key:"n36tog"}],["path",{d:"M12 16v.01",key:"133mhm"}],["path",{d:"M16 12h1",key:"1slzba"}],["path",{d:"M21 12v.01",key:"1lwtk9"}],["path",{d:"M12 21v-1",key:"1880an"}]],Dm=ke("qr-code",Kb);/** + * @license lucide-react v0.562.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Yb=[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]],$e=ke("refresh-cw",Yb);/** + * @license lucide-react v0.562.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Gb=[["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"}]],zt=ke("save",Gb);/** + * @license lucide-react v0.562.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Qb=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],yn=ke("search",Qb);/** + * @license lucide-react v0.562.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const qb=[["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"}]],dl=ke("settings",qb);/** + * @license lucide-react v0.562.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Xb=[["path",{d:"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"}]],jd=ke("settings-2",Xb);/** + * @license lucide-react v0.562.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Jb=[["path",{d:"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"}]],uu=ke("shield-check",Jb);/** + * @license lucide-react v0.562.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Zb=[["path",{d:"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"}]],Bd=ke("shopping-bag",Zb);/** + * @license lucide-react v0.562.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const eN=[["rect",{width:"14",height:"20",x:"5",y:"2",rx:"2",ry:"2",key:"1yt0o3"}],["path",{d:"M12 18h.01",key:"mhygvu"}]],Ud=ke("smartphone",eN);/** + * @license lucide-react v0.562.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const tN=[["path",{d:"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"}]],rN=ke("tag",tN);/** + * @license lucide-react v0.562.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const sN=[["path",{d:"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"}]],Gt=ke("trash-2",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 nN=[["path",{d:"M16 7h6v6",key:"box55l"}],["path",{d:"m22 7-8.5 8.5-5-5L2 17",key:"1t1m79"}]],ul=ke("trending-up",nN);/** + * @license lucide-react v0.562.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const aN=[["path",{d:"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"}]],Bx=ke("undo-2",aN);/** + * @license lucide-react v0.562.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const lN=[["path",{d:"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"}]],Zi=ke("upload",lN);/** + * @license lucide-react v0.562.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const iN=[["path",{d:"m16 11 2 2 4-4",key:"9rsbq5"}],["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}]],oN=ke("user-check",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 cN=[["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"}]],Vd=ke("user-plus",cN);/** + * @license lucide-react v0.562.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const dN=[["path",{d:"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"}]],ra=ke("user",dN);/** + * @license lucide-react v0.562.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const uN=[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["path",{d:"M16 3.128a4 4 0 0 1 0 7.744",key:"16gr8j"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}]],Qt=ke("users",uN);/** + * @license lucide-react v0.562.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const hN=[["path",{d:"M19 7V4a1 1 0 0 0-1-1H5a2 2 0 0 0 0 4h15a1 1 0 0 1 1 1v4h-3a2 2 0 0 0 0 4h3a1 1 0 0 0 1-1v-2a1 1 0 0 0-1-1",key:"18etb6"}],["path",{d:"M3 5v14a2 2 0 0 0 2 2h15a1 1 0 0 0 1-1v-4",key:"xoc0q4"}]],aa=ke("wallet",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 fN=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],Sr=ke("x",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 mN=[["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"}]],eo=ke("zap",mN),hu="admin_token";function fu(){try{return localStorage.getItem(hu)}catch{return null}}function xN(s){try{localStorage.setItem(hu,s)}catch{}}function pN(){try{localStorage.removeItem(hu)}catch{}}const gN="https://soulapi.quwanzhi.com",yN=()=>{const s="https://soulapi.quwanzhi.com";return s.length>0?s.replace(/\/$/,""):gN};function la(s){const a=yN(),l=s.startsWith("/")?s:`/${s}`;return a?`${a}${l}`:l}async function xo(s,a={}){const{data:l,...o}=a,c=la(s),d=new Headers(o.headers),h=fu();h&&d.set("Authorization",`Bearer ${h}`),l!=null&&!d.has("Content-Type")&&d.set("Content-Type","application/json");const m=l!=null?JSON.stringify(l):o.body,p=await fetch(c,{...o,headers:d,body:m,credentials:"include"}),g=(p.headers.get("Content-Type")||"").includes("application/json")?await p.json():p;if(!p.ok){const v=new Error((g==null?void 0:g.error)||`HTTP ${p.status}`);throw v.status=p.status,v.data=g,v}return g}function Fe(s,a){return xo(s,{...a,method:"GET"})}function Et(s,a,l){return xo(s,{...l,method:"POST",data:a})}function Nt(s,a,l){return xo(s,{...l,method:"PUT",data:a})}function vn(s,a){return xo(s,{...a,method:"DELETE"})}const vN=[{icon:wb,label:"数据概览",href:"/dashboard"},{icon:us,label:"内容管理",href:"/content"},{icon:Qt,label:"用户管理",href:"/users"}],Lm=[{icon:db,label:"找伙伴",href:"/find-partner"},{icon:mo,label:"VIP 角色",href:"/vip-roles"},{icon:zx,label:"导师管理",href:"/mentors"},{icon:aa,label:"推广中心",href:"/distribution"},{icon:zd,label:"推广设置",href:"/referral-settings"}];function jN(){const s=Zs(),a=da(),[l,o]=f.useState(!1),[c,d]=f.useState(!1),[h,m]=f.useState(!1);f.useEffect(()=>{o(!0)},[]),f.useEffect(()=>{Lm.some(g=>s.pathname===g.href)&&m(!0)},[s.pathname]),f.useEffect(()=>{if(!l)return;d(!1);let y=!1;return Fe("/api/admin").then(g=>{y||(g&&g.success!==!1?d(!0):a("/login",{replace:!0}))}).catch(()=>{y||a("/login",{replace:!0})}),()=>{y=!0}},[l,a]);const p=async()=>{pN();try{await Et("/api/admin/logout",{})}catch{}a("/login",{replace:!0})};return!l||!c?e.jsxs("div",{className:"flex min-h-screen bg-[#0a1628]",children:[e.jsx("div",{className:"w-64 bg-[#0f2137] border-r border-gray-700/50"}),e.jsx("div",{className:"flex-1 flex items-center justify-center",children:e.jsx("div",{className:"text-[#38bdac]",children:"加载中..."})})]}):e.jsxs("div",{className:"flex min-h-screen bg-[#0a1628]",children:[e.jsxs("div",{className:"w-64 bg-[#0f2137] flex flex-col border-r border-gray-700/50 shadow-xl",children:[e.jsxs("div",{className:"p-6 border-b border-gray-700/50",children:[e.jsx("h1",{className:"text-xl font-bold text-[#38bdac]",children:"管理后台"}),e.jsx("p",{className:"text-xs text-gray-400 mt-1",children:"Soul创业派对"})]}),e.jsxs("nav",{className:"flex-1 p-4 space-y-1 overflow-y-auto",children:[vN.map(y=>{const g=s.pathname===y.href;return e.jsxs(Hi,{to:y.href,className:`flex items-center gap-3 px-4 py-3 rounded-lg transition-colors ${g?"bg-[#38bdac]/20 text-[#38bdac] font-medium":"text-gray-400 hover:bg-gray-700/50 hover:text-white"}`,children:[e.jsx(y.icon,{className:"w-5 h-5 shrink-0"}),e.jsx("span",{className:"text-sm",children:y.label})]},y.href)}),e.jsx("button",{type:"button",onClick:()=>m(!h),className:"w-full flex items-center justify-between gap-3 px-4 py-3 text-gray-400 hover:bg-gray-700/50 hover:text-white rounded-lg transition-colors",children:e.jsxs("span",{className:"flex items-center gap-3",children:[h?e.jsx(Ax,{className:"w-5 h-5"}):e.jsx(ml,{className:"w-5 h-5"}),e.jsx("span",{className:"text-sm",children:"更多"})]})}),h&&e.jsx("div",{className:"space-y-1 pl-4",children:Lm.map(y=>{const g=s.pathname===y.href;return e.jsxs(Hi,{to:y.href,className:`flex items-center gap-3 px-4 py-2 rounded-lg transition-colors ${g?"bg-[#38bdac]/20 text-[#38bdac] font-medium":"text-gray-400 hover:bg-gray-700/50 hover:text-white"}`,children:[e.jsx(y.icon,{className:"w-5 h-5 shrink-0"}),e.jsx("span",{className:"text-sm",children:y.label})]},y.href)})}),e.jsx("div",{className:"pt-4 mt-4 border-t border-gray-700/50",children:e.jsxs(Hi,{to:"/settings",className:`flex items-center gap-3 px-4 py-3 rounded-lg transition-colors ${s.pathname==="/settings"?"bg-[#38bdac]/20 text-[#38bdac] font-medium":"text-gray-400 hover:bg-gray-700/50 hover:text-white"}`,children:[e.jsx(dl,{className:"w-5 h-5 shrink-0"}),e.jsx("span",{className:"text-sm",children:"系统设置"})]})})]}),e.jsx("div",{className:"p-4 border-t border-gray-700/50 space-y-1",children:e.jsxs("button",{type:"button",onClick:p,className:"w-full flex items-center gap-3 px-4 py-3 text-gray-400 hover:text-white rounded-lg hover:bg-gray-700/50 transition-colors",children:[e.jsx(Ib,{className:"w-5 h-5"}),e.jsx("span",{className:"text-sm",children:"退出登录"})]})})]}),e.jsx("div",{className:"flex-1 overflow-auto bg-[#0a1628] min-w-0",children:e.jsx("div",{className:"w-full min-w-[1024px] min-h-full",children:e.jsx(uj,{})})})]})}function Om(s,a){if(typeof s=="function")return s(a);s!=null&&(s.current=a)}function mu(...s){return a=>{let l=!1;const o=s.map(c=>{const d=Om(c,a);return!l&&typeof d=="function"&&(l=!0),d});if(l)return()=>{for(let c=0;c{let{children:d,...h}=o;Ux(d)&&typeof to=="function"&&(d=to(d._payload));const m=f.Children.toArray(d),p=m.find(CN);if(p){const y=p.props.children,g=m.map(v=>v===p?f.Children.count(y)>1?f.Children.only(null):f.isValidElement(y)?y.props.children:null:v);return e.jsx(a,{...h,ref:c,children:f.isValidElement(y)?f.cloneElement(y,void 0,g):null})}return e.jsx(a,{...h,ref:c,children:d})});return l.displayName=`${s}.Slot`,l}var Wx=Vx("Slot");function wN(s){const a=f.forwardRef((l,o)=>{let{children:c,...d}=l;if(Ux(c)&&typeof to=="function"&&(c=to(c._payload)),f.isValidElement(c)){const h=EN(c),m=kN(d,c.props);return c.type!==f.Fragment&&(m.ref=o?mu(o,h):h),f.cloneElement(c,m)}return f.Children.count(c)>1?f.Children.only(null):null});return a.displayName=`${s}.SlotClone`,a}var SN=Symbol("radix.slottable");function CN(s){return f.isValidElement(s)&&typeof s.type=="function"&&"__radixId"in s.type&&s.type.__radixId===SN}function kN(s,a){const l={...a};for(const o in a){const c=s[o],d=a[o];/^on[A-Z]/.test(o)?c&&d?l[o]=(...m)=>{const p=d(...m);return c(...m),p}:c&&(l[o]=c):o==="style"?l[o]={...c,...d}:o==="className"&&(l[o]=[c,d].filter(Boolean).join(" "))}return{...s,...l}}function EN(s){var o,c;let a=(o=Object.getOwnPropertyDescriptor(s.props,"ref"))==null?void 0:o.get,l=a&&"isReactWarning"in a&&a.isReactWarning;return l?s.ref:(a=(c=Object.getOwnPropertyDescriptor(s,"ref"))==null?void 0:c.get,l=a&&"isReactWarning"in a&&a.isReactWarning,l?s.props.ref:s.props.ref||s.ref)}function Hx(s){var a,l,o="";if(typeof s=="string"||typeof s=="number")o+=s;else if(typeof s=="object")if(Array.isArray(s)){var c=s.length;for(a=0;atypeof s=="boolean"?`${s}`:s===0?"0":s,zm=Kx,Yx=(s,a)=>l=>{var o;if((a==null?void 0:a.variants)==null)return zm(s,l==null?void 0:l.class,l==null?void 0:l.className);const{variants:c,defaultVariants:d}=a,h=Object.keys(c).map(y=>{const g=l==null?void 0:l[y],v=d==null?void 0:d[y];if(g===null)return null;const C=Fm(g)||Fm(v);return c[y][C]}),m=l&&Object.entries(l).reduce((y,g)=>{let[v,C]=g;return C===void 0||(y[v]=C),y},{}),p=a==null||(o=a.compoundVariants)===null||o===void 0?void 0:o.reduce((y,g)=>{let{class:v,className:C,...P}=g;return Object.entries(P).every(T=>{let[S,b]=T;return Array.isArray(b)?b.includes({...d,...m}[S]):{...d,...m}[S]===b})?[...y,v,C]:y},[]);return zm(s,h,p,l==null?void 0:l.class,l==null?void 0:l.className)},PN=(s,a)=>{const l=new Array(s.length+a.length);for(let o=0;o({classGroupId:s,validator:a}),Gx=(s=new Map,a=null,l)=>({nextPart:s,validators:a,classGroupId:l}),ro="-",$m=[],RN="arbitrary..",IN=s=>{const a=MN(s),{conflictingClassGroups:l,conflictingClassGroupModifiers:o}=s;return{getClassGroupId:h=>{if(h.startsWith("[")&&h.endsWith("]"))return _N(h);const m=h.split(ro),p=m[0]===""&&m.length>1?1:0;return Qx(m,p,a)},getConflictingClassGroupIds:(h,m)=>{if(m){const p=o[h],y=l[h];return p?y?PN(y,p):p:y||$m}return l[h]||$m}}},Qx=(s,a,l)=>{if(s.length-a===0)return l.classGroupId;const c=s[a],d=l.nextPart.get(c);if(d){const y=Qx(s,a+1,d);if(y)return y}const h=l.validators;if(h===null)return;const m=a===0?s.join(ro):s.slice(a).join(ro),p=h.length;for(let y=0;ys.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const a=s.slice(1,-1),l=a.indexOf(":"),o=a.slice(0,l);return o?RN+o:void 0})(),MN=s=>{const{theme:a,classGroups:l}=s;return AN(l,a)},AN=(s,a)=>{const l=Gx();for(const o in s){const c=s[o];xu(c,l,o,a)}return l},xu=(s,a,l,o)=>{const c=s.length;for(let d=0;d{if(typeof s=="string"){LN(s,a,l);return}if(typeof s=="function"){ON(s,a,l,o);return}FN(s,a,l,o)},LN=(s,a,l)=>{const o=s===""?a:qx(a,s);o.classGroupId=l},ON=(s,a,l,o)=>{if(zN(s)){xu(s(o),a,l,o);return}a.validators===null&&(a.validators=[]),a.validators.push(TN(l,s))},FN=(s,a,l,o)=>{const c=Object.entries(s),d=c.length;for(let h=0;h{let l=s;const o=a.split(ro),c=o.length;for(let d=0;d"isThemeGetter"in s&&s.isThemeGetter===!0,$N=s=>{if(s<1)return{get:()=>{},set:()=>{}};let a=0,l=Object.create(null),o=Object.create(null);const c=(d,h)=>{l[d]=h,a++,a>s&&(a=0,o=l,l=Object.create(null))};return{get(d){let h=l[d];if(h!==void 0)return h;if((h=o[d])!==void 0)return c(d,h),h},set(d,h){d in l?l[d]=h:c(d,h)}}},Wd="!",Bm=":",BN=[],Um=(s,a,l,o,c)=>({modifiers:s,hasImportantModifier:a,baseClassName:l,maybePostfixModifierPosition:o,isExternal:c}),UN=s=>{const{prefix:a,experimentalParseClassName:l}=s;let o=c=>{const d=[];let h=0,m=0,p=0,y;const g=c.length;for(let S=0;Sp?y-p:void 0;return Um(d,P,C,T)};if(a){const c=a+Bm,d=o;o=h=>h.startsWith(c)?d(h.slice(c.length)):Um(BN,!1,h,void 0,!0)}if(l){const c=o;o=d=>l({className:d,parseClassName:c})}return o},VN=s=>{const a=new Map;return s.orderSensitiveModifiers.forEach((l,o)=>{a.set(l,1e6+o)}),l=>{const o=[];let c=[];for(let d=0;d0&&(c.sort(),o.push(...c),c=[]),o.push(h)):c.push(h)}return c.length>0&&(c.sort(),o.push(...c)),o}},WN=s=>({cache:$N(s.cacheSize),parseClassName:UN(s),sortModifiers:VN(s),...IN(s)}),HN=/\s+/,KN=(s,a)=>{const{parseClassName:l,getClassGroupId:o,getConflictingClassGroupIds:c,sortModifiers:d}=a,h=[],m=s.trim().split(HN);let p="";for(let y=m.length-1;y>=0;y-=1){const g=m[y],{isExternal:v,modifiers:C,hasImportantModifier:P,baseClassName:T,maybePostfixModifierPosition:S}=l(g);if(v){p=g+(p.length>0?" "+p:p);continue}let b=!!S,N=o(b?T.substring(0,S):T);if(!N){if(!b){p=g+(p.length>0?" "+p:p);continue}if(N=o(T),!N){p=g+(p.length>0?" "+p:p);continue}b=!1}const E=C.length===0?"":C.length===1?C[0]:d(C).join(":"),j=P?E+Wd:E,R=j+N;if(h.indexOf(R)>-1)continue;h.push(R);const B=c(N,b);for(let U=0;U0?" "+p:p)}return p},YN=(...s)=>{let a=0,l,o,c="";for(;a{if(typeof s=="string")return s;let a,l="";for(let o=0;o{let l,o,c,d;const h=p=>{const y=a.reduce((g,v)=>v(g),s());return l=WN(y),o=l.cache.get,c=l.cache.set,d=m,m(p)},m=p=>{const y=o(p);if(y)return y;const g=KN(p,l);return c(p,g),g};return d=h,(...p)=>d(YN(...p))},QN=[],Mt=s=>{const a=l=>l[s]||QN;return a.isThemeGetter=!0,a},Jx=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,Zx=/^\((?:(\w[\w-]*):)?(.+)\)$/i,qN=/^\d+\/\d+$/,XN=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,JN=/\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$/,ZN=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,ew=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,tw=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,qn=s=>qN.test(s),He=s=>!!s&&!Number.isNaN(Number(s)),Bs=s=>!!s&&Number.isInteger(Number(s)),bd=s=>s.endsWith("%")&&He(s.slice(0,-1)),os=s=>XN.test(s),rw=()=>!0,sw=s=>JN.test(s)&&!ZN.test(s),ep=()=>!1,nw=s=>ew.test(s),aw=s=>tw.test(s),lw=s=>!Re(s)&&!Ie(s),iw=s=>ua(s,sp,ep),Re=s=>Jx.test(s),gn=s=>ua(s,np,sw),Nd=s=>ua(s,hw,He),Vm=s=>ua(s,tp,ep),ow=s=>ua(s,rp,aw),Oi=s=>ua(s,ap,nw),Ie=s=>Zx.test(s),ll=s=>ha(s,np),cw=s=>ha(s,fw),Wm=s=>ha(s,tp),dw=s=>ha(s,sp),uw=s=>ha(s,rp),Fi=s=>ha(s,ap,!0),ua=(s,a,l)=>{const o=Jx.exec(s);return o?o[1]?a(o[1]):l(o[2]):!1},ha=(s,a,l=!1)=>{const o=Zx.exec(s);return o?o[1]?a(o[1]):l:!1},tp=s=>s==="position"||s==="percentage",rp=s=>s==="image"||s==="url",sp=s=>s==="length"||s==="size"||s==="bg-size",np=s=>s==="length",hw=s=>s==="number",fw=s=>s==="family-name",ap=s=>s==="shadow",mw=()=>{const s=Mt("color"),a=Mt("font"),l=Mt("text"),o=Mt("font-weight"),c=Mt("tracking"),d=Mt("leading"),h=Mt("breakpoint"),m=Mt("container"),p=Mt("spacing"),y=Mt("radius"),g=Mt("shadow"),v=Mt("inset-shadow"),C=Mt("text-shadow"),P=Mt("drop-shadow"),T=Mt("blur"),S=Mt("perspective"),b=Mt("aspect"),N=Mt("ease"),E=Mt("animate"),j=()=>["auto","avoid","all","avoid-page","page","left","right","column"],R=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],B=()=>[...R(),Ie,Re],U=()=>["auto","hidden","clip","visible","scroll"],k=()=>["auto","contain","none"],L=()=>[Ie,Re,p],_=()=>[qn,"full","auto",...L()],se=()=>[Bs,"none","subgrid",Ie,Re],le=()=>["auto",{span:["full",Bs,Ie,Re]},Bs,Ie,Re],ie=()=>[Bs,"auto",Ie,Re],ee=()=>["auto","min","max","fr",Ie,Re],G=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],Q=()=>["start","end","center","stretch","center-safe","end-safe"],ce=()=>["auto",...L()],re=()=>[qn,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...L()],A=()=>[s,Ie,Re],ne=()=>[...R(),Wm,Vm,{position:[Ie,Re]}],W=()=>["no-repeat",{repeat:["","x","y","space","round"]}],M=()=>["auto","cover","contain",dw,iw,{size:[Ie,Re]}],O=()=>[bd,ll,gn],F=()=>["","none","full",y,Ie,Re],X=()=>["",He,ll,gn],H=()=>["solid","dashed","dotted","double"],ue=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],K=()=>[He,bd,Wm,Vm],ye=()=>["","none",T,Ie,Re],ge=()=>["none",He,Ie,Re],D=()=>["none",He,Ie,Re],fe=()=>[He,Ie,Re],Se=()=>[qn,"full",...L()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[os],breakpoint:[os],color:[rw],container:[os],"drop-shadow":[os],ease:["in","out","in-out"],font:[lw],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[os],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[os],shadow:[os],spacing:["px",He],text:[os],"text-shadow":[os],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",qn,Re,Ie,b]}],container:["container"],columns:[{columns:[He,Re,Ie,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:B()}],overflow:[{overflow:U()}],"overflow-x":[{"overflow-x":U()}],"overflow-y":[{"overflow-y":U()}],overscroll:[{overscroll:k()}],"overscroll-x":[{"overscroll-x":k()}],"overscroll-y":[{"overscroll-y":k()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:_()}],"inset-x":[{"inset-x":_()}],"inset-y":[{"inset-y":_()}],start:[{start:_()}],end:[{end:_()}],top:[{top:_()}],right:[{right:_()}],bottom:[{bottom:_()}],left:[{left:_()}],visibility:["visible","invisible","collapse"],z:[{z:[Bs,"auto",Ie,Re]}],basis:[{basis:[qn,"full","auto",m,...L()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[He,qn,"auto","initial","none",Re]}],grow:[{grow:["",He,Ie,Re]}],shrink:[{shrink:["",He,Ie,Re]}],order:[{order:[Bs,"first","last","none",Ie,Re]}],"grid-cols":[{"grid-cols":se()}],"col-start-end":[{col:le()}],"col-start":[{"col-start":ie()}],"col-end":[{"col-end":ie()}],"grid-rows":[{"grid-rows":se()}],"row-start-end":[{row:le()}],"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":ee()}],"auto-rows":[{"auto-rows":ee()}],gap:[{gap:L()}],"gap-x":[{"gap-x":L()}],"gap-y":[{"gap-y":L()}],"justify-content":[{justify:[...G(),"normal"]}],"justify-items":[{"justify-items":[...Q(),"normal"]}],"justify-self":[{"justify-self":["auto",...Q()]}],"align-content":[{content:["normal",...G()]}],"align-items":[{items:[...Q(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...Q(),{baseline:["","last"]}]}],"place-content":[{"place-content":G()}],"place-items":[{"place-items":[...Q(),"baseline"]}],"place-self":[{"place-self":["auto",...Q()]}],p:[{p:L()}],px:[{px:L()}],py:[{py:L()}],ps:[{ps:L()}],pe:[{pe:L()}],pt:[{pt:L()}],pr:[{pr:L()}],pb:[{pb:L()}],pl:[{pl:L()}],m:[{m:ce()}],mx:[{mx:ce()}],my:[{my:ce()}],ms:[{ms:ce()}],me:[{me:ce()}],mt:[{mt:ce()}],mr:[{mr:ce()}],mb:[{mb:ce()}],ml:[{ml:ce()}],"space-x":[{"space-x":L()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":L()}],"space-y-reverse":["space-y-reverse"],size:[{size:re()}],w:[{w:[m,"screen",...re()]}],"min-w":[{"min-w":[m,"screen","none",...re()]}],"max-w":[{"max-w":[m,"screen","none","prose",{screen:[h]},...re()]}],h:[{h:["screen","lh",...re()]}],"min-h":[{"min-h":["screen","lh","none",...re()]}],"max-h":[{"max-h":["screen","lh",...re()]}],"font-size":[{text:["base",l,ll,gn]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[o,Ie,Nd]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",bd,Re]}],"font-family":[{font:[cw,Re,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,Ie,Re]}],"line-clamp":[{"line-clamp":[He,"none",Ie,Nd]}],leading:[{leading:[d,...L()]}],"list-image":[{"list-image":["none",Ie,Re]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",Ie,Re]}],"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:[...H(),"wavy"]}],"text-decoration-thickness":[{decoration:[He,"from-font","auto",Ie,gn]}],"text-decoration-color":[{decoration:A()}],"underline-offset":[{"underline-offset":[He,"auto",Ie,Re]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:L()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Ie,Re]}],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",Ie,Re]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:ne()}],"bg-repeat":[{bg:W()}],"bg-size":[{bg:M()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},Bs,Ie,Re],radial:["",Ie,Re],conic:[Bs,Ie,Re]},uw,ow]}],"bg-color":[{bg:A()}],"gradient-from-pos":[{from:O()}],"gradient-via-pos":[{via:O()}],"gradient-to-pos":[{to:O()}],"gradient-from":[{from:A()}],"gradient-via":[{via:A()}],"gradient-to":[{to:A()}],rounded:[{rounded:F()}],"rounded-s":[{"rounded-s":F()}],"rounded-e":[{"rounded-e":F()}],"rounded-t":[{"rounded-t":F()}],"rounded-r":[{"rounded-r":F()}],"rounded-b":[{"rounded-b":F()}],"rounded-l":[{"rounded-l":F()}],"rounded-ss":[{"rounded-ss":F()}],"rounded-se":[{"rounded-se":F()}],"rounded-ee":[{"rounded-ee":F()}],"rounded-es":[{"rounded-es":F()}],"rounded-tl":[{"rounded-tl":F()}],"rounded-tr":[{"rounded-tr":F()}],"rounded-br":[{"rounded-br":F()}],"rounded-bl":[{"rounded-bl":F()}],"border-w":[{border:X()}],"border-w-x":[{"border-x":X()}],"border-w-y":[{"border-y":X()}],"border-w-s":[{"border-s":X()}],"border-w-e":[{"border-e":X()}],"border-w-t":[{"border-t":X()}],"border-w-r":[{"border-r":X()}],"border-w-b":[{"border-b":X()}],"border-w-l":[{"border-l":X()}],"divide-x":[{"divide-x":X()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":X()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...H(),"hidden","none"]}],"divide-style":[{divide:[...H(),"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:[...H(),"none","hidden"]}],"outline-offset":[{"outline-offset":[He,Ie,Re]}],"outline-w":[{outline:["",He,ll,gn]}],"outline-color":[{outline:A()}],shadow:[{shadow:["","none",g,Fi,Oi]}],"shadow-color":[{shadow:A()}],"inset-shadow":[{"inset-shadow":["none",v,Fi,Oi]}],"inset-shadow-color":[{"inset-shadow":A()}],"ring-w":[{ring:X()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:A()}],"ring-offset-w":[{"ring-offset":[He,gn]}],"ring-offset-color":[{"ring-offset":A()}],"inset-ring-w":[{"inset-ring":X()}],"inset-ring-color":[{"inset-ring":A()}],"text-shadow":[{"text-shadow":["none",C,Fi,Oi]}],"text-shadow-color":[{"text-shadow":A()}],opacity:[{opacity:[He,Ie,Re]}],"mix-blend":[{"mix-blend":[...ue(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":ue()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[He]}],"mask-image-linear-from-pos":[{"mask-linear-from":K()}],"mask-image-linear-to-pos":[{"mask-linear-to":K()}],"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":K()}],"mask-image-t-to-pos":[{"mask-t-to":K()}],"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":K()}],"mask-image-r-to-pos":[{"mask-r-to":K()}],"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":K()}],"mask-image-b-to-pos":[{"mask-b-to":K()}],"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":K()}],"mask-image-l-to-pos":[{"mask-l-to":K()}],"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":K()}],"mask-image-x-to-pos":[{"mask-x-to":K()}],"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":K()}],"mask-image-y-to-pos":[{"mask-y-to":K()}],"mask-image-y-from-color":[{"mask-y-from":A()}],"mask-image-y-to-color":[{"mask-y-to":A()}],"mask-image-radial":[{"mask-radial":[Ie,Re]}],"mask-image-radial-from-pos":[{"mask-radial-from":K()}],"mask-image-radial-to-pos":[{"mask-radial-to":K()}],"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":R()}],"mask-image-conic-pos":[{"mask-conic":[He]}],"mask-image-conic-from-pos":[{"mask-conic-from":K()}],"mask-image-conic-to-pos":[{"mask-conic-to":K()}],"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:ne()}],"mask-repeat":[{mask:W()}],"mask-size":[{mask:M()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",Ie,Re]}],filter:[{filter:["","none",Ie,Re]}],blur:[{blur:ye()}],brightness:[{brightness:[He,Ie,Re]}],contrast:[{contrast:[He,Ie,Re]}],"drop-shadow":[{"drop-shadow":["","none",P,Fi,Oi]}],"drop-shadow-color":[{"drop-shadow":A()}],grayscale:[{grayscale:["",He,Ie,Re]}],"hue-rotate":[{"hue-rotate":[He,Ie,Re]}],invert:[{invert:["",He,Ie,Re]}],saturate:[{saturate:[He,Ie,Re]}],sepia:[{sepia:["",He,Ie,Re]}],"backdrop-filter":[{"backdrop-filter":["","none",Ie,Re]}],"backdrop-blur":[{"backdrop-blur":ye()}],"backdrop-brightness":[{"backdrop-brightness":[He,Ie,Re]}],"backdrop-contrast":[{"backdrop-contrast":[He,Ie,Re]}],"backdrop-grayscale":[{"backdrop-grayscale":["",He,Ie,Re]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[He,Ie,Re]}],"backdrop-invert":[{"backdrop-invert":["",He,Ie,Re]}],"backdrop-opacity":[{"backdrop-opacity":[He,Ie,Re]}],"backdrop-saturate":[{"backdrop-saturate":[He,Ie,Re]}],"backdrop-sepia":[{"backdrop-sepia":["",He,Ie,Re]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":L()}],"border-spacing-x":[{"border-spacing-x":L()}],"border-spacing-y":[{"border-spacing-y":L()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",Ie,Re]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[He,"initial",Ie,Re]}],ease:[{ease:["linear","initial",N,Ie,Re]}],delay:[{delay:[He,Ie,Re]}],animate:[{animate:["none",E,Ie,Re]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[S,Ie,Re]}],"perspective-origin":[{"perspective-origin":B()}],rotate:[{rotate:ge()}],"rotate-x":[{"rotate-x":ge()}],"rotate-y":[{"rotate-y":ge()}],"rotate-z":[{"rotate-z":ge()}],scale:[{scale:D()}],"scale-x":[{"scale-x":D()}],"scale-y":[{"scale-y":D()}],"scale-z":[{"scale-z":D()}],"scale-3d":["scale-3d"],skew:[{skew:fe()}],"skew-x":[{"skew-x":fe()}],"skew-y":[{"skew-y":fe()}],transform:[{transform:[Ie,Re,"","none","gpu","cpu"]}],"transform-origin":[{origin:B()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:Se()}],"translate-x":[{"translate-x":Se()}],"translate-y":[{"translate-y":Se()}],"translate-z":[{"translate-z":Se()}],"translate-none":["translate-none"],accent:[{accent: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",Ie,Re]}],"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":L()}],"scroll-mx":[{"scroll-mx":L()}],"scroll-my":[{"scroll-my":L()}],"scroll-ms":[{"scroll-ms":L()}],"scroll-me":[{"scroll-me":L()}],"scroll-mt":[{"scroll-mt":L()}],"scroll-mr":[{"scroll-mr":L()}],"scroll-mb":[{"scroll-mb":L()}],"scroll-ml":[{"scroll-ml":L()}],"scroll-p":[{"scroll-p":L()}],"scroll-px":[{"scroll-px":L()}],"scroll-py":[{"scroll-py":L()}],"scroll-ps":[{"scroll-ps":L()}],"scroll-pe":[{"scroll-pe":L()}],"scroll-pt":[{"scroll-pt":L()}],"scroll-pr":[{"scroll-pr":L()}],"scroll-pb":[{"scroll-pb":L()}],"scroll-pl":[{"scroll-pl":L()}],"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",Ie,Re]}],fill:[{fill:["none",...A()]}],"stroke-w":[{stroke:[He,ll,gn,Nd]}],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"]}},xw=GN(mw);function tt(...s){return xw(Kx(s))}const pw=Yx("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 Z({className:s,variant:a,size:l,asChild:o=!1,...c}){const d=o?Wx:"button";return e.jsx(d,{"data-slot":"button",className:tt(pw({variant:a,size:l,className:s})),...c})}function de({className:s,type:a,...l}){return e.jsx("input",{type:a,"data-slot":"input",className:tt("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",s),...l})}function gw(){const s=da(),[a,l]=f.useState(""),[o,c]=f.useState(""),[d,h]=f.useState(""),[m,p]=f.useState(!1),y=async()=>{h(""),p(!0);try{const g=await Et("/api/admin",{username:a.trim(),password:o});if((g==null?void 0:g.success)!==!1&&(g!=null&&g.token)){xN(g.token),s("/dashboard",{replace:!0});return}h(g.error||"用户名或密码错误")}catch(g){const v=g;h(v.status===401?"用户名或密码错误":(v==null?void 0:v.message)||"网络错误,请重试")}finally{p(!1)}};return e.jsxs("div",{className:"min-h-screen bg-[#0a1628] flex items-center justify-center p-4",children:[e.jsxs("div",{className:"absolute inset-0 overflow-hidden",children:[e.jsx("div",{className:"absolute top-1/4 left-1/4 w-96 h-96 bg-[#38bdac]/5 rounded-full blur-3xl"}),e.jsx("div",{className:"absolute bottom-1/4 right-1/4 w-96 h-96 bg-blue-500/5 rounded-full blur-3xl"})]}),e.jsxs("div",{className:"w-full max-w-md relative z-10",children:[e.jsxs("div",{className:"text-center mb-8",children:[e.jsx("div",{className:"w-16 h-16 bg-[#38bdac]/20 rounded-2xl flex items-center justify-center mx-auto mb-4 border border-[#38bdac]/30",children:e.jsx(uu,{className:"w-8 h-8 text-[#38bdac]"})}),e.jsx("h1",{className:"text-2xl font-bold text-white mb-2",children:"管理后台"}),e.jsx("p",{className:"text-gray-400",children:"一场SOUL的创业实验场"})]}),e.jsxs("div",{className:"bg-[#0f2137] rounded-2xl p-8 shadow-xl border border-gray-700/50 backdrop-blur-xl",children:[e.jsx("h2",{className:"text-xl font-semibold text-white mb-6 text-center",children:"管理员登录"}),e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{children:[e.jsx("label",{className:"block text-gray-400 text-sm mb-2",children:"用户名"}),e.jsxs("div",{className:"relative",children:[e.jsx(ra,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-5 h-5 text-gray-500"}),e.jsx(de,{type:"text",value:a,onChange:g=>l(g.target.value),placeholder:"请输入用户名",className:"pl-10 bg-[#0a1628] border-gray-700 text-white placeholder:text-gray-500 focus:border-[#38bdac]"})]})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-gray-400 text-sm mb-2",children:"密码"}),e.jsxs("div",{className:"relative",children:[e.jsx(Tb,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-5 h-5 text-gray-500"}),e.jsx(de,{type:"password",value:o,onChange:g=>c(g.target.value),placeholder:"请输入密码",className:"pl-10 bg-[#0a1628] border-gray-700 text-white placeholder:text-gray-500 focus:border-[#38bdac]",onKeyDown:g=>g.key==="Enter"&&y()})]})]}),d&&e.jsx("div",{className:"bg-red-500/10 text-red-400 text-sm p-3 rounded-lg border border-red-500/20",children:d}),e.jsx(Z,{onClick:y,disabled:m,className:"w-full bg-[#38bdac] hover:bg-[#2da396] text-white py-5 disabled:opacity-50",children:m?"登录中...":"登录"})]})]}),e.jsx("p",{className:"text-center text-gray-500 text-xs mt-6",children:"Soul创业实验场 · 后台管理系统"})]})]})}const Ne=f.forwardRef(({className:s,...a},l)=>e.jsx("div",{ref:l,className:tt("rounded-xl border bg-card text-card-foreground shadow",s),...a}));Ne.displayName="Card";const Ue=f.forwardRef(({className:s,...a},l)=>e.jsx("div",{ref:l,className:tt("flex flex-col space-y-1.5 p-6",s),...a}));Ue.displayName="CardHeader";const Ve=f.forwardRef(({className:s,...a},l)=>e.jsx("h3",{ref:l,className:tt("font-semibold leading-none tracking-tight",s),...a}));Ve.displayName="CardTitle";const ht=f.forwardRef(({className:s,...a},l)=>e.jsx("p",{ref:l,className:tt("text-sm text-muted-foreground",s),...a}));ht.displayName="CardDescription";const we=f.forwardRef(({className:s,...a},l)=>e.jsx("div",{ref:l,className:tt("p-6 pt-0",s),...a}));we.displayName="CardContent";const yw=f.forwardRef(({className:s,...a},l)=>e.jsx("div",{ref:l,className:tt("flex items-center p-6 pt-0",s),...a}));yw.displayName="CardFooter";function vw(){const s=da(),[a,l]=f.useState(!0),[o,c]=f.useState([]),[d,h]=f.useState([]),[m,p]=f.useState(0),[y,g]=f.useState(0),[v,C]=f.useState(0),[P,T]=f.useState(0),[S,b]=f.useState(null);async function N(){var B;l(!0),b(null);try{const U=await Fe("/api/admin/dashboard/overview");if(U!=null&&U.success){p(U.totalUsers??0),g(U.paidOrderCount??0),C(U.totalRevenue??0),T(U.conversionRate??0),h(U.recentOrders??[]),c(U.newUsers??[]);return}}catch(U){console.error("数据概览接口失败,尝试降级拉取",U)}try{const[U,k]=await Promise.all([Fe("/api/db/users?page=1&pageSize=10"),Fe("/api/orders?page=1&pageSize=20&status=paid")]),L=typeof(U==null?void 0:U.total)=="number"?U.total:((B=U==null?void 0:U.users)==null?void 0:B.length)??0,_=(k==null?void 0:k.orders)??[],se=typeof(k==null?void 0:k.total)=="number"?k.total:_.length,le=_.filter(Q=>Q.status==="paid"||Q.status==="completed"||Q.status==="success"),ie=le.reduce((Q,ce)=>Q+Number(ce.amount||0),0),ee=new Set(le.map(Q=>Q.userId).filter(Boolean)),G=L>0&&ee.size>0?ee.size/L*100:0;p(L),g(se),C(ie),T(G),h(_.slice(0,5)),c((U==null?void 0:U.users)??[])}catch(U){console.error("降级拉取失败",U);const k=U;(k==null?void 0:k.status)===401?b("登录已过期,请重新登录"):b("加载失败,请检查网络或联系管理员")}finally{l(!1)}}if(f.useEffect(()=>{N();const B=setInterval(N,3e4);return()=>clearInterval(B)},[]),a)return e.jsxs("div",{className:"p-8 w-full",children:[e.jsx("h1",{className:"text-2xl font-bold mb-8 text-white",children:"数据概览"}),e.jsxs("div",{className:"flex flex-col items-center justify-center py-24",children:[e.jsx($e,{className:"w-12 h-12 text-[#38bdac] animate-spin mb-4"}),e.jsx("span",{className:"text-gray-400",children:"加载中..."})]})]});const E=m,j=B=>{const U=B.productType||"",k=B.description||"";if(k){if(U==="section"&&k.includes("章节")){if(k.includes("-")){const L=k.split("-");if(L.length>=3)return{title:`第${L[1]}章 第${L[2]}节`,subtitle:"《一场Soul的创业实验》"}}return{title:k,subtitle:"章节购买"}}return U==="fullbook"||k.includes("全书")?{title:"《一场Soul的创业实验》",subtitle:"全书购买"}:U==="match"||k.includes("伙伴")?{title:"找伙伴匹配",subtitle:"功能服务"}:{title:k,subtitle:U==="section"?"单章":U==="fullbook"?"全书":"其他"}}return U==="section"?{title:`章节 ${B.productId||""}`,subtitle:"单章购买"}:U==="fullbook"?{title:"《一场Soul的创业实验》",subtitle:"全书购买"}:U==="match"?{title:"找伙伴匹配",subtitle:"功能服务"}:{title:"未知商品",subtitle:U||"其他"}},R=[{title:"总用户数",value:E,icon:Qt,color:"text-blue-400",bg:"bg-blue-500/20",link:"/users"},{title:"总收入",value:`¥${(v??0).toFixed(2)}`,icon:ul,color:"text-[#38bdac]",bg:"bg-[#38bdac]/20",link:"/orders"},{title:"订单数",value:y,icon:Bd,color:"text-purple-400",bg:"bg-purple-500/20",link:"/orders"},{title:"转化率",value:`${typeof P=="number"?P.toFixed(1):0}%`,icon:us,color:"text-orange-400",bg:"bg-orange-500/20",link:"/distribution"}];return e.jsxs("div",{className:"p-8 w-full",children:[e.jsx("h1",{className:"text-2xl font-bold mb-8 text-white",children:"数据概览"}),S&&e.jsxs("div",{className:"mb-6 px-4 py-3 rounded-lg bg-amber-500/20 border border-amber-500/50 text-amber-200 text-sm flex items-center justify-between",children:[e.jsx("span",{children:S}),e.jsx("button",{type:"button",onClick:()=>N(),className:"text-amber-400 hover:text-amber-300 underline",children:"重试"})]}),e.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-6 mb-8",children:R.map((B,U)=>e.jsxs(Ne,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl cursor-pointer hover:border-[#38bdac]/50 transition-colors group",onClick:()=>B.link&&s(B.link),children:[e.jsxs(Ue,{className:"flex flex-row items-center justify-between pb-2",children:[e.jsx(Ve,{className:"text-sm font-medium text-gray-400",children:B.title}),e.jsx("div",{className:`p-2 rounded-lg ${B.bg}`,children:e.jsx(B.icon,{className:`w-4 h-4 ${B.color}`})})]}),e.jsx(we,{children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("div",{className:"text-2xl font-bold text-white",children:B.value}),e.jsx(Vs,{className:"w-5 h-5 text-gray-600 group-hover:text-[#38bdac] transition-colors"})]})})]},U))}),e.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-8",children:[e.jsxs(Ne,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:[e.jsxs(Ue,{className:"flex flex-row items-center justify-between",children:[e.jsx(Ve,{className:"text-white",children:"最近订单"}),e.jsxs("button",{type:"button",onClick:()=>N(),className:"text-xs text-gray-400 hover:text-[#38bdac] flex items-center gap-1",title:"刷新",children:[e.jsx($e,{className:"w-3.5 h-3.5"}),"刷新(每 30 秒自动更新)"]})]}),e.jsx(we,{children:e.jsxs("div",{className:"space-y-3",children:[d.slice(0,5).map(B=>{var se;const U=B.referrerId?o.find(le=>le.id===B.referrerId):void 0,k=B.referralCode||(U==null?void 0:U.referralCode)||(U==null?void 0:U.nickname)||(B.referrerId?String(B.referrerId).slice(0,8):""),L=j(B),_=B.userNickname||((se=o.find(le=>le.id===B.userId))==null?void 0:se.nickname)||"匿名用户";return e.jsxs("div",{className:"flex items-start justify-between p-4 bg-[#0a1628] rounded-lg border border-gray-700/30 hover:border-[#38bdac]/30 transition-colors",children:[e.jsxs("div",{className:"flex items-start gap-3 flex-1",children:[B.userAvatar?e.jsx("img",{src:B.userAvatar,alt:_,className:"w-9 h-9 rounded-full object-cover flex-shrink-0 mt-0.5",onError:le=>{le.currentTarget.style.display="none";const ie=le.currentTarget.nextElementSibling;ie&&ie.classList.remove("hidden")}}):null,e.jsx("div",{className:`w-9 h-9 rounded-full bg-[#38bdac]/20 flex items-center justify-center text-sm font-medium text-[#38bdac] flex-shrink-0 mt-0.5 ${B.userAvatar?"hidden":""}`,children:_.charAt(0)}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[e.jsx("span",{className:"text-sm text-gray-300",children:_}),e.jsx("span",{className:"text-gray-600",children:"·"}),e.jsx("span",{className:"text-sm font-medium text-white truncate",children:L.title})]}),e.jsxs("div",{className:"flex items-center gap-2 text-xs text-gray-500",children:[e.jsx("span",{className:"px-1.5 py-0.5 bg-gray-700/50 rounded",children:L.subtitle}),e.jsx("span",{children:new Date(B.createdAt||0).toLocaleString("zh-CN",{month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"})})]}),k&&e.jsxs("p",{className:"text-xs text-gray-600 mt-1",children:["推荐: ",k]})]})]}),e.jsxs("div",{className:"text-right ml-4 flex-shrink-0",children:[e.jsxs("p",{className:"text-sm font-bold text-[#38bdac]",children:["+¥",Number(B.amount).toFixed(2)]}),e.jsx("p",{className:"text-xs text-gray-500 mt-0.5",children:B.paymentMethod||"微信"})]})]},B.id)}),d.length===0&&e.jsxs("div",{className:"text-center py-12",children:[e.jsx(Bd,{className:"w-12 h-12 text-gray-600 mx-auto mb-3"}),e.jsx("p",{className:"text-gray-500",children:"暂无订单数据"})]})]})})]}),e.jsxs(Ne,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:[e.jsx(Ue,{children:e.jsx(Ve,{className:"text-white",children:"新注册用户"})}),e.jsx(we,{children:e.jsxs("div",{className:"space-y-3",children:[o.slice(0,5).map(B=>{var U;return e.jsxs("div",{className:"flex items-center justify-between p-4 bg-[#0a1628] rounded-lg border border-gray-700/30",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"w-10 h-10 rounded-full bg-[#38bdac]/20 flex items-center justify-center text-sm font-medium text-[#38bdac]",children:((U=B.nickname)==null?void 0:U.charAt(0))||"?"}),e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-medium text-white",children:B.nickname||"匿名用户"}),e.jsx("p",{className:"text-xs text-gray-500",children:B.phone||"-"})]})]}),e.jsx("p",{className:"text-xs text-gray-400",children:B.createdAt?new Date(B.createdAt).toLocaleDateString():"-"})]},B.id)}),o.length===0&&e.jsx("p",{className:"text-gray-500 text-center py-8",children:"暂无用户数据"})]})})]})]})]})}const ir=f.forwardRef(({className:s,...a},l)=>e.jsx("div",{className:"relative w-full overflow-auto",children:e.jsx("table",{ref:l,className:tt("w-full caption-bottom text-sm",s),...a})}));ir.displayName="Table";const or=f.forwardRef(({className:s,...a},l)=>e.jsx("thead",{ref:l,className:tt("[&_tr]:border-b",s),...a}));or.displayName="TableHeader";const cr=f.forwardRef(({className:s,...a},l)=>e.jsx("tbody",{ref:l,className:tt("[&_tr:last-child]:border-0",s),...a}));cr.displayName="TableBody";const Ge=f.forwardRef(({className:s,...a},l)=>e.jsx("tr",{ref:l,className:tt("border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted",s),...a}));Ge.displayName="TableRow";const je=f.forwardRef(({className:s,...a},l)=>e.jsx("th",{ref:l,className:tt("h-12 px-4 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0",s),...a}));je.displayName="TableHead";const pe=f.forwardRef(({className:s,...a},l)=>e.jsx("td",{ref:l,className:tt("p-4 align-middle [&:has([role=checkbox])]:pr-0",s),...a}));pe.displayName="TableCell";const jw=Yx("inline-flex items-center justify-center rounded-md border px-2 py-0.5 text-xs font-medium w-fit whitespace-nowrap shrink-0 transition-colors",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground",secondary:"border-transparent bg-secondary text-secondary-foreground",destructive:"border-transparent bg-destructive text-white",outline:"text-foreground"}},defaultVariants:{variant:"default"}});function Oe({className:s,variant:a,asChild:l=!1,...o}){const c=l?Wx:"span";return e.jsx(c,{className:tt(jw({variant:a}),s),...o})}function Be(s,a,{checkForDefaultPrevented:l=!0}={}){return function(c){if(s==null||s(c),l===!1||!c.defaultPrevented)return a==null?void 0:a(c)}}function bw(s,a){const l=f.createContext(a),o=d=>{const{children:h,...m}=d,p=f.useMemo(()=>m,Object.values(m));return e.jsx(l.Provider,{value:p,children:h})};o.displayName=s+"Provider";function c(d){const h=f.useContext(l);if(h)return h;if(a!==void 0)return a;throw new Error(`\`${d}\` must be used within \`${s}\``)}return[o,c]}function en(s,a=[]){let l=[];function o(d,h){const m=f.createContext(h),p=l.length;l=[...l,h];const y=v=>{var N;const{scope:C,children:P,...T}=v,S=((N=C==null?void 0:C[s])==null?void 0:N[p])||m,b=f.useMemo(()=>T,Object.values(T));return e.jsx(S.Provider,{value:b,children:P})};y.displayName=d+"Provider";function g(v,C){var S;const P=((S=C==null?void 0:C[s])==null?void 0:S[p])||m,T=f.useContext(P);if(T)return T;if(h!==void 0)return h;throw new Error(`\`${v}\` must be used within \`${d}\``)}return[y,g]}const c=()=>{const d=l.map(h=>f.createContext(h));return function(m){const p=(m==null?void 0:m[s])||d;return f.useMemo(()=>({[`__scope${s}`]:{...m,[s]:p}}),[m,p])}};return c.scopeName=s,[o,Nw(c,...a)]}function Nw(...s){const a=s[0];if(s.length===1)return a;const l=()=>{const o=s.map(c=>({useScope:c(),scopeName:c.scopeName}));return function(d){const h=o.reduce((m,{useScope:p,scopeName:y})=>{const v=p(d)[`__scope${y}`];return{...m,...v}},{});return f.useMemo(()=>({[`__scope${a.scopeName}`]:h}),[h])}};return l.scopeName=a.scopeName,l}var qt=globalThis!=null&&globalThis.document?f.useLayoutEffect:()=>{},ww=uo[" useId ".trim().toString()]||(()=>{}),Sw=0;function Gs(s){const[a,l]=f.useState(ww());return qt(()=>{l(o=>o??String(Sw++))},[s]),a?`radix-${a}`:""}var Cw=uo[" useInsertionEffect ".trim().toString()]||qt;function bn({prop:s,defaultProp:a,onChange:l=()=>{},caller:o}){const[c,d,h]=kw({defaultProp:a,onChange:l}),m=s!==void 0,p=m?s:c;{const g=f.useRef(s!==void 0);f.useEffect(()=>{const v=g.current;v!==m&&console.warn(`${o} is changing from ${v?"controlled":"uncontrolled"} to ${m?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),g.current=m},[m,o])}const y=f.useCallback(g=>{var v;if(m){const C=Ew(g)?g(s):g;C!==s&&((v=h.current)==null||v.call(h,C))}else d(g)},[m,s,d,h]);return[p,y]}function kw({defaultProp:s,onChange:a}){const[l,o]=f.useState(s),c=f.useRef(l),d=f.useRef(a);return Cw(()=>{d.current=a},[a]),f.useEffect(()=>{var h;c.current!==l&&((h=d.current)==null||h.call(d,l),c.current=l)},[l,c]),[l,o,d]}function Ew(s){return typeof s=="function"}function xl(s){const a=Pw(s),l=f.forwardRef((o,c)=>{const{children:d,...h}=o,m=f.Children.toArray(d),p=m.find(Rw);if(p){const y=p.props.children,g=m.map(v=>v===p?f.Children.count(y)>1?f.Children.only(null):f.isValidElement(y)?y.props.children:null:v);return e.jsx(a,{...h,ref:c,children:f.isValidElement(y)?f.cloneElement(y,void 0,g):null})}return e.jsx(a,{...h,ref:c,children:d})});return l.displayName=`${s}.Slot`,l}function Pw(s){const a=f.forwardRef((l,o)=>{const{children:c,...d}=l;if(f.isValidElement(c)){const h=_w(c),m=Iw(d,c.props);return c.type!==f.Fragment&&(m.ref=o?mu(o,h):h),f.cloneElement(c,m)}return f.Children.count(c)>1?f.Children.only(null):null});return a.displayName=`${s}.SlotClone`,a}var Tw=Symbol("radix.slottable");function Rw(s){return f.isValidElement(s)&&typeof s.type=="function"&&"__radixId"in s.type&&s.type.__radixId===Tw}function Iw(s,a){const l={...a};for(const o in a){const c=s[o],d=a[o];/^on[A-Z]/.test(o)?c&&d?l[o]=(...m)=>{const p=d(...m);return c(...m),p}:c&&(l[o]=c):o==="style"?l[o]={...c,...d}:o==="className"&&(l[o]=[c,d].filter(Boolean).join(" "))}return{...s,...l}}function _w(s){var o,c;let a=(o=Object.getOwnPropertyDescriptor(s.props,"ref"))==null?void 0:o.get,l=a&&"isReactWarning"in a&&a.isReactWarning;return l?s.ref:(a=(c=Object.getOwnPropertyDescriptor(s,"ref"))==null?void 0:c.get,l=a&&"isReactWarning"in a&&a.isReactWarning,l?s.props.ref:s.props.ref||s.ref)}var Mw=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Ke=Mw.reduce((s,a)=>{const l=xl(`Primitive.${a}`),o=f.forwardRef((c,d)=>{const{asChild:h,...m}=c,p=h?l:a;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),e.jsx(p,{...m,ref:d})});return o.displayName=`Primitive.${a}`,{...s,[a]:o}},{});function Aw(s,a){s&&gl.flushSync(()=>s.dispatchEvent(a))}function Qs(s){const a=f.useRef(s);return f.useEffect(()=>{a.current=s}),f.useMemo(()=>(...l)=>{var o;return(o=a.current)==null?void 0:o.call(a,...l)},[])}function Dw(s,a=globalThis==null?void 0:globalThis.document){const l=Qs(s);f.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 Lw="DismissableLayer",Hd="dismissableLayer.update",Ow="dismissableLayer.pointerDownOutside",Fw="dismissableLayer.focusOutside",Hm,lp=f.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),pu=f.forwardRef((s,a)=>{const{disableOutsidePointerEvents:l=!1,onEscapeKeyDown:o,onPointerDownOutside:c,onFocusOutside:d,onInteractOutside:h,onDismiss:m,...p}=s,y=f.useContext(lp),[g,v]=f.useState(null),C=(g==null?void 0:g.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,P]=f.useState({}),T=et(a,k=>v(k)),S=Array.from(y.layers),[b]=[...y.layersWithOutsidePointerEventsDisabled].slice(-1),N=S.indexOf(b),E=g?S.indexOf(g):-1,j=y.layersWithOutsidePointerEventsDisabled.size>0,R=E>=N,B=Bw(k=>{const L=k.target,_=[...y.branches].some(se=>se.contains(L));!R||_||(c==null||c(k),h==null||h(k),k.defaultPrevented||m==null||m())},C),U=Uw(k=>{const L=k.target;[...y.branches].some(se=>se.contains(L))||(d==null||d(k),h==null||h(k),k.defaultPrevented||m==null||m())},C);return Dw(k=>{E===y.layers.size-1&&(o==null||o(k),!k.defaultPrevented&&m&&(k.preventDefault(),m()))},C),f.useEffect(()=>{if(g)return l&&(y.layersWithOutsidePointerEventsDisabled.size===0&&(Hm=C.body.style.pointerEvents,C.body.style.pointerEvents="none"),y.layersWithOutsidePointerEventsDisabled.add(g)),y.layers.add(g),Km(),()=>{l&&y.layersWithOutsidePointerEventsDisabled.size===1&&(C.body.style.pointerEvents=Hm)}},[g,C,l,y]),f.useEffect(()=>()=>{g&&(y.layers.delete(g),y.layersWithOutsidePointerEventsDisabled.delete(g),Km())},[g,y]),f.useEffect(()=>{const k=()=>P({});return document.addEventListener(Hd,k),()=>document.removeEventListener(Hd,k)},[]),e.jsx(Ke.div,{...p,ref:T,style:{pointerEvents:j?R?"auto":"none":void 0,...s.style},onFocusCapture:Be(s.onFocusCapture,U.onFocusCapture),onBlurCapture:Be(s.onBlurCapture,U.onBlurCapture),onPointerDownCapture:Be(s.onPointerDownCapture,B.onPointerDownCapture)})});pu.displayName=Lw;var zw="DismissableLayerBranch",$w=f.forwardRef((s,a)=>{const l=f.useContext(lp),o=f.useRef(null),c=et(a,o);return f.useEffect(()=>{const d=o.current;if(d)return l.branches.add(d),()=>{l.branches.delete(d)}},[l.branches]),e.jsx(Ke.div,{...s,ref:c})});$w.displayName=zw;function Bw(s,a=globalThis==null?void 0:globalThis.document){const l=Qs(s),o=f.useRef(!1),c=f.useRef(()=>{});return f.useEffect(()=>{const d=m=>{if(m.target&&!o.current){let p=function(){ip(Ow,l,y,{discrete:!0})};const y={originalEvent:m};m.pointerType==="touch"?(a.removeEventListener("click",c.current),c.current=p,a.addEventListener("click",c.current,{once:!0})):p()}else a.removeEventListener("click",c.current);o.current=!1},h=window.setTimeout(()=>{a.addEventListener("pointerdown",d)},0);return()=>{window.clearTimeout(h),a.removeEventListener("pointerdown",d),a.removeEventListener("click",c.current)}},[a,l]),{onPointerDownCapture:()=>o.current=!0}}function Uw(s,a=globalThis==null?void 0:globalThis.document){const l=Qs(s),o=f.useRef(!1);return f.useEffect(()=>{const c=d=>{d.target&&!o.current&&ip(Fw,l,{originalEvent:d},{discrete:!1})};return a.addEventListener("focusin",c),()=>a.removeEventListener("focusin",c)},[a,l]),{onFocusCapture:()=>o.current=!0,onBlurCapture:()=>o.current=!1}}function Km(){const s=new CustomEvent(Hd);document.dispatchEvent(s)}function ip(s,a,l,{discrete:o}){const c=l.originalEvent.target,d=new CustomEvent(s,{bubbles:!1,cancelable:!0,detail:l});a&&c.addEventListener(s,a,{once:!0}),o?Aw(c,d):c.dispatchEvent(d)}var wd="focusScope.autoFocusOnMount",Sd="focusScope.autoFocusOnUnmount",Ym={bubbles:!1,cancelable:!0},Vw="FocusScope",gu=f.forwardRef((s,a)=>{const{loop:l=!1,trapped:o=!1,onMountAutoFocus:c,onUnmountAutoFocus:d,...h}=s,[m,p]=f.useState(null),y=Qs(c),g=Qs(d),v=f.useRef(null),C=et(a,S=>p(S)),P=f.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;f.useEffect(()=>{if(o){let S=function(j){if(P.paused||!m)return;const R=j.target;m.contains(R)?v.current=R:Ws(v.current,{select:!0})},b=function(j){if(P.paused||!m)return;const R=j.relatedTarget;R!==null&&(m.contains(R)||Ws(v.current,{select:!0}))},N=function(j){if(document.activeElement===document.body)for(const B of j)B.removedNodes.length>0&&Ws(m)};document.addEventListener("focusin",S),document.addEventListener("focusout",b);const E=new MutationObserver(N);return m&&E.observe(m,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",S),document.removeEventListener("focusout",b),E.disconnect()}}},[o,m,P.paused]),f.useEffect(()=>{if(m){Qm.add(P);const S=document.activeElement;if(!m.contains(S)){const N=new CustomEvent(wd,Ym);m.addEventListener(wd,y),m.dispatchEvent(N),N.defaultPrevented||(Ww(Qw(op(m)),{select:!0}),document.activeElement===S&&Ws(m))}return()=>{m.removeEventListener(wd,y),setTimeout(()=>{const N=new CustomEvent(Sd,Ym);m.addEventListener(Sd,g),m.dispatchEvent(N),N.defaultPrevented||Ws(S??document.body,{select:!0}),m.removeEventListener(Sd,g),Qm.remove(P)},0)}}},[m,y,g,P]);const T=f.useCallback(S=>{if(!l&&!o||P.paused)return;const b=S.key==="Tab"&&!S.altKey&&!S.ctrlKey&&!S.metaKey,N=document.activeElement;if(b&&N){const E=S.currentTarget,[j,R]=Hw(E);j&&R?!S.shiftKey&&N===R?(S.preventDefault(),l&&Ws(j,{select:!0})):S.shiftKey&&N===j&&(S.preventDefault(),l&&Ws(R,{select:!0})):N===E&&S.preventDefault()}},[l,o,P.paused]);return e.jsx(Ke.div,{tabIndex:-1,...h,ref:C,onKeyDown:T})});gu.displayName=Vw;function Ww(s,{select:a=!1}={}){const l=document.activeElement;for(const o of s)if(Ws(o,{select:a}),document.activeElement!==l)return}function Hw(s){const a=op(s),l=Gm(a,s),o=Gm(a.reverse(),s);return[l,o]}function op(s){const a=[],l=document.createTreeWalker(s,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 Gm(s,a){for(const l of s)if(!Kw(l,{upTo:a}))return l}function Kw(s,{upTo:a}){if(getComputedStyle(s).visibility==="hidden")return!0;for(;s;){if(a!==void 0&&s===a)return!1;if(getComputedStyle(s).display==="none")return!0;s=s.parentElement}return!1}function Yw(s){return s instanceof HTMLInputElement&&"select"in s}function Ws(s,{select:a=!1}={}){if(s&&s.focus){const l=document.activeElement;s.focus({preventScroll:!0}),s!==l&&Yw(s)&&a&&s.select()}}var Qm=Gw();function Gw(){let s=[];return{add(a){const l=s[0];a!==l&&(l==null||l.pause()),s=qm(s,a),s.unshift(a)},remove(a){var l;s=qm(s,a),(l=s[0])==null||l.resume()}}}function qm(s,a){const l=[...s],o=l.indexOf(a);return o!==-1&&l.splice(o,1),l}function Qw(s){return s.filter(a=>a.tagName!=="A")}var qw="Portal",yu=f.forwardRef((s,a)=>{var m;const{container:l,...o}=s,[c,d]=f.useState(!1);qt(()=>d(!0),[]);const h=l||c&&((m=globalThis==null?void 0:globalThis.document)==null?void 0:m.body);return h?yv.createPortal(e.jsx(Ke.div,{...o,ref:a}),h):null});yu.displayName=qw;function Xw(s,a){return f.useReducer((l,o)=>a[l][o]??l,s)}var yl=s=>{const{present:a,children:l}=s,o=Jw(a),c=typeof l=="function"?l({present:o.isPresent}):f.Children.only(l),d=et(o.ref,Zw(c));return typeof l=="function"||o.isPresent?f.cloneElement(c,{ref:d}):null};yl.displayName="Presence";function Jw(s){const[a,l]=f.useState(),o=f.useRef(null),c=f.useRef(s),d=f.useRef("none"),h=s?"mounted":"unmounted",[m,p]=Xw(h,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return f.useEffect(()=>{const y=zi(o.current);d.current=m==="mounted"?y:"none"},[m]),qt(()=>{const y=o.current,g=c.current;if(g!==s){const C=d.current,P=zi(y);s?p("MOUNT"):P==="none"||(y==null?void 0:y.display)==="none"?p("UNMOUNT"):p(g&&C!==P?"ANIMATION_OUT":"UNMOUNT"),c.current=s}},[s,p]),qt(()=>{if(a){let y;const g=a.ownerDocument.defaultView??window,v=P=>{const S=zi(o.current).includes(CSS.escape(P.animationName));if(P.target===a&&S&&(p("ANIMATION_END"),!c.current)){const b=a.style.animationFillMode;a.style.animationFillMode="forwards",y=g.setTimeout(()=>{a.style.animationFillMode==="forwards"&&(a.style.animationFillMode=b)})}},C=P=>{P.target===a&&(d.current=zi(o.current))};return a.addEventListener("animationstart",C),a.addEventListener("animationcancel",v),a.addEventListener("animationend",v),()=>{g.clearTimeout(y),a.removeEventListener("animationstart",C),a.removeEventListener("animationcancel",v),a.removeEventListener("animationend",v)}}else p("ANIMATION_END")},[a,p]),{isPresent:["mounted","unmountSuspended"].includes(m),ref:f.useCallback(y=>{o.current=y?getComputedStyle(y):null,l(y)},[])}}function zi(s){return(s==null?void 0:s.animationName)||"none"}function Zw(s){var o,c;let a=(o=Object.getOwnPropertyDescriptor(s.props,"ref"))==null?void 0:o.get,l=a&&"isReactWarning"in a&&a.isReactWarning;return l?s.ref:(a=(c=Object.getOwnPropertyDescriptor(s,"ref"))==null?void 0:c.get,l=a&&"isReactWarning"in a&&a.isReactWarning,l?s.props.ref:s.props.ref||s.ref)}var Cd=0;function cp(){f.useEffect(()=>{const s=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",s[0]??Xm()),document.body.insertAdjacentElement("beforeend",s[1]??Xm()),Cd++,()=>{Cd===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(a=>a.remove()),Cd--}},[])}function Xm(){const s=document.createElement("span");return s.setAttribute("data-radix-focus-guard",""),s.tabIndex=0,s.style.outline="none",s.style.opacity="0",s.style.position="fixed",s.style.pointerEvents="none",s}var Kr=function(){return Kr=Object.assign||function(a){for(var l,o=1,c=arguments.length;o"u")return p1;var a=g1(s),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])}},v1=fp(),sa="data-scroll-locked",j1=function(s,a,l,o){var c=s.left,d=s.top,h=s.right,m=s.gap;return l===void 0&&(l="margin"),` + .`.concat(t1,` { + overflow: hidden `).concat(o,`; + padding-right: `).concat(m,"px ").concat(o,`; + } + body[`).concat(sa,`] { + overflow: hidden `).concat(o,`; + overscroll-behavior: contain; + `).concat([a&&"position: relative ".concat(o,";"),l==="margin"&&` + padding-left: `.concat(c,`px; + padding-top: `).concat(d,`px; + padding-right: `).concat(h,`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(Ki,` { + right: `).concat(m,"px ").concat(o,`; + } + + .`).concat(Yi,` { + margin-right: `).concat(m,"px ").concat(o,`; + } + + .`).concat(Ki," .").concat(Ki,` { + right: 0 `).concat(o,`; + } + + .`).concat(Yi," .").concat(Yi,` { + margin-right: 0 `).concat(o,`; + } + + body[`).concat(sa,`] { + `).concat(r1,": ").concat(m,`px; + } +`)},Zm=function(){var s=parseInt(document.body.getAttribute(sa)||"0",10);return isFinite(s)?s:0},b1=function(){f.useEffect(function(){return document.body.setAttribute(sa,(Zm()+1).toString()),function(){var s=Zm()-1;s<=0?document.body.removeAttribute(sa):document.body.setAttribute(sa,s.toString())}},[])},N1=function(s){var a=s.noRelative,l=s.noImportant,o=s.gapMode,c=o===void 0?"margin":o;b1();var d=f.useMemo(function(){return y1(c)},[c]);return f.createElement(v1,{styles:j1(d,!a,c,l?"":"!important")})},Kd=!1;if(typeof window<"u")try{var $i=Object.defineProperty({},"passive",{get:function(){return Kd=!0,!0}});window.addEventListener("test",$i,$i),window.removeEventListener("test",$i,$i)}catch{Kd=!1}var Xn=Kd?{passive:!1}:!1,w1=function(s){return s.tagName==="TEXTAREA"},mp=function(s,a){if(!(s instanceof Element))return!1;var l=window.getComputedStyle(s);return l[a]!=="hidden"&&!(l.overflowY===l.overflowX&&!w1(s)&&l[a]==="visible")},S1=function(s){return mp(s,"overflowY")},C1=function(s){return mp(s,"overflowX")},ex=function(s,a){var l=a.ownerDocument,o=a;do{typeof ShadowRoot<"u"&&o instanceof ShadowRoot&&(o=o.host);var c=xp(s,o);if(c){var d=pp(s,o),h=d[1],m=d[2];if(h>m)return!0}o=o.parentNode}while(o&&o!==l.body);return!1},k1=function(s){var a=s.scrollTop,l=s.scrollHeight,o=s.clientHeight;return[a,l,o]},E1=function(s){var a=s.scrollLeft,l=s.scrollWidth,o=s.clientWidth;return[a,l,o]},xp=function(s,a){return s==="v"?S1(a):C1(a)},pp=function(s,a){return s==="v"?k1(a):E1(a)},P1=function(s,a){return s==="h"&&a==="rtl"?-1:1},T1=function(s,a,l,o,c){var d=P1(s,window.getComputedStyle(a).direction),h=d*o,m=l.target,p=a.contains(m),y=!1,g=h>0,v=0,C=0;do{if(!m)break;var P=pp(s,m),T=P[0],S=P[1],b=P[2],N=S-b-d*T;(T||N)&&xp(s,m)&&(v+=N,C+=T);var E=m.parentNode;m=E&&E.nodeType===Node.DOCUMENT_FRAGMENT_NODE?E.host:E}while(!p&&m!==document.body||p&&(a.contains(m)||a===m));return(g&&Math.abs(v)<1||!g&&Math.abs(C)<1)&&(y=!0),y},Bi=function(s){return"changedTouches"in s?[s.changedTouches[0].clientX,s.changedTouches[0].clientY]:[0,0]},tx=function(s){return[s.deltaX,s.deltaY]},rx=function(s){return s&&"current"in s?s.current:s},R1=function(s,a){return s[0]===a[0]&&s[1]===a[1]},I1=function(s){return` + .block-interactivity-`.concat(s,` {pointer-events: none;} + .allow-interactivity-`).concat(s,` {pointer-events: all;} +`)},_1=0,Jn=[];function M1(s){var a=f.useRef([]),l=f.useRef([0,0]),o=f.useRef(),c=f.useState(_1++)[0],d=f.useState(fp)[0],h=f.useRef(s);f.useEffect(function(){h.current=s},[s]),f.useEffect(function(){if(s.inert){document.body.classList.add("block-interactivity-".concat(c));var S=e1([s.lockRef.current],(s.shards||[]).map(rx),!0).filter(Boolean);return S.forEach(function(b){return b.classList.add("allow-interactivity-".concat(c))}),function(){document.body.classList.remove("block-interactivity-".concat(c)),S.forEach(function(b){return b.classList.remove("allow-interactivity-".concat(c))})}}},[s.inert,s.lockRef.current,s.shards]);var m=f.useCallback(function(S,b){if("touches"in S&&S.touches.length===2||S.type==="wheel"&&S.ctrlKey)return!h.current.allowPinchZoom;var N=Bi(S),E=l.current,j="deltaX"in S?S.deltaX:E[0]-N[0],R="deltaY"in S?S.deltaY:E[1]-N[1],B,U=S.target,k=Math.abs(j)>Math.abs(R)?"h":"v";if("touches"in S&&k==="h"&&U.type==="range")return!1;var L=window.getSelection(),_=L&&L.anchorNode,se=_?_===U||_.contains(U):!1;if(se)return!1;var le=ex(k,U);if(!le)return!0;if(le?B=k:(B=k==="v"?"h":"v",le=ex(k,U)),!le)return!1;if(!o.current&&"changedTouches"in S&&(j||R)&&(o.current=B),!B)return!0;var ie=o.current||B;return T1(ie,b,S,ie==="h"?j:R)},[]),p=f.useCallback(function(S){var b=S;if(!(!Jn.length||Jn[Jn.length-1]!==d)){var N="deltaY"in b?tx(b):Bi(b),E=a.current.filter(function(B){return B.name===b.type&&(B.target===b.target||b.target===B.shadowParent)&&R1(B.delta,N)})[0];if(E&&E.should){b.cancelable&&b.preventDefault();return}if(!E){var j=(h.current.shards||[]).map(rx).filter(Boolean).filter(function(B){return B.contains(b.target)}),R=j.length>0?m(b,j[0]):!h.current.noIsolation;R&&b.cancelable&&b.preventDefault()}}},[]),y=f.useCallback(function(S,b,N,E){var j={name:S,delta:b,target:N,should:E,shadowParent:A1(N)};a.current.push(j),setTimeout(function(){a.current=a.current.filter(function(R){return R!==j})},1)},[]),g=f.useCallback(function(S){l.current=Bi(S),o.current=void 0},[]),v=f.useCallback(function(S){y(S.type,tx(S),S.target,m(S,s.lockRef.current))},[]),C=f.useCallback(function(S){y(S.type,Bi(S),S.target,m(S,s.lockRef.current))},[]);f.useEffect(function(){return Jn.push(d),s.setCallbacks({onScrollCapture:v,onWheelCapture:v,onTouchMoveCapture:C}),document.addEventListener("wheel",p,Xn),document.addEventListener("touchmove",p,Xn),document.addEventListener("touchstart",g,Xn),function(){Jn=Jn.filter(function(S){return S!==d}),document.removeEventListener("wheel",p,Xn),document.removeEventListener("touchmove",p,Xn),document.removeEventListener("touchstart",g,Xn)}},[]);var P=s.removeScrollBar,T=s.inert;return f.createElement(f.Fragment,null,T?f.createElement(d,{styles:I1(c)}):null,P?f.createElement(N1,{noRelative:s.noRelative,gapMode:s.gapMode}):null)}function A1(s){for(var a=null;s!==null;)s instanceof ShadowRoot&&(a=s.host,s=s.host),s=s.parentNode;return a}const D1=c1(hp,M1);var vu=f.forwardRef(function(s,a){return f.createElement(po,Kr({},s,{ref:a,sideCar:D1}))});vu.classNames=po.classNames;var L1=function(s){if(typeof document>"u")return null;var a=Array.isArray(s)?s[0]:s;return a.ownerDocument.body},Zn=new WeakMap,Ui=new WeakMap,Vi={},Td=0,gp=function(s){return s&&(s.host||gp(s.parentNode))},O1=function(s,a){return a.map(function(l){if(s.contains(l))return l;var o=gp(l);return o&&s.contains(o)?o:(console.error("aria-hidden",l,"in not contained inside",s,". Doing nothing"),null)}).filter(function(l){return!!l})},F1=function(s,a,l,o){var c=O1(a,Array.isArray(s)?s:[s]);Vi[l]||(Vi[l]=new WeakMap);var d=Vi[l],h=[],m=new Set,p=new Set(c),y=function(v){!v||m.has(v)||(m.add(v),y(v.parentNode))};c.forEach(y);var g=function(v){!v||p.has(v)||Array.prototype.forEach.call(v.children,function(C){if(m.has(C))g(C);else try{var P=C.getAttribute(o),T=P!==null&&P!=="false",S=(Zn.get(C)||0)+1,b=(d.get(C)||0)+1;Zn.set(C,S),d.set(C,b),h.push(C),S===1&&T&&Ui.set(C,!0),b===1&&C.setAttribute(l,"true"),T||C.setAttribute(o,"true")}catch(N){console.error("aria-hidden: cannot operate on ",C,N)}})};return g(a),m.clear(),Td++,function(){h.forEach(function(v){var C=Zn.get(v)-1,P=d.get(v)-1;Zn.set(v,C),d.set(v,P),C||(Ui.has(v)||v.removeAttribute(o),Ui.delete(v)),P||v.removeAttribute(l)}),Td--,Td||(Zn=new WeakMap,Zn=new WeakMap,Ui=new WeakMap,Vi={})}},yp=function(s,a,l){l===void 0&&(l="data-aria-hidden");var o=Array.from(Array.isArray(s)?s:[s]),c=L1(s);return c?(o.push.apply(o,Array.from(c.querySelectorAll("[aria-live], script"))),F1(o,c,l,"aria-hidden")):function(){return null}},go="Dialog",[vp]=en(go),[z1,Or]=vp(go),jp=s=>{const{__scopeDialog:a,children:l,open:o,defaultOpen:c,onOpenChange:d,modal:h=!0}=s,m=f.useRef(null),p=f.useRef(null),[y,g]=bn({prop:o,defaultProp:c??!1,onChange:d,caller:go});return e.jsx(z1,{scope:a,triggerRef:m,contentRef:p,contentId:Gs(),titleId:Gs(),descriptionId:Gs(),open:y,onOpenChange:g,onOpenToggle:f.useCallback(()=>g(v=>!v),[g]),modal:h,children:l})};jp.displayName=go;var bp="DialogTrigger",$1=f.forwardRef((s,a)=>{const{__scopeDialog:l,...o}=s,c=Or(bp,l),d=et(a,c.triggerRef);return e.jsx(Ke.button,{type:"button","aria-haspopup":"dialog","aria-expanded":c.open,"aria-controls":c.contentId,"data-state":Nu(c.open),...o,ref:d,onClick:Be(s.onClick,c.onOpenToggle)})});$1.displayName=bp;var ju="DialogPortal",[B1,Np]=vp(ju,{forceMount:void 0}),wp=s=>{const{__scopeDialog:a,forceMount:l,children:o,container:c}=s,d=Or(ju,a);return e.jsx(B1,{scope:a,forceMount:l,children:f.Children.map(o,h=>e.jsx(yl,{present:l||d.open,children:e.jsx(yu,{asChild:!0,container:c,children:h})}))})};wp.displayName=ju;var so="DialogOverlay",Sp=f.forwardRef((s,a)=>{const l=Np(so,s.__scopeDialog),{forceMount:o=l.forceMount,...c}=s,d=Or(so,s.__scopeDialog);return d.modal?e.jsx(yl,{present:o||d.open,children:e.jsx(V1,{...c,ref:a})}):null});Sp.displayName=so;var U1=xl("DialogOverlay.RemoveScroll"),V1=f.forwardRef((s,a)=>{const{__scopeDialog:l,...o}=s,c=Or(so,l);return e.jsx(vu,{as:U1,allowPinchZoom:!0,shards:[c.contentRef],children:e.jsx(Ke.div,{"data-state":Nu(c.open),...o,ref:a,style:{pointerEvents:"auto",...o.style}})})}),Nn="DialogContent",Cp=f.forwardRef((s,a)=>{const l=Np(Nn,s.__scopeDialog),{forceMount:o=l.forceMount,...c}=s,d=Or(Nn,s.__scopeDialog);return e.jsx(yl,{present:o||d.open,children:d.modal?e.jsx(W1,{...c,ref:a}):e.jsx(H1,{...c,ref:a})})});Cp.displayName=Nn;var W1=f.forwardRef((s,a)=>{const l=Or(Nn,s.__scopeDialog),o=f.useRef(null),c=et(a,l.contentRef,o);return f.useEffect(()=>{const d=o.current;if(d)return yp(d)},[]),e.jsx(kp,{...s,ref:c,trapFocus:l.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Be(s.onCloseAutoFocus,d=>{var h;d.preventDefault(),(h=l.triggerRef.current)==null||h.focus()}),onPointerDownOutside:Be(s.onPointerDownOutside,d=>{const h=d.detail.originalEvent,m=h.button===0&&h.ctrlKey===!0;(h.button===2||m)&&d.preventDefault()}),onFocusOutside:Be(s.onFocusOutside,d=>d.preventDefault())})}),H1=f.forwardRef((s,a)=>{const l=Or(Nn,s.__scopeDialog),o=f.useRef(!1),c=f.useRef(!1);return e.jsx(kp,{...s,ref:a,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:d=>{var h,m;(h=s.onCloseAutoFocus)==null||h.call(s,d),d.defaultPrevented||(o.current||(m=l.triggerRef.current)==null||m.focus(),d.preventDefault()),o.current=!1,c.current=!1},onInteractOutside:d=>{var p,y;(p=s.onInteractOutside)==null||p.call(s,d),d.defaultPrevented||(o.current=!0,d.detail.originalEvent.type==="pointerdown"&&(c.current=!0));const h=d.target;((y=l.triggerRef.current)==null?void 0:y.contains(h))&&d.preventDefault(),d.detail.originalEvent.type==="focusin"&&c.current&&d.preventDefault()}})}),kp=f.forwardRef((s,a)=>{const{__scopeDialog:l,trapFocus:o,onOpenAutoFocus:c,onCloseAutoFocus:d,...h}=s,m=Or(Nn,l),p=f.useRef(null),y=et(a,p);return cp(),e.jsxs(e.Fragment,{children:[e.jsx(gu,{asChild:!0,loop:!0,trapped:o,onMountAutoFocus:c,onUnmountAutoFocus:d,children:e.jsx(pu,{role:"dialog",id:m.contentId,"aria-describedby":m.descriptionId,"aria-labelledby":m.titleId,"data-state":Nu(m.open),...h,ref:y,onDismiss:()=>m.onOpenChange(!1)})}),e.jsxs(e.Fragment,{children:[e.jsx(K1,{titleId:m.titleId}),e.jsx(G1,{contentRef:p,descriptionId:m.descriptionId})]})]})}),bu="DialogTitle",Ep=f.forwardRef((s,a)=>{const{__scopeDialog:l,...o}=s,c=Or(bu,l);return e.jsx(Ke.h2,{id:c.titleId,...o,ref:a})});Ep.displayName=bu;var Pp="DialogDescription",Tp=f.forwardRef((s,a)=>{const{__scopeDialog:l,...o}=s,c=Or(Pp,l);return e.jsx(Ke.p,{id:c.descriptionId,...o,ref:a})});Tp.displayName=Pp;var Rp="DialogClose",Ip=f.forwardRef((s,a)=>{const{__scopeDialog:l,...o}=s,c=Or(Rp,l);return e.jsx(Ke.button,{type:"button",...o,ref:a,onClick:Be(s.onClick,()=>c.onOpenChange(!1))})});Ip.displayName=Rp;function Nu(s){return s?"open":"closed"}var _p="DialogTitleWarning",[U4,Mp]=bw(_p,{contentName:Nn,titleName:bu,docsSlug:"dialog"}),K1=({titleId:s})=>{const a=Mp(_p),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 f.useEffect(()=>{s&&(document.getElementById(s)||console.error(l))},[l,s]),null},Y1="DialogDescriptionWarning",G1=({contentRef:s,descriptionId:a})=>{const o=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${Mp(Y1).contentName}}.`;return f.useEffect(()=>{var d;const c=(d=s.current)==null?void 0:d.getAttribute("aria-describedby");a&&c&&(document.getElementById(a)||console.warn(o))},[o,s,a]),null},Q1=jp,q1=wp,X1=Sp,J1=Cp,Z1=Ep,e2=Tp,t2=Ip;function wt(s){return e.jsx(Q1,{"data-slot":"dialog",...s})}function r2(s){return e.jsx(q1,{...s})}const Ap=f.forwardRef(({className:s,...a},l)=>e.jsx(X1,{ref:l,className:tt("fixed inset-0 z-50 bg-black/50",s),...a}));Ap.displayName="DialogOverlay";const vt=f.forwardRef(({className:s,children:a,showCloseButton:l=!0,...o},c)=>e.jsxs(r2,{children:[e.jsx(Ap,{}),e.jsxs(J1,{ref:c,"aria-describedby":void 0,className:tt("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",s),...o,children:[a,l&&e.jsxs(t2,{className:"absolute right-4 top-4 rounded-sm opacity-70 hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none",children:[e.jsx(Sr,{className:"h-4 w-4"}),e.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));vt.displayName="DialogContent";function St({className:s,...a}){return e.jsx("div",{className:tt("flex flex-col gap-2 text-center sm:text-left",s),...a})}function Ft({className:s,...a}){return e.jsx("div",{className:tt("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",s),...a})}function Ct(s){return e.jsx(Z1,{className:"text-lg font-semibold leading-none",...s})}function s2(s){return e.jsx(e2,{className:"text-sm text-muted-foreground",...s})}function wu(s,a){const[l,o]=f.useState(s);return f.useEffect(()=>{const c=setTimeout(()=>o(s),a);return()=>clearTimeout(c)},[s,a]),l}function Ar({page:s,totalPages:a,total:l,pageSize:o,onPageChange:c,onPageSizeChange:d,pageSizeOptions:h=[10,20,50,100]}){return a<=1&&!d?null:e.jsxs("div",{className:"flex items-center justify-between gap-4 py-4 px-5 border-t border-gray-700/50",children:[e.jsxs("div",{className:"flex items-center gap-2 text-sm text-gray-400",children:[e.jsxs("span",{children:["共 ",l," 条"]}),d&&e.jsx("select",{value:o,onChange:m=>d(Number(m.target.value)),className:"bg-[#0f2137] border border-gray-600 rounded px-2 py-1 text-gray-300 text-sm",children:h.map(m=>e.jsxs("option",{value:m,children:[m," 条/页"]},m))})]}),a>1&&e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("button",{type:"button",onClick:()=>c(1),disabled:s<=1,className:"px-2 py-1 rounded border border-gray-600 text-gray-400 hover:bg-gray-700/50 disabled:opacity-40 text-sm",children:"首页"}),e.jsx("button",{type:"button",onClick:()=>c(s-1),disabled:s<=1,className:"px-3 py-1 rounded border border-gray-600 text-gray-400 hover:bg-gray-700/50 disabled:opacity-40 text-sm",children:"上一页"}),e.jsxs("span",{className:"px-3 py-1 text-gray-400 text-sm",children:[s," / ",a]}),e.jsx("button",{type:"button",onClick:()=>c(s+1),disabled:s>=a,className:"px-3 py-1 rounded border border-gray-600 text-gray-400 hover:bg-gray-700/50 disabled:opacity-40 text-sm",children:"下一页"}),e.jsx("button",{type:"button",onClick:()=>c(a),disabled:s>=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 n2(){const[s,a]=f.useState([]),[l,o]=f.useState([]),[c,d]=f.useState(0),[h,m]=f.useState(0),[p,y]=f.useState(0),[g,v]=f.useState(1),[C,P]=f.useState(10),[T,S]=f.useState(""),b=wu(T,300),[N,E]=f.useState("all"),[j,R]=f.useState(!0),[B,U]=f.useState(null),[k,L]=f.useState(null),[_,se]=f.useState(""),[le,ie]=f.useState(!1);async function ee(){R(!0),U(null);try{const W=N==="all"?"":N==="completed"?"completed":N,M=new URLSearchParams({page:String(g),pageSize:String(C),...W&&{status:W},...b&&{search:b}}),[O,F]=await Promise.all([Fe(`/api/orders?${M}`),Fe("/api/db/users?page=1&pageSize=500")]);O!=null&&O.success&&(a(O.orders||[]),d(O.total??0),m(O.totalRevenue??0),y(O.todayRevenue??0)),F!=null&&F.success&&F.users&&o(F.users)}catch(W){console.error("加载订单失败",W),U("加载订单失败,请检查网络后重试")}finally{R(!1)}}f.useEffect(()=>{v(1)},[b,N]),f.useEffect(()=>{ee()},[g,C,b,N]);const G=W=>{var M;return W.userNickname||((M=l.find(O=>O.id===W.userId))==null?void 0:M.nickname)||"匿名用户"},Q=W=>{var M;return((M=l.find(O=>O.id===W))==null?void 0:M.phone)||"-"},ce=W=>{const M=W.productType||W.type||"",O=W.description||"";if(O){if(M==="section"&&O.includes("章节")){if(O.includes("-")){const F=O.split("-");if(F.length>=3)return{name:`第${F[1]}章 第${F[2]}节`,type:"《一场Soul的创业实验》"}}return{name:O,type:"章节购买"}}return M==="fullbook"||O.includes("全书")?{name:"《一场Soul的创业实验》",type:"全书购买"}:M==="vip"||O.includes("VIP")?{name:"VIP年度会员",type:"VIP"}:M==="match"||O.includes("伙伴")?{name:"找伙伴匹配",type:"功能服务"}:{name:O,type:"其他"}}return M==="section"?{name:`章节 ${W.productId||W.sectionId||""}`,type:"单章"}:M==="fullbook"?{name:"《一场Soul的创业实验》",type:"全书"}:M==="vip"?{name:"VIP年度会员",type:"VIP"}:M==="match"?{name:"找伙伴匹配",type:"功能"}:{name:"未知商品",type:M||"其他"}},re=Math.ceil(c/C)||1;async function A(){var W;if(!(!(k!=null&&k.orderSn)&&!(k!=null&&k.id))){ie(!0),U(null);try{const M=await Nt("/api/admin/orders/refund",{orderSn:k.orderSn||k.id,reason:_||void 0});M!=null&&M.success?(L(null),se(""),ee()):U((M==null?void 0:M.error)||"退款失败")}catch(M){const O=M;U(((W=O==null?void 0:O.data)==null?void 0:W.error)||"退款失败,请检查网络后重试")}finally{ie(!1)}}}function ne(){if(s.length===0){alert("暂无数据可导出");return}const W=["订单号","用户","手机号","商品","金额","支付方式","状态","退款原因","分销佣金","下单时间"],M=s.map(ue=>{const K=ce(ue);return[ue.orderSn||ue.id||"",G(ue),Q(ue.userId),K.name,Number(ue.amount||0).toFixed(2),ue.paymentMethod==="wechat"?"微信支付":ue.paymentMethod==="alipay"?"支付宝":ue.paymentMethod||"微信支付",ue.status==="refunded"?"已退款":ue.status==="paid"||ue.status==="completed"?"已完成":ue.status==="pending"||ue.status==="created"?"待支付":"已失败",ue.status==="refunded"&&ue.refundReason?ue.refundReason:"-",ue.referrerEarnings?Number(ue.referrerEarnings).toFixed(2):"-",ue.createdAt?new Date(ue.createdAt).toLocaleString("zh-CN"):""].join(",")}),O="\uFEFF"+[W.join(","),...M].join(` +`),F=new Blob([O],{type:"text/csv;charset=utf-8"}),X=URL.createObjectURL(F),H=document.createElement("a");H.href=X,H.download=`订单列表_${new Date().toISOString().slice(0,10)}.csv`,H.click(),URL.revokeObjectURL(X)}return e.jsxs("div",{className:"p-8 w-full",children:[B&&e.jsxs("div",{className:"mb-4 px-4 py-3 rounded-lg bg-red-500/20 border border-red-500/50 text-red-400 text-sm flex items-center justify-between",children:[e.jsx("span",{children:B}),e.jsx("button",{type:"button",onClick:()=>U(null),className:"hover:text-red-300",children:"×"})]}),e.jsxs("div",{className:"flex justify-between items-center mb-8",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"text-2xl font-bold text-white",children:"订单管理"}),e.jsxs("p",{className:"text-gray-400 mt-1",children:["共 ",s.length," 笔订单"]})]}),e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsxs(Z,{variant:"outline",onClick:ee,disabled:j,className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:[e.jsx($e,{className:`w-4 h-4 mr-2 ${j?"animate-spin":""}`}),"刷新"]}),e.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[e.jsx("span",{className:"text-gray-400",children:"总收入:"}),e.jsxs("span",{className:"text-[#38bdac] font-bold",children:["¥",h.toFixed(2)]}),e.jsx("span",{className:"text-gray-600",children:"|"}),e.jsx("span",{className:"text-gray-400",children:"今日:"}),e.jsxs("span",{className:"text-[#FFD700] font-bold",children:["¥",p.toFixed(2)]})]})]})]}),e.jsxs("div",{className:"flex items-center gap-4 mb-6",children:[e.jsxs("div",{className:"relative flex-1 max-w-md",children:[e.jsx(yn,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-gray-500"}),e.jsx(de,{type:"text",placeholder:"搜索订单号/用户/章节...",className:"pl-10 bg-[#0f2137] border-gray-700 text-white placeholder:text-gray-500",value:T,onChange:W=>S(W.target.value)})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(lb,{className:"w-4 h-4 text-gray-400"}),e.jsxs("select",{value:N,onChange:W=>E(W.target.value),className:"bg-[#0f2137] border border-gray-700 text-white rounded-lg px-3 py-2 text-sm",children:[e.jsx("option",{value:"all",children:"全部状态"}),e.jsx("option",{value:"completed",children:"已完成"}),e.jsx("option",{value:"pending",children:"待支付"}),e.jsx("option",{value:"created",children:"已创建"}),e.jsx("option",{value:"failed",children:"已失败"}),e.jsx("option",{value:"refunded",children:"已退款"})]})]}),e.jsxs(Z,{variant:"outline",onClick:ne,disabled:s.length===0,className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:[e.jsx(eb,{className:"w-4 h-4 mr-2"}),"导出 CSV"]})]}),e.jsx(Ne,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:e.jsx(we,{className:"p-0",children:j?e.jsxs("div",{className:"flex items-center justify-center py-12",children:[e.jsx($e,{className:"w-6 h-6 text-[#38bdac] animate-spin"}),e.jsx("span",{className:"ml-2 text-gray-400",children:"加载中..."})]}):e.jsxs("div",{children:[e.jsxs(ir,{children:[e.jsx(or,{children:e.jsxs(Ge,{className:"bg-[#0a1628] hover:bg-[#0a1628] border-gray-700",children:[e.jsx(je,{className:"text-gray-400",children:"订单号"}),e.jsx(je,{className:"text-gray-400",children:"用户"}),e.jsx(je,{className:"text-gray-400",children:"商品"}),e.jsx(je,{className:"text-gray-400",children:"金额"}),e.jsx(je,{className:"text-gray-400",children:"支付方式"}),e.jsx(je,{className:"text-gray-400",children:"状态"}),e.jsx(je,{className:"text-gray-400",children:"退款原因"}),e.jsx(je,{className:"text-gray-400",children:"分销佣金"}),e.jsx(je,{className:"text-gray-400",children:"下单时间"}),e.jsx(je,{className:"text-gray-400",children:"操作"})]})}),e.jsxs(cr,{children:[s.map(W=>{const M=ce(W);return e.jsxs(Ge,{className:"hover:bg-[#0a1628] border-gray-700/50",children:[e.jsxs(pe,{className:"font-mono text-xs text-gray-400",children:[(W.orderSn||W.id||"").slice(0,12),"..."]}),e.jsx(pe,{children:e.jsxs("div",{children:[e.jsx("p",{className:"text-white text-sm",children:G(W)}),e.jsx("p",{className:"text-gray-500 text-xs",children:Q(W.userId)})]})}),e.jsx(pe,{children:e.jsxs("div",{children:[e.jsxs("p",{className:"text-white text-sm flex items-center gap-2",children:[M.name,(W.productType||W.type)==="vip"&&e.jsx(Oe,{className:"bg-amber-500/20 text-amber-400 hover:bg-amber-500/20 border-0 text-xs",children:"VIP"})]}),e.jsx("p",{className:"text-gray-500 text-xs",children:M.type})]})}),e.jsxs(pe,{className:"text-[#38bdac] font-bold",children:["¥",Number(W.amount||0).toFixed(2)]}),e.jsx(pe,{className:"text-gray-300",children:W.paymentMethod==="wechat"?"微信支付":W.paymentMethod==="alipay"?"支付宝":W.paymentMethod||"微信支付"}),e.jsx(pe,{children:W.status==="refunded"?e.jsx(Oe,{className:"bg-gray-500/20 text-gray-400 hover:bg-gray-500/20 border-0",children:"已退款"}):W.status==="paid"||W.status==="completed"?e.jsx(Oe,{className:"bg-green-500/20 text-green-400 hover:bg-green-500/20 border-0",children:"已完成"}):W.status==="pending"||W.status==="created"?e.jsx(Oe,{className:"bg-yellow-500/20 text-yellow-400 hover:bg-yellow-500/20 border-0",children:"待支付"}):e.jsx(Oe,{className:"bg-red-500/20 text-red-400 hover:bg-red-500/20 border-0",children:"已失败"})}),e.jsx(pe,{className:"text-gray-400 text-sm max-w-[120px] truncate",title:W.refundReason,children:W.status==="refunded"&&W.refundReason?W.refundReason:"-"}),e.jsx(pe,{className:"text-[#FFD700]",children:W.referrerEarnings?`¥${Number(W.referrerEarnings).toFixed(2)}`:"-"}),e.jsx(pe,{className:"text-gray-400 text-sm",children:new Date(W.createdAt).toLocaleString("zh-CN")}),e.jsx(pe,{children:(W.status==="paid"||W.status==="completed")&&e.jsxs(Z,{variant:"outline",size:"sm",className:"border-orange-500/50 text-orange-400 hover:bg-orange-500/20",onClick:()=>{L(W),se("")},children:[e.jsx(Bx,{className:"w-3 h-3 mr-1"}),"退款"]})})]},W.id)}),s.length===0&&e.jsx(Ge,{children:e.jsx(pe,{colSpan:10,className:"text-center py-12 text-gray-500",children:"暂无订单数据"})})]})]}),e.jsx(Ar,{page:g,totalPages:re,total:c,pageSize:C,onPageChange:v,onPageSizeChange:W=>{P(W),v(1)}})]})})}),e.jsx(wt,{open:!!k,onOpenChange:W=>!W&&L(null),children:e.jsxs(vt,{className:"bg-[#0f2137] border-gray-700 text-white max-w-md",children:[e.jsx(St,{children:e.jsx(Ct,{className:"text-white",children:"订单退款"})}),k&&e.jsxs("div",{className:"space-y-4",children:[e.jsxs("p",{className:"text-gray-400 text-sm",children:["订单号:",k.orderSn||k.id]}),e.jsxs("p",{className:"text-gray-400 text-sm",children:["退款金额:¥",Number(k.amount||0).toFixed(2)]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-sm text-gray-400 block mb-2",children:"退款原因(选填)"}),e.jsx("div",{className:"form-input",children:e.jsx(de,{className:"bg-[#0a1628] border-gray-700 text-white placeholder:text-gray-500",placeholder:"如:用户申请退款",value:_,onChange:W=>se(W.target.value)})})]}),e.jsx("p",{className:"text-orange-400/80 text-xs",children:"退款将原路退回至用户微信,且无法撤销,请确认后再操作。"})]}),e.jsxs(Ft,{children:[e.jsx(Z,{variant:"outline",className:"border-gray-600 text-gray-300",onClick:()=>L(null),disabled:le,children:"取消"}),e.jsx(Z,{className:"bg-orange-500 hover:bg-orange-600 text-white",onClick:A,disabled:le,children:le?"退款中...":"确认退款"})]})]})})]})}var a2=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],l2=a2.reduce((s,a)=>{const l=Vx(`Primitive.${a}`),o=f.forwardRef((c,d)=>{const{asChild:h,...m}=c,p=h?l:a;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),e.jsx(p,{...m,ref:d})});return o.displayName=`Primitive.${a}`,{...s,[a]:o}},{}),i2="Label",Dp=f.forwardRef((s,a)=>e.jsx(l2.label,{...s,ref:a,onMouseDown:l=>{var c;l.target.closest("button, input, select, textarea")||((c=s.onMouseDown)==null||c.call(s,l),!l.defaultPrevented&&l.detail>1&&l.preventDefault())}}));Dp.displayName=i2;var Lp=Dp;const te=f.forwardRef(({className:s,...a},l)=>e.jsx(Lp,{ref:l,className:tt("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",s),...a}));te.displayName=Lp.displayName;function Su(s){const a=f.useRef({value:s,previous:s});return f.useMemo(()=>(a.current.value!==s&&(a.current.previous=a.current.value,a.current.value=s),a.current.previous),[s])}function Cu(s){const[a,l]=f.useState(void 0);return qt(()=>{if(s){l({width:s.offsetWidth,height:s.offsetHeight});const o=new ResizeObserver(c=>{if(!Array.isArray(c)||!c.length)return;const d=c[0];let h,m;if("borderBoxSize"in d){const p=d.borderBoxSize,y=Array.isArray(p)?p[0]:p;h=y.inlineSize,m=y.blockSize}else h=s.offsetWidth,m=s.offsetHeight;l({width:h,height:m})});return o.observe(s,{box:"border-box"}),()=>o.unobserve(s)}else l(void 0)},[s]),a}var yo="Switch",[o2]=en(yo),[c2,d2]=o2(yo),Op=f.forwardRef((s,a)=>{const{__scopeSwitch:l,name:o,checked:c,defaultChecked:d,required:h,disabled:m,value:p="on",onCheckedChange:y,form:g,...v}=s,[C,P]=f.useState(null),T=et(a,j=>P(j)),S=f.useRef(!1),b=C?g||!!C.closest("form"):!0,[N,E]=bn({prop:c,defaultProp:d??!1,onChange:y,caller:yo});return e.jsxs(c2,{scope:l,checked:N,disabled:m,children:[e.jsx(Ke.button,{type:"button",role:"switch","aria-checked":N,"aria-required":h,"data-state":Bp(N),"data-disabled":m?"":void 0,disabled:m,value:p,...v,ref:T,onClick:Be(s.onClick,j=>{E(R=>!R),b&&(S.current=j.isPropagationStopped(),S.current||j.stopPropagation())})}),b&&e.jsx($p,{control:C,bubbles:!S.current,name:o,value:p,checked:N,required:h,disabled:m,form:g,style:{transform:"translateX(-100%)"}})]})});Op.displayName=yo;var Fp="SwitchThumb",zp=f.forwardRef((s,a)=>{const{__scopeSwitch:l,...o}=s,c=d2(Fp,l);return e.jsx(Ke.span,{"data-state":Bp(c.checked),"data-disabled":c.disabled?"":void 0,...o,ref:a})});zp.displayName=Fp;var u2="SwitchBubbleInput",$p=f.forwardRef(({__scopeSwitch:s,control:a,checked:l,bubbles:o=!0,...c},d)=>{const h=f.useRef(null),m=et(h,d),p=Su(l),y=Cu(a);return f.useEffect(()=>{const g=h.current;if(!g)return;const v=window.HTMLInputElement.prototype,P=Object.getOwnPropertyDescriptor(v,"checked").set;if(p!==l&&P){const T=new Event("click",{bubbles:o});P.call(g,l),g.dispatchEvent(T)}},[p,l,o]),e.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:l,...c,tabIndex:-1,ref:m,style:{...c.style,...y,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});$p.displayName=u2;function Bp(s){return s?"checked":"unchecked"}var Up=Op,h2=zp;const it=f.forwardRef(({className:s,...a},l)=>e.jsx(Up,{className:tt("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]",s),...a,ref:l,children:e.jsx(h2,{className:tt("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")})}));it.displayName=Up.displayName;function ku(s){const a=s+"CollectionProvider",[l,o]=en(a),[c,d]=l(a,{collectionRef:{current:null},itemMap:new Map}),h=S=>{const{scope:b,children:N}=S,E=Us.useRef(null),j=Us.useRef(new Map).current;return e.jsx(c,{scope:b,itemMap:j,collectionRef:E,children:N})};h.displayName=a;const m=s+"CollectionSlot",p=xl(m),y=Us.forwardRef((S,b)=>{const{scope:N,children:E}=S,j=d(m,N),R=et(b,j.collectionRef);return e.jsx(p,{ref:R,children:E})});y.displayName=m;const g=s+"CollectionItemSlot",v="data-radix-collection-item",C=xl(g),P=Us.forwardRef((S,b)=>{const{scope:N,children:E,...j}=S,R=Us.useRef(null),B=et(b,R),U=d(g,N);return Us.useEffect(()=>(U.itemMap.set(R,{ref:R,...j}),()=>void U.itemMap.delete(R))),e.jsx(C,{[v]:"",ref:B,children:E})});P.displayName=g;function T(S){const b=d(s+"CollectionConsumer",S);return Us.useCallback(()=>{const E=b.collectionRef.current;if(!E)return[];const j=Array.from(E.querySelectorAll(`[${v}]`));return Array.from(b.itemMap.values()).sort((U,k)=>j.indexOf(U.ref.current)-j.indexOf(k.ref.current))},[b.collectionRef,b.itemMap])}return[{Provider:h,Slot:y,ItemSlot:P},T,o]}var f2=f.createContext(void 0);function vo(s){const a=f.useContext(f2);return s||a||"ltr"}var Rd="rovingFocusGroup.onEntryFocus",m2={bubbles:!1,cancelable:!0},vl="RovingFocusGroup",[Yd,Vp,x2]=ku(vl),[p2,Wp]=en(vl,[x2]),[g2,y2]=p2(vl),Hp=f.forwardRef((s,a)=>e.jsx(Yd.Provider,{scope:s.__scopeRovingFocusGroup,children:e.jsx(Yd.Slot,{scope:s.__scopeRovingFocusGroup,children:e.jsx(v2,{...s,ref:a})})}));Hp.displayName=vl;var v2=f.forwardRef((s,a)=>{const{__scopeRovingFocusGroup:l,orientation:o,loop:c=!1,dir:d,currentTabStopId:h,defaultCurrentTabStopId:m,onCurrentTabStopIdChange:p,onEntryFocus:y,preventScrollOnEntryFocus:g=!1,...v}=s,C=f.useRef(null),P=et(a,C),T=vo(d),[S,b]=bn({prop:h,defaultProp:m??null,onChange:p,caller:vl}),[N,E]=f.useState(!1),j=Qs(y),R=Vp(l),B=f.useRef(!1),[U,k]=f.useState(0);return f.useEffect(()=>{const L=C.current;if(L)return L.addEventListener(Rd,j),()=>L.removeEventListener(Rd,j)},[j]),e.jsx(g2,{scope:l,orientation:o,dir:T,loop:c,currentTabStopId:S,onItemFocus:f.useCallback(L=>b(L),[b]),onItemShiftTab:f.useCallback(()=>E(!0),[]),onFocusableItemAdd:f.useCallback(()=>k(L=>L+1),[]),onFocusableItemRemove:f.useCallback(()=>k(L=>L-1),[]),children:e.jsx(Ke.div,{tabIndex:N||U===0?-1:0,"data-orientation":o,...v,ref:P,style:{outline:"none",...s.style},onMouseDown:Be(s.onMouseDown,()=>{B.current=!0}),onFocus:Be(s.onFocus,L=>{const _=!B.current;if(L.target===L.currentTarget&&_&&!N){const se=new CustomEvent(Rd,m2);if(L.currentTarget.dispatchEvent(se),!se.defaultPrevented){const le=R().filter(ce=>ce.focusable),ie=le.find(ce=>ce.active),ee=le.find(ce=>ce.id===S),Q=[ie,ee,...le].filter(Boolean).map(ce=>ce.ref.current);Gp(Q,g)}}B.current=!1}),onBlur:Be(s.onBlur,()=>E(!1))})})}),Kp="RovingFocusGroupItem",Yp=f.forwardRef((s,a)=>{const{__scopeRovingFocusGroup:l,focusable:o=!0,active:c=!1,tabStopId:d,children:h,...m}=s,p=Gs(),y=d||p,g=y2(Kp,l),v=g.currentTabStopId===y,C=Vp(l),{onFocusableItemAdd:P,onFocusableItemRemove:T,currentTabStopId:S}=g;return f.useEffect(()=>{if(o)return P(),()=>T()},[o,P,T]),e.jsx(Yd.ItemSlot,{scope:l,id:y,focusable:o,active:c,children:e.jsx(Ke.span,{tabIndex:v?0:-1,"data-orientation":g.orientation,...m,ref:a,onMouseDown:Be(s.onMouseDown,b=>{o?g.onItemFocus(y):b.preventDefault()}),onFocus:Be(s.onFocus,()=>g.onItemFocus(y)),onKeyDown:Be(s.onKeyDown,b=>{if(b.key==="Tab"&&b.shiftKey){g.onItemShiftTab();return}if(b.target!==b.currentTarget)return;const N=N2(b,g.orientation,g.dir);if(N!==void 0){if(b.metaKey||b.ctrlKey||b.altKey||b.shiftKey)return;b.preventDefault();let j=C().filter(R=>R.focusable).map(R=>R.ref.current);if(N==="last")j.reverse();else if(N==="prev"||N==="next"){N==="prev"&&j.reverse();const R=j.indexOf(b.currentTarget);j=g.loop?w2(j,R+1):j.slice(R+1)}setTimeout(()=>Gp(j))}}),children:typeof h=="function"?h({isCurrentTabStop:v,hasTabStop:S!=null}):h})})});Yp.displayName=Kp;var j2={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function b2(s,a){return a!=="rtl"?s:s==="ArrowLeft"?"ArrowRight":s==="ArrowRight"?"ArrowLeft":s}function N2(s,a,l){const o=b2(s.key,l);if(!(a==="vertical"&&["ArrowLeft","ArrowRight"].includes(o))&&!(a==="horizontal"&&["ArrowUp","ArrowDown"].includes(o)))return j2[o]}function Gp(s,a=!1){const l=document.activeElement;for(const o of s)if(o===l||(o.focus({preventScroll:a}),document.activeElement!==l))return}function w2(s,a){return s.map((l,o)=>s[(a+o)%s.length])}var S2=Hp,C2=Yp,jo="Tabs",[k2]=en(jo,[Wp]),Qp=Wp(),[E2,Eu]=k2(jo),qp=f.forwardRef((s,a)=>{const{__scopeTabs:l,value:o,onValueChange:c,defaultValue:d,orientation:h="horizontal",dir:m,activationMode:p="automatic",...y}=s,g=vo(m),[v,C]=bn({prop:o,onChange:c,defaultProp:d??"",caller:jo});return e.jsx(E2,{scope:l,baseId:Gs(),value:v,onValueChange:C,orientation:h,dir:g,activationMode:p,children:e.jsx(Ke.div,{dir:g,"data-orientation":h,...y,ref:a})})});qp.displayName=jo;var Xp="TabsList",Jp=f.forwardRef((s,a)=>{const{__scopeTabs:l,loop:o=!0,...c}=s,d=Eu(Xp,l),h=Qp(l);return e.jsx(S2,{asChild:!0,...h,orientation:d.orientation,dir:d.dir,loop:o,children:e.jsx(Ke.div,{role:"tablist","aria-orientation":d.orientation,...c,ref:a})})});Jp.displayName=Xp;var Zp="TabsTrigger",eg=f.forwardRef((s,a)=>{const{__scopeTabs:l,value:o,disabled:c=!1,...d}=s,h=Eu(Zp,l),m=Qp(l),p=sg(h.baseId,o),y=ng(h.baseId,o),g=o===h.value;return e.jsx(C2,{asChild:!0,...m,focusable:!c,active:g,children:e.jsx(Ke.button,{type:"button",role:"tab","aria-selected":g,"aria-controls":y,"data-state":g?"active":"inactive","data-disabled":c?"":void 0,disabled:c,id:p,...d,ref:a,onMouseDown:Be(s.onMouseDown,v=>{!c&&v.button===0&&v.ctrlKey===!1?h.onValueChange(o):v.preventDefault()}),onKeyDown:Be(s.onKeyDown,v=>{[" ","Enter"].includes(v.key)&&h.onValueChange(o)}),onFocus:Be(s.onFocus,()=>{const v=h.activationMode!=="manual";!g&&!c&&v&&h.onValueChange(o)})})})});eg.displayName=Zp;var tg="TabsContent",rg=f.forwardRef((s,a)=>{const{__scopeTabs:l,value:o,forceMount:c,children:d,...h}=s,m=Eu(tg,l),p=sg(m.baseId,o),y=ng(m.baseId,o),g=o===m.value,v=f.useRef(g);return f.useEffect(()=>{const C=requestAnimationFrame(()=>v.current=!1);return()=>cancelAnimationFrame(C)},[]),e.jsx(yl,{present:c||g,children:({present:C})=>e.jsx(Ke.div,{"data-state":g?"active":"inactive","data-orientation":m.orientation,role:"tabpanel","aria-labelledby":p,hidden:!C,id:y,tabIndex:0,...h,ref:a,style:{...s.style,animationDuration:v.current?"0s":void 0},children:C&&d})})});rg.displayName=tg;function sg(s,a){return`${s}-trigger-${a}`}function ng(s,a){return`${s}-content-${a}`}var P2=qp,ag=Jp,lg=eg,ig=rg;const bo=P2,jl=f.forwardRef(({className:s,...a},l)=>e.jsx(ag,{ref:l,className:tt("inline-flex h-9 items-center justify-center rounded-lg bg-muted p-1 text-muted-foreground",s),...a}));jl.displayName=ag.displayName;const Zt=f.forwardRef(({className:s,...a},l)=>e.jsx(lg,{ref:l,className:tt("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",s),...a}));Zt.displayName=lg.displayName;const er=f.forwardRef(({className:s,...a},l)=>e.jsx(ig,{ref:l,className:tt("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",s),...a}));er.displayName=ig.displayName;function T2({open:s,onClose:a,userId:l,onUserUpdated:o}){var ce;const[c,d]=f.useState(null),[h,m]=f.useState([]),[p,y]=f.useState([]),[g,v]=f.useState(!1),[C,P]=f.useState(!1),[T,S]=f.useState(!1),[b,N]=f.useState("info"),[E,j]=f.useState(""),[R,B]=f.useState(""),[U,k]=f.useState([]),[L,_]=f.useState("");f.useEffect(()=>{s&&l&&se()},[s,l]);async function se(){if(l){v(!0);try{const re=await Fe(`/api/db/users?id=${encodeURIComponent(l)}`);if(re!=null&&re.success&&re.user){const A=re.user;d(A),j(A.phone||""),B(A.nickname||""),k(typeof A.tags=="string"?JSON.parse(A.tags||"[]"):[])}try{const A=await Fe(`/api/user/track?userId=${encodeURIComponent(l)}&limit=50`);A!=null&&A.success&&A.tracks&&m(A.tracks)}catch{m([])}try{const A=await Fe(`/api/db/users/referrals?userId=${encodeURIComponent(l)}`);A!=null&&A.success&&A.referrals&&y(A.referrals)}catch{y([])}}catch(re){console.error("Load user detail error:",re)}finally{v(!1)}}}async function le(){if(!(c!=null&&c.phone)){alert("用户未绑定手机号,无法同步");return}P(!0);try{const re=await Et("/api/ckb/sync",{action:"full_sync",phone:c.phone,userId:c.id});re!=null&&re.success?(alert("同步成功"),se()):alert("同步失败: "+(re==null?void 0:re.error))}catch(re){console.error("Sync CKB error:",re),alert("同步失败")}finally{P(!1)}}async function ie(){if(c){S(!0);try{const re={id:c.id,phone:E||void 0,nickname:R||void 0,tags:JSON.stringify(U)},A=await Nt("/api/db/users",re);A!=null&&A.success?(alert("保存成功"),se(),o==null||o()):alert("保存失败: "+(A==null?void 0:A.error))}catch(re){console.error("Save user error:",re),alert("保存失败")}finally{S(!1)}}}const ee=()=>{L&&!U.includes(L)&&(k([...U,L]),_(""))},G=re=>{k(U.filter(A=>A!==re))},Q=re=>{const ne={view_chapter:us,purchase:Bd,match:Qt,login:ra,register:ra,share:Ys,bind_phone:Wb,bind_wechat:Ob}[re]||_m;return e.jsx(ne,{className:"w-4 h-4"})};return s?e.jsx(wt,{open:s,onOpenChange:()=>a(),children:e.jsxs(vt,{className:"bg-[#0f2137] border-gray-700 text-white max-w-4xl max-h-[90vh] overflow-hidden",children:[e.jsx(St,{children:e.jsxs(Ct,{className:"text-white flex items-center gap-2",children:[e.jsx(ra,{className:"w-5 h-5 text-[#38bdac]"}),"用户详情",(c==null?void 0:c.phone)&&e.jsx(Oe,{className:"bg-green-500/20 text-green-400 border-0 ml-2",children:"已绑定手机"})]})}),g?e.jsxs("div",{className:"flex items-center justify-center py-20",children:[e.jsx($e,{className:"w-6 h-6 text-[#38bdac] animate-spin"}),e.jsx("span",{className:"ml-2 text-gray-400",children:"加载中..."})]}):c?e.jsxs("div",{className:"flex flex-col h-[70vh]",children:[e.jsxs("div",{className:"flex items-center gap-4 p-4 bg-[#0a1628] rounded-lg mb-4",children:[e.jsx("div",{className:"w-16 h-16 rounded-full bg-[#38bdac]/20 flex items-center justify-center text-2xl text-[#38bdac]",children:c.avatar?e.jsx("img",{src:c.avatar,className:"w-full h-full rounded-full object-cover",alt:""}):((ce=c.nickname)==null?void 0:ce.charAt(0))||"?"}),e.jsxs("div",{className:"flex-1",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("h3",{className:"text-lg font-bold text-white",children:c.nickname}),c.isAdmin&&e.jsx(Oe,{className:"bg-purple-500/20 text-purple-400 border-0",children:"管理员"}),c.hasFullBook&&e.jsx(Oe,{className:"bg-green-500/20 text-green-400 border-0",children:"全书已购"})]}),e.jsxs("p",{className:"text-gray-400 text-sm mt-1",children:[c.phone?`📱 ${c.phone}`:"未绑定手机",c.wechatId&&` · 💬 ${c.wechatId}`]}),e.jsxs("p",{className:"text-gray-500 text-xs mt-1",children:["ID: ",c.id," · 推广码: ",c.referralCode??"-"]})]}),e.jsxs("div",{className:"text-right",children:[e.jsxs("p",{className:"text-[#38bdac] font-bold",children:["¥",(c.earnings||0).toFixed(2)]}),e.jsx("p",{className:"text-gray-500 text-xs",children:"累计收益"})]})]}),e.jsxs(bo,{value:b,onValueChange:N,className:"flex-1 flex flex-col overflow-hidden",children:[e.jsxs(jl,{className:"bg-[#0a1628] border border-gray-700/50 p-1 mb-4",children:[e.jsx(Zt,{value:"info",className:"data-[state=active]:bg-[#38bdac]/20 data-[state=active]:text-[#38bdac]",children:"基础信息"}),e.jsx(Zt,{value:"tags",className:"data-[state=active]:bg-[#38bdac]/20 data-[state=active]:text-[#38bdac]",children:"标签体系"}),e.jsx(Zt,{value:"tracks",className:"data-[state=active]:bg-[#38bdac]/20 data-[state=active]:text-[#38bdac]",children:"行为轨迹"}),e.jsx(Zt,{value:"relations",className:"data-[state=active]:bg-[#38bdac]/20 data-[state=active]:text-[#38bdac]",children:"关系链路"})]}),e.jsxs(er,{value:"info",className:"flex-1 overflow-auto space-y-4",children:[e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"手机号"}),e.jsx(de,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"输入手机号",value:E,onChange:re=>j(re.target.value)})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"昵称"}),e.jsx(de,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"输入昵称",value:R,onChange:re=>B(re.target.value)})]})]}),e.jsxs("div",{className:"grid grid-cols-3 gap-4",children:[e.jsxs("div",{className:"p-4 bg-[#0a1628] rounded-lg",children:[e.jsx("p",{className:"text-gray-400 text-sm",children:"推荐人数"}),e.jsx("p",{className:"text-2xl font-bold text-white",children:c.referralCount??0})]}),e.jsxs("div",{className:"p-4 bg-[#0a1628] rounded-lg",children:[e.jsx("p",{className:"text-gray-400 text-sm",children:"待提现"}),e.jsxs("p",{className:"text-2xl font-bold text-yellow-400",children:["¥",(c.pendingEarnings??0).toFixed(2)]})]}),e.jsxs("div",{className:"p-4 bg-[#0a1628] rounded-lg",children:[e.jsx("p",{className:"text-gray-400 text-sm",children:"创建时间"}),e.jsx("p",{className:"text-sm text-white",children:c.createdAt?new Date(c.createdAt).toLocaleDateString():"-"})]})]}),e.jsxs("div",{className:"p-4 bg-[#0a1628] rounded-lg",children:[e.jsxs("div",{className:"flex items-center justify-between mb-3",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(Ys,{className:"w-4 h-4 text-[#38bdac]"}),e.jsx("span",{className:"text-white font-medium",children:"存客宝同步"})]}),e.jsx(Z,{size:"sm",onClick:le,disabled:C||!c.phone,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:C?e.jsxs(e.Fragment,{children:[e.jsx($e,{className:"w-4 h-4 mr-1 animate-spin"})," 同步中..."]}):e.jsxs(e.Fragment,{children:[e.jsx($e,{className:"w-4 h-4 mr-1"})," 同步数据"]})})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-4 text-sm",children:[e.jsxs("div",{children:[e.jsx("span",{className:"text-gray-500",children:"同步状态:"}),c.ckbSyncedAt?e.jsx(Oe,{className:"bg-green-500/20 text-green-400 border-0 ml-1",children:"已同步"}):e.jsx(Oe,{className:"bg-gray-500/20 text-gray-400 border-0 ml-1",children:"未同步"})]}),e.jsxs("div",{children:[e.jsx("span",{className:"text-gray-500",children:"最后同步:"}),e.jsx("span",{className:"text-gray-300 ml-1",children:c.ckbSyncedAt?new Date(c.ckbSyncedAt).toLocaleString():"-"})]})]})]})]}),e.jsx(er,{value:"tags",className:"flex-1 overflow-auto space-y-4",children:e.jsxs("div",{className:"p-4 bg-[#0a1628] rounded-lg",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[e.jsx(rN,{className:"w-4 h-4 text-[#38bdac]"}),e.jsx("span",{className:"text-white font-medium",children:"系统标签"})]}),e.jsxs("div",{className:"flex flex-wrap gap-2 mb-3",children:[U.map((re,A)=>e.jsxs(Oe,{className:"bg-[#38bdac]/20 text-[#38bdac] border-0 pr-1",children:[re,e.jsx("button",{type:"button",onClick:()=>G(re),className:"ml-1 hover:text-red-400",children:e.jsx(Sr,{className:"w-3 h-3"})})]},A)),U.length===0&&e.jsx("span",{className:"text-gray-500 text-sm",children:"暂无标签"})]}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(de,{className:"bg-[#162840] border-gray-700 text-white flex-1",placeholder:"添加新标签",value:L,onChange:re=>_(re.target.value),onKeyDown:re=>re.key==="Enter"&&ee()}),e.jsx(Z,{onClick:ee,className:"bg-[#38bdac] hover:bg-[#2da396]",children:"添加"})]})]})}),e.jsx(er,{value:"tracks",className:"flex-1 overflow-auto",children:e.jsx("div",{className:"space-y-2",children:h.length>0?h.map(re=>e.jsxs("div",{className:"flex items-start gap-3 p-3 bg-[#0a1628] rounded-lg",children:[e.jsx("div",{className:"w-8 h-8 rounded-full bg-[#38bdac]/20 flex items-center justify-center text-[#38bdac]",children:Q(re.action)}),e.jsxs("div",{className:"flex-1",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"text-white font-medium",children:re.actionLabel}),re.chapterTitle&&e.jsxs("span",{className:"text-gray-400 text-sm",children:["- ",re.chapterTitle]})]}),e.jsxs("p",{className:"text-gray-500 text-xs mt-1",children:[e.jsx(Ox,{className:"w-3 h-3 inline mr-1"}),re.timeAgo," · ",new Date(re.createdAt).toLocaleString()]})]})]},re.id)):e.jsxs("div",{className:"text-center py-12",children:[e.jsx(_m,{className:"w-10 h-10 text-[#38bdac]/40 mx-auto mb-4"}),e.jsx("p",{className:"text-gray-400",children:"暂无行为轨迹"})]})})}),e.jsx(er,{value:"relations",className:"flex-1 overflow-auto space-y-4",children:e.jsxs("div",{className:"p-4 bg-[#0a1628] rounded-lg",children:[e.jsxs("div",{className:"flex items-center justify-between mb-3",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(Ys,{className:"w-4 h-4 text-[#38bdac]"}),e.jsx("span",{className:"text-white font-medium",children:"推荐的用户"})]}),e.jsxs(Oe,{className:"bg-[#38bdac]/20 text-[#38bdac] border-0",children:["共 ",p.length," 人"]})]}),e.jsx("div",{className:"space-y-2 max-h-[200px] overflow-y-auto",children:p.length>0?p.map((re,A)=>{var W;const ne=re;return e.jsxs("div",{className:"flex items-center justify-between p-2 bg-[#162840] rounded",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("div",{className:"w-6 h-6 rounded-full bg-[#38bdac]/20 flex items-center justify-center text-xs text-[#38bdac]",children:((W=ne.nickname)==null?void 0:W.charAt(0))||"?"}),e.jsx("span",{className:"text-white text-sm",children:ne.nickname})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[ne.status==="vip"&&e.jsx(Oe,{className:"bg-green-500/20 text-green-400 border-0 text-xs",children:"已购"}),e.jsx("span",{className:"text-gray-500 text-xs",children:ne.createdAt?new Date(ne.createdAt).toLocaleDateString():""})]})]},ne.id||A)}):e.jsx("p",{className:"text-gray-500 text-sm text-center py-4",children:"暂无推荐用户"})})]})})]}),e.jsxs("div",{className:"flex justify-end gap-2 pt-4 border-t border-gray-700 mt-4",children:[e.jsxs(Z,{variant:"outline",onClick:a,className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:[e.jsx(Sr,{className:"w-4 h-4 mr-2"}),"关闭"]}),e.jsxs(Z,{onClick:ie,disabled:T,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:[e.jsx(zt,{className:"w-4 h-4 mr-2"}),T?"保存中...":"保存修改"]})]})]}):e.jsx("div",{className:"text-center py-12 text-gray-500",children:"用户不存在"})]})}):null}const Id={isVip:!1,vipExpireDate:"",vipSort:"",vipRole:"",vipRoleCustom:"",vipName:"",vipProject:"",vipContact:"",vipBio:""};function R2({open:s,onClose:a,userId:l,userNickname:o="",onSaved:c}){const[d,h]=f.useState(Id),[m,p]=f.useState([]),[y,g]=f.useState(!1),[v,C]=f.useState(!1);f.useEffect(()=>{if(!s){h(Id);return}let T=!1;return g(!0),Promise.all([Fe("/api/db/vip-roles"),l?Fe(`/api/db/users?id=${encodeURIComponent(l)}`):Promise.resolve(null)]).then(([S,b])=>{if(T)return;const N=S!=null&&S.success&&S.data?S.data:[];p(N);const E=b&&b.user?b.user:null;if(E){const j=String(E.vipRole??""),R=N.some(B=>B.name===j);h({isVip:!!(E.isVip??!1),vipExpireDate:E.vipExpireDate?String(E.vipExpireDate).slice(0,10):"",vipSort:typeof E.vipSort=="number"?E.vipSort:"",vipRole:R?j:j?"__custom__":"",vipRoleCustom:R?"":j,vipName:String(E.vipName??""),vipProject:String(E.vipProject??""),vipContact:String(E.vipContact??""),vipBio:String(E.vipBio??"")})}else h(Id)}).catch(S=>{T||console.error("Load error:",S)}).finally(()=>{T||g(!1)}),()=>{T=!0}},[s,l]);async function P(){if(l){if(d.isVip&&!d.vipExpireDate.trim()){alert("开启 VIP 时请填写有效到期日");return}if(d.isVip&&d.vipExpireDate.trim()){const T=new Date(d.vipExpireDate);if(isNaN(T.getTime())){alert("到期日格式无效,请使用 YYYY-MM-DD");return}}C(!0);try{const T=d.vipRole==="__custom__"?d.vipRoleCustom.trim():d.vipRole,S={id:l,isVip:d.isVip,vipExpireDate:d.isVip?d.vipExpireDate:void 0,vipSort:d.vipSort===""?void 0:d.vipSort,vipRole:T||void 0,vipName:d.vipName||void 0,vipProject:d.vipProject||void 0,vipContact:d.vipContact||void 0,vipBio:d.vipBio||void 0},b=await Nt("/api/db/users",S);b!=null&&b.success?(alert("VIP 设置已保存"),c==null||c(),a()):alert("保存失败: "+(b==null?void 0:b.error))}catch(T){console.error("Save VIP error:",T),alert("保存失败")}finally{C(!1)}}}return s?e.jsx(wt,{open:s,onOpenChange:()=>a(),children:e.jsxs(vt,{className:"bg-[#0f2137] border-gray-700 text-white max-w-md",children:[e.jsx(St,{children:e.jsxs(Ct,{className:"text-white flex items-center gap-2",children:[e.jsx(mo,{className:"w-5 h-5 text-amber-400"}),"设置 VIP - ",o||l]})}),y?e.jsx("div",{className:"py-8 text-center text-gray-400",children:"加载中..."}):e.jsxs("div",{className:"space-y-4 py-4",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx(te,{className:"text-gray-300",children:"VIP 会员"}),e.jsx(it,{checked:d.isVip,onCheckedChange:T=>h(S=>({...S,isVip:T}))})]}),d.isVip&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"space-y-2",children:[e.jsxs(te,{className:"text-gray-300",children:["到期日 (YYYY-MM-DD) ",e.jsx("span",{className:"text-amber-400",children:"*"})]}),e.jsx(de,{type:"date",className:"bg-[#0a1628] border-gray-700 text-white",value:d.vipExpireDate,onChange:T=>h(S=>({...S,vipExpireDate:T.target.value}))})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"排序"}),e.jsx(de,{type:"number",className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"数字越小越靠前,留空按时间",value:d.vipSort===""?"":d.vipSort,onChange:T=>{const S=T.target.value;h(b=>({...b,vipSort:S===""?"":parseInt(S,10)||0}))}})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"角色"}),e.jsxs("select",{className:"w-full bg-[#0a1628] border border-gray-700 text-white rounded-md px-3 py-2",value:d.vipRole,onChange:T=>h(S=>({...S,vipRole:T.target.value})),children:[e.jsx("option",{value:"",children:"请选择或下方手动填写"}),m.map(T=>e.jsx("option",{value:T.name,children:T.name},T.id)),e.jsx("option",{value:"__custom__",children:"其他(手动填写)"})]}),d.vipRole==="__custom__"&&e.jsx(de,{className:"bg-[#0a1628] border-gray-700 text-white mt-1",placeholder:"输入自定义角色",value:d.vipRoleCustom,onChange:T=>h(S=>({...S,vipRoleCustom:T.target.value}))})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"VIP 展示名"}),e.jsx(de,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"创业老板排行展示名",value:d.vipName,onChange:T=>h(S=>({...S,vipName:T.target.value}))})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"项目/公司"}),e.jsx(de,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"项目名称",value:d.vipProject,onChange:T=>h(S=>({...S,vipProject:T.target.value}))})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"联系方式"}),e.jsx(de,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"微信号或手机",value:d.vipContact,onChange:T=>h(S=>({...S,vipContact:T.target.value}))})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"一句话简介"}),e.jsx(de,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"简要描述业务",value:d.vipBio,onChange:T=>h(S=>({...S,vipBio:T.target.value}))})]})]}),e.jsxs(Ft,{children:[e.jsxs(Z,{variant:"outline",onClick:a,className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:[e.jsx(Sr,{className:"w-4 h-4 mr-2"}),"取消"]}),e.jsxs(Z,{onClick:P,disabled:v||y,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:[e.jsx(zt,{className:"w-4 h-4 mr-2"}),v?"保存中...":"保存"]})]})]})}):null}function I2(){var Xr,xs,ps,$t,gs;const[s,a]=f.useState([]),[l,o]=f.useState(0),[c,d]=f.useState(1),[h,m]=f.useState(10),[p,y]=f.useState(""),g=wu(p,300),[v,C]=f.useState("all"),[P,T]=f.useState(!0),[S,b]=f.useState(null),[N,E]=f.useState(!1),[j,R]=f.useState(!1),[B,U]=f.useState(null),[k,L]=f.useState(""),[_,se]=f.useState(""),[le,ie]=f.useState(!1),[ee,G]=f.useState(!1),[Q,ce]=f.useState({referrals:[],stats:{}}),[re,A]=f.useState(!1),[ne,W]=f.useState(null),[M,O]=f.useState(!1),[F,X]=f.useState(null),[H,ue]=f.useState(!1),[K,ye]=f.useState(null),[ge,D]=f.useState({phone:"",nickname:"",password:"",isAdmin:!1,hasFullBook:!1});async function fe(){T(!0),b(null);try{const oe=new URLSearchParams({page:String(c),pageSize:String(h),search:g,...v==="vip"&&{vip:"true"}}),Qe=await Fe(`/api/db/users?${oe}`);Qe!=null&&Qe.success?(a(Qe.users||[]),o(Qe.total??0)):b((Qe==null?void 0:Qe.error)||"加载失败")}catch(oe){console.error("Load users error:",oe),b("网络错误,请检查连接")}finally{T(!1)}}f.useEffect(()=>{d(1)},[g,v]),f.useEffect(()=>{fe()},[c,h,g,v]);const Se=Math.ceil(l/h)||1;async function ze(oe){if(confirm("确定要删除这个用户吗?"))try{const Qe=await vn(`/api/db/users?id=${encodeURIComponent(oe)}`);Qe!=null&&Qe.success?fe():alert("删除失败: "+((Qe==null?void 0:Qe.error)||"未知错误"))}catch(Qe){console.error("Delete user error:",Qe),alert("删除失败")}}const We=oe=>{U(oe),D({phone:oe.phone||"",nickname:oe.nickname||"",password:"",isAdmin:!!(oe.isAdmin??!1),hasFullBook:!!(oe.hasFullBook??!1)}),E(!0)},qe=()=>{U(null),D({phone:"",nickname:"",password:"",isAdmin:!1,hasFullBook:!1}),E(!0)};async function Ze(){if(!ge.phone||!ge.nickname){alert("请填写手机号和昵称");return}ie(!0);try{if(B){const oe=await Nt("/api/db/users",{id:B.id,nickname:ge.nickname,isAdmin:ge.isAdmin,hasFullBook:ge.hasFullBook,...ge.password&&{password:ge.password}});if(!(oe!=null&&oe.success)){alert("更新失败: "+((oe==null?void 0:oe.error)||"未知错误"));return}}else{const oe=await Et("/api/db/users",{phone:ge.phone,nickname:ge.nickname,password:ge.password,isAdmin:ge.isAdmin});if(!(oe!=null&&oe.success)){alert("创建失败: "+((oe==null?void 0:oe.error)||"未知错误"));return}}E(!1),fe()}catch(oe){console.error("Save user error:",oe),alert("保存失败")}finally{ie(!1)}}const st=oe=>{U(oe),L(""),se(""),R(!0)};async function ft(oe){W(oe),G(!0),A(!0);try{const Qe=await Fe(`/api/db/users/referrals?userId=${encodeURIComponent(oe.id)}`);Qe!=null&&Qe.success?ce({referrals:Qe.referrals||[],stats:Qe.stats||{}}):ce({referrals:[],stats:{}})}catch(Qe){console.error("Load referrals error:",Qe),ce({referrals:[],stats:{}})}finally{A(!1)}}const nt=oe=>{X(oe.id),O(!0)},Vt=oe=>{ye(oe),ue(!0)};async function Fr(){if(!k){alert("请输入新密码");return}if(k!==_){alert("两次输入的密码不一致");return}if(k.length<6){alert("密码长度不能少于6位");return}ie(!0);try{const oe=await Nt("/api/db/users",{id:B==null?void 0:B.id,password:k});oe!=null&&oe.success?(alert("密码修改成功"),R(!1)):alert("密码修改失败: "+((oe==null?void 0:oe.error)||"未知错误"))}catch(oe){console.error("Change password error:",oe),alert("密码修改失败")}finally{ie(!1)}}return e.jsxs("div",{className:"p-8 w-full",children:[S&&e.jsxs("div",{className:"mb-4 px-4 py-3 rounded-lg bg-red-500/20 border border-red-500/50 text-red-400 text-sm flex items-center justify-between",children:[e.jsx("span",{children:S}),e.jsx("button",{type:"button",onClick:()=>b(null),className:"hover:text-red-300",children:"×"})]}),e.jsxs("div",{className:"flex justify-between items-center mb-8",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"text-2xl font-bold text-white",children:"用户管理"}),e.jsxs("p",{className:"text-gray-400 mt-1",children:["共 ",l," 位注册用户",v==="vip"&&",当前筛选 VIP"]})]}),e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsxs(Z,{variant:"outline",onClick:fe,disabled:P,className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:[e.jsx($e,{className:`w-4 h-4 mr-2 ${P?"animate-spin":""}`}),"刷新"]}),e.jsxs("select",{value:v,onChange:oe=>{C(oe.target.value),d(1)},className:"bg-[#0f2137] border border-gray-700 text-white rounded-lg px-3 py-2 text-sm",children:[e.jsx("option",{value:"all",children:"全部用户"}),e.jsx("option",{value:"vip",children:"VIP会员"})]}),e.jsxs("div",{className:"relative",children:[e.jsx(yn,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-gray-500"}),e.jsx(de,{type:"text",placeholder:"搜索用户...",className:"pl-10 bg-[#0f2137] border-gray-700 text-white placeholder:text-gray-500 w-64",value:p,onChange:oe=>y(oe.target.value)})]}),e.jsxs(Z,{onClick:qe,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:[e.jsx(Vd,{className:"w-4 h-4 mr-2"}),"添加用户"]})]})]}),e.jsx(wt,{open:N,onOpenChange:E,children:e.jsxs(vt,{className:"bg-[#0f2137] border-gray-700 text-white max-w-lg",children:[e.jsx(St,{children:e.jsxs(Ct,{className:"text-white flex items-center gap-2",children:[B?e.jsx(yt,{className:"w-5 h-5 text-[#38bdac]"}):e.jsx(Vd,{className:"w-5 h-5 text-[#38bdac]"}),B?"编辑用户":"添加用户"]})}),e.jsxs("div",{className:"space-y-4 py-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"手机号"}),e.jsx(de,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"请输入手机号",value:ge.phone,onChange:oe=>D({...ge,phone:oe.target.value}),disabled:!!B})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"昵称"}),e.jsx(de,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"请输入昵称",value:ge.nickname,onChange:oe=>D({...ge,nickname:oe.target.value})})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:B?"新密码 (留空则不修改)":"密码"}),e.jsx(de,{type:"password",className:"bg-[#0a1628] border-gray-700 text-white",placeholder:B?"留空则不修改":"请输入密码",value:ge.password,onChange:oe=>D({...ge,password:oe.target.value})})]}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx(te,{className:"text-gray-300",children:"管理员权限"}),e.jsx(it,{checked:ge.isAdmin,onCheckedChange:oe=>D({...ge,isAdmin:oe})})]}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx(te,{className:"text-gray-300",children:"已购全书"}),e.jsx(it,{checked:ge.hasFullBook,onCheckedChange:oe=>D({...ge,hasFullBook:oe})})]})]}),e.jsxs(Ft,{children:[e.jsxs(Z,{variant:"outline",onClick:()=>E(!1),className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:[e.jsx(Sr,{className:"w-4 h-4 mr-2"}),"取消"]}),e.jsxs(Z,{onClick:Ze,disabled:le,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:[e.jsx(zt,{className:"w-4 h-4 mr-2"}),le?"保存中...":"保存"]})]})]})}),e.jsx(wt,{open:j,onOpenChange:R,children:e.jsxs(vt,{className:"bg-[#0f2137] border-gray-700 text-white max-w-md",children:[e.jsx(St,{children:e.jsxs(Ct,{className:"text-white flex items-center gap-2",children:[e.jsx(Mm,{className:"w-5 h-5 text-[#38bdac]"}),"修改密码"]})}),e.jsxs("div",{className:"space-y-4 py-4",children:[e.jsxs("div",{className:"bg-[#0a1628] rounded-lg p-3",children:[e.jsxs("p",{className:"text-gray-400 text-sm",children:["用户:",B==null?void 0:B.nickname]}),e.jsxs("p",{className:"text-gray-400 text-sm",children:["手机号:",B==null?void 0:B.phone]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"新密码"}),e.jsx(de,{type:"password",className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"请输入新密码 (至少6位)",value:k,onChange:oe=>L(oe.target.value)})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"确认密码"}),e.jsx(de,{type:"password",className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"请再次输入新密码",value:_,onChange:oe=>se(oe.target.value)})]})]}),e.jsxs(Ft,{children:[e.jsx(Z,{variant:"outline",onClick:()=>R(!1),className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:"取消"}),e.jsx(Z,{onClick:Fr,disabled:le,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:le?"保存中...":"确认修改"})]})]})}),e.jsx(T2,{open:M,onClose:()=>O(!1),userId:F,onUserUpdated:fe}),e.jsx(R2,{open:H,onClose:()=>{ue(!1),ye(null)},userId:(K==null?void 0:K.id)??null,userNickname:K==null?void 0:K.nickname,onSaved:fe}),e.jsx(wt,{open:ee,onOpenChange:G,children:e.jsxs(vt,{className:"bg-[#0f2137] border-gray-700 text-white max-w-2xl max-h-[80vh] overflow-auto",children:[e.jsx(St,{children:e.jsxs(Ct,{className:"text-white flex items-center gap-2",children:[e.jsx(Qt,{className:"w-5 h-5 text-[#38bdac]"}),"绑定关系详情 - ",ne==null?void 0:ne.nickname]})}),e.jsxs("div",{className:"space-y-4 py-4",children:[e.jsxs("div",{className:"grid grid-cols-4 gap-3",children:[e.jsxs("div",{className:"bg-[#0a1628] rounded-lg p-3 text-center",children:[e.jsx("div",{className:"text-2xl font-bold text-[#38bdac]",children:((Xr=Q.stats)==null?void 0:Xr.total)||0}),e.jsx("div",{className:"text-xs text-gray-400",children:"绑定总数"})]}),e.jsxs("div",{className:"bg-[#0a1628] rounded-lg p-3 text-center",children:[e.jsx("div",{className:"text-2xl font-bold text-green-400",children:((xs=Q.stats)==null?void 0:xs.purchased)||0}),e.jsx("div",{className:"text-xs text-gray-400",children:"已付费"})]}),e.jsxs("div",{className:"bg-[#0a1628] rounded-lg p-3 text-center",children:[e.jsxs("div",{className:"text-2xl font-bold text-yellow-400",children:["¥",(((ps=Q.stats)==null?void 0:ps.earnings)||0).toFixed(2)]}),e.jsx("div",{className:"text-xs text-gray-400",children:"累计收益"})]}),e.jsxs("div",{className:"bg-[#0a1628] rounded-lg p-3 text-center",children:[e.jsxs("div",{className:"text-2xl font-bold text-orange-400",children:["¥",((($t=Q.stats)==null?void 0:$t.pendingEarnings)||0).toFixed(2)]}),e.jsx("div",{className:"text-xs text-gray-400",children:"待提现"})]})]}),re?e.jsxs("div",{className:"flex items-center justify-center py-8",children:[e.jsx($e,{className:"w-5 h-5 text-[#38bdac] animate-spin"}),e.jsx("span",{className:"ml-2 text-gray-400",children:"加载中..."})]}):(((gs=Q.referrals)==null?void 0:gs.length)??0)>0?e.jsx("div",{className:"space-y-2 max-h-[300px] overflow-y-auto",children:(Q.referrals??[]).map((oe,Qe)=>{var dr;const Tt=oe;return e.jsxs("div",{className:"flex items-center justify-between bg-[#0a1628] rounded-lg p-3",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"w-8 h-8 rounded-full bg-[#38bdac]/20 flex items-center justify-center text-sm text-[#38bdac]",children:((dr=Tt.nickname)==null?void 0:dr.charAt(0))||"?"}),e.jsxs("div",{children:[e.jsx("div",{className:"text-white text-sm",children:Tt.nickname}),e.jsx("div",{className:"text-xs text-gray-500",children:Tt.phone||(Tt.hasOpenId?"微信用户":"未绑定")})]})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[Tt.status==="vip"&&e.jsx(Oe,{className:"bg-green-500/20 text-green-400 border-0 text-xs",children:"全书已购"}),Tt.status==="paid"&&e.jsxs(Oe,{className:"bg-blue-500/20 text-blue-400 border-0 text-xs",children:["已付费",Tt.purchasedSections,"章"]}),Tt.status==="free"&&e.jsx(Oe,{className:"bg-gray-500/20 text-gray-400 border-0 text-xs",children:"未付费"}),e.jsx("span",{className:"text-xs text-gray-500",children:Tt.createdAt?new Date(Tt.createdAt).toLocaleDateString():""})]})]},Tt.id||Qe)})}):e.jsx("div",{className:"text-center py-8 text-gray-500",children:"暂无绑定用户"})]}),e.jsx(Ft,{children:e.jsx(Z,{variant:"outline",onClick:()=>G(!1),className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:"关闭"})})]})}),e.jsx(Ne,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:e.jsx(we,{className:"p-0",children:P?e.jsxs("div",{className:"flex items-center justify-center py-12",children:[e.jsx($e,{className:"w-6 h-6 text-[#38bdac] animate-spin"}),e.jsx("span",{className:"ml-2 text-gray-400",children:"加载中..."})]}):e.jsxs("div",{children:[e.jsxs(ir,{children:[e.jsx(or,{children:e.jsxs(Ge,{className:"bg-[#0a1628] hover:bg-[#0a1628] border-gray-700",children:[e.jsx(je,{className:"text-gray-400",children:"用户信息"}),e.jsx(je,{className:"text-gray-400",children:"绑定信息"}),e.jsx(je,{className:"text-gray-400",children:"购买状态"}),e.jsx(je,{className:"text-gray-400",children:"分销收益"}),e.jsx(je,{className:"text-gray-400",children:"推广码"}),e.jsx(je,{className:"text-gray-400",children:"注册时间"}),e.jsx(je,{className:"text-right text-gray-400",children:"操作"})]})}),e.jsxs(cr,{children:[s.map(oe=>{var Qe,Tt,dr;return e.jsxs(Ge,{className:"hover:bg-[#0a1628] border-gray-700/50",children:[e.jsx(pe,{children:e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"w-10 h-10 rounded-full bg-[#38bdac]/20 flex items-center justify-center text-sm font-medium text-[#38bdac]",children:oe.avatar?e.jsx("img",{src:oe.avatar,className:"w-full h-full rounded-full object-cover",alt:""}):((Qe=oe.nickname)==null?void 0:Qe.charAt(0))||"?"}),e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("p",{className:"font-medium text-white",children:oe.nickname}),oe.isAdmin&&e.jsx(Oe,{className:"bg-purple-500/20 text-purple-400 hover:bg-purple-500/20 border-0 text-xs",children:"管理员"}),oe.openId&&!((Tt=oe.id)!=null&&Tt.startsWith("user_"))&&e.jsx(Oe,{className:"bg-green-500/20 text-green-400 hover:bg-green-500/20 border-0 text-xs",children:"微信"})]}),e.jsx("p",{className:"text-xs text-gray-500 font-mono",children:oe.openId?oe.openId.slice(0,12)+"...":(dr=oe.id)==null?void 0:dr.slice(0,12)})]})]})}),e.jsx(pe,{children:e.jsxs("div",{className:"space-y-1",children:[oe.phone&&e.jsxs("div",{className:"flex items-center gap-1 text-xs",children:[e.jsx("span",{className:"text-gray-500",children:"📱"}),e.jsx("span",{className:"text-gray-300",children:oe.phone})]}),oe.wechatId&&e.jsxs("div",{className:"flex items-center gap-1 text-xs",children:[e.jsx("span",{className:"text-gray-500",children:"💬"}),e.jsx("span",{className:"text-gray-300",children:oe.wechatId})]}),oe.openId&&e.jsxs("div",{className:"flex items-center gap-1 text-xs",children:[e.jsx("span",{className:"text-gray-500",children:"🔗"}),e.jsxs("span",{className:"text-gray-500 truncate max-w-[100px]",title:oe.openId,children:[oe.openId.slice(0,12),"..."]})]}),!oe.phone&&!oe.wechatId&&!oe.openId&&e.jsx("span",{className:"text-gray-600 text-xs",children:"未绑定"})]})}),e.jsx(pe,{children:oe.hasFullBook?e.jsx(Oe,{className:"bg-amber-500/20 text-amber-400 hover:bg-amber-500/20 border-0",children:"VIP"}):e.jsx(Oe,{variant:"outline",className:"text-gray-500 border-gray-600",children:"未购买"})}),e.jsx(pe,{children:e.jsxs("div",{className:"space-y-1",children:[e.jsxs("div",{className:"text-white font-medium",children:["¥",parseFloat(String(oe.earnings||0)).toFixed(2)]}),parseFloat(String(oe.pendingEarnings||0))>0&&e.jsxs("div",{className:"text-xs text-yellow-400",children:["待提现: ¥",parseFloat(String(oe.pendingEarnings||0)).toFixed(2)]}),e.jsxs("div",{className:"text-xs text-[#38bdac] cursor-pointer hover:underline flex items-center gap-1",onClick:()=>ft(oe),onKeyDown:zr=>zr.key==="Enter"&&ft(oe),role:"button",tabIndex:0,children:[e.jsx(Qt,{className:"w-3 h-3"}),"绑定",oe.referralCount||0,"人"]})]})}),e.jsx(pe,{children:e.jsx("code",{className:"text-[#38bdac] text-xs bg-[#38bdac]/10 px-2 py-0.5 rounded",children:oe.referralCode||"-"})}),e.jsx(pe,{className:"text-gray-400",children:oe.createdAt?new Date(oe.createdAt).toLocaleDateString():"-"}),e.jsx(pe,{className:"text-right",children:e.jsxs("div",{className:"flex items-center justify-end gap-1",children:[e.jsx(Z,{variant:"ghost",size:"sm",onClick:()=>Vt(oe),className:"text-gray-400 hover:text-amber-400 hover:bg-amber-400/10",title:"设置 VIP",children:e.jsx(mo,{className:"w-4 h-4"})}),e.jsx(Z,{variant:"ghost",size:"sm",onClick:()=>nt(oe),className:"text-gray-400 hover:text-blue-400 hover:bg-blue-400/10",title:"查看详情",children:e.jsx(ds,{className:"w-4 h-4"})}),e.jsx(Z,{variant:"ghost",size:"sm",onClick:()=>We(oe),className:"text-gray-400 hover:text-[#38bdac] hover:bg-[#38bdac]/10",title:"编辑",children:e.jsx(yt,{className:"w-4 h-4"})}),e.jsx(Z,{variant:"ghost",size:"sm",onClick:()=>st(oe),className:"text-gray-400 hover:text-yellow-400 hover:bg-yellow-400/10",title:"修改密码",children:e.jsx(Mm,{className:"w-4 h-4"})}),e.jsx(Z,{variant:"ghost",size:"sm",className:"text-red-400 hover:text-red-300 hover:bg-red-500/10",onClick:()=>ze(oe.id),title:"删除",children:e.jsx(Gt,{className:"w-4 h-4"})})]})})]},oe.id)}),s.length===0&&e.jsx(Ge,{children:e.jsx(pe,{colSpan:7,className:"text-center py-12 text-gray-500",children:"暂无用户数据"})})]})]}),e.jsx(Ar,{page:c,totalPages:Se,total:l,pageSize:h,onPageChange:d,onPageSizeChange:oe=>{m(oe),d(1)}})]})})})]})}function _2(){var ge;const[s,a]=f.useState("overview"),[l,o]=f.useState([]),[c,d]=f.useState(null),[h,m]=f.useState([]),[p,y]=f.useState([]),[g,v]=f.useState([]),[C,P]=f.useState(!0),[T,S]=f.useState(null),[b,N]=f.useState(""),[E,j]=f.useState("all"),[R,B]=f.useState(1),[U,k]=f.useState(10),[L,_]=f.useState(0),[se,le]=f.useState(new Set),[ie,ee]=f.useState(null),[G,Q]=f.useState(""),[ce,re]=f.useState(!1);f.useEffect(()=>{A()},[]),f.useEffect(()=>{B(1)},[s,E]),f.useEffect(()=>{ne(s)},[s]),f.useEffect(()=>{["orders","bindings","withdrawals"].includes(s)&&ne(s,!0)},[R,U,E,b]);async function A(){S(null);try{const D=await Fe("/api/admin/distribution/overview");D!=null&&D.success&&D.overview&&d(D.overview)}catch(D){console.error("[Admin] 概览接口异常:",D),S("加载概览失败")}try{const D=await Fe("/api/db/users");v((D==null?void 0:D.users)||[])}catch(D){console.error("[Admin] 用户数据加载失败:",D)}}async function ne(D,fe=!1){var Se;if(!(!fe&&se.has(D))){P(!0);try{const ze=g;switch(D){case"overview":break;case"orders":{try{const We=new URLSearchParams({page:String(R),pageSize:String(U),...E!=="all"&&{status:E},...b&&{search:b}}),qe=await Fe(`/api/orders?${We}`);if(qe!=null&&qe.success&&qe.orders){const Ze=qe.orders.map(st=>{const ft=ze.find(Vt=>Vt.id===st.userId),nt=st.referrerId?ze.find(Vt=>Vt.id===st.referrerId):null;return{...st,amount:parseFloat(String(st.amount))||0,userNickname:(ft==null?void 0:ft.nickname)||st.userNickname||"未知用户",userPhone:(ft==null?void 0:ft.phone)||st.userPhone||"-",referrerNickname:(nt==null?void 0:nt.nickname)||null,referrerCode:(nt==null?void 0:nt.referralCode)??null,type:st.productType||st.type}});o(Ze),_(qe.total??Ze.length)}else o([]),_(0)}catch(We){console.error(We),S("加载订单失败"),o([])}break}case"bindings":{try{const We=new URLSearchParams({page:String(R),pageSize:String(U),...E!=="all"&&{status:E}}),qe=await Fe(`/api/db/distribution?${We}`);m((qe==null?void 0:qe.bindings)||[]),_((qe==null?void 0:qe.total)??((Se=qe==null?void 0:qe.bindings)==null?void 0:Se.length)??0)}catch(We){console.error(We),S("加载绑定数据失败"),m([])}break}case"withdrawals":{try{const We=E==="completed"?"success":E==="rejected"?"failed":E,qe=new URLSearchParams({...We&&We!=="all"&&{status:We},page:String(R),pageSize:String(U)}),Ze=await Fe(`/api/admin/withdrawals?${qe}`);if(Ze!=null&&Ze.success&&Ze.withdrawals){const st=Ze.withdrawals.map(ft=>({...ft,account:ft.account??"未绑定微信号",status:ft.status==="success"?"completed":ft.status==="failed"?"rejected":ft.status}));y(st),_((Ze==null?void 0:Ze.total)??st.length)}else Ze!=null&&Ze.success||S(`获取提现记录失败: ${(Ze==null?void 0:Ze.error)||"未知错误"}`),y([])}catch(We){console.error(We),S("加载提现数据失败"),y([])}break}}le(We=>new Set(We).add(D))}catch(ze){console.error(ze)}finally{P(!1)}}}async function W(){S(null),le(D=>{const fe=new Set(D);return fe.delete(s),fe}),s==="overview"&&A(),await ne(s,!0)}async function M(D){if(confirm("确认审核通过并打款?"))try{const fe=await Nt("/api/admin/withdrawals",{id:D,action:"approve"});if(!(fe!=null&&fe.success)){const Se=(fe==null?void 0:fe.message)||(fe==null?void 0:fe.error)||"操作失败";alert(Se);return}await W()}catch(fe){console.error(fe),alert("操作失败")}}async function O(D){const fe=prompt("请输入拒绝原因:");if(fe)try{const Se=await Nt("/api/admin/withdrawals",{id:D,action:"reject",errorMessage:fe});if(!(Se!=null&&Se.success)){alert((Se==null?void 0:Se.error)||"操作失败");return}await W()}catch(Se){console.error(Se),alert("操作失败")}}async function F(){var D;if(!(!(ie!=null&&ie.orderSn)&&!(ie!=null&&ie.id))){re(!0),S(null);try{const fe=await Nt("/api/admin/orders/refund",{orderSn:ie.orderSn||ie.id,reason:G||void 0});fe!=null&&fe.success?(ee(null),Q(""),await ne("orders",!0)):S((fe==null?void 0:fe.error)||"退款失败")}catch(fe){const Se=fe;S(((D=Se==null?void 0:Se.data)==null?void 0:D.error)||"退款失败,请检查网络后重试")}finally{re(!1)}}}function X(D){const fe={active:"bg-green-500/20 text-green-400",converted:"bg-blue-500/20 text-blue-400",expired:"bg-gray-500/20 text-gray-400",cancelled:"bg-red-500/20 text-red-400",pending:"bg-orange-500/20 text-orange-400",pending_confirm:"bg-orange-500/20 text-orange-400",processing:"bg-blue-500/20 text-blue-400",completed:"bg-green-500/20 text-green-400",rejected:"bg-red-500/20 text-red-400"},Se={active:"有效",converted:"已转化",expired:"已过期",cancelled:"已取消",pending:"待审核",pending_confirm:"待用户确认",processing:"处理中",completed:"已完成",rejected:"已拒绝"};return e.jsx(Oe,{className:`${fe[D]||"bg-gray-500/20 text-gray-400"} border-0`,children:Se[D]||D})}const H=Math.ceil(L/U)||1,ue=l,K=h.filter(D=>{var Se,ze,We,qe;if(!b)return!0;const fe=b.toLowerCase();return((Se=D.refereeNickname)==null?void 0:Se.toLowerCase().includes(fe))||((ze=D.refereePhone)==null?void 0:ze.includes(fe))||((We=D.referrerName)==null?void 0:We.toLowerCase().includes(fe))||((qe=D.referrerCode)==null?void 0:qe.toLowerCase().includes(fe))}),ye=p.filter(D=>{var Se;if(!b)return!0;const fe=b.toLowerCase();return((Se=D.userName)==null?void 0:Se.toLowerCase().includes(fe))||D.account&&D.account.toLowerCase().includes(fe)});return e.jsxs("div",{className:"p-8 w-full",children:[T&&e.jsxs("div",{className:"mb-4 px-4 py-3 rounded-lg bg-red-500/20 border border-red-500/50 text-red-400 text-sm flex items-center justify-between",children:[e.jsx("span",{children:T}),e.jsx("button",{type:"button",onClick:()=>S(null),className:"hover:text-red-300",children:"×"})]}),e.jsxs("div",{className:"flex items-center justify-between mb-8",children:[e.jsxs("div",{children:[e.jsx("h1",{className:"text-2xl font-bold text-white",children:"推广中心"}),e.jsx("p",{className:"text-gray-400 mt-1",children:"统一管理:订单、分销绑定、提现审核"})]}),e.jsxs(Z,{onClick:W,disabled:C,variant:"outline",className:"border-gray-700 text-gray-300 hover:bg-gray-800",children:[e.jsx($e,{className:`w-4 h-4 mr-2 ${C?"animate-spin":""}`}),"刷新数据"]})]}),e.jsx("div",{className:"flex gap-2 mb-6 border-b border-gray-700 pb-4",children:[{key:"overview",label:"数据概览",icon:ul},{key:"orders",label:"订单管理",icon:Xi},{key:"bindings",label:"绑定管理",icon:Ys},{key:"withdrawals",label:"提现审核",icon:aa}].map(D=>e.jsxs("button",{type:"button",onClick:()=>{a(D.key),j("all"),N("")},className:`flex items-center gap-2 px-4 py-2 rounded-lg text-sm font-medium transition-colors ${s===D.key?"bg-[#38bdac] text-white":"text-gray-400 hover:text-white hover:bg-gray-800"}`,children:[e.jsx(D.icon,{className:"w-4 h-4"}),D.label]},D.key))}),C?e.jsxs("div",{className:"flex items-center justify-center py-20",children:[e.jsx($e,{className:"w-8 h-8 text-[#38bdac] animate-spin"}),e.jsx("span",{className:"ml-2 text-gray-400",children:"加载中..."})]}):e.jsxs(e.Fragment,{children:[s==="overview"&&c&&e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"grid grid-cols-4 gap-4",children:[e.jsx(Ne,{className:"bg-[#0f2137] border-gray-700/50",children:e.jsx(we,{className:"p-6",children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-gray-400 text-sm",children:"今日点击"}),e.jsx("p",{className:"text-2xl font-bold text-white mt-1",children:c.todayClicks}),e.jsx("p",{className:"text-xs text-gray-500 mt-0.5",children:"总点击次数(实时)"})]}),e.jsx("div",{className:"w-12 h-12 rounded-xl bg-blue-500/20 flex items-center justify-center",children:e.jsx(ds,{className:"w-6 h-6 text-blue-400"})})]})})}),e.jsx(Ne,{className:"bg-[#0f2137] border-gray-700/50",children:e.jsx(we,{className:"p-6",children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-gray-400 text-sm",children:"今日独立用户"}),e.jsx("p",{className:"text-2xl font-bold text-white mt-1",children:c.todayUniqueVisitors??0}),e.jsx("p",{className:"text-xs text-gray-500 mt-0.5",children:"去重访客数(实时)"})]}),e.jsx("div",{className:"w-12 h-12 rounded-xl bg-cyan-500/20 flex items-center justify-center",children:e.jsx(Qt,{className:"w-6 h-6 text-cyan-400"})})]})})}),e.jsx(Ne,{className:"bg-[#0f2137] border-gray-700/50",children:e.jsx(we,{className:"p-6",children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-gray-400 text-sm",children:"今日总文章点击率"}),e.jsx("p",{className:"text-2xl font-bold text-white mt-1",children:(c.todayClickRate??0).toFixed(2)}),e.jsx("p",{className:"text-xs text-gray-500 mt-0.5",children:"人均点击(总点击/独立用户)"})]}),e.jsx("div",{className:"w-12 h-12 rounded-xl bg-amber-500/20 flex items-center justify-center",children:e.jsx(ul,{className:"w-6 h-6 text-amber-400"})})]})})}),e.jsx(Ne,{className:"bg-[#0f2137] border-gray-700/50",children:e.jsx(we,{className:"p-6",children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-gray-400 text-sm",children:"今日绑定"}),e.jsx("p",{className:"text-2xl font-bold text-white mt-1",children:c.todayBindings})]}),e.jsx("div",{className:"w-12 h-12 rounded-xl bg-green-500/20 flex items-center justify-center",children:e.jsx(Ys,{className:"w-6 h-6 text-green-400"})})]})})}),e.jsx(Ne,{className:"bg-[#0f2137] border-gray-700/50",children:e.jsx(we,{className:"p-6",children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-gray-400 text-sm",children:"今日转化"}),e.jsx("p",{className:"text-2xl font-bold text-white mt-1",children:c.todayConversions})]}),e.jsx("div",{className:"w-12 h-12 rounded-xl bg-purple-500/20 flex items-center justify-center",children:e.jsx(Im,{className:"w-6 h-6 text-purple-400"})})]})})}),e.jsx(Ne,{className:"bg-[#0f2137] border-gray-700/50",children:e.jsx(we,{className:"p-6",children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-gray-400 text-sm",children:"今日佣金"}),e.jsxs("p",{className:"text-2xl font-bold text-[#38bdac] mt-1",children:["¥",c.todayEarnings.toFixed(2)]})]}),e.jsx("div",{className:"w-12 h-12 rounded-xl bg-[#38bdac]/20 flex items-center justify-center",children:e.jsx(Xi,{className:"w-6 h-6 text-[#38bdac]"})})]})})})]}),(((ge=c.todayClicksByPage)==null?void 0:ge.length)??0)>0&&e.jsxs(Ne,{className:"bg-[#0f2137] border-gray-700/50",children:[e.jsxs(Ue,{children:[e.jsxs(Ve,{className:"text-white flex items-center gap-2",children:[e.jsx(ds,{className:"w-5 h-5 text-[#38bdac]"}),"每篇文章今日点击(按来源页/文章统计)"]}),e.jsx("p",{className:"text-gray-400 text-sm mt-1",children:"实际用户与实际文章的点击均计入;今日总点击与上表一致"})]}),e.jsx(we,{children:e.jsx("div",{className:"overflow-x-auto",children:e.jsxs("table",{className:"w-full text-sm",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"border-b border-gray-700 text-left text-gray-400",children:[e.jsx("th",{className:"pb-3 pr-4",children:"来源页/文章"}),e.jsx("th",{className:"pb-3 pr-4 text-right",children:"今日点击"}),e.jsx("th",{className:"pb-3 text-right",children:"占比"})]})}),e.jsx("tbody",{children:[...c.todayClicksByPage??[]].sort((D,fe)=>fe.clicks-D.clicks).map((D,fe)=>e.jsxs("tr",{className:"border-b border-gray-700/50",children:[e.jsx("td",{className:"py-2 pr-4 text-white font-mono",children:D.page||"(未区分)"}),e.jsx("td",{className:"py-2 pr-4 text-right text-white",children:D.clicks}),e.jsxs("td",{className:"py-2 text-right text-gray-400",children:[c.todayClicks>0?(D.clicks/c.todayClicks*100).toFixed(1):0,"%"]})]},fe))})]})})})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsx(Ne,{className:"bg-orange-500/10 border-orange-500/30",children:e.jsx(we,{className:"p-6",children:e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsx("div",{className:"w-12 h-12 rounded-xl bg-orange-500/20 flex items-center justify-center",children:e.jsx(Ox,{className:"w-6 h-6 text-orange-400"})}),e.jsxs("div",{className:"flex-1",children:[e.jsx("p",{className:"text-orange-300 font-medium",children:"即将过期绑定"}),e.jsxs("p",{className:"text-2xl font-bold text-white",children:[c.expiringBindings," 个"]}),e.jsx("p",{className:"text-orange-300/60 text-sm",children:"7天内到期,需关注转化"})]})]})})}),e.jsx(Ne,{className:"bg-blue-500/10 border-blue-500/30",children:e.jsx(we,{className:"p-6",children:e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsx("div",{className:"w-12 h-12 rounded-xl bg-blue-500/20 flex items-center justify-center",children:e.jsx(aa,{className:"w-6 h-6 text-blue-400"})}),e.jsxs("div",{className:"flex-1",children:[e.jsx("p",{className:"text-blue-300 font-medium",children:"待审核提现"}),e.jsxs("p",{className:"text-2xl font-bold text-white",children:[c.pendingWithdrawals," 笔"]}),e.jsxs("p",{className:"text-blue-300/60 text-sm",children:["共 ¥",c.pendingWithdrawAmount.toFixed(2)]})]}),e.jsx(Z,{onClick:()=>a("withdrawals"),variant:"outline",className:"border-blue-500/50 text-blue-400 hover:bg-blue-500/20",children:"去审核"})]})})})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-6",children:[e.jsxs(Ne,{className:"bg-[#0f2137] border-gray-700/50",children:[e.jsx(Ue,{children:e.jsxs(Ve,{className:"text-white flex items-center gap-2",children:[e.jsx(qi,{className:"w-5 h-5 text-[#38bdac]"}),"本月统计"]})}),e.jsx(we,{children:e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{className:"p-4 bg-white/5 rounded-lg",children:[e.jsx("p",{className:"text-gray-400 text-sm",children:"点击量"}),e.jsx("p",{className:"text-xl font-bold text-white",children:c.monthClicks})]}),e.jsxs("div",{className:"p-4 bg-white/5 rounded-lg",children:[e.jsx("p",{className:"text-gray-400 text-sm",children:"绑定数"}),e.jsx("p",{className:"text-xl font-bold text-white",children:c.monthBindings})]}),e.jsxs("div",{className:"p-4 bg-white/5 rounded-lg",children:[e.jsx("p",{className:"text-gray-400 text-sm",children:"转化数"}),e.jsx("p",{className:"text-xl font-bold text-white",children:c.monthConversions})]}),e.jsxs("div",{className:"p-4 bg-white/5 rounded-lg",children:[e.jsx("p",{className:"text-gray-400 text-sm",children:"佣金"}),e.jsxs("p",{className:"text-xl font-bold text-[#38bdac]",children:["¥",c.monthEarnings.toFixed(2)]})]})]})})]}),e.jsxs(Ne,{className:"bg-[#0f2137] border-gray-700/50",children:[e.jsx(Ue,{children:e.jsxs(Ve,{className:"text-white flex items-center gap-2",children:[e.jsx(ul,{className:"w-5 h-5 text-[#38bdac]"}),"累计统计"]})}),e.jsxs(we,{children:[e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{className:"p-4 bg-white/5 rounded-lg",children:[e.jsx("p",{className:"text-gray-400 text-sm",children:"总点击"}),e.jsx("p",{className:"text-xl font-bold text-white",children:c.totalClicks.toLocaleString()})]}),e.jsxs("div",{className:"p-4 bg-white/5 rounded-lg",children:[e.jsx("p",{className:"text-gray-400 text-sm",children:"总绑定"}),e.jsx("p",{className:"text-xl font-bold text-white",children:c.totalBindings.toLocaleString()})]}),e.jsxs("div",{className:"p-4 bg-white/5 rounded-lg",children:[e.jsx("p",{className:"text-gray-400 text-sm",children:"总转化"}),e.jsx("p",{className:"text-xl font-bold text-white",children:c.totalConversions})]}),e.jsxs("div",{className:"p-4 bg-white/5 rounded-lg",children:[e.jsx("p",{className:"text-gray-400 text-sm",children:"总佣金"}),e.jsxs("p",{className:"text-xl font-bold text-[#38bdac]",children:["¥",c.totalEarnings.toFixed(2)]})]})]}),e.jsxs("div",{className:"mt-4 p-4 bg-[#38bdac]/10 rounded-lg flex items-center justify-between",children:[e.jsx("span",{className:"text-gray-300",children:"点击转化率"}),e.jsxs("span",{className:"text-[#38bdac] font-bold text-xl",children:[c.conversionRate,"%"]})]})]})]})]}),e.jsxs(Ne,{className:"bg-[#0f2137] border-gray-700/50",children:[e.jsx(Ue,{children:e.jsxs(Ve,{className:"text-white flex items-center gap-2",children:[e.jsx(Qt,{className:"w-5 h-5 text-[#38bdac]"}),"推广统计"]})}),e.jsx(we,{children:e.jsxs("div",{className:"grid grid-cols-4 gap-4",children:[e.jsxs("div",{className:"p-4 bg-white/5 rounded-lg text-center",children:[e.jsx("p",{className:"text-3xl font-bold text-white",children:c.totalDistributors}),e.jsx("p",{className:"text-gray-400 text-sm mt-1",children:"推广用户数"})]}),e.jsxs("div",{className:"p-4 bg-white/5 rounded-lg text-center",children:[e.jsx("p",{className:"text-3xl font-bold text-green-400",children:c.activeDistributors}),e.jsx("p",{className:"text-gray-400 text-sm mt-1",children:"有收益用户"})]}),e.jsxs("div",{className:"p-4 bg-white/5 rounded-lg text-center",children:[e.jsx("p",{className:"text-3xl font-bold text-[#38bdac]",children:"90%"}),e.jsx("p",{className:"text-gray-400 text-sm mt-1",children:"佣金比例"})]}),e.jsxs("div",{className:"p-4 bg-white/5 rounded-lg text-center",children:[e.jsx("p",{className:"text-3xl font-bold text-orange-400",children:"30天"}),e.jsx("p",{className:"text-gray-400 text-sm mt-1",children:"绑定有效期"})]})]})})]})]}),s==="orders"&&e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"flex gap-4",children:[e.jsxs("div",{className:"relative flex-1",children:[e.jsx(yn,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-gray-400"}),e.jsx(de,{value:b,onChange:D=>N(D.target.value),placeholder:"搜索订单号、用户名、手机号...",className:"pl-10 bg-[#0f2137] border-gray-700 text-white"})]}),e.jsxs("select",{value:E,onChange:D=>j(D.target.value),className:"px-4 py-2 bg-[#0f2137] border border-gray-700 rounded-lg text-white",children:[e.jsx("option",{value:"all",children:"全部状态"}),e.jsx("option",{value:"completed",children:"已完成"}),e.jsx("option",{value:"pending",children:"待支付"}),e.jsx("option",{value:"failed",children:"已失败"}),e.jsx("option",{value:"refunded",children:"已退款"})]})]}),e.jsx(Ne,{className:"bg-[#0f2137] border-gray-700/50",children:e.jsxs(we,{className:"p-0",children:[l.length===0?e.jsx("div",{className:"py-12 text-center text-gray-500",children:"暂无订单数据"}):e.jsx("div",{className:"overflow-x-auto",children:e.jsxs("table",{className:"w-full text-sm",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"bg-[#0a1628] text-gray-400",children:[e.jsx("th",{className:"p-4 text-left font-medium",children:"订单号"}),e.jsx("th",{className:"p-4 text-left font-medium",children:"用户"}),e.jsx("th",{className:"p-4 text-left font-medium",children:"商品"}),e.jsx("th",{className:"p-4 text-left font-medium",children:"金额"}),e.jsx("th",{className:"p-4 text-left font-medium",children:"支付方式"}),e.jsx("th",{className:"p-4 text-left font-medium",children:"状态"}),e.jsx("th",{className:"p-4 text-left font-medium",children:"退款原因"}),e.jsx("th",{className:"p-4 text-left font-medium",children:"推荐人/邀请码"}),e.jsx("th",{className:"p-4 text-left font-medium",children:"分销佣金"}),e.jsx("th",{className:"p-4 text-left font-medium",children:"下单时间"}),e.jsx("th",{className:"p-4 text-left font-medium",children:"操作"})]})}),e.jsx("tbody",{className:"divide-y divide-gray-700/50",children:ue.map(D=>{var fe,Se;return e.jsxs("tr",{className:"hover:bg-[#0a1628] transition-colors",children:[e.jsxs("td",{className:"p-4 font-mono text-xs text-gray-400",children:[(fe=D.id)==null?void 0:fe.slice(0,12),"..."]}),e.jsx("td",{className:"p-4",children:e.jsxs("div",{children:[e.jsx("p",{className:"text-white text-sm",children:D.userNickname}),e.jsx("p",{className:"text-gray-500 text-xs",children:D.userPhone})]})}),e.jsx("td",{className:"p-4",children:e.jsxs("div",{children:[e.jsx("p",{className:"text-white text-sm",children:(()=>{const ze=D.productType||D.type;return ze==="fullbook"?`${D.bookName||"《底层逻辑》"} - 全本`:ze==="match"?"匹配次数购买":`${D.bookName||"《底层逻辑》"} - ${D.sectionTitle||D.chapterTitle||`章节${D.productId||D.sectionId||""}`}`})()}),e.jsx("p",{className:"text-gray-500 text-xs",children:(()=>{const ze=D.productType||D.type;return ze==="fullbook"?"全书解锁":ze==="match"?"功能权益":D.chapterTitle||"单章购买"})()})]})}),e.jsxs("td",{className:"p-4 text-[#38bdac] font-bold",children:["¥",typeof D.amount=="number"?D.amount.toFixed(2):parseFloat(String(D.amount||"0")).toFixed(2)]}),e.jsx("td",{className:"p-4 text-gray-300",children:D.paymentMethod==="wechat"?"微信支付":D.paymentMethod==="alipay"?"支付宝":D.paymentMethod||"微信支付"}),e.jsx("td",{className:"p-4",children:D.status==="refunded"?e.jsx(Oe,{className:"bg-gray-500/20 text-gray-400 border-0",children:"已退款"}):D.status==="completed"||D.status==="paid"?e.jsx(Oe,{className:"bg-green-500/20 text-green-400 border-0",children:"已完成"}):D.status==="pending"||D.status==="created"?e.jsx(Oe,{className:"bg-yellow-500/20 text-yellow-400 border-0",children:"待支付"}):e.jsx(Oe,{className:"bg-red-500/20 text-red-400 border-0",children:"已失败"})}),e.jsx("td",{className:"p-4 text-gray-400 text-sm max-w-[120px]",title:D.refundReason,children:D.status==="refunded"&&D.refundReason?D.refundReason:"-"}),e.jsx("td",{className:"p-4 text-gray-300 text-sm",children:D.referrerId||D.referralCode?e.jsxs("span",{title:D.referralCode||D.referrerCode||D.referrerId||"",children:[D.referrerNickname||D.referralCode||D.referrerCode||((Se=D.referrerId)==null?void 0:Se.slice(0,8)),(D.referralCode||D.referrerCode)&&` (${D.referralCode||D.referrerCode})`]}):"-"}),e.jsx("td",{className:"p-4 text-[#FFD700]",children:D.referrerEarnings?`¥${(typeof D.referrerEarnings=="number"?D.referrerEarnings:parseFloat(String(D.referrerEarnings))).toFixed(2)}`:"-"}),e.jsx("td",{className:"p-4 text-gray-400 text-sm",children:D.createdAt?new Date(D.createdAt).toLocaleString("zh-CN"):"-"}),e.jsx("td",{className:"p-4",children:(D.status==="paid"||D.status==="completed")&&e.jsxs(Z,{variant:"outline",size:"sm",className:"border-orange-500/50 text-orange-400 hover:bg-orange-500/20",onClick:()=>{ee(D),Q("")},children:[e.jsx(Bx,{className:"w-3 h-3 mr-1"}),"退款"]})})]},D.id)})})]})}),s==="orders"&&e.jsx(Ar,{page:R,totalPages:H,total:L,pageSize:U,onPageChange:B,onPageSizeChange:D=>{k(D),B(1)}})]})})]}),s==="bindings"&&e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"flex gap-4",children:[e.jsxs("div",{className:"relative flex-1",children:[e.jsx(yn,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-gray-400"}),e.jsx(de,{value:b,onChange:D=>N(D.target.value),placeholder:"搜索用户昵称、手机号、推广码...",className:"pl-10 bg-[#0f2137] border-gray-700 text-white"})]}),e.jsxs("select",{value:E,onChange:D=>j(D.target.value),className:"px-4 py-2 bg-[#0f2137] border border-gray-700 rounded-lg text-white",children:[e.jsx("option",{value:"all",children:"全部状态"}),e.jsx("option",{value:"active",children:"有效"}),e.jsx("option",{value:"converted",children:"已转化"}),e.jsx("option",{value:"expired",children:"已过期"})]})]}),e.jsx(Ne,{className:"bg-[#0f2137] border-gray-700/50",children:e.jsxs(we,{className:"p-0",children:[K.length===0?e.jsx("div",{className:"py-12 text-center text-gray-500",children:"暂无绑定数据"}):e.jsx("div",{className:"overflow-x-auto",children:e.jsxs("table",{className:"w-full text-sm",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"bg-[#0a1628] text-gray-400",children:[e.jsx("th",{className:"p-4 text-left font-medium",children:"访客"}),e.jsx("th",{className:"p-4 text-left font-medium",children:"分销商"}),e.jsx("th",{className:"p-4 text-left font-medium",children:"绑定时间"}),e.jsx("th",{className:"p-4 text-left font-medium",children:"到期时间"}),e.jsx("th",{className:"p-4 text-left font-medium",children:"状态"}),e.jsx("th",{className:"p-4 text-left font-medium",children:"佣金"})]})}),e.jsx("tbody",{className:"divide-y divide-gray-700/50",children:K.map(D=>e.jsxs("tr",{className:"hover:bg-[#0a1628] transition-colors",children:[e.jsx("td",{className:"p-4",children:e.jsxs("div",{children:[e.jsx("p",{className:"text-white font-medium",children:D.refereeNickname||"匿名用户"}),e.jsx("p",{className:"text-gray-500 text-xs",children:D.refereePhone})]})}),e.jsx("td",{className:"p-4",children:e.jsxs("div",{children:[e.jsx("p",{className:"text-white",children:D.referrerName||"-"}),e.jsx("p",{className:"text-gray-500 text-xs font-mono",children:D.referrerCode})]})}),e.jsx("td",{className:"p-4 text-gray-400",children:D.boundAt?new Date(D.boundAt).toLocaleDateString("zh-CN"):"-"}),e.jsx("td",{className:"p-4 text-gray-400",children:D.expiresAt?new Date(D.expiresAt).toLocaleDateString("zh-CN"):"-"}),e.jsx("td",{className:"p-4",children:X(D.status)}),e.jsx("td",{className:"p-4",children:D.commission?e.jsxs("span",{className:"text-[#38bdac] font-medium",children:["¥",D.commission.toFixed(2)]}):e.jsx("span",{className:"text-gray-500",children:"-"})})]},D.id))})]})}),s==="bindings"&&e.jsx(Ar,{page:R,totalPages:H,total:L,pageSize:U,onPageChange:B,onPageSizeChange:D=>{k(D),B(1)}})]})})]}),s==="withdrawals"&&e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"flex gap-4",children:[e.jsxs("div",{className:"relative flex-1",children:[e.jsx(yn,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-gray-400"}),e.jsx(de,{value:b,onChange:D=>N(D.target.value),placeholder:"搜索用户名称、账号...",className:"pl-10 bg-[#0f2137] border-gray-700 text-white"})]}),e.jsxs("select",{value:E,onChange:D=>j(D.target.value),className:"px-4 py-2 bg-[#0f2137] border border-gray-700 rounded-lg text-white",children:[e.jsx("option",{value:"all",children:"全部状态"}),e.jsx("option",{value:"pending",children:"待审核"}),e.jsx("option",{value:"completed",children:"已完成"}),e.jsx("option",{value:"rejected",children:"已拒绝"})]})]}),e.jsx(Ne,{className:"bg-[#0f2137] border-gray-700/50",children:e.jsxs(we,{className:"p-0",children:[ye.length===0?e.jsx("div",{className:"py-12 text-center text-gray-500",children:"暂无提现记录"}):e.jsx("div",{className:"overflow-x-auto",children:e.jsxs("table",{className:"w-full text-sm",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"bg-[#0a1628] text-gray-400",children:[e.jsx("th",{className:"p-4 text-left font-medium",children:"申请人"}),e.jsx("th",{className:"p-4 text-left font-medium",children:"金额"}),e.jsx("th",{className:"p-4 text-left font-medium",children:"收款方式"}),e.jsx("th",{className:"p-4 text-left font-medium",children:"收款账号"}),e.jsx("th",{className:"p-4 text-left font-medium",children:"申请时间"}),e.jsx("th",{className:"p-4 text-left font-medium",children:"状态"}),e.jsx("th",{className:"p-4 text-right font-medium",children:"操作"})]})}),e.jsx("tbody",{className:"divide-y divide-gray-700/50",children:ye.map(D=>e.jsxs("tr",{className:"hover:bg-[#0a1628] transition-colors",children:[e.jsx("td",{className:"p-4",children:e.jsxs("div",{className:"flex items-center gap-2",children:[D.userAvatar?e.jsx("img",{src:D.userAvatar,alt:"",className:"w-8 h-8 rounded-full object-cover"}):e.jsx("div",{className:"w-8 h-8 rounded-full bg-gray-600 flex items-center justify-center text-white text-sm font-medium",children:(D.userName||D.name||"?").slice(0,1)}),e.jsx("p",{className:"text-white font-medium",children:D.userName||D.name})]})}),e.jsx("td",{className:"p-4",children:e.jsxs("span",{className:"text-[#38bdac] font-bold",children:["¥",D.amount.toFixed(2)]})}),e.jsx("td",{className:"p-4",children:e.jsx(Oe,{className:D.method==="wechat"?"bg-green-500/20 text-green-400 border-0":"bg-blue-500/20 text-blue-400 border-0",children:D.method==="wechat"?"微信":"支付宝"})}),e.jsx("td",{className:"p-4",children:e.jsxs("div",{children:[e.jsx("p",{className:"text-white font-mono text-xs",children:D.account}),e.jsx("p",{className:"text-gray-500 text-xs",children:D.name})]})}),e.jsx("td",{className:"p-4 text-gray-400",children:D.createdAt?new Date(D.createdAt).toLocaleString("zh-CN"):"-"}),e.jsx("td",{className:"p-4",children:X(D.status)}),e.jsx("td",{className:"p-4 text-right",children:D.status==="pending"&&e.jsxs("div",{className:"flex gap-2 justify-end",children:[e.jsxs(Z,{size:"sm",onClick:()=>M(D.id),className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:[e.jsx(Im,{className:"w-4 h-4 mr-1"}),"通过"]}),e.jsxs(Z,{size:"sm",variant:"outline",onClick:()=>O(D.id),className:"border-red-500/50 text-red-400 hover:bg-red-500/20",children:[e.jsx(Lx,{className:"w-4 h-4 mr-1"}),"拒绝"]})]})})]},D.id))})]})}),s==="withdrawals"&&e.jsx(Ar,{page:R,totalPages:H,total:L,pageSize:U,onPageChange:B,onPageSizeChange:D=>{k(D),B(1)}})]})})]})]}),e.jsx(wt,{open:!!ie,onOpenChange:D=>!D&&ee(null),children:e.jsxs(vt,{className:"bg-[#0f2137] border-gray-700 text-white max-w-md",children:[e.jsx(St,{children:e.jsx(Ct,{className:"text-white",children:"订单退款"})}),ie&&e.jsxs("div",{className:"space-y-4",children:[e.jsxs("p",{className:"text-gray-400 text-sm",children:["订单号:",ie.orderSn||ie.id]}),e.jsxs("p",{className:"text-gray-400 text-sm",children:["退款金额:¥",typeof ie.amount=="number"?ie.amount.toFixed(2):parseFloat(String(ie.amount||"0")).toFixed(2)]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-sm text-gray-400 block mb-2",children:"退款原因(选填)"}),e.jsx("div",{className:"form-input",children:e.jsx(de,{className:"bg-[#0a1628] border-gray-700 text-white placeholder:text-gray-500",placeholder:"如:用户申请退款",value:G,onChange:D=>Q(D.target.value)})})]}),e.jsx("p",{className:"text-orange-400/80 text-xs",children:"退款将原路退回至用户微信,且无法撤销,请确认后再操作。"})]}),e.jsxs(Ft,{children:[e.jsx(Z,{variant:"outline",className:"border-gray-600 text-gray-300",onClick:()=>ee(null),disabled:ce,children:"取消"}),e.jsx(Z,{className:"bg-orange-500 hover:bg-orange-600 text-white",onClick:F,disabled:ce,children:ce?"退款中...":"确认退款"})]})]})})]})}function M2(){const[s,a]=f.useState([]),[l,o]=f.useState({total:0,pendingCount:0,pendingAmount:0,successCount:0,successAmount:0,failedCount:0}),[c,d]=f.useState(!0),[h,m]=f.useState(null),[p,y]=f.useState("all"),[g,v]=f.useState(1),[C,P]=f.useState(10),[T,S]=f.useState(0),[b,N]=f.useState(null);async function E(){var k,L,_,se,le,ie,ee;d(!0),m(null);try{const G=new URLSearchParams({status:p,page:String(g),pageSize:String(C)}),Q=await Fe(`/api/admin/withdrawals?${G}`);if(Q!=null&&Q.success){const ce=Q.withdrawals||[];a(ce),S(Q.total??((k=Q.stats)==null?void 0:k.total)??ce.length),o({total:((L=Q.stats)==null?void 0:L.total)??Q.total??ce.length,pendingCount:((_=Q.stats)==null?void 0:_.pendingCount)??0,pendingAmount:((se=Q.stats)==null?void 0:se.pendingAmount)??0,successCount:((le=Q.stats)==null?void 0:le.successCount)??0,successAmount:((ie=Q.stats)==null?void 0:ie.successAmount)??0,failedCount:((ee=Q.stats)==null?void 0:ee.failedCount)??0})}else m("加载提现记录失败")}catch(G){console.error("Load withdrawals error:",G),m("加载失败,请检查网络后重试")}finally{d(!1)}}f.useEffect(()=>{v(1)},[p]),f.useEffect(()=>{E()},[p,g,C]);const j=Math.ceil(T/C)||1;async function R(k){const L=s.find(_=>_.id===k);if(L!=null&&L.userCommissionInfo&&L.userCommissionInfo.availableAfterThis<0){if(!confirm(`⚠️ 风险警告:该用户审核后余额为负数(¥${L.userCommissionInfo.availableAfterThis.toFixed(2)}),可能存在超额提现。 + +确认已核实用户账户并完成打款?`))return}else if(!confirm("确认已完成打款?批准后将更新用户提现记录。"))return;N(k);try{const _=await Nt("/api/admin/withdrawals",{id:k,action:"approve"});_!=null&&_.success?E():alert("操作失败: "+((_==null?void 0:_.error)??""))}catch{alert("操作失败")}finally{N(null)}}async function B(k){const L=prompt("请输入拒绝原因(将返还用户余额):");if(L){N(k);try{const _=await Nt("/api/admin/withdrawals",{id:k,action:"reject",errorMessage:L});_!=null&&_.success?E():alert("操作失败: "+((_==null?void 0:_.error)??""))}catch{alert("操作失败")}finally{N(null)}}}function U(k){switch(k){case"pending":return e.jsx(Oe,{className:"bg-orange-500/20 text-orange-400 hover:bg-orange-500/20 border-0",children:"待处理"});case"pending_confirm":return e.jsx(Oe,{className:"bg-orange-500/20 text-orange-400 hover:bg-orange-500/20 border-0",children:"待用户确认"});case"processing":return e.jsx(Oe,{className:"bg-blue-500/20 text-blue-400 hover:bg-blue-500/20 border-0",children:"已审批等待打款"});case"success":case"completed":return e.jsx(Oe,{className:"bg-green-500/20 text-green-400 hover:bg-green-500/20 border-0",children:"已完成"});case"failed":case"rejected":return e.jsx(Oe,{className:"bg-red-500/20 text-red-400 hover:bg-red-500/20 border-0",children:"已拒绝"});default:return e.jsx(Oe,{className:"bg-gray-500/20 text-gray-400 border-0",children:k})}}return e.jsxs("div",{className:"p-8 w-full",children:[h&&e.jsxs("div",{className:"mb-4 px-4 py-3 rounded-lg bg-red-500/20 border border-red-500/50 text-red-400 text-sm flex items-center justify-between",children:[e.jsx("span",{children:h}),e.jsx("button",{type:"button",onClick:()=>m(null),className:"hover:text-red-300",children:"×"})]}),e.jsxs("div",{className:"flex justify-between items-start mb-8",children:[e.jsxs("div",{children:[e.jsx("h1",{className:"text-2xl font-bold text-white",children:"分账提现管理"}),e.jsx("p",{className:"text-gray-400 mt-1",children:"管理用户分销收益的提现申请"})]}),e.jsxs(Z,{variant:"outline",onClick:E,disabled:c,className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:[e.jsx($e,{className:`w-4 h-4 mr-2 ${c?"animate-spin":""}`}),"刷新"]})]}),e.jsx(Ne,{className:"bg-gradient-to-r from-[#38bdac]/10 to-[#0f2137] border-[#38bdac]/30 mb-6",children:e.jsx(we,{className:"p-4",children:e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx(Xi,{className:"w-5 h-5 text-[#38bdac] mt-0.5"}),e.jsxs("div",{children:[e.jsx("h3",{className:"text-white font-medium mb-2",children:"自动分账规则"}),e.jsxs("div",{className:"text-sm text-gray-400 space-y-1",children:[e.jsxs("p",{children:["• ",e.jsx("span",{className:"text-[#38bdac]",children:"分销比例"}),":推广者获得订单金额的"," ",e.jsx("span",{className:"text-white font-medium",children:"90%"})]}),e.jsxs("p",{children:["• ",e.jsx("span",{className:"text-[#38bdac]",children:"结算方式"}),":用户付款后,分销收益自动计入推广者账户"]}),e.jsxs("p",{children:["• ",e.jsx("span",{className:"text-[#38bdac]",children:"提现方式"}),":用户在小程序端点击提现,系统自动转账到微信零钱"]}),e.jsxs("p",{children:["• ",e.jsx("span",{className:"text-[#38bdac]",children:"审批流程"}),":待处理的提现需管理员手动确认打款后批准"]})]})]})]})})}),e.jsxs("div",{className:"grid grid-cols-4 gap-4 mb-6",children:[e.jsx(Ne,{className:"bg-[#0f2137] border-gray-700/50",children:e.jsxs(we,{className:"p-4 text-center",children:[e.jsx("div",{className:"text-3xl font-bold text-[#38bdac]",children:l.total}),e.jsx("div",{className:"text-sm text-gray-400",children:"总申请"})]})}),e.jsx(Ne,{className:"bg-[#0f2137] border-gray-700/50",children:e.jsxs(we,{className:"p-4 text-center",children:[e.jsx("div",{className:"text-3xl font-bold text-orange-400",children:l.pendingCount}),e.jsx("div",{className:"text-sm text-gray-400",children:"待处理"}),e.jsxs("div",{className:"text-xs text-orange-400 mt-1",children:["¥",l.pendingAmount.toFixed(2)]})]})}),e.jsx(Ne,{className:"bg-[#0f2137] border-gray-700/50",children:e.jsxs(we,{className:"p-4 text-center",children:[e.jsx("div",{className:"text-3xl font-bold text-green-400",children:l.successCount}),e.jsx("div",{className:"text-sm text-gray-400",children:"已完成"}),e.jsxs("div",{className:"text-xs text-green-400 mt-1",children:["¥",l.successAmount.toFixed(2)]})]})}),e.jsx(Ne,{className:"bg-[#0f2137] border-gray-700/50",children:e.jsxs(we,{className:"p-4 text-center",children:[e.jsx("div",{className:"text-3xl font-bold text-red-400",children:l.failedCount}),e.jsx("div",{className:"text-sm text-gray-400",children:"已拒绝"})]})})]}),e.jsx("div",{className:"flex gap-2 mb-4",children:["all","pending","success","failed"].map(k=>e.jsx(Z,{variant:p===k?"default":"outline",size:"sm",onClick:()=>y(k),className:p===k?"bg-[#38bdac] hover:bg-[#2da396] text-white":"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:k==="all"?"全部":k==="pending"?"待处理":k==="success"?"已完成":"已拒绝"},k))}),e.jsx(Ne,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:e.jsx(we,{className:"p-0",children:c?e.jsxs("div",{className:"flex items-center justify-center py-12",children:[e.jsx($e,{className:"w-6 h-6 text-[#38bdac] animate-spin"}),e.jsx("span",{className:"ml-2 text-gray-400",children:"加载中..."})]}):s.length===0?e.jsxs("div",{className:"text-center py-12",children:[e.jsx(aa,{className:"w-12 h-12 text-gray-600 mx-auto mb-3"}),e.jsx("p",{className:"text-gray-500",children:"暂无提现记录"})]}):e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"overflow-x-auto",children:e.jsxs("table",{className:"w-full text-sm",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"bg-[#0a1628] text-gray-400",children:[e.jsx("th",{className:"p-4 text-left font-medium",children:"申请时间"}),e.jsx("th",{className:"p-4 text-left font-medium",children:"用户"}),e.jsx("th",{className:"p-4 text-left font-medium",children:"提现金额"}),e.jsx("th",{className:"p-4 text-left font-medium",children:"用户佣金信息"}),e.jsx("th",{className:"p-4 text-left font-medium",children:"状态"}),e.jsx("th",{className:"p-4 text-left font-medium",children:"处理时间"}),e.jsx("th",{className:"p-4 text-left font-medium",children:"确认收款"}),e.jsx("th",{className:"p-4 text-right font-medium",children:"操作"})]})}),e.jsx("tbody",{className:"divide-y divide-gray-700/50",children:s.map(k=>e.jsxs("tr",{className:"hover:bg-[#0a1628] transition-colors",children:[e.jsx("td",{className:"p-4 text-gray-400",children:new Date(k.createdAt??"").toLocaleString()}),e.jsx("td",{className:"p-4",children:e.jsxs("div",{className:"flex items-center gap-2",children:[k.userAvatar?e.jsx("img",{src:k.userAvatar,alt:k.userName??"",className:"w-8 h-8 rounded-full object-cover"}):e.jsx("div",{className:"w-8 h-8 rounded-full bg-[#38bdac]/20 flex items-center justify-center text-sm text-[#38bdac]",children:(k.userName??"?").charAt(0)}),e.jsxs("div",{children:[e.jsx("p",{className:"font-medium text-white",children:k.userName??"未知"}),e.jsx("p",{className:"text-xs text-gray-500",children:k.userPhone??k.referralCode??(k.userId??"").slice(0,10)})]})]})}),e.jsx("td",{className:"p-4",children:e.jsxs("span",{className:"font-bold text-orange-400",children:["¥",Number(k.amount).toFixed(2)]})}),e.jsx("td",{className:"p-4",children:k.userCommissionInfo?e.jsxs("div",{className:"text-xs space-y-1",children:[e.jsxs("div",{className:"flex justify-between gap-4",children:[e.jsx("span",{className:"text-gray-500",children:"累计佣金:"}),e.jsxs("span",{className:"text-[#38bdac] font-medium",children:["¥",k.userCommissionInfo.totalCommission.toFixed(2)]})]}),e.jsxs("div",{className:"flex justify-between gap-4",children:[e.jsx("span",{className:"text-gray-500",children:"已提现:"}),e.jsxs("span",{className:"text-gray-400",children:["¥",k.userCommissionInfo.withdrawnEarnings.toFixed(2)]})]}),e.jsxs("div",{className:"flex justify-between gap-4",children:[e.jsx("span",{className:"text-gray-500",children:"待审核:"}),e.jsxs("span",{className:"text-orange-400",children:["¥",k.userCommissionInfo.pendingWithdrawals.toFixed(2)]})]}),e.jsxs("div",{className:"flex justify-between gap-4 pt-1 border-t border-gray-700/30",children:[e.jsx("span",{className:"text-gray-500",children:"审核后余额:"}),e.jsxs("span",{className:k.userCommissionInfo.availableAfterThis>=0?"text-green-400 font-medium":"text-red-400 font-medium",children:["¥",k.userCommissionInfo.availableAfterThis.toFixed(2)]})]})]}):e.jsx("span",{className:"text-gray-500 text-xs",children:"暂无数据"})}),e.jsxs("td",{className:"p-4",children:[U(k.status),k.errorMessage&&e.jsx("p",{className:"text-xs text-red-400 mt-1",children:k.errorMessage})]}),e.jsx("td",{className:"p-4 text-gray-400",children:k.processedAt?new Date(k.processedAt).toLocaleString():"-"}),e.jsx("td",{className:"p-4 text-gray-400",children:k.userConfirmedAt?e.jsxs("span",{className:"text-green-400",title:k.userConfirmedAt,children:["已确认 ",new Date(k.userConfirmedAt).toLocaleString()]}):"-"}),e.jsxs("td",{className:"p-4 text-right",children:[(k.status==="pending"||k.status==="pending_confirm")&&e.jsxs("div",{className:"flex items-center justify-end gap-2",children:[e.jsxs(Z,{size:"sm",onClick:()=>R(k.id),disabled:b===k.id,className:"bg-green-600 hover:bg-green-700 text-white",children:[e.jsx(fo,{className:"w-4 h-4 mr-1"}),"批准"]}),e.jsxs(Z,{size:"sm",variant:"outline",onClick:()=>B(k.id),disabled:b===k.id,className:"border-red-500/50 text-red-400 hover:bg-red-500/10 bg-transparent",children:[e.jsx(Sr,{className:"w-4 h-4 mr-1"}),"拒绝"]})]}),(k.status==="success"||k.status==="completed")&&k.transactionId&&e.jsx("span",{className:"text-xs text-gray-500 font-mono",children:k.transactionId})]})]},k.id))})]})}),e.jsx(Ar,{page:g,totalPages:j,total:T,pageSize:C,onPageChange:v,onPageSizeChange:k=>{P(k),v(1)}})]})})})]})}const jn=f.forwardRef(({className:s,...a},l)=>e.jsx("textarea",{className:tt("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",s),ref:l,...a}));jn.displayName="Textarea";function no(s,[a,l]){return Math.min(l,Math.max(a,s))}const A2=["top","right","bottom","left"],qs=Math.min,xr=Math.max,ao=Math.round,Wi=Math.floor,Gr=s=>({x:s,y:s}),D2={left:"right",right:"left",bottom:"top",top:"bottom"},L2={start:"end",end:"start"};function Gd(s,a,l){return xr(s,qs(a,l))}function hs(s,a){return typeof s=="function"?s(a):s}function fs(s){return s.split("-")[0]}function fa(s){return s.split("-")[1]}function Pu(s){return s==="x"?"y":"x"}function Tu(s){return s==="y"?"height":"width"}const O2=new Set(["top","bottom"]);function Yr(s){return O2.has(fs(s))?"y":"x"}function Ru(s){return Pu(Yr(s))}function F2(s,a,l){l===void 0&&(l=!1);const o=fa(s),c=Ru(s),d=Tu(c);let h=c==="x"?o===(l?"end":"start")?"right":"left":o==="start"?"bottom":"top";return a.reference[d]>a.floating[d]&&(h=lo(h)),[h,lo(h)]}function z2(s){const a=lo(s);return[Qd(s),a,Qd(a)]}function Qd(s){return s.replace(/start|end/g,a=>L2[a])}const sx=["left","right"],nx=["right","left"],$2=["top","bottom"],B2=["bottom","top"];function U2(s,a,l){switch(s){case"top":case"bottom":return l?a?nx:sx:a?sx:nx;case"left":case"right":return a?$2:B2;default:return[]}}function V2(s,a,l,o){const c=fa(s);let d=U2(fs(s),l==="start",o);return c&&(d=d.map(h=>h+"-"+c),a&&(d=d.concat(d.map(Qd)))),d}function lo(s){return s.replace(/left|right|bottom|top/g,a=>D2[a])}function W2(s){return{top:0,right:0,bottom:0,left:0,...s}}function og(s){return typeof s!="number"?W2(s):{top:s,right:s,bottom:s,left:s}}function io(s){const{x:a,y:l,width:o,height:c}=s;return{width:o,height:c,top:l,left:a,right:a+o,bottom:l+c,x:a,y:l}}function ax(s,a,l){let{reference:o,floating:c}=s;const d=Yr(a),h=Ru(a),m=Tu(h),p=fs(a),y=d==="y",g=o.x+o.width/2-c.width/2,v=o.y+o.height/2-c.height/2,C=o[m]/2-c[m]/2;let P;switch(p){case"top":P={x:g,y:o.y-c.height};break;case"bottom":P={x:g,y:o.y+o.height};break;case"right":P={x:o.x+o.width,y:v};break;case"left":P={x:o.x-c.width,y:v};break;default:P={x:o.x,y:o.y}}switch(fa(a)){case"start":P[h]-=C*(l&&y?-1:1);break;case"end":P[h]+=C*(l&&y?-1:1);break}return P}async function H2(s,a){var l;a===void 0&&(a={});const{x:o,y:c,platform:d,rects:h,elements:m,strategy:p}=s,{boundary:y="clippingAncestors",rootBoundary:g="viewport",elementContext:v="floating",altBoundary:C=!1,padding:P=0}=hs(a,s),T=og(P),b=m[C?v==="floating"?"reference":"floating":v],N=io(await d.getClippingRect({element:(l=await(d.isElement==null?void 0:d.isElement(b)))==null||l?b:b.contextElement||await(d.getDocumentElement==null?void 0:d.getDocumentElement(m.floating)),boundary:y,rootBoundary:g,strategy:p})),E=v==="floating"?{x:o,y:c,width:h.floating.width,height:h.floating.height}:h.reference,j=await(d.getOffsetParent==null?void 0:d.getOffsetParent(m.floating)),R=await(d.isElement==null?void 0:d.isElement(j))?await(d.getScale==null?void 0:d.getScale(j))||{x:1,y:1}:{x:1,y:1},B=io(d.convertOffsetParentRelativeRectToViewportRelativeRect?await d.convertOffsetParentRelativeRectToViewportRelativeRect({elements:m,rect:E,offsetParent:j,strategy:p}):E);return{top:(N.top-B.top+T.top)/R.y,bottom:(B.bottom-N.bottom+T.bottom)/R.y,left:(N.left-B.left+T.left)/R.x,right:(B.right-N.right+T.right)/R.x}}const K2=async(s,a,l)=>{const{placement:o="bottom",strategy:c="absolute",middleware:d=[],platform:h}=l,m=d.filter(Boolean),p=await(h.isRTL==null?void 0:h.isRTL(a));let y=await h.getElementRects({reference:s,floating:a,strategy:c}),{x:g,y:v}=ax(y,o,p),C=o,P={},T=0;for(let b=0;b({name:"arrow",options:s,async fn(a){const{x:l,y:o,placement:c,rects:d,platform:h,elements:m,middlewareData:p}=a,{element:y,padding:g=0}=hs(s,a)||{};if(y==null)return{};const v=og(g),C={x:l,y:o},P=Ru(c),T=Tu(P),S=await h.getDimensions(y),b=P==="y",N=b?"top":"left",E=b?"bottom":"right",j=b?"clientHeight":"clientWidth",R=d.reference[T]+d.reference[P]-C[P]-d.floating[T],B=C[P]-d.reference[P],U=await(h.getOffsetParent==null?void 0:h.getOffsetParent(y));let k=U?U[j]:0;(!k||!await(h.isElement==null?void 0:h.isElement(U)))&&(k=m.floating[j]||d.floating[T]);const L=R/2-B/2,_=k/2-S[T]/2-1,se=qs(v[N],_),le=qs(v[E],_),ie=se,ee=k-S[T]-le,G=k/2-S[T]/2+L,Q=Gd(ie,G,ee),ce=!p.arrow&&fa(c)!=null&&G!==Q&&d.reference[T]/2-(GG<=0)){var le,ie;const G=(((le=d.flip)==null?void 0:le.index)||0)+1,Q=k[G];if(Q&&(!(v==="alignment"?E!==Yr(Q):!1)||se.every(A=>Yr(A.placement)===E?A.overflows[0]>0:!0)))return{data:{index:G,overflows:se},reset:{placement:Q}};let ce=(ie=se.filter(re=>re.overflows[0]<=0).sort((re,A)=>re.overflows[1]-A.overflows[1])[0])==null?void 0:ie.placement;if(!ce)switch(P){case"bestFit":{var ee;const re=(ee=se.filter(A=>{if(U){const ne=Yr(A.placement);return ne===E||ne==="y"}return!0}).map(A=>[A.placement,A.overflows.filter(ne=>ne>0).reduce((ne,W)=>ne+W,0)]).sort((A,ne)=>A[1]-ne[1])[0])==null?void 0:ee[0];re&&(ce=re);break}case"initialPlacement":ce=m;break}if(c!==ce)return{reset:{placement:ce}}}return{}}}};function lx(s,a){return{top:s.top-a.height,right:s.right-a.width,bottom:s.bottom-a.height,left:s.left-a.width}}function ix(s){return A2.some(a=>s[a]>=0)}const Q2=function(s){return s===void 0&&(s={}),{name:"hide",options:s,async fn(a){const{rects:l,platform:o}=a,{strategy:c="referenceHidden",...d}=hs(s,a);switch(c){case"referenceHidden":{const h=await o.detectOverflow(a,{...d,elementContext:"reference"}),m=lx(h,l.reference);return{data:{referenceHiddenOffsets:m,referenceHidden:ix(m)}}}case"escaped":{const h=await o.detectOverflow(a,{...d,altBoundary:!0}),m=lx(h,l.floating);return{data:{escapedOffsets:m,escaped:ix(m)}}}default:return{}}}}},cg=new Set(["left","top"]);async function q2(s,a){const{placement:l,platform:o,elements:c}=s,d=await(o.isRTL==null?void 0:o.isRTL(c.floating)),h=fs(l),m=fa(l),p=Yr(l)==="y",y=cg.has(h)?-1:1,g=d&&p?-1:1,v=hs(a,s);let{mainAxis:C,crossAxis:P,alignmentAxis:T}=typeof v=="number"?{mainAxis:v,crossAxis:0,alignmentAxis:null}:{mainAxis:v.mainAxis||0,crossAxis:v.crossAxis||0,alignmentAxis:v.alignmentAxis};return m&&typeof T=="number"&&(P=m==="end"?T*-1:T),p?{x:P*g,y:C*y}:{x:C*y,y:P*g}}const X2=function(s){return s===void 0&&(s=0),{name:"offset",options:s,async fn(a){var l,o;const{x:c,y:d,placement:h,middlewareData:m}=a,p=await q2(a,s);return h===((l=m.offset)==null?void 0:l.placement)&&(o=m.arrow)!=null&&o.alignmentOffset?{}:{x:c+p.x,y:d+p.y,data:{...p,placement:h}}}}},J2=function(s){return s===void 0&&(s={}),{name:"shift",options:s,async fn(a){const{x:l,y:o,placement:c,platform:d}=a,{mainAxis:h=!0,crossAxis:m=!1,limiter:p={fn:N=>{let{x:E,y:j}=N;return{x:E,y:j}}},...y}=hs(s,a),g={x:l,y:o},v=await d.detectOverflow(a,y),C=Yr(fs(c)),P=Pu(C);let T=g[P],S=g[C];if(h){const N=P==="y"?"top":"left",E=P==="y"?"bottom":"right",j=T+v[N],R=T-v[E];T=Gd(j,T,R)}if(m){const N=C==="y"?"top":"left",E=C==="y"?"bottom":"right",j=S+v[N],R=S-v[E];S=Gd(j,S,R)}const b=p.fn({...a,[P]:T,[C]:S});return{...b,data:{x:b.x-l,y:b.y-o,enabled:{[P]:h,[C]:m}}}}}},Z2=function(s){return s===void 0&&(s={}),{options:s,fn(a){const{x:l,y:o,placement:c,rects:d,middlewareData:h}=a,{offset:m=0,mainAxis:p=!0,crossAxis:y=!0}=hs(s,a),g={x:l,y:o},v=Yr(c),C=Pu(v);let P=g[C],T=g[v];const S=hs(m,a),b=typeof S=="number"?{mainAxis:S,crossAxis:0}:{mainAxis:0,crossAxis:0,...S};if(p){const j=C==="y"?"height":"width",R=d.reference[C]-d.floating[j]+b.mainAxis,B=d.reference[C]+d.reference[j]-b.mainAxis;PB&&(P=B)}if(y){var N,E;const j=C==="y"?"width":"height",R=cg.has(fs(c)),B=d.reference[v]-d.floating[j]+(R&&((N=h.offset)==null?void 0:N[v])||0)+(R?0:b.crossAxis),U=d.reference[v]+d.reference[j]+(R?0:((E=h.offset)==null?void 0:E[v])||0)-(R?b.crossAxis:0);TU&&(T=U)}return{[C]:P,[v]:T}}}},eS=function(s){return s===void 0&&(s={}),{name:"size",options:s,async fn(a){var l,o;const{placement:c,rects:d,platform:h,elements:m}=a,{apply:p=()=>{},...y}=hs(s,a),g=await h.detectOverflow(a,y),v=fs(c),C=fa(c),P=Yr(c)==="y",{width:T,height:S}=d.floating;let b,N;v==="top"||v==="bottom"?(b=v,N=C===(await(h.isRTL==null?void 0:h.isRTL(m.floating))?"start":"end")?"left":"right"):(N=v,b=C==="end"?"top":"bottom");const E=S-g.top-g.bottom,j=T-g.left-g.right,R=qs(S-g[b],E),B=qs(T-g[N],j),U=!a.middlewareData.shift;let k=R,L=B;if((l=a.middlewareData.shift)!=null&&l.enabled.x&&(L=j),(o=a.middlewareData.shift)!=null&&o.enabled.y&&(k=E),U&&!C){const se=xr(g.left,0),le=xr(g.right,0),ie=xr(g.top,0),ee=xr(g.bottom,0);P?L=T-2*(se!==0||le!==0?se+le:xr(g.left,g.right)):k=S-2*(ie!==0||ee!==0?ie+ee:xr(g.top,g.bottom))}await p({...a,availableWidth:L,availableHeight:k});const _=await h.getDimensions(m.floating);return T!==_.width||S!==_.height?{reset:{rects:!0}}:{}}}};function No(){return typeof window<"u"}function ma(s){return dg(s)?(s.nodeName||"").toLowerCase():"#document"}function pr(s){var a;return(s==null||(a=s.ownerDocument)==null?void 0:a.defaultView)||window}function qr(s){var a;return(a=(dg(s)?s.ownerDocument:s.document)||window.document)==null?void 0:a.documentElement}function dg(s){return No()?s instanceof Node||s instanceof pr(s).Node:!1}function Dr(s){return No()?s instanceof Element||s instanceof pr(s).Element:!1}function Qr(s){return No()?s instanceof HTMLElement||s instanceof pr(s).HTMLElement:!1}function ox(s){return!No()||typeof ShadowRoot>"u"?!1:s instanceof ShadowRoot||s instanceof pr(s).ShadowRoot}const tS=new Set(["inline","contents"]);function bl(s){const{overflow:a,overflowX:l,overflowY:o,display:c}=Lr(s);return/auto|scroll|overlay|hidden|clip/.test(a+o+l)&&!tS.has(c)}const rS=new Set(["table","td","th"]);function sS(s){return rS.has(ma(s))}const nS=[":popover-open",":modal"];function wo(s){return nS.some(a=>{try{return s.matches(a)}catch{return!1}})}const aS=["transform","translate","scale","rotate","perspective"],lS=["transform","translate","scale","rotate","perspective","filter"],iS=["paint","layout","strict","content"];function Iu(s){const a=_u(),l=Dr(s)?Lr(s):s;return aS.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)||lS.some(o=>(l.willChange||"").includes(o))||iS.some(o=>(l.contain||"").includes(o))}function oS(s){let a=Xs(s);for(;Qr(a)&&!ia(a);){if(Iu(a))return a;if(wo(a))return null;a=Xs(a)}return null}function _u(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const cS=new Set(["html","body","#document"]);function ia(s){return cS.has(ma(s))}function Lr(s){return pr(s).getComputedStyle(s)}function So(s){return Dr(s)?{scrollLeft:s.scrollLeft,scrollTop:s.scrollTop}:{scrollLeft:s.scrollX,scrollTop:s.scrollY}}function Xs(s){if(ma(s)==="html")return s;const a=s.assignedSlot||s.parentNode||ox(s)&&s.host||qr(s);return ox(a)?a.host:a}function ug(s){const a=Xs(s);return ia(a)?s.ownerDocument?s.ownerDocument.body:s.body:Qr(a)&&bl(a)?a:ug(a)}function pl(s,a,l){var o;a===void 0&&(a=[]),l===void 0&&(l=!0);const c=ug(s),d=c===((o=s.ownerDocument)==null?void 0:o.body),h=pr(c);if(d){const m=qd(h);return a.concat(h,h.visualViewport||[],bl(c)?c:[],m&&l?pl(m):[])}return a.concat(c,pl(c,[],l))}function qd(s){return s.parent&&Object.getPrototypeOf(s.parent)?s.frameElement:null}function hg(s){const a=Lr(s);let l=parseFloat(a.width)||0,o=parseFloat(a.height)||0;const c=Qr(s),d=c?s.offsetWidth:l,h=c?s.offsetHeight:o,m=ao(l)!==d||ao(o)!==h;return m&&(l=d,o=h),{width:l,height:o,$:m}}function Mu(s){return Dr(s)?s:s.contextElement}function na(s){const a=Mu(s);if(!Qr(a))return Gr(1);const l=a.getBoundingClientRect(),{width:o,height:c,$:d}=hg(a);let h=(d?ao(l.width):l.width)/o,m=(d?ao(l.height):l.height)/c;return(!h||!Number.isFinite(h))&&(h=1),(!m||!Number.isFinite(m))&&(m=1),{x:h,y:m}}const dS=Gr(0);function fg(s){const a=pr(s);return!_u()||!a.visualViewport?dS:{x:a.visualViewport.offsetLeft,y:a.visualViewport.offsetTop}}function uS(s,a,l){return a===void 0&&(a=!1),!l||a&&l!==pr(s)?!1:a}function wn(s,a,l,o){a===void 0&&(a=!1),l===void 0&&(l=!1);const c=s.getBoundingClientRect(),d=Mu(s);let h=Gr(1);a&&(o?Dr(o)&&(h=na(o)):h=na(s));const m=uS(d,l,o)?fg(d):Gr(0);let p=(c.left+m.x)/h.x,y=(c.top+m.y)/h.y,g=c.width/h.x,v=c.height/h.y;if(d){const C=pr(d),P=o&&Dr(o)?pr(o):o;let T=C,S=qd(T);for(;S&&o&&P!==T;){const b=na(S),N=S.getBoundingClientRect(),E=Lr(S),j=N.left+(S.clientLeft+parseFloat(E.paddingLeft))*b.x,R=N.top+(S.clientTop+parseFloat(E.paddingTop))*b.y;p*=b.x,y*=b.y,g*=b.x,v*=b.y,p+=j,y+=R,T=pr(S),S=qd(T)}}return io({width:g,height:v,x:p,y})}function Co(s,a){const l=So(s).scrollLeft;return a?a.left+l:wn(qr(s)).left+l}function mg(s,a){const l=s.getBoundingClientRect(),o=l.left+a.scrollLeft-Co(s,l),c=l.top+a.scrollTop;return{x:o,y:c}}function hS(s){let{elements:a,rect:l,offsetParent:o,strategy:c}=s;const d=c==="fixed",h=qr(o),m=a?wo(a.floating):!1;if(o===h||m&&d)return l;let p={scrollLeft:0,scrollTop:0},y=Gr(1);const g=Gr(0),v=Qr(o);if((v||!v&&!d)&&((ma(o)!=="body"||bl(h))&&(p=So(o)),Qr(o))){const P=wn(o);y=na(o),g.x=P.x+o.clientLeft,g.y=P.y+o.clientTop}const C=h&&!v&&!d?mg(h,p):Gr(0);return{width:l.width*y.x,height:l.height*y.y,x:l.x*y.x-p.scrollLeft*y.x+g.x+C.x,y:l.y*y.y-p.scrollTop*y.y+g.y+C.y}}function fS(s){return Array.from(s.getClientRects())}function mS(s){const a=qr(s),l=So(s),o=s.ownerDocument.body,c=xr(a.scrollWidth,a.clientWidth,o.scrollWidth,o.clientWidth),d=xr(a.scrollHeight,a.clientHeight,o.scrollHeight,o.clientHeight);let h=-l.scrollLeft+Co(s);const m=-l.scrollTop;return Lr(o).direction==="rtl"&&(h+=xr(a.clientWidth,o.clientWidth)-c),{width:c,height:d,x:h,y:m}}const cx=25;function xS(s,a){const l=pr(s),o=qr(s),c=l.visualViewport;let d=o.clientWidth,h=o.clientHeight,m=0,p=0;if(c){d=c.width,h=c.height;const g=_u();(!g||g&&a==="fixed")&&(m=c.offsetLeft,p=c.offsetTop)}const y=Co(o);if(y<=0){const g=o.ownerDocument,v=g.body,C=getComputedStyle(v),P=g.compatMode==="CSS1Compat"&&parseFloat(C.marginLeft)+parseFloat(C.marginRight)||0,T=Math.abs(o.clientWidth-v.clientWidth-P);T<=cx&&(d-=T)}else y<=cx&&(d+=y);return{width:d,height:h,x:m,y:p}}const pS=new Set(["absolute","fixed"]);function gS(s,a){const l=wn(s,!0,a==="fixed"),o=l.top+s.clientTop,c=l.left+s.clientLeft,d=Qr(s)?na(s):Gr(1),h=s.clientWidth*d.x,m=s.clientHeight*d.y,p=c*d.x,y=o*d.y;return{width:h,height:m,x:p,y}}function dx(s,a,l){let o;if(a==="viewport")o=xS(s,l);else if(a==="document")o=mS(qr(s));else if(Dr(a))o=gS(a,l);else{const c=fg(s);o={x:a.x-c.x,y:a.y-c.y,width:a.width,height:a.height}}return io(o)}function xg(s,a){const l=Xs(s);return l===a||!Dr(l)||ia(l)?!1:Lr(l).position==="fixed"||xg(l,a)}function yS(s,a){const l=a.get(s);if(l)return l;let o=pl(s,[],!1).filter(m=>Dr(m)&&ma(m)!=="body"),c=null;const d=Lr(s).position==="fixed";let h=d?Xs(s):s;for(;Dr(h)&&!ia(h);){const m=Lr(h),p=Iu(h);!p&&m.position==="fixed"&&(c=null),(d?!p&&!c:!p&&m.position==="static"&&!!c&&pS.has(c.position)||bl(h)&&!p&&xg(s,h))?o=o.filter(g=>g!==h):c=m,h=Xs(h)}return a.set(s,o),o}function vS(s){let{element:a,boundary:l,rootBoundary:o,strategy:c}=s;const h=[...l==="clippingAncestors"?wo(a)?[]:yS(a,this._c):[].concat(l),o],m=h[0],p=h.reduce((y,g)=>{const v=dx(a,g,c);return y.top=xr(v.top,y.top),y.right=qs(v.right,y.right),y.bottom=qs(v.bottom,y.bottom),y.left=xr(v.left,y.left),y},dx(a,m,c));return{width:p.right-p.left,height:p.bottom-p.top,x:p.left,y:p.top}}function jS(s){const{width:a,height:l}=hg(s);return{width:a,height:l}}function bS(s,a,l){const o=Qr(a),c=qr(a),d=l==="fixed",h=wn(s,!0,d,a);let m={scrollLeft:0,scrollTop:0};const p=Gr(0);function y(){p.x=Co(c)}if(o||!o&&!d)if((ma(a)!=="body"||bl(c))&&(m=So(a)),o){const P=wn(a,!0,d,a);p.x=P.x+a.clientLeft,p.y=P.y+a.clientTop}else c&&y();d&&!o&&c&&y();const g=c&&!o&&!d?mg(c,m):Gr(0),v=h.left+m.scrollLeft-p.x-g.x,C=h.top+m.scrollTop-p.y-g.y;return{x:v,y:C,width:h.width,height:h.height}}function _d(s){return Lr(s).position==="static"}function ux(s,a){if(!Qr(s)||Lr(s).position==="fixed")return null;if(a)return a(s);let l=s.offsetParent;return qr(s)===l&&(l=l.ownerDocument.body),l}function pg(s,a){const l=pr(s);if(wo(s))return l;if(!Qr(s)){let c=Xs(s);for(;c&&!ia(c);){if(Dr(c)&&!_d(c))return c;c=Xs(c)}return l}let o=ux(s,a);for(;o&&sS(o)&&_d(o);)o=ux(o,a);return o&&ia(o)&&_d(o)&&!Iu(o)?l:o||oS(s)||l}const NS=async function(s){const a=this.getOffsetParent||pg,l=this.getDimensions,o=await l(s.floating);return{reference:bS(s.reference,await a(s.floating),s.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}};function wS(s){return Lr(s).direction==="rtl"}const SS={convertOffsetParentRelativeRectToViewportRelativeRect:hS,getDocumentElement:qr,getClippingRect:vS,getOffsetParent:pg,getElementRects:NS,getClientRects:fS,getDimensions:jS,getScale:na,isElement:Dr,isRTL:wS};function gg(s,a){return s.x===a.x&&s.y===a.y&&s.width===a.width&&s.height===a.height}function CS(s,a){let l=null,o;const c=qr(s);function d(){var m;clearTimeout(o),(m=l)==null||m.disconnect(),l=null}function h(m,p){m===void 0&&(m=!1),p===void 0&&(p=1),d();const y=s.getBoundingClientRect(),{left:g,top:v,width:C,height:P}=y;if(m||a(),!C||!P)return;const T=Wi(v),S=Wi(c.clientWidth-(g+C)),b=Wi(c.clientHeight-(v+P)),N=Wi(g),j={rootMargin:-T+"px "+-S+"px "+-b+"px "+-N+"px",threshold:xr(0,qs(1,p))||1};let R=!0;function B(U){const k=U[0].intersectionRatio;if(k!==p){if(!R)return h();k?h(!1,k):o=setTimeout(()=>{h(!1,1e-7)},1e3)}k===1&&!gg(y,s.getBoundingClientRect())&&h(),R=!1}try{l=new IntersectionObserver(B,{...j,root:c.ownerDocument})}catch{l=new IntersectionObserver(B,j)}l.observe(s)}return h(!0),d}function kS(s,a,l,o){o===void 0&&(o={});const{ancestorScroll:c=!0,ancestorResize:d=!0,elementResize:h=typeof ResizeObserver=="function",layoutShift:m=typeof IntersectionObserver=="function",animationFrame:p=!1}=o,y=Mu(s),g=c||d?[...y?pl(y):[],...pl(a)]:[];g.forEach(N=>{c&&N.addEventListener("scroll",l,{passive:!0}),d&&N.addEventListener("resize",l)});const v=y&&m?CS(y,l):null;let C=-1,P=null;h&&(P=new ResizeObserver(N=>{let[E]=N;E&&E.target===y&&P&&(P.unobserve(a),cancelAnimationFrame(C),C=requestAnimationFrame(()=>{var j;(j=P)==null||j.observe(a)})),l()}),y&&!p&&P.observe(y),P.observe(a));let T,S=p?wn(s):null;p&&b();function b(){const N=wn(s);S&&!gg(S,N)&&l(),S=N,T=requestAnimationFrame(b)}return l(),()=>{var N;g.forEach(E=>{c&&E.removeEventListener("scroll",l),d&&E.removeEventListener("resize",l)}),v==null||v(),(N=P)==null||N.disconnect(),P=null,p&&cancelAnimationFrame(T)}}const ES=X2,PS=J2,TS=G2,RS=eS,IS=Q2,hx=Y2,_S=Z2,MS=(s,a,l)=>{const o=new Map,c={platform:SS,...l},d={...c.platform,_c:o};return K2(s,a,{...c,platform:d})};var AS=typeof document<"u",DS=function(){},Gi=AS?f.useLayoutEffect:DS;function oo(s,a){if(s===a)return!0;if(typeof s!=typeof a)return!1;if(typeof s=="function"&&s.toString()===a.toString())return!0;let l,o,c;if(s&&a&&typeof s=="object"){if(Array.isArray(s)){if(l=s.length,l!==a.length)return!1;for(o=l;o--!==0;)if(!oo(s[o],a[o]))return!1;return!0}if(c=Object.keys(s),l=c.length,l!==Object.keys(a).length)return!1;for(o=l;o--!==0;)if(!{}.hasOwnProperty.call(a,c[o]))return!1;for(o=l;o--!==0;){const d=c[o];if(!(d==="_owner"&&s.$$typeof)&&!oo(s[d],a[d]))return!1}return!0}return s!==s&&a!==a}function yg(s){return typeof window>"u"?1:(s.ownerDocument.defaultView||window).devicePixelRatio||1}function fx(s,a){const l=yg(s);return Math.round(a*l)/l}function Md(s){const a=f.useRef(s);return Gi(()=>{a.current=s}),a}function LS(s){s===void 0&&(s={});const{placement:a="bottom",strategy:l="absolute",middleware:o=[],platform:c,elements:{reference:d,floating:h}={},transform:m=!0,whileElementsMounted:p,open:y}=s,[g,v]=f.useState({x:0,y:0,strategy:l,placement:a,middlewareData:{},isPositioned:!1}),[C,P]=f.useState(o);oo(C,o)||P(o);const[T,S]=f.useState(null),[b,N]=f.useState(null),E=f.useCallback(A=>{A!==U.current&&(U.current=A,S(A))},[]),j=f.useCallback(A=>{A!==k.current&&(k.current=A,N(A))},[]),R=d||T,B=h||b,U=f.useRef(null),k=f.useRef(null),L=f.useRef(g),_=p!=null,se=Md(p),le=Md(c),ie=Md(y),ee=f.useCallback(()=>{if(!U.current||!k.current)return;const A={placement:a,strategy:l,middleware:C};le.current&&(A.platform=le.current),MS(U.current,k.current,A).then(ne=>{const W={...ne,isPositioned:ie.current!==!1};G.current&&!oo(L.current,W)&&(L.current=W,gl.flushSync(()=>{v(W)}))})},[C,a,l,le,ie]);Gi(()=>{y===!1&&L.current.isPositioned&&(L.current.isPositioned=!1,v(A=>({...A,isPositioned:!1})))},[y]);const G=f.useRef(!1);Gi(()=>(G.current=!0,()=>{G.current=!1}),[]),Gi(()=>{if(R&&(U.current=R),B&&(k.current=B),R&&B){if(se.current)return se.current(R,B,ee);ee()}},[R,B,ee,se,_]);const Q=f.useMemo(()=>({reference:U,floating:k,setReference:E,setFloating:j}),[E,j]),ce=f.useMemo(()=>({reference:R,floating:B}),[R,B]),re=f.useMemo(()=>{const A={position:l,left:0,top:0};if(!ce.floating)return A;const ne=fx(ce.floating,g.x),W=fx(ce.floating,g.y);return m?{...A,transform:"translate("+ne+"px, "+W+"px)",...yg(ce.floating)>=1.5&&{willChange:"transform"}}:{position:l,left:ne,top:W}},[l,m,ce.floating,g.x,g.y]);return f.useMemo(()=>({...g,update:ee,refs:Q,elements:ce,floatingStyles:re}),[g,ee,Q,ce,re])}const OS=s=>{function a(l){return{}.hasOwnProperty.call(l,"current")}return{name:"arrow",options:s,fn(l){const{element:o,padding:c}=typeof s=="function"?s(l):s;return o&&a(o)?o.current!=null?hx({element:o.current,padding:c}).fn(l):{}:o?hx({element:o,padding:c}).fn(l):{}}}},FS=(s,a)=>({...ES(s),options:[s,a]}),zS=(s,a)=>({...PS(s),options:[s,a]}),$S=(s,a)=>({..._S(s),options:[s,a]}),BS=(s,a)=>({...TS(s),options:[s,a]}),US=(s,a)=>({...RS(s),options:[s,a]}),VS=(s,a)=>({...IS(s),options:[s,a]}),WS=(s,a)=>({...OS(s),options:[s,a]});var HS="Arrow",vg=f.forwardRef((s,a)=>{const{children:l,width:o=10,height:c=5,...d}=s;return e.jsx(Ke.svg,{...d,ref:a,width:o,height:c,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:s.asChild?l:e.jsx("polygon",{points:"0,0 30,0 15,10"})})});vg.displayName=HS;var KS=vg,Au="Popper",[jg,bg]=en(Au),[YS,Ng]=jg(Au),wg=s=>{const{__scopePopper:a,children:l}=s,[o,c]=f.useState(null);return e.jsx(YS,{scope:a,anchor:o,onAnchorChange:c,children:l})};wg.displayName=Au;var Sg="PopperAnchor",Cg=f.forwardRef((s,a)=>{const{__scopePopper:l,virtualRef:o,...c}=s,d=Ng(Sg,l),h=f.useRef(null),m=et(a,h),p=f.useRef(null);return f.useEffect(()=>{const y=p.current;p.current=(o==null?void 0:o.current)||h.current,y!==p.current&&d.onAnchorChange(p.current)}),o?null:e.jsx(Ke.div,{...c,ref:m})});Cg.displayName=Sg;var Du="PopperContent",[GS,QS]=jg(Du),kg=f.forwardRef((s,a)=>{var K,ye,ge,D,fe,Se;const{__scopePopper:l,side:o="bottom",sideOffset:c=0,align:d="center",alignOffset:h=0,arrowPadding:m=0,avoidCollisions:p=!0,collisionBoundary:y=[],collisionPadding:g=0,sticky:v="partial",hideWhenDetached:C=!1,updatePositionStrategy:P="optimized",onPlaced:T,...S}=s,b=Ng(Du,l),[N,E]=f.useState(null),j=et(a,ze=>E(ze)),[R,B]=f.useState(null),U=Cu(R),k=(U==null?void 0:U.width)??0,L=(U==null?void 0:U.height)??0,_=o+(d!=="center"?"-"+d:""),se=typeof g=="number"?g:{top:0,right:0,bottom:0,left:0,...g},le=Array.isArray(y)?y:[y],ie=le.length>0,ee={padding:se,boundary:le.filter(XS),altBoundary:ie},{refs:G,floatingStyles:Q,placement:ce,isPositioned:re,middlewareData:A}=LS({strategy:"fixed",placement:_,whileElementsMounted:(...ze)=>kS(...ze,{animationFrame:P==="always"}),elements:{reference:b.anchor},middleware:[FS({mainAxis:c+L,alignmentAxis:h}),p&&zS({mainAxis:!0,crossAxis:!1,limiter:v==="partial"?$S():void 0,...ee}),p&&BS({...ee}),US({...ee,apply:({elements:ze,rects:We,availableWidth:qe,availableHeight:Ze})=>{const{width:st,height:ft}=We.reference,nt=ze.floating.style;nt.setProperty("--radix-popper-available-width",`${qe}px`),nt.setProperty("--radix-popper-available-height",`${Ze}px`),nt.setProperty("--radix-popper-anchor-width",`${st}px`),nt.setProperty("--radix-popper-anchor-height",`${ft}px`)}}),R&&WS({element:R,padding:m}),JS({arrowWidth:k,arrowHeight:L}),C&&VS({strategy:"referenceHidden",...ee})]}),[ne,W]=Tg(ce),M=Qs(T);qt(()=>{re&&(M==null||M())},[re,M]);const O=(K=A.arrow)==null?void 0:K.x,F=(ye=A.arrow)==null?void 0:ye.y,X=((ge=A.arrow)==null?void 0:ge.centerOffset)!==0,[H,ue]=f.useState();return qt(()=>{N&&ue(window.getComputedStyle(N).zIndex)},[N]),e.jsx("div",{ref:G.setFloating,"data-radix-popper-content-wrapper":"",style:{...Q,transform:re?Q.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:H,"--radix-popper-transform-origin":[(D=A.transformOrigin)==null?void 0:D.x,(fe=A.transformOrigin)==null?void 0:fe.y].join(" "),...((Se=A.hide)==null?void 0:Se.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:s.dir,children:e.jsx(GS,{scope:l,placedSide:ne,onArrowChange:B,arrowX:O,arrowY:F,shouldHideArrow:X,children:e.jsx(Ke.div,{"data-side":ne,"data-align":W,...S,ref:j,style:{...S.style,animation:re?void 0:"none"}})})})});kg.displayName=Du;var Eg="PopperArrow",qS={top:"bottom",right:"left",bottom:"top",left:"right"},Pg=f.forwardRef(function(a,l){const{__scopePopper:o,...c}=a,d=QS(Eg,o),h=qS[d.placedSide];return e.jsx("span",{ref:d.onArrowChange,style:{position:"absolute",left:d.arrowX,top:d.arrowY,[h]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[d.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[d.placedSide],visibility:d.shouldHideArrow?"hidden":void 0},children:e.jsx(KS,{...c,ref:l,style:{...c.style,display:"block"}})})});Pg.displayName=Eg;function XS(s){return s!==null}var JS=s=>({name:"transformOrigin",options:s,fn(a){var b,N,E;const{placement:l,rects:o,middlewareData:c}=a,h=((b=c.arrow)==null?void 0:b.centerOffset)!==0,m=h?0:s.arrowWidth,p=h?0:s.arrowHeight,[y,g]=Tg(l),v={start:"0%",center:"50%",end:"100%"}[g],C=(((N=c.arrow)==null?void 0:N.x)??0)+m/2,P=(((E=c.arrow)==null?void 0:E.y)??0)+p/2;let T="",S="";return y==="bottom"?(T=h?v:`${C}px`,S=`${-p}px`):y==="top"?(T=h?v:`${C}px`,S=`${o.floating.height+p}px`):y==="right"?(T=`${-p}px`,S=h?v:`${P}px`):y==="left"&&(T=`${o.floating.width+p}px`,S=h?v:`${P}px`),{data:{x:T,y:S}}}});function Tg(s){const[a,l="center"]=s.split("-");return[a,l]}var ZS=wg,eC=Cg,tC=kg,rC=Pg,Rg=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),sC="VisuallyHidden",nC=f.forwardRef((s,a)=>e.jsx(Ke.span,{...s,ref:a,style:{...Rg,...s.style}}));nC.displayName=sC;var aC=[" ","Enter","ArrowUp","ArrowDown"],lC=[" ","Enter"],Sn="Select",[ko,Eo,iC]=ku(Sn),[xa]=en(Sn,[iC,bg]),Po=bg(),[oC,tn]=xa(Sn),[cC,dC]=xa(Sn),Ig=s=>{const{__scopeSelect:a,children:l,open:o,defaultOpen:c,onOpenChange:d,value:h,defaultValue:m,onValueChange:p,dir:y,name:g,autoComplete:v,disabled:C,required:P,form:T}=s,S=Po(a),[b,N]=f.useState(null),[E,j]=f.useState(null),[R,B]=f.useState(!1),U=vo(y),[k,L]=bn({prop:o,defaultProp:c??!1,onChange:d,caller:Sn}),[_,se]=bn({prop:h,defaultProp:m,onChange:p,caller:Sn}),le=f.useRef(null),ie=b?T||!!b.closest("form"):!0,[ee,G]=f.useState(new Set),Q=Array.from(ee).map(ce=>ce.props.value).join(";");return e.jsx(ZS,{...S,children:e.jsxs(oC,{required:P,scope:a,trigger:b,onTriggerChange:N,valueNode:E,onValueNodeChange:j,valueNodeHasChildren:R,onValueNodeHasChildrenChange:B,contentId:Gs(),value:_,onValueChange:se,open:k,onOpenChange:L,dir:U,triggerPointerDownPosRef:le,disabled:C,children:[e.jsx(ko.Provider,{scope:a,children:e.jsx(cC,{scope:s.__scopeSelect,onNativeOptionAdd:f.useCallback(ce=>{G(re=>new Set(re).add(ce))},[]),onNativeOptionRemove:f.useCallback(ce=>{G(re=>{const A=new Set(re);return A.delete(ce),A})},[]),children:l})}),ie?e.jsxs(Zg,{"aria-hidden":!0,required:P,tabIndex:-1,name:g,autoComplete:v,value:_,onChange:ce=>se(ce.target.value),disabled:C,form:T,children:[_===void 0?e.jsx("option",{value:""}):null,Array.from(ee)]},Q):null]})})};Ig.displayName=Sn;var _g="SelectTrigger",Mg=f.forwardRef((s,a)=>{const{__scopeSelect:l,disabled:o=!1,...c}=s,d=Po(l),h=tn(_g,l),m=h.disabled||o,p=et(a,h.onTriggerChange),y=Eo(l),g=f.useRef("touch"),[v,C,P]=t0(S=>{const b=y().filter(j=>!j.disabled),N=b.find(j=>j.value===h.value),E=r0(b,S,N);E!==void 0&&h.onValueChange(E.value)}),T=S=>{m||(h.onOpenChange(!0),P()),S&&(h.triggerPointerDownPosRef.current={x:Math.round(S.pageX),y:Math.round(S.pageY)})};return e.jsx(eC,{asChild:!0,...d,children:e.jsx(Ke.button,{type:"button",role:"combobox","aria-controls":h.contentId,"aria-expanded":h.open,"aria-required":h.required,"aria-autocomplete":"none",dir:h.dir,"data-state":h.open?"open":"closed",disabled:m,"data-disabled":m?"":void 0,"data-placeholder":e0(h.value)?"":void 0,...c,ref:p,onClick:Be(c.onClick,S=>{S.currentTarget.focus(),g.current!=="mouse"&&T(S)}),onPointerDown:Be(c.onPointerDown,S=>{g.current=S.pointerType;const b=S.target;b.hasPointerCapture(S.pointerId)&&b.releasePointerCapture(S.pointerId),S.button===0&&S.ctrlKey===!1&&S.pointerType==="mouse"&&(T(S),S.preventDefault())}),onKeyDown:Be(c.onKeyDown,S=>{const b=v.current!=="";!(S.ctrlKey||S.altKey||S.metaKey)&&S.key.length===1&&C(S.key),!(b&&S.key===" ")&&aC.includes(S.key)&&(T(),S.preventDefault())})})})});Mg.displayName=_g;var Ag="SelectValue",Dg=f.forwardRef((s,a)=>{const{__scopeSelect:l,className:o,style:c,children:d,placeholder:h="",...m}=s,p=tn(Ag,l),{onValueNodeHasChildrenChange:y}=p,g=d!==void 0,v=et(a,p.onValueNodeChange);return qt(()=>{y(g)},[y,g]),e.jsx(Ke.span,{...m,ref:v,style:{pointerEvents:"none"},children:e0(p.value)?e.jsx(e.Fragment,{children:h}):d})});Dg.displayName=Ag;var uC="SelectIcon",Lg=f.forwardRef((s,a)=>{const{__scopeSelect:l,children:o,...c}=s;return e.jsx(Ke.span,{"aria-hidden":!0,...c,ref:a,children:o||"▼"})});Lg.displayName=uC;var hC="SelectPortal",Og=s=>e.jsx(yu,{asChild:!0,...s});Og.displayName=hC;var Cn="SelectContent",Fg=f.forwardRef((s,a)=>{const l=tn(Cn,s.__scopeSelect),[o,c]=f.useState();if(qt(()=>{c(new DocumentFragment)},[]),!l.open){const d=o;return d?gl.createPortal(e.jsx(zg,{scope:s.__scopeSelect,children:e.jsx(ko.Slot,{scope:s.__scopeSelect,children:e.jsx("div",{children:s.children})})}),d):null}return e.jsx($g,{...s,ref:a})});Fg.displayName=Cn;var Mr=10,[zg,rn]=xa(Cn),fC="SelectContentImpl",mC=xl("SelectContent.RemoveScroll"),$g=f.forwardRef((s,a)=>{const{__scopeSelect:l,position:o="item-aligned",onCloseAutoFocus:c,onEscapeKeyDown:d,onPointerDownOutside:h,side:m,sideOffset:p,align:y,alignOffset:g,arrowPadding:v,collisionBoundary:C,collisionPadding:P,sticky:T,hideWhenDetached:S,avoidCollisions:b,...N}=s,E=tn(Cn,l),[j,R]=f.useState(null),[B,U]=f.useState(null),k=et(a,K=>R(K)),[L,_]=f.useState(null),[se,le]=f.useState(null),ie=Eo(l),[ee,G]=f.useState(!1),Q=f.useRef(!1);f.useEffect(()=>{if(j)return yp(j)},[j]),cp();const ce=f.useCallback(K=>{const[ye,...ge]=ie().map(Se=>Se.ref.current),[D]=ge.slice(-1),fe=document.activeElement;for(const Se of K)if(Se===fe||(Se==null||Se.scrollIntoView({block:"nearest"}),Se===ye&&B&&(B.scrollTop=0),Se===D&&B&&(B.scrollTop=B.scrollHeight),Se==null||Se.focus(),document.activeElement!==fe))return},[ie,B]),re=f.useCallback(()=>ce([L,j]),[ce,L,j]);f.useEffect(()=>{ee&&re()},[ee,re]);const{onOpenChange:A,triggerPointerDownPosRef:ne}=E;f.useEffect(()=>{if(j){let K={x:0,y:0};const ye=D=>{var fe,Se;K={x:Math.abs(Math.round(D.pageX)-(((fe=ne.current)==null?void 0:fe.x)??0)),y:Math.abs(Math.round(D.pageY)-(((Se=ne.current)==null?void 0:Se.y)??0))}},ge=D=>{K.x<=10&&K.y<=10?D.preventDefault():j.contains(D.target)||A(!1),document.removeEventListener("pointermove",ye),ne.current=null};return ne.current!==null&&(document.addEventListener("pointermove",ye),document.addEventListener("pointerup",ge,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",ye),document.removeEventListener("pointerup",ge,{capture:!0})}}},[j,A,ne]),f.useEffect(()=>{const K=()=>A(!1);return window.addEventListener("blur",K),window.addEventListener("resize",K),()=>{window.removeEventListener("blur",K),window.removeEventListener("resize",K)}},[A]);const[W,M]=t0(K=>{const ye=ie().filter(fe=>!fe.disabled),ge=ye.find(fe=>fe.ref.current===document.activeElement),D=r0(ye,K,ge);D&&setTimeout(()=>D.ref.current.focus())}),O=f.useCallback((K,ye,ge)=>{const D=!Q.current&&!ge;(E.value!==void 0&&E.value===ye||D)&&(_(K),D&&(Q.current=!0))},[E.value]),F=f.useCallback(()=>j==null?void 0:j.focus(),[j]),X=f.useCallback((K,ye,ge)=>{const D=!Q.current&&!ge;(E.value!==void 0&&E.value===ye||D)&&le(K)},[E.value]),H=o==="popper"?Xd:Bg,ue=H===Xd?{side:m,sideOffset:p,align:y,alignOffset:g,arrowPadding:v,collisionBoundary:C,collisionPadding:P,sticky:T,hideWhenDetached:S,avoidCollisions:b}:{};return e.jsx(zg,{scope:l,content:j,viewport:B,onViewportChange:U,itemRefCallback:O,selectedItem:L,onItemLeave:F,itemTextRefCallback:X,focusSelectedItem:re,selectedItemText:se,position:o,isPositioned:ee,searchRef:W,children:e.jsx(vu,{as:mC,allowPinchZoom:!0,children:e.jsx(gu,{asChild:!0,trapped:E.open,onMountAutoFocus:K=>{K.preventDefault()},onUnmountAutoFocus:Be(c,K=>{var ye;(ye=E.trigger)==null||ye.focus({preventScroll:!0}),K.preventDefault()}),children:e.jsx(pu,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:d,onPointerDownOutside:h,onFocusOutside:K=>K.preventDefault(),onDismiss:()=>E.onOpenChange(!1),children:e.jsx(H,{role:"listbox",id:E.contentId,"data-state":E.open?"open":"closed",dir:E.dir,onContextMenu:K=>K.preventDefault(),...N,...ue,onPlaced:()=>G(!0),ref:k,style:{display:"flex",flexDirection:"column",outline:"none",...N.style},onKeyDown:Be(N.onKeyDown,K=>{const ye=K.ctrlKey||K.altKey||K.metaKey;if(K.key==="Tab"&&K.preventDefault(),!ye&&K.key.length===1&&M(K.key),["ArrowUp","ArrowDown","Home","End"].includes(K.key)){let D=ie().filter(fe=>!fe.disabled).map(fe=>fe.ref.current);if(["ArrowUp","End"].includes(K.key)&&(D=D.slice().reverse()),["ArrowUp","ArrowDown"].includes(K.key)){const fe=K.target,Se=D.indexOf(fe);D=D.slice(Se+1)}setTimeout(()=>ce(D)),K.preventDefault()}})})})})})})});$g.displayName=fC;var xC="SelectItemAlignedPosition",Bg=f.forwardRef((s,a)=>{const{__scopeSelect:l,onPlaced:o,...c}=s,d=tn(Cn,l),h=rn(Cn,l),[m,p]=f.useState(null),[y,g]=f.useState(null),v=et(a,k=>g(k)),C=Eo(l),P=f.useRef(!1),T=f.useRef(!0),{viewport:S,selectedItem:b,selectedItemText:N,focusSelectedItem:E}=h,j=f.useCallback(()=>{if(d.trigger&&d.valueNode&&m&&y&&S&&b&&N){const k=d.trigger.getBoundingClientRect(),L=y.getBoundingClientRect(),_=d.valueNode.getBoundingClientRect(),se=N.getBoundingClientRect();if(d.dir!=="rtl"){const fe=se.left-L.left,Se=_.left-fe,ze=k.left-Se,We=k.width+ze,qe=Math.max(We,L.width),Ze=window.innerWidth-Mr,st=no(Se,[Mr,Math.max(Mr,Ze-qe)]);m.style.minWidth=We+"px",m.style.left=st+"px"}else{const fe=L.right-se.right,Se=window.innerWidth-_.right-fe,ze=window.innerWidth-k.right-Se,We=k.width+ze,qe=Math.max(We,L.width),Ze=window.innerWidth-Mr,st=no(Se,[Mr,Math.max(Mr,Ze-qe)]);m.style.minWidth=We+"px",m.style.right=st+"px"}const le=C(),ie=window.innerHeight-Mr*2,ee=S.scrollHeight,G=window.getComputedStyle(y),Q=parseInt(G.borderTopWidth,10),ce=parseInt(G.paddingTop,10),re=parseInt(G.borderBottomWidth,10),A=parseInt(G.paddingBottom,10),ne=Q+ce+ee+A+re,W=Math.min(b.offsetHeight*5,ne),M=window.getComputedStyle(S),O=parseInt(M.paddingTop,10),F=parseInt(M.paddingBottom,10),X=k.top+k.height/2-Mr,H=ie-X,ue=b.offsetHeight/2,K=b.offsetTop+ue,ye=Q+ce+K,ge=ne-ye;if(ye<=X){const fe=le.length>0&&b===le[le.length-1].ref.current;m.style.bottom="0px";const Se=y.clientHeight-S.offsetTop-S.offsetHeight,ze=Math.max(H,ue+(fe?F:0)+Se+re),We=ye+ze;m.style.height=We+"px"}else{const fe=le.length>0&&b===le[0].ref.current;m.style.top="0px";const ze=Math.max(X,Q+S.offsetTop+(fe?O:0)+ue)+ge;m.style.height=ze+"px",S.scrollTop=ye-X+S.offsetTop}m.style.margin=`${Mr}px 0`,m.style.minHeight=W+"px",m.style.maxHeight=ie+"px",o==null||o(),requestAnimationFrame(()=>P.current=!0)}},[C,d.trigger,d.valueNode,m,y,S,b,N,d.dir,o]);qt(()=>j(),[j]);const[R,B]=f.useState();qt(()=>{y&&B(window.getComputedStyle(y).zIndex)},[y]);const U=f.useCallback(k=>{k&&T.current===!0&&(j(),E==null||E(),T.current=!1)},[j,E]);return e.jsx(gC,{scope:l,contentWrapper:m,shouldExpandOnScrollRef:P,onScrollButtonChange:U,children:e.jsx("div",{ref:p,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:R},children:e.jsx(Ke.div,{...c,ref:v,style:{boxSizing:"border-box",maxHeight:"100%",...c.style}})})})});Bg.displayName=xC;var pC="SelectPopperPosition",Xd=f.forwardRef((s,a)=>{const{__scopeSelect:l,align:o="start",collisionPadding:c=Mr,...d}=s,h=Po(l);return e.jsx(tC,{...h,...d,ref:a,align:o,collisionPadding:c,style:{boxSizing:"border-box",...d.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});Xd.displayName=pC;var[gC,Lu]=xa(Cn,{}),Jd="SelectViewport",Ug=f.forwardRef((s,a)=>{const{__scopeSelect:l,nonce:o,...c}=s,d=rn(Jd,l),h=Lu(Jd,l),m=et(a,d.onViewportChange),p=f.useRef(0);return e.jsxs(e.Fragment,{children:[e.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:o}),e.jsx(ko.Slot,{scope:l,children:e.jsx(Ke.div,{"data-radix-select-viewport":"",role:"presentation",...c,ref:m,style:{position:"relative",flex:1,overflow:"hidden auto",...c.style},onScroll:Be(c.onScroll,y=>{const g=y.currentTarget,{contentWrapper:v,shouldExpandOnScrollRef:C}=h;if(C!=null&&C.current&&v){const P=Math.abs(p.current-g.scrollTop);if(P>0){const T=window.innerHeight-Mr*2,S=parseFloat(v.style.minHeight),b=parseFloat(v.style.height),N=Math.max(S,b);if(N0?R:0,v.style.justifyContent="flex-end")}}}p.current=g.scrollTop})})})]})});Ug.displayName=Jd;var Vg="SelectGroup",[yC,vC]=xa(Vg),jC=f.forwardRef((s,a)=>{const{__scopeSelect:l,...o}=s,c=Gs();return e.jsx(yC,{scope:l,id:c,children:e.jsx(Ke.div,{role:"group","aria-labelledby":c,...o,ref:a})})});jC.displayName=Vg;var Wg="SelectLabel",bC=f.forwardRef((s,a)=>{const{__scopeSelect:l,...o}=s,c=vC(Wg,l);return e.jsx(Ke.div,{id:c.id,...o,ref:a})});bC.displayName=Wg;var co="SelectItem",[NC,Hg]=xa(co),Kg=f.forwardRef((s,a)=>{const{__scopeSelect:l,value:o,disabled:c=!1,textValue:d,...h}=s,m=tn(co,l),p=rn(co,l),y=m.value===o,[g,v]=f.useState(d??""),[C,P]=f.useState(!1),T=et(a,E=>{var j;return(j=p.itemRefCallback)==null?void 0:j.call(p,E,o,c)}),S=Gs(),b=f.useRef("touch"),N=()=>{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 e.jsx(NC,{scope:l,value:o,disabled:c,textId:S,isSelected:y,onItemTextChange:f.useCallback(E=>{v(j=>j||((E==null?void 0:E.textContent)??"").trim())},[]),children:e.jsx(ko.ItemSlot,{scope:l,value:o,disabled:c,textValue:g,children:e.jsx(Ke.div,{role:"option","aria-labelledby":S,"data-highlighted":C?"":void 0,"aria-selected":y&&C,"data-state":y?"checked":"unchecked","aria-disabled":c||void 0,"data-disabled":c?"":void 0,tabIndex:c?void 0:-1,...h,ref:T,onFocus:Be(h.onFocus,()=>P(!0)),onBlur:Be(h.onBlur,()=>P(!1)),onClick:Be(h.onClick,()=>{b.current!=="mouse"&&N()}),onPointerUp:Be(h.onPointerUp,()=>{b.current==="mouse"&&N()}),onPointerDown:Be(h.onPointerDown,E=>{b.current=E.pointerType}),onPointerMove:Be(h.onPointerMove,E=>{var j;b.current=E.pointerType,c?(j=p.onItemLeave)==null||j.call(p):b.current==="mouse"&&E.currentTarget.focus({preventScroll:!0})}),onPointerLeave:Be(h.onPointerLeave,E=>{var j;E.currentTarget===document.activeElement&&((j=p.onItemLeave)==null||j.call(p))}),onKeyDown:Be(h.onKeyDown,E=>{var R;((R=p.searchRef)==null?void 0:R.current)!==""&&E.key===" "||(lC.includes(E.key)&&N(),E.key===" "&&E.preventDefault())})})})})});Kg.displayName=co;var cl="SelectItemText",Yg=f.forwardRef((s,a)=>{const{__scopeSelect:l,className:o,style:c,...d}=s,h=tn(cl,l),m=rn(cl,l),p=Hg(cl,l),y=dC(cl,l),[g,v]=f.useState(null),C=et(a,N=>v(N),p.onItemTextChange,N=>{var E;return(E=m.itemTextRefCallback)==null?void 0:E.call(m,N,p.value,p.disabled)}),P=g==null?void 0:g.textContent,T=f.useMemo(()=>e.jsx("option",{value:p.value,disabled:p.disabled,children:P},p.value),[p.disabled,p.value,P]),{onNativeOptionAdd:S,onNativeOptionRemove:b}=y;return qt(()=>(S(T),()=>b(T)),[S,b,T]),e.jsxs(e.Fragment,{children:[e.jsx(Ke.span,{id:p.textId,...d,ref:C}),p.isSelected&&h.valueNode&&!h.valueNodeHasChildren?gl.createPortal(d.children,h.valueNode):null]})});Yg.displayName=cl;var Gg="SelectItemIndicator",Qg=f.forwardRef((s,a)=>{const{__scopeSelect:l,...o}=s;return Hg(Gg,l).isSelected?e.jsx(Ke.span,{"aria-hidden":!0,...o,ref:a}):null});Qg.displayName=Gg;var Zd="SelectScrollUpButton",qg=f.forwardRef((s,a)=>{const l=rn(Zd,s.__scopeSelect),o=Lu(Zd,s.__scopeSelect),[c,d]=f.useState(!1),h=et(a,o.onScrollButtonChange);return qt(()=>{if(l.viewport&&l.isPositioned){let m=function(){const y=p.scrollTop>0;d(y)};const p=l.viewport;return m(),p.addEventListener("scroll",m),()=>p.removeEventListener("scroll",m)}},[l.viewport,l.isPositioned]),c?e.jsx(Jg,{...s,ref:h,onAutoScroll:()=>{const{viewport:m,selectedItem:p}=l;m&&p&&(m.scrollTop=m.scrollTop-p.offsetHeight)}}):null});qg.displayName=Zd;var eu="SelectScrollDownButton",Xg=f.forwardRef((s,a)=>{const l=rn(eu,s.__scopeSelect),o=Lu(eu,s.__scopeSelect),[c,d]=f.useState(!1),h=et(a,o.onScrollButtonChange);return qt(()=>{if(l.viewport&&l.isPositioned){let m=function(){const y=p.scrollHeight-p.clientHeight,g=Math.ceil(p.scrollTop)p.removeEventListener("scroll",m)}},[l.viewport,l.isPositioned]),c?e.jsx(Jg,{...s,ref:h,onAutoScroll:()=>{const{viewport:m,selectedItem:p}=l;m&&p&&(m.scrollTop=m.scrollTop+p.offsetHeight)}}):null});Xg.displayName=eu;var Jg=f.forwardRef((s,a)=>{const{__scopeSelect:l,onAutoScroll:o,...c}=s,d=rn("SelectScrollButton",l),h=f.useRef(null),m=Eo(l),p=f.useCallback(()=>{h.current!==null&&(window.clearInterval(h.current),h.current=null)},[]);return f.useEffect(()=>()=>p(),[p]),qt(()=>{var g;const y=m().find(v=>v.ref.current===document.activeElement);(g=y==null?void 0:y.ref.current)==null||g.scrollIntoView({block:"nearest"})},[m]),e.jsx(Ke.div,{"aria-hidden":!0,...c,ref:a,style:{flexShrink:0,...c.style},onPointerDown:Be(c.onPointerDown,()=>{h.current===null&&(h.current=window.setInterval(o,50))}),onPointerMove:Be(c.onPointerMove,()=>{var y;(y=d.onItemLeave)==null||y.call(d),h.current===null&&(h.current=window.setInterval(o,50))}),onPointerLeave:Be(c.onPointerLeave,()=>{p()})})}),wC="SelectSeparator",SC=f.forwardRef((s,a)=>{const{__scopeSelect:l,...o}=s;return e.jsx(Ke.div,{"aria-hidden":!0,...o,ref:a})});SC.displayName=wC;var tu="SelectArrow",CC=f.forwardRef((s,a)=>{const{__scopeSelect:l,...o}=s,c=Po(l),d=tn(tu,l),h=rn(tu,l);return d.open&&h.position==="popper"?e.jsx(rC,{...c,...o,ref:a}):null});CC.displayName=tu;var kC="SelectBubbleInput",Zg=f.forwardRef(({__scopeSelect:s,value:a,...l},o)=>{const c=f.useRef(null),d=et(o,c),h=Su(a);return f.useEffect(()=>{const m=c.current;if(!m)return;const p=window.HTMLSelectElement.prototype,g=Object.getOwnPropertyDescriptor(p,"value").set;if(h!==a&&g){const v=new Event("change",{bubbles:!0});g.call(m,a),m.dispatchEvent(v)}},[h,a]),e.jsx(Ke.select,{...l,style:{...Rg,...l.style},ref:d,defaultValue:a})});Zg.displayName=kC;function e0(s){return s===""||s===void 0}function t0(s){const a=Qs(s),l=f.useRef(""),o=f.useRef(0),c=f.useCallback(h=>{const m=l.current+h;a(m),(function p(y){l.current=y,window.clearTimeout(o.current),y!==""&&(o.current=window.setTimeout(()=>p(""),1e3))})(m)},[a]),d=f.useCallback(()=>{l.current="",window.clearTimeout(o.current)},[]);return f.useEffect(()=>()=>window.clearTimeout(o.current),[]),[l,c,d]}function r0(s,a,l){const c=a.length>1&&Array.from(a).every(y=>y===a[0])?a[0]:a,d=l?s.indexOf(l):-1;let h=EC(s,Math.max(d,0));c.length===1&&(h=h.filter(y=>y!==l));const p=h.find(y=>y.textValue.toLowerCase().startsWith(c.toLowerCase()));return p!==l?p:void 0}function EC(s,a){return s.map((l,o)=>s[(a+o)%s.length])}var PC=Ig,s0=Mg,TC=Dg,RC=Lg,IC=Og,n0=Fg,_C=Ug,a0=Kg,MC=Yg,AC=Qg,DC=qg,LC=Xg;const il=PC,ol=TC,ea=f.forwardRef(({className:s,children:a,...l},o)=>e.jsxs(s0,{ref:o,className:tt("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",s),...l,children:[a,e.jsx(RC,{asChild:!0,children:e.jsx(ml,{className:"h-4 w-4 opacity-50"})})]}));ea.displayName=s0.displayName;const ta=f.forwardRef(({className:s,children:a,position:l="popper",...o},c)=>e.jsx(IC,{children:e.jsxs(n0,{ref:c,className:tt("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",s),position:l,...o,children:[e.jsx(DC,{className:"flex cursor-default items-center justify-center py-1",children:e.jsx(Ax,{className:"h-4 w-4"})}),e.jsx(_C,{className:"p-1",children:a}),e.jsx(LC,{className:"flex cursor-default items-center justify-center py-1",children:e.jsx(ml,{className:"h-4 w-4"})})]})}));ta.displayName=n0.displayName;const Hr=f.forwardRef(({className:s,children:a,...l},o)=>e.jsxs(a0,{ref:o,className:tt("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",s),...l,children:[e.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:e.jsx(AC,{children:e.jsx(fo,{className:"h-4 w-4"})})}),e.jsx(MC,{children:a})]}));Hr.displayName=a0.displayName;const OC=["一","二","三","四","五","六","七","八","九","十"];function Ad(s){return s.startsWith("part:")?{type:"part",id:s.slice(5)}:s.startsWith("chapter:")?{type:"chapter",id:s.slice(8)}:s.startsWith("section:")?{type:"section",id:s.slice(8)}:null}function FC({parts:s,expandedParts:a,onTogglePart:l,onReorder:o,onReadSection:c,onDeleteSection:d,onAddSectionInPart:h,onAddChapterInPart:m,onDeleteChapter:p,onEditPart:y,onDeletePart:g,onEditChapter:v,selectedSectionIds:C=[],onToggleSectionSelect:P,onShowSectionOrders:T}){const[S,b]=f.useState(null),[N,E]=f.useState(null),j=(_,se)=>(S==null?void 0:S.type)===_&&(S==null?void 0:S.id)===se,R=(_,se)=>(N==null?void 0:N.type)===_&&(N==null?void 0:N.id)===se,B=f.useCallback(()=>{const _=[];for(const se of s)for(const le of se.chapters)for(const ie of le.sections)_.push({id:ie.id,partId:se.id,partTitle:se.title,chapterId:le.id,chapterTitle:le.title});return _},[s]),U=f.useCallback(async(_,se,le,ie)=>{var re;_.preventDefault(),_.stopPropagation();const ee=_.dataTransfer.getData("text/plain"),G=Ad(ee);if(!G||G.type===se&&G.id===le)return;const Q=B(),ce=new Map(Q.map(A=>[A.id,A]));if(G.type==="part"&&se==="part"){const A=s.map(F=>F.id),ne=A.indexOf(G.id),W=A.indexOf(le);if(ne===-1||W===-1)return;const M=[...A];M.splice(ne,1),M.splice(neH.id===F);if(X)for(const H of X.chapters)for(const ue of H.sections){const K=ce.get(ue.id);K&&O.push(K)}}await o(O);return}if(G.type==="chapter"&&(se==="chapter"||se==="section"||se==="part")){const A=s.find(K=>K.chapters.some(ye=>ye.id===G.id)),ne=A==null?void 0:A.chapters.find(K=>K.id===G.id);if(!A||!ne)return;let W,M,O=null;if(se==="section"){const K=ce.get(le);if(!K)return;W=K.partId,M=K.partTitle,O=le}else if(se==="chapter"){const K=s.find(D=>D.chapters.some(fe=>fe.id===le)),ye=K==null?void 0:K.chapters.find(D=>D.id===le);if(!K||!ye)return;W=K.id,M=K.title;const ge=Q.filter(D=>D.chapterId===le).pop();O=(ge==null?void 0:ge.id)??null}else{const K=s.find(ge=>ge.id===le);if(!K||!K.chapters[0])return;W=K.id,M=K.title;const ye=Q.filter(ge=>ge.partId===K.id&&ge.chapterId===K.chapters[0].id);O=((re=ye[ye.length-1])==null?void 0:re.id)??null}const F=ne.sections.map(K=>K.id),X=Q.filter(K=>!F.includes(K.id));let H=X.length;if(O){const K=X.findIndex(ye=>ye.id===O);K>=0&&(H=K+1)}const ue=F.map(K=>({...ce.get(K),partId:W,partTitle:M,chapterId:ne.id,chapterTitle:ne.title}));await o([...X.slice(0,H),...ue,...X.slice(H)]);return}if(G.type==="section"&&(se==="section"||se==="chapter"||se==="part")){if(!ie)return;const{partId:A,partTitle:ne,chapterId:W,chapterTitle:M}=ie;let O;if(se==="section")O=Q.findIndex(ye=>ye.id===le);else if(se==="chapter"){const ye=Q.filter(ge=>ge.chapterId===le).pop();O=ye?Q.findIndex(ge=>ge.id===ye.id)+1:Q.length}else{const ye=s.find(fe=>fe.id===le);if(!(ye!=null&&ye.chapters[0]))return;const ge=Q.filter(fe=>fe.partId===ye.id&&fe.chapterId===ye.chapters[0].id),D=ge[ge.length-1];O=D?Q.findIndex(fe=>fe.id===D.id)+1:0}const F=Q.findIndex(ye=>ye.id===G.id);if(F===-1)return;const X=Q.filter(ye=>ye.id!==G.id),H=F({onDragEnter:ie=>{ie.preventDefault(),ie.stopPropagation(),ie.dataTransfer.dropEffect="move",E({type:_,id:se})},onDragOver:ie=>{ie.preventDefault(),ie.stopPropagation(),ie.dataTransfer.dropEffect="move",E({type:_,id:se})},onDragLeave:()=>E(null),onDrop:ie=>{E(null);const ee=Ad(ie.dataTransfer.getData("text/plain"));if(ee&&!(_==="section"&&ee.type==="section"&&ee.id===se))if(_==="part")if(ee.type==="part")U(ie,"part",se);else{const G=s.find(ce=>ce.id===se);(G==null?void 0:G.chapters[0])&&le&&U(ie,"part",se,le)}else _==="chapter"&&le?(ee.type==="section"||ee.type==="chapter")&&U(ie,"chapter",se,le):_==="section"&&le&&U(ie,"section",se,le)}}),L=_=>OC[_]??String(_+1);return e.jsx("div",{className:"space-y-3",children:s.map((_,se)=>{var ne,W,M,O;const le=_.title==="序言"||_.title.includes("序言"),ie=_.title==="尾声"||_.title.includes("尾声"),ee=_.title==="附录"||_.title.includes("附录"),G=R("part",_.id),Q=a.includes(_.id),ce=_.chapters.length,re=_.chapters.reduce((F,X)=>F+X.sections.length,0);if(le&&_.chapters.length===1&&_.chapters[0].sections.length===1){const F=_.chapters[0].sections[0],X=R("section",F.id),H={partId:_.id,partTitle:_.title,chapterId:_.chapters[0].id,chapterTitle:_.chapters[0].title};return e.jsxs("div",{draggable:!0,onDragStart:ue=>{ue.stopPropagation(),ue.dataTransfer.setData("text/plain","section:"+F.id),ue.dataTransfer.effectAllowed="move",b({type:"section",id:F.id})},onDragEnd:()=>{b(null),E(null)},className:`rounded-xl border border-gray-700/50 bg-[#1C1C1E] p-4 flex items-center justify-between hover:border-[#38bdac]/30 transition-colors cursor-grab active:cursor-grabbing select-none min-h-[40px] ${X?"bg-[#38bdac]/15 ring-2 ring-[#38bdac]/50":""} ${j("section",F.id)?"opacity-60 scale-[0.98] ring-2 ring-[#38bdac]":""}`,...k("section",F.id,H),children:[e.jsxs("div",{className:"flex items-center gap-3 flex-1 min-w-0 select-none",children:[e.jsx(is,{className:"w-5 h-5 text-gray-500 shrink-0 opacity-60"}),P&&e.jsx("label",{className:"shrink-0 flex items-center",onClick:ue=>ue.stopPropagation(),children:e.jsx("input",{type:"checkbox",checked:C.includes(F.id),onChange:()=>P(F.id),className:"w-4 h-4 rounded border-gray-600 bg-[#0a1628] text-[#38bdac] focus:ring-[#38bdac]"})}),e.jsx("div",{className:"w-8 h-8 rounded-lg bg-gray-600/50 flex items-center justify-center shrink-0",children:e.jsx(us,{className:"w-4 h-4 text-gray-400"})}),e.jsxs("span",{className:"font-medium text-gray-200 truncate",children:[_.chapters[0].title," | ",F.title]})]}),e.jsxs("div",{className:"flex items-center gap-2 shrink-0",onMouseDown:ue=>ue.stopPropagation(),onClick:ue=>ue.stopPropagation(),children:[F.price===0||F.isFree?e.jsx("span",{className:"px-2 py-1 bg-[#38bdac]/20 text-[#38bdac] text-[10px] font-medium rounded",children:"免费"}):e.jsxs("span",{className:"text-xs text-gray-500",children:["¥",F.price]}),e.jsxs("span",{className:"text-[10px] text-gray-500",children:["点击 ",F.clickCount??0," · 付款 ",F.payCount??0]}),e.jsxs("span",{className:"text-[10px] text-amber-400/90",title:"热度积分与排名",children:["热度 ",(F.hotScore??0).toFixed(1)," · 第",F.hotRank&&F.hotRank>0?F.hotRank:"-","名"]}),T&&e.jsx(Z,{draggable:!1,variant:"ghost",size:"sm",onClick:()=>T(F),className:"text-[10px] text-gray-500 hover:text-[#38bdac] h-7 px-1.5",children:"付款记录"}),e.jsxs("div",{className:"flex gap-1",children:[e.jsx(Z,{draggable:!1,variant:"ghost",size:"sm",onClick:()=>c(F),className:"text-gray-500 hover:text-[#38bdac] h-7 px-2",children:e.jsx(ds,{className:"w-3.5 h-3.5"})}),e.jsx(Z,{draggable:!1,variant:"ghost",size:"sm",onClick:()=>c(F),className:"text-gray-500 hover:text-[#38bdac] h-7 px-2",children:e.jsx(yt,{className:"w-3.5 h-3.5"})}),e.jsx(Z,{draggable:!1,variant:"ghost",size:"sm",onClick:()=>d(F),className:"text-gray-500 hover:text-red-400 h-7 px-2",children:e.jsx(Gt,{className:"w-3.5 h-3.5"})})]}),e.jsx(Vs,{className:"w-4 h-4 text-gray-500"})]})]},_.id)}if(_.title==="2026每日派对干货"||_.title.includes("2026每日派对干货")){const F=R("part",_.id);return e.jsxs("div",{className:`rounded-xl border overflow-hidden transition-all duration-200 ${F?"border-[#38bdac] ring-2 ring-[#38bdac]/40 bg-[#38bdac]/5":"border-gray-700/50 bg-[#1C1C1E]"}`,...k("part",_.id,{partId:_.id,partTitle:_.title,chapterId:((ne=_.chapters[0])==null?void 0:ne.id)??"",chapterTitle:((W=_.chapters[0])==null?void 0:W.title)??""}),children:[e.jsxs("div",{draggable:!0,onDragStart:X=>{X.stopPropagation(),X.dataTransfer.setData("text/plain","part:"+_.id),X.dataTransfer.effectAllowed="move",b({type:"part",id:_.id})},onDragEnd:()=>{b(null),E(null)},className:`flex items-center justify-between p-4 cursor-grab active:cursor-grabbing select-none transition-all duration-200 ${j("part",_.id)?"opacity-60 scale-[0.98] ring-2 ring-[#38bdac]":"hover:bg-[#162840]/50"}`,onClick:()=>l(_.id),children:[e.jsxs("div",{className:"flex items-center gap-3 min-w-0",children:[e.jsx(is,{className:"w-5 h-5 text-gray-500 shrink-0 opacity-60"}),e.jsx("div",{className:"w-10 h-10 rounded-xl bg-[#38bdac]/80 flex items-center justify-center text-white font-bold shrink-0",children:"派"}),e.jsxs("div",{children:[e.jsx("h3",{className:"font-bold text-white text-base",children:_.title}),e.jsxs("p",{className:"text-xs text-gray-500 mt-0.5",children:["共 ",re," 节"]})]})]}),e.jsxs("div",{className:"flex items-center gap-2 shrink-0",onMouseDown:X=>X.stopPropagation(),onClick:X=>X.stopPropagation(),children:[h&&e.jsx(Z,{draggable:!1,variant:"ghost",size:"sm",onClick:()=>h(_),className:"text-gray-500 hover:text-[#38bdac] h-7 px-2",title:"在本篇下新增章节",children:e.jsx(At,{className:"w-3.5 h-3.5"})}),y&&e.jsx(Z,{draggable:!1,variant:"ghost",size:"sm",onClick:()=>y(_),className:"text-gray-500 hover:text-[#38bdac] h-7 px-2",title:"编辑篇名",children:e.jsx(yt,{className:"w-3.5 h-3.5"})}),g&&e.jsx(Z,{draggable:!1,variant:"ghost",size:"sm",onClick:()=>g(_),className:"text-gray-500 hover:text-red-400 h-7 px-2",title:"删除本篇",children:e.jsx(Gt,{className:"w-3.5 h-3.5"})}),e.jsxs("span",{className:"text-xs text-gray-500",children:[ce,"章"]}),Q?e.jsx(ml,{className:"w-5 h-5 text-gray-500"}):e.jsx(Vs,{className:"w-5 h-5 text-gray-500"})]})]}),Q&&_.chapters.length>0&&e.jsx("div",{className:"border-t border-gray-700/50 pl-4 pr-4 pb-4 pt-3 space-y-4",children:_.chapters.map(X=>e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"flex items-center gap-2 w-full",children:[e.jsx("p",{className:"text-xs text-gray-500 pb-1 flex-1",children:X.title}),e.jsxs("div",{className:"flex gap-0.5 shrink-0",onClick:H=>H.stopPropagation(),children:[v&&e.jsx(Z,{variant:"ghost",size:"sm",onClick:()=>v(_,X),className:"text-gray-500 hover:text-[#38bdac] h-7 px-1.5",title:"编辑章节名称",children:e.jsx(yt,{className:"w-3.5 h-3.5"})}),m&&e.jsx(Z,{variant:"ghost",size:"sm",onClick:()=>m(_),className:"text-gray-500 hover:text-[#38bdac] h-7 px-1.5",title:"新增第X章",children:e.jsx(At,{className:"w-3.5 h-3.5"})}),p&&e.jsx(Z,{variant:"ghost",size:"sm",onClick:()=>p(_,X),className:"text-gray-500 hover:text-red-400 h-7 px-1.5",title:"删除本章",children:e.jsx(Gt,{className:"w-3.5 h-3.5"})})]})]}),e.jsx("div",{className:"space-y-1 pl-2",children:X.sections.map(H=>{const ue=R("section",H.id);return e.jsxs("div",{draggable:!0,onDragStart:K=>{K.stopPropagation(),K.dataTransfer.setData("text/plain","section:"+H.id),K.dataTransfer.effectAllowed="move",b({type:"section",id:H.id})},onDragEnd:()=>{b(null),E(null)},className:`flex items-center justify-between py-2 px-3 rounded-lg min-h-[40px] cursor-grab active:cursor-grabbing select-none transition-all duration-200 ${ue?"bg-[#38bdac]/15 ring-2 ring-[#38bdac]/50":"hover:bg-[#162840]/50"} ${j("section",H.id)?"opacity-60 scale-[0.98] ring-2 ring-[#38bdac]":""}`,...k("section",H.id,{partId:_.id,partTitle:_.title,chapterId:X.id,chapterTitle:X.title}),children:[e.jsxs("div",{className:"flex items-center gap-2 min-w-0 flex-1",children:[e.jsx(is,{className:"w-4 h-4 text-gray-500 shrink-0 opacity-50"}),P&&e.jsx("label",{className:"shrink-0 flex items-center",onClick:K=>K.stopPropagation(),children:e.jsx("input",{type:"checkbox",checked:C.includes(H.id),onChange:()=>P(H.id),className:"w-4 h-4 rounded border-gray-600 bg-[#0a1628] text-[#38bdac] focus:ring-[#38bdac]"})}),e.jsxs("span",{className:"text-sm text-gray-200 truncate",children:[H.id," ",H.title]})]}),e.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[e.jsxs("span",{className:"text-[10px] text-gray-500",children:["点击 ",H.clickCount??0," · 付款 ",H.payCount??0]}),e.jsxs("span",{className:"text-[10px] text-amber-400/90",title:"热度积分与排名",children:["热度 ",(H.hotScore??0).toFixed(1)," · 第",H.hotRank&&H.hotRank>0?H.hotRank:"-","名"]}),T&&e.jsx(Z,{variant:"ghost",size:"sm",onClick:()=>T(H),className:"text-[10px] text-gray-500 hover:text-[#38bdac] h-7 px-1.5",children:"付款记录"}),e.jsx(Z,{draggable:!1,variant:"ghost",size:"sm",onClick:()=>c(H),className:"text-gray-500 hover:text-[#38bdac] h-7 px-1.5",children:e.jsx(ds,{className:"w-3.5 h-3.5"})}),e.jsx(Z,{draggable:!1,variant:"ghost",size:"sm",onClick:()=>c(H),className:"text-gray-500 hover:text-[#38bdac] h-7 px-1.5",children:e.jsx(yt,{className:"w-3.5 h-3.5"})}),e.jsx(Z,{draggable:!1,variant:"ghost",size:"sm",onClick:()=>d(H),className:"text-gray-500 hover:text-red-400 h-7 px-1.5",children:e.jsx(Gt,{className:"w-3.5 h-3.5"})})]})]},H.id)})})]},X.id))})]},_.id)}if(ee)return e.jsxs("div",{className:"rounded-xl border border-gray-700/50 bg-[#1C1C1E] p-5",children:[e.jsx("h3",{className:"text-sm font-medium text-gray-400 mb-4",children:"附录"}),e.jsx("div",{className:"space-y-3",children:_.chapters.map((F,X)=>F.sections.length>0?F.sections.map(H=>{const ue=R("section",H.id);return e.jsxs("div",{draggable:!0,onDragStart:K=>{K.stopPropagation(),K.dataTransfer.setData("text/plain","section:"+H.id),K.dataTransfer.effectAllowed="move",b({type:"section",id:H.id})},onDragEnd:()=>{b(null),E(null)},className:`flex justify-between items-center py-2 select-none rounded px-2 -mx-2 group cursor-grab active:cursor-grabbing min-h-[40px] transition-all duration-200 ${ue?"bg-[#38bdac]/15 ring-2 ring-[#38bdac]/50":"hover:bg-[#162840]/50"} ${j("section",H.id)?"opacity-60 scale-[0.98] ring-2 ring-[#38bdac]":""}`,...k("section",H.id,{partId:_.id,partTitle:_.title,chapterId:F.id,chapterTitle:F.title}),children:[e.jsxs("div",{className:"flex items-center gap-2 min-w-0 flex-1",children:[e.jsx(is,{className:"w-4 h-4 text-gray-500 shrink-0 opacity-50"}),P&&e.jsx("label",{className:"shrink-0 flex items-center",onClick:K=>K.stopPropagation(),children:e.jsx("input",{type:"checkbox",checked:C.includes(H.id),onChange:()=>P(H.id),className:"w-4 h-4 rounded border-gray-600 bg-[#0a1628] text-[#38bdac] focus:ring-[#38bdac]"})}),e.jsxs("span",{className:"text-sm text-gray-300 truncate",children:["附录",X+1," | ",F.title," | ",H.title]})]}),e.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[e.jsxs("span",{className:"text-[10px] text-gray-500",children:["点击 ",H.clickCount??0," · 付款 ",H.payCount??0]}),e.jsxs("span",{className:"text-[10px] text-amber-400/90",title:"热度积分与排名",children:["热度 ",(H.hotScore??0).toFixed(1)," · 第",H.hotRank&&H.hotRank>0?H.hotRank:"-","名"]}),T&&e.jsx(Z,{variant:"ghost",size:"sm",onClick:()=>T(H),className:"text-[10px] text-gray-500 hover:text-[#38bdac] h-7 px-1.5",children:"付款记录"}),e.jsxs("div",{className:"flex gap-1 opacity-0 group-hover:opacity-100 transition-opacity",children:[e.jsx(Z,{variant:"ghost",size:"sm",onClick:()=>c(H),className:"text-gray-500 hover:text-[#38bdac] h-7 px-1.5",children:e.jsx(ds,{className:"w-3.5 h-3.5"})}),e.jsx(Z,{variant:"ghost",size:"sm",onClick:()=>c(H),className:"text-gray-500 hover:text-[#38bdac] h-7 px-1.5",children:e.jsx(yt,{className:"w-3.5 h-3.5"})}),e.jsx(Z,{variant:"ghost",size:"sm",onClick:()=>d(H),className:"text-gray-500 hover:text-red-400 h-7 px-1.5",children:e.jsx(Gt,{className:"w-3.5 h-3.5"})})]})]}),e.jsx(Vs,{className:"w-4 h-4 text-gray-500 shrink-0"})]},H.id)}):e.jsxs("div",{className:"flex justify-between items-center py-2 select-none hover:bg-[#162840]/50 rounded px-2 -mx-2",children:[e.jsxs("span",{className:"text-sm text-gray-500",children:["附录",X+1," | ",F.title,"(空)"]}),e.jsx(Vs,{className:"w-4 h-4 text-gray-500 shrink-0"})]},F.id))})]},_.id);if(ie&&_.chapters.length===1&&_.chapters[0].sections.length===1){const F=_.chapters[0].sections[0],X=R("section",F.id),H={partId:_.id,partTitle:_.title,chapterId:_.chapters[0].id,chapterTitle:_.chapters[0].title};return e.jsxs("div",{draggable:!0,onDragStart:ue=>{ue.stopPropagation(),ue.dataTransfer.setData("text/plain","section:"+F.id),ue.dataTransfer.effectAllowed="move",b({type:"section",id:F.id})},onDragEnd:()=>{b(null),E(null)},className:`rounded-xl border border-gray-700/50 bg-[#1C1C1E] p-4 flex items-center justify-between hover:border-[#38bdac]/30 transition-colors cursor-grab active:cursor-grabbing select-none min-h-[40px] ${X?"bg-[#38bdac]/15 ring-2 ring-[#38bdac]/50":""} ${j("section",F.id)?"opacity-60 scale-[0.98] ring-2 ring-[#38bdac]":""}`,...k("section",F.id,H),children:[e.jsxs("div",{className:"flex items-center gap-3 flex-1 min-w-0 select-none",children:[e.jsx(is,{className:"w-5 h-5 text-gray-500 shrink-0 opacity-60"}),P&&e.jsx("label",{className:"shrink-0 flex items-center",onClick:ue=>ue.stopPropagation(),children:e.jsx("input",{type:"checkbox",checked:C.includes(F.id),onChange:()=>P(F.id),className:"w-4 h-4 rounded border-gray-600 bg-[#0a1628] text-[#38bdac] focus:ring-[#38bdac]"})}),e.jsx("div",{className:"w-8 h-8 rounded-lg bg-gray-600/50 flex items-center justify-center shrink-0",children:e.jsx(us,{className:"w-4 h-4 text-gray-400"})}),e.jsxs("span",{className:"font-medium text-gray-200 truncate",children:[_.chapters[0].title," | ",F.title]})]}),e.jsxs("div",{className:"flex items-center gap-2 shrink-0",onMouseDown:ue=>ue.stopPropagation(),onClick:ue=>ue.stopPropagation(),children:[F.price===0||F.isFree?e.jsx("span",{className:"px-2 py-1 bg-[#38bdac]/20 text-[#38bdac] text-[10px] font-medium rounded",children:"免费"}):e.jsxs("span",{className:"text-xs text-gray-500",children:["¥",F.price]}),e.jsxs("span",{className:"text-[10px] text-gray-500",children:["点击 ",F.clickCount??0," · 付款 ",F.payCount??0]}),e.jsxs("span",{className:"text-[10px] text-amber-400/90",title:"热度积分与排名",children:["热度 ",(F.hotScore??0).toFixed(1)," · 第",F.hotRank&&F.hotRank>0?F.hotRank:"-","名"]}),T&&e.jsx(Z,{draggable:!1,variant:"ghost",size:"sm",onClick:()=>T(F),className:"text-[10px] text-gray-500 hover:text-[#38bdac] h-7 px-1.5",children:"付款记录"}),e.jsxs("div",{className:"flex gap-1",children:[e.jsx(Z,{draggable:!1,variant:"ghost",size:"sm",onClick:()=>c(F),className:"text-gray-500 hover:text-[#38bdac] h-7 px-2",children:e.jsx(ds,{className:"w-3.5 h-3.5"})}),e.jsx(Z,{draggable:!1,variant:"ghost",size:"sm",onClick:()=>c(F),className:"text-gray-500 hover:text-[#38bdac] h-7 px-2",children:e.jsx(yt,{className:"w-3.5 h-3.5"})}),e.jsx(Z,{draggable:!1,variant:"ghost",size:"sm",onClick:()=>d(F),className:"text-gray-500 hover:text-red-400 h-7 px-2",children:e.jsx(Gt,{className:"w-3.5 h-3.5"})})]}),e.jsx(Vs,{className:"w-4 h-4 text-gray-500"})]})]},_.id)}return ie?e.jsxs("div",{className:"rounded-xl border border-gray-700/50 bg-[#1C1C1E] p-5",children:[e.jsx("h3",{className:"text-sm font-medium text-gray-400 mb-4",children:"尾声"}),e.jsx("div",{className:"space-y-3",children:_.chapters.map(F=>F.sections.map(X=>{const H=R("section",X.id);return e.jsxs("div",{draggable:!0,onDragStart:ue=>{ue.stopPropagation(),ue.dataTransfer.setData("text/plain","section:"+X.id),ue.dataTransfer.effectAllowed="move",b({type:"section",id:X.id})},onDragEnd:()=>{b(null),E(null)},className:`flex justify-between items-center py-2 select-none rounded px-2 -mx-2 cursor-grab active:cursor-grabbing min-h-[40px] transition-all duration-200 ${H?"bg-[#38bdac]/15 ring-2 ring-[#38bdac]/50":"hover:bg-[#162840]/50"} ${j("section",X.id)?"opacity-60 scale-[0.98] ring-2 ring-[#38bdac]":""}`,...k("section",X.id,{partId:_.id,partTitle:_.title,chapterId:F.id,chapterTitle:F.title}),children:[e.jsxs("div",{className:"flex items-center gap-2 min-w-0 flex-1",children:[e.jsx(is,{className:"w-4 h-4 text-gray-500 shrink-0 opacity-50"}),P&&e.jsx("label",{className:"shrink-0 flex items-center",onClick:ue=>ue.stopPropagation(),children:e.jsx("input",{type:"checkbox",checked:C.includes(X.id),onChange:()=>P(X.id),className:"w-4 h-4 rounded border-gray-600 bg-[#0a1628] text-[#38bdac] focus:ring-[#38bdac]"})}),e.jsxs("span",{className:"text-sm text-gray-300",children:[F.title," | ",X.title]})]}),e.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[e.jsxs("span",{className:"text-[10px] text-gray-500",children:["点击 ",X.clickCount??0," · 付款 ",X.payCount??0]}),e.jsxs("span",{className:"text-[10px] text-amber-400/90",title:"热度积分与排名",children:["热度 ",(X.hotScore??0).toFixed(1)," · 第",X.hotRank&&X.hotRank>0?X.hotRank:"-","名"]}),T&&e.jsx(Z,{draggable:!1,variant:"ghost",size:"sm",onClick:()=>T(X),className:"text-[10px] text-gray-500 hover:text-[#38bdac] h-7 px-1.5",children:"付款记录"}),e.jsxs("div",{className:"flex gap-1",children:[e.jsx(Z,{draggable:!1,variant:"ghost",size:"sm",onClick:()=>c(X),className:"text-gray-500 hover:text-[#38bdac] h-7 px-2",children:e.jsx(ds,{className:"w-3.5 h-3.5"})}),e.jsx(Z,{draggable:!1,variant:"ghost",size:"sm",onClick:()=>c(X),className:"text-gray-500 hover:text-[#38bdac] h-7 px-2",children:e.jsx(yt,{className:"w-3.5 h-3.5"})}),e.jsx(Z,{draggable:!1,variant:"ghost",size:"sm",onClick:()=>d(X),className:"text-gray-500 hover:text-red-400 h-7 px-2",children:e.jsx(Gt,{className:"w-3.5 h-3.5"})})]})]})]},X.id)}))})]},_.id):e.jsxs("div",{className:`rounded-xl border bg-[#1C1C1E] overflow-hidden transition-all duration-200 ${G?"border-[#38bdac] ring-2 ring-[#38bdac]/40 bg-[#38bdac]/5":"border-gray-700/50"}`,...k("part",_.id,{partId:_.id,partTitle:_.title,chapterId:((M=_.chapters[0])==null?void 0:M.id)??"",chapterTitle:((O=_.chapters[0])==null?void 0:O.title)??""}),children:[e.jsxs("div",{draggable:!0,onDragStart:F=>{F.stopPropagation(),F.dataTransfer.setData("text/plain","part:"+_.id),F.dataTransfer.effectAllowed="move",b({type:"part",id:_.id})},onDragEnd:()=>{b(null),E(null)},className:`flex items-center justify-between p-4 cursor-grab active:cursor-grabbing select-none transition-all duration-200 ${j("part",_.id)?"opacity-60 scale-[0.98] ring-2 ring-[#38bdac] rounded-xl shadow-xl shadow-[#38bdac]/20":"hover:bg-[#162840]/50"}`,onClick:()=>l(_.id),children:[e.jsxs("div",{className:"flex items-center gap-3 min-w-0",children:[e.jsx(is,{className:"w-5 h-5 text-gray-500 shrink-0 opacity-60"}),e.jsx("div",{className:"w-10 h-10 rounded-xl bg-[#38bdac] flex items-center justify-center text-white font-bold shadow-lg shadow-[#38bdac]/30 shrink-0",children:L(se)}),e.jsxs("div",{children:[e.jsx("h3",{className:"font-bold text-white text-base",children:_.title}),e.jsxs("p",{className:"text-xs text-gray-500 mt-0.5",children:["共 ",re," 节"]})]})]}),e.jsxs("div",{className:"flex items-center gap-2 shrink-0",onMouseDown:F=>F.stopPropagation(),onClick:F=>F.stopPropagation(),children:[h&&e.jsx(Z,{draggable:!1,variant:"ghost",size:"sm",onClick:()=>h(_),className:"text-gray-500 hover:text-[#38bdac] h-7 px-2",title:"在本篇下新增章节",children:e.jsx(At,{className:"w-3.5 h-3.5"})}),y&&e.jsx(Z,{draggable:!1,variant:"ghost",size:"sm",onClick:()=>y(_),className:"text-gray-500 hover:text-[#38bdac] h-7 px-2",title:"编辑篇名",children:e.jsx(yt,{className:"w-3.5 h-3.5"})}),g&&e.jsx(Z,{draggable:!1,variant:"ghost",size:"sm",onClick:()=>g(_),className:"text-gray-500 hover:text-red-400 h-7 px-2",title:"删除本篇",children:e.jsx(Gt,{className:"w-3.5 h-3.5"})}),e.jsxs("span",{className:"text-xs text-gray-500",children:[ce,"章"]}),Q?e.jsx(ml,{className:"w-5 h-5 text-gray-500"}):e.jsx(Vs,{className:"w-5 h-5 text-gray-500"})]})]}),Q&&e.jsx("div",{className:"border-t border-gray-700/50 pl-4 pr-4 pb-4 pt-3 space-y-4",children:_.chapters.map(F=>{const X=R("chapter",F.id);return e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"flex items-center gap-2 w-full",children:[e.jsxs("div",{draggable:!0,onDragStart:H=>{H.stopPropagation(),H.dataTransfer.setData("text/plain","chapter:"+F.id),H.dataTransfer.effectAllowed="move",b({type:"chapter",id:F.id})},onDragEnd:()=>{b(null),E(null)},onDragEnter:H=>{H.preventDefault(),H.stopPropagation(),H.dataTransfer.dropEffect="move",E({type:"chapter",id:F.id})},onDragOver:H=>{H.preventDefault(),H.stopPropagation(),H.dataTransfer.dropEffect="move",E({type:"chapter",id:F.id})},onDragLeave:()=>E(null),onDrop:H=>{E(null);const ue=Ad(H.dataTransfer.getData("text/plain"));if(!ue)return;const K={partId:_.id,partTitle:_.title,chapterId:F.id,chapterTitle:F.title};(ue.type==="section"||ue.type==="chapter")&&U(H,"chapter",F.id,K)},className:`flex-1 min-w-0 py-2 px-2 rounded cursor-grab active:cursor-grabbing select-none -mx-2 transition-all duration-200 flex items-center gap-2 ${X?"bg-[#38bdac]/15 ring-1 ring-[#38bdac]/50":""} ${j("chapter",F.id)?"opacity-60 scale-[0.98] ring-2 ring-[#38bdac]":"hover:bg-[#162840]/30"}`,children:[e.jsx(is,{className:"w-4 h-4 text-gray-500 shrink-0 opacity-50"}),e.jsx("p",{className:"text-xs text-gray-500 pb-1 flex-1",children:F.title})]}),e.jsxs("div",{className:"flex gap-0.5 shrink-0",onClick:H=>H.stopPropagation(),children:[v&&e.jsx(Z,{variant:"ghost",size:"sm",onClick:()=>v(_,F),className:"text-gray-500 hover:text-[#38bdac] h-7 px-1.5",title:"编辑章节名称",children:e.jsx(yt,{className:"w-3.5 h-3.5"})}),m&&e.jsx(Z,{variant:"ghost",size:"sm",onClick:()=>m(_),className:"text-gray-500 hover:text-[#38bdac] h-7 px-1.5",title:"新增第X章",children:e.jsx(At,{className:"w-3.5 h-3.5"})}),p&&e.jsx(Z,{variant:"ghost",size:"sm",onClick:()=>p(_,F),className:"text-gray-500 hover:text-red-400 h-7 px-1.5",title:"删除本章",children:e.jsx(Gt,{className:"w-3.5 h-3.5"})})]})]}),e.jsx("div",{className:"space-y-1 pl-2",children:F.sections.map(H=>{const ue=R("section",H.id);return e.jsxs("div",{draggable:!0,onDragStart:K=>{K.stopPropagation(),K.dataTransfer.setData("text/plain","section:"+H.id),K.dataTransfer.effectAllowed="move",b({type:"section",id:H.id})},onDragEnd:()=>{b(null),E(null)},className:`flex items-center justify-between py-2 px-3 rounded-lg group cursor-grab active:cursor-grabbing select-none min-h-[40px] transition-all duration-200 ${ue?"bg-[#38bdac]/15 ring-2 ring-[#38bdac]/50":""} ${j("section",H.id)?"opacity-60 scale-[0.98] ring-2 ring-[#38bdac] shadow-lg":"hover:bg-[#162840]/50"}`,...k("section",H.id,{partId:_.id,partTitle:_.title,chapterId:F.id,chapterTitle:F.title}),children:[e.jsxs("div",{className:"flex items-center gap-3 min-w-0 flex-1",children:[P&&e.jsx("label",{className:"shrink-0 flex items-center",onClick:K=>K.stopPropagation(),children:e.jsx("input",{type:"checkbox",checked:C.includes(H.id),onChange:()=>P(H.id),className:"w-4 h-4 rounded border-gray-600 bg-[#0a1628] text-[#38bdac] focus:ring-[#38bdac]"})}),e.jsx(is,{className:"w-4 h-4 text-gray-500 shrink-0 opacity-50"}),e.jsx("div",{className:`w-2 h-2 rounded-full shrink-0 ${H.price===0||H.isFree?"border-2 border-[#38bdac] bg-transparent":"bg-gray-500"}`}),e.jsxs("span",{className:"text-sm text-gray-200 truncate",children:[H.id," ",H.title]})]}),e.jsxs("div",{className:"flex items-center gap-2 shrink-0",onMouseDown:K=>K.stopPropagation(),onClick:K=>K.stopPropagation(),children:[H.isNew&&e.jsx("span",{className:"px-2 py-1 bg-[#38bdac]/20 text-[#38bdac] text-[10px] font-medium rounded",children:"NEW"}),H.price===0||H.isFree?e.jsx("span",{className:"px-2 py-1 bg-[#38bdac]/20 text-[#38bdac] text-[10px] font-medium rounded",children:"免费"}):e.jsxs("span",{className:"text-xs text-gray-500",children:["¥",H.price]}),e.jsxs("span",{className:"text-[10px] text-gray-500",title:"点击次数 · 付款笔数",children:["点击 ",H.clickCount??0," · 付款 ",H.payCount??0]}),e.jsxs("span",{className:"text-[10px] text-amber-400/90",title:"热度积分与排名",children:["热度 ",(H.hotScore??0).toFixed(1)," · 第",H.hotRank&&H.hotRank>0?H.hotRank:"-","名"]}),T&&e.jsx(Z,{variant:"ghost",size:"sm",onClick:()=>T(H),className:"text-[10px] text-gray-500 hover:text-[#38bdac] h-7 px-1.5 shrink-0",children:"付款记录"}),e.jsxs("div",{className:"flex gap-0.5 opacity-0 group-hover:opacity-100 transition-opacity",children:[e.jsx(Z,{draggable:!1,variant:"ghost",size:"sm",onClick:()=>c(H),className:"text-gray-500 hover:text-[#38bdac] h-7 px-1.5",children:e.jsx(ds,{className:"w-3.5 h-3.5"})}),e.jsx(Z,{draggable:!1,variant:"ghost",size:"sm",onClick:()=>c(H),className:"text-gray-500 hover:text-[#38bdac] h-7 px-1.5",children:e.jsx(yt,{className:"w-3.5 h-3.5"})}),e.jsx(Z,{draggable:!1,variant:"ghost",size:"sm",onClick:()=>d(H),className:"text-gray-500 hover:text-red-400 h-7 px-1.5",children:e.jsx(Gt,{className:"w-3.5 h-3.5"})})]}),e.jsx(Vs,{className:"w-4 h-4 text-gray-500"})]})]},H.id)})})]},F.id)})})]},_.id)})})}function zC(s){const a=new Map;for(const m of s){const p=m.partId||"part-1",y=m.partTitle||"未分类",g=m.chapterId||"chapter-1",v=m.chapterTitle||"未分类";a.has(p)||a.set(p,{id:p,title:y,chapters:new Map});const C=a.get(p);C.chapters.has(g)||C.chapters.set(g,{id:g,title:v,sections:[]}),C.chapters.get(g).sections.push({id:m.id,title:m.title,price:m.price??1,filePath:m.filePath,isFree:m.isFree,isNew:m.isNew,clickCount:m.clickCount??0,payCount:m.payCount??0,hotScore:m.hotScore??0,hotRank:m.hotRank??0})}const l="part-2026-daily",o="2026每日派对干货";Array.from(a.values()).some(m=>m.title===o||m.title.includes(o))||a.set(l,{id:l,title:o,chapters:new Map([["chapter-2026-daily",{id:"chapter-2026-daily",title:o,sections:[]}]])});const d=Array.from(a.values()).map(m=>({...m,chapters:Array.from(m.chapters.values())})),h=m=>m.includes("序言")?0:m.includes(o)?1.5:m.includes("附录")?2:m.includes("尾声")?3:1;return d.sort((m,p)=>{const y=h(m.title),g=h(p.title);return y!==g?y-g:0})}function $C(){var js,Pl,bs;const[s,a]=f.useState([]),[l,o]=f.useState(!0),[c,d]=f.useState([]),[h,m]=f.useState(null),[p,y]=f.useState(!1),[g,v]=f.useState(!1),[C,P]=f.useState(!1),[T,S]=f.useState(""),[b,N]=f.useState([]),[E,j]=f.useState(!1),[R,B]=f.useState(!1),U=f.useRef(null),[k,L]=f.useState({id:"",title:"",price:1,partId:"part-1",chapterId:"chapter-1",content:""}),[_,se]=f.useState(null),[le,ie]=f.useState(!1),[ee,G]=f.useState(!1),[Q,ce]=f.useState(null),[re,A]=f.useState(!1),[ne,W]=f.useState([]),[M,O]=f.useState(!1),[F,X]=f.useState(""),[H,ue]=f.useState(""),[K,ye]=f.useState(!1),[ge,D]=f.useState(""),[fe,Se]=f.useState(!1),[ze,We]=f.useState(null),[qe,Ze]=f.useState(!1),[st,ft]=f.useState(!1),[nt,Vt]=f.useState({readWeight:.5,recencyWeight:.3,payWeight:.2}),[Fr,Xr]=f.useState(!1),[xs,ps]=f.useState(!1),$t=zC(s),gs=s.length,oe=async()=>{o(!0);try{const z=await Fe("/api/db/book?action=list",{cache:"no-store"});a(Array.isArray(z==null?void 0:z.sections)?z.sections:[])}catch(z){console.error(z),a([])}finally{o(!1)}};f.useEffect(()=>{oe()},[]);const Qe=z=>{d(ae=>ae.includes(z)?ae.filter(be=>be!==z):[...ae,z])},Tt=f.useCallback(z=>{const ae=s,be=z.flatMap(Ee=>{const mt=ae.find(gr=>gr.id===Ee.id);return mt?[{...mt,partId:Ee.partId,partTitle:Ee.partTitle,chapterId:Ee.chapterId,chapterTitle:Ee.chapterTitle}]:[]});return a(be),Nt("/api/db/book",{action:"reorder",items:z}).then(Ee=>{Ee&&Ee.success===!1&&(a(ae),alert("排序失败: "+(Ee&&typeof Ee=="object"&&"error"in Ee?Ee.error:"未知错误")))}).catch(Ee=>{a(ae),console.error("排序失败:",Ee),alert("排序失败: "+(Ee instanceof Error?Ee.message:"网络或服务异常"))}),Promise.resolve()},[s]),dr=async z=>{if(confirm(`确定要删除章节「${z.title}」吗?此操作不可恢复。`))try{const ae=await vn(`/api/db/book?id=${encodeURIComponent(z.id)}`);ae&&ae.success!==!1?(alert("已删除"),oe()):alert("删除失败: "+(ae&&typeof ae=="object"&&"error"in ae?ae.error:"未知错误"))}catch(ae){console.error(ae),alert("删除失败")}},zr=f.useCallback(async()=>{Xr(!0);try{const z=await Fe("/api/db/config/full?key=article_ranking_weights",{cache:"no-store"}),ae=z&&z.data;ae&&typeof ae.readWeight=="number"&&typeof ae.recencyWeight=="number"&&typeof ae.payWeight=="number"&&Vt({readWeight:Math.max(0,Math.min(1,ae.readWeight)),recencyWeight:Math.max(0,Math.min(1,ae.recencyWeight)),payWeight:Math.max(0,Math.min(1,ae.payWeight))})}catch{}finally{Xr(!1)}},[]);f.useEffect(()=>{st&&zr()},[st,zr]);const Ro=async()=>{const{readWeight:z,recencyWeight:ae,payWeight:be}=nt,Ee=z+ae+be;if(Math.abs(Ee-1)>.001){alert("三个权重之和必须等于 1");return}ps(!0);try{const mt=await Et("/api/db/config",{key:"article_ranking_weights",value:{readWeight:z,recencyWeight:ae,payWeight:be},description:"文章排名算法权重"});mt&&mt.success!==!1?(alert("已保存"),oe()):alert("保存失败: "+(mt&&typeof mt=="object"&&"error"in mt?mt.error:""))}catch(mt){console.error(mt),alert("保存失败")}finally{ps(!1)}},Nl=async z=>{We({section:z,orders:[]}),Ze(!0);try{const ae=await Fe(`/api/db/book?action=section-orders&id=${encodeURIComponent(z.id)}`),be=ae!=null&&ae.success&&Array.isArray(ae.orders)?ae.orders:[];We(Ee=>Ee?{...Ee,orders:be}:null)}catch(ae){console.error(ae),We(be=>be?{...be,orders:[]}:null)}finally{Ze(!1)}},ga=async z=>{v(!0);try{const ae=await Fe(`/api/db/book?action=read&id=${encodeURIComponent(z.id)}`);if(ae!=null&&ae.success&&ae.section){const be=ae.section;m({id:z.id,title:ae.section.title??z.title,price:ae.section.price??z.price,content:ae.section.content??"",filePath:z.filePath,isFree:z.isFree||z.price===0,isNew:be.isNew??z.isNew})}else m({id:z.id,title:z.title,price:z.price,content:"",filePath:z.filePath,isFree:z.isFree,isNew:z.isNew}),ae&&!ae.success&&alert("无法读取文件内容: "+(ae.error||"未知错误"))}catch(ae){console.error(ae),m({id:z.id,title:z.title,price:z.price,content:"",filePath:z.filePath,isFree:z.isFree})}finally{v(!1)}},Io=async()=>{var z;if(h){P(!0);try{let ae=h.content||"";const be=[new RegExp(`^#+\\s*${h.id.replace(".","\\.")}\\s+.*$`,"gm"),new RegExp(`^#+\\s*${h.id.replace(".","\\.")}[::].*$`,"gm"),new RegExp(`^#\\s+.*${(z=h.title)==null?void 0:z.slice(0,10).replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}.*$`,"gm")];for(const mt of be)ae=ae.replace(mt,"");ae=ae.replace(/^\s*\n+/,"").trim();const Ee=await Nt("/api/db/book",{id:h.id,title:h.title,price:h.isFree?0:h.price,content:ae,isFree:h.isFree||h.price===0,isNew:h.isNew,saveToFile:!0});Ee&&Ee.success!==!1?(alert(`已保存章节: ${h.title}`),m(null),oe()):alert("保存失败: "+(Ee&&typeof Ee=="object"&&"error"in Ee?Ee.error:"未知错误"))}catch(ae){console.error(ae),alert("保存失败")}finally{P(!1)}}},ya=async()=>{if(!k.id||!k.title){alert("请填写章节ID和标题");return}P(!0);try{const z=await Nt("/api/db/book",{id:k.id,title:k.title,price:k.price,content:k.content,partId:k.partId,chapterId:k.chapterId,saveToFile:!1});z&&z.success!==!1?(alert(`章节创建成功: ${k.title}`),y(!1),L({id:"",title:"",price:1,partId:"part-1",chapterId:"chapter-1",content:""}),oe()):alert("创建失败: "+(z&&typeof z=="object"&&"error"in z?z.error:"未知错误"))}catch(z){console.error(z),alert("创建失败")}finally{P(!1)}},va=z=>{L(ae=>{var be;return{...ae,partId:z.id,chapterId:((be=z.chapters[0])==null?void 0:be.id)??"chapter-1"}}),y(!0)},ja=z=>{se({id:z.id,title:z.title})},ba=async()=>{var z;if((z=_==null?void 0:_.title)!=null&&z.trim()){ie(!0);try{const ae=s.map(Ee=>({id:Ee.id,partId:Ee.partId||"part-1",partTitle:Ee.partId===_.id?_.title.trim():Ee.partTitle||"",chapterId:Ee.chapterId||"chapter-1",chapterTitle:Ee.chapterTitle||""})),be=await Nt("/api/db/book",{action:"reorder",items:ae});be&&be.success!==!1?(se(null),oe()):alert("更新篇名失败: "+(be&&typeof be=="object"&&"error"in be?be.error:"未知错误"))}catch(ae){console.error(ae),alert("更新篇名失败")}finally{ie(!1)}}},Na=z=>{const ae=z.chapters.length+1,be=`chapter-${z.id}-${ae}-${Date.now()}`;L({id:`${ae}.1`,title:"新章节",price:1,partId:z.id,chapterId:be,content:""}),y(!0)},ys=(z,ae)=>{ce({part:z,chapter:ae,title:ae.title})},vs=async()=>{var z;if((z=Q==null?void 0:Q.title)!=null&&z.trim()){A(!0);try{const ae=s.map(Ee=>({id:Ee.id,partId:Ee.partId||Q.part.id,partTitle:Ee.partId===Q.part.id?Q.part.title:Ee.partTitle||"",chapterId:Ee.chapterId||Q.chapter.id,chapterTitle:Ee.partId===Q.part.id&&Ee.chapterId===Q.chapter.id?Q.title.trim():Ee.chapterTitle||""})),be=await Nt("/api/db/book",{action:"reorder",items:ae});be&&be.success!==!1?(ce(null),oe()):alert("保存失败: "+(be&&typeof be=="object"&&"error"in be?be.error:"未知错误"))}catch(ae){console.error(ae),alert("保存失败")}finally{A(!1)}}},wl=async(z,ae)=>{const be=ae.sections.map(Ee=>Ee.id);if(be.length===0){alert("该章下无小节,无需删除");return}if(confirm(`确定要删除「第${z.chapters.indexOf(ae)+1}章 | ${ae.title}」吗?将删除共 ${be.length} 节,此操作不可恢复。`))try{for(const Ee of be)await vn(`/api/db/book?id=${encodeURIComponent(Ee)}`);oe()}catch(Ee){console.error(Ee),alert("删除失败")}},Sl=async()=>{if(!ge.trim()){alert("请输入篇名");return}Se(!0);try{const z=`part-new-${Date.now()}`,ae="chapter-1",be=`part-placeholder-${Date.now()}`,Ee=await Nt("/api/db/book",{id:be,title:"占位节(可编辑)",price:0,content:"",partId:z,partTitle:ge.trim(),chapterId:ae,chapterTitle:"第1章 | 待编辑",saveToFile:!1});Ee&&Ee.success!==!1?(alert(`篇「${ge}」创建成功,请编辑占位节`),G(!1),D(""),oe()):alert("创建失败: "+(Ee&&typeof Ee=="object"&&"error"in Ee?Ee.error:"未知错误"))}catch(z){console.error(z),alert("创建失败")}finally{Se(!1)}},Cl=async()=>{if(ne.length===0){alert("请先勾选要移动的章节");return}const z=$t.find(be=>be.id===F),ae=z==null?void 0:z.chapters.find(be=>be.id===H);if(!z||!ae||!F||!H){alert("请选择目标篇和章");return}ye(!0);try{const be=()=>{const at=new Set(ne),Cr=s.map(Rt=>({id:Rt.id,partId:Rt.partId||"",partTitle:Rt.partTitle||"",chapterId:Rt.chapterId||"",chapterTitle:Rt.chapterTitle||""})),Tl=Cr.filter(Rt=>at.has(Rt.id)).map(Rt=>({...Rt,partId:F,partTitle:z.title||F,chapterId:H,chapterTitle:ae.title||H})),sn=Cr.filter(Rt=>!at.has(Rt.id));let En=sn.length;for(let Rt=sn.length-1;Rt>=0;Rt-=1){const Ca=sn[Rt];if(Ca.partId===F&&Ca.chapterId===H){En=Rt+1;break}}return[...sn.slice(0,En),...Tl,...sn.slice(En)]},Ee=async()=>{const at=be(),Cr=await Nt("/api/db/book",{action:"reorder",items:at});return Cr&&Cr.success!==!1?(alert(`已移动 ${ne.length} 节到「${z.title}」-「${ae.title}」`),O(!1),W([]),await oe(),!0):!1},mt={action:"move-sections",sectionIds:ne,targetPartId:F,targetChapterId:H,targetPartTitle:z.title||F,targetChapterTitle:ae.title||H},gr=await Nt("/api/db/book",mt);if(gr&&gr.success!==!1)alert(`已移动 ${gr.count??ne.length} 节到「${z.title}」-「${ae.title}」`),O(!1),W([]),await oe();else{const at=gr&&typeof gr=="object"&&"error"in gr?gr.error||"":"未知错误";if((at.includes("缺少 id")||at.includes("无效的 action"))&&await Ee())return;alert("移动失败: "+at)}}catch(be){console.error(be),alert("移动失败: "+(be instanceof Error?be.message:"网络或服务异常"))}finally{ye(!1)}},kl=z=>{W(ae=>ae.includes(z)?ae.filter(be=>be!==z):[...ae,z])},El=async z=>{const ae=s.filter(be=>be.partId===z.id).map(be=>be.id);if(ae.length===0){alert("该篇下暂无小节可删除");return}if(confirm(`确定要删除「${z.title}」整篇吗?将删除共 ${ae.length} 节内容,此操作不可恢复。`))try{for(const be of ae)await vn(`/api/db/book?id=${encodeURIComponent(be)}`);oe()}catch(be){console.error(be),alert("删除失败")}},wa=async z=>{var be,Ee;const ae=(be=z.target.files)==null?void 0:be[0];if(ae){B(!0);try{const mt=new FormData;mt.append("file",ae),mt.append("folder","book-images");const at=await(await fetch(la("/api/upload"),{method:"POST",body:mt,credentials:"include"})).json();if(at!=null&&at.success&&((Ee=at==null?void 0:at.data)!=null&&Ee.url)){const Cr=`![${ae.name}](${at.data.url})`;h&&m({...h,content:(h.content||"")+` + +`+Cr}),alert(`图片上传成功: ${at.data.url}`)}else alert("上传失败: "+((at==null?void 0:at.error)||"未知错误"))}catch(mt){console.error(mt),alert("上传失败")}finally{B(!1),U.current&&(U.current.value="")}}},Sa=async()=>{var z;if(T.trim()){j(!0);try{const ae=await Fe(`/api/search?q=${encodeURIComponent(T)}`);ae!=null&&ae.success&&((z=ae.data)!=null&&z.results)?N(ae.data.results):(N([]),ae&&!ae.success&&alert("搜索失败: "+ae.error))}catch(ae){console.error(ae),N([]),alert("搜索失败")}finally{j(!1)}}},Jr=$t.find(z=>z.id===k.partId),kn=(Jr==null?void 0:Jr.chapters)??[];return e.jsxs("div",{className:"p-8 w-full",children:[e.jsxs("div",{className:"flex justify-between items-center mb-8",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"text-2xl font-bold text-white",children:"内容管理"}),e.jsxs("p",{className:"text-gray-400 mt-1",children:["共 ",$t.length," 篇 · ",gs," 节内容"]})]}),e.jsxs("div",{className:"flex gap-2",children:[e.jsxs(Z,{onClick:()=>ft(!0),variant:"outline",className:"border-amber-500/50 text-amber-400 hover:bg-amber-500/10 bg-transparent",children:[e.jsx(jd,{className:"w-4 h-4 mr-2"}),"排名算法"]}),e.jsxs(Z,{onClick:()=>{const z=typeof window<"u"?`${window.location.origin}/api-doc`:"";z&&window.open(z,"_blank","noopener,noreferrer")},variant:"outline",className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:[e.jsx(Ys,{className:"w-4 h-4 mr-2"}),"API 接口"]})]})]}),e.jsx(wt,{open:p,onOpenChange:y,children:e.jsxs(vt,{className:"bg-[#0f2137] border-gray-700 text-white max-w-2xl max-h-[90vh] overflow-y-auto",showCloseButton:!0,children:[e.jsx(St,{children:e.jsxs(Ct,{className:"text-white flex items-center gap-2",children:[e.jsx(At,{className:"w-5 h-5 text-[#38bdac]"}),"新建章节"]})}),e.jsxs("div",{className:"space-y-4 py-4",children:[e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"章节ID *"}),e.jsx(de,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"如: 9.15",value:k.id,onChange:z=>L({...k,id:z.target.value})})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"价格 (元)"}),e.jsx(de,{type:"number",className:"bg-[#0a1628] border-gray-700 text-white",value:k.price,onChange:z=>L({...k,price:Number(z.target.value)})})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"章节标题 *"}),e.jsx(de,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"输入章节标题",value:k.title,onChange:z=>L({...k,title:z.target.value})})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"所属篇"}),e.jsxs(il,{value:k.partId,onValueChange:z=>L({...k,partId:z,chapterId:"chapter-1"}),children:[e.jsx(ea,{className:"bg-[#0a1628] border-gray-700 text-white",children:e.jsx(ol,{})}),e.jsxs(ta,{className:"bg-[#0f2137] border-gray-700",children:[$t.map(z=>e.jsx(Hr,{value:z.id,className:"text-white hover:bg-[#38bdac]/20 focus:bg-[#38bdac]/20",children:z.title},z.id)),$t.length===0&&e.jsx(Hr,{value:"part-1",className:"text-white hover:bg-[#38bdac]/20 focus:bg-[#38bdac]/20",children:"默认篇"})]})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"所属章"}),e.jsxs(il,{value:k.chapterId,onValueChange:z=>L({...k,chapterId:z}),children:[e.jsx(ea,{className:"bg-[#0a1628] border-gray-700 text-white",children:e.jsx(ol,{})}),e.jsxs(ta,{className:"bg-[#0f2137] border-gray-700",children:[kn.map(z=>e.jsx(Hr,{value:z.id,className:"text-white hover:bg-[#38bdac]/20 focus:bg-[#38bdac]/20",children:z.title},z.id)),kn.length===0&&e.jsx(Hr,{value:"chapter-1",className:"text-white hover:bg-[#38bdac]/20 focus:bg-[#38bdac]/20",children:"默认章"})]})]})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"内容 (Markdown格式)"}),e.jsx(jn,{className:"bg-[#0a1628] border-gray-700 text-white min-h-[300px] font-mono text-sm placeholder:text-gray-500",placeholder:"输入章节内容...",value:k.content,onChange:z=>L({...k,content:z.target.value})})]})]}),e.jsxs(Ft,{children:[e.jsx(Z,{variant:"outline",onClick:()=>y(!1),className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:"取消"}),e.jsx(Z,{onClick:ya,disabled:C||!k.id||!k.title,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:C?e.jsxs(e.Fragment,{children:[e.jsx($e,{className:"w-4 h-4 mr-2 animate-spin"}),"创建中..."]}):e.jsxs(e.Fragment,{children:[e.jsx(At,{className:"w-4 h-4 mr-2"}),"创建章节"]})})]})]})}),e.jsx(wt,{open:!!_,onOpenChange:z=>!z&&se(null),children:e.jsxs(vt,{className:"bg-[#0f2137] border-gray-700 text-white max-w-md",showCloseButton:!0,children:[e.jsx(St,{children:e.jsxs(Ct,{className:"text-white flex items-center gap-2",children:[e.jsx(yt,{className:"w-5 h-5 text-[#38bdac]"}),"编辑篇名"]})}),_&&e.jsx("div",{className:"space-y-4 py-4",children:e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"篇名"}),e.jsx(de,{className:"bg-[#0a1628] border-gray-700 text-white",value:_.title,onChange:z=>se({..._,title:z.target.value}),placeholder:"输入篇名"})]})}),e.jsxs(Ft,{children:[e.jsx(Z,{variant:"outline",onClick:()=>se(null),className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:"取消"}),e.jsx(Z,{onClick:ba,disabled:le||!((js=_==null?void 0:_.title)!=null&&js.trim()),className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:le?e.jsxs(e.Fragment,{children:[e.jsx($e,{className:"w-4 h-4 mr-2 animate-spin"}),"保存中..."]}):e.jsxs(e.Fragment,{children:[e.jsx(zt,{className:"w-4 h-4 mr-2"}),"保存"]})})]})]})}),e.jsx(wt,{open:!!Q,onOpenChange:z=>!z&&ce(null),children:e.jsxs(vt,{className:"bg-[#0f2137] border-gray-700 text-white max-w-md",showCloseButton:!0,children:[e.jsx(St,{children:e.jsxs(Ct,{className:"text-white flex items-center gap-2",children:[e.jsx(yt,{className:"w-5 h-5 text-[#38bdac]"}),"编辑章节名称"]})}),Q&&e.jsx("div",{className:"space-y-4 py-4",children:e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"章节名称(如:第8章|底层结构)"}),e.jsx(de,{className:"bg-[#0a1628] border-gray-700 text-white",value:Q.title,onChange:z=>ce({...Q,title:z.target.value}),placeholder:"输入章节名称"})]})}),e.jsxs(Ft,{children:[e.jsx(Z,{variant:"outline",onClick:()=>ce(null),className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:"取消"}),e.jsx(Z,{onClick:vs,disabled:re||!((Pl=Q==null?void 0:Q.title)!=null&&Pl.trim()),className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:re?e.jsxs(e.Fragment,{children:[e.jsx($e,{className:"w-4 h-4 mr-2 animate-spin"}),"保存中..."]}):e.jsxs(e.Fragment,{children:[e.jsx(zt,{className:"w-4 h-4 mr-2"}),"保存"]})})]})]})}),e.jsx(wt,{open:M,onOpenChange:z=>{var ae;if(O(z),z&&$t.length>0){const be=$t[0];X(be.id),ue(((ae=be.chapters[0])==null?void 0:ae.id)??"")}},children:e.jsxs(vt,{className:"bg-[#0f2137] border-gray-700 text-white max-w-md",showCloseButton:!0,children:[e.jsx(St,{children:e.jsx(Ct,{className:"text-white",children:"批量移动至指定目录"})}),e.jsxs("div",{className:"space-y-4 py-4",children:[e.jsxs("p",{className:"text-gray-400 text-sm",children:["已选 ",e.jsx("span",{className:"text-[#38bdac] font-medium",children:ne.length})," 节,请选择目标篇与章。"]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"目标篇"}),e.jsxs(il,{value:F,onValueChange:z=>{var be;X(z);const ae=$t.find(Ee=>Ee.id===z);ue(((be=ae==null?void 0:ae.chapters[0])==null?void 0:be.id)??"")},children:[e.jsx(ea,{className:"bg-[#0a1628] border-gray-700 text-white",children:e.jsx(ol,{placeholder:"选择篇"})}),e.jsx(ta,{className:"bg-[#0f2137] border-gray-700",children:$t.map(z=>e.jsx(Hr,{value:z.id,className:"text-white hover:bg-[#38bdac]/20 focus:bg-[#38bdac]/20",children:z.title},z.id))})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"目标章"}),e.jsxs(il,{value:H,onValueChange:ue,children:[e.jsx(ea,{className:"bg-[#0a1628] border-gray-700 text-white",children:e.jsx(ol,{placeholder:"选择章"})}),e.jsx(ta,{className:"bg-[#0f2137] border-gray-700",children:(((bs=$t.find(z=>z.id===F))==null?void 0:bs.chapters)??[]).map(z=>e.jsx(Hr,{value:z.id,className:"text-white hover:bg-[#38bdac]/20 focus:bg-[#38bdac]/20",children:z.title},z.id))})]})]})]}),e.jsxs(Ft,{children:[e.jsx(Z,{variant:"outline",onClick:()=>O(!1),className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:"取消"}),e.jsx(Z,{onClick:Cl,disabled:K||ne.length===0,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:K?e.jsxs(e.Fragment,{children:[e.jsx($e,{className:"w-4 h-4 mr-2 animate-spin"}),"移动中..."]}):"确认移动"})]})]})}),e.jsx(wt,{open:!!ze,onOpenChange:z=>!z&&We(null),children:e.jsxs(vt,{className:"bg-[#0f2137] border-gray-700 text-white max-w-3xl max-h-[85vh] overflow-hidden flex flex-col",showCloseButton:!0,children:[e.jsx(St,{children:e.jsxs(Ct,{className:"text-white",children:["付款记录 — ",(ze==null?void 0:ze.section.title)??""]})}),e.jsx("div",{className:"flex-1 overflow-y-auto py-2",children:qe?e.jsxs("div",{className:"flex items-center justify-center py-8",children:[e.jsx($e,{className:"w-6 h-6 text-[#38bdac] animate-spin"}),e.jsx("span",{className:"ml-2 text-gray-400",children:"加载中..."})]}):ze&&ze.orders.length===0?e.jsx("p",{className:"text-gray-500 text-center py-6",children:"暂无付款记录"}):ze?e.jsxs("table",{className:"w-full text-sm border-collapse",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"border-b border-gray-700 text-left text-gray-400",children:[e.jsx("th",{className:"py-2 pr-2",children:"订单号"}),e.jsx("th",{className:"py-2 pr-2",children:"用户ID"}),e.jsx("th",{className:"py-2 pr-2",children:"金额"}),e.jsx("th",{className:"py-2 pr-2",children:"状态"}),e.jsx("th",{className:"py-2 pr-2",children:"支付时间"})]})}),e.jsx("tbody",{children:ze.orders.map(z=>e.jsxs("tr",{className:"border-b border-gray-700/50",children:[e.jsx("td",{className:"py-2 pr-2 text-gray-300",children:z.orderSn??"-"}),e.jsx("td",{className:"py-2 pr-2 text-gray-300",children:z.userId??z.openId??"-"}),e.jsxs("td",{className:"py-2 pr-2 text-gray-300",children:["¥",z.amount??0]}),e.jsx("td",{className:"py-2 pr-2 text-gray-300",children:z.status??"-"}),e.jsx("td",{className:"py-2 pr-2 text-gray-500",children:z.payTime??z.createdAt??"-"})]},z.id??z.orderSn??""))})]}):null})]})}),e.jsx(wt,{open:st,onOpenChange:ft,children:e.jsxs(vt,{className:"bg-[#0f2137] border-gray-700 text-white max-w-md",showCloseButton:!0,children:[e.jsx(St,{children:e.jsxs(Ct,{className:"text-white flex items-center gap-2",children:[e.jsx(jd,{className:"w-5 h-5 text-amber-400"}),"文章排名算法"]})}),e.jsxs("div",{className:"space-y-4 py-2",children:[e.jsx("p",{className:"text-sm text-gray-400",children:"热度积分 = 阅读权重×阅读排名分 + 新度权重×新度排名分 + 付款权重×付款排名分(三权重之和须为 1)"}),Fr?e.jsx("p",{className:"text-gray-500",children:"加载中..."}):e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"grid grid-cols-3 gap-3",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsx(te,{className:"text-gray-400 text-xs",children:"阅读权重"}),e.jsx(de,{type:"number",step:"0.1",min:"0",max:"1",className:"bg-[#0a1628] border-gray-700 text-white",value:nt.readWeight,onChange:z=>Vt(ae=>({...ae,readWeight:Math.max(0,Math.min(1,parseFloat(z.target.value)||0))}))})]}),e.jsxs("div",{className:"space-y-1",children:[e.jsx(te,{className:"text-gray-400 text-xs",children:"新度权重"}),e.jsx(de,{type:"number",step:"0.1",min:"0",max:"1",className:"bg-[#0a1628] border-gray-700 text-white",value:nt.recencyWeight,onChange:z=>Vt(ae=>({...ae,recencyWeight:Math.max(0,Math.min(1,parseFloat(z.target.value)||0))}))})]}),e.jsxs("div",{className:"space-y-1",children:[e.jsx(te,{className:"text-gray-400 text-xs",children:"付款权重"}),e.jsx(de,{type:"number",step:"0.1",min:"0",max:"1",className:"bg-[#0a1628] border-gray-700 text-white",value:nt.payWeight,onChange:z=>Vt(ae=>({...ae,payWeight:Math.max(0,Math.min(1,parseFloat(z.target.value)||0))}))})]})]}),e.jsxs("p",{className:"text-xs text-gray-500",children:["当前之和: ",(nt.readWeight+nt.recencyWeight+nt.payWeight).toFixed(1)]}),e.jsxs("ul",{className:"list-disc list-inside space-y-1 text-xs text-gray-400",children:[e.jsx("li",{children:"阅读量前 20 名:得分 20~1"}),e.jsx("li",{children:"最近更新前 30 篇:得分 30~1"}),e.jsx("li",{children:"付款数前 20 名:得分 20~1"})]}),e.jsx(Z,{onClick:Ro,disabled:xs||Math.abs(nt.readWeight+nt.recencyWeight+nt.payWeight-1)>.001,className:"w-full bg-amber-500 hover:bg-amber-600 text-white",children:xs?"保存中...":"保存权重"})]})]})]})}),e.jsx(wt,{open:ee,onOpenChange:G,children:e.jsxs(vt,{className:"bg-[#0f2137] border-gray-700 text-white max-w-md",showCloseButton:!0,children:[e.jsx(St,{children:e.jsxs(Ct,{className:"text-white flex items-center gap-2",children:[e.jsx(At,{className:"w-5 h-5 text-amber-400"}),"新建篇"]})}),e.jsx("div",{className:"space-y-4 py-4",children:e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"篇名(如:第六篇|真实的社会)"}),e.jsx(de,{className:"bg-[#0a1628] border-gray-700 text-white",value:ge,onChange:z=>D(z.target.value),placeholder:"输入篇名"})]})}),e.jsxs(Ft,{children:[e.jsx(Z,{variant:"outline",onClick:()=>{G(!1),D("")},className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:"取消"}),e.jsx(Z,{onClick:Sl,disabled:fe||!ge.trim(),className:"bg-amber-500 hover:bg-amber-600 text-white",children:fe?e.jsxs(e.Fragment,{children:[e.jsx($e,{className:"w-4 h-4 mr-2 animate-spin"}),"创建中..."]}):e.jsxs(e.Fragment,{children:[e.jsx(At,{className:"w-4 h-4 mr-2"}),"创建篇"]})})]})]})}),e.jsx(wt,{open:!!h,onOpenChange:()=>m(null),children:e.jsxs(vt,{className:"bg-[#0f2137] border-gray-700 text-white max-w-4xl max-h-[90vh] flex flex-col p-0 gap-0",showCloseButton:!0,children:[e.jsx(St,{className:"shrink-0 px-6 pt-6 pb-2",children:e.jsxs(Ct,{className:"text-white flex items-center gap-2",children:[e.jsx(yt,{className:"w-5 h-5 text-[#38bdac]"}),"编辑章节"]})}),h&&e.jsxs("div",{className:"flex-1 overflow-y-auto min-h-0 px-6 space-y-4 py-4",children:[e.jsxs("div",{className:"grid grid-cols-3 gap-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"章节ID"}),e.jsx(de,{className:"bg-[#0a1628] border-gray-700 text-white",value:h.id,disabled:!0})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"价格 (元)"}),e.jsx(de,{type:"number",className:"bg-[#0a1628] border-gray-700 text-white",value:h.isFree?0:h.price,onChange:z=>m({...h,price:Number(z.target.value),isFree:Number(z.target.value)===0}),disabled:h.isFree})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"免费章节(唯一入口,小程序以 is_free 或 price=0 为准)"}),e.jsx("div",{className:"flex items-center h-10",children:e.jsxs("label",{className:"flex items-center cursor-pointer",children:[e.jsx("input",{type:"checkbox",checked:h.isFree||h.price===0,onChange:z=>m({...h,isFree:z.target.checked,price:z.target.checked?0:1}),className:"w-5 h-5 rounded border-gray-600 bg-[#0a1628] text-[#38bdac] focus:ring-[#38bdac]"}),e.jsx("span",{className:"ml-2 text-gray-400 text-sm",children:"设为免费"})]})})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"最新新增"}),e.jsx("div",{className:"flex items-center h-10",children:e.jsxs("label",{className:"flex items-center cursor-pointer",children:[e.jsx("input",{type:"checkbox",checked:h.isNew??!1,onChange:z=>m({...h,isNew:z.target.checked}),className:"w-5 h-5 rounded border-gray-600 bg-[#0a1628] text-[#38bdac] focus:ring-[#38bdac]"}),e.jsx("span",{className:"ml-2 text-gray-400 text-sm",children:"标记 NEW"})]})})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"章节标题"}),e.jsx(de,{className:"bg-[#0a1628] border-gray-700 text-white",value:h.title,onChange:z=>m({...h,title:z.target.value})})]}),h.filePath&&e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"文件路径"}),e.jsx(de,{className:"bg-[#0a1628] border-gray-700 text-gray-400 text-sm",value:h.filePath,disabled:!0})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx(te,{className:"text-gray-300",children:"内容 (Markdown格式)"}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx("input",{ref:U,type:"file",accept:"image/*",onChange:wa,className:"hidden"}),e.jsxs(Z,{variant:"outline",size:"sm",onClick:()=>{var z;return(z=U.current)==null?void 0:z.click()},disabled:R,className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:[R?e.jsx($e,{className:"w-4 h-4 mr-1 animate-spin"}):e.jsx($x,{className:"w-4 h-4 mr-1"}),"上传图片"]})]})]}),g?e.jsxs("div",{className:"bg-[#0a1628] border border-gray-700 rounded-md min-h-[400px] flex items-center justify-center",children:[e.jsx($e,{className:"w-6 h-6 text-[#38bdac] animate-spin"}),e.jsx("span",{className:"ml-2 text-gray-400",children:"加载中..."})]}):e.jsx(jn,{className:"bg-[#0a1628] border-gray-700 text-white min-h-[400px] font-mono text-sm placeholder:text-gray-500",placeholder:"此处输入章节内容,支持Markdown格式...",value:h.content,onChange:z=>m({...h,content:z.target.value})})]})]}),e.jsxs(Ft,{className:"shrink-0 px-6 py-4 border-t border-gray-700/50",children:[e.jsxs(Z,{variant:"outline",onClick:()=>m(null),className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:[e.jsx(Sr,{className:"w-4 h-4 mr-2"}),"取消"]}),e.jsx(Z,{onClick:Io,disabled:C,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:C?e.jsxs(e.Fragment,{children:[e.jsx($e,{className:"w-4 h-4 mr-2 animate-spin"}),"保存中..."]}):e.jsxs(e.Fragment,{children:[e.jsx(zt,{className:"w-4 h-4 mr-2"}),"保存修改"]})})]})]})}),e.jsxs(bo,{defaultValue:"chapters",className:"space-y-6",children:[e.jsxs(jl,{className:"bg-[#0f2137] border border-gray-700/50 p-1",children:[e.jsxs(Zt,{value:"chapters",className:"data-[state=active]:bg-[#38bdac]/20 data-[state=active]:text-[#38bdac] text-gray-400",children:[e.jsx(us,{className:"w-4 h-4 mr-2"}),"章节管理"]}),e.jsxs(Zt,{value:"search",className:"data-[state=active]:bg-[#38bdac]/20 data-[state=active]:text-[#38bdac] text-gray-400",children:[e.jsx(yn,{className:"w-4 h-4 mr-2"}),"内容搜索"]}),e.jsxs(Zt,{value:"hooks",className:"data-[state=active]:bg-[#38bdac]/20 data-[state=active]:text-[#38bdac] text-gray-400",children:[e.jsx(jd,{className:"w-4 h-4 mr-2"}),"钩子配置"]})]}),e.jsxs(er,{value:"chapters",className:"space-y-4",children:[e.jsxs("div",{className:"rounded-2xl border border-gray-700/50 bg-[#1C1C1E] p-4 flex items-center justify-between shadow-sm",children:[e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsx("div",{className:"w-12 h-12 rounded-xl bg-[#38bdac] flex items-center justify-center text-white shadow-lg shadow-[#38bdac]/20 shrink-0",children:e.jsx(us,{className:"w-6 h-6"})}),e.jsxs("div",{children:[e.jsx("h2",{className:"font-bold text-base text-white leading-tight mb-1",children:"一场SOUL的创业实验场"}),e.jsx("p",{className:"text-xs text-gray-500",children:"来自Soul派对房的真实商业故事"})]})]}),e.jsxs("div",{className:"text-center shrink-0",children:[e.jsx("span",{className:"block text-2xl font-bold text-[#38bdac]",children:gs}),e.jsx("span",{className:"text-xs text-gray-500",children:"章节"})]})]}),e.jsxs("div",{className:"flex flex-wrap gap-2",children:[e.jsxs(Z,{onClick:()=>y(!0),className:"flex-1 min-w-[120px] bg-[#38bdac]/10 hover:bg-[#38bdac]/20 text-[#38bdac] border border-[#38bdac]/30",children:[e.jsx(At,{className:"w-4 h-4 mr-2"}),"新建章节"]}),e.jsxs(Z,{onClick:()=>G(!0),className:"flex-1 min-w-[120px] bg-amber-500/10 hover:bg-amber-500/20 text-amber-400 border border-amber-500/30",children:[e.jsx(At,{className:"w-4 h-4 mr-2"}),"新建篇"]}),e.jsxs(Z,{variant:"outline",onClick:()=>O(!0),className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:["批量移动(已选 ",ne.length," 节)"]})]}),l?e.jsxs("div",{className:"flex items-center justify-center py-12",children:[e.jsx($e,{className:"w-6 h-6 text-[#38bdac] animate-spin"}),e.jsx("span",{className:"ml-2 text-gray-400",children:"加载中..."})]}):e.jsx(FC,{parts:$t,expandedParts:c,onTogglePart:Qe,onReorder:Tt,onReadSection:ga,onDeleteSection:dr,onAddSectionInPart:va,onAddChapterInPart:Na,onDeleteChapter:wl,onEditPart:ja,onDeletePart:El,onEditChapter:ys,selectedSectionIds:ne,onToggleSectionSelect:kl,onShowSectionOrders:Nl})]}),e.jsx(er,{value:"search",className:"space-y-4",children:e.jsxs(Ne,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:[e.jsx(Ue,{children:e.jsx(Ve,{className:"text-white",children:"内容搜索"})}),e.jsxs(we,{className:"space-y-4",children:[e.jsxs("div",{className:"flex gap-2",children:[e.jsx(de,{className:"bg-[#0a1628] border-gray-700 text-white placeholder:text-gray-500 flex-1",placeholder:"搜索标题或内容...",value:T,onChange:z=>S(z.target.value),onKeyDown:z=>z.key==="Enter"&&Sa()}),e.jsx(Z,{onClick:Sa,disabled:E||!T.trim(),className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:E?e.jsx($e,{className:"w-4 h-4 animate-spin"}):e.jsx(yn,{className:"w-4 h-4"})})]}),b.length>0&&e.jsxs("div",{className:"space-y-2 mt-4",children:[e.jsxs("p",{className:"text-gray-400 text-sm",children:["找到 ",b.length," 个结果"]}),b.map(z=>e.jsxs("div",{className:"p-3 rounded-lg bg-[#162840] hover:bg-[#1a3050] cursor-pointer transition-colors",onClick:()=>ga({id:z.id,title:z.title,price:z.price??1,filePath:""}),children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx("span",{className:"text-[#38bdac] font-mono text-xs mr-2",children:z.id}),e.jsx("span",{className:"text-white",children:z.title})]}),e.jsx(Oe,{variant:"outline",className:"text-gray-400 border-gray-600 text-xs",children:z.matchType==="title"?"标题匹配":"内容匹配"})]}),z.snippet&&e.jsx("p",{className:"text-gray-500 text-xs mt-2 line-clamp-2",children:z.snippet}),(z.partTitle||z.chapterTitle)&&e.jsxs("p",{className:"text-gray-600 text-xs mt-1",children:[z.partTitle," · ",z.chapterTitle]})]},z.id))]})]})]})}),e.jsx(er,{value:"hooks",className:"space-y-4",children:e.jsxs(Ne,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:[e.jsx(Ue,{children:e.jsx(Ve,{className:"text-white",children:"引流钩子配置"})}),e.jsxs(we,{className:"space-y-4",children:[e.jsxs("div",{className:"grid w-full max-w-sm items-center gap-1.5",children:[e.jsx(te,{htmlFor:"hook-chapter",className:"text-gray-300",children:"触发章节"}),e.jsxs(il,{defaultValue:"3",children:[e.jsx(ea,{id:"hook-chapter",className:"bg-[#0a1628] border-gray-700 text-white",children:e.jsx(ol,{placeholder:"选择章节"})}),e.jsxs(ta,{className:"bg-[#0f2137] border-gray-700",children:[e.jsx(Hr,{value:"1",className:"text-white hover:bg-[#38bdac]/20 focus:bg-[#38bdac]/20",children:"第一章"}),e.jsx(Hr,{value:"2",className:"text-white hover:bg-[#38bdac]/20 focus:bg-[#38bdac]/20",children:"第二章"}),e.jsx(Hr,{value:"3",className:"text-white hover:bg-[#38bdac]/20 focus:bg-[#38bdac]/20",children:"第三章 (默认)"})]})]})]}),e.jsxs("div",{className:"grid w-full gap-1.5",children:[e.jsx(te,{htmlFor:"message",className:"text-gray-300",children:"引流文案"}),e.jsx(jn,{placeholder:"输入引导用户加群的文案...",id:"message",className:"bg-[#0a1628] border-gray-700 text-white placeholder:text-gray-500",defaultValue:"阅读更多精彩内容,请加入Soul创业实验派对群..."})]}),e.jsx(Z,{className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:"保存配置"})]})]})})]})]})}var l0=["PageUp","PageDown"],i0=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],o0={"from-left":["Home","PageDown","ArrowDown","ArrowLeft"],"from-right":["Home","PageDown","ArrowDown","ArrowRight"],"from-bottom":["Home","PageDown","ArrowDown","ArrowLeft"],"from-top":["Home","PageDown","ArrowUp","ArrowLeft"]},pa="Slider",[ru,BC,UC]=ku(pa),[c0]=en(pa,[UC]),[VC,To]=c0(pa),d0=f.forwardRef((s,a)=>{const{name:l,min:o=0,max:c=100,step:d=1,orientation:h="horizontal",disabled:m=!1,minStepsBetweenThumbs:p=0,defaultValue:y=[o],value:g,onValueChange:v=()=>{},onValueCommit:C=()=>{},inverted:P=!1,form:T,...S}=s,b=f.useRef(new Set),N=f.useRef(0),j=h==="horizontal"?WC:HC,[R=[],B]=bn({prop:g,defaultProp:y,onChange:le=>{var ee;(ee=[...b.current][N.current])==null||ee.focus(),v(le)}}),U=f.useRef(R);function k(le){const ie=qC(R,le);se(le,ie)}function L(le){se(le,N.current)}function _(){const le=U.current[N.current];R[N.current]!==le&&C(R)}function se(le,ie,{commit:ee}={commit:!1}){const G=e4(d),Q=t4(Math.round((le-o)/d)*d+o,G),ce=no(Q,[o,c]);B((re=[])=>{const A=GC(re,ce,ie);if(ZC(A,p*d)){N.current=A.indexOf(ce);const ne=String(A)!==String(re);return ne&&ee&&C(A),ne?A:re}else return re})}return e.jsx(VC,{scope:s.__scopeSlider,name:l,disabled:m,min:o,max:c,valueIndexToChangeRef:N,thumbs:b.current,values:R,orientation:h,form:T,children:e.jsx(ru.Provider,{scope:s.__scopeSlider,children:e.jsx(ru.Slot,{scope:s.__scopeSlider,children:e.jsx(j,{"aria-disabled":m,"data-disabled":m?"":void 0,...S,ref:a,onPointerDown:Be(S.onPointerDown,()=>{m||(U.current=R)}),min:o,max:c,inverted:P,onSlideStart:m?void 0:k,onSlideMove:m?void 0:L,onSlideEnd:m?void 0:_,onHomeKeyDown:()=>!m&&se(o,0,{commit:!0}),onEndKeyDown:()=>!m&&se(c,R.length-1,{commit:!0}),onStepKeyDown:({event:le,direction:ie})=>{if(!m){const Q=l0.includes(le.key)||le.shiftKey&&i0.includes(le.key)?10:1,ce=N.current,re=R[ce],A=d*Q*ie;se(re+A,ce,{commit:!0})}}})})})})});d0.displayName=pa;var[u0,h0]=c0(pa,{startEdge:"left",endEdge:"right",size:"width",direction:1}),WC=f.forwardRef((s,a)=>{const{min:l,max:o,dir:c,inverted:d,onSlideStart:h,onSlideMove:m,onSlideEnd:p,onStepKeyDown:y,...g}=s,[v,C]=f.useState(null),P=et(a,j=>C(j)),T=f.useRef(void 0),S=vo(c),b=S==="ltr",N=b&&!d||!b&&d;function E(j){const R=T.current||v.getBoundingClientRect(),B=[0,R.width],k=Ou(B,N?[l,o]:[o,l]);return T.current=R,k(j-R.left)}return e.jsx(u0,{scope:s.__scopeSlider,startEdge:N?"left":"right",endEdge:N?"right":"left",direction:N?1:-1,size:"width",children:e.jsx(f0,{dir:S,"data-orientation":"horizontal",...g,ref:P,style:{...g.style,"--radix-slider-thumb-transform":"translateX(-50%)"},onSlideStart:j=>{const R=E(j.clientX);h==null||h(R)},onSlideMove:j=>{const R=E(j.clientX);m==null||m(R)},onSlideEnd:()=>{T.current=void 0,p==null||p()},onStepKeyDown:j=>{const B=o0[N?"from-left":"from-right"].includes(j.key);y==null||y({event:j,direction:B?-1:1})}})})}),HC=f.forwardRef((s,a)=>{const{min:l,max:o,inverted:c,onSlideStart:d,onSlideMove:h,onSlideEnd:m,onStepKeyDown:p,...y}=s,g=f.useRef(null),v=et(a,g),C=f.useRef(void 0),P=!c;function T(S){const b=C.current||g.current.getBoundingClientRect(),N=[0,b.height],j=Ou(N,P?[o,l]:[l,o]);return C.current=b,j(S-b.top)}return e.jsx(u0,{scope:s.__scopeSlider,startEdge:P?"bottom":"top",endEdge:P?"top":"bottom",size:"height",direction:P?1:-1,children:e.jsx(f0,{"data-orientation":"vertical",...y,ref:v,style:{...y.style,"--radix-slider-thumb-transform":"translateY(50%)"},onSlideStart:S=>{const b=T(S.clientY);d==null||d(b)},onSlideMove:S=>{const b=T(S.clientY);h==null||h(b)},onSlideEnd:()=>{C.current=void 0,m==null||m()},onStepKeyDown:S=>{const N=o0[P?"from-bottom":"from-top"].includes(S.key);p==null||p({event:S,direction:N?-1:1})}})})}),f0=f.forwardRef((s,a)=>{const{__scopeSlider:l,onSlideStart:o,onSlideMove:c,onSlideEnd:d,onHomeKeyDown:h,onEndKeyDown:m,onStepKeyDown:p,...y}=s,g=To(pa,l);return e.jsx(Ke.span,{...y,ref:a,onKeyDown:Be(s.onKeyDown,v=>{v.key==="Home"?(h(v),v.preventDefault()):v.key==="End"?(m(v),v.preventDefault()):l0.concat(i0).includes(v.key)&&(p(v),v.preventDefault())}),onPointerDown:Be(s.onPointerDown,v=>{const C=v.target;C.setPointerCapture(v.pointerId),v.preventDefault(),g.thumbs.has(C)?C.focus():o(v)}),onPointerMove:Be(s.onPointerMove,v=>{v.target.hasPointerCapture(v.pointerId)&&c(v)}),onPointerUp:Be(s.onPointerUp,v=>{const C=v.target;C.hasPointerCapture(v.pointerId)&&(C.releasePointerCapture(v.pointerId),d(v))})})}),m0="SliderTrack",x0=f.forwardRef((s,a)=>{const{__scopeSlider:l,...o}=s,c=To(m0,l);return e.jsx(Ke.span,{"data-disabled":c.disabled?"":void 0,"data-orientation":c.orientation,...o,ref:a})});x0.displayName=m0;var su="SliderRange",p0=f.forwardRef((s,a)=>{const{__scopeSlider:l,...o}=s,c=To(su,l),d=h0(su,l),h=f.useRef(null),m=et(a,h),p=c.values.length,y=c.values.map(C=>v0(C,c.min,c.max)),g=p>1?Math.min(...y):0,v=100-Math.max(...y);return e.jsx(Ke.span,{"data-orientation":c.orientation,"data-disabled":c.disabled?"":void 0,...o,ref:m,style:{...s.style,[d.startEdge]:g+"%",[d.endEdge]:v+"%"}})});p0.displayName=su;var nu="SliderThumb",g0=f.forwardRef((s,a)=>{const l=BC(s.__scopeSlider),[o,c]=f.useState(null),d=et(a,m=>c(m)),h=f.useMemo(()=>o?l().findIndex(m=>m.ref.current===o):-1,[l,o]);return e.jsx(KC,{...s,ref:d,index:h})}),KC=f.forwardRef((s,a)=>{const{__scopeSlider:l,index:o,name:c,...d}=s,h=To(nu,l),m=h0(nu,l),[p,y]=f.useState(null),g=et(a,E=>y(E)),v=p?h.form||!!p.closest("form"):!0,C=Cu(p),P=h.values[o],T=P===void 0?0:v0(P,h.min,h.max),S=QC(o,h.values.length),b=C==null?void 0:C[m.size],N=b?XC(b,T,m.direction):0;return f.useEffect(()=>{if(p)return h.thumbs.add(p),()=>{h.thumbs.delete(p)}},[p,h.thumbs]),e.jsxs("span",{style:{transform:"var(--radix-slider-thumb-transform)",position:"absolute",[m.startEdge]:`calc(${T}% + ${N}px)`},children:[e.jsx(ru.ItemSlot,{scope:s.__scopeSlider,children:e.jsx(Ke.span,{role:"slider","aria-label":s["aria-label"]||S,"aria-valuemin":h.min,"aria-valuenow":P,"aria-valuemax":h.max,"aria-orientation":h.orientation,"data-orientation":h.orientation,"data-disabled":h.disabled?"":void 0,tabIndex:h.disabled?void 0:0,...d,ref:g,style:P===void 0?{display:"none"}:s.style,onFocus:Be(s.onFocus,()=>{h.valueIndexToChangeRef.current=o})})}),v&&e.jsx(y0,{name:c??(h.name?h.name+(h.values.length>1?"[]":""):void 0),form:h.form,value:P},o)]})});g0.displayName=nu;var YC="RadioBubbleInput",y0=f.forwardRef(({__scopeSlider:s,value:a,...l},o)=>{const c=f.useRef(null),d=et(c,o),h=Su(a);return f.useEffect(()=>{const m=c.current;if(!m)return;const p=window.HTMLInputElement.prototype,g=Object.getOwnPropertyDescriptor(p,"value").set;if(h!==a&&g){const v=new Event("input",{bubbles:!0});g.call(m,a),m.dispatchEvent(v)}},[h,a]),e.jsx(Ke.input,{style:{display:"none"},...l,ref:d,defaultValue:a})});y0.displayName=YC;function GC(s=[],a,l){const o=[...s];return o[l]=a,o.sort((c,d)=>c-d)}function v0(s,a,l){const d=100/(l-a)*(s-a);return no(d,[0,100])}function QC(s,a){return a>2?`Value ${s+1} of ${a}`:a===2?["Minimum","Maximum"][s]:void 0}function qC(s,a){if(s.length===1)return 0;const l=s.map(c=>Math.abs(c-a)),o=Math.min(...l);return l.indexOf(o)}function XC(s,a,l){const o=s/2,d=Ou([0,50],[0,o]);return(o-d(a)*l)*l}function JC(s){return s.slice(0,-1).map((a,l)=>s[l+1]-a)}function ZC(s,a){if(a>0){const l=JC(s);return Math.min(...l)>=a}return!0}function Ou(s,a){return l=>{if(s[0]===s[1]||a[0]===a[1])return a[0];const o=(a[1]-a[0])/(s[1]-s[0]);return a[0]+o*(l-s[0])}}function e4(s){return(String(s).split(".")[1]||"").length}function t4(s,a){const l=Math.pow(10,a);return Math.round(s*l)/l}var r4=d0,s4=x0,n4=p0,a4=g0;function l4({className:s,defaultValue:a,value:l,min:o=0,max:c=100,...d}){const h=f.useMemo(()=>Array.isArray(l)?l:Array.isArray(a)?a:[o,c],[l,a,o,c]);return e.jsxs(r4,{defaultValue:a,value:l,min:o,max:c,className:tt("relative flex w-full touch-none items-center select-none data-[disabled]:opacity-50",s),...d,children:[e.jsx(s4,{className:"bg-gray-600 relative grow overflow-hidden rounded-full h-1.5 w-full",children:e.jsx(n4,{className:"bg-[#38bdac] absolute h-full rounded-full"})}),Array.from({length:h.length},(m,p)=>e.jsx(a4,{className:"block size-4 shrink-0 rounded-full border-2 border-[#38bdac] bg-white shadow-sm focus-visible:ring-2 focus-visible:ring-[#38bdac] focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50"},p))]})}const i4={distributorShare:90,minWithdrawAmount:10,bindingDays:30,userDiscount:5,enableAutoWithdraw:!1,vipOrderShareVip:20,vipOrderShareNonVip:10};function o4(){const[s,a]=f.useState(i4),[l,o]=f.useState(!0),[c,d]=f.useState(!1);f.useEffect(()=>{Fe("/api/admin/referral-settings").then(p=>{const y=p==null?void 0:p.data;y&&typeof y=="object"&&a({distributorShare:y.distributorShare??90,minWithdrawAmount:y.minWithdrawAmount??10,bindingDays:y.bindingDays??30,userDiscount:y.userDiscount??5,enableAutoWithdraw:y.enableAutoWithdraw??!1,vipOrderShareVip:y.vipOrderShareVip??20,vipOrderShareNonVip:y.vipOrderShareNonVip??10})}).catch(console.error).finally(()=>o(!1))},[]);const h=async()=>{d(!0);try{const p={distributorShare:Number(s.distributorShare)||0,minWithdrawAmount:Number(s.minWithdrawAmount)||0,bindingDays:Number(s.bindingDays)||0,userDiscount:Number(s.userDiscount)||0,enableAutoWithdraw:!!s.enableAutoWithdraw,vipOrderShareVip:Number(s.vipOrderShareVip)||20,vipOrderShareNonVip:Number(s.vipOrderShareNonVip)||10},y=await Et("/api/admin/referral-settings",p);if(!y||y.success===!1){alert("保存失败: "+(y&&typeof y=="object"&&"error"in y?y.error:""));return}alert(`✅ 分销配置已保存成功! + +• 小程序与网站的推广规则会一起生效 +• 绑定关系会使用新的天数配置 +• 佣金比例会立即应用到新订单 + +如有缓存,请刷新前台/小程序页面。`)}catch(p){console.error(p),alert("保存失败: "+(p instanceof Error?p.message:String(p)))}finally{d(!1)}},m=p=>y=>{const g=parseFloat(y.target.value||"0");a(v=>({...v,[p]:isNaN(g)?0:g}))};return l?e.jsx("div",{className:"p-8 text-gray-500",children:"加载中..."}):e.jsxs("div",{className:"p-8 w-full",children:[e.jsxs("div",{className:"flex justify-between items-center mb-8",children:[e.jsxs("div",{children:[e.jsxs("h2",{className:"text-2xl font-bold text-white flex items-center gap-2",children:[e.jsx(aa,{className:"w-5 h-5 text-[#38bdac]"}),"推广 / 分销设置"]}),e.jsx("p",{className:"text-gray-400 mt-1",children:"统一管理「好友优惠」「你得 90% 收益」「绑定期 30 天」「提现门槛」等规则,小程序和 Web 共用这套配置。"})]}),e.jsxs(Z,{onClick:h,disabled:c||l,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:[e.jsx(zt,{className:"w-4 h-4 mr-2"}),c?"保存中...":"保存配置"]})]}),e.jsxs("div",{className:"space-y-6",children:[e.jsxs(Ne,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:[e.jsxs(Ue,{children:[e.jsxs(Ve,{className:"flex items-center gap-2 text-white",children:[e.jsx(Ub,{className:"w-4 h-4 text-[#38bdac]"}),"推广规则"]}),e.jsx(ht,{className:"text-gray-400",children:"这三项会直接体现在小程序「推广规则」卡片上,同时影响实收佣金计算。"})]}),e.jsx(we,{className:"space-y-6",children:e.jsxs("div",{className:"grid grid-cols-3 gap-6",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsxs(te,{className:"text-gray-300 flex items-center gap-2",children:[e.jsx(Li,{className:"w-3 h-3 text-[#38bdac]"}),"好友优惠(%)"]}),e.jsx(de,{type:"number",min:0,max:100,className:"bg-[#0a1628] border-gray-700 text-white",value:s.userDiscount,onChange:m("userDiscount")}),e.jsx("p",{className:"text-xs text-gray-500",children:"例如 5 表示好友立减 5%(在价格配置基础上生效)。"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs(te,{className:"text-gray-300 flex items-center gap-2",children:[e.jsx(Qt,{className:"w-3 h-3 text-[#38bdac]"}),"推广者分成(%)"]}),e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsx(l4,{className:"flex-1",min:10,max:100,step:1,value:[s.distributorShare],onValueChange:([p])=>a(y=>({...y,distributorShare:p}))}),e.jsx(de,{type:"number",min:0,max:100,className:"w-20 bg-[#0a1628] border-gray-700 text-white text-center",value:s.distributorShare,onChange:m("distributorShare")})]}),e.jsxs("p",{className:"text-xs text-gray-500",children:["内容订单佣金 = 订单金额 ×"," ",e.jsxs("span",{className:"text-[#38bdac] font-mono",children:[s.distributorShare,"%"]}),";会员订单见下方。"]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs(te,{className:"text-gray-300 flex items-center gap-2",children:[e.jsx(Li,{className:"w-3 h-3 text-[#38bdac]"}),"会员订单分润(推广者是会员 %)"]}),e.jsx(de,{type:"number",min:0,max:100,className:"bg-[#0a1628] border-gray-700 text-white",value:s.vipOrderShareVip,onChange:m("vipOrderShareVip")}),e.jsx("p",{className:"text-xs text-gray-500",children:"推广者已是会员时,会员订单佣金比例,默认 20%。"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs(te,{className:"text-gray-300 flex items-center gap-2",children:[e.jsx(Li,{className:"w-3 h-3 text-[#38bdac]"}),"会员订单分润(推广者非会员 %)"]}),e.jsx(de,{type:"number",min:0,max:100,className:"bg-[#0a1628] border-gray-700 text-white",value:s.vipOrderShareNonVip,onChange:m("vipOrderShareNonVip")}),e.jsx("p",{className:"text-xs text-gray-500",children:"推广者非会员时,会员订单佣金比例,默认 10%。"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs(te,{className:"text-gray-300 flex items-center gap-2",children:[e.jsx(Qt,{className:"w-3 h-3 text-[#38bdac]"}),"绑定有效期(天)"]}),e.jsx(de,{type:"number",min:1,max:365,className:"bg-[#0a1628] border-gray-700 text-white",value:s.bindingDays,onChange:m("bindingDays")}),e.jsx("p",{className:"text-xs text-gray-500",children:"好友通过你的链接进来并登录后,绑定在你名下的天数。"})]})]})})]}),e.jsxs(Ne,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:[e.jsxs(Ue,{children:[e.jsxs(Ve,{className:"flex items-center gap-2 text-white",children:[e.jsx(aa,{className:"w-4 h-4 text-[#38bdac]"}),"提现规则"]}),e.jsx(ht,{className:"text-gray-400",children:"与「提现中心」「自动提现」相关的参数,影响推广者看到的可提现金额和最低门槛。"})]}),e.jsx(we,{className:"space-y-6",children:e.jsxs("div",{className:"grid grid-cols-2 gap-6",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"最低提现金额(元)"}),e.jsx(de,{type:"number",min:0,step:1,className:"bg-[#0a1628] border-gray-700 text-white",value:s.minWithdrawAmount,onChange:m("minWithdrawAmount")}),e.jsx("p",{className:"text-xs text-gray-500",children:"小程序「满 X 元可提现」展示的门槛,同时用于后端接口校验。"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs(te,{className:"text-gray-300 flex items-center gap-2",children:["自动提现开关",e.jsx(Oe,{variant:"outline",className:"border-[#38bdac]/40 text-[#38bdac] text-[10px]",children:"预留"})]}),e.jsxs("div",{className:"flex items-center gap-3 mt-1",children:[e.jsx(it,{checked:s.enableAutoWithdraw,onCheckedChange:p=>a(y=>({...y,enableAutoWithdraw:p}))}),e.jsx("span",{className:"text-sm text-gray-400",children:"开启后,可结合定时任务实现「收益自动打款到微信零钱」。"})]})]})]})})]}),e.jsxs(Ne,{className:"bg-[#0f2137] border-gray-700/50",children:[e.jsx(Ue,{children:e.jsxs(Ve,{className:"flex items-center gap-2 text-gray-200 text-sm",children:[e.jsx(Li,{className:"w-4 h-4 text-[#38bdac]"}),"使用说明"]})}),e.jsxs(we,{className:"space-y-2 text-xs text-gray-400 leading-relaxed",children:[e.jsxs("p",{children:["1. 以上配置会写入"," ",e.jsx("code",{className:"font-mono text-[11px] text-[#38bdac]",children:"system_config.referral_config"}),",小程序「推广中心」、Web 推广页以及支付回调都会读取同一份配置。"]}),e.jsx("p",{children:"2. 修改后新订单立即生效;旧订单的历史佣金不会自动重算,只影响之后产生的订单。"}),e.jsx("p",{children:"3. 如遇前端展示与实际结算不一致,优先以此处配置为准,再排查缓存和小程序版本。"})]})]})]})]})}const cs={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 mx(s){return Array.isArray(s)?s.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):cs.stats}function xx(s){return Array.isArray(s)?s.map(a=>typeof a=="string"?a:String(a??"")).filter(Boolean):cs.highlights}function c4(){const[s,a]=f.useState(cs),[l,o]=f.useState(!0),[c,d]=f.useState(!1),[h,m]=f.useState(!1),p=f.useRef(null);f.useEffect(()=>{Fe("/api/admin/author-settings").then(N=>{const E=N==null?void 0:N.data;E&&typeof E=="object"&&a({name:String(E.name??cs.name),avatar:String(E.avatar??cs.avatar),avatarImg:String(E.avatarImg??""),title:String(E.title??cs.title),bio:String(E.bio??cs.bio),stats:mx(E.stats).length?mx(E.stats):cs.stats,highlights:xx(E.highlights).length?xx(E.highlights):cs.highlights})}).catch(console.error).finally(()=>o(!1))},[]);const y=async()=>{d(!0);try{const N={name:s.name,avatar:s.avatar||"K",avatarImg:s.avatarImg,title:s.title,bio:s.bio,stats:s.stats.filter(R=>R.label||R.value),highlights:s.highlights.filter(Boolean)},E=await Et("/api/admin/author-settings",N);if(!E||E.success===!1){alert("保存失败: "+(E&&typeof E=="object"&&"error"in E?E.error:""));return}d(!1);const j=document.createElement("div");j.className="fixed top-4 right-4 z-50 px-4 py-2 rounded-lg bg-[#38bdac] text-white text-sm shadow-lg",j.textContent="作者设置已保存",document.body.appendChild(j),setTimeout(()=>j.remove(),2e3)}catch(N){console.error(N),alert("保存失败: "+(N instanceof Error?N.message:String(N)))}finally{d(!1)}},g=async N=>{var j;const E=(j=N.target.files)==null?void 0:j[0];if(E){m(!0);try{const R=new FormData;R.append("file",E),R.append("folder","avatars");const B=fu(),U={};B&&(U.Authorization=`Bearer ${B}`);const L=await(await fetch(la("/api/upload"),{method:"POST",body:R,credentials:"include",headers:U})).json();L!=null&&L.success&&(L!=null&&L.url)?a(_=>({..._,avatarImg:L.url})):alert("上传失败: "+((L==null?void 0:L.error)||"未知错误"))}catch(R){console.error(R),alert("上传失败")}finally{m(!1),p.current&&(p.current.value="")}}},v=()=>a(N=>({...N,stats:[...N.stats,{label:"",value:""}]})),C=N=>a(E=>({...E,stats:E.stats.filter((j,R)=>R!==N)})),P=(N,E,j)=>a(R=>({...R,stats:R.stats.map((B,U)=>U===N?{...B,[E]:j}:B)})),T=()=>a(N=>({...N,highlights:[...N.highlights,""]})),S=N=>a(E=>({...E,highlights:E.highlights.filter((j,R)=>R!==N)})),b=(N,E)=>a(j=>({...j,highlights:j.highlights.map((R,B)=>B===N?E:R)}));return l?e.jsx("div",{className:"p-8 text-gray-500",children:"加载中..."}):e.jsxs("div",{className:"p-8 w-full",children:[e.jsxs("div",{className:"flex justify-between items-center mb-8",children:[e.jsxs("div",{children:[e.jsxs("h2",{className:"text-2xl font-bold text-white flex items-center gap-2",children:[e.jsx(ra,{className:"w-5 h-5 text-[#38bdac]"}),"作者详情"]}),e.jsx("p",{className:"text-gray-400 mt-1",children:"配置小程序「关于作者」页展示的作者信息,包括头像、简介、统计数据与亮点标签。"})]}),e.jsxs(Z,{onClick:y,disabled:c||l,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:[e.jsx(zt,{className:"w-4 h-4 mr-2"}),c?"保存中...":"保存"]})]}),e.jsxs("div",{className:"space-y-6",children:[e.jsxs(Ne,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:[e.jsxs(Ue,{children:[e.jsxs(Ve,{className:"flex items-center gap-2 text-white",children:[e.jsx(ra,{className:"w-4 h-4 text-[#38bdac]"}),"基本信息"]}),e.jsx(ht,{className:"text-gray-400",children:"作者姓名、头像、头衔与个人简介,将展示在「关于作者」页顶部。"})]}),e.jsxs(we,{className:"space-y-4",children:[e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"姓名"}),e.jsx(de,{className:"bg-[#0a1628] border-gray-700 text-white",value:s.name,onChange:N=>a(E=>({...E,name:N.target.value})),placeholder:"卡若"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"首字母占位(无头像时显示)"}),e.jsx(de,{className:"bg-[#0a1628] border-gray-700 text-white w-20",value:s.avatar,onChange:N=>a(E=>({...E,avatar:N.target.value.slice(0,1)||"K"})),placeholder:"K"})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs(te,{className:"text-gray-300 flex items-center gap-2",children:[e.jsx($x,{className:"w-3 h-3 text-[#38bdac]"}),"头像图片"]}),e.jsxs("div",{className:"flex gap-3 items-center",children:[e.jsx(de,{className:"flex-1 bg-[#0a1628] border-gray-700 text-white",value:s.avatarImg,onChange:N=>a(E=>({...E,avatarImg:N.target.value})),placeholder:"上传或粘贴 URL,如 /uploads/avatars/xxx.png"}),e.jsx("input",{ref:p,type:"file",accept:"image/*",className:"hidden",onChange:g}),e.jsxs(Z,{type:"button",variant:"outline",size:"sm",className:"border-gray-600 text-gray-400 shrink-0",disabled:h,onClick:()=>{var N;return(N=p.current)==null?void 0:N.click()},children:[e.jsx(Zi,{className:"w-4 h-4 mr-2"}),h?"上传中...":"上传"]})]}),s.avatarImg&&e.jsx("div",{className:"mt-2",children:e.jsx("img",{src:s.avatarImg.startsWith("http")?s.avatarImg:la(s.avatarImg),alt:"头像预览",className:"w-20 h-20 rounded-full object-cover border border-gray-600"})})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"头衔"}),e.jsx(de,{className:"bg-[#0a1628] border-gray-700 text-white",value:s.title,onChange:N=>a(E=>({...E,title:N.target.value})),placeholder:"Soul派对房主理人 · 私域运营专家"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"个人简介"}),e.jsx(jn,{className:"bg-[#0a1628] border-gray-700 text-white min-h-[120px]",value:s.bio,onChange:N=>a(E=>({...E,bio:N.target.value})),placeholder:"每天早上6点到9点..."})]})]})]}),e.jsxs(Ne,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:[e.jsxs(Ue,{children:[e.jsx(Ve,{className:"text-white",children:"统计数据"}),e.jsx(ht,{className:"text-gray-400",children:"展示在作者卡片中的数字指标,如「商业案例 62」「连续直播 365天」。第一个「商业案例」的值可由书籍统计自动更新。"})]}),e.jsxs(we,{className:"space-y-3",children:[s.stats.map((N,E)=>e.jsxs("div",{className:"flex gap-3 items-center",children:[e.jsx(de,{className:"flex-1 bg-[#0a1628] border-gray-700 text-white",value:N.label,onChange:j=>P(E,"label",j.target.value),placeholder:"标签"}),e.jsx(de,{className:"flex-1 bg-[#0a1628] border-gray-700 text-white",value:N.value,onChange:j=>P(E,"value",j.target.value),placeholder:"数值"}),e.jsx(Z,{variant:"ghost",size:"icon",className:"text-gray-400 hover:text-red-400",onClick:()=>C(E),children:e.jsx(Sr,{className:"w-4 h-4"})})]},E)),e.jsxs(Z,{variant:"outline",size:"sm",onClick:v,className:"border-gray-600 text-gray-400",children:[e.jsx(At,{className:"w-4 h-4 mr-2"}),"添加统计项"]})]})]}),e.jsxs(Ne,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:[e.jsxs(Ue,{children:[e.jsx(Ve,{className:"text-white",children:"亮点标签"}),e.jsx(ht,{className:"text-gray-400",children:"作者优势或成就的简短描述,以标签形式展示。"})]}),e.jsxs(we,{className:"space-y-3",children:[s.highlights.map((N,E)=>e.jsxs("div",{className:"flex gap-3 items-center",children:[e.jsx(de,{className:"flex-1 bg-[#0a1628] border-gray-700 text-white",value:N,onChange:j=>b(E,j.target.value),placeholder:"5年私域运营经验"}),e.jsx(Z,{variant:"ghost",size:"icon",className:"text-gray-400 hover:text-red-400",onClick:()=>S(E),children:e.jsx(Sr,{className:"w-4 h-4"})})]},E)),e.jsxs(Z,{variant:"outline",size:"sm",onClick:T,className:"border-gray-600 text-gray-400",children:[e.jsx(At,{className:"w-4 h-4 mr-2"}),"添加亮点"]})]})]})]})]})}function d4(){const[s,a]=f.useState([]),[l,o]=f.useState(0),[c,d]=f.useState(1),[h]=f.useState(10),[m,p]=f.useState(0),[y,g]=f.useState(""),v=wu(y,300),[C,P]=f.useState(!0),[T,S]=f.useState(null),[b,N]=f.useState(!1),[E,j]=f.useState(null),[R,B]=f.useState(""),[U,k]=f.useState(""),[L,_]=f.useState(""),[se,le]=f.useState("admin"),[ie,ee]=f.useState("active"),[G,Q]=f.useState(!1);async function ce(){var O;P(!0),S(null);try{const F=new URLSearchParams({page:String(c),pageSize:String(h)});v.trim()&&F.set("search",v.trim());const X=await Fe(`/api/admin/users?${F}`);X!=null&&X.success?(a(X.records||[]),o(X.total??0),p(X.totalPages??0)):S(X.error||"加载失败")}catch(F){const X=F;S(X.status===403?"无权限访问":((O=X==null?void 0:X.data)==null?void 0:O.error)||"加载失败"),a([])}finally{P(!1)}}f.useEffect(()=>{ce()},[c,h,v]);const re=()=>{j(null),B(""),k(""),_(""),le("admin"),ee("active"),N(!0)},A=O=>{j(O),B(O.username),k(""),_(O.name||""),le(O.role==="super_admin"?"super_admin":"admin"),ee(O.status==="disabled"?"disabled":"active"),N(!0)},ne=async()=>{var O;if(!R.trim()){S("用户名不能为空");return}if(!E&&!U){S("新建时密码必填,至少 6 位");return}if(U&&U.length<6){S("密码至少 6 位");return}S(null),Q(!0);try{if(E){const F=await Nt("/api/admin/users",{id:E.id,password:U||void 0,name:L.trim(),role:se,status:ie});F!=null&&F.success?(N(!1),ce()):S((F==null?void 0:F.error)||"保存失败")}else{const F=await Et("/api/admin/users",{username:R.trim(),password:U,name:L.trim(),role:se});F!=null&&F.success?(N(!1),ce()):S((F==null?void 0:F.error)||"保存失败")}}catch(F){const X=F;S(((O=X==null?void 0:X.data)==null?void 0:O.error)||"保存失败")}finally{Q(!1)}},W=async O=>{var F;if(confirm("确定删除该管理员?"))try{const X=await vn(`/api/admin/users?id=${O}`);X!=null&&X.success?ce():S((X==null?void 0:X.error)||"删除失败")}catch(X){const H=X;S(((F=H==null?void 0:H.data)==null?void 0:F.error)||"删除失败")}},M=O=>{if(!O)return"-";try{const F=new Date(O);return isNaN(F.getTime())?O:F.toLocaleString("zh-CN")}catch{return O}};return e.jsxs("div",{className:"p-8 w-full",children:[e.jsxs("div",{className:"flex justify-between items-center mb-6",children:[e.jsxs("div",{children:[e.jsxs("h2",{className:"text-2xl font-bold text-white flex items-center gap-2",children:[e.jsx(uu,{className:"w-5 h-5 text-[#38bdac]"}),"管理员用户"]}),e.jsx("p",{className:"text-gray-400 mt-1",children:"后台登录账号管理,仅超级管理员可操作"})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(de,{placeholder:"搜索用户名/昵称",value:y,onChange:O=>g(O.target.value),className:"w-48 bg-[#0f2137] border-gray-700 text-white placeholder:text-gray-500"}),e.jsx(Z,{variant:"outline",size:"sm",onClick:ce,disabled:C,className:"border-gray-600 text-gray-300",children:e.jsx($e,{className:`w-4 h-4 ${C?"animate-spin":""}`})}),e.jsxs(Z,{onClick:re,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:[e.jsx(At,{className:"w-4 h-4 mr-2"}),"新增管理员"]})]})]}),T&&e.jsxs("div",{className:"mb-4 p-3 rounded-lg bg-red-500/10 border border-red-500/20 text-red-400 text-sm flex justify-between items-center",children:[e.jsx("span",{children:T}),e.jsx("button",{type:"button",onClick:()=>S(null),className:"text-red-400 hover:text-red-300",children:"×"})]}),e.jsx(Ne,{className:"bg-[#0f2137] border-gray-700/50",children:e.jsx(we,{className:"p-0",children:C?e.jsx("div",{className:"py-12 text-center text-gray-400",children:"加载中..."}):e.jsxs(e.Fragment,{children:[e.jsxs(ir,{children:[e.jsx(or,{children:e.jsxs(Ge,{className:"bg-[#0a1628] border-gray-700",children:[e.jsx(je,{className:"text-gray-400",children:"ID"}),e.jsx(je,{className:"text-gray-400",children:"用户名"}),e.jsx(je,{className:"text-gray-400",children:"昵称"}),e.jsx(je,{className:"text-gray-400",children:"角色"}),e.jsx(je,{className:"text-gray-400",children:"状态"}),e.jsx(je,{className:"text-gray-400",children:"创建时间"}),e.jsx(je,{className:"text-right text-gray-400",children:"操作"})]})}),e.jsxs(cr,{children:[s.map(O=>e.jsxs(Ge,{className:"border-gray-700/50",children:[e.jsx(pe,{className:"text-gray-300",children:O.id}),e.jsx(pe,{className:"text-white font-medium",children:O.username}),e.jsx(pe,{className:"text-gray-400",children:O.name||"-"}),e.jsx(pe,{children:e.jsx(Oe,{variant:"outline",className:O.role==="super_admin"?"border-amber-500/50 text-amber-400":"border-gray-600 text-gray-400",children:O.role==="super_admin"?"超级管理员":"管理员"})}),e.jsx(pe,{children:e.jsx(Oe,{variant:"outline",className:O.status==="active"?"border-[#38bdac]/50 text-[#38bdac]":"border-gray-500 text-gray-500",children:O.status==="active"?"正常":"已禁用"})}),e.jsx(pe,{className:"text-gray-500 text-sm",children:M(O.createdAt)}),e.jsxs(pe,{className:"text-right",children:[e.jsx(Z,{variant:"ghost",size:"sm",onClick:()=>A(O),className:"text-gray-400 hover:text-[#38bdac]",children:e.jsx(yt,{className:"w-4 h-4"})}),e.jsx(Z,{variant:"ghost",size:"sm",onClick:()=>W(O.id),className:"text-gray-400 hover:text-red-400",children:e.jsx(Gt,{className:"w-4 h-4"})})]})]},O.id)),s.length===0&&!C&&e.jsx(Ge,{children:e.jsx(pe,{colSpan:7,className:"text-center py-12 text-gray-500",children:T==="无权限访问"?"仅超级管理员可查看":"暂无管理员"})})]})]}),m>1&&e.jsx("div",{className:"p-4 border-t border-gray-700/50",children:e.jsx(Ar,{page:c,pageSize:h,total:l,totalPages:m,onPageChange:d})})]})})}),e.jsx(wt,{open:b,onOpenChange:N,children:e.jsxs(vt,{className:"bg-[#0f2137] border-gray-700 text-white max-w-sm",children:[e.jsx(St,{children:e.jsx(Ct,{className:"text-white",children:E?"编辑管理员":"新增管理员"})}),e.jsxs("div",{className:"space-y-4 py-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"用户名"}),e.jsx(de,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"登录用户名",value:R,onChange:O=>B(O.target.value),disabled:!!E}),E&&e.jsx("p",{className:"text-xs text-gray-500",children:"用户名不可修改"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:E?"新密码(留空不改)":"密码"}),e.jsx(de,{type:"password",className:"bg-[#0a1628] border-gray-700 text-white",placeholder:E?"留空表示不修改":"至少 6 位",value:U,onChange:O=>k(O.target.value)})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"昵称"}),e.jsx(de,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"显示名称",value:L,onChange:O=>_(O.target.value)})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"角色"}),e.jsxs("select",{value:se,onChange:O=>le(O.target.value),className:"w-full h-10 px-3 rounded-md bg-[#0a1628] border border-gray-700 text-white",children:[e.jsx("option",{value:"admin",children:"管理员"}),e.jsx("option",{value:"super_admin",children:"超级管理员"})]})]}),E&&e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"状态"}),e.jsxs("select",{value:ie,onChange:O=>ee(O.target.value),className:"w-full h-10 px-3 rounded-md bg-[#0a1628] border border-gray-700 text-white",children:[e.jsx("option",{value:"active",children:"正常"}),e.jsx("option",{value:"disabled",children:"禁用"})]})]})]}),e.jsxs(Ft,{children:[e.jsxs(Z,{variant:"outline",onClick:()=>N(!1),className:"border-gray-600 text-gray-300",children:[e.jsx(Sr,{className:"w-4 h-4 mr-2"}),"取消"]}),e.jsxs(Z,{onClick:ne,disabled:G,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:[e.jsx(zt,{className:"w-4 h-4 mr-2"}),G?"保存中...":"保存"]})]})]})})]})}const u4={appId:"wxb8bbb2b10dec74aa",withdrawSubscribeTmplId:"u3MbZGPRkrZIk-I7QdpwzFxnO_CeQPaCWF2FkiIablE",mchId:"1318592501",minWithdraw:10},h4={name:"卡若",startDate:"2025年10月15日",bio:"连续创业者,私域运营专家,每天早上6-9点在Soul派对房分享真实商业故事",liveTime:"06:00-09:00",platform:"Soul派对房",description:"连续创业者,私域运营专家"},f4={sectionPrice:1,baseBookPrice:9.9,distributorShare:90,authorInfo:{...h4}},m4={matchEnabled:!0,referralEnabled:!0,searchEnabled:!0,aboutEnabled:!0},x4=["system","author","admin"];function p4(){const[s,a]=Cj(),l=s.get("tab")??"system",o=x4.includes(l)?l:"system",[c,d]=f.useState(f4),[h,m]=f.useState(m4),[p,y]=f.useState(u4),[g,v]=f.useState(!1),[C,P]=f.useState(!0),[T,S]=f.useState(!1),[b,N]=f.useState(""),[E,j]=f.useState(""),[R,B]=f.useState(!1),[U,k]=f.useState(!1),L=(ee,G,Q=!1)=>{N(ee),j(G),B(Q),S(!0)};f.useEffect(()=>{(async()=>{try{const G=await Fe("/api/admin/settings");if(!G||G.success===!1)return;if(G.featureConfig&&Object.keys(G.featureConfig).length&&m(Q=>({...Q,...G.featureConfig})),G.mpConfig&&typeof G.mpConfig=="object"&&y(Q=>({...Q,...G.mpConfig})),G.siteSettings&&typeof G.siteSettings=="object"){const Q=G.siteSettings;d(ce=>({...ce,...typeof Q.sectionPrice=="number"&&{sectionPrice:Q.sectionPrice},...typeof Q.baseBookPrice=="number"&&{baseBookPrice:Q.baseBookPrice},...typeof Q.distributorShare=="number"&&{distributorShare:Q.distributorShare},...Q.authorInfo&&typeof Q.authorInfo=="object"&&{authorInfo:{...ce.authorInfo,...Q.authorInfo}}}))}}catch(G){console.error("Load settings error:",G)}finally{P(!1)}})()},[]);const _=async(ee,G)=>{k(!0);try{const Q=await Et("/api/admin/settings",{featureConfig:ee});if(!Q||Q.success===!1){G(),L("保存失败",(Q==null?void 0:Q.error)??"未知错误",!0);return}L("已保存","功能开关已更新,相关入口将随之显示或隐藏。")}catch(Q){console.error("Save feature config error:",Q),G(),L("保存失败",Q instanceof Error?Q.message:String(Q),!0)}finally{k(!1)}},se=(ee,G)=>{const Q=h,ce={...Q,[ee]:G};m(ce),_(ce,()=>m(Q))},le=async()=>{v(!0);try{const ee=await Et("/api/admin/settings",{featureConfig:h,siteSettings:{sectionPrice:c.sectionPrice,baseBookPrice:c.baseBookPrice,distributorShare:c.distributorShare,authorInfo:c.authorInfo},mpConfig:{...p,appId:p.appId||"",withdrawSubscribeTmplId:p.withdrawSubscribeTmplId||"",mchId:p.mchId||"",minWithdraw:typeof p.minWithdraw=="number"?p.minWithdraw:10}});if(!ee||ee.success===!1){L("保存失败",(ee==null?void 0:ee.error)??"未知错误",!0);return}L("已保存","设置已保存成功。")}catch(ee){console.error("Save settings error:",ee),L("保存失败",ee instanceof Error?ee.message:String(ee),!0)}finally{v(!1)}},ie=ee=>{a(ee==="system"?{}:{tab:ee})};return C?e.jsx("div",{className:"p-8 text-gray-500",children:"加载中..."}):e.jsxs("div",{className:"p-8 w-full",children:[e.jsxs("div",{className:"flex justify-between items-center mb-6",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"text-2xl font-bold text-white",children:"系统设置"}),e.jsx("p",{className:"text-gray-400 mt-1",children:"配置全站基础参数与开关"})]}),o==="system"&&e.jsxs(Z,{onClick:le,disabled:g,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:[e.jsx(zt,{className:"w-4 h-4 mr-2"}),g?"保存中...":"保存设置"]})]}),e.jsxs(bo,{value:o,onValueChange:ie,className:"w-full",children:[e.jsxs(jl,{className:"mb-6 bg-[#0f2137] border border-gray-700/50 p-1",children:[e.jsxs(Zt,{value:"system",className:"data-[state=active]:bg-[#38bdac]/20 data-[state=active]:text-[#38bdac] text-gray-400 data-[state=active]:font-medium",children:[e.jsx(dl,{className:"w-4 h-4 mr-2"}),"系统设置"]}),e.jsxs(Zt,{value:"author",className:"data-[state=active]:bg-[#38bdac]/20 data-[state=active]:text-[#38bdac] text-gray-400 data-[state=active]:font-medium",children:[e.jsx(vd,{className:"w-4 h-4 mr-2"}),"作者详情"]}),e.jsxs(Zt,{value:"admin",className:"data-[state=active]:bg-[#38bdac]/20 data-[state=active]:text-[#38bdac] text-gray-400 data-[state=active]:font-medium",children:[e.jsx(uu,{className:"w-4 h-4 mr-2"}),"管理员"]})]}),e.jsx(er,{value:"system",className:"mt-0",children:e.jsxs("div",{className:"space-y-6",children:[e.jsxs(Ne,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:[e.jsxs(Ue,{children:[e.jsxs(Ve,{className:"text-white flex items-center gap-2",children:[e.jsx(vd,{className:"w-5 h-5 text-[#38bdac]"}),"关于作者"]}),e.jsx(ht,{className:"text-gray-400",children:'配置作者信息,将在"关于作者"页面显示'})]}),e.jsxs(we,{className:"space-y-4",children:[e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsxs(te,{htmlFor:"author-name",className:"text-gray-300 flex items-center gap-1",children:[e.jsx(vd,{className:"w-3 h-3"}),"主理人名称"]}),e.jsx(de,{id:"author-name",className:"bg-[#0a1628] border-gray-700 text-white",value:c.authorInfo.name??"",onChange:ee=>d(G=>({...G,authorInfo:{...G.authorInfo,name:ee.target.value}}))})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs(te,{htmlFor:"start-date",className:"text-gray-300 flex items-center gap-1",children:[e.jsx(qi,{className:"w-3 h-3"}),"开播日期"]}),e.jsx(de,{id:"start-date",className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"例如: 2025年10月15日",value:c.authorInfo.startDate??"",onChange:ee=>d(G=>({...G,authorInfo:{...G.authorInfo,startDate:ee.target.value}}))})]})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsxs(te,{htmlFor:"live-time",className:"text-gray-300 flex items-center gap-1",children:[e.jsx(qi,{className:"w-3 h-3"}),"直播时间"]}),e.jsx(de,{id:"live-time",className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"例如: 06:00-09:00",value:c.authorInfo.liveTime??"",onChange:ee=>d(G=>({...G,authorInfo:{...G.authorInfo,liveTime:ee.target.value}}))})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs(te,{htmlFor:"platform",className:"text-gray-300 flex items-center gap-1",children:[e.jsx(Mb,{className:"w-3 h-3"}),"直播平台"]}),e.jsx(de,{id:"platform",className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"例如: Soul派对房",value:c.authorInfo.platform??"",onChange:ee=>d(G=>({...G,authorInfo:{...G.authorInfo,platform:ee.target.value}}))})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs(te,{htmlFor:"description",className:"text-gray-300 flex items-center gap-1",children:[e.jsx(us,{className:"w-3 h-3"}),"简介描述"]}),e.jsx(de,{id:"description",className:"bg-[#0a1628] border-gray-700 text-white",value:c.authorInfo.description??"",onChange:ee=>d(G=>({...G,authorInfo:{...G.authorInfo,description:ee.target.value}}))})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{htmlFor:"bio",className:"text-gray-300",children:"详细介绍"}),e.jsx(jn,{id:"bio",className:"bg-[#0a1628] border-gray-700 text-white min-h-[100px]",placeholder:"输入作者详细介绍...",value:c.authorInfo.bio??"",onChange:ee=>d(G=>({...G,authorInfo:{...G.authorInfo,bio:ee.target.value}}))})]}),e.jsxs("div",{className:"mt-4 p-4 rounded-xl bg-[#0a1628] border border-[#38bdac]/30",children:[e.jsx("p",{className:"text-xs text-gray-500 mb-2",children:"预览效果"}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"w-12 h-12 rounded-full bg-gradient-to-br from-[#00CED1] to-[#20B2AA] flex items-center justify-center text-xl font-bold text-white",children:(c.authorInfo.name??"K").charAt(0)}),e.jsxs("div",{children:[e.jsx("p",{className:"text-white font-semibold",children:c.authorInfo.name}),e.jsx("p",{className:"text-gray-400 text-xs",children:c.authorInfo.description}),e.jsxs("p",{className:"text-[#38bdac] text-xs mt-1",children:["每日 ",c.authorInfo.liveTime," · ",c.authorInfo.platform]})]})]})]})]})]}),e.jsxs(Ne,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:[e.jsxs(Ue,{children:[e.jsxs(Ve,{className:"text-white flex items-center gap-2",children:[e.jsx(Xi,{className:"w-5 h-5 text-[#38bdac]"}),"价格设置"]}),e.jsx(ht,{className:"text-gray-400",children:"配置书籍和章节的定价"})]}),e.jsx(we,{className:"space-y-4",children:e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"单节价格 (元)"}),e.jsx(de,{type:"number",className:"bg-[#0a1628] border-gray-700 text-white",value:c.sectionPrice,onChange:ee=>d(G=>({...G,sectionPrice:Number.parseFloat(ee.target.value)||1}))})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"整本价格 (元)"}),e.jsx(de,{type:"number",className:"bg-[#0a1628] border-gray-700 text-white",value:c.baseBookPrice,onChange:ee=>d(G=>({...G,baseBookPrice:Number.parseFloat(ee.target.value)||9.9}))})]})]})})]}),e.jsxs(Ne,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:[e.jsxs(Ue,{children:[e.jsxs(Ve,{className:"text-white flex items-center gap-2",children:[e.jsx(Ud,{className:"w-5 h-5 text-[#38bdac]"}),"小程序配置"]}),e.jsx(ht,{className:"text-gray-400",children:"订阅消息模板、支付商户号等,小程序从 /api/miniprogram/config 读取(API 地址由 app.js baseUrl 控制)"})]}),e.jsx(we,{className:"space-y-4",children:e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"小程序 AppID"}),e.jsx(de,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"wxb8bbb2b10dec74aa",value:p.appId??"",onChange:ee=>y(G=>({...G,appId:ee.target.value}))})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"提现订阅模板 ID"}),e.jsx(de,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"用户申请提现时需授权",value:p.withdrawSubscribeTmplId??"",onChange:ee=>y(G=>({...G,withdrawSubscribeTmplId:ee.target.value}))})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"微信支付商户号"}),e.jsx(de,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"1318592501",value:p.mchId??"",onChange:ee=>y(G=>({...G,mchId:ee.target.value}))})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"最低提现金额 (元)"}),e.jsx(de,{type:"number",className:"bg-[#0a1628] border-gray-700 text-white",value:p.minWithdraw??10,onChange:ee=>y(G=>({...G,minWithdraw:Number.parseFloat(ee.target.value)||10}))})]})]})})]}),e.jsxs(Ne,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:[e.jsxs(Ue,{children:[e.jsxs(Ve,{className:"text-white flex items-center gap-2",children:[e.jsx(dl,{className:"w-5 h-5 text-[#38bdac]"}),"功能开关"]}),e.jsx(ht,{className:"text-gray-400",children:"控制各个功能模块的显示/隐藏"})]}),e.jsxs(we,{className:"space-y-4",children:[e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"flex items-center justify-between p-4 rounded-lg bg-[#0a1628] border border-gray-700/50",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(Qt,{className:"w-4 h-4 text-[#38bdac]"}),e.jsx(te,{htmlFor:"match-enabled",className:"text-white font-medium cursor-pointer",children:"找伙伴功能"})]}),e.jsx("p",{className:"text-xs text-gray-400 ml-6",children:"控制小程序和Web端的找伙伴功能显示"})]}),e.jsx(it,{id:"match-enabled",checked:h.matchEnabled,disabled:U,onCheckedChange:ee=>se("matchEnabled",ee)})]}),e.jsxs("div",{className:"flex items-center justify-between p-4 rounded-lg bg-[#0a1628] border border-gray-700/50",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(ob,{className:"w-4 h-4 text-[#38bdac]"}),e.jsx(te,{htmlFor:"referral-enabled",className:"text-white font-medium cursor-pointer",children:"推广功能"})]}),e.jsx("p",{className:"text-xs text-gray-400 ml-6",children:"控制推广中心的显示(我的页面入口)"})]}),e.jsx(it,{id:"referral-enabled",checked:h.referralEnabled,disabled:U,onCheckedChange:ee=>se("referralEnabled",ee)})]}),e.jsxs("div",{className:"flex items-center justify-between p-4 rounded-lg bg-[#0a1628] border border-gray-700/50",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(us,{className:"w-4 h-4 text-[#38bdac]"}),e.jsx(te,{htmlFor:"search-enabled",className:"text-white font-medium cursor-pointer",children:"搜索功能"})]}),e.jsx("p",{className:"text-xs text-gray-400 ml-6",children:"控制首页搜索栏的显示"})]}),e.jsx(it,{id:"search-enabled",checked:h.searchEnabled,disabled:U,onCheckedChange:ee=>se("searchEnabled",ee)})]}),e.jsxs("div",{className:"flex items-center justify-between p-4 rounded-lg bg-[#0a1628] border border-gray-700/50",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(dl,{className:"w-4 h-4 text-[#38bdac]"}),e.jsx(te,{htmlFor:"about-enabled",className:"text-white font-medium cursor-pointer",children:"关于页面"})]}),e.jsx("p",{className:"text-xs text-gray-400 ml-6",children:"控制关于页面的访问"})]}),e.jsx(it,{id:"about-enabled",checked:h.aboutEnabled,disabled:U,onCheckedChange:ee=>se("aboutEnabled",ee)})]})]}),e.jsx("div",{className:"p-3 rounded-lg bg-blue-500/10 border border-blue-500/30",children:e.jsx("p",{className:"text-xs text-blue-300",children:"💡 关闭功能后,相关入口会自动隐藏。建议在功能开发完成后再开启。"})})]})]})]})}),e.jsx(er,{value:"author",className:"mt-0",children:e.jsx(c4,{})}),e.jsx(er,{value:"admin",className:"mt-0",children:e.jsx(d4,{})})]}),e.jsx(wt,{open:T,onOpenChange:S,children:e.jsxs(vt,{className:"bg-[#0f2137] border-gray-700 text-white",showCloseButton:!0,children:[e.jsxs(St,{children:[e.jsx(Ct,{className:R?"text-red-400":"text-[#38bdac]",children:b}),e.jsx(s2,{className:"text-gray-400 whitespace-pre-wrap pt-2",children:E})]}),e.jsx(Ft,{className:"mt-4",children:e.jsx(Z,{onClick:()=>S(!1),className:R?"bg-gray-600 hover:bg-gray-500":"bg-[#38bdac] hover:bg-[#2da396]",children:"确定"})})]})})]})}const px={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 g4(){const[s,a]=f.useState(!1),[l,o]=f.useState(px),[c,d]=f.useState(""),h=async()=>{a(!0);try{const N=await Fe("/api/config");N!=null&&N.paymentMethods&&o({...px,...N.paymentMethods})}catch(N){console.error(N)}finally{a(!1)}};f.useEffect(()=>{h()},[]);const m=async()=>{a(!0);try{await Et("/api/db/config",{key:"payment_methods",value:l,description:"支付方式配置"}),alert("配置已保存!")}catch(N){console.error("保存失败:",N),alert("保存失败: "+(N instanceof Error?N.message:String(N)))}finally{a(!1)}},p=(N,E)=>{navigator.clipboard.writeText(N),d(E),setTimeout(()=>d(""),2e3)},y=(N,E)=>{o(j=>({...j,wechat:{...j.wechat,[N]:E}}))},g=(N,E)=>{o(j=>({...j,alipay:{...j.alipay,[N]:E}}))},v=(N,E)=>{o(j=>({...j,usdt:{...j.usdt,[N]:E}}))},C=(N,E)=>{o(j=>({...j,paypal:{...j.paypal,[N]:E}}))},P=l.wechat,T=l.alipay,S=l.usdt,b=l.paypal;return e.jsxs("div",{className:"p-8 w-full",children:[e.jsxs("div",{className:"flex justify-between items-center mb-8",children:[e.jsxs("div",{children:[e.jsx("h1",{className:"text-2xl font-bold mb-2 text-white",children:"支付配置"}),e.jsx("p",{className:"text-gray-400",children:"配置微信、支付宝、USDT、PayPal等支付参数"})]}),e.jsxs("div",{className:"flex gap-3",children:[e.jsxs(Z,{variant:"outline",onClick:h,className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:[e.jsx($e,{className:`w-4 h-4 mr-2 ${s?"animate-spin":""}`}),"同步配置"]}),e.jsxs(Z,{onClick:m,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:[e.jsx(zt,{className:"w-4 h-4 mr-2"}),"保存配置"]})]})]}),e.jsx("div",{className:"mb-6 bg-[#07C160]/10 border border-[#07C160]/30 rounded-xl p-4",children:e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx(Dx,{className:"w-5 h-5 text-[#07C160] flex-shrink-0 mt-0.5"}),e.jsxs("div",{className:"text-sm",children:[e.jsx("p",{className:"font-medium mb-2 text-[#07C160]",children:"如何获取微信群跳转链接?"}),e.jsxs("ol",{className:"text-[#07C160]/80 space-y-1 list-decimal list-inside",children:[e.jsx("li",{children:"打开微信,进入目标微信群"}),e.jsx("li",{children:'点击右上角"..." → "群二维码"'}),e.jsx("li",{children:'点击右上角"..." → "发送到电脑"'}),e.jsx("li",{children:"在电脑上保存二维码图片,上传到图床获取URL"}),e.jsx("li",{children:"或使用草料二维码等工具解析二维码获取链接"})]}),e.jsx("p",{className:"text-[#07C160]/60 mt-2",children:"提示:微信群二维码7天后失效,建议使用活码工具"})]})]})}),e.jsxs(bo,{defaultValue:"wechat",className:"space-y-6",children:[e.jsxs(jl,{className:"bg-[#0f2137] border border-gray-700/50 p-1 grid grid-cols-4 w-full",children:[e.jsxs(Zt,{value:"wechat",className:"data-[state=active]:bg-[#07C160]/20 data-[state=active]:text-[#07C160] text-gray-400",children:[e.jsx(Ud,{className:"w-4 h-4 mr-2"}),"微信"]}),e.jsxs(Zt,{value:"alipay",className:"data-[state=active]:bg-[#1677FF]/20 data-[state=active]:text-[#1677FF] text-gray-400",children:[e.jsx(zd,{className:"w-4 h-4 mr-2"}),"支付宝"]}),e.jsxs(Zt,{value:"usdt",className:"data-[state=active]:bg-[#26A17B]/20 data-[state=active]:text-[#26A17B] text-gray-400",children:[e.jsx(Rm,{className:"w-4 h-4 mr-2"}),"USDT"]}),e.jsxs(Zt,{value:"paypal",className:"data-[state=active]:bg-[#003087]/20 data-[state=active]:text-[#169BD7] text-gray-400",children:[e.jsx($d,{className:"w-4 h-4 mr-2"}),"PayPal"]})]}),e.jsx(er,{value:"wechat",className:"space-y-4",children:e.jsxs(Ne,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:[e.jsxs(Ue,{className:"flex flex-row items-center justify-between pb-2",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsxs(Ve,{className:"text-[#07C160] flex items-center gap-2",children:[e.jsx(Ud,{className:"w-5 h-5"}),"微信支付配置"]}),e.jsx(ht,{className:"text-gray-400",children:"配置微信支付参数和跳转链接"})]}),e.jsx(it,{checked:!!P.enabled,onCheckedChange:N=>y("enabled",N)})]}),e.jsxs(we,{className:"space-y-4",children:[e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"网站AppID"}),e.jsx(de,{className:"bg-[#0a1628] border-gray-700 text-white font-mono text-sm",value:String(P.websiteAppId??""),onChange:N=>y("websiteAppId",N.target.value)})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"商户号"}),e.jsx(de,{className:"bg-[#0a1628] border-gray-700 text-white font-mono text-sm",value:String(P.merchantId??""),onChange:N=>y("merchantId",N.target.value)})]})]}),e.jsxs("div",{className:"border-t border-gray-700/50 pt-4 space-y-4",children:[e.jsxs("h4",{className:"text-white font-medium flex items-center gap-2",children:[e.jsx(Ji,{className:"w-4 h-4 text-[#38bdac]"}),"跳转链接配置(核心功能)"]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"微信收款码/支付链接"}),e.jsx(de,{className:"bg-[#0a1628] border-gray-700 text-white placeholder:text-gray-500",placeholder:"https://收款码图片URL 或 weixin://支付链接",value:String(P.qrCode??""),onChange:N=>y("qrCode",N.target.value)}),e.jsx("p",{className:"text-xs text-gray-500",children:"用户点击微信支付后显示的二维码图片URL"})]}),e.jsxs("div",{className:"space-y-2 bg-[#07C160]/5 p-4 rounded-xl border border-[#07C160]/20",children:[e.jsx(te,{className:"text-[#07C160] font-medium",children:"微信群跳转链接(支付成功后跳转)"}),e.jsx(de,{className:"bg-[#0a1628] border-[#07C160]/30 text-white placeholder:text-gray-500",placeholder:"https://weixin.qq.com/g/... 或微信群二维码图片URL",value:String(P.groupQrCode??""),onChange:N=>y("groupQrCode",N.target.value)}),e.jsx("p",{className:"text-xs text-[#07C160]/70",children:"用户支付成功后将自动跳转到此链接,进入指定微信群"})]})]})]})]})}),e.jsx(er,{value:"alipay",className:"space-y-4",children:e.jsxs(Ne,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:[e.jsxs(Ue,{className:"flex flex-row items-center justify-between pb-2",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsxs(Ve,{className:"text-[#1677FF] flex items-center gap-2",children:[e.jsx(zd,{className:"w-5 h-5"}),"支付宝配置"]}),e.jsx(ht,{className:"text-gray-400",children:"已加载真实支付宝参数"})]}),e.jsx(it,{checked:!!T.enabled,onCheckedChange:N=>g("enabled",N)})]}),e.jsxs(we,{className:"space-y-4",children:[e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"合作者身份 (PID)"}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(de,{className:"bg-[#0a1628] border-gray-700 text-white font-mono text-sm",value:String(T.partnerId??""),onChange:N=>g("partnerId",N.target.value)}),e.jsx(Z,{size:"icon",variant:"outline",className:"border-gray-700 bg-transparent",onClick:()=>p(String(T.partnerId??""),"pid"),children:c==="pid"?e.jsx(fo,{className:"w-4 h-4 text-green-500"}):e.jsx(Fx,{className:"w-4 h-4 text-gray-400"})})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"安全校验码 (Key)"}),e.jsx(de,{type:"password",className:"bg-[#0a1628] border-gray-700 text-white font-mono text-sm",value:String(T.securityKey??""),onChange:N=>g("securityKey",N.target.value)})]})]}),e.jsxs("div",{className:"border-t border-gray-700/50 pt-4 space-y-4",children:[e.jsxs("h4",{className:"text-white font-medium flex items-center gap-2",children:[e.jsx(Ji,{className:"w-4 h-4 text-[#38bdac]"}),"跳转链接配置"]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"支付宝收款码/跳转链接"}),e.jsx(de,{className:"bg-[#0a1628] border-gray-700 text-white placeholder:text-gray-500",placeholder:"https://qr.alipay.com/... 或收款码图片URL",value:String(T.qrCode??""),onChange:N=>g("qrCode",N.target.value)}),e.jsx("p",{className:"text-xs text-gray-500",children:"用户点击支付宝支付后显示的二维码"})]})]})]})]})}),e.jsx(er,{value:"usdt",className:"space-y-4",children:e.jsxs(Ne,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:[e.jsxs(Ue,{className:"flex flex-row items-center justify-between pb-2",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsxs(Ve,{className:"text-[#26A17B] flex items-center gap-2",children:[e.jsx(Rm,{className:"w-5 h-5"}),"USDT配置"]}),e.jsx(ht,{className:"text-gray-400",children:"配置加密货币收款地址"})]}),e.jsx(it,{checked:!!S.enabled,onCheckedChange:N=>v("enabled",N)})]}),e.jsxs(we,{className:"space-y-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"网络类型"}),e.jsxs("select",{className:"w-full bg-[#0a1628] border border-gray-700 text-white rounded-md p-2",value:String(S.network??"TRC20"),onChange:N=>v("network",N.target.value),children:[e.jsx("option",{value:"TRC20",children:"TRC20 (波场)"}),e.jsx("option",{value:"ERC20",children:"ERC20 (以太坊)"}),e.jsx("option",{value:"BEP20",children:"BEP20 (币安链)"})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"收款地址"}),e.jsx(de,{className:"bg-[#0a1628] border-gray-700 text-white font-mono text-sm",placeholder:"T... (TRC20地址)",value:String(S.address??""),onChange:N=>v("address",N.target.value)})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"汇率 (1 USD = ? CNY)"}),e.jsx(de,{type:"number",className:"bg-[#0a1628] border-gray-700 text-white",value:Number(S.exchangeRate)??7.2,onChange:N=>v("exchangeRate",Number.parseFloat(N.target.value)||7.2)})]})]})]})}),e.jsx(er,{value:"paypal",className:"space-y-4",children:e.jsxs(Ne,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:[e.jsxs(Ue,{className:"flex flex-row items-center justify-between pb-2",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsxs(Ve,{className:"text-[#169BD7] flex items-center gap-2",children:[e.jsx($d,{className:"w-5 h-5"}),"PayPal配置"]}),e.jsx(ht,{className:"text-gray-400",children:"配置PayPal收款账户"})]}),e.jsx(it,{checked:!!b.enabled,onCheckedChange:N=>C("enabled",N)})]}),e.jsxs(we,{className:"space-y-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"PayPal邮箱"}),e.jsx(de,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"your@email.com",value:String(b.email??""),onChange:N=>C("email",N.target.value)})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"汇率 (1 USD = ? CNY)"}),e.jsx(de,{type:"number",className:"bg-[#0a1628] border-gray-700 text-white",value:Number(b.exchangeRate)??7.2,onChange:N=>C("exchangeRate",Number(N.target.value)||7.2)})]})]})]})})]})]})}const y4={siteName:"卡若日记",siteTitle:"一场SOUL的创业实验场",siteDescription:"来自Soul派对房的真实商业故事",logo:"/logo.png",favicon:"/favicon.ico",primaryColor:"#00CED1"},v4={home:{enabled:!0,label:"首页"},chapters:{enabled:!0,label:"目录"},match:{enabled:!0,label:"匹配"},my:{enabled:!0,label:"我的"}},j4={homeTitle:"一场SOUL的创业实验场",homeSubtitle:"来自Soul派对房的真实商业故事",chaptersTitle:"我要看",matchTitle:"语音匹配",myTitle:"我的",aboutTitle:"关于作者"};function b4(){const[s,a]=f.useState({siteConfig:{...y4},menuConfig:{...v4},pageConfig:{...j4}}),[l,o]=f.useState(!1),[c,d]=f.useState(!1);f.useEffect(()=>{Fe("/api/config").then(g=>{g!=null&&g.siteConfig&&a(v=>({...v,siteConfig:{...v.siteConfig,...g.siteConfig}})),g!=null&&g.menuConfig&&a(v=>({...v,menuConfig:{...v.menuConfig,...g.menuConfig}})),g!=null&&g.pageConfig&&a(v=>({...v,pageConfig:{...v.pageConfig,...g.pageConfig}}))}).catch(console.error)},[]);const h=async()=>{d(!0);try{await Et("/api/db/config",{key:"site_config",value:s.siteConfig,description:"网站基础配置"}),await Et("/api/db/config",{key:"menu_config",value:s.menuConfig,description:"底部菜单配置"}),await Et("/api/db/config",{key:"page_config",value:s.pageConfig,description:"页面标题配置"}),o(!0),setTimeout(()=>o(!1),2e3),alert("配置已保存")}catch(g){console.error(g),alert("保存失败: "+(g instanceof Error?g.message:String(g)))}finally{d(!1)}},m=s.siteConfig,p=s.menuConfig,y=s.pageConfig;return e.jsxs("div",{className:"p-8 w-full",children:[e.jsxs("div",{className:"flex justify-between items-center mb-8",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"text-2xl font-bold text-white",children:"网站配置"}),e.jsx("p",{className:"text-gray-400 mt-1",children:"配置网站名称、图标、菜单和页面标题"})]}),e.jsxs(Z,{onClick:h,disabled:c,className:`${l?"bg-green-500":"bg-[#00CED1]"} hover:bg-[#20B2AA] text-white transition-colors`,children:[e.jsx(zt,{className:"w-4 h-4 mr-2"}),c?"保存中...":l?"已保存":"保存设置"]})]}),e.jsxs("div",{className:"space-y-6",children:[e.jsxs(Ne,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:[e.jsxs(Ue,{children:[e.jsxs(Ve,{className:"text-white flex items-center gap-2",children:[e.jsx($d,{className:"w-5 h-5 text-[#00CED1]"}),"网站基础信息"]}),e.jsx(ht,{className:"text-gray-400",children:"配置网站名称、标题和描述"})]}),e.jsxs(we,{className:"space-y-4",children:[e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{htmlFor:"site-name",className:"text-gray-300",children:"网站名称"}),e.jsx(de,{id:"site-name",className:"bg-[#0a1628] border-gray-700 text-white",value:m.siteName??"",onChange:g=>a(v=>({...v,siteConfig:{...v.siteConfig,siteName:g.target.value}}))})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{htmlFor:"site-title",className:"text-gray-300",children:"网站标题"}),e.jsx(de,{id:"site-title",className:"bg-[#0a1628] border-gray-700 text-white",value:m.siteTitle??"",onChange:g=>a(v=>({...v,siteConfig:{...v.siteConfig,siteTitle:g.target.value}}))})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{htmlFor:"site-desc",className:"text-gray-300",children:"网站描述"}),e.jsx(de,{id:"site-desc",className:"bg-[#0a1628] border-gray-700 text-white",value:m.siteDescription??"",onChange:g=>a(v=>({...v,siteConfig:{...v.siteConfig,siteDescription:g.target.value}}))})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{htmlFor:"logo",className:"text-gray-300",children:"Logo地址"}),e.jsx(de,{id:"logo",className:"bg-[#0a1628] border-gray-700 text-white",value:m.logo??"",onChange:g=>a(v=>({...v,siteConfig:{...v.siteConfig,logo:g.target.value}}))})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{htmlFor:"favicon",className:"text-gray-300",children:"Favicon地址"}),e.jsx(de,{id:"favicon",className:"bg-[#0a1628] border-gray-700 text-white",value:m.favicon??"",onChange:g=>a(v=>({...v,siteConfig:{...v.siteConfig,favicon:g.target.value}}))})]})]})]})]}),e.jsxs(Ne,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:[e.jsxs(Ue,{children:[e.jsxs(Ve,{className:"text-white flex items-center gap-2",children:[e.jsx(zb,{className:"w-5 h-5 text-[#00CED1]"}),"主题颜色"]}),e.jsx(ht,{className:"text-gray-400",children:"配置网站主题色"})]}),e.jsx(we,{children:e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsxs("div",{className:"space-y-2 flex-1",children:[e.jsx(te,{htmlFor:"primary-color",className:"text-gray-300",children:"主色调"}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(de,{id:"primary-color",type:"color",className:"w-16 h-10 bg-[#0a1628] border-gray-700 cursor-pointer p-1",value:m.primaryColor??"#00CED1",onChange:g=>a(v=>({...v,siteConfig:{...v.siteConfig,primaryColor:g.target.value}}))}),e.jsx(de,{className:"bg-[#0a1628] border-gray-700 text-white flex-1",value:m.primaryColor??"#00CED1",onChange:g=>a(v=>({...v,siteConfig:{...v.siteConfig,primaryColor:g.target.value}}))})]})]}),e.jsx("div",{className:"w-24 h-24 rounded-xl flex items-center justify-center text-white font-bold",style:{backgroundColor:m.primaryColor??"#00CED1"},children:"预览"})]})})]}),e.jsxs(Ne,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:[e.jsxs(Ue,{children:[e.jsxs(Ve,{className:"text-white flex items-center gap-2",children:[e.jsx(Db,{className:"w-5 h-5 text-[#00CED1]"}),"底部菜单配置"]}),e.jsx(ht,{className:"text-gray-400",children:"控制底部导航栏菜单的显示和名称"})]}),e.jsx(we,{className:"space-y-4",children:Object.entries(p).map(([g,v])=>e.jsxs("div",{className:"flex items-center justify-between p-4 bg-[#0a1628] rounded-lg",children:[e.jsxs("div",{className:"flex items-center gap-4 flex-1",children:[e.jsx(it,{checked:(v==null?void 0:v.enabled)??!0,onCheckedChange:C=>a(P=>({...P,menuConfig:{...P.menuConfig,[g]:{...v,enabled:C}}}))}),e.jsx("span",{className:"text-gray-300 w-16 capitalize",children:g}),e.jsx(de,{className:"bg-[#0f2137] border-gray-700 text-white max-w-[200px]",value:(v==null?void 0:v.label)??"",onChange:C=>a(P=>({...P,menuConfig:{...P.menuConfig,[g]:{...v,label:C.target.value}}}))})]}),e.jsx("span",{className:`text-sm ${v!=null&&v.enabled?"text-green-400":"text-gray-500"}`,children:v!=null&&v.enabled?"显示":"隐藏"})]},g))})]}),e.jsxs(Ne,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:[e.jsxs(Ue,{children:[e.jsxs(Ve,{className:"text-white flex items-center gap-2",children:[e.jsx(nb,{className:"w-5 h-5 text-[#00CED1]"}),"页面标题配置"]}),e.jsx(ht,{className:"text-gray-400",children:"配置各个页面的标题和副标题"})]}),e.jsxs(we,{className:"space-y-4",children:[e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"首页标题"}),e.jsx(de,{className:"bg-[#0a1628] border-gray-700 text-white",value:y.homeTitle??"",onChange:g=>a(v=>({...v,pageConfig:{...v.pageConfig,homeTitle:g.target.value}}))})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"首页副标题"}),e.jsx(de,{className:"bg-[#0a1628] border-gray-700 text-white",value:y.homeSubtitle??"",onChange:g=>a(v=>({...v,pageConfig:{...v.pageConfig,homeSubtitle:g.target.value}}))})]})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"目录页标题"}),e.jsx(de,{className:"bg-[#0a1628] border-gray-700 text-white",value:y.chaptersTitle??"",onChange:g=>a(v=>({...v,pageConfig:{...v.pageConfig,chaptersTitle:g.target.value}}))})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"匹配页标题"}),e.jsx(de,{className:"bg-[#0a1628] border-gray-700 text-white",value:y.matchTitle??"",onChange:g=>a(v=>({...v,pageConfig:{...v.pageConfig,matchTitle:g.target.value}}))})]})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"我的页标题"}),e.jsx(de,{className:"bg-[#0a1628] border-gray-700 text-white",value:y.myTitle??"",onChange:g=>a(v=>({...v,pageConfig:{...v.pageConfig,myTitle:g.target.value}}))})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"关于作者标题"}),e.jsx(de,{className:"bg-[#0a1628] border-gray-700 text-white",value:y.aboutTitle??"",onChange:g=>a(v=>({...v,pageConfig:{...v.pageConfig,aboutTitle:g.target.value}}))})]})]})]})]})]})]})}function N4(){const[s,a]=f.useState(""),[l,o]=f.useState(""),[c,d]=f.useState(""),[h,m]=f.useState({}),p=async()=>{var P,T,S,b;try{const N=await Fe("/api/config"),E=(T=(P=N==null?void 0:N.liveQRCodes)==null?void 0:P[0])==null?void 0:T.urls;Array.isArray(E)&&a(E.join(` +`));const j=(b=(S=N==null?void 0:N.paymentMethods)==null?void 0:S.wechat)==null?void 0:b.groupQrCode;j&&o(j),m({paymentMethods:N==null?void 0:N.paymentMethods,liveQRCodes:N==null?void 0:N.liveQRCodes})}catch(N){console.error(N)}};f.useEffect(()=>{p()},[]);const y=(P,T)=>{navigator.clipboard.writeText(P),d(T),setTimeout(()=>d(""),2e3)},g=async()=>{try{const P=s.split(` +`).map(S=>S.trim()).filter(Boolean),T=[...h.liveQRCodes||[]];T[0]?T[0].urls=P:T.push({id:"live-1",name:"微信群活码",urls:P,clickCount:0}),await Et("/api/db/config",{key:"live_qr_codes",value:T,description:"群活码配置"}),alert("群活码配置已保存!"),await p()}catch(P){console.error(P),alert("保存失败: "+(P instanceof Error?P.message:String(P)))}},v=async()=>{var P;try{await Et("/api/db/config",{key:"payment_methods",value:{...h.paymentMethods||{},wechat:{...((P=h.paymentMethods)==null?void 0:P.wechat)||{},groupQrCode:l}},description:"支付方式配置"}),alert("微信群链接已保存!用户支付成功后将自动跳转"),await p()}catch(T){console.error(T),alert("保存失败: "+(T instanceof Error?T.message:String(T)))}},C=()=>{l?window.open(l,"_blank"):alert("请先配置微信群链接")};return e.jsxs("div",{className:"p-8 w-full",children:[e.jsxs("div",{className:"mb-8",children:[e.jsx("h2",{className:"text-2xl font-bold text-white",children:"微信群活码管理"}),e.jsx("p",{className:"text-gray-400 mt-1",children:"配置微信群跳转链接,用户支付后自动跳转加群"})]}),e.jsx("div",{className:"mb-6 bg-[#07C160]/10 border border-[#07C160]/30 rounded-xl p-4",children:e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx(Dx,{className:"w-5 h-5 text-[#07C160] flex-shrink-0 mt-0.5"}),e.jsxs("div",{className:"text-sm",children:[e.jsx("p",{className:"font-medium mb-2 text-[#07C160]",children:"微信群活码配置指南"}),e.jsxs("div",{className:"text-[#07C160]/80 space-y-2",children:[e.jsx("p",{className:"font-medium",children:"方法一:使用草料活码(推荐)"}),e.jsxs("ol",{className:"list-decimal list-inside space-y-1 pl-2",children:[e.jsx("li",{children:"访问草料二维码创建活码"}),e.jsx("li",{children:"上传微信群二维码图片,生成永久链接"}),e.jsx("li",{children:"复制生成的短链接填入下方配置"}),e.jsx("li",{children:"群满后可直接在草料后台更换新群码,链接不变"})]}),e.jsx("p",{className:"font-medium mt-3",children:"方法二:直接使用微信群链接"}),e.jsxs("ol",{className:"list-decimal list-inside space-y-1 pl-2",children:[e.jsx("li",{children:'微信打开目标群 → 右上角"..." → 群二维码'}),e.jsx("li",{children:"长按二维码 → 识别二维码 → 复制链接"})]}),e.jsx("p",{className:"text-[#07C160]/60 mt-2",children:"注意:微信原生群二维码7天后失效,建议使用草料活码"})]})]})]})}),e.jsxs("div",{className:"grid gap-6 md:grid-cols-2",children:[e.jsxs(Ne,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl md:col-span-2",children:[e.jsxs(Ue,{children:[e.jsxs(Ve,{className:"text-[#07C160] flex items-center gap-2",children:[e.jsx(Dm,{className:"w-5 h-5"}),"支付成功跳转链接(核心配置)"]}),e.jsx(ht,{className:"text-gray-400",children:"用户支付完成后自动跳转到此链接,进入指定微信群"})]}),e.jsxs(we,{className:"space-y-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsxs(te,{className:"text-gray-300 flex items-center gap-2",children:[e.jsx(Am,{className:"w-4 h-4"}),"微信群链接 / 活码链接"]}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(de,{placeholder:"https://cli.im/xxxxx 或 https://weixin.qq.com/g/...",className:"bg-[#0a1628] border-gray-700 text-white placeholder:text-gray-500 flex-1",value:l,onChange:P=>o(P.target.value)}),e.jsx(Z,{variant:"outline",size:"icon",className:"border-gray-700 bg-transparent hover:bg-gray-700/50",onClick:()=>y(l,"group"),children:c==="group"?e.jsx(fo,{className:"w-4 h-4 text-green-500"}):e.jsx(Fx,{className:"w-4 h-4 text-gray-400"})})]}),e.jsxs("p",{className:"text-xs text-gray-500 flex items-center gap-1",children:[e.jsx(Ji,{className:"w-3 h-3"}),"支持格式:草料短链、微信群链接(https://weixin.qq.com/g/...)、企业微信链接等"]})]}),e.jsxs("div",{className:"flex gap-3",children:[e.jsxs(Z,{onClick:v,className:"flex-1 bg-[#07C160] hover:bg-[#06AD51] text-white",children:[e.jsx(Zi,{className:"w-4 h-4 mr-2"}),"保存配置"]}),e.jsxs(Z,{onClick:C,variant:"outline",className:"border-[#07C160] text-[#07C160] hover:bg-[#07C160]/10 bg-transparent",children:[e.jsx(Ji,{className:"w-4 h-4 mr-2"}),"测试跳转"]})]})]})]}),e.jsxs(Ne,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl md:col-span-2",children:[e.jsxs(Ue,{children:[e.jsxs(Ve,{className:"text-white flex items-center gap-2",children:[e.jsx(Dm,{className:"w-5 h-5 text-[#38bdac]"}),"多群轮换(高级配置)"]}),e.jsx(ht,{className:"text-gray-400",children:"配置多个群链接,系统自动轮换分配,避免单群满员"})]}),e.jsxs(we,{className:"space-y-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsxs(te,{className:"text-gray-300 flex items-center gap-2",children:[e.jsx(Am,{className:"w-4 h-4"}),"多个群链接(每行一个)"]}),e.jsx(jn,{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:s,onChange:P=>a(P.target.value)}),e.jsx("p",{className:"text-xs text-gray-500",children:"每行填写一个群链接,系统将按顺序或随机分配"})]}),e.jsxs("div",{className:"flex items-center justify-between p-3 bg-[#0a1628] rounded-lg border border-gray-700/50",children:[e.jsx("span",{className:"text-sm text-gray-400",children:"已配置群数量"}),e.jsxs("span",{className:"font-bold text-[#38bdac]",children:[s.split(` +`).filter(Boolean).length," 个"]})]}),e.jsxs(Z,{onClick:g,className:"w-full bg-[#38bdac] hover:bg-[#2da396] text-white",children:[e.jsx(Zi,{className:"w-4 h-4 mr-2"}),"保存多群配置"]})]})]})]}),e.jsxs("div",{className:"mt-6 bg-[#0f2137] rounded-xl p-4 border border-gray-700/50",children:[e.jsx("h4",{className:"text-white font-medium mb-3",children:"常见问题"}),e.jsxs("div",{className:"space-y-3 text-sm",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-[#38bdac]",children:"Q: 为什么推荐使用草料活码?"}),e.jsx("p",{className:"text-gray-400",children:"A: 草料活码是永久链接,群满后可直接在后台更换新群码,无需修改网站配置。微信原生群码7天失效。"})]}),e.jsxs("div",{children:[e.jsx("p",{className:"text-[#38bdac]",children:"Q: 支付后没有跳转怎么办?"}),e.jsx("p",{className:"text-gray-400",children:"A: 1) 检查链接是否正确填写 2) 部分浏览器可能拦截弹窗,用户需手动允许 3) 建议使用https开头的链接"})]})]})]})]})}const gx={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}},w4=["⭐","👥","❤️","🎮","💼","🚀","💡","🎯","🔥","✨"];function S4(){const[s,a]=f.useState(gx),[l,o]=f.useState(!0),[c,d]=f.useState(!1),[h,m]=f.useState(!1),[p,y]=f.useState(null),[g,v]=f.useState({id:"",label:"",matchLabel:"",icon:"⭐",matchFromDB:!1,showJoinAfterMatch:!0,price:1,enabled:!0}),C=async()=>{o(!0);try{const j=await Fe("/api/db/config/full?key=match_config"),R=(j==null?void 0:j.data)??(j==null?void 0:j.config);R&&a({...gx,...R})}catch(j){console.error("加载匹配配置失败:",j)}finally{o(!1)}};f.useEffect(()=>{C()},[]);const P=async()=>{d(!0);try{const j=await Et("/api/db/config",{key:"match_config",value:s,description:"匹配功能配置"});j&&j.success!==!1?alert("配置保存成功!"):alert("保存失败: "+(j&&typeof j=="object"&&"error"in j?j.error:"未知错误"))}catch(j){console.error("保存配置失败:",j),alert("保存失败")}finally{d(!1)}},T=j=>{y(j),v({id:j.id,label:j.label,matchLabel:j.matchLabel,icon:j.icon,matchFromDB:j.matchFromDB,showJoinAfterMatch:j.showJoinAfterMatch,price:j.price,enabled:j.enabled}),m(!0)},S=()=>{y(null),v({id:"",label:"",matchLabel:"",icon:"⭐",matchFromDB:!1,showJoinAfterMatch:!0,price:1,enabled:!0}),m(!0)},b=()=>{if(!g.id||!g.label){alert("请填写类型ID和名称");return}const j=[...s.matchTypes];if(p){const R=j.findIndex(B=>B.id===p.id);R!==-1&&(j[R]={...g})}else{if(j.some(R=>R.id===g.id)){alert("类型ID已存在");return}j.push({...g})}a({...s,matchTypes:j}),m(!1)},N=j=>{confirm("确定要删除这个匹配类型吗?")&&a({...s,matchTypes:s.matchTypes.filter(R=>R.id!==j)})},E=j=>{a({...s,matchTypes:s.matchTypes.map(R=>R.id===j?{...R,enabled:!R.enabled}:R)})};return e.jsxs("div",{className:"p-8 w-full space-y-6",children:[e.jsxs("div",{className:"flex justify-between items-center",children:[e.jsxs("div",{children:[e.jsxs("h2",{className:"text-2xl font-bold text-white flex items-center gap-2",children:[e.jsx(dl,{className:"w-6 h-6 text-[#38bdac]"}),"匹配功能配置"]}),e.jsx("p",{className:"text-gray-400 mt-1",children:"管理找伙伴功能的匹配类型和价格"})]}),e.jsxs("div",{className:"flex gap-3",children:[e.jsxs(Z,{variant:"outline",onClick:C,disabled:l,className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:[e.jsx($e,{className:`w-4 h-4 mr-2 ${l?"animate-spin":""}`}),"刷新"]}),e.jsxs(Z,{onClick:P,disabled:c,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:[e.jsx(zt,{className:"w-4 h-4 mr-2"}),c?"保存中...":"保存配置"]})]})]}),e.jsxs(Ne,{className:"bg-[#0f2137] border-gray-700/50",children:[e.jsxs(Ue,{children:[e.jsxs(Ve,{className:"text-white flex items-center gap-2",children:[e.jsx(eo,{className:"w-5 h-5 text-yellow-400"}),"基础设置"]}),e.jsx(ht,{className:"text-gray-400",children:"配置免费匹配次数和付费规则"})]}),e.jsxs(we,{className:"space-y-6",children:[e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-6",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"每日免费匹配次数"}),e.jsx(de,{type:"number",min:0,max:100,className:"bg-[#0a1628] border-gray-700 text-white",value:s.freeMatchLimit,onChange:j=>a({...s,freeMatchLimit:parseInt(j.target.value,10)||0})}),e.jsx("p",{className:"text-xs text-gray-500",children:"用户每天可免费匹配的次数"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"付费匹配价格(元)"}),e.jsx(de,{type:"number",min:.01,step:.01,className:"bg-[#0a1628] border-gray-700 text-white",value:s.matchPrice,onChange:j=>a({...s,matchPrice:parseFloat(j.target.value)||1})}),e.jsx("p",{className:"text-xs text-gray-500",children:"免费次数用完后的单次匹配价格"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"每日最大匹配次数"}),e.jsx(de,{type:"number",min:1,max:100,className:"bg-[#0a1628] border-gray-700 text-white",value:s.settings.maxMatchesPerDay,onChange:j=>a({...s,settings:{...s.settings,maxMatchesPerDay:parseInt(j.target.value,10)||10}})}),e.jsx("p",{className:"text-xs text-gray-500",children:"包含免费和付费的总次数"})]})]}),e.jsxs("div",{className:"flex gap-8 pt-4 border-t border-gray-700/50",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(it,{checked:s.settings.enableFreeMatches,onCheckedChange:j=>a({...s,settings:{...s.settings,enableFreeMatches:j}})}),e.jsx(te,{className:"text-gray-300",children:"启用免费匹配"})]}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(it,{checked:s.settings.enablePaidMatches,onCheckedChange:j=>a({...s,settings:{...s.settings,enablePaidMatches:j}})}),e.jsx(te,{className:"text-gray-300",children:"启用付费匹配"})]})]})]})]}),e.jsxs(Ne,{className:"bg-[#0f2137] border-gray-700/50",children:[e.jsxs(Ue,{className:"flex flex-row items-center justify-between",children:[e.jsxs("div",{children:[e.jsxs(Ve,{className:"text-white flex items-center gap-2",children:[e.jsx(Qt,{className:"w-5 h-5 text-[#38bdac]"}),"匹配类型管理"]}),e.jsx(ht,{className:"text-gray-400",children:"配置不同的匹配类型及其价格"})]}),e.jsxs(Z,{onClick:S,size:"sm",className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:[e.jsx(At,{className:"w-4 h-4 mr-1"}),"添加类型"]})]}),e.jsx(we,{children:e.jsxs(ir,{children:[e.jsx(or,{children:e.jsxs(Ge,{className:"bg-[#0a1628] hover:bg-[#0a1628] border-gray-700",children:[e.jsx(je,{className:"text-gray-400",children:"图标"}),e.jsx(je,{className:"text-gray-400",children:"类型ID"}),e.jsx(je,{className:"text-gray-400",children:"显示名称"}),e.jsx(je,{className:"text-gray-400",children:"匹配标签"}),e.jsx(je,{className:"text-gray-400",children:"价格"}),e.jsx(je,{className:"text-gray-400",children:"数据库匹配"}),e.jsx(je,{className:"text-gray-400",children:"状态"}),e.jsx(je,{className:"text-right text-gray-400",children:"操作"})]})}),e.jsx(cr,{children:s.matchTypes.map(j=>e.jsxs(Ge,{className:"hover:bg-[#0a1628] border-gray-700/50",children:[e.jsx(pe,{children:e.jsx("span",{className:"text-2xl",children:j.icon})}),e.jsx(pe,{className:"font-mono text-gray-300",children:j.id}),e.jsx(pe,{className:"text-white font-medium",children:j.label}),e.jsx(pe,{className:"text-gray-300",children:j.matchLabel}),e.jsx(pe,{children:e.jsxs(Oe,{className:"bg-yellow-500/20 text-yellow-400 hover:bg-yellow-500/20 border-0",children:["¥",j.price]})}),e.jsx(pe,{children:j.matchFromDB?e.jsx(Oe,{className:"bg-green-500/20 text-green-400 hover:bg-green-500/20 border-0",children:"是"}):e.jsx(Oe,{variant:"outline",className:"text-gray-500 border-gray-600",children:"否"})}),e.jsx(pe,{children:e.jsx(it,{checked:j.enabled,onCheckedChange:()=>E(j.id)})}),e.jsx(pe,{className:"text-right",children:e.jsxs("div",{className:"flex items-center justify-end gap-1",children:[e.jsx(Z,{variant:"ghost",size:"sm",onClick:()=>T(j),className:"text-gray-400 hover:text-[#38bdac] hover:bg-[#38bdac]/10",children:e.jsx(yt,{className:"w-4 h-4"})}),e.jsx(Z,{variant:"ghost",size:"sm",onClick:()=>N(j.id),className:"text-red-400 hover:text-red-300 hover:bg-red-500/10",children:e.jsx(Gt,{className:"w-4 h-4"})})]})})]},j.id))})]})})]}),e.jsx(wt,{open:h,onOpenChange:m,children:e.jsxs(vt,{className:"bg-[#0f2137] border-gray-700 text-white max-w-lg",showCloseButton:!0,children:[e.jsx(St,{children:e.jsxs(Ct,{className:"text-white flex items-center gap-2",children:[p?e.jsx(yt,{className:"w-5 h-5 text-[#38bdac]"}):e.jsx(At,{className:"w-5 h-5 text-[#38bdac]"}),p?"编辑匹配类型":"添加匹配类型"]})}),e.jsxs("div",{className:"space-y-4 py-4",children:[e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"类型ID(英文)"}),e.jsx(de,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"如: partner",value:g.id,onChange:j=>v({...g,id:j.target.value}),disabled:!!p})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"图标"}),e.jsx("div",{className:"flex gap-1 flex-wrap",children:w4.map(j=>e.jsx("button",{type:"button",className:`w-8 h-8 text-lg rounded ${g.icon===j?"bg-[#38bdac]/30 ring-1 ring-[#38bdac]":"bg-[#0a1628]"}`,onClick:()=>v({...g,icon:j}),children:j},j))})]})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"显示名称"}),e.jsx(de,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"如: 创业合伙",value:g.label,onChange:j=>v({...g,label:j.target.value})})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"匹配标签"}),e.jsx(de,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"如: 创业伙伴",value:g.matchLabel,onChange:j=>v({...g,matchLabel:j.target.value})})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"单次匹配价格(元)"}),e.jsx(de,{type:"number",min:.01,step:.01,className:"bg-[#0a1628] border-gray-700 text-white",value:g.price,onChange:j=>v({...g,price:parseFloat(j.target.value)||1})})]}),e.jsxs("div",{className:"flex gap-6 pt-2",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(it,{checked:g.matchFromDB,onCheckedChange:j=>v({...g,matchFromDB:j})}),e.jsx(te,{className:"text-gray-300 text-sm",children:"从数据库匹配"})]}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(it,{checked:g.showJoinAfterMatch,onCheckedChange:j=>v({...g,showJoinAfterMatch:j})}),e.jsx(te,{className:"text-gray-300 text-sm",children:"匹配后显示加入"})]}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(it,{checked:g.enabled,onCheckedChange:j=>v({...g,enabled:j})}),e.jsx(te,{className:"text-gray-300 text-sm",children:"启用"})]})]})]}),e.jsxs(Ft,{children:[e.jsx(Z,{variant:"outline",onClick:()=>m(!1),className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:"取消"}),e.jsxs(Z,{onClick:b,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:[e.jsx(zt,{className:"w-4 h-4 mr-2"}),"保存"]})]})]})})]})}const yx={partner:"找伙伴",investor:"资源对接",mentor:"导师顾问",team:"团队招募"};function C4(){const[s,a]=f.useState([]),[l,o]=f.useState(0),[c,d]=f.useState(1),[h,m]=f.useState(10),[p,y]=f.useState(""),[g,v]=f.useState(!0),[C,P]=f.useState(null);async function T(){v(!0),P(null);try{const b=new URLSearchParams({page:String(c),pageSize:String(h)});p&&b.set("matchType",p);const N=await Fe(`/api/db/match-records?${b}`);N!=null&&N.success?(a(N.records||[]),o(N.total??0)):P("加载匹配记录失败")}catch(b){console.error("加载匹配记录失败",b),P("加载失败,请检查网络后重试")}finally{v(!1)}}f.useEffect(()=>{T()},[c,p]);const S=Math.ceil(l/h)||1;return e.jsxs("div",{className:"p-8 w-full",children:[C&&e.jsxs("div",{className:"mb-4 px-4 py-3 rounded-lg bg-red-500/20 border border-red-500/50 text-red-400 text-sm flex items-center justify-between",children:[e.jsx("span",{children:C}),e.jsx("button",{type:"button",onClick:()=>P(null),className:"hover:text-red-300",children:"×"})]}),e.jsxs("div",{className:"flex justify-between items-center mb-8",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"text-2xl font-bold text-white",children:"匹配记录"}),e.jsxs("p",{className:"text-gray-400 mt-1",children:["找伙伴匹配统计,共 ",l," 条记录"]})]}),e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsxs("select",{value:p,onChange:b=>{y(b.target.value),d(1)},className:"bg-[#0f2137] border border-gray-700 text-white rounded-lg px-3 py-2 text-sm",children:[e.jsx("option",{value:"",children:"全部类型"}),Object.entries(yx).map(([b,N])=>e.jsx("option",{value:b,children:N},b))]}),e.jsxs("button",{type:"button",onClick:T,disabled:g,className:"flex items-center gap-2 px-4 py-2 rounded-lg border border-gray-600 text-gray-300 hover:bg-gray-700/50 transition-colors disabled:opacity-50",children:[e.jsx($e,{className:`w-4 h-4 ${g?"animate-spin":""}`}),"刷新"]})]})]}),e.jsx(Ne,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:e.jsx(we,{className:"p-0",children:g?e.jsxs("div",{className:"flex justify-center py-12",children:[e.jsx($e,{className:"w-6 h-6 text-[#38bdac] animate-spin"}),e.jsx("span",{className:"ml-2 text-gray-400",children:"加载中..."})]}):e.jsxs(e.Fragment,{children:[e.jsxs(ir,{children:[e.jsx(or,{children:e.jsxs(Ge,{className:"bg-[#0a1628] hover:bg-[#0a1628] border-gray-700",children:[e.jsx(je,{className:"text-gray-400",children:"发起人"}),e.jsx(je,{className:"text-gray-400",children:"匹配到"}),e.jsx(je,{className:"text-gray-400",children:"类型"}),e.jsx(je,{className:"text-gray-400",children:"联系方式"}),e.jsx(je,{className:"text-gray-400",children:"匹配时间"})]})}),e.jsxs(cr,{children:[s.map(b=>e.jsxs(Ge,{className:"hover:bg-[#0a1628] border-gray-700/50",children:[e.jsx(pe,{children:e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsxs("div",{className:"w-9 h-9 rounded-full bg-[#38bdac]/20 flex items-center justify-center text-sm font-medium text-[#38bdac] flex-shrink-0 overflow-hidden",children:[b.userAvatar?e.jsx("img",{src:b.userAvatar,alt:"",className:"w-full h-full object-cover",onError:N=>{N.currentTarget.style.display="none";const E=N.currentTarget.nextElementSibling;E&&E.classList.remove("hidden")}}):null,e.jsx("span",{className:b.userAvatar?"hidden":"",children:(b.userNickname||b.userId||"?").charAt(0)})]}),e.jsxs("div",{children:[e.jsx("div",{className:"text-white",children:b.userNickname||b.userId}),e.jsxs("div",{className:"text-xs text-gray-500 font-mono",children:[b.userId.slice(0,16),"..."]})]})]})}),e.jsx(pe,{children:e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsxs("div",{className:"w-9 h-9 rounded-full bg-[#38bdac]/20 flex items-center justify-center text-sm font-medium text-[#38bdac] flex-shrink-0 overflow-hidden",children:[b.matchedUserAvatar?e.jsx("img",{src:b.matchedUserAvatar,alt:"",className:"w-full h-full object-cover",onError:N=>{N.currentTarget.style.display="none";const E=N.currentTarget.nextElementSibling;E&&E.classList.remove("hidden")}}):null,e.jsx("span",{className:b.matchedUserAvatar?"hidden":"",children:(b.matchedNickname||b.matchedUserId||"?").charAt(0)})]}),e.jsxs("div",{children:[e.jsx("div",{className:"text-white",children:b.matchedNickname||b.matchedUserId}),e.jsxs("div",{className:"text-xs text-gray-500 font-mono",children:[b.matchedUserId.slice(0,16),"..."]})]})]})}),e.jsx(pe,{children:e.jsx(Oe,{className:"bg-[#38bdac]/20 text-[#38bdac] border-0",children:yx[b.matchType]||b.matchType})}),e.jsxs(pe,{className:"text-gray-400 text-sm",children:[b.phone&&e.jsxs("div",{children:["📱 ",b.phone]}),b.wechatId&&e.jsxs("div",{children:["💬 ",b.wechatId]}),!b.phone&&!b.wechatId&&"-"]}),e.jsx(pe,{className:"text-gray-400",children:b.createdAt?new Date(b.createdAt).toLocaleString():"-"})]},b.id)),s.length===0&&e.jsx(Ge,{children:e.jsx(pe,{colSpan:5,className:"text-center py-12 text-gray-500",children:"暂无匹配记录"})})]})]}),e.jsx(Ar,{page:c,totalPages:S,total:l,pageSize:h,onPageChange:d,onPageSizeChange:b=>{m(b),d(1)}})]})})})]})}function k4(){const[s,a]=f.useState([]),[l,o]=f.useState(!0),[c,d]=f.useState(!1),[h,m]=f.useState(null),[p,y]=f.useState(""),[g,v]=f.useState(0),[C,P]=f.useState(!1);async function T(){o(!0);try{const j=await Fe("/api/db/vip-roles");j!=null&&j.success&&j.data&&a(j.data)}catch(j){console.error("Load roles error:",j)}finally{o(!1)}}f.useEffect(()=>{T()},[]);const S=()=>{m(null),y(""),v(s.length>0?Math.max(...s.map(j=>j.sort))+1:0),d(!0)},b=j=>{m(j),y(j.name),v(j.sort),d(!0)},N=async()=>{if(!p.trim()){alert("角色名称不能为空");return}P(!0);try{if(h){const j=await Nt("/api/db/vip-roles",{id:h.id,name:p.trim(),sort:g});j!=null&&j.success?(d(!1),T()):alert("更新失败: "+(j==null?void 0:j.error))}else{const j=await Et("/api/db/vip-roles",{name:p.trim(),sort:g});j!=null&&j.success?(d(!1),T()):alert("新增失败: "+(j==null?void 0:j.error))}}catch(j){console.error("Save error:",j),alert("保存失败")}finally{P(!1)}},E=async j=>{if(confirm("确定删除该角色?已设置该角色的 VIP 用户将保留角色名称。"))try{const R=await vn(`/api/db/vip-roles?id=${j}`);R!=null&&R.success?T():alert("删除失败: "+(R==null?void 0:R.error))}catch(R){console.error("Delete error:",R),alert("删除失败")}};return e.jsxs("div",{className:"p-8 w-full",children:[e.jsxs("div",{className:"flex justify-between items-center mb-8",children:[e.jsxs("div",{children:[e.jsxs("h2",{className:"text-2xl font-bold text-white flex items-center gap-2",children:[e.jsx(mo,{className:"w-5 h-5 text-amber-400"}),"VIP 角色管理"]}),e.jsx("p",{className:"text-gray-400 mt-1",children:"超级个体固定角色,在「设置 VIP」时可选择或手动填写"})]}),e.jsxs(Z,{onClick:S,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:[e.jsx(At,{className:"w-4 h-4 mr-2"}),"新增角色"]})]}),e.jsx(Ne,{className:"bg-[#0f2137] border-gray-700/50",children:e.jsx(we,{className:"p-0",children:l?e.jsx("div",{className:"py-12 text-center text-gray-400",children:"加载中..."}):e.jsxs(ir,{children:[e.jsx(or,{children:e.jsxs(Ge,{className:"bg-[#0a1628] border-gray-700",children:[e.jsx(je,{className:"text-gray-400",children:"ID"}),e.jsx(je,{className:"text-gray-400",children:"角色名称"}),e.jsx(je,{className:"text-gray-400",children:"排序"}),e.jsx(je,{className:"text-right text-gray-400",children:"操作"})]})}),e.jsxs(cr,{children:[s.map(j=>e.jsxs(Ge,{className:"border-gray-700/50",children:[e.jsx(pe,{className:"text-gray-300",children:j.id}),e.jsx(pe,{className:"text-white",children:j.name}),e.jsx(pe,{className:"text-gray-400",children:j.sort}),e.jsxs(pe,{className:"text-right",children:[e.jsx(Z,{variant:"ghost",size:"sm",onClick:()=>b(j),className:"text-gray-400 hover:text-[#38bdac]",children:e.jsx(yt,{className:"w-4 h-4"})}),e.jsx(Z,{variant:"ghost",size:"sm",onClick:()=>E(j.id),className:"text-gray-400 hover:text-red-400",children:e.jsx(Gt,{className:"w-4 h-4"})})]})]},j.id)),s.length===0&&e.jsx(Ge,{children:e.jsx(pe,{colSpan:4,className:"text-center py-12 text-gray-500",children:"暂无角色,点击「新增角色」添加"})})]})]})})}),e.jsx(wt,{open:c,onOpenChange:d,children:e.jsxs(vt,{className:"bg-[#0f2137] border-gray-700 text-white max-w-sm",children:[e.jsx(St,{children:e.jsx(Ct,{className:"text-white",children:h?"编辑角色":"新增角色"})}),e.jsxs("div",{className:"space-y-4 py-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"角色名称"}),e.jsx(de,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"如:创始人、投资人",value:p,onChange:j=>y(j.target.value)})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"排序(下拉展示顺序,越小越前)"}),e.jsx(de,{type:"number",className:"bg-[#0a1628] border-gray-700 text-white",value:g,onChange:j=>v(parseInt(j.target.value,10)||0)})]})]}),e.jsxs(Ft,{children:[e.jsxs(Z,{variant:"outline",onClick:()=>d(!1),className:"border-gray-600 text-gray-300",children:[e.jsx(Sr,{className:"w-4 h-4 mr-2"}),"取消"]}),e.jsxs(Z,{onClick:N,disabled:C,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:[e.jsx(zt,{className:"w-4 h-4 mr-2"}),C?"保存中...":"保存"]})]})]})})]})}function E4(){const[s,a]=f.useState([]),[l,o]=f.useState(!0),[c,d]=f.useState(!1),[h,m]=f.useState(null),[p,y]=f.useState({name:"",avatar:"",intro:"",tags:"",priceSingle:"",priceHalfYear:"",priceYear:"",quote:"",whyFind:"",offering:"",judgmentStyle:"",sort:0,enabled:!0}),[g,v]=f.useState(!1),[C,P]=f.useState(!1),T=f.useRef(null),S=async k=>{var _;const L=(_=k.target.files)==null?void 0:_[0];if(L){P(!0);try{const se=new FormData;se.append("file",L),se.append("folder","mentors");const le=fu(),ie={};le&&(ie.Authorization=`Bearer ${le}`);const G=await(await fetch(la("/api/upload"),{method:"POST",body:se,credentials:"include",headers:ie})).json();G!=null&&G.success&&(G!=null&&G.url)?y(Q=>({...Q,avatar:G.url})):alert("上传失败: "+((G==null?void 0:G.error)||"未知错误"))}catch(se){console.error(se),alert("上传失败")}finally{P(!1),T.current&&(T.current.value="")}}};async function b(){o(!0);try{const k=await Fe("/api/db/mentors");k!=null&&k.success&&k.data&&a(k.data)}catch(k){console.error("Load mentors error:",k)}finally{o(!1)}}f.useEffect(()=>{b()},[]);const N=()=>{y({name:"",avatar:"",intro:"",tags:"",priceSingle:"",priceHalfYear:"",priceYear:"",quote:"",whyFind:"",offering:"",judgmentStyle:"",sort:s.length>0?Math.max(...s.map(k=>k.sort))+1:0,enabled:!0})},E=()=>{m(null),N(),d(!0)},j=k=>{m(k),y({name:k.name,avatar:k.avatar||"",intro:k.intro||"",tags:k.tags||"",priceSingle:k.priceSingle!=null?String(k.priceSingle):"",priceHalfYear:k.priceHalfYear!=null?String(k.priceHalfYear):"",priceYear:k.priceYear!=null?String(k.priceYear):"",quote:k.quote||"",whyFind:k.whyFind||"",offering:k.offering||"",judgmentStyle:k.judgmentStyle||"",sort:k.sort,enabled:k.enabled??!0}),d(!0)},R=async()=>{if(!p.name.trim()){alert("导师姓名不能为空");return}v(!0);try{const k=_=>_===""?void 0:parseFloat(_),L={name:p.name.trim(),avatar:p.avatar.trim()||void 0,intro:p.intro.trim()||void 0,tags:p.tags.trim()||void 0,priceSingle:k(p.priceSingle),priceHalfYear:k(p.priceHalfYear),priceYear:k(p.priceYear),quote:p.quote.trim()||void 0,whyFind:p.whyFind.trim()||void 0,offering:p.offering.trim()||void 0,judgmentStyle:p.judgmentStyle.trim()||void 0,sort:p.sort,enabled:p.enabled};if(h){const _=await Nt("/api/db/mentors",{id:h.id,...L});_!=null&&_.success?(d(!1),b()):alert("更新失败: "+(_==null?void 0:_.error))}else{const _=await Et("/api/db/mentors",L);_!=null&&_.success?(d(!1),b()):alert("新增失败: "+(_==null?void 0:_.error))}}catch(k){console.error("Save error:",k),alert("保存失败")}finally{v(!1)}},B=async k=>{if(confirm("确定删除该导师?"))try{const L=await vn(`/api/db/mentors?id=${k}`);L!=null&&L.success?b():alert("删除失败: "+(L==null?void 0:L.error))}catch(L){console.error("Delete error:",L),alert("删除失败")}},U=k=>k!=null?`¥${k}`:"-";return e.jsxs("div",{className:"p-8 w-full",children:[e.jsxs("div",{className:"flex justify-between items-center mb-8",children:[e.jsxs("div",{children:[e.jsxs("h2",{className:"text-2xl font-bold text-white flex items-center gap-2",children:[e.jsx(Qt,{className:"w-5 h-5 text-[#38bdac]"}),"导师管理"]}),e.jsx("p",{className:"text-gray-400 mt-1",children:"stitch_soul 导师列表,支持每个导师独立配置单次/半年/年度价格"})]}),e.jsxs(Z,{onClick:E,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:[e.jsx(At,{className:"w-4 h-4 mr-2"}),"新增导师"]})]}),e.jsx(Ne,{className:"bg-[#0f2137] border-gray-700/50",children:e.jsx(we,{className:"p-0",children:l?e.jsx("div",{className:"py-12 text-center text-gray-400",children:"加载中..."}):e.jsxs(ir,{children:[e.jsx(or,{children:e.jsxs(Ge,{className:"bg-[#0a1628] border-gray-700",children:[e.jsx(je,{className:"text-gray-400",children:"ID"}),e.jsx(je,{className:"text-gray-400",children:"姓名"}),e.jsx(je,{className:"text-gray-400",children:"简介"}),e.jsx(je,{className:"text-gray-400",children:"单次"}),e.jsx(je,{className:"text-gray-400",children:"半年"}),e.jsx(je,{className:"text-gray-400",children:"年度"}),e.jsx(je,{className:"text-gray-400",children:"排序"}),e.jsx(je,{className:"text-right text-gray-400",children:"操作"})]})}),e.jsxs(cr,{children:[s.map(k=>e.jsxs(Ge,{className:"border-gray-700/50",children:[e.jsx(pe,{className:"text-gray-300",children:k.id}),e.jsx(pe,{className:"text-white",children:k.name}),e.jsx(pe,{className:"text-gray-400 max-w-[200px] truncate",children:k.intro||"-"}),e.jsx(pe,{className:"text-gray-400",children:U(k.priceSingle)}),e.jsx(pe,{className:"text-gray-400",children:U(k.priceHalfYear)}),e.jsx(pe,{className:"text-gray-400",children:U(k.priceYear)}),e.jsx(pe,{className:"text-gray-400",children:k.sort}),e.jsxs(pe,{className:"text-right",children:[e.jsx(Z,{variant:"ghost",size:"sm",onClick:()=>j(k),className:"text-gray-400 hover:text-[#38bdac]",children:e.jsx(yt,{className:"w-4 h-4"})}),e.jsx(Z,{variant:"ghost",size:"sm",onClick:()=>B(k.id),className:"text-gray-400 hover:text-red-400",children:e.jsx(Gt,{className:"w-4 h-4"})})]})]},k.id)),s.length===0&&e.jsx(Ge,{children:e.jsx(pe,{colSpan:8,className:"text-center py-12 text-gray-500",children:"暂无导师,点击「新增导师」添加"})})]})]})})}),e.jsx(wt,{open:c,onOpenChange:d,children:e.jsxs(vt,{className:"bg-[#0f2137] border-gray-700 text-white max-w-lg max-h-[90vh] overflow-y-auto",children:[e.jsx(St,{children:e.jsx(Ct,{className:"text-white",children:h?"编辑导师":"新增导师"})}),e.jsxs("div",{className:"space-y-4 py-4",children:[e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"姓名 *"}),e.jsx(de,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"如:卡若",value:p.name,onChange:k=>y(L=>({...L,name:k.target.value}))})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"排序"}),e.jsx(de,{type:"number",className:"bg-[#0a1628] border-gray-700 text-white",value:p.sort,onChange:k=>y(L=>({...L,sort:parseInt(k.target.value,10)||0}))})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"头像"}),e.jsxs("div",{className:"flex gap-3 items-center",children:[e.jsx(de,{className:"flex-1 bg-[#0a1628] border-gray-700 text-white",value:p.avatar,onChange:k=>y(L=>({...L,avatar:k.target.value})),placeholder:"点击上传或粘贴图片地址"}),e.jsx("input",{ref:T,type:"file",accept:"image/*",className:"hidden",onChange:S}),e.jsxs(Z,{type:"button",variant:"outline",size:"sm",className:"border-gray-600 text-gray-400 shrink-0",disabled:C,onClick:()=>{var k;return(k=T.current)==null?void 0:k.click()},children:[e.jsx(Zi,{className:"w-4 h-4 mr-2"}),C?"上传中...":"上传"]})]}),p.avatar&&e.jsx("div",{className:"mt-2",children:e.jsx("img",{src:p.avatar.startsWith("http")?p.avatar:la(p.avatar),alt:"头像预览",className:"w-20 h-20 rounded-full object-cover border border-gray-600"})})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"简介"}),e.jsx(de,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"如:结构判断型咨询 · Decision > Execution",value:p.intro,onChange:k=>y(L=>({...L,intro:k.target.value}))})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"技能标签(逗号分隔)"}),e.jsx(de,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"如:项目结构判断、风险止损、人×项目匹配",value:p.tags,onChange:k=>y(L=>({...L,tags:k.target.value}))})]}),e.jsxs("div",{className:"border-t border-gray-700 pt-4",children:[e.jsx(te,{className:"text-gray-300 block mb-2",children:"价格配置(每个导师独立)"}),e.jsxs("div",{className:"grid grid-cols-3 gap-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-500 text-xs",children:"单次咨询 ¥"}),e.jsx(de,{type:"number",step:"0.01",className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"980",value:p.priceSingle,onChange:k=>y(L=>({...L,priceSingle:k.target.value}))})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-500 text-xs",children:"半年咨询 ¥"}),e.jsx(de,{type:"number",step:"0.01",className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"19800",value:p.priceHalfYear,onChange:k=>y(L=>({...L,priceHalfYear:k.target.value}))})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-500 text-xs",children:"年度咨询 ¥"}),e.jsx(de,{type:"number",step:"0.01",className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"29800",value:p.priceYear,onChange:k=>y(L=>({...L,priceYear:k.target.value}))})]})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"引言"}),e.jsx(de,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"如:大多数人失败,不是因为不努力...",value:p.quote,onChange:k=>y(L=>({...L,quote:k.target.value}))})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"为什么找(文本)"}),e.jsx(de,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"",value:p.whyFind,onChange:k=>y(L=>({...L,whyFind:k.target.value}))})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"提供什么(文本)"}),e.jsx(de,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"",value:p.offering,onChange:k=>y(L=>({...L,offering:k.target.value}))})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"判断风格(逗号分隔)"}),e.jsx(de,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"如:冷静、克制、偏风险视角",value:p.judgmentStyle,onChange:k=>y(L=>({...L,judgmentStyle:k.target.value}))})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("input",{type:"checkbox",id:"enabled",checked:p.enabled,onChange:k=>y(L=>({...L,enabled:k.target.checked})),className:"rounded border-gray-600 bg-[#0a1628]"}),e.jsx(te,{htmlFor:"enabled",className:"text-gray-300 cursor-pointer",children:"上架(小程序可见)"})]})]}),e.jsxs(Ft,{children:[e.jsxs(Z,{variant:"outline",onClick:()=>d(!1),className:"border-gray-600 text-gray-300",children:[e.jsx(Sr,{className:"w-4 h-4 mr-2"}),"取消"]}),e.jsxs(Z,{onClick:R,disabled:g,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:[e.jsx(zt,{className:"w-4 h-4 mr-2"}),g?"保存中...":"保存"]})]})]})})]})}function P4(){const[s,a]=f.useState([]),[l,o]=f.useState(!0),[c,d]=f.useState("");async function h(){o(!0);try{const y=c?`/api/db/mentor-consultations?status=${c}`:"/api/db/mentor-consultations",g=await Fe(y);g!=null&&g.success&&g.data&&a(g.data)}catch(y){console.error("Load consultations error:",y)}finally{o(!1)}}f.useEffect(()=>{h()},[c]);const m={created:"已创建",pending_pay:"待支付",paid:"已支付",completed:"已完成",cancelled:"已取消"},p={single:"单次",half_year:"半年",year:"年度"};return e.jsxs("div",{className:"p-8 w-full",children:[e.jsxs("div",{className:"flex justify-between items-center mb-8",children:[e.jsxs("div",{children:[e.jsxs("h2",{className:"text-2xl font-bold text-white flex items-center gap-2",children:[e.jsx(qi,{className:"w-5 h-5 text-[#38bdac]"}),"导师预约列表"]}),e.jsx("p",{className:"text-gray-400 mt-1",children:"stitch_soul 导师咨询预约记录"})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs("select",{value:c,onChange:y=>d(y.target.value),className:"bg-[#0f2137] border border-gray-700 rounded-lg px-3 py-2 text-gray-300 text-sm",children:[e.jsx("option",{value:"",children:"全部状态"}),Object.entries(m).map(([y,g])=>e.jsx("option",{value:y,children:g},y))]}),e.jsxs(Z,{onClick:h,disabled:l,variant:"outline",className:"border-gray-600 text-gray-300",children:[e.jsx($e,{className:`w-4 h-4 mr-2 ${l?"animate-spin":""}`}),"刷新"]})]})]}),e.jsx(Ne,{className:"bg-[#0f2137] border-gray-700/50",children:e.jsx(we,{className:"p-0",children:l?e.jsx("div",{className:"py-12 text-center text-gray-400",children:"加载中..."}):e.jsxs(ir,{children:[e.jsx(or,{children:e.jsxs(Ge,{className:"bg-[#0a1628] border-gray-700",children:[e.jsx(je,{className:"text-gray-400",children:"ID"}),e.jsx(je,{className:"text-gray-400",children:"用户ID"}),e.jsx(je,{className:"text-gray-400",children:"导师ID"}),e.jsx(je,{className:"text-gray-400",children:"类型"}),e.jsx(je,{className:"text-gray-400",children:"金额"}),e.jsx(je,{className:"text-gray-400",children:"状态"}),e.jsx(je,{className:"text-gray-400",children:"创建时间"})]})}),e.jsxs(cr,{children:[s.map(y=>e.jsxs(Ge,{className:"border-gray-700/50",children:[e.jsx(pe,{className:"text-gray-300",children:y.id}),e.jsx(pe,{className:"text-gray-400",children:y.userId}),e.jsx(pe,{className:"text-gray-400",children:y.mentorId}),e.jsx(pe,{className:"text-gray-400",children:p[y.consultationType]||y.consultationType}),e.jsxs(pe,{className:"text-white",children:["¥",y.amount]}),e.jsx(pe,{className:"text-gray-400",children:m[y.status]||y.status}),e.jsx(pe,{className:"text-gray-500 text-sm",children:y.createdAt})]},y.id)),s.length===0&&e.jsx(Ge,{children:e.jsx(pe,{colSpan:7,className:"text-center py-12 text-gray-500",children:"暂无预约记录"})})]})]})})})]})}const vx={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}},T4=["⭐","👥","❤️","🎮","💼","🚀","💡","🎯","🔥","✨"];function R4(){const[s,a]=f.useState(vx),[l,o]=f.useState(!0),[c,d]=f.useState(!1),[h,m]=f.useState(!1),[p,y]=f.useState(null),[g,v]=f.useState({id:"",label:"",matchLabel:"",icon:"⭐",matchFromDB:!1,showJoinAfterMatch:!0,price:1,enabled:!0}),C=async()=>{o(!0);try{const j=await Fe("/api/db/config/full?key=match_config"),R=(j==null?void 0:j.data)??(j==null?void 0:j.config);R&&a({...vx,...R})}catch(j){console.error("加载匹配配置失败:",j)}finally{o(!1)}};f.useEffect(()=>{C()},[]);const P=async()=>{d(!0);try{const j=await Et("/api/db/config",{key:"match_config",value:s,description:"匹配功能配置"});alert((j==null?void 0:j.success)!==!1?"配置保存成功!":"保存失败: "+((j==null?void 0:j.error)||"未知错误"))}catch(j){console.error(j),alert("保存失败")}finally{d(!1)}},T=j=>{y(j),v({...j}),m(!0)},S=()=>{y(null),v({id:"",label:"",matchLabel:"",icon:"⭐",matchFromDB:!1,showJoinAfterMatch:!0,price:1,enabled:!0}),m(!0)},b=()=>{if(!g.id||!g.label){alert("请填写类型ID和名称");return}const j=[...s.matchTypes];if(p){const R=j.findIndex(B=>B.id===p.id);R!==-1&&(j[R]={...g})}else{if(j.some(R=>R.id===g.id)){alert("类型ID已存在");return}j.push({...g})}a({...s,matchTypes:j}),m(!1)},N=j=>{confirm("确定要删除这个匹配类型吗?")&&a({...s,matchTypes:s.matchTypes.filter(R=>R.id!==j)})},E=j=>{a({...s,matchTypes:s.matchTypes.map(R=>R.id===j?{...R,enabled:!R.enabled}:R)})};return e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"flex justify-end gap-3",children:[e.jsxs(Z,{variant:"outline",onClick:C,disabled:l,className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:[e.jsx($e,{className:`w-4 h-4 mr-2 ${l?"animate-spin":""}`})," 刷新"]}),e.jsxs(Z,{onClick:P,disabled:c,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:[e.jsx(zt,{className:"w-4 h-4 mr-2"})," ",c?"保存中...":"保存配置"]})]}),e.jsxs(Ne,{className:"bg-[#0f2137] border-gray-700/50",children:[e.jsxs(Ue,{children:[e.jsxs(Ve,{className:"text-white flex items-center gap-2",children:[e.jsx(eo,{className:"w-5 h-5 text-yellow-400"})," 基础设置"]}),e.jsx(ht,{className:"text-gray-400",children:"配置免费匹配次数和付费规则"})]}),e.jsxs(we,{className:"space-y-6",children:[e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-6",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"每日免费匹配次数"}),e.jsx(de,{type:"number",min:0,max:100,className:"bg-[#0a1628] border-gray-700 text-white",value:s.freeMatchLimit,onChange:j=>a({...s,freeMatchLimit:parseInt(j.target.value,10)||0})})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"付费匹配价格(元)"}),e.jsx(de,{type:"number",min:.01,step:.01,className:"bg-[#0a1628] border-gray-700 text-white",value:s.matchPrice,onChange:j=>a({...s,matchPrice:parseFloat(j.target.value)||1})})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"每日最大匹配次数"}),e.jsx(de,{type:"number",min:1,max:100,className:"bg-[#0a1628] border-gray-700 text-white",value:s.settings.maxMatchesPerDay,onChange:j=>a({...s,settings:{...s.settings,maxMatchesPerDay:parseInt(j.target.value,10)||10}})})]})]}),e.jsxs("div",{className:"flex gap-8 pt-4 border-t border-gray-700/50",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(it,{checked:s.settings.enableFreeMatches,onCheckedChange:j=>a({...s,settings:{...s.settings,enableFreeMatches:j}})}),e.jsx(te,{className:"text-gray-300",children:"启用免费匹配"})]}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(it,{checked:s.settings.enablePaidMatches,onCheckedChange:j=>a({...s,settings:{...s.settings,enablePaidMatches:j}})}),e.jsx(te,{className:"text-gray-300",children:"启用付费匹配"})]})]})]})]}),e.jsxs(Ne,{className:"bg-[#0f2137] border-gray-700/50",children:[e.jsxs(Ue,{className:"flex flex-row items-center justify-between",children:[e.jsxs("div",{children:[e.jsxs(Ve,{className:"text-white flex items-center gap-2",children:[e.jsx(Qt,{className:"w-5 h-5 text-[#38bdac]"})," 匹配类型管理"]}),e.jsx(ht,{className:"text-gray-400",children:"配置不同的匹配类型及其价格"})]}),e.jsxs(Z,{onClick:S,size:"sm",className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:[e.jsx(At,{className:"w-4 h-4 mr-1"})," 添加类型"]})]}),e.jsx(we,{children:e.jsxs(ir,{children:[e.jsx(or,{children:e.jsxs(Ge,{className:"bg-[#0a1628] hover:bg-[#0a1628] border-gray-700",children:[e.jsx(je,{className:"text-gray-400",children:"图标"}),e.jsx(je,{className:"text-gray-400",children:"类型ID"}),e.jsx(je,{className:"text-gray-400",children:"显示名称"}),e.jsx(je,{className:"text-gray-400",children:"匹配标签"}),e.jsx(je,{className:"text-gray-400",children:"价格"}),e.jsx(je,{className:"text-gray-400",children:"数据库匹配"}),e.jsx(je,{className:"text-gray-400",children:"状态"}),e.jsx(je,{className:"text-right text-gray-400",children:"操作"})]})}),e.jsx(cr,{children:s.matchTypes.map(j=>e.jsxs(Ge,{className:"hover:bg-[#0a1628] border-gray-700/50",children:[e.jsx(pe,{children:e.jsx("span",{className:"text-2xl",children:j.icon})}),e.jsx(pe,{className:"font-mono text-gray-300",children:j.id}),e.jsx(pe,{className:"text-white font-medium",children:j.label}),e.jsx(pe,{className:"text-gray-300",children:j.matchLabel}),e.jsx(pe,{children:e.jsxs(Oe,{className:"bg-yellow-500/20 text-yellow-400 hover:bg-yellow-500/20 border-0",children:["¥",j.price]})}),e.jsx(pe,{children:j.matchFromDB?e.jsx(Oe,{className:"bg-green-500/20 text-green-400 hover:bg-green-500/20 border-0",children:"是"}):e.jsx(Oe,{variant:"outline",className:"text-gray-500 border-gray-600",children:"否"})}),e.jsx(pe,{children:e.jsx(it,{checked:j.enabled,onCheckedChange:()=>E(j.id)})}),e.jsx(pe,{className:"text-right",children:e.jsxs("div",{className:"flex items-center justify-end gap-1",children:[e.jsx(Z,{variant:"ghost",size:"sm",onClick:()=>T(j),className:"text-gray-400 hover:text-[#38bdac] hover:bg-[#38bdac]/10",children:e.jsx(yt,{className:"w-4 h-4"})}),e.jsx(Z,{variant:"ghost",size:"sm",onClick:()=>N(j.id),className:"text-red-400 hover:text-red-300 hover:bg-red-500/10",children:e.jsx(Gt,{className:"w-4 h-4"})})]})})]},j.id))})]})})]}),e.jsx(wt,{open:h,onOpenChange:m,children:e.jsxs(vt,{className:"bg-[#0f2137] border-gray-700 text-white max-w-lg",showCloseButton:!0,children:[e.jsx(St,{children:e.jsxs(Ct,{className:"text-white flex items-center gap-2",children:[p?e.jsx(yt,{className:"w-5 h-5 text-[#38bdac]"}):e.jsx(At,{className:"w-5 h-5 text-[#38bdac]"}),p?"编辑匹配类型":"添加匹配类型"]})}),e.jsxs("div",{className:"space-y-4 py-4",children:[e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"类型ID(英文)"}),e.jsx(de,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"如: partner",value:g.id,onChange:j=>v({...g,id:j.target.value}),disabled:!!p})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"图标"}),e.jsx("div",{className:"flex gap-1 flex-wrap",children:T4.map(j=>e.jsx("button",{type:"button",className:`w-8 h-8 text-lg rounded ${g.icon===j?"bg-[#38bdac]/30 ring-1 ring-[#38bdac]":"bg-[#0a1628]"}`,onClick:()=>v({...g,icon:j}),children:j},j))})]})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"显示名称"}),e.jsx(de,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"如: 超级个体",value:g.label,onChange:j=>v({...g,label:j.target.value})})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"匹配标签"}),e.jsx(de,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"如: 超级个体",value:g.matchLabel,onChange:j=>v({...g,matchLabel:j.target.value})})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"单次匹配价格(元)"}),e.jsx(de,{type:"number",min:.01,step:.01,className:"bg-[#0a1628] border-gray-700 text-white",value:g.price,onChange:j=>v({...g,price:parseFloat(j.target.value)||1})})]}),e.jsxs("div",{className:"flex gap-6 pt-2",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(it,{checked:g.matchFromDB,onCheckedChange:j=>v({...g,matchFromDB:j})}),e.jsx(te,{className:"text-gray-300 text-sm",children:"从数据库匹配"})]}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(it,{checked:g.showJoinAfterMatch,onCheckedChange:j=>v({...g,showJoinAfterMatch:j})}),e.jsx(te,{className:"text-gray-300 text-sm",children:"匹配后显示加入"})]}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(it,{checked:g.enabled,onCheckedChange:j=>v({...g,enabled:j})}),e.jsx(te,{className:"text-gray-300 text-sm",children:"启用"})]})]})]}),e.jsxs(Ft,{children:[e.jsx(Z,{variant:"outline",onClick:()=>m(!1),className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:"取消"}),e.jsxs(Z,{onClick:b,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:[e.jsx(zt,{className:"w-4 h-4 mr-2"})," 保存"]})]})]})})]})}const jx={partner:"超级个体",investor:"资源对接",mentor:"导师顾问",team:"团队招募"};function I4(){const[s,a]=f.useState([]),[l,o]=f.useState(0),[c,d]=f.useState(1),[h,m]=f.useState(10),[p,y]=f.useState(""),[g,v]=f.useState(!0),[C,P]=f.useState(null);async function T(){v(!0),P(null);try{const b=new URLSearchParams({page:String(c),pageSize:String(h)});p&&b.set("matchType",p);const N=await Fe(`/api/db/match-records?${b}`);N!=null&&N.success?(a(N.records||[]),o(N.total??0)):P("加载匹配记录失败")}catch{P("加载失败,请检查网络后重试")}finally{v(!1)}}f.useEffect(()=>{T()},[c,p]);const S=Math.ceil(l/h)||1;return e.jsxs("div",{children:[C&&e.jsxs("div",{className:"mb-4 px-4 py-3 rounded-lg bg-red-500/20 border border-red-500/50 text-red-400 text-sm flex items-center justify-between",children:[e.jsx("span",{children:C}),e.jsx("button",{type:"button",onClick:()=>P(null),className:"hover:text-red-300",children:"×"})]}),e.jsxs("div",{className:"flex justify-between items-center mb-4",children:[e.jsxs("p",{className:"text-gray-400",children:["共 ",l," 条匹配记录"]}),e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsxs("select",{value:p,onChange:b=>{y(b.target.value),d(1)},className:"bg-[#0f2137] border border-gray-700 text-white rounded-lg px-3 py-2 text-sm",children:[e.jsx("option",{value:"",children:"全部类型"}),Object.entries(jx).map(([b,N])=>e.jsx("option",{value:b,children:N},b))]}),e.jsxs("button",{type:"button",onClick:T,disabled:g,className:"flex items-center gap-2 px-4 py-2 rounded-lg border border-gray-600 text-gray-300 hover:bg-gray-700/50 transition-colors disabled:opacity-50",children:[e.jsx($e,{className:`w-4 h-4 ${g?"animate-spin":""}`})," 刷新"]})]})]}),e.jsx(Ne,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:e.jsx(we,{className:"p-0",children:g?e.jsxs("div",{className:"flex justify-center py-12",children:[e.jsx($e,{className:"w-6 h-6 text-[#38bdac] animate-spin"}),e.jsx("span",{className:"ml-2 text-gray-400",children:"加载中..."})]}):e.jsxs(e.Fragment,{children:[e.jsxs(ir,{children:[e.jsx(or,{children:e.jsxs(Ge,{className:"bg-[#0a1628] hover:bg-[#0a1628] border-gray-700",children:[e.jsx(je,{className:"text-gray-400",children:"发起人"}),e.jsx(je,{className:"text-gray-400",children:"匹配到"}),e.jsx(je,{className:"text-gray-400",children:"类型"}),e.jsx(je,{className:"text-gray-400",children:"联系方式"}),e.jsx(je,{className:"text-gray-400",children:"匹配时间"})]})}),e.jsxs(cr,{children:[s.map(b=>e.jsxs(Ge,{className:"hover:bg-[#0a1628] border-gray-700/50",children:[e.jsx(pe,{children:e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsxs("div",{className:"w-9 h-9 rounded-full bg-[#38bdac]/20 flex items-center justify-center text-sm font-medium text-[#38bdac] flex-shrink-0 overflow-hidden",children:[b.userAvatar?e.jsx("img",{src:b.userAvatar,alt:"",className:"w-full h-full object-cover",onError:N=>{N.currentTarget.style.display="none"}}):null,e.jsx("span",{className:b.userAvatar?"hidden":"",children:(b.userNickname||b.userId||"?").charAt(0)})]}),e.jsxs("div",{children:[e.jsx("div",{className:"text-white",children:b.userNickname||b.userId}),e.jsxs("div",{className:"text-xs text-gray-500 font-mono",children:[b.userId.slice(0,16),"..."]})]})]})}),e.jsx(pe,{children:e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsxs("div",{className:"w-9 h-9 rounded-full bg-[#38bdac]/20 flex items-center justify-center text-sm font-medium text-[#38bdac] flex-shrink-0 overflow-hidden",children:[b.matchedUserAvatar?e.jsx("img",{src:b.matchedUserAvatar,alt:"",className:"w-full h-full object-cover",onError:N=>{N.currentTarget.style.display="none"}}):null,e.jsx("span",{className:b.matchedUserAvatar?"hidden":"",children:(b.matchedNickname||b.matchedUserId||"?").charAt(0)})]}),e.jsxs("div",{children:[e.jsx("div",{className:"text-white",children:b.matchedNickname||b.matchedUserId}),e.jsxs("div",{className:"text-xs text-gray-500 font-mono",children:[b.matchedUserId.slice(0,16),"..."]})]})]})}),e.jsx(pe,{children:e.jsx(Oe,{className:"bg-[#38bdac]/20 text-[#38bdac] border-0",children:jx[b.matchType]||b.matchType})}),e.jsxs(pe,{className:"text-gray-400 text-sm",children:[b.phone&&e.jsxs("div",{children:["📱 ",b.phone]}),b.wechatId&&e.jsxs("div",{children:["💬 ",b.wechatId]}),!b.phone&&!b.wechatId&&"-"]}),e.jsx(pe,{className:"text-gray-400",children:b.createdAt?new Date(b.createdAt).toLocaleString():"-"})]},b.id)),s.length===0&&e.jsx(Ge,{children:e.jsx(pe,{colSpan:5,className:"text-center py-12 text-gray-500",children:"暂无匹配记录"})})]})]}),e.jsx(Ar,{page:c,totalPages:S,total:l,pageSize:h,onPageChange:d,onPageSizeChange:b=>{m(b),d(1)}})]})})})]})}function _4(){const[s,a]=f.useState([]),[l,o]=f.useState(0),[c,d]=f.useState(1),[h,m]=f.useState(10),[p,y]=f.useState(!0);async function g(){y(!0);try{const C=new URLSearchParams({page:String(c),pageSize:String(h),matchType:"investor"}),P=await Fe(`/api/db/match-records?${C}`);P!=null&&P.success&&(a(P.records||[]),o(P.total??0))}catch(C){console.error(C)}finally{y(!1)}}f.useEffect(()=>{g()},[c]);const v=Math.ceil(l/h)||1;return e.jsxs("div",{children:[e.jsxs("div",{className:"flex justify-between items-center mb-4",children:[e.jsxs("div",{children:[e.jsxs("p",{className:"text-gray-400",children:["资源对接匹配记录,共 ",l," 条"]}),e.jsx("p",{className:"text-gray-500 text-xs mt-1",children:"用户填写「我能帮到你什么」和「我需要什么帮助」后提交到存客宝"})]}),e.jsxs("button",{type:"button",onClick:g,disabled:p,className:"flex items-center gap-2 px-4 py-2 rounded-lg border border-gray-600 text-gray-300 hover:bg-gray-700/50 transition-colors disabled:opacity-50",children:[e.jsx($e,{className:`w-4 h-4 ${p?"animate-spin":""}`})," 刷新"]})]}),e.jsx(Ne,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:e.jsx(we,{className:"p-0",children:p?e.jsxs("div",{className:"flex justify-center py-12",children:[e.jsx($e,{className:"w-6 h-6 text-[#38bdac] animate-spin"}),e.jsx("span",{className:"ml-2 text-gray-400",children:"加载中..."})]}):e.jsxs(e.Fragment,{children:[e.jsxs(ir,{children:[e.jsx(or,{children:e.jsxs(Ge,{className:"bg-[#0a1628] hover:bg-[#0a1628] border-gray-700",children:[e.jsx(je,{className:"text-gray-400",children:"发起人"}),e.jsx(je,{className:"text-gray-400",children:"匹配到"}),e.jsx(je,{className:"text-gray-400",children:"联系方式"}),e.jsx(je,{className:"text-gray-400",children:"时间"})]})}),e.jsxs(cr,{children:[s.map(C=>e.jsxs(Ge,{className:"hover:bg-[#0a1628] border-gray-700/50",children:[e.jsx(pe,{className:"text-white",children:C.userNickname||C.userId}),e.jsx(pe,{className:"text-white",children:C.matchedNickname||C.matchedUserId}),e.jsxs(pe,{className:"text-gray-400 text-sm",children:[C.phone&&e.jsxs("div",{children:["📱 ",C.phone]}),C.wechatId&&e.jsxs("div",{children:["💬 ",C.wechatId]}),!C.phone&&!C.wechatId&&"-"]}),e.jsx(pe,{className:"text-gray-400",children:C.createdAt?new Date(C.createdAt).toLocaleString():"-"})]},C.id)),s.length===0&&e.jsx(Ge,{children:e.jsx(pe,{colSpan:4,className:"text-center py-12 text-gray-500",children:"暂无资源对接记录"})})]})]}),e.jsx(Ar,{page:c,totalPages:v,total:l,pageSize:h,onPageChange:d,onPageSizeChange:C=>{m(C),d(1)}})]})})})]})}const bx={created:"已创建",pending_pay:"待支付",paid:"已支付",completed:"已完成",cancelled:"已取消"},M4={single:"单次",half_year:"半年",year:"年度"};function A4(){const[s,a]=f.useState([]),[l,o]=f.useState(!0),[c,d]=f.useState("");async function h(){o(!0);try{const m=c?`/api/db/mentor-consultations?status=${c}`:"/api/db/mentor-consultations",p=await Fe(m);p!=null&&p.success&&p.data&&a(p.data)}catch(m){console.error(m)}finally{o(!1)}}return f.useEffect(()=>{h()},[c]),e.jsxs("div",{children:[e.jsxs("div",{className:"flex justify-between items-center mb-4",children:[e.jsx("p",{className:"text-gray-400",children:"导师咨询预约记录"}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs("select",{value:c,onChange:m=>d(m.target.value),className:"bg-[#0f2137] border border-gray-700 rounded-lg px-3 py-2 text-gray-300 text-sm",children:[e.jsx("option",{value:"",children:"全部状态"}),Object.entries(bx).map(([m,p])=>e.jsx("option",{value:m,children:p},m))]}),e.jsxs(Z,{onClick:h,disabled:l,variant:"outline",className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:[e.jsx($e,{className:`w-4 h-4 mr-2 ${l?"animate-spin":""}`})," 刷新"]})]})]}),e.jsx(Ne,{className:"bg-[#0f2137] border-gray-700/50",children:e.jsx(we,{className:"p-0",children:l?e.jsx("div",{className:"py-12 text-center text-gray-400",children:"加载中..."}):e.jsxs(ir,{children:[e.jsx(or,{children:e.jsxs(Ge,{className:"bg-[#0a1628] border-gray-700",children:[e.jsx(je,{className:"text-gray-400",children:"ID"}),e.jsx(je,{className:"text-gray-400",children:"用户ID"}),e.jsx(je,{className:"text-gray-400",children:"导师ID"}),e.jsx(je,{className:"text-gray-400",children:"类型"}),e.jsx(je,{className:"text-gray-400",children:"金额"}),e.jsx(je,{className:"text-gray-400",children:"状态"}),e.jsx(je,{className:"text-gray-400",children:"创建时间"})]})}),e.jsxs(cr,{children:[s.map(m=>e.jsxs(Ge,{className:"border-gray-700/50",children:[e.jsx(pe,{className:"text-gray-300",children:m.id}),e.jsx(pe,{className:"text-gray-400",children:m.userId}),e.jsx(pe,{className:"text-gray-400",children:m.mentorId}),e.jsx(pe,{className:"text-gray-400",children:M4[m.consultationType]||m.consultationType}),e.jsxs(pe,{className:"text-white",children:["¥",m.amount]}),e.jsx(pe,{className:"text-gray-400",children:bx[m.status]||m.status}),e.jsx(pe,{className:"text-gray-500 text-sm",children:m.createdAt?new Date(m.createdAt).toLocaleString():"-"})]},m.id)),s.length===0&&e.jsx(Ge,{children:e.jsx(pe,{colSpan:7,className:"text-center py-12 text-gray-500",children:"暂无预约记录"})})]})]})})})]})}function D4(){const[s,a]=f.useState([]),[l,o]=f.useState(0),[c,d]=f.useState(1),[h,m]=f.useState(10),[p,y]=f.useState(!0);async function g(){y(!0);try{const C=new URLSearchParams({page:String(c),pageSize:String(h),matchType:"team"}),P=await Fe(`/api/db/match-records?${C}`);P!=null&&P.success&&(a(P.records||[]),o(P.total??0))}catch(C){console.error(C)}finally{y(!1)}}f.useEffect(()=>{g()},[c]);const v=Math.ceil(l/h)||1;return e.jsxs("div",{children:[e.jsxs("div",{className:"flex justify-between items-center mb-4",children:[e.jsxs("div",{children:[e.jsxs("p",{className:"text-gray-400",children:["团队招募匹配记录,共 ",l," 条"]}),e.jsx("p",{className:"text-gray-500 text-xs mt-1",children:"用户通过「团队招募」提交联系方式到存客宝"})]}),e.jsxs("button",{type:"button",onClick:g,disabled:p,className:"flex items-center gap-2 px-4 py-2 rounded-lg border border-gray-600 text-gray-300 hover:bg-gray-700/50 transition-colors disabled:opacity-50",children:[e.jsx($e,{className:`w-4 h-4 ${p?"animate-spin":""}`})," 刷新"]})]}),e.jsx(Ne,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:e.jsx(we,{className:"p-0",children:p?e.jsxs("div",{className:"flex justify-center py-12",children:[e.jsx($e,{className:"w-6 h-6 text-[#38bdac] animate-spin"}),e.jsx("span",{className:"ml-2 text-gray-400",children:"加载中..."})]}):e.jsxs(e.Fragment,{children:[e.jsxs(ir,{children:[e.jsx(or,{children:e.jsxs(Ge,{className:"bg-[#0a1628] hover:bg-[#0a1628] border-gray-700",children:[e.jsx(je,{className:"text-gray-400",children:"发起人"}),e.jsx(je,{className:"text-gray-400",children:"匹配到"}),e.jsx(je,{className:"text-gray-400",children:"联系方式"}),e.jsx(je,{className:"text-gray-400",children:"时间"})]})}),e.jsxs(cr,{children:[s.map(C=>e.jsxs(Ge,{className:"hover:bg-[#0a1628] border-gray-700/50",children:[e.jsx(pe,{className:"text-white",children:C.userNickname||C.userId}),e.jsx(pe,{className:"text-white",children:C.matchedNickname||C.matchedUserId}),e.jsxs(pe,{className:"text-gray-400 text-sm",children:[C.phone&&e.jsxs("div",{children:["📱 ",C.phone]}),C.wechatId&&e.jsxs("div",{children:["💬 ",C.wechatId]}),!C.phone&&!C.wechatId&&"-"]}),e.jsx(pe,{className:"text-gray-400",children:C.createdAt?new Date(C.createdAt).toLocaleString():"-"})]},C.id)),s.length===0&&e.jsx(Ge,{children:e.jsx(pe,{colSpan:4,className:"text-center py-12 text-gray-500",children:"暂无团队招募记录"})})]})]}),e.jsx(Ar,{page:c,totalPages:v,total:l,pageSize:h,onPageChange:d,onPageSizeChange:C=>{m(C),d(1)}})]})})})]})}function L4(){const[s,a]=f.useState(null),[l,o]=f.useState(!0),[c,d]=f.useState([{endpoint:"/api/ckb/join",label:"CKB 加入(ckb/join)",status:"idle"},{endpoint:"/api/ckb/match",label:"CKB 匹配上报(ckb/match)",status:"idle"},{endpoint:"/api/miniprogram/ckb/lead",label:"CKB 链接卡若(ckb/lead)",status:"idle"},{endpoint:"/api/match/config",label:"匹配配置(match/config)",status:"idle"}]),h={partner:"超级个体",investor:"资源对接",mentor:"导师顾问",team:"团队招募"},m=f.useCallback(async()=>{o(!0);try{const g=await Fe("/api/db/match-records?stats=true");if(g!=null&&g.success&&g.data)a(g.data);else{const v=await Fe("/api/db/match-records?page=1&pageSize=1");v!=null&&v.success&&a({totalMatches:v.total??0,todayMatches:0,byType:[],uniqueUsers:0})}}catch(g){console.error("加载统计失败:",g)}finally{o(!1)}},[]);f.useEffect(()=>{m()},[m]);const p=async g=>{const v=c[g],C=[...c];C[g]={...v,status:"testing",message:void 0,responseTime:void 0},d(C);const P=performance.now();try{let T;v.endpoint.includes("match/config")?T=await Fe(v.endpoint):T=await Et(v.endpoint,{type:"partner",phone:"00000000000",wechat:"test_ping",userId:"test_admin_ping",matchType:"partner",name:"接口测试"});const S=Math.round(performance.now()-P),b=[...c],N=(T==null?void 0:T.success)!==void 0||(T==null?void 0:T.code)===200||(T==null?void 0:T.code)===400;b[g]={...v,status:N?"success":"error",message:(T==null?void 0:T.message)||(N?"接口可用":"响应异常"),responseTime:S},d(b)}catch(T){const S=Math.round(performance.now()-P),b=[...c];b[g]={...v,status:"error",message:T instanceof Error?T.message:"请求失败",responseTime:S},d(b)}},y=async()=>{for(let g=0;g0&&e.jsxs(Ne,{className:"bg-[#0f2137] border-gray-700/50",children:[e.jsx(Ue,{children:e.jsx(Ve,{className:"text-white text-lg",children:"按类型分布"})}),e.jsx(we,{children:e.jsx("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-4",children:s.byType.map(g=>e.jsxs("div",{className:"bg-[#0a1628] rounded-lg p-4 text-center",children:[e.jsx("p",{className:"text-gray-400 text-sm",children:h[g.matchType]||g.matchType}),e.jsx("p",{className:"text-2xl font-bold text-white mt-2",children:g.count}),e.jsxs("p",{className:"text-gray-500 text-xs mt-1",children:[s.totalMatches>0?(g.count/s.totalMatches*100).toFixed(1):0,"%"]})]},g.matchType))})})]}),e.jsxs(Ne,{className:"bg-[#0f2137] border-gray-700/50",children:[e.jsxs(Ue,{className:"flex flex-row items-center justify-between",children:[e.jsxs("div",{children:[e.jsxs(Ve,{className:"text-white flex items-center gap-2",children:[e.jsx(Ys,{className:"w-5 h-5 text-[#38bdac]"}),"存客宝接口连通性测试"]}),e.jsx("p",{className:"text-gray-400 text-sm mt-1",children:"测试所有找伙伴相关的 CKB 接口是否正常可用"})]}),e.jsxs("div",{className:"flex gap-2",children:[e.jsxs(Z,{onClick:m,disabled:l,variant:"outline",className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:[e.jsx($e,{className:`w-4 h-4 mr-2 ${l?"animate-spin":""}`})," 刷新统计"]}),e.jsxs(Z,{onClick:y,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:[e.jsx(eo,{className:"w-4 h-4 mr-2"})," 全部测试"]})]})]}),e.jsx(we,{children:e.jsx("div",{className:"space-y-3",children:c.map((g,v)=>e.jsxs("div",{className:"flex items-center justify-between bg-[#0a1628] rounded-lg px-4 py-3",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[g.status==="idle"&&e.jsx("div",{className:"w-3 h-3 rounded-full bg-gray-500"}),g.status==="testing"&&e.jsx($e,{className:"w-4 h-4 text-yellow-400 animate-spin"}),g.status==="success"&&e.jsx(Wj,{className:"w-4 h-4 text-green-400"}),g.status==="error"&&e.jsx(Lx,{className:"w-4 h-4 text-red-400"}),e.jsxs("div",{children:[e.jsx("p",{className:"text-white text-sm font-medium",children:g.label}),e.jsx("p",{className:"text-gray-500 text-xs font-mono",children:g.endpoint})]})]}),e.jsxs("div",{className:"flex items-center gap-3",children:[g.message&&e.jsx("span",{className:`text-xs ${g.status==="success"?"text-green-400":g.status==="error"?"text-red-400":"text-gray-400"}`,children:g.message}),g.responseTime!==void 0&&e.jsxs(Oe,{className:"bg-gray-700 text-gray-300 border-0",children:[g.responseTime,"ms"]}),e.jsx(Z,{size:"sm",variant:"outline",onClick:()=>p(v),disabled:g.status==="testing",className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent text-xs",children:"测试"})]})]},g.endpoint))})})]})]})}const O4=[{id:"pool",label:"匹配池",icon:Qt},{id:"records",label:"匹配记录",icon:Eb},{id:"resource",label:"资源对接",icon:xb},{id:"mentor",label:"导师预约",icon:zx},{id:"team",label:"团队招募",icon:Vd},{id:"stats",label:"存客宝统计",icon:Dj}];function F4(){const[s,a]=f.useState("pool");return e.jsxs("div",{className:"p-8 w-full",children:[e.jsxs("div",{className:"mb-6",children:[e.jsxs("h2",{className:"text-2xl font-bold text-white flex items-center gap-2",children:[e.jsx(Qt,{className:"w-6 h-6 text-[#38bdac]"}),"找伙伴"]}),e.jsx("p",{className:"text-gray-400 mt-1",children:"管理匹配池、匹配记录、资源对接、导师预约、团队招募及存客宝数据统计"})]}),e.jsx("div",{className:"flex gap-1 mb-6 bg-[#0f2137] rounded-lg p-1 border border-gray-700/50",children:O4.map(l=>{const o=s===l.id;return e.jsxs("button",{type:"button",onClick:()=>a(l.id),className:`flex items-center gap-2 px-4 py-2.5 rounded-md text-sm font-medium transition-all ${o?"bg-[#38bdac] text-white shadow-lg":"text-gray-400 hover:text-white hover:bg-gray-700/50"}`,children:[e.jsx(l.icon,{className:"w-4 h-4"}),l.label]},l.id)})}),s==="pool"&&e.jsx(R4,{}),s==="records"&&e.jsx(I4,{}),s==="resource"&&e.jsx(_4,{}),s==="mentor"&&e.jsx(A4,{}),s==="team"&&e.jsx(D4,{}),s==="stats"&&e.jsx(L4,{})]})}function z4(){return e.jsxs("div",{className:"p-8 w-full",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-8",children:[e.jsx(Ys,{className:"w-8 h-8 text-[#38bdac]"}),e.jsx("h1",{className:"text-2xl font-bold text-white",children:"API 接口文档"})]}),e.jsx("p",{className:"text-gray-400 mb-6",children:"API 风格:RESTful · 版本 v1.0 · 基础路径 /api · 简单、清晰、易用。"}),e.jsxs(Ne,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl mb-6",children:[e.jsx(Ue,{children:e.jsx(Ve,{className:"text-white",children:"1. 接口总览"})}),e.jsxs(we,{className:"space-y-4 text-sm",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-gray-400 mb-2",children:"接口分类"}),e.jsxs("ul",{className:"space-y-1 text-gray-300 font-mono",children:[e.jsx("li",{children:"/api/book — 书籍内容(章节列表、内容获取、同步)"}),e.jsx("li",{children:"/api/payment — 支付系统(订单创建、回调、状态查询)"}),e.jsx("li",{children:"/api/referral — 分销系统(邀请码、收益、提现)"}),e.jsx("li",{children:"/api/user — 用户系统(登录、注册、信息更新)"}),e.jsx("li",{children:"/api/match — 匹配系统(寻找匹配、匹配历史)"}),e.jsx("li",{children:"/api/admin — 管理后台(内容/订单/用户/分销管理)"}),e.jsx("li",{children:"/api/config — 配置系统"})]})]}),e.jsxs("div",{children:[e.jsx("p",{className:"text-gray-400 mb-2",children:"认证方式"}),e.jsx("p",{className:"text-gray-300",children:"用户:Cookie session_id(可选)"}),e.jsx("p",{className:"text-gray-300",children:"管理端:Authorization: Bearer admin-token-secret"})]})]})]}),e.jsxs(Ne,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl mb-6",children:[e.jsx(Ue,{children:e.jsx(Ve,{className:"text-white",children:"2. 书籍内容"})}),e.jsxs(we,{className:"space-y-2 text-sm text-gray-300 font-mono",children:[e.jsx("p",{children:"GET /api/book/all-chapters — 获取所有章节"}),e.jsx("p",{children:"GET /api/book/chapter/:id — 获取单章内容"}),e.jsx("p",{children:"POST /api/book/sync — 同步章节(需管理员认证)"})]})]}),e.jsxs(Ne,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl mb-6",children:[e.jsx(Ue,{children:e.jsx(Ve,{className:"text-white",children:"3. 支付"})}),e.jsxs(we,{className:"space-y-2 text-sm text-gray-300 font-mono",children:[e.jsx("p",{children:"POST /api/payment/create-order — 创建订单"}),e.jsx("p",{children:"POST /api/payment/alipay/notify — 支付宝回调"}),e.jsx("p",{children:"POST /api/payment/wechat/notify — 微信回调"})]})]}),e.jsxs(Ne,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl mb-6",children:[e.jsx(Ue,{children:e.jsx(Ve,{className:"text-white",children:"4. 分销与用户"})}),e.jsxs(we,{className:"space-y-2 text-sm text-gray-300 font-mono",children:[e.jsx("p",{children:"/api/referral/* — 邀请码、收益查询、提现"}),e.jsx("p",{children:"/api/user/* — 登录、注册、信息更新"}),e.jsx("p",{children:"/api/match/* — 匹配、匹配历史"})]})]}),e.jsxs(Ne,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl mb-6",children:[e.jsx(Ue,{children:e.jsx(Ve,{className:"text-white",children:"5. 管理后台"})}),e.jsxs(we,{className:"space-y-2 text-sm text-gray-300 font-mono",children:[e.jsx("p",{children:"GET/POST /api/admin/referral-settings — 推广/分销设置(含 VIP 配置)"}),e.jsx("p",{children:"GET /api/db/users、/api/db/book — 用户与章节数据"}),e.jsx("p",{children:"GET /api/orders — 订单列表"})]})]}),e.jsx("p",{className:"text-gray-500 text-xs",children:"完整说明见项目内 开发文档/5、接口/API接口完整文档.md"})]})}function $4(){const s=Zs();return e.jsx("div",{className:"min-h-screen bg-[#0a1628] flex items-center justify-center p-8",children:e.jsxs("div",{className:"text-center max-w-md",children:[e.jsx("div",{className:"inline-flex items-center justify-center w-20 h-20 rounded-full bg-red-500/20 text-red-400 mb-6",children:e.jsx(Bj,{className:"w-10 h-10"})}),e.jsx("h1",{className:"text-4xl font-bold text-white mb-2",children:"404"}),e.jsx("p",{className:"text-gray-400 mb-1",children:"页面不存在"}),e.jsx("p",{className:"text-sm text-gray-500 font-mono mb-8 break-all",children:s.pathname}),e.jsx(Z,{asChild:!0,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:e.jsxs(Hi,{to:"/",children:[e.jsx(yb,{className:"w-4 h-4 mr-2"}),"返回首页"]})})]})})}function B4(){return e.jsxs(fj,{children:[e.jsx(dt,{path:"/login",element:e.jsx(gw,{})}),e.jsxs(dt,{path:"/",element:e.jsx(jN,{}),children:[e.jsx(dt,{index:!0,element:e.jsx(yd,{to:"/dashboard",replace:!0})}),e.jsx(dt,{path:"dashboard",element:e.jsx(vw,{})}),e.jsx(dt,{path:"orders",element:e.jsx(n2,{})}),e.jsx(dt,{path:"users",element:e.jsx(I2,{})}),e.jsx(dt,{path:"distribution",element:e.jsx(_2,{})}),e.jsx(dt,{path:"withdrawals",element:e.jsx(M2,{})}),e.jsx(dt,{path:"content",element:e.jsx($C,{})}),e.jsx(dt,{path:"referral-settings",element:e.jsx(o4,{})}),e.jsx(dt,{path:"author-settings",element:e.jsx(yd,{to:"/settings?tab=author",replace:!0})}),e.jsx(dt,{path:"admin-users",element:e.jsx(yd,{to:"/settings?tab=admin",replace:!0})}),e.jsx(dt,{path:"vip-roles",element:e.jsx(k4,{})}),e.jsx(dt,{path:"mentors",element:e.jsx(E4,{})}),e.jsx(dt,{path:"mentor-consultations",element:e.jsx(P4,{})}),e.jsx(dt,{path:"settings",element:e.jsx(p4,{})}),e.jsx(dt,{path:"payment",element:e.jsx(g4,{})}),e.jsx(dt,{path:"site",element:e.jsx(b4,{})}),e.jsx(dt,{path:"qrcodes",element:e.jsx(N4,{})}),e.jsx(dt,{path:"find-partner",element:e.jsx(F4,{})}),e.jsx(dt,{path:"match",element:e.jsx(S4,{})}),e.jsx(dt,{path:"match-records",element:e.jsx(C4,{})}),e.jsx(dt,{path:"api-doc",element:e.jsx(z4,{})})]}),e.jsx(dt,{path:"*",element:e.jsx($4,{})})]})}gv.createRoot(document.getElementById("root")).render(e.jsx(f.StrictMode,{children:e.jsx(bj,{future:{v7_startTransition:!0,v7_relativeSplatPath:!0},children:e.jsx(B4,{})})})); diff --git a/soul-admin/dist/index.html b/soul-admin/dist/index.html index 48e73657..d5435e0d 100644 --- a/soul-admin/dist/index.html +++ b/soul-admin/dist/index.html @@ -4,8 +4,8 @@ 管理后台 - Soul创业派对 - - + +
diff --git a/soul-admin/src/App.tsx b/soul-admin/src/App.tsx index 7562bb5a..3c04e125 100644 --- a/soul-admin/src/App.tsx +++ b/soul-admin/src/App.tsx @@ -8,7 +8,6 @@ import { DistributionPage } from './pages/distribution/DistributionPage' import { WithdrawalsPage } from './pages/withdrawals/WithdrawalsPage' import { ContentPage } from './pages/content/ContentPage' import { ReferralSettingsPage } from './pages/referral-settings/ReferralSettingsPage' -import { AuthorSettingsPage } from './pages/author-settings/AuthorSettingsPage' import { SettingsPage } from './pages/settings/SettingsPage' import { PaymentPage } from './pages/payment/PaymentPage' import { SitePage } from './pages/site/SitePage' @@ -18,7 +17,7 @@ import { MatchRecordsPage } from './pages/match-records/MatchRecordsPage' import { VipRolesPage } from './pages/vip-roles/VipRolesPage' import { MentorsPage } from './pages/mentors/MentorsPage' import { MentorConsultationsPage } from './pages/mentor-consultations/MentorConsultationsPage' -import { AdminUsersPage } from './pages/admin-users/AdminUsersPage' +import { FindPartnerPage } from './pages/find-partner/FindPartnerPage' import { ApiDocPage } from './pages/api-doc/ApiDocPage' import { NotFoundPage } from './pages/not-found/NotFoundPage' @@ -35,15 +34,16 @@ function App() { } /> } /> } /> - } /> + } /> + } /> } /> } /> } /> - } /> } /> } /> } /> } /> + } /> } /> } /> } /> diff --git a/soul-admin/src/layouts/AdminLayout.tsx b/soul-admin/src/layouts/AdminLayout.tsx index 21a291f7..27771a39 100644 --- a/soul-admin/src/layouts/AdminLayout.tsx +++ b/soul-admin/src/layouts/AdminLayout.tsx @@ -11,9 +11,6 @@ import { GitMerge, Crown, GraduationCap, - Calendar, - User, - ShieldCheck, ChevronDown, ChevronUp, } from 'lucide-react' @@ -28,13 +25,10 @@ const primaryMenuItems = [ ] // 折叠区「更多」(字典类 + 业务) const moreMenuItems = [ + { icon: GitMerge, label: '找伙伴', href: '/find-partner' }, { icon: Crown, label: 'VIP 角色', href: '/vip-roles' }, - { icon: User, label: '作者详情', href: '/author-settings' }, - { icon: ShieldCheck, label: '管理员', href: '/admin-users' }, { icon: GraduationCap, label: '导师管理', href: '/mentors' }, - { icon: Calendar, label: '导师预约', href: '/mentor-consultations' }, { 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 8f3b7398..4a442f6d 100644 --- a/soul-admin/src/pages/content/ChapterTree.tsx +++ b/soul-admin/src/pages/content/ChapterTree.tsx @@ -16,6 +16,8 @@ export interface SectionItem { isNew?: boolean clickCount?: number payCount?: number + hotScore?: number + hotRank?: number } export interface ChapterItem { @@ -55,6 +57,8 @@ interface ChapterTreeProps { /** 批量移动:勾选章节 */ selectedSectionIds?: string[] onToggleSectionSelect?: (sectionId: string) => void + /** 查看某节的付款记录 */ + onShowSectionOrders?: (s: SectionItem) => void } export function ChapterTree({ @@ -72,6 +76,7 @@ export function ChapterTree({ onEditChapter, selectedSectionIds = [], onToggleSectionSelect, + onShowSectionOrders, }: ChapterTreeProps) { const [draggingItem, setDraggingItem] = useState<{ type: DragType; id: string } | null>(null) const [dragOverTarget, setDragOverTarget] = useState<{ type: DragType; id: string } | null>(null) @@ -318,6 +323,13 @@ export function ChapterTree({ ) : ( ¥{sec.price} )} + 点击 {(sec.clickCount ?? 0)} · 付款 {(sec.payCount ?? 0)} + 热度 {(sec.hotScore ?? 0).toFixed(1)} · 第{(sec.hotRank && sec.hotRank > 0 ? sec.hotRank : '-')}名 + {onShowSectionOrders && ( + + )}
)} + {onEditPart && ( + + )} + {onDeletePart && ( + + )} + {chapterCount}章 {isExpanded ? ( ) : ( @@ -393,7 +416,26 @@ export function ChapterTree({
{part.chapters.map((chapter) => (
-

{chapter.title}

+
+

{chapter.title}

+
e.stopPropagation()}> + {onEditChapter && ( + + )} + {onAddChapterInPart && ( + + )} + {onDeleteChapter && ( + + )} +
+
{chapter.sections.map((section) => { const secDragOver = isDragOver('section', section.id) @@ -432,6 +474,12 @@ export function ChapterTree({
点击 {(section.clickCount ?? 0)} · 付款 {(section.payCount ?? 0)} + 热度 {(section.hotScore ?? 0).toFixed(1)} · 第{(section.hotRank && section.hotRank > 0 ? section.hotRank : '-')}名 + {onShowSectionOrders && ( + + )} @@ -499,6 +547,12 @@ export function ChapterTree({
点击 {(sec.clickCount ?? 0)} · 付款 {(sec.payCount ?? 0)} + 热度 {(sec.hotScore ?? 0).toFixed(1)} · 第{(sec.hotRank && sec.hotRank > 0 ? sec.hotRank : '-')}名 + {onShowSectionOrders && ( + + )}
+ )}
点击 {(sec.clickCount ?? 0)} · 付款 {(sec.payCount ?? 0)} + 热度 {(sec.hotScore ?? 0).toFixed(1)} · 第{(sec.hotRank && sec.hotRank > 0 ? sec.hotRank : '-')}名 + {onShowSectionOrders && ( + + )}
+ )}
+ + + )} +
+ + + {/* 新建篇弹窗 */} @@ -1269,6 +1518,7 @@ export function ContentPage() { onEditChapter={handleEditChapter} selectedSectionIds={selectedSectionIds} onToggleSectionSelect={toggleSectionSelect} + onShowSectionOrders={handleShowSectionOrders} /> )} diff --git a/soul-admin/src/pages/dashboard/DashboardPage.tsx b/soul-admin/src/pages/dashboard/DashboardPage.tsx index 4595b545..89b5bd18 100644 --- a/soul-admin/src/pages/dashboard/DashboardPage.tsx +++ b/soul-admin/src/pages/dashboard/DashboardPage.tsx @@ -39,6 +39,18 @@ interface DashboardOverviewRes { newUsers?: UserRow[] } +interface UsersRes { + success?: boolean + users?: UserRow[] + total?: number +} + +interface OrdersRes { + success?: boolean + orders?: OrderRow[] + total?: number +} + export function DashboardPage() { const navigate = useNavigate() const [isLoading, setIsLoading] = useState(true) @@ -48,9 +60,11 @@ export function DashboardPage() { const [paidOrderCount, setPaidOrderCount] = useState(0) const [totalRevenue, setTotalRevenue] = useState(0) const [conversionRate, setConversionRate] = useState(0) + const [loadError, setLoadError] = useState(null) async function loadData() { setIsLoading(true) + setLoadError(null) try { const data = await get('/api/admin/dashboard/overview') if (data?.success) { @@ -60,9 +74,38 @@ export function DashboardPage() { setConversionRate(data.conversionRate ?? 0) setPurchases(data.recentOrders ?? []) setUsers(data.newUsers ?? []) + return } } catch (e) { - console.error('加载数据失败', e) + console.error('数据概览接口失败,尝试降级拉取', e) + } + // 降级:新接口未部署或失败时,用原有接口拉取用户与订单 + try { + const [usersData, ordersData] = await Promise.all([ + get('/api/db/users?page=1&pageSize=10'), + get('/api/orders?page=1&pageSize=20&status=paid'), + ]) + const totalUsers = typeof usersData?.total === 'number' ? usersData.total : (usersData?.users?.length ?? 0) + const orders = ordersData?.orders ?? [] + const total = typeof ordersData?.total === 'number' ? ordersData.total : orders.length + const paidOrders = orders.filter((p) => p.status === 'paid' || p.status === 'completed' || p.status === 'success') + const revenue = paidOrders.reduce((sum, p) => sum + Number(p.amount || 0), 0) + const paidUserIds = new Set(paidOrders.map((p) => p.userId).filter(Boolean)) + const rate = totalUsers > 0 && paidUserIds.size > 0 ? (paidUserIds.size / totalUsers) * 100 : 0 + setTotalUsersCount(totalUsers) + setPaidOrderCount(total) + setTotalRevenue(revenue) + setConversionRate(rate) + setPurchases(orders.slice(0, 5)) + setUsers(usersData?.users ?? []) + } catch (fallbackErr) { + console.error('降级拉取失败', fallbackErr) + const err = fallbackErr as Error & { status?: number } + if (err?.status === 401) { + setLoadError('登录已过期,请重新登录') + } else { + setLoadError('加载失败,请检查网络或联系管理员') + } } finally { setIsLoading(false) } @@ -70,6 +113,8 @@ export function DashboardPage() { useEffect(() => { loadData() + const timer = setInterval(loadData, 30000) + return () => clearInterval(timer) }, []) if (isLoading) { @@ -157,7 +202,18 @@ export function DashboardPage() { return (

数据概览

- + {loadError && ( +
+ {loadError} + +
+ )}
{stats.map((stat, index) => ( - + 最近订单 +
{purchases - .slice(-5) - .reverse() + .slice(0, 5) .map((p) => { const referrer: UserRow | undefined = p.referrerId ? users.find((u) => u.id === p.referrerId) @@ -285,8 +349,7 @@ export function DashboardPage() {
{users - .slice(-5) - .reverse() + .slice(0, 5) .map((u) => (
('pool') + + return ( +
+
+

+ + 找伙伴 +

+

+ 管理匹配池、匹配记录、资源对接、导师预约、团队招募及存客宝数据统计 +

+
+ +
+ {TABS.map((tab) => { + const isActive = activeTab === tab.id + return ( + + ) + })} +
+ + {activeTab === 'pool' && } + {activeTab === 'records' && } + {activeTab === 'resource' && } + {activeTab === 'mentor' && } + {activeTab === 'team' && } + {activeTab === 'stats' && } +
+ ) +} diff --git a/soul-admin/src/pages/find-partner/tabs/CKBStatsTab.tsx b/soul-admin/src/pages/find-partner/tabs/CKBStatsTab.tsx new file mode 100644 index 00000000..0b26c3fd --- /dev/null +++ b/soul-admin/src/pages/find-partner/tabs/CKBStatsTab.tsx @@ -0,0 +1,242 @@ +import { useState, useEffect, useCallback } from 'react' +import { Card, CardContent, CardHeader, CardTitle } from '@/components/ui/card' +import { Button } from '@/components/ui/button' +import { Badge } from '@/components/ui/badge' +import { RefreshCw, Users, UserCheck, TrendingUp, Zap, Link2, CheckCircle2, XCircle } from 'lucide-react' +import { get, post } from '@/api/client' + +interface MatchStats { + totalMatches: number + todayMatches: number + byType: { matchType: string; count: number }[] + uniqueUsers: number +} + +interface CKBTestResult { + endpoint: string + label: string + status: 'idle' | 'testing' | 'success' | 'error' + message?: string + responseTime?: number +} + +export function CKBStatsTab() { + const [stats, setStats] = useState(null) + const [isLoading, setIsLoading] = useState(true) + const [ckbTests, setCkbTests] = useState([ + { endpoint: '/api/ckb/join', label: 'CKB 加入(ckb/join)', status: 'idle' }, + { endpoint: '/api/ckb/match', label: 'CKB 匹配上报(ckb/match)', status: 'idle' }, + { endpoint: '/api/miniprogram/ckb/lead', label: 'CKB 链接卡若(ckb/lead)', status: 'idle' }, + { endpoint: '/api/match/config', label: '匹配配置(match/config)', status: 'idle' }, + ]) + + const typeLabels: Record = { + partner: '超级个体', investor: '资源对接', mentor: '导师顾问', team: '团队招募', + } + + const loadStats = useCallback(async () => { + setIsLoading(true) + try { + const data = await get<{ success?: boolean; data?: MatchStats }>('/api/db/match-records?stats=true') + if (data?.success && data.data) { + setStats(data.data) + } else { + const fallback = await get<{ success?: boolean; records?: unknown[]; total?: number }>('/api/db/match-records?page=1&pageSize=1') + if (fallback?.success) { + setStats({ + totalMatches: fallback.total ?? 0, + todayMatches: 0, + byType: [], + uniqueUsers: 0, + }) + } + } + } catch (e) { console.error('加载统计失败:', e) } + finally { setIsLoading(false) } + }, []) + + useEffect(() => { loadStats() }, [loadStats]) + + const testEndpoint = async (index: number) => { + const test = ckbTests[index] + const updated = [...ckbTests] + updated[index] = { ...test, status: 'testing', message: undefined, responseTime: undefined } + setCkbTests(updated) + + const start = performance.now() + try { + let res: { success?: boolean; message?: string; code?: number } + if (test.endpoint.includes('match/config')) { + res = await get<{ success?: boolean }>(test.endpoint) + } else { + res = await post<{ success?: boolean; message?: string }>(test.endpoint, { + type: 'partner', + phone: '00000000000', + wechat: 'test_ping', + userId: 'test_admin_ping', + matchType: 'partner', + name: '接口测试', + }) + } + const elapsed = Math.round(performance.now() - start) + const next = [...ckbTests] + const ok = res?.success !== undefined || res?.code === 200 || res?.code === 400 + next[index] = { + ...test, + status: ok ? 'success' : 'error', + message: res?.message || (ok ? '接口可用' : '响应异常'), + responseTime: elapsed, + } + setCkbTests(next) + } catch (e: unknown) { + const elapsed = Math.round(performance.now() - start) + const next = [...ckbTests] + next[index] = { + ...test, + status: 'error', + message: e instanceof Error ? e.message : '请求失败', + responseTime: elapsed, + } + setCkbTests(next) + } + } + + const testAll = async () => { + for (let i = 0; i < ckbTests.length; i++) { + await testEndpoint(i) + } + } + + return ( +
+ {/* 统计卡片 */} +
+ + +
+
+

总匹配次数

+

{isLoading ? '-' : (stats?.totalMatches ?? 0)}

+
+ +
+
+
+ + +
+
+

今日匹配

+

{isLoading ? '-' : (stats?.todayMatches ?? 0)}

+
+ +
+
+
+ + +
+
+

独立用户数

+

{isLoading ? '-' : (stats?.uniqueUsers ?? 0)}

+
+ +
+
+
+ + +
+
+

人均匹配

+

+ {isLoading ? '-' : (stats?.uniqueUsers ? (stats.totalMatches / stats.uniqueUsers).toFixed(1) : '0')} +

+
+ +
+
+
+
+ + {/* 按类型分布 */} + {stats?.byType && stats.byType.length > 0 && ( + + + 按类型分布 + + +
+ {stats.byType.map(item => ( +
+

{typeLabels[item.matchType] || item.matchType}

+

{item.count}

+

+ {stats.totalMatches > 0 ? ((item.count / stats.totalMatches) * 100).toFixed(1) : 0}% +

+
+ ))} +
+
+
+ )} + + {/* CKB 接口测试 */} + + +
+ + + 存客宝接口连通性测试 + +

+ 测试所有找伙伴相关的 CKB 接口是否正常可用 +

+
+
+ + +
+
+ +
+ {ckbTests.map((test, idx) => ( +
+
+ {test.status === 'idle' &&
} + {test.status === 'testing' && } + {test.status === 'success' && } + {test.status === 'error' && } +
+

{test.label}

+

{test.endpoint}

+
+
+
+ {test.message && ( + + {test.message} + + )} + {test.responseTime !== undefined && ( + {test.responseTime}ms + )} + +
+
+ ))} +
+ + +
+ ) +} diff --git a/soul-admin/src/pages/find-partner/tabs/MatchPoolTab.tsx b/soul-admin/src/pages/find-partner/tabs/MatchPoolTab.tsx new file mode 100644 index 00000000..c9de2a69 --- /dev/null +++ b/soul-admin/src/pages/find-partner/tabs/MatchPoolTab.tsx @@ -0,0 +1,242 @@ +import { useState, useEffect } from 'react' +import { + Card, CardContent, CardHeader, CardTitle, CardDescription, +} from '@/components/ui/card' +import { Input } from '@/components/ui/input' +import { Button } from '@/components/ui/button' +import { Label } from '@/components/ui/label' +import { Switch } from '@/components/ui/switch' +import { + Table, TableBody, TableCell, TableHead, TableHeader, TableRow, +} from '@/components/ui/table' +import { Badge } from '@/components/ui/badge' +import { + Dialog, DialogContent, DialogHeader, DialogTitle, DialogFooter, +} from '@/components/ui/dialog' +import { Save, RefreshCw, Edit3, Plus, Trash2, Users, Zap } from 'lucide-react' +import { get, post } from '@/api/client' + +interface MatchType { + id: string; label: string; matchLabel: string; icon: string + matchFromDB: boolean; showJoinAfterMatch: boolean; price: number; enabled: boolean +} +interface MatchConfig { + matchTypes: MatchType[]; freeMatchLimit: number; matchPrice: number + settings: { enableFreeMatches: boolean; enablePaidMatches: boolean; maxMatchesPerDay: number } +} + +const DEFAULT_CONFIG: MatchConfig = { + matchTypes: [ + { id: 'partner', label: '超级个体', matchLabel: '超级个体', icon: '⭐', matchFromDB: true, showJoinAfterMatch: false, price: 1, enabled: true }, + { id: 'investor', label: '资源对接', matchLabel: '资源对接', icon: '👥', matchFromDB: false, showJoinAfterMatch: true, price: 1, enabled: true }, + { id: 'mentor', label: '导师顾问', matchLabel: '导师顾问', icon: '❤️', matchFromDB: false, showJoinAfterMatch: true, price: 1, enabled: true }, + { id: 'team', label: '团队招募', matchLabel: '加入项目', icon: '🎮', matchFromDB: false, showJoinAfterMatch: true, price: 1, enabled: true }, + ], + freeMatchLimit: 3, matchPrice: 1, + settings: { enableFreeMatches: true, enablePaidMatches: true, maxMatchesPerDay: 10 }, +} +const ICONS = ['⭐', '👥', '❤️', '🎮', '💼', '🚀', '💡', '🎯', '🔥', '✨'] + +export function MatchPoolTab() { + const [config, setConfig] = useState(DEFAULT_CONFIG) + const [isLoading, setIsLoading] = useState(true) + const [isSaving, setIsSaving] = useState(false) + const [showTypeModal, setShowTypeModal] = useState(false) + const [editingType, setEditingType] = useState(null) + const [formData, setFormData] = useState({ id: '', label: '', matchLabel: '', icon: '⭐', matchFromDB: false, showJoinAfterMatch: true, price: 1, enabled: true }) + + const loadConfig = async () => { + setIsLoading(true) + try { + const data = await get<{ success?: boolean; data?: MatchConfig; config?: MatchConfig }>('/api/db/config/full?key=match_config') + const c = (data as { data?: MatchConfig })?.data ?? (data as { config?: MatchConfig })?.config + if (c) setConfig({ ...DEFAULT_CONFIG, ...c }) + } catch (e) { console.error('加载匹配配置失败:', e) } + finally { setIsLoading(false) } + } + + useEffect(() => { loadConfig() }, []) + + const handleSave = async () => { + setIsSaving(true) + try { + const res = await post<{ success?: boolean; error?: string }>('/api/db/config', { key: 'match_config', value: config, description: '匹配功能配置' }) + alert(res?.success !== false ? '配置保存成功!' : '保存失败: ' + (res?.error || '未知错误')) + } catch (e) { console.error(e); alert('保存失败') } + finally { setIsSaving(false) } + } + + const handleEditType = (type: MatchType) => { + setEditingType(type) + setFormData({ ...type }) + setShowTypeModal(true) + } + const handleAddType = () => { + setEditingType(null) + setFormData({ id: '', label: '', matchLabel: '', icon: '⭐', matchFromDB: false, showJoinAfterMatch: true, price: 1, enabled: true }) + setShowTypeModal(true) + } + const handleSaveType = () => { + if (!formData.id || !formData.label) { alert('请填写类型ID和名称'); return } + const newTypes = [...config.matchTypes] + if (editingType) { + const idx = newTypes.findIndex(t => t.id === editingType.id) + if (idx !== -1) newTypes[idx] = { ...formData } + } else { + if (newTypes.some(t => t.id === formData.id)) { alert('类型ID已存在'); return } + newTypes.push({ ...formData }) + } + setConfig({ ...config, matchTypes: newTypes }) + setShowTypeModal(false) + } + const handleDeleteType = (typeId: string) => { + if (!confirm('确定要删除这个匹配类型吗?')) return + setConfig({ ...config, matchTypes: config.matchTypes.filter(t => t.id !== typeId) }) + } + const handleToggleType = (typeId: string) => { + setConfig({ ...config, matchTypes: config.matchTypes.map(t => t.id === typeId ? { ...t, enabled: !t.enabled } : t) }) + } + + return ( +
+
+ + +
+ + + + 基础设置 + 配置免费匹配次数和付费规则 + + +
+
+ + setConfig({ ...config, freeMatchLimit: parseInt(e.target.value, 10) || 0 })} /> +
+
+ + setConfig({ ...config, matchPrice: parseFloat(e.target.value) || 1 })} /> +
+
+ + setConfig({ ...config, settings: { ...config.settings, maxMatchesPerDay: parseInt(e.target.value, 10) || 10 } })} /> +
+
+
+
+ setConfig({ ...config, settings: { ...config.settings, enableFreeMatches: checked } })} /> + +
+
+ setConfig({ ...config, settings: { ...config.settings, enablePaidMatches: checked } })} /> + +
+
+
+
+ + + +
+ 匹配类型管理 + 配置不同的匹配类型及其价格 +
+ +
+ + + + + 图标 + 类型ID + 显示名称 + 匹配标签 + 价格 + 数据库匹配 + 状态 + 操作 + + + + {config.matchTypes.map(type => ( + + {type.icon} + {type.id} + {type.label} + {type.matchLabel} + ¥{type.price} + {type.matchFromDB ? : } + handleToggleType(type.id)} /> + +
+ + +
+
+
+ ))} +
+
+
+
+ + + + + + {editingType ? : } + {editingType ? '编辑匹配类型' : '添加匹配类型'} + + +
+
+
+ + setFormData({ ...formData, id: e.target.value })} disabled={!!editingType} /> +
+
+ +
+ {ICONS.map(icon => ( + + ))} +
+
+
+
+
+ + setFormData({ ...formData, label: e.target.value })} /> +
+
+ + setFormData({ ...formData, matchLabel: e.target.value })} /> +
+
+
+ + setFormData({ ...formData, price: parseFloat(e.target.value) || 1 })} /> +
+
+
setFormData({ ...formData, matchFromDB: checked })} />
+
setFormData({ ...formData, showJoinAfterMatch: checked })} />
+
setFormData({ ...formData, enabled: checked })} />
+
+
+ + + + +
+
+
+ ) +} diff --git a/soul-admin/src/pages/find-partner/tabs/MatchRecordsTab.tsx b/soul-admin/src/pages/find-partner/tabs/MatchRecordsTab.tsx new file mode 100644 index 00000000..15753e8a --- /dev/null +++ b/soul-admin/src/pages/find-partner/tabs/MatchRecordsTab.tsx @@ -0,0 +1,132 @@ +import { useState, useEffect } from 'react' +import { Card, CardContent } from '@/components/ui/card' +import { + Table, TableBody, TableCell, TableHead, TableHeader, TableRow, +} from '@/components/ui/table' +import { Badge } from '@/components/ui/badge' +import { RefreshCw } from 'lucide-react' +import { Pagination } from '@/components/ui/Pagination' +import { get } from '@/api/client' + +interface MatchRecord { + id: string; userId: string; matchedUserId: string; matchType: string + phone?: string; wechatId?: string; userNickname?: string; matchedNickname?: string + userAvatar?: string; matchedUserAvatar?: string; matchScore?: number; createdAt: string +} + +const matchTypeLabels: Record = { + partner: '超级个体', investor: '资源对接', mentor: '导师顾问', team: '团队招募', +} + +export function MatchRecordsTab() { + const [records, setRecords] = useState([]) + const [total, setTotal] = useState(0) + const [page, setPage] = useState(1) + const [pageSize, setPageSize] = useState(10) + const [matchTypeFilter, setMatchTypeFilter] = useState('') + const [isLoading, setIsLoading] = useState(true) + const [error, setError] = useState(null) + + async function loadRecords() { + setIsLoading(true); setError(null) + try { + const params = new URLSearchParams({ page: String(page), pageSize: String(pageSize) }) + if (matchTypeFilter) params.set('matchType', matchTypeFilter) + const data = await get<{ success?: boolean; records?: MatchRecord[]; total?: number }>(`/api/db/match-records?${params}`) + if (data?.success) { setRecords(data.records || []); setTotal(data.total ?? 0) } + else setError('加载匹配记录失败') + } catch { setError('加载失败,请检查网络后重试') } + finally { setIsLoading(false) } + } + + useEffect(() => { loadRecords() }, [page, matchTypeFilter]) + + const totalPages = Math.ceil(total / pageSize) || 1 + + return ( +
+ {error && ( +
+ {error} + +
+ )} +
+

共 {total} 条匹配记录

+
+ + +
+
+ + + + {isLoading ? ( +
加载中...
+ ) : ( + <> + + + + 发起人 + 匹配到 + 类型 + 联系方式 + 匹配时间 + + + + {records.map(r => ( + + +
+
+ {r.userAvatar ? { (e.currentTarget as HTMLImageElement).style.display = 'none' }} /> : null} + {(r.userNickname || r.userId || '?').charAt(0)} +
+
+
{r.userNickname || r.userId}
+
{r.userId.slice(0, 16)}...
+
+
+
+ +
+
+ {r.matchedUserAvatar ? { (e.currentTarget as HTMLImageElement).style.display = 'none' }} /> : null} + {(r.matchedNickname || r.matchedUserId || '?').charAt(0)} +
+
+
{r.matchedNickname || r.matchedUserId}
+
{r.matchedUserId.slice(0, 16)}...
+
+
+
+ {matchTypeLabels[r.matchType] || r.matchType} + + {r.phone &&
📱 {r.phone}
} + {r.wechatId &&
💬 {r.wechatId}
} + {!r.phone && !r.wechatId && '-'} +
+ {r.createdAt ? new Date(r.createdAt).toLocaleString() : '-'} +
+ ))} + {records.length === 0 && 暂无匹配记录} +
+
+ { setPageSize(n); setPage(1) }} /> + + )} +
+
+
+ ) +} diff --git a/soul-admin/src/pages/find-partner/tabs/MentorBookingTab.tsx b/soul-admin/src/pages/find-partner/tabs/MentorBookingTab.tsx new file mode 100644 index 00000000..803554c4 --- /dev/null +++ b/soul-admin/src/pages/find-partner/tabs/MentorBookingTab.tsx @@ -0,0 +1,86 @@ +import { useState, useEffect } from 'react' +import { Card, CardContent } from '@/components/ui/card' +import { Table, TableBody, TableCell, TableHead, TableHeader, TableRow } from '@/components/ui/table' +import { Button } from '@/components/ui/button' +import { RefreshCw } from 'lucide-react' +import { get } from '@/api/client' + +interface Consultation { + id: number; userId: number; mentorId: number; consultationType: string + amount: number; status: string; createdAt: string +} + +const statusMap: Record = { created: '已创建', pending_pay: '待支付', paid: '已支付', completed: '已完成', cancelled: '已取消' } +const typeMap: Record = { single: '单次', half_year: '半年', year: '年度' } + +export function MentorBookingTab() { + const [list, setList] = useState([]) + const [loading, setLoading] = useState(true) + const [statusFilter, setStatusFilter] = useState('') + + async function load() { + setLoading(true) + try { + const url = statusFilter ? `/api/db/mentor-consultations?status=${statusFilter}` : '/api/db/mentor-consultations' + const data = await get<{ success?: boolean; data?: Consultation[] }>(url) + if (data?.success && data.data) setList(data.data) + } catch (e) { console.error(e) } + finally { setLoading(false) } + } + + useEffect(() => { load() }, [statusFilter]) + + return ( +
+
+

导师咨询预约记录

+
+ + +
+
+ + + + {loading ? ( +
加载中...
+ ) : ( + + + + ID + 用户ID + 导师ID + 类型 + 金额 + 状态 + 创建时间 + + + + {list.map(r => ( + + {r.id} + {r.userId} + {r.mentorId} + {typeMap[r.consultationType] || r.consultationType} + ¥{r.amount} + {statusMap[r.status] || r.status} + {r.createdAt ? new Date(r.createdAt).toLocaleString() : '-'} + + ))} + {list.length === 0 && 暂无预约记录} + +
+ )} +
+
+
+ ) +} diff --git a/soul-admin/src/pages/find-partner/tabs/ResourceDockingTab.tsx b/soul-admin/src/pages/find-partner/tabs/ResourceDockingTab.tsx new file mode 100644 index 00000000..8d557d7f --- /dev/null +++ b/soul-admin/src/pages/find-partner/tabs/ResourceDockingTab.tsx @@ -0,0 +1,86 @@ +import { useState, useEffect } from 'react' +import { Card, CardContent } from '@/components/ui/card' +import { Table, TableBody, TableCell, TableHead, TableHeader, TableRow } from '@/components/ui/table' +import { RefreshCw } from 'lucide-react' +import { Pagination } from '@/components/ui/Pagination' +import { get } from '@/api/client' + +interface MatchRecord { + id: string; userId: string; matchedUserId: string; matchType: string + phone?: string; wechatId?: string; userNickname?: string; matchedNickname?: string + createdAt: string +} + +export function ResourceDockingTab() { + const [records, setRecords] = useState([]) + const [total, setTotal] = useState(0) + const [page, setPage] = useState(1) + const [pageSize, setPageSize] = useState(10) + const [isLoading, setIsLoading] = useState(true) + + async function load() { + setIsLoading(true) + try { + const params = new URLSearchParams({ page: String(page), pageSize: String(pageSize), matchType: 'investor' }) + const data = await get<{ success?: boolean; records?: MatchRecord[]; total?: number }>(`/api/db/match-records?${params}`) + if (data?.success) { setRecords(data.records || []); setTotal(data.total ?? 0) } + } catch (e) { console.error(e) } + finally { setIsLoading(false) } + } + + useEffect(() => { load() }, [page]) + + const totalPages = Math.ceil(total / pageSize) || 1 + + return ( +
+
+
+

资源对接匹配记录,共 {total} 条

+

用户填写「我能帮到你什么」和「我需要什么帮助」后提交到存客宝

+
+ +
+ + + + {isLoading ? ( +
加载中...
+ ) : ( + <> + + + + 发起人 + 匹配到 + 联系方式 + 时间 + + + + {records.map(r => ( + + {r.userNickname || r.userId} + {r.matchedNickname || r.matchedUserId} + + {r.phone &&
📱 {r.phone}
} + {r.wechatId &&
💬 {r.wechatId}
} + {!r.phone && !r.wechatId && '-'} +
+ {r.createdAt ? new Date(r.createdAt).toLocaleString() : '-'} +
+ ))} + {records.length === 0 && 暂无资源对接记录} +
+
+ { setPageSize(n); setPage(1) }} /> + + )} +
+
+
+ ) +} diff --git a/soul-admin/src/pages/find-partner/tabs/TeamRecruitTab.tsx b/soul-admin/src/pages/find-partner/tabs/TeamRecruitTab.tsx new file mode 100644 index 00000000..2d0d83c5 --- /dev/null +++ b/soul-admin/src/pages/find-partner/tabs/TeamRecruitTab.tsx @@ -0,0 +1,86 @@ +import { useState, useEffect } from 'react' +import { Card, CardContent } from '@/components/ui/card' +import { Table, TableBody, TableCell, TableHead, TableHeader, TableRow } from '@/components/ui/table' +import { RefreshCw } from 'lucide-react' +import { Pagination } from '@/components/ui/Pagination' +import { get } from '@/api/client' + +interface MatchRecord { + id: string; userId: string; matchedUserId: string; matchType: string + phone?: string; wechatId?: string; userNickname?: string; matchedNickname?: string + createdAt: string +} + +export function TeamRecruitTab() { + const [records, setRecords] = useState([]) + const [total, setTotal] = useState(0) + const [page, setPage] = useState(1) + const [pageSize, setPageSize] = useState(10) + const [isLoading, setIsLoading] = useState(true) + + async function load() { + setIsLoading(true) + try { + const params = new URLSearchParams({ page: String(page), pageSize: String(pageSize), matchType: 'team' }) + const data = await get<{ success?: boolean; records?: MatchRecord[]; total?: number }>(`/api/db/match-records?${params}`) + if (data?.success) { setRecords(data.records || []); setTotal(data.total ?? 0) } + } catch (e) { console.error(e) } + finally { setIsLoading(false) } + } + + useEffect(() => { load() }, [page]) + + const totalPages = Math.ceil(total / pageSize) || 1 + + return ( +
+
+
+

团队招募匹配记录,共 {total} 条

+

用户通过「团队招募」提交联系方式到存客宝

+
+ +
+ + + + {isLoading ? ( +
加载中...
+ ) : ( + <> + + + + 发起人 + 匹配到 + 联系方式 + 时间 + + + + {records.map(r => ( + + {r.userNickname || r.userId} + {r.matchedNickname || r.matchedUserId} + + {r.phone &&
📱 {r.phone}
} + {r.wechatId &&
💬 {r.wechatId}
} + {!r.phone && !r.wechatId && '-'} +
+ {r.createdAt ? new Date(r.createdAt).toLocaleString() : '-'} +
+ ))} + {records.length === 0 && 暂无团队招募记录} +
+
+ { setPageSize(n); setPage(1) }} /> + + )} +
+
+
+ ) +} diff --git a/soul-admin/src/pages/settings/SettingsPage.tsx b/soul-admin/src/pages/settings/SettingsPage.tsx index cf9db529..2fa41320 100644 --- a/soul-admin/src/pages/settings/SettingsPage.tsx +++ b/soul-admin/src/pages/settings/SettingsPage.tsx @@ -1,4 +1,6 @@ import { useState, useEffect } from 'react' +import { useSearchParams } from 'react-router-dom' +import { Tabs, TabsContent, TabsList, TabsTrigger } from '@/components/ui/tabs' import { Card, CardContent, @@ -30,8 +32,11 @@ import { BookOpen, Gift, Smartphone, + ShieldCheck, } from 'lucide-react' import { get, post } from '@/api/client' +import { AuthorSettingsPage } from '@/pages/author-settings/AuthorSettingsPage' +import { AdminUsersPage } from '@/pages/admin-users/AdminUsersPage' interface AuthorInfo { name?: string @@ -93,7 +98,14 @@ const defaultFeatures: FeatureConfig = { aboutEnabled: true, } +const TAB_KEYS = ['system', 'author', 'admin'] as const +type TabKey = (typeof TAB_KEYS)[number] + export function SettingsPage() { + const [searchParams, setSearchParams] = useSearchParams() + const tabParam = searchParams.get('tab') ?? 'system' + const activeTab = TAB_KEYS.includes(tabParam as TabKey) ? (tabParam as TabKey) : 'system' + const [localSettings, setLocalSettings] = useState(defaultSettings) const [featureConfig, setFeatureConfig] = useState(defaultFeatures) const [mpConfig, setMpConfig] = useState(defaultMpConfig) @@ -208,26 +220,58 @@ export function SettingsPage() { } } + const handleTabChange = (v: string) => { + setSearchParams(v === 'system' ? {} : { tab: v }) + } + if (loading) return
加载中...
return (
-
+

系统设置

配置全站基础参数与开关

- + {activeTab === 'system' && ( + + )}
-
+ + + + + 系统设置 + + + + 作者详情 + + + + 管理员 + + + + +
@@ -561,7 +605,17 @@ export function SettingsPage() {
-
+
+ + + + + + + + + + 0 { @@ -61,18 +65,93 @@ func DBBookAction(c *gin.Context) { for _, x := range readCounts { readMap[x.SectionID] = int(x.Cnt) } - // 付款笔数:orders 中 product_type=section 且 status=paid 按 product_id 计数 + // 付款笔数:与 orders 表直接捆绑,兼容 paid/completed/success 等已支付状态 type payCnt struct{ ProductID string `gorm:"column:product_id"`; Cnt int64 `gorm:"column:cnt"` } var payCounts []payCnt if len(ids) > 0 { db.Table("orders").Select("product_id, COUNT(*) as cnt"). - Where("product_type = ? AND status = ? AND product_id IN ?", "section", "paid", ids). + Where("product_type = ? AND status IN ? AND product_id IN ?", "section", []string{"paid", "completed", "success"}, ids). Group("product_id").Scan(&payCounts) } payMap := make(map[string]int) for _, x := range payCounts { payMap[x.ProductID] = int(x.Cnt) } + // 文章排名算法:权重可从 config article_ranking_weights 读取,默认 阅读50% 新度30% 付款20% + readWeight, recencyWeight, payWeight := 0.5, 0.3, 0.2 + var cfgRow model.SystemConfig + if err := db.Where("config_key = ?", "article_ranking_weights").First(&cfgRow).Error; err == nil && len(cfgRow.ConfigValue) > 0 { + var m map[string]interface{} + if json.Unmarshal(cfgRow.ConfigValue, &m) == nil { + if v, ok := m["readWeight"]; ok { + if f, ok := v.(float64); ok && f >= 0 && f <= 1 { + readWeight = f + } + } + if v, ok := m["recencyWeight"]; ok { + if f, ok := v.(float64); ok && f >= 0 && f <= 1 { + recencyWeight = f + } + } + if v, ok := m["payWeight"]; ok { + if f, ok := v.(float64); ok && f >= 0 && f <= 1 { + payWeight = f + } + } + } + } + // 热度 = readWeight*阅读排名分 + recencyWeight*新度排名分 + payWeight*付款排名分 + readScore := make(map[string]float64) + idsByRead := make([]string, len(ids)) + copy(idsByRead, ids) + sort.Slice(idsByRead, func(i, j int) bool { return readMap[idsByRead[i]] > readMap[idsByRead[j]] }) + for i := 0; i < 20 && i < len(idsByRead); i++ { + readScore[idsByRead[i]] = float64(20 - i) + } + recencyScore := make(map[string]float64) + sort.Slice(rows, func(i, j int) bool { return rows[i].UpdatedAt.After(rows[j].UpdatedAt) }) + for i := 0; i < 30 && i < len(rows); i++ { + recencyScore[rows[i].ID] = float64(30 - i) + } + payScore := make(map[string]float64) + idsByPay := make([]string, len(ids)) + copy(idsByPay, ids) + sort.Slice(idsByPay, func(i, j int) bool { return payMap[idsByPay[i]] > payMap[idsByPay[j]] }) + for i := 0; i < 20 && i < len(idsByPay); i++ { + payScore[idsByPay[i]] = float64(20 - i) + } + type idTotal struct { + id string + total float64 + } + totals := make([]idTotal, 0, len(rows)) + for _, r := range rows { + t := readWeight*readScore[r.ID] + recencyWeight*recencyScore[r.ID] + payWeight*payScore[r.ID] + totals = append(totals, idTotal{r.ID, t}) + } + sort.Slice(totals, func(i, j int) bool { return totals[i].total > totals[j].total }) + hotRankMap := make(map[string]int) + for i, t := range totals { + hotRankMap[t.id] = i + 1 + } + hotScoreMap := make(map[string]float64) + for _, t := range totals { + hotScoreMap[t.id] = t.total + } + // 恢复 rows 的 sort_order 顺序(上面 recency 排序打乱了) + sort.Slice(rows, func(i, j int) bool { + soi, soj := 0, 0 + if rows[i].SortOrder != nil { + soi = *rows[i].SortOrder + } + if rows[j].SortOrder != nil { + soj = *rows[j].SortOrder + } + if soi != soj { + return soi < soj + } + return rows[i].ID < rows[j].ID + }) sections := make([]sectionListItem, 0, len(rows)) for _, r := range rows { price := 1.0 @@ -91,6 +170,8 @@ func DBBookAction(c *gin.Context) { ChapterTitle: r.ChapterTitle, ClickCount: readMap[r.ID], PayCount: payMap[r.ID], + HotScore: hotScoreMap[r.ID], + HotRank: hotRankMap[r.ID], }) } c.JSON(http.StatusOK, gin.H{"success": true, "sections": sections, "total": len(sections)}) @@ -135,7 +216,8 @@ func DBBookAction(c *gin.Context) { return } var orders []model.Order - if err := db.Where("product_type = ? AND product_id = ?", "section", id).Order("created_at DESC").Limit(200).Find(&orders).Error; err != nil { + if err := db.Where("product_type = ? AND product_id = ? AND status IN ?", "section", id, []string{"paid", "completed", "success"}). + Order("pay_time DESC, created_at DESC").Limit(200).Find(&orders).Error; err != nil { c.JSON(http.StatusOK, gin.H{"success": false, "error": err.Error(), "orders": []model.Order{}}) return } @@ -297,7 +379,15 @@ func DBBookAction(c *gin.Context) { return } } - if body.Action == "move-sections" && len(body.SectionIds) > 0 && body.TargetPartID != "" && body.TargetChapterID != "" { + if body.Action == "move-sections" { + if len(body.SectionIds) == 0 { + c.JSON(http.StatusOK, gin.H{"success": false, "error": "批量移动缺少 sectionIds(请先勾选要移动的节)"}) + return + } + if body.TargetPartID == "" || body.TargetChapterID == "" { + c.JSON(http.StatusOK, gin.H{"success": false, "error": "批量移动缺少目标篇或目标章(targetPartId、targetChapterId)"}) + return + } up := map[string]interface{}{ "part_id": body.TargetPartID, "chapter_id": body.TargetChapterID, diff --git a/soul-api/internal/handler/match.go b/soul-api/internal/handler/match.go index e933ef99..9b788671 100644 --- a/soul-api/internal/handler/match.go +++ b/soul-api/internal/handler/match.go @@ -18,11 +18,11 @@ const defaultFreeMatchLimit = 3 // MatchQuota 匹配次数配额(纯计算:订单 + match_records) type MatchQuota struct { PurchasedTotal int64 `json:"purchasedTotal"` - PurchasedUsed int64 `json:"purchasedUsed"` + PurchasedUsed int64 `json:"purchasedUsed"` MatchesUsedToday int64 `json:"matchesUsedToday"` - FreeRemainToday int64 `json:"freeRemainToday"` - PurchasedRemain int64 `json:"purchasedRemain"` - RemainToday int64 `json:"remainToday"` // 今日剩余可匹配次数 + FreeRemainToday int64 `json:"freeRemainToday"` + PurchasedRemain int64 `json:"purchasedRemain"` + RemainToday int64 `json:"remainToday"` // 今日剩余可匹配次数 } func getFreeMatchLimit(db *gorm.DB) int { @@ -73,7 +73,7 @@ func GetMatchQuota(db *gorm.DB, userID string, freeLimit int) MatchQuota { } remainToday := freeRemain + purchasedRemain return MatchQuota{ - PurchasedTotal: purchasedTotal, + PurchasedTotal: purchasedTotal, PurchasedUsed: purchasedUsed, MatchesUsedToday: matchesToday, FreeRemainToday: freeRemain, @@ -83,7 +83,7 @@ func GetMatchQuota(db *gorm.DB, userID string, freeLimit int) MatchQuota { } var defaultMatchTypes = []gin.H{ - gin.H{"id": "partner", "label": "创业合伙", "matchLabel": "创业伙伴", "icon": "⭐", "matchFromDB": true, "showJoinAfterMatch": false, "price": 1, "enabled": true}, + gin.H{"id": "partner", "label": "超级个体", "matchLabel": "超级个体", "icon": "⭐", "matchFromDB": true, "showJoinAfterMatch": false, "price": 1, "enabled": true}, gin.H{"id": "investor", "label": "资源对接", "matchLabel": "资源对接", "icon": "👥", "matchFromDB": false, "showJoinAfterMatch": true, "price": 1, "enabled": true}, gin.H{"id": "mentor", "label": "导师顾问", "matchLabel": "导师顾问", "icon": "❤️", "matchFromDB": false, "showJoinAfterMatch": true, "price": 1, "enabled": true}, gin.H{"id": "team", "label": "团队招募", "matchLabel": "加入项目", "icon": "🎮", "matchFromDB": false, "showJoinAfterMatch": true, "price": 1, "enabled": true}, @@ -100,7 +100,7 @@ func MatchConfigGet(c *gin.Context) { "matchTypes": defaultMatchTypes, "freeMatchLimit": 3, "matchPrice": 1, - "settings": gin.H{"enableFreeMatches": true, "enablePaidMatches": true, "maxMatchesPerDay": 10}, + "settings": gin.H{"enableFreeMatches": true, "enablePaidMatches": true, "maxMatchesPerDay": 10}, }, "source": "default", }) @@ -181,10 +181,14 @@ func MatchUsers(c *gin.Context) { return } } - // 只匹配已绑定微信或手机号的用户 + // 找伙伴(partner):仅从超级个体池匹配(is_vip=1 且 vip_expire_date>NOW);其他类型:已绑定微信或手机号的用户 var users []model.User q := db.Where("id != ?", body.UserID). Where("((wechat_id IS NOT NULL AND wechat_id != '') OR (phone IS NOT NULL AND phone != ''))") + if body.MatchType == "partner" { + // 超级个体:VIP 会员池 + q = q.Where("is_vip = 1 AND vip_expire_date > NOW()") + } if err := q.Order("created_at DESC").Limit(20).Find(&users).Error; err != nil || len(users) == 0 { c.JSON(http.StatusOK, gin.H{"success": false, "message": "暂无匹配用户", "data": nil, "code": "NO_USERS"}) return @@ -212,7 +216,7 @@ func MatchUsers(c *gin.Context) { phone = *r.Phone } intro := "来自Soul创业派对的伙伴" - matchLabels := map[string]string{"partner": "找伙伴", "investor": "资源对接", "mentor": "导师顾问", "team": "团队招募"} + matchLabels := map[string]string{"partner": "超级个体", "investor": "资源对接", "mentor": "导师顾问", "team": "团队招募"} tag := matchLabels[body.MatchType] if tag == "" { tag = "找伙伴" diff --git a/soul-api/internal/handler/match_records.go b/soul-api/internal/handler/match_records.go index e236e5cd..e36d1c3a 100644 --- a/soul-api/internal/handler/match_records.go +++ b/soul-api/internal/handler/match_records.go @@ -11,8 +11,35 @@ import ( ) // DBMatchRecordsList GET /api/db/match-records 管理端-匹配记录列表(分页、按类型筛选) +// 当 ?stats=true 时返回汇总统计(总匹配数、今日匹配、按类型分布、独立用户数) func DBMatchRecordsList(c *gin.Context) { db := database.DB() + + if c.Query("stats") == "true" { + var totalMatches int64 + db.Model(&model.MatchRecord{}).Count(&totalMatches) + var todayMatches int64 + db.Model(&model.MatchRecord{}).Where("created_at >= CURDATE()").Count(&todayMatches) + type TypeCount struct { + MatchType string `json:"matchType"` + Count int64 `json:"count"` + } + var byType []TypeCount + db.Model(&model.MatchRecord{}).Select("match_type as match_type, count(*) as count").Group("match_type").Scan(&byType) + var uniqueUsers int64 + db.Model(&model.MatchRecord{}).Distinct("user_id").Count(&uniqueUsers) + c.JSON(http.StatusOK, gin.H{ + "success": true, + "data": gin.H{ + "totalMatches": totalMatches, + "todayMatches": todayMatches, + "byType": byType, + "uniqueUsers": uniqueUsers, + }, + }) + return + } + page, _ := strconv.Atoi(c.DefaultQuery("page", "1")) pageSize, _ := strconv.Atoi(c.DefaultQuery("pageSize", "10")) matchType := c.Query("matchType") diff --git a/soul-api/internal/handler/user.go b/soul-api/internal/handler/user.go index 8410f4d9..2c978e5d 100644 --- a/soul-api/internal/handler/user.go +++ b/soul-api/internal/handler/user.go @@ -476,6 +476,87 @@ func UserReadingProgressPost(c *gin.Context) { c.JSON(http.StatusOK, gin.H{"success": true, "message": "进度已保存"}) } +// UserDashboardStatsGet GET /api/user/dashboard-stats?userId= +// 返回我的页所需的真实统计:已读章节、阅读分钟、最近阅读、匹配次数 +func UserDashboardStatsGet(c *gin.Context) { + userId := c.Query("userId") + if userId == "" { + c.JSON(http.StatusBadRequest, gin.H{"success": false, "error": "缺少 userId 参数"}) + return + } + + db := database.DB() + + var progressList []model.ReadingProgress + if err := db.Where("user_id = ?", userId).Order("last_open_at DESC").Find(&progressList).Error; err != nil { + c.JSON(http.StatusInternalServerError, gin.H{"success": false, "error": "读取阅读统计失败"}) + return + } + + readCount := len(progressList) + totalReadSeconds := 0 + recentIDs := make([]string, 0, 5) + seenRecent := make(map[string]bool) + readSectionIDs := make([]string, 0, len(progressList)) + for _, item := range progressList { + totalReadSeconds += item.Duration + if item.SectionID != "" { + readSectionIDs = append(readSectionIDs, item.SectionID) + if !seenRecent[item.SectionID] && len(recentIDs) < 5 { + seenRecent[item.SectionID] = true + recentIDs = append(recentIDs, item.SectionID) + } + } + } + + totalReadMinutes := totalReadSeconds / 60 + if totalReadSeconds > 0 && totalReadMinutes == 0 { + totalReadMinutes = 1 + } + + chapterMap := make(map[string]model.Chapter) + if len(recentIDs) > 0 { + var chapters []model.Chapter + if err := db.Select("id", "mid", "section_title").Where("id IN ?", recentIDs).Find(&chapters).Error; err == nil { + for _, ch := range chapters { + chapterMap[ch.ID] = ch + } + } + } + + recentChapters := make([]gin.H, 0, len(recentIDs)) + for _, id := range recentIDs { + ch, ok := chapterMap[id] + title := id + mid := 0 + if ok { + if ch.SectionTitle != "" { + title = ch.SectionTitle + } + mid = ch.MID + } + recentChapters = append(recentChapters, gin.H{ + "id": id, + "mid": mid, + "title": title, + }) + } + + var matchHistory int64 + db.Model(&model.MatchRecord{}).Where("user_id = ?", userId).Count(&matchHistory) + + c.JSON(http.StatusOK, gin.H{ + "success": true, + "data": gin.H{ + "readCount": readCount, + "totalReadMinutes": totalReadMinutes, + "recentChapters": recentChapters, + "matchHistory": matchHistory, + "readSectionIds": readSectionIDs, + }, + }) +} + // UserTrackGet GET /api/user/track?userId=&limit= 从 user_tracks 表查(GORM) func UserTrackGet(c *gin.Context) { userId := c.Query("userId") diff --git a/soul-api/internal/router/router.go b/soul-api/internal/router/router.go index 812b89bb..8051b401 100644 --- a/soul-api/internal/router/router.go +++ b/soul-api/internal/router/router.go @@ -264,6 +264,7 @@ func Setup(cfg *config.Config) *gin.Engine { miniprogram.GET("/user/profile", handler.UserProfileGet) miniprogram.POST("/user/profile", handler.UserProfilePost) miniprogram.GET("/user/purchase-status", handler.UserPurchaseStatus) + miniprogram.GET("/user/dashboard-stats", handler.UserDashboardStatsGet) miniprogram.GET("/user/reading-progress", handler.UserReadingProgressGet) miniprogram.POST("/user/reading-progress", handler.UserReadingProgressPost) miniprogram.POST("/user/update", handler.UserUpdate) diff --git a/开发文档/1、需求/修改/20260308找伙伴功能.pages b/开发文档/1、需求/修改/20260308找伙伴功能.pages new file mode 100644 index 00000000..28cb3270 Binary files /dev/null and b/开发文档/1、需求/修改/20260308找伙伴功能.pages differ diff --git a/开发文档/1、需求/修改/20260308找伙伴功能.pdf b/开发文档/1、需求/修改/20260308找伙伴功能.pdf new file mode 100644 index 00000000..30c1bd22 Binary files /dev/null and b/开发文档/1、需求/修改/20260308找伙伴功能.pdf differ diff --git a/开发文档/1、需求/修改/20260308找伙伴功能2.md b/开发文档/1、需求/修改/20260308找伙伴功能2.md new file mode 100644 index 00000000..0c619d29 --- /dev/null +++ b/开发文档/1、需求/修改/20260308找伙伴功能2.md @@ -0,0 +1,39 @@ +# 需求文档标题 + +> 创建日期:YYYY-MM-DD +> 文档格式:Markdown(支持图片粘贴 + 预览) + +--- + +## 一、背景与目标 + +(在此输入文字,可直接粘贴图片) + + + +--- + +## 二、功能点 + +### 2.1 功能一 + +(文字 + 可粘贴的截图、原型图) + +示例图片引用:`![描述](./images/截图1.png)` + +### 2.2 功能二 + + + +--- + +## 三、补充说明 + +(可继续粘贴图片和文字) + +--- + +## 使用提示 + +- **粘贴图片**:在 Cursor 中安装「Paste Image」扩展后,直接 Ctrl+V / Cmd+V 即可将剪贴板图片保存到 `images/` 并自动插入引用 +- **预览**:`Cmd+Shift+V` 或右侧「Open Preview」查看排版效果 diff --git a/开发文档/1、需求/修改/README_需求文档格式说明.md b/开发文档/1、需求/修改/README_需求文档格式说明.md new file mode 100644 index 00000000..f403efe0 --- /dev/null +++ b/开发文档/1、需求/修改/README_需求文档格式说明.md @@ -0,0 +1,75 @@ +# 需求文档格式说明 + +> 本目录支持 **Markdown(.md)** 格式,可在 Cursor 中直接粘贴图片并预览。 + +--- + +## 为什么用 Markdown + +| 能力 | 说明 | +|:-----------|:-------------------------------------------------| +| 粘贴图片 | 配合扩展可 Ctrl+V / Cmd+V 直接粘贴剪贴板图片 | +| 预览 | Cursor 内置 Markdown 预览,`Cmd+Shift+V` 即可 | +| 版本管理 | 纯文本 + 图片文件,方便 Git 追踪 | +| 跨平台 | 任意编辑器可编辑,导出 PDF/HTML 也方便 | + +--- + +## 使用方法 + +### 1. 新建文档 + +- 复制 `_模板_需求文档.md`,重命名为你的文档名(如 `20260308找伙伴功能.md`) +- 或直接新建 `.md` 文件 + +### 2. 粘贴图片 + +**方式一:配合扩展(推荐)** + +1. 在 Cursor 中安装扩展:`Paste Image` 或 `Markdown Paste` +2. 截屏或复制图片到剪贴板 +3. 在 `.md` 文件中按 `Ctrl+V`(Mac:`Cmd+V`) +4. 扩展会自动将图片保存到 `images/` 并插入 `![描述](images/xxx.png)` + +**方式二:手动** + +1. 将图片放入本目录下的 `images/` 文件夹 +2. 在文档中插入:`![图片描述](./images/文件名.png)` + +### 3. 预览 + +- **快捷键**:`Cmd+Shift+V`(Mac)或 `Ctrl+Shift+V`(Windows) +- **右键**:编辑器内右键 → 「Open Preview」 +- 卡若AI 规则已配置 Markdown Preview Enhanced,可直接查看排版 + +--- + +## 目录约定 + +``` +修改/ +├── README_需求文档格式说明.md ← 本说明 +├── _模板_需求文档.md ← 可复制的模板 +├── images/ ← 粘贴的图片存放于此 +│ └── .gitkeep +├── 20260308找伙伴功能.md ← 你的需求文档 +└── *.pdf / *.pages ← 仍可保留原格式作归档 +``` + +--- + +## 扩展安装(如需粘贴图片) + +在 Cursor 扩展市场搜索并安装其一: + +- **Paste Image**:`naumovs.paste-image` +- **Markdown Paste**:支持粘贴图片并生成 Markdown 引用 + +**Paste Image 路径配置**(可选):在 `settings.json` 中添加,使图片保存到当前目录的 `images/` 下: + +```json +{ + "pasteImage.path": "${currentFileDir}/images", + "pasteImage.basePath": "${currentFileDir}" +} +``` diff --git a/开发文档/1、需求/修改/_模板_需求文档.md b/开发文档/1、需求/修改/_模板_需求文档.md new file mode 100644 index 00000000..0c619d29 --- /dev/null +++ b/开发文档/1、需求/修改/_模板_需求文档.md @@ -0,0 +1,39 @@ +# 需求文档标题 + +> 创建日期:YYYY-MM-DD +> 文档格式:Markdown(支持图片粘贴 + 预览) + +--- + +## 一、背景与目标 + +(在此输入文字,可直接粘贴图片) + + + +--- + +## 二、功能点 + +### 2.1 功能一 + +(文字 + 可粘贴的截图、原型图) + +示例图片引用:`![描述](./images/截图1.png)` + +### 2.2 功能二 + + + +--- + +## 三、补充说明 + +(可继续粘贴图片和文字) + +--- + +## 使用提示 + +- **粘贴图片**:在 Cursor 中安装「Paste Image」扩展后,直接 Ctrl+V / Cmd+V 即可将剪贴板图片保存到 `images/` 并自动插入引用 +- **预览**:`Cmd+Shift+V` 或右侧「Open Preview」查看排版效果 diff --git a/开发文档/1、需求/修改/1.doc b/开发文档/1、需求/修改/images/.gitkeep similarity index 100% rename from 开发文档/1、需求/修改/1.doc rename to 开发文档/1、需求/修改/images/.gitkeep