Peach: Local-first video metadata scraper and media manager.
fix(desktop): 接回已有馆藏并在在线更新后记住数据目录
longmeidao83970e12117c
diff --git a/README.en.md b/README.en.mdindex 59f9902b1..725166fc0 100644--- a/README.en.md+++ b/README.en.md@@ -106,6 +106,10 @@ The original screenshots are lossless 3840×2160 PNGs; click to view them. You c2. Your browser opens the first-run setup page.3. Pick your media folders and who may access Peach, then start the scan.+If you already have a library but see first-run setup, choose **使用已有数据目录** and enter its `peach-data` folder. Peach keeps the existing settings, ledger and access password, and remembers the folder.++Windows standalone builds can check for and download updates under **应用与维护** in Configuration. Confirm a restart to install a downloaded update. Automatic checks and downloads are off by default and can be enabled there.+The test package is not code-signed yet. If Windows says "Windows protected your PC", make sure the file came from this project's Releases, then choose "More info → Run anyway". Transcoding and thumbnails need FFmpeg; without it you can still browse and play MP4 and WebM. See [Windows test build](docs/TESTING_DESKTOP.md) for how to install it.On Windows, the tray runs independently. Closing the Codex, Claude, or terminal session that started it keeps Peach running. Peach attempts to recover after an unexpected tray exit, up to three times within five minutes. Choosing “Quit Peach” keeps it closed. Exit reasons and recovery results are recorded in `tray-lifecycle.log` in the logs folder.diff --git a/README.md b/README.mdindex c1e67795c..84973ece8 100644--- a/README.md+++ b/README.md@@ -105,6 +105,10 @@ https://github.com/user-attachments/assets/a5610874-e611-41bb-be22-7d99f0d64b622. 浏览器会打开首次设置页。3. 选好媒体文件夹和谁能访问,开始扫描。+已有馆藏却出现首次设置页时,点「使用已有数据目录」,填入保存馆藏的 `peach-data` 目录。程序会沿用其中的设置、账本和访问密码,并记住位置。++Windows 独立包可在配置页「应用与维护」检查并下载更新;下载完成后确认重启安装。自动检查与下载默认关闭,可在同一处开启。+测试包还没有代码签名。Windows 提示「已保护你的电脑」时,确认文件来自本项目的 Release,再点「更多信息 → 仍要运行」。转码和缩略图要用到 FFmpeg,没装也能浏览和播放 MP4、WebM,安装方法见 [Windows 测试版](docs/TESTING_DESKTOP.md)。Windows 托盘独立运行,关闭启动它的 Codex、Claude 或终端不会退出 Peach。托盘异常退出后会自动尝试恢复;5 分钟内最多恢复 3 次。主动选择「退出 Peach」会保持关闭。退出原因和恢复结果可在日志目录的 `tray-lifecycle.log` 中查看。diff --git a/docs/OPERATIONS.md b/docs/OPERATIONS.mdindex 0d565618e..9ee3de5e8 100644--- a/docs/OPERATIONS.md+++ b/docs/OPERATIONS.md@@ -53,6 +53,12 @@Windows 测试包默认使用 `%LOCALAPPDATA%\Peach\peach-data`。首次设置选择其他数据目录时,启动落点的 `state/data-root.txt` 会记录所选绝对路径;托盘、子服务和再次启动均沿此记录读取设置。该文件只保存本机路径,账本和媒体留在各自目录。记录不可读、路径无效或循环时会报错。+已有配置却出现首次设置页时,选择「使用已有数据目录」,填入原数据目录,例如 `E:\Peach\peach-data`。此目录须包含有效的 `config.toml` 和账本;连接成功后,普通启动也沿用该位置。没有位置记录的任意自选目录无法在升级时自动发现,需要选择一次;不必重新初始化或删除数据。++已经通过 `--data-root` 进入馆藏的部署,在线更新的新版本会将正在使用的目录记入空的默认启动落点,随后可以普通启动。默认落点已有配置、账本或目录记录时,继续保留其选择。++恢复接口 `POST /api/setup/restore` 接收 `{"data_root":"绝对路径"}`,沿用首启的本机和同源守卫。成功返回完成页字段及 `restored=true`;失败返回 400,原因位于 `errors.data_root`。+同一个设置项的优先级:环境变量 > 设置文件 > 内置默认值。### 设置文件出问题时diff --git a/docs/REUSE.md b/docs/REUSE.mdindex 4e78eed90..13e90c277 100644--- a/docs/REUSE.md+++ b/docs/REUSE.md@@ -188,6 +188,7 @@ OneJAV、Free JAV Torrent 只给种子链接。这类条目经索引器同源的- 不用 [Velopack](https://docs.velopack.io/packaging/operating-systems/windows)(要求其安装目录与包格式)与 [WinSparkle](https://winsparkle.org/)(要求 appcast 与原生更新界面):产物是 PyInstaller ZIP、进度在 Web 显示,沿用托盘进程与目录替换协议。- Web 复用 Fieldset、Progress、confirmModal;状态由 `standalone-update.json` 保存。下载按字节计量,解压按文件数计量,替换使用阶段进度;服务重启期间保留等待状态,恢复连接后核对版本。- 新版有待应用迁移时,重启安装复用 `migrate upgrade --yes`,先保存 SQLite 备份;迁移或启动失败时恢复数据库与程序。数据库备份位于用户数据根的 `state/update-backups/`。+- 更新事务按当前配置读取 state 与账本路径,助手显式继承所选数据根。已有数据目录恢复复用严格配置解析与位置记录,只接受含配置和账本的目录。`scripts/smoke_desktop.py` 验证恢复及再次启动;`scripts/smoke_online_update.py` 使用真实 Release 包和临时馆藏验证在线更新,可注入无法启动的暂存 EXE 验证回滚。JAV 默认封面(官方封面/预览图)与视频默认大小(大图/小图)独立保存,用 localStorage、共享 Switch 与既有 `/cover`、`/poster`。设置弹窗同步首页与 JAV 的版式,筛选条可单独调当前视图。`frontend/src/jav-artwork.ts` 管作品身份、偏好恢复与缺图回退,首页、接着看、实体作品、详情推荐、Mix 静止与翻图、播放队列共用封面选择。小图展示完整封套,竖版正封完整放入大图卡片;新作封面完成取景才显示,缓存图插入时重算取景。diff --git a/docs/STATUS.md b/docs/STATUS.mdindex 8bd460f28..1a3d37ba0 100644--- a/docs/STATUS.md+++ b/docs/STATUS.md@@ -18,11 +18,11 @@- 产地是独立维度、JAV 是其投影:`region` 空时按厂牌、创作者、番号逐层推断,不落库;韩国 MIB 不算 JAV。- Windows 托盘自动恢复;重启 `restart_windows_tray.py --source`;代码、数据在内置盘,媒体在外置盘。- 托盘用普通权限:提权看不到 CloudDrive 的 `A:`/`B:`,误报脱盘。-- Windows:80→HTTPS、LAN:443;`peach-win`、`0.39.0`。重启、CA、桌面/手机通过。+- Windows:80→HTTPS、LAN:443;`peach-win`。重启、CA、桌面/手机通过。- 封面2001,v11。- 收藏、续播、播放墙续页;[路由](ROUTES.md)、[JAV](JAV_DISCOVERY.md)。- `/healthz` 报 `configurable=true`;配置、选目录共用连接判据;托盘管理 HTTPS 地址、端口及重载。-- 首启目录持久化,配置后启动后台任务;依赖提示见 [运行与配置](OPERATIONS.md)。+- 首启记住目录,支持接回已有配置;更新沿用数据根;见 [运行与配置](OPERATIONS.md)。- 密码未开,局域网匿名可读;首启可跳过密码,配置页可改可关,登录可记住设备。- macOS 是 reader,代码与 `peach-data` 在内置盘;`peach.local` 经 8900/8443 和 pf 提供 80/443,GET 正常、写入回 409。- 两端用本机 CA,私钥、凭据不跨机;代码 Git、账本单写者复制、图片 Syncthing;坐标 `<数据根>/config.toml`。diff --git a/docs/TESTING_DESKTOP.md b/docs/TESTING_DESKTOP.mdindex 27be71180..4f263fd15 100644--- a/docs/TESTING_DESKTOP.md+++ b/docs/TESTING_DESKTOP.md@@ -83,12 +83,14 @@ Windows 第一次询问防火墙权限时,只勾选「专用网络」。## 更新-在配置页「通用 → 检查更新」里操作:+在配置页「应用与维护 → 检查更新」里操作:1. 点「检查更新」。有新版本时出现「下载并安装」。2. 点「下载并安装」,等待下载、校验、解压和准备安装完成。3. 点「重启安装」。+已有馆藏却出现首次设置页时,点「使用已有数据目录」,填入保存馆藏的 `peach-data` 目录。成功连接后会记住位置,沿用原配置、账本和访问密码。尚未进入馆藏的部署可先运行新版安装包,再接回已有目录。+也可以打开「自动检查新版本」和「自动下载更新」,下载完成后仍要在这里确认重启。也可以手动更新,数据目录不用动,新版启动后会沿用已有配置:diff --git a/frontend/e2e/setup.test.ts b/frontend/e2e/setup.test.tsindex 1e63abaa1..2d31d0581 100644--- a/frontend/e2e/setup.test.ts+++ b/frontend/e2e/setup.test.ts@@ -5,6 +5,7 @@* PEACH_E2E_SETUP_DATA(临时数据根)和 PEACH_E2E_SETUP_MEDIA(一个已建好的空媒体目录)传进来。* 路由冒烟那几批没有这几个变量,本文件整组跳过。 */import assert from 'node:assert/strict';+import { readFile, unlink } from 'node:fs/promises';import { join } from 'node:path';import { after, before, describe, it } from 'node:test';@@ -19,7 +20,8 @@ const ledgerRoot = process.env.PEACH_E2E_SETUP_LEDGER_ROOT ?? '';/** 填错那一轮的 400 是预期内的:Chrome 会把它同时记成一条控制台错误和一条 4xx 响应。 */const expectedRejection = (problem: string) =>- problem === '400 /api/setup' || problem.startsWith('console Failed to load resource: the server responded with a status of 400');+ problem === '400 /api/setup' || problem === '400 /api/setup/restore'+ || problem.startsWith('console Failed to load resource: the server responded with a status of 400');describe('首次运行页', { skip: origin && media && dataRoot ? false : '只在 SetupE2ETests 起的首启服务上跑' }, () => {let browser: Browser;@@ -116,6 +118,29 @@ describe('首次运行页', { skip: origin && media && dataRoot ? false : '只await page.setViewportSize({ width: mobile.width, height: mobile.height });assert.deepEqual((await layout(page)).offenders, []);+ // 已有数据目录的入口在首启页可操作,找不到配置时保留路径并说明原因。+ const originalConfig = await readFile(join(selectedData, 'config.toml'));+ await unlink(join(dataRoot, 'state', 'data-root.txt'));+ await page.reload({ waitUntil: 'load' });+ await page.getByRole('button', { name: '使用已有数据目录', exact: true }).click();+ const existing = page.getByRole('textbox', { name: '已有数据目录' });+ await existing.fill(join(dataRoot, 'missing'));+ const restoreRejected = page.waitForResponse((response) => response.url().endsWith('/api/setup/restore'));+ await page.getByRole('button', { name: '使用此目录', exact: true }).click();+ assert.equal((await restoreRejected).status(), 400);+ await page.getByRole('alert').filter({ hasText: 'config.toml' }).waitFor({ state: 'visible' });+ assert.deepEqual((await layout(page)).offenders, []);+ await existing.fill(selectedData);+ const restoreAccepted = page.waitForResponse((response) => response.url().endsWith('/api/setup/restore'));+ await page.getByRole('button', { name: '使用此目录', exact: true }).click();+ assert.equal((await restoreAccepted).status(), 200);+ await page.getByText('已连接已有数据目录。', { exact: true }).waitFor({ state: 'visible' });+ assert.equal(await readFile(join(dataRoot, 'state', 'data-root.txt'), 'utf8'), selectedData);+ assert.deepEqual(await readFile(join(selectedData, 'config.toml')), originalConfig);+ assert.deepEqual((await layout(page)).offenders, []);+ await page.setViewportSize({ width: viewport.width, height: viewport.height });+ assert.deepEqual((await layout(page)).offenders, []);+assert.deepEqual(problems.filter((problem) => !expectedRejection(problem)), []);} finally {await context.close();diff --git a/frontend/src/react/pages/setup/setup-api.ts b/frontend/src/react/pages/setup/setup-api.tsindex a365021d7..0cc4e0145 100644--- a/frontend/src/react/pages/setup/setup-api.ts+++ b/frontend/src/react/pages/setup/setup-api.ts@@ -42,6 +42,7 @@ export interface SetupQuestions {export interface SetupFact { term: string; value: string; download_url?: string; download_label?: string }export interface SetupDone {+ restored?: boolean;url: string;scan_requested: boolean;history_guide: boolean;@@ -92,6 +93,9 @@ export const fetchQuestions = (signal?: AbortSignal) =>export const submitSetup = (submission: SetupSubmission) =>request<SetupDone>(SETUP_URL, { method: 'POST', body: JSON.stringify(submission) }, '没能完成设置');+export const restoreSetup = (dataRoot: string) =>+ request<SetupDone>(`${SETUP_URL}/restore`, { method: 'POST', body: JSON.stringify({ data_root: dataRoot }) }, '没能使用此数据目录');+export const pickFolder = async (initial: string) =>(await request<{ path: string | null }>(PICK_FOLDER_URL,{ method: 'POST', body: JSON.stringify({ initial }) }, '没能打开文件夹对话框')).path;diff --git a/frontend/src/react/pages/setup/setup-done.tsx b/frontend/src/react/pages/setup/setup-done.tsxindex e7a65005a..5a708d9dd 100644--- a/frontend/src/react/pages/setup/setup-done.tsx+++ b/frontend/src/react/pages/setup/setup-done.tsx@@ -29,7 +29,7 @@ export function SetupDoneView({ done }: { done: SetupDone }) {return (<AuthCard title="设置完成" lede="正在启动馆藏。"><p className="text-body-regular text-text-primary">- {done.scan_requested+ {done.restored ? '已连接已有数据目录。' : done.scan_requested? '首次扫描已排队,在后台整理媒体库,期间可以照常使用 Peach。': '稍后在配置页开始扫描媒体库。'}</p>diff --git a/frontend/src/react/pages/setup/setup-page.tsx b/frontend/src/react/pages/setup/setup-page.tsxindex 48cb90100..09a10770e 100644--- a/frontend/src/react/pages/setup/setup-page.tsx+++ b/frontend/src/react/pages/setup/setup-page.tsx@@ -10,6 +10,7 @@ import { AuthCard } from '../auth-card';import { describeFailure, fetchQuestions, SetupRequestError, type SetupDone, type SetupQuestions } from './setup-api';import { SetupDoneView } from './setup-done';import { SetupForm } from './setup-form';+import { SetupRestore } from './setup-restore';type View =| { kind: 'loading' }@@ -21,6 +22,7 @@ type View =export function SetupPage() {const [view, setView] = useState<View>({ kind: 'loading' });const [attempt, setAttempt] = useState(0);+ const [restoring, setRestoring] = useState(false);useEffect(() => {const controller = new AbortController();@@ -46,7 +48,14 @@ export function SetupPage() {{view.kind === 'failed'? <Note tone="error" action={<Button variant="secondary" onClick={retry}>重试</Button>}>{view.message}</Note>: null}- {view.kind === 'form' ? <SetupForm setup={view.setup} onDone={(done) => setView({ kind: 'done', done })} /> : null}+ {view.kind === 'form' ? <>+ <Button variant="secondary" className="self-start" onClick={() => setRestoring((current) => !current)}>+ {restoring ? '返回首次设置' : '使用已有数据目录'}+ </Button>+ {restoring+ ? <SetupRestore onDone={(done) => setView({ kind: 'done', done })} />+ : <SetupForm setup={view.setup} onDone={(done) => setView({ kind: 'done', done })} />}+ </> : null}</AuthCard>);}diff --git a/frontend/src/react/pages/setup/setup-restore.tsx b/frontend/src/react/pages/setup/setup-restore.tsxnew file mode 100644index 000000000..6b40ac2f7--- /dev/null+++ b/frontend/src/react/pages/setup/setup-restore.tsx@@ -0,0 +1,35 @@+import { useState, type FormEvent } from 'react';++import { Button } from '@/components/base/buttons/button';+import { Input } from '@/components/base/input/input';++import { busyProps } from '../../settings/busy-props';+import { describeFailure, restoreSetup, SetupRequestError, type SetupDone } from './setup-api';++export function SetupRestore({ onDone }: { onDone: (done: SetupDone) => void }) {+ const [path, setPath] = useState('');+ const [error, setError] = useState('');+ const [busy, setBusy] = useState(false);+ const submit = async (event: FormEvent<HTMLFormElement>) => {+ event.preventDefault();+ if (busy) return;+ setBusy(true);+ setError('');+ try {+ onDone(await restoreSetup(path));+ } catch (cause) {+ const detail = cause instanceof SetupRequestError ? cause.errors?.data_root : undefined;+ setError(typeof detail === 'string' ? detail : describeFailure(cause));+ } finally {+ setBusy(false);+ }+ };+ return (+ <form className="flex flex-col gap-4" onSubmit={submit} noValidate>+ <Input label="已有数据目录" value={path} onChange={setPath} isRequired autoComplete="off" spellCheck="false"+ validationBehavior="aria" isInvalid={Boolean(error)}+ hint={error ? <span role="alert">{error}</span> : '选择包含 config.toml 和 database 文件夹的数据目录。'} />+ <Button type="submit" className="self-start" {...busyProps(busy)}>{busy ? '正在连接数据目录…' : '使用此目录'}</Button>+ </form>+ );+}diff --git a/scripts/smoke_desktop.py b/scripts/smoke_desktop.pyindex 6b8c5ef10..84885e2b2 100644--- a/scripts/smoke_desktop.py+++ b/scripts/smoke_desktop.py@@ -109,6 +109,7 @@ def wait_for(check, description: str, *, timeout: float = 60):def smoke_environment(data: Path) -> dict[str, str]:environment = dict(os.environ, PEACH_DATA_ROOT=str(data), PYTHONIOENCODING="utf-8")+ environment["LOCALAPPDATA"] = str(data.parent / "local-app-data")environment.pop("PYTHONPATH", None)environment["PATH"] = os.environ.get("SystemRoot", "/usr") + ("/System32" if os.name == "nt" else "/bin")return environment@@ -163,12 +164,14 @@ def smoke_tray(executable: Path, evidence_dir: Path) -> None:return pids and tray_window_ready(pids)wait_for(tray_started, "托盘窗口、消息循环与监视器就绪")wait_health(opener, "http://127.0.0.1:8900", None, root / "runtime.log")+ selected = root / "selected-data"complete_first_run(opener, "http://127.0.0.1:8900", media, port,- "standalone-tray-smoke-password")+ "standalone-tray-smoke-password", data_root=selected)health = wait_health(opener, f"http://127.0.0.1:{port}", None, root / "runtime.log")assert health["ok"]- assert (data / "database/ledger.db").is_file()- wait_for(lambda: not (data / "state/configuration-reload.request").exists(),+ assert (selected / "database/ledger.db").is_file()+ assert (data / "state/data-root.txt").read_text(encoding="utf-8") == str(selected)+ wait_for(lambda: not (selected / "state/configuration-reload.request").exists(),"托盘消费设置重载请求")assert_requires_login(opener, f"http://127.0.0.1:{port}")finally:@@ -181,8 +184,33 @@ def smoke_tray(executable: Path, evidence_dir: Path) -> None:for row in rows), "托盘发生异常退出或恢复"assert not list((data / "state/tray-watchdogs").glob("*.json")), "监视器记录仍在"assert not list((data / "state/tray-watchdogs").glob("*.ready")), "监视器握手仍在"+ # 原配置保存在自选目录、启动落点没有位置记录:恢复后再次普通启动也应进入馆藏。+ original = (selected / "config.toml").read_bytes()+ (data / "state/data-root.txt").unlink()+ launcher = subprocess.Popen([str(executable), "--silent"], cwd=root,+ env=environment, stdout=log, stderr=log)+ try:+ setup = "http://127.0.0.1:8900"+ assert wait_health(opener, setup, None, root / "runtime.log")["configured"] is False+ request = urllib.request.Request(setup + "/api/setup/restore",+ data=json.dumps({"data_root": str(selected)}).encode(),+ headers={"Origin": setup, "Content-Type": "application/json"})+ with opener.open(request, timeout=10) as response:+ assert json.load(response)["restored"]+ assert wait_health(opener, f"http://127.0.0.1:{port}", None, root / "runtime.log")["configured"]+ assert (selected / "config.toml").read_bytes() == original+ finally:+ stop_tray(executable, root, environment, log, launcher)+ launcher = subprocess.Popen([str(executable), "--silent"], cwd=root,+ env=environment, stdout=log, stderr=log)+ try:+ assert wait_health(opener, f"http://127.0.0.1:{port}", None, root / "runtime.log")["configured"]+ assert_requires_login(opener, f"http://127.0.0.1:{port}")+ finally:+ stop_tray(executable, root, environment, log, launcher)print(json.dumps({"ok": True, "checks": ["tray-first-run", "tray-window",- "tray-watchdog", "tray-service-handoff", "tray-graceful-stop", "tray-no-residue"]}))+ "tray-watchdog", "tray-service-handoff", "tray-graceful-stop", "tray-no-residue",+ "existing-data-recovery", "selected-data-relaunch"]}))def wait_health(opener, base: str, process: subprocess.Popen | None, log_path: Path) -> dict:@@ -225,7 +253,7 @@ def assert_standalone_tunnel(configuration: dict) -> None:assert tunnel['available'] is True-def complete_first_run(opener, base: str, media: Path, port: int, password: str) -> None:+def complete_first_run(opener, base: str, media: Path, port: int, password: str, *, data_root: Path | None = None) -> None:"""首启服务的薄壳与页面包都取得到,再按页面包的提交形态完成一次设置。"""with opener.open(base + "/", timeout=5) as response:assert 'data-page="setup"' in response.read().decode("utf-8")@@ -235,6 +263,8 @@ def complete_first_run(opener, base: str, media: Path, port: int, password: str)answers = {"media_dir": [{"path": str(media), "location": "115"}], "host": "2","port": str(port), "mdns_name": "peach", "access_enabled": True,"access_password": password, "access_confirm": password}+ if data_root is not None:+ answers["data_root"] = str(data_root)request = urllib.request.Request(base + "/api/setup", data=json.dumps(answers).encode(),headers={"Origin": base, "Content-Type": "application/json"})with opener.open(request, timeout=60) as response:diff --git a/scripts/smoke_online_update.py b/scripts/smoke_online_update.pynew file mode 100644index 000000000..dac690186--- /dev/null+++ b/scripts/smoke_online_update.py@@ -0,0 +1,157 @@+"""在临时馆藏中用已发布 Windows 包验证真实在线更新与回滚。"""+from __future__ import annotations++import argparse+from contextlib import closing+import hashlib+import http.cookiejar+import json+import os+from pathlib import Path+import socket+import sqlite3+import subprocess+import urllib.parse+import urllib.request+import zipfile++from smoke_desktop import (artifact_processes, complete_first_run, smoke_directory,+ smoke_environment, stop_tray, wait_for, wait_health)+++def download_release(opener, root: Path, version: str) -> Path:+ with opener.open(f"https://api.github.com/repos/peach-mitao/peach/releases/tags/v{version}", timeout=30) as response:+ release = json.load(response)+ asset = next(asset for asset in release["assets"] if asset["name"] == f"Peach-{version}-windows-x64.zip")+ archive = root / "old.zip"+ with opener.open(asset["browser_download_url"], timeout=60) as response, archive.open("wb") as output:+ while chunk := response.read(256 * 1024):+ output.write(chunk)+ with archive.open("rb") as source:+ assert "sha256:" + hashlib.file_digest(source, "sha256").hexdigest() == asset["digest"]+ with zipfile.ZipFile(archive) as package:+ package.extractall(root / "app")+ return root / "app/Peach/Peach.exe"+++def configuration_request(opener, base: str, path: str, body=None):+ request = urllib.request.Request(base + "/api/configuration/" + path,+ data=None if body is None else json.dumps(body).encode(),+ headers={"Origin": base, "Content-Type": "application/json"})+ with opener.open(request, timeout=20) as response:+ return json.load(response)+++def exercise_update(opener, base: str, data: Path, log_path: Path, version: str, *, rollback: bool):+ original = (data / "config.toml").read_bytes()+ access = (data / "secrets/access.json").read_bytes()+ configuration_request(opener, base, "update", {})++ def prepared():+ state = configuration_request(opener, base, "update-status")+ assert state["state"] != "error", state+ return state if state["state"] == "ready" else None++ wait_for(prepared, "下载、SHA-256 校验与解压", timeout=300)+ manifest = data / "state/standalone-update.json"+ transaction = json.loads(manifest.read_text(encoding="utf-8"))+ if rollback:+ (Path(transaction["stage"]) / "Peach.exe").write_bytes(b"invalid-executable-smoke-fixture")+ configuration_request(opener, base, "update-restart", {})++ def installed():+ state = json.loads(manifest.read_text(encoding="utf-8"))+ if rollback:+ return state if state["state"] == "error" else None+ assert state["state"] != "error", state+ return state if state["state"] == "complete" else None++ state = wait_for(installed, "回滚到旧版" if rollback else "重启安装新版", timeout=240)+ health = wait_health(opener, base, None, log_path)+ assert health["configured"] and health["version"] == version, health+ if rollback:+ assert "已恢复旧版本" in state["message"], state+ assert (data / "config.toml").read_bytes() == original+ assert (data / "secrets/access.json").read_bytes() == access+ with closing(sqlite3.connect(data / "database/ledger.db")) as connection:+ assert connection.execute("SELECT value FROM online_update_fixture").fetchone() == ("retained",)+ with opener.open(base + "/healthz?ready=1", timeout=10) as response:+ assert json.load(response)["ready"]+ with opener.open(base + "/api/items", timeout=10) as response:+ assert response.status == 200+ helper = Path(transaction["helper"]) / "Peach.exe"+ wait_for(lambda: not artifact_processes(helper), "更新助手退出", timeout=20)+ print(json.dumps({"ok": True, "phase": "rollback" if rollback else "installed",+ "version": health["version"], "build_commit": health.get("build_commit"), "state": state["state"]}), flush=True)+++def main() -> int:+ parser = argparse.ArgumentParser(description=__doc__)+ parser.add_argument("--from-version", required=True)+ parser.add_argument("--to-version", required=True)+ parser.add_argument("--exercise-rollback", action="store_true")+ parser.add_argument("--apply", action="store_true", help="运行临时实例并安装更新;缺省只输出验收计划")+ parser.add_argument("--evidence-dir", type=Path, default=Path("smoke-evidence"))+ args = parser.parse_args()+ if not args.apply:+ print(json.dumps({"from_version": args.from_version, "to_version": args.to_version,+ "rollback": args.exercise_rollback, "apply": False}))+ return 0+ assert os.name == "nt", "在线更新制品验收需要 Windows"+ opener = urllib.request.build_opener(urllib.request.ProxyHandler({}),+ urllib.request.HTTPCookieProcessor(http.cookiejar.CookieJar()))+ with smoke_directory(args.evidence_dir.resolve()) as root:+ executable = download_release(opener, root, args.from_version)+ data, media = root / "selected-data", root / "media"+ media.mkdir()+ environment = smoke_environment(data)+ with socket.socket() as reservation:+ reservation.bind(("127.0.0.1", 0))+ port = reservation.getsockname()[1]+ base = f"http://127.0.0.1:{port}"+ password = "online-update-smoke-password"+ log_path = root / "runtime.log"+ with log_path.open("wb") as log:+ setup = subprocess.Popen([str(executable), "serve", "--setup", "--host", "127.0.0.1", "--port", str(port),+ "--no-mdns", "--no-ledger-sync"], cwd=root, env=environment, stdout=log, stderr=log)+ try:+ assert wait_health(opener, base, setup, log_path)["version"] == args.from_version+ complete_first_run(opener, base, media, port, password)+ finally:+ setup.terminate()+ setup.wait(timeout=15)+ database = data / "database/ledger.db"+ with closing(sqlite3.connect(database)) as connection, connection:+ connection.execute("CREATE TABLE online_update_fixture(value TEXT)")+ connection.execute("INSERT INTO online_update_fixture VALUES ('retained')")+ launcher = subprocess.Popen([str(executable), "--silent"], cwd=root,+ env=environment, stdout=log, stderr=log)+ try:+ wait_health(opener, base, None, log_path)+ request = urllib.request.Request(base + "/login",+ data=urllib.parse.urlencode({"token": password, "days": "0"}).encode(), headers={"Origin": base})+ with opener.open(request, timeout=10) as response:+ assert response.status == 200++ release = configuration_request(opener, base, "updates")+ assert release["state"] == "available" and release["latest_version"] == args.to_version, release+ print(json.dumps({"phase": "checked", "release": release}), flush=True)+ for rollback in ([True, False] if args.exercise_rollback else [False]):+ exercise_update(opener, base, data, log_path,+ args.from_version if rollback else args.to_version, rollback=rollback)+ locator = Path(environment["LOCALAPPDATA"]) / "Peach/peach-data/state/data-root.txt"+ assert locator.read_text(encoding="utf-8") == str(data)+ stop_tray(executable, root, environment, log, launcher)+ environment.pop("PEACH_DATA_ROOT")+ launcher = subprocess.Popen([str(executable), "--silent"], cwd=root,+ env=environment, stdout=log, stderr=log)+ health = wait_health(opener, base, None, log_path)+ assert health["configured"] and health["version"] == args.to_version, health+ print(json.dumps({"ok": True, "phase": "default-launch", "version": health["version"]}), flush=True)+ finally:+ stop_tray(executable, root, environment, log, launcher)+ return 0+++if __name__ == "__main__":+ raise SystemExit(main())diff --git a/src/peach/routes_pages.py b/src/peach/routes_pages.pyindex 3cbd96ab4..05393c673 100644--- a/src/peach/routes_pages.py+++ b/src/peach/routes_pages.py@@ -443,18 +443,47 @@ async def setup_submit_json(request: Request):raise HTTPException(status_code=400, detail={"message": "有几项需要修改", "errors": errors})if scan_now:onboarding.request_first_scan(applied.config, "configured" if answers.media_sources is not None else "local")- destination = _setup_destination(applied.config, history_guide=history_guide)+ return _setup_done(applied.config, scan_now=scan_now, history_guide=history_guide)+++def _setup_done(config, *, scan_now: bool = False, history_guide: bool = False, restored: bool = False):+ destination = _setup_destination(config, history_guide=history_guide)return JSONResponse({"url": destination,"scan_requested": scan_now,"history_guide": history_guide,- "standalone": standalone,+ "restored": restored,+ "standalone": distribution.standalone(),# 独立包的完成页过一会儿自己跳到入口;时长由前端定,与配置页保存后的跳转同一个数。- "redirect": destination if standalone else None,- "facts": runtime_fact_entries(applied.config),+ "redirect": destination if distribution.standalone() else None,+ "facts": runtime_fact_entries(config),})[email protected]("/api/setup/restore")+async def setup_restore(request: Request):+ """接回用户指定的已有数据目录;只记录位置,沿用其中的配置、账本和访问密码。"""+ _setup_guard(request, submit=True)+ try:+ body = await request.json()+ raw = body.get("data_root") if isinstance(body, dict) else None+ if not isinstance(raw, str) or not raw.strip() or not Path(raw).is_absolute():+ raise ValueError("请选择已有数据目录的绝对路径")+ config, broken = onboarding.resolve_config(Path(raw))+ if broken:+ raise broken+ if not config.present:+ raise ValueError("此目录中没有有效的 config.toml")+ if not (config.directory("database") / "ledger.db").is_file():+ raise ValueError("此目录中没有账本,请选择保存原配置和账本的数据目录")+ if distribution.standalone():+ onboarding.check_available_port(config.server.port, request.url.port or 80)+ settings_file.remember_data_root(settings_file.active(), config)+ except (ValueError, OSError, RuntimeError) as exc:+ raise HTTPException(400, {"message": "无法使用此数据目录", "errors": {"data_root": str(exc)}}) from exc+ return _setup_done(config, restored=True)++def _setup_media_source_errors(dirs: Sequence[str], kinds: object,problems: Sequence[str], validate) -> list[str]:"""首启的本地来源必须真的可读;CloudDrive 来源仍可离线保存。diff --git a/src/peach/standalone_update.py b/src/peach/standalone_update.pyindex 45256001c..3739383c6 100644--- a/src/peach/standalone_update.py+++ b/src/peach/standalone_update.py@@ -18,8 +18,7 @@ import zipfileimport httpxfrom filelock import FileLock, Timeout-from . import desktop_installer, distribution, release_updates-from .config import STATE_DIR, DATABASE_PATH+from . import __version__, desktop_installer, distribution, release_updates, settings_filefrom .fsutil import atomic_write_textfrom .windows_update import replace_with_retry@@ -29,7 +28,27 @@ MAX_EXPANDED = 2 * 1024 * 1024 * 1024def state_path() -> Path:- return STATE_DIR / "standalone-update.json"+ return settings_file.load_config().directory("state") / "standalone-update.json"+++def remember_installation_data_root(config) -> bool:+ """在线安装启动时,将已知的数据目录记入空的默认启动落点。"""+ if not distribution.standalone() or not config.present:+ return False+ data = read()+ target = data.get("target")+ if (data.get("state") != "installing" or data.get("version") != __version__+ or not isinstance(target, str) or not Path(target).is_absolute()+ or Path(target).resolve() != Path(sys.executable).resolve().parent):+ return False+ bootstrap = distribution.user_data_root(os.environ)+ if (bootstrap.resolve() == config.data_root.resolve()+ or any((bootstrap / name).exists() for name in (+ settings_file.SETTINGS_FILENAME, "state/data-root.txt", "database/ledger.db"))):+ return False+ settings_file.remember_data_root(settings_file.load_config(+ environ=dict(os.environ, PEACH_DATA_ROOT=str(bootstrap))), config)+ return Truedef read() -> dict:@@ -91,7 +110,7 @@ def prepare(data: dict, lock: FileLock) -> None:if not isinstance(total, int) or not 0 < total <= MAX_ARCHIVE:raise ValueError("更新包大小无效")target = Path(sys.executable).resolve().parent- if STATE_DIR.resolve().is_relative_to(target):+ if state_path().resolve().is_relative_to(target):raise ValueError("数据目录位于程序目录内,不能自动替换")transaction = target.parent / f".{target.name}-update-{data['id']}"transaction.mkdir()@@ -168,6 +187,7 @@ def poll(tray) -> None:helper = Path(data["helper"]) / "Peach.exe"environment = os.environ.copy()environment["PYINSTALLER_RESET_ENVIRONMENT"] = "1"+ environment[settings_file.DATA_ROOT_ENV] = str(settings_file.load_config().data_root.resolve())subprocess.Popen([str(helper), "--apply-standalone-update", str(state_path()), str(os.getpid())],cwd=str(helper.parent), env=environment, creationflags=subprocess.CREATE_NO_WINDOW)tray.exit(reason="standalone-update")@@ -179,17 +199,19 @@ def poll(tray) -> None:def migrate_database(stage: Path, data: dict) -> Path | None:from .migrations import plan, sqlite_backup- if not DATABASE_PATH.is_file():+ config = settings_file.load_config()+ database = config.directory("database") / "ledger.db"+ if not database.is_file():return None- _, pending = plan(DATABASE_PATH, stage / "_internal" / "migrations")+ _, pending = plan(database, stage / "_internal" / "migrations")if not pending:return None- backup = STATE_DIR / "update-backups" / data["id"] / "ledger.db"- sqlite_backup(DATABASE_PATH, backup)+ backup = config.directory("state") / "update-backups" / data["id"] / "ledger.db"+ sqlite_backup(database, backup)write(data, database_backup=str(backup), state="installing", progress=10, message="正在更新本地数据库")- environment = dict(os.environ, PYINSTALLER_RESET_ENVIRONMENT="1")+ environment = dict(os.environ, PYINSTALLER_RESET_ENVIRONMENT="1", PEACH_DATA_ROOT=str(config.data_root.resolve()))with (backup.parent / "migration.log").open("wb") as log:- result = subprocess.run([str(stage / "Peach.exe"), "migrate", "upgrade", "--yes", "--db", str(DATABASE_PATH)],+ result = subprocess.run([str(stage / "Peach.exe"), "migrate", "upgrade", "--yes", "--db", str(database)],cwd=str(stage), env=environment, stdout=log, stderr=log, stdin=subprocess.DEVNULL,timeout=180, check=False, creationflags=subprocess.CREATE_NO_WINDOW if os.name == "nt" else 0)if result.returncode:@@ -198,10 +220,12 @@ def migrate_database(stage: Path, data: dict) -> Path | None:def restore_database(data: dict) -> None:- backup = STATE_DIR / "update-backups" / data["id"] / "ledger.db"+ config = settings_file.load_config()+ database = config.directory("database") / "ledger.db"+ backup = config.directory("state") / "update-backups" / data["id"] / "ledger.db"if not backup.is_file():return- with closing(sqlite3.connect(backup.as_uri() + "?mode=ro", uri=True)) as source, closing(sqlite3.connect(DATABASE_PATH)) as destination:+ with closing(sqlite3.connect(backup.as_uri() + "?mode=ro", uri=True)) as source, closing(sqlite3.connect(database)) as destination:source.backup(destination)if destination.execute("PRAGMA integrity_check").fetchone()[0] != "ok":raise RuntimeError("数据库恢复检查失败")@@ -219,7 +243,7 @@ def apply(manifest: Path, wait_pid: int) -> int:transaction = Path(data["transaction"]).resolve()stage = Path(data["stage"]).resolve()if (transaction.parent != target.parent or transaction.name != f".{target.name}-update-{data['id']}"- or stage != transaction / "stage" / "Peach" or STATE_DIR.resolve().is_relative_to(target)+ or stage != transaction / "stage" / "Peach" or state_path().resolve().is_relative_to(target)or not (target / "_internal" / "standalone.txt").is_file()):return 2backup = transaction / "backup"diff --git a/src/peach/tray.py b/src/peach/tray.pyindex 2d69f2c06..7fd60af14 100644--- a/src/peach/tray.py+++ b/src/peach/tray.py@@ -1721,6 +1721,11 @@ def _main(argv: list[str] | None = None) -> int:except Exception:logging.getLogger(__name__).warning("日志整理失败", exc_info=True)log_to_file(config.directory("logs") / "tray.log")+ try:+ from .standalone_update import remember_installation_data_root+ remember_installation_data_root(config)+ except (OSError, RuntimeError):+ logging.getLogger(__name__).warning("更新后的数据目录位置未能保存", exc_info=True)if sys.platform == "win32":lifecycle = Lifecycle(config.directory("state"), config.directory("logs"),config.data_root, PROJECT_ROOT)diff --git a/tests/test_fastapi_api.py b/tests/test_fastapi_api.pyindex 8920042a6..8aa04d2aa 100644--- a/tests/test_fastapi_api.py+++ b/tests/test_fastapi_api.py@@ -3189,6 +3189,7 @@ PUBLIC_ROUTES = {# 平台、打包形态与挂载软件这些运行事实不外露。("GET", "/api/setup/questions"),("POST", "/api/setup"),+ ("POST", "/api/setup/restore"),# 首启与登录页的浏览器尚无会话;此接口仅向本机同源开放,限流、限长后只写脱敏错误日志。("POST", "/api/diagnostics/client-error"),# 登录页在拿到会话之前就要出图,书签与历史记录也从这三个固定路径取图标。diff --git a/tests/test_onboarding.py b/tests/test_onboarding.pyindex 6e97c5410..0393f6e47 100644--- a/tests/test_onboarding.py+++ b/tests/test_onboarding.py@@ -667,6 +667,37 @@ class SetupJsonContractTests(_SetupHttpCase):self.assertEqual((again.status_code, again.json()), (409, {"error": "settings file already exists"}))self.assertEqual(self._loaded().server.port, 8900)+ def test_restore_adopts_the_selected_existing_configuration_without_rewriting_data(self):+ selected = self.root / "existing-data"+ self._submit(data_root=str(selected), scan_now=False)+ locator = self.config.data_root / "state" / settings_file.DATA_ROOT_LOCATION+ locator.unlink()+ before = {path: path.read_bytes() for path in selected.rglob("*") if path.is_file()}+ response = self._send("POST", "/api/setup/restore", json={"data_root": str(selected)})+ self.assertEqual(response.status_code, 200, response.text)+ self.assertTrue(response.json()["restored"])+ self.assertFalse(response.json()["scan_requested"])+ self.assertEqual(self._loaded().data_root, selected)+ self.assertEqual(before, {path: path.read_bytes() for path in selected.rglob("*") if path.is_file()})++ def test_restore_requires_an_existing_configuration_and_ledger_and_keeps_guards(self):+ for value in (None, "relative", str(self.root / "missing")):+ with self.subTest(value=value):+ response = self._send("POST", "/api/setup/restore", json={"data_root": value})+ self.assertEqual(response.status_code, 400, response.text)+ self.assertIn("data_root", response.json()["errors"])+ self.assertFalse((self.config.data_root / "state" / settings_file.DATA_ROOT_LOCATION).exists())+ for kwargs, status in (({"configured": True}, 404), ({"client": ("198.51.100.7", 1)}, 403),+ ({"headers": {"Origin": "http://elsewhere.example"}}, 403)):+ with self.subTest(kwargs=kwargs):+ self.assertEqual(self._send("POST", "/api/setup/restore", json={}, **kwargs).status_code, status)+ selected = self.root / "existing-data"+ self._submit(data_root=str(selected), scan_now=False)+ (self.config.data_root / "state" / settings_file.DATA_ROOT_LOCATION).unlink()+ (selected / "database" / "ledger.db").unlink()+ response = self._send("POST", "/api/setup/restore", json={"data_root": str(selected)})+ self.assertEqual(response.status_code, 400, response.text)+def test_each_wrong_answer_comes_back_under_its_own_key(self):a_file = self.root / "not-a-folder"a_file.write_text("x", encoding="utf-8")diff --git a/tests/test_standalone_update.py b/tests/test_standalone_update.pyindex 5216537e7..0767eeafd 100644--- a/tests/test_standalone_update.py+++ b/tests/test_standalone_update.py@@ -1,6 +1,7 @@"""独立包更新使用临时目录验证路径、进度、重启确认及回滚。"""import jsonimport hashlib+import osfrom contextlib import nullcontextfrom pathlib import Pathimport tempfile@@ -9,7 +10,7 @@ import unittestfrom unittest.mock import Mock, patchimport zipfile-from peach import standalone_update as update+from peach import settings_file, standalone_update as updateclass StandaloneUpdateTests(unittest.TestCase):@@ -17,13 +18,55 @@ class StandaloneUpdateTests(unittest.TestCase):temp = tempfile.TemporaryDirectory()self.addCleanup(temp.cleanup)self.root = Path(temp.name).resolve()- self.state = self.root / "state"+ self.config = settings_file.load_config(environ={"PEACH_DATA_ROOT": str(self.root)})+ self.load_config = settings_file.load_config+ self.database = self.config.directory("database") / "ledger.db"+ self.database.parent.mkdir()+ self.state = self.config.directory("state")self.state.mkdir()- patcher = patch.object(update, "STATE_DIR", self.state)- patcher.start(); self.addCleanup(patcher.stop)- patcher = patch.object(update, "DATABASE_PATH", self.root / "ledger.db")+ patcher = patch.object(update.settings_file, "load_config", return_value=self.config)patcher.start(); self.addCleanup(patcher.stop)+ def test_online_install_remembers_a_known_root_only_for_an_empty_default_location(self):+ settings_file.write(self.config)+ config = self.load_config(environ={"PEACH_DATA_ROOT": str(self.root)})+ target = self.root / "app"+ bootstrap = self.root / "default-data"+ with patch.object(update.distribution, "standalone", return_value=True), patch.object(+ update.distribution, "user_data_root", return_value=bootstrap), patch.object(+ update.settings_file, "load_config", side_effect=self.load_config), patch.dict(+ os.environ, {"PEACH_DATA_ROOT": str(self.root)}), patch.object(+ update.sys, "executable", str(target / "Peach.exe")):+ update.write({"target": str(target), "version": update.__version__}, state="ready")+ self.assertFalse(update.remember_installation_data_root(config))+ update.write({"target": str(self.root / "other-app"), "version": update.__version__}, state="installing")+ self.assertFalse(update.remember_installation_data_root(config))+ update.write({"target": str(target), "version": update.__version__}, state="installing")+ self.assertTrue(update.remember_installation_data_root(config))+ self.assertEqual(self.load_config(environ={"PEACH_DATA_ROOT": str(bootstrap)}).data_root, self.root)+ self.assertFalse(update.remember_installation_data_root(config))+ (bootstrap / "state/data-root.txt").unlink()+ settings = bootstrap / "config.toml"+ settings.write_text("[server]\nport = 9123\n", encoding="utf-8")+ self.assertFalse(update.remember_installation_data_root(config))+ self.assertEqual(settings.read_text(encoding="utf-8"), "[server]\nport = 9123\n")++ @unittest.skipUnless(os.name == "nt", "Windows 更新助手")+ def test_tray_reads_update_intent_from_the_selected_data_root_and_passes_it_to_helper(self):+ import threading+ from types import SimpleNamespace+ from dataclasses import replace+ selected = replace(self.config, data_root=self.root / "selected")+ tray = SimpleNamespace(_action_lock=threading.Lock(), exit=Mock())+ with patch.object(update.settings_file, "load_config", return_value=selected), patch.object(+ update.distribution, "standalone", return_value=True), patch.object(update.subprocess, "Popen") as launch:+ update.write({"helper": str(self.root / "helper")}, state="restarting")+ update.poll(tray)+ self.assertEqual(launch.call_args.args[0][2], str(selected.directory("state") / "standalone-update.json"))+ self.assertEqual(launch.call_args.kwargs["env"]["PEACH_DATA_ROOT"], str(selected.data_root))+ tray.exit.assert_called_once_with(reason="standalone-update")+ self.assertEqual(update.read()["state"], "idle")+def archive(self, names):archive = self.root / "package.zip"with zipfile.ZipFile(archive, "w") as package:@@ -116,12 +159,12 @@ class StandaloneUpdateTests(unittest.TestCase):self.assertTrue(self.state.is_dir())def test_migration_failure_can_restore_the_sqlite_backup(self):- with update.closing(sqlite3.connect(update.DATABASE_PATH)) as connection, connection:+ with update.closing(sqlite3.connect(self.database)) as connection, connection:connection.execute("CREATE TABLE fixture(value TEXT)")connection.execute("INSERT INTO fixture VALUES ('original')")data = {"id":"migration-fixture"}def failed_migration(*args, **kwargs):- with update.closing(sqlite3.connect(update.DATABASE_PATH)) as connection, connection:+ with update.closing(sqlite3.connect(self.database)) as connection, connection:connection.execute("UPDATE fixture SET value='changed'")return Mock(returncode=1)with patch("peach.migrations.plan",return_value=([],[object()])), patch.object(@@ -129,5 +172,5 @@ class StandaloneUpdateTests(unittest.TestCase):with self.assertRaises(RuntimeError):update.migrate_database(self.root,data)update.restore_database(data)- with update.closing(sqlite3.connect(update.DATABASE_PATH)) as connection:+ with update.closing(sqlite3.connect(self.database)) as connection:self.assertEqual(connection.execute("SELECT value FROM fixture").fetchone()[0],"original")diff --git a/web/dist/peach-pages.js b/web/dist/peach-pages.jsindex 54f4f7c9e..44b1e6193 100644--- a/web/dist/peach-pages.js+++ b/web/dist/peach-pages.js@@ -19309,41 +19309,44 @@ async function Jp(e, t, n) {var Yp = (e) => Jp(Gp, { signal: e }, "没能读取设置题目"), Xp = (e) => Jp(Kp, {method: "POST",body: JSON.stringify(e)-}, "没能完成设置"), Zp = async (e) => (await Jp(Wp, {+}, "没能完成设置"), Zp = (e) => Jp(`${Kp}/restore`, {+ method: "POST",+ body: JSON.stringify({ data_root: e })+}, "没能使用此数据目录"), Qp = async (e) => (await Jp(Wp, {method: "POST",body: JSON.stringify({ initial: e })-}, "没能打开文件夹对话框")).path, Qp = (e) => e instanceof Error && e.message || "请求失败,请重试", $p = 8e3, em = /* @__PURE__ */ new WeakMap();-function tm(e, t, n) {+}, "没能打开文件夹对话框")).path, $p = (e) => e instanceof Error && e.message || "请求失败,请重试", em = 8e3, tm = /* @__PURE__ */ new WeakMap();+function nm(e, t, n) {t.classList.add("ui-fcollapse");- let r = (em.get(t) || 0) + 1;- em.set(t, r);- let i = () => em.get(t) === r;+ let r = (tm.get(t) || 0) + 1;+ tm.set(t, r);+ let i = () => tm.get(t) === r;if (n) {t.inert = !1;let n = e.open ? t.getBoundingClientRect().height : 0;- e.open = !0, rm(t, n, i);- } else t.inert = !0, t.classList.remove("ui-fcollapse-settled"), t.style.height = t.getBoundingClientRect().height + "px", t.getBoundingClientRect(), t.style.height = "0px", nm(t, () => {+ e.open = !0, im(t, n, i);+ } else t.inert = !0, t.classList.remove("ui-fcollapse-settled"), t.style.height = t.getBoundingClientRect().height + "px", t.getBoundingClientRect(), t.style.height = "0px", rm(t, () => {i() && (e.open = !1, t.style.height = "");});}-function nm(e, t) {+function rm(e, t) {let n = !1, r, i = (a) => {a && a.propertyName !== "height" || n || (n = !0, e.removeEventListener("transitionend", i), clearTimeout(r), t());};e.addEventListener("transitionend", i), r = setTimeout(i, 260);}-function rm(e, t, n = () => !0) {- e.classList.remove("ui-fcollapse-settled"), e.style.height = t + "px", e.getBoundingClientRect(), e.style.height = e.scrollHeight + "px", nm(e, () => {+function im(e, t, n = () => !0) {+ e.classList.remove("ui-fcollapse-settled"), e.style.height = t + "px", e.getBoundingClientRect(), e.style.height = e.scrollHeight + "px", rm(e, () => {n() && (e.style.height = "auto", e.classList.add("ui-fcollapse-settled"));});}//#endregion//#region src/ui-kit/media-source-icons.ts-var im = {+var am = {local: "hard-drive",115: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAYAAACqaXHeAAAHB0lEQVR4nO2bbUwURxjH/zN38qIcb4JWoIoHFYumWhDbRquNiSlYC4ZGjVYrotHWD1VTLdY00X7zbA22Na21KWqsUMHYSiygJjaRQDW+VK2YioBarVZBQA9QDm6nedajCuxxHrfH7dX+kiXcvszM8+zO7DPP/JfBzcQmfx4O1jpJEmKUgBTHwUYIIAyAwbYRZtoYUCdBVDLwi5yxCgjfo1Uly2vd2T7mjkJj3vgsUVitcwWkqQxstAv1CAFxnoEfZjpdbvXPq05p1gFxqSZDexuWCIhMCMTDHTBcYGA5+n7YdrEwy6xOkS4yJi07uMliWSGEeB9ACPqGBsbYFwE+PpvP7l/Z6BEHCCFYzDRTBgATBMLhCRhofMiqLsrawRgTvSuiFxinbxjK2pErgAnQAAwoE3rMrTmw5s9eXOscxpSNE5iQ9glgEDQEA24LxtNrij8sc+Y67szJscmmTAjpiNaMJ+Q2CemI3Ea1n4CZM/N1p5pqPoXASngDDNmJAcbVBQWzrI5PfRLjzTX7AKTCuyhMNBjTHTmBOypFvvPeZzyRamt775+A2GRTpgTxHbwYDraoqiQrx2kHGFM2TqBBBYAPvBsLGJ9i7+3AenjPn9DiaN/rV6QeSUpxgl4pwotNMeWqbXw/PceYuAiEBvk7dZ2/Xz8MCQvE2JERGB4ZgteXOt8jyRY5cBPi1a4Ro77rybbwVtUIzzDAF7mmOYiPGexSOZt2Hu31tRS12mzbbvctMCYtO1iO7VVmUXqSy8bX323Bjp9OutoUk81GZQc0WSwr1J7YBAb4IiNtnMvlbCs4jpYHba4VIhAu26jkgLhUk8E2pVWVRenj5S7QWyxtVhQcOoecH0+o0h6ykWztNga0t2GJ2vP5oAA/ZKQldtv/1Q+/Yv8vFWg0P3BYhrm5Fa2WdjWbFWKzdVMnB8iZHJVZ/NZ4BPTvfPfzis64NJipgc1W2QG8I4endhor2OCHd1ITOu27/6AN2btK4XEE4mWbYXMAJTD74u5/f+A07jS2QAt02MzlH5Cmqn/3u/d9vV6HyeOM8nFP02Ezo7y9hPu31MwQr86YjHdnv9zjOTXX7+D4uWsoKv0D5WeuwgMIDv/Belq0gFDP+JBAf8zv0veVMEYNlLc508bir1t3sffw78g/eA5/16mS7X4SGNnOacVG7b4/wN+5CWTk4CAsnzcRh79djPlvOnaeWkhCjOK0XKVmoXWNzdhTchalpy7Ld9YZ+vv5YP2yqfK8YfDAALgbASmOxSRvoGmv67GqHcJCBuDFkRHybC5pdBQSno8EY457XPW1O5i9ajca7t13V9Oo359kxuQNlwFEo494JsyAGVNGYeGMcbJzeuLcxZt4e02e63MA+1yh1+C/cXFfQIPc1vxjmJSxFZt3lcJqleye+0LcEKyYP9GdzTH0uQM6oPj+y9xyzM3Kw83ae3bPmzc9ARGDAt3qAI9ysuI6Zn2wG7X1TYrHfX30WDb7FbfVz23iBI9yo/YeFq/bK88VlJicZHRX1WZNOIA4X3ULuw6cVjwWER6I6Ai3rLybOclSoBFy9p2wO/ePHTpQ9foYUMdJkwONUNvQjIuXlSVBOp36w5UEUclJkAQNcdPOXIDTs6oyjMRYshpLQ1gl5big5nq96nVxxio4SdEeps21QVx0uGJesPKK6mo5QbZz0uGRFA0agMLk4ZGh3faX/XaF9HKqQjZXlSyvlUcW0uFBA9BUWKmvUxZZbTps5vIPnS4XHoZecwsU0mgHyypRUU0JK3XpsJnTH1mByXABHoKySFvWzpAXQrtOiT/aXKx+hQwXOlSn/NE+ZldE4E6GDQlGwaZ5eG4YyYcfcbu+CRkf5+Nuk+PFE2d53Fbe8Q/JT0mBiT6CJjlLZ76Eoq8zMTyq88B36WodFqzdgxu37c8SXaDBZqtMpxEnJsW0XgixDm6CNAKUGaLU+OzkMQgN6t/peLtVwjf5x7Alr1xeE3QHjLFPqouz1ivqAwJ8fDabLa3LXF0hHjEsDBMSoqHjHH4+egwM7g9jVCgS46O69XOC0l6Hyiuxs/CU3VBYFRhqycbOu7pgTNmwEAI5aiyMvjbeiEkJRhifDUXkoCB5qbyt3YrmFguu3mxE5dVaHCq7hPIzV2CV+iAWY8isKV6zvUcHiIcSmVKt6IDV1BNXFWd1k8jwbicyJkh4TMIi/EewiaTmKinKudIFpKYi4bEsMfN+LLKI2o6SnNu7inR1HOw9eDlkQ08Kct7TxbLCkiEb3gpDdk8qUcJhmoVU1yQ8hvdRaGs7XHJAQcEsK6muvepJILn8EyjFCafyTDbx9Nca1g9bqM87euwfhzlbw1P9yQxBFZDwmAILaATbR1NJzhpP/P/ZHFzkqf1wsitP7aezSjyVH0/DDlr/fP4fOwTeE5lpP+gAAAAASUVORK5CYII=",pikpak: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAACY0lEQVR4nNWXy2tTQRSHv7m5RUWttqlNW1OairhKNbrU+lhE/AOkdCOIIO7arty0QhSxCIIQ7VJwIfgfCIJdFB+rgC32AVIflD5CbFUsoohJRiZzb5Ne05p4kxv94HCTc+bO+c0MM3eOoICD/TJswAAQBdoBH5UhA8wDo1mIv7ojpuyAsH9EBuQgkmuASXVJI4lN3BXDawIifXIQwQ28RDA0ERfDwpr2cQ9G7iSdhcOGteZeJ1eYKreB5DS1I2oiCJba2hDQVA9tjdDaCHMfICuhMwDJz5D8BMtftK9E2s2NttrJMOxvzSdT1rIb6goW69KIXsjr5/K+nxlIWWKWrOebJIxNFhXgK7r20QjcPL+59PllGH8LarDvU3oWFHU+CDZpK+TKA3j88vd+zGKd93av/y8lrKxao7Ls6bROrrj6EE6E9WzZppZKrJ0y0Hu8RAGhZuhohqk5nShp2Y/0+nZqxPaoFQsr2my2mNDSkBe01w/7AvAu9QcB/nrYs0vboU4qSsNOwCHAoMYY/5WAsckNt1NJ8WKY5TS+fF8/E7f/Lu5aQDrjLu5agOlzF3ct4NYFd3HXAk51uYv/k9vQLPeFr9/h4gh0dcCBNu17vaiP7nt9sGNblQVs3wo9x+DZNCRm9aUyFICebh0rF9PpWP22+QvqC3f2qLZyKda34XTMLsGLGSrO8xndtxMR6ZfqQ+tz7uczRyDor0zyxY/6LlDkoMqYVsUSKvSqho8SVB/JglqCUWqF4ImharVcueQ96j4bN3KFoiDmeXpJTOXO7QJVoyEZ8mgm0rm6sLA4talFef4LaurBZfZxNPMAAAAASUVORK5CYII="-}, am = bt({+}, om = bt({base: ["inline-flex items-center justify-center gap-1 whitespace-nowrap","font-sans select-none cursor-pointer rounded-sm",@@ -19367,15 +19370,15 @@ var im = {secondary: ["text-text-secondary active:text-text-primary", "disabled:text-text-tertiary aria-disabled:text-text-tertiary"].join(" ")}});-function om({ variant: e = "primary", size: t = "medium", leadingIcon: n, trailingIcon: r, children: i, className: a, disabled: o = !1, ...s }) {- let c = yt(am.base, am.size[t], am.variant[e], a), l = /* @__PURE__ */ (0, R.jsxs)(R.Fragment, { children: [+function sm({ variant: e = "primary", size: t = "medium", leadingIcon: n, trailingIcon: r, children: i, className: a, disabled: o = !1, ...s }) {+ let c = yt(om.base, om.size[t], om.variant[e], a), l = /* @__PURE__ */ (0, R.jsxs)(R.Fragment, { children: [n ? /* @__PURE__ */ (0, R.jsx)(n, {- className: am.icon[t],+ className: om.icon[t],"aria-hidden": !0}) : null,i != null && /* @__PURE__ */ (0, R.jsx)("span", { children: i }),r ? /* @__PURE__ */ (0, R.jsx)(r, {- className: am.icon[t],+ className: om.icon[t],"aria-hidden": !0}) : null] });@@ -19402,22 +19405,22 @@ function om({ variant: e = "primary", size: t = "medium", leadingIcon: n, traili}//#endregion//#region src/react/settings/section.tsx-function sm({ role: e, children: t }) {+function cm({ role: e, children: t }) {return /* @__PURE__ */ (0, R.jsx)("p", {role: e,className: "text-body-2-regular text-text-secondary",children: t});}-function cm({ children: e }) {+function lm({ children: e }) {return /* @__PURE__ */ (0, R.jsx)("p", {role: "alert",className: "text-body-2-regular text-text-error-primary",children: e});}-function lm({ href: e, children: t, leadingIcon: n }) {- return /* @__PURE__ */ (0, R.jsx)(om, {+function um({ href: e, children: t, leadingIcon: n }) {+ return /* @__PURE__ */ (0, R.jsx)(sm, {href: e,target: "_blank",rel: "noopener noreferrer",@@ -19431,13 +19434,13 @@ function lm({ href: e, children: t, leadingIcon: n }) {})});}-function um({ children: e }) {+function dm({ children: e }) {return /* @__PURE__ */ (0, R.jsx)("dl", {className: "flex flex-col",children: e});}-function dm({ term: e, children: t }) {+function fm({ term: e, children: t }) {return /* @__PURE__ */ (0, R.jsxs)("div", {className: "flex min-h-11 items-center justify-between gap-4 border-b border-separator-border py-2.5 pr-3 last:border-b-0",children: [/* @__PURE__ */ (0, R.jsx)("dt", {@@ -19449,7 +19452,7 @@ function dm({ term: e, children: t }) {})]});}-function fm({ summary: e, defaultOpen: t = !1, children: n, trailing: r = !1, onOpenChange: i }) {+function pm({ summary: e, defaultOpen: t = !1, children: n, trailing: r = !1, onOpenChange: i }) {let a = (0, y.useId)(), o = (0, y.useRef)(null), s = (0, y.useRef)(null), c = (0, y.useRef)(!1), [l, u] = (0, y.useState)(t);return /* @__PURE__ */ (0, R.jsxs)("details", {ref: (e) => {@@ -19459,7 +19462,7 @@ function fm({ summary: e, defaultOpen: t = !1, children: n, trailing: r = !1, on"aria-expanded": l,"aria-controls": a,onClick: (e) => {- e.preventDefault(), o.current && s.current && (tm(o.current, s.current, !l), u(!l), i?.(!l));+ e.preventDefault(), o.current && s.current && (nm(o.current, s.current, !l), u(!l), i?.(!l));},className: `${r ? "w-full" : "w-fit"} flex cursor-pointer list-none items-center gap-1 rounded-sm text-body-2-medium text-text-secondary outline-none select-none hover:text-text-primary focus-visible:ring-2 focus-visible:ring-border-focus-ring`,children: [@@ -19484,7 +19487,7 @@ function fm({ summary: e, defaultOpen: t = !1, children: n, trailing: r = !1, on})]});}-function pm({ name: e }) {+function mm({ name: e }) {return /* @__PURE__ */ (0, R.jsx)("svg", {"aria-hidden": !0,viewBox: "0 0 24 24",@@ -19493,25 +19496,25 @@ function pm({ name: e }) {children: /* @__PURE__ */ (0, R.jsx)("use", { href: `#i-${e}` })});}-function mm({ mark: e }) {+function hm({ mark: e }) {return e.startsWith("data:image/png;base64,") ? /* @__PURE__ */ (0, R.jsx)("img", {src: e,alt: "",width: 16,height: 16,className: "size-4 shrink-0"- }) : /* @__PURE__ */ (0, R.jsx)(pm, { name: e });+ }) : /* @__PURE__ */ (0, R.jsx)(mm, { name: e });}//#endregion//#region src/react/pages/setup/setup-done.tsx-function hm({ done: e }) {+function gm({ done: e }) {let t = (0, y.useRef)(null);return (0, y.useEffect)(() => {document.title = "Peach · 设置完成", t.current?.focus();}, []), (0, y.useEffect)(() => {let t = e.redirect;if (!t) return;- let n = setTimeout(() => location.assign(t), $p);+ let n = setTimeout(() => location.assign(t), em);return () => clearTimeout(n);}, [e.redirect]), /* @__PURE__ */ (0, R.jsxs)(Tt, {title: "设置完成",@@ -19519,7 +19522,7 @@ function hm({ done: e }) {children: [/* @__PURE__ */ (0, R.jsx)("p", {className: "text-body-regular text-text-primary",- children: e.scan_requested ? "首次扫描已排队,在后台整理媒体库,期间可以照常使用 Peach。" : "稍后在配置页开始扫描媒体库。"+ children: e.restored ? "已连接已有数据目录。" : e.scan_requested ? "首次扫描已排队,在后台整理媒体库,期间可以照常使用 Peach。" : "稍后在配置页开始扫描媒体库。"}),/* @__PURE__ */ (0, R.jsx)(wt, {ref: t,@@ -19527,11 +19530,11 @@ function hm({ done: e }) {className: "self-start",children: e.history_guide ? "导入浏览器历史记录" : "进入 Peach"}),- /* @__PURE__ */ (0, R.jsx)(fm, {+ /* @__PURE__ */ (0, R.jsx)(pm, {summary: "运行信息",- children: /* @__PURE__ */ (0, R.jsx)(um, { children: e.facts.map((e) => /* @__PURE__ */ (0, R.jsxs)(dm, {+ children: /* @__PURE__ */ (0, R.jsx)(dm, { children: e.facts.map((e) => /* @__PURE__ */ (0, R.jsxs)(fm, {term: e.term,- children: [e.value, e.download_url ? /* @__PURE__ */ (0, R.jsx)(lm, {+ children: [e.value, e.download_url ? /* @__PURE__ */ (0, R.jsx)(um, {href: e.download_url,children: e.download_label ?? e.download_url}) : null]@@ -19542,7 +19545,7 @@ function hm({ done: e }) {}//#endregion//#region src/react/boardui/components/base/switch/switch.tsx-var gm = bt({+var _m = bt({sm: {track: "h-4 w-7",trackRadius: {@@ -19604,8 +19607,8 @@ var gm = bt({}}});-function _m({ state: e, size: t = "md", shape: n = "pill" }) {- let r = gm[t];+function vm({ state: e, size: t = "md", shape: n = "pill" }) {+ let r = _m[t];return /* @__PURE__ */ (0, R.jsx)("span", {"aria-hidden": !0,className: yt("relative shrink-0 transition-colors duration-200 ease", r.track, r.trackRadius[n], e.isSelected ? yt("bg-linear-to-b from-accent-500 to-accent-600", r.onShadow) : "bg-background-tertiary-default", e.isDisabled && "opacity-50", e.isFocusVisible && "ring-2 ring-border-focus-ring ring-offset-2"),@@ -19615,12 +19618,12 @@ function _m({ state: e, size: t = "md", shape: n = "pill" }) {})});}-function vm({ className: e, children: t, size: n = "md", shape: r = "pill", ref: i, ...a }) {+function ym({ className: e, children: t, size: n = "md", shape: r = "pill", ref: i, ...a }) {return /* @__PURE__ */ (0, R.jsx)(xp, {ref: i,...a,className: (t) => yt("group inline-flex items-center gap-2 select-none", t.isDisabled ? "cursor-not-allowed" : "cursor-pointer", typeof e == "function" ? e(t) : e),- children: (e) => /* @__PURE__ */ (0, R.jsxs)(R.Fragment, { children: [/* @__PURE__ */ (0, R.jsx)(_m, {+ children: (e) => /* @__PURE__ */ (0, R.jsxs)(R.Fragment, { children: [/* @__PURE__ */ (0, R.jsx)(vm, {state: e,size: n,shape: r@@ -19632,55 +19635,55 @@ function vm({ className: e, children: t, size: n = "md", shape: r = "pill", ref:}//#endregion//#region node_modules/motion-utils/dist/es/clamp.mjs-var ym = (e, t, n) => n > t ? t : n < e ? e : n, bm = {};+var bm = (e, t, n) => n > t ? t : n < e ? e : n, xm = {};//#endregion//#region node_modules/motion-utils/dist/es/memo.mjs/*#__NO_SIDE_EFFECTS__*/-function xm(e) {+function Sm(e) {let t;return () => (t === void 0 && (t = e()), t);}//#endregion//#region node_modules/motion-utils/dist/es/noop.mjs-var Sm = /* @__NO_SIDE_EFFECTS__ */ (e) => e, Cm = /* @__NO_SIDE_EFFECTS__ */ (e) => e * 1e3, wm = /* @__NO_SIDE_EFFECTS__ */ (e) => e / 1e3, Tm = /* @__NO_SIDE_EFFECTS__ */ (e) => Array.isArray(e) && typeof e[0] == "number", Em = {+var Cm = /* @__NO_SIDE_EFFECTS__ */ (e) => e, wm = /* @__NO_SIDE_EFFECTS__ */ (e) => e * 1e3, Tm = /* @__NO_SIDE_EFFECTS__ */ (e) => e / 1e3, Em = /* @__NO_SIDE_EFFECTS__ */ (e) => Array.isArray(e) && typeof e[0] == "number", Dm = {delta: 0,timestamp: 0,isProcessing: !1-}, Dm;-function Om() {- Dm = void 0;+}, Om;+function km() {+ Om = void 0;}-var km = {- now: () => (Dm === void 0 && km.set(Em.isProcessing || bm.useManualTiming ? Em.timestamp : performance.now()), Dm),+var Am = {+ now: () => (Om === void 0 && Am.set(Dm.isProcessing || xm.useManualTiming ? Dm.timestamp : performance.now()), Om),set: (e) => {- Dm = e, queueMicrotask(Om);+ Om = e, queueMicrotask(km);}-}, Am = (e, t, n = 10) => {+}, jm = (e, t, n = 10) => {let r = "", i = Math.max(Math.round(t / n), 2);for (let t = 0; t < i; t++) r += Math.round(e(t / (i - 1)) * 1e4) / 1e4 + ", ";return `linear(${r.substring(0, r.length - 2)})`;-}, jm = 2e4;-function Mm(e, t = 50, n = jm, r) {+}, Mm = 2e4;+function Nm(e, t = 50, n = Mm, r) {let i = 0, a = e.next(i);for (r?.push(a.value); !a.done && i < n;) i += t, a = e.next(i), r?.push(a.value);return i >= n ? Infinity : i;}//#endregion//#region node_modules/motion-dom/dist/es/animation/generators/utils/create-generator-easing.mjs-function Nm(e, t = 100, n) {+function Pm(e, t = 100, n) {let r = n({...e,keyframes: [0, t]- }), i = Math.min(Mm(r), jm);+ }), i = Math.min(Nm(r), Mm);return {type: "keyframes",ease: (e) => r.next(i * e).value / t,- duration: /* @__PURE__ */ wm(i)+ duration: /* @__PURE__ */ Tm(i)};}//#endregion//#region node_modules/motion-dom/dist/es/animation/generators/spring.mjs-var Pm = {+var Fm = {stiffness: 100,damping: 10,mass: 1,@@ -19698,63 +19701,63 @@ var Pm = {minDuration: .01,maxDuration: 10,minDamping: .05-}, Fm = (e) => e < 0 ? 1 / Math.max(1 + e, Pm.minDamping) : Math.max(1 - e, Pm.minDamping);-function Im(e, t) {+}, Im = (e) => e < 0 ? 1 / Math.max(1 + e, Fm.minDamping) : Math.max(1 - e, Fm.minDamping);+function Lm(e, t) {if (!(e > 1)) return 1;let n = Math.sqrt(e * e - 1), r = e - n, i = e + n, a = 2 * n * Math.exp(-t) * (1 + t);- return zm((e) => i * Math.exp(-r * e) - r * Math.exp(-i * e) - a, (e) => Math.exp(-i * e) - Math.exp(-r * e), t) / t;+ return Bm((e) => i * Math.exp(-r * e) - r * Math.exp(-i * e) - a, (e) => Math.exp(-i * e) - Math.exp(-r * e), t) / t;}-function Lm(e, t) {+function Rm(e, t) {return e * Math.sqrt(1 - t * t);}-var Rm = 12;-function zm(e, t, n) {+var zm = 12;+function Bm(e, t, n) {let r = n;- for (let n = 1; n < Rm; n++) r -= e(r) / t(r);+ for (let n = 1; n < zm; n++) r -= e(r) / t(r);return r;}-var Bm = .001;-function Vm({ duration: e = Pm.duration, bounce: t = Pm.bounce }) {+var Vm = .001;+function Hm({ duration: e = Fm.duration, bounce: t = Fm.bounce }) {let n, r;- Pm.maxDuration;- let i = Fm(t);- e = ym(Pm.minDuration, Pm.maxDuration, /* @__PURE__ */ wm(e)), i < 1 ? (n = (t) => {- let n = t * i, r = n * e, a = Lm(t, i), o = Math.exp(-r);- return Bm - n / a * o;+ Fm.maxDuration;+ let i = Im(t);+ e = bm(Fm.minDuration, Fm.maxDuration, /* @__PURE__ */ Tm(e)), i < 1 ? (n = (t) => {+ let n = t * i, r = n * e, a = Rm(t, i), o = Math.exp(-r);+ return Vm - n / a * o;}, r = (t) => {- let r = t * i * e, a = i * i * t * t * e, o = Math.exp(-r), s = Lm(t * t, i);- return (-n(t) + Bm > 0 ? -1 : 1) * -a * o / s;+ let r = t * i * e, a = i * i * t * t * e, o = Math.exp(-r), s = Rm(t * t, i);+ return (-n(t) + Vm > 0 ? -1 : 1) * -a * o / s;}) : (n = (t) => -.001 + Math.exp(-t * e) * (t * e + 1), r = (t) => Math.exp(-t * e) * (-t * (e * e)));- let a = 5 / e, o = zm(n, r, a), s = o * Im(i, o * e), c = s * s;+ let a = 5 / e, o = Bm(n, r, a), s = o * Lm(i, o * e), c = s * s;return {stiffness: c,damping: i * 2 * Math.sqrt(c),- duration: /* @__PURE__ */ Cm(e)+ duration: /* @__PURE__ */ wm(e)};}-var Hm = (e, t) => (t ? e >= 0 : e > 0) && e < Infinity;-function Um(e, t) {- if (Hm(e, t)) return e;+var Um = (e, t) => (t ? e >= 0 : e > 0) && e < Infinity;+function Wm(e, t) {+ if (Um(e, t)) return e;}-function Wm(e) {- let t = Um(e.stiffness), n = Um(e.damping, !0), r = Um(e.mass), i = {+function Gm(e) {+ let t = Wm(e.stiffness), n = Wm(e.damping, !0), r = Wm(e.mass), i = {...e,- stiffness: t ?? Pm.stiffness,- damping: n ?? Pm.damping,- mass: r ?? Pm.mass,+ stiffness: t ?? Fm.stiffness,+ damping: n ?? Fm.damping,+ mass: r ?? Fm.mass,isResolvedFromDuration: !1,isTimeDefined: (t ?? n ?? r) === void 0 && (e.duration !== void 0 || e.bounce !== void 0)};if (i.isTimeDefined) {if (e.visualDuration) {- let t = Fm(e.bounce || 0), n = 2 * Math.PI / (e.visualDuration * 1.2) * Im(t, 2 * Math.PI / 1.2);+ let t = Im(e.bounce || 0), n = 2 * Math.PI / (e.visualDuration * 1.2) * Lm(t, 2 * Math.PI / 1.2);i.stiffness = n * n, i.damping = 2 * t * Math.sqrt(i.stiffness);- } else Object.assign(i, Vm(i)), i.isResolvedFromDuration = !0;- (!Hm(i.stiffness) || !Hm(i.damping, !0)) && (i.stiffness = Pm.stiffness, i.damping = Pm.damping);+ } else Object.assign(i, Hm(i)), i.isResolvedFromDuration = !0;+ (!Um(i.stiffness) || !Um(i.damping, !0)) && (i.stiffness = Fm.stiffness, i.damping = Fm.damping);}return i;}-function Gm(e = Pm.visualDuration, t = Pm.bounce) {+function Km(e = Fm.visualDuration, t = Fm.bounce) {let n = typeof e == "object" ? e : {visualDuration: e,keyframes: [0, 1],@@ -19762,7 +19765,7 @@ function Gm(e = Pm.visualDuration, t = Pm.bounce) {}, r = n.keyframes[0], i = n.keyframes[n.keyframes.length - 1], a = {done: !1,value: r- }, { stiffness: o, damping: s, mass: c, duration: l, isResolvedFromDuration: u, isTimeDefined: d } = Wm({ ...n }), f = (e) => d ? 0 : -/* @__PURE__ */ wm(e), p = s / (2 * Math.sqrt(o * c)), m = /* @__PURE__ */ wm(Math.sqrt(o / c)), h = p * m, g = {+ }, { stiffness: o, damping: s, mass: c, duration: l, isResolvedFromDuration: u, isTimeDefined: d } = Gm({ ...n }), f = (e) => d ? 0 : -/* @__PURE__ */ Tm(e), p = s / (2 * Math.sqrt(o * c)), m = /* @__PURE__ */ Tm(Math.sqrt(o / c)), h = p * m, g = {target: i,delta: i - r,velocity: f(n.velocity || 0) || 0,@@ -19770,12 +19773,12 @@ function Gm(e = Pm.visualDuration, t = Pm.bounce) {restDelta: 0}, _ = () => {let e = Math.abs(g.delta) < 5;- g.restSpeed = n.restSpeed || (e ? Pm.restSpeed.granular : Pm.restSpeed.default), g.restDelta = n.restDelta || (e ? Pm.restDelta.granular : Pm.restDelta.default);+ g.restSpeed = n.restSpeed || (e ? Fm.restSpeed.granular : Fm.restSpeed.default), g.restDelta = n.restDelta || (e ? Fm.restDelta.granular : Fm.restDelta.default);};_();let v, y, b;if (p < 1) {- let e = Lm(m, p), t = {+ let e = Rm(m, p), t = {A: 0,sinC: 0,cosC: 0,@@ -19813,51 +19816,51 @@ function Gm(e = Pm.visualDuration, t = Pm.bounce) {retarget: (e, t) => {g.target = e[e.length - 1], g.delta = g.target - e[0], g.velocity = f(t), n.restSpeed && n.restDelta || _(), S.calculatedDuration = x, a.done = !1, b();},- velocity: (e) => /* @__PURE__ */ Cm(y(e)),+ velocity: (e) => /* @__PURE__ */ wm(y(e)),next: (e) => {let t = v(e);if (u) a.done = e >= l;else {- let n = /* @__PURE__ */ Cm(y(e));+ let n = /* @__PURE__ */ wm(y(e));a.done = Math.abs(n) <= g.restSpeed && Math.abs(g.target - t) <= g.restDelta;}return a.value = a.done ? g.target : t, a;},toString: () => {- let e = Math.min(Mm(S), jm), t = Am((t) => S.next(e * t).value, e, 30);+ let e = Math.min(Nm(S), Mm), t = jm((t) => S.next(e * t).value, e, 30);return e + "ms " + t;},toTransition: () => {}};return S;}-Gm.applyToOptions = (e) => {- let t = Nm(e, 100, Gm);- return e.ease = t.ease, e.duration = /* @__PURE__ */ Cm(t.duration), e.type = "keyframes", e;+Km.applyToOptions = (e) => {+ let t = Pm(e, 100, Km);+ return e.ease = t.ease, e.duration = /* @__PURE__ */ wm(t.duration), e.type = "keyframes", e;};//#endregion//#region node_modules/motion-dom/dist/es/animation/keyframes/get-final.mjs-var Km = (e) => e !== null;-function qm(e, { repeat: t, repeatType: n = "loop" }, r, i = 1) {- let a = e.filter(Km), o = i < 0 || t && n !== "loop" && t % 2 == 1 ? 0 : a.length - 1;+var qm = (e) => e !== null;+function Jm(e, { repeat: t, repeatType: n = "loop" }, r, i = 1) {+ let a = e.filter(qm), o = i < 0 || t && n !== "loop" && t % 2 == 1 ? 0 : a.length - 1;return !o || r === void 0 ? a[o] : r;}//#endregion//#region node_modules/motion-dom/dist/es/animation/utils/notify-inspector.mjs-function Jm(e, t) {+function Ym(e, t) {return {kind: e,animation: t,- timestamp: km.now(),- frameTimestamp: Em.timestamp,- frameIsProcessing: Em.isProcessing+ timestamp: Am.now(),+ frameTimestamp: Dm.timestamp,+ frameIsProcessing: Dm.isProcessing};}-function Ym(e, t, n) {+function Xm(e, t, n) {let r = globalThis.__MOTION_INSPECT__;if (r) try {r({- ...Jm("animation-start", e),+ ...Ym("animation-start", e),options: n ? {...t,...n@@ -19867,7 +19870,7 @@ function Ym(e, t, n) {}//#endregion//#region node_modules/motion-dom/dist/es/animation/utils/WithPromise.mjs-var Xm = class {+var Zm = class {constructor() {this.isResolved = !1;}@@ -19888,60 +19891,60 @@ var Xm = class {};//#endregion//#region node_modules/motion-dom/dist/es/animation/keyframes/utils/fill-wildcards.mjs-function Zm(e) {+function Qm(e) {for (let t = 1; t < e.length; t++) e[t] ?? (e[t] = e[t - 1]);}//#endregion//#region node_modules/motion-dom/dist/es/render/dom/is-css-var.mjs-var Qm = (e) => e.startsWith("--");+var $m = (e) => e.startsWith("--");//#endregion//#region node_modules/motion-dom/dist/es/render/dom/style-set.mjs-function $m(e, t, n) {- Qm(t) ? e.style.setProperty(t, n) : e.style[t] = n;+function eh(e, t, n) {+ $m(t) ? e.style.setProperty(t, n) : e.style[t] = n;}//#endregion//#region node_modules/motion-dom/dist/es/utils/supports/flags.mjs-var eh = {};+var th = {};//#endregion//#region node_modules/motion-dom/dist/es/utils/supports/memo.mjs-function th(e, t) {- let n = /* @__PURE__ */ xm(e);- return () => eh[t] ?? n();+function nh(e, t) {+ let n = /* @__PURE__ */ Sm(e);+ return () => th[t] ?? n();}//#endregion//#region node_modules/motion-dom/dist/es/utils/supports/scroll-timeline.mjs-var nh = /* @__PURE__ */ th(() => window.ScrollTimeline !== void 0, "scrollTimeline"), rh = /*@__PURE__*/ th(() => {+var rh = /* @__PURE__ */ nh(() => window.ScrollTimeline !== void 0, "scrollTimeline"), ih = /*@__PURE__*/ nh(() => {try {document.createElement("div").animate({ opacity: 0 }, { easing: "linear(0, 1)" });} catch {return !1;}return !0;-}, "linearEasing"), ih = ([e, t, n, r]) => `cubic-bezier(${e}, ${t}, ${n}, ${r})`, ah = {+}, "linearEasing"), ah = ([e, t, n, r]) => `cubic-bezier(${e}, ${t}, ${n}, ${r})`, oh = {linear: "linear",ease: "ease",easeIn: "ease-in",easeOut: "ease-out",easeInOut: "ease-in-out",- circIn: /*@__PURE__*/ ih([+ circIn: /*@__PURE__*/ ah([0,.65,.55,1]),- circOut: /*@__PURE__*/ ih([+ circOut: /*@__PURE__*/ ah([.55,0,1,.45]),- backIn: /*@__PURE__*/ ih([+ backIn: /*@__PURE__*/ ah([.31,.01,.66,-.59]),- backOut: /*@__PURE__*/ ih([+ backOut: /*@__PURE__*/ ah([.33,1.53,.69,@@ -19950,15 +19953,15 @@ var nh = /* @__PURE__ */ th(() => window.ScrollTimeline !== void 0, "scrollTimel};//#endregion//#region node_modules/motion-dom/dist/es/animation/waapi/easing/map-easing.mjs-function oh(e, t) {- if (e) return typeof e == "function" ? rh() ? Am(e, t) : "ease-out" : /* @__PURE__ */ Tm(e) ? ih(e) : Array.isArray(e) ? e.map((e) => oh(e, t) || ah.easeOut) : ah[e];+function sh(e, t) {+ if (e) return typeof e == "function" ? ih() ? jm(e, t) : "ease-out" : /* @__PURE__ */ Em(e) ? ah(e) : Array.isArray(e) ? e.map((e) => sh(e, t) || oh.easeOut) : oh[e];}//#endregion//#region node_modules/motion-dom/dist/es/animation/waapi/start-waapi-animation.mjs-function sh(e, t, n, { delay: r = 0, duration: i = 300, repeat: a = 0, repeatType: o = "loop", ease: s = "easeOut", times: c } = {}, l = void 0) {+function ch(e, t, n, { delay: r = 0, duration: i = 300, repeat: a = 0, repeatType: o = "loop", ease: s = "easeOut", times: c } = {}, l = void 0) {let u = { [t]: n };c && (u.offset = c);- let d = oh(s, i);+ let d = sh(s, i);Array.isArray(d) && (u.easing = d);let f = {delay: r,@@ -19972,29 +19975,29 @@ function sh(e, t, n, { delay: r = 0, duration: i = 300, repeat: a = 0, repeatTyp}//#endregion//#region node_modules/motion-dom/dist/es/animation/generators/utils/is-generator.mjs-function ch(e) {+function lh(e) {return typeof e == "function" && "applyToOptions" in e;}//#endregion//#region node_modules/motion-dom/dist/es/animation/waapi/utils/apply-generator.mjs-function lh({ type: e, ...t }) {- return ch(e) && rh() ? e.applyToOptions(t) : (t.duration ??= 300, t.ease ??= "easeOut", t);+function uh({ type: e, ...t }) {+ return lh(e) && ih() ? e.applyToOptions(t) : (t.duration ??= 300, t.ease ??= "easeOut", t);}//#endregion//#region node_modules/motion-dom/dist/es/animation/NativeAnimation.mjs-var uh = class extends Xm {+var dh = class extends Zm {constructor(e) {if (super(), this.finishedTime = null, this.isStopped = !1, this.manualStartTime = null, !e) return;let { element: t, name: n, keyframes: r, pseudoElement: i, allowFlatten: a = !1, finalKeyframe: o, onComplete: s } = e;this.isPseudoElement = !!i, this.allowFlatten = a, this.options = e, e.type;- let c = lh(e);- this.animation = sh(t, n, r, c, i), c.autoplay === !1 && this.animation.pause(), this.animation.onfinish = () => {+ let c = uh(e);+ this.animation = ch(t, n, r, c, i), c.autoplay === !1 && this.animation.pause(), this.animation.onfinish = () => {if (this.finishedTime = this.time, !i) {- let e = qm(r, this.options, o, this.speed);- this.updateMotionValue && this.updateMotionValue(e), $m(t, n, e), this.animation.cancel();+ let e = Jm(r, this.options, o, this.speed);+ this.updateMotionValue && this.updateMotionValue(e), eh(t, n, e), this.animation.cancel();}s?.(), this.notifyFinished();- }, Ym(this, e, c);+ }, Xm(this, e, c);}play() {this.isStopped || (this.manualStartTime = null, this.animation.play(), this.state === "finished" && this.updateFinished());@@ -20022,18 +20025,18 @@ var uh = class extends Xm {}get duration() {let e = this.animation.effect?.getComputedTiming?.().duration || 0;- return /* @__PURE__ */ wm(Number(e));+ return /* @__PURE__ */ Tm(Number(e));}get iterationDuration() {let { delay: e = 0 } = this.options || {};- return this.duration + /* @__PURE__ */ wm(e);+ return this.duration + /* @__PURE__ */ Tm(e);}get time() {- return /* @__PURE__ */ wm(Number(this.animation.currentTime) || 0);+ return /* @__PURE__ */ Tm(Number(this.animation.currentTime) || 0);}set time(e) {let t = this.finishedTime !== null;- this.manualStartTime = null, this.finishedTime = null, this.animation.currentTime = /* @__PURE__ */ Cm(e), t && this.animation.pause();+ this.manualStartTime = null, this.finishedTime = null, this.animation.currentTime = /* @__PURE__ */ wm(e), t && this.animation.pause();}get speed() {return this.animation.playbackRate;@@ -20051,9 +20054,9 @@ var uh = class extends Xm {this.manualStartTime = this.animation.startTime = e;}attachTimeline({ timeline: e, onAttach: t, observe: n }) {- return this.allowFlatten && this.animation.effect?.updateTiming({ easing: "linear" }), this.animation.onfinish = null, e && nh() ? (this.animation.timeline = e, t?.(this.animation), Sm) : n(this);+ return this.allowFlatten && this.animation.effect?.updateTiming({ easing: "linear" }), this.animation.onfinish = null, e && rh() ? (this.animation.timeline = e, t?.(this.animation), Cm) : n(this);}-}, dh = class {+}, fh = class {constructor(e) {this.stop = () => this.runAll("stop"), this.animations = e.filter(Boolean);}@@ -20093,10 +20096,10 @@ var uh = class extends Xm {return this.getAll("startTime");}get duration() {- return fh(this.animations, "duration");+ return ph(this.animations, "duration");}get iterationDuration() {- return fh(this.animations, "iterationDuration");+ return ph(this.animations, "iterationDuration");}runAll(e) {this.animations.forEach((t) => t[e]());@@ -20114,7 +20117,7 @@ var uh = class extends Xm {this.runAll("complete");}};-function fh(e, t) {+function ph(e, t) {let n = 0;for (let r = 0; r < e.length; r++) {let i = e[r][t];@@ -20124,18 +20127,18 @@ function fh(e, t) {}//#endregion//#region node_modules/motion-dom/dist/es/animation/GroupAnimationWithThen.mjs-var ph = class extends dh {+var mh = class extends fh {then(e, t) {return this.finished.finally(e).then(() => {});}-}, mh = /* @__PURE__ */ new WeakMap(), hh = (e, t = "") => `${e}:${t}`;-function gh(e) {- let t = mh.get(e);- return t || (t = /* @__PURE__ */ new Map(), mh.set(e, t)), t;+}, hh = /* @__PURE__ */ new WeakMap(), gh = (e, t = "") => `${e}:${t}`;+function _h(e) {+ let t = hh.get(e);+ return t || (t = /* @__PURE__ */ new Map(), hh.set(e, t)), t;}//#endregion//#region node_modules/motion-dom/dist/es/animation/utils/resolve-transition.mjs-function _h(e, t) {+function vh(e, t) {if (e?.inherit && t) {let { inherit: n, ...r } = e;return {@@ -20147,21 +20150,21 @@ function _h(e, t) {}//#endregion//#region node_modules/motion-dom/dist/es/animation/utils/get-value-transition.mjs-function vh(e, t) {+function yh(e, t) {let n = e?.[t] ?? e?.default ?? e;- return n === e ? n : _h(n, e);+ return n === e ? n : vh(n, e);}//#endregion//#region node_modules/motion-dom/dist/es/animation/waapi/utils/px-values.mjs-var yh = /* @__PURE__ */ new Set(/* @__PURE__ */ "borderWidth.borderTopWidth.borderRightWidth.borderBottomWidth.borderLeftWidth.borderRadius.borderTopLeftRadius.borderTopRightRadius.borderBottomRightRadius.borderBottomLeftRadius.width.maxWidth.height.maxHeight.top.right.bottom.left.inset.insetBlock.insetBlockStart.insetBlockEnd.insetInline.insetInlineStart.insetInlineEnd.padding.paddingTop.paddingRight.paddingBottom.paddingLeft.paddingBlock.paddingBlockStart.paddingBlockEnd.paddingInline.paddingInlineStart.paddingInlineEnd.margin.marginTop.marginRight.marginBottom.marginLeft.marginBlock.marginBlockStart.marginBlockEnd.marginInline.marginInlineStart.marginInlineEnd.fontSize.backgroundPositionX.backgroundPositionY".split("."));+var bh = /* @__PURE__ */ new Set(/* @__PURE__ */ "borderWidth.borderTopWidth.borderRightWidth.borderBottomWidth.borderLeftWidth.borderRadius.borderTopLeftRadius.borderTopRightRadius.borderBottomRightRadius.borderBottomLeftRadius.width.maxWidth.height.maxHeight.top.right.bottom.left.inset.insetBlock.insetBlockStart.insetBlockEnd.insetInline.insetInlineStart.insetInlineEnd.padding.paddingTop.paddingRight.paddingBottom.paddingLeft.paddingBlock.paddingBlockStart.paddingBlockEnd.paddingInline.paddingInlineStart.paddingInlineEnd.margin.marginTop.marginRight.marginBottom.marginLeft.marginBlock.marginBlockStart.marginBlockEnd.marginInline.marginInlineStart.marginInlineEnd.fontSize.backgroundPositionX.backgroundPositionY".split("."));//#endregion//#region node_modules/motion-dom/dist/es/animation/keyframes/utils/apply-px-defaults.mjs-function bh(e, t) {- for (let n = 0; n < e.length; n++) typeof e[n] == "number" && yh.has(t) && (e[n] = e[n] + "px");+function xh(e, t) {+ for (let n = 0; n < e.length; n++) typeof e[n] == "number" && bh.has(t) && (e[n] = e[n] + "px");}//#endregion//#region node_modules/motion-dom/dist/es/utils/resolve-elements.mjs-function xh(e, t, n) {+function Sh(e, t, n) {if (e == null) return [];if (e instanceof EventTarget) return [e];if (typeof e == "string") {@@ -20174,24 +20177,24 @@ function xh(e, t, n) {}//#endregion//#region node_modules/motion-dom/dist/es/render/dom/style-computed.mjs-function Sh(e, t) {+function Ch(e, t) {let n = window.getComputedStyle(e);- return Qm(t) ? n.getPropertyValue(t) : n[t];+ return $m(t) ? n.getPropertyValue(t) : n[t];}//#endregion//#region node_modules/framer-motion/dist/es/animation/animators/waapi/animate-elements.mjs-function Ch(e, t, n, r) {+function wh(e, t, n, r) {if (e == null) return [];- let i = xh(e, r), a = i.length, o = [];+ let i = Sh(e, r), a = i.length, o = [];for (let e = 0; e < a; e++) {let r = i[e], s = { ...n };typeof s.delay == "function" && (s.delay = s.delay(e, a));for (let e in t) {let n = t[e];Array.isArray(n) || (n = [n]);- let i = { ...vh(s, e) };- i.duration &&= /* @__PURE__ */ Cm(i.duration), i.delay &&= /* @__PURE__ */ Cm(i.delay);- let a = gh(r), c = hh(e, i.pseudoElement || ""), l = a.get(c);+ let i = { ...yh(s, e) };+ i.duration &&= /* @__PURE__ */ wm(i.duration), i.delay &&= /* @__PURE__ */ wm(i.delay);+ let a = _h(r), c = gh(e, i.pseudoElement || ""), l = a.get(c);l && l.stop(), o.push({map: a,key: c,@@ -20207,33 +20210,33 @@ function Ch(e, t, n, r) {}for (let e = 0; e < o.length; e++) {let { unresolvedKeyframes: t, options: n } = o[e], { element: r, name: i, pseudoElement: a } = n;- !a && t[0] === null && (t[0] = Sh(r, i)), Zm(t), bh(t, i), !a && t.length < 2 && t.unshift(Sh(r, i)), n.keyframes = t;+ !a && t[0] === null && (t[0] = Ch(r, i)), Qm(t), xh(t, i), !a && t.length < 2 && t.unshift(Ch(r, i)), n.keyframes = t;}let s = [];for (let e = 0; e < o.length; e++) {- let { map: t, key: n, options: r } = o[e], i = new uh(r);+ let { map: t, key: n, options: r } = o[e], i = new dh(r);t.set(n, i), i.finished.finally(() => t.delete(n)), s.push(i);}return s;}-var wh = /*@__PURE__*/ ((e) => {+var Th = /*@__PURE__*/ ((e) => {function t(t, n, r) {- return new ph(Ch(t, n, r, e));+ return new mh(wh(t, n, r, e));}return t;-})(), Th = {+})(), Eh = {selection: {- type: Gm,+ type: Km,duration: .16,bounce: 0},hover: {- type: Gm,+ type: Km,duration: .08,bounce: 0}};-function Eh(e) {+function Dh(e) {let [t, n] = (0, y.useState)(null);return (0, y.useLayoutEffect)(() => {if (!t) return;@@ -20254,7 +20257,7 @@ function Eh(e) {let ee = `translate(${b}px, ${x}px) scale(1, 1)`;if (u && a && !r.matches && T && s !== h) {let r = `translate(${(T.left - _.left) / v + t.scrollLeft - t.clientLeft}px, ${(T.top - _.top) / y + t.scrollTop - t.clientTop}px) scale(${T.width / v / S}, ${T.height / y / C})`;- l = wh(n, { transform: [r, ee] }, Th[e]);+ l = Th(n, { transform: [r, ee] }, Eh[e]);} else n.style.transform = ee;s = h, c = w, t.dataset.surfaceReady = "";}, m = (t) => {@@ -20291,17 +20294,17 @@ function Eh(e) {}//#endregion//#region src/react/components/segmented.tsx-function Dh(e) {- let t = Eh("selection");+function Oh(e) {+ let t = Dh("selection");return /* @__PURE__ */ (0, R.jsx)(ep, {...e,ref: t});}-var Oh = "inline-flex w-max max-w-full items-center gap-0.5 overflow-x-auto overscroll-x-contain rounded-2lg bg-background-tertiary-default p-1", kh = "flex min-h-7 flex-none cursor-pointer items-center gap-1.5 rounded-md px-2.5 py-1 max-sm:px-2 text-body-medium whitespace-nowrap text-text-secondary outline-none transition-colors hover:text-text-primary focus-visible:ring-2 focus-visible:ring-border-focus-ring data-focus-visible:ring-2 data-focus-visible:ring-border-focus-ring data-selected:bg-background-primary-default data-selected:text-text-primary data-selected:shadow-card dark:data-selected:bg-background-primary-hover";+var kh = "inline-flex w-max max-w-full items-center gap-0.5 overflow-x-auto overscroll-x-contain rounded-2lg bg-background-tertiary-default p-1", Ah = "flex min-h-7 flex-none cursor-pointer items-center gap-1.5 rounded-md px-2.5 py-1 max-sm:px-2 text-body-medium whitespace-nowrap text-text-secondary outline-none transition-colors hover:text-text-primary focus-visible:ring-2 focus-visible:ring-border-focus-ring data-focus-visible:ring-2 data-focus-visible:ring-border-focus-ring data-selected:bg-background-primary-default data-selected:text-text-primary data-selected:shadow-card dark:data-selected:bg-background-primary-hover";//#endregion//#region src/react/settings/busy-props.ts-function Ah(e) {+function jh(e) {return e ? {"aria-busy": !0,"aria-disabled": !0@@ -20309,7 +20312,7 @@ function Ah(e) {}//#endregion//#region src/react/boardui/components/base/buttons/icon-button.tsx-var jh = bt({+var Mh = bt({base: ["relative inline-flex shrink-0 items-center justify-center overflow-visible rounded-2lg","bg-background-primary-default text-foreground-icon-primary",@@ -20330,21 +20333,21 @@ var jh = bt({small: "size-4 shrink-0"}});-function Mh({ icon: e, size: t = "medium", className: n, type: r = "button", ref: i, ...a }) {+function Nh({ icon: e, size: t = "medium", className: n, type: r = "button", ref: i, ...a }) {return /* @__PURE__ */ (0, R.jsx)("button", {ref: i,type: r,- className: yt(jh.base, jh.size[t], n),+ className: yt(Mh.base, Mh.size[t], n),...a,children: /* @__PURE__ */ (0, R.jsx)(e, {- className: jh.icon[t],+ className: Mh.icon[t],"aria-hidden": !0})});}//#endregion//#region src/react/boardui/components/base/dropdown/menu-styles.ts-var Nh = [+var Ph = ["max-w-[calc(100vw-32px)] overflow-y-auto","rounded-2xl border border-border-button-default bg-background-primary-default p-2.5 shadow-dropdown","transition duration-150 ease-out",@@ -20352,10 +20355,10 @@ var Nh = ["data-[exiting]:opacity-0 data-[exiting]:scale-95 data-[exiting]:blur-[2px]","data-[placement=bottom]:origin-top-left data-[placement=top]:origin-bottom-left","data-[placement=left]:origin-right data-[placement=right]:origin-left"-].join(" "), Ph = "w-[266px]", Fh = "flex w-full flex-col gap-1 outline-none", Ih = ["flex w-full cursor-pointer items-center gap-2 rounded-2lg p-2 text-left", "text-text-primary outline-none transition-colors"].join(" ");+].join(" "), Fh = "w-[266px]", Ih = "flex w-full flex-col gap-1 outline-none", Lh = ["flex w-full cursor-pointer items-center gap-2 rounded-2lg p-2 text-left", "text-text-primary outline-none transition-colors"].join(" ");//#endregion//#region src/react/boardui/components/foundations/icons/chevrons.tsx-function Lh(e) {+function Rh(e) {return /* @__PURE__ */ (0, R.jsx)("svg", {viewBox: "0 0 16 16",fill: "none",@@ -20371,7 +20374,7 @@ function Lh(e) {}//#endregion//#region src/react/boardui/utils/use-dismiss-on-outside-press.ts-function Rh(e, t, n) {+function zh(e, t, n) {(0, y.useEffect)(() => {if (!e) return;let r = (e) => {@@ -20385,7 +20388,7 @@ function Rh(e, t, n) {n]);}-function zh(e, t) {+function Bh(e, t) {let n = (0, y.useRef)(!1);return (0, y.useEffect)(() => {if (!e) return;@@ -20399,11 +20402,11 @@ function zh(e, t) {}//#endregion//#region src/react/boardui/components/base/select/select.tsx-var Bh = (0, y.createContext)("md");-function Vh({ className: e, triggerClassName: t, popoverClassName: n, size: r = "md", children: i, items: a, renderValue: o, ref: s, ...c }) {+var Vh = (0, y.createContext)("md");+function Hh({ className: e, triggerClassName: t, popoverClassName: n, size: r = "md", children: i, items: a, renderValue: o, ref: s, ...c }) {let l = (0, y.useRef)(null), u = (0, y.useRef)(null), [d, f] = (0, y.useState)(!1);- Rh(d, () => f(!1), [l, u]);- let p = zh(d, l);+ zh(d, () => f(!1), [l, u]);+ let p = Bh(d, l);return /* @__PURE__ */ (0, R.jsx)(pp, {ref: s,...c,@@ -20416,16 +20419,16 @@ function Vh({ className: e, triggerClassName: t, popoverClassName: n, size: r =children: [/* @__PURE__ */ (0, R.jsx)(_p, {className: yt("flex min-w-0 items-center truncate", r === "sm" ? "gap-1" : "gap-[5px]"),children: o- }), /* @__PURE__ */ (0, R.jsx)(Lh, { className: yt("shrink-0 text-text-secondary transition-transform duration-200 ease", r === "sm" ? "size-3.5" : "size-4", e && "rotate-180") })]+ }), /* @__PURE__ */ (0, R.jsx)(Rh, { className: yt("shrink-0 text-text-secondary transition-transform duration-200 ease", r === "sm" ? "size-3.5" : "size-4", e && "rotate-180") })]}), /* @__PURE__ */ (0, R.jsx)(nf, {ref: u,isNonModal: !0,offset: 4,- className: yt(Ph, Nh, "p-2", n),+ className: yt(Fh, Ph, "p-2", n),children: /* @__PURE__ */ (0, R.jsx)(Xl, {items: a,- className: yt(Fh, "max-h-[240px] overflow-auto"),- children: /* @__PURE__ */ (0, R.jsx)(Bh.Provider, {+ className: yt(Ih, "max-h-[240px] overflow-auto"),+ children: /* @__PURE__ */ (0, R.jsx)(Vh.Provider, {value: r,children: i})@@ -20433,17 +20436,17 @@ function Vh({ className: e, triggerClassName: t, popoverClassName: n, size: r =})] })});}-function Hh({ className: e, children: t, ...n }) {- let r = (0, y.useContext)(Bh);+function Uh({ className: e, children: t, ...n }) {+ let r = (0, y.useContext)(Vh);return /* @__PURE__ */ (0, R.jsx)(eu, {...n,- className: (t) => yt(Ih, r === "sm" ? "px-2 py-1.5 text-body-2-medium" : "text-body-medium", (t.isFocused || t.isSelected) && "bg-dropdown-item-hover-background", t.isDisabled && "cursor-not-allowed text-text-disabled", typeof e == "function" ? e(t) : e),+ className: (t) => yt(Lh, r === "sm" ? "px-2 py-1.5 text-body-2-medium" : "text-body-medium", (t.isFocused || t.isSelected) && "bg-dropdown-item-hover-background", t.isDisabled && "cursor-not-allowed text-text-disabled", typeof e == "function" ? e(t) : e),children: t});}//#endregion//#region src/react/settings/folder-rows.tsx-function Uh({ className: e }) {+function Wh({ className: e }) {return /* @__PURE__ */ (0, R.jsx)("svg", {"aria-hidden": !0,viewBox: "0 0 24 24",@@ -20456,12 +20459,12 @@ function Uh({ className: e }) {children: /* @__PURE__ */ (0, R.jsx)("use", { href: "#i-folder-search" })});}-var Wh = [+var Gh = [["local", "本地磁盘"],["115", "CloudDrive · 115"],["pikpak", "CloudDrive · PikPak"]-], Gh = (e) => im[e] || "database", Kh = (e) => e === "115" || e === "pikpak";-function qh({ initial: e, blank: t, pickFolder: n, describe: r, focusAfterPick: i = !1 }) {+], Kh = (e) => am[e] || "database", qh = (e) => e === "115" || e === "pikpak";+function Jh({ initial: e, blank: t, pickFolder: n, describe: r, focusAfterPick: i = !1 }) {let [a, o] = (0, y.useState)(e), [s, c] = (0, y.useState)([]), [l, u] = (0, y.useState)(null), [d, f] = (0, y.useState)(null), p = (0, y.useRef)(!1), m = (0, y.useRef)([]);(0, y.useLayoutEffect)(() => {l !== null && (m.current[l]?.focus(), u(null));@@ -20504,7 +20507,7 @@ function qh({ initial: e, blank: t, pickFolder: n, describe: r, focusAfterPick:}};}-function Jh({ label: e, path: t, onPath: n, error: r, inputRef: i, picking: a, onPick: o, onRemove: s, status: c, children: l }) {+function Yh({ label: e, path: t, onPath: n, error: r, inputRef: i, picking: a, onPick: o, onRemove: s, status: c, children: l }) {let u = (0, y.useRef)(null), d = () => {let e = u.current;e && e.ownerDocument.activeElement !== e && (e.scrollLeft = e.scrollWidth);@@ -20535,11 +20538,11 @@ function Jh({ label: e, path: t, onPath: n, error: r, inputRef: i, picking: a, oclassName: "flex h-9 shrink-0 items-center",children: c}) : null,- /* @__PURE__ */ (0, R.jsx)(Mh, {- icon: Uh,+ /* @__PURE__ */ (0, R.jsx)(Nh, {+ icon: Wh,"aria-label": "选择文件夹",onClick: o,- ...Ah(a)+ ...jh(a)}),s ? /* @__PURE__ */ (0, R.jsx)(Ct, {variant: "danger",@@ -20555,22 +20558,22 @@ function Jh({ label: e, path: t, onPath: n, error: r, inputRef: i, picking: a, o})]});}-function Yh({ index: e, value: t, onChange: n, options: r = Wh }) {- return /* @__PURE__ */ (0, R.jsx)(Vh, {+function Xh({ index: e, value: t, onChange: n, options: r = Gh }) {+ return /* @__PURE__ */ (0, R.jsx)(Hh, {className: "w-full @lg:w-60","aria-label": `媒体来源 ${e + 1}`,selectedKey: t,onSelectionChange: (e) => {e !== null && n(String(e));},- children: r.map(([e, t]) => /* @__PURE__ */ (0, R.jsxs)(Hh, {+ children: r.map(([e, t]) => /* @__PURE__ */ (0, R.jsxs)(Uh, {id: e,textValue: t,- children: [/* @__PURE__ */ (0, R.jsx)(mm, { mark: Gh(e) }), t]+ children: [/* @__PURE__ */ (0, R.jsx)(hm, { mark: Kh(e) }), t]}, e))});}-function Xh({ value: e, onChange: t, label: n = "Windows 中的对应路径", placeholder: r = "例如 B:\\" }) {+function Zh({ value: e, onChange: t, label: n = "Windows 中的对应路径", placeholder: r = "例如 B:\\" }) {return /* @__PURE__ */ (0, R.jsx)(Vp, {label: n,placeholder: r,@@ -20580,7 +20583,7 @@ function Xh({ value: e, onChange: t, label: n = "Windows 中的对应路径", pl}//#endregion//#region src/react/settings/password-pair.tsx-function Zh({ label: e, password: t, confirmation: n, onPassword: r, onConfirmation: i, disabled: a = !1, passwordError: o, passwordHint: s, confirmationError: c, confirmationInvalid: l = !1 }) {+function Qh({ label: e, password: t, confirmation: n, onPassword: r, onConfirmation: i, disabled: a = !1, passwordError: o, passwordHint: s, confirmationError: c, confirmationInvalid: l = !1 }) {return /* @__PURE__ */ (0, R.jsxs)(R.Fragment, { children: [/* @__PURE__ */ (0, R.jsx)(Vp, {id: "access-password",type: "password",@@ -20611,13 +20614,13 @@ function Zh({ label: e, password: t, confirmation: n, onPassword: r, onConfirmat}//#endregion//#region src/react/pages/setup/setup-form.tsx-var Qh = [+var $h = ["data_root","host","port","mdns_name"];-function $h(e, t) {+function eg(e, t) {return Array.isArray(e) ? e.length === t ? {rows: e,table: ""@@ -20629,20 +20632,20 @@ function $h(e, t) {table: e ?? ""};}-function eg(e) {+function tg(e) {return e.length ? e.length === 1 ? `完成设置后扫描并补全资料:${e[0]}` : `完成设置后扫描这 ${e.length} 个文件夹并补全资料` : "完成设置后扫描并补全资料";}-var tg = (e) => Array.isArray(e) ? e.filter(Boolean).join(" ") : e ?? "";-function ng({ setup: e, onDone: t }) {+var ng = (e) => Array.isArray(e) ? e.filter(Boolean).join(" ") : e ?? "";+function rg({ setup: e, onDone: t }) {let n = e.questions.find((e) => e.input === "folders"), r = e.questions.filter((e) => e.input !== "folders"), i = e.media_sources.map(({ value: e, label: t }) => [e, t]), a = (t = "") => ({path: t,location: e.media_source_default,root: ""- }), o = qh({+ }), o = Jh({initial: () => [a(n?.default ?? "")],blank: () => a(),- pickFolder: Zp,- describe: Qp,+ pickFolder: Qp,+ describe: $p,focusAfterPick: !0}), [s, c] = (0, y.useState)(() => Object.fromEntries(r.map((e) => [e.key, e.default]))), [l, u] = (0, y.useState)(e.access_enabled), [d, f] = (0, y.useState)(""), [p, m] = (0, y.useState)(""), [h, g] = (0, y.useState)(e.scan_now), [_, v] = (0, y.useState)(e.history_guide), [b, x] = (0, y.useState)({}), [S, C] = (0, y.useState)(""), [w, T] = (0, y.useState)(""), [ee, E] = (0, y.useState)(!1), [D, O] = (0, y.useState)(0), k = (0, y.useRef)(null), A = (0, y.useRef)(null), [j, te] = (0, y.useState)(0);(0, y.useEffect)(() => {@@ -20672,14 +20675,14 @@ function ng({ setup: e, onDone: t }) {t(await Xp(n));} catch (e) {if (e instanceof qp && e.status === 400 && e.errors) {- let t = e.errors, { rows: n, table: r } = $h(t.media_dir, o.rows.length);- o.setErrors(n), C(r), x(t), Qh.some((e) => t[e]) && O((e) => e + 1), t.access_password && u(!0), te((e) => e + 1);- } else T(Qp(e));+ let t = e.errors, { rows: n, table: r } = eg(t.media_dir, o.rows.length);+ o.setErrors(n), C(r), x(t), $h.some((e) => t[e]) && O((e) => e + 1), t.access_password && u(!0), te((e) => e + 1);+ } else T($p(e));} finally {E(!1);}}, ae = (e) => {- let t = tg(b[e.key]), n = e.help.join("");+ let t = ng(b[e.key]), n = e.help.join("");if (e.input === "choice") {let r = `setup-${e.key}-label`;return /* @__PURE__ */ (0, R.jsxs)("div", {@@ -20690,20 +20693,20 @@ function ng({ setup: e, onDone: t }) {elementType: "span",children: e.label}),- /* @__PURE__ */ (0, R.jsx)(Dh, {+ /* @__PURE__ */ (0, R.jsx)(Oh, {"aria-labelledby": r,orientation: "horizontal",- className: Oh,+ className: kh,value: s[e.key] ?? e.default,onChange: (t) => M(e.key, t),children: (e.options ?? []).map((e) => /* @__PURE__ */ (0, R.jsx)(tp, {value: e.value,- className: kh,+ className: Ah,children: e.label}, e.value))}),- n ? /* @__PURE__ */ (0, R.jsx)(sm, { children: n }) : null,- t ? /* @__PURE__ */ (0, R.jsx)(cm, { children: t }, j) : null+ n ? /* @__PURE__ */ (0, R.jsx)(cm, { children: n }) : null,+ t ? /* @__PURE__ */ (0, R.jsx)(lm, { children: t }, j) : null]}, e.key);}@@ -20728,7 +20731,7 @@ function ng({ setup: e, onDone: t }) {isInvalid: !!t,hint: ne(t) ?? (n || void 0)}, e.key);- }, oe = o.rows.map((e) => e.path.trim()).filter(Boolean), se = o.rows.some((e) => Kh(e.location));+ }, oe = o.rows.map((e) => e.path.trim()).filter(Boolean), se = o.rows.some((e) => qh(e.location));return /* @__PURE__ */ (0, R.jsxs)("form", {ref: k,noValidate: !0,@@ -20748,12 +20751,12 @@ function ng({ setup: e, onDone: t }) {children: "*"})]}),- S ? /* @__PURE__ */ (0, R.jsx)(cm, { children: S }, j) : null,+ S ? /* @__PURE__ */ (0, R.jsx)(lm, { children: S }, j) : null,/* @__PURE__ */ (0, R.jsx)("div", {role: "group","aria-labelledby": "setup-media-title",className: "flex flex-col gap-3",- children: o.rows.map((t, r) => /* @__PURE__ */ (0, R.jsxs)(Jh, {+ children: o.rows.map((t, r) => /* @__PURE__ */ (0, R.jsxs)(Yh, {label: `${n.label} ${r + 1}`,path: t.path,onPath: (e) => o.edit(r, { path: e }),@@ -20764,12 +20767,12 @@ function ng({ setup: e, onDone: t }) {onRemove: o.rows.length > 1 ? () => {o.remove(r), A.current?.focus();} : void 0,- children: [/* @__PURE__ */ (0, R.jsx)(Yh, {+ children: [/* @__PURE__ */ (0, R.jsx)(Xh, {index: r,value: t.location,options: i,onChange: (e) => o.edit(r, { location: e })- }), e.media_root ? /* @__PURE__ */ (0, R.jsx)(Xh, {+ }), e.media_root ? /* @__PURE__ */ (0, R.jsx)(Zh, {label: e.media_root.label,placeholder: e.media_root.placeholder,value: t.root,@@ -20785,14 +20788,14 @@ function ng({ setup: e, onDone: t }) {onClick: o.add,children: "添加媒体库"}),- se ? /* @__PURE__ */ (0, R.jsxs)(R.Fragment, { children: [/* @__PURE__ */ (0, R.jsxs)(sm, { children: [e.cloud.help, /* @__PURE__ */ (0, R.jsx)(lm, {+ se ? /* @__PURE__ */ (0, R.jsxs)(R.Fragment, { children: [/* @__PURE__ */ (0, R.jsxs)(cm, { children: [e.cloud.help, /* @__PURE__ */ (0, R.jsx)(um, {href: e.cloud.link.url,children: e.cloud.link.label- })] }), e.cloud.dependencies.map((e) => /* @__PURE__ */ (0, R.jsxs)(sm, { children: [e.message, /* @__PURE__ */ (0, R.jsx)(lm, {+ })] }), e.cloud.dependencies.map((e) => /* @__PURE__ */ (0, R.jsxs)(cm, { children: [e.message, /* @__PURE__ */ (0, R.jsx)(um, {href: e.download_url,children: e.download_label})] }, e.name))] }) : null,- n.help.map((e) => /* @__PURE__ */ (0, R.jsx)(sm, { children: e }, e))+ n.help.map((e) => /* @__PURE__ */ (0, R.jsx)(cm, { children: e }, e))]}) : null,/* @__PURE__ */ (0, R.jsxs)(Et, {@@ -20810,27 +20813,27 @@ function ng({ setup: e, onDone: t }) {className: "text-body-2-regular text-text-secondary",children: "开启后,访问 Peach 需要先登录。"})]- }), /* @__PURE__ */ (0, R.jsx)(vm, {+ }), /* @__PURE__ */ (0, R.jsx)(ym, {"aria-labelledby": "setup-access-title","aria-describedby": "setup-access-description",isSelected: l,onChange: u})]}),- /* @__PURE__ */ (0, R.jsx)(sm, { children: "未设置密码时,能连接到 Peach 的设备可直接进入。" }),- l ? /* @__PURE__ */ (0, R.jsx)(Zh, {+ /* @__PURE__ */ (0, R.jsx)(cm, { children: "未设置密码时,能连接到 Peach 的设备可直接进入。" }),+ l ? /* @__PURE__ */ (0, R.jsx)(Qh, {label: "访问密码",password: d,confirmation: p,onPassword: f,onConfirmation: m,- passwordError: ne(tg(b.access_password)),+ passwordError: ne(ng(b.access_password)),passwordHint: "请输入 8–256 个字符。",confirmationInvalid: !!b.access_password}) : null]}),- /* @__PURE__ */ (0, R.jsx)(Et, { children: /* @__PURE__ */ (0, R.jsx)(fm, {+ /* @__PURE__ */ (0, R.jsx)(Et, { children: /* @__PURE__ */ (0, R.jsx)(pm, {summary: "高级设置",defaultOpen: D > 0,children: /* @__PURE__ */ (0, R.jsx)("div", {@@ -20850,8 +20853,8 @@ function ng({ setup: e, onDone: t }) {children: [/* @__PURE__ */ (0, R.jsx)(kp, {isSelected: h,onChange: g,- children: eg(oe)- }), /* @__PURE__ */ (0, R.jsx)(sm, { children: "读取已有 NFO 和封面,采集缺失资料。符合自动规则的资料会在处理完成后落库,其余候选留在复核。" })]+ children: tg(oe)+ }), /* @__PURE__ */ (0, R.jsx)(cm, { children: "读取已有 NFO 和封面,采集缺失资料。符合自动规则的资料会在处理完成后落库,其余候选留在复核。" })]}),/* @__PURE__ */ (0, R.jsxs)("section", {"aria-labelledby": "setup-history-title",@@ -20870,25 +20873,66 @@ function ng({ setup: e, onDone: t }) {onChange: v,children: "接下来导入浏览器历史记录"}),- /* @__PURE__ */ (0, R.jsx)(sm, { children: "用于生成口味分析。完成设置后选择读取这台电脑,或导入其他设备的记录;也可稍后从「口味」进入。" })+ /* @__PURE__ */ (0, R.jsx)(cm, { children: "用于生成口味分析。完成设置后选择读取这台电脑,或导入其他设备的记录;也可稍后从「口味」进入。" })]})]}),- w ? /* @__PURE__ */ (0, R.jsx)(cm, { children: w }) : null,+ w ? /* @__PURE__ */ (0, R.jsx)(lm, { children: w }) : null,/* @__PURE__ */ (0, R.jsx)(Ct, {type: "submit",className: "self-start",- ...Ah(ee),+ ...jh(ee),children: "完成设置"})]});}//#endregion+//#region src/react/pages/setup/setup-restore.tsx+function ig({ onDone: e }) {+ let [t, n] = (0, y.useState)(""), [r, i] = (0, y.useState)(""), [a, o] = (0, y.useState)(!1);+ return /* @__PURE__ */ (0, R.jsxs)("form", {+ className: "flex flex-col gap-4",+ onSubmit: async (n) => {+ if (n.preventDefault(), !a) {+ o(!0), i("");+ try {+ e(await Zp(t));+ } catch (e) {+ let t = e instanceof qp ? e.errors?.data_root : void 0;+ i(typeof t == "string" ? t : $p(e));+ } finally {+ o(!1);+ }+ }+ },+ noValidate: !0,+ children: [/* @__PURE__ */ (0, R.jsx)(Vp, {+ label: "已有数据目录",+ value: t,+ onChange: n,+ isRequired: !0,+ autoComplete: "off",+ spellCheck: "false",+ validationBehavior: "aria",+ isInvalid: !!r,+ hint: r ? /* @__PURE__ */ (0, R.jsx)("span", {+ role: "alert",+ children: r+ }) : "选择包含 config.toml 和 database 文件夹的数据目录。"+ }), /* @__PURE__ */ (0, R.jsx)(Ct, {+ type: "submit",+ className: "self-start",+ ...jh(a),+ children: a ? "正在连接数据目录…" : "使用此目录"+ })]+ });+}+//#endregion//#region src/react/pages/setup/setup-page.tsx-function rg() {- let [e, t] = (0, y.useState)({ kind: "loading" }), [n, r] = (0, y.useState)(0);+function ag() {+ let [e, t] = (0, y.useState)({ kind: "loading" }), [n, r] = (0, y.useState)(0), [i, a] = (0, y.useState)(!1);return (0, y.useEffect)(() => {let e = new AbortController();return Yp(e.signal).then((e) => t({@@ -20897,10 +20941,10 @@ function rg() {}), (n) => {e.signal.aborted || t(n instanceof qp && n.status === 403 ? { kind: "denied" } : {kind: "failed",- message: Qp(n)+ message: $p(n)});}), () => e.abort();- }, [n]), e.kind === "done" ? /* @__PURE__ */ (0, R.jsx)(hm, { done: e.done }) : /* @__PURE__ */ (0, R.jsxs)(Tt, {+ }, [n]), e.kind === "done" ? /* @__PURE__ */ (0, R.jsx)(gm, { done: e.done }) : /* @__PURE__ */ (0, R.jsxs)(Tt, {title: "欢迎使用 Peach",lede: "添加媒体库,开始整理馆藏。",busy: e.kind === "loading",@@ -20920,24 +20964,32 @@ function rg() {}),children: e.message}) : null,- e.kind === "form" ? /* @__PURE__ */ (0, R.jsx)(ng, {+ e.kind === "form" ? /* @__PURE__ */ (0, R.jsxs)(R.Fragment, { children: [/* @__PURE__ */ (0, R.jsx)(Ct, {+ variant: "secondary",+ className: "self-start",+ onClick: () => a((e) => !e),+ children: i ? "返回首次设置" : "使用已有数据目录"+ }), i ? /* @__PURE__ */ (0, R.jsx)(ig, { onDone: (e) => t({+ kind: "done",+ done: e+ }) }) : /* @__PURE__ */ (0, R.jsx)(rg, {setup: e.setup,onDone: (e) => t({kind: "done",done: e})- }) : null+ })] }) : null]});}//#endregion//#region src/react/pages/index.tsx-var ig = {- setup: rg,+var og = {+ setup: ag,login: Hp,error: At};u();-var ag = document.getElementById("peach-page"), og = ag ? ig[ag.dataset.page ?? ""] : void 0;-ag && og && (0, b.createRoot)(ag).render(/* @__PURE__ */ (0, R.jsx)(og, { data: { ...ag.dataset } }));+var sg = document.getElementById("peach-page"), cg = sg ? og[sg.dataset.page ?? ""] : void 0;+sg && cg && (0, b.createRoot)(sg).render(/* @__PURE__ */ (0, R.jsx)(cg, { data: { ...sg.dataset } }));//#endregion