3 Commits
Author SHA1 Message Date
jinghui 08c417c7d0 feat: 躺赚鱼 v3.6.8 —— 转卖图片增删改替 + AI 优化标题描述
- 转卖弹窗图片可编辑:删除/替换/设首图/本地上传/URL粘贴,上限9张,发布提交自定义列表(后端清洗+源图回退)
- 新增 POST /resell/upload-image(存 resell_uploads)与免鉴权 GET /resell/uploaded/{name} 直链
- 新增 POST /resell/ai-optimize:按原标题/描述改写,返回4个候选标题(点击填入)+ 分段优化描述,复用AI回复KEY体系
- 端到端实测:图片五种操作全过、AI 36s 出4候选且描述30→246字;测试数据已还原
2026-11-16 10:37:29 +08:00
jinghui 4636810047 feat: 躺赚鱼 v3.6.7 —— AI 优化建议按商品数显示预计耗时
- 新增 POST /ai-optimize/preview 轻量预检(KEY→同步状态校验与正式分析一致),返回商品数与预计秒区间
- 点击即弹「共 N 个商品,预计约 X~Y 秒」;分析中按钮两行进度(已耗时每秒刷新 + 预计区间)
- 同步后分析补一次预检;预检失败降级不阻断
- 估算基于实测 12 件 28~55s 线性外推,宁宽勿窄,120s 封顶

端到端实测:14 件商品 toast 29~74s、按钮倒计时、结果报告正常;测试数据已还原。
2026-11-16 10:14:40 +08:00
jinghui da4a6f8e91 feat: 躺赚鱼 v3.6.6 —— 关于页信息更新
- 官网改为导航站 https://nav.88531.cn
- 移除 QQ 交流群卡片(群号 1037854503 整块删除),支持区四列改三列
- 联系邮箱改为 3970260761@qq.com

build 通过;线上 chunk 实测新值已生效、旧值与 QQ 相关内容 0 残留。
2026-11-16 10:01:48 +08:00
63 changed files with 755 additions and 146 deletions

No files matched your search

+62
View File
@@ -4,6 +4,68 @@
---
## 2026-11-16 · v3.6.8
### ✨ 新功能
- **一键转卖图片:可修改 / 删除 / 添加**(原为只读固定 3 张)
- 悬停图片:**删除**(至少保留 1 张)、**替换**(本地文件覆盖该张)、**设首图**(第一张即封面)
- 两种**添加**方式:本地上传(jpg/png/webp/gif ≤8MB,存服务端 resell_uploads 目录并生成直链)、
粘贴图片地址(自动读取真实宽高,防盗链/失效地址会拦截提示);上限 9 张
- 发布时提交弹窗里改好的图片列表(后端校验清洗,非法条目丢弃、全空自动回退源商品图片,向后兼容)
- **AI 一键优化标题+描述**(弹窗「标题」行右侧紫色按钮)
- 按钮 → AI 生成中 → 返回 **4 个不同风格的候选标题**(点击任意一个即填入标题输入框,选中态高亮)
- **描述同步改写**为结构清晰的分段文案(保留原描述全部关键信息)
- 复用 AI 回复的模型 KEY 体系;无 KEY 时提示先去 AI 设置配置
### ✅ 验证(端到端实测,14 商品真实账号)
- 图片:删除 3→2、本地上传 2→3(服务端文件落盘)、URL 添加 3→4、设首图(首图切换)、替换(idx1 换图)全通过
- AI 优化:36 秒返回 4 个候选标题 → 点击候选2 → 标题精确填入;描述由 30 字改写为 246 字分段文案
- 后端:`/resell/upload-image`、`/resell/ai-optimize` 路由注册(无 token 401);静态图 `/resell/uploaded/*` 免鉴权直链;
payload 单测:自定义图片覆盖、相对路径丢弃、尺寸兜底、空列表回退源图
- 测试账号与属主临时变更已还原(用户表仅剩原有 admin/jinghui)
---
## 2026-11-16 · v3.6.7
### ✨ 新功能
- **AI 优化建议:点击即显示预计耗时**(按商品数量估算)
- 新增轻量预检接口 `POST /ai-optimize/preview`(校验口径与正式分析一致:模型 KEY → 商品同步状态),
返回商品总数、送模型件数与预计秒区间
- 点击按钮立即弹出提示:**「共 N 个商品,预计约 X~Y 秒」**(商品超送模型上限时注明"分析前 M 个")
- 分析期间按钮变两行进度:**「分析中 Xs」+「N 件 · 预计约 X~Ys」**(每秒刷新已耗时),悬停 tooltip 同步显示
- 同步商品后再分析的场景也会在同步完成后补一次预检展示预计时间
- 估算基准:实测 12 件约 28~55 秒,按商品数线性外推、宁宽勿窄,120s 在模型单次超时线内封顶;
预检失败自动降级(不显示预计,分析照常)
### ✅ 验证
- 端到端实测(14 个商品的真实账号):点击 → toast「共 14 个商品,预计约 29~74 秒」
→ 按钮「分析中 2s / 14 件 · 预计约 29~74s」→ 分析完成弹出结果报告(14 件、模型 big-pickle、逐件评分)
- 路由无 token 返回 401(已注册);`npm run build` 通过
- 测试账号与临时属主变更已还原(用户表仅剩原有 admin/jinghui,账号属主回 admin)
---
## 2026-11-16 · v3.6.6
### ✏️ 调整
- **关于页**(侧边栏 → 系统 → 关于)三项信息更新:
- 官网改为导航站 `https://nav.88531.cn`(原 www.88531.cn)
- 移除「QQ 交流群」卡片(点击加入 / 群号 1037854503 / 手动搜索提示整块删除,支持区四列改三列)
- 联系邮箱改为 `3970260761@qq.com`(原 admin@88531.cn)
### ✅ 验证
- `npm run build` 通过;线上 chunk 实测:`nav.88531.cn`、`3970260761@qq.com` 已在,
`1037854503`、`QQ 交流群`、`mqqapi`、`admin@88531.cn` 全部 0 残留
---
## 2026-11-16 · v3.6.5
### ✨ 新功能
+40
View File
@@ -105,6 +105,46 @@ def create_ai_optimize_router(
raise HTTPException(status_code=403, detail="无权限操作该账号")
return details
@router.post("/ai-optimize/preview")
def ai_optimize_preview(
req: AiOptimizeRequest,
current_user: dict[str, Any] = Depends(get_current_user),
):
"""轻量预检:返回该账号商品数与预计分析耗时,供前端点击后立刻展示给用户。
校验顺序与 suggest 一致(模型 KEY → 商品同步状态),保证提示口径统一。
"""
require_account(req.cookie_id, current_user)
settings = db_manager.get_ai_reply_settings(req.cookie_id)
if not (settings.get("api_key") or "").strip():
return {
"status": "need_api_key",
"message": "尚未配置模型 KEY,请先在 AI 设置中填写模型 KEY 再执行优化建议。",
}
rows = db_manager.get_items_by_cookie(req.cookie_id) or []
if not rows:
return {
"status": "need_sync",
"message": "该账号还没有同步商品,需要先同步商品才能执行优化分析。",
}
total = len(rows)
analyzed = min(total, MAX_ITEMS)
# 实测基准:12 件约 28~55 秒(一次批量模型调用,单次 130s 超时)。
# 输入商品越多 prompt 越长,线性外推;区间宁宽勿窄,120s 在超时线内封顶。
est_min = int(min(8 + 1.5 * analyzed, 60))
est_max = int(min(25 + 3.5 * analyzed, 120))
return {
"status": "ok",
"total": total,
"analyzed_count": analyzed,
"truncated": total > MAX_ITEMS,
"est_min_seconds": est_min,
"est_max_seconds": est_max,
}
@router.post("/ai-optimize/suggest")
def ai_optimize_suggest(
req: AiOptimizeRequest,
+155 -1
View File
@@ -6,11 +6,16 @@
from __future__ import annotations
import json
import re
import time
import uuid
from pathlib import Path
from typing import Any, Callable, Dict, List, Optional
from fastapi import APIRouter, Depends, HTTPException
from fastapi import APIRouter, Depends, File, HTTPException, UploadFile
from fastapi.responses import FileResponse
from openai import OpenAI
from pydantic import BaseModel, Field
from utils.xianyu_seller_api import SellerApiError, XianyuSellerAPI
@@ -53,6 +58,15 @@ class ResellPublishRequest(BaseModel):
delivery: str = "包邮"
post_price: float = Field(default=0, ge=0)
quantity: int = Field(default=1, ge=1, le=99999)
# 自定义图片列表 [{url, width, height}]:用户在弹窗里增删/替换后的最终图片;
# 为空或全非法时回退源商品图片,保持向后兼容
images: Optional[List[Dict[str, Any]]] = None
class ResellAiOptimizeRequest(BaseModel):
cookie_id: str
title: str = Field(default="", max_length=120)
description: str = Field(default="", max_length=4000)
def _money(value: float) -> str:
@@ -235,6 +249,23 @@ def create_resell_router(
detail = detail_result.get("data") or {}
item_do = detail.get("itemDO") or {}
images = _detail_images(item_do)
# 用户在弹窗里改过的图片优先;非法条目丢弃,全空则回退源图
if req.images:
custom: List[Dict[str, Any]] = []
for raw in req.images[:MAX_IMAGES]:
if not isinstance(raw, dict):
continue
url = str(raw.get("url") or "").strip()
if not url.startswith(("http://", "https://")):
continue
try:
width = int(raw.get("width") or 1000)
height = int(raw.get("height") or 1000)
except (TypeError, ValueError):
width, height = 1000, 1000
custom.append({"url": url, "width": width, "height": height})
if custom:
images = custom
if not images:
raise HTTPException(status_code=400, detail="源商品没有可用图片,无法转卖")
labels = item_do.get("itemLabelExtList") or []
@@ -296,6 +327,129 @@ def create_resell_router(
"price": req.price,
}
# ------------------------------------------------------------------
# 转卖图片:本地上传(存 data/resell_uploads,静态读取免鉴权供 <img> 加载)
# ------------------------------------------------------------------
_UPLOAD_DIR = Path("/app/data/resell_uploads")
_ALLOWED_EXT = {".jpg", ".jpeg", ".png", ".webp", ".gif"}
@router.post("/resell/upload-image")
async def resell_upload_image(
file: UploadFile = File(...),
current_user: dict[str, Any] = Depends(get_current_user),
):
ext = Path(file.filename or "").suffix.lower()
if ext not in _ALLOWED_EXT:
raise HTTPException(status_code=400, detail="仅支持 jpg/png/webp/gif 图片")
data = await file.read()
if not data:
raise HTTPException(status_code=400, detail="图片内容为空")
if len(data) > 8 * 1024 * 1024:
raise HTTPException(status_code=400, detail="图片不能超过 8MB")
_UPLOAD_DIR.mkdir(parents=True, exist_ok=True)
name = f"{uuid.uuid4().hex}{ext}"
(_UPLOAD_DIR / name).write_bytes(data)
return {"success": True, "path": f"/resell/uploaded/{name}"}
@router.get("/resell/uploaded/{name}")
async def resell_uploaded(name: str):
# 文件名 uuid 随机不可枚举;此路由免鉴权(<img> 无法带 Authorization 头)
if "/" in name or ".." in name or not name:
raise HTTPException(status_code=400, detail="非法文件名")
ext = Path(name).suffix.lower()
if ext not in _ALLOWED_EXT:
raise HTTPException(status_code=404, detail="Not Found")
target = _UPLOAD_DIR / name
if not target.is_file():
raise HTTPException(status_code=404, detail="图片不存在")
return FileResponse(target, media_type=f"image/{'jpeg' if ext in ('.jpg', '.jpeg') else ext[1:]}")
# ------------------------------------------------------------------
# AI 一键优化:按原标题/描述改写,返回多个候选标题 + 优化后描述
# ------------------------------------------------------------------
@router.post("/resell/ai-optimize")
def resell_ai_optimize(
req: ResellAiOptimizeRequest,
current_user: dict[str, Any] = Depends(get_current_user),
):
require_account(req.cookie_id, current_user)
settings = db_manager.get_ai_reply_settings(req.cookie_id)
api_key = (settings.get("api_key") or "").strip()
if not api_key:
return {
"success": False,
"status": "need_api_key",
"message": "尚未配置模型 KEY,请先在 AI 设置中填写模型 KEY 再使用 AI 优化。",
}
model_name = (settings.get("model_name") or "").strip() or "qwen-plus"
system_prompt = (
"你是闲鱼文案优化专家。根据用户提供的商品原标题与原描述改写优化,严格返回 JSON(不要 markdown 代码块):\n"
'{"titles": ["候选标题1", "候选标题2", "候选标题3", "候选标题4"], "description": "优化后的商品描述"}\n'
"要求:titles 为 4 个不同风格的标题(突出卖点/关键词前置/数字吸引/简洁直达,各 30 字内、吸睛不夸大、不含违规词);"
"description 保留原描述全部关键信息(规格、内容、使用说明),结构更清晰、分段合理、语气自然,长度与原描述相当。"
)
user_prompt = (
f"原标题:{(req.title or '').strip()[:120]}\n"
f"原描述:{(req.description or '').strip()[:3500]}"
)
content = ""
last_err: Optional[Exception] = None
for extra in ({"enable_thinking": False}, {}):
try:
client = OpenAI(
api_key=api_key,
base_url=(settings.get("base_url") or "").strip() or None,
timeout=60.0,
max_retries=0,
default_headers={"User-Agent": settings.get("user_agent") or "Mozilla/5.0"},
)
response = client.chat.completions.create(
model=model_name,
messages=[
{"role": "system", "content": system_prompt},
{"role": "user", "content": user_prompt},
],
temperature=0.7,
max_tokens=2000,
extra_body=extra or None,
)
content = (response.choices[0].message.content or "").strip()
if content:
break
except Exception as exc: # noqa: BLE001 - 两发兜底后统一报错
last_err = exc
if not content:
raise HTTPException(status_code=502, detail=f"模型调用失败:{last_err or '无返回'}")
# 容错解析:优先整段 JSON,再从文本中截取首对花括号
parsed: Dict[str, Any] = {}
try:
parsed = json.loads(content)
except json.JSONDecodeError:
match = re.search(r"\{[\s\S]*\}", content)
if match:
try:
parsed = json.loads(match.group(0))
except json.JSONDecodeError:
parsed = {}
titles: List[str] = []
for raw in (parsed.get("titles") or []):
text = str(raw).strip()
if text and text not in titles:
titles.append(text)
description = str(parsed.get("description") or "").strip()
if not titles and not description:
raise HTTPException(status_code=502, detail="模型返回无法解析,请重试")
return {
"success": True,
"titles": titles[:5],
"description": description or (req.description or ""),
"model": model_name,
}
return router
+5 -24
View File
@@ -1,20 +1,15 @@
import React, { useEffect, useState } from 'react';
import { Info, Megaphone, RefreshCw, Download, ExternalLink, CheckCircle2, Globe, Github, Mail, Users } from 'lucide-react';
import { Info, Megaphone, RefreshCw, Download, ExternalLink, CheckCircle2, Globe, Github, Mail } from 'lucide-react';
import { getAnnouncement } from '../services/api';
import { AnnouncementPayload } from '../types';
import { EmptyState, PageHeader } from './ui';
// 与 Wiki「开发文档 → 相关链接」保持同一个群;mqqapi 协议在装有 QQ 的设备上
// 点击会直接唤起加群卡片,未安装 QQ 时靠群号文字手动搜索兜底。
const QQ_GROUP_NUMBER = '1037854503';
const QQ_GROUP_LINK = `mqqapi://card/show_pslcard?src_type=internal&version=1&uin=${QQ_GROUP_NUMBER}&card_type=group&source=qrcode`;
// 对外入口统一指向自己的站点与仓库,不指向原作者的地址
const SITE_URL = 'https://www.88531.cn';
const SITE_LABEL = 'www.88531.cn';
const SITE_URL = 'https://nav.88531.cn';
const SITE_LABEL = 'nav.88531.cn';
const REPO_URL = 'https://gitea.88531.cn/jinghui/xianyu-auto-reply';
const REPO_LABEL = 'jinghui/xianyu-auto-reply';
const CONTACT_EMAIL = 'admin@88531.cn';
const CONTACT_EMAIL = '3970260761@qq.com';
const levelStyles: Record<string, string> = {
info: 'border-blue-200 bg-blue-50 text-blue-800',
@@ -126,7 +121,7 @@ const About: React.FC = () => {
</p>
)}
<div className="mt-4 grid gap-3 border-t border-gray-100 pt-4 sm:grid-cols-2 lg:grid-cols-4">
<div className="mt-4 grid gap-3 border-t border-gray-100 pt-4 sm:grid-cols-2 lg:grid-cols-3">
<div className="flex min-w-0 flex-col gap-1.5">
<span className="text-xs font-semibold text-gray-500">官网</span>
<a
@@ -141,20 +136,6 @@ const About: React.FC = () => {
</a>
</div>
<div className="flex min-w-0 flex-col gap-1.5">
<span className="text-xs font-semibold text-gray-500">QQ 交流群</span>
<a
href={QQ_GROUP_LINK}
className="inline-flex min-w-0 items-center gap-1.5 text-xs font-bold text-[#8c7900] hover:underline"
>
<Users className="h-3.5 w-3.5 shrink-0" />
<span className="truncate">点击加入 QQ 群</span>
</a>
<span className="text-[11px] text-gray-400">
群号 {QQ_GROUP_NUMBER},未唤起 QQ 时可手动搜索加群
</span>
</div>
<div className="flex min-w-0 flex-col gap-1.5">
<span className="text-xs font-semibold text-gray-500">开源仓库</span>
<a
+63 -5
View File
@@ -20,6 +20,7 @@ import {
startManualCaptchaSession,
requestFreshCaptchaUrl,
getAiOptimizeSuggest,
getAiOptimizePreview,
syncItemsFromAccount,
} from '../services/api';
import { confirmAction, notify } from '../services/feedback';
@@ -70,6 +71,19 @@ const AccountList: React.FC = () => {
// AI 一键优化建议:哪个账号在跑分析 + 分析结果弹窗
const [aiOptimizingId, setAiOptimizingId] = useState<string | null>(null);
const [aiResult, setAiResult] = useState<{ account: AccountDetail; data: AiOptimizeResult } | null>(null);
// 分析中的预计耗时展示:商品数 + 预计秒区间 + 已耗时秒数
const [aiProgress, setAiProgress] = useState<{ total: number; analyzed: number; estMin: number; estMax: number; truncated: boolean; startedAt: number } | null>(null);
const [aiElapsed, setAiElapsed] = useState(0);
// 分析期间每秒刷新已耗时
useEffect(() => {
if (!aiProgress) return;
setAiElapsed(0);
const timer = setInterval(() => {
setAiElapsed(Math.floor((Date.now() - aiProgress.startedAt) / 1000));
}, 500);
return () => clearInterval(timer);
}, [aiProgress]);
// 编辑表单状态
const [editForm, setEditForm] = useState({
@@ -404,7 +418,34 @@ const AccountList: React.FC = () => {
if (aiOptimizingId) return;
setAiOptimizingId(account.id);
const errMsg = (e: any) => e?.response?.data?.detail || e?.message || 'AI 优化建议请求失败';
// 轻量预检:先拿商品数与预计耗时展示给用户(失败不阻断正式分析)
const applyPreview = async (id: string) => {
try {
const pv = await getAiOptimizePreview(id);
if (pv.status === 'ok' && pv.est_min_seconds != null && pv.est_max_seconds != null) {
setAiProgress({
total: pv.total ?? 0,
analyzed: pv.analyzed_count ?? 0,
estMin: pv.est_min_seconds,
estMax: pv.est_max_seconds,
truncated: !!pv.truncated,
startedAt: Date.now(),
});
notify(
pv.truncated
? `共 ${pv.total} 个商品(分析前 ${pv.analyzed_count} 个),预计约 ${pv.est_min_seconds}~${pv.est_max_seconds} 秒`
: `共 ${pv.total} 个商品,预计约 ${pv.est_min_seconds}~${pv.est_max_seconds} 秒`,
'info',
);
}
} catch {
// 预检失败静默降级:不显示预计时间,分析照常进行
}
};
try {
await applyPreview(account.id);
let res = await getAiOptimizeSuggest(account.id);
if (res.status === 'need_api_key') {
@@ -424,6 +465,7 @@ const AccountList: React.FC = () => {
try {
const syncRes = await syncItemsFromAccount(account.id);
notify(syncRes?.message || '商品同步完成,开始执行优化分析', 'success');
await applyPreview(account.id);
} catch (syncErr) {
notify(errMsg(syncErr), 'error');
return;
@@ -448,6 +490,8 @@ const AccountList: React.FC = () => {
notify(errMsg(e), 'error');
} finally {
setAiOptimizingId(null);
setAiProgress(null);
setAiElapsed(0);
}
};
@@ -796,13 +840,27 @@ const AccountList: React.FC = () => {
onClick={() => handleAiOptimize(account)}
disabled={aiOptimizingId !== null}
className="flex items-center gap-1.5 rounded-md bg-violet-50 px-2.5 py-2 text-xs font-bold text-violet-700 hover:bg-violet-100 disabled:cursor-not-allowed disabled:opacity-40"
title="AI 一键优化建议:检测该账号哪些商品需要优化(需已配置模型 KEY)"
title={aiOptimizingId === account.id && aiProgress ? `正在分析 ${aiProgress.total} 个商品,预计约 ${aiProgress.estMin}~${aiProgress.estMax} 秒` : "AI 一键优化建议:检测该账号哪些商品需要优化(需已配置模型 KEY)"}
aria-label="AI一键优化建议"
>
{aiOptimizingId === account.id
? <Loader2 className="h-4 w-4 animate-spin" />
: <Sparkles className="h-4 w-4" />}
<span>AI优化建议</span>
{aiOptimizingId === account.id ? (
<>
<Loader2 className="h-4 w-4 shrink-0 animate-spin" />
<span className="flex flex-col items-start leading-tight text-left">
<span>分析中 {aiElapsed}s</span>
{aiProgress && (
<span className="text-[10px] font-normal opacity-80">
{aiProgress.total} 件 · 预计约 {aiProgress.estMin}~{aiProgress.estMax}s
</span>
)}
</span>
</>
) : (
<>
<Sparkles className="h-4 w-4" />
<span>AI优化建议</span>
</>
)}
</button>
<button
onClick={() => handleManualCaptcha(account)}
+297 -19
View File
@@ -5,17 +5,21 @@ import {
Heart,
Loader2,
Package,
Plus,
Search,
Sparkles,
Store,
X,
} from 'lucide-react';
import { AccountDetail, ResellItem, ResellPreviewItem } from '../types';
import {
getAccountDetails,
getResellAiOptimize,
getResellFavorites,
previewResellItem,
publishResellItem,
searchResellItems,
uploadResellImage,
} from '../services/api';
import { EmptyState, NoticeBanner, PageHeader, PageTabs } from './ui';
@@ -32,6 +36,25 @@ const itemDetailUrl = (item: Pick<ResellItem, 'item_id' | 'url'>): string => {
return `https://www.goofish.com/item?id=${item.item_id}`;
};
// 弹窗里可编辑的图片:预览/上传后统一成这个结构,发布时原样提交
interface EditImage {
url: string;
width: number;
height: number;
}
// 读图片真实宽高(闲鱼 payload 需要 widthSize/heightSize);加载失败返回 null
const readImageSize = (src: string): Promise<{ width: number; height: number } | null> =>
new Promise(resolve => {
const probe = new Image();
probe.onload = () => resolve({
width: probe.naturalWidth || 1000,
height: probe.naturalHeight || 1000,
});
probe.onerror = () => resolve(null);
probe.src = src;
});
interface PublishForm {
title: string;
price: string;
@@ -76,6 +99,16 @@ const Resell: React.FC = () => {
const [form, setForm] = useState<PublishForm>(emptyForm);
const [publishing, setPublishing] = useState(false);
const [publishedUrl, setPublishedUrl] = useState('');
// 图片增删改替:预览加载后进入可编辑状态,发布时提交这份
const [editImages, setEditImages] = useState<EditImage[]>([]);
const [imgUrlDraft, setImgUrlDraft] = useState('');
const [showAddUrl, setShowAddUrl] = useState(false);
const [imgBusy, setImgBusy] = useState(false);
const fileInputRef = useRef<HTMLInputElement | null>(null);
const replaceIdxRef = useRef<number | null>(null);
// AI 一键优化:候选标题 + 生成中状态
const [aiTitles, setAiTitles] = useState<string[]>([]);
const [aiLoading, setAiLoading] = useState(false);
const accountNames = useMemo(
() => new Map(accounts.map(account => [
@@ -156,6 +189,124 @@ const Resell: React.FC = () => {
}
};
// ------------------------------------------------------------------
// 转卖图片:删除 / 设为首图 / URL 添加 / 本地上传替换
// ------------------------------------------------------------------
const removeImage = (idx: number) => {
if (editImages.length <= 1) {
setNotice({ type: 'error', message: '至少保留一张图片' });
return;
}
setEditImages(list => list.filter((_, i) => i !== idx));
};
const promoteImage = (idx: number) => {
if (idx <= 0) return;
setEditImages(list => {
const next = [...list];
const [picked] = next.splice(idx, 1);
return [picked, ...next];
});
};
const addImageFromUrl = async () => {
const url = imgUrlDraft.trim();
if (imgBusy) return;
if (!/^https?:\/\//.test(url)) {
setNotice({ type: 'error', message: '请输入以 http(s):// 开头的图片地址' });
return;
}
if (editImages.length >= 9) {
setNotice({ type: 'error', message: '最多 9 张图片' });
return;
}
setImgBusy(true);
try {
const size = await readImageSize(url);
if (!size) {
setNotice({ type: 'error', message: '该图片地址无法加载(可能防盗链或已失效)' });
return;
}
setEditImages(list => [...list, { url, ...size }].slice(0, 9));
setImgUrlDraft('');
setShowAddUrl(false);
setNotice({ type: 'success', message: '已添加图片' });
} finally {
setImgBusy(false);
}
};
const uploadImageFiles = async (files: FileList | null, replaceIdx: number | null) => {
if (!files || !files.length) return;
const file = files[0];
setImgBusy(true);
try {
const res = await uploadResellImage(file);
// 相对路径转绝对:闲鱼服务器要能直接抓取该地址
const absolute = new URL(res.path, window.location.origin).href;
const size = await readImageSize(absolute);
if (!size) {
setNotice({ type: 'error', message: '图片上传后无法加载,请重试' });
return;
}
if (replaceIdx != null) {
setEditImages(list => list.map((img, i) => (i === replaceIdx ? { url: absolute, ...size } : img)));
setNotice({ type: 'success', message: '图片已替换' });
} else {
if (editImages.length >= 9) {
setNotice({ type: 'error', message: '最多 9 张图片' });
return;
}
setEditImages(list => [...list, { url: absolute, ...size }].slice(0, 9));
setNotice({ type: 'success', message: '图片已添加' });
}
// 本机/局域网地址闲鱼抓不到,提示一下
if (/^(https?:\/\/)?(localhost|127\.0\.0\.1|192\.168\.)/.test(window.location.origin)) {
setNotice({ type: 'error', message: '当前访问地址非公网,闲鱼可能无法拉取上传的图片,建议通过公网域名操作' });
}
} catch (error) {
setNotice({ type: 'error', message: error instanceof Error ? error.message : '图片上传失败' });
} finally {
setImgBusy(false);
if (fileInputRef.current) fileInputRef.current.value = '';
replaceIdxRef.current = null;
}
};
// ------------------------------------------------------------------
// AI 一键优化:多候选标题点击填入 + 描述改写
// ------------------------------------------------------------------
const handleAiOptimize = async () => {
if (!publishItem || !selectedAccount || aiLoading) return;
setAiLoading(true);
try {
const res = await getResellAiOptimize({
cookie_id: selectedAccount,
title: form.title,
description: form.desc,
});
if (!res.success) {
setNotice({ type: 'error', message: res.message || 'AI 优化失败,请重试' });
return;
}
const titles = res.titles || [];
setAiTitles(titles);
if (res.description && res.description !== form.desc) {
setForm(current => ({ ...current, desc: res.description as string }));
}
setNotice({
type: 'success',
message: titles.length
? `AI 已生成 ${titles.length} 个候选标题(点击选用),描述已同步优化`
: '描述已优化',
});
} catch (error) {
setNotice({ type: 'error', message: error instanceof Error ? error.message : 'AI 优化失败' });
} finally {
setAiLoading(false);
}
};
const openResell = async (item: ResellItem) => {
if (!selectedAccount) {
setNotice({ type: 'error', message: '请先选择账号' });
@@ -164,6 +315,17 @@ const Resell: React.FC = () => {
setPublishItem(item);
setPreview(null);
setPublishedUrl('');
setAiTitles([]);
setShowAddUrl(false);
setImgUrlDraft('');
// 预览未回前先用卡片图占位,详情回来后整组覆盖
setEditImages(
(item.images?.length
? item.images.map(url => ({ url, width: 1000, height: 1000 }))
: item.image
? [{ url: item.image, width: 1000, height: 1000 }]
: []),
);
setForm({
...emptyForm,
title: item.title || '',
@@ -174,6 +336,9 @@ const Resell: React.FC = () => {
const res = await previewResellItem({ cookie_id: selectedAccount, item_id: item.item_id });
const detail = res.item;
setPreview(detail);
if (detail.images?.length) {
setEditImages(detail.images.map(img => ({ url: img.url, width: img.width || 1000, height: img.height || 1000 })));
}
const detailPrice = detail.price != null ? String(detail.price) : '';
setForm(current => ({
...current,
@@ -220,6 +385,7 @@ const Resell: React.FC = () => {
delivery: form.delivery,
post_price: Number(form.postPrice) || 0,
quantity: Number(form.quantity) || 1,
images: editImages.length ? editImages : undefined,
});
setPublishedUrl(res.url);
setNotice({ type: 'success', message: `转卖发布成功:${res.title}` });
@@ -489,28 +655,121 @@ const Resell: React.FC = () => {
</div>
) : (
<div className="flex flex-col gap-4">
{(preview?.images?.length || publishItem.images?.length) ? (
<div className="flex gap-2 overflow-x-auto pb-1">
{(preview?.images || []).map(img => (
<img
key={img.url}
src={img.url}
alt=""
className="h-20 w-20 shrink-0 rounded-md border border-gray-200 object-cover"
/>
))}
{!preview?.images?.length && publishItem.image && (
<img
src={publishItem.image}
alt=""
className="h-20 w-20 shrink-0 rounded-md border border-gray-200 object-cover"
/>
)}
<div>
<div className="mb-2 flex items-center justify-between">
<span className="text-xs text-gray-500">
图片({editImages.length}/9)· 第一张为封面,悬停可替换/删除
</span>
</div>
) : null}
{editImages.length ? (
<>
<div className="flex flex-wrap gap-2">
{editImages.map((img, idx) => (
<div key={`${img.url}-${idx}`} className="group relative h-20 w-20 shrink-0">
<img
src={img.url}
alt=""
className="h-full w-full rounded-md border border-gray-200 object-cover"
/>
{idx === 0 && (
<span className="absolute inset-x-0 bottom-0 rounded-b-md bg-black/55 text-center text-[10px] leading-4 text-white">
封面
</span>
)}
<button
type="button"
onClick={() => removeImage(idx)}
title="删除该图"
className="absolute -right-1.5 -top-1.5 hidden h-5 w-5 items-center justify-center rounded-full bg-red-500 text-white shadow group-hover:flex"
>
<X className="h-3 w-3" />
</button>
<div
className={`absolute inset-x-0 hidden gap-1 bg-black/55 p-0.5 group-hover:flex ${idx === 0 ? 'bottom-4' : 'bottom-0'}`}
>
<button
type="button"
onClick={() => { replaceIdxRef.current = idx; fileInputRef.current?.click(); }}
className="flex-1 rounded bg-white/20 text-[10px] text-white hover:bg-white/40"
>
替换
</button>
{idx > 0 && (
<button
type="button"
onClick={() => promoteImage(idx)}
className="flex-1 rounded bg-white/20 text-[10px] text-white hover:bg-white/40"
>
设首图
</button>
)}
</div>
</div>
))}
{editImages.length < 9 && (
<button
type="button"
onClick={() => fileInputRef.current?.click()}
disabled={imgBusy}
className="flex h-20 w-20 shrink-0 flex-col items-center justify-center gap-1 rounded-md border border-dashed border-gray-300 text-gray-400 transition hover:border-purple-400 hover:text-purple-500 disabled:opacity-60"
>
{imgBusy ? <Loader2 className="h-5 w-5 animate-spin" /> : <Plus className="h-5 w-5" />}
<span className="text-[10px]">上传</span>
</button>
)}
<button
type="button"
onClick={() => setShowAddUrl(value => !value)}
className="flex h-20 w-20 shrink-0 flex-col items-center justify-center gap-1 rounded-md border border-dashed border-gray-300 text-gray-400 transition hover:border-purple-400 hover:text-purple-500"
>
<span className="text-base leading-none">🔗</span>
<span className="text-[10px]">URL</span>
</button>
</div>
{showAddUrl && (
<div className="mt-2 flex gap-2">
<input
value={imgUrlDraft}
onChange={event => setImgUrlDraft(event.target.value)}
placeholder="粘贴图片地址 https://…"
className="ios-input min-w-0 flex-1 rounded-md px-3 py-2 text-sm"
/>
<button
type="button"
onClick={addImageFromUrl}
disabled={imgBusy}
className="shrink-0 rounded-md bg-purple-500 px-3 text-xs font-bold text-white disabled:opacity-60"
>
{imgBusy ? '读取中…' : '添加'}
</button>
</div>
)}
</>
) : (
<p className="text-xs text-gray-400">暂无图片,点下方「上传」或「URL」添加</p>
)}
<input
ref={fileInputRef}
type="file"
accept="image/*"
className="hidden"
onChange={event => uploadImageFiles(event.target.files, replaceIdxRef.current)}
/>
</div>
<div>
<label className="mb-2 block text-sm font-bold text-gray-700" htmlFor="resell-title">标题</label>
<div className="mb-2 flex items-center justify-between gap-2">
<label className="text-sm font-bold text-gray-700" htmlFor="resell-title">标题</label>
<button
type="button"
onClick={handleAiOptimize}
disabled={aiLoading}
className="inline-flex shrink-0 items-center gap-1 rounded-md bg-purple-50 px-2.5 py-1 text-xs font-bold text-purple-600 transition hover:bg-purple-100 disabled:cursor-not-allowed disabled:opacity-60"
>
{aiLoading ? <Loader2 className="h-3.5 w-3.5 animate-spin" /> : <Sparkles className="h-3.5 w-3.5" />}
{aiLoading ? 'AI 生成中…' : 'AI 优化标题+描述'}
</button>
</div>
<input
id="resell-title"
value={form.title}
@@ -519,6 +778,25 @@ const Resell: React.FC = () => {
className="ios-input w-full rounded-md px-3 py-2.5"
placeholder="商品标题"
/>
{aiTitles.length > 0 && (
<div className="mt-2 flex flex-col gap-1.5">
<p className="text-xs text-gray-400">AI 候选标题(点击填入上方输入框):</p>
{aiTitles.map((title, index) => (
<button
key={`${title}-${index}`}
type="button"
onClick={() => setForm(current => ({ ...current, title }))}
className={`rounded-md border px-2.5 py-1.5 text-left text-xs leading-relaxed transition ${
form.title === title
? 'border-purple-500 bg-purple-50 text-purple-700'
: 'border-gray-200 bg-white text-gray-700 hover:border-purple-400 hover:bg-purple-50'
}`}
>
{title}
</button>
))}
</div>
)}
</div>
<div className="grid grid-cols-1 gap-4 sm:grid-cols-2">
+21
View File
@@ -1650,12 +1650,33 @@ export const publishResellItem = async (data: {
delivery?: string;
post_price?: number;
quantity?: number;
/** 弹窗里增删改后的图片列表;缺省则用源商品图片 */
images?: { url: string; width: number; height: number }[];
}): Promise<{ success: boolean; item_id: string; url: string; title: string; price: number }> =>
post('/resell/publish', data);
/** 转卖图片本地上传(存服务端 resell_uploads,返回可直链访问的 path)。 */
export const uploadResellImage = async (file: File): Promise<{ success: boolean; path: string }> => {
const form = new FormData();
form.append('file', file);
return post('/resell/upload-image', form, { timeout: 60000 });
};
/** AI 一键优化:按原标题/描述改写,返回多个候选标题 + 优化后描述。 */
export const getResellAiOptimize = async (data: {
cookie_id: string;
title: string;
description: string;
}): Promise<{ success: boolean; titles?: string[]; description?: string; model?: string; message?: string }> =>
post('/resell/ai-optimize', data, { timeout: 150000 });
// ==================== AI 一键优化建议 ====================
/** 轻量预检:拿商品数与预计分析耗时,点击后先展示预计时间(失败不阻断正式分析)。 */
export const getAiOptimizePreview = async (cookieId: string): Promise<import('../types').AiOptimizePreview> =>
post('/ai-optimize/preview', { cookie_id: cookieId }, { timeout: 15000 });
/** 检测账号商品并给出优化建议(后端会先校验模型 KEY 与商品同步状态)。 */
export const getAiOptimizeSuggest = async (cookieId: string): Promise<import('../types').AiOptimizeResult> =>
// 后端单次模型调用 130s 超时 + 失败重试一次,最坏约 4.5 分钟,前端放宽到 6 分钟
+15
View File
@@ -875,6 +875,21 @@ export interface PriceWatchRuleInput {
ai_precise?: boolean;
}
export interface AiOptimizePreview {
/** ok=可直接分析;need_api_key=未配置模型 KEY;need_sync=该账号还没同步商品 */
status: 'ok' | 'need_api_key' | 'need_sync';
message?: string;
/** 该账号已同步商品总数 */
total?: number;
/** 实际送模型的商品数(受上限截断) */
analyzed_count?: number;
/** 商品数超过送模型上限,会截断分析 */
truncated?: boolean;
/** 预计耗时区间(秒,按商品数估算,宁宽勿窄) */
est_min_seconds?: number;
est_max_seconds?: number;
}
export interface AiOptimizeResult {
/** ok=分析完成;need_api_key=未配置模型 KEY;need_sync=该账号还没同步商品 */
status: 'ok' | 'need_api_key' | 'need_sync';
@@ -1 +1 @@
import{r as l,o as O,n as i,z as k,j as e,B as j,L as A,E as H,aD as q,S,K as z,aQ as B}from"./index-BIvz5Jcw.js";import{P as F,a as U,E as D,S as o}from"./ui-YqULwUTN.js";import{S as Q}from"./save-Bwc_QnHd.js";import{M as E}from"./message-square-text-CYR04FKJ.js";import{E as $}from"./eye-off-DlmcXBo-.js";import{E as G}from"./eye-DT2WPUBY.js";import{P as C}from"./play-D2zUiMa7.js";const I="https://ai.88531.cn/v1",J="https://ai.88531.cn",f={ai_enabled:!1,model_name:"qwen-plus",api_key:"",api_key_configured:!1,base_url:I,user_agent:"codex_cli_rs/0.0.0 (Hermes Agent)",max_discount_percent:10,max_discount_amount:100,max_bargain_rounds:3,context_enabled:!0,context_message_limit:12,context_expire_minutes:120,custom_prompts:""},ae=()=>{const[c,P]=l.useState([]),[t,y]=l.useState(""),[a,d]=l.useState(f),[K,x]=l.useState(!0),[p,N]=l.useState(!1),[u,_]=l.useState(!1),[g,w]=l.useState(!1),[h,R]=l.useState("你好,这个商品现在还能买吗?"),[v,b]=l.useState(""),r=l.useMemo(()=>c.find(s=>s.id===t),[c,t]);l.useEffect(()=>{O().then(s=>{var m;P(s),y(((m=s[0])==null?void 0:m.id)||"")}).catch(s=>i(s instanceof Error?s.message:"账号加载失败","error")).finally(()=>x(!1))},[]),l.useEffect(()=>{t&&(x(!0),b(""),w(!1),k(t).then(s=>d({...f,...s,api_key:""})).catch(s=>i(s instanceof Error?s.message:"AI配置加载失败","error")).finally(()=>x(!1)))},[t]);const n=(s,m)=>{d(M=>({...M,[s]:m}))},T=async()=>{if(!t){i("请先选择账号","warning");return}if(!a.model_name.trim()||!a.base_url.trim()){i("模型名称和接口地址不能为空","warning");return}N(!0);try{await z(t,a);const s=await k(t);d({...f,...s,api_key:""}),i("人工智能回复配置已保存","success")}catch(s){i(s instanceof Error?s.message:"AI配置保存失败","error")}finally{N(!1)}},L=async()=>{if(!t||!h.trim()){i("请选择账号并输入测试消息","warning");return}_(!0),b("");try{const s=await B(t,{message:h.trim(),item_title:"测试商品",item_price:100,item_desc:"仅用于测试人工智能回复,不会发送到闲鱼。"});b(s.reply||s.message||"测试完成"),i("AI回复测试完成","success")}catch(s){i(s instanceof Error?s.message:"AI回复测试失败","error")}finally{_(!1)}};return K&&c.length===0?e.jsx(F,{label:"正在加载 AI 回复配置"}):e.jsxs("div",{className:"page-stack animate-fade-in",children:[e.jsx(U,{title:"AI 回复",description:"按账号配置模型连接、上下文记忆、议价边界和业务回复规则。",icon:j,actions:e.jsxs("div",{className:"flex min-w-0 flex-wrap items-end gap-2",children:[e.jsxs("label",{className:"min-w-0 sm:w-72",children:[e.jsx("span",{className:"field-label",children:"当前账号"}),e.jsx("select",{value:t,onChange:s=>y(s.target.value),className:"ios-input w-full rounded-md px-3 py-2 text-sm font-semibold",children:c.map(s=>e.jsx("option",{value:s.id,children:s.nickname||s.remark||`账号 ${s.id.slice(0,8)}`},s.id))})]}),e.jsxs("button",{type:"button",onClick:T,disabled:p||!t,className:"ios-btn-primary flex items-center justify-center gap-2 rounded-md px-4 py-2 text-sm",children:[p?e.jsx(A,{className:"h-4 w-4 animate-spin"}):e.jsx(Q,{className:"h-4 w-4"}),p?"保存中":"保存配置"]})]})}),t?e.jsxs(e.Fragment,{children:[e.jsxs("section",{className:"section-panel grid gap-4 p-4 lg:grid-cols-[1fr_auto] lg:items-center",children:[e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center gap-2 font-bold text-gray-900",children:[e.jsx(E,{className:"h-5 w-5"}),(r==null?void 0:r.nickname)||(r==null?void 0:r.remark)||t]}),e.jsx("p",{className:"mt-1 text-sm text-gray-500",children:"回复优先级:关键词回复 → 人工智能回复 → 默认回复。AI失败时不会中断消息处理。"})]}),e.jsxs("label",{className:"flex cursor-pointer items-center gap-3",children:[e.jsx("span",{className:"text-sm font-bold text-gray-700",children:a.ai_enabled?"已启用":"已停用"}),e.jsx("input",{type:"checkbox",checked:a.ai_enabled,onChange:s=>n("ai_enabled",s.target.checked),className:"h-5 w-5 accent-yellow-400"})]})]}),e.jsxs("div",{className:"grid gap-6 xl:grid-cols-[minmax(0,1.35fr)_minmax(340px,0.65fr)]",children:[e.jsxs("div",{className:"space-y-6",children:[e.jsxs("section",{className:"section-panel",children:[e.jsx(o,{title:"模型连接",description:"支持 OpenAI 兼容接口;密钥留空时保留服务器中已有配置。",icon:j}),e.jsxs("div",{className:"grid gap-4 p-5 md:grid-cols-2",children:[e.jsxs("div",{className:"md:col-span-2 flex flex-wrap items-center justify-between gap-3 rounded-lg border border-brand-200 bg-brand-50 px-4 py-3",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsx("p",{className:"text-sm font-semibold text-gray-800",children:"没有 API Key?每天可免费领取额度"}),e.jsx("p",{className:"mt-0.5 text-xs text-gray-600",children:"兼容 OpenAI 接口,注册后把密钥填到下方即可直接用。"})]}),e.jsx("div",{className:"flex shrink-0 items-center gap-2",children:e.jsxs("a",{href:J,target:"_blank",rel:"norefLine truncated
import{r as l,o as O,n as i,z as k,j as e,B as j,L as A,E as H,aE as q,S,K as z,aR as B}from"./index-BZnqBmwp.js";import{P as F,a as U,E as D,S as o}from"./ui-B9Jzqjf7.js";import{S as $}from"./save-Dxf2dvgb.js";import{M as E}from"./message-square-text-Bnj1FXzX.js";import{E as G}from"./eye-off-D1JuM9mR.js";import{E as J}from"./eye-BibUMjxU.js";import{P as C}from"./play-P9T6ppIo.js";const I="https://ai.88531.cn/v1",Q="https://ai.88531.cn",f={ai_enabled:!1,model_name:"qwen-plus",api_key:"",api_key_configured:!1,base_url:I,user_agent:"codex_cli_rs/0.0.0 (Hermes Agent)",max_discount_percent:10,max_discount_amount:100,max_bargain_rounds:3,context_enabled:!0,context_message_limit:12,context_expire_minutes:120,custom_prompts:""},ae=()=>{const[c,P]=l.useState([]),[t,y]=l.useState(""),[a,d]=l.useState(f),[R,x]=l.useState(!0),[p,N]=l.useState(!1),[u,_]=l.useState(!1),[g,w]=l.useState(!1),[h,K]=l.useState("你好,这个商品现在还能买吗?"),[v,b]=l.useState(""),r=l.useMemo(()=>c.find(s=>s.id===t),[c,t]);l.useEffect(()=>{O().then(s=>{var m;P(s),y(((m=s[0])==null?void 0:m.id)||"")}).catch(s=>i(s instanceof Error?s.message:"账号加载失败","error")).finally(()=>x(!1))},[]),l.useEffect(()=>{t&&(x(!0),b(""),w(!1),k(t).then(s=>d({...f,...s,api_key:""})).catch(s=>i(s instanceof Error?s.message:"AI配置加载失败","error")).finally(()=>x(!1)))},[t]);const n=(s,m)=>{d(M=>({...M,[s]:m}))},T=async()=>{if(!t){i("请先选择账号","warning");return}if(!a.model_name.trim()||!a.base_url.trim()){i("模型名称和接口地址不能为空","warning");return}N(!0);try{await z(t,a);const s=await k(t);d({...f,...s,api_key:""}),i("人工智能回复配置已保存","success")}catch(s){i(s instanceof Error?s.message:"AI配置保存失败","error")}finally{N(!1)}},L=async()=>{if(!t||!h.trim()){i("请选择账号并输入测试消息","warning");return}_(!0),b("");try{const s=await B(t,{message:h.trim(),item_title:"测试商品",item_price:100,item_desc:"仅用于测试人工智能回复,不会发送到闲鱼。"});b(s.reply||s.message||"测试完成"),i("AI回复测试完成","success")}catch(s){i(s instanceof Error?s.message:"AI回复测试失败","error")}finally{_(!1)}};return R&&c.length===0?e.jsx(F,{label:"正在加载 AI 回复配置"}):e.jsxs("div",{className:"page-stack animate-fade-in",children:[e.jsx(U,{title:"AI 回复",description:"按账号配置模型连接、上下文记忆、议价边界和业务回复规则。",icon:j,actions:e.jsxs("div",{className:"flex min-w-0 flex-wrap items-end gap-2",children:[e.jsxs("label",{className:"min-w-0 sm:w-72",children:[e.jsx("span",{className:"field-label",children:"当前账号"}),e.jsx("select",{value:t,onChange:s=>y(s.target.value),className:"ios-input w-full rounded-md px-3 py-2 text-sm font-semibold",children:c.map(s=>e.jsx("option",{value:s.id,children:s.nickname||s.remark||`账号 ${s.id.slice(0,8)}`},s.id))})]}),e.jsxs("button",{type:"button",onClick:T,disabled:p||!t,className:"ios-btn-primary flex items-center justify-center gap-2 rounded-md px-4 py-2 text-sm",children:[p?e.jsx(A,{className:"h-4 w-4 animate-spin"}):e.jsx($,{className:"h-4 w-4"}),p?"保存中":"保存配置"]})]})}),t?e.jsxs(e.Fragment,{children:[e.jsxs("section",{className:"section-panel grid gap-4 p-4 lg:grid-cols-[1fr_auto] lg:items-center",children:[e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center gap-2 font-bold text-gray-900",children:[e.jsx(E,{className:"h-5 w-5"}),(r==null?void 0:r.nickname)||(r==null?void 0:r.remark)||t]}),e.jsx("p",{className:"mt-1 text-sm text-gray-500",children:"回复优先级:关键词回复 → 人工智能回复 → 默认回复。AI失败时不会中断消息处理。"})]}),e.jsxs("label",{className:"flex cursor-pointer items-center gap-3",children:[e.jsx("span",{className:"text-sm font-bold text-gray-700",children:a.ai_enabled?"已启用":"已停用"}),e.jsx("input",{type:"checkbox",checked:a.ai_enabled,onChange:s=>n("ai_enabled",s.target.checked),className:"h-5 w-5 accent-yellow-400"})]})]}),e.jsxs("div",{className:"grid gap-6 xl:grid-cols-[minmax(0,1.35fr)_minmax(340px,0.65fr)]",children:[e.jsxs("div",{className:"space-y-6",children:[e.jsxs("section",{className:"section-panel",children:[e.jsx(o,{title:"模型连接",description:"支持 OpenAI 兼容接口;密钥留空时保留服务器中已有配置。",icon:j}),e.jsxs("div",{className:"grid gap-4 p-5 md:grid-cols-2",children:[e.jsxs("div",{className:"md:col-span-2 flex flex-wrap items-center justify-between gap-3 rounded-lg border border-brand-200 bg-brand-50 px-4 py-3",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsx("p",{className:"text-sm font-semibold text-gray-800",children:"没有 API Key?每天可免费领取额度"}),e.jsx("p",{className:"mt-0.5 text-xs text-gray-600",children:"兼容 OpenAI 接口,注册后把密钥填到下方即可直接用。"})]}),e.jsx("div",{className:"flex shrink-0 items-center gap-2",children:e.jsxs("a",{href:Q,target:"_blank",rel:"norefLine truncated
-11
View File
@@ -1,11 +0,0 @@
import{c as m,r as n,j as e,bC as g,e as b,O as j,E as l,aD as f,U as N,aT as u,aU as o,bD as y}from"./index-BIvz5Jcw.js";import{a as w,E as _}from"./ui-YqULwUTN.js";/**
* @license lucide-react v0.562.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const v=[["path",{d:"M15 22v-4a4.8 4.8 0 0 0-1-3.5c3 0 6-2 6-5.5.08-1.25-.27-2.48-1-3.5.28-1.15.28-2.35 0-3.5 0 0-1 0-3 1.5-2.64-.5-5.36-.5-8 0C6 2 5 2 5 2c-.3 1.15-.3 2.35 0 3.5A5.403 5.403 0 0 0 4 9c0 3.5 3 5.5 6 5.5-.39.49-.68 1.05-.85 1.65-.17.6-.22 1.23-.15 1.85v4",key:"tonef"}],["path",{d:"M9 18c-4.51 2-5-2-7-2",key:"9comsn"}]],k=m("github",v);/**
* @license lucide-react v0.562.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const E=[["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"}]],L=m("globe",E),p="1037854503",Q=`mqqapi://card/show_pslcard?src_type=internal&version=1&uin=${p}&card_type=group&source=qrcode`,R="https://www.88531.cn",C="www.88531.cn",M="https://gitea.88531.cn/jinghui/xianyu-auto-reply",U="jinghui/xianyu-auto-reply",x="admin@88531.cn",d={info:"border-blue-200 bg-blue-50 text-blue-800",warning:"border-amber-200 bg-amber-50 text-amber-800",danger:"border-red-200 bg-red-50 text-red-700"},A={info:"通知",warning:"注意",danger:"重要"},S=()=>{const[s,h]=n.useState(null),[t,c]=n.useState(!1),i=async(a=!1)=>{c(!0);try{h(await y(a))}catch{}finally{c(!1)}};n.useEffect(()=>{i()},[]);const r=(s==null?void 0:s.announcements)||[];return e.jsxs("div",{className:"page-stack animate-fade-in",children:[e.jsx(w,{title:"关于",description:"查看当前版本、检查更新与历史公告。",icon:g,actions:e.jsxs("button",{type:"button",onClick:()=>i(!0),disabled:t,className:"ios-btn-secondary flex items-center gap-2 rounded-md px-4 py-2 text-sm disabled:opacity-50",children:[e.jsx(b,{className:`h-4 w-4 ${t?"animate-spin":""}`}),t?"正在检查":"检查更新"]})}),e.jsxs("section",{className:"section-panel p-4",children:[e.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[e.jsxs("div",{className:"rounded-md border border-gray-200 p-4",children:[e.jsx("p",{className:"text-xs font-semibold text-gray-500",children:"当前版本"}),e.jsx("p",{className:"mt-1 text-2xl font-bold text-gray-900",children:(s==null?void 0:s.local_version)||"—"})]}),e.jsxs("div",{className:`rounded-md border p-4 ${s!=null&&s.has_update?"border-amber-200 bg-amber-50":"border-gray-200"}`,children:[e.jsx("p",{className:"text-xs font-semibold text-gray-500",children:"最新版本"}),s!=null&&s.has_update?e.jsxs(e.Fragment,{children:[e.jsx("p",{className:"mt-1 text-2xl font-bold text-amber-700",children:s.latest_version}),s.release_notes&&e.jsx("p",{className:"mt-2 whitespace-pre-wrap text-xs text-amber-800",children:s.release_notes}),s.download_url&&e.jsxs("a",{href:s.download_url,target:"_blank",rel:"noopener noreferrer",className:"ios-btn-primary mt-3 inline-flex items-center gap-2 rounded-md px-3 py-2 text-xs",children:[e.jsx(j,{className:"h-4 w-4"}),"前往下载",e.jsx(l,{className:"h-3 w-3"})]})]}):e.jsxs("p",{className:"mt-1 flex items-center gap-2 text-sm font-bold text-green-700",children:[e.jsx(f,{className:"h-5 w-5"}),s!=null&&s.source_configured?"已是最新版本":"未配置更新源"]})]})]}),!(s!=null&&s.source_configured)&&e.jsx("p",{className:"mt-4 rounded-md border border-gray-200 bg-gray-50 px-3 py-2 text-xs text-gray-600",children:"公告与更新检查已关闭。在「系统设置 → 公告与更新」里开启后, 这里会显示公告并自动检查新版本。"}),(s==null?void 0:s.error)&&e.jsxs("p",{className:"mt-3 rounded-md border border-red-200 bg-red-50 px-3 py-2 text-xs text-red-700",children:["拉取公告失败:",s.error]}),e.jsxs("div",{className:"mt-4 grid gap-3 border-t border-gray-100 pt-4 sm:grid-cols-2 lg:grid-cols-4",children:[e.jsxs("div",{className:"flex min-w-0 flex-col gap-1.5",children:[e.jsx("span",{className:"text-xs font-semibold text-gray-500",children:"官网"}),e.jsxs("a",{href:R,target:"_blank",rel:"noopener noreferrer",className:"inline-flex min-w-0 items-center gap-1.5 text-xs font-bold text-[#8c7900] hover:underline",children:[e.jsx(L,{className:"h-3.5 w-3.5 shrink-0"}),e.jsx("span",{className:"truncate",children:C}),e.jsx(l,{className:"h-3 w-3 shrink-0"})]})]}),e.jsxs("div",{className:"flex min-w-0 flex-col gap-1.5",children:[e.jsx("span",{className:"text-xs font-semibold text-gray-500",children:"QQ 交流群"}),e.jsxs("a",{href:Q,className:"inline-flex min-w-0 items-center gap-1.5 text-xs font-bold text-[#8c7900] hover:underline",children:[e.jsx(N,{className:"h-3.5 w-3.5 shrink-0"}),e.jsx("span",{className:"truncate",children:"点击加入 QQ 群"})]}),e.jsxs("span",{className:"text-[11px] text-gray-400",children:["群号 ",p,",未唤起 QQ 时可手动搜索加群"]})]}),e.jsxs("div",{className:"flex min-w-0 flex-col gap-1.5",children:[e.jsx("span",{className:"text-xs font-semibold text-gray-500",children:"开源仓库"}),e.jsxs("a",{href:M,target:"_blank",rel:"noopener noreferrer",className:"inline-flex min-w-0 items-center gap-1.5 text-xs font-bold text-[#8c7900] hover:underline",children:[e.jsx(k,{className:"h-3.5 w-3.5 shrink-0"}),e.jsx("span",{className:"truncate",children:U}),e.jsx(l,{className:"h-3 w-3 shrink-0"})]})]}),e.jsxs("div",{className:"flex min-w-0 flex-col gap-1.5",children:[e.jsx("span",{className:"text-xs font-semibold text-gray-500",children:"联系邮箱"}),e.jsxs("a",{href:`mailto:${x}`,className:"inline-flex min-w-0 items-center gap-1.5 text-xs font-bold text-[#8c7900] hover:underline",children:[e.jsx(u,{className:"h-3.5 w-3.5 shrink-0"}),e.js Line truncated
+11
View File
@@ -0,0 +1,11 @@
import{c as m,r as n,j as e,bD as h,e as g,P as b,E as l,aE as j,aU as f,aV as o,bE as N}from"./index-BZnqBmwp.js";import{a as u,E as y}from"./ui-B9Jzqjf7.js";/**
* @license lucide-react v0.562.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const w=[["path",{d:"M15 22v-4a4.8 4.8 0 0 0-1-3.5c3 0 6-2 6-5.5.08-1.25-.27-2.48-1-3.5.28-1.15.28-2.35 0-3.5 0 0-1 0-3 1.5-2.64-.5-5.36-.5-8 0C6 2 5 2 5 2c-.3 1.15-.3 2.35 0 3.5A5.403 5.403 0 0 0 4 9c0 3.5 3 5.5 6 5.5-.39.49-.68 1.05-.85 1.65-.17.6-.22 1.23-.15 1.85v4",key:"tonef"}],["path",{d:"M9 18c-4.51 2-5-2-7-2",key:"9comsn"}]],v=m("github",w);/**
* @license lucide-react v0.562.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const _=[["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"}]],k=m("globe",_),E="https://nav.88531.cn",L="nav.88531.cn",A="https://gitea.88531.cn/jinghui/xianyu-auto-reply",C="jinghui/xianyu-auto-reply",x="3970260761@qq.com",d={info:"border-blue-200 bg-blue-50 text-blue-800",warning:"border-amber-200 bg-amber-50 text-amber-800",danger:"border-red-200 bg-red-50 text-red-700"},M={info:"通知",warning:"注意",danger:"重要"},I=()=>{const[s,p]=n.useState(null),[t,c]=n.useState(!1),i=async(a=!1)=>{c(!0);try{p(await N(a))}catch{}finally{c(!1)}};n.useEffect(()=>{i()},[]);const r=(s==null?void 0:s.announcements)||[];return e.jsxs("div",{className:"page-stack animate-fade-in",children:[e.jsx(u,{title:"关于",description:"查看当前版本、检查更新与历史公告。",icon:h,actions:e.jsxs("button",{type:"button",onClick:()=>i(!0),disabled:t,className:"ios-btn-secondary flex items-center gap-2 rounded-md px-4 py-2 text-sm disabled:opacity-50",children:[e.jsx(g,{className:`h-4 w-4 ${t?"animate-spin":""}`}),t?"正在检查":"检查更新"]})}),e.jsxs("section",{className:"section-panel p-4",children:[e.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[e.jsxs("div",{className:"rounded-md border border-gray-200 p-4",children:[e.jsx("p",{className:"text-xs font-semibold text-gray-500",children:"当前版本"}),e.jsx("p",{className:"mt-1 text-2xl font-bold text-gray-900",children:(s==null?void 0:s.local_version)||"—"})]}),e.jsxs("div",{className:`rounded-md border p-4 ${s!=null&&s.has_update?"border-amber-200 bg-amber-50":"border-gray-200"}`,children:[e.jsx("p",{className:"text-xs font-semibold text-gray-500",children:"最新版本"}),s!=null&&s.has_update?e.jsxs(e.Fragment,{children:[e.jsx("p",{className:"mt-1 text-2xl font-bold text-amber-700",children:s.latest_version}),s.release_notes&&e.jsx("p",{className:"mt-2 whitespace-pre-wrap text-xs text-amber-800",children:s.release_notes}),s.download_url&&e.jsxs("a",{href:s.download_url,target:"_blank",rel:"noopener noreferrer",className:"ios-btn-primary mt-3 inline-flex items-center gap-2 rounded-md px-3 py-2 text-xs",children:[e.jsx(b,{className:"h-4 w-4"}),"前往下载",e.jsx(l,{className:"h-3 w-3"})]})]}):e.jsxs("p",{className:"mt-1 flex items-center gap-2 text-sm font-bold text-green-700",children:[e.jsx(j,{className:"h-5 w-5"}),s!=null&&s.source_configured?"已是最新版本":"未配置更新源"]})]})]}),!(s!=null&&s.source_configured)&&e.jsx("p",{className:"mt-4 rounded-md border border-gray-200 bg-gray-50 px-3 py-2 text-xs text-gray-600",children:"公告与更新检查已关闭。在「系统设置 → 公告与更新」里开启后, 这里会显示公告并自动检查新版本。"}),(s==null?void 0:s.error)&&e.jsxs("p",{className:"mt-3 rounded-md border border-red-200 bg-red-50 px-3 py-2 text-xs text-red-700",children:["拉取公告失败:",s.error]}),e.jsxs("div",{className:"mt-4 grid gap-3 border-t border-gray-100 pt-4 sm:grid-cols-2 lg:grid-cols-3",children:[e.jsxs("div",{className:"flex min-w-0 flex-col gap-1.5",children:[e.jsx("span",{className:"text-xs font-semibold text-gray-500",children:"官网"}),e.jsxs("a",{href:E,target:"_blank",rel:"noopener noreferrer",className:"inline-flex min-w-0 items-center gap-1.5 text-xs font-bold text-[#8c7900] hover:underline",children:[e.jsx(k,{className:"h-3.5 w-3.5 shrink-0"}),e.jsx("span",{className:"truncate",children:L}),e.jsx(l,{className:"h-3 w-3 shrink-0"})]})]}),e.jsxs("div",{className:"flex min-w-0 flex-col gap-1.5",children:[e.jsx("span",{className:"text-xs font-semibold text-gray-500",children:"开源仓库"}),e.jsxs("a",{href:A,target:"_blank",rel:"noopener noreferrer",className:"inline-flex min-w-0 items-center gap-1.5 text-xs font-bold text-[#8c7900] hover:underline",children:[e.jsx(v,{className:"h-3.5 w-3.5 shrink-0"}),e.jsx("span",{className:"truncate",children:C}),e.jsx(l,{className:"h-3 w-3 shrink-0"})]})]}),e.jsxs("div",{className:"flex min-w-0 flex-col gap-1.5",children:[e.jsx("span",{className:"text-xs font-semibold text-gray-500",children:"联系邮箱"}),e.jsxs("a",{href:`mailto:${x}`,className:"inline-flex min-w-0 items-center gap-1.5 text-xs font-bold text-[#8c7900] hover:underline",children:[e.jsx(f,{className:"h-3.5 w-3.5 shrink-0"}),e.jsx("span",{className:"truncate",children:x})]})]})]})]}),e.jsxs("section",{className:"section-panel",children:[e.jsxs("div",{className:"flex items-center gap-2 border-b border-gray-200 px-4 py-3",children:[e.jsx(o,{className:"h-4 w-4 text-gray-500"}),e.jsx("span",{className:"text-sm font-bold text-gray-800",children:"历史公告"}),e.jsxs("span",{className:"text-xs text-gray-400",children:[r.length," 条"]})]}),r.length>0?e.jsx("div",{className:"divide-y divide-gray-100",children:r.map(a=>e.jsxs("article",{className:"px-4 py-3",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsx("span",{classN Line truncated
-18
View File
@@ -1,18 +0,0 @@
import{c as J,r as n,j as e,U as be,B as T,M as Qe,L as k,S as Y,e as fe,k as Be,b as $,X as L,l as De,m as U,o as Oe,p as Ke,q as Ye,s as He,t as Je,n as c,u as ye,v as je,w as Ve,x as Xe,y as Ge,z as Ze,A as es,D as ss,F as ts,G as as,H as rs,I as ls,J as ns,K as is}from"./index-BIvz5Jcw.js";import{P as os,a as ds,E as cs}from"./ui-YqULwUTN.js";import{C as H}from"./check-FJ-UzmYk.js";import{S as ms}from"./sparkles-19y4hwrj.js";import{P as xs,a as us}from"./power-DjMfqLyB.js";import{T as hs}from"./trash-2-DQAdkDas.js";import{K as ps}from"./key-CYZA_CNy.js";import{E as gs}from"./eye-off-DlmcXBo-.js";import{E as bs}from"./eye-DT2WPUBY.js";import{S as Ne}from"./save-Bwc_QnHd.js";/**
* @license lucide-react v0.562.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const fs=[["path",{d:"M12 6v6l4 2",key:"mmk7yg"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],ve=J("clock",fs);/**
* @license lucide-react v0.562.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const ys=[["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"}]],js=J("map-pin",ys);/**
* @license lucide-react v0.562.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const Ns=[["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"}]],vs=J("qr-code",Ns),Rs=()=>{var pe;const[W,_e]=n.useState([]),[we,V]=n.useState(!0),[S,q]=n.useState([]),[ke,z]=n.useState(!1),[Ce,Se]=n.useState(""),[v,p]=n.useState("pending"),[Q,g]=n.useState(""),[X,G]=n.useState(""),[Z,ee]=n.useState(""),y=n.useRef(null),j=n.useRef(""),[se,_]=n.useState(null),[o,te]=n.useState(null),[ae,re]=n.useState(null),[le,ne]=n.useState(null),[ie,oe]=n.useState(null),[A,B]=n.useState(null),[de,ce]=n.useState(""),[me,P]=n.useState("starting"),[Ae,R]=n.useState(""),I=n.useRef(null),b=n.useRef(null),xe=n.useRef(null),[Ie,ue]=n.useState(new Set),[D,he]=n.useState(null),[d,O]=n.useState(null),[l,N]=n.useState({remark:"",cookie:"",auto_confirm:!1,pause_duration:0,username:"",login_password:"",show_browser:!1,showLoginPassword:!1}),[u,M]=n.useState({ai_enabled:!1,model_name:"qwen-plus",api_key:"",base_url:"https://dashscope.aliyuncs.com/compatible-mode/v1",user_agent:"",max_discount_percent:10,max_discount_amount:100,max_bargain_rounds:3,context_enabled:!0,context_message_limit:12,context_expire_minutes:120,custom_prompts:""}),[w,E]=n.useState(!1),h=async s=>{s!=null&&s.silent||V(!0);try{const a=await Oe();let t={};try{t=await Ke()}catch(i){console.error("Failed to load AI settings:",i)}const r=a.map(i=>{var m,f,C,x,ge;return{...i,ai_enabled:((m=t[i.id])==null?void 0:m.ai_enabled)??!1,max_discount_percent:((f=t[i.id])==null?void 0:f.max_discount_percent)??10,max_discount_amount:((C=t[i.id])==null?void 0:C.max_discount_amount)??100,max_bargain_rounds:((x=t[i.id])==null?void 0:x.max_bargain_rounds)??3,custom_prompts:((ge=t[i.id])==null?void 0:ge.custom_prompts)??""}});_e(r)}catch(a){console.error("Failed to load accounts:",a)}finally{s!=null&&s.silent||V(!1)}};n.useEffect(()=>{const s=()=>{U().then(t=>q((t.accounts||[]).filter(r=>r.blocked||r.verification_type&&r.verification_type!=="none"))).catch(()=>q([]))};s();const a=setInterval(s,3e4);return()=>clearInterval(a)},[]),n.useEffect(()=>{h();const s=setInterval(()=>{h({silent:!0})},3e4);return()=>{clearInterval(s),j.current="",y.current&&clearTimeout(y.current),b.current&&clearInterval(b.current)}},[]);const Me=async(s,a)=>{await es(s,!a),h()},Ee=async s=>{ne(s);try{const a=await Je(s);if(!a.need_verify){c(a.message||"该账号风控已解除,无需验证","success"),await h({silent:!0});const t=await U();q((t.accounts||[]).filter(r=>r.blocked||r.verification_type&&r.verification_type!=="none"));return}if(a.verification_url){window.open(a.verification_url,"_blank","noopener,noreferrer"),c("已打开验证页;滑块通过后页面可能跳转到淘宝,属正常现象,直接关闭即可","info"),b.current&&clearInterval(b.current);let t=18;b.current=setInterval(async()=>{t-=1;try{((await U()).accounts||[]).some(m=>m.blocked||m.verification_type&&m.verification_type!=="none")?t<=0&&b.current&&(clearInterval(b.current),b.current=null):(b.current&&clearInterval(b.current),b.current=null,c("验证已生效,账号恢复运行","success"),h({silent:!0}))}catch{}},1e4)}}catch(a){c(a instanceof Error?a.message:"获取验证链接失败","error")}finally{ne(null)}},Pe=async s=>{re(s);try{await Ge(s),ue(a=>{const t=new Set(a);return t.delete(s),t}),await h()}catch(a){console.error("Failed to refresh account profile:",a),c(a instanceof Error?a.message:"账号资料刷新失败")}finally{re(null)}},Re=async s=>{await je("确认删除该账号吗?")&&(await ss(s),h())},$e=async s=>{B(s),ce(""),P("starting"),R("正在服务器上启动验证页面,请稍候…"),oe(s.id);try{const a=await Xe(s.id);if(!a.success)throw new Error(a.message||"人工验证未完成");P("done"),R(a.message||"验证完成,账号 Cookie 已更新"),c(a.message||"人工验证完成,账号 Cookie 已更新","success");const t=await U();q((t.accounts||[]).filter(r=>r.blocked||r.verification_type&&r.verification_type!=="none")),await h({silent:!0})}catch(a){const t=a instanceof Error?a.message:"人工验证启动失败";P("failed"),R(t),c(t,"error")}finally{oe(null)}};n.useEffect(()=>{var i;if(!A){(i=I.current)==null||i.close(),I.current=null;return}let s=!1,a=0,t;const r=()=>{if(s)return;const m=location.protocol==="https:"?"wss":"ws",f=new WebSocket(`${m}://${location.host}/api/captcha/ws/${encodeURIComponent(A.id)}`);I.current=f,f.onmessage=C=>{let x;try{x=JSON.parse(C.data)}catch{return}x.type==="session_info"||x.type==="screenshot_update"?x.screenshot&&(ce(String(x.screenshot).startsWith("Line truncated
例如:回复时保持礼貌专业、使用简洁的语言、强调产品质量等`,className:"ios-input h-36 w-full resize-y rounded-md px-3 py-2.5"})]}),e.jsxs("div",{className:"rounded-md border border-blue-200 bg-blue-50 p-4",children:[e.jsxs("h4",{className:"mb-2 flex items-center gap-2 font-bold text-blue-900",children:[e.jsx(De,{className:"w-4 h-4"}),"AI如何工作"]}),e.jsxs("ul",{className:"text-xs text-blue-800 space-y-1",children:[e.jsx("li",{children:"• 自动识别买家的砍价请求"}),e.jsx("li",{children:"• 根据设定的策略智能回复"}),e.jsx("li",{children:"• 在合理范围内同意降价或礼貌拒绝"}),e.jsx("li",{children:"• 保持专业友好的沟通风格"})]})]})]}),e.jsx("div",{className:"modal-footer",children:e.jsxs("div",{className:"flex w-full gap-2",children:[e.jsx("button",{type:"button",onClick:()=>_(null),className:"ios-btn-secondary flex-1 rounded-md px-4 py-2.5 text-sm",disabled:w,children:"取消"}),e.jsxs("button",{type:"button",onClick:Ue,className:"ios-btn-primary flex flex-1 items-center justify-center gap-2 rounded-md px-4 py-2.5 text-sm",disabled:w,children:[w?e.jsx(k,{className:"w-4 h-4 animate-spin"}):e.jsx(Ne,{className:"w-4 h-4"}),w?"保存中...":"保存"]})]})})]})}),document.body),A&&$.createPortal(e.jsx("div",{className:"modal-overlay",children:e.jsxs("div",{className:"modal-container modal-container-lg",children:[e.jsxs("div",{className:"modal-header flex items-start justify-between gap-4",children:[e.jsxs("div",{children:[e.jsx("h3",{className:"text-lg font-bold text-gray-900",children:"人工滑块验证"}),e.jsx("p",{className:"mt-1 text-sm text-gray-500",children:A.nickname||A.id})]}),e.jsx("button",{type:"button",onClick:()=>B(null),className:"rounded-md p-2 hover:bg-gray-100","aria-label":"关闭",children:e.jsx(L,{className:"h-5 w-5"})})]}),e.jsxs("div",{className:"modal-body space-y-4",children:[e.jsxs("div",{className:"rounded-md border border-blue-200 bg-blue-50 px-3 py-2 text-xs leading-relaxed text-blue-800",children:[e.jsx("p",{className:"font-bold",children:"这是什么?"}),e.jsxs("p",{className:"mt-1",children:["闲鱼要求人机验证时,系统会自动尝试滑动,但成功率有限。此处把",e.jsx("b",{children:"服务器上浏览器的画面实时投屏"}),"到这里,你用鼠标拖动, 操作会回传到服务器驱动真实浏览器 —— 因此部署在无桌面的服务器上也能用。"]}),e.jsx("p",{className:"mt-1",children:"验证通过后系统会自动回收新的登录凭证,账号立即恢复运行。"})]}),e.jsx("div",{className:`rounded-md px-3 py-2 text-sm font-semibold ${me==="done"?"bg-green-50 text-green-700":me==="failed"?"bg-red-50 text-red-700":"bg-amber-50 text-amber-800"}`,children:Ae||"正在准备…"}),e.jsx("div",{className:"flex min-h-[320px] items-center justify-center rounded-md border-2 border-dashed border-gray-200 bg-gray-50 p-2",children:de?e.jsx("img",{ref:xe,src:de,alt:"服务器端验证页面",draggable:!1,className:"max-h-[460px] w-auto cursor-crosshair select-none rounded",onMouseDown:s=>{s.preventDefault(),F("down",s)},onMouseMove:s=>{s.buttons===1&&F("move",s)},onMouseUp:s=>F("up",s),onMouseLeave:s=>{s.buttons===1&&F("up",s)}}):e.jsxs("div",{className:"text-center text-sm text-gray-500",children:[e.jsx(k,{className:"mx-auto mb-2 h-6 w-6 animate-spin text-gray-400"}),"正在服务器上打开验证页面…",e.jsx("p",{className:"mt-1 text-xs text-gray-400",children:"首次启动需要几秒,若账号当前不在风控状态则不会出现滑块"})]})}),e.jsxs("p",{className:"text-xs text-gray-500",children:["操作方式:在上方画面的滑块按钮上 ",e.jsx("b",{children:"按住鼠标左键"}),",",e.jsx("b",{children:"向右拖到底"})," 后松开。画面会随你的操作实时刷新。"]})]}),e.jsx("div",{className:"modal-footer flex justify-end",children:e.jsx("button",{type:"button",onClick:()=>B(null),className:"ios-btn-secondary rounded-md px-4 py-2 text-sm",children:"关闭"})})]})}),document.body),d&&$.createPortal(e.jsx("div",{className:"modal-overlay",children:e.jsxs("div",{className:"modal-container",style:{maxWidth:"44rem"},children:[e.jsxs("div",{className:"modal-header flex items-start justify-between gap-4",children:[e.jsxs("div",{children:[e.jsxs("h3",{className:"text-lg font-bold text-gray-900",children:["AI 优化建议 · ",d.account.nickname||d.account.username||d.account.id]}),e.jsxs("p",{className:"mt-1 text-xs text-gray-500",children:["共分析 ",d.data.analyzed_count??((pe=d.data.items)==null?void 0:pe.length)??0," 件商品",d.data.model?` · 模型 ${d.data.model}`:"",d.data.truncated?" · 商品较多已截断分析":""]})]}),e.jsx("button",{type:"button",onClick:()=>O(null),className:"rounded-md p-2 hover:bg-gray-100","aria-label":"关闭AI优化建议",children:e.jsx(L,{className:"h-5 w-5 text-gray-600"})})]}),e.jsxs("div",{className:"modal-body py-5",children:[d.data.stats&&e.jsxs("div",{className:"mb-4 flex fle Line truncated
+18
View File
@@ -0,0 +1,18 @@
import{c as X,r as i,j as e,U as je,B as U,M as Ke,L as S,S as J,e as Ne,k as Ye,b as L,X as q,l as He,m as W,o as Je,p as Ve,q as Xe,s as Ge,t as Ze,n as m,u as _e,v as ve,w as es,x as ss,y as ts,z as as,A as rs,D as ls,F as ns,G as is,H as os,I as ds,J as cs,K as ms,N as xs}from"./index-BZnqBmwp.js";import{P as us,a as hs,E as ps}from"./ui-B9Jzqjf7.js";import{C as V}from"./check-C6LyX_Nv.js";import{S as gs}from"./sparkles-DVlvGI-3.js";import{P as bs,a as fs}from"./power-D9WTjX12.js";import{T as ys}from"./trash-2-CmT2n80I.js";import{K as js}from"./key-C0msAg8e.js";import{E as Ns}from"./eye-off-D1JuM9mR.js";import{E as _s}from"./eye-BibUMjxU.js";import{S as we}from"./save-Dxf2dvgb.js";/**
* @license lucide-react v0.562.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const vs=[["path",{d:"M12 6v6l4 2",key:"mmk7yg"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],ke=X("clock",vs);/**
* @license lucide-react v0.562.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const ws=[["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"}]],ks=X("map-pin",ws);/**
* @license lucide-react v0.562.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const Ss=[["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"}]],Cs=X("qr-code",Ss),Fs=()=>{var fe;const[Q,Se]=i.useState([]),[Ce,G]=i.useState(!0),[A,z]=i.useState([]),[Ae,D]=i.useState(!1),[Ie,Me]=i.useState(""),[v,p]=i.useState("pending"),[O,g]=i.useState(""),[Z,ee]=i.useState(""),[se,te]=i.useState(""),j=i.useRef(null),N=i.useRef(""),[ae,w]=i.useState(null),[o,re]=i.useState(null),[le,ne]=i.useState(null),[ie,oe]=i.useState(null),[de,ce]=i.useState(null),[I,B]=i.useState(null),[me,xe]=i.useState(""),[ue,P]=i.useState("starting"),[$e,R]=i.useState(""),M=i.useRef(null),b=i.useRef(null),he=i.useRef(null),[Ee,pe]=i.useState(new Set),[F,ge]=i.useState(null),[c,K]=i.useState(null),[f,be]=i.useState(null),[Pe,Y]=i.useState(0);i.useEffect(()=>{if(!f)return;Y(0);const s=setInterval(()=>{Y(Math.floor((Date.now()-f.startedAt)/1e3))},500);return()=>clearInterval(s)},[f]);const[n,_]=i.useState({remark:"",cookie:"",auto_confirm:!1,pause_duration:0,username:"",login_password:"",show_browser:!1,showLoginPassword:!1}),[u,$]=i.useState({ai_enabled:!1,model_name:"qwen-plus",api_key:"",base_url:"https://dashscope.aliyuncs.com/compatible-mode/v1",user_agent:"",max_discount_percent:10,max_discount_amount:100,max_bargain_rounds:3,context_enabled:!0,context_message_limit:12,context_expire_minutes:120,custom_prompts:""}),[k,E]=i.useState(!1),h=async s=>{s!=null&&s.silent||G(!0);try{const t=await Je();let r={};try{r=await Ve()}catch(l){console.error("Failed to load AI settings:",l)}const a=t.map(l=>{var d,y,C,x,ye;return{...l,ai_enabled:((d=r[l.id])==null?void 0:d.ai_enabled)??!1,max_discount_percent:((y=r[l.id])==null?void 0:y.max_discount_percent)??10,max_discount_amount:((C=r[l.id])==null?void 0:C.max_discount_amount)??100,max_bargain_rounds:((x=r[l.id])==null?void 0:x.max_bargain_rounds)??3,custom_prompts:((ye=r[l.id])==null?void 0:ye.custom_prompts)??""}});Se(a)}catch(t){console.error("Failed to load accounts:",t)}finally{s!=null&&s.silent||G(!1)}};i.useEffect(()=>{const s=()=>{W().then(r=>z((r.accounts||[]).filter(a=>a.blocked||a.verification_type&&a.verification_type!=="none"))).catch(()=>z([]))};s();const t=setInterval(s,3e4);return()=>clearInterval(t)},[]),i.useEffect(()=>{h();const s=setInterval(()=>{h({silent:!0})},3e4);return()=>{clearInterval(s),N.current="",j.current&&clearTimeout(j.current),b.current&&clearInterval(b.current)}},[]);const Re=async(s,t)=>{await rs(s,!t),h()},Le=async s=>{oe(s);try{const t=await Ze(s);if(!t.need_verify){m(t.message||"该账号风控已解除,无需验证","success"),await h({silent:!0});const r=await W();z((r.accounts||[]).filter(a=>a.blocked||a.verification_type&&a.verification_type!=="none"));return}if(t.verification_url){window.open(t.verification_url,"_blank","noopener,noreferrer"),m("已打开验证页;滑块通过后页面可能跳转到淘宝,属正常现象,直接关闭即可","info"),b.current&&clearInterval(b.current);let r=18;b.current=setInterval(async()=>{r-=1;try{((await W()).accounts||[]).some(d=>d.blocked||d.verification_type&&d.verification_type!=="none")?r<=0&&b.current&&(clearInterval(b.current),b.current=null):(b.current&&clearInterval(b.current),b.current=null,m("验证已生效,账号恢复运行","success"),h({silent:!0}))}catch{}},1e4)}}catch(t){m(t instanceof Error?t.message:"获取验证链接失败","error")}finally{oe(null)}},qe=async s=>{ne(s);try{await ts(s),pe(t=>{const r=new Set(t);return r.delete(s),r}),await h()}catch(t){console.error("Failed to refresh account profile:",t),m(t instanceof Error?t.message:"账号资料刷新失败")}finally{ne(null)}},ze=async s=>{await ve("确认删除该账号吗?")&&(await ls(s),h())},Fe=async s=>{B(s),xe(""),P("starting"),R("正在服务器上启动验证页面,请稍候…"),ce(s.id);try{const t=await ss(s.id);if(!t.success)throw new Error(t.message||"人工验证未完成");P("done"),R(t.message||"验证完成,账号 Cookie 已更新"),m(t.message||"人工验证完成,账号 Cookie 已更新","success");const r=await W();z((r.accounts||[]).filter(a=>a.blocked||a.verification_type&&a.verification_type!=="none")),await h({silent:!0})}catch(t){const r=t instanceof Error?t.message:"人工验证启动失败";P("failed"),R(r),m(r,"error")}finally{ce(null)}};i.useEffect(()=>{var l;if(!I){(l=M.current)==null||l.close(),M.current=null;return}let s=!1,t=0,r;const a=()=>{if(s)return;const d=location.protocol==="https:"?"wss":"ws",y=new WebSocket(`${d}://${location.host}/api/captcha/ws/${encodeURICLine truncated
例如:回复时保持礼貌专业、使用简洁的语言、强调产品质量等`,className:"ios-input h-36 w-full resize-y rounded-md px-3 py-2.5"})]}),e.jsxs("div",{className:"rounded-md border border-blue-200 bg-blue-50 p-4",children:[e.jsxs("h4",{className:"mb-2 flex items-center gap-2 font-bold text-blue-900",children:[e.jsx(He,{className:"w-4 h-4"}),"AI如何工作"]}),e.jsxs("ul",{className:"text-xs text-blue-800 space-y-1",children:[e.jsx("li",{children:"• 自动识别买家的砍价请求"}),e.jsx("li",{children:"• 根据设定的策略智能回复"}),e.jsx("li",{children:"• 在合理范围内同意降价或礼貌拒绝"}),e.jsx("li",{children:"• 保持专业友好的沟通风格"})]})]})]}),e.jsx("div",{className:"modal-footer",children:e.jsxs("div",{className:"flex w-full gap-2",children:[e.jsx("button",{type:"button",onClick:()=>w(null),className:"ios-btn-secondary flex-1 rounded-md px-4 py-2.5 text-sm",disabled:k,children:"取消"}),e.jsxs("button",{type:"button",onClick:De,className:"ios-btn-primary flex flex-1 items-center justify-center gap-2 rounded-md px-4 py-2.5 text-sm",disabled:k,children:[k?e.jsx(S,{className:"w-4 h-4 animate-spin"}):e.jsx(we,{className:"w-4 h-4"}),k?"保存中...":"保存"]})]})})]})}),document.body),I&&L.createPortal(e.jsx("div",{className:"modal-overlay",children:e.jsxs("div",{className:"modal-container modal-container-lg",children:[e.jsxs("div",{className:"modal-header flex items-start justify-between gap-4",children:[e.jsxs("div",{children:[e.jsx("h3",{className:"text-lg font-bold text-gray-900",children:"人工滑块验证"}),e.jsx("p",{className:"mt-1 text-sm text-gray-500",children:I.nickname||I.id})]}),e.jsx("button",{type:"button",onClick:()=>B(null),className:"rounded-md p-2 hover:bg-gray-100","aria-label":"关闭",children:e.jsx(q,{className:"h-5 w-5"})})]}),e.jsxs("div",{className:"modal-body space-y-4",children:[e.jsxs("div",{className:"rounded-md border border-blue-200 bg-blue-50 px-3 py-2 text-xs leading-relaxed text-blue-800",children:[e.jsx("p",{className:"font-bold",children:"这是什么?"}),e.jsxs("p",{className:"mt-1",children:["闲鱼要求人机验证时,系统会自动尝试滑动,但成功率有限。此处把",e.jsx("b",{children:"服务器上浏览器的画面实时投屏"}),"到这里,你用鼠标拖动, 操作会回传到服务器驱动真实浏览器 —— 因此部署在无桌面的服务器上也能用。"]}),e.jsx("p",{className:"mt-1",children:"验证通过后系统会自动回收新的登录凭证,账号立即恢复运行。"})]}),e.jsx("div",{className:`rounded-md px-3 py-2 text-sm font-semibold ${ue==="done"?"bg-green-50 text-green-700":ue==="failed"?"bg-red-50 text-red-700":"bg-amber-50 text-amber-800"}`,children:$e||"正在准备…"}),e.jsx("div",{className:"flex min-h-[320px] items-center justify-center rounded-md border-2 border-dashed border-gray-200 bg-gray-50 p-2",children:me?e.jsx("img",{ref:he,src:me,alt:"服务器端验证页面",draggable:!1,className:"max-h-[460px] w-auto cursor-crosshair select-none rounded",onMouseDown:s=>{s.preventDefault(),T("down",s)},onMouseMove:s=>{s.buttons===1&&T("move",s)},onMouseUp:s=>T("up",s),onMouseLeave:s=>{s.buttons===1&&T("up",s)}}):e.jsxs("div",{className:"text-center text-sm text-gray-500",children:[e.jsx(S,{className:"mx-auto mb-2 h-6 w-6 animate-spin text-gray-400"}),"正在服务器上打开验证页面…",e.jsx("p",{className:"mt-1 text-xs text-gray-400",children:"首次启动需要几秒,若账号当前不在风控状态则不会出现滑块"})]})}),e.jsxs("p",{className:"text-xs text-gray-500",children:["操作方式:在上方画面的滑块按钮上 ",e.jsx("b",{children:"按住鼠标左键"}),",",e.jsx("b",{children:"向右拖到底"})," 后松开。画面会随你的操作实时刷新。"]})]}),e.jsx("div",{className:"modal-footer flex justify-end",children:e.jsx("button",{type:"button",onClick:()=>B(null),className:"ios-btn-secondary rounded-md px-4 py-2 text-sm",children:"关闭"})})]})}),document.body),c&&L.createPortal(e.jsx("div",{className:"modal-overlay",children:e.jsxs("div",{className:"modal-container",style:{maxWidth:"44rem"},children:[e.jsxs("div",{className:"modal-header flex items-start justify-between gap-4",children:[e.jsxs("div",{children:[e.jsxs("h3",{className:"text-lg font-bold text-gray-900",children:["AI 优化建议 · ",c.account.nickname||c.account.username||c.account.id]}),e.jsxs("p",{className:"mt-1 text-xs text-gray-500",children:["共分析 ",c.data.analyzed_count??((fe=c.data.items)==null?void 0:fe.length)??0," 件商品",c.data.model?` · 模型 ${c.data.model}`:"",c.data.truncated?" · 商品较多已截断分析":""]})]}),e.jsx("button",{type:"button",onClick:()=>K(null),className:"rounded-md p-2 hover:bg-gray-100","aria-label":"关闭AI优化建议",children:e.jsx(q,{className:"h-5 w-5 text-gray-600"})})]}),e.jsxs("div",{className:"modal-body py-5",children:[c.data.stats&&e.jsxs("div",{className:"mb-4 flex fle Line truncated
@@ -1 +1 @@
import{r as n,j as e,P as C,e as E,aR as P,Q as $,o as B,n as i,aW as H,bE as M}from"./index-BIvz5Jcw.js";import{P as R,a as D,N as z,S as d}from"./ui-YqULwUTN.js";import{S as O}from"./save-Bwc_QnHd.js";import{S as U}from"./shield-alert-BLVh_PbV.js";import{F as W}from"./flower-2-B8e-r4X9.js";import{M as q}from"./message-square-text-CYR04FKJ.js";const r=200,A="宝贝收到了,很满意,感谢老板,欢迎下次再来!",G="亲,感谢支持!有任何问题随时找我~",I={auto_rate_enabled:"评价买家",auto_flower_enabled:"索要小红花",auto_thanks_enabled:"收货致谢",auto_receive_flower_enabled:"自动收下小红花"},K=[{value:300,label:"5 分钟"},{value:900,label:"15 分钟"},{value:1800,label:"30 分钟"},{value:3600,label:"1 小时"},{value:7200,label:"2 小时(默认)"},{value:21600,label:"6 小时"},{value:86400,label:"24 小时"}],ee=()=>{const[l,c]=n.useState(null),[p,h]=n.useState(!1),[b,_]=n.useState(!1),[o,T]=n.useState([]),[f,x]=n.useState({}),j=()=>{h(!0),Promise.all([P(),$().catch(()=>null),B().catch(()=>[])]).then(([t,a,s])=>{c({...t,auto_rate_template:(t.auto_rate_template??"").trim()||(a==null?void 0:a.auto_rate_template)||A}),T(s),x((a==null?void 0:a.accounts)??{})}).finally(()=>h(!1))},F=async(t,a)=>{const s=f[t]??{auto_rate_enabled:!1,auto_flower_enabled:!1,auto_thanks_enabled:!1,auto_receive_flower_enabled:!1},w={...s,[a]:!s[a]};x(u=>({...u,[t]:w}));try{await M(t,{[a]:w[a]})}catch(u){x(k=>({...k,[t]:s})),i(`保存失败:${u.message}`)}};n.useEffect(()=>{j()},[]);const L=async()=>{if(!l)return;const t=(l.auto_rate_template||"").trim();if(!t){i("默认评价内容不能为空");return}if(t.length>r){i(`默认评价内容不能超过 ${r} 字`);return}_(!0);try{await H({auto_rate_template:t,auto_thanks_template:(l.auto_thanks_template||"").trim(),buyer_interaction_interval:String(S)}),i("买家互动配置已保存")}catch(a){i(`保存失败:${a.message}`)}finally{_(!1)}};if(!l)return e.jsx(R,{label:"正在加载买家互动配置"});const m=t=>f[t]??{auto_rate_enabled:!1,auto_flower_enabled:!1,auto_thanks_enabled:!1,auto_receive_flower_enabled:!1},g=o.some(t=>m(t.id).auto_rate_enabled),y=o.some(t=>m(t.id).auto_thanks_enabled),N=l.auto_rate_template??"",v=l.auto_thanks_template??"",S=Number(l.buyer_interaction_interval)||7200;return e.jsxs("div",{className:"page-stack animate-fade-in",children:[e.jsx(D,{title:"买家互动",description:"评价买家、索要小红花与自动收花。涉及平台实际操作,请按账号开启。",icon:C,actions:e.jsxs(e.Fragment,{children:[e.jsxs("button",{type:"button",onClick:j,disabled:p,className:"ios-btn-secondary flex items-center justify-center gap-2 rounded-md px-4 py-2 text-sm",children:[e.jsx(E,{className:`h-4 w-4 ${p?"animate-spin":""}`}),"刷新"]}),e.jsxs("button",{type:"button",onClick:()=>void L(),disabled:b,className:"ios-btn-primary flex items-center justify-center gap-2 rounded-md px-4 py-2 text-sm",children:[e.jsx(O,{className:"h-4 w-4"}),b?"保存中":"保存设置"]})]})}),e.jsx(z,{type:"warning",message:"评价提交后无法撤销,求花会向买家发送一条消息。建议先用测试订单验证效果。"}),e.jsxs("div",{className:"grid gap-4 xl:grid-cols-2",children:[e.jsxs("section",{className:"section-panel",children:[e.jsx(d,{title:"按账号开启",description:"逐个账号控制。关闭的账号不会自动执行,订单页也不显示入口、后端拒绝请求。",icon:U}),o.length===0?e.jsx("p",{className:"px-4 py-6 text-sm 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:"border-b border-gray-200 text-left text-xs text-gray-500",children:[e.jsx("th",{className:"px-4 py-2 font-semibold",children:"账号"}),e.jsx("th",{className:"px-4 py-2 text-center font-semibold",children:"评价买家"}),e.jsx("th",{className:"px-4 py-2 text-center font-semibold",children:"索要小红花"}),e.jsx("th",{className:"px-4 py-2 text-center font-semibold",children:"收货致谢"}),e.jsx("th",{className:"px-4 py-2 text-center font-semibold",children:"自动收下小红花"})]})}),e.jsx("tbody",{children:o.map(t=>{const a=m(t.id);return e.jsxs("tr",{className:"border-b border-gray-100 last:border-b-0",children:[e.jsxs("td",{className:"px-4 py-3",children:[e.jsx("p",{className:"font-semibold text-gray-900",children:t.nickname||t.id}),e.jsx("p",{className:"mt-0.5 font-mono text-xs text-gray-400",children:t.id})]}),["auto_rate_enabled","auto_flower_enabled","auto_thanks_enabled","auto_receive_flower_enabled"].map(s=>e.jsx("td",{className:"px-4 py-3 text-center",children:e.jsx("button",{type:"button",role:"switch","aria-checked":a[s],"aria-label":`${t.nickname||t.id} ${I[s]}`,onClick:()=>void F(t.id,s),className:`relative h-6 w-11 shrink-0 rounded-full transition-colors ${a[s]?"bg-[#ffe100]":"bg-gray-300"}`,children:e.jsx("span",{cLine truncated
import{r as n,j as e,Q as C,e as A,aS as $,T as P,o as B,n as i,aX as H,bF as M}from"./index-BZnqBmwp.js";import{P as D,a as R,N as z,S as d}from"./ui-B9Jzqjf7.js";import{S as O}from"./save-Dxf2dvgb.js";import{S as U}from"./shield-alert-rM_NVGQr.js";import{F as X}from"./flower-2-B1FJm-vw.js";import{M as q}from"./message-square-text-Bnj1FXzX.js";const r=200,E="宝贝收到了,很满意,感谢老板,欢迎下次再来!",G="亲,感谢支持!有任何问题随时找我~",I={auto_rate_enabled:"评价买家",auto_flower_enabled:"索要小红花",auto_thanks_enabled:"收货致谢",auto_receive_flower_enabled:"自动收下小红花"},K=[{value:300,label:"5 分钟"},{value:900,label:"15 分钟"},{value:1800,label:"30 分钟"},{value:3600,label:"1 小时"},{value:7200,label:"2 小时(默认)"},{value:21600,label:"6 小时"},{value:86400,label:"24 小时"}],ee=()=>{const[l,c]=n.useState(null),[p,h]=n.useState(!1),[b,_]=n.useState(!1),[o,T]=n.useState([]),[f,x]=n.useState({}),j=()=>{h(!0),Promise.all([$(),P().catch(()=>null),B().catch(()=>[])]).then(([t,a,s])=>{c({...t,auto_rate_template:(t.auto_rate_template??"").trim()||(a==null?void 0:a.auto_rate_template)||E}),T(s),x((a==null?void 0:a.accounts)??{})}).finally(()=>h(!1))},F=async(t,a)=>{const s=f[t]??{auto_rate_enabled:!1,auto_flower_enabled:!1,auto_thanks_enabled:!1,auto_receive_flower_enabled:!1},w={...s,[a]:!s[a]};x(u=>({...u,[t]:w}));try{await M(t,{[a]:w[a]})}catch(u){x(k=>({...k,[t]:s})),i(`保存失败:${u.message}`)}};n.useEffect(()=>{j()},[]);const L=async()=>{if(!l)return;const t=(l.auto_rate_template||"").trim();if(!t){i("默认评价内容不能为空");return}if(t.length>r){i(`默认评价内容不能超过 ${r} 字`);return}_(!0);try{await H({auto_rate_template:t,auto_thanks_template:(l.auto_thanks_template||"").trim(),buyer_interaction_interval:String(S)}),i("买家互动配置已保存")}catch(a){i(`保存失败:${a.message}`)}finally{_(!1)}};if(!l)return e.jsx(D,{label:"正在加载买家互动配置"});const m=t=>f[t]??{auto_rate_enabled:!1,auto_flower_enabled:!1,auto_thanks_enabled:!1,auto_receive_flower_enabled:!1},g=o.some(t=>m(t.id).auto_rate_enabled),y=o.some(t=>m(t.id).auto_thanks_enabled),N=l.auto_rate_template??"",v=l.auto_thanks_template??"",S=Number(l.buyer_interaction_interval)||7200;return e.jsxs("div",{className:"page-stack animate-fade-in",children:[e.jsx(R,{title:"买家互动",description:"评价买家、索要小红花与自动收花。涉及平台实际操作,请按账号开启。",icon:C,actions:e.jsxs(e.Fragment,{children:[e.jsxs("button",{type:"button",onClick:j,disabled:p,className:"ios-btn-secondary flex items-center justify-center gap-2 rounded-md px-4 py-2 text-sm",children:[e.jsx(A,{className:`h-4 w-4 ${p?"animate-spin":""}`}),"刷新"]}),e.jsxs("button",{type:"button",onClick:()=>void L(),disabled:b,className:"ios-btn-primary flex items-center justify-center gap-2 rounded-md px-4 py-2 text-sm",children:[e.jsx(O,{className:"h-4 w-4"}),b?"保存中":"保存设置"]})]})}),e.jsx(z,{type:"warning",message:"评价提交后无法撤销,求花会向买家发送一条消息。建议先用测试订单验证效果。"}),e.jsxs("div",{className:"grid gap-4 xl:grid-cols-2",children:[e.jsxs("section",{className:"section-panel",children:[e.jsx(d,{title:"按账号开启",description:"逐个账号控制。关闭的账号不会自动执行,订单页也不显示入口、后端拒绝请求。",icon:U}),o.length===0?e.jsx("p",{className:"px-4 py-6 text-sm 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:"border-b border-gray-200 text-left text-xs text-gray-500",children:[e.jsx("th",{className:"px-4 py-2 font-semibold",children:"账号"}),e.jsx("th",{className:"px-4 py-2 text-center font-semibold",children:"评价买家"}),e.jsx("th",{className:"px-4 py-2 text-center font-semibold",children:"索要小红花"}),e.jsx("th",{className:"px-4 py-2 text-center font-semibold",children:"收货致谢"}),e.jsx("th",{className:"px-4 py-2 text-center font-semibold",children:"自动收下小红花"})]})}),e.jsx("tbody",{children:o.map(t=>{const a=m(t.id);return e.jsxs("tr",{className:"border-b border-gray-100 last:border-b-0",children:[e.jsxs("td",{className:"px-4 py-3",children:[e.jsx("p",{className:"font-semibold text-gray-900",children:t.nickname||t.id}),e.jsx("p",{className:"mt-0.5 font-mono text-xs text-gray-400",children:t.id})]}),["auto_rate_enabled","auto_flower_enabled","auto_thanks_enabled","auto_receive_flower_enabled"].map(s=>e.jsx("td",{className:"px-4 py-3 text-center",children:e.jsx("button",{type:"button",role:"switch","aria-checked":a[s],"aria-label":`${t.nickname||t.id} ${I[s]}`,onClick:()=>void F(t.id,s),className:`relative h-6 w-11 shrink-0 rounded-full transition-colors ${a[s]?"bg-[#ffe100]":"bg-gray-300"}`,children:e.jsx("span",{cLine truncated
@@ -1,4 +1,4 @@
import{c as P,r as m,j as e,X as D,a5 as re,n as j,a6 as de,a7 as M,a8 as G,b as z,a9 as H,v as Y,aa as ce,ab as oe,ac as me}from"./index-BIvz5Jcw.js";import{a as pe,S as xe,E as B}from"./ui-YqULwUTN.js";import{P as U}from"./plus-C6QmxIVH.js";import{S as he}from"./square-pen-BKEEv4kY.js";import{T as ye}from"./trash-2-DQAdkDas.js";import{P as Z}from"./package-D-ZQrAsI.js";import{S as ue}from"./save-Bwc_QnHd.js";import{I as q}from"./image-BqfhCYxr.js";import{P as be}from"./package-check-CmnmaNHB.js";/**
import{c as P,r as m,j as e,X as D,a6 as re,n as j,a7 as de,a8 as M,a9 as G,b as z,aa as H,v as Y,ab as ce,ac as oe,ad as me}from"./index-BZnqBmwp.js";import{a as pe,S as xe,E as B}from"./ui-B9Jzqjf7.js";import{P as U}from"./plus-BljRK6L8.js";import{S as he}from"./square-pen-Bmle-FRS.js";import{T as ye}from"./trash-2-CmT2n80I.js";import{P as Z}from"./package-CDIx-vGO.js";import{S as ue}from"./save-Dxf2dvgb.js";import{I as q}from"./image-BE6TxU00.js";import{P as be}from"./package-check-BKkFNxd0.js";/**
* @license lucide-react v0.562.0 - ISC
*
* This source code is licensed under the ISC license.
@@ -1,4 +1,4 @@
var Db=Object.defineProperty;var $b=(e,t,r)=>t in e?Db(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var _i=(e,t,r)=>$b(e,typeof t!="symbol"?t+"":t,r);import{c as gu,r as v,a as bu,b as xu,g as Nb,R as Rb,d as Lb,j as I,C as zb,e as Bb,U as Fb,E as Wb,f as Kb,h as Ub,n as Hb,i as Ac}from"./index-BIvz5Jcw.js";import{P as Yb,a as Gb,b as Vb,S as qb,E as Ii}from"./ui-YqULwUTN.js";import{P as Ro}from"./package-D-ZQrAsI.js";import{T as Lh}from"./trending-up-lcv1edBO.js";import{A as Xb}from"./activity-WV3qb2N7.js";import{P as Zb}from"./package-check-CmnmaNHB.js";/**
var Db=Object.defineProperty;var $b=(e,t,r)=>t in e?Db(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var _i=(e,t,r)=>$b(e,typeof t!="symbol"?t+"":t,r);import{c as gu,r as v,a as bu,b as xu,g as Nb,R as Rb,d as Lb,j as I,C as zb,e as Bb,U as Fb,E as Wb,f as Kb,h as Ub,n as Hb,i as Ac}from"./index-BZnqBmwp.js";import{P as Yb,a as Gb,b as Vb,S as qb,E as Ii}from"./ui-B9Jzqjf7.js";import{P as Ro}from"./package-CDIx-vGO.js";import{T as Lh}from"./trending-up-BLnHDV6T.js";import{A as Xb}from"./activity-D09genEZ.js";import{P as Zb}from"./package-check-BKkFNxd0.js";/**
* @license lucide-react v0.562.0 - ISC
*
* This source code is licensed under the ISC license.
@@ -1 +1 @@
import{r as o,j as e}from"./index-BIvz5Jcw.js";const r=[{group:"快速开始",items:[{id:"dashboard",label:"系统总览"},{id:"accounts",label:"账号管理"}]},{group:"闲鱼业务",items:[{id:"items",label:"商品与发货"},{id:"resell",label:"一键转卖"},{id:"hotlist",label:"实时热卖榜"},{id:"pricewatch",label:"价格监控"},{id:"orders",label:"订单管理"},{id:"buyer-interaction",label:"买家互动"},{id:"cards",label:"卡密库存"}]},{group:"消息与自动化",items:[{id:"messages",label:"消息中心"},{id:"auto-reply",label:"自动回复"},{id:"ai-reply",label:"AI 回复"},{id:"product-automation",label:"商品自动化"}]},{group:"系统",items:[{id:"notifications",label:"通知与日志"},{id:"settings",label:"系统设置"},{id:"users",label:"用户管理"},{id:"about",label:"关于本系统"}]}],p={dashboard:{title:"系统总览",intro:"登录后的首页,汇总账号、订单、营收和库存数据,一眼判断当前经营状态。",steps:["顶部时间筛选可切换统计周期:今天 / 昨天 / 三天内 / 7天内 / 一个月内 / 自定义。","「有效成交额」与「已到账」两张卡片展示所选周期内的资金数据。","「系统运行中」状态灯表示后端自动回复、定时任务正常运行。","左侧菜单点击任意功能即可切换页面,右上角可切换日间/夜间模式。"],tips:["新部署时没有订单记录,金额显示 ¥0.00 属正常,产生交易后自动累计。"]},accounts:{title:"账号管理",intro:"所有功能的入口:先把闲鱼账号接入系统,其他页面才能选择该账号操作。",steps:["点击「添加账号」,填入账号备注名与 Cookie(从浏览器登录闲鱼后在开发者工具 Network 里复制)。","保存后列表会显示该账号,可点击「检测」验证 Cookie 是否仍然有效。","失效的账号需要重新复制 Cookie 更新;不用的账号可「禁用」而不必删除。","启用状态的账号才会参与自动回复、订单同步、消息聚合等自动化。"],tips:["Cookie 等同账号登录态,请勿泄露;本系统只保存在自己的服务器数据库中。"]},items:{title:"商品与发货",intro:"同步闲鱼在售商品,为每个商品配置自动发货内容(卡密、网盘链接或文字说明)。",steps:["选择账号后点击同步,把该账号在闲鱼的在售商品拉取到列表。","给商品设置发货内容:虚拟商品可填卡密说明或网盘链接,实物商品可填物流备注。","买家付款后系统按这里配置的内容自动回复发货,无需手动复制粘贴。","商品价格、标题变化可通过刷新按钮同步最新状态。"],tips:["发货内容支持多行文本与链接,建议按「商品名称 + 提取码」格式写清楚。"]},resell:{title:"一键转卖",intro:"从收藏或搜索结果里挑商品,改好标题价格直接发布到自己账号,做无货源转卖。",steps:["右上角先选择要发布到的闲鱼账号。","点「我的收藏」→「加载收藏」读取该账号收藏的在售商品;或切到「搜索商品」按关键词找货。","在列表中勾选想转卖的商品,修改标题、价格、描述等发布信息。","点「一键转卖」发布,商品即挂到自己账号名下。"],tips:["发布前核对价格是否留足利润;同名商品重复转卖前先在商品列表确认未上架过。"]},hotlist:{title:"实时热卖榜",intro:"抓取闲鱼实时热卖数据,帮你判断什么好卖、该上什么货。",steps:["选择分类或直接查看综合热卖榜,列表按近期成交热度排序。","点击商品可查看详情与价格区间,作为自己定价的参考。","看中的品可直接跳「一键转卖」上架到自己账号。"],tips:["榜单数据为实时抓取,个别时段可能延迟,可点刷新重新拉取。"]},pricewatch:{title:"价格监控",intro:"设定关键词和目标价,系统定时搜索闲鱼,出现低于目标价的商品立即通知你捡漏。",steps:["点「新建规则」:填写关键词(如想蹲的商品名)、目标价、检测间隔,保存后立即执行一次检测。","检测结果展示匹配商品数、历史最低价与「最近一次」的完整商品信息(超长内容自动换行展示)。","低于目标价时触发通知——前提是已在「通知与日志」页配置好通知渠道并勾选「价格监控」事件(见下方章节)。","点「历史记录」查看每次检测的明细;不需要的规则可停用或删除。"],tips:["通知没发出来时,页面顶部的红色提示会写明去哪配置,按提示到「通知与日志」页补配即可。","关键词越具体匹配越准,避免太宽泛导致噪音过多。"]},orders:{title:"订单管理",intro:"汇总所选账号的闲鱼订单,查看状态、手动补发与核对发货记录。",steps:["选择账号与时间范围筛选订单,列表显示买家、商品、金额与状态。","自动发货成Line truncated
import{r as o,j as e}from"./index-BZnqBmwp.js";const r=[{group:"快速开始",items:[{id:"dashboard",label:"系统总览"},{id:"accounts",label:"账号管理"}]},{group:"闲鱼业务",items:[{id:"items",label:"商品与发货"},{id:"resell",label:"一键转卖"},{id:"hotlist",label:"实时热卖榜"},{id:"pricewatch",label:"价格监控"},{id:"orders",label:"订单管理"},{id:"buyer-interaction",label:"买家互动"},{id:"cards",label:"卡密库存"}]},{group:"消息与自动化",items:[{id:"messages",label:"消息中心"},{id:"auto-reply",label:"自动回复"},{id:"ai-reply",label:"AI 回复"},{id:"product-automation",label:"商品自动化"}]},{group:"系统",items:[{id:"notifications",label:"通知与日志"},{id:"settings",label:"系统设置"},{id:"users",label:"用户管理"},{id:"about",label:"关于本系统"}]}],p={dashboard:{title:"系统总览",intro:"登录后的首页,汇总账号、订单、营收和库存数据,一眼判断当前经营状态。",steps:["顶部时间筛选可切换统计周期:今天 / 昨天 / 三天内 / 7天内 / 一个月内 / 自定义。","「有效成交额」与「已到账」两张卡片展示所选周期内的资金数据。","「系统运行中」状态灯表示后端自动回复、定时任务正常运行。","左侧菜单点击任意功能即可切换页面,右上角可切换日间/夜间模式。"],tips:["新部署时没有订单记录,金额显示 ¥0.00 属正常,产生交易后自动累计。"]},accounts:{title:"账号管理",intro:"所有功能的入口:先把闲鱼账号接入系统,其他页面才能选择该账号操作。",steps:["点击「添加账号」,填入账号备注名与 Cookie(从浏览器登录闲鱼后在开发者工具 Network 里复制)。","保存后列表会显示该账号,可点击「检测」验证 Cookie 是否仍然有效。","失效的账号需要重新复制 Cookie 更新;不用的账号可「禁用」而不必删除。","启用状态的账号才会参与自动回复、订单同步、消息聚合等自动化。"],tips:["Cookie 等同账号登录态,请勿泄露;本系统只保存在自己的服务器数据库中。"]},items:{title:"商品与发货",intro:"同步闲鱼在售商品,为每个商品配置自动发货内容(卡密、网盘链接或文字说明)。",steps:["选择账号后点击同步,把该账号在闲鱼的在售商品拉取到列表。","给商品设置发货内容:虚拟商品可填卡密说明或网盘链接,实物商品可填物流备注。","买家付款后系统按这里配置的内容自动回复发货,无需手动复制粘贴。","商品价格、标题变化可通过刷新按钮同步最新状态。"],tips:["发货内容支持多行文本与链接,建议按「商品名称 + 提取码」格式写清楚。"]},resell:{title:"一键转卖",intro:"从收藏或搜索结果里挑商品,改好标题价格直接发布到自己账号,做无货源转卖。",steps:["右上角先选择要发布到的闲鱼账号。","点「我的收藏」→「加载收藏」读取该账号收藏的在售商品;或切到「搜索商品」按关键词找货。","在列表中勾选想转卖的商品,修改标题、价格、描述等发布信息。","点「一键转卖」发布,商品即挂到自己账号名下。"],tips:["发布前核对价格是否留足利润;同名商品重复转卖前先在商品列表确认未上架过。"]},hotlist:{title:"实时热卖榜",intro:"抓取闲鱼实时热卖数据,帮你判断什么好卖、该上什么货。",steps:["选择分类或直接查看综合热卖榜,列表按近期成交热度排序。","点击商品可查看详情与价格区间,作为自己定价的参考。","看中的品可直接跳「一键转卖」上架到自己账号。"],tips:["榜单数据为实时抓取,个别时段可能延迟,可点刷新重新拉取。"]},pricewatch:{title:"价格监控",intro:"设定关键词和目标价,系统定时搜索闲鱼,出现低于目标价的商品立即通知你捡漏。",steps:["点「新建规则」:填写关键词(如想蹲的商品名)、目标价、检测间隔,保存后立即执行一次检测。","检测结果展示匹配商品数、历史最低价与「最近一次」的完整商品信息(超长内容自动换行展示)。","低于目标价时触发通知——前提是已在「通知与日志」页配置好通知渠道并勾选「价格监控」事件(见下方章节)。","点「历史记录」查看每次检测的明细;不需要的规则可停用或删除。"],tips:["通知没发出来时,页面顶部的红色提示会写明去哪配置,按提示到「通知与日志」页补配即可。","关键词越具体匹配越准,避免太宽泛导致噪音过多。"]},orders:{title:"订单管理",intro:"汇总所选账号的闲鱼订单,查看状态、手动补发与核对发货记录。",steps:["选择账号与时间范围筛选订单,列表显示买家、商品、金额与状态。","自动发货成Line truncated
@@ -1 +1 @@
import{r as n,bK as H,bL as A,j as e,bM as S,L as y,e as B,E as F}from"./index-BIvz5Jcw.js";import{P as O,a as U,N as q,b as z,E as K}from"./ui-YqULwUTN.js";import{T as L}from"./trending-up-lcv1edBO.js";import{P as V}from"./package-D-ZQrAsI.js";const W=2500,R=r=>r?r>=1e4?`${(r/1e4).toFixed(1).replace(/\.0$/,"")}万`:String(r):"0",Y=r=>{if(!r)return"—";const i=Date.now()-r;if(i<6e4)return"刚刚";if(i<36e5)return`${Math.floor(i/6e4)}分钟前`;if(i<864e5)return`${Math.floor(i/36e5)}小时前`;if(i<7*864e5)return`${Math.floor(i/864e5)}天前`;const o=new Date(r);return`${o.getMonth()+1}月${o.getDate()}日`},G=r=>{if(!r)return"—";const i=new Date(r),o=v=>String(v).padStart(2,"0");return`${i.getFullYear()}-${o(i.getMonth()+1)}-${o(i.getDate())}`},J=({rank:r})=>{const i=r===1?"bg-amber-400 text-white":r===2?"bg-gray-300 text-gray-700":r===3?"bg-orange-300 text-orange-900":"bg-[var(--surface-subtle)] text-[var(--text-soft)]";return e.jsx("span",{className:`inline-flex h-7 w-7 shrink-0 items-center justify-center rounded-full text-sm font-bold ${i}`,children:r})},se=()=>{const[r,i]=n.useState(!0),[o,v]=n.useState({}),[$,M]=n.useState([]),[d,P]=n.useState("digital"),[j,f]=n.useState(null),[h,_]=n.useState(0),[u,k]=n.useState(!1),g=n.useRef(null),I=n.useRef(d);I.current=d;const w=n.useCallback(()=>{g.current&&(clearInterval(g.current),g.current=null)},[]),b=n.useCallback(async s=>{try{const a=await H();v(a.boards||{}),M(a.categories||[]),s!=null&&s.silent||i(!1),Object.values(a.boards||{}).some(x=>x.refreshing)?E():w()}catch(a){s!=null&&s.silent||(i(!1),f({type:"error",message:a.message||"榜单加载失败"}))}},[]),E=n.useCallback(()=>{g.current||(g.current=setInterval(()=>{b({silent:!0})},W))},[b]);n.useEffect(()=>(b(),w),[b,w]),n.useEffect(()=>{if(h<=0)return;const s=setInterval(()=>_(a=>a<=1?0:a-1),1e3);return()=>clearInterval(s)},[h]);const t=o[d];n.useEffect(()=>{const s=o[d];!s||r||s.refreshing||s.items.length>0||s.cooldown_remaining>0||N(d)},[d,r,o]);const N=async s=>{if(!u){k(!0);try{const a=await A(s);a.started?(f({type:"info",message:a.categories&&a.categories.length>1?"已开始刷新全部类目,完成后自动更新。":"已开始抓取,十几秒后榜单自动刷新。"}),E()):a.reason==="cooldown"?f({type:"error",message:a.message||"刷新过于频繁,请稍后再试"}):f({type:"info",message:a.message||"已有刷新任务进行中"})}catch(a){f({type:"error",message:a.message||"刷新触发失败"})}finally{k(!1)}}};n.useEffect(()=>{t&&t.cooldown_remaining>0&&_(t.cooldown_remaining)},[t]);const T=n.useMemo(()=>$.map(s=>{var a;return{id:s.id,label:s.name,count:(a=o[s.id])==null?void 0:a.items.length}}),[$,o]),C=n.useMemo(()=>{if(!t)return[];const s={};return(t.items||[]).forEach(l=>{(l.keywords||[]).forEach(x=>{const p=s[x]||(s[x]={hits:0,want:0});p.hits+=1,p.want+=l.want_count||0})}),(t.keywords&&t.keywords.length?t.keywords:Object.keys(s)).map(l=>{var x,p;return{kw:l,hits:((x=s[l])==null?void 0:x.hits)||0,want:((p=s[l])==null?void 0:p.want)||0}}).sort((l,x)=>x.want-l.want)},[t]),m=!!(t!=null&&t.refreshing),c=t==null?void 0:t.progress,D=t!=null&&t.updated_at?Y(t.updated_at*1e3):"尚未生成";return r?e.jsx(O,{label:"正在加载热卖榜"}):e.jsxs("div",{className:"flex flex-col gap-4",children:[e.jsx(U,{title:"实时热卖榜",description:"按「想要人数」排序的全网热卖商品,数据来自闲鱼实时搜索聚合。",icon:S,badge:e.jsx("span",{className:"rounded-full bg-[var(--surface-subtle)] px-2 py-0.5 text-xs text-[var(--text-soft)]",children:t?`更新于 ${D}`:"待生成"}),actions:e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsxs("button",{type:"button",className:"ios-btn-secondary flex items-center gap-1.5 rounded-md px-3 py-2 text-sm",onClick:()=>void N("all"),disabled:u||m||h>0,children:[u||m?e.jsx(y,{className:"h-4 w-4 animate-spin"}):e.jsx(B,{className:"h-4 w-4"}),"全部刷新"]}),e.jsxs("button",{type:"button",className:"ios-btn-primary flex items-center gap-1.5 rounded-md px-3 py-2 text-sm",onClick:()=>void N(d),disabled:u||m||h>0,children:[m?e.jsx(y,{className:"h-4 w-4 animate-spin"}):e.jsx(L,{className:"h-4 w-4"}),h>0?`${h}s 后可刷新`:"刷新本类目"]})]})}),j&&e.jsx(q,{type:j.type==="info"?"success":j.type,message:j.message,onClose:()=>f(null)}),e.jsx("div",{className:"toolbar",children:e.jsx(z,{value:d,onChange:P,items:T,ariaLabel:"热卖榜类目"})}),m&&e.jsx("div",{className:"section-panel",children:e.jsxs("div",{className:"flex items-center gap-3 text-sm text-[var(--text-soft)]",children:[e.jsx(y,{className:"h-4 w-4 animate-spin text-[#ff4400]"}),e.jsxs("span",{children:["正在抓取「",(c==null?void 0:c.keyword)||"…","」",c&&c.total>0?`(${Math.min(c.done+1,c.total)}/${c.total})`:""]}),c&&c.total>0&&e.jsx("span",{className:"h-1.5 flex-1 overflow-hidden rounded-full bg-[var(--surface-subtle)]",children:e.jsx("span",{className:"block h-full rounded-full bg-[#ff4400] transition-all",style:{width:`${Math.round(c.Line truncated
import{r as n,bN as H,bO as O,j as e,bP as S,L as y,e as A,E as B}from"./index-BZnqBmwp.js";import{P as F,a as U,N as q,b as z,E as V}from"./ui-B9Jzqjf7.js";import{T as R}from"./trending-up-BLnHDV6T.js";import{P as W}from"./package-CDIx-vGO.js";const Y=2500,L=r=>r?r>=1e4?`${(r/1e4).toFixed(1).replace(/\.0$/,"")}万`:String(r):"0",G=r=>{if(!r)return"—";const i=Date.now()-r;if(i<6e4)return"刚刚";if(i<36e5)return`${Math.floor(i/6e4)}分钟前`;if(i<864e5)return`${Math.floor(i/36e5)}小时前`;if(i<7*864e5)return`${Math.floor(i/864e5)}天前`;const o=new Date(r);return`${o.getMonth()+1}月${o.getDate()}日`},J=r=>{if(!r)return"—";const i=new Date(r),o=v=>String(v).padStart(2,"0");return`${i.getFullYear()}-${o(i.getMonth()+1)}-${o(i.getDate())}`},K=({rank:r})=>{const i=r===1?"bg-amber-400 text-white":r===2?"bg-gray-300 text-gray-700":r===3?"bg-orange-300 text-orange-900":"bg-[var(--surface-subtle)] text-[var(--text-soft)]";return e.jsx("span",{className:`inline-flex h-7 w-7 shrink-0 items-center justify-center rounded-full text-sm font-bold ${i}`,children:r})},se=()=>{const[r,i]=n.useState(!0),[o,v]=n.useState({}),[$,P]=n.useState([]),[d,M]=n.useState("digital"),[j,f]=n.useState(null),[h,_]=n.useState(0),[u,k]=n.useState(!1),g=n.useRef(null),I=n.useRef(d);I.current=d;const w=n.useCallback(()=>{g.current&&(clearInterval(g.current),g.current=null)},[]),b=n.useCallback(async s=>{try{const a=await H();v(a.boards||{}),P(a.categories||[]),s!=null&&s.silent||i(!1),Object.values(a.boards||{}).some(x=>x.refreshing)?E():w()}catch(a){s!=null&&s.silent||(i(!1),f({type:"error",message:a.message||"榜单加载失败"}))}},[]),E=n.useCallback(()=>{g.current||(g.current=setInterval(()=>{b({silent:!0})},Y))},[b]);n.useEffect(()=>(b(),w),[b,w]),n.useEffect(()=>{if(h<=0)return;const s=setInterval(()=>_(a=>a<=1?0:a-1),1e3);return()=>clearInterval(s)},[h]);const t=o[d];n.useEffect(()=>{const s=o[d];!s||r||s.refreshing||s.items.length>0||s.cooldown_remaining>0||N(d)},[d,r,o]);const N=async s=>{if(!u){k(!0);try{const a=await O(s);a.started?(f({type:"info",message:a.categories&&a.categories.length>1?"已开始刷新全部类目,完成后自动更新。":"已开始抓取,十几秒后榜单自动刷新。"}),E()):a.reason==="cooldown"?f({type:"error",message:a.message||"刷新过于频繁,请稍后再试"}):f({type:"info",message:a.message||"已有刷新任务进行中"})}catch(a){f({type:"error",message:a.message||"刷新触发失败"})}finally{k(!1)}}};n.useEffect(()=>{t&&t.cooldown_remaining>0&&_(t.cooldown_remaining)},[t]);const T=n.useMemo(()=>$.map(s=>{var a;return{id:s.id,label:s.name,count:(a=o[s.id])==null?void 0:a.items.length}}),[$,o]),C=n.useMemo(()=>{if(!t)return[];const s={};return(t.items||[]).forEach(l=>{(l.keywords||[]).forEach(x=>{const p=s[x]||(s[x]={hits:0,want:0});p.hits+=1,p.want+=l.want_count||0})}),(t.keywords&&t.keywords.length?t.keywords:Object.keys(s)).map(l=>{var x,p;return{kw:l,hits:((x=s[l])==null?void 0:x.hits)||0,want:((p=s[l])==null?void 0:p.want)||0}}).sort((l,x)=>x.want-l.want)},[t]),m=!!(t!=null&&t.refreshing),c=t==null?void 0:t.progress,D=t!=null&&t.updated_at?G(t.updated_at*1e3):"尚未生成";return r?e.jsx(F,{label:"正在加载热卖榜"}):e.jsxs("div",{className:"flex flex-col gap-4",children:[e.jsx(U,{title:"实时热卖榜",description:"按「想要人数」排序的全网热卖商品,数据来自闲鱼实时搜索聚合。",icon:S,badge:e.jsx("span",{className:"rounded-full bg-[var(--surface-subtle)] px-2 py-0.5 text-xs text-[var(--text-soft)]",children:t?`更新于 ${D}`:"待生成"}),actions:e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsxs("button",{type:"button",className:"ios-btn-secondary flex items-center gap-1.5 rounded-md px-3 py-2 text-sm",onClick:()=>void N("all"),disabled:u||m||h>0,children:[u||m?e.jsx(y,{className:"h-4 w-4 animate-spin"}):e.jsx(A,{className:"h-4 w-4"}),"全部刷新"]}),e.jsxs("button",{type:"button",className:"ios-btn-primary flex items-center gap-1.5 rounded-md px-3 py-2 text-sm",onClick:()=>void N(d),disabled:u||m||h>0,children:[m?e.jsx(y,{className:"h-4 w-4 animate-spin"}):e.jsx(R,{className:"h-4 w-4"}),h>0?`${h}s 后可刷新`:"刷新本类目"]})]})}),j&&e.jsx(q,{type:j.type==="info"?"success":j.type,message:j.message,onClose:()=>f(null)}),e.jsx("div",{className:"toolbar",children:e.jsx(z,{value:d,onChange:M,items:T,ariaLabel:"热卖榜类目"})}),m&&e.jsx("div",{className:"section-panel",children:e.jsxs("div",{className:"flex items-center gap-3 text-sm text-[var(--text-soft)]",children:[e.jsx(y,{className:"h-4 w-4 animate-spin text-[#ff4400]"}),e.jsxs("span",{children:["正在抓取「",(c==null?void 0:c.keyword)||"…","」",c&&c.total>0?`(${Math.min(c.done+1,c.total)}/${c.total})`:""]}),c&&c.total>0&&e.jsx("span",{className:"h-1.5 flex-1 overflow-hidden rounded-full bg-[var(--surface-subtle)]",children:e.jsx("span",{className:"block h-full rounded-full bg-[#ff4400] transition-all",style:{width:`${Math.round(c.Line truncated
@@ -1,4 +1,4 @@
import{c as _e,r,ad as fs,ae as Ee,n as w,j as e,e as ve,X as ee,L as V,af as js,ag as Ns,ah as _s,v as xe,ai as vs,aj as Be,b as re,ak as fe,al as je,am as ws,an as ks,ao as Qe,ap as Re,o as Te,h as ye,a7 as Le,aq as ze,ar as be,w as Ss,as as Cs,at as Ue,au as Ke,av as Is,aw as $s,ax as Ms,ay as Ds}from"./index-BIvz5Jcw.js";import{E as se,S as Ne,P as qe,a as Fs,b as Ps,N as Es}from"./ui-YqULwUTN.js";import{S as de}from"./shield-alert-BLVh_PbV.js";import{S as ce}from"./save-Bwc_QnHd.js";import{T as me}from"./trash-2-DQAdkDas.js";import{P as oe}from"./plus-C6QmxIVH.js";import{P as Bs}from"./power-off-CRjSW7V0.js";import{a as Rs,P as Ts}from"./power-DjMfqLyB.js";import{P as We}from"./package-check-CmnmaNHB.js";import{S as Oe}from"./sparkles-19y4hwrj.js";import{S as Ls}from"./settings-2-DI3dKtSP.js";import{S as zs}from"./square-pen-BKEEv4kY.js";/**
import{c as _e,r,ae as fs,af as Ee,n as w,j as e,e as ve,X as ee,L as V,ag as js,ah as Ns,ai as _s,v as xe,aj as vs,ak as Be,b as re,al as fe,am as je,an as ws,ao as ks,ap as Qe,aq as Re,o as Te,h as ye,a8 as Le,ar as ze,as as be,w as Ss,at as Cs,au as Ue,av as Ke,aw as Is,ax as $s,ay as Ms,az as Ds}from"./index-BZnqBmwp.js";import{E as se,S as Ne,P as qe,a as Fs,b as Ps,N as Es}from"./ui-B9Jzqjf7.js";import{S as de}from"./shield-alert-rM_NVGQr.js";import{S as ce}from"./save-Dxf2dvgb.js";import{T as me}from"./trash-2-CmT2n80I.js";import{P as oe}from"./plus-BljRK6L8.js";import{P as Bs}from"./power-off-NLH-bTqs.js";import{a as Rs,P as Ts}from"./power-D9WTjX12.js";import{P as We}from"./package-check-BKkFNxd0.js";import{S as Oe}from"./sparkles-DVlvGI-3.js";import{S as Ls}from"./settings-2-CRN1TI2k.js";import{S as zs}from"./square-pen-Bmle-FRS.js";/**
* @license lucide-react v0.562.0 - ISC
*
* This source code is licensed under the ISC license.
@@ -1 +1 @@
import{r as i,o as J,b1 as fe,aq as Ne,a7 as ve,b2 as we,j as e,M as R,B as P,e as Q,b as E,X as F,v as k,b3 as _e,n as t,ak as V,al as ke,b4 as Se,b5 as Ce,b6 as De,b7 as Re,b8 as Pe}from"./index-BIvz5Jcw.js";import{a as Ee,b as Fe,E as S,P as Me,S as M}from"./ui-YqULwUTN.js";import{T}from"./truck-tA7BGYeX.js";import{K as W}from"./key-CYZA_CNy.js";import{P as Te}from"./plus-C6QmxIVH.js";import{P as $,a as $e}from"./power-DjMfqLyB.js";import{T as A}from"./trash-2-DQAdkDas.js";import{P as Ae}from"./power-off-CRjSW7V0.js";import{S as K}from"./save-Bwc_QnHd.js";import{S as Ke}from"./sparkles-19y4hwrj.js";const Ve=({mode:l})=>{const[x,L]=i.useState([]),[d,B]=i.useState(""),[y,Y]=i.useState("reply"),[j,Z]=i.useState([]),[I,h]=i.useState(!1),[f,q]=i.useState(null),[c,N]=i.useState({keyword:"",reply_content:""}),[C,ee]=i.useState([]),[se,ae]=i.useState([]),[te,u]=i.useState(!1),[v,z]=i.useState(null),[r,o]=i.useState({keyword:"",cookie_id:"",card_id:"",description:"",enabled:!0}),[H,le]=i.useState({}),[ie,g]=i.useState(!1),[Le,O]=i.useState(null),[n,m]=i.useState({cookie_id:"",enabled:!1,reply_content:"",reply_once:!1,reply_image_url:""}),[re,U]=i.useState(!1);i.useEffect(()=>{if(l==="delivery"){b(),X(),J().then(L);return}J().then(s=>{L(s),s&&s.length>0&&B(a=>a||s[0].id)})},[l]),i.useEffect(()=>{l==="reply"&&d&&(_(),w())},[l,d]);const w=async()=>{try{const s=await fe();le(s)}catch(s){console.error("加载默认回复失败",s)}},b=async()=>{try{const s=await Ne();ee(s.filter(a=>!a.item_id))}catch(s){console.error("加载发货规则失败",s)}},X=async()=>{try{const s=await ve();ae(s)}catch(s){console.error("加载卡券失败",s)}},_=async()=>{if(d){U(!0);try{const s=await we(d);Z(s)}catch(s){console.error("加载关键词失败",s)}finally{U(!1)}}},ne=()=>{if(l==="delivery")z(null),o({keyword:"",cookie_id:"",card_id:"",description:"",enabled:!0}),u(!0);else if(y==="reply")q(null),N({keyword:"",reply_content:""}),h(!0);else{if(!d)return;G(d)}},G=async s=>{try{const a=await Se(s);O(a),m({cookie_id:s,enabled:a.enabled,reply_content:a.reply_content,reply_once:a.reply_once,reply_image_url:a.reply_image_url||""}),g(!0)}catch(a){console.error("加载默认回复失败",a),O(null),m({cookie_id:s,enabled:!1,reply_content:"",reply_once:!1,reply_image_url:""}),g(!0)}},de=s=>{y==="reply"&&(q(s),N({keyword:s.keyword,reply_content:s.reply_content}),h(!0))},ce=s=>{z(s),o({keyword:s.item_keyword,cookie_id:s.cookie_id||"",card_id:String(s.card_group_id),description:s.name,enabled:s.enabled}),u(!0)},oe=async()=>{if(!d){t("请先选择账号");return}if(!c.keyword.trim()||!c.reply_content.trim()){t("请填写关键词和回复内容");return}try{await Re({id:f==null?void 0:f.id,keyword:c.keyword,reply_content:c.reply_content,match_type:"exact",enabled:!0},d),h(!1),_(),t("保存成功!")}catch(s){t("保存失败:"+s.message)}},me=async()=>{if(!r.keyword.trim()){t("请填写触发关键词");return}if(!r.card_id){t("请选择卡券");return}try{await V({id:v==null?void 0:v.id,item_keyword:r.keyword,cookie_id:r.cookie_id||void 0,item_id:void 0,card_group_id:parseInt(r.card_id),name:r.description,priority:1,enabled:r.enabled}),u(!1),b(),t("保存成功!")}catch(s){t("保存失败:"+s.message)}},pe=async s=>{if(!(!d||!await k("确认删除该关键词吗?")))try{await _e(s,d),_(),t("删除成功!")}catch(a){t("删除失败:"+a.message)}},xe=async s=>{if(await k("确认删除该发货规则吗?"))try{await ke(s),b(),t("删除成功!")}catch(a){t("删除失败:"+a.message)}},ye=async s=>{try{await V({id:s.id,item_keyword:s.item_keyword,cookie_id:s.cookie_id,item_id:s.item_id,card_group_id:s.card_group_id,name:s.name,priority:s.priority,enabled:!s.enabled}),b()}catch(a){t("操作失败:"+a.message)}},he=async()=>{if(!n.cookie_id){t("请先选择账号");return}try{await Pe(n.cookie_id,{enabled:n.enabled,reply_content:n.reply_content,reply_once:n.reply_once,reply_image_url:n.reply_image_url}),g(!1),w(),t("保存成功!")}catch(s){t("保存失败:"+s.message)}},ue=async s=>{if(await k("确认删除该默认回复吗?"))try{await De(s),w(),t("删除成功!")}catch(a){t("删除失败:"+a.message)}},ge=async s=>{if(await k("确认清空该账号的回复记录吗?清空后可以重新对所有对话使用默认回复。"))try{await Ce(s),t("清空成功!")}catch(a){t("清空失败:"+a.message)}},be=Object.values(H).filter(s=>s.enabled).length,je=()=>{l==="delivery"?Promise.all([b(),X()]):y==="reply"?_():w()},D=(s,a,p)=>e.jsx("button",{type:"button",role:"switch","aria-checked":s,"aria-label":p,onClick:a,className:`relative h-6 w-11 shrink-0 rounded-full transition-colors ${s?"bg-[#ffe100]":"bg-gray-300"}`,children:e.jsx("span",{className:`absolute left-1 top-1 h-4 w-4 rounded-full bg-white transition-transform ${s?"translate-x-5":""}`})});return e.jsxs("div",{className:"page-stack animate-fade-in",children:[e.jsx(Ee,{title:l==="reply"?"自动回复":"通用自动发货",description:l==="reply"?"管理账Line truncated
import{r as i,o as J,b2 as fe,ar as Ne,a8 as ve,b3 as we,j as e,M as R,B as P,e as Q,b as E,X as F,v as k,b4 as _e,n as t,al as V,am as ke,b5 as Se,b6 as Ce,b7 as De,b8 as Re,b9 as Pe}from"./index-BZnqBmwp.js";import{a as Ee,b as Fe,E as S,P as Me,S as M}from"./ui-B9Jzqjf7.js";import{T}from"./truck-3I9pdhz5.js";import{K as W}from"./key-C0msAg8e.js";import{P as Te}from"./plus-BljRK6L8.js";import{P as $,a as $e}from"./power-D9WTjX12.js";import{T as A}from"./trash-2-CmT2n80I.js";import{P as Ae}from"./power-off-NLH-bTqs.js";import{S as K}from"./save-Dxf2dvgb.js";import{S as Ke}from"./sparkles-DVlvGI-3.js";const Ve=({mode:l})=>{const[x,L]=i.useState([]),[d,B]=i.useState(""),[y,Y]=i.useState("reply"),[j,Z]=i.useState([]),[I,h]=i.useState(!1),[f,z]=i.useState(null),[c,N]=i.useState({keyword:"",reply_content:""}),[C,ee]=i.useState([]),[se,ae]=i.useState([]),[te,u]=i.useState(!1),[v,H]=i.useState(null),[r,o]=i.useState({keyword:"",cookie_id:"",card_id:"",description:"",enabled:!0}),[O,le]=i.useState({}),[ie,g]=i.useState(!1),[Le,q]=i.useState(null),[n,m]=i.useState({cookie_id:"",enabled:!1,reply_content:"",reply_once:!1,reply_image_url:""}),[re,U]=i.useState(!1);i.useEffect(()=>{if(l==="delivery"){b(),X(),J().then(L);return}J().then(s=>{L(s),s&&s.length>0&&B(a=>a||s[0].id)})},[l]),i.useEffect(()=>{l==="reply"&&d&&(_(),w())},[l,d]);const w=async()=>{try{const s=await fe();le(s)}catch(s){console.error("加载默认回复失败",s)}},b=async()=>{try{const s=await Ne();ee(s.filter(a=>!a.item_id))}catch(s){console.error("加载发货规则失败",s)}},X=async()=>{try{const s=await ve();ae(s)}catch(s){console.error("加载卡券失败",s)}},_=async()=>{if(d){U(!0);try{const s=await we(d);Z(s)}catch(s){console.error("加载关键词失败",s)}finally{U(!1)}}},ne=()=>{if(l==="delivery")H(null),o({keyword:"",cookie_id:"",card_id:"",description:"",enabled:!0}),u(!0);else if(y==="reply")z(null),N({keyword:"",reply_content:""}),h(!0);else{if(!d)return;G(d)}},G=async s=>{try{const a=await Se(s);q(a),m({cookie_id:s,enabled:a.enabled,reply_content:a.reply_content,reply_once:a.reply_once,reply_image_url:a.reply_image_url||""}),g(!0)}catch(a){console.error("加载默认回复失败",a),q(null),m({cookie_id:s,enabled:!1,reply_content:"",reply_once:!1,reply_image_url:""}),g(!0)}},de=s=>{y==="reply"&&(z(s),N({keyword:s.keyword,reply_content:s.reply_content}),h(!0))},ce=s=>{H(s),o({keyword:s.item_keyword,cookie_id:s.cookie_id||"",card_id:String(s.card_group_id),description:s.name,enabled:s.enabled}),u(!0)},oe=async()=>{if(!d){t("请先选择账号");return}if(!c.keyword.trim()||!c.reply_content.trim()){t("请填写关键词和回复内容");return}try{await Re({id:f==null?void 0:f.id,keyword:c.keyword,reply_content:c.reply_content,match_type:"exact",enabled:!0},d),h(!1),_(),t("保存成功!")}catch(s){t("保存失败:"+s.message)}},me=async()=>{if(!r.keyword.trim()){t("请填写触发关键词");return}if(!r.card_id){t("请选择卡券");return}try{await V({id:v==null?void 0:v.id,item_keyword:r.keyword,cookie_id:r.cookie_id||void 0,item_id:void 0,card_group_id:parseInt(r.card_id),name:r.description,priority:1,enabled:r.enabled}),u(!1),b(),t("保存成功!")}catch(s){t("保存失败:"+s.message)}},pe=async s=>{if(!(!d||!await k("确认删除该关键词吗?")))try{await _e(s,d),_(),t("删除成功!")}catch(a){t("删除失败:"+a.message)}},xe=async s=>{if(await k("确认删除该发货规则吗?"))try{await ke(s),b(),t("删除成功!")}catch(a){t("删除失败:"+a.message)}},ye=async s=>{try{await V({id:s.id,item_keyword:s.item_keyword,cookie_id:s.cookie_id,item_id:s.item_id,card_group_id:s.card_group_id,name:s.name,priority:s.priority,enabled:!s.enabled}),b()}catch(a){t("操作失败:"+a.message)}},he=async()=>{if(!n.cookie_id){t("请先选择账号");return}try{await Pe(n.cookie_id,{enabled:n.enabled,reply_content:n.reply_content,reply_once:n.reply_once,reply_image_url:n.reply_image_url}),g(!1),w(),t("保存成功!")}catch(s){t("保存失败:"+s.message)}},ue=async s=>{if(await k("确认删除该默认回复吗?"))try{await De(s),w(),t("删除成功!")}catch(a){t("删除失败:"+a.message)}},ge=async s=>{if(await k("确认清空该账号的回复记录吗?清空后可以重新对所有对话使用默认回复。"))try{await Ce(s),t("清空成功!")}catch(a){t("清空失败:"+a.message)}},be=Object.values(O).filter(s=>s.enabled).length,je=()=>{l==="delivery"?Promise.all([b(),X()]):y==="reply"?_():w()},D=(s,a,p)=>e.jsx("button",{type:"button",role:"switch","aria-checked":s,"aria-label":p,onClick:a,className:`relative h-6 w-11 shrink-0 rounded-full transition-colors ${s?"bg-[#ffe100]":"bg-gray-300"}`,children:e.jsx("span",{className:`absolute left-1 top-1 h-4 w-4 rounded-full bg-white transition-transform ${s?"translate-x-5":""}`})});return e.jsxs("div",{className:"page-stack animate-fade-in",children:[e.jsx(Ee,{title:l==="reply"?"自动回复":"通用自动发货",description:l==="reply"?"管理账Line truncated
@@ -1,4 +1,4 @@
import{c as We,r as n,aV as mt,o as xt,n as u,h as ut,b9 as ht,ba as ft,j as t,e as $e,L as U,bb as pt,X as gt,bc as bt,bd as jt,be as yt,aS as vt,bf as wt,bg as Nt,bh as kt,bi as St,v as Te,bj as Ct,bk as Mt}from"./index-BIvz5Jcw.js";import{I as Re,c as _t,S as Ee,E as It}from"./ui-YqULwUTN.js";import{S as Z}from"./settings-2-DI3dKtSP.js";import{S as $t}from"./search-DB5lV4of.js";import{P as Tt}from"./package-D-ZQrAsI.js";import{I as Rt}from"./image-BqfhCYxr.js";import{Z as Et}from"./zap-DQxF-JwJ.js";import{S as Lt}from"./send-CiGD-0RS.js";import{P as Le}from"./plus-C6QmxIVH.js";import{T as Ue}from"./trash-2-DQAdkDas.js";/**
import{c as We,r as n,aW as mt,o as xt,n as u,h as ut,ba as ht,bb as ft,j as t,e as $e,L as U,bc as pt,X as gt,bd as bt,be as jt,bf as yt,aT as vt,bg as wt,bh as Nt,bi as kt,bj as St,v as Te,bk as Ct,bl as Mt}from"./index-BZnqBmwp.js";import{I as Re,c as _t,S as Ee,E as It}from"./ui-B9Jzqjf7.js";import{S as Z}from"./settings-2-CRN1TI2k.js";import{S as $t}from"./search-FaxHcuoK.js";import{P as Tt}from"./package-CDIx-vGO.js";import{I as Rt}from"./image-BE6TxU00.js";import{Z as Et}from"./zap-BWofDPZm.js";import{S as Lt}from"./send-BjFPcqyQ.js";import{P as Le}from"./plus-BljRK6L8.js";import{T as Ue}from"./trash-2-CmT2n80I.js";/**
* @license lucide-react v0.562.0 - ISC
*
* This source code is licensed under the ISC license.
@@ -8,5 +8,5 @@ import{c as We,r as n,aV as mt,o as xt,n as u,h as ut,b9 as ht,ba as ft,j as t,e
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const Ft=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M8 14s1.5 2 4 2 4-2 4-2",key:"1y1vjs"}],["line",{x1:"9",x2:"9.01",y1:"9",y2:"9",key:"yxxnd0"}],["line",{x1:"15",x2:"15.01",y1:"9",y2:"9",key:"1p4y9e"}]],Pt=We("smile",Ft),At={微笑:"🙂",呲牙:"😁",咧嘴:"😁",大笑:"😄",笑哭:"😂",憨笑:"😊",微尬:"😅",尴尬:"😅",流汗:"😓",冷汗:"😰",流泪:"😭",大哭:"😭",快哭了:"😭",委屈:"🥺",可怜:"🥺",难过:"😢",失落:"😞",衰:"😞",捂脸:"🤦",掩面:"🤦",偷笑:"🤭",坏笑:"😏",阴险:"😈",淘气:"😜",调皮:"😜",吐舌:"😜",色色:"😍",色:"😍",爱慕:"😍",发呆:"😳",害羞:"😊",脸红:"😊",闭嘴:"🤐",睡觉:"😴",睡:"😴",困:"😪",打哈欠:"🥱",哈欠:"🥱",惊讶:"😲",吃惊:"😲",惊恐:"😱",吓:"😱",发怒:"😡",生气:"😡",怒:"😡",抓狂:"😫",疯狂:"😫",疑问:"❓",疑惑:"🤔",想想:"🤔",晕:"😵",晕倒:"😵",骷髅:"💀",敲打:"🔨",再见:"👋",拜拜:"👋",擦汗:"😅",抠鼻:"👃",鄙视:"🙄",白眼:"🙄",傲慢:"😏",得意:"😎",酷:"😎",饥饿:"🤤",馋嘴:"🤤",吐:"🤮",呕吐:"🤮",奋斗:"💪",加油:"💪",鼓掌:"👏",喝彩:"👏",调停:"🙏",抱拳:"🙏",作揖:"🙏",祈祷:"🙏",感谢:"🙏",亲亲:"😘",亲吻:"😘",飞吻:"😘",拥抱:"🤗",抱抱:"🤗",强:"👍",赞:"👍",点赞:"👍",弱:"👎",差评:"👎",握手:"🤝",胜利:"✌️",OK:"👌",剪刀:"✌️",手枪:"🔫",计算:"🧮",卡住:"😵",爱心:"❤️",红心:"❤️",心碎:"💔",玫瑰:"🌹",花朵:"🌸",凋谢:"🥀",樱花:"🌸",太阳:"☀️",月亮:"🌙",星星:"⭐",闪电:"⚡",彩虹:"🌈",咖啡:"☕",蛋糕:"🎂",生日快乐:"🎂",啤酒:"🍺",干杯:"🍻",西瓜:"🍉",苹果:"🍎",礼物:"🎁",红包:"🧧",恭喜发财:"🧧",灯笼:"🏮",爆竹:"🧨",庆祝:"🎉",撒花:"🎉",烟花:"🎆",足球:"⚽",篮球:"🏀",排球:"🏐",乒乓:"🏓",网球:"🎾",炸弹:"💣",刀:"🔪",猪头:"🐷",狗:"🐶",猫:"🐱",熊:"🐻",兔:"🐰",鸡:"🐔",公鸡:"🐔",蚂蚁:"🐜",蜗牛:"🐌",瓢虫:"🐞",蝴蝶:"🦋",蛇:"🐍",恐龙:"🦖",鲨鱼:"🦈"};function Pe(r){return r.replace(/\[([^\[\]]{1,8})\]/g,(o,d)=>At[d]??o)}const Dt=1e4,Ot=1e4,Ke="xianyu-message-read-watermarks-v2",zt=500,Ae=9,Wt=10*1024*1024,De=(r,o)=>`${r}\0${o}`,Kt=()=>{if(typeof window>"u")return{};try{const r=JSON.parse(window.localStorage.getItem(Ke)||"{}");return!r||typeof r!="object"||Array.isArray(r)?{}:Object.fromEntries(Object.entries(r).filter(([,o])=>{if(!o||typeof o!="object"||Array.isArray(o))return!1;const d=o;return Number.isFinite(d.lastMessageTime)&&typeof d.lastMessageSummary=="string"&&Number.isFinite(d.unreadCount)}))}catch{return{}}},Bt=r=>{if(!(typeof window>"u"))try{const o=Object.entries(r).sort(([,d],[,g])=>g.lastMessageTime-d.lastMessageTime).slice(0,zt);window.localStorage.setItem(Ke,JSON.stringify(Object.fromEntries(o)))}catch{}},qt=(r,o)=>{if(!r)return!1;const d=Number(o.lastMessageTime)||0,g=String(o.lastMessageSummary||""),k=Number(o.unreadCount)||0;return d<r.lastMessageTime||d===r.lastMessageTime&&g===r.lastMessageSummary&&k<=r.unreadCount},F=r=>r?r.startsWith("//")?`https:${r}`:r:"",Oe=r=>{if(!r)return"";const o=r<1e12?r*1e3:r,d=new Date(o);if(Number.isNaN(d.getTime()))return"";const g=new Date;return d.toDateString()===g.toDateString()?d.toLocaleTimeString("zh-CN",{hour:"2-digit",minute:"2-digit"}):d.toLocaleDateString("zh-CN",{month:"2-digit",day:"2-digit"})},Vt=r=>{if(!r)return"-";const o=new Date(r.includes("T")?r:`${r.replace(" ","T")}Z`);return Number.isNaN(o.getTime())?r:o.toLocaleString("zh-CN",{month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"})},Y=r=>(r==null?void 0:r.displayName)||(r==null?void 0:r.accountId)||"未选择账号",ze=["#8c7900","#0f704b","#2a5f92","#945800","#6b5a8a","#b45309","#3f7a5c","#7c4d5e"],Gt=r=>{let o=0;for(let d=0;d<r.length;d+=1)o=o*31+r.charCodeAt(d)|0;return ze[Math.abs(o)%ze.length]},Ht={skip_reply:"跳过自动回复",skip_notify:"跳过外部通知"},ls=({isActive:r=!0})=>{const[o,d]=n.useState("messages"),[g,k]=n.useState("list"),[P,Be]=n.useState([]),[ee,qe]=n.useState([]),[te,Ve]=n.useState([]),[x,se]=n.useState(""),[S,A]=n.useState([]),[Ge,He]=n.useState(new Set),[j,D]=n.useState(""),[C,O]=n.useState([]),[z,W]=n.useState(""),[Qe,ae]=n.useState(!1),[Xe]=n.useState(()=>`conversation-filter-${Date.now()}-${Math.random().toString(36).slice(2)}`),[Je,re]=n.useState(!0),[K,ne]=n.useState(!1),[ie,le]=n.useState(!1),[B,q]=n.useState(""),[oe,ce]=n.useState([]),[de,V]=n.useState(!1),[G,me]=n.useState(!1),[b,H]=n.useState([]),xe=n.useRef(null),Q=n.useRef(null),ue=n.useRef(null),I=n.useRef(!1),$=n.useRef(""),T=n.useRef(Kt()),he=n.useRef(b);he.current=b,n.useEffect(()=>()=>{he.current.forEach(e=>URL.revokeObjectURL(e.url))},[]);const[y,Ze]=n.useState([]),[fe,pe]=n.useState(!0),[ge,Ye]=n.useState(""),[be,et]=n.useState(""),[X,je]=n.useState(""),[ye,tt]=n.useState("skipLine truncated
系统通知`,className:"ios-input min-h-20 resize-y rounded-md px-3 py-2.5 text-sm"}),t.jsxs("button",{type:"button",onClick:()=>void lt(),disabled:Ne,className:"ios-btn-primary flex min-h-11 items-center justify-center gap-2 rounded-md px-4 py-2.5 text-sm disabled:opacity-50",children:[Ne?t.jsx(U,{className:"h-4 w-4 animate-spin"}):t.jsx(Le,{className:"h-4 w-4"}),"批量添加"]})]})]}),t.jsxs("section",{className:"section-panel",children:[t.jsx(Ee,{title:"现有规则",description:`当前筛选共 ${y.length} 条`,icon:Z}),t.jsxs("div",{className:"toolbar rounded-none border-x-0 border-t-0 shadow-none",children:[t.jsxs("div",{className:"toolbar__group",children:[t.jsxs("select",{value:ge,onChange:e=>Ye(e.target.value),className:"ios-input rounded-md px-3 py-2.5 text-sm sm:min-w-52",children:[t.jsx("option",{value:"",children:"全部账号"}),ee.map(e=>t.jsx("option",{value:e.id,children:e.nickname||e.remark||e.id},e.id))]}),t.jsxs("select",{value:be,onChange:e=>et(e.target.value),className:"ios-input rounded-md px-3 py-2.5 text-sm sm:min-w-44",children:[t.jsx("option",{value:"",children:"全部用途"}),t.jsx("option",{value:"skip_reply",children:"跳过自动回复"}),t.jsx("option",{value:"skip_notify",children:"跳过外部通知"})]}),t.jsxs("button",{type:"button",onClick:()=>void N(),className:"ios-btn-secondary flex items-center justify-center gap-2 rounded-md px-4 py-2.5 text-sm",children:[t.jsx($e,{className:`h-4 w-4 ${fe?"animate-spin":""}`}),"查询"]})]}),w.length>0&&t.jsxs("button",{type:"button",onClick:()=>void ct(),className:"ios-btn-danger flex items-center justify-center gap-2 rounded-md px-4 py-2.5 text-sm",children:[t.jsx(Ue,{className:"h-4 w-4"}),"删除所选"]})]}),t.jsxs("div",{className:"divide-y divide-[#eeeeee] px-4",children:[y.length>0&&t.jsxs("label",{className:"flex items-center gap-3 py-3 text-xs font-bold text-[var(--text-muted)]",children:[t.jsx("input",{type:"checkbox",checked:at,onChange:e=>R(e.target.checked?y.map(s=>s.id):[]),className:"h-4 w-4 accent-[#f5c400]"}),"全选当前列表"]}),y.map(e=>t.jsxs("div",{className:"grid gap-3 py-4 sm:grid-cols-[24px_52px_180px_minmax(0,1fr)_44px] sm:items-center",children:[t.jsx("input",{type:"checkbox",checked:w.includes(e.id),onChange:s=>R(a=>s.target.checked?[...a,e.id]:a.filter(i=>i!==e.id)),className:"h-4 w-4 accent-[#f5c400]"}),t.jsx("button",{type:"button",role:"switch","aria-checked":e.enabled,onClick:()=>void bt(e.id).then(N),title:e.enabled?"停用规则":"启用规则",className:`relative h-6 w-11 rounded-full transition-colors ${e.enabled?"bg-[#f5c800]":"bg-gray-300"}`,children:t.jsx("span",{className:`absolute left-1 top-1 h-4 w-4 rounded-full bg-white transition-transform ${e.enabled?"translate-x-5":""}`})}),t.jsxs("div",{children:[t.jsx("p",{className:"break-all text-sm font-bold text-[var(--text)]",children:e.cookie_id}),t.jsx("p",{className:"mt-1 text-xs text-[var(--text-muted)]",children:Ht[e.filter_type]})]}),t.jsxs("div",{className:"min-w-0",children:[t.jsx("p",{className:"break-words text-sm font-medium text-[var(--text)]",children:e.keyword}),t.jsx("p",{className:"mt-1 text-xs text-[var(--text-soft)]",children:Vt(e.updated_at||e.created_at)})]}),t.jsx("button",{type:"button",onClick:()=>void ot(e),title:"删除规则",className:"flex h-9 w-9 items-center justify-center rounded-md bg-red-50 text-red-600 hover:bg-red-100",children:t.jsx(Ue,{className:"h-4 w-4"})})]},e.id)),!fe&&y.length===0&&t.jsx(It,{compact:!0,title:"暂无消息过滤规则",description:"添加规则后可跳过指定消息的自动回复或外部通知。",icon:Z})]})]})]})})};export{ls as default};
*/const Ft=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M8 14s1.5 2 4 2 4-2 4-2",key:"1y1vjs"}],["line",{x1:"9",x2:"9.01",y1:"9",y2:"9",key:"yxxnd0"}],["line",{x1:"15",x2:"15.01",y1:"9",y2:"9",key:"1p4y9e"}]],Pt=We("smile",Ft),At={微笑:"🙂",呲牙:"😁",咧嘴:"😁",大笑:"😄",笑哭:"😂",憨笑:"😊",微尬:"😅",尴尬:"😅",流汗:"😓",冷汗:"😰",流泪:"😭",大哭:"😭",快哭了:"😭",委屈:"🥺",可怜:"🥺",难过:"😢",失落:"😞",衰:"😞",捂脸:"🤦",掩面:"🤦",偷笑:"🤭",坏笑:"😏",阴险:"😈",淘气:"😜",调皮:"😜",吐舌:"😜",色色:"😍",色:"😍",爱慕:"😍",发呆:"😳",害羞:"😊",脸红:"😊",闭嘴:"🤐",睡觉:"😴",睡:"😴",困:"😪",打哈欠:"🥱",哈欠:"🥱",惊讶:"😲",吃惊:"😲",惊恐:"😱",吓:"😱",发怒:"😡",生气:"😡",怒:"😡",抓狂:"😫",疯狂:"😫",疑问:"❓",疑惑:"🤔",想想:"🤔",晕:"😵",晕倒:"😵",骷髅:"💀",敲打:"🔨",再见:"👋",拜拜:"👋",擦汗:"😅",抠鼻:"👃",鄙视:"🙄",白眼:"🙄",傲慢:"😏",得意:"😎",酷:"😎",饥饿:"🤤",馋嘴:"🤤",吐:"🤮",呕吐:"🤮",奋斗:"💪",加油:"💪",鼓掌:"👏",喝彩:"👏",调停:"🙏",抱拳:"🙏",作揖:"🙏",祈祷:"🙏",感谢:"🙏",亲亲:"😘",亲吻:"😘",飞吻:"😘",拥抱:"🤗",抱抱:"🤗",强:"👍",赞:"👍",点赞:"👍",弱:"👎",差评:"👎",握手:"🤝",胜利:"✌️",OK:"👌",剪刀:"✌️",手枪:"🔫",计算:"🧮",卡住:"😵",爱心:"❤️",红心:"❤️",心碎:"💔",玫瑰:"🌹",花朵:"🌸",凋谢:"🥀",樱花:"🌸",太阳:"☀️",月亮:"🌙",星星:"⭐",闪电:"⚡",彩虹:"🌈",咖啡:"☕",蛋糕:"🎂",生日快乐:"🎂",啤酒:"🍺",干杯:"🍻",西瓜:"🍉",苹果:"🍎",礼物:"🎁",红包:"🧧",恭喜发财:"🧧",灯笼:"🏮",爆竹:"🧨",庆祝:"🎉",撒花:"🎉",烟花:"🎆",足球:"⚽",篮球:"🏀",排球:"🏐",乒乓:"🏓",网球:"🎾",炸弹:"💣",刀:"🔪",猪头:"🐷",狗:"🐶",猫:"🐱",熊:"🐻",兔:"🐰",鸡:"🐔",公鸡:"🐔",蚂蚁:"🐜",蜗牛:"🐌",瓢虫:"🐞",蝴蝶:"🦋",蛇:"🐍",恐龙:"🦖",鲨鱼:"🦈"};function Pe(r){return r.replace(/\[([^\[\]]{1,8})\]/g,(o,d)=>At[d]??o)}const Dt=1e4,Ot=1e4,Ke="xianyu-message-read-watermarks-v2",zt=500,Ae=9,Wt=10*1024*1024,De=(r,o)=>`${r}\0${o}`,Kt=()=>{if(typeof window>"u")return{};try{const r=JSON.parse(window.localStorage.getItem(Ke)||"{}");return!r||typeof r!="object"||Array.isArray(r)?{}:Object.fromEntries(Object.entries(r).filter(([,o])=>{if(!o||typeof o!="object"||Array.isArray(o))return!1;const d=o;return Number.isFinite(d.lastMessageTime)&&typeof d.lastMessageSummary=="string"&&Number.isFinite(d.unreadCount)}))}catch{return{}}},Bt=r=>{if(!(typeof window>"u"))try{const o=Object.entries(r).sort(([,d],[,g])=>g.lastMessageTime-d.lastMessageTime).slice(0,zt);window.localStorage.setItem(Ke,JSON.stringify(Object.fromEntries(o)))}catch{}},qt=(r,o)=>{if(!r)return!1;const d=Number(o.lastMessageTime)||0,g=String(o.lastMessageSummary||""),k=Number(o.unreadCount)||0;return d<r.lastMessageTime||d===r.lastMessageTime&&g===r.lastMessageSummary&&k<=r.unreadCount},F=r=>r?r.startsWith("//")?`https:${r}`:r:"",Oe=r=>{if(!r)return"";const o=r<1e12?r*1e3:r,d=new Date(o);if(Number.isNaN(d.getTime()))return"";const g=new Date;return d.toDateString()===g.toDateString()?d.toLocaleTimeString("zh-CN",{hour:"2-digit",minute:"2-digit"}):d.toLocaleDateString("zh-CN",{month:"2-digit",day:"2-digit"})},Gt=r=>{if(!r)return"-";const o=new Date(r.includes("T")?r:`${r.replace(" ","T")}Z`);return Number.isNaN(o.getTime())?r:o.toLocaleString("zh-CN",{month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"})},Y=r=>(r==null?void 0:r.displayName)||(r==null?void 0:r.accountId)||"未选择账号",ze=["#8c7900","#0f704b","#2a5f92","#945800","#6b5a8a","#b45309","#3f7a5c","#7c4d5e"],Ht=r=>{let o=0;for(let d=0;d<r.length;d+=1)o=o*31+r.charCodeAt(d)|0;return ze[Math.abs(o)%ze.length]},Qt={skip_reply:"跳过自动回复",skip_notify:"跳过外部通知"},ls=({isActive:r=!0})=>{const[o,d]=n.useState("messages"),[g,k]=n.useState("list"),[P,Be]=n.useState([]),[ee,qe]=n.useState([]),[te,Ge]=n.useState([]),[x,se]=n.useState(""),[S,A]=n.useState([]),[He,Qe]=n.useState(new Set),[j,D]=n.useState(""),[C,O]=n.useState([]),[z,W]=n.useState(""),[Ve,ae]=n.useState(!1),[Xe]=n.useState(()=>`conversation-filter-${Date.now()}-${Math.random().toString(36).slice(2)}`),[Je,re]=n.useState(!0),[K,ne]=n.useState(!1),[ie,le]=n.useState(!1),[B,q]=n.useState(""),[oe,ce]=n.useState([]),[de,G]=n.useState(!1),[H,me]=n.useState(!1),[b,Q]=n.useState([]),xe=n.useRef(null),V=n.useRef(null),ue=n.useRef(null),I=n.useRef(!1),$=n.useRef(""),T=n.useRef(Kt()),he=n.useRef(b);he.current=b,n.useEffect(()=>()=>{he.current.forEach(e=>URL.revokeObjectURL(e.url))},[]);const[y,Ze]=n.useState([]),[fe,pe]=n.useState(!0),[ge,Ye]=n.useState(""),[be,et]=n.useState(""),[X,je]=n.useState(""),[ye,tt]=n.useState("skipLine truncated
系统通知`,className:"ios-input min-h-20 resize-y rounded-md px-3 py-2.5 text-sm"}),t.jsxs("button",{type:"button",onClick:()=>void lt(),disabled:Ne,className:"ios-btn-primary flex min-h-11 items-center justify-center gap-2 rounded-md px-4 py-2.5 text-sm disabled:opacity-50",children:[Ne?t.jsx(U,{className:"h-4 w-4 animate-spin"}):t.jsx(Le,{className:"h-4 w-4"}),"批量添加"]})]})]}),t.jsxs("section",{className:"section-panel",children:[t.jsx(Ee,{title:"现有规则",description:`当前筛选共 ${y.length} 条`,icon:Z}),t.jsxs("div",{className:"toolbar rounded-none border-x-0 border-t-0 shadow-none",children:[t.jsxs("div",{className:"toolbar__group",children:[t.jsxs("select",{value:ge,onChange:e=>Ye(e.target.value),className:"ios-input rounded-md px-3 py-2.5 text-sm sm:min-w-52",children:[t.jsx("option",{value:"",children:"全部账号"}),ee.map(e=>t.jsx("option",{value:e.id,children:e.nickname||e.remark||e.id},e.id))]}),t.jsxs("select",{value:be,onChange:e=>et(e.target.value),className:"ios-input rounded-md px-3 py-2.5 text-sm sm:min-w-44",children:[t.jsx("option",{value:"",children:"全部用途"}),t.jsx("option",{value:"skip_reply",children:"跳过自动回复"}),t.jsx("option",{value:"skip_notify",children:"跳过外部通知"})]}),t.jsxs("button",{type:"button",onClick:()=>void N(),className:"ios-btn-secondary flex items-center justify-center gap-2 rounded-md px-4 py-2.5 text-sm",children:[t.jsx($e,{className:`h-4 w-4 ${fe?"animate-spin":""}`}),"查询"]})]}),w.length>0&&t.jsxs("button",{type:"button",onClick:()=>void ct(),className:"ios-btn-danger flex items-center justify-center gap-2 rounded-md px-4 py-2.5 text-sm",children:[t.jsx(Ue,{className:"h-4 w-4"}),"删除所选"]})]}),t.jsxs("div",{className:"divide-y divide-[#eeeeee] px-4",children:[y.length>0&&t.jsxs("label",{className:"flex items-center gap-3 py-3 text-xs font-bold text-[var(--text-muted)]",children:[t.jsx("input",{type:"checkbox",checked:at,onChange:e=>R(e.target.checked?y.map(s=>s.id):[]),className:"h-4 w-4 accent-[#f5c400]"}),"全选当前列表"]}),y.map(e=>t.jsxs("div",{className:"grid gap-3 py-4 sm:grid-cols-[24px_52px_180px_minmax(0,1fr)_44px] sm:items-center",children:[t.jsx("input",{type:"checkbox",checked:w.includes(e.id),onChange:s=>R(a=>s.target.checked?[...a,e.id]:a.filter(i=>i!==e.id)),className:"h-4 w-4 accent-[#f5c400]"}),t.jsx("button",{type:"button",role:"switch","aria-checked":e.enabled,onClick:()=>void bt(e.id).then(N),title:e.enabled?"停用规则":"启用规则",className:`relative h-6 w-11 rounded-full transition-colors ${e.enabled?"bg-[#f5c800]":"bg-gray-300"}`,children:t.jsx("span",{className:`absolute left-1 top-1 h-4 w-4 rounded-full bg-white transition-transform ${e.enabled?"translate-x-5":""}`})}),t.jsxs("div",{children:[t.jsx("p",{className:"break-all text-sm font-bold text-[var(--text)]",children:e.cookie_id}),t.jsx("p",{className:"mt-1 text-xs text-[var(--text-muted)]",children:Qt[e.filter_type]})]}),t.jsxs("div",{className:"min-w-0",children:[t.jsx("p",{className:"break-words text-sm font-medium text-[var(--text)]",children:e.keyword}),t.jsx("p",{className:"mt-1 text-xs text-[var(--text-soft)]",children:Gt(e.updated_at||e.created_at)})]}),t.jsx("button",{type:"button",onClick:()=>void ot(e),title:"删除规则",className:"flex h-9 w-9 items-center justify-center rounded-md bg-red-50 text-red-600 hover:bg-red-100",children:t.jsx(Ue,{className:"h-4 w-4"})})]},e.id)),!fe&&y.length===0&&t.jsx(It,{compact:!0,title:"暂无消息过滤规则",description:"添加规则后可跳过指定消息的自动回复或外部通知。",icon:Z})]})]})]})})};export{ls as default};
+1
View File
@@ -0,0 +1 @@
import{r as l,j as t,bc as E,e as ee,L as te,aE as ot,C as ct,X as Se,o as dt,bm as mt,bn as xt,bo as pt,n as o,bp as ut,bq as ht,br as _e,v as se,bs as yt,bt as Re,bu as bt,bv as gt,bw as ft,bx as jt,by as Nt}from"./index-BZnqBmwp.js";import{a as vt,b as wt,S as $,E as L}from"./ui-B9Jzqjf7.js";import{L as ae}from"./link-2-CTuWzTfU.js";import{S as le}from"./shield-alert-rM_NVGQr.js";import{A as ne}from"./activity-D09genEZ.js";import{P as Ee}from"./plus-BljRK6L8.js";import{P as $e}from"./pen-line-CmEoWNKp.js";import{T as ie}from"./trash-2-CmT2n80I.js";import{S as kt}from"./send-BjFPcqyQ.js";import{C as Ct,a as St}from"./chevron-right-pxFcnXJt.js";import{S as Le}from"./save-Dxf2dvgb.js";import{C as _t}from"./check-C6LyX_Nv.js";const y={dingtalk:{label:"钉钉",fields:[{key:"webhook_url",label:"Webhook 地址",placeholder:"https://oapi.dingtalk.com/robot/send?..."},{key:"secret",label:"加签密钥",type:"password",optional:!0}],defaults:{}},feishu:{label:"飞书",fields:[{key:"webhook_url",label:"Webhook 地址",placeholder:"https://open.feishu.cn/open-apis/bot/v2/hook/..."},{key:"secret",label:"签名密钥",type:"password",optional:!0}],defaults:{}},bark:{label:"Bark",fields:[{key:"device_key",label:"Device Key",type:"password"},{key:"server_url",label:"服务器地址",placeholder:"https://api.day.app",optional:!0}],defaults:{server_url:"https://api.day.app"}},email:{label:"邮件",fields:[{key:"smtp_server",label:"SMTP 服务器",placeholder:"留空则使用「系统设置 → 邮件服务」",optional:!0},{key:"smtp_port",label:"SMTP 端口",type:"number",placeholder:"留空则使用系统设置(如 465)",optional:!0},{key:"email_user",label:"发件邮箱",placeholder:"留空则使用系统设置的发件邮箱",optional:!0},{key:"email_password",label:"邮箱密码或授权码",type:"password",placeholder:"留空则使用系统设置的授权码",optional:!0},{key:"recipient_email",label:"接收邮箱",placeholder:"必填,通知发到这个邮箱"}],defaults:{}},webhook:{label:"Webhook",fields:[{key:"webhook_url",label:"Webhook 地址"},{key:"http_method",label:"请求方法",type:"select",options:["POST","PUT"]},{key:"headers",label:"请求头 JSON",type:"textarea",placeholder:'{"Authorization":"Bearer ..."}',optional:!0}],defaults:{http_method:"POST",headers:"{}"}},wechat:{label:"企业微信",fields:[{key:"webhook_url",label:"机器人 Webhook 地址"}],defaults:{}},telegram:{label:"Telegram",fields:[{key:"bot_token",label:"Bot Token",type:"password"},{key:"chat_id",label:"Chat ID"}],defaults:{}}},re=20,Rt=i=>{var k,x;const r=(x=(k=i==null?void 0:i.response)==null?void 0:k.data)==null?void 0:x.detail;if(r&&typeof r=="object"&&"message"in r){const b=r.message;if(typeof b=="string"&&b.trim())return b.trim()}return typeof r=="string"&&r.trim()?r.trim():i instanceof Error&&i.message?i.message:"测试发送失败,请稍后重试"},oe=i=>i.nickname||i.remark||i.id,T=i=>{if(!i)return"-";const r=new Date(i.includes("T")?i:`${i.replace(" ","T")}Z`);return Number.isNaN(r.getTime())?i:r.toLocaleString("zh-CN")},Wt=({isAdmin:i})=>{const[r,k]=l.useState("channels"),[x,b]=l.useState([]),[A,ce]=l.useState([]),[de,D]=l.useState([]),[Te,g]=l.useState({}),[f,Ae]=l.useState([]),[me,De]=l.useState([]),[C,xe]=l.useState(!0),[Pe,j]=l.useState(!1),[N,pe]=l.useState(null),[P,B]=l.useState("dingtalk"),[O,I]=l.useState(""),[d,p]=l.useState({}),[ue,he]=l.useState(!1),[Be,u]=l.useState(!1),[v,ye]=l.useState(null),[M,q]=l.useState(""),[W,G]=l.useState(""),[z,F]=l.useState(""),[H,h]=l.useState([]),[be,S]=l.useState(!1),[ge,Oe]=l.useState([]),[fe,Ie]=l.useState(0),[U,Me]=l.useState(""),[Z,qe]=l.useState(""),[w,_]=l.useState(0),[J,je]=l.useState(!1),[Ne,We]=l.useState([]),[ve,Ge]=l.useState(""),[R,we]=l.useState(""),[K,ke]=l.useState(!1),m=async()=>{xe(!0);try{const[e,s,a,n]=await Promise.all([dt(),mt(),xt(),pt()]);b(e),ce(s.data),D(a.data),g(c=>{const rt=new Set(a.data.map(Y=>String(Y.id)));return Object.fromEntries(Object.entries(c).filter(([Y])=>rt.has(Y)))}),Ae(n.events),De(n.priorities)}catch(e){o(`加载通知配置失败:${e.message}`)}finally{xe(!1)}};l.useEffect(()=>{m()},[]);const ze=()=>{const e="dingtalk";pe(null),B(e),I(""),p({...y[e].defaults}),j(!0)},Fe=e=>{pe(e),B(e.type),I(e.name),p({...y[e.type].defaults,...e.config}),j(!0)},He=e=>{B(e),p({...y[e].defaults})},Ue=async()=>{he(!0);try{N?await _e(N.id,{name:O,config:d,enabled:N.enabled}):await jt({name:O,type:P,config:d}),j(!1),await m()}catch(e){o(`保存通知渠道失败:${e.message}`)}finally{he(!1)}},Ze=async e=>{try{await _e(e.id,{enabled:!e.enabled}),ce(s=>s.map(a=>a.id===e.id?{...a,enabled:!a.enabled}:a)),e.enabled?D(s=>s.filter(a=>a.channel_id!==Number(e.id))):await m()}catch(s){o(`更新渠道状态失败:${s.message}`)}},Je=async e=>{if(await se(`确认删除通知渠道“${e.name}”?相关账号绑定也会被删除。`))try{await yt(e.id),await m()}catch(s){o(`删除通知渠道失败:${s.message}`)}},Ke=e=>{var s;return((s=f.find(a=Line truncated
-1
View File
@@ -1 +0,0 @@
import{r as l,j as t,bb as $,e as ee,L as te,aD as ot,C as ct,X as Se,o as dt,bl as mt,bm as xt,bn as pt,n as o,bo as ut,bp as ht,bq as _e,v as se,br as yt,bs as Re,bt,bu as gt,bv as ft,bw as jt,bx as Nt}from"./index-BIvz5Jcw.js";import{a as vt,b as wt,S as E,E as L}from"./ui-YqULwUTN.js";import{L as ae}from"./link-2-BLLx-6jV.js";import{S as le}from"./shield-alert-BLVh_PbV.js";import{A as ne}from"./activity-WV3qb2N7.js";import{P as $e}from"./plus-C6QmxIVH.js";import{P as Ee}from"./pen-line-cbtfAAum.js";import{T as ie}from"./trash-2-DQAdkDas.js";import{S as kt}from"./send-CiGD-0RS.js";import{C as Ct,a as St}from"./chevron-right-D1rbL3LX.js";import{S as Le}from"./save-Bwc_QnHd.js";import{C as _t}from"./check-FJ-UzmYk.js";const y={dingtalk:{label:"钉钉",fields:[{key:"webhook_url",label:"Webhook 地址",placeholder:"https://oapi.dingtalk.com/robot/send?..."},{key:"secret",label:"加签密钥",type:"password",optional:!0}],defaults:{}},feishu:{label:"飞书",fields:[{key:"webhook_url",label:"Webhook 地址",placeholder:"https://open.feishu.cn/open-apis/bot/v2/hook/..."},{key:"secret",label:"签名密钥",type:"password",optional:!0}],defaults:{}},bark:{label:"Bark",fields:[{key:"device_key",label:"Device Key",type:"password"},{key:"server_url",label:"服务器地址",placeholder:"https://api.day.app",optional:!0}],defaults:{server_url:"https://api.day.app"}},email:{label:"邮件",fields:[{key:"smtp_server",label:"SMTP 服务器",placeholder:"留空则使用「系统设置 → 邮件服务」",optional:!0},{key:"smtp_port",label:"SMTP 端口",type:"number",placeholder:"留空则使用系统设置(如 465)",optional:!0},{key:"email_user",label:"发件邮箱",placeholder:"留空则使用系统设置的发件邮箱",optional:!0},{key:"email_password",label:"邮箱密码或授权码",type:"password",placeholder:"留空则使用系统设置的授权码",optional:!0},{key:"recipient_email",label:"接收邮箱",placeholder:"必填,通知发到这个邮箱"}],defaults:{}},webhook:{label:"Webhook",fields:[{key:"webhook_url",label:"Webhook 地址"},{key:"http_method",label:"请求方法",type:"select",options:["POST","PUT"]},{key:"headers",label:"请求头 JSON",type:"textarea",placeholder:'{"Authorization":"Bearer ..."}',optional:!0}],defaults:{http_method:"POST",headers:"{}"}},wechat:{label:"企业微信",fields:[{key:"webhook_url",label:"机器人 Webhook 地址"}],defaults:{}},telegram:{label:"Telegram",fields:[{key:"bot_token",label:"Bot Token",type:"password"},{key:"chat_id",label:"Chat ID"}],defaults:{}}},re=20,Rt=i=>{var k,x;const r=(x=(k=i==null?void 0:i.response)==null?void 0:k.data)==null?void 0:x.detail;if(r&&typeof r=="object"&&"message"in r){const b=r.message;if(typeof b=="string"&&b.trim())return b.trim()}return typeof r=="string"&&r.trim()?r.trim():i instanceof Error&&i.message?i.message:"测试发送失败,请稍后重试"},oe=i=>i.nickname||i.remark||i.id,T=i=>{if(!i)return"-";const r=new Date(i.includes("T")?i:`${i.replace(" ","T")}Z`);return Number.isNaN(r.getTime())?i:r.toLocaleString("zh-CN")},Wt=({isAdmin:i})=>{const[r,k]=l.useState("channels"),[x,b]=l.useState([]),[A,ce]=l.useState([]),[de,D]=l.useState([]),[Te,g]=l.useState({}),[f,Ae]=l.useState([]),[me,De]=l.useState([]),[C,xe]=l.useState(!0),[Pe,j]=l.useState(!1),[N,pe]=l.useState(null),[P,B]=l.useState("dingtalk"),[O,I]=l.useState(""),[d,p]=l.useState({}),[ue,he]=l.useState(!1),[Be,u]=l.useState(!1),[v,ye]=l.useState(null),[M,q]=l.useState(""),[W,G]=l.useState(""),[z,F]=l.useState(""),[H,h]=l.useState([]),[be,S]=l.useState(!1),[ge,Oe]=l.useState([]),[fe,Ie]=l.useState(0),[U,Me]=l.useState(""),[Z,qe]=l.useState(""),[w,_]=l.useState(0),[J,je]=l.useState(!1),[Ne,We]=l.useState([]),[ve,Ge]=l.useState(""),[R,we]=l.useState(""),[K,ke]=l.useState(!1),m=async()=>{xe(!0);try{const[e,s,a,n]=await Promise.all([dt(),mt(),xt(),pt()]);b(e),ce(s.data),D(a.data),g(c=>{const rt=new Set(a.data.map(Y=>String(Y.id)));return Object.fromEntries(Object.entries(c).filter(([Y])=>rt.has(Y)))}),Ae(n.events),De(n.priorities)}catch(e){o(`加载通知配置失败:${e.message}`)}finally{xe(!1)}};l.useEffect(()=>{m()},[]);const ze=()=>{const e="dingtalk";pe(null),B(e),I(""),p({...y[e].defaults}),j(!0)},Fe=e=>{pe(e),B(e.type),I(e.name),p({...y[e.type].defaults,...e.config}),j(!0)},He=e=>{B(e),p({...y[e].defaults})},Ue=async()=>{he(!0);try{N?await _e(N.id,{name:O,config:d,enabled:N.enabled}):await jt({name:O,type:P,config:d}),j(!1),await m()}catch(e){o(`保存通知渠道失败:${e.message}`)}finally{he(!1)}},Ze=async e=>{try{await _e(e.id,{enabled:!e.enabled}),ce(s=>s.map(a=>a.id===e.id?{...a,enabled:!a.enabled}:a)),e.enabled?D(s=>s.filter(a=>a.channel_id!==Number(e.id))):await m()}catch(s){o(`更新渠道状态失败:${s.message}`)}},Je=async e=>{if(await se(`确认删除通知渠道“${e.name}”?相关账号绑定也会被删除。`))try{await yt(e.id),await m()}catch(s){o(`删除通知渠道失败:${s.message}`)}},Ke=e=>{var s;return((s=f.find(a=>a.id=Line truncated
@@ -1,4 +1,4 @@
import{c as Re,r as l,h as ys,N as js,j as e,e as $,O as fs,E as vs,P as Ns,b as N,X as _,o as _s,Q as ws,T as Me,V as ks,W as Ss,n,Y as Cs,v as Pe,Z as Os,_ as Es,$ as Ls,a0 as Is,a1 as Ms,a2 as Ps,a3 as Ds,a4 as Fs}from"./index-BIvz5Jcw.js";import{a as As,b as $s,E as Rs}from"./ui-YqULwUTN.js";import{P as qs}from"./plus-C6QmxIVH.js";import{T as De}from"./truck-tA7BGYeX.js";import{S as Ts}from"./search-DB5lV4of.js";import{P as Y}from"./package-check-CmnmaNHB.js";import{F as zs}from"./flower-2-B8e-r4X9.js";import{E as Vs}from"./eye-DT2WPUBY.js";import{S as Hs}from"./square-pen-BKEEv4kY.js";import{T as Js}from"./trash-2-DQAdkDas.js";import{C as Ws,a as Bs}from"./chevron-right-D1rbL3LX.js";import{S as Fe}from"./save-Bwc_QnHd.js";/**
import{c as Re,r as l,h as ys,O as js,j as e,e as $,P as fs,E as vs,Q as Ns,b as N,X as _,o as _s,T as ws,V as Me,W as ks,Y as Ss,n,Z as Cs,v as Pe,_ as Os,$ as Es,a0 as Ls,a1 as Is,a2 as Ms,a3 as Ps,a4 as Ds,a5 as Fs}from"./index-BZnqBmwp.js";import{a as As,b as $s,E as Rs}from"./ui-B9Jzqjf7.js";import{P as qs}from"./plus-BljRK6L8.js";import{T as De}from"./truck-3I9pdhz5.js";import{S as Ts}from"./search-FaxHcuoK.js";import{P as Y}from"./package-check-BKkFNxd0.js";import{F as zs}from"./flower-2-B1FJm-vw.js";import{E as Vs}from"./eye-BibUMjxU.js";import{S as Hs}from"./square-pen-Bmle-FRS.js";import{T as Js}from"./trash-2-CmT2n80I.js";import{C as Ws,a as Bs}from"./chevron-right-pxFcnXJt.js";import{S as Fe}from"./save-Dxf2dvgb.js";/**
* @license lucide-react v0.562.0 - ISC
*
* This source code is licensed under the ISC license.
@@ -1,4 +1,4 @@
import{c as A,r as n,bN as oe,bO as me,j as e,bP as q,e as M,X as Q,bQ as xe,aD as pe,bR as he,bS as ue,bT as be,bU as je,bV as ge,bW as ve}from"./index-BIvz5Jcw.js";import{P as U,a as ye,N as E,E as V}from"./ui-YqULwUTN.js";import{P as Ne}from"./plus-C6QmxIVH.js";import{P as _e}from"./play-D2zUiMa7.js";import{P as fe}from"./pen-line-cbtfAAum.js";import{T as we}from"./trash-2-DQAdkDas.js";import{S as X}from"./search-DB5lV4of.js";/**
import{c as A,r as n,bQ as oe,bR as me,j as e,bS as X,e as M,X as q,bT as xe,aE as pe,bU as he,bV as ue,bW as be,bX as je,bY as ge,bZ as ve}from"./index-BZnqBmwp.js";import{P as Q,a as ye,N as E,E as U}from"./ui-B9Jzqjf7.js";import{P as Ne}from"./plus-BljRK6L8.js";import{P as _e}from"./play-P9T6ppIo.js";import{P as fe}from"./pen-line-CmEoWNKp.js";import{T as we}from"./trash-2-CmT2n80I.js";import{S as V}from"./search-FaxHcuoK.js";/**
* @license lucide-react v0.562.0 - ISC
*
* This source code is licensed under the ISC license.
@@ -13,4 +13,4 @@ import{c as A,r as n,bN as oe,bO as me,j as e,bP as q,e as M,X as Q,bQ as xe,aD
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const Pe=[["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"}]],$e=A("history",Pe),Me=2500,x=t=>t==null?"—":`¥${Number(t).toLocaleString("zh-CN",{maximumFractionDigits:2})}`,I=()=>Math.floor(Date.now()/1e3),L=t=>{if(!t||t<=0)return"—";const i=Math.floor(t);return i<60?`${i} 秒前`:i<3600?`${Math.floor(i/60)} 分钟前`:i<86400?`${Math.floor(i/3600)} 小时前`:`${Math.floor(i/86400)} 天前`},Ee=t=>t==null||t<0?"已停用":t<60?`${Math.max(0,Math.round(t))} 秒后`:t<3600?`${Math.floor(t/60)} 分钟后`:`${Math.floor(t/3600)} 小时后`,k=t=>{const i=t.trim();if(i==="")return null;const h=Number(i);return Number.isFinite(h)&&h>=0?h:null},J={name:"",keyword:"",min_price:"",max_price:"",target_price:"",interval_minutes:"30",pages:"2",enabled:!0,cookie_id:"",min_seller_credit:"",min_seller_deals:"",ai_precise:!1},Re=t=>({name:t.name,keyword:t.keyword,min_price:t.min_price===null?"":String(t.min_price),max_price:t.max_price===null?"":String(t.max_price),target_price:t.target_price===null?"":String(t.target_price),interval_minutes:String(t.interval_minutes),pages:String(t.pages||2),enabled:t.enabled!==!1,cookie_id:t.cookie_id||"",min_seller_credit:t.min_seller_credit||"",min_seller_deals:t.min_seller_deals!=null?String(t.min_seller_deals):"",ai_precise:!!t.ai_precise}),Z=t=>{const i=t.keyword.trim();if(!i)return{input:null,error:"请填写搜索关键词"};const h=t.name.trim()||i,v=k(t.min_price),m=k(t.max_price);if(v!==null&&m!==null&&v>m)return{input:null,error:"最低价不能大于最高价"};const g=k(t.target_price);if(g!==null&&m!==null&&g>m)return{input:null,error:"目标价不能高于最高价"};const u=Number(t.interval_minutes);if(!Number.isFinite(u)||u<5)return{input:null,error:"检查间隔至少 5 分钟"};const c=Number(t.pages);return!Number.isFinite(c)||c<1||c>5?{input:null,error:"每轮页数取 1~5"}:{input:{name:h,keyword:i,min_price:v,max_price:m,target_price:g,interval_minutes:Math.round(u),pages:Math.round(c),enabled:t.enabled,cookie_id:t.cookie_id||null,min_seller_credit:t.min_seller_credit||null,min_seller_deals:k(t.min_seller_deals),ai_precise:t.ai_precise}}};function He(){const[t,i]=n.useState([]),[h,v]=n.useState(!0),[m,g]=n.useState(""),[u,c]=n.useState(null),[ee,F]=n.useState([]),[se,y]=n.useState(!1),[N,D]=n.useState(null),[l,d]=n.useState(J),[T,O]=n.useState(!1),[H,_]=n.useState(""),[C,B]=n.useState(!1),[o,f]=n.useState(null),[Y,b]=n.useState(""),[S,z]=n.useState(null),[G,P]=n.useState([]),[te,K]=n.useState(!1),w=n.useRef(new Set),p=n.useCallback(async()=>{try{const r=(await oe()).rules??[];i(r),g("");const a=new Set;for(const j of r)j.running&&a.add(j.id);const $=[...w.current].filter(j=>!a.has(j));w.current=a,$.length&&p()}catch(s){g(s instanceof Error?s.message:"加载失败")}finally{v(!1)}},[]);n.useEffect(()=>{p(),me().then(r=>F(r.cookies??[])).catch(()=>F([]));const s=setInterval(()=>void p(),Me);return()=>clearInterval(s)},[p]);const ae=()=>{D(null),d(J),f(null),b(""),_(""),y(!0)},re=s=>{D(s.id),d(Re(s)),f(null),b(""),_(""),y(!0)},le=async()=>{const{input:s,error:r}=Z(l);if(!s){b(r??"参数有误");return}B(!0),b(""),f(null);try{const a=await he({keyword:s.keyword,min_price:s.min_price,max_price:s.max_price,pages:s.pages,cookie_id:s.cookie_id,min_seller_credit:s.min_seller_credit,min_seller_deals:s.min_seller_deals,ai_precise:s.ai_precise});f(a),a.error?b(a.error):a.lowest||b("没搜到符合条件的商品,换个关键词或放宽价格区间试试")}catch(a){b(a instanceof Error?a.message:"试搜失败")}finally{B(!1)}},ne=async()=>{const{input:s,error:r}=Z(l);if(!s){_(r??"参数有误");return}O(!0),_("");try{N===null?await ue(s):await be(N,s),y(!1),c({type:"info",message:N===null?"规则已创建,可以立即检查一次":"规则已保存"}),await p()}catch(a){_(a instanceof Error?a.message:"保存失败")}finally{O(!1)}},ie=async s=>{w.current.add(s.id),c(null);try{const r=await je(s.id);if(!r.started)c({type:"info",message:r.message??"任务未启动"});else if(r.record){const a=r.record.lowest_price;a==null?c({type:"warning",message:`「${s.name}」没搜到可比价的商品(已记录一次空结果)`}):r.notified?c({type:"success",message:`已找到最低价 ${x(a)},通知已发送(${r.notify_reason||"命中"})`}):c({type:"info",message:`本次最低价 ${x(a)}(${r.notify_reason||"未触发通知"})`}),r.notify_error&&c({type:"error",message:`通知发送失败:${r.notify_error}`})}}catch(r){c({type:"error",message:r instanceof Error?r.message:"检查失败"})}finally{w.current.delete(s.id),await p()}},ce=async s=>{if(window.confirm(`删除监控规则「${s.name}」?检查历史会一并删除。`))try{await ge(s.id),c({type:"info",message:"规则已删除"}),await p()}catch(r){c({type:"error",message:r instanceof Error?r.message:"删除失败"})}},de=async s=>{z(s),K(!0),P([]);try{const r=await ve(s.id,50);P(r.records??[])}catchLine truncated
*/const $e=[["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"}]],Pe=A("history",$e),Me=2500,x=t=>t==null?"—":`¥${Number(t).toLocaleString("zh-CN",{maximumFractionDigits:2})}`,I=()=>Math.floor(Date.now()/1e3),L=t=>{if(!t||t<=0)return"—";const i=Math.floor(t);return i<60?`${i} 秒前`:i<3600?`${Math.floor(i/60)} 分钟前`:i<86400?`${Math.floor(i/3600)} 小时前`:`${Math.floor(i/86400)} 天前`},Ee=t=>t==null||t<0?"已停用":t<60?`${Math.max(0,Math.round(t))} 秒后`:t<3600?`${Math.floor(t/60)} 分钟后`:`${Math.floor(t/3600)} 小时后`,k=t=>{const i=t.trim();if(i==="")return null;const h=Number(i);return Number.isFinite(h)&&h>=0?h:null},Z={name:"",keyword:"",min_price:"",max_price:"",target_price:"",interval_minutes:"30",pages:"2",enabled:!0,cookie_id:"",min_seller_credit:"",min_seller_deals:"",ai_precise:!1},Re=t=>({name:t.name,keyword:t.keyword,min_price:t.min_price===null?"":String(t.min_price),max_price:t.max_price===null?"":String(t.max_price),target_price:t.target_price===null?"":String(t.target_price),interval_minutes:String(t.interval_minutes),pages:String(t.pages||2),enabled:t.enabled!==!1,cookie_id:t.cookie_id||"",min_seller_credit:t.min_seller_credit||"",min_seller_deals:t.min_seller_deals!=null?String(t.min_seller_deals):"",ai_precise:!!t.ai_precise}),J=t=>{const i=t.keyword.trim();if(!i)return{input:null,error:"请填写搜索关键词"};const h=t.name.trim()||i,v=k(t.min_price),m=k(t.max_price);if(v!==null&&m!==null&&v>m)return{input:null,error:"最低价不能大于最高价"};const g=k(t.target_price);if(g!==null&&m!==null&&g>m)return{input:null,error:"目标价不能高于最高价"};const u=Number(t.interval_minutes);if(!Number.isFinite(u)||u<5)return{input:null,error:"检查间隔至少 5 分钟"};const c=Number(t.pages);return!Number.isFinite(c)||c<1||c>5?{input:null,error:"每轮页数取 1~5"}:{input:{name:h,keyword:i,min_price:v,max_price:m,target_price:g,interval_minutes:Math.round(u),pages:Math.round(c),enabled:t.enabled,cookie_id:t.cookie_id||null,min_seller_credit:t.min_seller_credit||null,min_seller_deals:k(t.min_seller_deals),ai_precise:t.ai_precise}}};function Oe(){const[t,i]=n.useState([]),[h,v]=n.useState(!0),[m,g]=n.useState(""),[u,c]=n.useState(null),[ee,F]=n.useState([]),[se,y]=n.useState(!1),[N,T]=n.useState(null),[l,d]=n.useState(Z),[D,H]=n.useState(!1),[O,_]=n.useState(""),[C,Y]=n.useState(!1),[o,f]=n.useState(null),[B,b]=n.useState(""),[S,z]=n.useState(null),[G,$]=n.useState([]),[te,K]=n.useState(!1),w=n.useRef(new Set),p=n.useCallback(async()=>{try{const r=(await oe()).rules??[];i(r),g("");const a=new Set;for(const j of r)j.running&&a.add(j.id);const P=[...w.current].filter(j=>!a.has(j));w.current=a,P.length&&p()}catch(s){g(s instanceof Error?s.message:"加载失败")}finally{v(!1)}},[]);n.useEffect(()=>{p(),me().then(r=>F(r.cookies??[])).catch(()=>F([]));const s=setInterval(()=>void p(),Me);return()=>clearInterval(s)},[p]);const ae=()=>{T(null),d(Z),f(null),b(""),_(""),y(!0)},re=s=>{T(s.id),d(Re(s)),f(null),b(""),_(""),y(!0)},le=async()=>{const{input:s,error:r}=J(l);if(!s){b(r??"参数有误");return}Y(!0),b(""),f(null);try{const a=await he({keyword:s.keyword,min_price:s.min_price,max_price:s.max_price,pages:s.pages,cookie_id:s.cookie_id,min_seller_credit:s.min_seller_credit,min_seller_deals:s.min_seller_deals,ai_precise:s.ai_precise});f(a),a.error?b(a.error):a.lowest||b("没搜到符合条件的商品,换个关键词或放宽价格区间试试")}catch(a){b(a instanceof Error?a.message:"试搜失败")}finally{Y(!1)}},ne=async()=>{const{input:s,error:r}=J(l);if(!s){_(r??"参数有误");return}H(!0),_("");try{N===null?await ue(s):await be(N,s),y(!1),c({type:"info",message:N===null?"规则已创建,可以立即检查一次":"规则已保存"}),await p()}catch(a){_(a instanceof Error?a.message:"保存失败")}finally{H(!1)}},ie=async s=>{w.current.add(s.id),c(null);try{const r=await je(s.id);if(!r.started)c({type:"info",message:r.message??"任务未启动"});else if(r.record){const a=r.record.lowest_price;a==null?c({type:"warning",message:`「${s.name}」没搜到可比价的商品(已记录一次空结果)`}):r.notified?c({type:"success",message:`已找到最低价 ${x(a)},通知已发送(${r.notify_reason||"命中"})`}):c({type:"info",message:`本次最低价 ${x(a)}(${r.notify_reason||"未触发通知"})`}),r.notify_error&&c({type:"error",message:`通知发送失败:${r.notify_error}`})}}catch(r){c({type:"error",message:r instanceof Error?r.message:"检查失败"})}finally{w.current.delete(s.id),await p()}},ce=async s=>{if(window.confirm(`删除监控规则「${s.name}」?检查历史会一并删除。`))try{await ge(s.id),c({type:"info",message:"规则已删除"}),await p()}catch(r){c({type:"error",message:r instanceof Error?r.message:"删除失败"})}},de=async s=>{z(s),K(!0),$([]);try{const r=await ve(s.id,50);$(r.records??[])}catchLine truncated
@@ -1,4 +1,4 @@
import{c as H,r as c,j as e,az as J,e as ye,S as ge,E as be,L as j,aA as je,aB as _e,aC as Ne,aD as ve,X as O,o as fe,aE as we,aF as ke,aG as Ce,aH as U,n as r,v as z,aI as $e,aJ as Se,aK as Pe,aL as De,aM as Re,aN as Fe,aO as Me,aP as Le}from"./index-BIvz5Jcw.js";import{P as Ie,a as Ae,b as ze,S as _,E as N,N as Ee}from"./ui-YqULwUTN.js";import{S as C}from"./search-DB5lV4of.js";import{T as v}from"./trash-2-DQAdkDas.js";import{S as E}from"./save-Bwc_QnHd.js";import{P as X}from"./play-D2zUiMa7.js";import{P as Te}from"./package-check-CmnmaNHB.js";import{L as Be}from"./link-2-BLLx-6jV.js";/**
import{c as H,r as c,j as e,aA as J,e as ye,S as ge,E as be,L as j,aB as je,aC as _e,aD as Ne,aE as ve,X as O,o as fe,aF as we,aG as ke,aH as Ce,aI as U,n as r,v as E,aJ as $e,aK as Se,aL as Pe,aM as De,aN as Re,aO as Fe,aP as Me,aQ as Le}from"./index-BZnqBmwp.js";import{P as Ie,a as Ae,b as Ee,S as _,E as N,N as ze}from"./ui-B9Jzqjf7.js";import{S as C}from"./search-FaxHcuoK.js";import{T as v}from"./trash-2-CmT2n80I.js";import{S as z}from"./save-Dxf2dvgb.js";import{P as X}from"./play-P9T6ppIo.js";import{P as Te}from"./package-check-BKkFNxd0.js";import{L as Be}from"./link-2-CTuWzTfU.js";/**
* @license lucide-react v0.562.0 - ISC
*
* This source code is licensed under the ISC license.
@@ -13,4 +13,4 @@ import{c as H,r as c,j as e,az as J,e as ye,S as ge,E as be,L as j,aA as je,aB a
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const Qe=[["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"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]],T=H("pencil",Qe),Ve=[{id:"materials",label:"素材库",icon:$},{id:"filters",label:"筛选规则",icon:C},{id:"delete",label:"删除计划",icon:v},{id:"repairs",label:"补偿任务",icon:ge}],B={id:void 0,cookie_id:"",name:"",include_keywords:"",exclude_keywords:"",min_price:"",max_price:"",category:"",daily_limit:"50",enabled:!0},K={id:void 0,cookie_id:"",name:"",min_publish_days:"30",daily_limit:"10",skip_reply_activity:!0,skip_order_activity:!0,enabled:!1},Y=n=>n.split(/[,,\n]/).map(g=>g.trim()).filter(Boolean),q=n=>{if(!n)return"-";const g=new Date(n.includes("T")?n:`${n.replace(" ","T")}Z`);return Number.isNaN(g.getTime())?n:g.toLocaleString("zh-CN",{hour12:!1})},We=n=>n?n.startsWith("//")?`https:${n}`:n:"",Ge={material_filter:"素材筛选",delete_preview:"删除预演",published_id_repair:"商品 ID 回写",short_link_repair:"链接修复",card_compensation:"卡券补偿"},ts=()=>{const[n,g]=c.useState("materials"),[f,Z]=c.useState([]),[Q,S]=c.useState([]),[P,D]=c.useState([]),[R,F]=c.useState([]),[M,V]=c.useState([]),[ee,W]=c.useState(!0),[m,o]=c.useState(""),[w,se]=c.useState(""),[L,te]=c.useState(""),[i,x]=c.useState(null),[a,p]=c.useState(B),[l,u]=c.useState(K),[y,G]=c.useState(null),b=c.useMemo(()=>new Map(f.map(s=>[s.id,s.nickname||s.remark||`账号 ${s.id.slice(0,6)}`])),[f]),I=c.useMemo(()=>{const s=L.trim().toLowerCase();return Q.filter(t=>w&&t.cookie_id!==w?!1:s?[t.title,t.source_item_id,t.published_item_id,t.category].some(d=>String(d||"").toLowerCase().includes(s)):!0)},[Q,w,L]),k=async(s=!0)=>{s&&W(!0);try{const[t,d,h,ue,he]=await Promise.all([fe(),we(),ke(),Ce(),U()]);Z(t),S(d),D(h),F(ue),V(he),!a.cookie_id&&t[0]&&p(A=>({...A,cookie_id:t[0].id})),!l.cookie_id&&t[0]&&u(A=>({...A,cookie_id:t[0].id}))}catch(t){r(`商品自动化数据加载失败:${t.message}`,"error")}finally{W(!1)}};c.useEffect(()=>{k()},[]);const ae=async()=>{if(i){o(`material-${i.id}`);try{const s=await Le(i.id,{title:i.title,description:i.description,category:i.category,price:i.price,images:i.images,source_url:i.source_url,short_url:i.short_url,delivery_content:i.delivery_content,publish_status:i.publish_status,published_item_id:i.published_item_id,publish_trace_code:i.publish_trace_code});S(t=>t.map(d=>d.id===s.id?s:d)),x(null),r("素材已保存","success")}catch(s){r(`素材保存失败:${s.message}`,"error")}finally{o("")}}},ie=async s=>{if(await z(`删除本地素材“${s.title}”?`,{title:"删除素材",confirmLabel:"删除"})){o(`material-${s.id}`);try{await $e(s.id),S(d=>d.filter(h=>h.id!==s.id)),r("素材已删除","success")}catch(d){r(`删除失败:${d.message}`,"error")}finally{o("")}}},le=s=>{p({id:s.id,cookie_id:s.cookie_id,name:s.name,include_keywords:s.include_keywords.join(","),exclude_keywords:s.exclude_keywords.join(","),min_price:s.min_price==null?"":String(s.min_price),max_price:s.max_price==null?"":String(s.max_price),category:s.category||"",daily_limit:String(s.daily_limit),enabled:s.enabled})},de=async()=>{if(!a.cookie_id||!a.name.trim()){r("请选择账号并填写规则名称","warning");return}o("filter-save");try{const s=await Se({id:a.id,cookie_id:a.cookie_id,name:a.name.trim(),include_keywords:Y(a.include_keywords),exclude_keywords:Y(a.exclude_keywords),min_price:a.min_price===""?void 0:Number(a.min_price),max_price:a.max_price===""?void 0:Number(a.max_price),category:a.category.trim(),daily_limit:Number(a.daily_limit)||50,enabled:a.enabled});D(t=>t.some(h=>h.id===s.id)?t.map(h=>h.id===s.id?s:h):[s,...t]),p({...B,cookie_id:a.cookie_id}),r("筛选规则已保存","success")}catch(s){r(`规则保存失败:${s.message}`,"error")}finally{o("")}},re=async s=>{o(`filter-run-${s.id}`);try{const t=await Pe(s.id);r(t.summary,"success"),await k(!1)}catch(t){r(`筛选执行失败:${t.message}`,"error")}finally{o("")}},ne=async s=>{if(await z(`删除筛选规则“${s.name}”?`,{title:"删除规则",confirmLabel:"删除"}))try{await De(s.id),D(t=>t.filter(d=>d.id!==s.id)),r("筛选规则已删除","success")}catch(t){r(`删除失败:${t.message}`,"error")}},ce=s=>{u({id:s.id,cookie_id:s.cookie_id,name:s.name,min_publish_days:String(s.min_publish_days),daily_limit:String(s.daily_limit),skip_reply_activity:s.skip_reply_activity,skip_order_activity:s.skip_order_activity,enabled:s.enabled})},oe=async()=>{if(!l.cookie_id||!l.name.trim()){r("请选择账号并填写计划名称","warning");return}o("delete-save");try{const s=await Re({id:l.id,cookie_id:l.cookie_id,name:l.name.trim(),min_publish_days:Number(l.min_publish_days)||30,daily_limit:Number(l.daily_limit)||10,skip_reply_activity:l.skip_reply_activity,skip_order_activity:l.skip_order_activity,enabled:l.enabled,execution_mode:"dry_run"});F(t=>{const d=t.filter(h=>h.cookie_id!==s.cookie_id);return[s,...d]}),u({...K,cookLine truncated
*/const Qe=[["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"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]],T=H("pencil",Qe),Ve=[{id:"materials",label:"素材库",icon:$},{id:"filters",label:"筛选规则",icon:C},{id:"delete",label:"删除计划",icon:v},{id:"repairs",label:"补偿任务",icon:ge}],B={id:void 0,cookie_id:"",name:"",include_keywords:"",exclude_keywords:"",min_price:"",max_price:"",category:"",daily_limit:"50",enabled:!0},K={id:void 0,cookie_id:"",name:"",min_publish_days:"30",daily_limit:"10",skip_reply_activity:!0,skip_order_activity:!0,enabled:!1},Y=n=>n.split(/[,,\n]/).map(g=>g.trim()).filter(Boolean),q=n=>{if(!n)return"-";const g=new Date(n.includes("T")?n:`${n.replace(" ","T")}Z`);return Number.isNaN(g.getTime())?n:g.toLocaleString("zh-CN",{hour12:!1})},We=n=>n?n.startsWith("//")?`https:${n}`:n:"",Ge={material_filter:"素材筛选",delete_preview:"删除预演",published_id_repair:"商品 ID 回写",short_link_repair:"链接修复",card_compensation:"卡券补偿"},ts=()=>{const[n,g]=c.useState("materials"),[f,Z]=c.useState([]),[Q,S]=c.useState([]),[P,D]=c.useState([]),[R,F]=c.useState([]),[M,V]=c.useState([]),[ee,W]=c.useState(!0),[m,o]=c.useState(""),[w,se]=c.useState(""),[L,te]=c.useState(""),[i,x]=c.useState(null),[a,p]=c.useState(B),[l,u]=c.useState(K),[y,G]=c.useState(null),b=c.useMemo(()=>new Map(f.map(s=>[s.id,s.nickname||s.remark||`账号 ${s.id.slice(0,6)}`])),[f]),I=c.useMemo(()=>{const s=L.trim().toLowerCase();return Q.filter(t=>w&&t.cookie_id!==w?!1:s?[t.title,t.source_item_id,t.published_item_id,t.category].some(d=>String(d||"").toLowerCase().includes(s)):!0)},[Q,w,L]),k=async(s=!0)=>{s&&W(!0);try{const[t,d,h,ue,he]=await Promise.all([fe(),we(),ke(),Ce(),U()]);Z(t),S(d),D(h),F(ue),V(he),!a.cookie_id&&t[0]&&p(A=>({...A,cookie_id:t[0].id})),!l.cookie_id&&t[0]&&u(A=>({...A,cookie_id:t[0].id}))}catch(t){r(`商品自动化数据加载失败:${t.message}`,"error")}finally{W(!1)}};c.useEffect(()=>{k()},[]);const ae=async()=>{if(i){o(`material-${i.id}`);try{const s=await Le(i.id,{title:i.title,description:i.description,category:i.category,price:i.price,images:i.images,source_url:i.source_url,short_url:i.short_url,delivery_content:i.delivery_content,publish_status:i.publish_status,published_item_id:i.published_item_id,publish_trace_code:i.publish_trace_code});S(t=>t.map(d=>d.id===s.id?s:d)),x(null),r("素材已保存","success")}catch(s){r(`素材保存失败:${s.message}`,"error")}finally{o("")}}},ie=async s=>{if(await E(`删除本地素材“${s.title}”?`,{title:"删除素材",confirmLabel:"删除"})){o(`material-${s.id}`);try{await $e(s.id),S(d=>d.filter(h=>h.id!==s.id)),r("素材已删除","success")}catch(d){r(`删除失败:${d.message}`,"error")}finally{o("")}}},le=s=>{p({id:s.id,cookie_id:s.cookie_id,name:s.name,include_keywords:s.include_keywords.join(","),exclude_keywords:s.exclude_keywords.join(","),min_price:s.min_price==null?"":String(s.min_price),max_price:s.max_price==null?"":String(s.max_price),category:s.category||"",daily_limit:String(s.daily_limit),enabled:s.enabled})},de=async()=>{if(!a.cookie_id||!a.name.trim()){r("请选择账号并填写规则名称","warning");return}o("filter-save");try{const s=await Se({id:a.id,cookie_id:a.cookie_id,name:a.name.trim(),include_keywords:Y(a.include_keywords),exclude_keywords:Y(a.exclude_keywords),min_price:a.min_price===""?void 0:Number(a.min_price),max_price:a.max_price===""?void 0:Number(a.max_price),category:a.category.trim(),daily_limit:Number(a.daily_limit)||50,enabled:a.enabled});D(t=>t.some(h=>h.id===s.id)?t.map(h=>h.id===s.id?s:h):[s,...t]),p({...B,cookie_id:a.cookie_id}),r("筛选规则已保存","success")}catch(s){r(`规则保存失败:${s.message}`,"error")}finally{o("")}},re=async s=>{o(`filter-run-${s.id}`);try{const t=await Pe(s.id);r(t.summary,"success"),await k(!1)}catch(t){r(`筛选执行失败:${t.message}`,"error")}finally{o("")}},ne=async s=>{if(await E(`删除筛选规则“${s.name}”?`,{title:"删除规则",confirmLabel:"删除"}))try{await De(s.id),D(t=>t.filter(d=>d.id!==s.id)),r("筛选规则已删除","success")}catch(t){r(`删除失败:${t.message}`,"error")}},ce=s=>{u({id:s.id,cookie_id:s.cookie_id,name:s.name,min_publish_days:String(s.min_publish_days),daily_limit:String(s.daily_limit),skip_reply_activity:s.skip_reply_activity,skip_order_activity:s.skip_order_activity,enabled:s.enabled})},oe=async()=>{if(!l.cookie_id||!l.name.trim()){r("请选择账号并填写计划名称","warning");return}o("delete-save");try{const s=await Re({id:l.id,cookie_id:l.cookie_id,name:l.name.trim(),min_publish_days:Number(l.min_publish_days)||30,daily_limit:Number(l.daily_limit)||10,skip_reply_activity:l.skip_reply_activity,skip_order_activity:l.skip_order_activity,enabled:l.enabled,execution_mode:"dry_run"});F(t=>{const d=t.filter(h=>h.cookie_id!==s.cookie_id);return[s,...d]}),u({...K,cookLine truncated
+6
View File
@@ -0,0 +1,6 @@
import{c as Fe,r,o as Ee,j as e,bG as le,L as g,b as Re,X as ie,E as Ae,bH as $e,bI as Ue,bJ as qe,bK as De,bL as Me,bM as Te}from"./index-BZnqBmwp.js";import{a as ze,N as Be,b as He,E as ne}from"./ui-B9Jzqjf7.js";import{S as F}from"./search-FaxHcuoK.js";import{P as Oe}from"./plus-BljRK6L8.js";import{S as Ke}from"./sparkles-DVlvGI-3.js";import{P as We}from"./package-CDIx-vGO.js";/**
* @license lucide-react v0.562.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const Ge=[["path",{d:"M2 9.5a5.5 5.5 0 0 1 9.591-3.676.56.56 0 0 0 .818 0A5.49 5.49 0 0 1 22 9.5c0 2.29-1.5 4-3 5.5l-5.492 5.313a2 2 0 0 1-3 .019L5 15c-1.5-1.5-3-3.2-3-5.5",key:"mvr1a0"}]],E=Fe("heart",Ge),Je=["包邮","无需邮寄","一口价","按距离计费"],z=d=>d.url?d.url:!d.item_id||d.item_id.startsWith("mock_")?"":`https://www.goofish.com/item?id=${d.item_id}`,ce=d=>new Promise(k=>{const n=new Image;n.onload=()=>k({width:n.naturalWidth||1e3,height:n.naturalHeight||1e3}),n.onerror=()=>k(null),n.src=d}),oe={title:"",price:"",desc:"",delivery:"包邮",postPrice:"0",quantity:"1"},ss=()=>{const[d,k]=r.useState([]),[n,B]=r.useState(""),[y,de]=r.useState("favorites"),[R,a]=r.useState(null),[S,me]=r.useState([]),[xe,ue]=r.useState(1),[pe,he]=r.useState(!1),[f,H]=r.useState(!1),[j,ge]=r.useState(!1),[_,fe]=r.useState(""),[O,be]=r.useState([]),[A,K]=r.useState(!1),[W,ye]=r.useState(!1),[x,G]=r.useState(null),[h,$]=r.useState(null),[J,V]=r.useState(!1),[c,u]=r.useState(oe),[I,X]=r.useState(!1),[C,U]=r.useState(""),[p,b]=r.useState([]),[Y,q]=r.useState(""),[je,D]=r.useState(!1),[v,L]=r.useState(!1),N=r.useRef(null),M=r.useRef(null),[Q,Z]=r.useState([]),[P,ee]=r.useState(!1),ve=r.useMemo(()=>new Map(d.map(s=>[s.id,s.nickname||s.remark||`账号 ${s.id.substring(0,6)}`])),[d]);r.useEffect(()=>{Ee().then(s=>{const t=s.filter(i=>i.enabled),l=t.length>0?t:s;k(l),B(i=>{var o;return i||((o=l[0])==null?void 0:o.id)||""})}).catch(()=>a({type:"error",message:"账号列表加载失败"}))},[]);const T=async(s=1)=>{if(!n){a({type:"error",message:"请先选择账号"});return}H(!0),a(null);try{const t=await $e(n,s,20),l=t.items||[];me(i=>s===1?l:[...i,...l]),he(!!t.next_page),ue(s),ge(!0),l.length===0&&s===1&&a({type:"error",message:"该账号没有可转卖的有效收藏"})}catch(t){a({type:"error",message:t instanceof Error?t.message:"收藏列表加载失败"})}finally{H(!1)}},se=r.useRef(!1);r.useEffect(()=>{!n||y!=="favorites"||j||f||se.current||(se.current=!0,T(1))},[n,y,j,f]);const te=async()=>{if(!n){a({type:"error",message:"请先选择账号"});return}if(!_.trim()){a({type:"error",message:"请输入搜索关键词"});return}K(!0),a(null);try{const s=await Ue(n,_.trim());be(s.items||[]),ye(!0),(s.items||[]).length===0&&a({type:"error",message:`没有搜到「${_.trim()}」相关商品`})}catch(s){a({type:"error",message:s instanceof Error?s.message:"搜索失败"})}finally{K(!1)}},Ne=s=>{if(p.length<=1){a({type:"error",message:"至少保留一张图片"});return}b(t=>t.filter((l,i)=>i!==s))},we=s=>{s<=0||b(t=>{const l=[...t],[i]=l.splice(s,1);return[i,...l]})},ke=async()=>{const s=Y.trim();if(!v){if(!/^https?:\/\//.test(s)){a({type:"error",message:"请输入以 http(s):// 开头的图片地址"});return}if(p.length>=9){a({type:"error",message:"最多 9 张图片"});return}L(!0);try{const t=await ce(s);if(!t){a({type:"error",message:"该图片地址无法加载(可能防盗链或已失效)"});return}b(l=>[...l,{url:s,...t}].slice(0,9)),q(""),D(!1),a({type:"success",message:"已添加图片"})}finally{L(!1)}}},Se=async(s,t)=>{if(!s||!s.length)return;const l=s[0];L(!0);try{const i=await qe(l),o=new URL(i.path,window.location.origin).href,w=await ce(o);if(!w){a({type:"error",message:"图片上传后无法加载,请重试"});return}if(t!=null)b(m=>m.map((Le,Pe)=>Pe===t?{url:o,...w}:Le)),a({type:"success",message:"图片已替换"});else{if(p.length>=9){a({type:"error",message:"最多 9 张图片"});return}b(m=>[...m,{url:o,...w}].slice(0,9)),a({type:"success",message:"图片已添加"})}/^(https?:\/\/)?(localhost|127\.0\.0\.1|192\.168\.)/.test(window.location.origin)&&a({type:"error",message:"当前访问地址非公网,闲鱼可能无法拉取上传的图片,建议通过公网域名操作"})}catch(i){a({type:"error",message:i instanceof Error?i.message:"图片上传失败"})}finally{L(!1),N.current&&(N.current.value=""),M.current=null}},_e=async()=>{if(!(!x||!n||P)){ee(!0);try{const s=await De({cookie_id:n,title:c.title,description:c.desc});if(!s.success){a({type:"error",message:s.message||"AI 优化失败,请重试"});return}const t=s.titles||[];Z(t),s.description&&s.description!==c.desc&&u(l=>({...l,desc:s.description})),a({type:"success",message:t.length?`AI 已生成 ${t.length} 个候选标题(点击选用),描述已同步优化`:"描述已优化"})}catch(s){a({type:"error",message:s instanceof Error?s.message:"AI 优化失败"})}finally{ee(!1)}}},Ie=async s=>{var t,l;if(!n){a({type:"error",message:"请先选择账号"});return}G(s),$(null),U(""),Z([]),D(!1),q(""),b((t=s.images)!=null&&t.length?s.images.map(i=>({url:i,width:1e3,height:1e3})):s.image?[{url:s.image,width:1e3,height:1e3}]:[]),u({...oe,title:s.title||"",price:(s.price||"").replace(/[^\d.]/g,"")}),V(!0);try{const o=(await Te({cookie_id:n,item_id:s.item_id})).item;$(o),(l=o.images)!=null&&l.length&&b(o.images.map(m=>({url:m.url,width:m.width||1e3,height:m.height||1e3})));const w=o.price!=null?String(o.price):"";u(m=>({...m,title Line truncated
-6
View File
@@ -1,6 +0,0 @@
import{c as oe,r as a,o as de,j as e,bF as G,L as p,b as me,X as xe,E as ue,bG as he,bH as pe,bI as ge,bJ as fe}from"./index-BIvz5Jcw.js";import{a as je,N as be,b as ye,E as J}from"./ui-YqULwUTN.js";import{S as N}from"./search-DB5lV4of.js";import{P as ve}from"./package-D-ZQrAsI.js";/**
* @license lucide-react v0.562.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=[["path",{d:"M2 9.5a5.5 5.5 0 0 1 9.591-3.676.56.56 0 0 0 .818 0A5.49 5.49 0 0 1 22 9.5c0 2.29-1.5 4-3 5.5l-5.492 5.313a2 2 0 0 1-3 .019L5 15c-1.5-1.5-3-3.2-3-5.5",key:"mvr1a0"}]],w=oe("heart",Ne),we=["包邮","无需邮寄","一口价","按距离计费"],F=m=>m.url?m.url:!m.item_id||m.item_id.startsWith("mock_")?"":`https://www.goofish.com/item?id=${m.item_id}`,V={title:"",price:"",desc:"",delivery:"包邮",postPrice:"0",quantity:"1"},Ce=()=>{var K,O,z;const[m,W]=a.useState([]),[o,L]=a.useState(""),[g,X]=a.useState("favorites"),[_,l]=a.useState(null),[j,Y]=a.useState([]),[Q,Z]=a.useState(1),[ee,se]=a.useState(!1),[u,E]=a.useState(!1),[f,te]=a.useState(!1),[b,ae]=a.useState(""),[I,le]=a.useState([]),[S,q]=a.useState(!1),[R,re]=a.useState(!1),[c,$]=a.useState(null),[r,k]=a.useState(null),[A,M]=a.useState(!1),[n,x]=a.useState(V),[y,D]=a.useState(!1),[v,P]=a.useState(""),ie=a.useMemo(()=>new Map(m.map(s=>[s.id,s.nickname||s.remark||`账号 ${s.id.substring(0,6)}`])),[m]);a.useEffect(()=>{de().then(s=>{const t=s.filter(d=>d.enabled),i=t.length>0?t:s;W(i),L(d=>{var h;return d||((h=i[0])==null?void 0:h.id)||""})}).catch(()=>l({type:"error",message:"账号列表加载失败"}))},[]);const C=async(s=1)=>{if(!o){l({type:"error",message:"请先选择账号"});return}E(!0),l(null);try{const t=await he(o,s,20),i=t.items||[];Y(d=>s===1?i:[...d,...i]),se(!!t.next_page),Z(s),te(!0),i.length===0&&s===1&&l({type:"error",message:"该账号没有可转卖的有效收藏"})}catch(t){l({type:"error",message:t instanceof Error?t.message:"收藏列表加载失败"})}finally{E(!1)}},T=a.useRef(!1);a.useEffect(()=>{!o||g!=="favorites"||f||u||T.current||(T.current=!0,C(1))},[o,g,f,u]);const U=async()=>{if(!o){l({type:"error",message:"请先选择账号"});return}if(!b.trim()){l({type:"error",message:"请输入搜索关键词"});return}q(!0),l(null);try{const s=await pe(o,b.trim());le(s.items||[]),re(!0),(s.items||[]).length===0&&l({type:"error",message:`没有搜到「${b.trim()}」相关商品`})}catch(s){l({type:"error",message:s instanceof Error?s.message:"搜索失败"})}finally{q(!1)}},ne=async s=>{if(!o){l({type:"error",message:"请先选择账号"});return}$(s),k(null),P(""),x({...V,title:s.title||"",price:(s.price||"").replace(/[^\d.]/g,"")}),M(!0);try{const i=(await fe({cookie_id:o,item_id:s.item_id})).item;k(i);const d=i.price!=null?String(i.price):"";x(h=>({...h,title:i.title||h.title,price:d.replace(/[^\d.]/g,"")||h.price,desc:i.desc||"",quantity:String(i.quantity||1)}))}catch(t){l({type:"warning",message:`详情预览失败(${t instanceof Error?t.message:"未知错误"}),可手动补全后发布`})}finally{M(!1)}},H=()=>{y||($(null),k(null),P(""))},ce=async()=>{if(!c||!o)return;const s=Number(n.price);if(!n.title.trim()){l({type:"error",message:"标题不能为空"});return}if(!Number.isFinite(s)||s<=0){l({type:"error",message:"请输入有效的价格"});return}D(!0),l(null);try{const t=await ge({cookie_id:o,item_id:c.item_id,title:n.title.trim(),price:s,desc:n.desc,delivery:n.delivery,post_price:Number(n.postPrice)||0,quantity:Number(n.quantity)||1});P(t.url),l({type:"success",message:`转卖发布成功:${t.title}`})}catch(t){l({type:"error",message:t instanceof Error?t.message:"发布失败"})}finally{D(!1)}},B=s=>{const t=F(s),i=s.image?e.jsx("img",{src:s.image,alt:s.title,className:"h-full w-full object-cover",loading:"lazy"}):e.jsx("div",{className:"flex h-full items-center justify-center text-gray-400",children:e.jsx(ve,{className:"h-8 w-8"})}),d=s.area?e.jsx("span",{className:"absolute left-2 top-2 rounded bg-black/55 px-1.5 py-0.5 text-[11px] text-white",children:s.area}):null;return e.jsxs("article",{className:"flex flex-col overflow-hidden rounded-xl border border-[var(--border)] bg-[var(--surface)]",children:[t?e.jsxs("a",{href:t,target:"_blank",rel:"noreferrer",title:"在闲鱼打开商品详情",className:"relative block aspect-square bg-gray-100",children:[i,d]}):e.jsxs("div",{className:"relative aspect-square bg-gray-100",children:[i,d]}),e.jsxs("div",{className:"flex flex-1 flex-col gap-2 p-3",children:[t?e.jsx("a",{href:t,target:"_blank",rel:"noreferrer",title:`${s.title}(在闲鱼打开商品详情)`,className:"line-clamp-2 min-h-[2.5rem] text-sm text-[var(--text)] hover:text-[#ff4400] hover:underline",children:s.title}):e.jsx("p",{className:"line-clamp-2 min-h-[2.5rem] text-sm text-[var(--text)]",title:s.title,children:s.title}),e.jsxs("div",{className:"flex items-baseline justify-between gap-2",children:[e.jsx("span",{className:"text-base font-bold text-[#ff4400]",children:s.price||"面议"}),s.want_count?e.jsxs("span",{className:"text-xs text-[var(--text-soft)]",children:[s.want_count,"人想要"]}):null]}),s.seller&&e.jsxs("p",{className:"truncate text-xs text-[var(--text-soft)]",children:["卖家:",s.seller]}),e.jsxs("button",{type:"button",onClick:()=>ne(s),className:"ios-btn-primary mt-auto flex items-center justify-center gap-1.5 rounded-md px-3 py-2 text-sm",childr Line truncated
@@ -1,6 +1,6 @@
import{c as se,r as l,aR as ae,j as e,l as te,e as K,aS as ne,aT as v,aU as q,S as le,aj as O,aV as ie,aW as re,n as c,aX as ce,aY as oe,aZ as de,a_ as pe,a$ as me,b0 as ue}from"./index-BIvz5Jcw.js";import{P as xe,a as he,b as ge,S as p,N as ye}from"./ui-YqULwUTN.js";import{S as je}from"./save-Bwc_QnHd.js";import{S as Q}from"./sparkles-19y4hwrj.js";import{Z as R}from"./zap-DQxF-JwJ.js";import{E as w}from"./eye-off-DlmcXBo-.js";import{E as C}from"./eye-DT2WPUBY.js";/**
import{c as se,r as l,aS as ae,j as e,l as te,e as K,aT as ne,aU as v,aV as q,S as le,ak as O,aW as ie,aX as re,n as c,aY as ce,aZ as oe,a_ as de,a$ as pe,b0 as me,b1 as ue}from"./index-BZnqBmwp.js";import{P as xe,a as he,b as ge,S as p,N as ye}from"./ui-B9Jzqjf7.js";import{S as je}from"./save-Dxf2dvgb.js";import{S as Q}from"./sparkles-DVlvGI-3.js";import{Z as L}from"./zap-BWofDPZm.js";import{E as w}from"./eye-off-D1JuM9mR.js";import{E as C}from"./eye-BibUMjxU.js";/**
* @license lucide-react v0.562.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const be=[["ellipse",{cx:"12",cy:"5",rx:"9",ry:"3",key:"msslwz"}],["path",{d:"M3 5V19A9 3 0 0 0 21 19V5",key:"1wlel7"}],["path",{d:"M3 12A9 3 0 0 0 21 12",key:"mv7ke4"}]],k=se("database",be),r=(s,t=!1)=>{if(typeof s=="boolean")return s;if(typeof s=="string"){const d=s.trim().toLowerCase();return d?!["false","0","no"].includes(d):t}return s==null?t:!!s},o=({title:s,description:t,checked:d,onChange:g})=>e.jsxs("div",{className:"flex items-center justify-between gap-4 border-b border-gray-100 px-4 py-3 last:border-b-0",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsx("p",{className:"text-sm font-bold text-gray-900",children:s}),e.jsx("p",{className:"mt-1 text-xs leading-5 text-gray-500",children:t})]}),e.jsx("button",{type:"button",role:"switch","aria-checked":d,onClick:g,className:`relative h-6 w-11 shrink-0 rounded-full transition-colors ${d?"bg-[#ffe100]":"bg-gray-300"}`,children:e.jsx("span",{className:`absolute left-1 top-1 h-4 w-4 rounded-full bg-white transition-transform ${d?"translate-x-5":""}`})})]}),Se=()=>{const[s,t]=l.useState(null),[d,g]=l.useState(!1),[S,P]=l.useState(!1),[u,L]=l.useState("general"),[A,I]=l.useState([]),[i,y]=l.useState({category:"默认",title:"",content:""}),j=()=>{ie(!0).then(I).catch(()=>I([]))};l.useEffect(()=>{j()},[]);const z=async()=>{!i.title.trim()||!i.content.trim()||(await de(i.title.trim(),i.content.trim(),i.category.trim()||"默认"),y({category:i.category,title:"",content:""}),j())},B=async a=>{await pe(a.id,{enabled:!a.enabled}),j()},D=async a=>{await me(a),j()},[b,V]=l.useState(!1),[f,Z]=l.useState(!1),[T,H]=l.useState(""),[N,E]=l.useState(!1),[m,_]=l.useState({current:"",next:"",confirm:""}),[x,J]=l.useState(!1),[M,$]=l.useState(!1),U=async()=>{const{current:a,next:n,confirm:Y}=m;if(!a||!n){c("请填写当前密码和新密码");return}const[G,ee]=ce(n);if(!G){c(ee);return}if(n!==Y){c("两次输入的新密码不一致");return}if(n===a){c("新密码不能与当前密码相同");return}$(!0);try{const h=await oe(a,n);if((h==null?void 0:h.success)===!1){c(h.message||"密码修改失败");return}_({current:"",next:"",confirm:""}),c("密码已修改,下次登录请使用新密码")}catch(h){c(`密码修改失败:${h.message}`)}finally{$(!1)}};l.useEffect(()=>{F()},[]);const F=()=>{g(!0),ae().then(t).finally(()=>g(!1))},W=async()=>{if(s){P(!0);try{await re(s),c("系统配置已保存")}catch(a){c(`保存失败:${a.message}`)}finally{P(!1)}}},X=async()=>{if(!s)return;const a=T.trim();if(!a){c("请先填写接收测试邮件的邮箱");return}E(!0);try{const n=await ue({to:a,smtp_server:s.smtp_server||"",smtp_port:Number(s.smtp_port)||0,smtp_user:s.smtp_user||"",smtp_password:s.smtp_password||"",smtp_from:s.smtp_from||""});c(n.message||(n.success?"测试邮件已发送":"发送失败"),n.success?"success":"error")}catch(n){c(`测试发信失败:${n.message}`,"error")}finally{E(!1)}};return s?e.jsxs("div",{className:"page-stack animate-fade-in",children:[e.jsx(he,{title:"系统设置",description:"配置管理端访问、商品同步、默认 AI 参数和邮件服务。",icon:te,actions:e.jsxs(e.Fragment,{children:[e.jsxs("button",{type:"button",onClick:F,disabled:d,className:"ios-btn-secondary flex items-center justify-center gap-2 rounded-md px-4 py-2 text-sm",children:[e.jsx(K,{className:`h-4 w-4 ${d?"animate-spin":""}`}),"刷新"]}),e.jsxs("button",{type:"button",onClick:()=>void W(),disabled:S,className:"ios-btn-primary flex items-center justify-center gap-2 rounded-md px-4 py-2 text-sm",children:[e.jsx(je,{className:"h-4 w-4"}),S?"保存中":"保存设置"]})]})}),e.jsx(ge,{value:u,onChange:L,ariaLabel:"系统设置分区",items:[{id:"general",label:"账号与同步",icon:ne},{id:"ai",label:"默认 AI 配置",icon:Q},{id:"email",label:"邮件服务",icon:v},{id:"phrases",label:"快捷短语",icon:R},{id:"notice",label:"公告与更新",icon:q}]}),u==="general"&&e.jsxs("div",{className:"grid gap-4 xl:grid-cols-2",children:[e.jsxs("section",{className:"section-panel",children:[e.jsx(p,{title:"访问与安全",description:"控制后台注册入口、登录提示和验证码策略。",icon:le}),e.jsx(o,{title:"允许用户注册",description:"开启后允许新用户从登录页创建管理账号。",checked:r(s.registration_enabled,!0),onChange:()=>t({...s,registration_enabled:!r(s.registration_enabled,!0)})}),e.jsx(o,{title:"注册邮箱验证",description:"要求注册时填写邮箱验证码。未配置下方「邮件服务」时请关闭,否则用户收不到验证码、无法完成注册。",checked:r(s.email_verification_enabled,!0),onChange:()=>t({...s,email_verification_enabled:!r(s.email_verification_enabled,!0)})}),e.jsx(o,{title:"显示默认登录信息",description:"仅建议在本地调试环境显示默认账号提示。",checked:r(s.show_default_login_info,!0),onChange:()=>t({...s,show_default_login_info:!r(s.show_default_login_info,!0)})}),e.jsx(o,{title:"登录防爆破验证码",description:"连续登录失败达阈值后Line truncated
*/const be=[["ellipse",{cx:"12",cy:"5",rx:"9",ry:"3",key:"msslwz"}],["path",{d:"M3 5V19A9 3 0 0 0 21 19V5",key:"1wlel7"}],["path",{d:"M3 12A9 3 0 0 0 21 12",key:"mv7ke4"}]],k=se("database",be),r=(s,t=!1)=>{if(typeof s=="boolean")return s;if(typeof s=="string"){const d=s.trim().toLowerCase();return d?!["false","0","no"].includes(d):t}return s==null?t:!!s},o=({title:s,description:t,checked:d,onChange:g})=>e.jsxs("div",{className:"flex items-center justify-between gap-4 border-b border-gray-100 px-4 py-3 last:border-b-0",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsx("p",{className:"text-sm font-bold text-gray-900",children:s}),e.jsx("p",{className:"mt-1 text-xs leading-5 text-gray-500",children:t})]}),e.jsx("button",{type:"button",role:"switch","aria-checked":d,onClick:g,className:`relative h-6 w-11 shrink-0 rounded-full transition-colors ${d?"bg-[#ffe100]":"bg-gray-300"}`,children:e.jsx("span",{className:`absolute left-1 top-1 h-4 w-4 rounded-full bg-white transition-transform ${d?"translate-x-5":""}`})})]}),Se=()=>{const[s,t]=l.useState(null),[d,g]=l.useState(!1),[S,P]=l.useState(!1),[u,R]=l.useState("general"),[A,I]=l.useState([]),[i,y]=l.useState({category:"默认",title:"",content:""}),j=()=>{ie(!0).then(I).catch(()=>I([]))};l.useEffect(()=>{j()},[]);const z=async()=>{!i.title.trim()||!i.content.trim()||(await de(i.title.trim(),i.content.trim(),i.category.trim()||"默认"),y({category:i.category,title:"",content:""}),j())},B=async a=>{await pe(a.id,{enabled:!a.enabled}),j()},D=async a=>{await me(a),j()},[b,V]=l.useState(!1),[f,Z]=l.useState(!1),[T,H]=l.useState(""),[N,E]=l.useState(!1),[m,_]=l.useState({current:"",next:"",confirm:""}),[x,J]=l.useState(!1),[M,$]=l.useState(!1),U=async()=>{const{current:a,next:n,confirm:Y}=m;if(!a||!n){c("请填写当前密码和新密码");return}const[G,ee]=ce(n);if(!G){c(ee);return}if(n!==Y){c("两次输入的新密码不一致");return}if(n===a){c("新密码不能与当前密码相同");return}$(!0);try{const h=await oe(a,n);if((h==null?void 0:h.success)===!1){c(h.message||"密码修改失败");return}_({current:"",next:"",confirm:""}),c("密码已修改,下次登录请使用新密码")}catch(h){c(`密码修改失败:${h.message}`)}finally{$(!1)}};l.useEffect(()=>{F()},[]);const F=()=>{g(!0),ae().then(t).finally(()=>g(!1))},W=async()=>{if(s){P(!0);try{await re(s),c("系统配置已保存")}catch(a){c(`保存失败:${a.message}`)}finally{P(!1)}}},X=async()=>{if(!s)return;const a=T.trim();if(!a){c("请先填写接收测试邮件的邮箱");return}E(!0);try{const n=await ue({to:a,smtp_server:s.smtp_server||"",smtp_port:Number(s.smtp_port)||0,smtp_user:s.smtp_user||"",smtp_password:s.smtp_password||"",smtp_from:s.smtp_from||""});c(n.message||(n.success?"测试邮件已发送":"发送失败"),n.success?"success":"error")}catch(n){c(`测试发信失败:${n.message}`,"error")}finally{E(!1)}};return s?e.jsxs("div",{className:"page-stack animate-fade-in",children:[e.jsx(he,{title:"系统设置",description:"配置管理端访问、商品同步、默认 AI 参数和邮件服务。",icon:te,actions:e.jsxs(e.Fragment,{children:[e.jsxs("button",{type:"button",onClick:F,disabled:d,className:"ios-btn-secondary flex items-center justify-center gap-2 rounded-md px-4 py-2 text-sm",children:[e.jsx(K,{className:`h-4 w-4 ${d?"animate-spin":""}`}),"刷新"]}),e.jsxs("button",{type:"button",onClick:()=>void W(),disabled:S,className:"ios-btn-primary flex items-center justify-center gap-2 rounded-md px-4 py-2 text-sm",children:[e.jsx(je,{className:"h-4 w-4"}),S?"保存中":"保存设置"]})]})}),e.jsx(ge,{value:u,onChange:R,ariaLabel:"系统设置分区",items:[{id:"general",label:"账号与同步",icon:ne},{id:"ai",label:"默认 AI 配置",icon:Q},{id:"email",label:"邮件服务",icon:v},{id:"phrases",label:"快捷短语",icon:L},{id:"notice",label:"公告与更新",icon:q}]}),u==="general"&&e.jsxs("div",{className:"grid gap-4 xl:grid-cols-2",children:[e.jsxs("section",{className:"section-panel",children:[e.jsx(p,{title:"访问与安全",description:"控制后台注册入口、登录提示和验证码策略。",icon:le}),e.jsx(o,{title:"允许用户注册",description:"开启后允许新用户从登录页创建管理账号。",checked:r(s.registration_enabled,!0),onChange:()=>t({...s,registration_enabled:!r(s.registration_enabled,!0)})}),e.jsx(o,{title:"注册邮箱验证",description:"要求注册时填写邮箱验证码。未配置下方「邮件服务」时请关闭,否则用户收不到验证码、无法完成注册。",checked:r(s.email_verification_enabled,!0),onChange:()=>t({...s,email_verification_enabled:!r(s.email_verification_enabled,!0)})}),e.jsx(o,{title:"显示默认登录信息",description:"仅建议在本地调试环境显示默认账号提示。",checked:r(s.show_default_login_info,!0),onChange:()=>t({...s,show_default_login_info:!r(s.show_default_login_info,!0)})}),e.jsx(o,{title:"登录防爆破验证码",description:"连续登录失败达阈值后Line truncated
@@ -1 +1 @@
import{r as l,j as e,U as h,e as $,S as j,aS as A,L as f,aj as L,by as P,n as i,v as y,bz as R,bA as T,aX as E,bB as _}from"./index-BIvz5Jcw.js";import{a as I,S as N,E as B}from"./ui-YqULwUTN.js";import{T as z}from"./trash-2-DQAdkDas.js";const D=n=>{if(!n)return"-";const c=new Date(n.includes("T")?n:`${n.replace(" ","T")}Z`);return Number.isNaN(c.getTime())?n:c.toLocaleString("zh-CN",{year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"})},X=()=>{const[n,c]=l.useState([]),[u,g]=l.useState(!0),[o,d]=l.useState(null),[w,p]=l.useState(null),[b,m]=l.useState(""),x=async()=>{g(!0);try{c(await P())}catch(t){i(`加载用户列表失败:${t.message}`,"error")}finally{g(!1)}};l.useEffect(()=>{x()},[]);const U=async t=>{if(o!==null)return;const s=t.is_active!==!1;if(!(s&&!await y(`禁用用户「${t.username}」?其所有在线会话将立即下线,且无法再登录。`,{title:"禁用用户",confirmLabel:"禁用",danger:!0}))){d(t.id);try{const a=await R(t.id,!s);i(a.message||"状态已更新","success"),await x()}catch(a){i(`操作失败:${a.message}`,"error")}finally{d(null)}}},S=async t=>{const[s,a]=E(b);if(!s){i(a,"warning");return}if(o===null){d(t.id);try{const r=await _(t.id,b);i(r.message||"密码已重置","success"),p(null),m("")}catch(r){i(`重置失败:${r.message}`,"error")}finally{d(null)}}},C=async t=>{if(o===null&&await y(`删除用户「${t.username}」?其名下的闲鱼账号、卡密、回复规则等数据将一并删除,不可恢复。`,{title:"删除用户",confirmLabel:"删除",danger:!0})){d(t.id);try{const s=await T(t.id);i(s.message||"用户已删除","success"),await x()}catch(s){i(`删除失败:${s.message}`,"error")}finally{d(null)}}};return e.jsxs("div",{className:"page-stack",children:[e.jsx(I,{title:"用户管理",description:"管理注册用户与登录权限。普通用户仅能操作分配给其名下的账号数据。",icon:h,actions:e.jsxs("button",{type:"button",onClick:()=>void x(),className:"ios-btn-secondary flex items-center gap-2 rounded-md px-4 py-2.5 text-sm",children:[e.jsx($,{className:`h-4 w-4 ${u?"animate-spin":""}`}),"刷新"]})}),e.jsxs("section",{className:"section-panel",children:[e.jsx(N,{title:"权限说明",icon:j}),e.jsxs("div",{className:"grid gap-3 p-4 sm:grid-cols-2",children:[e.jsxs("div",{className:"rounded-lg border border-[var(--border)] bg-[var(--surface-subtle)] p-3.5",children:[e.jsxs("p",{className:"flex items-center gap-2 text-sm font-bold text-[var(--text)]",children:[e.jsx(j,{className:"h-4 w-4 text-[#8a6300]"}),"管理员(admin)"]}),e.jsx("p",{className:"mt-1.5 text-xs leading-5 text-[var(--text-muted)]",children:"拥有全部权限:系统设置、通知与系统日志、用户管理,以及所有闲鱼账号和数据。"})]}),e.jsxs("div",{className:"rounded-lg border border-[var(--border)] bg-[var(--surface-subtle)] p-3.5",children:[e.jsxs("p",{className:"flex items-center gap-2 text-sm font-bold text-[var(--text)]",children:[e.jsx(A,{className:"h-4 w-4 text-[var(--text-soft)]"}),"普通用户"]}),e.jsx("p",{className:"mt-1.5 text-xs leading-5 text-[var(--text-muted)]",children:"只能看到并操作自己名下的闲鱼账号、商品、订单与消息;侧栏不显示系统设置与用户管理,接口层也会拒绝其访问。"})]})]})]}),e.jsxs("section",{className:"section-panel",children:[e.jsx(N,{title:"用户列表",description:`共 ${n.length} 个用户`,icon:h}),e.jsxs("div",{className:"divide-y divide-[var(--border)]",children:[n.map(t=>{const s=t.username==="admin",a=t.is_active===!1,r=o===t.id,v=w===t.id;return e.jsxs("div",{className:"p-4",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-3",children:[e.jsx("div",{className:"flex h-10 w-10 shrink-0 items-center justify-center rounded-full bg-[var(--brand)] text-sm font-black text-[#2a2416]",children:t.username.slice(0,1).toUpperCase()}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsx("p",{className:"text-sm font-bold text-[var(--text)]",children:t.username}),s&&e.jsx("span",{className:"rounded-full bg-[var(--brand)] px-2 py-0.5 text-[10px] font-bold text-[#2a2416]",children:"内置管理员"}),e.jsx("span",{className:`rounded-full px-2 py-0.5 text-[10px] font-bold ${a?"bg-red-50 text-red-600":"bg-emerald-50 text-emerald-600"}`,children:a?"已禁用":"正常"})]}),e.jsx("p",{className:"mt-0.5 truncate text-xs text-[var(--text-muted)]",children:t.email}),e.jsxs("p",{className:"mt-1 text-[11px] text-[var(--text-soft)]",children:[t.cookie_count??0," 个闲鱼账号 · ",t.card_count??0," 张卡密 · 注册于 ",D(t.created_at)]})]}),!s&&e.jsxs("div",{className:"flex shrink-0 items-center gap-2",children:[e.jsx("button",{type:"button",onClick:()=>void U(t),disabled:r,className:a?"rounded-md bg-emerald-50 px-3 py-2 text-xs font-bold text-emerald-700 hover:bg-emerald-100 disabled:opacity-50":"rounded-md bg-amber-50 px-3 py-2 text-xs font-bolLine truncated
import{r as l,j as e,U as h,e as $,S as j,aT as A,L as f,ak as T,bz as L,n as i,v as y,bA as P,bB as R,aY as E,bC as _}from"./index-BZnqBmwp.js";import{a as I,S as N,E as B}from"./ui-B9Jzqjf7.js";import{T as z}from"./trash-2-CmT2n80I.js";const D=n=>{if(!n)return"-";const c=new Date(n.includes("T")?n:`${n.replace(" ","T")}Z`);return Number.isNaN(c.getTime())?n:c.toLocaleString("zh-CN",{year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"})},Y=()=>{const[n,c]=l.useState([]),[u,g]=l.useState(!0),[o,d]=l.useState(null),[w,p]=l.useState(null),[b,m]=l.useState(""),x=async()=>{g(!0);try{c(await L())}catch(t){i(`加载用户列表失败:${t.message}`,"error")}finally{g(!1)}};l.useEffect(()=>{x()},[]);const U=async t=>{if(o!==null)return;const s=t.is_active!==!1;if(!(s&&!await y(`禁用用户「${t.username}」?其所有在线会话将立即下线,且无法再登录。`,{title:"禁用用户",confirmLabel:"禁用",danger:!0}))){d(t.id);try{const a=await P(t.id,!s);i(a.message||"状态已更新","success"),await x()}catch(a){i(`操作失败:${a.message}`,"error")}finally{d(null)}}},C=async t=>{const[s,a]=E(b);if(!s){i(a,"warning");return}if(o===null){d(t.id);try{const r=await _(t.id,b);i(r.message||"密码已重置","success"),p(null),m("")}catch(r){i(`重置失败:${r.message}`,"error")}finally{d(null)}}},k=async t=>{if(o===null&&await y(`删除用户「${t.username}」?其名下的闲鱼账号、卡密、回复规则等数据将一并删除,不可恢复。`,{title:"删除用户",confirmLabel:"删除",danger:!0})){d(t.id);try{const s=await R(t.id);i(s.message||"用户已删除","success"),await x()}catch(s){i(`删除失败:${s.message}`,"error")}finally{d(null)}}};return e.jsxs("div",{className:"page-stack",children:[e.jsx(I,{title:"用户管理",description:"管理注册用户与登录权限。普通用户仅能操作分配给其名下的账号数据。",icon:h,actions:e.jsxs("button",{type:"button",onClick:()=>void x(),className:"ios-btn-secondary flex items-center gap-2 rounded-md px-4 py-2.5 text-sm",children:[e.jsx($,{className:`h-4 w-4 ${u?"animate-spin":""}`}),"刷新"]})}),e.jsxs("section",{className:"section-panel",children:[e.jsx(N,{title:"权限说明",icon:j}),e.jsxs("div",{className:"grid gap-3 p-4 sm:grid-cols-2",children:[e.jsxs("div",{className:"rounded-lg border border-[var(--border)] bg-[var(--surface-subtle)] p-3.5",children:[e.jsxs("p",{className:"flex items-center gap-2 text-sm font-bold text-[var(--text)]",children:[e.jsx(j,{className:"h-4 w-4 text-[#8a6300]"}),"管理员(admin)"]}),e.jsx("p",{className:"mt-1.5 text-xs leading-5 text-[var(--text-muted)]",children:"拥有全部权限:系统设置、通知与系统日志、用户管理,以及所有闲鱼账号和数据。"})]}),e.jsxs("div",{className:"rounded-lg border border-[var(--border)] bg-[var(--surface-subtle)] p-3.5",children:[e.jsxs("p",{className:"flex items-center gap-2 text-sm font-bold text-[var(--text)]",children:[e.jsx(A,{className:"h-4 w-4 text-[var(--text-soft)]"}),"普通用户"]}),e.jsx("p",{className:"mt-1.5 text-xs leading-5 text-[var(--text-muted)]",children:"只能看到并操作自己名下的闲鱼账号、商品、订单与消息;侧栏不显示系统设置与用户管理,接口层也会拒绝其访问。"})]})]})]}),e.jsxs("section",{className:"section-panel",children:[e.jsx(N,{title:"用户列表",description:`共 ${n.length} 个用户`,icon:h}),e.jsxs("div",{className:"divide-y divide-[var(--border)]",children:[n.map(t=>{const s=t.username==="admin",a=t.is_active===!1,r=o===t.id,v=w===t.id;return e.jsxs("div",{className:"p-4",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-3",children:[e.jsx("div",{className:"flex h-10 w-10 shrink-0 items-center justify-center rounded-full bg-[var(--brand)] text-sm font-black text-[#2a2416]",children:t.username.slice(0,1).toUpperCase()}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsx("p",{className:"text-sm font-bold text-[var(--text)]",children:t.username}),s&&e.jsx("span",{className:"rounded-full bg-[var(--brand)] px-2 py-0.5 text-[10px] font-bold text-[#2a2416]",children:"内置管理员"}),e.jsx("span",{className:`rounded-full px-2 py-0.5 text-[10px] font-bold ${a?"bg-red-50 text-red-600":"bg-emerald-50 text-emerald-600"}`,children:a?"已禁用":"正常"})]}),e.jsx("p",{className:"mt-0.5 truncate text-xs text-[var(--text-muted)]",children:t.email}),e.jsxs("p",{className:"mt-1 text-[11px] text-[var(--text-soft)]",children:[t.cookie_count??0," 个闲鱼账号 · ",t.card_count??0," 张卡密 · 注册于 ",D(t.created_at)]})]}),!s&&e.jsxs("div",{className:"flex shrink-0 items-center gap-2",children:[e.jsx("button",{type:"button",onClick:()=>void U(t),disabled:r,className:a?"rounded-md bg-emerald-50 px-3 py-2 text-xs font-bold text-emerald-700 hover:bg-emerald-100 disabled:opacity-50":"rounded-md bg-amber-50 px-3 py-2 text-xs font-bolLine truncated
@@ -1,4 +1,4 @@
import{c as t}from"./index-BIvz5Jcw.js";/**
import{c as t}from"./index-BZnqBmwp.js";/**
* @license lucide-react v0.562.0 - ISC
*
* This source code is licensed under the ISC license.
@@ -1,4 +1,4 @@
import{c}from"./index-BIvz5Jcw.js";/**
import{c}from"./index-BZnqBmwp.js";/**
* @license lucide-react v0.562.0 - ISC
*
* This source code is licensed under the ISC license.
@@ -1,4 +1,4 @@
import{c as o}from"./index-BIvz5Jcw.js";/**
import{c as o}from"./index-BZnqBmwp.js";/**
* @license lucide-react v0.562.0 - ISC
*
* This source code is licensed under the ISC license.
@@ -1,4 +1,4 @@
import{c}from"./index-BIvz5Jcw.js";/**
import{c}from"./index-BZnqBmwp.js";/**
* @license lucide-react v0.562.0 - ISC
*
* This source code is licensed under the ISC license.
@@ -1,4 +1,4 @@
import{c as e}from"./index-BIvz5Jcw.js";/**
import{c as e}from"./index-BZnqBmwp.js";/**
* @license lucide-react v0.562.0 - ISC
*
* This source code is licensed under the ISC license.
@@ -1,4 +1,4 @@
import{c}from"./index-BIvz5Jcw.js";/**
import{c}from"./index-BZnqBmwp.js";/**
* @license lucide-react v0.562.0 - ISC
*
* This source code is licensed under the ISC license.
@@ -1,4 +1,4 @@
import{c as e}from"./index-BIvz5Jcw.js";/**
import{c as e}from"./index-BZnqBmwp.js";/**
* @license lucide-react v0.562.0 - ISC
*
* This source code is licensed under the ISC license.
@@ -1,4 +1,4 @@
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/Dashboard-B33BHNCV.js","assets/ui-YqULwUTN.js","assets/package-D-ZQrAsI.js","assets/trending-up-lcv1edBO.js","assets/activity-WV3qb2N7.js","assets/package-check-CmnmaNHB.js","assets/AccountList-BKSBDt_l.js","assets/check-FJ-UzmYk.js","assets/sparkles-19y4hwrj.js","assets/power-DjMfqLyB.js","assets/trash-2-DQAdkDas.js","assets/key-CYZA_CNy.js","assets/eye-off-DlmcXBo-.js","assets/eye-DT2WPUBY.js","assets/save-Bwc_QnHd.js","assets/OrderList-CIIheF2Y.js","assets/plus-C6QmxIVH.js","assets/truck-tA7BGYeX.js","assets/search-DB5lV4of.js","assets/flower-2-B8e-r4X9.js","assets/square-pen-BKEEv4kY.js","assets/chevron-right-D1rbL3LX.js","assets/CardList-C8XdWKP9.js","assets/image-BqfhCYxr.js","assets/ItemList-BsqatMN9.js","assets/shield-alert-BLVh_PbV.js","assets/power-off-CRjSW7V0.js","assets/settings-2-DI3dKtSP.js","assets/ProductAutomation-DRPtO9fp.js","assets/play-D2zUiMa7.js","assets/link-2-BLLx-6jV.js","assets/AIReply-X3NfSWlX.js","assets/message-square-text-CYR04FKJ.js","assets/Settings-C16Ebgzw.js","assets/zap-DQxF-JwJ.js","assets/Keywords-BbN7QSqO.js","assets/MessageManagement-D0l_btLh.js","assets/send-CiGD-0RS.js","assets/NotificationsAndLogs-CgQ8KgCM.js","assets/pen-line-cbtfAAum.js","assets/UserManagement-7Buex7RY.js","assets/About-BL_cstMs.js","assets/BuyerInteraction-BaO2JFO9.js","assets/Resell-DjCgly7T.js","assets/HotList-BLMc0acu.js","assets/PriceWatch-Cm4KX0HR.js"])))=>i.map(i=>d[i]);
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/Dashboard-SIGinmod.js","assets/ui-B9Jzqjf7.js","assets/package-CDIx-vGO.js","assets/trending-up-BLnHDV6T.js","assets/activity-D09genEZ.js","assets/package-check-BKkFNxd0.js","assets/AccountList-BxMZ8Udh.js","assets/check-C6LyX_Nv.js","assets/sparkles-DVlvGI-3.js","assets/power-D9WTjX12.js","assets/trash-2-CmT2n80I.js","assets/key-C0msAg8e.js","assets/eye-off-D1JuM9mR.js","assets/eye-BibUMjxU.js","assets/save-Dxf2dvgb.js","assets/OrderList-ZwW4LdUq.js","assets/plus-BljRK6L8.js","assets/truck-3I9pdhz5.js","assets/search-FaxHcuoK.js","assets/flower-2-B1FJm-vw.js","assets/square-pen-Bmle-FRS.js","assets/chevron-right-pxFcnXJt.js","assets/CardList-Camdnn7z.js","assets/image-BE6TxU00.js","assets/ItemList-D_zO1nzP.js","assets/shield-alert-rM_NVGQr.js","assets/power-off-NLH-bTqs.js","assets/settings-2-CRN1TI2k.js","assets/ProductAutomation-MbnRCc-u.js","assets/play-P9T6ppIo.js","assets/link-2-CTuWzTfU.js","assets/AIReply-teRO4Zqo.js","assets/message-square-text-Bnj1FXzX.js","assets/Settings-C3ht1_iw.js","assets/zap-BWofDPZm.js","assets/Keywords-GHbY9xAn.js","assets/MessageManagement-B1rvp6fJ.js","assets/send-BjFPcqyQ.js","assets/NotificationsAndLogs-BsCaJ8H7.js","assets/pen-line-CmEoWNKp.js","assets/UserManagement-BCtLeLer.js","assets/About-B_6kryH7.js","assets/BuyerInteraction-DnC0dxfT.js","assets/Resell-45XAV9t5.js","assets/HotList-SDSWlemc.js","assets/PriceWatch-nQDi2og7.js"])))=>i.map(i=>d[i]);
function xp(l,s){for(var c=0;c<s.length;c++){const r=s[c];if(typeof r!="string"&&!Array.isArray(r)){for(const f in r)if(f!=="default"&&!(f in l)){const m=Object.getOwnPropertyDescriptor(r,f);m&&Object.defineProperty(l,f,m.get?m:{enumerable:!0,get:()=>r[f]})}}}return Object.freeze(Object.defineProperty(l,Symbol.toStringTag,{value:"Module"}))}(function(){const s=document.createElement("link").relList;if(s&&s.supports&&s.supports("modulepreload"))return;for(const f of document.querySelectorAll('link[rel="modulepreload"]'))r(f);new MutationObserver(f=>{for(const m of f)if(m.type==="childList")for(const h of m.addedNodes)h.tagName==="LINK"&&h.rel==="modulepreload"&&r(h)}).observe(document,{childList:!0,subtree:!0});function c(f){const m={};return f.integrity&&(m.integrity=f.integrity),f.referrerPolicy&&(m.referrerPolicy=f.referrerPolicy),f.crossOrigin==="use-credentials"?m.credentials="include":f.crossOrigin==="anonymous"?m.credentials="omit":m.credentials="same-origin",m}function r(f){if(f.ep)return;f.ep=!0;const m=c(f);fetch(f.href,m)}})();function hh(l){return l&&l.__esModule&&Object.prototype.hasOwnProperty.call(l,"default")?l.default:l}var Ic={exports:{}},lu={};/**
* @license React
* react-jsx-runtime.production.js
@@ -7,7 +7,7 @@ function xp(l,s){for(var c=0;c<s.length;c++){const r=s[c];if(typeof r!="string"&
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/var wm;function Ep(){if(wm)return lu;wm=1;var l=Symbol.for("react.transitional.element"),s=Symbol.for("react.fragment");function c(r,f,m){var h=null;if(m!==void 0&&(h=""+m),f.key!==void 0&&(h=""+f.key),"key"in f){m={};for(var p in f)p!=="key"&&(m[p]=f[p])}else m=f;return f=m.ref,{$$typeof:l,type:r,key:h,ref:f!==void 0?f:null,props:m}}return lu.Fragment=s,lu.jsx=c,lu.jsxs=c,lu}var zm;function Ap(){return zm||(zm=1,Ic.exports=Ep()),Ic.exports}var y=Ap(),Pc={exports:{}},se={};/**
*/var wm;function Ep(){if(wm)return lu;wm=1;var l=Symbol.for("react.transitional.element"),s=Symbol.for("react.fragment");function c(r,f,m){var h=null;if(m!==void 0&&(h=""+m),f.key!==void 0&&(h=""+f.key),"key"in f){m={};for(var p in f)p!=="key"&&(m[p]=f[p])}else m=f;return f=m.ref,{$$typeof:l,type:r,key:h,ref:f!==void 0?f:null,props:m}}return lu.Fragment=s,lu.jsx=c,lu.jsxs=c,lu}var zm;function Ap(){return zm||(zm=1,Ic.exports=Ep()),Ic.exports}var y=Ap(),Pc={exports:{}},ce={};/**
* @license React
* react.production.js
*
@@ -15,7 +15,7 @@ function xp(l,s){for(var c=0;c<s.length;c++){const r=s[c];if(typeof r!="string"&
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/var jm;function Tp(){if(jm)return se;jm=1;var l=Symbol.for("react.transitional.element"),s=Symbol.for("react.portal"),c=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),f=Symbol.for("react.profiler"),m=Symbol.for("react.consumer"),h=Symbol.for("react.context"),p=Symbol.for("react.forward_ref"),v=Symbol.for("react.suspense"),g=Symbol.for("react.memo"),A=Symbol.for("react.lazy"),N=Symbol.for("react.activity"),q=Symbol.iterator;function F(S){return S===null||typeof S!="object"?null:(S=q&&S[q]||S["@@iterator"],typeof S=="function"?S:null)}var W={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},X=Object.assign,Y={};function C(S,j,H){this.props=S,this.context=j,this.refs=Y,this.updater=H||W}C.prototype.isReactComponent={},C.prototype.setState=function(S,j){if(typeof S!="object"&&typeof S!="function"&&S!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,S,j,"setState")},C.prototype.forceUpdate=function(S){this.updater.enqueueForceUpdate(this,S,"forceUpdate")};function K(){}K.prototype=C.prototype;function Q(S,j,H){this.props=S,this.context=j,this.refs=Y,this.updater=H||W}var ee=Q.prototype=new K;ee.constructor=Q,X(ee,C.prototype),ee.isPureReactComponent=!0;var Ee=Array.isArray;function me(){}var ne={H:null,A:null,T:null,S:null},Le=Object.prototype.hasOwnProperty;function ct(S,j,H){var G=H.ref;return{$$typeof:l,type:S,key:j,ref:G!==void 0?G:null,props:H}}function be(S,j){return ct(S.type,j,S.props)}function Me(S){return typeof S=="object"&&S!==null&&S.$$typeof===l}function ke(S){var j={"=":"=0",":":"=2"};return"$"+S.replace(/[=:]/g,function(H){return j[H]})}var xt=/\/+/g;function He(S,j){return typeof S=="object"&&S!==null&&S.key!=null?ke(""+S.key):j.toString(36)}function Re(S){switch(S.status){case"fulfilled":return S.value;case"rejected":throw S.reason;default:switch(typeof S.status=="string"?S.then(me,me):(S.status="pending",S.then(function(j){S.status==="pending"&&(S.status="fulfilled",S.value=j)},function(j){S.status==="pending"&&(S.status="rejected",S.reason=j)})),S.status){case"fulfilled":return S.value;case"rejected":throw S.reason}}throw S}function z(S,j,H,G,le){var Z=typeof S;(Z==="undefined"||Z==="boolean")&&(S=null);var k=!1;if(S===null)k=!0;else switch(Z){case"bigint":case"string":case"number":k=!0;break;case"object":switch(S.$$typeof){case l:case s:k=!0;break;case A:return k=S._init,z(k(S._payload),j,H,G,le)}}if(k)return le=le(S),k=G===""?"."+He(S,0):G,Ee(le)?(H="",k!=null&&(H=k.replace(xt,"$&/")+"/"),z(le,j,H,"",function(Za){return Za})):le!=null&&(Me(le)&&(le=be(le,H+(le.key==null||S&&S.key===le.key?"":(""+le.key).replace(xt,"$&/")+"/")+k)),j.push(le)),1;k=0;var ue=G===""?".":G+":";if(Ee(S))for(var Te=0;Te<S.length;Te++)G=S[Te],Z=ue+He(G,Te),k+=z(G,j,H,Z,le);else if(Te=F(S),typeof Te=="function")for(S=Te.call(S),Te=0;!(G=S.next()).done;)G=G.value,Z=ue+He(G,Te++),k+=z(G,j,H,Z,le);else if(Z==="object"){if(typeof S.then=="function")return z(Re(S),j,H,G,le);throw j=String(S),Error("Objects are not valid as a React child (found: "+(j==="[object Object]"?"object with keys {"+Object.keys(S).join(", ")+"}":j)+"). If you meant to render a collection of children, use an array instead.")}return k}function L(S,j,H){if(S==null)return S;var G=[],le=0;return z(S,G,"","",function(Z){return j.call(H,Z,le++)}),G}function P(S){if(S._status===-1){var j=S._result;j=j(),j.then(function(H){(S._status===0||S._status===-1)&&(S._status=1,S._result=H)},function(H){(S._status===0||S._status===-1)&&(S._status=2,S._result=H)}),S._status===-1&&(S._status=0,S._result=j)}if(S._status===1)return S._result.default;throw S._result}var Se=typeof reportError=="function"?reportError:function(S){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var j=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof S=="object"&&S!==null&&typeof S.message=="string"?String(S.message):String(S),error:S});if(!window.dispatchEvent(j))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",S);return}console.error(S)},ce={map:L,forEach:function(S,j,H){L(S,function(){j.apply(this,arguments)},H)},count:function(S){var j=0;return L(S,function(){j++}),j},toArray:function(S){return L(S,function(j){return j})||[]},only:function(S){if(!Me(S))throw Error("React.Children.only expected to receive a single React element child.");return S}};return se.Activity=N,se.Children=ce,se.Component=C,se.Fragment=c,se.Profiler=f,se.PureComponent=Q,se.StrictMode=r,se.Suspense=v,se.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=ne,se.__COMPILER_RUNTIME={__proto__:null,c:function(S){return ne.H.useMemoCache(S)}},se.cache=function(S){return function(){return S.apply(null,arguments)}},se.cacheSignal=function(){return null},se.cloneElement=function(S,j,H){if(S==null)throw Error("The argumLine truncated
*/var jm;function Tp(){if(jm)return ce;jm=1;var l=Symbol.for("react.transitional.element"),s=Symbol.for("react.portal"),c=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),f=Symbol.for("react.profiler"),m=Symbol.for("react.consumer"),h=Symbol.for("react.context"),p=Symbol.for("react.forward_ref"),v=Symbol.for("react.suspense"),g=Symbol.for("react.memo"),A=Symbol.for("react.lazy"),N=Symbol.for("react.activity"),q=Symbol.iterator;function F(S){return S===null||typeof S!="object"?null:(S=q&&S[q]||S["@@iterator"],typeof S=="function"?S:null)}var W={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},X=Object.assign,Y={};function C(S,j,H){this.props=S,this.context=j,this.refs=Y,this.updater=H||W}C.prototype.isReactComponent={},C.prototype.setState=function(S,j){if(typeof S!="object"&&typeof S!="function"&&S!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,S,j,"setState")},C.prototype.forceUpdate=function(S){this.updater.enqueueForceUpdate(this,S,"forceUpdate")};function K(){}K.prototype=C.prototype;function Q(S,j,H){this.props=S,this.context=j,this.refs=Y,this.updater=H||W}var ee=Q.prototype=new K;ee.constructor=Q,X(ee,C.prototype),ee.isPureReactComponent=!0;var Ee=Array.isArray;function me(){}var ne={H:null,A:null,T:null,S:null},Le=Object.prototype.hasOwnProperty;function ct(S,j,H){var G=H.ref;return{$$typeof:l,type:S,key:j,ref:G!==void 0?G:null,props:H}}function be(S,j){return ct(S.type,j,S.props)}function Me(S){return typeof S=="object"&&S!==null&&S.$$typeof===l}function ke(S){var j={"=":"=0",":":"=2"};return"$"+S.replace(/[=:]/g,function(H){return j[H]})}var xt=/\/+/g;function He(S,j){return typeof S=="object"&&S!==null&&S.key!=null?ke(""+S.key):j.toString(36)}function Re(S){switch(S.status){case"fulfilled":return S.value;case"rejected":throw S.reason;default:switch(typeof S.status=="string"?S.then(me,me):(S.status="pending",S.then(function(j){S.status==="pending"&&(S.status="fulfilled",S.value=j)},function(j){S.status==="pending"&&(S.status="rejected",S.reason=j)})),S.status){case"fulfilled":return S.value;case"rejected":throw S.reason}}throw S}function z(S,j,H,G,le){var Z=typeof S;(Z==="undefined"||Z==="boolean")&&(S=null);var k=!1;if(S===null)k=!0;else switch(Z){case"bigint":case"string":case"number":k=!0;break;case"object":switch(S.$$typeof){case l:case s:k=!0;break;case A:return k=S._init,z(k(S._payload),j,H,G,le)}}if(k)return le=le(S),k=G===""?"."+He(S,0):G,Ee(le)?(H="",k!=null&&(H=k.replace(xt,"$&/")+"/"),z(le,j,H,"",function(Za){return Za})):le!=null&&(Me(le)&&(le=be(le,H+(le.key==null||S&&S.key===le.key?"":(""+le.key).replace(xt,"$&/")+"/")+k)),j.push(le)),1;k=0;var ue=G===""?".":G+":";if(Ee(S))for(var Te=0;Te<S.length;Te++)G=S[Te],Z=ue+He(G,Te),k+=z(G,j,H,Z,le);else if(Te=F(S),typeof Te=="function")for(S=Te.call(S),Te=0;!(G=S.next()).done;)G=G.value,Z=ue+He(G,Te++),k+=z(G,j,H,Z,le);else if(Z==="object"){if(typeof S.then=="function")return z(Re(S),j,H,G,le);throw j=String(S),Error("Objects are not valid as a React child (found: "+(j==="[object Object]"?"object with keys {"+Object.keys(S).join(", ")+"}":j)+"). If you meant to render a collection of children, use an array instead.")}return k}function L(S,j,H){if(S==null)return S;var G=[],le=0;return z(S,G,"","",function(Z){return j.call(H,Z,le++)}),G}function P(S){if(S._status===-1){var j=S._result;j=j(),j.then(function(H){(S._status===0||S._status===-1)&&(S._status=1,S._result=H)},function(H){(S._status===0||S._status===-1)&&(S._status=2,S._result=H)}),S._status===-1&&(S._status=0,S._result=j)}if(S._status===1)return S._result.default;throw S._result}var Se=typeof reportError=="function"?reportError:function(S){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var j=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof S=="object"&&S!==null&&typeof S.message=="string"?String(S.message):String(S),error:S});if(!window.dispatchEvent(j))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",S);return}console.error(S)},re={map:L,forEach:function(S,j,H){L(S,function(){j.apply(this,arguments)},H)},count:function(S){var j=0;return L(S,function(){j++}),j},toArray:function(S){return L(S,function(j){return j})||[]},only:function(S){if(!Me(S))throw Error("React.Children.only expected to receive a single React element child.");return S}};return ce.Activity=N,ce.Children=re,ce.Component=C,ce.Fragment=c,ce.Profiler=f,ce.PureComponent=Q,ce.StrictMode=r,ce.Suspense=v,ce.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=ne,ce.__COMPILER_RUNTIME={__proto__:null,c:function(S){return ne.H.useMemoCache(S)}},ce.cache=function(S){return function(){return S.apply(null,arguments)}},ce.cacheSignal=function(){return null},ce.cloneElement=function(S,j,H){if(S==null)throw Error("The argumLine truncated
* @license React
* scheduler.production.js
*
@@ -23,7 +23,7 @@ function xp(l,s){for(var c=0;c<s.length;c++){const r=s[c];if(typeof r!="string"&
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/var Cm;function Op(){return Cm||(Cm=1,(function(l){function s(z,L){var P=z.length;z.push(L);e:for(;0<P;){var Se=P-1>>>1,ce=z[Se];if(0<f(ce,L))z[Se]=L,z[P]=ce,P=Se;else break e}}function c(z){return z.length===0?null:z[0]}function r(z){if(z.length===0)return null;var L=z[0],P=z.pop();if(P!==L){z[0]=P;e:for(var Se=0,ce=z.length,S=ce>>>1;Se<S;){var j=2*(Se+1)-1,H=z[j],G=j+1,le=z[G];if(0>f(H,P))G<ce&&0>f(le,H)?(z[Se]=le,z[G]=P,Se=G):(z[Se]=H,z[j]=P,Se=j);else if(G<ce&&0>f(le,P))z[Se]=le,z[G]=P,Se=G;else break e}}return L}function f(z,L){var P=z.sortIndex-L.sortIndex;return P!==0?P:z.id-L.id}if(l.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var m=performance;l.unstable_now=function(){return m.now()}}else{var h=Date,p=h.now();l.unstable_now=function(){return h.now()-p}}var v=[],g=[],A=1,N=null,q=3,F=!1,W=!1,X=!1,Y=!1,C=typeof setTimeout=="function"?setTimeout:null,K=typeof clearTimeout=="function"?clearTimeout:null,Q=typeof setImmediate<"u"?setImmediate:null;function ee(z){for(var L=c(g);L!==null;){if(L.callback===null)r(g);else if(L.startTime<=z)r(g),L.sortIndex=L.expirationTime,s(v,L);else break;L=c(g)}}function Ee(z){if(X=!1,ee(z),!W)if(c(v)!==null)W=!0,me||(me=!0,ke());else{var L=c(g);L!==null&&Re(Ee,L.startTime-z)}}var me=!1,ne=-1,Le=5,ct=-1;function be(){return Y?!0:!(l.unstable_now()-ct<Le)}function Me(){if(Y=!1,me){var z=l.unstable_now();ct=z;var L=!0;try{e:{W=!1,X&&(X=!1,K(ne),ne=-1),F=!0;var P=q;try{t:{for(ee(z),N=c(v);N!==null&&!(N.expirationTime>z&&be());){var Se=N.callback;if(typeof Se=="function"){N.callback=null,q=N.priorityLevel;var ce=Se(N.expirationTime<=z);if(z=l.unstable_now(),typeof ce=="function"){N.callback=ce,ee(z),L=!0;break t}N===c(v)&&r(v),ee(z)}else r(v);N=c(v)}if(N!==null)L=!0;else{var S=c(g);S!==null&&Re(Ee,S.startTime-z),L=!1}}break e}finally{N=null,q=P,F=!1}L=void 0}}finally{L?ke():me=!1}}}var ke;if(typeof Q=="function")ke=function(){Q(Me)};else if(typeof MessageChannel<"u"){var xt=new MessageChannel,He=xt.port2;xt.port1.onmessage=Me,ke=function(){He.postMessage(null)}}else ke=function(){C(Me,0)};function Re(z,L){ne=C(function(){z(l.unstable_now())},L)}l.unstable_IdlePriority=5,l.unstable_ImmediatePriority=1,l.unstable_LowPriority=4,l.unstable_NormalPriority=3,l.unstable_Profiling=null,l.unstable_UserBlockingPriority=2,l.unstable_cancelCallback=function(z){z.callback=null},l.unstable_forceFrameRate=function(z){0>z||125<z?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):Le=0<z?Math.floor(1e3/z):5},l.unstable_getCurrentPriorityLevel=function(){return q},l.unstable_next=function(z){switch(q){case 1:case 2:case 3:var L=3;break;default:L=q}var P=q;q=L;try{return z()}finally{q=P}},l.unstable_requestPaint=function(){Y=!0},l.unstable_runWithPriority=function(z,L){switch(z){case 1:case 2:case 3:case 4:case 5:break;default:z=3}var P=q;q=z;try{return L()}finally{q=P}},l.unstable_scheduleCallback=function(z,L,P){var Se=l.unstable_now();switch(typeof P=="object"&&P!==null?(P=P.delay,P=typeof P=="number"&&0<P?Se+P:Se):P=Se,z){case 1:var ce=-1;break;case 2:ce=250;break;case 5:ce=1073741823;break;case 4:ce=1e4;break;default:ce=5e3}return ce=P+ce,z={id:A++,callback:L,priorityLevel:z,startTime:P,expirationTime:ce,sortIndex:-1},P>Se?(z.sortIndex=P,s(g,z),c(v)===null&&z===c(g)&&(X?(K(ne),ne=-1):X=!0,Re(Ee,P-Se))):(z.sortIndex=ce,s(v,z),W||F||(W=!0,me||(me=!0,ke()))),z},l.unstable_shouldYield=be,l.unstable_wrapCallback=function(z){var L=q;return function(){var P=q;q=L;try{return z.apply(this,arguments)}finally{q=P}}}})(ar)),ar}var Mm;function Np(){return Mm||(Mm=1,tr.exports=Op()),tr.exports}var nr={exports:{}},rt={};/**
*/var Cm;function Op(){return Cm||(Cm=1,(function(l){function s(z,L){var P=z.length;z.push(L);e:for(;0<P;){var Se=P-1>>>1,re=z[Se];if(0<f(re,L))z[Se]=L,z[P]=re,P=Se;else break e}}function c(z){return z.length===0?null:z[0]}function r(z){if(z.length===0)return null;var L=z[0],P=z.pop();if(P!==L){z[0]=P;e:for(var Se=0,re=z.length,S=re>>>1;Se<S;){var j=2*(Se+1)-1,H=z[j],G=j+1,le=z[G];if(0>f(H,P))G<re&&0>f(le,H)?(z[Se]=le,z[G]=P,Se=G):(z[Se]=H,z[j]=P,Se=j);else if(G<re&&0>f(le,P))z[Se]=le,z[G]=P,Se=G;else break e}}return L}function f(z,L){var P=z.sortIndex-L.sortIndex;return P!==0?P:z.id-L.id}if(l.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var m=performance;l.unstable_now=function(){return m.now()}}else{var h=Date,p=h.now();l.unstable_now=function(){return h.now()-p}}var v=[],g=[],A=1,N=null,q=3,F=!1,W=!1,X=!1,Y=!1,C=typeof setTimeout=="function"?setTimeout:null,K=typeof clearTimeout=="function"?clearTimeout:null,Q=typeof setImmediate<"u"?setImmediate:null;function ee(z){for(var L=c(g);L!==null;){if(L.callback===null)r(g);else if(L.startTime<=z)r(g),L.sortIndex=L.expirationTime,s(v,L);else break;L=c(g)}}function Ee(z){if(X=!1,ee(z),!W)if(c(v)!==null)W=!0,me||(me=!0,ke());else{var L=c(g);L!==null&&Re(Ee,L.startTime-z)}}var me=!1,ne=-1,Le=5,ct=-1;function be(){return Y?!0:!(l.unstable_now()-ct<Le)}function Me(){if(Y=!1,me){var z=l.unstable_now();ct=z;var L=!0;try{e:{W=!1,X&&(X=!1,K(ne),ne=-1),F=!0;var P=q;try{t:{for(ee(z),N=c(v);N!==null&&!(N.expirationTime>z&&be());){var Se=N.callback;if(typeof Se=="function"){N.callback=null,q=N.priorityLevel;var re=Se(N.expirationTime<=z);if(z=l.unstable_now(),typeof re=="function"){N.callback=re,ee(z),L=!0;break t}N===c(v)&&r(v),ee(z)}else r(v);N=c(v)}if(N!==null)L=!0;else{var S=c(g);S!==null&&Re(Ee,S.startTime-z),L=!1}}break e}finally{N=null,q=P,F=!1}L=void 0}}finally{L?ke():me=!1}}}var ke;if(typeof Q=="function")ke=function(){Q(Me)};else if(typeof MessageChannel<"u"){var xt=new MessageChannel,He=xt.port2;xt.port1.onmessage=Me,ke=function(){He.postMessage(null)}}else ke=function(){C(Me,0)};function Re(z,L){ne=C(function(){z(l.unstable_now())},L)}l.unstable_IdlePriority=5,l.unstable_ImmediatePriority=1,l.unstable_LowPriority=4,l.unstable_NormalPriority=3,l.unstable_Profiling=null,l.unstable_UserBlockingPriority=2,l.unstable_cancelCallback=function(z){z.callback=null},l.unstable_forceFrameRate=function(z){0>z||125<z?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):Le=0<z?Math.floor(1e3/z):5},l.unstable_getCurrentPriorityLevel=function(){return q},l.unstable_next=function(z){switch(q){case 1:case 2:case 3:var L=3;break;default:L=q}var P=q;q=L;try{return z()}finally{q=P}},l.unstable_requestPaint=function(){Y=!0},l.unstable_runWithPriority=function(z,L){switch(z){case 1:case 2:case 3:case 4:case 5:break;default:z=3}var P=q;q=z;try{return L()}finally{q=P}},l.unstable_scheduleCallback=function(z,L,P){var Se=l.unstable_now();switch(typeof P=="object"&&P!==null?(P=P.delay,P=typeof P=="number"&&0<P?Se+P:Se):P=Se,z){case 1:var re=-1;break;case 2:re=250;break;case 5:re=1073741823;break;case 4:re=1e4;break;default:re=5e3}return re=P+re,z={id:A++,callback:L,priorityLevel:z,startTime:P,expirationTime:re,sortIndex:-1},P>Se?(z.sortIndex=P,s(g,z),c(v)===null&&z===c(g)&&(X?(K(ne),ne=-1):X=!0,Re(Ee,P-Se))):(z.sortIndex=re,s(v,z),W||F||(W=!0,me||(me=!0,ke()))),z},l.unstable_shouldYield=be,l.unstable_wrapCallback=function(z){var L=q;return function(){var P=q;q=L;try{return z.apply(this,arguments)}finally{q=P}}}})(ar)),ar}var Mm;function Np(){return Mm||(Mm=1,tr.exports=Op()),tr.exports}var nr={exports:{}},rt={};/**
* @license React
* react-dom.production.js
*
@@ -39,12 +39,12 @@ function xp(l,s){for(var c=0;c<s.length;c++){const r=s[c];if(typeof r!="string"&
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/var Bm;function wp(){if(Bm)return uu;Bm=1;var l=Np(),s=vr(),c=ph();function r(e){var t="https://react.dev/errors/"+e;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var a=2;a<arguments.length;a++)t+="&args[]="+encodeURIComponent(arguments[a])}return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function f(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function m(e){var t=e,a=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,(t.flags&4098)!==0&&(a=t.return),e=t.return;while(e)}return t.tag===3?a:null}function h(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function p(e){if(e.tag===31){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function v(e){if(m(e)!==e)throw Error(r(188))}function g(e){var t=e.alternate;if(!t){if(t=m(e),t===null)throw Error(r(188));return t!==e?null:e}for(var a=e,n=t;;){var u=a.return;if(u===null)break;var i=u.alternate;if(i===null){if(n=u.return,n!==null){a=n;continue}break}if(u.child===i.child){for(i=u.child;i;){if(i===a)return v(u),e;if(i===n)return v(u),t;i=i.sibling}throw Error(r(188))}if(a.return!==n.return)a=u,n=i;else{for(var o=!1,d=u.child;d;){if(d===a){o=!0,a=u,n=i;break}if(d===n){o=!0,n=u,a=i;break}d=d.sibling}if(!o){for(d=i.child;d;){if(d===a){o=!0,a=i,n=u;break}if(d===n){o=!0,n=i,a=u;break}d=d.sibling}if(!o)throw Error(r(189))}}if(a.alternate!==n)throw Error(r(190))}if(a.tag!==3)throw Error(r(188));return a.stateNode.current===a?e:t}function A(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=A(e),t!==null)return t;e=e.sibling}return null}var N=Object.assign,q=Symbol.for("react.element"),F=Symbol.for("react.transitional.element"),W=Symbol.for("react.portal"),X=Symbol.for("react.fragment"),Y=Symbol.for("react.strict_mode"),C=Symbol.for("react.profiler"),K=Symbol.for("react.consumer"),Q=Symbol.for("react.context"),ee=Symbol.for("react.forward_ref"),Ee=Symbol.for("react.suspense"),me=Symbol.for("react.suspense_list"),ne=Symbol.for("react.memo"),Le=Symbol.for("react.lazy"),ct=Symbol.for("react.activity"),be=Symbol.for("react.memo_cache_sentinel"),Me=Symbol.iterator;function ke(e){return e===null||typeof e!="object"?null:(e=Me&&e[Me]||e["@@iterator"],typeof e=="function"?e:null)}var xt=Symbol.for("react.client.reference");function He(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===xt?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case X:return"Fragment";case C:return"Profiler";case Y:return"StrictMode";case Ee:return"Suspense";case me:return"SuspenseList";case ct:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case W:return"Portal";case Q:return e.displayName||"Context";case K:return(e._context.displayName||"Context")+".Consumer";case ee:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case ne:return t=e.displayName||null,t!==null?t:He(e.type)||"Memo";case Le:t=e._payload,e=e._init;try{return He(e(t))}catch{}}return null}var Re=Array.isArray,z=s.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,L=c.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,P={pending:!1,data:null,method:null,action:null},Se=[],ce=-1;function S(e){return{current:e}}function j(e){0>ce||(e.current=Se[ce],Se[ce]=null,ce--)}function H(e,t){ce++,Se[ce]=e.current,e.current=t}var G=S(null),le=S(null),Z=S(null),k=S(null);function ue(e,t){switch(H(Z,t),H(le,e),H(G,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?Id(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=Id(t),e=Pd(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}j(G),H(G,e)}function Te(){j(G),j(le),j(Z)}function Za(e){e.memoizedState!==null&&H(k,e);var t=G.current,a=Pd(t,e.type);t!==a&&(H(le,e),H(G,a))}function Ka(e){le.current===e&&(j(G),j(le)),k.current===e&&(j(k),eu._currentValue=P)}var Et,ol;function Zt(e){if(Et===void 0)try{throw Error()}catch(a){var t=a.stack.trim().match(/\n( *(at )?)/);Et=t&&t[1]||"",ol=-1<a.stack.indexOf(`
*/var Bm;function wp(){if(Bm)return uu;Bm=1;var l=Np(),s=vr(),c=ph();function r(e){var t="https://react.dev/errors/"+e;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var a=2;a<arguments.length;a++)t+="&args[]="+encodeURIComponent(arguments[a])}return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function f(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function m(e){var t=e,a=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,(t.flags&4098)!==0&&(a=t.return),e=t.return;while(e)}return t.tag===3?a:null}function h(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function p(e){if(e.tag===31){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function v(e){if(m(e)!==e)throw Error(r(188))}function g(e){var t=e.alternate;if(!t){if(t=m(e),t===null)throw Error(r(188));return t!==e?null:e}for(var a=e,n=t;;){var u=a.return;if(u===null)break;var i=u.alternate;if(i===null){if(n=u.return,n!==null){a=n;continue}break}if(u.child===i.child){for(i=u.child;i;){if(i===a)return v(u),e;if(i===n)return v(u),t;i=i.sibling}throw Error(r(188))}if(a.return!==n.return)a=u,n=i;else{for(var o=!1,d=u.child;d;){if(d===a){o=!0,a=u,n=i;break}if(d===n){o=!0,n=u,a=i;break}d=d.sibling}if(!o){for(d=i.child;d;){if(d===a){o=!0,a=i,n=u;break}if(d===n){o=!0,n=i,a=u;break}d=d.sibling}if(!o)throw Error(r(189))}}if(a.alternate!==n)throw Error(r(190))}if(a.tag!==3)throw Error(r(188));return a.stateNode.current===a?e:t}function A(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=A(e),t!==null)return t;e=e.sibling}return null}var N=Object.assign,q=Symbol.for("react.element"),F=Symbol.for("react.transitional.element"),W=Symbol.for("react.portal"),X=Symbol.for("react.fragment"),Y=Symbol.for("react.strict_mode"),C=Symbol.for("react.profiler"),K=Symbol.for("react.consumer"),Q=Symbol.for("react.context"),ee=Symbol.for("react.forward_ref"),Ee=Symbol.for("react.suspense"),me=Symbol.for("react.suspense_list"),ne=Symbol.for("react.memo"),Le=Symbol.for("react.lazy"),ct=Symbol.for("react.activity"),be=Symbol.for("react.memo_cache_sentinel"),Me=Symbol.iterator;function ke(e){return e===null||typeof e!="object"?null:(e=Me&&e[Me]||e["@@iterator"],typeof e=="function"?e:null)}var xt=Symbol.for("react.client.reference");function He(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===xt?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case X:return"Fragment";case C:return"Profiler";case Y:return"StrictMode";case Ee:return"Suspense";case me:return"SuspenseList";case ct:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case W:return"Portal";case Q:return e.displayName||"Context";case K:return(e._context.displayName||"Context")+".Consumer";case ee:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case ne:return t=e.displayName||null,t!==null?t:He(e.type)||"Memo";case Le:t=e._payload,e=e._init;try{return He(e(t))}catch{}}return null}var Re=Array.isArray,z=s.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,L=c.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,P={pending:!1,data:null,method:null,action:null},Se=[],re=-1;function S(e){return{current:e}}function j(e){0>re||(e.current=Se[re],Se[re]=null,re--)}function H(e,t){re++,Se[re]=e.current,e.current=t}var G=S(null),le=S(null),Z=S(null),k=S(null);function ue(e,t){switch(H(Z,t),H(le,e),H(G,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?Id(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=Id(t),e=Pd(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}j(G),H(G,e)}function Te(){j(G),j(le),j(Z)}function Za(e){e.memoizedState!==null&&H(k,e);var t=G.current,a=Pd(t,e.type);t!==a&&(H(le,e),H(G,a))}function Ka(e){le.current===e&&(j(G),j(le)),k.current===e&&(j(k),eu._currentValue=P)}var Et,ol;function Zt(e){if(Et===void 0)try{throw Error()}catch(a){var t=a.stack.trim().match(/\n( *(at )?)/);Et=t&&t[1]||"",ol=-1<a.stack.indexOf(`
at`)?" (<anonymous>)":-1<a.stack.indexOf("@")?"@unknown:0:0":""}return`
`+Et+e+ol}var At=!1;function ie(e,t){if(!e||At)return"";At=!0;var a=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var n={DetermineComponentFrameRoot:function(){try{if(t){var U=function(){throw Error()};if(Object.defineProperty(U.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(U,[])}catch(w){var R=w}Reflect.construct(e,[],U)}else{try{U.call()}catch(w){R=w}e.call(U.prototype)}}else{try{throw Error()}catch(w){R=w}(U=e())&&typeof U.catch=="function"&&U.catch(function(){})}}catch(w){if(w&&R&&typeof w.stack=="string")return[w.stack,R.stack]}return[null,null]}};n.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var u=Object.getOwnPropertyDescriptor(n.DetermineComponentFrameRoot,"name");u&&u.configurable&&Object.defineProperty(n.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var i=n.DetermineComponentFrameRoot(),o=i[0],d=i[1];if(o&&d){var b=o.split(`
`+Et+e+ol}var At=!1;function se(e,t){if(!e||At)return"";At=!0;var a=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var n={DetermineComponentFrameRoot:function(){try{if(t){var U=function(){throw Error()};if(Object.defineProperty(U.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(U,[])}catch(w){var R=w}Reflect.construct(e,[],U)}else{try{U.call()}catch(w){R=w}e.call(U.prototype)}}else{try{throw Error()}catch(w){R=w}(U=e())&&typeof U.catch=="function"&&U.catch(function(){})}}catch(w){if(w&&R&&typeof w.stack=="string")return[w.stack,R.stack]}return[null,null]}};n.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var u=Object.getOwnPropertyDescriptor(n.DetermineComponentFrameRoot,"name");u&&u.configurable&&Object.defineProperty(n.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var i=n.DetermineComponentFrameRoot(),o=i[0],d=i[1];if(o&&d){var b=o.split(`
`),O=d.split(`
`);for(u=n=0;n<b.length&&!b[n].includes("DetermineComponentFrameRoot");)n++;for(;u<O.length&&!O[u].includes("DetermineComponentFrameRoot");)u++;if(n===b.length||u===O.length)for(n=b.length-1,u=O.length-1;1<=n&&0<=u&&b[n]!==O[u];)u--;for(;1<=n&&0<=u;n--,u--)if(b[n]!==O[u]){if(n!==1||u!==1)do if(n--,u--,0>u||b[n]!==O[u]){var D=`
`+b[n].replace(" at new "," at ");return e.displayName&&D.includes("<anonymous>")&&(D=D.replace("<anonymous>",e.displayName)),D}while(1<=n&&0<=u);break}}}finally{At=!1,Error.prepareStackTrace=a}return(a=e?e.displayName||e.name:"")?Zt(a):""}function dt(e,t){switch(e.tag){case 26:case 27:case 5:return Zt(e.type);case 16:return Zt("Lazy");case 13:return e.child!==t&&t!==null?Zt("Suspense Fallback"):Zt("Suspense");case 19:return Zt("SuspenseList");case 0:case 15:return ie(e.type,!1);case 11:return ie(e.type.render,!1);case 1:return ie(e.type,!0);case 31:return Zt("Activity");default:return""}}function Kt(e){try{var t="",a=null;do t+=dt(e,a),a=e,e=e.return;while(e);return t}catch(n){return`
`+b[n].replace(" at new "," at ");return e.displayName&&D.includes("<anonymous>")&&(D=D.replace("<anonymous>",e.displayName)),D}while(1<=n&&0<=u);break}}}finally{At=!1,Error.prepareStackTrace=a}return(a=e?e.displayName||e.name:"")?Zt(a):""}function dt(e,t){switch(e.tag){case 26:case 27:case 5:return Zt(e.type);case 16:return Zt("Lazy");case 13:return e.child!==t&&t!==null?Zt("Suspense Fallback"):Zt("Suspense");case 19:return Zt("SuspenseList");case 0:case 15:return se(e.type,!1);case 11:return se(e.type.render,!1);case 1:return se(e.type,!0);case 31:return Zt("Activity");default:return""}}function Kt(e){try{var t="",a=null;do t+=dt(e,a),a=e,e=e.return;while(e);return t}catch(n){return`
Error generating stack: `+n.message+`
`+n.stack}}var Jt=Object.prototype.hasOwnProperty,vn=l.unstable_scheduleCallback,fl=l.unstable_cancelCallback,Ja=l.unstable_shouldYield,ty=l.unstable_requestPaint,Tt=l.unstable_now,ay=l.unstable_getCurrentPriorityLevel,Rr=l.unstable_ImmediatePriority,wr=l.unstable_UserBlockingPriority,mu=l.unstable_NormalPriority,ny=l.unstable_LowPriority,zr=l.unstable_IdlePriority,ly=l.log,uy=l.unstable_setDisableYieldValue,dl=null,Ot=null;function Sa(e){if(typeof ly=="function"&&uy(e),Ot&&typeof Ot.setStrictMode=="function")try{Ot.setStrictMode(dl,e)}catch{}}var Nt=Math.clz32?Math.clz32:cy,iy=Math.log,sy=Math.LN2;function cy(e){return e>>>=0,e===0?32:31-(iy(e)/sy|0)|0}var hu=256,yu=262144,pu=4194304;function $a(e){var t=e&42;if(t!==0)return t;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:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return e&261888;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function gu(e,t,a){var n=e.pendingLanes;if(n===0)return 0;var u=0,i=e.suspendedLanes,o=e.pingedLanes;e=e.warmLanes;var d=n&134217727;return d!==0?(n=d&~i,n!==0?u=$a(n):(o&=d,o!==0?u=$a(o):a||(a=d&~e,a!==0&&(u=$a(a))))):(d=n&~i,d!==0?u=$a(d):o!==0?u=$a(o):a||(a=n&~e,a!==0&&(u=$a(a)))),u===0?0:t!==0&&t!==u&&(t&i)===0&&(i=u&-u,a=t&-t,i>=a||i===32&&(a&4194048)!==0)?t:u}function ml(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function ry(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function jr(){var e=pu;return pu<<=1,(pu&62914560)===0&&(pu=4194304),e}function ki(e){for(var t=[],a=0;31>a;a++)t.push(e);return t}function hl(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function oy(e,t,a,n,u,i){var o=e.pendingLanes;e.pendingLanes=a,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=a,e.entangledLanes&=a,e.errorRecoveryDisabledLanes&=a,e.shellSuspendCounter=0;var d=e.entanglements,b=e.expirationTimes,O=e.hiddenUpdates;for(a=o&~a;0<a;){var D=31-Nt(a),U=1<<D;d[D]=0,b[D]=-1;var R=O[D];if(R!==null)for(O[D]=null,D=0;D<R.length;D++){var w=R[D];w!==null&&(w.lane&=-536870913)}a&=~U}n!==0&&Dr(e,n,0),i!==0&&u===0&&e.tag!==0&&(e.suspendedLanes|=i&~(o&~t))}function Dr(e,t,a){e.pendingLanes|=t,e.suspendedLanes&=~t;var n=31-Nt(t);e.entangledLanes|=t,e.entanglements[n]=e.entanglements[n]|1073741824|a&261930}function Cr(e,t){var a=e.entangledLanes|=t;for(e=e.entanglements;a;){var n=31-Nt(a),u=1<<n;u&t|e[n]&t&&(e[n]|=t),a&=~u}}function Mr(e,t){var a=t&-t;return a=(a&42)!==0?1:Yi(a),(a&(e.suspendedLanes|t))!==0?0:a}function Yi(e){switch(e){case 2:e=1;break;case 8:e=4;break;case 32:e=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:e=128;break;case 268435456:e=134217728;break;default:e=0}return e}function Vi(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function Ur(){var e=L.p;return e!==0?e:(e=window.event,e===void 0?32:xm(e.type))}function qr(e,t){var a=L.p;try{return L.p=e,t()}finally{L.p=a}}var _a=Math.random().toString(36).slice(2),at="__reactFiber$"+_a,ht="__reactProps$"+_a,Sn="__reactContainer$"+_a,Xi="__reactEvents$"+_a,fy="__reactListeners$"+_a,dy="__reactHandles$"+_a,Br="__reactResources$"+_a,yl="__reactMarker$"+_a;function Gi(e){delete e[at],delete e[ht],delete e[Xi],delete e[fy],delete e[dy]}function _n(e){var t=e[at];if(t)return t;for(var a=e.parentNode;a;){if(t=a[Sn]||a[at]){if(a=t.alternate,t.child!==null||a!==null&&a.child!==null)for(e=im(e);e!==null;){if(a=e[at])return a;e=im(e)}return t}e=a,a=e.parentNode}return null}function xn(e){if(e=e[at]||e[Sn]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function pl(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(r(33))}function En(e){var t=e[Br];return t||(t=e[Br]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function We(e){e[yl]=!0}var Hr=new Set,Lr={};function Fa(e,t){An(e,t),An(e+"Capture",t)}function An(e,t){for(Lr[e]=t,e=0;e<t.length;e++)Hr.add(t[e])}var my=RegExp("^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u21 Line truncated
`).replace(G0,"")}function Fd(e,t){return t=$d(t),$d(e)===t}function ze(e,t,a,n,u,i){switch(a){case"children":typeof n=="string"?t==="body"||t==="textarea"&&n===""||On(e,n):(typeof n=="number"||typeof n=="bigint")&&t!=="body"&&On(e,""+n);break;case"className":vu(e,"class",n);break;case"tabIndex":vu(e,"tabindex",n);break;case"dir":case"role":case"viewBox":case"width":case"height":vu(e,a,n);break;case"style":Jr(e,n,i);break;case"data":if(t!=="object"){vu(e,"data",n);break}case"src":case"href":if(n===""&&(t!=="a"||a!=="href")){e.removeAttribute(a);break}if(n==null||typeof n=="function"||typeof n=="symbol"||typeof n=="boolean"){e.removeAttribute(a);break}n=_u(""+n),e.setAttribute(a,n);break;case"action":case"formAction":if(typeof n=="function"){e.setAttribute(a,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof i=="function"&&(a==="formAction"?(t!=="input"&&ze(e,t,"name",u.name,u,null),ze(e,t,"formEncType",u.formEncType,u,null),ze(e,t,"formMethod",u.formMethod,u,null),ze(e,t,"formTarget",u.formTarget,u,null)):(ze(e,t,"encType",u.encType,u,null),ze(e,t,"method",u.method,u,null),ze(e,t,"target",u.target,u,null)));if(n==null||typeof n=="symbol"||typeof n=="boolean"){e.removeAttribute(a);break}n=_u(""+n),e.setAttribute(a,n);break;case"onClick":n!=null&&(e.onclick=na);break;case"onScroll":n!=null&&ye("scroll",e);break;case"onScrollEnd":n!=null&&ye("scrollend",e);break;case"dangerouslySetInnerHTML":if(n!=null){if(typeof n!="object"||!("__html"in n))throw Error(r(61));if(a=n.__html,a!=null){if(u.children!=null)throw Error(r(60));e.innerHTML=a}}break;case"multiple":e.multiple=n&&typeof n!="function"&&typeof n!="symbol";break;case"muted":e.muted=n&&typeof n!="function"&&typeof n!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(n==null||typeof n=="function"||typeof n=="boolean"||typeof n=="symbol"){e.removeAttribute("xlink:href");break}a=_u(""+n),e.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",a);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":n!=null&&typeof n!="function"&&typeof n!="symbol"?e.setAttribute(a,""+n):e.removeAttribute(a);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":n&&typeof n!="function"&&typeof n!="symbol"?e.setAttribute(a,""):e.removeAttribute(a);break;case"capture":case"download":n===!0?e.setAttribute(a,""):n!==!1&&n!=null&&typeof n!="function"&&typeof n!="symbol"?e.setAttribute(a,n):e.removeAttribute(a);break;case"cols":case"rows":case"size":case"span":n!=null&&typeof n!="function"&&typeof n!="symbol"&&!isNaN(n)&&1<=n?e.setAttribute(a,n):e.removeAttribute(a);break;case"rowSpan":case"start":n==null||typeof n=="function"||typeof n=="symbol"||isNaN(n)?e.removeAttribute(a):e.setAttribute(a,n);break;case"popover":ye("beforetoggle",e),ye("toggle",e),bu(e,"popover",n);break;case"xlinkActuate":aa(e,"http://www.w3.org/1999/xlink","xlink:actuate",n);break;case"xlinkArcrole":aa(e,"http://www.w3.org/1999/xlink","xlink:arcrole",n);break;case"xlinkRole":aa(e,"http://www.w3.org/1999/xlink","xlink:role",n);break;case"xlinkShow":aa(e,"http://www.w3.org/1999/xlink","xlink:show",n);break;case"xlinkTitle":aa(e,"http://www.w3.org/1999/xlink","xlink:title",n);break;case"xlinkType":aa(e,"http://www.w3.org/1999/xlink","xlink:type",n);break;case"xmlBase":aa(e,"http://www.w3.org/XML/1998/namespace","xml:base",n);break;case"xmlLang":aa(e,"http://www.w3.org/XML/1998/namespace","xml:lang",n);break;case"xmlSpace":aa(e,"http://www.w3.org/XML/1998/namespace","xml:space",n);break;case"is":bu(e,"is",n);break;case"innerText":case"textContent":break;default:(!(2<a.length)||a[0]!=="o"&&a[0]!=="O"||a[1]!=="n"&&a[1]!=="N")&&(a=by.get(a)||a,bu(e,a,n))}}function Mc(e,t,a,n,u,i){switch(a){case"style":Jr(e,n,i);break;case"dangerouslySetInnerHTML":if(n!=null){if(typeof n!="object"||!("__html"in n))throw Error(r(61));if(a=n.__html,a!=null){if(u.children!=null)throw Error(r(60));e.innerHTML=a}}break;case"children":typeof n=="string"?On(e,n):(typeof n=="number"||typeof n=="bigint")&&On(e,""+n);break;case"onScroll":n!=null&&ye("scroll",e);break;case"onScrollEnd":n!=null&&ye("scrollend",e);break;case"onClick":n!=null&&(e.onclick=na);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"inne Line truncated
@@ -269,10 +269,10 @@ Error generating stack: `+n.message+`
* See the LICENSE file in the root directory of this source tree.
*/const ag=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],_h=de("x",ag),fr="xianyu-theme-preference",xh="(prefers-color-scheme: dark)",Eh=B.createContext(null),Ah=l=>l==="light"||l==="dark"||l==="system"?l:"system",ng=()=>{if(typeof window>"u")return"system";try{return Ah(window.localStorage.getItem(fr))}catch{return"system"}},lg=()=>typeof window>"u"?"light":window.matchMedia(xh).matches?"dark":"light",ug=({children:l})=>{const[s,c]=B.useState(ng),[r,f]=B.useState(lg);B.useEffect(()=>{const v=window.matchMedia(xh),g=A=>{f(A.matches?"dark":"light")};return f(v.matches?"dark":"light"),v.addEventListener("change",g),()=>v.removeEventListener("change",g)},[]),B.useEffect(()=>{const v=g=>{g.key===fr&&c(Ah(g.newValue))};return window.addEventListener("storage",v),()=>window.removeEventListener("storage",v)},[]);const m=s==="system"?r:s;B.useLayoutEffect(()=>{const v=document.documentElement;v.dataset.theme=m,v.dataset.themePreference=s,v.classList.toggle("dark",m==="dark"),v.style.colorScheme=m;try{window.localStorage.setItem(fr,s)}catch{}},[m,s]);const h=B.useCallback(v=>{c(v)},[]),p=B.useMemo(()=>({theme:s,resolvedTheme:m,setTheme:h}),[m,h,s]);return y.jsx(Eh.Provider,{value:p,children:l})},ig=()=>{const l=B.useContext(Eh);if(!l)throw new Error("useTheme must be used inside ThemeProvider");return l},ll=[{value:"light",label:"浅色",description:"使用浅色主题",icon:X1},{value:"dark",label:"深色",description:"使用深色主题",icon:z1},{value:"system",label:"自动",description:"跟随系统外观",icon:R1}],dr=({compact:l=!1,className:s=""})=>{const{theme:c,resolvedTheme:r,setTheme:f}=ig(),m=(h,p)=>{var A,N;let v=p;if(h.key==="ArrowRight"||h.key==="ArrowDown")v=(p+1)%ll.length;else if(h.key==="ArrowLeft"||h.key==="ArrowUp")v=(p-1+ll.length)%ll.length;else if(h.key==="Home")v=0;else if(h.key==="End")v=ll.length-1;else return;h.preventDefault();const g=ll[v].value;f(g),(N=(A=h.currentTarget.parentElement)==null?void 0:A.querySelector(`[data-theme-option="${g}"]`))==null||N.focus()};return y.jsxs("div",{className:`theme-picker ${l?"theme-picker--compact":""} ${s}`.trim(),"data-resolved-theme":r,children:[!l&&y.jsxs("div",{className:"theme-picker__heading",children:[y.jsx("span",{children:"显示主题"}),y.jsx("span",{className:"theme-picker__status",children:c==="system"?`自动 · ${r==="dark"?"深色":"浅色"}`:c==="dark"?"深色":"浅色"})]}),y.jsx("div",{className:"theme-switcher",role:"radiogroup","aria-label":"显示主题",children:ll.map((h,p)=>{const v=h.icon,g=c===h.value;return y.jsxs("button",{type:"button",role:"radio","aria-checked":g,"aria-label":h.description,title:h.description,tabIndex:g?0:-1,"data-theme-option":h.value,className:`theme-switcher__option ${g?"theme-switcher__option--active":""}`,onClick:()=>f(h.value),onKeyDown:A=>m(A,p),children:[y.jsx(v,{className:"h-3.5 w-3.5"}),!l&&y.jsx("span",{children:h.label})]},h.value)})})]})};function Th(l,s){return function(){return l.apply(s,arguments)}}const{toString:sg}=Object.prototype,{getPrototypeOf:sl}=Object,{iterator:ru,toStringTag:Oh}=Symbol,Mi=(({hasOwnProperty:l})=>(s,c)=>l.call(s,c))(Object.prototype),cu=(l,s)=>{let c=l;const r=[];for(;c!=null&&c!==Object.prototype;){if(r.indexOf(c)!==-1)return!1;if(r.push(c),Mi(c,s))return!0;c=sl(c)}return!1},cg=(l,s)=>l!=null&&cu(l,s)?l[s]:void 0,Sr=(l=>s=>{const c=sg.call(s);return l[c]||(l[c]=c.slice(8,-1).toLowerCase())})(Object.create(null)),Qt=l=>(l=l.toLowerCase(),s=>Sr(s)===l),Bi=l=>s=>typeof s===l,{isArray:pn}=Array,gn=Bi("undefined");function cl(l){return l!==null&&!gn(l)&&l.constructor!==null&&!gn(l.constructor)&&_t(l.constructor.isBuffer)&&l.constructor.isBuffer(l)}const Nh=Qt("ArrayBuffer");function rg(l){let s;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?s=ArrayBuffer.isView(l):s=l&&l.buffer&&Nh(l.buffer),s}const og=Bi("string"),_t=Bi("function"),Rh=Bi("number"),rl=l=>l!==null&&typeof l=="object",fg=l=>l===!0||l===!1,ji=l=>{if(!rl(l))return!1;const s=sl(l);return(s===null||s===Object.prototype||sl(s)===null)&&!cu(l,Oh)&&!cu(l,ru)},dg=l=>{if(!rl(l)||cl(l))return!1;try{return Object.keys(l).length===0&&Object.getPrototypeOf(l)===Object.prototype}catch{return!1}},mg=Qt("Date"),hg=Qt("File"),yg=l=>!!(l&&typeof l.uri<"u"),pg=l=>l&&typeof l.getParts<"u",gg=Qt("Blob"),bg=Qt("FileList"),vg=Qt("Set"),Sg=l=>rl(l)&&_t(l.pipe);function _g(){return typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{}}const Qm=_g(),Zm=typeof Qm.FormData<"u"?Qm.FormData:void 0,xg=l=>{if(!l)return!1;if(Zm&&l instanceof Zm)return!0;const s=sl(l);if(!s||s===Object.prototype||!_t(l.append))return!1;const c=Sr(l);return c==="formdata"||c==="object"&&_t(l.toString)&&l.toString()==="[object FormData]"},Eg=Qt("URLSearchParams"),[Ag,Tg,Og,Ng]=["ReadableStream","Request","Response","Headers"].map(Qt),Rg=l=>l.trim?l.trim():l.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function ou(l,s,{allOwnKeys:c=!1}={}){if(l===null||typeoLine truncated
`).forEach(function(h){f=h.indexOf(":"),c=h.substring(0,f).trim().toLowerCase(),r=h.substring(f+1).trim();const p=x.hasOwnProp(s,c);!c||p&&x.hasOwnProp(Ig,c)||(c==="set-cookie"?p?s[c].push(r):s[c]=[r]:s[c]=p?s[c]+", "+r:r)}),s};function eb(l){let s=0,c=l.length;for(;s<c;){const r=l.charCodeAt(s);if(r!==9&&r!==32)break;s+=1}for(;c>s;){const r=l.charCodeAt(c-1);if(r!==9&&r!==32)break;c-=1}return s===0&&c===l.length?l:l.slice(s,c)}const tb=new RegExp("[\\u0000-\\u0008\\u000a-\\u001f\\u007f]+","g"),ab=new RegExp("[^\\u0009\\u0020-\\u007e\\u0080-\\u00ff]+","g");function _r(l,s){return x.isArray(l)?l.map(c=>_r(c,s)):eb(String(l).replace(s,""))}const nb=l=>_r(l,tb),lb=l=>_r(l,ab);function Mh(l){const s=Object.create(null);return x.forEach(l.toJSON(),(c,r)=>{s[r]=lb(c)}),s}const Km=Symbol("internals");function iu(l){return l&&String(l).trim().toLowerCase()}function Di(l){return l===!1||l==null?l:x.isArray(l)?l.map(Di):nb(String(l))}function ub(l){const s=Object.create(null),c=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let r;for(;r=c.exec(l);)s[r[1]]=r[2];return s}const ib=/^[!#$%&'*+\-.^_`|~0-9A-Za-z]+$/;function lr(l){let s=0,c=l.length;for(;s<c;){const r=l.charCodeAt(s);if(r!==9&&r!==32)break;s+=1}for(;c>s;){const r=l.charCodeAt(c-1);if(r!==9&&r!==32)break;c-=1}return s===0&&c===l.length?l:l.slice(s,c)}function sb(l){const s=l.length-1;if(s<1||l.charCodeAt(0)!==34||l.charCodeAt(s)!==34)return l;let c="";for(let r=1;r<s;r++){const f=l.charCodeAt(r);if(f===34||f===92&&(r+=1,r>=s))return l;c+=l[r]}return c}function cb(l){const s=Object.create(null),c=String(l);let r=0,f=!1,m=!1;function h(p){const v=lr(c.slice(r,p)),g=v.indexOf("=");if(g<1)return;const A=lr(v.slice(0,g));if(!ib.test(A))return;const N=A.toLowerCase();if(N==="__proto__"||N==="constructor"||N==="prototype")return;const q=lr(v.slice(g+1));s[N]=sb(q)}for(let p=0;p<c.length;p++){const v=c.charCodeAt(p);f?m?m=!1:v===92?m=!0:v===34&&(f=!1):v===34?f=!0:(v===44||v===59)&&(h(p),r=p+1)}return h(c.length),s}const rb=l=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(l.trim());function ur(l,s,c,r,f){if(x.isFunction(r))return r.call(this,s,c);if(f&&(s=c),!!x.isString(s)){if(x.isString(r))return s.indexOf(r)!==-1;if(x.isRegExp(r))return r.test(s)}}function ob(l){return l.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(s,c,r)=>c.toUpperCase()+r)}function fb(l,s){const c=x.toCamelCase(" "+s);["get","set","has"].forEach(r=>{Object.defineProperty(l,r+c,{__proto__:null,value:function(f,m,h){return this[r].call(this,s,f,m,h)},configurable:!0})})}let ft=class{constructor(s){s&&this.set(s)}set(s,c,r){const f=this;function m(p,v,g){const A=iu(v);if(!A)return;const N=x.findKey(f,A);(!N||f[N]===void 0||g===!0||g===void 0&&f[N]!==!1)&&(f[N||v]=Di(p))}const h=(p,v)=>x.forEach(p,(g,A)=>m(g,A,v));if(x.isPlainObject(s)||s instanceof this.constructor)h(s,c);else if(x.isString(s)&&(s=s.trim())&&!rb(s))h(Pg(s),c);else if(x.isObject(s)&&x.isSafeIterable(s)){let p=Object.create(null),v,g;for(const A of s){if(!x.isArray(A))throw new TypeError("Object iterator must return a key-value pair");g=A[0],x.hasOwnProp(p,g)?(v=p[g],p[g]=x.isArray(v)?[...v,A[1]]:[v,A[1]]):p[g]=A[1]}h(p,c)}else s!=null&&m(c,s,r);return this}get(s,c){if(s=iu(s),s){const r=x.findKey(this,s);if(r){const f=this[r];if(!c)return f;if(c===!0)return ub(f);if(x.isFunction(c))return c.call(this,f,r);if(x.isRegExp(c))return c.exec(f);throw new TypeError("parser must be boolean|regexp|function")}}}has(s,c){if(s=iu(s),s){const r=x.findKey(this,s);return!!(r&&this[r]!==void 0&&(!c||ur(this,this[r],r,c)))}return!1}delete(s,c){const r=this;let f=!1;function m(h){if(h=iu(h),h){const p=x.findKey(r,h);p&&(!c||ur(r,r[p],p,c))&&(delete r[p],f=!0)}}return x.isArray(s)?s.forEach(m):m(s),f}clear(s){const c=Object.keys(this);let r=c.length,f=!1;for(;r--;){const m=c[r];(!s||ur(this,this[m],m,s,!0))&&(delete this[m],f=!0)}return f}normalize(s){const c=this,r={};return x.forEach(this,(f,m)=>{const h=x.findKey(r,m);if(h){c[h]=Di(f),delete c[m];return}const p=s?ob(m):String(m).trim();p!==m&&delete c[m],c[p]=Di(f),r[p]=!0}),this}concat(...s){return this.constructor.concat(this,...s)}toJSON(s){const c=Object.create(null);return x.forEach(this,(r,f)=>{r!=null&&r!==!1&&(c[f]=s&&x.isArray(r)?r.join(", "):r)}),c}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([s,c])=>s+": "+c).join(`
`)}getSetCookie(){const s=this.get("set-cookie");return x.isArray(s)?s:s==null||s===!1?[]:[s]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(s){return s instanceof this?s:new this(s)}static parseParameters(s){return cb(s)}static concat(s,...c){const r=new this(s);return c.forEach(f=>r.set(f)),r}static accessor(s){const r=(this[Km]=this[Km]={accessors:{}}).accessors,f=this.prototype;function m(h){const p=iu(h);r[p]||(fb(f,h),r[p]=!0)}return x.isArray(s)?s.forEach(m):m(s),this}};ft.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);x.reduceDescriptors(ft.prototype,({value:l},s)=>{let c=s[0].toUpperCase()+s.slice(1);return{get:()=>l,set(r){this[c]=r}}});x.freezeMethods(ft);const Ui="[REDACTED ****]";function db(l){if(x.hasOwnProp(l,"toJSON"))return!0;let s=Object.getPrototypeOf(l);for(;s&&s!==Object.prototype;){if(x.hasOwnProp(s,"toJSON"))return!0;s=Object.getPrototypeOf(s)}return!1}function mb(l,s){const c=new Set(s.map(m=>String(m).toLowerCase())),r=[],f=m=>{if(m===null||typeof m!="object"||x.isBuffer(m))return m;if(r.indexOf(m)!==-1)return;m instanceof ft&&(m=m.toJSON()),r.push(m);let h;if(x.isArray(m))h=[],m.forEach((p,v)=>{const g=f(p);x.isUndefined(g)||(h[v]=g)});else{if(!x.isPlainObject(m)&&db(m))return r.pop(),m;h=Object.create(null);for(const[p,v]of Object.entries(m)){const g=c.has(p.toLowerCase())?Ui:f(v);x.isUndefined(g)||(h[p]=g)}}return r.pop(),h};return f(l)}function Jm(l){try{return String(l)}catch{return""}}function hb(l){return l.errors.map(c=>{try{return c&&c.message?Jm(c.message):Jm(c)}catch{return""}}).filter(Boolean).join("; ")||l.name||"AggregateError"}let V=class Uh extends Error{static from(s,c,r,f,m,h){let p=s.message;!p&&x.isArray(s.errors)&&s.errors.length&&(p=hb(s));const v=new Uh(p,c||s.code,r,f,m);return Object.defineProperty(v,"cause",{__proto__:null,value:s,writable:!0,enumerable:!1,configurable:!0}),v.name=s.name,s.status!=null&&v.status==null&&(v.status=s.status),h&&Object.assign(v,h),v}constructor(s,c,r,f,m){super(s),Object.defineProperty(this,"message",{__proto__:null,value:s,enumerable:!0,writable:!0,configurable:!0}),this.name="AxiosError",this.isAxiosError=!0,c&&(this.code=c),r&&(this.config=r),f&&(this.request=f),m&&(this.response=m,this.status=m.status)}toJSON(){const s=this.config,c=s&&x.hasOwnProp(s,"redact")?s.redact:void 0,r=x.isArray(c)&&c.length>0?mb(s,c):x.toJSONObject(s);return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:r,code:this.code,status:this.status}}};V.ERR_BAD_OPTION_VALUE="ERR_BAD_OPTION_VALUE";V.ERR_BAD_OPTION="ERR_BAD_OPTION";V.ECONNABORTED="ECONNABORTED";V.ETIMEDOUT="ETIMEDOUT";V.ECONNREFUSED="ECONNREFUSED";V.ERR_NETWORK="ERR_NETWORK";V.ERR_FR_TOO_MANY_REDIRECTS="ERR_FR_TOO_MANY_REDIRECTS";V.ERR_DEPRECATED="ERR_DEPRECATED";V.ERR_BAD_RESPONSE="ERR_BAD_RESPONSE";V.ERR_BAD_REQUEST="ERR_BAD_REQUEST";V.ERR_CANCELED="ERR_CANCELED";V.ERR_NOT_SUPPORT="ERR_NOT_SUPPORT";V.ERR_INVALID_URL="ERR_INVALID_URL";V.ERR_FORM_DATA_DEPTH_EXCEEDED="ERR_FORM_DATA_DEPTH_EXCEEDED";const yb=null,qh=100;function hr(l){return x.isPlainObject(l)||x.isArray(l)}function Bh(l){return x.endsWith(l,"[]")?l.slice(0,-2):l}function ir(l,s,c){return l?l.concat(s).map(function(f,m){return f=Bh(f),!c&&m?"["+f+"]":f}).join(c?".":""):s}function pb(l){return x.isArray(l)&&!l.some(hr)}const gb=x.toFlatObject(x,{},null,function(s){return/^is[A-Z]/.test(s)});function Hi(l,s,c){if(!x.isObject(l))throw new TypeError("target must be an object");s=s||new FormData,c=x.toFlatObject(c,{metaTokens:!0,dots:!1,indexes:!1},!1,function(K,Q){return!x.isUndefined(Q[K])});const r=c.metaTokens,f=c.visitor||W,m=c.dots,h=c.indexes,p=c.Blob||typeof Blob<"u"&&Blob,v=c.maxDepth===void 0?qh:c.maxDepth,g=p&&x.isSpecCompliantForm(s),A=[];if(!x.isFunction(f))throw new TypeError("visitor must be a function");function N(C){if(C===null)return"";if(x.isDate(C))return C.toISOString();if(x.isBoolean(C))return C.toString();if(!g&&x.isBlob(C))throw new V("Blob is not supported. Use a Buffer instead.");if(x.isArrayBuffer(C)||x.isTypedArray(C)){if(g&&typeof p=="function")return new p([C]);throw new V("Blob is not supported. Use a Buffer instead.",V.ERR_NOT_SUPPORT)}return C}function q(C){if(C>v)throw new V("Object is too deeply nested ("+C+" levels). Max depth: "+v,V.ERR_FORM_DATA_DEPTH_EXCEEDED)}function F(C,K){if(v===1/0)return JSON.stringify(C);const Q=[];return JSON.stringify(C,function(Ee,me){if(!x.isObject(me))return me;for(;Q.length&&Q[Q.length-1]!==this;)Q.pop();return Q.push(me),q(K+Q.length-1),me})}function W(C,K,Q){let ee=C;if(x.isReactNative(s)&&x.isReactNativeBlob(C))return s.append(ir(Q,K,m),N(C)),!1;if(C&&!Q&&typeof C=="object"){if(x.endsWith(K,"{}"))K=r?K:K.slice(0,-2),C=F(C,1);else if(x.isArray(C)&&pb(C)||(x.isFileList(C)||x.endsWith(K,"[]"))&&(ee=x.toArray(C)))return K=Bh(K),ee.forEach(function(me,ne){!(x.is Line truncated
`)}getSetCookie(){const s=this.get("set-cookie");return x.isArray(s)?s:s==null||s===!1?[]:[s]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(s){return s instanceof this?s:new this(s)}static parseParameters(s){return cb(s)}static concat(s,...c){const r=new this(s);return c.forEach(f=>r.set(f)),r}static accessor(s){const r=(this[Km]=this[Km]={accessors:{}}).accessors,f=this.prototype;function m(h){const p=iu(h);r[p]||(fb(f,h),r[p]=!0)}return x.isArray(s)?s.forEach(m):m(s),this}};ft.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);x.reduceDescriptors(ft.prototype,({value:l},s)=>{let c=s[0].toUpperCase()+s.slice(1);return{get:()=>l,set(r){this[c]=r}}});x.freezeMethods(ft);const Ui="[REDACTED ****]";function db(l){if(x.hasOwnProp(l,"toJSON"))return!0;let s=Object.getPrototypeOf(l);for(;s&&s!==Object.prototype;){if(x.hasOwnProp(s,"toJSON"))return!0;s=Object.getPrototypeOf(s)}return!1}function mb(l,s){const c=new Set(s.map(m=>String(m).toLowerCase())),r=[],f=m=>{if(m===null||typeof m!="object"||x.isBuffer(m))return m;if(r.indexOf(m)!==-1)return;m instanceof ft&&(m=m.toJSON()),r.push(m);let h;if(x.isArray(m))h=[],m.forEach((p,v)=>{const g=f(p);x.isUndefined(g)||(h[v]=g)});else{if(!x.isPlainObject(m)&&db(m))return r.pop(),m;h=Object.create(null);for(const[p,v]of Object.entries(m)){const g=c.has(p.toLowerCase())?Ui:f(v);x.isUndefined(g)||(h[p]=g)}}return r.pop(),h};return f(l)}function Jm(l){try{return String(l)}catch{return""}}function hb(l){return l.errors.map(c=>{try{return c&&c.message?Jm(c.message):Jm(c)}catch{return""}}).filter(Boolean).join("; ")||l.name||"AggregateError"}let V=class Uh extends Error{static from(s,c,r,f,m,h){let p=s.message;!p&&x.isArray(s.errors)&&s.errors.length&&(p=hb(s));const v=new Uh(p,c||s.code,r,f,m);return Object.defineProperty(v,"cause",{__proto__:null,value:s,writable:!0,enumerable:!1,configurable:!0}),v.name=s.name,s.status!=null&&v.status==null&&(v.status=s.status),h&&Object.assign(v,h),v}constructor(s,c,r,f,m){super(s),Object.defineProperty(this,"message",{__proto__:null,value:s,enumerable:!0,writable:!0,configurable:!0}),this.name="AxiosError",this.isAxiosError=!0,c&&(this.code=c),r&&(this.config=r),f&&(this.request=f),m&&(this.response=m,this.status=m.status)}toJSON(){const s=this.config,c=s&&x.hasOwnProp(s,"redact")?s.redact:void 0,r=x.isArray(c)&&c.length>0?mb(s,c):x.toJSONObject(s);return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:r,code:this.code,status:this.status}}};V.ERR_BAD_OPTION_VALUE="ERR_BAD_OPTION_VALUE";V.ERR_BAD_OPTION="ERR_BAD_OPTION";V.ECONNABORTED="ECONNABORTED";V.ETIMEDOUT="ETIMEDOUT";V.ECONNREFUSED="ECONNREFUSED";V.ERR_NETWORK="ERR_NETWORK";V.ERR_FR_TOO_MANY_REDIRECTS="ERR_FR_TOO_MANY_REDIRECTS";V.ERR_DEPRECATED="ERR_DEPRECATED";V.ERR_BAD_RESPONSE="ERR_BAD_RESPONSE";V.ERR_BAD_REQUEST="ERR_BAD_REQUEST";V.ERR_CANCELED="ERR_CANCELED";V.ERR_NOT_SUPPORT="ERR_NOT_SUPPORT";V.ERR_INVALID_URL="ERR_INVALID_URL";V.ERR_FORM_DATA_DEPTH_EXCEEDED="ERR_FORM_DATA_DEPTH_EXCEEDED";const yb=null,qh=100;function hr(l){return x.isPlainObject(l)||x.isArray(l)}function Bh(l){return x.endsWith(l,"[]")?l.slice(0,-2):l}function ir(l,s,c){return l?l.concat(s).map(function(f,m){return f=Bh(f),!c&&m?"["+f+"]":f}).join(c?".":""):s}function pb(l){return x.isArray(l)&&!l.some(hr)}const gb=x.toFlatObject(x,{},null,function(s){return/^is[A-Z]/.test(s)});function Hi(l,s,c){if(!x.isObject(l))throw new TypeError("target must be an object");s=s||new FormData,c=x.toFlatObject(c,{metaTokens:!0,dots:!1,indexes:!1},!1,function(K,Q){return!x.isUndefined(Q[K])});const r=c.metaTokens,f=c.visitor||W,m=c.dots,h=c.indexes,p=c.Blob||typeof Blob<"u"&&Blob,v=c.maxDepth===void 0?qh:c.maxDepth,g=p&&x.isSpecCompliantForm(s),A=[];if(!x.isFunction(f))throw new TypeError("visitor must be a function");function N(C){if(C===null)return"";if(x.isDate(C))return C.toISOString();if(x.isBoolean(C))return C.toString();if(!g&&x.isBlob(C))throw new V("Blob is not supported. Use a Buffer instead.");if(x.isArrayBuffer(C)||x.isTypedArray(C)){if(g&&typeof p=="function")return new p([C]);throw new V("Blob is not supported. Use a Buffer instead.",V.ERR_NOT_SUPPORT)}return C}function q(C){if(C>v)throw new V("Object is too deeply nested ("+C+" levels). Max depth: "+v,V.ERR_FORM_DATA_DEPTH_EXCEEDED)}function F(C,K){if(v===1/0)return JSON.stringify(C);const Q=[];return JSON.stringify(C,function(Ee,me){if(!x.isObject(me))return me;for(;Q.length&&Q[Q.length-1]!==this;)Q.pop();return Q.push(me),q(K+Q.length-1),me})}function W(C,K,Q){let ee=C;if(x.isReactNative(s)&&x.isReactNativeBlob(C))return s.append(ir(Q,K,m),N(C)),!1;if(C&&!Q&&typeof C=="object"){if(x.endsWith(K,"{}"))K=r?K:K.slice(0,-2),C=F(C,1);else if(x.isArray(C)&&pb(C)||(x.isFileList(C)||x.endsWith(K,"[]"))&&(ee=x.toArray(C)))return K=Bh(K),ee.forEach(function(me,ne){!(x.is Line truncated
`+h.map(ch).join(`
`):" "+ch(h[0]):"as no adapter specified";throw new V("There is no suitable adapter to dispatch the request "+p,V.ERR_NOT_SUPPORT)}return f}const Jh={getAdapter:dv,adapters:Or};function cr(l){if(l.cancelToken&&l.cancelToken.throwIfRequested(),l.signal&&l.signal.aborted)throw new du(null,l)}function rr(l){return cr(l),l.headers=ft.from(l.headers),l.data=sr.call(l,l.transformRequest),["post","put","patch"].indexOf(l.method)!==-1&&l.headers.setContentType("application/x-www-form-urlencoded",!1),Jh.getAdapter(l.adapter||fu.adapter,l)(l).then(function(r){cr(l),l.response=r;try{r.data=sr.call(l,l.transformResponse,r)}finally{delete l.response}return r.headers=ft.from(r.headers),r},function(r){if(!Vh(r)&&(cr(l),r&&r.response)){l.response=r.response;try{r.response.data=sr.call(l,l.transformResponse,r.response)}finally{delete l.response}r.response.headers=ft.from(r.response.headers)}return Promise.reject(r)})}const Li={};["object","boolean","number","function","string","symbol"].forEach((l,s)=>{Li[l]=function(r){return typeof r===l||"a"+(s<1?"n ":" ")+l}});const rh={};Li.transitional=function(s,c,r){function f(m,h){return"[Axios v"+Tr+"] Transitional option '"+m+"'"+h+(r?". "+r:"")}return(m,h,p)=>{if(s===!1)throw new V(f(h," has been removed"+(c?" in "+c:"")),V.ERR_DEPRECATED);return c&&!rh[h]&&(rh[h]=!0,console.warn(f(h," has been deprecated since v"+c+" and will be removed in the near future"))),s?s(m,h,p):!0}};Li.spelling=function(s){return(c,r)=>(console.warn(`${r} is likely a misspelling of ${s}`),!0)};function mv(l,s,c){if(typeof l!="object"||l===null)throw new V("options must be an object",V.ERR_BAD_OPTION_VALUE);const r=Object.keys(l);let f=r.length;for(;f-- >0;){const m=r[f],h=Object.prototype.hasOwnProperty.call(s,m)?s[m]:void 0;if(h){const p=l[m],v=p===void 0||h(p,m,l);if(v!==!0)throw new V("option "+m+" must be "+v,V.ERR_BAD_OPTION_VALUE);continue}if(c!==!0)throw new V("Unknown option "+m,V.ERR_BAD_OPTION)}}const Ci={assertOptions:mv,validators:Li},ot=Ci.validators;let yn=class{constructor(s){this.defaults=s||{},this.interceptors={request:new Fm,response:new Fm}}async request(s,c){try{return await this._request(s,c)}catch(r){if(r instanceof Error){let f={};Error.captureStackTrace?Error.captureStackTrace(f):f=new Error;const m=(()=>{if(!f.stack)return"";const h=f.stack.indexOf(`
`);return h===-1?"":f.stack.slice(h+1)})();try{if(!r.stack)r.stack=m;else if(m){const h=m.indexOf(`
`),p=h===-1?-1:m.indexOf(`
`,h+1),v=p===-1?"":m.slice(p+1);String(r.stack).endsWith(v)||(r.stack+=`
`+m)}}catch{}}throw r}}_request(s,c){typeof s=="string"?(c=c||{},c.url=s):c=s||{},c=bn(this.defaults,c);const{transitional:r,paramsSerializer:f,headers:m}=c;r!==void 0&&Ci.assertOptions(r,{silentJSONParsing:ot.transitional(ot.boolean),forcedJSONParsing:ot.transitional(ot.boolean),clarifyTimeoutError:ot.transitional(ot.boolean),legacyInterceptorReqResOrdering:ot.transitional(ot.boolean),advertiseZstdAcceptEncoding:ot.transitional(ot.boolean),validateStatusUndefinedResolves:ot.transitional(ot.boolean)},!1),f!=null&&(x.isFunction(f)?c.paramsSerializer={serialize:f}:Ci.assertOptions(f,{encode:ot.function,serialize:ot.function},!0)),c.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?c.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:c.allowAbsoluteUrls=!0),Ci.assertOptions(c,{baseUrl:ot.spelling("baseURL"),withXsrfToken:ot.spelling("withXSRFToken")},!0),c.method=(c.method||this.defaults.method||"get").toLowerCase();let h=m&&x.merge(m.common,m[c.method]);m&&x.forEach(["delete","get","head","post","put","patch","query","common"],W=>{delete m[W]}),c.headers=ft.concat(h,m);const p=[];let v=!0;this.interceptors.request.forEach(function(X){if(typeof X.runWhen=="function"&&X.runWhen(c)===!1)return;v=v&&X.synchronous;const Y=c.transitional||Er;Y&&Y.legacyInterceptorReqResOrdering?p.unshift(X.fulfilled,X.rejected):p.push(X.fulfilled,X.rejected)});const g=[];this.interceptors.response.forEach(function(X){g.push(X.fulfilled,X.rejected)});let A,N=0,q;if(!v){const W=[rr.bind(this),void 0];for(W.unshift(...p),W.push(...g),q=W.length,A=Promise.resolve(c);N<q;)A=A.then(W[N++],W[N++]);return A}q=p.length;let F=c;for(;N<q;){const W=p[N++],X=p[N++];try{F=W?W(F):F}catch(Y){if(!X){A=Promise.reject(Y);break}try{const C=X.call(this,Y);x.isThenable(C)&&(A=Promise.resolve(C).then(()=>rr.call(this,F)))}catch(C){A=Promise.reject(C)}break}}if(!A)try{A=rr.call(this,F)}catch(W){A=Promise.reject(W)}for(N=0,q=g.length;N<q;)A=A.then(g[N++],g[N++]);return A}getUri(s){s=bn(this.defaults,s);const c=Gh(s.baseURL,s.url,s.allowAbsoluteUrls,s);return Lh(c,s.params,s.paramsSerializer)}};x.forEach(["delete","get","head","options"],function(s){yn.prototype[s]=function(c,r){return this.request(bn(r||{},{method:s,url:c,data:r&&x.hasOwnProp(r,"data")?r.data:void 0}))}});x.forEach(["post","put","patch","query"],function(s){function c(r){return function(m,h,p){return this.request(bn(p||{},{method:s,headers:r?{"Content-Type":"multipart/form-data"}:{},url:m,data:h}))}}yn.prototype[s]=c(),s!=="query"&&(yn.prototype[s+"Form"]=c(!0))});let hv=class $h{constructor(s){if(typeof s!="function")throw new TypeError("executor must be a function.");let c;this.promise=new Promise(function(m){c=m});const r=this;this.promise.then(f=>{if(!r._listeners)return;let m=r._listeners.length;for(;m-- >0;)r._listeners[m](f);r._listeners=null}),this.promise.then=f=>{let m;const h=new Promise(p=>{r.subscribe(p),m=p}).then(f);return h.cancel=function(){r.unsubscribe(m)},h},s(function(m,h,p){r.reason||(r.reason=new du(m,h,p),c(r.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(s){if(this.reason){s(this.reason);return}this._listeners?this._listeners.push(s):this._listeners=[s]}unsubscribe(s){if(!this._listeners)return;const c=this._listeners.indexOf(s);c!==-1&&this._listeners.splice(c,1)}toAbortSignal(){const s=new AbortController,c=r=>{s.abort(r)};return this.subscribe(c),s.signal.unsubscribe=()=>this.unsubscribe(c),s.signal}static source(){let s;return{token:new $h(function(f){s=f}),cancel:s}}};function yv(l){return function(c){return l.apply(null,c)}}function pv(l){return x.isObject(l)&&l.isAxiosError===!0}const pr={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511,WebServerReturnsAnUnknownError:520,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCe Line truncated
`+m)}}catch{}}throw r}}_request(s,c){typeof s=="string"?(c=c||{},c.url=s):c=s||{},c=bn(this.defaults,c);const{transitional:r,paramsSerializer:f,headers:m}=c;r!==void 0&&Ci.assertOptions(r,{silentJSONParsing:ot.transitional(ot.boolean),forcedJSONParsing:ot.transitional(ot.boolean),clarifyTimeoutError:ot.transitional(ot.boolean),legacyInterceptorReqResOrdering:ot.transitional(ot.boolean),advertiseZstdAcceptEncoding:ot.transitional(ot.boolean),validateStatusUndefinedResolves:ot.transitional(ot.boolean)},!1),f!=null&&(x.isFunction(f)?c.paramsSerializer={serialize:f}:Ci.assertOptions(f,{encode:ot.function,serialize:ot.function},!0)),c.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?c.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:c.allowAbsoluteUrls=!0),Ci.assertOptions(c,{baseUrl:ot.spelling("baseURL"),withXsrfToken:ot.spelling("withXSRFToken")},!0),c.method=(c.method||this.defaults.method||"get").toLowerCase();let h=m&&x.merge(m.common,m[c.method]);m&&x.forEach(["delete","get","head","post","put","patch","query","common"],W=>{delete m[W]}),c.headers=ft.concat(h,m);const p=[];let v=!0;this.interceptors.request.forEach(function(X){if(typeof X.runWhen=="function"&&X.runWhen(c)===!1)return;v=v&&X.synchronous;const Y=c.transitional||Er;Y&&Y.legacyInterceptorReqResOrdering?p.unshift(X.fulfilled,X.rejected):p.push(X.fulfilled,X.rejected)});const g=[];this.interceptors.response.forEach(function(X){g.push(X.fulfilled,X.rejected)});let A,N=0,q;if(!v){const W=[rr.bind(this),void 0];for(W.unshift(...p),W.push(...g),q=W.length,A=Promise.resolve(c);N<q;)A=A.then(W[N++],W[N++]);return A}q=p.length;let F=c;for(;N<q;){const W=p[N++],X=p[N++];try{F=W?W(F):F}catch(Y){if(!X){A=Promise.reject(Y);break}try{const C=X.call(this,Y);x.isThenable(C)&&(A=Promise.resolve(C).then(()=>rr.call(this,F)))}catch(C){A=Promise.reject(C)}break}}if(!A)try{A=rr.call(this,F)}catch(W){A=Promise.reject(W)}for(N=0,q=g.length;N<q;)A=A.then(g[N++],g[N++]);return A}getUri(s){s=bn(this.defaults,s);const c=Gh(s.baseURL,s.url,s.allowAbsoluteUrls,s);return Lh(c,s.params,s.paramsSerializer)}};x.forEach(["delete","get","head","options"],function(s){yn.prototype[s]=function(c,r){return this.request(bn(r||{},{method:s,url:c,data:r&&x.hasOwnProp(r,"data")?r.data:void 0}))}});x.forEach(["post","put","patch","query"],function(s){function c(r){return function(m,h,p){return this.request(bn(p||{},{method:s,headers:r?{"Content-Type":"multipart/form-data"}:{},url:m,data:h}))}}yn.prototype[s]=c(),s!=="query"&&(yn.prototype[s+"Form"]=c(!0))});let hv=class $h{constructor(s){if(typeof s!="function")throw new TypeError("executor must be a function.");let c;this.promise=new Promise(function(m){c=m});const r=this;this.promise.then(f=>{if(!r._listeners)return;let m=r._listeners.length;for(;m-- >0;)r._listeners[m](f);r._listeners=null}),this.promise.then=f=>{let m;const h=new Promise(p=>{r.subscribe(p),m=p}).then(f);return h.cancel=function(){r.unsubscribe(m)},h},s(function(m,h,p){r.reason||(r.reason=new du(m,h,p),c(r.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(s){if(this.reason){s(this.reason);return}this._listeners?this._listeners.push(s):this._listeners=[s]}unsubscribe(s){if(!this._listeners)return;const c=this._listeners.indexOf(s);c!==-1&&this._listeners.splice(c,1)}toAbortSignal(){const s=new AbortController,c=r=>{s.abort(r)};return this.subscribe(c),s.signal.unsubscribe=()=>this.unsubscribe(c),s.signal}static source(){let s;return{token:new $h(function(f){s=f}),cancel:s}}};function yv(l){return function(c){return l.apply(null,c)}}function pv(l){return x.isObject(l)&&l.isAxiosError===!0}const pr={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511,WebServerReturnsAnUnknownError:520,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCe Line truncated
-1
View File
@@ -1 +0,0 @@
*,:before,:after{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }::backdrop{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }*,:before,:after{box-sizing:border-box;border-width:0;border-style:solid;border-color:rgb(var(--gray-200) / 1)}:before,:after{--tw-content: ""}html,:host{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:-apple-system,BlinkMacSystemFont,PingFang SC,Hiragino Sans GB,Microsoft YaHei,Helvetica Neue,Helvetica,Arial,sans-serif;font-feature-settings:normal;font-variation-settings:normal;-webkit-tap-highlight-color:transparent}body{margin:0;line-height:inherit}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;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-feature-settings:normal;font-variation-settings:normal;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;letter-spacing:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,input:where([type=button]),input:where([type=reset]),input:where([type=submit]){-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}fieldset{margin:0;padding:0}legend{padding:0}ol,ul,menu{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{opacity:1;color:rgb(var(--gray-400) / 1)}input::placeholder,textarea::placeholder{opacity:1;color:rgb(var(--gray-400) / 1)}button,[role=button]{cursor:pointer}:disabled{cursor:default}img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]:where(:not([hidden=until-found])){display:none}.pointer-events-none{pointer-events:none}.visible{visibility:visible}.static{position:static}.fixed{position:fixed}.absolute{position:absolute}.relative{position:relativeLine truncated
+1
View File
@@ -0,0 +1 @@
*,:before,:after{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }::backdrop{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }*,:before,:after{box-sizing:border-box;border-width:0;border-style:solid;border-color:rgb(var(--gray-200) / 1)}:before,:after{--tw-content: ""}html,:host{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:-apple-system,BlinkMacSystemFont,PingFang SC,Hiragino Sans GB,Microsoft YaHei,Helvetica Neue,Helvetica,Arial,sans-serif;font-feature-settings:normal;font-variation-settings:normal;-webkit-tap-highlight-color:transparent}body{margin:0;line-height:inherit}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;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-feature-settings:normal;font-variation-settings:normal;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;letter-spacing:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,input:where([type=button]),input:where([type=reset]),input:where([type=submit]){-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}fieldset{margin:0;padding:0}legend{padding:0}ol,ul,menu{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{opacity:1;color:rgb(var(--gray-400) / 1)}input::placeholder,textarea::placeholder{opacity:1;color:rgb(var(--gray-400) / 1)}button,[role=button]{cursor:pointer}:disabled{cursor:default}img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]:where(:not([hidden=until-found])){display:none}.pointer-events-none{pointer-events:none}.visible{visibility:visible}.static{position:static}.fixed{position:fixed}.absolute{position:absolute}.relative{position:relativeLine truncated
@@ -1,4 +1,4 @@
import{c}from"./index-BIvz5Jcw.js";/**
import{c}from"./index-BZnqBmwp.js";/**
* @license lucide-react v0.562.0 - ISC
*
* This source code is licensed under the ISC license.
@@ -1,4 +1,4 @@
import{c as e}from"./index-BIvz5Jcw.js";/**
import{c as e}from"./index-BZnqBmwp.js";/**
* @license lucide-react v0.562.0 - ISC
*
* This source code is licensed under the ISC license.
@@ -1,4 +1,4 @@
import{c as e}from"./index-BIvz5Jcw.js";/**
import{c as e}from"./index-BZnqBmwp.js";/**
* @license lucide-react v0.562.0 - ISC
*
* This source code is licensed under the ISC license.
@@ -1,4 +1,4 @@
import{c as a}from"./index-BIvz5Jcw.js";/**
import{c as a}from"./index-BZnqBmwp.js";/**
* @license lucide-react v0.562.0 - ISC
*
* This source code is licensed under the ISC license.
@@ -1,4 +1,4 @@
import{c as e}from"./index-BIvz5Jcw.js";/**
import{c as e}from"./index-BZnqBmwp.js";/**
* @license lucide-react v0.562.0 - ISC
*
* This source code is licensed under the ISC license.
@@ -1,4 +1,4 @@
import{c as e}from"./index-BIvz5Jcw.js";/**
import{c as e}from"./index-BZnqBmwp.js";/**
* @license lucide-react v0.562.0 - ISC
*
* This source code is licensed under the ISC license.
@@ -1,4 +1,4 @@
import{c as a}from"./index-BIvz5Jcw.js";/**
import{c as a}from"./index-BZnqBmwp.js";/**
* @license lucide-react v0.562.0 - ISC
*
* This source code is licensed under the ISC license.
@@ -1,4 +1,4 @@
import{c as e}from"./index-BIvz5Jcw.js";/**
import{c as e}from"./index-BZnqBmwp.js";/**
* @license lucide-react v0.562.0 - ISC
*
* This source code is licensed under the ISC license.
@@ -1,4 +1,4 @@
import{c as o}from"./index-BIvz5Jcw.js";/**
import{c as o}from"./index-BZnqBmwp.js";/**
* @license lucide-react v0.562.0 - ISC
*
* This source code is licensed under the ISC license.
@@ -1,4 +1,4 @@
import{c as o}from"./index-BIvz5Jcw.js";/**
import{c as o}from"./index-BZnqBmwp.js";/**
* @license lucide-react v0.562.0 - ISC
*
* This source code is licensed under the ISC license.
@@ -1,4 +1,4 @@
import{c as a}from"./index-BIvz5Jcw.js";/**
import{c as a}from"./index-BZnqBmwp.js";/**
* @license lucide-react v0.562.0 - ISC
*
* This source code is licensed under the ISC license.
@@ -1,4 +1,4 @@
import{c}from"./index-BIvz5Jcw.js";/**
import{c}from"./index-BZnqBmwp.js";/**
* @license lucide-react v0.562.0 - ISC
*
* This source code is licensed under the ISC license.
@@ -1,4 +1,4 @@
import{c as a}from"./index-BIvz5Jcw.js";/**
import{c as a}from"./index-BZnqBmwp.js";/**
* @license lucide-react v0.562.0 - ISC
*
* This source code is licensed under the ISC license.
@@ -1,4 +1,4 @@
import{c}from"./index-BIvz5Jcw.js";/**
import{c}from"./index-BZnqBmwp.js";/**
* @license lucide-react v0.562.0 - ISC
*
* This source code is licensed under the ISC license.
@@ -1,4 +1,4 @@
import{c as e}from"./index-BIvz5Jcw.js";/**
import{c as e}from"./index-BZnqBmwp.js";/**
* @license lucide-react v0.562.0 - ISC
*
* This source code is licensed under the ISC license.
@@ -1,4 +1,4 @@
import{c as a}from"./index-BIvz5Jcw.js";/**
import{c as a}from"./index-BZnqBmwp.js";/**
* @license lucide-react v0.562.0 - ISC
*
* This source code is licensed under the ISC license.
@@ -1,4 +1,4 @@
import{c as a}from"./index-BIvz5Jcw.js";/**
import{c as a}from"./index-BZnqBmwp.js";/**
* @license lucide-react v0.562.0 - ISC
*
* This source code is licensed under the ISC license.
@@ -1,4 +1,4 @@
import{c as a}from"./index-BIvz5Jcw.js";/**
import{c as a}from"./index-BZnqBmwp.js";/**
* @license lucide-react v0.562.0 - ISC
*
* This source code is licensed under the ISC license.
@@ -1,4 +1,4 @@
import{c as e}from"./index-BIvz5Jcw.js";/**
import{c as e}from"./index-BZnqBmwp.js";/**
* @license lucide-react v0.562.0 - ISC
*
* This source code is licensed under the ISC license.
@@ -1,4 +1,4 @@
import{c}from"./index-BIvz5Jcw.js";/**
import{c}from"./index-BZnqBmwp.js";/**
* @license lucide-react v0.562.0 - ISC
*
* This source code is licensed under the ISC license.
@@ -1,6 +1,6 @@
import{c as W,j as e,L as $,aD as A,bQ as H,X as R,r as x,b as z}from"./index-BIvz5Jcw.js";/**
import{c as W,j as e,L as $,aE as A,bT as H,X as R,r as x,b as z}from"./index-BZnqBmwp.js";/**
* @license lucide-react v0.562.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const M=[["polyline",{points:"22 12 16 12 14 15 10 15 8 12 2 12",key:"o97t9d"}],["path",{d:"M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z",key:"oot6mr"}]],C=W("inbox",M),B=({title:s,description:a,icon:c,badge:n,actions:t})=>e.jsxs("header",{className:"page-header",children:[e.jsxs("div",{className:"page-header__identity",children:[c&&e.jsx("span",{className:"page-header__icon","aria-hidden":"true",children:e.jsx(c,{className:"h-5 w-5"})}),e.jsxs("div",{className:"min-w-0",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsx("h1",{className:"page-title",children:s}),n]}),a&&e.jsx("p",{className:"page-description",children:a})]})]}),t&&e.jsx("div",{className:"page-actions",children:t})]}),F=({value:s,onChange:a,items:c,ariaLabel:n="页面分区"})=>e.jsx("div",{className:"page-tabs",role:"tablist","aria-label":n,children:c.map(t=>{const p=t.icon,m=s===t.id;return e.jsxs("button",{type:"button",role:"tab","aria-selected":m,onClick:()=>a(t.id),className:`page-tab ${m?"page-tab--active":""}`,children:[p&&e.jsx(p,{className:"h-4 w-4 shrink-0"}),e.jsx("span",{children:t.label}),t.count!==void 0&&e.jsx("span",{className:"page-tab__count",children:t.count})]},t.id)})}),I=({title:s,description:a,icon:c,actions:n})=>e.jsxs("div",{className:"section-panel__header",children:[e.jsxs("div",{className:"flex min-w-0 items-start gap-3",children:[c&&e.jsx("span",{className:"section-header__icon","aria-hidden":"true",children:e.jsx(c,{className:"h-4 w-4"})}),e.jsxs("div",{className:"min-w-0",children:[e.jsx("h2",{className:"section-title",children:s}),a&&e.jsx("p",{className:"section-description",children:a})]})]}),n&&e.jsx("div",{className:"section-header__actions",children:n})]}),q=({type:s,message:a,onClose:c,children:n})=>{const t=s==="success"?A:H;return e.jsxs("div",{className:`notice-banner notice-banner--${s}`,role:"status",children:[e.jsx(t,{className:"h-4 w-4 shrink-0"}),e.jsx("span",{className:"min-w-0 flex-1",children:a??n}),c&&e.jsx("button",{type:"button",onClick:c,"aria-label":"关闭提示",children:e.jsx(R,{className:"h-4 w-4"})})]})},T=({title:s,description:a,icon:c=C,action:n,compact:t=!1})=>e.jsxs("div",{className:`empty-state ${t?"empty-state--compact":""}`,children:[e.jsx("span",{className:"empty-state__icon","aria-hidden":"true",children:e.jsx(c,{className:"h-6 w-6"})}),e.jsx("h3",{children:s}),a&&e.jsx("p",{children:a}),n&&e.jsx("div",{className:"mt-4",children:n})]}),K=({label:s="正在加载"})=>e.jsxs("div",{className:"page-loading",role:"status",children:[e.jsx($,{className:"h-5 w-5 animate-spin"}),e.jsx("span",{children:s})]}),Q=({open:s,onClose:a,trigger:c,placement:n="bottom",align:t="left",panelClassName:p="max-h-72 w-80",children:m,portal:h=!1})=>{const f=x.useRef(null),v=x.useRef(null),[j,L]=x.useState(null);x.useEffect(()=>{if(!s)return;const u=o=>{var i,l;const r=o.target;(i=f.current)!=null&&i.contains(r)||(l=v.current)!=null&&l.contains(r)||a()},d=o=>{o.key==="Escape"&&a()};return document.addEventListener("mousedown",u),document.addEventListener("keydown",d),()=>{document.removeEventListener("mousedown",u),document.removeEventListener("keydown",d)}},[s,a]),x.useLayoutEffect(()=>{if(!s||!h)return;const u=()=>{var y,E,_;const r=(y=f.current)==null?void 0:y.getBoundingClientRect();if(!r)return;const i=8,l=((E=v.current)==null?void 0:E.offsetHeight)??0,w=((_=v.current)==null?void 0:_.offsetWidth)??0,N=window.innerHeight-r.bottom-i,b=r.top-i,k=(n==="top"?b>=l||b>=N?"top":"bottom":N>=l||N>=b?"bottom":"top")==="top"?r.top-l-i:r.bottom+i,P=t==="left"?Math.min(r.left,Math.max(i,window.innerWidth-w-i)):Math.max(i,Math.min(r.right-w,window.innerWidth-w-i));L({top:k,left:P,minWidth:r.width})};u();let d=0;const o=()=>{cancelAnimationFrame(d),d=requestAnimationFrame(u)};return window.addEventListener("resize",o),window.addEventListener("scroll",o,!0),()=>{cancelAnimationFrame(d),window.removeEventListener("resize",o),window.removeEventListener("scroll",o,!0)}},[s,h,n,t,m]);const g=e.jsx("div",{ref:v,className:`overflow-y-auto rounded-lg border border-[var(--border)] bg-[var(--surface)] p-2 shadow-lg ${h?"fixed z-50":`absolute z-20 ${n==="top"?"bottom-8":"top-8"} ${t==="left"?"left-0":"right-0"}`} ${p}`,style:h&&j?{top:j.top,left:j.left,minWidth:j.minWidth}:void 0,children:m});return e.jsxs("div",{ref:f,className:"relative",children:[c,s&&(h?z.createPortal(g,document.body):g)]})};export{T as E,C as I,q as N,K as P,I as S,B as a,F as b,Q as c};
*/const M=[["polyline",{points:"22 12 16 12 14 15 10 15 8 12 2 12",key:"o97t9d"}],["path",{d:"M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z",key:"oot6mr"}]],C=W("inbox",M),D=({title:s,description:a,icon:c,badge:n,actions:t})=>e.jsxs("header",{className:"page-header",children:[e.jsxs("div",{className:"page-header__identity",children:[c&&e.jsx("span",{className:"page-header__icon","aria-hidden":"true",children:e.jsx(c,{className:"h-5 w-5"})}),e.jsxs("div",{className:"min-w-0",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsx("h1",{className:"page-title",children:s}),n]}),a&&e.jsx("p",{className:"page-description",children:a})]})]}),t&&e.jsx("div",{className:"page-actions",children:t})]}),F=({value:s,onChange:a,items:c,ariaLabel:n="页面分区"})=>e.jsx("div",{className:"page-tabs",role:"tablist","aria-label":n,children:c.map(t=>{const p=t.icon,m=s===t.id;return e.jsxs("button",{type:"button",role:"tab","aria-selected":m,onClick:()=>a(t.id),className:`page-tab ${m?"page-tab--active":""}`,children:[p&&e.jsx(p,{className:"h-4 w-4 shrink-0"}),e.jsx("span",{children:t.label}),t.count!==void 0&&e.jsx("span",{className:"page-tab__count",children:t.count})]},t.id)})}),I=({title:s,description:a,icon:c,actions:n})=>e.jsxs("div",{className:"section-panel__header",children:[e.jsxs("div",{className:"flex min-w-0 items-start gap-3",children:[c&&e.jsx("span",{className:"section-header__icon","aria-hidden":"true",children:e.jsx(c,{className:"h-4 w-4"})}),e.jsxs("div",{className:"min-w-0",children:[e.jsx("h2",{className:"section-title",children:s}),a&&e.jsx("p",{className:"section-description",children:a})]})]}),n&&e.jsx("div",{className:"section-header__actions",children:n})]}),T=({type:s,message:a,onClose:c,children:n})=>{const t=s==="success"?A:H;return e.jsxs("div",{className:`notice-banner notice-banner--${s}`,role:"status",children:[e.jsx(t,{className:"h-4 w-4 shrink-0"}),e.jsx("span",{className:"min-w-0 flex-1",children:a??n}),c&&e.jsx("button",{type:"button",onClick:c,"aria-label":"关闭提示",children:e.jsx(R,{className:"h-4 w-4"})})]})},q=({title:s,description:a,icon:c=C,action:n,compact:t=!1})=>e.jsxs("div",{className:`empty-state ${t?"empty-state--compact":""}`,children:[e.jsx("span",{className:"empty-state__icon","aria-hidden":"true",children:e.jsx(c,{className:"h-6 w-6"})}),e.jsx("h3",{children:s}),a&&e.jsx("p",{children:a}),n&&e.jsx("div",{className:"mt-4",children:n})]}),K=({label:s="正在加载"})=>e.jsxs("div",{className:"page-loading",role:"status",children:[e.jsx($,{className:"h-5 w-5 animate-spin"}),e.jsx("span",{children:s})]}),U=({open:s,onClose:a,trigger:c,placement:n="bottom",align:t="left",panelClassName:p="max-h-72 w-80",children:m,portal:h=!1})=>{const f=x.useRef(null),v=x.useRef(null),[j,L]=x.useState(null);x.useEffect(()=>{if(!s)return;const u=o=>{var i,l;const r=o.target;(i=f.current)!=null&&i.contains(r)||(l=v.current)!=null&&l.contains(r)||a()},d=o=>{o.key==="Escape"&&a()};return document.addEventListener("mousedown",u),document.addEventListener("keydown",d),()=>{document.removeEventListener("mousedown",u),document.removeEventListener("keydown",d)}},[s,a]),x.useLayoutEffect(()=>{if(!s||!h)return;const u=()=>{var y,E,_;const r=(y=f.current)==null?void 0:y.getBoundingClientRect();if(!r)return;const i=8,l=((E=v.current)==null?void 0:E.offsetHeight)??0,w=((_=v.current)==null?void 0:_.offsetWidth)??0,N=window.innerHeight-r.bottom-i,b=r.top-i,k=(n==="top"?b>=l||b>=N?"top":"bottom":N>=l||N>=b?"bottom":"top")==="top"?r.top-l-i:r.bottom+i,P=t==="left"?Math.min(r.left,Math.max(i,window.innerWidth-w-i)):Math.max(i,Math.min(r.right-w,window.innerWidth-w-i));L({top:k,left:P,minWidth:r.width})};u();let d=0;const o=()=>{cancelAnimationFrame(d),d=requestAnimationFrame(u)};return window.addEventListener("resize",o),window.addEventListener("scroll",o,!0),()=>{cancelAnimationFrame(d),window.removeEventListener("resize",o),window.removeEventListener("scroll",o,!0)}},[s,h,n,t,m]);const g=e.jsx("div",{ref:v,className:`overflow-y-auto rounded-lg border border-[var(--border)] bg-[var(--surface)] p-2 shadow-lg ${h?"fixed z-50":`absolute z-20 ${n==="top"?"bottom-8":"top-8"} ${t==="left"?"left-0":"right-0"}`} ${p}`,style:h&&j?{top:j.top,left:j.left,minWidth:j.minWidth}:void 0,children:m});return e.jsxs("div",{ref:f,className:"relative",children:[c,s&&(h?z.createPortal(g,document.body):g)]})};export{q as E,C as I,T as N,K as P,I as S,D as a,F as b,U as c};
@@ -1,4 +1,4 @@
import{c as a}from"./index-BIvz5Jcw.js";/**
import{c as a}from"./index-BZnqBmwp.js";/**
* @license lucide-react v0.562.0 - ISC
*
* This source code is licensed under the ISC license.
+2 -2
View File
@@ -24,8 +24,8 @@
}
})();
</script>
<script type="module" crossorigin src="/static/assets/index-BIvz5Jcw.js"></script>
<link rel="stylesheet" crossorigin href="/static/assets/index-BlMpFSYI.css">
<script type="module" crossorigin src="/static/assets/index-BZnqBmwp.js"></script>
<link rel="stylesheet" crossorigin href="/static/assets/index-CRJ6TC5_.css">
</head>
<body>
<div id="root"></div>