From 1d2965ffe6678de6f8fbb9120efddfa4f5fbe842 Mon Sep 17 00:00:00 2001 From: Liang Date: Fri, 27 Nov 2026 06:04:24 +0800 Subject: [PATCH 1/9] build: upgrade to electron-vite 6 and Vite 8 Upgrade electron-vite to v6 and Vite to v8, the base for the Vite+ migration. - Rename `rollupOptions` to `rolldownOptions`, since Vite 8 bundles with Rolldown. - Replace the `manualChunks` function with a Rolldown `codeSplitting` group that keeps Cesium in its own chunk. - Update the pinned Vite version note in AGENTS.md. --- AGENTS.md | 2 +- electron.vite.config.ts | 10 +- package-lock.json | 5552 ++++++++++++++++++--------------------- package.json | 4 +- 4 files changed, 2524 insertions(+), 3044 deletions(-) diff --git a/AGENTS.md b/AGENTS.md index 3af34a1..1b520dd 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -22,7 +22,7 @@ map data providers, an AI globe assistant ("EOQ agent"), and teaching/drawing to **Pinned versions — do not bump casually:** -- `vite@^7` — electron-vite@5 peer range tops out at vite 7. +- `vite@^8` — the project uses Vite 8 with electron-vite@6. - `typescript@5.9.x` — pinned TypeScript version (`tsconfig.node.json` + `tsconfig.web.json`). - `@base-ui/react@^1.9` + `tailwindcss@^4.3` + `lucide-react` — headless Base UI primitives wrapped in `src/renderer/src/components/ui/` following [DESIGN.md](./DESIGN.md) monochrome Light/Dark tokens. Do not reintroduce `antd` or `@ant-design/*`. - Electron binaries must be installed manually with the npmmirror mirror: diff --git a/electron.vite.config.ts b/electron.vite.config.ts index c07ca5b..a141d2b 100644 --- a/electron.vite.config.ts +++ b/electron.vite.config.ts @@ -49,7 +49,7 @@ export default defineConfig({ main: { build: { externalizeDeps: false, - rollupOptions: { + rolldownOptions: { external: ['koffi'], input: { index: resolve('src/main/index.ts'), @@ -72,16 +72,14 @@ export default defineConfig({ }, plugins: [react(), tailwindcss(), cesiumStaticPlugin()], build: { - rollupOptions: { + rolldownOptions: { input: { index: resolve('src/renderer/index.html'), offscreen: resolve('src/renderer/offscreen.html') }, output: { - manualChunks(id) { - const normalizedId = id.replaceAll('\\', '/') - if (normalizedId.includes('/node_modules/cesium/') || normalizedId.includes('/node_modules/@cesium/')) return 'cesium' - return undefined + codeSplitting: { + groups: [{ name: 'cesium', test: /[\\/]node_modules[\\/]@?cesium[\\/]/ }] } } } diff --git a/package-lock.json b/package-lock.json index 5850410..f34308f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -35,7 +35,7 @@ "echarts": "^6.1.0", "electron": "^44.9.1", "electron-builder": "^26.15.3", - "electron-vite": "^5.0.0", + "electron-vite": "^6.0.0", "jsdom": "^31.0.1", "lucide-react": "^1.77.0", "markdown-it": "^15.0.3", @@ -47,7 +47,7 @@ "tailwindcss": "^4.3.5", "tw-shimmer": "^0.4.14", "typescript": "^5.9.3", - "vite": "^7.3.7", + "vite": "^8.4.0", "zustand": "^5.1.0" } }, @@ -837,1612 +837,1236 @@ "node": ">=14.14" } }, - "node_modules/@esbuild/aix-ppc64": { - "version": "0.28.2", - "resolved": "https://registry.npmmirror.com/@esbuild/aix-ppc64/-/aix-ppc64-0.28.2.tgz", - "integrity": "sha512-XExcO+dvLKvVtNTibSTBej1NCAbaGhWn9Ww1ZPx80qsahhPFe/8jgWP0IchNe0F3HwkU7n8ejhH8bjonqht8mQ==", - "cpu": [ - "ppc64" - ], + "node_modules/@emnapi/core": { + "version": "2.0.0-beta.2", + "resolved": "https://registry.npmjs.org/@emnapi/core/-/core-2.0.0-beta.2.tgz", + "integrity": "sha512-MzCVoWtcg4Pm2B3je5mMvYMvj3MmBKw+fU7vbsJc9/iT8ip6/eYIHo/Dsm/mr+wsHB6SEyJDuxB09Yy6r/8+4A==", "dev": true, + "license": "MIT", "optional": true, - "os": [ - "aix" - ], - "engines": { - "node": ">=18" + "dependencies": { + "@emnapi/wasi-threads": "2.2.0", + "tslib": "^2.4.0" } }, - "node_modules/@esbuild/android-arm": { - "version": "0.28.2", - "resolved": "https://registry.npmmirror.com/@esbuild/android-arm/-/android-arm-0.28.2.tgz", - "integrity": "sha512-kXXoiPVVGQcnIYGOeaovwOURpniDBpSq4A03qkQ+BMQqtGG6HYap3xne9C1O1yo4TR3qxlCX5IqqmX6fFo2Lqg==", - "cpu": [ - "arm" - ], + "node_modules/@emnapi/runtime": { + "version": "2.0.0-beta.2", + "resolved": "https://registry.npmjs.org/@emnapi/runtime/-/runtime-2.0.0-beta.2.tgz", + "integrity": "sha512-JcrSPzPvZuNZvJqPTF9Fw25LbOJ8avzFVlaf2grmH4Cku0oGP47tRgqPZadcfj3YoZMHkFVnCYFbQM8I+i5QEw==", "dev": true, + "license": "MIT", "optional": true, - "os": [ - "android" - ], + "dependencies": { + "tslib": "^2.4.0" + } + }, + "node_modules/@emnapi/wasi-threads": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/@emnapi/wasi-threads/-/wasi-threads-2.2.0.tgz", + "integrity": "sha512-JP7OYH38Q7+pyTAe14raZHLQIK7BDKbdwji+Xi3pcd/6QkJYQH3SX4wu6EplGrGJWRepoNzedfm0G3B9Z4e9Rw==", + "dev": true, + "license": "MIT", + "optional": true, + "dependencies": { + "tslib": "^2.4.0" + } + }, + "node_modules/@exodus/bytes": { + "version": "1.16.0", + "resolved": "https://registry.npmmirror.com/@exodus/bytes/-/bytes-1.16.0.tgz", + "integrity": "sha512-IcpW84uEn3N7ETtNZMlxKhfl6Pec8rUNGOTBtWbK1FKhJxIFAptZyVrvVRVBimAJxJCgc3PxepxkdWWG4DVzfA==", + "dev": true, "engines": { - "node": ">=18" + "node": "^20.19.0 || ^22.12.0 || >=24.0.0" + }, + "peerDependencies": { + "@noble/hashes": "^1.8.0 || ^2.0.0" + }, + "peerDependenciesMeta": { + "@noble/hashes": { + "optional": true + } + } + }, + "node_modules/@floating-ui/core": { + "version": "1.8.0", + "resolved": "https://registry.npmmirror.com/@floating-ui/core/-/core-1.8.0.tgz", + "integrity": "sha512-0CIZ5itps/8x7BG8dEIhs53BvCUH2PCoogtakwRTut+Arm58sJooJ0AuZhLw2HJYIR5cMLNPBSS728sPho2khQ==", + "dev": true, + "dependencies": { + "@floating-ui/utils": "^0.2.12" + } + }, + "node_modules/@floating-ui/dom": { + "version": "1.8.0", + "resolved": "https://registry.npmmirror.com/@floating-ui/dom/-/dom-1.8.0.tgz", + "integrity": "sha512-yXSrzeHZBTZadLOlfyhCkJHNeLJnHRnRInwdZ40L7ZiaAtrBwoYlsDrX3v5zB1Utk7CLfzcOVnVVWoXEky7Ceg==", + "dev": true, + "dependencies": { + "@floating-ui/core": "^1.8.0", + "@floating-ui/utils": "^0.2.12" + } + }, + "node_modules/@floating-ui/react-dom": { + "version": "2.1.9", + "resolved": "https://registry.npmmirror.com/@floating-ui/react-dom/-/react-dom-2.1.9.tgz", + "integrity": "sha512-JDjEFGCpImxDCA7JJKviA0M9+RtmJdj0m/NVU5IMgBK+AmZouAQQ7/+2GLH0GXXY0YMw9oXPB8hKdbPYg5QLYg==", + "dev": true, + "dependencies": { + "@floating-ui/dom": "^1.8.0" + }, + "peerDependencies": { + "react": ">=16.8.0", + "react-dom": ">=16.8.0" + } + }, + "node_modules/@floating-ui/utils": { + "version": "0.2.12", + "resolved": "https://registry.npmmirror.com/@floating-ui/utils/-/utils-0.2.12.tgz", + "integrity": "sha512-HpCo8tmWzLVad5s2d19EhAz5zqrrQ6s69qd6moPMQvkOuSwDT1YgRfWSVuc4ennqrgv3OHppiOGMQ7oC13yIww==", + "dev": true + }, + "node_modules/@isaacs/fs-minipass": { + "version": "4.0.1", + "resolved": "https://registry.npmmirror.com/@isaacs/fs-minipass/-/fs-minipass-4.0.1.tgz", + "integrity": "sha512-wgm9Ehl2jpeqP3zw/7mo3kRHFp5MEDhqAdwy1fTGkHAwnkGOVsgpvQhL8B5n1qlb01jV3n/bI0ZfZp5lWA1k4w==", + "dev": true, + "dependencies": { + "minipass": "^7.0.4" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@isaacs/nonrecursive-glob-match": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/@isaacs/nonrecursive-glob-match/-/nonrecursive-glob-match-1.0.3.tgz", + "integrity": "sha512-SI7kyKHq4XXDRozw+r9GlRZkia1ZkFrpLW98r2IC2Bpr8YkFGE3fvjzmxCG0x78A++69HmDNrDvSMYBZmHGpKA==", + "dev": true, + "license": "BlueOak-1.0.0" + }, + "node_modules/@jridgewell/gen-mapping": { + "version": "0.3.13", + "resolved": "https://registry.npmmirror.com/@jridgewell/gen-mapping/-/gen-mapping-0.3.13.tgz", + "integrity": "sha512-2kkt/7niJ6MgEPxF0bYdQ6etZaA+fQvDcLKckhy1yIQOzaoKjBBjSj63/aLVjYE3qhRt5dvM+uUyfCg6UKCBbA==", + "dev": true, + "dependencies": { + "@jridgewell/sourcemap-codec": "^1.5.0", + "@jridgewell/trace-mapping": "^0.3.24" + } + }, + "node_modules/@jridgewell/remapping": { + "version": "2.3.5", + "resolved": "https://registry.npmmirror.com/@jridgewell/remapping/-/remapping-2.3.5.tgz", + "integrity": "sha512-LI9u/+laYG4Ds1TDKSJW2YPrIlcVYOwi2fUC6xB43lueCjgxV4lffOCZCtYFiH6TNOX+tQKXx97T4IKHbhyHEQ==", + "dev": true, + "dependencies": { + "@jridgewell/gen-mapping": "^0.3.5", + "@jridgewell/trace-mapping": "^0.3.24" + } + }, + "node_modules/@jridgewell/resolve-uri": { + "version": "3.1.2", + "resolved": "https://registry.npmmirror.com/@jridgewell/resolve-uri/-/resolve-uri-3.1.2.tgz", + "integrity": "sha512-bRISgCIjP20/tbWSPWMEi54QVPRZExkuD9lJL+UIxUKtwVJA8wW1Trb1jMs1RFXo1CBTNZ/5hpC9QvmKWdopKw==", + "dev": true, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@jridgewell/sourcemap-codec": { + "version": "1.6.0", + "resolved": "https://registry.npmmirror.com/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.6.0.tgz", + "integrity": "sha512-T7jf+5zgsZHwNJ4lvQ7/aezbyk0nNX+zJVWpmHA7VYsEx7a7qr5Rg5IbtJFqkgze5Y2sruq1RUY8Q837Od7iFw==", + "dev": true + }, + "node_modules/@jridgewell/trace-mapping": { + "version": "0.3.31", + "resolved": "https://registry.npmmirror.com/@jridgewell/trace-mapping/-/trace-mapping-0.3.31.tgz", + "integrity": "sha512-zzNR+SdQSDJzc8joaeP8QQoCQr8NuYx2dIIytl1QeBEZHJ9uW6hebsrYgbz8hJwUQao3TWCMtmfV8Nu1twOLAw==", + "dev": true, + "dependencies": { + "@jridgewell/resolve-uri": "^3.1.0", + "@jridgewell/sourcemap-codec": "^1.4.14" } }, - "node_modules/@esbuild/android-arm64": { - "version": "0.28.2", - "resolved": "https://registry.npmmirror.com/@esbuild/android-arm64/-/android-arm64-0.28.2.tgz", - "integrity": "sha512-5YfKeeI8qWfBZIX+u2xZC3Zlb3Os/gLS2sbEKM+I4ZOcsWmHS2WLysCcQZDAFRslDUU5Oiq44gf6PYN1vGwG5A==", + "node_modules/@koromix/koffi-android-arm64": { + "version": "3.3.8", + "resolved": "https://registry.npmmirror.com/@koromix/koffi-android-arm64/-/koffi-android-arm64-3.3.8.tgz", + "integrity": "sha512-Y0lt2JexRGXlg1PxFuegfi5p6bIcLMj7Mig0WapZRKEM3Yv2L9J3Ej4XHPYMsB0TRNttBRHiliaJOH6EedEIXg==", "cpu": [ "arm64" ], - "dev": true, "optional": true, "os": [ "android" ], - "engines": { - "node": ">=18" + "funding": { + "url": "https://liberapay.com/Koromix" } }, - "node_modules/@esbuild/android-x64": { - "version": "0.28.2", - "resolved": "https://registry.npmmirror.com/@esbuild/android-x64/-/android-x64-0.28.2.tgz", - "integrity": "sha512-O387ite7SzUyCcy3JQX4P4bLtEA7bLLkx+esve5JHnyYfNTxcVpXZo9jhdB0lTKN44gztELTdU7nS8Nr16Fs1Q==", + "node_modules/@koromix/koffi-android-x64": { + "version": "3.3.8", + "resolved": "https://registry.npmmirror.com/@koromix/koffi-android-x64/-/koffi-android-x64-3.3.8.tgz", + "integrity": "sha512-ZOwUZJoQ7Xd0rRF85Qc5XyIBjZPKGNLNgoTFakWdxn55AoZ6zdGEYvOXQMIN8JLjQ6qYUiQMtlFlusddZr+pjA==", "cpu": [ "x64" ], - "dev": true, "optional": true, "os": [ "android" ], - "engines": { - "node": ">=18" + "funding": { + "url": "https://liberapay.com/Koromix" } }, - "node_modules/@esbuild/darwin-arm64": { - "version": "0.28.2", - "resolved": "https://registry.npmmirror.com/@esbuild/darwin-arm64/-/darwin-arm64-0.28.2.tgz", - "integrity": "sha512-n4KqkOQrraxHJcgjM1RvwbigfQKIKJVpM7xp+KsxiyUSrRdIXnt73VhrPAx0fV44hgfmIVKjxMN9J1t5jySVkw==", + "node_modules/@koromix/koffi-darwin-arm64": { + "version": "3.3.8", + "resolved": "https://registry.npmmirror.com/@koromix/koffi-darwin-arm64/-/koffi-darwin-arm64-3.3.8.tgz", + "integrity": "sha512-7tzlnYSePCQW66iEIi+wgN9HgTiF431KL9wIDhH9b+32KOYZXBdA+JyDgRVi2E5AIyJ1hdkQFNg7YCAOft2mKw==", "cpu": [ "arm64" ], - "dev": true, "optional": true, "os": [ "darwin" ], - "engines": { - "node": ">=18" + "funding": { + "url": "https://liberapay.com/Koromix" } }, - "node_modules/@esbuild/darwin-x64": { - "version": "0.28.2", - "resolved": "https://registry.npmmirror.com/@esbuild/darwin-x64/-/darwin-x64-0.28.2.tgz", - "integrity": "sha512-uq6suIWYP37qzGddBKPw5QEQPi6HiLGsO7UmkpfyaYNQ3D+rN6w6WfwH+nuqcGXWvawGwxOEroO4YGnFh95azw==", + "node_modules/@koromix/koffi-darwin-x64": { + "version": "3.3.8", + "resolved": "https://registry.npmmirror.com/@koromix/koffi-darwin-x64/-/koffi-darwin-x64-3.3.8.tgz", + "integrity": "sha512-Pw1EsCT9Yov4Szo4joLhABbQfqNgYhwfkhWZiIbEZ2b3sGyv9Yj2N0p00jOpdTfQ+u9QFFi8XhNivJbBTqMTPA==", "cpu": [ "x64" ], - "dev": true, "optional": true, "os": [ "darwin" ], - "engines": { - "node": ">=18" + "funding": { + "url": "https://liberapay.com/Koromix" } }, - "node_modules/@esbuild/freebsd-arm64": { - "version": "0.28.2", - "resolved": "https://registry.npmmirror.com/@esbuild/freebsd-arm64/-/freebsd-arm64-0.28.2.tgz", - "integrity": "sha512-n+I0BTSRIoy+d6RPKnEVwql5UwBJolytvY4mAOIEJorKlqgPII8ix6slVVrfZ5Tnj7glIZvloylbB/EJPMWEXw==", + "node_modules/@koromix/koffi-freebsd-arm64": { + "version": "3.3.8", + "resolved": "https://registry.npmmirror.com/@koromix/koffi-freebsd-arm64/-/koffi-freebsd-arm64-3.3.8.tgz", + "integrity": "sha512-bpkvHfxUn5EqaHQO9k42lqO8+5t9aF8McgJyOsXx+vd/xicA0Zc0vP2kz0MjQu760ZdsR3WI4VFiNh2xHRP6Lw==", "cpu": [ "arm64" ], - "dev": true, "optional": true, "os": [ "freebsd" ], - "engines": { - "node": ">=18" + "funding": { + "url": "https://liberapay.com/Koromix" + } + }, + "node_modules/@koromix/koffi-freebsd-ia32": { + "version": "3.3.8", + "resolved": "https://registry.npmmirror.com/@koromix/koffi-freebsd-ia32/-/koffi-freebsd-ia32-3.3.8.tgz", + "integrity": "sha512-h2WI3Ofb+TioTqWDTMXPgtZ2LAghY2CPwZwMM3mZeGAzKygo9RxZ4PRGq8bvrdvinR4VN9ZK+H48m9GV3/u3mQ==", + "cpu": [ + "ia32" + ], + "optional": true, + "os": [ + "freebsd" + ], + "funding": { + "url": "https://liberapay.com/Koromix" } }, - "node_modules/@esbuild/freebsd-x64": { - "version": "0.28.2", - "resolved": "https://registry.npmmirror.com/@esbuild/freebsd-x64/-/freebsd-x64-0.28.2.tgz", - "integrity": "sha512-78XJTJkvPs0kz2w61301PJjXl4g7q3JqiYMZ/M/yVI73EHBrCRTgkhu9oqG7vPqq+a/yadEW8aD+agKlk5xrmg==", + "node_modules/@koromix/koffi-freebsd-x64": { + "version": "3.3.8", + "resolved": "https://registry.npmmirror.com/@koromix/koffi-freebsd-x64/-/koffi-freebsd-x64-3.3.8.tgz", + "integrity": "sha512-Z1VAr2CfWaHYfqJ1UlbZBH2IcPqZHilBSCgSqDmVhmyN/tSz5kSjaRfxcBGloJted3CCvsNFg8lOJiKkPiAUNQ==", "cpu": [ "x64" ], - "dev": true, "optional": true, "os": [ "freebsd" ], - "engines": { - "node": ">=18" + "funding": { + "url": "https://liberapay.com/Koromix" } }, - "node_modules/@esbuild/linux-arm": { - "version": "0.28.2", - "resolved": "https://registry.npmmirror.com/@esbuild/linux-arm/-/linux-arm-0.28.2.tgz", - "integrity": "sha512-XlDnu2q5yoqems+xay6wSAcg9DDD7K9RLKZEBOMZm3ckNpJBvOX20tSfby8KfrrhINDyv9V2YVZKY/SpoGJI8w==", + "node_modules/@koromix/koffi-linux-arm": { + "version": "3.3.8", + "resolved": "https://registry.npmmirror.com/@koromix/koffi-linux-arm/-/koffi-linux-arm-3.3.8.tgz", + "integrity": "sha512-9c9IfIz5sFpzbuwV2HomSBWOakpbd9tJ3FChmE556KdPzw9iXrJoMT5JyzPnUe10Soag2NK6SMKrDafOsR6J2A==", "cpu": [ "arm" ], - "dev": true, "optional": true, "os": [ "linux" ], - "engines": { - "node": ">=18" + "funding": { + "url": "https://liberapay.com/Koromix" } }, - "node_modules/@esbuild/linux-arm64": { - "version": "0.28.2", - "resolved": "https://registry.npmmirror.com/@esbuild/linux-arm64/-/linux-arm64-0.28.2.tgz", - "integrity": "sha512-pW4AC0P3it8c7do9MVM4p51FzHzdM/TZrerurgRcHJ2WTa1VQ1CIq18xncfpBJw4ojkiZZrKW2yIBWBP92j6Ug==", + "node_modules/@koromix/koffi-linux-arm64": { + "version": "3.3.8", + "resolved": "https://registry.npmmirror.com/@koromix/koffi-linux-arm64/-/koffi-linux-arm64-3.3.8.tgz", + "integrity": "sha512-7yknlwsy7X76+Qy7leuI+RTQfYHX1W8Uv+CFpyiMsdLnpaSCpNJDIpCr6/qnQzpLx93mRncB+VBBD2PB/IMX8g==", "cpu": [ "arm64" ], - "dev": true, "optional": true, "os": [ "linux" ], - "engines": { - "node": ">=18" + "funding": { + "url": "https://liberapay.com/Koromix" } }, - "node_modules/@esbuild/linux-ia32": { - "version": "0.28.2", - "resolved": "https://registry.npmmirror.com/@esbuild/linux-ia32/-/linux-ia32-0.28.2.tgz", - "integrity": "sha512-CYbnj78HsIeA+DhgUKgFCfvNsTHFhMMrinUrMZpDXJXKN8T3XViTZ/+wtHeVxEWY8ewSzTFN+nRmSwO2tZaLUQ==", + "node_modules/@koromix/koffi-linux-ia32": { + "version": "3.3.8", + "resolved": "https://registry.npmmirror.com/@koromix/koffi-linux-ia32/-/koffi-linux-ia32-3.3.8.tgz", + "integrity": "sha512-/AqDOcvQzeSDnwDsdqfJP2LjBgCX6CJZwSuYJc+YZCFFtUvsIDq9sRfSvyDy6xTC3HTkJKaT1SrrlE6Ji1aZCA==", "cpu": [ "ia32" ], - "dev": true, "optional": true, "os": [ "linux" ], - "engines": { - "node": ">=18" + "funding": { + "url": "https://liberapay.com/Koromix" } }, - "node_modules/@esbuild/linux-loong64": { - "version": "0.28.2", - "resolved": "https://registry.npmmirror.com/@esbuild/linux-loong64/-/linux-loong64-0.28.2.tgz", - "integrity": "sha512-buwkd8nsph4R+ajRvw0qM5Hja/TXQow3ptzWO2EbG/cqcIkHloRrdlBtQlshyYGTNFvfkfJ5tpPLVkY4DtsPfQ==", + "node_modules/@koromix/koffi-linux-loong64": { + "version": "3.3.8", + "resolved": "https://registry.npmmirror.com/@koromix/koffi-linux-loong64/-/koffi-linux-loong64-3.3.8.tgz", + "integrity": "sha512-XgqxynMlKdcPZ5Hu0EyhFqfvEMcqm1RzLj8vbhRTtwV/GhrAMoToExzcF5uHXqiVL/EsWE1V/BmdrCfjlUsqtA==", "cpu": [ "loong64" ], - "dev": true, "optional": true, "os": [ "linux" ], - "engines": { - "node": ">=18" + "funding": { + "url": "https://liberapay.com/Koromix" } }, - "node_modules/@esbuild/linux-mips64el": { - "version": "0.28.2", - "resolved": "https://registry.npmmirror.com/@esbuild/linux-mips64el/-/linux-mips64el-0.28.2.tgz", - "integrity": "sha512-ZVykbDyk7519VwiNb9Lcj9m8XM6v5V9uKPvrEMkkEedVewf+0itkhahp4HDpgERXhwLRpWFypsGbG/J8s0QjJA==", + "node_modules/@koromix/koffi-linux-ppc64": { + "version": "3.3.8", + "resolved": "https://registry.npmmirror.com/@koromix/koffi-linux-ppc64/-/koffi-linux-ppc64-3.3.8.tgz", + "integrity": "sha512-nzoG1pIu00cdwbMmQ+U4Tr1Xaej1L/XP39wG0nQMviDf/7tlZeM8i/yD1ggNHeSYao/CHcaJr0eW5IjmkfO10Q==", "cpu": [ - "mips64el" + "ppc64" ], - "dev": true, - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=18" - } - }, - "node_modules/@esbuild/linux-ppc64": { - "version": "0.28.2", - "resolved": "https://registry.npmmirror.com/@esbuild/linux-ppc64/-/linux-ppc64-0.28.2.tgz", - "integrity": "sha512-CAXl+Dtd9UUuJd8pKKdwh6MLm3MUMiqMPmhZ3tTSXPqfyQ3vDl6R5hZdZ/kYojK4ofXtdfSv1tFq8XzWx3heNQ==", - "cpu": [ - "ppc64" - ], - "dev": true, "optional": true, "os": [ "linux" ], - "engines": { - "node": ">=18" + "funding": { + "url": "https://liberapay.com/Koromix" } }, - "node_modules/@esbuild/linux-riscv64": { - "version": "0.28.2", - "resolved": "https://registry.npmmirror.com/@esbuild/linux-riscv64/-/linux-riscv64-0.28.2.tgz", - "integrity": "sha512-GeXCej4IQtU1B+QlDV8W/RRvbzI3O/Stss+/bCXv4lZls5WGRtu2a+3JkA3i4qIUlMXpcHebWpF8AkJhATowuA==", + "node_modules/@koromix/koffi-linux-riscv64": { + "version": "3.3.8", + "resolved": "https://registry.npmmirror.com/@koromix/koffi-linux-riscv64/-/koffi-linux-riscv64-3.3.8.tgz", + "integrity": "sha512-i6CtjaydMXmhvUPz5gCCodgCBCQOA27Cs0mCTcodHzaJCmICqlmGr0y7ManHIeqTxzrDNIJERa0BFNBpoPpe4A==", "cpu": [ "riscv64" ], - "dev": true, "optional": true, "os": [ "linux" ], - "engines": { - "node": ">=18" + "funding": { + "url": "https://liberapay.com/Koromix" } }, - "node_modules/@esbuild/linux-s390x": { - "version": "0.28.2", - "resolved": "https://registry.npmmirror.com/@esbuild/linux-s390x/-/linux-s390x-0.28.2.tgz", - "integrity": "sha512-3H1weTYZPxt/WOhByszQZybS9w5lKzUn1FDMsgEChbHWQwHYQQRfBxgCcZvPhjHfKyJjIievvMmEUawJrdY9Dg==", + "node_modules/@koromix/koffi-linux-x64": { + "version": "3.3.8", + "resolved": "https://registry.npmmirror.com/@koromix/koffi-linux-x64/-/koffi-linux-x64-3.3.8.tgz", + "integrity": "sha512-0KyTCxjxzjdwCxTA8HdEFCLeJLZPQdOqpJQVvf2KJA8izmnDlM/g2NZd6jNJ4lwvuU8+R6fN7zW0OrwSM6pHzA==", "cpu": [ - "s390x" + "x64" ], - "dev": true, "optional": true, "os": [ "linux" ], - "engines": { - "node": ">=18" + "funding": { + "url": "https://liberapay.com/Koromix" } }, - "node_modules/@esbuild/linux-x64": { - "version": "0.28.2", - "resolved": "https://registry.npmmirror.com/@esbuild/linux-x64/-/linux-x64-0.28.2.tgz", - "integrity": "sha512-4xTZr1FUmSoQW4XIWmit3tzQrUTZM+N3P0XV8xROKYF50XfI7xeO90+1bZvNwxIufQ9hDQVRJH5YhgPVF8A/HQ==", + "node_modules/@koromix/koffi-openbsd-arm64": { + "version": "3.3.8", + "resolved": "https://registry.npmmirror.com/@koromix/koffi-openbsd-arm64/-/koffi-openbsd-arm64-3.3.8.tgz", + "integrity": "sha512-HY1pfpsHrHL248y3TRg0FAa8MlSLuVMABkkieiKINqNvIWWvuMekZO/zQM+BtmgFQHXO+t/Hd0W55fzH/U2EYA==", "cpu": [ - "x64" + "arm64" ], - "dev": true, "optional": true, "os": [ - "linux" + "openbsd" ], - "engines": { - "node": ">=18" + "funding": { + "url": "https://liberapay.com/Koromix" } }, - "node_modules/@esbuild/netbsd-arm64": { - "version": "0.28.2", - "resolved": "https://registry.npmmirror.com/@esbuild/netbsd-arm64/-/netbsd-arm64-0.28.2.tgz", - "integrity": "sha512-sSATRjPeDBg3pdgHoQfoYBob11Kk1FGa9lui5RIHZCoCkJa9QKlvl3/vKz2usCmYYjs7ymJR/2Nnsqe+Hjt5nw==", + "node_modules/@koromix/koffi-openbsd-ia32": { + "version": "3.3.8", + "resolved": "https://registry.npmmirror.com/@koromix/koffi-openbsd-ia32/-/koffi-openbsd-ia32-3.3.8.tgz", + "integrity": "sha512-745gBEJnFhO9N7mnRVRkd2NQnQGbBUKkEUsJcm2Di5KBkkTyfjf2BQSvzegJE+ab6gLnQ57ZEA0UwBBdS0MlrA==", "cpu": [ - "arm64" + "ia32" ], - "dev": true, "optional": true, "os": [ - "netbsd" + "openbsd" ], - "engines": { - "node": ">=18" + "funding": { + "url": "https://liberapay.com/Koromix" } }, - "node_modules/@esbuild/netbsd-x64": { - "version": "0.28.2", - "resolved": "https://registry.npmmirror.com/@esbuild/netbsd-x64/-/netbsd-x64-0.28.2.tgz", - "integrity": "sha512-lqnzCV+mM0gIADaKihiCg6ifgfU2L3h5E33rNQBN1Y4MaVGnzryzmvvf7UHxprpQdE8hpqLolJ9Rl+SkIRDpyw==", + "node_modules/@koromix/koffi-openbsd-x64": { + "version": "3.3.8", + "resolved": "https://registry.npmmirror.com/@koromix/koffi-openbsd-x64/-/koffi-openbsd-x64-3.3.8.tgz", + "integrity": "sha512-bwcuk5PquAQGgR1DYAVrZwInSEeKuq0RXFylejAs5kQCJCBoyUOipkAJj4q4HYdOtCCxwqdrMm/+XwXrwtf3ZQ==", "cpu": [ "x64" ], - "dev": true, "optional": true, "os": [ - "netbsd" + "openbsd" ], - "engines": { - "node": ">=18" + "funding": { + "url": "https://liberapay.com/Koromix" } }, - "node_modules/@esbuild/openbsd-arm64": { - "version": "0.28.2", - "resolved": "https://registry.npmmirror.com/@esbuild/openbsd-arm64/-/openbsd-arm64-0.28.2.tgz", - "integrity": "sha512-AL2qJILH7lNjrDmCQDvdxMfAUIv8KMNZOvrwAQ8i8//ntL9FflhOyMJ8OZSMBb8/AWXe3/5v5S20y3zCoZWKoQ==", + "node_modules/@koromix/koffi-win32-arm64": { + "version": "3.3.8", + "resolved": "https://registry.npmmirror.com/@koromix/koffi-win32-arm64/-/koffi-win32-arm64-3.3.8.tgz", + "integrity": "sha512-f43sCr9lxFIvkOEE0Br+Qr5+KH2XqRm/EAQgAflYprIsjCz4eBTPVwEjbuymyN/6iDEKyO7EDz/7xQgNiyvIyA==", "cpu": [ "arm64" ], - "dev": true, "optional": true, "os": [ - "openbsd" + "win32" ], - "engines": { - "node": ">=18" + "funding": { + "url": "https://liberapay.com/Koromix" } }, - "node_modules/@esbuild/openbsd-x64": { - "version": "0.28.2", - "resolved": "https://registry.npmmirror.com/@esbuild/openbsd-x64/-/openbsd-x64-0.28.2.tgz", - "integrity": "sha512-QtiuPytchRyC4rwUKhexJdQKvDuZ6hWloi3igqPQNUJCS1/v9EiO3UTOXR6A3FoMo4fnAKbWJdqaIwhOzh8qEw==", + "node_modules/@koromix/koffi-win32-ia32": { + "version": "3.3.8", + "resolved": "https://registry.npmmirror.com/@koromix/koffi-win32-ia32/-/koffi-win32-ia32-3.3.8.tgz", + "integrity": "sha512-aBozU1HP1mWzanVAoo2fkJBLJsEVVs2b3/FbtqbotrgDFsBt8r71LNX+mKX7d4YASXMIAsUPG3iXBpNtk7+Y8Q==", "cpu": [ - "x64" + "ia32" ], - "dev": true, "optional": true, "os": [ - "openbsd" + "win32" ], - "engines": { - "node": ">=18" + "funding": { + "url": "https://liberapay.com/Koromix" } }, - "node_modules/@esbuild/openharmony-arm64": { - "version": "0.28.2", - "resolved": "https://registry.npmmirror.com/@esbuild/openharmony-arm64/-/openharmony-arm64-0.28.2.tgz", - "integrity": "sha512-WkhYDmpTjLvGlScA1rwjRUmhl4k8oXR3cIbtqWmELgU/dFeHHlEllxDvdWcNJV9rbzCexB5vz8gtNewWLgCT7Q==", + "node_modules/@koromix/koffi-win32-x64": { + "version": "3.3.8", + "resolved": "https://registry.npmmirror.com/@koromix/koffi-win32-x64/-/koffi-win32-x64-3.3.8.tgz", + "integrity": "sha512-Ef9XpIn/AfnZWMI1lvA6IOjCsTVRlako+BXosp4cRaLZZXkgjwiBVqYXXhqZix1G8e+27UAv97XBTmDEyfS7jA==", "cpu": [ - "arm64" + "x64" ], - "dev": true, "optional": true, "os": [ - "openharmony" + "win32" ], - "engines": { - "node": ">=18" + "funding": { + "url": "https://liberapay.com/Koromix" } }, - "node_modules/@esbuild/sunos-x64": { - "version": "0.28.2", - "resolved": "https://registry.npmmirror.com/@esbuild/sunos-x64/-/sunos-x64-0.28.2.tgz", - "integrity": "sha512-GPMSkTOtMnv2U2F8gxe4Io6qmVs+YKyp832Etqqxr0hFngmXQ3rzwytelm3GIn7T4VviRUlf3sOgBOiTdvaf7g==", - "cpu": [ - "x64" - ], + "node_modules/@malept/cross-spawn-promise": { + "version": "2.0.0", + "resolved": "https://registry.npmmirror.com/@malept/cross-spawn-promise/-/cross-spawn-promise-2.0.0.tgz", + "integrity": "sha512-1DpKU0Z5ThltBwjNySMC14g0CkbyhCaz9FkhxqNsZI6uAPJXFS8cMXlBKo26FJ8ZuW6S9GCMcR9IO5k2X5/9Fg==", "dev": true, - "optional": true, - "os": [ - "sunos" + "funding": [ + { + "type": "individual", + "url": "https://github.com/sponsors/malept" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/subscription/pkg/npm-.malept-cross-spawn-promise?utm_medium=referral&utm_source=npm_fund" + } ], + "dependencies": { + "cross-spawn": "^7.0.1" + }, "engines": { - "node": ">=18" + "node": ">= 12.13.0" } }, - "node_modules/@esbuild/win32-arm64": { - "version": "0.28.2", - "resolved": "https://registry.npmmirror.com/@esbuild/win32-arm64/-/win32-arm64-0.28.2.tgz", - "integrity": "sha512-PIhhEkE9uPBleRBrQEJpUn7MBnibZzbGzYWPmY3x+YoVg/95zbjB4CxPPOQ8l5tYYM4mMaCthF8/1DIfBQQyWQ==", - "cpu": [ - "arm64" - ], + "node_modules/@malept/flatpak-bundler": { + "version": "0.4.0", + "resolved": "https://registry.npmmirror.com/@malept/flatpak-bundler/-/flatpak-bundler-0.4.0.tgz", + "integrity": "sha512-9QOtNffcOF/c1seMCDnjckb3R9WHcG34tky+FHpNKKCW0wc/scYLwMtO+ptyGUfMW0/b/n4qRiALlaFHc9Oj7Q==", "dev": true, - "optional": true, - "os": [ - "win32" - ], + "dependencies": { + "debug": "^4.1.1", + "fs-extra": "^9.0.0", + "lodash": "^4.17.15", + "tmp-promise": "^3.0.2" + }, "engines": { - "node": ">=18" + "node": ">= 10.0.0" } }, - "node_modules/@esbuild/win32-ia32": { - "version": "0.28.2", - "resolved": "https://registry.npmmirror.com/@esbuild/win32-ia32/-/win32-ia32-0.28.2.tgz", - "integrity": "sha512-YmJbfTlvU7Sdn9BB+4PRES4oB6pxgS37MAONj+hBr/cpXS1aBPKXxNnDbu+QCWPj0o9dgyxeq79g6c5P8KeuYA==", - "cpu": [ - "ia32" - ], + "node_modules/@malept/flatpak-bundler/node_modules/fs-extra": { + "version": "9.1.0", + "resolved": "https://registry.npmmirror.com/fs-extra/-/fs-extra-9.1.0.tgz", + "integrity": "sha512-hcg3ZmepS30/7BSFqRvoo3DOMQu7IjqxO5nCDt+zM9XWjb33Wg7ziNT+Qvqbuc3+gWpzO02JubVyk2G4Zvo1OQ==", "dev": true, - "optional": true, - "os": [ - "win32" - ], + "dependencies": { + "at-least-node": "^1.0.0", + "graceful-fs": "^4.2.0", + "jsonfile": "^6.0.1", + "universalify": "^2.0.0" + }, "engines": { - "node": ">=18" + "node": ">=10" } }, - "node_modules/@esbuild/win32-x64": { - "version": "0.28.2", - "resolved": "https://registry.npmmirror.com/@esbuild/win32-x64/-/win32-x64-0.28.2.tgz", - "integrity": "sha512-5ebpxr3nWMzrL/rnUI755Jkuee0bHL/Gq0WTF9lvcpv73wAp5eu8MfBUgWK9bhWvZjj7yX8etf/8tI8Ney695g==", - "cpu": [ - "x64" - ], + "node_modules/@napi-rs/wasm-runtime": { + "version": "1.2.6", + "resolved": "https://registry.npmjs.org/@napi-rs/wasm-runtime/-/wasm-runtime-1.2.6.tgz", + "integrity": "sha512-mRyDmEw9/fCDXCGfL1sbgIw/GUK0PVxRW4YwgPN61F3LQ+fSyoBFarJVzgGyhF6kRzEQZ0FejDqm4WLXSeqQmw==", "dev": true, + "license": "MIT", "optional": true, - "os": [ - "win32" - ], + "dependencies": { + "@tybys/wasm-util": "^0.10.3" + }, "engines": { - "node": ">=18" + "node": "^20.19.0 || ^22.13.0 || >=23.5.0" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/Brooooooklyn" + }, + "peerDependencies": { + "@emnapi/core": "^1.7.1 || 2.0.0-beta.2", + "@emnapi/runtime": "^1.7.1 || 2.0.0-beta.2" } }, - "node_modules/@exodus/bytes": { - "version": "1.16.0", - "resolved": "https://registry.npmmirror.com/@exodus/bytes/-/bytes-1.16.0.tgz", - "integrity": "sha512-IcpW84uEn3N7ETtNZMlxKhfl6Pec8rUNGOTBtWbK1FKhJxIFAptZyVrvVRVBimAJxJCgc3PxepxkdWWG4DVzfA==", + "node_modules/@noble/hashes": { + "version": "2.4.0", + "resolved": "https://registry.npmmirror.com/@noble/hashes/-/hashes-2.4.0.tgz", + "integrity": "sha512-X5XaVWZIBCT7HHZGm5I7ZQXDwLG+bGXuSrMQAW+7Zvl87h1kmc1ZB1VSRJcpUfoUrGQp4Fkoxm5kZ+Ms+aW+eA==", "dev": true, "engines": { - "node": "^20.19.0 || ^22.12.0 || >=24.0.0" - }, - "peerDependencies": { - "@noble/hashes": "^1.8.0 || ^2.0.0" + "node": ">= 20.19.0" }, - "peerDependenciesMeta": { - "@noble/hashes": { - "optional": true - } + "funding": { + "url": "https://paulmillr.com/funding/" } }, - "node_modules/@floating-ui/core": { - "version": "1.8.0", - "resolved": "https://registry.npmmirror.com/@floating-ui/core/-/core-1.8.0.tgz", - "integrity": "sha512-0CIZ5itps/8x7BG8dEIhs53BvCUH2PCoogtakwRTut+Arm58sJooJ0AuZhLw2HJYIR5cMLNPBSS728sPho2khQ==", - "dev": true, - "dependencies": { - "@floating-ui/utils": "^0.2.12" + "node_modules/@opentelemetry/api": { + "version": "1.10.0", + "resolved": "https://registry.npmmirror.com/@opentelemetry/api/-/api-1.10.0.tgz", + "integrity": "sha512-lMkyes8iHrG+mk6WH7X70MdCLI2RS0FwNBY1PyQ8UemaijE2m5mv5A0Niy3HtbYTFrgkUEQjFMXmSAk2hQDuPQ==", + "license": "Apache-2.0", + "engines": { + "node": ">=8.0.0" } }, - "node_modules/@floating-ui/dom": { - "version": "1.8.0", - "resolved": "https://registry.npmmirror.com/@floating-ui/dom/-/dom-1.8.0.tgz", - "integrity": "sha512-yXSrzeHZBTZadLOlfyhCkJHNeLJnHRnRInwdZ40L7ZiaAtrBwoYlsDrX3v5zB1Utk7CLfzcOVnVVWoXEky7Ceg==", - "dev": true, + "node_modules/@opentelemetry/api-logs": { + "version": "0.223.0", + "resolved": "https://registry.npmmirror.com/@opentelemetry/api-logs/-/api-logs-0.223.0.tgz", + "integrity": "sha512-Oepm6etVPFCn0VWB1t833iOTgz1eYBDUPxcrOR/XvwzD1+Ag9VzSPSrrKAFNJ/haatj+8CXbG47pZXvdNQKDJw==", + "license": "Apache-2.0", "dependencies": { - "@floating-ui/core": "^1.8.0", - "@floating-ui/utils": "^0.2.12" + "@opentelemetry/api": "^1.3.0" + }, + "engines": { + "node": ">=8.0.0" } }, - "node_modules/@floating-ui/react-dom": { - "version": "2.1.9", - "resolved": "https://registry.npmmirror.com/@floating-ui/react-dom/-/react-dom-2.1.9.tgz", - "integrity": "sha512-JDjEFGCpImxDCA7JJKviA0M9+RtmJdj0m/NVU5IMgBK+AmZouAQQ7/+2GLH0GXXY0YMw9oXPB8hKdbPYg5QLYg==", - "dev": true, + "node_modules/@opentelemetry/core": { + "version": "3.1.1", + "resolved": "https://registry.npmmirror.com/@opentelemetry/core/-/core-3.1.1.tgz", + "integrity": "sha512-6wc9r0zrTsAVOd/5UrZBsrHhXWNfwisolgWxd8o3Eu1HKIz8cAxQjOdGrrJB406ceFiGV+ckTcLdXzB+y/QVTA==", + "license": "Apache-2.0", "dependencies": { - "@floating-ui/dom": "^1.8.0" + "@opentelemetry/semantic-conventions": "^1.29.0" + }, + "engines": { + "node": ">=22.15.0" }, "peerDependencies": { - "react": ">=16.8.0", - "react-dom": ">=16.8.0" + "@opentelemetry/api": ">=1.10.0 <1.11.0" } }, - "node_modules/@floating-ui/utils": { - "version": "0.2.12", - "resolved": "https://registry.npmmirror.com/@floating-ui/utils/-/utils-0.2.12.tgz", - "integrity": "sha512-HpCo8tmWzLVad5s2d19EhAz5zqrrQ6s69qd6moPMQvkOuSwDT1YgRfWSVuc4ennqrgv3OHppiOGMQ7oC13yIww==", - "dev": true - }, - "node_modules/@isaacs/fs-minipass": { - "version": "4.0.1", - "resolved": "https://registry.npmmirror.com/@isaacs/fs-minipass/-/fs-minipass-4.0.1.tgz", - "integrity": "sha512-wgm9Ehl2jpeqP3zw/7mo3kRHFp5MEDhqAdwy1fTGkHAwnkGOVsgpvQhL8B5n1qlb01jV3n/bI0ZfZp5lWA1k4w==", - "dev": true, + "node_modules/@opentelemetry/exporter-logs-otlp-http": { + "version": "0.301.2", + "resolved": "https://registry.npmmirror.com/@opentelemetry/exporter-logs-otlp-http/-/exporter-logs-otlp-http-0.301.2.tgz", + "integrity": "sha512-l3K1Fp2qaxAS8wKPyjVm7/QfnvJXZZfPuGXa+AYzNeoOk6qxcZwWZhLe9SYemWxDrtPTl3Mj82diLgVzbz54Hw==", + "license": "Apache-2.0", "dependencies": { - "minipass": "^7.0.4" + "@opentelemetry/otlp-exporter-base": "0.301.2", + "@opentelemetry/otlp-transformer": "0.301.2", + "@opentelemetry/sdk-logs": "3.1.1" }, "engines": { - "node": ">=18.0.0" + "node": ">=22.15.0" + }, + "peerDependencies": { + "@opentelemetry/api": "^1.10.0" } }, - "node_modules/@isaacs/nonrecursive-glob-match": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/@isaacs/nonrecursive-glob-match/-/nonrecursive-glob-match-1.0.3.tgz", - "integrity": "sha512-SI7kyKHq4XXDRozw+r9GlRZkia1ZkFrpLW98r2IC2Bpr8YkFGE3fvjzmxCG0x78A++69HmDNrDvSMYBZmHGpKA==", - "dev": true, - "license": "BlueOak-1.0.0" + "node_modules/@opentelemetry/otlp-exporter-base": { + "version": "0.301.2", + "resolved": "https://registry.npmmirror.com/@opentelemetry/otlp-exporter-base/-/otlp-exporter-base-0.301.2.tgz", + "integrity": "sha512-XlC8Mqeqk5vY9/jXU2No4tAPDO4g7d3QqgxznctJrM1wzF/xKUiBvQwlQguGL98nEBweq2NCkXMGj4QIGSpplg==", + "license": "Apache-2.0", + "dependencies": { + "@opentelemetry/core": "3.1.1", + "@opentelemetry/otlp-transformer": "0.301.2" + }, + "engines": { + "node": ">=22.15.0" + }, + "peerDependencies": { + "@opentelemetry/api": "^1.10.0" + } }, - "node_modules/@jridgewell/gen-mapping": { - "version": "0.3.13", - "resolved": "https://registry.npmmirror.com/@jridgewell/gen-mapping/-/gen-mapping-0.3.13.tgz", - "integrity": "sha512-2kkt/7niJ6MgEPxF0bYdQ6etZaA+fQvDcLKckhy1yIQOzaoKjBBjSj63/aLVjYE3qhRt5dvM+uUyfCg6UKCBbA==", - "dev": true, + "node_modules/@opentelemetry/otlp-transformer": { + "version": "0.301.2", + "resolved": "https://registry.npmmirror.com/@opentelemetry/otlp-transformer/-/otlp-transformer-0.301.2.tgz", + "integrity": "sha512-Ap4MhVvrta1YAXoLKLdX9KuEy8zfupMRaDmbOFm0afxPqe56dAo2cCe52TDN6t175E6i4hnrBMzDXpnDR843eg==", + "license": "Apache-2.0", "dependencies": { - "@jridgewell/sourcemap-codec": "^1.5.0", - "@jridgewell/trace-mapping": "^0.3.24" + "@opentelemetry/core": "3.1.1", + "@opentelemetry/resources": "3.1.1", + "@opentelemetry/sdk-logs": "3.1.1", + "@opentelemetry/sdk-metrics": "3.1.1", + "@opentelemetry/sdk-trace": "3.1.1" + }, + "engines": { + "node": ">=22.15.0" + }, + "peerDependencies": { + "@opentelemetry/api": ">=1.10.0 <1.11.0" } }, - "node_modules/@jridgewell/remapping": { - "version": "2.3.5", - "resolved": "https://registry.npmmirror.com/@jridgewell/remapping/-/remapping-2.3.5.tgz", - "integrity": "sha512-LI9u/+laYG4Ds1TDKSJW2YPrIlcVYOwi2fUC6xB43lueCjgxV4lffOCZCtYFiH6TNOX+tQKXx97T4IKHbhyHEQ==", - "dev": true, + "node_modules/@opentelemetry/resources": { + "version": "3.1.1", + "resolved": "https://registry.npmmirror.com/@opentelemetry/resources/-/resources-3.1.1.tgz", + "integrity": "sha512-dSd0FI1rfl+WHeaZxCTCEvwv6vcmUqkOHHTGWMkmyHg+PyL/wLbCqgsGKgI0wOwT0KGy9IMPAvY85hT8IPwApA==", + "license": "Apache-2.0", "dependencies": { - "@jridgewell/gen-mapping": "^0.3.5", - "@jridgewell/trace-mapping": "^0.3.24" + "@opentelemetry/core": "3.1.1", + "@opentelemetry/semantic-conventions": "^1.29.0" + }, + "engines": { + "node": ">=22.15.0" + }, + "peerDependencies": { + "@opentelemetry/api": ">=1.10.0 <1.11.0" } }, - "node_modules/@jridgewell/resolve-uri": { - "version": "3.1.2", - "resolved": "https://registry.npmmirror.com/@jridgewell/resolve-uri/-/resolve-uri-3.1.2.tgz", - "integrity": "sha512-bRISgCIjP20/tbWSPWMEi54QVPRZExkuD9lJL+UIxUKtwVJA8wW1Trb1jMs1RFXo1CBTNZ/5hpC9QvmKWdopKw==", - "dev": true, + "node_modules/@opentelemetry/sdk-logs": { + "version": "3.1.1", + "resolved": "https://registry.npmmirror.com/@opentelemetry/sdk-logs/-/sdk-logs-3.1.1.tgz", + "integrity": "sha512-Z2V826tjNXRaCP7EtaJGzNuk16o8rq8OWnYBS60tfCkGyUv3Eugrz3GIj7AiXb5MAyeeOR2PJ9EC8WjeGeAgbg==", + "license": "Apache-2.0", + "dependencies": { + "@opentelemetry/core": "3.1.1", + "@opentelemetry/resources": "3.1.1", + "@opentelemetry/semantic-conventions": "^1.29.0" + }, "engines": { - "node": ">=6.0.0" + "node": ">=22.15.0" + }, + "peerDependencies": { + "@opentelemetry/api": ">=1.10.0 <1.11.0" } }, - "node_modules/@jridgewell/sourcemap-codec": { - "version": "1.6.0", - "resolved": "https://registry.npmmirror.com/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.6.0.tgz", - "integrity": "sha512-T7jf+5zgsZHwNJ4lvQ7/aezbyk0nNX+zJVWpmHA7VYsEx7a7qr5Rg5IbtJFqkgze5Y2sruq1RUY8Q837Od7iFw==", - "dev": true + "node_modules/@opentelemetry/sdk-metrics": { + "version": "3.1.1", + "resolved": "https://registry.npmmirror.com/@opentelemetry/sdk-metrics/-/sdk-metrics-3.1.1.tgz", + "integrity": "sha512-QBDkERTMERMxwtH7hHbE6esoo+5Tdb79MtF9lMh1EIFlij39prkSEWlfSD2flUGGv15b0GQ1X2jj/JqG9gQBTw==", + "license": "Apache-2.0", + "dependencies": { + "@opentelemetry/core": "3.1.1", + "@opentelemetry/resources": "3.1.1" + }, + "engines": { + "node": ">=22.15.0" + }, + "peerDependencies": { + "@opentelemetry/api": ">=1.10.0 <1.11.0" + } }, - "node_modules/@jridgewell/trace-mapping": { - "version": "0.3.31", - "resolved": "https://registry.npmmirror.com/@jridgewell/trace-mapping/-/trace-mapping-0.3.31.tgz", - "integrity": "sha512-zzNR+SdQSDJzc8joaeP8QQoCQr8NuYx2dIIytl1QeBEZHJ9uW6hebsrYgbz8hJwUQao3TWCMtmfV8Nu1twOLAw==", - "dev": true, + "node_modules/@opentelemetry/sdk-trace": { + "version": "3.1.1", + "resolved": "https://registry.npmmirror.com/@opentelemetry/sdk-trace/-/sdk-trace-3.1.1.tgz", + "integrity": "sha512-DJZXZJu1H3kek9Kh9SqJ46yN3faiNiabnqkEtl9eVnBvs4KuK+ynmk9jOyB0NfWAXWGZlTivCf46uwiXyr2PGA==", + "license": "Apache-2.0", "dependencies": { - "@jridgewell/resolve-uri": "^3.1.0", - "@jridgewell/sourcemap-codec": "^1.4.14" + "@opentelemetry/core": "3.1.1", + "@opentelemetry/resources": "3.1.1", + "@opentelemetry/semantic-conventions": "^1.29.0" + }, + "engines": { + "node": ">=22.15.0" + }, + "peerDependencies": { + "@opentelemetry/api": ">=1.10.0 <1.11.0" } }, - "node_modules/@koromix/koffi-android-arm64": { - "version": "3.3.8", - "resolved": "https://registry.npmmirror.com/@koromix/koffi-android-arm64/-/koffi-android-arm64-3.3.8.tgz", - "integrity": "sha512-Y0lt2JexRGXlg1PxFuegfi5p6bIcLMj7Mig0WapZRKEM3Yv2L9J3Ej4XHPYMsB0TRNttBRHiliaJOH6EedEIXg==", + "node_modules/@opentelemetry/semantic-conventions": { + "version": "1.45.0", + "resolved": "https://registry.npmmirror.com/@opentelemetry/semantic-conventions/-/semantic-conventions-1.45.0.tgz", + "integrity": "sha512-aOP45mbcOKbQVvFWfQmgoOPT8R2iwbbbgl83k4CujGV9BrJhFr3qG55MFpwFs4YLabpuW3HhzUY9eQxPlDqaZw==", + "license": "Apache-2.0", + "engines": { + "node": ">=14" + } + }, + "node_modules/@oxc-parser/binding-android-arm-eabi": { + "version": "0.143.0", + "resolved": "https://registry.npmmirror.com/@oxc-parser/binding-android-arm-eabi/-/binding-android-arm-eabi-0.143.0.tgz", + "integrity": "sha512-n9uozULWflPqBtdmI8lAabLqGKNgLVNN0ZH8HfgCwpKGNtzRzauB76jTiW/3YLkcA7N1zskpi9GdVnZuu1SAvg==", "cpu": [ - "arm64" + "arm" ], + "dev": true, "optional": true, "os": [ "android" ], - "funding": { - "url": "https://liberapay.com/Koromix" + "engines": { + "node": "^20.19.0 || >=22.12.0" } }, - "node_modules/@koromix/koffi-android-x64": { - "version": "3.3.8", - "resolved": "https://registry.npmmirror.com/@koromix/koffi-android-x64/-/koffi-android-x64-3.3.8.tgz", - "integrity": "sha512-ZOwUZJoQ7Xd0rRF85Qc5XyIBjZPKGNLNgoTFakWdxn55AoZ6zdGEYvOXQMIN8JLjQ6qYUiQMtlFlusddZr+pjA==", + "node_modules/@oxc-parser/binding-android-arm64": { + "version": "0.143.0", + "resolved": "https://registry.npmmirror.com/@oxc-parser/binding-android-arm64/-/binding-android-arm64-0.143.0.tgz", + "integrity": "sha512-9BbdjHETk6O3zH/DDid9IgBtF0GlpLabNKN231uraXpRDSfY+iiZxTP5bk1Z63GBownVdhdINFIeddmMz4MzpQ==", "cpu": [ - "x64" + "arm64" ], + "dev": true, "optional": true, "os": [ "android" ], - "funding": { - "url": "https://liberapay.com/Koromix" + "engines": { + "node": "^20.19.0 || >=22.12.0" } }, - "node_modules/@koromix/koffi-darwin-arm64": { - "version": "3.3.8", - "resolved": "https://registry.npmmirror.com/@koromix/koffi-darwin-arm64/-/koffi-darwin-arm64-3.3.8.tgz", - "integrity": "sha512-7tzlnYSePCQW66iEIi+wgN9HgTiF431KL9wIDhH9b+32KOYZXBdA+JyDgRVi2E5AIyJ1hdkQFNg7YCAOft2mKw==", + "node_modules/@oxc-parser/binding-darwin-arm64": { + "version": "0.143.0", + "resolved": "https://registry.npmmirror.com/@oxc-parser/binding-darwin-arm64/-/binding-darwin-arm64-0.143.0.tgz", + "integrity": "sha512-gh+6ecoHUy4/sUcolBl/1qPXKBbYNxFY0Pk0ujgQvINTMSftJY7o4yb8gOkDJPeZeB8+a+u7xTe6umoP8N5HFA==", "cpu": [ "arm64" ], + "dev": true, "optional": true, "os": [ "darwin" ], - "funding": { - "url": "https://liberapay.com/Koromix" + "engines": { + "node": "^20.19.0 || >=22.12.0" } }, - "node_modules/@koromix/koffi-darwin-x64": { - "version": "3.3.8", - "resolved": "https://registry.npmmirror.com/@koromix/koffi-darwin-x64/-/koffi-darwin-x64-3.3.8.tgz", - "integrity": "sha512-Pw1EsCT9Yov4Szo4joLhABbQfqNgYhwfkhWZiIbEZ2b3sGyv9Yj2N0p00jOpdTfQ+u9QFFi8XhNivJbBTqMTPA==", + "node_modules/@oxc-parser/binding-darwin-x64": { + "version": "0.143.0", + "resolved": "https://registry.npmmirror.com/@oxc-parser/binding-darwin-x64/-/binding-darwin-x64-0.143.0.tgz", + "integrity": "sha512-qd1hl2d+lXgHv/VQ/M9qm8TrMC5T4RqDBwtOnl+1D0QMjwcz+8AaB4JSg8STgeag0GP6a6L74XEGAsrTSJWNzQ==", "cpu": [ "x64" ], + "dev": true, "optional": true, "os": [ "darwin" ], - "funding": { - "url": "https://liberapay.com/Koromix" + "engines": { + "node": "^20.19.0 || >=22.12.0" } }, - "node_modules/@koromix/koffi-freebsd-arm64": { - "version": "3.3.8", - "resolved": "https://registry.npmmirror.com/@koromix/koffi-freebsd-arm64/-/koffi-freebsd-arm64-3.3.8.tgz", - "integrity": "sha512-bpkvHfxUn5EqaHQO9k42lqO8+5t9aF8McgJyOsXx+vd/xicA0Zc0vP2kz0MjQu760ZdsR3WI4VFiNh2xHRP6Lw==", + "node_modules/@oxc-parser/binding-freebsd-x64": { + "version": "0.143.0", + "resolved": "https://registry.npmmirror.com/@oxc-parser/binding-freebsd-x64/-/binding-freebsd-x64-0.143.0.tgz", + "integrity": "sha512-M5XXcNa7aOqLPKTR41msfghKu2yQ4xWvCm11/gwU0JzOzHNk5sgW//rVEjJ+LO48+VDAMzXTSzurUVxIDKwozw==", "cpu": [ - "arm64" + "x64" ], + "dev": true, "optional": true, "os": [ "freebsd" ], - "funding": { - "url": "https://liberapay.com/Koromix" + "engines": { + "node": "^20.19.0 || >=22.12.0" } }, - "node_modules/@koromix/koffi-freebsd-ia32": { - "version": "3.3.8", - "resolved": "https://registry.npmmirror.com/@koromix/koffi-freebsd-ia32/-/koffi-freebsd-ia32-3.3.8.tgz", - "integrity": "sha512-h2WI3Ofb+TioTqWDTMXPgtZ2LAghY2CPwZwMM3mZeGAzKygo9RxZ4PRGq8bvrdvinR4VN9ZK+H48m9GV3/u3mQ==", + "node_modules/@oxc-parser/binding-linux-arm-gnueabihf": { + "version": "0.143.0", + "resolved": "https://registry.npmmirror.com/@oxc-parser/binding-linux-arm-gnueabihf/-/binding-linux-arm-gnueabihf-0.143.0.tgz", + "integrity": "sha512-T/GXusuOkPNQhCQCSBbcU/N8j0rAypuDBl1IyFK+lyYT594XsVz80clPC/OtbSSpBGyJxj8uYEfctxVuxVYoww==", "cpu": [ - "ia32" + "arm" ], + "dev": true, "optional": true, "os": [ - "freebsd" + "linux" ], - "funding": { - "url": "https://liberapay.com/Koromix" + "engines": { + "node": "^20.19.0 || >=22.12.0" } }, - "node_modules/@koromix/koffi-freebsd-x64": { - "version": "3.3.8", - "resolved": "https://registry.npmmirror.com/@koromix/koffi-freebsd-x64/-/koffi-freebsd-x64-3.3.8.tgz", - "integrity": "sha512-Z1VAr2CfWaHYfqJ1UlbZBH2IcPqZHilBSCgSqDmVhmyN/tSz5kSjaRfxcBGloJted3CCvsNFg8lOJiKkPiAUNQ==", - "cpu": [ - "x64" - ], - "optional": true, - "os": [ - "freebsd" - ], - "funding": { - "url": "https://liberapay.com/Koromix" - } - }, - "node_modules/@koromix/koffi-linux-arm": { - "version": "3.3.8", - "resolved": "https://registry.npmmirror.com/@koromix/koffi-linux-arm/-/koffi-linux-arm-3.3.8.tgz", - "integrity": "sha512-9c9IfIz5sFpzbuwV2HomSBWOakpbd9tJ3FChmE556KdPzw9iXrJoMT5JyzPnUe10Soag2NK6SMKrDafOsR6J2A==", + "node_modules/@oxc-parser/binding-linux-arm-musleabihf": { + "version": "0.143.0", + "resolved": "https://registry.npmmirror.com/@oxc-parser/binding-linux-arm-musleabihf/-/binding-linux-arm-musleabihf-0.143.0.tgz", + "integrity": "sha512-oKu4RcBlXSqo3OC62dp6YTnQaZIurNDpCX3BnAM3+bJxt7s8J2TJKMnC0UYer1qhlRaDCg6wkTaTw+2IlsZ12w==", "cpu": [ "arm" ], + "dev": true, "optional": true, "os": [ "linux" ], - "funding": { - "url": "https://liberapay.com/Koromix" + "engines": { + "node": "^20.19.0 || >=22.12.0" } }, - "node_modules/@koromix/koffi-linux-arm64": { - "version": "3.3.8", - "resolved": "https://registry.npmmirror.com/@koromix/koffi-linux-arm64/-/koffi-linux-arm64-3.3.8.tgz", - "integrity": "sha512-7yknlwsy7X76+Qy7leuI+RTQfYHX1W8Uv+CFpyiMsdLnpaSCpNJDIpCr6/qnQzpLx93mRncB+VBBD2PB/IMX8g==", + "node_modules/@oxc-parser/binding-linux-arm64-gnu": { + "version": "0.143.0", + "resolved": "https://registry.npmmirror.com/@oxc-parser/binding-linux-arm64-gnu/-/binding-linux-arm64-gnu-0.143.0.tgz", + "integrity": "sha512-WJBbD186AZmMGaSIhlktC+rPl8L3peCTXAh88Ih9uEvK0en2mPojGyCGYiL6mHtV1RPV3JyfJW5t6n5hh0lXhA==", "cpu": [ "arm64" ], + "dev": true, "optional": true, "os": [ "linux" ], - "funding": { - "url": "https://liberapay.com/Koromix" + "engines": { + "node": "^20.19.0 || >=22.12.0" } }, - "node_modules/@koromix/koffi-linux-ia32": { - "version": "3.3.8", - "resolved": "https://registry.npmmirror.com/@koromix/koffi-linux-ia32/-/koffi-linux-ia32-3.3.8.tgz", - "integrity": "sha512-/AqDOcvQzeSDnwDsdqfJP2LjBgCX6CJZwSuYJc+YZCFFtUvsIDq9sRfSvyDy6xTC3HTkJKaT1SrrlE6Ji1aZCA==", + "node_modules/@oxc-parser/binding-linux-arm64-musl": { + "version": "0.143.0", + "resolved": "https://registry.npmmirror.com/@oxc-parser/binding-linux-arm64-musl/-/binding-linux-arm64-musl-0.143.0.tgz", + "integrity": "sha512-t1AcYOwEzgceadT4v5e+vaCCb0AncCA3v5AyzfBAz/tMq11qzVccXKzNHtkWdjBsgvTKwRkaUF3QvT4kot8vcQ==", "cpu": [ - "ia32" + "arm64" ], + "dev": true, "optional": true, "os": [ "linux" ], - "funding": { - "url": "https://liberapay.com/Koromix" + "engines": { + "node": "^20.19.0 || >=22.12.0" } }, - "node_modules/@koromix/koffi-linux-loong64": { - "version": "3.3.8", - "resolved": "https://registry.npmmirror.com/@koromix/koffi-linux-loong64/-/koffi-linux-loong64-3.3.8.tgz", - "integrity": "sha512-XgqxynMlKdcPZ5Hu0EyhFqfvEMcqm1RzLj8vbhRTtwV/GhrAMoToExzcF5uHXqiVL/EsWE1V/BmdrCfjlUsqtA==", + "node_modules/@oxc-parser/binding-linux-ppc64-gnu": { + "version": "0.143.0", + "resolved": "https://registry.npmmirror.com/@oxc-parser/binding-linux-ppc64-gnu/-/binding-linux-ppc64-gnu-0.143.0.tgz", + "integrity": "sha512-RsnO/NoD8376LMJq8JS8TwI0ieNaFRTuNe2GVJntQg6gwZNMENZsEbknHdVwjpOmxdGLGodcwaGSbAeRr5Bgjw==", "cpu": [ - "loong64" + "ppc64" ], + "dev": true, "optional": true, "os": [ "linux" ], - "funding": { - "url": "https://liberapay.com/Koromix" + "engines": { + "node": "^20.19.0 || >=22.12.0" } }, - "node_modules/@koromix/koffi-linux-ppc64": { - "version": "3.3.8", - "resolved": "https://registry.npmmirror.com/@koromix/koffi-linux-ppc64/-/koffi-linux-ppc64-3.3.8.tgz", - "integrity": "sha512-nzoG1pIu00cdwbMmQ+U4Tr1Xaej1L/XP39wG0nQMviDf/7tlZeM8i/yD1ggNHeSYao/CHcaJr0eW5IjmkfO10Q==", + "node_modules/@oxc-parser/binding-linux-riscv64-gnu": { + "version": "0.143.0", + "resolved": "https://registry.npmmirror.com/@oxc-parser/binding-linux-riscv64-gnu/-/binding-linux-riscv64-gnu-0.143.0.tgz", + "integrity": "sha512-48fSVfR9TZi5CASZFyv0VC6z6BCoeihFsX031mAD/oSH7d9PYsPgIqza7d9mjP7Z2KTEpTFyH6SIu0Ui6R1vdg==", "cpu": [ - "ppc64" + "riscv64" ], + "dev": true, "optional": true, "os": [ "linux" ], - "funding": { - "url": "https://liberapay.com/Koromix" + "engines": { + "node": "^20.19.0 || >=22.12.0" } }, - "node_modules/@koromix/koffi-linux-riscv64": { - "version": "3.3.8", - "resolved": "https://registry.npmmirror.com/@koromix/koffi-linux-riscv64/-/koffi-linux-riscv64-3.3.8.tgz", - "integrity": "sha512-i6CtjaydMXmhvUPz5gCCodgCBCQOA27Cs0mCTcodHzaJCmICqlmGr0y7ManHIeqTxzrDNIJERa0BFNBpoPpe4A==", + "node_modules/@oxc-parser/binding-linux-riscv64-musl": { + "version": "0.143.0", + "resolved": "https://registry.npmmirror.com/@oxc-parser/binding-linux-riscv64-musl/-/binding-linux-riscv64-musl-0.143.0.tgz", + "integrity": "sha512-T8CpdD+SfE01DnIOD4HpVxu0ZJOfMJ/VhCvikKfaXAxkZ+9veyLM/D2hpi7Y2hFUyPmVQO3FNZHmYzV/WlVR4g==", "cpu": [ "riscv64" ], + "dev": true, "optional": true, "os": [ "linux" ], - "funding": { - "url": "https://liberapay.com/Koromix" + "engines": { + "node": "^20.19.0 || >=22.12.0" } }, - "node_modules/@koromix/koffi-linux-x64": { - "version": "3.3.8", - "resolved": "https://registry.npmmirror.com/@koromix/koffi-linux-x64/-/koffi-linux-x64-3.3.8.tgz", - "integrity": "sha512-0KyTCxjxzjdwCxTA8HdEFCLeJLZPQdOqpJQVvf2KJA8izmnDlM/g2NZd6jNJ4lwvuU8+R6fN7zW0OrwSM6pHzA==", + "node_modules/@oxc-parser/binding-linux-s390x-gnu": { + "version": "0.143.0", + "resolved": "https://registry.npmmirror.com/@oxc-parser/binding-linux-s390x-gnu/-/binding-linux-s390x-gnu-0.143.0.tgz", + "integrity": "sha512-QLdeMsCcacenPEFsfxnBUDF1y6opyz5+fmOz9bfD5Y7fiGCMupUCuB3KTPQhNwshIG1P9fPqar9MHxuBDd4bwQ==", "cpu": [ - "x64" + "s390x" ], + "dev": true, "optional": true, "os": [ "linux" ], - "funding": { - "url": "https://liberapay.com/Koromix" + "engines": { + "node": "^20.19.0 || >=22.12.0" } }, - "node_modules/@koromix/koffi-openbsd-arm64": { - "version": "3.3.8", - "resolved": "https://registry.npmmirror.com/@koromix/koffi-openbsd-arm64/-/koffi-openbsd-arm64-3.3.8.tgz", - "integrity": "sha512-HY1pfpsHrHL248y3TRg0FAa8MlSLuVMABkkieiKINqNvIWWvuMekZO/zQM+BtmgFQHXO+t/Hd0W55fzH/U2EYA==", + "node_modules/@oxc-parser/binding-linux-x64-gnu": { + "version": "0.143.0", + "resolved": "https://registry.npmmirror.com/@oxc-parser/binding-linux-x64-gnu/-/binding-linux-x64-gnu-0.143.0.tgz", + "integrity": "sha512-659ujfqLy6k7cuH3sbzhd8b+ztSq+i6E2E9pG78Q0BmHjAExfGIdgc8cGgMdwAozDXeZFHkJ+LXYJdWsaGdgyw==", "cpu": [ - "arm64" + "x64" ], + "dev": true, "optional": true, "os": [ - "openbsd" + "linux" ], - "funding": { - "url": "https://liberapay.com/Koromix" + "engines": { + "node": "^20.19.0 || >=22.12.0" } }, - "node_modules/@koromix/koffi-openbsd-ia32": { - "version": "3.3.8", - "resolved": "https://registry.npmmirror.com/@koromix/koffi-openbsd-ia32/-/koffi-openbsd-ia32-3.3.8.tgz", - "integrity": "sha512-745gBEJnFhO9N7mnRVRkd2NQnQGbBUKkEUsJcm2Di5KBkkTyfjf2BQSvzegJE+ab6gLnQ57ZEA0UwBBdS0MlrA==", + "node_modules/@oxc-parser/binding-linux-x64-musl": { + "version": "0.143.0", + "resolved": "https://registry.npmmirror.com/@oxc-parser/binding-linux-x64-musl/-/binding-linux-x64-musl-0.143.0.tgz", + "integrity": "sha512-/Mw/9j4TfZcnKphPrzOE6t4MMknXadcAAuVUlDRTF/ETWB5xOgQvOJV2Mh9We/bWxZdoxaGAdc+hy4GuYwQ2yQ==", "cpu": [ - "ia32" + "x64" ], + "dev": true, "optional": true, "os": [ - "openbsd" + "linux" ], - "funding": { - "url": "https://liberapay.com/Koromix" + "engines": { + "node": "^20.19.0 || >=22.12.0" } }, - "node_modules/@koromix/koffi-openbsd-x64": { - "version": "3.3.8", - "resolved": "https://registry.npmmirror.com/@koromix/koffi-openbsd-x64/-/koffi-openbsd-x64-3.3.8.tgz", - "integrity": "sha512-bwcuk5PquAQGgR1DYAVrZwInSEeKuq0RXFylejAs5kQCJCBoyUOipkAJj4q4HYdOtCCxwqdrMm/+XwXrwtf3ZQ==", + "node_modules/@oxc-parser/binding-openharmony-arm64": { + "version": "0.143.0", + "resolved": "https://registry.npmmirror.com/@oxc-parser/binding-openharmony-arm64/-/binding-openharmony-arm64-0.143.0.tgz", + "integrity": "sha512-8rIKWR2BFuifbIK/1XB9wTaSdtuJ25dlE7ZQYDnEwj/2xH2vHsxnvIjHT3ZjSVuLLwGGlSslIG/fbOJ8TV8rTw==", "cpu": [ - "x64" + "arm64" ], + "dev": true, "optional": true, "os": [ - "openbsd" + "openharmony" ], - "funding": { - "url": "https://liberapay.com/Koromix" + "engines": { + "node": "^20.19.0 || >=22.12.0" } }, - "node_modules/@koromix/koffi-win32-arm64": { - "version": "3.3.8", - "resolved": "https://registry.npmmirror.com/@koromix/koffi-win32-arm64/-/koffi-win32-arm64-3.3.8.tgz", - "integrity": "sha512-f43sCr9lxFIvkOEE0Br+Qr5+KH2XqRm/EAQgAflYprIsjCz4eBTPVwEjbuymyN/6iDEKyO7EDz/7xQgNiyvIyA==", + "node_modules/@oxc-parser/binding-win32-arm64-msvc": { + "version": "0.143.0", + "resolved": "https://registry.npmmirror.com/@oxc-parser/binding-win32-arm64-msvc/-/binding-win32-arm64-msvc-0.143.0.tgz", + "integrity": "sha512-5U9kQYMfRRI6Zq7KDxgbIP0RMnKrfn3gLepRMgJuRkPSUALTiRCk9d/uyhb4lGDjUdzwK7mBkKqhLgzBPCmLpQ==", "cpu": [ "arm64" ], + "dev": true, "optional": true, "os": [ "win32" ], - "funding": { - "url": "https://liberapay.com/Koromix" + "engines": { + "node": "^20.19.0 || >=22.12.0" } }, - "node_modules/@koromix/koffi-win32-ia32": { - "version": "3.3.8", - "resolved": "https://registry.npmmirror.com/@koromix/koffi-win32-ia32/-/koffi-win32-ia32-3.3.8.tgz", - "integrity": "sha512-aBozU1HP1mWzanVAoo2fkJBLJsEVVs2b3/FbtqbotrgDFsBt8r71LNX+mKX7d4YASXMIAsUPG3iXBpNtk7+Y8Q==", + "node_modules/@oxc-parser/binding-win32-ia32-msvc": { + "version": "0.143.0", + "resolved": "https://registry.npmmirror.com/@oxc-parser/binding-win32-ia32-msvc/-/binding-win32-ia32-msvc-0.143.0.tgz", + "integrity": "sha512-25P7AaHk4R88Yv2XH4gToDVmh0cOu+bEURQU10CRrmvgabfRArSGAP5osmwUKeSUHj0VS50upbpbRWWW/m7mHA==", "cpu": [ "ia32" ], + "dev": true, "optional": true, "os": [ "win32" ], - "funding": { - "url": "https://liberapay.com/Koromix" + "engines": { + "node": "^20.19.0 || >=22.12.0" } }, - "node_modules/@koromix/koffi-win32-x64": { - "version": "3.3.8", - "resolved": "https://registry.npmmirror.com/@koromix/koffi-win32-x64/-/koffi-win32-x64-3.3.8.tgz", - "integrity": "sha512-Ef9XpIn/AfnZWMI1lvA6IOjCsTVRlako+BXosp4cRaLZZXkgjwiBVqYXXhqZix1G8e+27UAv97XBTmDEyfS7jA==", + "node_modules/@oxc-parser/binding-win32-x64-msvc": { + "version": "0.143.0", + "resolved": "https://registry.npmmirror.com/@oxc-parser/binding-win32-x64-msvc/-/binding-win32-x64-msvc-0.143.0.tgz", + "integrity": "sha512-ORMh3JE1s6V7ySicdRK7vgaDQnn5o+UHg9ct989PlWHbel8O9ARrmWXM6kZjrBMtNucxNayQ8g69G0VfWzhANw==", "cpu": [ "x64" ], + "dev": true, "optional": true, "os": [ "win32" ], - "funding": { - "url": "https://liberapay.com/Koromix" + "engines": { + "node": "^20.19.0 || >=22.12.0" } }, - "node_modules/@malept/cross-spawn-promise": { - "version": "2.0.0", - "resolved": "https://registry.npmmirror.com/@malept/cross-spawn-promise/-/cross-spawn-promise-2.0.0.tgz", - "integrity": "sha512-1DpKU0Z5ThltBwjNySMC14g0CkbyhCaz9FkhxqNsZI6uAPJXFS8cMXlBKo26FJ8ZuW6S9GCMcR9IO5k2X5/9Fg==", + "node_modules/@oxc-project/types": { + "version": "0.143.0", + "resolved": "https://registry.npmmirror.com/@oxc-project/types/-/types-0.143.0.tgz", + "integrity": "sha512-u6JZdLBTLotrNC9Vd6vPssINdzcCzleKAH6EJKImQb7GtYvX5keN2dxkoK44stCc4tffE6QQRtZTXVSzsLUlWA==", "dev": true, - "funding": [ - { - "type": "individual", - "url": "https://github.com/sponsors/malept" - }, - { - "type": "tidelift", - "url": "https://tidelift.com/subscription/pkg/npm-.malept-cross-spawn-promise?utm_medium=referral&utm_source=npm_fund" - } - ], - "dependencies": { - "cross-spawn": "^7.0.1" - }, - "engines": { - "node": ">= 12.13.0" + "funding": { + "url": "https://github.com/sponsors/Boshen" } }, - "node_modules/@malept/flatpak-bundler": { - "version": "0.4.0", - "resolved": "https://registry.npmmirror.com/@malept/flatpak-bundler/-/flatpak-bundler-0.4.0.tgz", - "integrity": "sha512-9QOtNffcOF/c1seMCDnjckb3R9WHcG34tky+FHpNKKCW0wc/scYLwMtO+ptyGUfMW0/b/n4qRiALlaFHc9Oj7Q==", + "node_modules/@peculiar/asn1-schema": { + "version": "2.10.0", + "resolved": "https://registry.npmmirror.com/@peculiar/asn1-schema/-/asn1-schema-2.10.0.tgz", + "integrity": "sha512-GhokD41lV4gQrrLYm3wCkHfBOnJrnhDMgt4XeMW8gzfE1UdJqIuSwsE+ggf82XBjUXRJylcm+KIGQFa4utIVLw==", "dev": true, "dependencies": { - "debug": "^4.1.1", - "fs-extra": "^9.0.0", - "lodash": "^4.17.15", - "tmp-promise": "^3.0.2" + "@peculiar/utils": "^2.0.2", + "asn1js": "^3.0.10", + "tslib": "^2.8.1" }, "engines": { - "node": ">= 10.0.0" + "node": ">=14" } }, - "node_modules/@malept/flatpak-bundler/node_modules/fs-extra": { - "version": "9.1.0", - "resolved": "https://registry.npmmirror.com/fs-extra/-/fs-extra-9.1.0.tgz", - "integrity": "sha512-hcg3ZmepS30/7BSFqRvoo3DOMQu7IjqxO5nCDt+zM9XWjb33Wg7ziNT+Qvqbuc3+gWpzO02JubVyk2G4Zvo1OQ==", + "node_modules/@peculiar/json-schema": { + "version": "1.1.12", + "resolved": "https://registry.npmmirror.com/@peculiar/json-schema/-/json-schema-1.1.12.tgz", + "integrity": "sha512-coUfuoMeIB7B8/NMekxaDzLhaYmp0HZNPEjYRm9goRou8UZIC3z21s0sL9AWoCw4EG876QyO3kYrc61WNF9B/w==", "dev": true, "dependencies": { - "at-least-node": "^1.0.0", - "graceful-fs": "^4.2.0", - "jsonfile": "^6.0.1", - "universalify": "^2.0.0" + "tslib": "^2.0.0" }, "engines": { - "node": ">=10" + "node": ">=8.0.0" } }, - "node_modules/@napi-rs/lzma-linux-x64-gnu": { - "version": "1.5.1", - "resolved": "https://registry.npmmirror.com/@napi-rs/lzma-linux-x64-gnu/-/lzma-linux-x64-gnu-1.5.1.tgz", - "integrity": "sha512-oTXEIha4SsuXdTA4Iyskj0kpdx2yVXdhd75c2v3xGrHFfVMsbhTPZU/nMPL4sWKo4pBHm3aucLaqGlF696dTyQ==", - "cpu": [ - "x64" - ], + "node_modules/@peculiar/utils": { + "version": "2.0.3", + "resolved": "https://registry.npmmirror.com/@peculiar/utils/-/utils-2.0.3.tgz", + "integrity": "sha512-+oL3HPFRIZ1St2K50lWCXiioIgSoxzz7R1J3uF6neO2yl1sgmpgY6XXJH4BdpoDkMWznQTeYF6oWNDZLCdQ4eQ==", "dev": true, - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": "^22.20 || ^24.12 || >=25" + "dependencies": { + "tslib": "^2.8.1" } }, - "node_modules/@noble/hashes": { - "version": "2.4.0", - "resolved": "https://registry.npmmirror.com/@noble/hashes/-/hashes-2.4.0.tgz", - "integrity": "sha512-X5XaVWZIBCT7HHZGm5I7ZQXDwLG+bGXuSrMQAW+7Zvl87h1kmc1ZB1VSRJcpUfoUrGQp4Fkoxm5kZ+Ms+aW+eA==", + "node_modules/@peculiar/webcrypto": { + "version": "1.7.1", + "resolved": "https://registry.npmmirror.com/@peculiar/webcrypto/-/webcrypto-1.7.1.tgz", + "integrity": "sha512-ODOov0sGMJMf3jPonOkgGqPknTsu+DdQ7kD++gz8aI+aFMOMHFbWAA2taqXXVTdP+OTOQR/znGvSpmkeI0WTYQ==", "dev": true, - "engines": { - "node": ">= 20.19.0" + "dependencies": { + "@peculiar/asn1-schema": "^2.7.0", + "@peculiar/json-schema": "^1.1.12", + "@peculiar/utils": "^2.0.2", + "tslib": "^2.8.1", + "webcrypto-core": "^1.9.2" }, - "funding": { - "url": "https://paulmillr.com/funding/" - } - }, - "node_modules/@opentelemetry/api": { - "version": "1.10.0", - "resolved": "https://registry.npmmirror.com/@opentelemetry/api/-/api-1.10.0.tgz", - "integrity": "sha512-lMkyes8iHrG+mk6WH7X70MdCLI2RS0FwNBY1PyQ8UemaijE2m5mv5A0Niy3HtbYTFrgkUEQjFMXmSAk2hQDuPQ==", - "license": "Apache-2.0", "engines": { - "node": ">=8.0.0" + "node": ">=14.18.0" } }, - "node_modules/@opentelemetry/api-logs": { - "version": "0.223.0", - "resolved": "https://registry.npmmirror.com/@opentelemetry/api-logs/-/api-logs-0.223.0.tgz", - "integrity": "sha512-Oepm6etVPFCn0VWB1t833iOTgz1eYBDUPxcrOR/XvwzD1+Ag9VzSPSrrKAFNJ/haatj+8CXbG47pZXvdNQKDJw==", - "license": "Apache-2.0", + "node_modules/@posthog/browser-common": { + "version": "0.12.0", + "resolved": "https://registry.npmmirror.com/@posthog/browser-common/-/browser-common-0.12.0.tgz", + "integrity": "sha512-P1CubrDp1xwYi2DQxjzJITEeMJpZ7qYcbHuhtXLHgkG8bE6gLy0JwkykjRtEFbElvJNbHQO1jQi7Cbb3JyazNw==", + "license": "MIT", "dependencies": { - "@opentelemetry/api": "^1.3.0" - }, - "engines": { - "node": ">=8.0.0" + "@posthog/core": "^1.68.0", + "@posthog/types": "^1.425.1", + "dompurify": "^3.4.13", + "preact": "^10.29.3" } }, - "node_modules/@opentelemetry/core": { - "version": "3.1.1", - "resolved": "https://registry.npmmirror.com/@opentelemetry/core/-/core-3.1.1.tgz", - "integrity": "sha512-6wc9r0zrTsAVOd/5UrZBsrHhXWNfwisolgWxd8o3Eu1HKIz8cAxQjOdGrrJB406ceFiGV+ckTcLdXzB+y/QVTA==", - "license": "Apache-2.0", + "node_modules/@posthog/core": { + "version": "1.69.1", + "resolved": "https://registry.npmmirror.com/@posthog/core/-/core-1.69.1.tgz", + "integrity": "sha512-36hlJRZlVh5d+yBOmqObT162SrqNes9yY4x4wLDXVSu5Dzdt19KNxQ136cd37+U0yABZVx7ehjtWslyn1iG+0Q==", + "license": "MIT", "dependencies": { - "@opentelemetry/semantic-conventions": "^1.29.0" - }, - "engines": { - "node": ">=22.15.0" - }, - "peerDependencies": { - "@opentelemetry/api": ">=1.10.0 <1.11.0" + "@posthog/types": "^1.425.1" } }, - "node_modules/@opentelemetry/exporter-logs-otlp-http": { - "version": "0.301.2", - "resolved": "https://registry.npmmirror.com/@opentelemetry/exporter-logs-otlp-http/-/exporter-logs-otlp-http-0.301.2.tgz", - "integrity": "sha512-l3K1Fp2qaxAS8wKPyjVm7/QfnvJXZZfPuGXa+AYzNeoOk6qxcZwWZhLe9SYemWxDrtPTl3Mj82diLgVzbz54Hw==", - "license": "Apache-2.0", + "node_modules/@posthog/types": { + "version": "1.425.1", + "resolved": "https://registry.npmmirror.com/@posthog/types/-/types-1.425.1.tgz", + "integrity": "sha512-mh7jyQ5lN+XCeOnMdYkBEFtO/G0TxeLOKTWNH6E6OZjxS4nVM0Tb2xQt+FG5DCFM9qzL2HmuX6A793TwlJVDvw==", + "license": "MIT" + }, + "node_modules/@radix-ui/number": { + "version": "1.1.3", + "resolved": "https://registry.npmmirror.com/@radix-ui/number/-/number-1.1.3.tgz", + "integrity": "sha512-Road2bidD0uu/1BGDOWNdPI06g0lIRy6IF9GZcIrDK2KGItfor8IQwQa+yM2ERgHM1MmHxaxpTzk0/Jp42lNfA==", + "dev": true + }, + "node_modules/@radix-ui/primitive": { + "version": "1.2.0", + "resolved": "https://registry.npmmirror.com/@radix-ui/primitive/-/primitive-1.2.0.tgz", + "integrity": "sha512-KABY+VMIRPJL+Vyzv/335FEhXXD/xDv8BMb1kl48/aXJZMH0LtHCTx5ga5RnxaEP3nZHtmTLf1P9vanmFX46bw==", + "dev": true + }, + "node_modules/@radix-ui/react-accessible-icon": { + "version": "1.2.0", + "resolved": "https://registry.npmmirror.com/@radix-ui/react-accessible-icon/-/react-accessible-icon-1.2.0.tgz", + "integrity": "sha512-BB4+HHkFl3HipEAhm/mLhrpXV+2kRX7MvY4AaImUcQVeWQt5KhV1JEByNs8NGfJOcr95RcQGijt9+OrCo68xGA==", + "dev": true, "dependencies": { - "@opentelemetry/otlp-exporter-base": "0.301.2", - "@opentelemetry/otlp-transformer": "0.301.2", - "@opentelemetry/sdk-logs": "3.1.1" - }, - "engines": { - "node": ">=22.15.0" + "@radix-ui/react-visually-hidden": "1.2.13" }, "peerDependencies": { - "@opentelemetry/api": "^1.10.0" + "@types/react": "*", + "@types/react-dom": "*", + "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc", + "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + }, + "@types/react-dom": { + "optional": true + } } }, - "node_modules/@opentelemetry/otlp-exporter-base": { - "version": "0.301.2", - "resolved": "https://registry.npmmirror.com/@opentelemetry/otlp-exporter-base/-/otlp-exporter-base-0.301.2.tgz", - "integrity": "sha512-XlC8Mqeqk5vY9/jXU2No4tAPDO4g7d3QqgxznctJrM1wzF/xKUiBvQwlQguGL98nEBweq2NCkXMGj4QIGSpplg==", - "license": "Apache-2.0", + "node_modules/@radix-ui/react-accordion": { + "version": "1.3.1", + "resolved": "https://registry.npmmirror.com/@radix-ui/react-accordion/-/react-accordion-1.3.1.tgz", + "integrity": "sha512-lCZ6sbGS/7WO0j84yx4srIgOf0MRJ/sZ13RonADXxvKBym8xrxNCq5f6DibGcr38sIlwPk8/52uYdXeOPsbEDw==", + "dev": true, "dependencies": { - "@opentelemetry/core": "3.1.1", - "@opentelemetry/otlp-transformer": "0.301.2" - }, - "engines": { - "node": ">=22.15.0" + "@radix-ui/primitive": "1.2.0", + "@radix-ui/react-collapsible": "1.2.1", + "@radix-ui/react-collection": "1.2.0", + "@radix-ui/react-compose-refs": "1.1.5", + "@radix-ui/react-context": "1.3.0", + "@radix-ui/react-direction": "1.2.0", + "@radix-ui/react-id": "1.1.4", + "@radix-ui/react-primitive": "2.2.0", + "@radix-ui/react-use-controllable-state": "1.3.0" }, "peerDependencies": { - "@opentelemetry/api": "^1.10.0" + "@types/react": "*", + "@types/react-dom": "*", + "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc", + "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + }, + "@types/react-dom": { + "optional": true + } } }, - "node_modules/@opentelemetry/otlp-transformer": { - "version": "0.301.2", - "resolved": "https://registry.npmmirror.com/@opentelemetry/otlp-transformer/-/otlp-transformer-0.301.2.tgz", - "integrity": "sha512-Ap4MhVvrta1YAXoLKLdX9KuEy8zfupMRaDmbOFm0afxPqe56dAo2cCe52TDN6t175E6i4hnrBMzDXpnDR843eg==", - "license": "Apache-2.0", + "node_modules/@radix-ui/react-alert-dialog": { + "version": "1.2.1", + "resolved": "https://registry.npmmirror.com/@radix-ui/react-alert-dialog/-/react-alert-dialog-1.2.1.tgz", + "integrity": "sha512-MWC4N7RY+qsbNrFNo7yQ9ZbdoZEW+B5DtpWxJfUnVCqcQxxqqg3qis3RMPTDbCNaTIdHJSn5XDkl9ZdVWXknLg==", + "dev": true, "dependencies": { - "@opentelemetry/core": "3.1.1", - "@opentelemetry/resources": "3.1.1", - "@opentelemetry/sdk-logs": "3.1.1", - "@opentelemetry/sdk-metrics": "3.1.1", - "@opentelemetry/sdk-trace": "3.1.1" - }, - "engines": { - "node": ">=22.15.0" + "@radix-ui/primitive": "1.2.0", + "@radix-ui/react-compose-refs": "1.1.5", + "@radix-ui/react-context": "1.3.0", + "@radix-ui/react-dialog": "1.3.1", + "@radix-ui/react-primitive": "2.2.0" }, "peerDependencies": { - "@opentelemetry/api": ">=1.10.0 <1.11.0" + "@types/react": "*", + "@types/react-dom": "*", + "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc", + "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + }, + "@types/react-dom": { + "optional": true + } } }, - "node_modules/@opentelemetry/resources": { - "version": "3.1.1", - "resolved": "https://registry.npmmirror.com/@opentelemetry/resources/-/resources-3.1.1.tgz", - "integrity": "sha512-dSd0FI1rfl+WHeaZxCTCEvwv6vcmUqkOHHTGWMkmyHg+PyL/wLbCqgsGKgI0wOwT0KGy9IMPAvY85hT8IPwApA==", - "license": "Apache-2.0", + "node_modules/@radix-ui/react-arrow": { + "version": "1.1.17", + "resolved": "https://registry.npmmirror.com/@radix-ui/react-arrow/-/react-arrow-1.1.17.tgz", + "integrity": "sha512-67jjcVvxjXCCStnTW3Z+M7jmaFMuMR7M2JgpDzH4w7JSRrikmzhjfYgP/09ECb8n7whnsgh1ifJ+Ie96qEj+pQ==", + "dev": true, "dependencies": { - "@opentelemetry/core": "3.1.1", - "@opentelemetry/semantic-conventions": "^1.29.0" - }, - "engines": { - "node": ">=22.15.0" + "@radix-ui/react-primitive": "2.2.0" }, "peerDependencies": { - "@opentelemetry/api": ">=1.10.0 <1.11.0" + "@types/react": "*", + "@types/react-dom": "*", + "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc", + "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + }, + "@types/react-dom": { + "optional": true + } } }, - "node_modules/@opentelemetry/sdk-logs": { - "version": "3.1.1", - "resolved": "https://registry.npmmirror.com/@opentelemetry/sdk-logs/-/sdk-logs-3.1.1.tgz", - "integrity": "sha512-Z2V826tjNXRaCP7EtaJGzNuk16o8rq8OWnYBS60tfCkGyUv3Eugrz3GIj7AiXb5MAyeeOR2PJ9EC8WjeGeAgbg==", - "license": "Apache-2.0", + "node_modules/@radix-ui/react-aspect-ratio": { + "version": "1.2.0", + "resolved": "https://registry.npmmirror.com/@radix-ui/react-aspect-ratio/-/react-aspect-ratio-1.2.0.tgz", + "integrity": "sha512-gHEU+Lx8DlT/FYIjZQvvBJrFSwUngXTjh7FeL9QvJaNALDLez6pgDj2axCUihBjtPBy82LN0gNb25+sTcSXNmA==", + "dev": true, "dependencies": { - "@opentelemetry/core": "3.1.1", - "@opentelemetry/resources": "3.1.1", - "@opentelemetry/semantic-conventions": "^1.29.0" - }, - "engines": { - "node": ">=22.15.0" + "@radix-ui/react-primitive": "2.2.0" }, "peerDependencies": { - "@opentelemetry/api": ">=1.10.0 <1.11.0" - } - }, - "node_modules/@opentelemetry/sdk-metrics": { - "version": "3.1.1", - "resolved": "https://registry.npmmirror.com/@opentelemetry/sdk-metrics/-/sdk-metrics-3.1.1.tgz", - "integrity": "sha512-QBDkERTMERMxwtH7hHbE6esoo+5Tdb79MtF9lMh1EIFlij39prkSEWlfSD2flUGGv15b0GQ1X2jj/JqG9gQBTw==", - "license": "Apache-2.0", - "dependencies": { - "@opentelemetry/core": "3.1.1", - "@opentelemetry/resources": "3.1.1" - }, - "engines": { - "node": ">=22.15.0" - }, - "peerDependencies": { - "@opentelemetry/api": ">=1.10.0 <1.11.0" - } - }, - "node_modules/@opentelemetry/sdk-trace": { - "version": "3.1.1", - "resolved": "https://registry.npmmirror.com/@opentelemetry/sdk-trace/-/sdk-trace-3.1.1.tgz", - "integrity": "sha512-DJZXZJu1H3kek9Kh9SqJ46yN3faiNiabnqkEtl9eVnBvs4KuK+ynmk9jOyB0NfWAXWGZlTivCf46uwiXyr2PGA==", - "license": "Apache-2.0", - "dependencies": { - "@opentelemetry/core": "3.1.1", - "@opentelemetry/resources": "3.1.1", - "@opentelemetry/semantic-conventions": "^1.29.0" - }, - "engines": { - "node": ">=22.15.0" - }, - "peerDependencies": { - "@opentelemetry/api": ">=1.10.0 <1.11.0" - } - }, - "node_modules/@opentelemetry/semantic-conventions": { - "version": "1.45.0", - "resolved": "https://registry.npmmirror.com/@opentelemetry/semantic-conventions/-/semantic-conventions-1.45.0.tgz", - "integrity": "sha512-aOP45mbcOKbQVvFWfQmgoOPT8R2iwbbbgl83k4CujGV9BrJhFr3qG55MFpwFs4YLabpuW3HhzUY9eQxPlDqaZw==", - "license": "Apache-2.0", - "engines": { - "node": ">=14" - } - }, - "node_modules/@oxc-parser/binding-android-arm-eabi": { - "version": "0.143.0", - "resolved": "https://registry.npmmirror.com/@oxc-parser/binding-android-arm-eabi/-/binding-android-arm-eabi-0.143.0.tgz", - "integrity": "sha512-n9uozULWflPqBtdmI8lAabLqGKNgLVNN0ZH8HfgCwpKGNtzRzauB76jTiW/3YLkcA7N1zskpi9GdVnZuu1SAvg==", - "cpu": [ - "arm" - ], - "dev": true, - "optional": true, - "os": [ - "android" - ], - "engines": { - "node": "^20.19.0 || >=22.12.0" - } - }, - "node_modules/@oxc-parser/binding-android-arm64": { - "version": "0.143.0", - "resolved": "https://registry.npmmirror.com/@oxc-parser/binding-android-arm64/-/binding-android-arm64-0.143.0.tgz", - "integrity": "sha512-9BbdjHETk6O3zH/DDid9IgBtF0GlpLabNKN231uraXpRDSfY+iiZxTP5bk1Z63GBownVdhdINFIeddmMz4MzpQ==", - "cpu": [ - "arm64" - ], - "dev": true, - "optional": true, - "os": [ - "android" - ], - "engines": { - "node": "^20.19.0 || >=22.12.0" - } - }, - "node_modules/@oxc-parser/binding-darwin-arm64": { - "version": "0.143.0", - "resolved": "https://registry.npmmirror.com/@oxc-parser/binding-darwin-arm64/-/binding-darwin-arm64-0.143.0.tgz", - "integrity": "sha512-gh+6ecoHUy4/sUcolBl/1qPXKBbYNxFY0Pk0ujgQvINTMSftJY7o4yb8gOkDJPeZeB8+a+u7xTe6umoP8N5HFA==", - "cpu": [ - "arm64" - ], - "dev": true, - "optional": true, - "os": [ - "darwin" - ], - "engines": { - "node": "^20.19.0 || >=22.12.0" - } - }, - "node_modules/@oxc-parser/binding-darwin-x64": { - "version": "0.143.0", - "resolved": "https://registry.npmmirror.com/@oxc-parser/binding-darwin-x64/-/binding-darwin-x64-0.143.0.tgz", - "integrity": "sha512-qd1hl2d+lXgHv/VQ/M9qm8TrMC5T4RqDBwtOnl+1D0QMjwcz+8AaB4JSg8STgeag0GP6a6L74XEGAsrTSJWNzQ==", - "cpu": [ - "x64" - ], - "dev": true, - "optional": true, - "os": [ - "darwin" - ], - "engines": { - "node": "^20.19.0 || >=22.12.0" - } - }, - "node_modules/@oxc-parser/binding-freebsd-x64": { - "version": "0.143.0", - "resolved": "https://registry.npmmirror.com/@oxc-parser/binding-freebsd-x64/-/binding-freebsd-x64-0.143.0.tgz", - "integrity": "sha512-M5XXcNa7aOqLPKTR41msfghKu2yQ4xWvCm11/gwU0JzOzHNk5sgW//rVEjJ+LO48+VDAMzXTSzurUVxIDKwozw==", - "cpu": [ - "x64" - ], - "dev": true, - "optional": true, - "os": [ - "freebsd" - ], - "engines": { - "node": "^20.19.0 || >=22.12.0" - } - }, - "node_modules/@oxc-parser/binding-linux-arm-gnueabihf": { - "version": "0.143.0", - "resolved": "https://registry.npmmirror.com/@oxc-parser/binding-linux-arm-gnueabihf/-/binding-linux-arm-gnueabihf-0.143.0.tgz", - "integrity": "sha512-T/GXusuOkPNQhCQCSBbcU/N8j0rAypuDBl1IyFK+lyYT594XsVz80clPC/OtbSSpBGyJxj8uYEfctxVuxVYoww==", - "cpu": [ - "arm" - ], - "dev": true, - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": "^20.19.0 || >=22.12.0" - } - }, - "node_modules/@oxc-parser/binding-linux-arm-musleabihf": { - "version": "0.143.0", - "resolved": "https://registry.npmmirror.com/@oxc-parser/binding-linux-arm-musleabihf/-/binding-linux-arm-musleabihf-0.143.0.tgz", - "integrity": "sha512-oKu4RcBlXSqo3OC62dp6YTnQaZIurNDpCX3BnAM3+bJxt7s8J2TJKMnC0UYer1qhlRaDCg6wkTaTw+2IlsZ12w==", - "cpu": [ - "arm" - ], - "dev": true, - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": "^20.19.0 || >=22.12.0" - } - }, - "node_modules/@oxc-parser/binding-linux-arm64-gnu": { - "version": "0.143.0", - "resolved": "https://registry.npmmirror.com/@oxc-parser/binding-linux-arm64-gnu/-/binding-linux-arm64-gnu-0.143.0.tgz", - "integrity": "sha512-WJBbD186AZmMGaSIhlktC+rPl8L3peCTXAh88Ih9uEvK0en2mPojGyCGYiL6mHtV1RPV3JyfJW5t6n5hh0lXhA==", - "cpu": [ - "arm64" - ], - "dev": true, - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": "^20.19.0 || >=22.12.0" - } - }, - "node_modules/@oxc-parser/binding-linux-arm64-musl": { - "version": "0.143.0", - "resolved": "https://registry.npmmirror.com/@oxc-parser/binding-linux-arm64-musl/-/binding-linux-arm64-musl-0.143.0.tgz", - "integrity": "sha512-t1AcYOwEzgceadT4v5e+vaCCb0AncCA3v5AyzfBAz/tMq11qzVccXKzNHtkWdjBsgvTKwRkaUF3QvT4kot8vcQ==", - "cpu": [ - "arm64" - ], - "dev": true, - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": "^20.19.0 || >=22.12.0" - } - }, - "node_modules/@oxc-parser/binding-linux-ppc64-gnu": { - "version": "0.143.0", - "resolved": "https://registry.npmmirror.com/@oxc-parser/binding-linux-ppc64-gnu/-/binding-linux-ppc64-gnu-0.143.0.tgz", - "integrity": "sha512-RsnO/NoD8376LMJq8JS8TwI0ieNaFRTuNe2GVJntQg6gwZNMENZsEbknHdVwjpOmxdGLGodcwaGSbAeRr5Bgjw==", - "cpu": [ - "ppc64" - ], - "dev": true, - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": "^20.19.0 || >=22.12.0" - } - }, - "node_modules/@oxc-parser/binding-linux-riscv64-gnu": { - "version": "0.143.0", - "resolved": "https://registry.npmmirror.com/@oxc-parser/binding-linux-riscv64-gnu/-/binding-linux-riscv64-gnu-0.143.0.tgz", - "integrity": "sha512-48fSVfR9TZi5CASZFyv0VC6z6BCoeihFsX031mAD/oSH7d9PYsPgIqza7d9mjP7Z2KTEpTFyH6SIu0Ui6R1vdg==", - "cpu": [ - "riscv64" - ], - "dev": true, - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": "^20.19.0 || >=22.12.0" - } - }, - "node_modules/@oxc-parser/binding-linux-riscv64-musl": { - "version": "0.143.0", - "resolved": "https://registry.npmmirror.com/@oxc-parser/binding-linux-riscv64-musl/-/binding-linux-riscv64-musl-0.143.0.tgz", - "integrity": "sha512-T8CpdD+SfE01DnIOD4HpVxu0ZJOfMJ/VhCvikKfaXAxkZ+9veyLM/D2hpi7Y2hFUyPmVQO3FNZHmYzV/WlVR4g==", - "cpu": [ - "riscv64" - ], - "dev": true, - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": "^20.19.0 || >=22.12.0" - } - }, - "node_modules/@oxc-parser/binding-linux-s390x-gnu": { - "version": "0.143.0", - "resolved": "https://registry.npmmirror.com/@oxc-parser/binding-linux-s390x-gnu/-/binding-linux-s390x-gnu-0.143.0.tgz", - "integrity": "sha512-QLdeMsCcacenPEFsfxnBUDF1y6opyz5+fmOz9bfD5Y7fiGCMupUCuB3KTPQhNwshIG1P9fPqar9MHxuBDd4bwQ==", - "cpu": [ - "s390x" - ], - "dev": true, - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": "^20.19.0 || >=22.12.0" - } - }, - "node_modules/@oxc-parser/binding-linux-x64-gnu": { - "version": "0.143.0", - "resolved": "https://registry.npmmirror.com/@oxc-parser/binding-linux-x64-gnu/-/binding-linux-x64-gnu-0.143.0.tgz", - "integrity": "sha512-659ujfqLy6k7cuH3sbzhd8b+ztSq+i6E2E9pG78Q0BmHjAExfGIdgc8cGgMdwAozDXeZFHkJ+LXYJdWsaGdgyw==", - "cpu": [ - "x64" - ], - "dev": true, - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": "^20.19.0 || >=22.12.0" - } - }, - "node_modules/@oxc-parser/binding-linux-x64-musl": { - "version": "0.143.0", - "resolved": "https://registry.npmmirror.com/@oxc-parser/binding-linux-x64-musl/-/binding-linux-x64-musl-0.143.0.tgz", - "integrity": "sha512-/Mw/9j4TfZcnKphPrzOE6t4MMknXadcAAuVUlDRTF/ETWB5xOgQvOJV2Mh9We/bWxZdoxaGAdc+hy4GuYwQ2yQ==", - "cpu": [ - "x64" - ], - "dev": true, - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": "^20.19.0 || >=22.12.0" - } - }, - "node_modules/@oxc-parser/binding-openharmony-arm64": { - "version": "0.143.0", - "resolved": "https://registry.npmmirror.com/@oxc-parser/binding-openharmony-arm64/-/binding-openharmony-arm64-0.143.0.tgz", - "integrity": "sha512-8rIKWR2BFuifbIK/1XB9wTaSdtuJ25dlE7ZQYDnEwj/2xH2vHsxnvIjHT3ZjSVuLLwGGlSslIG/fbOJ8TV8rTw==", - "cpu": [ - "arm64" - ], - "dev": true, - "optional": true, - "os": [ - "openharmony" - ], - "engines": { - "node": "^20.19.0 || >=22.12.0" - } - }, - "node_modules/@oxc-parser/binding-win32-arm64-msvc": { - "version": "0.143.0", - "resolved": "https://registry.npmmirror.com/@oxc-parser/binding-win32-arm64-msvc/-/binding-win32-arm64-msvc-0.143.0.tgz", - "integrity": "sha512-5U9kQYMfRRI6Zq7KDxgbIP0RMnKrfn3gLepRMgJuRkPSUALTiRCk9d/uyhb4lGDjUdzwK7mBkKqhLgzBPCmLpQ==", - "cpu": [ - "arm64" - ], - "dev": true, - "optional": true, - "os": [ - "win32" - ], - "engines": { - "node": "^20.19.0 || >=22.12.0" - } - }, - "node_modules/@oxc-parser/binding-win32-ia32-msvc": { - "version": "0.143.0", - "resolved": "https://registry.npmmirror.com/@oxc-parser/binding-win32-ia32-msvc/-/binding-win32-ia32-msvc-0.143.0.tgz", - "integrity": "sha512-25P7AaHk4R88Yv2XH4gToDVmh0cOu+bEURQU10CRrmvgabfRArSGAP5osmwUKeSUHj0VS50upbpbRWWW/m7mHA==", - "cpu": [ - "ia32" - ], - "dev": true, - "optional": true, - "os": [ - "win32" - ], - "engines": { - "node": "^20.19.0 || >=22.12.0" - } - }, - "node_modules/@oxc-parser/binding-win32-x64-msvc": { - "version": "0.143.0", - "resolved": "https://registry.npmmirror.com/@oxc-parser/binding-win32-x64-msvc/-/binding-win32-x64-msvc-0.143.0.tgz", - "integrity": "sha512-ORMh3JE1s6V7ySicdRK7vgaDQnn5o+UHg9ct989PlWHbel8O9ARrmWXM6kZjrBMtNucxNayQ8g69G0VfWzhANw==", - "cpu": [ - "x64" - ], - "dev": true, - "optional": true, - "os": [ - "win32" - ], - "engines": { - "node": "^20.19.0 || >=22.12.0" - } - }, - "node_modules/@oxc-project/types": { - "version": "0.143.0", - "resolved": "https://registry.npmmirror.com/@oxc-project/types/-/types-0.143.0.tgz", - "integrity": "sha512-u6JZdLBTLotrNC9Vd6vPssINdzcCzleKAH6EJKImQb7GtYvX5keN2dxkoK44stCc4tffE6QQRtZTXVSzsLUlWA==", - "dev": true, - "funding": { - "url": "https://github.com/sponsors/Boshen" - } - }, - "node_modules/@peculiar/asn1-schema": { - "version": "2.10.0", - "resolved": "https://registry.npmmirror.com/@peculiar/asn1-schema/-/asn1-schema-2.10.0.tgz", - "integrity": "sha512-GhokD41lV4gQrrLYm3wCkHfBOnJrnhDMgt4XeMW8gzfE1UdJqIuSwsE+ggf82XBjUXRJylcm+KIGQFa4utIVLw==", - "dev": true, - "dependencies": { - "@peculiar/utils": "^2.0.2", - "asn1js": "^3.0.10", - "tslib": "^2.8.1" - }, - "engines": { - "node": ">=14" - } - }, - "node_modules/@peculiar/json-schema": { - "version": "1.1.12", - "resolved": "https://registry.npmmirror.com/@peculiar/json-schema/-/json-schema-1.1.12.tgz", - "integrity": "sha512-coUfuoMeIB7B8/NMekxaDzLhaYmp0HZNPEjYRm9goRou8UZIC3z21s0sL9AWoCw4EG876QyO3kYrc61WNF9B/w==", - "dev": true, - "dependencies": { - "tslib": "^2.0.0" - }, - "engines": { - "node": ">=8.0.0" - } - }, - "node_modules/@peculiar/utils": { - "version": "2.0.3", - "resolved": "https://registry.npmmirror.com/@peculiar/utils/-/utils-2.0.3.tgz", - "integrity": "sha512-+oL3HPFRIZ1St2K50lWCXiioIgSoxzz7R1J3uF6neO2yl1sgmpgY6XXJH4BdpoDkMWznQTeYF6oWNDZLCdQ4eQ==", - "dev": true, - "dependencies": { - "tslib": "^2.8.1" - } - }, - "node_modules/@peculiar/webcrypto": { - "version": "1.7.1", - "resolved": "https://registry.npmmirror.com/@peculiar/webcrypto/-/webcrypto-1.7.1.tgz", - "integrity": "sha512-ODOov0sGMJMf3jPonOkgGqPknTsu+DdQ7kD++gz8aI+aFMOMHFbWAA2taqXXVTdP+OTOQR/znGvSpmkeI0WTYQ==", - "dev": true, - "dependencies": { - "@peculiar/asn1-schema": "^2.7.0", - "@peculiar/json-schema": "^1.1.12", - "@peculiar/utils": "^2.0.2", - "tslib": "^2.8.1", - "webcrypto-core": "^1.9.2" - }, - "engines": { - "node": ">=14.18.0" - } - }, - "node_modules/@posthog/browser-common": { - "version": "0.12.0", - "resolved": "https://registry.npmmirror.com/@posthog/browser-common/-/browser-common-0.12.0.tgz", - "integrity": "sha512-P1CubrDp1xwYi2DQxjzJITEeMJpZ7qYcbHuhtXLHgkG8bE6gLy0JwkykjRtEFbElvJNbHQO1jQi7Cbb3JyazNw==", - "license": "MIT", - "dependencies": { - "@posthog/core": "^1.68.0", - "@posthog/types": "^1.425.1", - "dompurify": "^3.4.13", - "preact": "^10.29.3" - } - }, - "node_modules/@posthog/core": { - "version": "1.69.1", - "resolved": "https://registry.npmmirror.com/@posthog/core/-/core-1.69.1.tgz", - "integrity": "sha512-36hlJRZlVh5d+yBOmqObT162SrqNes9yY4x4wLDXVSu5Dzdt19KNxQ136cd37+U0yABZVx7ehjtWslyn1iG+0Q==", - "license": "MIT", - "dependencies": { - "@posthog/types": "^1.425.1" - } - }, - "node_modules/@posthog/types": { - "version": "1.425.1", - "resolved": "https://registry.npmmirror.com/@posthog/types/-/types-1.425.1.tgz", - "integrity": "sha512-mh7jyQ5lN+XCeOnMdYkBEFtO/G0TxeLOKTWNH6E6OZjxS4nVM0Tb2xQt+FG5DCFM9qzL2HmuX6A793TwlJVDvw==", - "license": "MIT" - }, - "node_modules/@radix-ui/number": { - "version": "1.1.3", - "resolved": "https://registry.npmmirror.com/@radix-ui/number/-/number-1.1.3.tgz", - "integrity": "sha512-Road2bidD0uu/1BGDOWNdPI06g0lIRy6IF9GZcIrDK2KGItfor8IQwQa+yM2ERgHM1MmHxaxpTzk0/Jp42lNfA==", - "dev": true - }, - "node_modules/@radix-ui/primitive": { - "version": "1.2.0", - "resolved": "https://registry.npmmirror.com/@radix-ui/primitive/-/primitive-1.2.0.tgz", - "integrity": "sha512-KABY+VMIRPJL+Vyzv/335FEhXXD/xDv8BMb1kl48/aXJZMH0LtHCTx5ga5RnxaEP3nZHtmTLf1P9vanmFX46bw==", - "dev": true - }, - "node_modules/@radix-ui/react-accessible-icon": { - "version": "1.2.0", - "resolved": "https://registry.npmmirror.com/@radix-ui/react-accessible-icon/-/react-accessible-icon-1.2.0.tgz", - "integrity": "sha512-BB4+HHkFl3HipEAhm/mLhrpXV+2kRX7MvY4AaImUcQVeWQt5KhV1JEByNs8NGfJOcr95RcQGijt9+OrCo68xGA==", - "dev": true, - "dependencies": { - "@radix-ui/react-visually-hidden": "1.2.13" - }, - "peerDependencies": { - "@types/react": "*", - "@types/react-dom": "*", - "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc", - "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" - }, - "peerDependenciesMeta": { - "@types/react": { - "optional": true - }, - "@types/react-dom": { - "optional": true - } - } - }, - "node_modules/@radix-ui/react-accordion": { - "version": "1.3.1", - "resolved": "https://registry.npmmirror.com/@radix-ui/react-accordion/-/react-accordion-1.3.1.tgz", - "integrity": "sha512-lCZ6sbGS/7WO0j84yx4srIgOf0MRJ/sZ13RonADXxvKBym8xrxNCq5f6DibGcr38sIlwPk8/52uYdXeOPsbEDw==", - "dev": true, - "dependencies": { - "@radix-ui/primitive": "1.2.0", - "@radix-ui/react-collapsible": "1.2.1", - "@radix-ui/react-collection": "1.2.0", - "@radix-ui/react-compose-refs": "1.1.5", - "@radix-ui/react-context": "1.3.0", - "@radix-ui/react-direction": "1.2.0", - "@radix-ui/react-id": "1.1.4", - "@radix-ui/react-primitive": "2.2.0", - "@radix-ui/react-use-controllable-state": "1.3.0" - }, - "peerDependencies": { - "@types/react": "*", - "@types/react-dom": "*", - "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc", - "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" - }, - "peerDependenciesMeta": { - "@types/react": { - "optional": true - }, - "@types/react-dom": { - "optional": true - } - } - }, - "node_modules/@radix-ui/react-alert-dialog": { - "version": "1.2.1", - "resolved": "https://registry.npmmirror.com/@radix-ui/react-alert-dialog/-/react-alert-dialog-1.2.1.tgz", - "integrity": "sha512-MWC4N7RY+qsbNrFNo7yQ9ZbdoZEW+B5DtpWxJfUnVCqcQxxqqg3qis3RMPTDbCNaTIdHJSn5XDkl9ZdVWXknLg==", - "dev": true, - "dependencies": { - "@radix-ui/primitive": "1.2.0", - "@radix-ui/react-compose-refs": "1.1.5", - "@radix-ui/react-context": "1.3.0", - "@radix-ui/react-dialog": "1.3.1", - "@radix-ui/react-primitive": "2.2.0" - }, - "peerDependencies": { - "@types/react": "*", - "@types/react-dom": "*", - "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc", - "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" - }, - "peerDependenciesMeta": { - "@types/react": { - "optional": true - }, - "@types/react-dom": { - "optional": true - } - } - }, - "node_modules/@radix-ui/react-arrow": { - "version": "1.1.17", - "resolved": "https://registry.npmmirror.com/@radix-ui/react-arrow/-/react-arrow-1.1.17.tgz", - "integrity": "sha512-67jjcVvxjXCCStnTW3Z+M7jmaFMuMR7M2JgpDzH4w7JSRrikmzhjfYgP/09ECb8n7whnsgh1ifJ+Ie96qEj+pQ==", - "dev": true, - "dependencies": { - "@radix-ui/react-primitive": "2.2.0" - }, - "peerDependencies": { - "@types/react": "*", - "@types/react-dom": "*", - "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc", - "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" - }, - "peerDependenciesMeta": { - "@types/react": { - "optional": true - }, - "@types/react-dom": { - "optional": true - } - } - }, - "node_modules/@radix-ui/react-aspect-ratio": { - "version": "1.2.0", - "resolved": "https://registry.npmmirror.com/@radix-ui/react-aspect-ratio/-/react-aspect-ratio-1.2.0.tgz", - "integrity": "sha512-gHEU+Lx8DlT/FYIjZQvvBJrFSwUngXTjh7FeL9QvJaNALDLez6pgDj2axCUihBjtPBy82LN0gNb25+sTcSXNmA==", - "dev": true, - "dependencies": { - "@radix-ui/react-primitive": "2.2.0" - }, - "peerDependencies": { - "@types/react": "*", - "@types/react-dom": "*", - "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc", - "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" - }, - "peerDependenciesMeta": { - "@types/react": { - "optional": true - }, - "@types/react-dom": { - "optional": true - } + "@types/react": "*", + "@types/react-dom": "*", + "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc", + "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + }, + "@types/react-dom": { + "optional": true + } } }, "node_modules/@radix-ui/react-avatar": { @@ -3809,330 +3433,304 @@ "integrity": "sha512-JtyZR+mqgBibTo8xea3B6ZRmzZiM/YeVBtUkas6zMuXjAlfIFIW2FgqeM9eLyvEaYX66vr6DJMK+4U6LV0KhNw==", "dev": true }, - "node_modules/@rollup/rollup-android-arm-eabi": { - "version": "4.63.6", - "resolved": "https://registry.npmmirror.com/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.63.6.tgz", - "integrity": "sha512-G6xF9OVRWsbHadMfoPNUDwW/Jt70QYG+ZDUvtYCFxjf3SPhqVAO0u9ShXZ7Cf5silVoRWyN4bDjCEKnJkXkw0w==", + "node_modules/@rolldown/binding-android-arm-eabi": { + "version": "1.2.19", + "resolved": "https://registry.npmjs.org/@rolldown/binding-android-arm-eabi/-/binding-android-arm-eabi-1.2.19.tgz", + "integrity": "sha512-e+Ebe0WT+9tbXmNKPIiC8YrWAHYwug3m6i4p3rZGGulfZri1jtI4HslT+OZnFf/OIHowWF71DTlHwXBP2SiA7A==", "cpu": [ "arm" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "android" - ] + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } }, - "node_modules/@rollup/rollup-android-arm64": { - "version": "4.63.6", - "resolved": "https://registry.npmmirror.com/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.63.6.tgz", - "integrity": "sha512-Us/kTH5e2anr1CQvO8MEq4eeCVcIXI3Ag7OFxDI30n2OW7Q7xWuxo8ItbYq28PG2Sm1NWmZzG9+SqVEaj25SFA==", + "node_modules/@rolldown/binding-android-arm64": { + "version": "1.2.19", + "resolved": "https://registry.npmjs.org/@rolldown/binding-android-arm64/-/binding-android-arm64-1.2.19.tgz", + "integrity": "sha512-hOombrTJ+szt2ciEzS7oCA78lMPBgF5UMQWCJIyNfnrI7GLl8HYoFqCnpL2gcPOaXMqryGCU5ExdQKyDDcC+yA==", "cpu": [ "arm64" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "android" - ] + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } }, - "node_modules/@rollup/rollup-darwin-arm64": { - "version": "4.63.6", - "resolved": "https://registry.npmmirror.com/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.63.6.tgz", - "integrity": "sha512-fwaSNrSHp9PJuEh4bKtd0mYC+G3FeVDjSTmsSiSlIYu7TFCpxrfB6lk7Ao8cIbswFyklPB1ZDUV8LkLBM15VWw==", + "node_modules/@rolldown/binding-darwin-arm64": { + "version": "1.2.19", + "resolved": "https://registry.npmjs.org/@rolldown/binding-darwin-arm64/-/binding-darwin-arm64-1.2.19.tgz", + "integrity": "sha512-XoMA2pwCKGTQzUjPgtRwkedH4WmXhdIPKT6l6oOxd1PUbNodGI6DcBekgN7EC//+x3pfBYX/qL1gNmZAqivw5g==", "cpu": [ "arm64" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "darwin" - ] + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } }, - "node_modules/@rollup/rollup-darwin-x64": { - "version": "4.63.6", - "resolved": "https://registry.npmmirror.com/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.63.6.tgz", - "integrity": "sha512-QR2tx26gCeGh4eAGnUasfnJuRc+d7Vc0Jo1/fYtKGuiKqCuhbVpbNEvqgYGBwGDZGyS04jj+zdHi9W8uvb1Sdw==", + "node_modules/@rolldown/binding-darwin-x64": { + "version": "1.2.19", + "resolved": "https://registry.npmjs.org/@rolldown/binding-darwin-x64/-/binding-darwin-x64-1.2.19.tgz", + "integrity": "sha512-zo8EsSSwMZCY/e+fRnGaX02YGgvJD0yvhNi/9hpGPA2MJ9ZF8dPCw75UGfpI6OpQ/myR/dIYmogRvqiZD0TrXg==", "cpu": [ "x64" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "darwin" - ] - }, - "node_modules/@rollup/rollup-freebsd-arm64": { - "version": "4.63.6", - "resolved": "https://registry.npmmirror.com/@rollup/rollup-freebsd-arm64/-/rollup-freebsd-arm64-4.63.6.tgz", - "integrity": "sha512-7E1wRJEW8r7WlqmCy58ugndWHrzoEV/pRt2x0D9el7Inra62+Cw00lYW9XhW6iUCtFjhNw49McsSCIzJ/nG8uw==", - "cpu": [ - "arm64" ], - "dev": true, - "optional": true, - "os": [ - "freebsd" - ] + "engines": { + "node": "^20.19.0 || >=22.12.0" + } }, - "node_modules/@rollup/rollup-freebsd-x64": { - "version": "4.63.6", - "resolved": "https://registry.npmmirror.com/@rollup/rollup-freebsd-x64/-/rollup-freebsd-x64-4.63.6.tgz", - "integrity": "sha512-13KJeF+vDswMzEHmMIouCVcEQdov3CzAA3ZhM8QFmBJV/FZ/VMZI49UHDvPXTK+wokk86kYPmQ9Qb3xGGJbZoQ==", + "node_modules/@rolldown/binding-freebsd-x64": { + "version": "1.2.19", + "resolved": "https://registry.npmjs.org/@rolldown/binding-freebsd-x64/-/binding-freebsd-x64-1.2.19.tgz", + "integrity": "sha512-O8ISAOfI1nj7AuBPd30FSF47z7f7lzlk5poQVGgiikvQuGEBFYvW8ki+UEnT+YJPnNGjQzn304klt4O9FUE7mA==", "cpu": [ "x64" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "freebsd" - ] - }, - "node_modules/@rollup/rollup-linux-arm-gnueabihf": { - "version": "4.63.6", - "resolved": "https://registry.npmmirror.com/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.63.6.tgz", - "integrity": "sha512-hV+W1r8HM84PER4If94QuzrrD0DNk4CxobNhVUiz9ZiiWHDzJss4Jra2AYGH1a7GOTzjS1sIyZ35yYEhw/aq+g==", - "cpu": [ - "arm" ], - "dev": true, - "optional": true, - "os": [ - "linux" - ] + "engines": { + "node": "^20.19.0 || >=22.12.0" + } }, - "node_modules/@rollup/rollup-linux-arm-musleabihf": { - "version": "4.63.6", - "resolved": "https://registry.npmmirror.com/@rollup/rollup-linux-arm-musleabihf/-/rollup-linux-arm-musleabihf-4.63.6.tgz", - "integrity": "sha512-5dWs/GENZufRph8PEfl0TrNH/R3DHJA+VxF/dqlfV2oUZfxRtN3qmFXg2DZj8DYM8d+Vd3dgZtuVmoBE/nb2YQ==", + "node_modules/@rolldown/binding-linux-arm-gnueabihf": { + "version": "1.2.19", + "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-arm-gnueabihf/-/binding-linux-arm-gnueabihf-1.2.19.tgz", + "integrity": "sha512-/lYCba5NO0yq4S0jGMH8QTBtkvQxoXjoQWzF5BcWp9MjB9jxVRD1GQDNofkVjcOj30DWyhLIN/4Oe60JKzaONw==", "cpu": [ "arm" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "linux" - ] - }, - "node_modules/@rollup/rollup-linux-arm64-gnu": { - "version": "4.63.6", - "resolved": "https://registry.npmmirror.com/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.63.6.tgz", - "integrity": "sha512-inQYLPVIUvYk+s7zpxQldqwrajUNs+t4TJjPGzsdPTvsT8gsQXVcW/sQFolHZ3YSWVk0nMMwU7TtRi0Ow+QMuw==", - "cpu": [ - "arm64" ], - "dev": true, - "optional": true, - "os": [ - "linux" - ] + "engines": { + "node": "^20.19.0 || >=22.12.0" + } }, - "node_modules/@rollup/rollup-linux-arm64-musl": { - "version": "4.63.6", - "resolved": "https://registry.npmmirror.com/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.63.6.tgz", - "integrity": "sha512-sH+0MV1HmDC1q7+bQnlN9ywKBmHqkA2EdD/hHYrrz654ybc+vNC1FRNyzuYKicMQVtZZ4X2jz0osJYmsOtnj4g==", + "node_modules/@rolldown/binding-linux-arm64-gnu": { + "version": "1.2.19", + "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-arm64-gnu/-/binding-linux-arm64-gnu-1.2.19.tgz", + "integrity": "sha512-pm/apFMBnSbFb3O6nG5pHO1iqHhZrjGDFEjSm+ot9J17XXPvH9L90y5h+jgfHCE+Qdlsvy8qKEcU4VKxgjD+vA==", "cpu": [ "arm64" ], "dev": true, - "optional": true, - "os": [ - "linux" - ] - }, - "node_modules/@rollup/rollup-linux-loong64-gnu": { - "version": "4.63.6", - "resolved": "https://registry.npmmirror.com/@rollup/rollup-linux-loong64-gnu/-/rollup-linux-loong64-gnu-4.63.6.tgz", - "integrity": "sha512-mCECvRr6HGekdBc6dvHzUWubqEti4JyOqlNePrOzl4Wimk26iW5Zy9rld2mQbC9id1NYjfF8nHLFq5fr3CuOKQ==", - "cpu": [ - "loong64" + "libc": [ + "glibc" ], - "dev": true, + "license": "MIT", "optional": true, "os": [ "linux" - ] - }, - "node_modules/@rollup/rollup-linux-loong64-musl": { - "version": "4.63.6", - "resolved": "https://registry.npmmirror.com/@rollup/rollup-linux-loong64-musl/-/rollup-linux-loong64-musl-4.63.6.tgz", - "integrity": "sha512-bb9rdoCPwM4DEsbOP3CJgFnvhSJ3XKCUYyUhxnlSs/XGT0DknpOYgLCPbK8VUzwl+cZGzFQm0KbBYRaSGZC2YQ==", - "cpu": [ - "loong64" ], - "dev": true, - "optional": true, - "os": [ - "linux" - ] + "engines": { + "node": "^20.19.0 || >=22.12.0" + } }, - "node_modules/@rollup/rollup-linux-ppc64-gnu": { - "version": "4.63.6", - "resolved": "https://registry.npmmirror.com/@rollup/rollup-linux-ppc64-gnu/-/rollup-linux-ppc64-gnu-4.63.6.tgz", - "integrity": "sha512-aIJRoGCHev45JSu7JMzVrMzu1NX3nQrXx1Vb/6y4AblxW7JpCMpk4e8C6lHzvSElxi3UEcMdFJldsuWQjV1ddA==", + "node_modules/@rolldown/binding-linux-arm64-musl": { + "version": "1.2.19", + "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-arm64-musl/-/binding-linux-arm64-musl-1.2.19.tgz", + "integrity": "sha512-K1SmQp3FFichn8oqrNIwvFoZ5wcvjC7goBzpaMNvLf9FZc+QB/QvLmnpJZgAAGHiD980tP8FZZnXk2K94rvlxg==", "cpu": [ - "ppc64" + "arm64" ], "dev": true, + "libc": [ + "musl" + ], + "license": "MIT", "optional": true, "os": [ "linux" - ] + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } }, - "node_modules/@rollup/rollup-linux-ppc64-musl": { - "version": "4.63.6", - "resolved": "https://registry.npmmirror.com/@rollup/rollup-linux-ppc64-musl/-/rollup-linux-ppc64-musl-4.63.6.tgz", - "integrity": "sha512-LvjnulezHjiaM5Ga9MPCDLTVddjvcrJhZc6vEz9fxeFRGPJsPAX9HuTuPTUQ3l8d+nYpZB/xWzUpuKJlLQm3VQ==", + "node_modules/@rolldown/binding-linux-ppc64-gnu": { + "version": "1.2.19", + "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-ppc64-gnu/-/binding-linux-ppc64-gnu-1.2.19.tgz", + "integrity": "sha512-I0xwD57jP/3A7+5UPZin2w8Y7XHEmEM5zqpYZOcQ45MlNW6tUJUziymV3yRr7rL4vwyfEcRsRksC4a7Kc08p5Q==", "cpu": [ "ppc64" ], "dev": true, - "optional": true, - "os": [ - "linux" - ] - }, - "node_modules/@rollup/rollup-linux-riscv64-gnu": { - "version": "4.63.6", - "resolved": "https://registry.npmmirror.com/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.63.6.tgz", - "integrity": "sha512-YmhSBeYZwJ937s8tKpYAhms48N+tj7e+oFkbkVVxfMRdAiynK2AxqRapJXB4utyXxc/iYTkMfPRQ+7ZP0IO78w==", - "cpu": [ - "riscv64" + "libc": [ + "glibc" ], - "dev": true, + "license": "MIT", "optional": true, "os": [ "linux" - ] - }, - "node_modules/@rollup/rollup-linux-riscv64-musl": { - "version": "4.63.6", - "resolved": "https://registry.npmmirror.com/@rollup/rollup-linux-riscv64-musl/-/rollup-linux-riscv64-musl-4.63.6.tgz", - "integrity": "sha512-9+YukhzqTvJvzfDXJJzkURK9TDY01nofNH3pyHGuucGC4xPvBVtIfCAqJjkjnmBEGJYNXB8sBc2EDt7xDgGenw==", - "cpu": [ - "riscv64" ], - "dev": true, - "optional": true, - "os": [ - "linux" - ] + "engines": { + "node": "^20.19.0 || >=22.12.0" + } }, - "node_modules/@rollup/rollup-linux-s390x-gnu": { - "version": "4.63.6", - "resolved": "https://registry.npmmirror.com/@rollup/rollup-linux-s390x-gnu/-/rollup-linux-s390x-gnu-4.63.6.tgz", - "integrity": "sha512-9G5AtEkpN/A89BILHHEL9aYRYTuFjwa8PUQqoEg8SDrwOZBKpwYqNlQCBNI5QPwGrf7qFlb6LNFilo8FCSA3Wg==", + "node_modules/@rolldown/binding-linux-s390x-gnu": { + "version": "1.2.19", + "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-s390x-gnu/-/binding-linux-s390x-gnu-1.2.19.tgz", + "integrity": "sha512-BrtEHT24SNXj9HiXqy+s/kXiSiQGt6EKCPUlRirAoIioVxKGnbXBUEkbZASAei7iZJB0/Ynm+0JP00Ipx7AnSw==", "cpu": [ "s390x" ], "dev": true, + "libc": [ + "glibc" + ], + "license": "MIT", "optional": true, "os": [ "linux" - ] + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } }, - "node_modules/@rollup/rollup-linux-x64-gnu": { - "version": "4.63.6", - "resolved": "https://registry.npmmirror.com/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.63.6.tgz", - "integrity": "sha512-Ezx2E5D6Siz805j41x91JiGbzuCm8i2U98U37SQ7ytY737+wsJq+P9nPL6UmqDww491zO7MTivYOTrtmTTeCSw==", + "node_modules/@rolldown/binding-linux-x64-gnu": { + "version": "1.2.19", + "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-x64-gnu/-/binding-linux-x64-gnu-1.2.19.tgz", + "integrity": "sha512-rm75/9DkHKeU2WnA8w4X94WGYgLlDCFCfkQC+4bguVJmC/jvDRv2B+2wLOYhyE0fVuv7//Ckk39OoOufyCu76Q==", "cpu": [ "x64" ], "dev": true, + "libc": [ + "glibc" + ], + "license": "MIT", "optional": true, "os": [ "linux" - ] + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } }, - "node_modules/@rollup/rollup-linux-x64-musl": { - "version": "4.63.6", - "resolved": "https://registry.npmmirror.com/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.63.6.tgz", - "integrity": "sha512-8EZ1Q3PB7yUjvR4MbFAnCBF1wF0XRe5QQqbtlJXP7ZX5C8iYlSQJugUhj9oS0gbUP4jp9qGhaIgFnV9Nvod86Q==", + "node_modules/@rolldown/binding-linux-x64-musl": { + "version": "1.2.19", + "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-x64-musl/-/binding-linux-x64-musl-1.2.19.tgz", + "integrity": "sha512-irh/4+iYFM4GAzpluDErgjz89bj6NDtqqMAG/6O1LG38Ed3NpyebzCpcVNkFW8uhy+/3/BocUvnXDR33CXWe9A==", "cpu": [ "x64" ], "dev": true, + "libc": [ + "musl" + ], + "license": "MIT", "optional": true, "os": [ "linux" - ] - }, - "node_modules/@rollup/rollup-openbsd-x64": { - "version": "4.63.6", - "resolved": "https://registry.npmmirror.com/@rollup/rollup-openbsd-x64/-/rollup-openbsd-x64-4.63.6.tgz", - "integrity": "sha512-3JI27TALItfZ/qaxXKdbRXfV6WepUoUa3IN07FE+1xxoRdl3JIyrp5PiDF0vOHsPgEiOFkF8s3B3BRymQkdwGA==", - "cpu": [ - "x64" ], - "dev": true, - "optional": true, - "os": [ - "openbsd" - ] + "engines": { + "node": "^20.19.0 || >=22.12.0" + } }, - "node_modules/@rollup/rollup-openharmony-arm64": { - "version": "4.63.6", - "resolved": "https://registry.npmmirror.com/@rollup/rollup-openharmony-arm64/-/rollup-openharmony-arm64-4.63.6.tgz", - "integrity": "sha512-BNOGeNFNRZDT7Hfc7b9JbTZFXkpAXeXl/CZWtxdd5CNfBaor/0RkJjg+q+E2gwVIvGqqp/NclThKFGrhuScVhw==", + "node_modules/@rolldown/binding-openharmony-arm64": { + "version": "1.2.19", + "resolved": "https://registry.npmjs.org/@rolldown/binding-openharmony-arm64/-/binding-openharmony-arm64-1.2.19.tgz", + "integrity": "sha512-+KWTWNoPt+CfSq94CiceWu3yPE+QzkaG+phPyz9G60tmZLwfQkcA4AeksafzvJAw4pvg1mcd5a1TkUqVv0s4JA==", "cpu": [ "arm64" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "openharmony" - ] - }, - "node_modules/@rollup/rollup-win32-arm64-msvc": { - "version": "4.63.6", - "resolved": "https://registry.npmmirror.com/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.63.6.tgz", - "integrity": "sha512-D3eEyLSIim5WF5fHbwnx+ryk0delN7fJyBrDTO3wVCCNBZ/cA8aCGwLS3SiuK+vRI4E7dqikAlStGuR20dBMuw==", - "cpu": [ - "arm64" ], - "dev": true, - "optional": true, - "os": [ - "win32" - ] + "engines": { + "node": "^20.19.0 || >=22.12.0" + } }, - "node_modules/@rollup/rollup-win32-ia32-msvc": { - "version": "4.63.6", - "resolved": "https://registry.npmmirror.com/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.63.6.tgz", - "integrity": "sha512-xwbs9g8zLbHzj1poG1uh27xtubsu27Gk2nuN6kvvGDybjiTfwMksQAnF+phlvI5oeXkJWWDc6kg1t3XpgUYvrg==", + "node_modules/@rolldown/binding-wasm32-wasi": { + "version": "1.2.19", + "resolved": "https://registry.npmjs.org/@rolldown/binding-wasm32-wasi/-/binding-wasm32-wasi-1.2.19.tgz", + "integrity": "sha512-7EH+skOsl5qpWnK0vzamgJFhOv1cwxQpsxm8tI883K9fur5c27p8q87fzEO6BbBPabA2/+s/zR63/pLc137iOg==", "cpu": [ - "ia32" + "wasm32" ], "dev": true, + "license": "MIT", "optional": true, - "os": [ - "win32" - ] + "dependencies": { + "@emnapi/core": "2.0.0-beta.2", + "@emnapi/runtime": "2.0.0-beta.2", + "@napi-rs/wasm-runtime": "1.2.6" + }, + "engines": { + "node": "^20.19.0 || ^22.13.0 || >=23.5.0" + } }, - "node_modules/@rollup/rollup-win32-x64-gnu": { - "version": "4.63.6", - "resolved": "https://registry.npmmirror.com/@rollup/rollup-win32-x64-gnu/-/rollup-win32-x64-gnu-4.63.6.tgz", - "integrity": "sha512-Tr6rhRNnFthvXr45zWVZQ5P8jZ5UwZnXNc7Qnu80cP/VVYtSioOPmvv7wP6UMgRfkBCJr2Pm60ua0YBDSJjgnw==", + "node_modules/@rolldown/binding-win32-arm64-msvc": { + "version": "1.2.19", + "resolved": "https://registry.npmjs.org/@rolldown/binding-win32-arm64-msvc/-/binding-win32-arm64-msvc-1.2.19.tgz", + "integrity": "sha512-3Q1Yg1Q7tEvBWoZf5rFvG/GKZQPgwfru+p4wBajDfJFBs0SHCpL++dfTjW9gyAKd1T7ZpIYvdaUax7Pa/IhFVQ==", "cpu": [ - "x64" + "arm64" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "win32" - ] + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } }, - "node_modules/@rollup/rollup-win32-x64-msvc": { - "version": "4.63.6", - "resolved": "https://registry.npmmirror.com/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.63.6.tgz", - "integrity": "sha512-0RAxO1pS/6lY1mSoD2Apm+6aPyfUlm+OWKgncIdj/eVN9I+pDY3lKgD7xsUNFei1u7MZQETGOo6m8POXMDp53A==", + "node_modules/@rolldown/binding-win32-x64-msvc": { + "version": "1.2.19", + "resolved": "https://registry.npmjs.org/@rolldown/binding-win32-x64-msvc/-/binding-win32-x64-msvc-1.2.19.tgz", + "integrity": "sha512-y/sqRRc6d7hECzOFc5n3LSeqctmIp9mMjY1Kq4s14uLPd/LZ4z7i1zrW6fMtp2mPeuQIC4e6ULMcwQzMomqQag==", "cpu": [ "x64" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "win32" - ] + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/pluginutils": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/@rolldown/pluginutils/-/pluginutils-1.1.1.tgz", + "integrity": "sha512-glFIJDvLNDtJhT9qrMFWLPbvS+skxgt4L0K8Ei2YtnhPysAJnsI7nyxSJxKj4ADeKX0OLjC4ntRkwpLOoS3rwA==", + "dev": true, + "license": "MIT" }, "node_modules/@sentry/browser": { "version": "11.1.0", @@ -4629,1986 +4227,1552 @@ "node": ">= 20" } }, - "node_modules/@tailwindcss/oxide-linux-x64-musl": { - "version": "4.3.5", - "resolved": "https://registry.npmmirror.com/@tailwindcss/oxide-linux-x64-musl/-/oxide-linux-x64-musl-4.3.5.tgz", - "integrity": "sha512-0JQAzs7jwbA7O6+z/adU+Jk3AXwsu3npAhtr5escXS7TqEqWcaDV7qHuI+0Vy/KQRuVGnLQREcSJWYauyV3oqg==", - "cpu": [ - "x64" - ], - "dev": true, - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">= 20" - } - }, - "node_modules/@tailwindcss/oxide-wasm32-wasi": { - "version": "4.3.5", - "resolved": "https://registry.npmmirror.com/@tailwindcss/oxide-wasm32-wasi/-/oxide-wasm32-wasi-4.3.5.tgz", - "integrity": "sha512-OJhFmlEfdzMr+avACdi40RPtnkW0B6hXyxL/8r+tnEHBWZji36CYRjEXrrvgBmaYsD3oEOBqwYFRKsYvzFe7Bw==", - "bundleDependencies": [ - "@napi-rs/wasm-runtime", - "@emnapi/core", - "@emnapi/runtime", - "@tybys/wasm-util", - "@emnapi/wasi-threads", - "tslib" - ], - "dev": true, - "optional": true, - "dependencies": { - "@emnapi/core": "^1.11.3", - "@emnapi/runtime": "^1.11.3", - "@emnapi/wasi-threads": "^1.2.3", - "@napi-rs/wasm-runtime": "^1.2.2", - "@tybys/wasm-util": "^0.10.3", - "tslib": "^2.8.1" - }, - "engines": { - "node": "^20.19.0 || ^22.13.0 || >=23.5.0" - } - }, - "node_modules/@tailwindcss/oxide-wasm32-wasi/node_modules/@emnapi/core": { - "version": "1.11.3", - "dev": true, - "inBundle": true, - "license": "MIT", - "optional": true, - "dependencies": { - "@emnapi/wasi-threads": "1.2.3", - "tslib": "^2.4.0" - } - }, - "node_modules/@tailwindcss/oxide-wasm32-wasi/node_modules/@emnapi/runtime": { - "version": "1.11.3", - "dev": true, - "inBundle": true, - "license": "MIT", - "optional": true, - "dependencies": { - "tslib": "^2.4.0" - } - }, - "node_modules/@tailwindcss/oxide-wasm32-wasi/node_modules/@emnapi/wasi-threads": { - "version": "1.2.3", - "dev": true, - "inBundle": true, - "license": "MIT", - "optional": true, - "dependencies": { - "tslib": "^2.4.0" - } - }, - "node_modules/@tailwindcss/oxide-wasm32-wasi/node_modules/@napi-rs/wasm-runtime": { - "version": "1.2.2", - "dev": true, - "inBundle": true, - "license": "MIT", - "optional": true, - "dependencies": { - "@tybys/wasm-util": "^0.10.3" - }, - "engines": { - "node": "^20.19.0 || ^22.13.0 || >=23.5.0" - }, - "funding": { - "type": "github", - "url": "https://github.com/sponsors/Brooooooklyn" - }, - "peerDependencies": { - "@emnapi/core": "^1.7.1 || ^2.0.0-alpha.3", - "@emnapi/runtime": "^1.7.1 || ^2.0.0-alpha.3" - } - }, - "node_modules/@tailwindcss/oxide-wasm32-wasi/node_modules/@tybys/wasm-util": { - "version": "0.10.3", - "dev": true, - "inBundle": true, - "license": "MIT", - "optional": true, - "dependencies": { - "tslib": "^2.4.0" - } - }, - "node_modules/@tailwindcss/oxide-wasm32-wasi/node_modules/tslib": { - "version": "2.8.1", - "dev": true, - "inBundle": true, - "license": "0BSD", - "optional": true - }, - "node_modules/@tailwindcss/oxide-win32-arm64-msvc": { - "version": "4.3.5", - "resolved": "https://registry.npmmirror.com/@tailwindcss/oxide-win32-arm64-msvc/-/oxide-win32-arm64-msvc-4.3.5.tgz", - "integrity": "sha512-9o8jgthi+QE5eandnboiJT64VQfnIArfZzSTdgbhEK5aafdiu2jTW9Honi/mwYHxBZuH1vAC57IFyrh+0iK5Gg==", - "cpu": [ - "arm64" - ], - "dev": true, - "optional": true, - "os": [ - "win32" - ], - "engines": { - "node": ">= 20" - } - }, - "node_modules/@tailwindcss/oxide-win32-x64-msvc": { - "version": "4.3.5", - "resolved": "https://registry.npmmirror.com/@tailwindcss/oxide-win32-x64-msvc/-/oxide-win32-x64-msvc-4.3.5.tgz", - "integrity": "sha512-XiKFfIy1RWe7qK4WqByxNW7Oz1/nkOy8o/BWhHminyV1PmpUd8Eedj5v2A8h2kpqeVlz6xRnwk9Fr/ZXNLcZfg==", - "cpu": [ - "x64" - ], - "dev": true, - "optional": true, - "os": [ - "win32" - ], - "engines": { - "node": ">= 20" - } - }, - "node_modules/@tailwindcss/vite": { - "version": "4.3.5", - "resolved": "https://registry.npmmirror.com/@tailwindcss/vite/-/vite-4.3.5.tgz", - "integrity": "sha512-BCNiY0a1ZjdOHVqw7kyb7U72BwfMF3dfUuN+tQsLWky/J5JOI/r7abibglXfygrZhVO/3u3V+E25kkKTeMkXaQ==", - "dev": true, - "dependencies": { - "@tailwindcss/node": "4.3.5", - "@tailwindcss/oxide": "4.3.5", - "tailwindcss": "4.3.5" - }, - "peerDependencies": { - "vite": "^5.2.0 || ^6 || ^7 || ^8" - } - }, - "node_modules/@tweenjs/tween.js": { - "version": "25.0.0", - "resolved": "https://registry.npmmirror.com/@tweenjs/tween.js/-/tween.js-25.0.0.tgz", - "integrity": "sha512-XKLA6syeBUaPzx4j3qwMqzzq+V4uo72BnlbOjmuljLrRqdsd3qnzvZZoxvMHZ23ndsRS4aufU6JOZYpCbU6T1A==", - "dev": true - }, - "node_modules/@types/babel__core": { - "version": "7.20.5", - "resolved": "https://registry.npmmirror.com/@types/babel__core/-/babel__core-7.20.5.tgz", - "integrity": "sha512-qoQprZvz5wQFJwMDqeseRXWv3rqMvhgpbXFfVyWhbx9X47POIA6i/+dXefEmZKoAgOaTdaIgNSMqMIU61yRyzA==", - "dev": true, - "dependencies": { - "@babel/parser": "^7.20.7", - "@babel/types": "^7.20.7", - "@types/babel__generator": "*", - "@types/babel__template": "*", - "@types/babel__traverse": "*" - } - }, - "node_modules/@types/babel__generator": { - "version": "7.27.0", - "resolved": "https://registry.npmmirror.com/@types/babel__generator/-/babel__generator-7.27.0.tgz", - "integrity": "sha512-ufFd2Xi92OAVPYsy+P4n7/U7e68fex0+Ee8gSG9KX7eo084CWiQ4sdxktvdl0bOPupXtVJPY19zk6EwWqUQ8lg==", - "dev": true, - "dependencies": { - "@babel/types": "^7.0.0" - } - }, - "node_modules/@types/babel__template": { - "version": "7.4.4", - "resolved": "https://registry.npmmirror.com/@types/babel__template/-/babel__template-7.4.4.tgz", - "integrity": "sha512-h/NUaSyG5EyxBIp8YRxo4RMe2/qQgvyowRwVMzhYhBCONbW8PUsg4lkFMrhgZhUe5z3L3MiLDuvyJ/CaPa2A8A==", - "dev": true, - "dependencies": { - "@babel/parser": "^7.1.0", - "@babel/types": "^7.0.0" - } - }, - "node_modules/@types/babel__traverse": { - "version": "7.28.0", - "resolved": "https://registry.npmmirror.com/@types/babel__traverse/-/babel__traverse-7.28.0.tgz", - "integrity": "sha512-8PvcXf70gTDZBgt9ptxJ8elBeBjcLOAcOtoO/mPJjtji1+CdGbHgm77om1GrsPxsiE+uXIpNSK64UYaIwQXd4Q==", - "dev": true, - "dependencies": { - "@babel/types": "^7.28.2" - } - }, - "node_modules/@types/debug": { - "version": "4.1.13", - "resolved": "https://registry.npmmirror.com/@types/debug/-/debug-4.1.13.tgz", - "integrity": "sha512-KSVgmQmzMwPlmtljOomayoR89W4FynCAi3E8PPs7vmDVPe84hT+vGPKkJfThkmXs0x0jAaa9U8uW8bbfyS2fWw==", - "dev": true, - "dependencies": { - "@types/ms": "*" - } - }, - "node_modules/@types/dom-webcodecs": { - "version": "0.1.19", - "resolved": "https://registry.npmmirror.com/@types/dom-webcodecs/-/dom-webcodecs-0.1.19.tgz", - "integrity": "sha512-+yFUIDUaASFz0vQpWBErPxun/Lb+F0TdrlTsj50gm7K797YzEx2TmV6fEiwciHyFNghlZYPgQXH5qRcwMHcJFQ==", - "dev": true, - "license": "MIT" - }, - "node_modules/@types/estree": { - "version": "1.0.9", - "resolved": "https://registry.npmmirror.com/@types/estree/-/estree-1.0.9.tgz", - "integrity": "sha512-GhdPgy1el4/ImP05X05Uw4cw2/M93BCUmnEvWZNStlCzEKME4Fkk+YpoA5OiHNQmoS7Cafb8Xa3Pya8m1Qrzeg==", - "dev": true - }, - "node_modules/@types/estree-jsx": { - "version": "1.0.5", - "resolved": "https://registry.npmmirror.com/@types/estree-jsx/-/estree-jsx-1.0.5.tgz", - "integrity": "sha512-52CcUVNFyfb1A2ALocQw/Dd1BQFNmSdkuC3BkZ6iqhdMfQz7JWOFRuJFloOzjk+6WijU56m9oKXFAXc7o3Towg==", - "dev": true, - "dependencies": { - "@types/estree": "*" - } - }, - "node_modules/@types/fs-extra": { - "version": "9.0.13", - "resolved": "https://registry.npmmirror.com/@types/fs-extra/-/fs-extra-9.0.13.tgz", - "integrity": "sha512-nEnwB++1u5lVDM2UI4c1+5R+FYaKfaAzS4OococimjVm3nQw3TuzH5UNsocrcTBbhnerblyHj4A49qXbIiZdpA==", + "node_modules/@tailwindcss/oxide-linux-x64-musl": { + "version": "4.3.5", + "resolved": "https://registry.npmmirror.com/@tailwindcss/oxide-linux-x64-musl/-/oxide-linux-x64-musl-4.3.5.tgz", + "integrity": "sha512-0JQAzs7jwbA7O6+z/adU+Jk3AXwsu3npAhtr5escXS7TqEqWcaDV7qHuI+0Vy/KQRuVGnLQREcSJWYauyV3oqg==", + "cpu": [ + "x64" + ], "dev": true, - "dependencies": { - "@types/node": "*" + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 20" } }, - "node_modules/@types/hast": { - "version": "3.0.5", - "resolved": "https://registry.npmmirror.com/@types/hast/-/hast-3.0.5.tgz", - "integrity": "sha512-rp/ezSWaD1m44dPKICGhiskI13nVr7qTloFwDa/IYkhhf5nzwP+zIQcIJh3WIFSBOy/H1PzB40jPjMDksN4F+g==", + "node_modules/@tailwindcss/oxide-wasm32-wasi": { + "version": "4.3.5", + "resolved": "https://registry.npmmirror.com/@tailwindcss/oxide-wasm32-wasi/-/oxide-wasm32-wasi-4.3.5.tgz", + "integrity": "sha512-OJhFmlEfdzMr+avACdi40RPtnkW0B6hXyxL/8r+tnEHBWZji36CYRjEXrrvgBmaYsD3oEOBqwYFRKsYvzFe7Bw==", + "bundleDependencies": [ + "@napi-rs/wasm-runtime", + "@emnapi/core", + "@emnapi/runtime", + "@tybys/wasm-util", + "@emnapi/wasi-threads", + "tslib" + ], "dev": true, + "optional": true, "dependencies": { - "@types/unist": "*" + "@emnapi/core": "^1.11.3", + "@emnapi/runtime": "^1.11.3", + "@emnapi/wasi-threads": "^1.2.3", + "@napi-rs/wasm-runtime": "^1.2.2", + "@tybys/wasm-util": "^0.10.3", + "tslib": "^2.8.1" + }, + "engines": { + "node": "^20.19.0 || ^22.13.0 || >=23.5.0" } }, - "node_modules/@types/json-schema": { - "version": "7.0.15", - "resolved": "https://registry.npmmirror.com/@types/json-schema/-/json-schema-7.0.15.tgz", - "integrity": "sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA==", - "dev": true - }, - "node_modules/@types/mdast": { - "version": "4.0.4", - "resolved": "https://registry.npmmirror.com/@types/mdast/-/mdast-4.0.4.tgz", - "integrity": "sha512-kGaNbPh1k7AFzgpud/gMdvIm5xuECykRR+JnWKQno9TAXVa6WIVCGTPvYGekIDL4uwCZQSYbUxNBSb1aUo79oA==", + "node_modules/@tailwindcss/oxide-wasm32-wasi/node_modules/@emnapi/core": { + "version": "1.11.3", "dev": true, + "inBundle": true, + "license": "MIT", + "optional": true, "dependencies": { - "@types/unist": "*" + "@emnapi/wasi-threads": "1.2.3", + "tslib": "^2.4.0" } }, - "node_modules/@types/ms": { - "version": "2.1.0", - "resolved": "https://registry.npmmirror.com/@types/ms/-/ms-2.1.0.tgz", - "integrity": "sha512-GsCCIZDE/p3i96vtEqx+7dBUGXrc7zeSK3wwPHIaRThS+9OhWIXRqzs4d6k1SVU8g91DrNRWxWUGhp5KXQb2VA==", - "dev": true - }, - "node_modules/@types/node": { - "version": "26.6.3", - "resolved": "https://registry.npmmirror.com/@types/node/-/node-26.6.3.tgz", - "integrity": "sha512-dsqMQQoeTLqu9wynDD00q573mNzso3IdQOAfHRJqLCcmCFPoGo9A1bDpUcv/9tnKpErQWv9uKeGfl37EIS02Yg==", + "node_modules/@tailwindcss/oxide-wasm32-wasi/node_modules/@emnapi/runtime": { + "version": "1.11.3", "dev": true, + "inBundle": true, + "license": "MIT", + "optional": true, "dependencies": { - "undici-types": "~8.9.0" - } - }, - "node_modules/@types/react": { - "version": "19.3.0", - "resolved": "https://registry.npmmirror.com/@types/react/-/react-19.3.0.tgz", - "integrity": "sha512-N0rFCuH9YoxG9/m61l9MfpJKfmLOVU0em7ipIz6TRgSSkvReLB9vL85GB+yr8Bs5leqpvg96JSwF4ZS1s4viQg==", - "devOptional": true, - "dependencies": { - "csstype": "^3.2.2" + "tslib": "^2.4.0" } }, - "node_modules/@types/react-dom": { - "version": "19.3.0", - "resolved": "https://registry.npmmirror.com/@types/react-dom/-/react-dom-19.3.0.tgz", - "integrity": "sha512-ZI7bU42mZXXKHn/qNLEw2IrbiINU7X5+vfgdixBHkCNpYWXjKgfQ/P+uyGb5CjOLB9UcnTeg3rylQtV2hym44Q==", + "node_modules/@tailwindcss/oxide-wasm32-wasi/node_modules/@emnapi/wasi-threads": { + "version": "1.2.3", "dev": true, - "peerDependencies": { - "@types/react": "^19.3.0" + "inBundle": true, + "license": "MIT", + "optional": true, + "dependencies": { + "tslib": "^2.4.0" } }, - "node_modules/@types/trusted-types": { - "version": "2.0.7", - "resolved": "https://registry.npmmirror.com/@types/trusted-types/-/trusted-types-2.0.7.tgz", - "integrity": "sha512-ScaPdn1dQczgbl0QFTeTOmVHFULt394XJgOQNoyVhZ6r2vLnMLJfBPd53SB52T/3G36VI1/g2MZaX0cwDuXsfw==", - "optional": true - }, - "node_modules/@types/unist": { - "version": "3.0.3", - "resolved": "https://registry.npmmirror.com/@types/unist/-/unist-3.0.3.tgz", - "integrity": "sha512-ko/gIFJRv177XgZsZcBwnqJN5x/Gien8qNOn0D5bQU/zAzVf9Zt3BlcUiLqhV9y4ARk0GbT3tnUiPNgnTXzc/Q==", - "dev": true - }, - "node_modules/@types/wicg-file-system-access": { - "version": "2020.9.8", - "resolved": "https://registry.npmmirror.com/@types/wicg-file-system-access/-/wicg-file-system-access-2020.9.8.tgz", - "integrity": "sha512-ggMz8nOygG7d/stpH40WVaNvBwuyYLnrg5Mbyf6bmsj/8+gb6Ei4ZZ9/4PNpcPNTT8th9Q8sM8wYmWGjMWLX/A==", - "dev": true, - "license": "MIT" - }, - "node_modules/@ungap/structured-clone": { - "version": "1.4.0", - "resolved": "https://registry.npmmirror.com/@ungap/structured-clone/-/structured-clone-1.4.0.tgz", - "integrity": "sha512-1mEZtMKPM09vDmQt5y7YvmN2+DFTP7Tg0EWXdic8/C6VRnpb33e4ghisCIE3WZjsE2N8mf+QV1Zqh7ZFYLWInQ==", - "dev": true - }, - "node_modules/@vitejs/plugin-react": { - "version": "5.2.0", - "resolved": "https://registry.npmmirror.com/@vitejs/plugin-react/-/plugin-react-5.2.0.tgz", - "integrity": "sha512-YmKkfhOAi3wsB1PhJq5Scj3GXMn3WvtQ/JC0xoopuHoXSdmtdStOpFrYaT1kie2YgFBcIe64ROzMYRjCrYOdYw==", + "node_modules/@tailwindcss/oxide-wasm32-wasi/node_modules/@napi-rs/wasm-runtime": { + "version": "1.2.2", "dev": true, + "inBundle": true, + "license": "MIT", + "optional": true, "dependencies": { - "@babel/core": "^7.29.0", - "@babel/plugin-transform-react-jsx-self": "^7.27.1", - "@babel/plugin-transform-react-jsx-source": "^7.27.1", - "@rolldown/pluginutils": "1.0.0-rc.3", - "@types/babel__core": "^7.20.5", - "react-refresh": "^0.18.0" + "@tybys/wasm-util": "^0.10.3" }, "engines": { - "node": "^20.19.0 || >=22.12.0" + "node": "^20.19.0 || ^22.13.0 || >=23.5.0" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/Brooooooklyn" }, "peerDependencies": { - "vite": "^4.2.0 || ^5.0.0 || ^6.0.0 || ^7.0.0 || ^8.0.0" + "@emnapi/core": "^1.7.1 || ^2.0.0-alpha.3", + "@emnapi/runtime": "^1.7.1 || ^2.0.0-alpha.3" } }, - "node_modules/@vitejs/plugin-react/node_modules/@rolldown/pluginutils": { - "version": "1.0.0-rc.3", - "resolved": "https://registry.npmmirror.com/@rolldown/pluginutils/-/pluginutils-1.0.0-rc.3.tgz", - "integrity": "sha512-eybk3TjzzzV97Dlj5c+XrBFW57eTNhzod66y9HrBlzJ6NsCrWCp/2kaPS3K9wJmurBC0Tdw4yPjXKZqlznim3Q==", - "dev": true - }, - "node_modules/@xmldom/xmldom": { - "version": "0.8.15", - "resolved": "https://registry.npmmirror.com/@xmldom/xmldom/-/xmldom-0.8.15.tgz", - "integrity": "sha512-/5NV/vDALVFDXgLmfsy9TRCBlKwO2LNBFzpzvb9iIj+jR+eSc6DLYYvVOdivT/jm7MtU6TebYuRmzEOI7w40UA==", + "node_modules/@tailwindcss/oxide-wasm32-wasi/node_modules/@tybys/wasm-util": { + "version": "0.10.3", "dev": true, - "engines": { - "node": ">=10.0.0" + "inBundle": true, + "license": "MIT", + "optional": true, + "dependencies": { + "tslib": "^2.4.0" } }, - "node_modules/@zip.js/zip.js": { - "version": "2.22.0", - "resolved": "https://registry.npmmirror.com/@zip.js/zip.js/-/zip.js-2.22.0.tgz", - "integrity": "sha512-QgkA+BSEPNR0C2l6xbSu5HDXieUxiuDK+Jx4ZeZlp22QO/qRUIF6JRXdxh4WlLiQUmnE/9aaGerlni+OY81wqg==", + "node_modules/@tailwindcss/oxide-wasm32-wasi/node_modules/tslib": { + "version": "2.8.1", "dev": true, - "engines": { - "bun": ">=0.7.0", - "deno": ">=1.0.0", - "node": ">=18.0.0" - } + "inBundle": true, + "license": "0BSD", + "optional": true }, - "node_modules/abbrev": { - "version": "4.0.0", - "resolved": "https://registry.npmmirror.com/abbrev/-/abbrev-4.0.0.tgz", - "integrity": "sha512-a1wflyaL0tHtJSmLSOVybYhy22vRih4eduhhrkcjgrWGnRfrZtovJ2FRjxuTtkkj47O/baf0R86QU5OuYpz8fA==", + "node_modules/@tailwindcss/oxide-win32-arm64-msvc": { + "version": "4.3.5", + "resolved": "https://registry.npmmirror.com/@tailwindcss/oxide-win32-arm64-msvc/-/oxide-win32-arm64-msvc-4.3.5.tgz", + "integrity": "sha512-9o8jgthi+QE5eandnboiJT64VQfnIArfZzSTdgbhEK5aafdiu2jTW9Honi/mwYHxBZuH1vAC57IFyrh+0iK5Gg==", + "cpu": [ + "arm64" + ], "dev": true, + "optional": true, + "os": [ + "win32" + ], "engines": { - "node": "^20.17.0 || >=22.9.0" + "node": ">= 20" } }, - "node_modules/agent-base": { - "version": "7.1.4", - "resolved": "https://registry.npmmirror.com/agent-base/-/agent-base-7.1.4.tgz", - "integrity": "sha512-MnA+YT8fwfJPgBx3m60MNqakm30XOkyIoH1y6huTQvC0PwZG7ki8NacLBcrPbNoo8vEZy7Jpuk7+jMO+CUovTQ==", + "node_modules/@tailwindcss/oxide-win32-x64-msvc": { + "version": "4.3.5", + "resolved": "https://registry.npmmirror.com/@tailwindcss/oxide-win32-x64-msvc/-/oxide-win32-x64-msvc-4.3.5.tgz", + "integrity": "sha512-XiKFfIy1RWe7qK4WqByxNW7Oz1/nkOy8o/BWhHminyV1PmpUd8Eedj5v2A8h2kpqeVlz6xRnwk9Fr/ZXNLcZfg==", + "cpu": [ + "x64" + ], "dev": true, + "optional": true, + "os": [ + "win32" + ], "engines": { - "node": ">= 14" + "node": ">= 20" } }, - "node_modules/ajv": { - "version": "8.20.0", - "resolved": "https://registry.npmmirror.com/ajv/-/ajv-8.20.0.tgz", - "integrity": "sha512-Thbli+OlOj+iMPYFBVBfJ3OmCAnaSyNn4M1vz9T6Gka5Jt9ba/HIR56joy65tY6kx/FCF5VXNB819Y7/GUrBGA==", + "node_modules/@tailwindcss/vite": { + "version": "4.3.5", + "resolved": "https://registry.npmmirror.com/@tailwindcss/vite/-/vite-4.3.5.tgz", + "integrity": "sha512-BCNiY0a1ZjdOHVqw7kyb7U72BwfMF3dfUuN+tQsLWky/J5JOI/r7abibglXfygrZhVO/3u3V+E25kkKTeMkXaQ==", "dev": true, "dependencies": { - "fast-deep-equal": "^3.1.3", - "fast-uri": "^3.0.1", - "json-schema-traverse": "^1.0.0", - "require-from-string": "^2.0.2" + "@tailwindcss/node": "4.3.5", + "@tailwindcss/oxide": "4.3.5", + "tailwindcss": "4.3.5" }, - "funding": { - "type": "github", - "url": "https://github.com/sponsors/epoberezkin" - } - }, - "node_modules/ansi-regex": { - "version": "5.0.1", - "resolved": "https://registry.npmmirror.com/ansi-regex/-/ansi-regex-5.0.1.tgz", - "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", - "dev": true, - "engines": { - "node": ">=8" + "peerDependencies": { + "vite": "^5.2.0 || ^6 || ^7 || ^8" } }, - "node_modules/ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmmirror.com/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "node_modules/@tweenjs/tween.js": { + "version": "25.0.0", + "resolved": "https://registry.npmmirror.com/@tweenjs/tween.js/-/tween.js-25.0.0.tgz", + "integrity": "sha512-XKLA6syeBUaPzx4j3qwMqzzq+V4uo72BnlbOjmuljLrRqdsd3qnzvZZoxvMHZ23ndsRS4aufU6JOZYpCbU6T1A==", + "dev": true + }, + "node_modules/@tybys/wasm-util": { + "version": "0.10.5", + "resolved": "https://registry.npmjs.org/@tybys/wasm-util/-/wasm-util-0.10.5.tgz", + "integrity": "sha512-dOGOPxlaNV+G046mZzN+9C0dAcQZeSKcXiVaM0TYy/LM4ttTmgSBDxYfovcYI8Em3+eAbiAYpvWLOv8+ZVRJKA==", "dev": true, + "license": "MIT", + "optional": true, "dependencies": { - "color-convert": "^2.0.1" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" + "tslib": "^2.4.0" } }, - "node_modules/app-builder-lib": { - "version": "26.15.3", - "resolved": "https://registry.npmmirror.com/app-builder-lib/-/app-builder-lib-26.15.3.tgz", - "integrity": "sha512-2VnyWkqsP5v5XbBhL3tD5Syx8iNPBYsoU7kY4S2fz7wg8Rj/nztWKCUzGKaFRTv0Xwf3/H058CR1Kvtd/3lRow==", + "node_modules/@types/babel__core": { + "version": "7.20.5", + "resolved": "https://registry.npmmirror.com/@types/babel__core/-/babel__core-7.20.5.tgz", + "integrity": "sha512-qoQprZvz5wQFJwMDqeseRXWv3rqMvhgpbXFfVyWhbx9X47POIA6i/+dXefEmZKoAgOaTdaIgNSMqMIU61yRyzA==", "dev": true, "dependencies": { - "@electron/asar": "3.4.1", - "@electron/fuses": "^1.8.0", - "@electron/get": "^3.0.0", - "@electron/notarize": "2.5.0", - "@electron/osx-sign": "1.3.3", - "@electron/rebuild": "^4.0.4", - "@electron/universal": "2.0.3", - "@malept/flatpak-bundler": "^0.4.0", - "@noble/hashes": "^2.2.0", - "@peculiar/webcrypto": "^1.7.1", - "@types/fs-extra": "9.0.13", - "ajv": "^8.18.0", - "asn1js": "^3.0.10", - "async-exit-hook": "^2.0.1", - "builder-util": "26.15.3", - "builder-util-runtime": "9.7.0", - "chromium-pickle-js": "^0.2.0", - "ci-info": "4.3.1", - "debug": "^4.3.4", - "dotenv": "^16.4.5", - "dotenv-expand": "^11.0.6", - "ejs": "^3.1.8", - "electron-publish": "26.15.3", - "fs-extra": "^10.1.0", - "hosted-git-info": "^4.1.0", - "isbinaryfile": "^5.0.0", - "jiti": "^2.4.2", - "js-yaml": "^4.1.0", - "json5": "^2.2.3", - "lazy-val": "^1.0.5", - "minimatch": "^10.2.5", - "pkijs": "^3.4.0", - "plist": "3.1.0", - "proper-lockfile": "^4.1.2", - "resedit": "^1.7.0", - "semver": "~7.7.3", - "tar": "^7.5.7", - "temp-file": "^3.4.0", - "tiny-async-pool": "1.3.0", - "unzipper": "^0.12.3", - "which": "^5.0.0" - }, - "engines": { - "node": ">=14.0.0" - }, - "peerDependencies": { - "dmg-builder": "26.15.3", - "electron-builder-squirrel-windows": "26.15.3" + "@babel/parser": "^7.20.7", + "@babel/types": "^7.20.7", + "@types/babel__generator": "*", + "@types/babel__template": "*", + "@types/babel__traverse": "*" } }, - "node_modules/app-builder-lib/node_modules/ci-info": { - "version": "4.3.1", - "resolved": "https://registry.npmmirror.com/ci-info/-/ci-info-4.3.1.tgz", - "integrity": "sha512-Wdy2Igu8OcBpI2pZePZ5oWjPC38tmDVx5WKUXKwlLYkA0ozo85sLsLvkBbBn/sZaSCMFOGZJ14fvW9t5/d7kdA==", + "node_modules/@types/babel__generator": { + "version": "7.27.0", + "resolved": "https://registry.npmmirror.com/@types/babel__generator/-/babel__generator-7.27.0.tgz", + "integrity": "sha512-ufFd2Xi92OAVPYsy+P4n7/U7e68fex0+Ee8gSG9KX7eo084CWiQ4sdxktvdl0bOPupXtVJPY19zk6EwWqUQ8lg==", "dev": true, - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/sibiraj-s" - } - ], - "engines": { - "node": ">=8" + "dependencies": { + "@babel/types": "^7.0.0" } }, - "node_modules/app-builder-lib/node_modules/semver": { - "version": "7.7.4", - "resolved": "https://registry.npmmirror.com/semver/-/semver-7.7.4.tgz", - "integrity": "sha512-vFKC2IEtQnVhpT78h1Yp8wzwrf8CM+MzKMHGJZfBtzhZNycRFnXsHk6E5TxIkkMsgNS7mdX3AGB7x2QM2di4lA==", + "node_modules/@types/babel__template": { + "version": "7.4.4", + "resolved": "https://registry.npmmirror.com/@types/babel__template/-/babel__template-7.4.4.tgz", + "integrity": "sha512-h/NUaSyG5EyxBIp8YRxo4RMe2/qQgvyowRwVMzhYhBCONbW8PUsg4lkFMrhgZhUe5z3L3MiLDuvyJ/CaPa2A8A==", "dev": true, - "bin": { - "semver": "bin/semver.js" - }, - "engines": { - "node": ">=10" + "dependencies": { + "@babel/parser": "^7.1.0", + "@babel/types": "^7.0.0" } }, - "node_modules/argparse": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/argparse/-/argparse-3.0.3.tgz", - "integrity": "sha512-Sn98ftV3KfsO8xfLPHG6oT8y+b0yvbrLgZjgPDXsharNY15tTAjqIsIju4S32nl6/iEUNNE4v+yL2Zhm8ooP3w==", + "node_modules/@types/babel__traverse": { + "version": "7.28.0", + "resolved": "https://registry.npmmirror.com/@types/babel__traverse/-/babel__traverse-7.28.0.tgz", + "integrity": "sha512-8PvcXf70gTDZBgt9ptxJ8elBeBjcLOAcOtoO/mPJjtji1+CdGbHgm77om1GrsPxsiE+uXIpNSK64UYaIwQXd4Q==", "dev": true, - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/puzrin" - }, - { - "type": "github", - "url": "https://github.com/sponsors/nodeca" - } - ], - "license": "PSF-2.0" + "dependencies": { + "@babel/types": "^7.28.2" + } }, - "node_modules/aria-hidden": { - "version": "1.2.6", - "resolved": "https://registry.npmmirror.com/aria-hidden/-/aria-hidden-1.2.6.tgz", - "integrity": "sha512-ik3ZgC9dY/lYVVM++OISsaYDeg1tb0VtP5uL3ouh1koGOaUMDPpbFIei4JkFimWUFPn90sbMNMXQAIVOlnYKJA==", + "node_modules/@types/debug": { + "version": "4.1.13", + "resolved": "https://registry.npmmirror.com/@types/debug/-/debug-4.1.13.tgz", + "integrity": "sha512-KSVgmQmzMwPlmtljOomayoR89W4FynCAi3E8PPs7vmDVPe84hT+vGPKkJfThkmXs0x0jAaa9U8uW8bbfyS2fWw==", "dev": true, "dependencies": { - "tslib": "^2.0.0" - }, - "engines": { - "node": ">=10" + "@types/ms": "*" } }, - "node_modules/asn1js": { - "version": "3.0.10", - "resolved": "https://registry.npmmirror.com/asn1js/-/asn1js-3.0.10.tgz", - "integrity": "sha512-S2s3aOytiKdFRdulw2qPE51MzjzVOisppcVv7jVFR+Kw0kxwvFrDcYA0h7Ndqbmj0HkMIXYWaoj7fli8kgx1eg==", + "node_modules/@types/dom-webcodecs": { + "version": "0.1.19", + "resolved": "https://registry.npmmirror.com/@types/dom-webcodecs/-/dom-webcodecs-0.1.19.tgz", + "integrity": "sha512-+yFUIDUaASFz0vQpWBErPxun/Lb+F0TdrlTsj50gm7K797YzEx2TmV6fEiwciHyFNghlZYPgQXH5qRcwMHcJFQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/@types/estree": { + "version": "1.0.9", + "resolved": "https://registry.npmmirror.com/@types/estree/-/estree-1.0.9.tgz", + "integrity": "sha512-GhdPgy1el4/ImP05X05Uw4cw2/M93BCUmnEvWZNStlCzEKME4Fkk+YpoA5OiHNQmoS7Cafb8Xa3Pya8m1Qrzeg==", + "dev": true + }, + "node_modules/@types/estree-jsx": { + "version": "1.0.5", + "resolved": "https://registry.npmmirror.com/@types/estree-jsx/-/estree-jsx-1.0.5.tgz", + "integrity": "sha512-52CcUVNFyfb1A2ALocQw/Dd1BQFNmSdkuC3BkZ6iqhdMfQz7JWOFRuJFloOzjk+6WijU56m9oKXFAXc7o3Towg==", "dev": true, "dependencies": { - "pvtsutils": "^1.3.6", - "pvutils": "^1.1.5", - "tslib": "^2.8.1" - }, - "engines": { - "node": ">=12.0.0" + "@types/estree": "*" } }, - "node_modules/assistant-cloud": { - "version": "0.2.13", - "resolved": "https://registry.npmmirror.com/assistant-cloud/-/assistant-cloud-0.2.13.tgz", - "integrity": "sha512-ptR42dXgQ8lx+9mR21/UDRWoaEZr4RjwBoxlDTQUTX+Jvsz/DOOrSDRHZIyOCgns9WTicMXvNWnGYvFyRQd7Uw==", + "node_modules/@types/fs-extra": { + "version": "9.0.13", + "resolved": "https://registry.npmmirror.com/@types/fs-extra/-/fs-extra-9.0.13.tgz", + "integrity": "sha512-nEnwB++1u5lVDM2UI4c1+5R+FYaKfaAzS4OococimjVm3nQw3TuzH5UNsocrcTBbhnerblyHj4A49qXbIiZdpA==", "dev": true, "dependencies": { - "assistant-stream": "^0.3.58" - }, - "peerDependencies": { - "@opentelemetry/api": "^1.9.0", - "@opentelemetry/exporter-trace-otlp-http": ">=0.200.0", - "@opentelemetry/sdk-trace-base": "^2.1.0", - "ai": "^6.0.0 || ^7.0.0" - }, - "peerDependenciesMeta": { - "@opentelemetry/api": { - "optional": true - }, - "@opentelemetry/exporter-trace-otlp-http": { - "optional": true - }, - "@opentelemetry/sdk-trace-base": { - "optional": true - }, - "ai": { - "optional": true - } + "@types/node": "*" } }, - "node_modules/assistant-stream": { - "version": "0.3.58", - "resolved": "https://registry.npmmirror.com/assistant-stream/-/assistant-stream-0.3.58.tgz", - "integrity": "sha512-i3g2FPxq2bC45Ac1J4bDuAJOHga1f7LdkJjw0nl0tEAIjENhZSVI/FjdLI0qxL1XPkMeWDT7IIBtJfnIXw8jZA==", + "node_modules/@types/hast": { + "version": "3.0.5", + "resolved": "https://registry.npmmirror.com/@types/hast/-/hast-3.0.5.tgz", + "integrity": "sha512-rp/ezSWaD1m44dPKICGhiskI13nVr7qTloFwDa/IYkhhf5nzwP+zIQcIJh3WIFSBOy/H1PzB40jPjMDksN4F+g==", "dev": true, "dependencies": { - "@standard-schema/spec": "^1.1.0", - "@types/json-schema": "^7.0.15", - "nanoid": "^6.0.2", - "secure-json-parse": "^4.1.1" - }, - "peerDependencies": { - "ai": "^6.0.0 || ^7.0.0", - "ioredis": "^5.10.1 || ^6.0.0", - "redis": "^5.12.1" - }, - "peerDependenciesMeta": { - "ai": { - "optional": true - }, - "ioredis": { - "optional": true - }, - "redis": { - "optional": true - } + "@types/unist": "*" } }, - "node_modules/assistant-stream/node_modules/nanoid": { - "version": "6.0.2", - "resolved": "https://registry.npmmirror.com/nanoid/-/nanoid-6.0.2.tgz", - "integrity": "sha512-hIvVOb9Qr1p/9CNNLOe0OlWvgx/ziTsVwKN/GDSsuArN2K0wDiafP3s0SWmsm7o2BdnyS8Z9Z64NFBUbn6ziBg==", + "node_modules/@types/json-schema": { + "version": "7.0.15", + "resolved": "https://registry.npmmirror.com/@types/json-schema/-/json-schema-7.0.15.tgz", + "integrity": "sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA==", + "dev": true + }, + "node_modules/@types/mdast": { + "version": "4.0.4", + "resolved": "https://registry.npmmirror.com/@types/mdast/-/mdast-4.0.4.tgz", + "integrity": "sha512-kGaNbPh1k7AFzgpud/gMdvIm5xuECykRR+JnWKQno9TAXVa6WIVCGTPvYGekIDL4uwCZQSYbUxNBSb1aUo79oA==", "dev": true, - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/ai" - } - ], - "bin": { - "nanoid": "bin/nanoid.js" - }, - "engines": { - "node": "^22 || ^24 || >=26" + "dependencies": { + "@types/unist": "*" } }, - "node_modules/async": { - "version": "3.2.6", - "resolved": "https://registry.npmmirror.com/async/-/async-3.2.6.tgz", - "integrity": "sha512-htCUDlxyyCLMgaM3xXg0C0LW2xqfuQ6p05pCEIsXuyQ+a1koYKTuBMzRNwmybfLgvJDMd0r1LTn4+E0Ti6C2AA==", + "node_modules/@types/ms": { + "version": "2.1.0", + "resolved": "https://registry.npmmirror.com/@types/ms/-/ms-2.1.0.tgz", + "integrity": "sha512-GsCCIZDE/p3i96vtEqx+7dBUGXrc7zeSK3wwPHIaRThS+9OhWIXRqzs4d6k1SVU8g91DrNRWxWUGhp5KXQb2VA==", "dev": true }, - "node_modules/async-exit-hook": { - "version": "2.0.1", - "resolved": "https://registry.npmmirror.com/async-exit-hook/-/async-exit-hook-2.0.1.tgz", - "integrity": "sha512-NW2cX8m1Q7KPA7a5M2ULQeZ2wR5qI5PAbw5L0UOMxdioVk9PMZ0h1TmyZEkPYrCvYjDlFICusOu1dlEKAAeXBw==", + "node_modules/@types/node": { + "version": "26.6.3", + "resolved": "https://registry.npmmirror.com/@types/node/-/node-26.6.3.tgz", + "integrity": "sha512-dsqMQQoeTLqu9wynDD00q573mNzso3IdQOAfHRJqLCcmCFPoGo9A1bDpUcv/9tnKpErQWv9uKeGfl37EIS02Yg==", "dev": true, - "engines": { - "node": ">=0.12.0" + "dependencies": { + "undici-types": "~8.9.0" } }, - "node_modules/asynckit": { - "version": "0.4.0", - "resolved": "https://registry.npmmirror.com/asynckit/-/asynckit-0.4.0.tgz", - "integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==", - "dev": true + "node_modules/@types/react": { + "version": "19.3.0", + "resolved": "https://registry.npmmirror.com/@types/react/-/react-19.3.0.tgz", + "integrity": "sha512-N0rFCuH9YoxG9/m61l9MfpJKfmLOVU0em7ipIz6TRgSSkvReLB9vL85GB+yr8Bs5leqpvg96JSwF4ZS1s4viQg==", + "devOptional": true, + "dependencies": { + "csstype": "^3.2.2" + } }, - "node_modules/at-least-node": { - "version": "1.0.0", - "resolved": "https://registry.npmmirror.com/at-least-node/-/at-least-node-1.0.0.tgz", - "integrity": "sha512-+q/t7Ekv1EDY2l6Gda6LLiX14rU9TV20Wa3ofeQmwPFZbOMo9DXrLbOjFaaclkXKWidIaopwAObQDqwWtGUjqg==", + "node_modules/@types/react-dom": { + "version": "19.3.0", + "resolved": "https://registry.npmmirror.com/@types/react-dom/-/react-dom-19.3.0.tgz", + "integrity": "sha512-ZI7bU42mZXXKHn/qNLEw2IrbiINU7X5+vfgdixBHkCNpYWXjKgfQ/P+uyGb5CjOLB9UcnTeg3rylQtV2hym44Q==", "dev": true, - "engines": { - "node": ">= 4.0.0" + "peerDependencies": { + "@types/react": "^19.3.0" } }, - "node_modules/autolinker": { - "version": "4.1.5", - "resolved": "https://registry.npmmirror.com/autolinker/-/autolinker-4.1.5.tgz", - "integrity": "sha512-vEfYZPmvVOIuE567XBVCsx8SBgOYtjB2+S1iAaJ+HgH+DNjAcrHem2hmAeC9yaNGWayicv4yR+9UaJlkF3pvtw==", + "node_modules/@types/trusted-types": { + "version": "2.0.7", + "resolved": "https://registry.npmmirror.com/@types/trusted-types/-/trusted-types-2.0.7.tgz", + "integrity": "sha512-ScaPdn1dQczgbl0QFTeTOmVHFULt394XJgOQNoyVhZ6r2vLnMLJfBPd53SB52T/3G36VI1/g2MZaX0cwDuXsfw==", + "optional": true + }, + "node_modules/@types/unist": { + "version": "3.0.3", + "resolved": "https://registry.npmmirror.com/@types/unist/-/unist-3.0.3.tgz", + "integrity": "sha512-ko/gIFJRv177XgZsZcBwnqJN5x/Gien8qNOn0D5bQU/zAzVf9Zt3BlcUiLqhV9y4ARk0GbT3tnUiPNgnTXzc/Q==", + "dev": true + }, + "node_modules/@types/wicg-file-system-access": { + "version": "2020.9.8", + "resolved": "https://registry.npmmirror.com/@types/wicg-file-system-access/-/wicg-file-system-access-2020.9.8.tgz", + "integrity": "sha512-ggMz8nOygG7d/stpH40WVaNvBwuyYLnrg5Mbyf6bmsj/8+gb6Ei4ZZ9/4PNpcPNTT8th9Q8sM8wYmWGjMWLX/A==", + "dev": true, + "license": "MIT" + }, + "node_modules/@ungap/structured-clone": { + "version": "1.4.0", + "resolved": "https://registry.npmmirror.com/@ungap/structured-clone/-/structured-clone-1.4.0.tgz", + "integrity": "sha512-1mEZtMKPM09vDmQt5y7YvmN2+DFTP7Tg0EWXdic8/C6VRnpb33e4ghisCIE3WZjsE2N8mf+QV1Zqh7ZFYLWInQ==", + "dev": true + }, + "node_modules/@vitejs/plugin-react": { + "version": "5.2.0", + "resolved": "https://registry.npmmirror.com/@vitejs/plugin-react/-/plugin-react-5.2.0.tgz", + "integrity": "sha512-YmKkfhOAi3wsB1PhJq5Scj3GXMn3WvtQ/JC0xoopuHoXSdmtdStOpFrYaT1kie2YgFBcIe64ROzMYRjCrYOdYw==", "dev": true, "dependencies": { - "tslib": "^2.8.1" + "@babel/core": "^7.29.0", + "@babel/plugin-transform-react-jsx-self": "^7.27.1", + "@babel/plugin-transform-react-jsx-source": "^7.27.1", + "@rolldown/pluginutils": "1.0.0-rc.3", + "@types/babel__core": "^7.20.5", + "react-refresh": "^0.18.0" }, "engines": { - "pnpm": ">=10.10.0" + "node": "^20.19.0 || >=22.12.0" + }, + "peerDependencies": { + "vite": "^4.2.0 || ^5.0.0 || ^6.0.0 || ^7.0.0 || ^8.0.0" } }, - "node_modules/aws4": { - "version": "1.13.2", - "resolved": "https://registry.npmmirror.com/aws4/-/aws4-1.13.2.tgz", - "integrity": "sha512-lHe62zvbTB5eEABUVi/AwVh0ZKY9rMMDhmm+eeyuuUQbQ3+J+fONVQOZyj+DdrvD4BY33uYniyRJ4UJIaSKAfw==", + "node_modules/@vitejs/plugin-react/node_modules/@rolldown/pluginutils": { + "version": "1.0.0-rc.3", + "resolved": "https://registry.npmmirror.com/@rolldown/pluginutils/-/pluginutils-1.0.0-rc.3.tgz", + "integrity": "sha512-eybk3TjzzzV97Dlj5c+XrBFW57eTNhzod66y9HrBlzJ6NsCrWCp/2kaPS3K9wJmurBC0Tdw4yPjXKZqlznim3Q==", "dev": true }, - "node_modules/bail": { - "version": "2.0.2", - "resolved": "https://registry.npmmirror.com/bail/-/bail-2.0.2.tgz", - "integrity": "sha512-0xO6mYd7JB2YesxDKplafRpsiOzPt9V02ddPCLbY1xYGPOX24NTyN50qnUxgCPcSoYMhKpAuBTjQoRZCAkUDRw==", + "node_modules/@xmldom/xmldom": { + "version": "0.8.15", + "resolved": "https://registry.npmmirror.com/@xmldom/xmldom/-/xmldom-0.8.15.tgz", + "integrity": "sha512-/5NV/vDALVFDXgLmfsy9TRCBlKwO2LNBFzpzvb9iIj+jR+eSc6DLYYvVOdivT/jm7MtU6TebYuRmzEOI7w40UA==", "dev": true, - "funding": { - "type": "github", - "url": "https://github.com/sponsors/wooorm" + "engines": { + "node": ">=10.0.0" } }, - "node_modules/balanced-match": { - "version": "4.0.4", - "resolved": "https://registry.npmmirror.com/balanced-match/-/balanced-match-4.0.4.tgz", - "integrity": "sha512-BLrgEcRTwX2o6gGxGOCNyMvGSp35YofuYzw9h1IMTRmKqttAZZVU67bdb9Pr2vUHA8+j3i2tJfjO6C6+4myGTA==", + "node_modules/@zip.js/zip.js": { + "version": "2.22.0", + "resolved": "https://registry.npmmirror.com/@zip.js/zip.js/-/zip.js-2.22.0.tgz", + "integrity": "sha512-QgkA+BSEPNR0C2l6xbSu5HDXieUxiuDK+Jx4ZeZlp22QO/qRUIF6JRXdxh4WlLiQUmnE/9aaGerlni+OY81wqg==", "dev": true, "engines": { - "node": "18 || 20 || >=22" + "bun": ">=0.7.0", + "deno": ">=1.0.0", + "node": ">=18.0.0" } }, - "node_modules/base64-js": { - "version": "1.5.1", - "resolved": "https://registry.npmmirror.com/base64-js/-/base64-js-1.5.1.tgz", - "integrity": "sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==", + "node_modules/abbrev": { + "version": "4.0.0", + "resolved": "https://registry.npmmirror.com/abbrev/-/abbrev-4.0.0.tgz", + "integrity": "sha512-a1wflyaL0tHtJSmLSOVybYhy22vRih4eduhhrkcjgrWGnRfrZtovJ2FRjxuTtkkj47O/baf0R86QU5OuYpz8fA==", "dev": true, - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ] + "engines": { + "node": "^20.17.0 || >=22.9.0" + } }, - "node_modules/baseline-browser-mapping": { - "version": "2.11.26", - "resolved": "https://registry.npmmirror.com/baseline-browser-mapping/-/baseline-browser-mapping-2.11.26.tgz", - "integrity": "sha512-GLQdD3y6UF8iVuMJl5fHgE4jdn/ua7n+toKfLgNlg3BqQtOZjpy68T8Tup8/wGWZCDlm7KMg7tPb4MPn7oN0TQ==", + "node_modules/agent-base": { + "version": "7.1.4", + "resolved": "https://registry.npmmirror.com/agent-base/-/agent-base-7.1.4.tgz", + "integrity": "sha512-MnA+YT8fwfJPgBx3m60MNqakm30XOkyIoH1y6huTQvC0PwZG7ki8NacLBcrPbNoo8vEZy7Jpuk7+jMO+CUovTQ==", "dev": true, - "bin": { - "baseline-browser-mapping": "dist/cli.cjs" - }, "engines": { - "node": ">=6.0.0" + "node": ">= 14" } }, - "node_modules/bcp-47": { - "version": "2.1.2", - "resolved": "https://registry.npmmirror.com/bcp-47/-/bcp-47-2.1.2.tgz", - "integrity": "sha512-wsv86UuNFuPnVieKLyECTT+CP1WSAHeoIg5P3xu2kA9Z+7fVPoKt7dxzSeEhtJel0AI+NW3fIW3KtTKQKUCngg==", + "node_modules/ajv": { + "version": "8.20.0", + "resolved": "https://registry.npmmirror.com/ajv/-/ajv-8.20.0.tgz", + "integrity": "sha512-Thbli+OlOj+iMPYFBVBfJ3OmCAnaSyNn4M1vz9T6Gka5Jt9ba/HIR56joy65tY6kx/FCF5VXNB819Y7/GUrBGA==", "dev": true, "dependencies": { - "is-alphabetical": "^2.0.0", - "is-alphanumerical": "^2.0.0", - "is-decimal": "^2.0.0" + "fast-deep-equal": "^3.1.3", + "fast-uri": "^3.0.1", + "json-schema-traverse": "^1.0.0", + "require-from-string": "^2.0.2" }, "funding": { "type": "github", - "url": "https://github.com/sponsors/wooorm" - } - }, - "node_modules/bcp-47-match": { - "version": "2.0.3", - "resolved": "https://registry.npmmirror.com/bcp-47-match/-/bcp-47-match-2.0.3.tgz", - "integrity": "sha512-JtTezzbAibu8G0R9op9zb3vcWZd9JF6M0xOYGPn0fNCd7wOpRB1mU2mH9T8gaBGbAAyIIVgB2G7xG0GP98zMAQ==", - "dev": true, - "funding": { - "type": "github", - "url": "https://github.com/sponsors/wooorm" + "url": "https://github.com/sponsors/epoberezkin" } }, - "node_modules/bitmap-sdf": { - "version": "1.0.4", - "resolved": "https://registry.npmmirror.com/bitmap-sdf/-/bitmap-sdf-1.0.4.tgz", - "integrity": "sha512-1G3U4n5JE6RAiALMxu0p1XmeZkTeCwGKykzsLTCqVzfSDaN6S7fKnkIkfejogz+iwqBWc0UYAIKnKHNN7pSfDg==", - "dev": true - }, - "node_modules/bluebird": { - "version": "3.7.2", - "resolved": "https://registry.npmmirror.com/bluebird/-/bluebird-3.7.2.tgz", - "integrity": "sha512-XpNj6GDQzdfW+r2Wnn7xiSAd7TM3jzkxGXBGTtWKuSXv1xUV+azxAm8jdWZN06QTQk+2N2XB9jRDkvbmQmcRtg==", - "dev": true - }, - "node_modules/brace-expansion": { - "version": "5.0.12", - "resolved": "https://registry.npmmirror.com/brace-expansion/-/brace-expansion-5.0.12.tgz", - "integrity": "sha512-YovQ3rzhaLMIrDjNDMkNS01tea93qhEhG5xy8f6+R0l+dw3Ki+5sCoIoI942iuLZTHWogWktgwVDhU09iNEimQ==", + "node_modules/ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmmirror.com/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", "dev": true, - "dependencies": { - "balanced-match": "^4.0.2" - }, "engines": { - "node": "20 || >=22" + "node": ">=8" } }, - "node_modules/browserslist": { - "version": "4.29.3", - "resolved": "https://registry.npmmirror.com/browserslist/-/browserslist-4.29.3.tgz", - "integrity": "sha512-1R4kiYKXGViqEN0CnoDrXc1StD9niAwu+j2dukWzrD4bJgsD4lDmEp0CRbc6E/vYJIfTHwPmwyaKtVSudICdPA==", + "node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmmirror.com/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", "dev": true, - "funding": [ - { - "type": "opencollective", - "url": "https://opencollective.com/browserslist" - }, - { - "type": "tidelift", - "url": "https://tidelift.com/funding/github/npm/browserslist" - }, - { - "type": "github", - "url": "https://github.com/sponsors/ai" - } - ], "dependencies": { - "baseline-browser-mapping": "^2.11.26", - "caniuse-lite": "^1.0.30001813", - "electron-to-chromium": "^1.5.439", - "node-releases": "^2.0.57", - "update-browserslist-db": "^1.3.3" - }, - "bin": { - "browserslist": "cli.js" + "color-convert": "^2.0.1" }, "engines": { - "node": "^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7" + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" } }, - "node_modules/buffer-from": { - "version": "1.1.2", - "resolved": "https://registry.npmmirror.com/buffer-from/-/buffer-from-1.1.2.tgz", - "integrity": "sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==", - "dev": true - }, - "node_modules/builder-util": { + "node_modules/app-builder-lib": { "version": "26.15.3", - "resolved": "https://registry.npmmirror.com/builder-util/-/builder-util-26.15.3.tgz", - "integrity": "sha512-q2hn7Mbo2nFNkVekPiHFx6Nfo3hURmES3tfBn+k5Pqxl2RkmP3QGqZUhH/q9Pch/4G05NRhPjDlVj1O8q4Txvw==", + "resolved": "https://registry.npmmirror.com/app-builder-lib/-/app-builder-lib-26.15.3.tgz", + "integrity": "sha512-2VnyWkqsP5v5XbBhL3tD5Syx8iNPBYsoU7kY4S2fz7wg8Rj/nztWKCUzGKaFRTv0Xwf3/H058CR1Kvtd/3lRow==", "dev": true, "dependencies": { - "@types/debug": "^4.1.6", + "@electron/asar": "3.4.1", + "@electron/fuses": "^1.8.0", + "@electron/get": "^3.0.0", + "@electron/notarize": "2.5.0", + "@electron/osx-sign": "1.3.3", + "@electron/rebuild": "^4.0.4", + "@electron/universal": "2.0.3", + "@malept/flatpak-bundler": "^0.4.0", + "@noble/hashes": "^2.2.0", + "@peculiar/webcrypto": "^1.7.1", + "@types/fs-extra": "9.0.13", + "ajv": "^8.18.0", + "asn1js": "^3.0.10", + "async-exit-hook": "^2.0.1", + "builder-util": "26.15.3", "builder-util-runtime": "9.7.0", - "chalk": "^4.1.2", - "cross-spawn": "^7.0.6", + "chromium-pickle-js": "^0.2.0", + "ci-info": "4.3.1", "debug": "^4.3.4", + "dotenv": "^16.4.5", + "dotenv-expand": "^11.0.6", + "ejs": "^3.1.8", + "electron-publish": "26.15.3", "fs-extra": "^10.1.0", - "http-proxy-agent": "^7.0.0", - "https-proxy-agent": "^7.0.0", + "hosted-git-info": "^4.1.0", + "isbinaryfile": "^5.0.0", + "jiti": "^2.4.2", "js-yaml": "^4.1.0", - "sanitize-filename": "^1.6.3", - "source-map-support": "^0.5.19", - "stat-mode": "^1.0.0", + "json5": "^2.2.3", + "lazy-val": "^1.0.5", + "minimatch": "^10.2.5", + "pkijs": "^3.4.0", + "plist": "3.1.0", + "proper-lockfile": "^4.1.2", + "resedit": "^1.7.0", + "semver": "~7.7.3", + "tar": "^7.5.7", "temp-file": "^3.4.0", - "tiny-async-pool": "1.3.0" + "tiny-async-pool": "1.3.0", + "unzipper": "^0.12.3", + "which": "^5.0.0" }, "engines": { "node": ">=14.0.0" - } - }, - "node_modules/builder-util-runtime": { - "version": "9.7.0", - "resolved": "https://registry.npmmirror.com/builder-util-runtime/-/builder-util-runtime-9.7.0.tgz", - "integrity": "sha512-g/kR520giAFYkSXTzcmF3kqQq7wi8F6N6SzeDgZrqTBN+VHdmgWOyTdD1yD7AATDId/yXLvuP34CxW46/BwCdw==", - "dev": true, - "dependencies": { - "debug": "^4.3.4", - "sax": "^1.2.4" }, - "engines": { - "node": ">=12.0.0" - } - }, - "node_modules/bytestreamjs": { - "version": "2.0.1", - "resolved": "https://registry.npmmirror.com/bytestreamjs/-/bytestreamjs-2.0.1.tgz", - "integrity": "sha512-U1Z/ob71V/bXfVABvNr/Kumf5VyeQRBEm6Txb0PQ6S7V5GpBM3w4Cbqz/xPDicR5tN0uvDifng8C+5qECeGwyQ==", - "dev": true, - "engines": { - "node": ">=6.0.0" + "peerDependencies": { + "dmg-builder": "26.15.3", + "electron-builder-squirrel-windows": "26.15.3" } }, - "node_modules/cac": { - "version": "6.7.14", - "resolved": "https://registry.npmmirror.com/cac/-/cac-6.7.14.tgz", - "integrity": "sha512-b6Ilus+c3RrdDk+JhLKUAQfzzgLEPy6wcXqS7f/xe1EETvsDP6GORG7SFuOs6cID5YkqchW/LXZbX5bc8j7ZcQ==", + "node_modules/app-builder-lib/node_modules/ci-info": { + "version": "4.3.1", + "resolved": "https://registry.npmmirror.com/ci-info/-/ci-info-4.3.1.tgz", + "integrity": "sha512-Wdy2Igu8OcBpI2pZePZ5oWjPC38tmDVx5WKUXKwlLYkA0ozo85sLsLvkBbBn/sZaSCMFOGZJ14fvW9t5/d7kdA==", "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/sibiraj-s" + } + ], "engines": { "node": ">=8" } }, - "node_modules/call-bind-apply-helpers": { - "version": "1.0.2", - "resolved": "https://registry.npmmirror.com/call-bind-apply-helpers/-/call-bind-apply-helpers-1.0.2.tgz", - "integrity": "sha512-Sp1ablJ0ivDkSzjcaJdxEunN5/XvksFJ2sMBFfq6x0ryhQV/2b/KwFe21cMpmHtPOSij8K99/wSfoEuTObmuMQ==", + "node_modules/app-builder-lib/node_modules/semver": { + "version": "7.7.4", + "resolved": "https://registry.npmmirror.com/semver/-/semver-7.7.4.tgz", + "integrity": "sha512-vFKC2IEtQnVhpT78h1Yp8wzwrf8CM+MzKMHGJZfBtzhZNycRFnXsHk6E5TxIkkMsgNS7mdX3AGB7x2QM2di4lA==", "dev": true, - "dependencies": { - "es-errors": "^1.3.0", - "function-bind": "^1.1.2" + "bin": { + "semver": "bin/semver.js" }, "engines": { - "node": ">= 0.4" + "node": ">=10" } }, - "node_modules/caniuse-lite": { - "version": "1.0.30001814", - "resolved": "https://registry.npmmirror.com/caniuse-lite/-/caniuse-lite-1.0.30001814.tgz", - "integrity": "sha512-/Uaf1lAzr59XcMpW0o96WoEfr+VXK2OX4U9AgFoiSHsVJ4HppnIFUjtYzsyDH2+tgANaQb2/oxYGwCPapN1FpA==", + "node_modules/argparse": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-3.0.3.tgz", + "integrity": "sha512-Sn98ftV3KfsO8xfLPHG6oT8y+b0yvbrLgZjgPDXsharNY15tTAjqIsIju4S32nl6/iEUNNE4v+yL2Zhm8ooP3w==", "dev": true, "funding": [ { - "type": "opencollective", - "url": "https://opencollective.com/browserslist" - }, - { - "type": "tidelift", - "url": "https://tidelift.com/funding/github/npm/caniuse-lite" + "type": "github", + "url": "https://github.com/sponsors/puzrin" }, { "type": "github", - "url": "https://github.com/sponsors/ai" + "url": "https://github.com/sponsors/nodeca" } - ] - }, - "node_modules/ccount": { - "version": "2.0.1", - "resolved": "https://registry.npmmirror.com/ccount/-/ccount-2.0.1.tgz", - "integrity": "sha512-eyrF0jiFpY+3drT6383f1qhkbGsLSifNAjA61IUjZjmLCWjItY6LB9ft9YhoDgwfmclB2zhu51Lc7+95b8NRAg==", - "dev": true, - "funding": { - "type": "github", - "url": "https://github.com/sponsors/wooorm" - } + ], + "license": "PSF-2.0" }, - "node_modules/cesium": { - "version": "1.145.0", - "resolved": "https://registry.npmmirror.com/cesium/-/cesium-1.145.0.tgz", - "integrity": "sha512-6Azix8b5LPpoVSx8XQ6zPztpluJVmq+CEO3W2rOWxtc6bri6Nc9MvCYhKmTW1LAEwfisV7yzNgfulCXw9842+g==", + "node_modules/aria-hidden": { + "version": "1.2.6", + "resolved": "https://registry.npmmirror.com/aria-hidden/-/aria-hidden-1.2.6.tgz", + "integrity": "sha512-ik3ZgC9dY/lYVVM++OISsaYDeg1tb0VtP5uL3ouh1koGOaUMDPpbFIei4JkFimWUFPn90sbMNMXQAIVOlnYKJA==", "dev": true, - "workspaces": [ - "packages/engine", - "packages/widgets", - "packages/sandcastle" - ], "dependencies": { - "@cesium/engine": "^26.3.0", - "@cesium/widgets": "^16.2.0", - "protobufjs": "^8.8.0" + "tslib": "^2.0.0" }, "engines": { - "node": ">=22.0.0" + "node": ">=10" } }, - "node_modules/chalk": { - "version": "4.1.2", - "resolved": "https://registry.npmmirror.com/chalk/-/chalk-4.1.2.tgz", - "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "node_modules/asn1js": { + "version": "3.0.10", + "resolved": "https://registry.npmmirror.com/asn1js/-/asn1js-3.0.10.tgz", + "integrity": "sha512-S2s3aOytiKdFRdulw2qPE51MzjzVOisppcVv7jVFR+Kw0kxwvFrDcYA0h7Ndqbmj0HkMIXYWaoj7fli8kgx1eg==", "dev": true, "dependencies": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" + "pvtsutils": "^1.3.6", + "pvutils": "^1.1.5", + "tslib": "^2.8.1" }, "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/chalk?sponsor=1" - } - }, - "node_modules/character-entities": { - "version": "2.0.2", - "resolved": "https://registry.npmmirror.com/character-entities/-/character-entities-2.0.2.tgz", - "integrity": "sha512-shx7oQ0Awen/BRIdkjkvz54PnEEI/EjwXDSIZp86/KKdbafHh1Df/RYGBhn4hbe2+uKC9FnT5UCEdyPz3ai9hQ==", - "dev": true, - "funding": { - "type": "github", - "url": "https://github.com/sponsors/wooorm" - } - }, - "node_modules/character-entities-html4": { - "version": "2.1.0", - "resolved": "https://registry.npmmirror.com/character-entities-html4/-/character-entities-html4-2.1.0.tgz", - "integrity": "sha512-1v7fgQRj6hnSwFpq1Eu0ynr/CDEw0rXo2B61qXrLNdHZmPKgb7fqS1a2JwF0rISo9q77jDI8VMEHoApn8qDoZA==", - "dev": true, - "funding": { - "type": "github", - "url": "https://github.com/sponsors/wooorm" - } - }, - "node_modules/character-entities-legacy": { - "version": "3.0.0", - "resolved": "https://registry.npmmirror.com/character-entities-legacy/-/character-entities-legacy-3.0.0.tgz", - "integrity": "sha512-RpPp0asT/6ufRm//AJVwpViZbGM/MkjQFxJccQRHmISF/22NBtsHqAWmL+/pmkPWoIUJdWyeVleTl1wydHATVQ==", - "dev": true, - "funding": { - "type": "github", - "url": "https://github.com/sponsors/wooorm" + "node": ">=12.0.0" } }, - "node_modules/character-reference-invalid": { - "version": "2.0.1", - "resolved": "https://registry.npmmirror.com/character-reference-invalid/-/character-reference-invalid-2.0.1.tgz", - "integrity": "sha512-iBZ4F4wRbyORVsu0jPV7gXkOsGYjGHPmAyv+HiHG8gi5PtC9KI2j1+v8/tlibRvjoWX027ypmG/n0HtO5t7unw==", + "node_modules/assistant-cloud": { + "version": "0.2.13", + "resolved": "https://registry.npmmirror.com/assistant-cloud/-/assistant-cloud-0.2.13.tgz", + "integrity": "sha512-ptR42dXgQ8lx+9mR21/UDRWoaEZr4RjwBoxlDTQUTX+Jvsz/DOOrSDRHZIyOCgns9WTicMXvNWnGYvFyRQd7Uw==", "dev": true, - "funding": { - "type": "github", - "url": "https://github.com/sponsors/wooorm" + "dependencies": { + "assistant-stream": "^0.3.58" + }, + "peerDependencies": { + "@opentelemetry/api": "^1.9.0", + "@opentelemetry/exporter-trace-otlp-http": ">=0.200.0", + "@opentelemetry/sdk-trace-base": "^2.1.0", + "ai": "^6.0.0 || ^7.0.0" + }, + "peerDependenciesMeta": { + "@opentelemetry/api": { + "optional": true + }, + "@opentelemetry/exporter-trace-otlp-http": { + "optional": true + }, + "@opentelemetry/sdk-trace-base": { + "optional": true + }, + "ai": { + "optional": true + } } }, - "node_modules/chownr": { - "version": "3.0.0", - "resolved": "https://registry.npmmirror.com/chownr/-/chownr-3.0.0.tgz", - "integrity": "sha512-+IxzY9BZOQd/XuYPRmrvEVjF/nqj5kgT4kEq7VofrDoM1MxoRjEWkrCC3EtLi59TVawxTAn+orJwFQcrqEN1+g==", + "node_modules/assistant-stream": { + "version": "0.3.58", + "resolved": "https://registry.npmmirror.com/assistant-stream/-/assistant-stream-0.3.58.tgz", + "integrity": "sha512-i3g2FPxq2bC45Ac1J4bDuAJOHga1f7LdkJjw0nl0tEAIjENhZSVI/FjdLI0qxL1XPkMeWDT7IIBtJfnIXw8jZA==", "dev": true, - "engines": { - "node": ">=18" + "dependencies": { + "@standard-schema/spec": "^1.1.0", + "@types/json-schema": "^7.0.15", + "nanoid": "^6.0.2", + "secure-json-parse": "^4.1.1" + }, + "peerDependencies": { + "ai": "^6.0.0 || ^7.0.0", + "ioredis": "^5.10.1 || ^6.0.0", + "redis": "^5.12.1" + }, + "peerDependenciesMeta": { + "ai": { + "optional": true + }, + "ioredis": { + "optional": true + }, + "redis": { + "optional": true + } } }, - "node_modules/chromium-pickle-js": { - "version": "0.2.0", - "resolved": "https://registry.npmmirror.com/chromium-pickle-js/-/chromium-pickle-js-0.2.0.tgz", - "integrity": "sha512-1R5Fho+jBq0DDydt+/vHWj5KJNJCKdARKOCwZUen84I5BreWoLqRLANH1U87eJy1tiASPtMnGqJJq0ZsLoRPOw==", - "dev": true - }, - "node_modules/ci-info": { - "version": "4.4.0", - "resolved": "https://registry.npmmirror.com/ci-info/-/ci-info-4.4.0.tgz", - "integrity": "sha512-77PSwercCZU2Fc4sX94eF8k8Pxte6JAwL4/ICZLFjJLqegs7kCuAsqqj/70NQF6TvDpgFjkubQB2FW2ZZddvQg==", + "node_modules/assistant-stream/node_modules/nanoid": { + "version": "6.0.2", + "resolved": "https://registry.npmmirror.com/nanoid/-/nanoid-6.0.2.tgz", + "integrity": "sha512-hIvVOb9Qr1p/9CNNLOe0OlWvgx/ziTsVwKN/GDSsuArN2K0wDiafP3s0SWmsm7o2BdnyS8Z9Z64NFBUbn6ziBg==", "dev": true, "funding": [ { "type": "github", - "url": "https://github.com/sponsors/sibiraj-s" + "url": "https://github.com/sponsors/ai" } ], - "engines": { - "node": ">=8" - } - }, - "node_modules/class-variance-authority": { - "version": "0.7.1", - "resolved": "https://registry.npmmirror.com/class-variance-authority/-/class-variance-authority-0.7.1.tgz", - "integrity": "sha512-Ka+9Trutv7G8M6WT6SeiRWz792K5qEqIGEGzXKhAE6xOWAY6pPH8U+9IY3oCMv6kqTmLsv7Xh/2w2RigkePMsg==", - "dev": true, - "dependencies": { - "clsx": "^2.1.1" + "bin": { + "nanoid": "bin/nanoid.js" }, - "funding": { - "url": "https://polar.sh/cva" + "engines": { + "node": "^22 || ^24 || >=26" } }, - "node_modules/classnames": { - "version": "2.5.1", - "resolved": "https://registry.npmmirror.com/classnames/-/classnames-2.5.1.tgz", - "integrity": "sha512-saHYOzhIQs6wy2sVxTM6bUDsQO4F50V9RQ22qBpEdCW+I+/Wmke2HOl6lS6dTpdxVhb88/I6+Hs+438c3lfUow==", + "node_modules/async": { + "version": "3.2.6", + "resolved": "https://registry.npmmirror.com/async/-/async-3.2.6.tgz", + "integrity": "sha512-htCUDlxyyCLMgaM3xXg0C0LW2xqfuQ6p05pCEIsXuyQ+a1koYKTuBMzRNwmybfLgvJDMd0r1LTn4+E0Ti6C2AA==", "dev": true }, - "node_modules/cliui": { - "version": "8.0.1", - "resolved": "https://registry.npmmirror.com/cliui/-/cliui-8.0.1.tgz", - "integrity": "sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ==", + "node_modules/async-exit-hook": { + "version": "2.0.1", + "resolved": "https://registry.npmmirror.com/async-exit-hook/-/async-exit-hook-2.0.1.tgz", + "integrity": "sha512-NW2cX8m1Q7KPA7a5M2ULQeZ2wR5qI5PAbw5L0UOMxdioVk9PMZ0h1TmyZEkPYrCvYjDlFICusOu1dlEKAAeXBw==", "dev": true, - "dependencies": { - "string-width": "^4.2.0", - "strip-ansi": "^6.0.1", - "wrap-ansi": "^7.0.0" - }, "engines": { - "node": ">=12" + "node": ">=0.12.0" } }, - "node_modules/clsx": { - "version": "2.1.1", - "resolved": "https://registry.npmmirror.com/clsx/-/clsx-2.1.1.tgz", - "integrity": "sha512-eYm0QWBtUrBWZWG0d386OGAw16Z995PiOVo2B7bjWSbHedGl5e0ZWaq65kOGgUSNesEIDkB9ISbTg/JK9dhCZA==", + "node_modules/asynckit": { + "version": "0.4.0", + "resolved": "https://registry.npmmirror.com/asynckit/-/asynckit-0.4.0.tgz", + "integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==", + "dev": true + }, + "node_modules/at-least-node": { + "version": "1.0.0", + "resolved": "https://registry.npmmirror.com/at-least-node/-/at-least-node-1.0.0.tgz", + "integrity": "sha512-+q/t7Ekv1EDY2l6Gda6LLiX14rU9TV20Wa3ofeQmwPFZbOMo9DXrLbOjFaaclkXKWidIaopwAObQDqwWtGUjqg==", "dev": true, "engines": { - "node": ">=6" + "node": ">= 4.0.0" } }, - "node_modules/color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmmirror.com/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "node_modules/autolinker": { + "version": "4.1.5", + "resolved": "https://registry.npmmirror.com/autolinker/-/autolinker-4.1.5.tgz", + "integrity": "sha512-vEfYZPmvVOIuE567XBVCsx8SBgOYtjB2+S1iAaJ+HgH+DNjAcrHem2hmAeC9yaNGWayicv4yR+9UaJlkF3pvtw==", "dev": true, "dependencies": { - "color-name": "~1.1.4" + "tslib": "^2.8.1" }, "engines": { - "node": ">=7.0.0" + "pnpm": ">=10.10.0" } }, - "node_modules/color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmmirror.com/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "node_modules/aws4": { + "version": "1.13.2", + "resolved": "https://registry.npmmirror.com/aws4/-/aws4-1.13.2.tgz", + "integrity": "sha512-lHe62zvbTB5eEABUVi/AwVh0ZKY9rMMDhmm+eeyuuUQbQ3+J+fONVQOZyj+DdrvD4BY33uYniyRJ4UJIaSKAfw==", "dev": true }, - "node_modules/combined-stream": { - "version": "1.0.8", - "resolved": "https://registry.npmmirror.com/combined-stream/-/combined-stream-1.0.8.tgz", - "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==", - "dev": true, - "dependencies": { - "delayed-stream": "~1.0.0" - }, - "engines": { - "node": ">= 0.8" - } - }, - "node_modules/comma-separated-tokens": { - "version": "2.0.3", - "resolved": "https://registry.npmmirror.com/comma-separated-tokens/-/comma-separated-tokens-2.0.3.tgz", - "integrity": "sha512-Fu4hJdvzeylCfQPp9SGWidpzrMs7tTrlu6Vb8XGaRGck8QSNZJJp538Wrb60Lax4fPwR64ViY468OIUTbRlGZg==", + "node_modules/bail": { + "version": "2.0.2", + "resolved": "https://registry.npmmirror.com/bail/-/bail-2.0.2.tgz", + "integrity": "sha512-0xO6mYd7JB2YesxDKplafRpsiOzPt9V02ddPCLbY1xYGPOX24NTyN50qnUxgCPcSoYMhKpAuBTjQoRZCAkUDRw==", "dev": true, "funding": { "type": "github", "url": "https://github.com/sponsors/wooorm" } }, - "node_modules/commander": { - "version": "2.20.3", - "resolved": "https://registry.npmmirror.com/commander/-/commander-2.20.3.tgz", - "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==", - "dev": true - }, - "node_modules/compare-version": { - "version": "0.1.2", - "resolved": "https://registry.npmmirror.com/compare-version/-/compare-version-0.1.2.tgz", - "integrity": "sha512-pJDh5/4wrEnXX/VWRZvruAGHkzKdr46z11OlTPN+VrATlWWhSKewNCJ1futCO5C7eJB3nPMFZA1LeYtcFboZ2A==", + "node_modules/balanced-match": { + "version": "4.0.4", + "resolved": "https://registry.npmmirror.com/balanced-match/-/balanced-match-4.0.4.tgz", + "integrity": "sha512-BLrgEcRTwX2o6gGxGOCNyMvGSp35YofuYzw9h1IMTRmKqttAZZVU67bdb9Pr2vUHA8+j3i2tJfjO6C6+4myGTA==", "dev": true, "engines": { - "node": ">=0.10.0" + "node": "18 || 20 || >=22" } }, - "node_modules/convert-source-map": { - "version": "2.0.0", - "resolved": "https://registry.npmmirror.com/convert-source-map/-/convert-source-map-2.0.0.tgz", - "integrity": "sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg==", - "dev": true + "node_modules/base64-js": { + "version": "1.5.1", + "resolved": "https://registry.npmmirror.com/base64-js/-/base64-js-1.5.1.tgz", + "integrity": "sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ] }, - "node_modules/core-js": { - "version": "3.50.0", - "resolved": "https://registry.npmmirror.com/core-js/-/core-js-3.50.0.tgz", - "integrity": "sha512-BRWgOLKkFeCgRudR6zrs8p9XJZcE14grzKMMssoYrk6krtuEZ7MTKPIY5RzOnqsEKIR9kst7wNzphttraT+Yqw==", - "hasInstallScript": true, - "engines": { - "node": "*" + "node_modules/baseline-browser-mapping": { + "version": "2.11.26", + "resolved": "https://registry.npmmirror.com/baseline-browser-mapping/-/baseline-browser-mapping-2.11.26.tgz", + "integrity": "sha512-GLQdD3y6UF8iVuMJl5fHgE4jdn/ua7n+toKfLgNlg3BqQtOZjpy68T8Tup8/wGWZCDlm7KMg7tPb4MPn7oN0TQ==", + "dev": true, + "bin": { + "baseline-browser-mapping": "dist/cli.cjs" }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/core-js" + "engines": { + "node": ">=6.0.0" } }, - "node_modules/core-util-is": { - "version": "1.0.3", - "resolved": "https://registry.npmmirror.com/core-util-is/-/core-util-is-1.0.3.tgz", - "integrity": "sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ==", - "dev": true - }, - "node_modules/cross-dirname": { - "version": "0.1.0", - "resolved": "https://registry.npmmirror.com/cross-dirname/-/cross-dirname-0.1.0.tgz", - "integrity": "sha512-+R08/oI0nl3vfPcqftZRpytksBXDzOUveBq/NBVx0sUp1axwzPQrKinNx5yd5sxPu8j1wIy8AfnVQ+5eFdha6Q==", - "dev": true, - "optional": true, - "peer": true - }, - "node_modules/cross-spawn": { - "version": "7.0.6", - "resolved": "https://registry.npmmirror.com/cross-spawn/-/cross-spawn-7.0.6.tgz", - "integrity": "sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA==", + "node_modules/bcp-47": { + "version": "2.1.2", + "resolved": "https://registry.npmmirror.com/bcp-47/-/bcp-47-2.1.2.tgz", + "integrity": "sha512-wsv86UuNFuPnVieKLyECTT+CP1WSAHeoIg5P3xu2kA9Z+7fVPoKt7dxzSeEhtJel0AI+NW3fIW3KtTKQKUCngg==", "dev": true, "dependencies": { - "path-key": "^3.1.0", - "shebang-command": "^2.0.0", - "which": "^2.0.1" + "is-alphabetical": "^2.0.0", + "is-alphanumerical": "^2.0.0", + "is-decimal": "^2.0.0" }, - "engines": { - "node": ">= 8" + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" } }, - "node_modules/cross-spawn/node_modules/isexe": { - "version": "2.0.0", - "resolved": "https://registry.npmmirror.com/isexe/-/isexe-2.0.0.tgz", - "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==", + "node_modules/bcp-47-match": { + "version": "2.0.3", + "resolved": "https://registry.npmmirror.com/bcp-47-match/-/bcp-47-match-2.0.3.tgz", + "integrity": "sha512-JtTezzbAibu8G0R9op9zb3vcWZd9JF6M0xOYGPn0fNCd7wOpRB1mU2mH9T8gaBGbAAyIIVgB2G7xG0GP98zMAQ==", + "dev": true, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, + "node_modules/bitmap-sdf": { + "version": "1.0.4", + "resolved": "https://registry.npmmirror.com/bitmap-sdf/-/bitmap-sdf-1.0.4.tgz", + "integrity": "sha512-1G3U4n5JE6RAiALMxu0p1XmeZkTeCwGKykzsLTCqVzfSDaN6S7fKnkIkfejogz+iwqBWc0UYAIKnKHNN7pSfDg==", "dev": true }, - "node_modules/cross-spawn/node_modules/which": { - "version": "2.0.2", - "resolved": "https://registry.npmmirror.com/which/-/which-2.0.2.tgz", - "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", + "node_modules/bluebird": { + "version": "3.7.2", + "resolved": "https://registry.npmmirror.com/bluebird/-/bluebird-3.7.2.tgz", + "integrity": "sha512-XpNj6GDQzdfW+r2Wnn7xiSAd7TM3jzkxGXBGTtWKuSXv1xUV+azxAm8jdWZN06QTQk+2N2XB9jRDkvbmQmcRtg==", + "dev": true + }, + "node_modules/brace-expansion": { + "version": "5.0.12", + "resolved": "https://registry.npmmirror.com/brace-expansion/-/brace-expansion-5.0.12.tgz", + "integrity": "sha512-YovQ3rzhaLMIrDjNDMkNS01tea93qhEhG5xy8f6+R0l+dw3Ki+5sCoIoI942iuLZTHWogWktgwVDhU09iNEimQ==", "dev": true, "dependencies": { - "isexe": "^2.0.0" - }, - "bin": { - "node-which": "bin/node-which" + "balanced-match": "^4.0.2" }, "engines": { - "node": ">= 8" + "node": "20 || >=22" } }, - "node_modules/csstype": { - "version": "3.2.3", - "resolved": "https://registry.npmmirror.com/csstype/-/csstype-3.2.3.tgz", - "integrity": "sha512-z1HGKcYy2xA8AGQfwrn0PAy+PB7X/GSj3UVJW9qKyn43xWa+gl5nXmU4qqLMRzWVLFC8KusUX8T/0kCiOYpAIQ==", - "devOptional": true - }, - "node_modules/data-urls": { - "version": "8.0.0", - "resolved": "https://registry.npmmirror.com/data-urls/-/data-urls-8.0.0.tgz", - "integrity": "sha512-JQUCCK+/CAGbGGx618PlFZMXH81Jtj7t73CHv9dd/zVWvxgGT2zLFRjnKb+Ng46GIwcy+f7f88qd4duqllK+WQ==", + "node_modules/browserslist": { + "version": "4.29.3", + "resolved": "https://registry.npmmirror.com/browserslist/-/browserslist-4.29.3.tgz", + "integrity": "sha512-1R4kiYKXGViqEN0CnoDrXc1StD9niAwu+j2dukWzrD4bJgsD4lDmEp0CRbc6E/vYJIfTHwPmwyaKtVSudICdPA==", "dev": true, + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/browserslist" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/browserslist" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], "dependencies": { - "whatwg-mimetype": "^5.0.0", - "whatwg-url": "^17.1.2" + "baseline-browser-mapping": "^2.11.26", + "caniuse-lite": "^1.0.30001813", + "electron-to-chromium": "^1.5.439", + "node-releases": "^2.0.57", + "update-browserslist-db": "^1.3.3" + }, + "bin": { + "browserslist": "cli.js" }, "engines": { - "node": "^22.14.0 || >=24.0.0" + "node": "^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7" } }, - "node_modules/dayjs": { - "version": "1.11.23", - "resolved": "https://registry.npmmirror.com/dayjs/-/dayjs-1.11.23.tgz", - "integrity": "sha512-QDTCU0M0MxR3hQfnlDJfwekQiaanm1ubOD231u73WBckQ/fsamwRLiE2GBz6D3a/xF1NgfiDLJjXBa1hYOYTtQ==", + "node_modules/buffer-from": { + "version": "1.1.2", + "resolved": "https://registry.npmmirror.com/buffer-from/-/buffer-from-1.1.2.tgz", + "integrity": "sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==", "dev": true }, - "node_modules/debug": { - "version": "4.4.3", - "resolved": "https://registry.npmmirror.com/debug/-/debug-4.4.3.tgz", - "integrity": "sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA==", + "node_modules/builder-util": { + "version": "26.15.3", + "resolved": "https://registry.npmmirror.com/builder-util/-/builder-util-26.15.3.tgz", + "integrity": "sha512-q2hn7Mbo2nFNkVekPiHFx6Nfo3hURmES3tfBn+k5Pqxl2RkmP3QGqZUhH/q9Pch/4G05NRhPjDlVj1O8q4Txvw==", "dev": true, "dependencies": { - "ms": "^2.1.3" + "@types/debug": "^4.1.6", + "builder-util-runtime": "9.7.0", + "chalk": "^4.1.2", + "cross-spawn": "^7.0.6", + "debug": "^4.3.4", + "fs-extra": "^10.1.0", + "http-proxy-agent": "^7.0.0", + "https-proxy-agent": "^7.0.0", + "js-yaml": "^4.1.0", + "sanitize-filename": "^1.6.3", + "source-map-support": "^0.5.19", + "stat-mode": "^1.0.0", + "temp-file": "^3.4.0", + "tiny-async-pool": "1.3.0" }, "engines": { - "node": ">=6.0" - }, - "peerDependenciesMeta": { - "supports-color": { - "optional": true - } + "node": ">=14.0.0" } }, - "node_modules/decimal.js": { - "version": "10.6.0", - "resolved": "https://registry.npmmirror.com/decimal.js/-/decimal.js-10.6.0.tgz", - "integrity": "sha512-YpgQiITW3JXGntzdUmyUR1V812Hn8T1YVXhCu+wO3OpS4eU9l4YdD3qjyiKdV6mvV29zapkMeD390UVEf2lkUg==", - "dev": true - }, - "node_modules/decode-named-character-reference": { - "version": "1.3.0", - "resolved": "https://registry.npmmirror.com/decode-named-character-reference/-/decode-named-character-reference-1.3.0.tgz", - "integrity": "sha512-GtpQYB283KrPp6nRw50q3U9/VfOutZOe103qlN7BPP6Ad27xYnOIWv4lPzo8HCAL+mMZofJ9KEy30fq6MfaK6Q==", + "node_modules/builder-util-runtime": { + "version": "9.7.0", + "resolved": "https://registry.npmmirror.com/builder-util-runtime/-/builder-util-runtime-9.7.0.tgz", + "integrity": "sha512-g/kR520giAFYkSXTzcmF3kqQq7wi8F6N6SzeDgZrqTBN+VHdmgWOyTdD1yD7AATDId/yXLvuP34CxW46/BwCdw==", "dev": true, "dependencies": { - "character-entities": "^2.0.0" + "debug": "^4.3.4", + "sax": "^1.2.4" }, - "funding": { - "type": "github", - "url": "https://github.com/sponsors/wooorm" + "engines": { + "node": ">=12.0.0" } }, - "node_modules/delayed-stream": { - "version": "1.0.0", - "resolved": "https://registry.npmmirror.com/delayed-stream/-/delayed-stream-1.0.0.tgz", - "integrity": "sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==", + "node_modules/bytestreamjs": { + "version": "2.0.1", + "resolved": "https://registry.npmmirror.com/bytestreamjs/-/bytestreamjs-2.0.1.tgz", + "integrity": "sha512-U1Z/ob71V/bXfVABvNr/Kumf5VyeQRBEm6Txb0PQ6S7V5GpBM3w4Cbqz/xPDicR5tN0uvDifng8C+5qECeGwyQ==", "dev": true, "engines": { - "node": ">=0.4.0" + "node": ">=6.0.0" } }, - "node_modules/dequal": { - "version": "2.0.3", - "resolved": "https://registry.npmmirror.com/dequal/-/dequal-2.0.3.tgz", - "integrity": "sha512-0je+qPKHEMohvfRTCEo3CrPG6cAzAYgmzKyxRiYSSDkS6eGJdyVJm7WaYA5ECaAD9wLB2T4EEeymA5aFVcYXCA==", + "node_modules/cac": { + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/cac/-/cac-7.1.1.tgz", + "integrity": "sha512-8zc+h51HxpodKsA7L4PpBNd+9qlrfuUcyUDE5a793BJfN4NZgwk7v9NmrY3ptZ+Sk0+ToigxSzkb47AsEgyizw==", "dev": true, + "license": "MIT", "engines": { - "node": ">=6" + "node": ">=20.19.0" } }, - "node_modules/detect-libc": { - "version": "2.1.2", - "resolved": "https://registry.npmmirror.com/detect-libc/-/detect-libc-2.1.2.tgz", - "integrity": "sha512-Btj2BOOO83o3WyH59e8MgXsxEQVcarkUOpEYrubB0urwnN10yQ364rsiByU11nZlqWYZm05i/of7io4mzihBtQ==", + "node_modules/call-bind-apply-helpers": { + "version": "1.0.2", + "resolved": "https://registry.npmmirror.com/call-bind-apply-helpers/-/call-bind-apply-helpers-1.0.2.tgz", + "integrity": "sha512-Sp1ablJ0ivDkSzjcaJdxEunN5/XvksFJ2sMBFfq6x0ryhQV/2b/KwFe21cMpmHtPOSij8K99/wSfoEuTObmuMQ==", "dev": true, + "dependencies": { + "es-errors": "^1.3.0", + "function-bind": "^1.1.2" + }, "engines": { - "node": ">=8" + "node": ">= 0.4" } }, - "node_modules/detect-node-es": { - "version": "1.1.0", - "resolved": "https://registry.npmmirror.com/detect-node-es/-/detect-node-es-1.1.0.tgz", - "integrity": "sha512-ypdmJU/TbBby2Dxibuv7ZLW3Bs1QEmM7nHjEANfohJLvE0XVujisn1qPJcZxg+qDucsr+bP6fLD1rPS3AhJ7EQ==", - "dev": true + "node_modules/caniuse-lite": { + "version": "1.0.30001814", + "resolved": "https://registry.npmmirror.com/caniuse-lite/-/caniuse-lite-1.0.30001814.tgz", + "integrity": "sha512-/Uaf1lAzr59XcMpW0o96WoEfr+VXK2OX4U9AgFoiSHsVJ4HppnIFUjtYzsyDH2+tgANaQb2/oxYGwCPapN1FpA==", + "dev": true, + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/browserslist" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/caniuse-lite" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ] }, - "node_modules/devlop": { - "version": "1.1.0", - "resolved": "https://registry.npmmirror.com/devlop/-/devlop-1.1.0.tgz", - "integrity": "sha512-RWmIqhcFf1lRYBvNmr7qTNuyCt/7/ns2jbpp1+PalgE/rDQcBT0fioSMUpJ93irlUhC5hrg4cYqe6U+0ImW0rA==", + "node_modules/ccount": { + "version": "2.0.1", + "resolved": "https://registry.npmmirror.com/ccount/-/ccount-2.0.1.tgz", + "integrity": "sha512-eyrF0jiFpY+3drT6383f1qhkbGsLSifNAjA61IUjZjmLCWjItY6LB9ft9YhoDgwfmclB2zhu51Lc7+95b8NRAg==", "dev": true, - "dependencies": { - "dequal": "^2.0.0" - }, "funding": { "type": "github", "url": "https://github.com/sponsors/wooorm" } }, - "node_modules/dir-compare": { - "version": "4.2.0", - "resolved": "https://registry.npmmirror.com/dir-compare/-/dir-compare-4.2.0.tgz", - "integrity": "sha512-2xMCmOoMrdQIPHdsTawECdNPwlVFB9zGcz3kuhmBO6U3oU+UQjsue0i8ayLKpgBcm+hcXPMVSGUN9d+pvJ6+VQ==", + "node_modules/cesium": { + "version": "1.145.0", + "resolved": "https://registry.npmmirror.com/cesium/-/cesium-1.145.0.tgz", + "integrity": "sha512-6Azix8b5LPpoVSx8XQ6zPztpluJVmq+CEO3W2rOWxtc6bri6Nc9MvCYhKmTW1LAEwfisV7yzNgfulCXw9842+g==", "dev": true, + "workspaces": [ + "packages/engine", + "packages/widgets", + "packages/sandcastle" + ], "dependencies": { - "minimatch": "^3.0.5", - "p-limit": "^3.1.0 " + "@cesium/engine": "^26.3.0", + "@cesium/widgets": "^16.2.0", + "protobufjs": "^8.8.0" + }, + "engines": { + "node": ">=22.0.0" } }, - "node_modules/dmg-builder": { - "version": "26.15.3", - "resolved": "https://registry.npmmirror.com/dmg-builder/-/dmg-builder-26.15.3.tgz", - "integrity": "sha512-O3zJUFUYHJKgzPqioHxfxzBzlSC1eXCSr79gMSBKBP5AgjjpmrydMsMLotEg9fAJF36vdUncb+4ndRNxoPdlSQ==", + "node_modules/chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmmirror.com/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", "dev": true, "dependencies": { - "app-builder-lib": "26.15.3", - "builder-util": "26.15.3", - "fs-extra": "^10.1.0", - "js-yaml": "^4.1.0" - } - }, - "node_modules/dompurify": { - "version": "3.4.17", - "resolved": "https://registry.npmjs.org/dompurify/-/dompurify-3.4.17.tgz", - "integrity": "sha512-B/pSlYVHQ58kqISD/yDjuJ1yfzI34m1gF4lAod2bwSRhiN4K5Cl3H8Af7hqB2PmTL911tdEudnnXn5FnhRoz0w==", - "license": "(MPL-2.0 OR Apache-2.0)", - "optionalDependencies": { - "@types/trusted-types": "^2.0.7" - } - }, - "node_modules/dotenv": { - "version": "16.6.1", - "resolved": "https://registry.npmmirror.com/dotenv/-/dotenv-16.6.1.tgz", - "integrity": "sha512-uBq4egWHTcTt33a72vpSG0z3HnPuIl6NqYcTrKEg2azoEyl2hpW0zqlxysq2pK9HlDIHyHyakeYaYnSAwd8bow==", - "dev": true, + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, "engines": { - "node": ">=12" + "node": ">=10" }, "funding": { - "url": "https://dotenvx.com" + "url": "https://github.com/chalk/chalk?sponsor=1" } }, - "node_modules/dotenv-expand": { - "version": "11.0.7", - "resolved": "https://registry.npmmirror.com/dotenv-expand/-/dotenv-expand-11.0.7.tgz", - "integrity": "sha512-zIHwmZPRshsCdpMDyVsqGmgyP0yT8GAgXUnkdAoJisxvf33k7yO6OuoKmcTGuXPWSsm8Oh88nZicRLA9Y0rUeA==", + "node_modules/character-entities": { + "version": "2.0.2", + "resolved": "https://registry.npmmirror.com/character-entities/-/character-entities-2.0.2.tgz", + "integrity": "sha512-shx7oQ0Awen/BRIdkjkvz54PnEEI/EjwXDSIZp86/KKdbafHh1Df/RYGBhn4hbe2+uKC9FnT5UCEdyPz3ai9hQ==", "dev": true, - "dependencies": { - "dotenv": "^16.4.5" - }, - "engines": { - "node": ">=12" - }, "funding": { - "url": "https://dotenvx.com" + "type": "github", + "url": "https://github.com/sponsors/wooorm" } }, - "node_modules/draco3d": { - "version": "1.5.7", - "resolved": "https://registry.npmmirror.com/draco3d/-/draco3d-1.5.7.tgz", - "integrity": "sha512-m6WCKt/erDXcw+70IJXnG7M3awwQPAsZvJGX5zY7beBqpELw6RDGkYVU0W43AFxye4pDZ5i2Lbyc/NNGqwjUVQ==", - "dev": true - }, - "node_modules/dunder-proto": { - "version": "1.0.1", - "resolved": "https://registry.npmmirror.com/dunder-proto/-/dunder-proto-1.0.1.tgz", - "integrity": "sha512-KIN/nDJBQRcXw0MLVhZE9iQHmG68qAVIBg9CqmUYjmQIhgij9U5MFvrqkUL5FbtyyzZuOeOt0zdeRe4UY7ct+A==", + "node_modules/character-entities-html4": { + "version": "2.1.0", + "resolved": "https://registry.npmmirror.com/character-entities-html4/-/character-entities-html4-2.1.0.tgz", + "integrity": "sha512-1v7fgQRj6hnSwFpq1Eu0ynr/CDEw0rXo2B61qXrLNdHZmPKgb7fqS1a2JwF0rISo9q77jDI8VMEHoApn8qDoZA==", "dev": true, - "dependencies": { - "call-bind-apply-helpers": "^1.0.1", - "es-errors": "^1.3.0", - "gopd": "^1.2.0" - }, - "engines": { - "node": ">= 0.4" + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" } }, - "node_modules/duplexer2": { - "version": "0.1.4", - "resolved": "https://registry.npmmirror.com/duplexer2/-/duplexer2-0.1.4.tgz", - "integrity": "sha512-asLFVfWWtJ90ZyOUHMqk7/S2w2guQKxUI2itj3d92ADHhxUSbCMGi1f1cBcJ7xM1To+pE/Khbwo1yuNbMEPKeA==", + "node_modules/character-entities-legacy": { + "version": "3.0.0", + "resolved": "https://registry.npmmirror.com/character-entities-legacy/-/character-entities-legacy-3.0.0.tgz", + "integrity": "sha512-RpPp0asT/6ufRm//AJVwpViZbGM/MkjQFxJccQRHmISF/22NBtsHqAWmL+/pmkPWoIUJdWyeVleTl1wydHATVQ==", "dev": true, - "dependencies": { - "readable-stream": "^2.0.2" + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" } }, - "node_modules/earcut": { - "version": "3.0.2", - "resolved": "https://registry.npmmirror.com/earcut/-/earcut-3.0.2.tgz", - "integrity": "sha512-X7hshQbLyMJ/3RPhyObLARM2sNxxmRALLKx1+NVFFnQ9gKzmCrxm9+uLIAdBcvc8FNLpctqlQ2V6AE92Ol9UDQ==", - "dev": true + "node_modules/character-reference-invalid": { + "version": "2.0.1", + "resolved": "https://registry.npmmirror.com/character-reference-invalid/-/character-reference-invalid-2.0.1.tgz", + "integrity": "sha512-iBZ4F4wRbyORVsu0jPV7gXkOsGYjGHPmAyv+HiHG8gi5PtC9KI2j1+v8/tlibRvjoWX027ypmG/n0HtO5t7unw==", + "dev": true, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } }, - "node_modules/echarts": { - "version": "6.1.0", - "resolved": "https://registry.npmmirror.com/echarts/-/echarts-6.1.0.tgz", - "integrity": "sha512-q0yaFPggC9FUdsWH4blavRWFmxdrIodbkoKNAjJudAI6CA9gNPxHtV2RcZNEepZVlk4yvBYkOkbk6HIVpIyHZA==", + "node_modules/chownr": { + "version": "3.0.0", + "resolved": "https://registry.npmmirror.com/chownr/-/chownr-3.0.0.tgz", + "integrity": "sha512-+IxzY9BZOQd/XuYPRmrvEVjF/nqj5kgT4kEq7VofrDoM1MxoRjEWkrCC3EtLi59TVawxTAn+orJwFQcrqEN1+g==", "dev": true, - "dependencies": { - "tslib": "2.3.0", - "zrender": "6.1.0" + "engines": { + "node": ">=18" } }, - "node_modules/echarts/node_modules/tslib": { - "version": "2.3.0", - "resolved": "https://registry.npmmirror.com/tslib/-/tslib-2.3.0.tgz", - "integrity": "sha512-N82ooyxVNm6h1riLCoyS9e3fuJ3AMG2zIZs2Gd1ATcSFjSA23Q0fzjjZeh0jbJvWVDZ0cJT8yaNNaaXHzueNjg==", + "node_modules/chromium-pickle-js": { + "version": "0.2.0", + "resolved": "https://registry.npmmirror.com/chromium-pickle-js/-/chromium-pickle-js-0.2.0.tgz", + "integrity": "sha512-1R5Fho+jBq0DDydt+/vHWj5KJNJCKdARKOCwZUen84I5BreWoLqRLANH1U87eJy1tiASPtMnGqJJq0ZsLoRPOw==", "dev": true }, - "node_modules/ejs": { - "version": "3.1.10", - "resolved": "https://registry.npmmirror.com/ejs/-/ejs-3.1.10.tgz", - "integrity": "sha512-UeJmFfOrAQS8OJWPZ4qtgHyWExa088/MtK5UEyoJGFH67cDEXkZSviOiKRCZ4Xij0zxI3JECgYs3oKx+AizQBA==", + "node_modules/ci-info": { + "version": "4.4.0", + "resolved": "https://registry.npmmirror.com/ci-info/-/ci-info-4.4.0.tgz", + "integrity": "sha512-77PSwercCZU2Fc4sX94eF8k8Pxte6JAwL4/ICZLFjJLqegs7kCuAsqqj/70NQF6TvDpgFjkubQB2FW2ZZddvQg==", "dev": true, - "dependencies": { - "jake": "^10.8.5" - }, - "bin": { - "ejs": "bin/cli.js" - }, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/sibiraj-s" + } + ], "engines": { - "node": ">=0.10.0" + "node": ">=8" } }, - "node_modules/electron": { - "version": "44.9.1", - "resolved": "https://registry.npmjs.org/electron/-/electron-44.9.1.tgz", - "integrity": "sha512-x/tECFFDa2OFNjMObFH0EGKWrCnFZPOR1wP2iMIVt0STecGl8FmDXdaiaryY0kf8mtw9kSLP2yK8dfdaWkfDmw==", + "node_modules/class-variance-authority": { + "version": "0.7.1", + "resolved": "https://registry.npmmirror.com/class-variance-authority/-/class-variance-authority-0.7.1.tgz", + "integrity": "sha512-Ka+9Trutv7G8M6WT6SeiRWz792K5qEqIGEGzXKhAE6xOWAY6pPH8U+9IY3oCMv6kqTmLsv7Xh/2w2RigkePMsg==", "dev": true, - "license": "MIT", "dependencies": { - "@electron-internal/extract-zip": "^1.0.1", - "@electron/get": "^5.0.0", - "@types/node": "^24.9.0" - }, - "bin": { - "electron": "cli.js", - "install-electron": "install.js" + "clsx": "^2.1.1" }, - "engines": { - "node": ">= 22.12.0" + "funding": { + "url": "https://polar.sh/cva" } }, - "node_modules/electron-builder": { - "version": "26.15.3", - "resolved": "https://registry.npmmirror.com/electron-builder/-/electron-builder-26.15.3.tgz", - "integrity": "sha512-a1KM5heqS3gQCZzizXEI8RjJy3QVogULPdeSknt76uLDpBIW/HDGsMg/XgP0riP6PI9COsRvFITKKGDqA8fJxA==", + "node_modules/classnames": { + "version": "2.5.1", + "resolved": "https://registry.npmmirror.com/classnames/-/classnames-2.5.1.tgz", + "integrity": "sha512-saHYOzhIQs6wy2sVxTM6bUDsQO4F50V9RQ22qBpEdCW+I+/Wmke2HOl6lS6dTpdxVhb88/I6+Hs+438c3lfUow==", + "dev": true + }, + "node_modules/cliui": { + "version": "8.0.1", + "resolved": "https://registry.npmmirror.com/cliui/-/cliui-8.0.1.tgz", + "integrity": "sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ==", "dev": true, "dependencies": { - "app-builder-lib": "26.15.3", - "builder-util": "26.15.3", - "builder-util-runtime": "9.7.0", - "chalk": "^4.1.2", - "ci-info": "^4.2.0", - "dmg-builder": "26.15.3", - "fs-extra": "^10.1.0", - "lazy-val": "^1.0.5", - "simple-update-notifier": "2.0.0", - "yargs": "^17.6.2" - }, - "bin": { - "electron-builder": "cli.js", - "install-app-deps": "install-app-deps.js" + "string-width": "^4.2.0", + "strip-ansi": "^6.0.1", + "wrap-ansi": "^7.0.0" }, "engines": { - "node": ">=14.0.0" + "node": ">=12" } }, - "node_modules/electron-builder-squirrel-windows": { - "version": "26.15.3", - "resolved": "https://registry.npmmirror.com/electron-builder-squirrel-windows/-/electron-builder-squirrel-windows-26.15.3.tgz", - "integrity": "sha512-Jc19XPV9y9+2bAdZPkXuVNGNIEFBq9poHC61l8Kv6FdK7DRG3+Ic0rerC0DXOaeHNz8yW0fg/JnF8GQROOF5MA==", + "node_modules/clsx": { + "version": "2.1.1", + "resolved": "https://registry.npmmirror.com/clsx/-/clsx-2.1.1.tgz", + "integrity": "sha512-eYm0QWBtUrBWZWG0d386OGAw16Z995PiOVo2B7bjWSbHedGl5e0ZWaq65kOGgUSNesEIDkB9ISbTg/JK9dhCZA==", "dev": true, - "peer": true, - "dependencies": { - "app-builder-lib": "26.15.3", - "builder-util": "26.15.3", - "electron-winstaller": "5.4.0" + "engines": { + "node": ">=6" } }, - "node_modules/electron-publish": { - "version": "26.15.3", - "resolved": "https://registry.npmmirror.com/electron-publish/-/electron-publish-26.15.3.tgz", - "integrity": "sha512-g/2bn8YTavY4cuS5F+jOS7zmZbXXBV8KZ8yHKfJjFPoKtzBqrpCdNPxBd3tqdBwP7BVd0lGzf7Bk2s0KesWZ4Q==", + "node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmmirror.com/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", "dev": true, "dependencies": { - "@types/fs-extra": "^9.0.11", - "aws4": "^1.13.2", - "builder-util": "26.15.3", - "builder-util-runtime": "9.7.0", - "chalk": "^4.1.2", - "form-data": "^4.0.5", - "fs-extra": "^10.1.0", - "lazy-val": "^1.0.5", - "mime": "^2.5.2" + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" } }, - "node_modules/electron-to-chromium": { - "version": "1.5.443", - "resolved": "https://registry.npmmirror.com/electron-to-chromium/-/electron-to-chromium-1.5.443.tgz", - "integrity": "sha512-TDJG36L9A3CWWwZ97HKaE+Iz1sW80pNp6sAU0owzCIV3Zc9eVyRqZK8Vz6NKuMIU8WjP0pIkoqCa0VRf/yFD0Q==", + "node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmmirror.com/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", "dev": true }, - "node_modules/electron-vite": { - "version": "5.0.0", - "resolved": "https://registry.npmmirror.com/electron-vite/-/electron-vite-5.0.0.tgz", - "integrity": "sha512-OHp/vjdlubNlhNkPkL/+3JD34ii5ov7M0GpuXEVdQeqdQ3ulvVR7Dg/rNBLfS5XPIFwgoBLDf9sjjrL+CuDyRQ==", + "node_modules/combined-stream": { + "version": "1.0.8", + "resolved": "https://registry.npmmirror.com/combined-stream/-/combined-stream-1.0.8.tgz", + "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==", "dev": true, "dependencies": { - "@babel/core": "^7.28.4", - "@babel/plugin-transform-arrow-functions": "^7.27.1", - "cac": "^6.7.14", - "esbuild": "^0.25.11", - "magic-string": "^0.30.19", - "picocolors": "^1.1.1" - }, - "bin": { - "electron-vite": "bin/electron-vite.js" + "delayed-stream": "~1.0.0" }, "engines": { - "node": "^20.19.0 || >=22.12.0" - }, - "peerDependencies": { - "@swc/core": "^1.0.0", - "vite": "^5.0.0 || ^6.0.0 || ^7.0.0" - }, - "peerDependenciesMeta": { - "@swc/core": { - "optional": true - } + "node": ">= 0.8" } }, - "node_modules/electron-vite/node_modules/@esbuild/aix-ppc64": { - "version": "0.25.12", - "resolved": "https://registry.npmmirror.com/@esbuild/aix-ppc64/-/aix-ppc64-0.25.12.tgz", - "integrity": "sha512-Hhmwd6CInZ3dwpuGTF8fJG6yoWmsToE+vYgD4nytZVxcu1ulHpUQRAB1UJ8+N1Am3Mz4+xOByoQoSZf4D+CpkA==", - "cpu": [ - "ppc64" - ], + "node_modules/comma-separated-tokens": { + "version": "2.0.3", + "resolved": "https://registry.npmmirror.com/comma-separated-tokens/-/comma-separated-tokens-2.0.3.tgz", + "integrity": "sha512-Fu4hJdvzeylCfQPp9SGWidpzrMs7tTrlu6Vb8XGaRGck8QSNZJJp538Wrb60Lax4fPwR64ViY468OIUTbRlGZg==", "dev": true, - "optional": true, - "os": [ - "aix" - ], - "engines": { - "node": ">=18" + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" } }, - "node_modules/electron-vite/node_modules/@esbuild/android-arm": { - "version": "0.25.12", - "resolved": "https://registry.npmmirror.com/@esbuild/android-arm/-/android-arm-0.25.12.tgz", - "integrity": "sha512-VJ+sKvNA/GE7Ccacc9Cha7bpS8nyzVv0jdVgwNDaR4gDMC/2TTRc33Ip8qrNYUcpkOHUT5OZ0bUcNNVZQ9RLlg==", - "cpu": [ - "arm" - ], + "node_modules/commander": { + "version": "2.20.3", + "resolved": "https://registry.npmmirror.com/commander/-/commander-2.20.3.tgz", + "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==", + "dev": true + }, + "node_modules/compare-version": { + "version": "0.1.2", + "resolved": "https://registry.npmmirror.com/compare-version/-/compare-version-0.1.2.tgz", + "integrity": "sha512-pJDh5/4wrEnXX/VWRZvruAGHkzKdr46z11OlTPN+VrATlWWhSKewNCJ1futCO5C7eJB3nPMFZA1LeYtcFboZ2A==", "dev": true, - "optional": true, - "os": [ - "android" - ], "engines": { - "node": ">=18" + "node": ">=0.10.0" } }, - "node_modules/electron-vite/node_modules/@esbuild/android-arm64": { - "version": "0.25.12", - "resolved": "https://registry.npmmirror.com/@esbuild/android-arm64/-/android-arm64-0.25.12.tgz", - "integrity": "sha512-6AAmLG7zwD1Z159jCKPvAxZd4y/VTO0VkprYy+3N2FtJ8+BQWFXU+OxARIwA46c5tdD9SsKGZ/1ocqBS/gAKHg==", - "cpu": [ - "arm64" - ], - "dev": true, - "optional": true, - "os": [ - "android" - ], + "node_modules/convert-source-map": { + "version": "2.0.0", + "resolved": "https://registry.npmmirror.com/convert-source-map/-/convert-source-map-2.0.0.tgz", + "integrity": "sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg==", + "dev": true + }, + "node_modules/core-js": { + "version": "3.50.0", + "resolved": "https://registry.npmmirror.com/core-js/-/core-js-3.50.0.tgz", + "integrity": "sha512-BRWgOLKkFeCgRudR6zrs8p9XJZcE14grzKMMssoYrk6krtuEZ7MTKPIY5RzOnqsEKIR9kst7wNzphttraT+Yqw==", + "hasInstallScript": true, "engines": { - "node": ">=18" + "node": "*" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/core-js" } }, - "node_modules/electron-vite/node_modules/@esbuild/android-x64": { - "version": "0.25.12", - "resolved": "https://registry.npmmirror.com/@esbuild/android-x64/-/android-x64-0.25.12.tgz", - "integrity": "sha512-5jbb+2hhDHx5phYR2By8GTWEzn6I9UqR11Kwf22iKbNpYrsmRB18aX/9ivc5cabcUiAT/wM+YIZ6SG9QO6a8kg==", - "cpu": [ - "x64" - ], + "node_modules/core-util-is": { + "version": "1.0.3", + "resolved": "https://registry.npmmirror.com/core-util-is/-/core-util-is-1.0.3.tgz", + "integrity": "sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ==", + "dev": true + }, + "node_modules/cross-dirname": { + "version": "0.1.0", + "resolved": "https://registry.npmmirror.com/cross-dirname/-/cross-dirname-0.1.0.tgz", + "integrity": "sha512-+R08/oI0nl3vfPcqftZRpytksBXDzOUveBq/NBVx0sUp1axwzPQrKinNx5yd5sxPu8j1wIy8AfnVQ+5eFdha6Q==", "dev": true, "optional": true, - "os": [ - "android" - ], - "engines": { - "node": ">=18" - } + "peer": true }, - "node_modules/electron-vite/node_modules/@esbuild/darwin-arm64": { - "version": "0.25.12", - "resolved": "https://registry.npmmirror.com/@esbuild/darwin-arm64/-/darwin-arm64-0.25.12.tgz", - "integrity": "sha512-N3zl+lxHCifgIlcMUP5016ESkeQjLj/959RxxNYIthIg+CQHInujFuXeWbWMgnTo4cp5XVHqFPmpyu9J65C1Yg==", - "cpu": [ - "arm64" - ], + "node_modules/cross-spawn": { + "version": "7.0.6", + "resolved": "https://registry.npmmirror.com/cross-spawn/-/cross-spawn-7.0.6.tgz", + "integrity": "sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA==", "dev": true, - "optional": true, - "os": [ - "darwin" - ], + "dependencies": { + "path-key": "^3.1.0", + "shebang-command": "^2.0.0", + "which": "^2.0.1" + }, "engines": { - "node": ">=18" + "node": ">= 8" } }, - "node_modules/electron-vite/node_modules/@esbuild/darwin-x64": { - "version": "0.25.12", - "resolved": "https://registry.npmmirror.com/@esbuild/darwin-x64/-/darwin-x64-0.25.12.tgz", - "integrity": "sha512-HQ9ka4Kx21qHXwtlTUVbKJOAnmG1ipXhdWTmNXiPzPfWKpXqASVcWdnf2bnL73wgjNrFXAa3yYvBSd9pzfEIpA==", - "cpu": [ - "x64" - ], + "node_modules/cross-spawn/node_modules/isexe": { + "version": "2.0.0", + "resolved": "https://registry.npmmirror.com/isexe/-/isexe-2.0.0.tgz", + "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==", + "dev": true + }, + "node_modules/cross-spawn/node_modules/which": { + "version": "2.0.2", + "resolved": "https://registry.npmmirror.com/which/-/which-2.0.2.tgz", + "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", "dev": true, - "optional": true, - "os": [ - "darwin" - ], + "dependencies": { + "isexe": "^2.0.0" + }, + "bin": { + "node-which": "bin/node-which" + }, "engines": { - "node": ">=18" + "node": ">= 8" } }, - "node_modules/electron-vite/node_modules/@esbuild/freebsd-arm64": { - "version": "0.25.12", - "resolved": "https://registry.npmmirror.com/@esbuild/freebsd-arm64/-/freebsd-arm64-0.25.12.tgz", - "integrity": "sha512-gA0Bx759+7Jve03K1S0vkOu5Lg/85dou3EseOGUes8flVOGxbhDDh/iZaoek11Y8mtyKPGF3vP8XhnkDEAmzeg==", - "cpu": [ - "arm64" - ], + "node_modules/csstype": { + "version": "3.2.3", + "resolved": "https://registry.npmmirror.com/csstype/-/csstype-3.2.3.tgz", + "integrity": "sha512-z1HGKcYy2xA8AGQfwrn0PAy+PB7X/GSj3UVJW9qKyn43xWa+gl5nXmU4qqLMRzWVLFC8KusUX8T/0kCiOYpAIQ==", + "devOptional": true + }, + "node_modules/data-urls": { + "version": "8.0.0", + "resolved": "https://registry.npmmirror.com/data-urls/-/data-urls-8.0.0.tgz", + "integrity": "sha512-JQUCCK+/CAGbGGx618PlFZMXH81Jtj7t73CHv9dd/zVWvxgGT2zLFRjnKb+Ng46GIwcy+f7f88qd4duqllK+WQ==", "dev": true, - "optional": true, - "os": [ - "freebsd" - ], + "dependencies": { + "whatwg-mimetype": "^5.0.0", + "whatwg-url": "^17.1.2" + }, "engines": { - "node": ">=18" + "node": "^22.14.0 || >=24.0.0" } }, - "node_modules/electron-vite/node_modules/@esbuild/freebsd-x64": { - "version": "0.25.12", - "resolved": "https://registry.npmmirror.com/@esbuild/freebsd-x64/-/freebsd-x64-0.25.12.tgz", - "integrity": "sha512-TGbO26Yw2xsHzxtbVFGEXBFH0FRAP7gtcPE7P5yP7wGy7cXK2oO7RyOhL5NLiqTlBh47XhmIUXuGciXEqYFfBQ==", - "cpu": [ - "x64" - ], + "node_modules/dayjs": { + "version": "1.11.23", + "resolved": "https://registry.npmmirror.com/dayjs/-/dayjs-1.11.23.tgz", + "integrity": "sha512-QDTCU0M0MxR3hQfnlDJfwekQiaanm1ubOD231u73WBckQ/fsamwRLiE2GBz6D3a/xF1NgfiDLJjXBa1hYOYTtQ==", + "dev": true + }, + "node_modules/debug": { + "version": "4.4.3", + "resolved": "https://registry.npmmirror.com/debug/-/debug-4.4.3.tgz", + "integrity": "sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA==", "dev": true, - "optional": true, - "os": [ - "freebsd" - ], + "dependencies": { + "ms": "^2.1.3" + }, "engines": { - "node": ">=18" + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } } }, - "node_modules/electron-vite/node_modules/@esbuild/linux-arm": { - "version": "0.25.12", - "resolved": "https://registry.npmmirror.com/@esbuild/linux-arm/-/linux-arm-0.25.12.tgz", - "integrity": "sha512-lPDGyC1JPDou8kGcywY0YILzWlhhnRjdof3UlcoqYmS9El818LLfJJc3PXXgZHrHCAKs/Z2SeZtDJr5MrkxtOw==", - "cpu": [ - "arm" - ], + "node_modules/decimal.js": { + "version": "10.6.0", + "resolved": "https://registry.npmmirror.com/decimal.js/-/decimal.js-10.6.0.tgz", + "integrity": "sha512-YpgQiITW3JXGntzdUmyUR1V812Hn8T1YVXhCu+wO3OpS4eU9l4YdD3qjyiKdV6mvV29zapkMeD390UVEf2lkUg==", + "dev": true + }, + "node_modules/decode-named-character-reference": { + "version": "1.3.0", + "resolved": "https://registry.npmmirror.com/decode-named-character-reference/-/decode-named-character-reference-1.3.0.tgz", + "integrity": "sha512-GtpQYB283KrPp6nRw50q3U9/VfOutZOe103qlN7BPP6Ad27xYnOIWv4lPzo8HCAL+mMZofJ9KEy30fq6MfaK6Q==", "dev": true, - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=18" + "dependencies": { + "character-entities": "^2.0.0" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" } }, - "node_modules/electron-vite/node_modules/@esbuild/linux-arm64": { - "version": "0.25.12", - "resolved": "https://registry.npmmirror.com/@esbuild/linux-arm64/-/linux-arm64-0.25.12.tgz", - "integrity": "sha512-8bwX7a8FghIgrupcxb4aUmYDLp8pX06rGh5HqDT7bB+8Rdells6mHvrFHHW2JAOPZUbnjUpKTLg6ECyzvas2AQ==", - "cpu": [ - "arm64" - ], + "node_modules/delayed-stream": { + "version": "1.0.0", + "resolved": "https://registry.npmmirror.com/delayed-stream/-/delayed-stream-1.0.0.tgz", + "integrity": "sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==", "dev": true, - "optional": true, - "os": [ - "linux" - ], "engines": { - "node": ">=18" + "node": ">=0.4.0" } }, - "node_modules/electron-vite/node_modules/@esbuild/linux-ia32": { - "version": "0.25.12", - "resolved": "https://registry.npmmirror.com/@esbuild/linux-ia32/-/linux-ia32-0.25.12.tgz", - "integrity": "sha512-0y9KrdVnbMM2/vG8KfU0byhUN+EFCny9+8g202gYqSSVMonbsCfLjUO+rCci7pM0WBEtz+oK/PIwHkzxkyharA==", - "cpu": [ - "ia32" - ], + "node_modules/dequal": { + "version": "2.0.3", + "resolved": "https://registry.npmmirror.com/dequal/-/dequal-2.0.3.tgz", + "integrity": "sha512-0je+qPKHEMohvfRTCEo3CrPG6cAzAYgmzKyxRiYSSDkS6eGJdyVJm7WaYA5ECaAD9wLB2T4EEeymA5aFVcYXCA==", "dev": true, - "optional": true, - "os": [ - "linux" - ], "engines": { - "node": ">=18" + "node": ">=6" } }, - "node_modules/electron-vite/node_modules/@esbuild/linux-loong64": { - "version": "0.25.12", - "resolved": "https://registry.npmmirror.com/@esbuild/linux-loong64/-/linux-loong64-0.25.12.tgz", - "integrity": "sha512-h///Lr5a9rib/v1GGqXVGzjL4TMvVTv+s1DPoxQdz7l/AYv6LDSxdIwzxkrPW438oUXiDtwM10o9PmwS/6Z0Ng==", - "cpu": [ - "loong64" - ], + "node_modules/detect-libc": { + "version": "2.1.2", + "resolved": "https://registry.npmmirror.com/detect-libc/-/detect-libc-2.1.2.tgz", + "integrity": "sha512-Btj2BOOO83o3WyH59e8MgXsxEQVcarkUOpEYrubB0urwnN10yQ364rsiByU11nZlqWYZm05i/of7io4mzihBtQ==", "dev": true, - "optional": true, - "os": [ - "linux" - ], "engines": { - "node": ">=18" + "node": ">=8" } }, - "node_modules/electron-vite/node_modules/@esbuild/linux-mips64el": { - "version": "0.25.12", - "resolved": "https://registry.npmmirror.com/@esbuild/linux-mips64el/-/linux-mips64el-0.25.12.tgz", - "integrity": "sha512-iyRrM1Pzy9GFMDLsXn1iHUm18nhKnNMWscjmp4+hpafcZjrr2WbT//d20xaGljXDBYHqRcl8HnxbX6uaA/eGVw==", - "cpu": [ - "mips64el" - ], + "node_modules/detect-node-es": { + "version": "1.1.0", + "resolved": "https://registry.npmmirror.com/detect-node-es/-/detect-node-es-1.1.0.tgz", + "integrity": "sha512-ypdmJU/TbBby2Dxibuv7ZLW3Bs1QEmM7nHjEANfohJLvE0XVujisn1qPJcZxg+qDucsr+bP6fLD1rPS3AhJ7EQ==", + "dev": true + }, + "node_modules/devlop": { + "version": "1.1.0", + "resolved": "https://registry.npmmirror.com/devlop/-/devlop-1.1.0.tgz", + "integrity": "sha512-RWmIqhcFf1lRYBvNmr7qTNuyCt/7/ns2jbpp1+PalgE/rDQcBT0fioSMUpJ93irlUhC5hrg4cYqe6U+0ImW0rA==", "dev": true, - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=18" + "dependencies": { + "dequal": "^2.0.0" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" } }, - "node_modules/electron-vite/node_modules/@esbuild/linux-ppc64": { - "version": "0.25.12", - "resolved": "https://registry.npmmirror.com/@esbuild/linux-ppc64/-/linux-ppc64-0.25.12.tgz", - "integrity": "sha512-9meM/lRXxMi5PSUqEXRCtVjEZBGwB7P/D4yT8UG/mwIdze2aV4Vo6U5gD3+RsoHXKkHCfSxZKzmDssVlRj1QQA==", - "cpu": [ - "ppc64" - ], + "node_modules/dir-compare": { + "version": "4.2.0", + "resolved": "https://registry.npmmirror.com/dir-compare/-/dir-compare-4.2.0.tgz", + "integrity": "sha512-2xMCmOoMrdQIPHdsTawECdNPwlVFB9zGcz3kuhmBO6U3oU+UQjsue0i8ayLKpgBcm+hcXPMVSGUN9d+pvJ6+VQ==", "dev": true, - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=18" + "dependencies": { + "minimatch": "^3.0.5", + "p-limit": "^3.1.0 " } }, - "node_modules/electron-vite/node_modules/@esbuild/linux-riscv64": { - "version": "0.25.12", - "resolved": "https://registry.npmmirror.com/@esbuild/linux-riscv64/-/linux-riscv64-0.25.12.tgz", - "integrity": "sha512-Zr7KR4hgKUpWAwb1f3o5ygT04MzqVrGEGXGLnj15YQDJErYu/BGg+wmFlIDOdJp0PmB0lLvxFIOXZgFRrdjR0w==", - "cpu": [ - "riscv64" - ], + "node_modules/dmg-builder": { + "version": "26.15.3", + "resolved": "https://registry.npmmirror.com/dmg-builder/-/dmg-builder-26.15.3.tgz", + "integrity": "sha512-O3zJUFUYHJKgzPqioHxfxzBzlSC1eXCSr79gMSBKBP5AgjjpmrydMsMLotEg9fAJF36vdUncb+4ndRNxoPdlSQ==", "dev": true, - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=18" + "dependencies": { + "app-builder-lib": "26.15.3", + "builder-util": "26.15.3", + "fs-extra": "^10.1.0", + "js-yaml": "^4.1.0" } }, - "node_modules/electron-vite/node_modules/@esbuild/linux-s390x": { - "version": "0.25.12", - "resolved": "https://registry.npmmirror.com/@esbuild/linux-s390x/-/linux-s390x-0.25.12.tgz", - "integrity": "sha512-MsKncOcgTNvdtiISc/jZs/Zf8d0cl/t3gYWX8J9ubBnVOwlk65UIEEvgBORTiljloIWnBzLs4qhzPkJcitIzIg==", - "cpu": [ - "s390x" - ], - "dev": true, - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=18" + "node_modules/dompurify": { + "version": "3.4.17", + "resolved": "https://registry.npmjs.org/dompurify/-/dompurify-3.4.17.tgz", + "integrity": "sha512-B/pSlYVHQ58kqISD/yDjuJ1yfzI34m1gF4lAod2bwSRhiN4K5Cl3H8Af7hqB2PmTL911tdEudnnXn5FnhRoz0w==", + "license": "(MPL-2.0 OR Apache-2.0)", + "optionalDependencies": { + "@types/trusted-types": "^2.0.7" } }, - "node_modules/electron-vite/node_modules/@esbuild/linux-x64": { - "version": "0.25.12", - "resolved": "https://registry.npmmirror.com/@esbuild/linux-x64/-/linux-x64-0.25.12.tgz", - "integrity": "sha512-uqZMTLr/zR/ed4jIGnwSLkaHmPjOjJvnm6TVVitAa08SLS9Z0VM8wIRx7gWbJB5/J54YuIMInDquWyYvQLZkgw==", - "cpu": [ - "x64" - ], - "dev": true, - "optional": true, - "os": [ - "linux" - ], + "node_modules/dotenv": { + "version": "16.6.1", + "resolved": "https://registry.npmmirror.com/dotenv/-/dotenv-16.6.1.tgz", + "integrity": "sha512-uBq4egWHTcTt33a72vpSG0z3HnPuIl6NqYcTrKEg2azoEyl2hpW0zqlxysq2pK9HlDIHyHyakeYaYnSAwd8bow==", + "dev": true, "engines": { - "node": ">=18" + "node": ">=12" + }, + "funding": { + "url": "https://dotenvx.com" } }, - "node_modules/electron-vite/node_modules/@esbuild/netbsd-arm64": { - "version": "0.25.12", - "resolved": "https://registry.npmmirror.com/@esbuild/netbsd-arm64/-/netbsd-arm64-0.25.12.tgz", - "integrity": "sha512-xXwcTq4GhRM7J9A8Gv5boanHhRa/Q9KLVmcyXHCTaM4wKfIpWkdXiMog/KsnxzJ0A1+nD+zoecuzqPmCRyBGjg==", - "cpu": [ - "arm64" - ], + "node_modules/dotenv-expand": { + "version": "11.0.7", + "resolved": "https://registry.npmmirror.com/dotenv-expand/-/dotenv-expand-11.0.7.tgz", + "integrity": "sha512-zIHwmZPRshsCdpMDyVsqGmgyP0yT8GAgXUnkdAoJisxvf33k7yO6OuoKmcTGuXPWSsm8Oh88nZicRLA9Y0rUeA==", "dev": true, - "optional": true, - "os": [ - "netbsd" - ], + "dependencies": { + "dotenv": "^16.4.5" + }, "engines": { - "node": ">=18" + "node": ">=12" + }, + "funding": { + "url": "https://dotenvx.com" } }, - "node_modules/electron-vite/node_modules/@esbuild/netbsd-x64": { - "version": "0.25.12", - "resolved": "https://registry.npmmirror.com/@esbuild/netbsd-x64/-/netbsd-x64-0.25.12.tgz", - "integrity": "sha512-Ld5pTlzPy3YwGec4OuHh1aCVCRvOXdH8DgRjfDy/oumVovmuSzWfnSJg+VtakB9Cm0gxNO9BzWkj6mtO1FMXkQ==", - "cpu": [ - "x64" - ], + "node_modules/draco3d": { + "version": "1.5.7", + "resolved": "https://registry.npmmirror.com/draco3d/-/draco3d-1.5.7.tgz", + "integrity": "sha512-m6WCKt/erDXcw+70IJXnG7M3awwQPAsZvJGX5zY7beBqpELw6RDGkYVU0W43AFxye4pDZ5i2Lbyc/NNGqwjUVQ==", + "dev": true + }, + "node_modules/dunder-proto": { + "version": "1.0.1", + "resolved": "https://registry.npmmirror.com/dunder-proto/-/dunder-proto-1.0.1.tgz", + "integrity": "sha512-KIN/nDJBQRcXw0MLVhZE9iQHmG68qAVIBg9CqmUYjmQIhgij9U5MFvrqkUL5FbtyyzZuOeOt0zdeRe4UY7ct+A==", "dev": true, - "optional": true, - "os": [ - "netbsd" - ], + "dependencies": { + "call-bind-apply-helpers": "^1.0.1", + "es-errors": "^1.3.0", + "gopd": "^1.2.0" + }, "engines": { - "node": ">=18" + "node": ">= 0.4" } }, - "node_modules/electron-vite/node_modules/@esbuild/openbsd-arm64": { - "version": "0.25.12", - "resolved": "https://registry.npmmirror.com/@esbuild/openbsd-arm64/-/openbsd-arm64-0.25.12.tgz", - "integrity": "sha512-fF96T6KsBo/pkQI950FARU9apGNTSlZGsv1jZBAlcLL1MLjLNIWPBkj5NlSz8aAzYKg+eNqknrUJ24QBybeR5A==", - "cpu": [ - "arm64" - ], + "node_modules/duplexer2": { + "version": "0.1.4", + "resolved": "https://registry.npmmirror.com/duplexer2/-/duplexer2-0.1.4.tgz", + "integrity": "sha512-asLFVfWWtJ90ZyOUHMqk7/S2w2guQKxUI2itj3d92ADHhxUSbCMGi1f1cBcJ7xM1To+pE/Khbwo1yuNbMEPKeA==", "dev": true, - "optional": true, - "os": [ - "openbsd" - ], - "engines": { - "node": ">=18" + "dependencies": { + "readable-stream": "^2.0.2" } }, - "node_modules/electron-vite/node_modules/@esbuild/openbsd-x64": { - "version": "0.25.12", - "resolved": "https://registry.npmmirror.com/@esbuild/openbsd-x64/-/openbsd-x64-0.25.12.tgz", - "integrity": "sha512-MZyXUkZHjQxUvzK7rN8DJ3SRmrVrke8ZyRusHlP+kuwqTcfWLyqMOE3sScPPyeIXN/mDJIfGXvcMqCgYKekoQw==", - "cpu": [ - "x64" - ], + "node_modules/earcut": { + "version": "3.0.2", + "resolved": "https://registry.npmmirror.com/earcut/-/earcut-3.0.2.tgz", + "integrity": "sha512-X7hshQbLyMJ/3RPhyObLARM2sNxxmRALLKx1+NVFFnQ9gKzmCrxm9+uLIAdBcvc8FNLpctqlQ2V6AE92Ol9UDQ==", + "dev": true + }, + "node_modules/echarts": { + "version": "6.1.0", + "resolved": "https://registry.npmmirror.com/echarts/-/echarts-6.1.0.tgz", + "integrity": "sha512-q0yaFPggC9FUdsWH4blavRWFmxdrIodbkoKNAjJudAI6CA9gNPxHtV2RcZNEepZVlk4yvBYkOkbk6HIVpIyHZA==", "dev": true, - "optional": true, - "os": [ - "openbsd" - ], - "engines": { - "node": ">=18" + "dependencies": { + "tslib": "2.3.0", + "zrender": "6.1.0" } }, - "node_modules/electron-vite/node_modules/@esbuild/openharmony-arm64": { - "version": "0.25.12", - "resolved": "https://registry.npmmirror.com/@esbuild/openharmony-arm64/-/openharmony-arm64-0.25.12.tgz", - "integrity": "sha512-rm0YWsqUSRrjncSXGA7Zv78Nbnw4XL6/dzr20cyrQf7ZmRcsovpcRBdhD43Nuk3y7XIoW2OxMVvwuRvk9XdASg==", - "cpu": [ - "arm64" - ], + "node_modules/echarts/node_modules/tslib": { + "version": "2.3.0", + "resolved": "https://registry.npmmirror.com/tslib/-/tslib-2.3.0.tgz", + "integrity": "sha512-N82ooyxVNm6h1riLCoyS9e3fuJ3AMG2zIZs2Gd1ATcSFjSA23Q0fzjjZeh0jbJvWVDZ0cJT8yaNNaaXHzueNjg==", + "dev": true + }, + "node_modules/ejs": { + "version": "3.1.10", + "resolved": "https://registry.npmmirror.com/ejs/-/ejs-3.1.10.tgz", + "integrity": "sha512-UeJmFfOrAQS8OJWPZ4qtgHyWExa088/MtK5UEyoJGFH67cDEXkZSviOiKRCZ4Xij0zxI3JECgYs3oKx+AizQBA==", "dev": true, - "optional": true, - "os": [ - "openharmony" - ], + "dependencies": { + "jake": "^10.8.5" + }, + "bin": { + "ejs": "bin/cli.js" + }, "engines": { - "node": ">=18" + "node": ">=0.10.0" } }, - "node_modules/electron-vite/node_modules/@esbuild/sunos-x64": { - "version": "0.25.12", - "resolved": "https://registry.npmmirror.com/@esbuild/sunos-x64/-/sunos-x64-0.25.12.tgz", - "integrity": "sha512-3wGSCDyuTHQUzt0nV7bocDy72r2lI33QL3gkDNGkod22EsYl04sMf0qLb8luNKTOmgF/eDEDP5BFNwoBKH441w==", - "cpu": [ - "x64" - ], + "node_modules/electron": { + "version": "44.9.1", + "resolved": "https://registry.npmjs.org/electron/-/electron-44.9.1.tgz", + "integrity": "sha512-x/tECFFDa2OFNjMObFH0EGKWrCnFZPOR1wP2iMIVt0STecGl8FmDXdaiaryY0kf8mtw9kSLP2yK8dfdaWkfDmw==", "dev": true, - "optional": true, - "os": [ - "sunos" - ], + "license": "MIT", + "dependencies": { + "@electron-internal/extract-zip": "^1.0.1", + "@electron/get": "^5.0.0", + "@types/node": "^24.9.0" + }, + "bin": { + "electron": "cli.js", + "install-electron": "install.js" + }, "engines": { - "node": ">=18" + "node": ">= 22.12.0" } }, - "node_modules/electron-vite/node_modules/@esbuild/win32-arm64": { - "version": "0.25.12", - "resolved": "https://registry.npmmirror.com/@esbuild/win32-arm64/-/win32-arm64-0.25.12.tgz", - "integrity": "sha512-rMmLrur64A7+DKlnSuwqUdRKyd3UE7oPJZmnljqEptesKM8wx9J8gx5u0+9Pq0fQQW8vqeKebwNXdfOyP+8Bsg==", - "cpu": [ - "arm64" - ], + "node_modules/electron-builder": { + "version": "26.15.3", + "resolved": "https://registry.npmmirror.com/electron-builder/-/electron-builder-26.15.3.tgz", + "integrity": "sha512-a1KM5heqS3gQCZzizXEI8RjJy3QVogULPdeSknt76uLDpBIW/HDGsMg/XgP0riP6PI9COsRvFITKKGDqA8fJxA==", "dev": true, - "optional": true, - "os": [ - "win32" - ], + "dependencies": { + "app-builder-lib": "26.15.3", + "builder-util": "26.15.3", + "builder-util-runtime": "9.7.0", + "chalk": "^4.1.2", + "ci-info": "^4.2.0", + "dmg-builder": "26.15.3", + "fs-extra": "^10.1.0", + "lazy-val": "^1.0.5", + "simple-update-notifier": "2.0.0", + "yargs": "^17.6.2" + }, + "bin": { + "electron-builder": "cli.js", + "install-app-deps": "install-app-deps.js" + }, "engines": { - "node": ">=18" + "node": ">=14.0.0" } }, - "node_modules/electron-vite/node_modules/@esbuild/win32-ia32": { - "version": "0.25.12", - "resolved": "https://registry.npmmirror.com/@esbuild/win32-ia32/-/win32-ia32-0.25.12.tgz", - "integrity": "sha512-HkqnmmBoCbCwxUKKNPBixiWDGCpQGVsrQfJoVGYLPT41XWF8lHuE5N6WhVia2n4o5QK5M4tYr21827fNhi4byQ==", - "cpu": [ - "ia32" - ], + "node_modules/electron-builder-squirrel-windows": { + "version": "26.15.3", + "resolved": "https://registry.npmmirror.com/electron-builder-squirrel-windows/-/electron-builder-squirrel-windows-26.15.3.tgz", + "integrity": "sha512-Jc19XPV9y9+2bAdZPkXuVNGNIEFBq9poHC61l8Kv6FdK7DRG3+Ic0rerC0DXOaeHNz8yW0fg/JnF8GQROOF5MA==", "dev": true, - "optional": true, - "os": [ - "win32" - ], - "engines": { - "node": ">=18" + "peer": true, + "dependencies": { + "app-builder-lib": "26.15.3", + "builder-util": "26.15.3", + "electron-winstaller": "5.4.0" } }, - "node_modules/electron-vite/node_modules/@esbuild/win32-x64": { - "version": "0.25.12", - "resolved": "https://registry.npmmirror.com/@esbuild/win32-x64/-/win32-x64-0.25.12.tgz", - "integrity": "sha512-alJC0uCZpTFrSL0CCDjcgleBXPnCrEAhTBILpeAp7M/OFgoqtAetfBzX0xM00MUsVVPpVjlPuMbREqnZCXaTnA==", - "cpu": [ - "x64" - ], + "node_modules/electron-publish": { + "version": "26.15.3", + "resolved": "https://registry.npmmirror.com/electron-publish/-/electron-publish-26.15.3.tgz", + "integrity": "sha512-g/2bn8YTavY4cuS5F+jOS7zmZbXXBV8KZ8yHKfJjFPoKtzBqrpCdNPxBd3tqdBwP7BVd0lGzf7Bk2s0KesWZ4Q==", "dev": true, - "optional": true, - "os": [ - "win32" - ], - "engines": { - "node": ">=18" + "dependencies": { + "@types/fs-extra": "^9.0.11", + "aws4": "^1.13.2", + "builder-util": "26.15.3", + "builder-util-runtime": "9.7.0", + "chalk": "^4.1.2", + "form-data": "^4.0.5", + "fs-extra": "^10.1.0", + "lazy-val": "^1.0.5", + "mime": "^2.5.2" } }, - "node_modules/electron-vite/node_modules/esbuild": { - "version": "0.25.12", - "resolved": "https://registry.npmmirror.com/esbuild/-/esbuild-0.25.12.tgz", - "integrity": "sha512-bbPBYYrtZbkt6Os6FiTLCTFxvq4tt3JKall1vRwshA3fdVztsLAatFaZobhkBC8/BrPetoa0oksYoKXoG4ryJg==", + "node_modules/electron-to-chromium": { + "version": "1.5.443", + "resolved": "https://registry.npmmirror.com/electron-to-chromium/-/electron-to-chromium-1.5.443.tgz", + "integrity": "sha512-TDJG36L9A3CWWwZ97HKaE+Iz1sW80pNp6sAU0owzCIV3Zc9eVyRqZK8Vz6NKuMIU8WjP0pIkoqCa0VRf/yFD0Q==", + "dev": true + }, + "node_modules/electron-vite": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/electron-vite/-/electron-vite-6.0.0.tgz", + "integrity": "sha512-zafg2uizgll7jdx0BNDkkzO/SowsUBsiHqYN3v9Ieq7XPDHreRGZ4G9IRY/+RslgBktpLOjLM4jlP+IVpV0BGw==", "dev": true, - "hasInstallScript": true, + "license": "MIT", + "dependencies": { + "@babel/core": "^7.29.7", + "@babel/plugin-transform-arrow-functions": "^7.29.7", + "cac": "^7.0.0", + "magic-string": "^1.4.2", + "picocolors": "^1.1.1", + "rolldown": "~1.2.10" + }, "bin": { - "esbuild": "bin/esbuild" + "electron-vite": "bin/electron-vite.js" }, "engines": { - "node": ">=18" + "node": "^20.19.0 || >=22.12.0" }, - "optionalDependencies": { - "@esbuild/aix-ppc64": "0.25.12", - "@esbuild/android-arm": "0.25.12", - "@esbuild/android-arm64": "0.25.12", - "@esbuild/android-x64": "0.25.12", - "@esbuild/darwin-arm64": "0.25.12", - "@esbuild/darwin-x64": "0.25.12", - "@esbuild/freebsd-arm64": "0.25.12", - "@esbuild/freebsd-x64": "0.25.12", - "@esbuild/linux-arm": "0.25.12", - "@esbuild/linux-arm64": "0.25.12", - "@esbuild/linux-ia32": "0.25.12", - "@esbuild/linux-loong64": "0.25.12", - "@esbuild/linux-mips64el": "0.25.12", - "@esbuild/linux-ppc64": "0.25.12", - "@esbuild/linux-riscv64": "0.25.12", - "@esbuild/linux-s390x": "0.25.12", - "@esbuild/linux-x64": "0.25.12", - "@esbuild/netbsd-arm64": "0.25.12", - "@esbuild/netbsd-x64": "0.25.12", - "@esbuild/openbsd-arm64": "0.25.12", - "@esbuild/openbsd-x64": "0.25.12", - "@esbuild/openharmony-arm64": "0.25.12", - "@esbuild/sunos-x64": "0.25.12", - "@esbuild/win32-arm64": "0.25.12", - "@esbuild/win32-ia32": "0.25.12", - "@esbuild/win32-x64": "0.25.12" + "peerDependencies": { + "@swc/core": "^1.0.0", + "vite": "^6.0.0 || ^7.0.0 || ^8.0.0" + }, + "peerDependenciesMeta": { + "@swc/core": { + "optional": true + } + } + }, + "node_modules/electron-vite/node_modules/magic-string": { + "version": "1.4.5", + "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-1.4.5.tgz", + "integrity": "sha512-oLLC2+YvQUfAa+vxoufE/yc1icb87M9iXIRqAoR/2EhE/8cb3SF/+Gi0c2By1B+5Vz2e2vQtUvHiu1+63Znh+w==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jridgewell/sourcemap-codec": "^1.6.0" } }, "node_modules/electron-winstaller": { @@ -6764,47 +5928,6 @@ "node": ">= 0.4" } }, - "node_modules/esbuild": { - "version": "0.28.2", - "resolved": "https://registry.npmmirror.com/esbuild/-/esbuild-0.28.2.tgz", - "integrity": "sha512-HKVLS8dvII+xoKW9kmqxbRKrnWEXfJJr/FZhhJmiqIB0e053QNYFqOBouTMO/k5sID4MvCiUCvv8b9M4h32wIA==", - "dev": true, - "hasInstallScript": true, - "bin": { - "esbuild": "bin/esbuild" - }, - "engines": { - "node": ">=18" - }, - "optionalDependencies": { - "@esbuild/aix-ppc64": "0.28.2", - "@esbuild/android-arm": "0.28.2", - "@esbuild/android-arm64": "0.28.2", - "@esbuild/android-x64": "0.28.2", - "@esbuild/darwin-arm64": "0.28.2", - "@esbuild/darwin-x64": "0.28.2", - "@esbuild/freebsd-arm64": "0.28.2", - "@esbuild/freebsd-x64": "0.28.2", - "@esbuild/linux-arm": "0.28.2", - "@esbuild/linux-arm64": "0.28.2", - "@esbuild/linux-ia32": "0.28.2", - "@esbuild/linux-loong64": "0.28.2", - "@esbuild/linux-mips64el": "0.28.2", - "@esbuild/linux-ppc64": "0.28.2", - "@esbuild/linux-riscv64": "0.28.2", - "@esbuild/linux-s390x": "0.28.2", - "@esbuild/linux-x64": "0.28.2", - "@esbuild/netbsd-arm64": "0.28.2", - "@esbuild/netbsd-x64": "0.28.2", - "@esbuild/openbsd-arm64": "0.28.2", - "@esbuild/openbsd-x64": "0.28.2", - "@esbuild/openharmony-arm64": "0.28.2", - "@esbuild/sunos-x64": "0.28.2", - "@esbuild/win32-arm64": "0.28.2", - "@esbuild/win32-ia32": "0.28.2", - "@esbuild/win32-x64": "0.28.2" - } - }, "node_modules/escalade": { "version": "3.2.0", "resolved": "https://registry.npmmirror.com/escalade/-/escalade-3.2.0.tgz", @@ -8955,9 +8078,9 @@ "dev": true }, "node_modules/nanoid": { - "version": "3.3.19", - "resolved": "https://registry.npmmirror.com/nanoid/-/nanoid-3.3.19.tgz", - "integrity": "sha512-Y2tUNy4ouw6tq5oDSKeQYGOyhkUBhNOcGV/02KC+6kd9eDGqdZd++mjMiIDilrBYvjEnCYvVtsuHCuP+okSfug==", + "version": "3.3.20", + "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.20.tgz", + "integrity": "sha512-uKdg2G3GNCKQn9byYOpxbGqrT2fGO5KRt5J/8b3pok8rT6qxGWF6hxMyJiEYtAf+FVyYuD9hRaDqX5uPFYJ4ZQ==", "dev": true, "funding": [ { @@ -8965,11 +8088,30 @@ "url": "https://github.com/sponsors/ai" } ], - "bin": { - "nanoid": "bin/nanoid.cjs" - }, + "license": "MIT", + "bin": { + "nanoid": "bin/nanoid.cjs" + }, + "engines": { + "node": "^10 || ^12 || ^13.7 || ^14 || >=15.0.1" + } + }, + "node_modules/napi-windows-process-start-time": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/napi-windows-process-start-time/-/napi-windows-process-start-time-0.1.0.tgz", + "integrity": "sha512-zHxhzKsIFu3elch3eFw69WEUGc79DFhbc3nD/WEOzWL/pFFLZRW13EHnuO0c+0YjncE5uCaS9ICHxOBXkb6vPw==", + "cpu": [ + "x64", + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], "engines": { - "node": "^10 || ^12 || ^13.7 || ^14 || >=15.0.1" + "node": ">=20" } }, "node_modules/node-abi": { @@ -9355,9 +8497,9 @@ } }, "node_modules/postcss": { - "version": "8.5.28", - "resolved": "https://registry.npmmirror.com/postcss/-/postcss-8.5.28.tgz", - "integrity": "sha512-RRuzqDtt5Y9h3quz5hWhK+TPnsmVs6WwSU6LkJMeY4HstUEDuYTG8UJSdawMRzmzAtV+KEoG8N3Qg2qLy5vM/A==", + "version": "8.5.33", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.5.33.tgz", + "integrity": "sha512-RVHEU9/Pp1Fnjr/MpAJsZoADukCKhfIi15OunEYiGktIkYLkPVvC1sioWolGDS7XByMTx9m/IGbro0Js13zhnQ==", "dev": true, "funding": [ { @@ -9373,10 +8515,11 @@ "url": "https://github.com/sponsors/ai" } ], + "license": "MIT", "dependencies": { - "nanoid": "^3.3.18", + "nanoid": "^3.3.20", "picocolors": "^1.1.1", - "source-map-js": "^1.2.1" + "source-map-js": "^1.2.2" }, "engines": { "node": "^10 || ^12 || >=14" @@ -9990,49 +9133,49 @@ "rimraf": "bin.js" } }, - "node_modules/rollup": { - "version": "4.63.6", - "resolved": "https://registry.npmmirror.com/rollup/-/rollup-4.63.6.tgz", - "integrity": "sha512-w4+GKyTBqshj84F1GF3s2zxAPFZPEmNkCbQtqilsYS7GsksmX6VoV7UggfZg8sUHCCOkBe7UtQp6fZwbH311FQ==", + "node_modules/rolldown": { + "version": "1.2.19", + "resolved": "https://registry.npmjs.org/rolldown/-/rolldown-1.2.19.tgz", + "integrity": "sha512-QIiV1J9d0pzN4jeeTH4sjPy0AZ6cAy2cG0ExeoE1+U8Rvj+hR3gYkokx0YbeUNGlZqiQJJ2utcETe0oKXwzsuA==", "dev": true, + "license": "MIT", "dependencies": { - "@types/estree": "1.0.9" + "@oxc-project/types": "=0.156.0", + "@rolldown/pluginutils": "^1.0.0" }, "bin": { - "rollup": "dist/bin/rollup" + "rolldown": "bin/cli.mjs" }, "engines": { - "node": ">=18.0.0", - "npm": ">=8.0.0" + "node": "^20.19.0 || >=22.12.0" }, "optionalDependencies": { - "@napi-rs/lzma-linux-x64-gnu": "1.5.1", - "@rollup/rollup-android-arm-eabi": "4.63.6", - "@rollup/rollup-android-arm64": "4.63.6", - "@rollup/rollup-darwin-arm64": "4.63.6", - "@rollup/rollup-darwin-x64": "4.63.6", - "@rollup/rollup-freebsd-arm64": "4.63.6", - "@rollup/rollup-freebsd-x64": "4.63.6", - "@rollup/rollup-linux-arm-gnueabihf": "4.63.6", - "@rollup/rollup-linux-arm-musleabihf": "4.63.6", - "@rollup/rollup-linux-arm64-gnu": "4.63.6", - "@rollup/rollup-linux-arm64-musl": "4.63.6", - "@rollup/rollup-linux-loong64-gnu": "4.63.6", - "@rollup/rollup-linux-loong64-musl": "4.63.6", - "@rollup/rollup-linux-ppc64-gnu": "4.63.6", - "@rollup/rollup-linux-ppc64-musl": "4.63.6", - "@rollup/rollup-linux-riscv64-gnu": "4.63.6", - "@rollup/rollup-linux-riscv64-musl": "4.63.6", - "@rollup/rollup-linux-s390x-gnu": "4.63.6", - "@rollup/rollup-linux-x64-gnu": "4.63.6", - "@rollup/rollup-linux-x64-musl": "4.63.6", - "@rollup/rollup-openbsd-x64": "4.63.6", - "@rollup/rollup-openharmony-arm64": "4.63.6", - "@rollup/rollup-win32-arm64-msvc": "4.63.6", - "@rollup/rollup-win32-ia32-msvc": "4.63.6", - "@rollup/rollup-win32-x64-gnu": "4.63.6", - "@rollup/rollup-win32-x64-msvc": "4.63.6", - "fsevents": "~2.3.2" + "@rolldown/binding-android-arm-eabi": "1.2.19", + "@rolldown/binding-android-arm64": "1.2.19", + "@rolldown/binding-darwin-arm64": "1.2.19", + "@rolldown/binding-darwin-x64": "1.2.19", + "@rolldown/binding-freebsd-x64": "1.2.19", + "@rolldown/binding-linux-arm-gnueabihf": "1.2.19", + "@rolldown/binding-linux-arm64-gnu": "1.2.19", + "@rolldown/binding-linux-arm64-musl": "1.2.19", + "@rolldown/binding-linux-ppc64-gnu": "1.2.19", + "@rolldown/binding-linux-s390x-gnu": "1.2.19", + "@rolldown/binding-linux-x64-gnu": "1.2.19", + "@rolldown/binding-linux-x64-musl": "1.2.19", + "@rolldown/binding-openharmony-arm64": "1.2.19", + "@rolldown/binding-wasm32-wasi": "1.2.19", + "@rolldown/binding-win32-arm64-msvc": "1.2.19", + "@rolldown/binding-win32-x64-msvc": "1.2.19" + } + }, + "node_modules/rolldown/node_modules/@oxc-project/types": { + "version": "0.156.0", + "resolved": "https://registry.npmjs.org/@oxc-project/types/-/types-0.156.0.tgz", + "integrity": "sha512-1Duyg48TdJNdyhEB8Xn1L36bT9Pv6GUtlKjHxOys8xkaF/rQq3XJE+bAurSK/AgIz5mGFsb77cn9Pb20+WCScw==", + "dev": true, + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/oxc-project" } }, "node_modules/safe-buffer": { @@ -10854,18 +9997,17 @@ } }, "node_modules/vite": { - "version": "7.3.7", - "resolved": "https://registry.npmjs.org/vite/-/vite-7.3.7.tgz", - "integrity": "sha512-AHEzTORMbi7/7aXp7w7KZ5+DCUdSeLsJz0grY8xHpc9DHdYb0vQu6DqJfm2tOw3gDExNgPgnJTXxM6syYFHaCA==", + "version": "8.4.0", + "resolved": "https://registry.npmjs.org/vite/-/vite-8.4.0.tgz", + "integrity": "sha512-X2nUJg+9cutlz3hzqyO6p+WTwk9H257DjwAEf9EQYUFrQbDItmetadi9gYmb+l7VDy4r3VXLUnmLTwuPmzejDw==", "dev": true, "license": "MIT", "dependencies": { - "esbuild": "^0.27.0 || ^0.28.0", - "fdir": "^6.5.0", - "picomatch": "^4.0.3", - "postcss": "^8.5.6", - "rollup": "^4.43.0", - "tinyglobby": "^0.2.15" + "lightningcss": "^1.33.0", + "picomatch": "^4.0.7", + "postcss": "^8.5.33", + "rolldown": "~1.3.2", + "tinyglobby": "^0.2.17" }, "bin": { "vite": "bin/vite.js" @@ -10877,13 +10019,15 @@ "url": "https://github.com/vitejs/vite?sponsor=1" }, "optionalDependencies": { - "fsevents": "~2.3.3" + "fsevents": "~2.3.3", + "napi-windows-process-start-time": "^0.1.0" }, "peerDependencies": { "@types/node": "^20.19.0 || >=22.12.0", + "@vitejs/devtools": "^0.7.1 || ^0.8.0", + "esbuild": "^0.27.0 || ^0.28.0", "jiti": ">=1.21.0", "less": "^4.0.0", - "lightningcss": "^1.21.0", "sass": "^1.70.0", "sass-embedded": "^1.70.0", "stylus": ">=0.54.8", @@ -10896,13 +10040,16 @@ "@types/node": { "optional": true }, - "jiti": { + "@vitejs/devtools": { "optional": true }, - "less": { + "esbuild": { + "optional": true + }, + "jiti": { "optional": true }, - "lightningcss": { + "less": { "optional": true }, "sass": { @@ -10928,6 +10075,341 @@ } } }, + "node_modules/vite/node_modules/@oxc-project/types": { + "version": "0.160.0", + "resolved": "https://registry.npmjs.org/@oxc-project/types/-/types-0.160.0.tgz", + "integrity": "sha512-gw4k9syEmnckbOgw2A2FU1TBDdX9hfwV9jEn/uio65pguPzwWiXQS3OIJDMEhv9m06tj9XiEe6RoD0YA+LgreA==", + "dev": true, + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/oxc-project" + } + }, + "node_modules/vite/node_modules/@rolldown/binding-android-arm-eabi": { + "version": "1.3.4", + "resolved": "https://registry.npmjs.org/@rolldown/binding-android-arm-eabi/-/binding-android-arm-eabi-1.3.4.tgz", + "integrity": "sha512-xCW8CkL/ualx/SbYqeG9iK87lJCZGDQ0soE+kaORJ0Bd+pHALyE4qK7BStmEAyYWLEzZ3/biSIpA6/7GDFvzIg==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/vite/node_modules/@rolldown/binding-android-arm64": { + "version": "1.3.4", + "resolved": "https://registry.npmjs.org/@rolldown/binding-android-arm64/-/binding-android-arm64-1.3.4.tgz", + "integrity": "sha512-5lifIO+b/prcM9sx/bkPN4w6UEToEfQ3gjhx0+0neuL+dkYskI792CfAq03T51jc8JFcaYXs2hi3l8RjiH/VWQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/vite/node_modules/@rolldown/binding-darwin-arm64": { + "version": "1.3.4", + "resolved": "https://registry.npmjs.org/@rolldown/binding-darwin-arm64/-/binding-darwin-arm64-1.3.4.tgz", + "integrity": "sha512-RCgxTI4AJQxhVF//BI3ImQOsXTHrF4Eg+f99jBy8WoETA2kSEGFxpnrVmW0leQq/2aBR4R5AC6csmy3rc66e3Q==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/vite/node_modules/@rolldown/binding-darwin-x64": { + "version": "1.3.4", + "resolved": "https://registry.npmjs.org/@rolldown/binding-darwin-x64/-/binding-darwin-x64-1.3.4.tgz", + "integrity": "sha512-zNPJVVPUaDEj+L0lImoK3rFv2b+Z5gNijI6DWu/fcD3/1TfmRXKb9ZyxbSN+2AhlctqjbNzUvCsMa+EBhnEM4Q==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/vite/node_modules/@rolldown/binding-freebsd-x64": { + "version": "1.3.4", + "resolved": "https://registry.npmjs.org/@rolldown/binding-freebsd-x64/-/binding-freebsd-x64-1.3.4.tgz", + "integrity": "sha512-upP6g7ZIRy5by1RDQ/EphHIdJ5xK0eUD7sUgfZFWJ49s4XdbYsIvIlAPtrFpayR70Hhf9J22lb4Pm8/9FhrZmg==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/vite/node_modules/@rolldown/binding-linux-arm-gnueabihf": { + "version": "1.3.4", + "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-arm-gnueabihf/-/binding-linux-arm-gnueabihf-1.3.4.tgz", + "integrity": "sha512-SAX5C5+poMLCxu8dkPF6h5yst40rkzs+9Y3cbPn2OFSydmHjAEprrGi64zGgnYyPIVZfdGUFqJ2fJbfbnHI+mA==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/vite/node_modules/@rolldown/binding-linux-arm64-gnu": { + "version": "1.3.4", + "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-arm64-gnu/-/binding-linux-arm64-gnu-1.3.4.tgz", + "integrity": "sha512-nwHqdlRZS6GWBef3dG5/pMY6RNTBBUjj7s0Da+m6xsFpe7jx6IC46SLZcCu8f46JOfCovZmwnrz51EzGE+7Fyw==", + "cpu": [ + "arm64" + ], + "dev": true, + "libc": [ + "glibc" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/vite/node_modules/@rolldown/binding-linux-arm64-musl": { + "version": "1.3.4", + "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-arm64-musl/-/binding-linux-arm64-musl-1.3.4.tgz", + "integrity": "sha512-Gr78X2ur/AgLCkmZgHffk/FerIX8S5zb/eII4bCcvJo0ANzeXhTShahdNbpnY6bpiszIAgIfiuKS9ziziWsamw==", + "cpu": [ + "arm64" + ], + "dev": true, + "libc": [ + "musl" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/vite/node_modules/@rolldown/binding-linux-ppc64-gnu": { + "version": "1.3.4", + "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-ppc64-gnu/-/binding-linux-ppc64-gnu-1.3.4.tgz", + "integrity": "sha512-o9Wcn8nWrsQasaBRYM4d//FwhlBsTJYWkPVlhlt6FwzpwEoovY4IopRZjk5Fq3+ntRuSDORJjF/nA8sFeF2q6w==", + "cpu": [ + "ppc64" + ], + "dev": true, + "libc": [ + "glibc" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/vite/node_modules/@rolldown/binding-linux-s390x-gnu": { + "version": "1.3.4", + "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-s390x-gnu/-/binding-linux-s390x-gnu-1.3.4.tgz", + "integrity": "sha512-UDWu4jkVcx2kiBKm3Ec//4lVCbeTWj8gmJ9SyLWCdLWtTlyq7fQVeVV/14nXvRtSLErvJ2+yA/Ux5taS31Y17Q==", + "cpu": [ + "s390x" + ], + "dev": true, + "libc": [ + "glibc" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/vite/node_modules/@rolldown/binding-linux-x64-gnu": { + "version": "1.3.4", + "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-x64-gnu/-/binding-linux-x64-gnu-1.3.4.tgz", + "integrity": "sha512-W9mGtTa0w4fWh8RLMNPyaEhhcuqUfO07Q4I1bBc4PDMNg7gQSw0yPQNQ3D0qwbkXwxbyL4YrIzc8n6k1vuFExQ==", + "cpu": [ + "x64" + ], + "dev": true, + "libc": [ + "glibc" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/vite/node_modules/@rolldown/binding-linux-x64-musl": { + "version": "1.3.4", + "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-x64-musl/-/binding-linux-x64-musl-1.3.4.tgz", + "integrity": "sha512-8B+ofyQZ7/aCmkqnyMonPr5zKLqMVNczhRGFNtdIuItiwNn8iQWJawMq2E58r7bxD1XEbtRRsULY/eCWwZQ01Q==", + "cpu": [ + "x64" + ], + "dev": true, + "libc": [ + "musl" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/vite/node_modules/@rolldown/binding-openharmony-arm64": { + "version": "1.3.4", + "resolved": "https://registry.npmjs.org/@rolldown/binding-openharmony-arm64/-/binding-openharmony-arm64-1.3.4.tgz", + "integrity": "sha512-TlD0FSZaC7o2B4NCe9V5N11ugTnhzTM9ksj4sgRLvrKosDzjEkvlsTX3ehkw4ZlPv8AADimZZTvJGEa16pfXug==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "openharmony" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/vite/node_modules/@rolldown/binding-wasm32-wasi": { + "version": "1.3.4", + "resolved": "https://registry.npmjs.org/@rolldown/binding-wasm32-wasi/-/binding-wasm32-wasi-1.3.4.tgz", + "integrity": "sha512-jwO8P3o53ygo7b5061B7BeaJ1BGv3BKZ6jroFdw/01qWry7Z+qNBlDvulzbTle5s/A0Fc1FRgsTxrke9DvsSbA==", + "cpu": [ + "wasm32" + ], + "dev": true, + "license": "MIT", + "optional": true, + "dependencies": { + "@oxc-project/types": "0.160.0" + }, + "engines": { + "node": "^20.19.0 || ^22.13.0 || >=23.5.0" + } + }, + "node_modules/vite/node_modules/@rolldown/binding-win32-arm64-msvc": { + "version": "1.3.4", + "resolved": "https://registry.npmjs.org/@rolldown/binding-win32-arm64-msvc/-/binding-win32-arm64-msvc-1.3.4.tgz", + "integrity": "sha512-8adGMrNtrdzi2WD1ozhYapER59gD8Q/DV6SCKJlyG2HqULPdeQUBvMa33lTsiEYwIqTZUaIU2MmvPp5f1wbtXA==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/vite/node_modules/@rolldown/binding-win32-x64-msvc": { + "version": "1.3.4", + "resolved": "https://registry.npmjs.org/@rolldown/binding-win32-x64-msvc/-/binding-win32-x64-msvc-1.3.4.tgz", + "integrity": "sha512-rIMjtESdXJCIoOiUTroQ1Y1rjVDZkuUVRUxs3APX2vNv175D7TDWvzdELiIhzGq9cUNUFat+co+PTmPHPqSREg==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/vite/node_modules/rolldown": { + "version": "1.3.4", + "resolved": "https://registry.npmjs.org/rolldown/-/rolldown-1.3.4.tgz", + "integrity": "sha512-p2rq4bfBmF0M6yaR8+A89fbkBQynZI2fxUW4G07eq9kpctAkpo7q5BZ4X4Mo4XZ7HHROu33cX9PeopUFN6u+2Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "@oxc-project/types": "=0.160.0", + "@rolldown/pluginutils": "^1.0.0" + }, + "bin": { + "rolldown": "bin/cli.mjs" + }, + "engines": { + "node": "^20.19.0 || >=22.12.0" + }, + "optionalDependencies": { + "@rolldown/binding-android-arm-eabi": "1.3.4", + "@rolldown/binding-android-arm64": "1.3.4", + "@rolldown/binding-darwin-arm64": "1.3.4", + "@rolldown/binding-darwin-x64": "1.3.4", + "@rolldown/binding-freebsd-x64": "1.3.4", + "@rolldown/binding-linux-arm-gnueabihf": "1.3.4", + "@rolldown/binding-linux-arm64-gnu": "1.3.4", + "@rolldown/binding-linux-arm64-musl": "1.3.4", + "@rolldown/binding-linux-ppc64-gnu": "1.3.4", + "@rolldown/binding-linux-s390x-gnu": "1.3.4", + "@rolldown/binding-linux-x64-gnu": "1.3.4", + "@rolldown/binding-linux-x64-musl": "1.3.4", + "@rolldown/binding-openharmony-arm64": "1.3.4", + "@rolldown/binding-wasm32-wasi": "1.3.4", + "@rolldown/binding-win32-arm64-msvc": "1.3.4", + "@rolldown/binding-win32-x64-msvc": "1.3.4" + } + }, "node_modules/w3c-xmlserializer": { "version": "6.0.0", "resolved": "https://registry.npmmirror.com/w3c-xmlserializer/-/w3c-xmlserializer-6.0.0.tgz", diff --git a/package.json b/package.json index 697c7c7..56060a0 100644 --- a/package.json +++ b/package.json @@ -43,7 +43,7 @@ "echarts": "^6.1.0", "electron": "^44.9.1", "electron-builder": "^26.15.3", - "electron-vite": "^5.0.0", + "electron-vite": "^6.0.0", "jsdom": "^31.0.1", "lucide-react": "^1.77.0", "markdown-it": "^15.0.3", @@ -55,7 +55,7 @@ "tailwindcss": "^4.3.5", "tw-shimmer": "^0.4.14", "typescript": "^5.9.3", - "vite": "^7.3.7", + "vite": "^8.4.0", "zustand": "^5.1.0" }, "dependencies": { From 3c1fd09ce1445dc862c49e2c4859f911d73a5364 Mon Sep 17 00:00:00 2001 From: Liang Date: Fri, 27 Nov 2026 06:05:28 +0800 Subject: [PATCH 2/9] test: migrate the suite from node:test to Vitest Run the unit tests with Vitest instead of `node --test`. - Import `test` from `vitest` in every test file. - Replace `t.after` with `t.onTestFinished`, and `t.mock.timers` with `vi.useFakeTimers` and `vi.advanceTimersByTime`. - Turn off Vite's module runner in `vite.config.mts`, so the tests keep using native Node.js imports and their `module.registerHooks` fixtures. --- AGENTS.md | 4 +- package-lock.json | 261 +++++++++++++++++++++++++ package.json | 3 +- tests/account-login.test.mjs | 7 +- tests/account-store.test.mjs | 2 +- tests/agri-regions.test.mjs | 2 +- tests/ai-history.test.mjs | 4 +- tests/ai-settings-draft.test.mjs | 2 +- tests/annotation-references.test.mjs | 2 +- tests/button-loading-icon.test.mjs | 2 +- tests/decision-sandbox.test.mjs | 2 +- tests/drawing-store.test.mjs | 4 +- tests/eoq-ui.test.mjs | 6 +- tests/ffmpeg-fetch.test.mjs | 2 +- tests/flight-framing.test.mjs | 2 +- tests/flight-stops.test.mjs | 2 +- tests/gcj02.test.mjs | 2 +- tests/globe-navigation.test.mjs | 12 +- tests/globe-surface.test.mjs | 2 +- tests/hawdb-fetch.test.mjs | 2 +- tests/hawdb.test.mjs | 12 +- tests/hsr-lines.test.mjs | 2 +- tests/live-typhoons.test.mjs | 2 +- tests/migration-geometry.test.mjs | 2 +- tests/model-importer.test.mjs | 2 +- tests/model-test.test.mjs | 2 +- tests/mountain-zonation.test.mjs | 2 +- tests/night-basemap.test.mjs | 2 +- tests/notable-peaks.test.mjs | 2 +- tests/offscreen-camera.test.mjs | 2 +- tests/offscreen-container.test.mjs | 2 +- tests/offscreen-mac.test.mjs | 2 +- tests/offscreen-paths.test.mjs | 2 +- tests/offscreen-state.test.mjs | 2 +- tests/offscreen-timing.test.mjs | 2 +- tests/online-data.test.mjs | 2 +- tests/packaging.test.mjs | 2 +- tests/passport-account.test.mjs | 2 +- tests/poi-aggregation.test.mjs | 2 +- tests/poi-categories.test.mjs | 2 +- tests/population-layer.test.mjs | 2 +- tests/pr-review.test.mjs | 13 +- tests/pr95-fixes.test.mjs | 2 +- tests/privacy.test.mjs | 2 +- tests/recording-state.test.mjs | 2 +- tests/recording.test.mjs | 2 +- tests/renderer-review.test.mjs | 25 +-- tests/resource-failure.test.mjs | 2 +- tests/scene-camera.test.mjs | 2 +- tests/sea-level-seed.test.mjs | 2 +- tests/sea-level.test.mjs | 2 +- tests/shape-graphics.test.mjs | 2 +- tests/terrain-availability.test.mjs | 2 +- tests/terrain-providers.test.mjs | 2 +- tests/thematic-layer-ids.test.mjs | 2 +- tests/thematic-request-render.test.mjs | 2 +- tests/theme-mode.test.mjs | 2 +- tests/tile-mirror.test.mjs | 12 +- tests/touch-interaction.test.mjs | 2 +- tests/ui-no-antd.test.mjs | 2 +- tests/ui-triggers.test.mjs | 4 +- tests/update-channel.test.mjs | 2 +- tests/update-dialog.test.mjs | 4 +- tests/update-integrity.test.mjs | 2 +- tests/urban-cities.test.mjs | 2 +- tests/viirs-granule.test.mjs | 2 +- vite.config.mts | 8 + 67 files changed, 380 insertions(+), 103 deletions(-) create mode 100644 vite.config.mts diff --git a/AGENTS.md b/AGENTS.md index 1b520dd..ed65219 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -96,9 +96,11 @@ npm run build # production build npm run fetch:ffmpeg # pinned LGPL FFmpeg for Windows or Linux into resources/bin npm run build:linux # AppImage + deb for Linux x64 and arm64 npm run typecheck # tsc (node) + tsc (web) -npm test # node:test unit tests (tests/*.test.mjs), run by CI +npm test # Vitest unit tests (tests/*.test.mjs), run by CI ``` +Vitest uses native Node.js imports (`experimental.viteModuleRunner: false` in `vite.config.mts`), so the `module.registerHooks` fixtures in the tests can load React components and simulate filesystem failures. + ## Docs - https://ant.design/llms.txt diff --git a/package-lock.json b/package-lock.json index f34308f..7a23c63 100644 --- a/package-lock.json +++ b/package-lock.json @@ -48,6 +48,7 @@ "tw-shimmer": "^0.4.14", "typescript": "^5.9.3", "vite": "^8.4.0", + "vitest": "^5.1.2", "zustand": "^5.1.0" } }, @@ -4442,6 +4443,17 @@ "@babel/types": "^7.28.2" } }, + "node_modules/@types/chai": { + "version": "5.2.3", + "resolved": "https://registry.npmjs.org/@types/chai/-/chai-5.2.3.tgz", + "integrity": "sha512-Mw558oeA9fFbv65/y4mHtXDs9bPnFMZAL/jxdPFUpOHHIXX91mcgEHbS5Lahr+pwZFR8A7GQleRWeI6cGFC2UA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/deep-eql": "*", + "assertion-error": "^2.0.1" + } + }, "node_modules/@types/debug": { "version": "4.1.13", "resolved": "https://registry.npmmirror.com/@types/debug/-/debug-4.1.13.tgz", @@ -4451,6 +4463,13 @@ "@types/ms": "*" } }, + "node_modules/@types/deep-eql": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/@types/deep-eql/-/deep-eql-4.0.2.tgz", + "integrity": "sha512-c9h9dVVMigMPc4bwTvC5dxqtqJZwQPePsWjPlpSOnojbor6pGqdk541lfA7AqFQr5pB1BRdq0juY9db81BwyFw==", + "dev": true, + "license": "MIT" + }, "node_modules/@types/dom-webcodecs": { "version": "0.1.19", "resolved": "https://registry.npmmirror.com/@types/dom-webcodecs/-/dom-webcodecs-0.1.19.tgz", @@ -4590,6 +4609,54 @@ "integrity": "sha512-eybk3TjzzzV97Dlj5c+XrBFW57eTNhzod66y9HrBlzJ6NsCrWCp/2kaPS3K9wJmurBC0Tdw4yPjXKZqlznim3Q==", "dev": true }, + "node_modules/@vitest/mocker": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/@vitest/mocker/-/mocker-5.1.2.tgz", + "integrity": "sha512-UGc97wUIy0Ji2+9GxzHEJiOhiwkaukgE7VYcUNnjpX3sWnwQ8XogmNXX4WyOukxYgKb8Nh2XFa7KId0ZjpmVhQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jridgewell/trace-mapping": "0.3.31", + "@vitest/spy": "5.1.2", + "estree-walker": "^3.0.3", + "magic-string": "^1.4.5" + }, + "funding": { + "url": "https://opencollective.com/vitest" + }, + "peerDependencies": { + "msw": "^2.4.9 || ^3.0.0", + "vite": "^6.0.0 || ^7.0.0 || ^8.0.0" + }, + "peerDependenciesMeta": { + "msw": { + "optional": true + }, + "vite": { + "optional": true + } + } + }, + "node_modules/@vitest/mocker/node_modules/magic-string": { + "version": "1.4.5", + "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-1.4.5.tgz", + "integrity": "sha512-oLLC2+YvQUfAa+vxoufE/yc1icb87M9iXIRqAoR/2EhE/8cb3SF/+Gi0c2By1B+5Vz2e2vQtUvHiu1+63Znh+w==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jridgewell/sourcemap-codec": "^1.6.0" + } + }, + "node_modules/@vitest/spy": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/@vitest/spy/-/spy-5.1.2.tgz", + "integrity": "sha512-PQl0/3+p9GaY71+MHywN6oyHfLhVDD5kcbm7oNRldA2F0ExMU3S8RQdnpteJ9gFAdK5P6KCgE6LqCpUgy57KzA==", + "dev": true, + "license": "MIT", + "funding": { + "url": "https://opencollective.com/vitest" + } + }, "node_modules/@xmldom/xmldom": { "version": "0.8.15", "resolved": "https://registry.npmmirror.com/@xmldom/xmldom/-/xmldom-0.8.15.tgz", @@ -4794,6 +4861,16 @@ "node": ">=12.0.0" } }, + "node_modules/assertion-error": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/assertion-error/-/assertion-error-2.0.1.tgz", + "integrity": "sha512-Izi8RQcffqCeNVgFigKli1ssklIbpHnCYc6AknXGYoB6grJqyeby7jv12JUQgmTAnIDnbck1uxksT4dzN3PWBA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12" + } + }, "node_modules/assistant-cloud": { "version": "0.2.13", "resolved": "https://registry.npmmirror.com/assistant-cloud/-/assistant-cloud-0.2.13.tgz", @@ -5175,6 +5252,16 @@ "node": ">=22.0.0" } }, + "node_modules/chai": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/chai/-/chai-6.3.0.tgz", + "integrity": "sha512-XWAtwJ6OHO+tj0EKCs0Y2UamnyOxseZWltU4x2U2wh8g4AigdjwvtUjvLP2tqkA/avxHEtzxNaqGq/YGNwckKg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=18" + } + }, "node_modules/chalk": { "version": "4.1.2", "resolved": "https://registry.npmmirror.com/chalk/-/chalk-4.1.2.tgz", @@ -5901,6 +5988,13 @@ "node": ">= 0.4" } }, + "node_modules/es-module-lexer": { + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/es-module-lexer/-/es-module-lexer-2.3.2.tgz", + "integrity": "sha512-poHGpORABojJJucnV9KbOavETW8lBVnphkW77ER5/BQ5Fz7oXSoCNek7IH3vR5nRjdsEz926ibFYX8KtLQmdyw==", + "dev": true, + "license": "MIT" + }, "node_modules/es-object-atoms": { "version": "1.1.2", "resolved": "https://registry.npmmirror.com/es-object-atoms/-/es-object-atoms-1.1.2.tgz", @@ -5959,6 +6053,26 @@ "url": "https://opencollective.com/unified" } }, + "node_modules/estree-walker": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-3.0.3.tgz", + "integrity": "sha512-7RUKfXgSMMkzt6ZuXmqapOurLGPPfgj6l9uRZ7lRGolvk0y2yocc35LdcxKC5PQZdn2DMqioAQ2NoWcrTKmm6g==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/estree": "^1.0.0" + } + }, + "node_modules/expect-type": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/expect-type/-/expect-type-1.4.0.tgz", + "integrity": "sha512-KfYbmpRm0VbLjEvVa9yGwCi9GI34xvi7A/HXYWQO65CSD2u3MczUJSuwXKFIxlGsgBQizV9q5J9NHj4VG0n+pA==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": ">=12.0.0" + } + }, "node_modules/exponential-backoff": { "version": "3.1.3", "resolved": "https://registry.npmmirror.com/exponential-backoff/-/exponential-backoff-3.1.3.tgz", @@ -8238,6 +8352,20 @@ "integrity": "sha512-9d1HbpKLh3sdWlhXMhU6MMH+wQzKkrgfRkYV0EBdvt99YJfj0ilCJrWRDYG2130Tm4GXbEoTCx5b34JSaP+HhA==", "dev": true }, + "node_modules/obug": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/obug/-/obug-3.0.0.tgz", + "integrity": "sha512-5vvB5+W7ePv+p3uqxi+RcW1XAzLW0/hxt3/4X4Lc4qHudzOhmBiBwOY6DRob4WnanAEGvNcLjF+KNOufrUoEQw==", + "dev": true, + "funding": [ + "https://github.com/sponsors/sxzz", + "https://opencollective.com/debug" + ], + "license": "MIT", + "engines": { + "node": ">=12.20.0" + } + }, "node_modules/once": { "version": "1.4.0", "resolved": "https://registry.npmmirror.com/once/-/once-1.4.0.tgz", @@ -9352,6 +9480,13 @@ "node": ">= 6" } }, + "node_modules/std-env": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/std-env/-/std-env-4.3.0.tgz", + "integrity": "sha512-OtU/EgQ1kIm5KwqQpBC6ZEMXrZRui11w8zgfTWp8cdO9B8OaPsbA8bTHO2P+HNo1VlUTGMVBwPhydu6poeXiag==", + "dev": true, + "license": "MIT" + }, "node_modules/string_decoder": { "version": "1.1.1", "resolved": "https://registry.npmmirror.com/string_decoder/-/string_decoder-1.1.1.tgz", @@ -9530,6 +9665,26 @@ "semver": "bin/semver" } }, + "node_modules/tinybench": { + "version": "6.2.5", + "resolved": "https://registry.npmjs.org/tinybench/-/tinybench-6.2.5.tgz", + "integrity": "sha512-b/8GRMdnY4cqkfCLyaFpTGIv1qwfi3oT0mWaepwT++6Z/ZrYehNfZZ2JDKVLKGhNoEkS3IIB1ELtCT0XS5DtOA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=20.0.0" + } + }, + "node_modules/tinyexec": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/tinyexec/-/tinyexec-1.4.0.tgz", + "integrity": "sha512-PV6lIcJQh57aFeJDwx16JNHmgFRh5xguzallrDW1qe8nAghYgr5MKz2K5k7wEyV/ygZhdnIAP8+HZSarHPBCsg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=18" + } + }, "node_modules/tinyglobby": { "version": "0.2.17", "resolved": "https://registry.npmmirror.com/tinyglobby/-/tinyglobby-0.2.17.tgz", @@ -10410,6 +10565,99 @@ "@rolldown/binding-win32-x64-msvc": "1.3.4" } }, + "node_modules/vitest": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/vitest/-/vitest-5.1.2.tgz", + "integrity": "sha512-VIa2wXV208WraXUbzH+dQUrGcFpPuaiRA8HlhXS8R6/sy9cynw6OMqGj8fmAlH1hot7huTCtWUE14+FdXU3eLw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/chai": "^5.2.2", + "@vitest/mocker": "5.1.2", + "chai": "^6.3.0", + "es-module-lexer": "^2.3.2", + "expect-type": "^1.4.0", + "magic-string": "^1.4.5", + "obug": "^3.0.0", + "picomatch": "^4.0.7", + "std-env": "^4.3.0", + "tinybench": "^6.2.3", + "tinyexec": "^1.3.1", + "tinyglobby": "^0.2.17", + "why-is-node-running": "3.2.1" + }, + "bin": { + "vitest": "vitest.mjs" + }, + "engines": { + "node": "^22.12.0 || ^24.0.0 || >=26.0.0" + }, + "funding": { + "url": "https://opencollective.com/vitest" + }, + "peerDependencies": { + "@edge-runtime/vm": "*", + "@opentelemetry/api": "^1.9.0", + "@types/node": "^22.0.0 || >=24.0.0", + "@vitest/browser-playwright": "5.1.2", + "@vitest/browser-preview": "5.1.2", + "@vitest/browser-webdriverio": "^5.0.0-beta.5 || >=5.0.0", + "@vitest/coverage-istanbul": "5.1.2", + "@vitest/coverage-v8": "5.1.2", + "@vitest/ui": "5.1.2", + "happy-dom": "*", + "jsdom": "*", + "vite": "^6.4.0 || ^7.0.0 || ^8.0.0" + }, + "peerDependenciesMeta": { + "@edge-runtime/vm": { + "optional": true + }, + "@opentelemetry/api": { + "optional": true + }, + "@types/node": { + "optional": true + }, + "@vitest/browser-playwright": { + "optional": true + }, + "@vitest/browser-preview": { + "optional": true + }, + "@vitest/browser-webdriverio": { + "optional": true + }, + "@vitest/coverage-istanbul": { + "optional": true + }, + "@vitest/coverage-v8": { + "optional": true + }, + "@vitest/ui": { + "optional": true + }, + "happy-dom": { + "optional": true + }, + "jsdom": { + "optional": true + }, + "vite": { + "optional": false + } + } + }, + "node_modules/vitest/node_modules/magic-string": { + "version": "1.4.5", + "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-1.4.5.tgz", + "integrity": "sha512-oLLC2+YvQUfAa+vxoufE/yc1icb87M9iXIRqAoR/2EhE/8cb3SF/+Gi0c2By1B+5Vz2e2vQtUvHiu1+63Znh+w==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jridgewell/sourcemap-codec": "^1.6.0" + } + }, "node_modules/w3c-xmlserializer": { "version": "6.0.0", "resolved": "https://registry.npmmirror.com/w3c-xmlserializer/-/w3c-xmlserializer-6.0.0.tgz", @@ -10494,6 +10742,19 @@ "node": "^18.17.0 || >=20.5.0" } }, + "node_modules/why-is-node-running": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/why-is-node-running/-/why-is-node-running-3.2.1.tgz", + "integrity": "sha512-Tb2FUhB4vUsGQlfSquQLYkApkuPAFQXGFzxWKHHumVz2dK+X1RUm/HnID4+TfIGYJ1kTcwOaCk/buYCEJr6YjQ==", + "dev": true, + "license": "MIT", + "bin": { + "why-is-node-running": "cli.js" + }, + "engines": { + "node": ">=20.11" + } + }, "node_modules/wrap-ansi": { "version": "7.0.0", "resolved": "https://registry.npmmirror.com/wrap-ansi/-/wrap-ansi-7.0.0.tgz", diff --git a/package.json b/package.json index 56060a0..e4defed 100644 --- a/package.json +++ b/package.json @@ -17,7 +17,7 @@ "fetch:hawdb": "node scripts/fetch-hawdb.mjs", "start": "electron-vite preview", "typecheck": "tsc --noEmit -p tsconfig.node.json && tsc --noEmit -p tsconfig.web.json", - "test": "node --test \"tests/*.test.mjs\"" + "test": "vitest run" }, "overrides": { "app-builder-lib": { @@ -56,6 +56,7 @@ "tw-shimmer": "^0.4.14", "typescript": "^5.9.3", "vite": "^8.4.0", + "vitest": "^5.1.2", "zustand": "^5.1.0" }, "dependencies": { diff --git a/tests/account-login.test.mjs b/tests/account-login.test.mjs index 3d605d3..5dc7c56 100644 --- a/tests/account-login.test.mjs +++ b/tests/account-login.test.mjs @@ -2,7 +2,7 @@ import assert from 'node:assert/strict' import { readFileSync } from 'node:fs' import { createRequire } from 'node:module' import { setImmediate as nextTurn } from 'node:timers/promises' -import { test } from 'node:test' +import { test, vi } from 'vitest' import { compileFunction } from 'node:vm' import { ModuleKind, ScriptTarget, transpileModule } from 'typescript' import * as passport from '../src/common/passport.ts' @@ -17,7 +17,8 @@ const tokenPayload = { access_token: 'local-access', refresh_token: 'local-refre const json = (payload, status = 200, headers) => Response.json(payload, { status, headers }) function fixture(t, respond, refreshToken = '') { - t.mock.timers.enable({ apis: ['setTimeout', 'Date'], now: 1000 }) + vi.useFakeTimers({ toFake: ['setTimeout', 'clearTimeout', 'Date'], now: 1000 }) + t.onTestFinished(() => vi.useRealTimers()) const secrets = new Map(refreshToken ? [['passport-refresh-token', refreshToken]] : []) const requests = [] const timeoutDurations = [] @@ -56,7 +57,7 @@ function fixture(t, respond, refreshToken = '') { if (!dependency) throw new Error(`Unexpected module dependency: ${id}`) return dependency }, {}, signals) - const tick = async (ms) => { t.mock.timers.tick(ms); await nextTurn() } + const tick = async (ms) => { vi.advanceTimersByTime(ms); await nextTurn() } return { ...api, requests, secrets, timeoutDurations, tick } } diff --git a/tests/account-store.test.mjs b/tests/account-store.test.mjs index f2fb360..a93e9f7 100644 --- a/tests/account-store.test.mjs +++ b/tests/account-store.test.mjs @@ -1,5 +1,5 @@ import assert from 'node:assert/strict' -import { test } from 'node:test' +import { test } from 'vitest' import { registerHooks } from 'node:module' import { resolve } from 'node:path' import { pathToFileURL } from 'node:url' diff --git a/tests/agri-regions.test.mjs b/tests/agri-regions.test.mjs index 47573cc..d59f885 100644 --- a/tests/agri-regions.test.mjs +++ b/tests/agri-regions.test.mjs @@ -1,5 +1,5 @@ import assert from 'node:assert/strict' -import { test } from 'node:test' +import { test } from 'vitest' import { AGRI_CATEGORY_META, agriCategoryOf, agriculturalRegions, agriFacts } from '../src/renderer/src/thematic/agriculturalRegions.ts' import { industrialBases, industrialTransferFacts, industrialTransferFlows } from '../src/renderer/src/thematic/industrialBases.ts' diff --git a/tests/ai-history.test.mjs b/tests/ai-history.test.mjs index 2859214..70c2941 100644 --- a/tests/ai-history.test.mjs +++ b/tests/ai-history.test.mjs @@ -1,5 +1,5 @@ import assert from 'node:assert/strict' -import { test } from 'node:test' +import { test } from 'vitest' import { registerHooks } from 'node:module' import { mkdtemp, readFile, writeFile, readdir, rename, mkdir, rm } from 'node:fs/promises' import { tmpdir } from 'node:os' @@ -51,7 +51,7 @@ function conversation(id, updatedAt = 1, content = '地理问题') { async function fixture(t) { const directory = await mkdtemp(join(tmpdir(), 'guearth-history-')) - t.after(() => rm(directory, { recursive: true, force: true })) + t.onTestFinished(() => rm(directory, { recursive: true, force: true })) return { path: join(directory, 'history.json'), directory } } diff --git a/tests/ai-settings-draft.test.mjs b/tests/ai-settings-draft.test.mjs index 224969f..c3971ea 100644 --- a/tests/ai-settings-draft.test.mjs +++ b/tests/ai-settings-draft.test.mjs @@ -1,5 +1,5 @@ import assert from 'node:assert/strict' -import { test } from 'node:test' +import { test } from 'vitest' import { registerHooks } from 'node:module' registerHooks({ diff --git a/tests/annotation-references.test.mjs b/tests/annotation-references.test.mjs index 0664a50..fdc4de6 100644 --- a/tests/annotation-references.test.mjs +++ b/tests/annotation-references.test.mjs @@ -1,5 +1,5 @@ import assert from 'node:assert/strict' -import { test } from 'node:test' +import { test } from 'vitest' import { referencedShapeIds } from '../src/renderer/src/lib/annotationReferences.ts' diff --git a/tests/button-loading-icon.test.mjs b/tests/button-loading-icon.test.mjs index 9bbed0a..c87931d 100644 --- a/tests/button-loading-icon.test.mjs +++ b/tests/button-loading-icon.test.mjs @@ -1,7 +1,7 @@ import assert from 'node:assert/strict' import { readdirSync, readFileSync } from 'node:fs' import { join, relative, resolve } from 'node:path' -import { test } from 'node:test' +import { test } from 'vitest' import ts from 'typescript' const RENDERER_ROOT = resolve('src/renderer/src') diff --git a/tests/decision-sandbox.test.mjs b/tests/decision-sandbox.test.mjs index 3175555..7e68a9a 100644 --- a/tests/decision-sandbox.test.mjs +++ b/tests/decision-sandbox.test.mjs @@ -1,5 +1,5 @@ import assert from 'node:assert/strict' -import { test } from 'node:test' +import { test } from 'vitest' import { buildDecisionPrompt, decisionCases, decisionSandboxIntro } from '../src/renderer/src/thematic/decisionSandbox.ts' test('decision cases: four contexts with essential factors and reachable places', () => { diff --git a/tests/drawing-store.test.mjs b/tests/drawing-store.test.mjs index 228de60..423e14e 100644 --- a/tests/drawing-store.test.mjs +++ b/tests/drawing-store.test.mjs @@ -1,5 +1,5 @@ import assert from 'node:assert/strict' -import { test } from 'node:test' +import { test } from 'vitest' import { registerHooks } from 'node:module' import { resolve } from 'node:path' import { pathToFileURL } from 'node:url' @@ -28,7 +28,7 @@ function storeFixture(t) { resetDrawingStore() const saved = [] globalThis.window = { guEarth: { annotations: { save: async (document) => { saved.push(document) } } } } - t.after(() => { delete globalThis.window }) + t.onTestFinished(() => { delete globalThis.window }) return { store: () => useDrawingStore.getState(), saved } } diff --git a/tests/eoq-ui.test.mjs b/tests/eoq-ui.test.mjs index 81e6ef5..48e7aef 100644 --- a/tests/eoq-ui.test.mjs +++ b/tests/eoq-ui.test.mjs @@ -2,7 +2,7 @@ import assert from 'node:assert/strict' import { readFileSync } from 'node:fs' import { registerHooks } from 'node:module' import { resolve } from 'node:path' -import { test } from 'node:test' +import { test } from 'vitest' import { pathToFileURL } from 'node:url' import { JSDOM } from 'jsdom' import { act, createElement } from 'react' @@ -160,7 +160,7 @@ test('EoqWebSearch filters unsafe links, toggles extra sources, and exposes retr const container = dom.window.document.createElement('div') dom.window.document.body.appendChild(container) const root = createRoot(container) - t.after(() => { + t.onTestFinished(() => { act(() => root.unmount()) container.remove() }) @@ -234,7 +234,7 @@ test('EoqWelcome renders suggestions, cycles on refresh, and submits clicked pro const container = dom.window.document.createElement('div') dom.window.document.body.appendChild(container) const root = createRoot(container) - t.after(() => { + t.onTestFinished(() => { act(() => root.unmount()) container.remove() }) diff --git a/tests/ffmpeg-fetch.test.mjs b/tests/ffmpeg-fetch.test.mjs index 33c27ac..8ef57dd 100644 --- a/tests/ffmpeg-fetch.test.mjs +++ b/tests/ffmpeg-fetch.test.mjs @@ -3,7 +3,7 @@ import { existsSync } from 'node:fs' import { mkdtemp, rm, writeFile } from 'node:fs/promises' import { tmpdir } from 'node:os' import { join } from 'node:path' -import { test } from 'node:test' +import { test } from 'vitest' import { fileURLToPath } from 'node:url' import { diff --git a/tests/flight-framing.test.mjs b/tests/flight-framing.test.mjs index f9172be..dbb12ba 100644 --- a/tests/flight-framing.test.mjs +++ b/tests/flight-framing.test.mjs @@ -1,5 +1,5 @@ import assert from 'node:assert/strict' -import { test } from 'node:test' +import { test } from 'vitest' import { conservativeFlightHeightM, destinationAt, diff --git a/tests/flight-stops.test.mjs b/tests/flight-stops.test.mjs index b3fbdff..f81f460 100644 --- a/tests/flight-stops.test.mjs +++ b/tests/flight-stops.test.mjs @@ -1,5 +1,5 @@ import assert from 'node:assert/strict' -import { test } from 'node:test' +import { test } from 'vitest' import { registerHooks } from 'node:module' registerHooks({ diff --git a/tests/gcj02.test.mjs b/tests/gcj02.test.mjs index 8e2bd1e..7770f76 100644 --- a/tests/gcj02.test.mjs +++ b/tests/gcj02.test.mjs @@ -1,6 +1,6 @@ import assert from 'node:assert/strict' import { readFileSync } from 'node:fs' -import { test } from 'node:test' +import { test } from 'vitest' import { gcj02ToWgs84, outsideChina, wgs84ToGcj02 } from '../src/main/geo/gcj02.ts' const citiesGcj02 = [ diff --git a/tests/globe-navigation.test.mjs b/tests/globe-navigation.test.mjs index d31a0c2..dce146b 100644 --- a/tests/globe-navigation.test.mjs +++ b/tests/globe-navigation.test.mjs @@ -1,5 +1,5 @@ import assert from 'node:assert/strict' -import { test } from 'node:test' +import { test, vi } from 'vitest' import { Cartographic, EllipsoidTerrainProvider, GeographicTilingScheme, HeightmapTerrainData, ImageryLayer, UrlTemplateImageryProvider, WebMercatorTilingScheme } from 'cesium' import { createBasemapImageryProvider } from '../src/renderer/src/composables/basemapImagery.ts' import { resolveFlightDestination } from '../src/renderer/src/composables/terrainFlight.ts' @@ -119,9 +119,10 @@ test('non-finite terrain samples use the conservative altitude', async () => { }) test('terrain lookup timeout still allows flight', async context => { - context.mock.timers.enable({ apis: ['setTimeout'] }) + vi.useFakeTimers({ toFake: ['setTimeout', 'clearTimeout'] }) + context.onTestFinished(() => vi.useRealTimers()) const flight = flightHeight(terrainScene(() => new Promise(() => {}))) - context.mock.timers.tick(4000) + vi.advanceTimersByTime(4000) assert.ok(Math.abs(await flight - 10000) < 1e-5) }) @@ -205,11 +206,12 @@ test('already cancelled flight does not sample terrain', async () => { }) test('cancelled flight does not adopt the timeout altitude', async (context) => { - context.mock.timers.enable({ apis: ['setTimeout'] }) + vi.useFakeTimers({ toFake: ['setTimeout', 'clearTimeout'] }) + context.onTestFinished(() => vi.useRealTimers()) let cancelled = false const flight = resolveFlightDestination(terrainScene(() => new Promise(() => {})), SUMMIT_LON, SUMMIT_LAT, 5000, { isCancelled: () => cancelled }) cancelled = true - context.mock.timers.tick(4000) + vi.advanceTimersByTime(4000) assert.equal(await flight, undefined) }) diff --git a/tests/globe-surface.test.mjs b/tests/globe-surface.test.mjs index 8c8f34a..e7ed497 100644 --- a/tests/globe-surface.test.mjs +++ b/tests/globe-surface.test.mjs @@ -1,6 +1,6 @@ import assert from 'node:assert/strict' import { readFile } from 'node:fs/promises' -import { test } from 'node:test' +import { test } from 'vitest' import { BUFFER_MISSING_REPORT_MS, RENDER_FAULT_LIMIT, diff --git a/tests/hawdb-fetch.test.mjs b/tests/hawdb-fetch.test.mjs index c4365bd..0b705bb 100644 --- a/tests/hawdb-fetch.test.mjs +++ b/tests/hawdb-fetch.test.mjs @@ -1,5 +1,5 @@ import assert from 'node:assert/strict' -import { test } from 'node:test' +import { test } from 'vitest' import { archiveRedirectTarget, assertArchiveSource, diff --git a/tests/hawdb.test.mjs b/tests/hawdb.test.mjs index 4517278..f2fa538 100644 --- a/tests/hawdb.test.mjs +++ b/tests/hawdb.test.mjs @@ -3,7 +3,7 @@ import { existsSync, readFileSync } from 'node:fs' import { mkdir, mkdtemp, chmod, rm, writeFile } from 'node:fs/promises' import { tmpdir } from 'node:os' import { join, resolve } from 'node:path' -import { test } from 'node:test' +import { test } from 'vitest' import { registerHooks } from 'node:module' import { fileURLToPath } from 'node:url' @@ -96,7 +96,7 @@ test('EoqHawdbEngine persists memories, conversations, BM25 recall and Cypher kn return } const baseDir = await mkdtemp(join(repoRoot, '.tmp-hawdb-test-')) - t.after(() => rm(baseDir, { recursive: true, force: true })) + t.onTestFinished(() => rm(baseDir, { recursive: true, force: true })) const dbRoot = join(baseDir, 'eoq-hawdb') const legacyMemoriesPath = join(baseDir, 'ai-memories.json') @@ -183,12 +183,12 @@ test('EoqHawdbEngine falls back cleanly to memory-snapshot under restricted dire return } const baseDir = await mkdtemp(join(tmpdir(), 'guearth-hawdb-snap-')) - t.after(() => rm(baseDir, { recursive: true, force: true })) + t.onTestFinished(() => rm(baseDir, { recursive: true, force: true })) const dbRoot = join(baseDir, 'eoq-hawdb') if (process.platform !== 'win32') { await mkdir(join(dbRoot, 'db'), { recursive: true }) await chmod(join(dbRoot, 'db'), 0o500).catch(() => undefined) - t.after(() => chmod(join(dbRoot, 'db'), 0o700).catch(() => undefined)) + t.onTestFinished(() => chmod(join(dbRoot, 'db'), 0o700).catch(() => undefined)) } const entries = loadKnowledgeFixtures().slice(0, 12) @@ -234,7 +234,7 @@ test('AiMemoryStore and AiChatHistoryStore work end-to-end when attached to EoqH return } const baseDir = await mkdtemp(join(repoRoot, '.tmp-hawdb-client-')) - t.after(() => rm(baseDir, { recursive: true, force: true })) + t.onTestFinished(() => rm(baseDir, { recursive: true, force: true })) await mkdir(baseDir, { recursive: true }) const client = new EoqHawdbClient({ inProcess: true }) @@ -277,7 +277,7 @@ test('EoqHawdbClient communicates with the compiled worker_threads bundle', asyn return } const baseDir = await mkdtemp(join(repoRoot, '.tmp-hawdb-worker-')) - t.after(() => rm(baseDir, { recursive: true, force: true })) + t.onTestFinished(() => rm(baseDir, { recursive: true, force: true })) const client = new EoqHawdbClient({ workerPath: compiledWorker }) try { diff --git a/tests/hsr-lines.test.mjs b/tests/hsr-lines.test.mjs index f92c43a..edf4da4 100644 --- a/tests/hsr-lines.test.mjs +++ b/tests/hsr-lines.test.mjs @@ -1,5 +1,5 @@ import assert from 'node:assert/strict' -import { test } from 'node:test' +import { test } from 'vitest' import { HSR_END_YEAR, HSR_START_YEAR, hsrFacts, hsrGrowthSeries, hsrLines, hsrLinesUpTo, hsrMileageAt } from '../src/renderer/src/thematic/hsrLines.ts' test('hsr lines: opening years within growth window and paths in China bounds', () => { diff --git a/tests/live-typhoons.test.mjs b/tests/live-typhoons.test.mjs index 381047b..00127c1 100644 --- a/tests/live-typhoons.test.mjs +++ b/tests/live-typhoons.test.mjs @@ -1,5 +1,5 @@ import assert from 'node:assert/strict' -import { test } from 'node:test' +import { test } from 'vitest' import { CustomDataSource, JulianDate, PolylineDashMaterialProperty } from 'cesium' import { buildLiveTyphoons } from '../src/renderer/src/thematic/liveTyphoons.ts' diff --git a/tests/migration-geometry.test.mjs b/tests/migration-geometry.test.mjs index 0a52f0e..b5a9c7a 100644 --- a/tests/migration-geometry.test.mjs +++ b/tests/migration-geometry.test.mjs @@ -1,5 +1,5 @@ import assert from 'node:assert/strict' -import { test } from 'node:test' +import { test } from 'vitest' import { fanMigrationEndpoints, migrationFlows, smoothMigrationPath } from '../src/renderer/src/thematic/populationCensus.ts' test('smoothed path passes through every waypoint', () => { diff --git a/tests/model-importer.test.mjs b/tests/model-importer.test.mjs index d468b85..7f794fd 100644 --- a/tests/model-importer.test.mjs +++ b/tests/model-importer.test.mjs @@ -3,7 +3,7 @@ import { readFileSync } from 'node:fs' import { createRequire } from 'node:module' import { compileFunction } from 'node:vm' import { ModuleKind, ScriptTarget, transpileModule } from 'typescript' -import { test } from 'node:test' +import { test } from 'vitest' import * as tileMirror from '../src/common/tileMirror.ts' const responseReaderSource = readFileSync(new URL('../src/main/ai/responseReader.ts', import.meta.url), 'utf8') diff --git a/tests/model-test.test.mjs b/tests/model-test.test.mjs index c0abe53..a113012 100644 --- a/tests/model-test.test.mjs +++ b/tests/model-test.test.mjs @@ -3,7 +3,7 @@ import { randomUUID } from 'node:crypto' import { readFileSync } from 'node:fs' import { compileFunction } from 'node:vm' import { ModuleKind, ScriptTarget, transpileModule } from 'typescript' -import { test } from 'node:test' +import { test } from 'vitest' const aiTelemetrySource = readFileSync(new URL('../src/common/aiTelemetry.ts', import.meta.url), 'utf8') const aiTelemetryOutput = transpileModule(aiTelemetrySource, { diff --git a/tests/mountain-zonation.test.mjs b/tests/mountain-zonation.test.mjs index 48a7d13..1ddeb40 100644 --- a/tests/mountain-zonation.test.mjs +++ b/tests/mountain-zonation.test.mjs @@ -1,5 +1,5 @@ import assert from 'node:assert/strict' -import { test } from 'node:test' +import { test } from 'vitest' import { beltAtAltitude, mountainById, snowlineM, zonationMountains, zonationPrinciples } from '../src/renderer/src/thematic/mountainZonation.ts' import { bearingDeg, greatCircleKm, groundProfileImplausible, interpolateWaypoints, planTransectAltitudes, transectHops, transectLegsKm, transectTotalKm } from '../src/renderer/src/lib/transect.ts' diff --git a/tests/night-basemap.test.mjs b/tests/night-basemap.test.mjs index ef8e428..214cd66 100644 --- a/tests/night-basemap.test.mjs +++ b/tests/night-basemap.test.mjs @@ -1,6 +1,6 @@ import assert from 'node:assert/strict' import { readFile } from 'node:fs/promises' -import { test } from 'node:test' +import { test } from 'vitest' import { hidesThematicLayers, visibleThematicLayers } from '../src/renderer/src/lib/nightBasemap.ts' const appSource = await readFile(new URL('../src/renderer/src/App.tsx', import.meta.url), 'utf8') diff --git a/tests/notable-peaks.test.mjs b/tests/notable-peaks.test.mjs index ab0f53b..ec8bbf0 100644 --- a/tests/notable-peaks.test.mjs +++ b/tests/notable-peaks.test.mjs @@ -1,5 +1,5 @@ import assert from 'node:assert/strict' -import { test } from 'node:test' +import { test } from 'vitest' import { findPeaksNear, nearestPeaks, notablePeaks } from '../src/renderer/src/thematic/notablePeaks.ts' test('notable peaks: ids and names unique, coordinates and elevations plausible', () => { diff --git a/tests/offscreen-camera.test.mjs b/tests/offscreen-camera.test.mjs index 8d7c4e6..63bbbbc 100644 --- a/tests/offscreen-camera.test.mjs +++ b/tests/offscreen-camera.test.mjs @@ -1,6 +1,6 @@ import assert from 'node:assert/strict' import { readFile } from 'node:fs/promises' -import { test } from 'node:test' +import { test } from 'vitest' const offscreenSource = await readFile(new URL('../src/renderer/src/offscreen.tsx', import.meta.url), 'utf8') const layersSource = await readFile(new URL('../src/renderer/src/composables/useThematicLayers.ts', import.meta.url), 'utf8') diff --git a/tests/offscreen-container.test.mjs b/tests/offscreen-container.test.mjs index 7de3197..60c6a03 100644 --- a/tests/offscreen-container.test.mjs +++ b/tests/offscreen-container.test.mjs @@ -3,7 +3,7 @@ import { spawnSync } from 'node:child_process' import { mkdtempSync, rmSync, writeFileSync } from 'node:fs' import { tmpdir } from 'node:os' import { join } from 'node:path' -import { test } from 'node:test' +import { test } from 'vitest' import { fileURLToPath } from 'node:url' import { findFfmpegBinary } from '../src/main/ffmpeg.ts' diff --git a/tests/offscreen-mac.test.mjs b/tests/offscreen-mac.test.mjs index f96b2c0..f216365 100644 --- a/tests/offscreen-mac.test.mjs +++ b/tests/offscreen-mac.test.mjs @@ -1,6 +1,6 @@ import assert from 'node:assert/strict' import { access, readFile } from 'node:fs/promises' -import { test } from 'node:test' +import { test } from 'vitest' const mainSource = await readFile(new URL('../src/main/index.ts', import.meta.url), 'utf8') const macSource = await readFile(new URL('../src/main/offscreenMac.ts', import.meta.url), 'utf8') diff --git a/tests/offscreen-paths.test.mjs b/tests/offscreen-paths.test.mjs index 5f29213..fefd7f2 100644 --- a/tests/offscreen-paths.test.mjs +++ b/tests/offscreen-paths.test.mjs @@ -3,7 +3,7 @@ import { mkdirSync, mkdtempSync, readdirSync, rmSync, symlinkSync } from 'node:f import { readFile } from 'node:fs/promises' import { tmpdir } from 'node:os' import { join, resolve, sep } from 'node:path' -import { test } from 'node:test' +import { test } from 'vitest' import { assertOffscreenRecordingSupported, resolveFfmpegBinary } from '../src/main/ffmpeg.ts' import { resolveOffscreenEntry } from '../src/main/offscreenPaths.ts' diff --git a/tests/offscreen-state.test.mjs b/tests/offscreen-state.test.mjs index 72ed091..a2be969 100644 --- a/tests/offscreen-state.test.mjs +++ b/tests/offscreen-state.test.mjs @@ -1,6 +1,6 @@ import assert from 'node:assert/strict' import { readFile } from 'node:fs/promises' -import { test } from 'node:test' +import { test } from 'vitest' import { wrapText } from '../src/renderer/src/offscreenText.ts' diff --git a/tests/offscreen-timing.test.mjs b/tests/offscreen-timing.test.mjs index 17f39ce..002c6c3 100644 --- a/tests/offscreen-timing.test.mjs +++ b/tests/offscreen-timing.test.mjs @@ -1,5 +1,5 @@ import assert from 'node:assert/strict' -import { test } from 'node:test' +import { test } from 'vitest' import { offscreenCaptureSize, offscreenConcatPlaylist, offscreenFrameDurations, offscreenFrameRate, offscreenScriptDurationMs } from '../src/main/offscreenTiming.ts' diff --git a/tests/online-data.test.mjs b/tests/online-data.test.mjs index ebe372a..901358d 100644 --- a/tests/online-data.test.mjs +++ b/tests/online-data.test.mjs @@ -1,7 +1,7 @@ import assert from 'node:assert/strict' import { readFileSync } from 'node:fs' import { createRequire } from 'node:module' -import { test } from 'node:test' +import { test } from 'vitest' import { compileFunction } from 'node:vm' import { ModuleKind, ScriptTarget, transpileModule } from 'typescript' import * as shared from '../src/common/onlineData.ts' diff --git a/tests/packaging.test.mjs b/tests/packaging.test.mjs index 131b093..dcef632 100644 --- a/tests/packaging.test.mjs +++ b/tests/packaging.test.mjs @@ -2,7 +2,7 @@ import assert from 'node:assert/strict' import { existsSync, readdirSync, readFileSync } from 'node:fs' import { builtinModules } from 'node:module' import { dirname, join, posix, relative, resolve } from 'node:path' -import { test } from 'node:test' +import { test } from 'vitest' import { fileURLToPath } from 'node:url' const repoRoot = fileURLToPath(new URL('..', import.meta.url)) diff --git a/tests/passport-account.test.mjs b/tests/passport-account.test.mjs index 6660c09..a20e454 100644 --- a/tests/passport-account.test.mjs +++ b/tests/passport-account.test.mjs @@ -1,6 +1,6 @@ import assert from 'node:assert/strict' import { randomBytes } from 'node:crypto' -import { test } from 'node:test' +import { test } from 'vitest' import { accountPhaseLabel, buildDeviceName, diff --git a/tests/poi-aggregation.test.mjs b/tests/poi-aggregation.test.mjs index 21beb6b..ce07fcb 100644 --- a/tests/poi-aggregation.test.mjs +++ b/tests/poi-aggregation.test.mjs @@ -1,5 +1,5 @@ import assert from 'node:assert/strict' -import { test } from 'node:test' +import { test } from 'vitest' import { registerHooks } from 'node:module' registerHooks({ diff --git a/tests/poi-categories.test.mjs b/tests/poi-categories.test.mjs index b28d605..21e939e 100644 --- a/tests/poi-categories.test.mjs +++ b/tests/poi-categories.test.mjs @@ -1,5 +1,5 @@ import assert from 'node:assert/strict' -import { test } from 'node:test' +import { test } from 'vitest' import { POI_CATEGORY_LABELS, poiBigCategory } from '../src/main/ai/poiCategories.ts' test('real-shaped amap pois classify by their typecode, not the chinese type name', () => { diff --git a/tests/population-layer.test.mjs b/tests/population-layer.test.mjs index 21a67c2..7ec239e 100644 --- a/tests/population-layer.test.mjs +++ b/tests/population-layer.test.mjs @@ -1,6 +1,6 @@ import assert from 'node:assert/strict' import { readFileSync } from 'node:fs' -import { test } from 'node:test' +import { test } from 'vitest' import { censusAgeStructure, densityBins, densityColor, densityOf, densityRank, huComparison, huLineEndpoints, migrationFlows, nationalPopulation, populationRank, provincePopulation, provinceSummary, pyramid2020, pyramidAgeGroups, diff --git a/tests/pr-review.test.mjs b/tests/pr-review.test.mjs index 11bc114..1cf82a8 100644 --- a/tests/pr-review.test.mjs +++ b/tests/pr-review.test.mjs @@ -1,5 +1,5 @@ import assert from 'node:assert/strict' -import { test } from 'node:test' +import { test, vi } from 'vitest' import { registerHooks } from 'node:module' import { mkdtemp, readFile, writeFile, readdir, mkdir, rm, utimes } from 'node:fs/promises' import { tmpdir } from 'node:os' @@ -43,7 +43,7 @@ const { renderMarkdown, renderStreamingMarkdown, createStreamingDelayState, sett async function directory(t) { const path = await mkdtemp(join(tmpdir(), 'guearth-review-')) - t.after(() => rm(path, { recursive: true, force: true })) + t.onTestFinished(() => rm(path, { recursive: true, force: true })) return path } @@ -66,7 +66,7 @@ test('failed cache deletions remain in quota and orphan metadata is pruned', asy await writeFile(join(path, 'locked.json'), Buffer.alloc(10)) await writeFile(join(path, 'orphan.json'), Buffer.alloc(10)) blocked.add(locked) - t.after(() => blocked.delete(locked)) + t.onTestFinished(() => blocked.delete(locked)) assert.equal(await pruneTileFiles(path, 0), 10) assert.deepEqual(await readdir(path), ['locked.bin']) }) @@ -136,7 +136,8 @@ function playerFixture(t) { resetSolarStore() resetGlobeStore() resetTransportStore() - t.mock.timers.enable({ apis: ['setTimeout', 'Date'], now: 1000 }) + vi.useFakeTimers({ toFake: ['setTimeout', 'clearTimeout', 'Date'], now: 1000 }) + t.onTestFinished(() => vi.useRealTimers()) let requests = 0 const viewer = { isDestroyed: () => false, @@ -145,9 +146,9 @@ function playerFixture(t) { } const player = createScenePlayerController(viewer, () => {}, () => {}) const unmount = player.mount() - t.after(unmount) + t.onTestFinished(unmount) const scene = { name: 'Sky', narration: '', flyDurationMs: 100, dwellMs: 100, snapshot: { camera: { longitude: 179, latitude: 30, height: 10000, heading: 350, pitch: 10 }, basemapId: '', overlays: [], month: 6, simTime: null } } - const tick = async (ms) => { t.mock.timers.tick(ms); await nextTurn() } + const tick = async (ms) => { vi.advanceTimersByTime(ms); await nextTurn() } return { viewer, player, scene, tick, requests: () => requests } } diff --git a/tests/pr95-fixes.test.mjs b/tests/pr95-fixes.test.mjs index 56bfdb7..82d8f03 100644 --- a/tests/pr95-fixes.test.mjs +++ b/tests/pr95-fixes.test.mjs @@ -1,6 +1,6 @@ import assert from 'node:assert/strict' import { readFileSync } from 'node:fs' -import { test } from 'node:test' +import { test } from 'vitest' import { formatActionError, runGuardedAction } from '../src/renderer/src/components/ui/actionError.ts' import { computeGuideCardPosition } from '../src/renderer/src/lib/guidePosition.ts' import { flattenVisibleTree, resolveTreeKeyAction } from '../src/renderer/src/lib/treeNavigation.ts' diff --git a/tests/privacy.test.mjs b/tests/privacy.test.mjs index 799e3df..96c5a3a 100644 --- a/tests/privacy.test.mjs +++ b/tests/privacy.test.mjs @@ -1,5 +1,5 @@ import assert from 'node:assert/strict' -import { test } from 'node:test' +import { test } from 'vitest' import { registerHooks } from 'node:module' import { resolve } from 'node:path' import { pathToFileURL } from 'node:url' diff --git a/tests/recording-state.test.mjs b/tests/recording-state.test.mjs index d7312c5..83dc9de 100644 --- a/tests/recording-state.test.mjs +++ b/tests/recording-state.test.mjs @@ -1,6 +1,6 @@ import assert from 'node:assert/strict' import { readFile } from 'node:fs/promises' -import { test } from 'node:test' +import { test } from 'vitest' import { ENSO_PHASES, HSR_END_YEAR, HSR_START_YEAR, SEA_LEVEL_SCENARIOS } from '../src/common/thematicState.ts' import { ensoPhaseOptions } from '../src/renderer/src/thematic/ensoPhases.ts' import { HSR_END_YEAR as rendererEndYear, HSR_START_YEAR as rendererStartYear } from '../src/renderer/src/thematic/hsrLines.ts' diff --git a/tests/recording.test.mjs b/tests/recording.test.mjs index fa021f3..d8581e5 100644 --- a/tests/recording.test.mjs +++ b/tests/recording.test.mjs @@ -1,6 +1,6 @@ import assert from 'node:assert/strict' import { readFile } from 'node:fs/promises' -import { test } from 'node:test' +import { test } from 'vitest' const mainSource = await readFile(new URL('../src/main/index.ts', import.meta.url), 'utf8') const preloadSource = await readFile(new URL('../src/preload/index.ts', import.meta.url), 'utf8') diff --git a/tests/renderer-review.test.mjs b/tests/renderer-review.test.mjs index 823f0a0..7958a52 100644 --- a/tests/renderer-review.test.mjs +++ b/tests/renderer-review.test.mjs @@ -1,5 +1,5 @@ import assert from 'node:assert/strict' -import { test } from 'node:test' +import { test, vi } from 'vitest' import { registerHooks } from 'node:module' import { readFileSync } from 'node:fs' import { resolve } from 'node:path' @@ -84,11 +84,12 @@ function ThematicHarness({ viewer }) { test('streaming Markdown coalesces updates for 50ms, settles idle tail and cancels unmount work', async (t) => { installDomGlobals() - t.mock.timers.enable({ apis: ['setTimeout'] }) + vi.useFakeTimers({ toFake: ['setTimeout', 'clearTimeout'] }) + t.onTestFinished(() => vi.useRealTimers()) const container = dom.window.document.createElement('div') dom.window.document.body.appendChild(container) const root = createRoot(container) - t.after(() => { + t.onTestFinished(() => { act(() => root.unmount()) container.remove() }) @@ -112,18 +113,18 @@ test('streaming Markdown coalesces updates for 50ms, settles idle tail and cance assert.equal(renders, 1) act(() => { - t.mock.timers.tick(49) + vi.advanceTimersByTime(49) }) assert.equal(renders, 1) act(() => { - t.mock.timers.tick(1) + vi.advanceTimersByTime(1) }) assert.equal(renders, 2) assert.equal(hasStreamingArtifacts(), true) act(() => { - t.mock.timers.tick(260) + vi.advanceTimersByTime(260) }) assert.equal(renders, 2) assert.equal(hasStreamingArtifacts(), false) @@ -137,7 +138,7 @@ test('streaming Markdown coalesces updates for 50ms, settles idle tail and cance assert.equal(hasStreamingArtifacts(), false) act(() => { - t.mock.timers.tick(50) + vi.advanceTimersByTime(50) }) assert.equal(renders, 4) @@ -146,7 +147,7 @@ test('streaming Markdown coalesces updates for 50ms, settles idle tail and cance root.unmount() }) act(() => { - t.mock.timers.tick(500) + vi.advanceTimersByTime(500) }) assert.equal(renders, 4) }) @@ -178,7 +179,7 @@ test('thematic sources clean up across viewer changes, delayed additions and unm const container = dom.window.document.createElement('div') dom.window.document.body.appendChild(container) const root = createRoot(container) - t.after(() => { + t.onTestFinished(() => { act(() => root.unmount()) container.remove() resetOnlineDataStore() @@ -238,7 +239,7 @@ test('earthquake failures stay retryable and retry refreshes the feed', async (t const container = dom.window.document.createElement('div') dom.window.document.body.appendChild(container) const root = createRoot(container) - t.after(() => { + t.onTestFinished(() => { act(() => root.unmount()) container.remove() resetOnlineDataStore() @@ -287,7 +288,7 @@ test('stale earthquake cache keeps a retryable failure until a fresh feed arrive const container = dom.window.document.createElement('div') dom.window.document.body.appendChild(container) const root = createRoot(container) - t.after(() => { + t.onTestFinished(() => { act(() => root.unmount()) container.remove() resetOnlineDataStore() @@ -334,7 +335,7 @@ test('typhoon layers fetch newly configured data on demand and ignore obsolete I const container = dom.window.document.createElement('div') dom.window.document.body.appendChild(container) const root = createRoot(container) - t.after(() => { + t.onTestFinished(() => { act(() => root.unmount()) container.remove() resetOnlineDataStore() diff --git a/tests/resource-failure.test.mjs b/tests/resource-failure.test.mjs index 8353165..10ce50a 100644 --- a/tests/resource-failure.test.mjs +++ b/tests/resource-failure.test.mjs @@ -1,5 +1,5 @@ import assert from 'node:assert/strict' -import { test } from 'node:test' +import { test } from 'vitest' import { describeResourceFailure, isRequestErrorShape, requestErrorRejectionLabel } from '../src/common/resourceFailure.ts' import { serveTileResponse, TILE_FAILURE_STATUS, tileFailureResponse } from '../src/common/tileProtocol.ts' diff --git a/tests/scene-camera.test.mjs b/tests/scene-camera.test.mjs index 24f5635..560c5b3 100644 --- a/tests/scene-camera.test.mjs +++ b/tests/scene-camera.test.mjs @@ -1,5 +1,5 @@ import assert from 'node:assert/strict' -import { test } from 'node:test' +import { test } from 'vitest' import * as Cesium from 'cesium' import { sanitizeCamera, sceneCameraView } from '../src/renderer/src/lib/sceneCamera.ts' diff --git a/tests/sea-level-seed.test.mjs b/tests/sea-level-seed.test.mjs index e71e948..7309563 100644 --- a/tests/sea-level-seed.test.mjs +++ b/tests/sea-level-seed.test.mjs @@ -1,6 +1,6 @@ import assert from 'node:assert/strict' import { readFile } from 'node:fs/promises' -import { test } from 'node:test' +import { test } from 'vitest' import { cacheKeyOf, coastalZones, gridPointsOf, heightCache, seaLevelGridPoints, seedSampleHeights } from '../src/renderer/src/thematic/seaLevelRise.ts' const mainSource = await readFile(new URL('../src/main/index.ts', import.meta.url), 'utf8') diff --git a/tests/sea-level.test.mjs b/tests/sea-level.test.mjs index 6b9f071..eea61c5 100644 --- a/tests/sea-level.test.mjs +++ b/tests/sea-level.test.mjs @@ -1,5 +1,5 @@ import assert from 'node:assert/strict' -import { test } from 'node:test' +import { test } from 'vitest' import { SEA_LEVEL_SCENARIOS, buildLandMask, cacheKeyOf, cellAreaKm2, coastalZones, gridPointsOf, heightCache, inundationByZone, isLandCell, isInundated, recordSamples, seaLevelFacts, scenarioSummary, diff --git a/tests/shape-graphics.test.mjs b/tests/shape-graphics.test.mjs index b469dca..1a6c80f 100644 --- a/tests/shape-graphics.test.mjs +++ b/tests/shape-graphics.test.mjs @@ -1,5 +1,5 @@ import assert from 'node:assert/strict' -import { test } from 'node:test' +import { test } from 'vitest' import { registerHooks } from 'node:module' import { resolve } from 'node:path' import { pathToFileURL } from 'node:url' diff --git a/tests/terrain-availability.test.mjs b/tests/terrain-availability.test.mjs index f6911c2..86164f3 100644 --- a/tests/terrain-availability.test.mjs +++ b/tests/terrain-availability.test.mjs @@ -1,5 +1,5 @@ import assert from 'node:assert/strict' -import { test } from 'node:test' +import { test } from 'vitest' import { withoutTileAvailability } from '../src/common/terrainAvailability.ts' function availabilityProbe() { diff --git a/tests/terrain-providers.test.mjs b/tests/terrain-providers.test.mjs index eff3d65..689fc7e 100644 --- a/tests/terrain-providers.test.mjs +++ b/tests/terrain-providers.test.mjs @@ -1,6 +1,6 @@ import assert from 'node:assert/strict' import { readFile } from 'node:fs/promises' -import { test } from 'node:test' +import { test } from 'vitest' import { TERRAIN_PROVIDER_ID_SET, TERRAIN_PROVIDER_IDS } from '../src/common/terrainProviders.ts' const registrySource = await readFile(new URL('../src/renderer/src/terrain/terrainRegistry.ts', import.meta.url), 'utf8') diff --git a/tests/thematic-layer-ids.test.mjs b/tests/thematic-layer-ids.test.mjs index 92080f0..9d92b5c 100644 --- a/tests/thematic-layer-ids.test.mjs +++ b/tests/thematic-layer-ids.test.mjs @@ -1,6 +1,6 @@ import assert from 'node:assert/strict' import { readFile } from 'node:fs/promises' -import { test } from 'node:test' +import { test } from 'vitest' import { THEMATIC_LAYER_ID_SET, THEMATIC_LAYER_IDS } from '../src/common/thematicLayers.ts' const climateSource = await readFile(new URL('../src/renderer/src/stores/climate.ts', import.meta.url), 'utf8') diff --git a/tests/thematic-request-render.test.mjs b/tests/thematic-request-render.test.mjs index 9feb484..0470cae 100644 --- a/tests/thematic-request-render.test.mjs +++ b/tests/thematic-request-render.test.mjs @@ -1,6 +1,6 @@ import assert from 'node:assert/strict' import { readFile } from 'node:fs/promises' -import { test } from 'node:test' +import { test } from 'vitest' const layersSource = await readFile(new URL('../src/renderer/src/composables/useThematicLayers.ts', import.meta.url), 'utf8') diff --git a/tests/theme-mode.test.mjs b/tests/theme-mode.test.mjs index dc703c9..9f54ac4 100644 --- a/tests/theme-mode.test.mjs +++ b/tests/theme-mode.test.mjs @@ -1,5 +1,5 @@ import assert from 'node:assert/strict' -import { test } from 'node:test' +import { test } from 'vitest' import { isThemeMode, normalizeThemeMode, resolveTheme, themeModes } from '../src/common/themeMode.ts' test('isThemeMode accepts only light, dark, and system', () => { diff --git a/tests/tile-mirror.test.mjs b/tests/tile-mirror.test.mjs index ac99fb4..ff1466e 100644 --- a/tests/tile-mirror.test.mjs +++ b/tests/tile-mirror.test.mjs @@ -2,7 +2,7 @@ import assert from 'node:assert/strict' import { readFileSync } from 'node:fs' import { registerHooks } from 'node:module' import { resolve } from 'node:path' -import { test } from 'node:test' +import { test } from 'vitest' import { pathToFileURL } from 'node:url' import { attachOriginTerrainFallback } from '../src/common/terrainAvailability.ts' import { @@ -388,7 +388,7 @@ test('globeStore mirror consent workflow gates enabling on consent and persists } } } - t.after(() => { + t.onTestFinished(() => { globalThis.window = originalWindow }) resetGlobeStore() @@ -441,7 +441,7 @@ test('globeStore does not persist mirrorConsentPrompted after settings.get failu } } } - t.after(() => { + t.onTestFinished(() => { globalThis.window = originalWindow }) resetGlobeStore() @@ -564,7 +564,7 @@ test('globeStore syncs mirror mode back to actual status when consent persistenc } } } - t.after(() => { + t.onTestFinished(() => { globalThis.window = originalWindow }) resetGlobeStore() @@ -778,7 +778,7 @@ test('globeStore hydrates, persists, and rolls back tileMirrorSource and applies } } } - t.after(() => { + t.onTestFinished(() => { globalThis.window = originalWindow }) resetGlobeStore() @@ -973,7 +973,7 @@ test('globeStore preserves pending tileMirrorSource across stale broadcasts and } } } - t.after(() => { + t.onTestFinished(() => { globalThis.window = originalWindow }) resetGlobeStore() diff --git a/tests/touch-interaction.test.mjs b/tests/touch-interaction.test.mjs index ec7375a..b976dcb 100644 --- a/tests/touch-interaction.test.mjs +++ b/tests/touch-interaction.test.mjs @@ -1,5 +1,5 @@ import assert from 'node:assert/strict' -import { test } from 'node:test' +import { test } from 'vitest' import { isTouchInteractionMode, normalizeTouchInteractionMode, diff --git a/tests/ui-no-antd.test.mjs b/tests/ui-no-antd.test.mjs index 137887d..6afe0cb 100644 --- a/tests/ui-no-antd.test.mjs +++ b/tests/ui-no-antd.test.mjs @@ -1,7 +1,7 @@ import assert from 'node:assert/strict' import { readdirSync, readFileSync } from 'node:fs' import { join, relative, resolve } from 'node:path' -import { test } from 'node:test' +import { test } from 'vitest' const SRC_ROOT = resolve('src') const FORBIDDEN_PATTERNS = [ diff --git a/tests/ui-triggers.test.mjs b/tests/ui-triggers.test.mjs index 369ca2f..a03c71a 100644 --- a/tests/ui-triggers.test.mjs +++ b/tests/ui-triggers.test.mjs @@ -2,7 +2,7 @@ import assert from 'node:assert/strict' import { readFileSync } from 'node:fs' import { registerHooks } from 'node:module' import { resolve } from 'node:path' -import { test } from 'node:test' +import { test } from 'vitest' import { pathToFileURL } from 'node:url' import { JSDOM } from 'jsdom' import { act, createElement } from 'react' @@ -71,7 +71,7 @@ test('Tooltip, Popover, and DropdownMenu preserve child Button onClick handlers const container = dom.window.document.createElement('div') dom.window.document.body.appendChild(container) const root = createRoot(container) - t.after(() => { + t.onTestFinished(() => { act(() => root.unmount()) container.remove() }) diff --git a/tests/update-channel.test.mjs b/tests/update-channel.test.mjs index 646aeb3..df35ae1 100644 --- a/tests/update-channel.test.mjs +++ b/tests/update-channel.test.mjs @@ -2,7 +2,7 @@ import assert from 'node:assert/strict' import { mkdirSync, mkdtempSync, readFileSync, realpathSync, rmSync, statSync, symlinkSync, writeFileSync } from 'node:fs' import { tmpdir } from 'node:os' import { delimiter, join } from 'node:path' -import { test } from 'node:test' +import { test } from 'vitest' import { updateInstallContent, updateReadyHint } from '../src/renderer/src/stores/updateCopy.ts' import { DEB_INSTALL_EXECUTABLE, diff --git a/tests/update-dialog.test.mjs b/tests/update-dialog.test.mjs index 1b60f81..4e106a1 100644 --- a/tests/update-dialog.test.mjs +++ b/tests/update-dialog.test.mjs @@ -2,7 +2,7 @@ import assert from 'node:assert/strict' import { readFileSync } from 'node:fs' import { registerHooks } from 'node:module' import { resolve } from 'node:path' -import { test } from 'node:test' +import { test } from 'vitest' import { pathToFileURL } from 'node:url' import { JSDOM } from 'jsdom' import { JsxEmit, ModuleKind, ScriptTarget, transpileModule } from 'typescript' @@ -139,7 +139,7 @@ test('UpdateDialog renders markdown release notes, hides blank notes, and falls const root = createRoot(container) const originalConsoleError = console.error console.error = () => {} - t.after(() => { + t.onTestFinished(() => { console.error = originalConsoleError act(() => root.unmount()) container.remove() diff --git a/tests/update-integrity.test.mjs b/tests/update-integrity.test.mjs index 51de7ea..811bf62 100644 --- a/tests/update-integrity.test.mjs +++ b/tests/update-integrity.test.mjs @@ -3,7 +3,7 @@ import { createHash } from 'node:crypto' import { mkdtempSync, rmSync, writeFileSync } from 'node:fs' import { tmpdir } from 'node:os' import { join } from 'node:path' -import { test } from 'node:test' +import { test } from 'vitest' import { compareVersions, extractAssetDigest, hashFile, parseSha256, releaseTagCandidates } from '../src/main/updateIntegrity.ts' const HEX = 'a3b5c7d9e1f2031425364758697a8b9c0d1e2f30415263748596a7b8c9d0e1f2' diff --git a/tests/urban-cities.test.mjs b/tests/urban-cities.test.mjs index d51fffb..263aa2b 100644 --- a/tests/urban-cities.test.mjs +++ b/tests/urban-cities.test.mjs @@ -1,5 +1,5 @@ import assert from 'node:assert/strict' -import { test } from 'node:test' +import { test } from 'vitest' import { CITY_TIER_META, cityTierOf, FUNCTIONAL_ZONES, functionalZoneCities, functionalZoneCityById, urbanCities } from '../src/renderer/src/thematic/urbanCities.ts' test('city tier metadata contains exactly five tiers with strictly shrinking service radii', () => { diff --git a/tests/viirs-granule.test.mjs b/tests/viirs-granule.test.mjs index 5d9fee9..d85520e 100644 --- a/tests/viirs-granule.test.mjs +++ b/tests/viirs-granule.test.mjs @@ -1,5 +1,5 @@ import assert from 'node:assert/strict' -import { test } from 'node:test' +import { test } from 'vitest' import { viirsCacheStyleId, viirsGranuleDate } from '../src/common/viirs.ts' test('viirsGranuleDate lags two UTC days behind the request time', () => { diff --git a/vite.config.mts b/vite.config.mts new file mode 100644 index 0000000..e68b846 --- /dev/null +++ b/vite.config.mts @@ -0,0 +1,8 @@ +import { defineConfig } from 'vitest/config' + +export default defineConfig({ + test: { + include: ['tests/*.test.mjs'], + experimental: { viteModuleRunner: false } + } +}) From 4a5f871e7927a5b8968ba01220cc45504474f567 Mon Sep 17 00:00:00 2001 From: Liang Date: Fri, 27 Nov 2026 06:07:45 +0800 Subject: [PATCH 3/9] build: migrate to TypeScript 7 Type-check with the native TypeScript 7 compiler. - Remove `baseUrl` and make `paths` relative, since TypeScript 7 dropped `baseUrl`. - Point the tests that use the compiler API (`transpileModule`, the AST) at `@typescript/typescript6`, because TypeScript 7 has no stable JS API yet. - Run TypeScript 7's `tsc` by path in `npm run typecheck`. `@typescript/typescript6` also links a TypeScript 6 `tsc` into `node_modules/.bin`, so a bare `tsc` could run the wrong version. --- AGENTS.md | 2 +- package-lock.json | 405 ++++++++++++++++++++++++++++- package.json | 5 +- tests/account-login.test.mjs | 2 +- tests/button-loading-icon.test.mjs | 2 +- tests/eoq-ui.test.mjs | 2 +- tests/model-importer.test.mjs | 2 +- tests/model-test.test.mjs | 2 +- tests/online-data.test.mjs | 2 +- tests/pr-review.test.mjs | 2 +- tests/renderer-review.test.mjs | 2 +- tests/ui-triggers.test.mjs | 2 +- tests/update-dialog.test.mjs | 2 +- tsconfig.json | 3 +- tsconfig.web.json | 5 +- 15 files changed, 415 insertions(+), 25 deletions(-) diff --git a/AGENTS.md b/AGENTS.md index ed65219..5a881eb 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -23,7 +23,7 @@ map data providers, an AI globe assistant ("EOQ agent"), and teaching/drawing to **Pinned versions — do not bump casually:** - `vite@^8` — the project uses Vite 8 with electron-vite@6. -- `typescript@5.9.x` — pinned TypeScript version (`tsconfig.node.json` + `tsconfig.web.json`). +- `typescript@^7` — the native TypeScript compiler (`tsconfig.node.json` + `tsconfig.web.json`). TypeScript 7 has no stable JS API yet, so tests that compile or parse source import TypeScript 6 from `@typescript/typescript6`. `npm run typecheck` calls `node_modules/typescript/bin/tsc` directly, because `@typescript/typescript6` also links a TypeScript 6 `tsc` into `node_modules/.bin`. - `@base-ui/react@^1.9` + `tailwindcss@^4.3` + `lucide-react` — headless Base UI primitives wrapped in `src/renderer/src/components/ui/` following [DESIGN.md](./DESIGN.md) monochrome Light/Dark tokens. Do not reintroduce `antd` or `@ant-design/*`. - Electron binaries must be installed manually with the npmmirror mirror: `ELECTRON_MIRROR="https://npmmirror.com/mirrors/electron/" node node_modules/electron/install.js` diff --git a/package-lock.json b/package-lock.json index 7a23c63..55226c8 100644 --- a/package-lock.json +++ b/package-lock.json @@ -27,6 +27,7 @@ "@types/node": "^26.6.3", "@types/react": "^19.3.0", "@types/react-dom": "^19.3.0", + "@typescript/typescript6": "^6.0.2", "@vitejs/plugin-react": "^5.2.0", "cesium": "^1.145.0", "class-variance-authority": "^0.7.1", @@ -46,7 +47,7 @@ "tailwind-merge": "^3.7.1", "tailwindcss": "^4.3.5", "tw-shimmer": "^0.4.14", - "typescript": "^5.9.3", + "typescript": "^7.0.2", "vite": "^8.4.0", "vitest": "^5.1.2", "zustand": "^5.1.0" @@ -4577,6 +4578,374 @@ "dev": true, "license": "MIT" }, + "node_modules/@typescript/old": { + "name": "typescript", + "version": "6.0.3", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-6.0.3.tgz", + "integrity": "sha512-y2TvuxSZPDyQakkFRPZHKFm+KKVqIisdg9/CZwm9ftvKXLP8NRWj38/ODjNbr43SsoXqNuAisEf1GdCxqWcdBw==", + "dev": true, + "license": "Apache-2.0", + "bin": { + "tsc": "bin/tsc", + "tsserver": "bin/tsserver" + }, + "engines": { + "node": ">=14.17" + } + }, + "node_modules/@typescript/typescript-aix-ppc64": { + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/@typescript/typescript-aix-ppc64/-/typescript-aix-ppc64-7.0.2.tgz", + "integrity": "sha512-MTKKkWB7p/0E9xi1d1tHtZ5PiLkGEMIq88pK2CubZjOsLtYTLqhgIgi6zepFa+9GHZ6h05NMCkQxGKiPXMxXtQ==", + "cpu": [ + "ppc64" + ], + "dev": true, + "license": "Apache-2.0", + "optional": true, + "os": [ + "aix" + ], + "engines": { + "node": ">=16.20.0" + } + }, + "node_modules/@typescript/typescript-darwin-arm64": { + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/@typescript/typescript-darwin-arm64/-/typescript-darwin-arm64-7.0.2.tgz", + "integrity": "sha512-gowzar9MwS/aRWp6f3a4KUqzRjAZjOsmGNCM6LcTgXum+dBfgsBVMN+AgvOCCbguXyick6LJhpBszxMebJ8syA==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "Apache-2.0", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=16.20.0" + } + }, + "node_modules/@typescript/typescript-darwin-x64": { + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/@typescript/typescript-darwin-x64/-/typescript-darwin-x64-7.0.2.tgz", + "integrity": "sha512-SZ9xZInqApNlNGc9s0W1VSsktYSOe9cFqNOIqmN1Gs8SmkjKZYFt017G4VwPxASInODuAdbTW7sXiFUf893RgA==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "Apache-2.0", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=16.20.0" + } + }, + "node_modules/@typescript/typescript-freebsd-arm64": { + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/@typescript/typescript-freebsd-arm64/-/typescript-freebsd-arm64-7.0.2.tgz", + "integrity": "sha512-W5NH4y/J0plIIS5b2xvTEkU7JFxyqdMAOgf+Ilhl0vHQXKO5dZoxd+C/jEtq56c4F3wk71RB4BMRQ2XdI+bwYQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "Apache-2.0", + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=16.20.0" + } + }, + "node_modules/@typescript/typescript-freebsd-x64": { + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/@typescript/typescript-freebsd-x64/-/typescript-freebsd-x64-7.0.2.tgz", + "integrity": "sha512-UMGDx5sTpzNw3WiPebH7l90IWfJggEd+egHt/q6p7/Cm3zqoV7VxkGXt+3DxPIw8CcmvAB0j3sVVfbhX+M4Tpw==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "Apache-2.0", + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=16.20.0" + } + }, + "node_modules/@typescript/typescript-linux-arm": { + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/@typescript/typescript-linux-arm/-/typescript-linux-arm-7.0.2.tgz", + "integrity": "sha512-gffT3xPz9sR7j/YJExkyPntrI0P2EP9XbOyWzth2/Gs0RstK+90RBcO0ncXoXy/beYll1SXw846Nf2zdnEz0QQ==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "Apache-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=16.20.0" + } + }, + "node_modules/@typescript/typescript-linux-arm64": { + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/@typescript/typescript-linux-arm64/-/typescript-linux-arm64-7.0.2.tgz", + "integrity": "sha512-Qh4eU4/y3yDjnfjjyPYihMj5/ODIlmt+Bzu17OI+fiSRDW57QmU5SiN63exPRNJPKUzcc1INa1NXdrJ+MqHjUQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "Apache-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=16.20.0" + } + }, + "node_modules/@typescript/typescript-linux-loong64": { + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/@typescript/typescript-linux-loong64/-/typescript-linux-loong64-7.0.2.tgz", + "integrity": "sha512-uEHck9i8hoAzXPiYRib1O7miOnz23SxIeVl6F4LXox+qov1K35jHcEW6VHKvZI+pyvl7fZEP4MCU5LYvIq1GuQ==", + "cpu": [ + "loong64" + ], + "dev": true, + "license": "Apache-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=16.20.0" + } + }, + "node_modules/@typescript/typescript-linux-mips64el": { + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/@typescript/typescript-linux-mips64el/-/typescript-linux-mips64el-7.0.2.tgz", + "integrity": "sha512-R4KvAMnE43W5Qeqb0Ly56O3mWMWIAgsMyz36DCaycd5nbg/9kzm0liw3JocfRqyJY0KPmzFjbswozXyW0DnIYA==", + "cpu": [ + "mips64el" + ], + "dev": true, + "license": "Apache-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=16.20.0" + } + }, + "node_modules/@typescript/typescript-linux-ppc64": { + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/@typescript/typescript-linux-ppc64/-/typescript-linux-ppc64-7.0.2.tgz", + "integrity": "sha512-DORx5b3sd/4S7eayxm4FQv+A7CrkUIGRaHiwI8oiHTAI1fAPWhF4J0vAlkC8biAlHSVVwxMQ3tjZ2/DVbnQiiA==", + "cpu": [ + "ppc64" + ], + "dev": true, + "license": "Apache-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=16.20.0" + } + }, + "node_modules/@typescript/typescript-linux-riscv64": { + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/@typescript/typescript-linux-riscv64/-/typescript-linux-riscv64-7.0.2.tgz", + "integrity": "sha512-wf0jqEDOjrPRnKwYRyyJDRo11KMbvMFrU+q4zqKyChODBzvlkbhNQfKvLxQCcwTpdDaXSHZTVuh0JoCrKCUMHQ==", + "cpu": [ + "riscv64" + ], + "dev": true, + "license": "Apache-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=16.20.0" + } + }, + "node_modules/@typescript/typescript-linux-s390x": { + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/@typescript/typescript-linux-s390x/-/typescript-linux-s390x-7.0.2.tgz", + "integrity": "sha512-IkwJc3L7yhytWd/ewjyxNDfOmswCm9GWMJT/ue/dU4aZNbwZeYAetq42VyLmsmSjvoX7z74X6ZaYCtzAr0EuGw==", + "cpu": [ + "s390x" + ], + "dev": true, + "license": "Apache-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=16.20.0" + } + }, + "node_modules/@typescript/typescript-linux-x64": { + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/@typescript/typescript-linux-x64/-/typescript-linux-x64-7.0.2.tgz", + "integrity": "sha512-EYdf2cNg7rgCWJnxCdJ+F3V39O8ihb37eHAu1LK8oAFizgTQbPOK7zHHXbPt8rX24COqODXeI3sIf0fCXG7H/A==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "Apache-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=16.20.0" + } + }, + "node_modules/@typescript/typescript-netbsd-arm64": { + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/@typescript/typescript-netbsd-arm64/-/typescript-netbsd-arm64-7.0.2.tgz", + "integrity": "sha512-+polYF4MF04aPpO5FTkHran9yUQDSXqy5GiSDKpsll5jy3l3+g9QLhpf39T+ePtefhXLOGrLl0QIjkQP6VnelA==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "Apache-2.0", + "optional": true, + "os": [ + "netbsd" + ], + "engines": { + "node": ">=16.20.0" + } + }, + "node_modules/@typescript/typescript-netbsd-x64": { + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/@typescript/typescript-netbsd-x64/-/typescript-netbsd-x64-7.0.2.tgz", + "integrity": "sha512-8YIT0EHM/3dq10ZOVF/A7pc/YSMtbcecct4rWtexrnSCHOPcpC2KTLXfTCR6vDpnSiY12heNb1GiN/wu+T/FyA==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "Apache-2.0", + "optional": true, + "os": [ + "netbsd" + ], + "engines": { + "node": ">=16.20.0" + } + }, + "node_modules/@typescript/typescript-openbsd-arm64": { + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/@typescript/typescript-openbsd-arm64/-/typescript-openbsd-arm64-7.0.2.tgz", + "integrity": "sha512-APT8+ClYnuYm1u9+kgGXoMj2VzWzcymwh2gNSQVySHfkRDGOTVkoWLjCmOQSaO+PoqQ57B0flRp9SA+7GnnkzQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "Apache-2.0", + "optional": true, + "os": [ + "openbsd" + ], + "engines": { + "node": ">=16.20.0" + } + }, + "node_modules/@typescript/typescript-openbsd-x64": { + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/@typescript/typescript-openbsd-x64/-/typescript-openbsd-x64-7.0.2.tgz", + "integrity": "sha512-yX7s+Q0Dln0Dt9tEzZsAjXXR/+ytBM7AlglaqyeMPxQszJ1JhlJdZ6jLA+IzldHtflX81em7lDao1xXu+aRRkg==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "Apache-2.0", + "optional": true, + "os": [ + "openbsd" + ], + "engines": { + "node": ">=16.20.0" + } + }, + "node_modules/@typescript/typescript-sunos-x64": { + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/@typescript/typescript-sunos-x64/-/typescript-sunos-x64-7.0.2.tgz", + "integrity": "sha512-dLJDGaLZ1D4HPQn62u1n8mBDkJREwMsAkCdkwd4Ieqw+x3TUyTsqY0YiBCtE6H6OzzgGk3iuZ3vFWRS+E8/d1g==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "Apache-2.0", + "optional": true, + "os": [ + "sunos" + ], + "engines": { + "node": ">=16.20.0" + } + }, + "node_modules/@typescript/typescript-win32-arm64": { + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/@typescript/typescript-win32-arm64/-/typescript-win32-arm64-7.0.2.tgz", + "integrity": "sha512-Gyl1Vy6OsWesLzmq+EP0Fb7b4Nid5232AvcA2SFcdYreldpNtYFFofPjnt62y9hQy7VTaZp65ICJjuAQRaVcIQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "Apache-2.0", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=16.20.0" + } + }, + "node_modules/@typescript/typescript-win32-x64": { + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/@typescript/typescript-win32-x64/-/typescript-win32-x64-7.0.2.tgz", + "integrity": "sha512-0BQ3HkAHHlKLSp1qRvf3SUhGpGsDuhB/jgFw75guyqbxJqEaS0Cw/VFO8i2nHglJUzQCRtMMR/IBAKE3ETMC4g==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "Apache-2.0", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=16.20.0" + } + }, + "node_modules/@typescript/typescript6": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/@typescript/typescript6/-/typescript6-6.0.2.tgz", + "integrity": "sha512-mbCddXd+jm7hfx7w2YU64/Av4/NqqeG3GoRZgxPcgoTxYjhrcfJRw9ULch71SS4G+Q3bOXFhRvPqjguN0Hyp5w==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "@typescript/old": "npm:typescript@^6" + }, + "bin": { + "tsc6": "bin/tsc6" + } + }, "node_modules/@ungap/structured-clone": { "version": "1.4.0", "resolved": "https://registry.npmmirror.com/@ungap/structured-clone/-/structured-clone-1.4.0.tgz", @@ -9820,16 +10189,38 @@ } }, "node_modules/typescript": { - "version": "5.9.3", - "resolved": "https://registry.npmmirror.com/typescript/-/typescript-5.9.3.tgz", - "integrity": "sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw==", + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-7.0.2.tgz", + "integrity": "sha512-8FYau96o3NKOhbjKi/qNvG/W5jhzxkbdm5sj9AbZ/5T5sWqn3hJgLfGx27sRKZWTvyzCP8dLRBTf5tBTSRVUNA==", "dev": true, + "license": "Apache-2.0", "bin": { - "tsc": "bin/tsc", - "tsserver": "bin/tsserver" + "tsc": "bin/tsc" }, "engines": { - "node": ">=14.17" + "node": ">=16.20.0" + }, + "optionalDependencies": { + "@typescript/typescript-aix-ppc64": "7.0.2", + "@typescript/typescript-darwin-arm64": "7.0.2", + "@typescript/typescript-darwin-x64": "7.0.2", + "@typescript/typescript-freebsd-arm64": "7.0.2", + "@typescript/typescript-freebsd-x64": "7.0.2", + "@typescript/typescript-linux-arm": "7.0.2", + "@typescript/typescript-linux-arm64": "7.0.2", + "@typescript/typescript-linux-loong64": "7.0.2", + "@typescript/typescript-linux-mips64el": "7.0.2", + "@typescript/typescript-linux-ppc64": "7.0.2", + "@typescript/typescript-linux-riscv64": "7.0.2", + "@typescript/typescript-linux-s390x": "7.0.2", + "@typescript/typescript-linux-x64": "7.0.2", + "@typescript/typescript-netbsd-arm64": "7.0.2", + "@typescript/typescript-netbsd-x64": "7.0.2", + "@typescript/typescript-openbsd-arm64": "7.0.2", + "@typescript/typescript-openbsd-x64": "7.0.2", + "@typescript/typescript-sunos-x64": "7.0.2", + "@typescript/typescript-win32-arm64": "7.0.2", + "@typescript/typescript-win32-x64": "7.0.2" } }, "node_modules/uc.micro": { diff --git a/package.json b/package.json index e4defed..68accb4 100644 --- a/package.json +++ b/package.json @@ -16,7 +16,7 @@ "fetch:ffmpeg": "node scripts/fetch-ffmpeg.mjs", "fetch:hawdb": "node scripts/fetch-hawdb.mjs", "start": "electron-vite preview", - "typecheck": "tsc --noEmit -p tsconfig.node.json && tsc --noEmit -p tsconfig.web.json", + "typecheck": "node node_modules/typescript/bin/tsc --noEmit -p tsconfig.node.json && node node_modules/typescript/bin/tsc --noEmit -p tsconfig.web.json", "test": "vitest run" }, "overrides": { @@ -35,6 +35,7 @@ "@types/node": "^26.6.3", "@types/react": "^19.3.0", "@types/react-dom": "^19.3.0", + "@typescript/typescript6": "^6.0.2", "@vitejs/plugin-react": "^5.2.0", "cesium": "^1.145.0", "class-variance-authority": "^0.7.1", @@ -54,7 +55,7 @@ "tailwind-merge": "^3.7.1", "tailwindcss": "^4.3.5", "tw-shimmer": "^0.4.14", - "typescript": "^5.9.3", + "typescript": "^7.0.2", "vite": "^8.4.0", "vitest": "^5.1.2", "zustand": "^5.1.0" diff --git a/tests/account-login.test.mjs b/tests/account-login.test.mjs index 5dc7c56..5ca6738 100644 --- a/tests/account-login.test.mjs +++ b/tests/account-login.test.mjs @@ -4,7 +4,7 @@ import { createRequire } from 'node:module' import { setImmediate as nextTurn } from 'node:timers/promises' import { test, vi } from 'vitest' import { compileFunction } from 'node:vm' -import { ModuleKind, ScriptTarget, transpileModule } from 'typescript' +import { ModuleKind, ScriptTarget, transpileModule } from '@typescript/typescript6' import * as passport from '../src/common/passport.ts' import { serialQueue } from '../src/main/jsonStore.ts' diff --git a/tests/button-loading-icon.test.mjs b/tests/button-loading-icon.test.mjs index c87931d..d2f456b 100644 --- a/tests/button-loading-icon.test.mjs +++ b/tests/button-loading-icon.test.mjs @@ -2,7 +2,7 @@ import assert from 'node:assert/strict' import { readdirSync, readFileSync } from 'node:fs' import { join, relative, resolve } from 'node:path' import { test } from 'vitest' -import ts from 'typescript' +import ts from '@typescript/typescript6' const RENDERER_ROOT = resolve('src/renderer/src') const BUTTON_TAGS = new Set(['Button']) diff --git a/tests/eoq-ui.test.mjs b/tests/eoq-ui.test.mjs index 48e7aef..5daf66d 100644 --- a/tests/eoq-ui.test.mjs +++ b/tests/eoq-ui.test.mjs @@ -7,7 +7,7 @@ import { pathToFileURL } from 'node:url' import { JSDOM } from 'jsdom' import { act, createElement } from 'react' import { createRoot } from 'react-dom/client' -import { JsxEmit, ModuleKind, ScriptTarget, transpileModule } from 'typescript' +import { JsxEmit, ModuleKind, ScriptTarget, transpileModule } from '@typescript/typescript6' globalThis.IS_REACT_ACT_ENVIRONMENT = true diff --git a/tests/model-importer.test.mjs b/tests/model-importer.test.mjs index 7f794fd..64d3bb5 100644 --- a/tests/model-importer.test.mjs +++ b/tests/model-importer.test.mjs @@ -2,7 +2,7 @@ import assert from 'node:assert/strict' import { readFileSync } from 'node:fs' import { createRequire } from 'node:module' import { compileFunction } from 'node:vm' -import { ModuleKind, ScriptTarget, transpileModule } from 'typescript' +import { ModuleKind, ScriptTarget, transpileModule } from '@typescript/typescript6' import { test } from 'vitest' import * as tileMirror from '../src/common/tileMirror.ts' diff --git a/tests/model-test.test.mjs b/tests/model-test.test.mjs index a113012..ccb4fed 100644 --- a/tests/model-test.test.mjs +++ b/tests/model-test.test.mjs @@ -2,7 +2,7 @@ import assert from 'node:assert/strict' import { randomUUID } from 'node:crypto' import { readFileSync } from 'node:fs' import { compileFunction } from 'node:vm' -import { ModuleKind, ScriptTarget, transpileModule } from 'typescript' +import { ModuleKind, ScriptTarget, transpileModule } from '@typescript/typescript6' import { test } from 'vitest' const aiTelemetrySource = readFileSync(new URL('../src/common/aiTelemetry.ts', import.meta.url), 'utf8') diff --git a/tests/online-data.test.mjs b/tests/online-data.test.mjs index 901358d..156a560 100644 --- a/tests/online-data.test.mjs +++ b/tests/online-data.test.mjs @@ -3,7 +3,7 @@ import { readFileSync } from 'node:fs' import { createRequire } from 'node:module' import { test } from 'vitest' import { compileFunction } from 'node:vm' -import { ModuleKind, ScriptTarget, transpileModule } from 'typescript' +import { ModuleKind, ScriptTarget, transpileModule } from '@typescript/typescript6' import * as shared from '../src/common/onlineData.ts' import * as tileMirror from '../src/common/tileMirror.ts' diff --git a/tests/pr-review.test.mjs b/tests/pr-review.test.mjs index 1cf82a8..e4300f4 100644 --- a/tests/pr-review.test.mjs +++ b/tests/pr-review.test.mjs @@ -6,7 +6,7 @@ import { tmpdir } from 'node:os' import { dirname, join, resolve } from 'node:path' import { pathToFileURL } from 'node:url' import { setImmediate as nextTurn } from 'node:timers/promises' -import { transpileModule } from 'typescript' +import { transpileModule } from '@typescript/typescript6' const tileFsUrl = `data:text/javascript,${encodeURIComponent(` import { readdir, stat, unlink as remove } from 'node:fs/promises' diff --git a/tests/renderer-review.test.mjs b/tests/renderer-review.test.mjs index 7958a52..a4ffbeb 100644 --- a/tests/renderer-review.test.mjs +++ b/tests/renderer-review.test.mjs @@ -5,7 +5,7 @@ import { readFileSync } from 'node:fs' import { resolve } from 'node:path' import { pathToFileURL } from 'node:url' import { JSDOM } from 'jsdom' -import { JsxEmit, ModuleKind, ScriptTarget, transpileModule } from 'typescript' +import { JsxEmit, ModuleKind, ScriptTarget, transpileModule } from '@typescript/typescript6' import { act, createElement } from 'react' import { createRoot } from 'react-dom/client' import { DataSourceCollection } from 'cesium' diff --git a/tests/ui-triggers.test.mjs b/tests/ui-triggers.test.mjs index a03c71a..a744123 100644 --- a/tests/ui-triggers.test.mjs +++ b/tests/ui-triggers.test.mjs @@ -7,7 +7,7 @@ import { pathToFileURL } from 'node:url' import { JSDOM } from 'jsdom' import { act, createElement } from 'react' import { createRoot } from 'react-dom/client' -import { JsxEmit, ModuleKind, ScriptTarget, transpileModule } from 'typescript' +import { JsxEmit, ModuleKind, ScriptTarget, transpileModule } from '@typescript/typescript6' globalThis.IS_REACT_ACT_ENVIRONMENT = true diff --git a/tests/update-dialog.test.mjs b/tests/update-dialog.test.mjs index 4e106a1..d974336 100644 --- a/tests/update-dialog.test.mjs +++ b/tests/update-dialog.test.mjs @@ -5,7 +5,7 @@ import { resolve } from 'node:path' import { test } from 'vitest' import { pathToFileURL } from 'node:url' import { JSDOM } from 'jsdom' -import { JsxEmit, ModuleKind, ScriptTarget, transpileModule } from 'typescript' +import { JsxEmit, ModuleKind, ScriptTarget, transpileModule } from '@typescript/typescript6' import { act, createElement } from 'react' import { createRoot } from 'react-dom/client' diff --git a/tsconfig.json b/tsconfig.json index 7b46bfd..e450151 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -11,9 +11,8 @@ "esModuleInterop": true, "resolveJsonModule": true, "jsx": "preserve", - "baseUrl": ".", "paths": { - "@renderer/*": ["src/renderer/src/*"] + "@renderer/*": ["./src/renderer/src/*"] } }, "include": [ diff --git a/tsconfig.web.json b/tsconfig.web.json index 527cc69..568809a 100644 --- a/tsconfig.web.json +++ b/tsconfig.web.json @@ -11,10 +11,9 @@ "skipLibCheck": true, "esModuleInterop": true, "jsx": "react-jsx", - "baseUrl": ".", "paths": { - "@renderer/*": ["src/renderer/src/*"], - "@/*": ["src/renderer/src/*"] + "@renderer/*": ["./src/renderer/src/*"], + "@/*": ["./src/renderer/src/*"] } }, "include": [ From b421c00ad42ba018cd599c2124eeb3e50be9b503 Mon Sep 17 00:00:00 2001 From: Liang Date: Fri, 27 Nov 2026 06:10:37 +0800 Subject: [PATCH 4/9] build: migrate to Vite+ and @liangmi/vp-config Move the toolchain to Vite+, configured with the `@liangmi/vp-config` preset. - Alias `vite` to `@voidzero-dev/vite-plus-core`, and import test APIs from `vite-plus/test`. - Replace `npm run typecheck` with `npm run check` (`vp check`), which type-checks through tsrs-lint. Lint rules and formatting are off (`check: { fmt: false, lint: false }`) and get turned on in follow-up PRs. - Make the root `tsconfig.json` reference `tsconfig.node.json` and `tsconfig.web.json`, so each file is checked with its own project's settings. Add the two config files to the node project. - Keep the Node test environment. The preset would pick jsdom, but the tests set up their own DOM. --- .github/workflows/build.yml | 4 +- .gitignore | 1 + AGENTS.md | 10 +- package-lock.json | 4384 ++++++++++++++++-------- package.json | 12 +- tests/account-login.test.mjs | 2 +- tests/account-store.test.mjs | 2 +- tests/agri-regions.test.mjs | 2 +- tests/ai-history.test.mjs | 2 +- tests/ai-settings-draft.test.mjs | 2 +- tests/annotation-references.test.mjs | 2 +- tests/button-loading-icon.test.mjs | 2 +- tests/decision-sandbox.test.mjs | 2 +- tests/drawing-store.test.mjs | 2 +- tests/eoq-ui.test.mjs | 2 +- tests/ffmpeg-fetch.test.mjs | 2 +- tests/flight-framing.test.mjs | 2 +- tests/flight-stops.test.mjs | 2 +- tests/gcj02.test.mjs | 2 +- tests/globe-navigation.test.mjs | 2 +- tests/globe-surface.test.mjs | 2 +- tests/hawdb-fetch.test.mjs | 2 +- tests/hawdb.test.mjs | 2 +- tests/hsr-lines.test.mjs | 2 +- tests/live-typhoons.test.mjs | 2 +- tests/migration-geometry.test.mjs | 2 +- tests/model-importer.test.mjs | 2 +- tests/model-test.test.mjs | 2 +- tests/mountain-zonation.test.mjs | 2 +- tests/night-basemap.test.mjs | 2 +- tests/notable-peaks.test.mjs | 2 +- tests/offscreen-camera.test.mjs | 2 +- tests/offscreen-container.test.mjs | 2 +- tests/offscreen-mac.test.mjs | 2 +- tests/offscreen-paths.test.mjs | 2 +- tests/offscreen-state.test.mjs | 2 +- tests/offscreen-timing.test.mjs | 2 +- tests/online-data.test.mjs | 2 +- tests/packaging.test.mjs | 2 +- tests/passport-account.test.mjs | 2 +- tests/poi-aggregation.test.mjs | 2 +- tests/poi-categories.test.mjs | 2 +- tests/population-layer.test.mjs | 2 +- tests/pr-review.test.mjs | 2 +- tests/pr95-fixes.test.mjs | 2 +- tests/privacy.test.mjs | 2 +- tests/recording-state.test.mjs | 2 +- tests/recording.test.mjs | 2 +- tests/renderer-review.test.mjs | 2 +- tests/resource-failure.test.mjs | 2 +- tests/scene-camera.test.mjs | 2 +- tests/sea-level-seed.test.mjs | 2 +- tests/sea-level.test.mjs | 2 +- tests/shape-graphics.test.mjs | 2 +- tests/terrain-availability.test.mjs | 2 +- tests/terrain-providers.test.mjs | 2 +- tests/thematic-layer-ids.test.mjs | 2 +- tests/thematic-request-render.test.mjs | 2 +- tests/theme-mode.test.mjs | 2 +- tests/tile-mirror.test.mjs | 2 +- tests/touch-interaction.test.mjs | 2 +- tests/ui-no-antd.test.mjs | 2 +- tests/ui-triggers.test.mjs | 2 +- tests/update-channel.test.mjs | 2 +- tests/update-dialog.test.mjs | 2 +- tests/update-integrity.test.mjs | 2 +- tests/urban-cities.test.mjs | 2 +- tests/viirs-granule.test.mjs | 2 +- tsconfig.json | 24 +- tsconfig.node.json | 4 +- vite.config.mts | 7 +- 71 files changed, 3135 insertions(+), 1437 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index de5060f..53b0739 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -18,8 +18,8 @@ jobs: cache: npm - name: Install dependencies run: npm ci - - name: Typecheck - run: npm run typecheck + - name: Check + run: npm run check - name: Test run: npm test - name: Build diff --git a/.gitignore b/.gitignore index 08a891f..b2436ac 100644 --- a/.gitignore +++ b/.gitignore @@ -9,3 +9,4 @@ resources/bin csdn-blog.md updater-server/.vercel .env +.vitest/ diff --git a/AGENTS.md b/AGENTS.md index 5a881eb..e401a82 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -22,8 +22,8 @@ map data providers, an AI globe assistant ("EOQ agent"), and teaching/drawing to **Pinned versions — do not bump casually:** -- `vite@^8` — the project uses Vite 8 with electron-vite@6. -- `typescript@^7` — the native TypeScript compiler (`tsconfig.node.json` + `tsconfig.web.json`). TypeScript 7 has no stable JS API yet, so tests that compile or parse source import TypeScript 6 from `@typescript/typescript6`. `npm run typecheck` calls `node_modules/typescript/bin/tsc` directly, because `@typescript/typescript6` also links a TypeScript 6 `tsc` into `node_modules/.bin`. +- `vite-plus` — Vite+ provides Vite 8 through the npm alias for `vite` (`@voidzero-dev/vite-plus-core`). Keep the `devDependencies` alias and the `overrides` entry aligned when upgrading Vite+. +- `typescript@^7` — the native TypeScript compiler (`tsconfig.node.json` + `tsconfig.web.json`). TypeScript 7 has no stable JS API yet, so tests that compile or parse source import TypeScript 6 from `@typescript/typescript6`. Type checking runs in `npm run check` through Vite+, so don't call `tsc` from scripts: `@typescript/typescript6` also links a TypeScript 6 `tsc` into `node_modules/.bin`. - `@base-ui/react@^1.9` + `tailwindcss@^4.3` + `lucide-react` — headless Base UI primitives wrapped in `src/renderer/src/components/ui/` following [DESIGN.md](./DESIGN.md) monochrome Light/Dark tokens. Do not reintroduce `antd` or `@ant-design/*`. - Electron binaries must be installed manually with the npmmirror mirror: `ELECTRON_MIRROR="https://npmmirror.com/mirrors/electron/" node node_modules/electron/install.js` @@ -95,10 +95,12 @@ npm run dev # electron-vite dev server + app npm run build # production build npm run fetch:ffmpeg # pinned LGPL FFmpeg for Windows or Linux into resources/bin npm run build:linux # AppImage + deb for Linux x64 and arm64 -npm run typecheck # tsc (node) + tsc (web) -npm test # Vitest unit tests (tests/*.test.mjs), run by CI +npm run check # vp check: type checks (lint and format are off for now), run by CI +npm test # Vitest unit tests through Vite+ (tests/*.test.mjs), run by CI ``` +Vite+ config lives in `vite.config.mts`, on top of the `@liangmi/vp-config` preset. Import test APIs from `vite-plus/test`, not `vitest`. + Vitest uses native Node.js imports (`experimental.viteModuleRunner: false` in `vite.config.mts`), so the `module.registerHooks` fixtures in the tests can load React components and simulate filesystem failures. ## Docs diff --git a/package-lock.json b/package-lock.json index 55226c8..4c9b127 100644 --- a/package-lock.json +++ b/package-lock.json @@ -22,6 +22,7 @@ "@assistant-ui/react": "^0.15.37", "@assistant-ui/react-markdown": "^0.14.26", "@base-ui/react": "^1.9.0", + "@liangmi/vp-config": "^1.0.2", "@sentry/electron": "^8.0.0", "@tailwindcss/vite": "^4.3.5", "@types/node": "^26.6.3", @@ -48,8 +49,8 @@ "tailwindcss": "^4.3.5", "tw-shimmer": "^0.4.14", "typescript": "^7.0.2", - "vite": "^8.4.0", - "vitest": "^5.1.2", + "vite": "npm:@voidzero-dev/vite-plus-core@8.3.8000", + "vite-plus": "1.7.0", "zustand": "^5.1.0" } }, @@ -553,6 +554,13 @@ } } }, + "node_modules/@blazediff/core": { + "version": "1.10.0", + "resolved": "https://registry.npmjs.org/@blazediff/core/-/core-1.10.0.tgz", + "integrity": "sha512-AOQff0zgR7cGsZL+4E7hVkmujoPUpm0J9xzWGWZj5wCjd3gmxESXAPfKyuzs93VdpQNFhHlBhfOjrcZ+XTERtQ==", + "dev": true, + "license": "MIT" + }, "node_modules/@cesium/engine": { "version": "26.3.0", "resolved": "https://registry.npmmirror.com/@cesium/engine/-/engine-26.3.0.tgz", @@ -1292,6 +1300,20 @@ "url": "https://liberapay.com/Koromix" } }, + "node_modules/@liangmi/vp-config": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/@liangmi/vp-config/-/vp-config-1.0.2.tgz", + "integrity": "sha512-WbirZirK+TCupY9ilWLEEnMMmABA5zhcuY3AY4cx9x9KNBtYrEOg0zN4rEn9rjzssxk9m0ewoQHfiH3EH3fyHA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@oxlint-flat-config/composer": "^0.3.1", + "oxlint-flat-config": "^0.4.0" + }, + "peerDependencies": { + "vite-plus": ">=1.0.0" + } + }, "node_modules/@malept/cross-spawn-promise": { "version": "2.0.0", "resolved": "https://registry.npmmirror.com/@malept/cross-spawn-promise/-/cross-spawn-promise-2.0.0.tgz", @@ -1845,6 +1867,16 @@ "node": "^20.19.0 || >=22.12.0" } }, + "node_modules/@oxc-project/runtime": { + "version": "0.159.0", + "resolved": "https://registry.npmjs.org/@oxc-project/runtime/-/runtime-0.159.0.tgz", + "integrity": "sha512-z+wJlHpqB2rsnQ5PbQlWKC7lYISlHrniQ3N5JF4LGaa+kOopx5u5DMT2P7pN12fsXFg1gVcoLdRXPRyIS61OKQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, "node_modules/@oxc-project/types": { "version": "0.143.0", "resolved": "https://registry.npmmirror.com/@oxc-project/types/-/types-0.143.0.tgz", @@ -1854,181 +1886,915 @@ "url": "https://github.com/sponsors/Boshen" } }, - "node_modules/@peculiar/asn1-schema": { - "version": "2.10.0", - "resolved": "https://registry.npmmirror.com/@peculiar/asn1-schema/-/asn1-schema-2.10.0.tgz", - "integrity": "sha512-GhokD41lV4gQrrLYm3wCkHfBOnJrnhDMgt4XeMW8gzfE1UdJqIuSwsE+ggf82XBjUXRJylcm+KIGQFa4utIVLw==", + "node_modules/@oxfmt/binding-android-arm-eabi": { + "version": "0.79.0", + "resolved": "https://registry.npmjs.org/@oxfmt/binding-android-arm-eabi/-/binding-android-arm-eabi-0.79.0.tgz", + "integrity": "sha512-xOCQ/rvokUXs8SxOQY5Wy2ukPaZJZ0PmdJovN0ryB1c8DVEtbcvliLdYtINUYh8QOTpmBOctIisSJk9tvh+J6w==", + "cpu": [ + "arm" + ], "dev": true, - "dependencies": { - "@peculiar/utils": "^2.0.2", - "asn1js": "^3.0.10", - "tslib": "^2.8.1" - }, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], "engines": { - "node": ">=14" + "node": "^20.19.0 || >=22.12.0" } }, - "node_modules/@peculiar/json-schema": { - "version": "1.1.12", - "resolved": "https://registry.npmmirror.com/@peculiar/json-schema/-/json-schema-1.1.12.tgz", - "integrity": "sha512-coUfuoMeIB7B8/NMekxaDzLhaYmp0HZNPEjYRm9goRou8UZIC3z21s0sL9AWoCw4EG876QyO3kYrc61WNF9B/w==", + "node_modules/@oxfmt/binding-android-arm64": { + "version": "0.79.0", + "resolved": "https://registry.npmjs.org/@oxfmt/binding-android-arm64/-/binding-android-arm64-0.79.0.tgz", + "integrity": "sha512-WMLDvCjjchUYtI6zXKOdzTDGm72BaYZiz1/VhB1rrxdakUZRlJh1aMr3CT6ui51uHcWVBycULIXSZHpw6u2pTQ==", + "cpu": [ + "arm64" + ], "dev": true, - "dependencies": { - "tslib": "^2.0.0" - }, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], "engines": { - "node": ">=8.0.0" + "node": "^20.19.0 || >=22.12.0" } }, - "node_modules/@peculiar/utils": { - "version": "2.0.3", - "resolved": "https://registry.npmmirror.com/@peculiar/utils/-/utils-2.0.3.tgz", - "integrity": "sha512-+oL3HPFRIZ1St2K50lWCXiioIgSoxzz7R1J3uF6neO2yl1sgmpgY6XXJH4BdpoDkMWznQTeYF6oWNDZLCdQ4eQ==", + "node_modules/@oxfmt/binding-darwin-arm64": { + "version": "0.79.0", + "resolved": "https://registry.npmjs.org/@oxfmt/binding-darwin-arm64/-/binding-darwin-arm64-0.79.0.tgz", + "integrity": "sha512-+LzSN7w7tULz96ntS1Uqe5oI00XZ0o/m/t3+eSfiQp3aTPnj2eGUafqEWryMLk84j7x9NiF+GEP2YT4/BfClgA==", + "cpu": [ + "arm64" + ], "dev": true, - "dependencies": { - "tslib": "^2.8.1" + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" } }, - "node_modules/@peculiar/webcrypto": { - "version": "1.7.1", - "resolved": "https://registry.npmmirror.com/@peculiar/webcrypto/-/webcrypto-1.7.1.tgz", - "integrity": "sha512-ODOov0sGMJMf3jPonOkgGqPknTsu+DdQ7kD++gz8aI+aFMOMHFbWAA2taqXXVTdP+OTOQR/znGvSpmkeI0WTYQ==", + "node_modules/@oxfmt/binding-darwin-x64": { + "version": "0.79.0", + "resolved": "https://registry.npmjs.org/@oxfmt/binding-darwin-x64/-/binding-darwin-x64-0.79.0.tgz", + "integrity": "sha512-KFiMRhKeiiooaS1dKc4r8AZgOrfOhwVe1yf/aRef+8BajJwtVjMtlsQl/BNRxtkFbq13GjEo/4Q+9YhFGU4o6g==", + "cpu": [ + "x64" + ], "dev": true, - "dependencies": { - "@peculiar/asn1-schema": "^2.7.0", - "@peculiar/json-schema": "^1.1.12", - "@peculiar/utils": "^2.0.2", - "tslib": "^2.8.1", - "webcrypto-core": "^1.9.2" - }, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], "engines": { - "node": ">=14.18.0" + "node": "^20.19.0 || >=22.12.0" } }, - "node_modules/@posthog/browser-common": { - "version": "0.12.0", - "resolved": "https://registry.npmmirror.com/@posthog/browser-common/-/browser-common-0.12.0.tgz", - "integrity": "sha512-P1CubrDp1xwYi2DQxjzJITEeMJpZ7qYcbHuhtXLHgkG8bE6gLy0JwkykjRtEFbElvJNbHQO1jQi7Cbb3JyazNw==", + "node_modules/@oxfmt/binding-freebsd-x64": { + "version": "0.79.0", + "resolved": "https://registry.npmjs.org/@oxfmt/binding-freebsd-x64/-/binding-freebsd-x64-0.79.0.tgz", + "integrity": "sha512-lHVIp0g8ZOFKiqVscvttp+3HJkkRH6XkGgfAA0lVexIlE1mMFVp4V7RBdxz/P9p7T8pSNsYdapFWvdT21Mib9w==", + "cpu": [ + "x64" + ], + "dev": true, "license": "MIT", - "dependencies": { - "@posthog/core": "^1.68.0", - "@posthog/types": "^1.425.1", - "dompurify": "^3.4.13", - "preact": "^10.29.3" + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" } }, - "node_modules/@posthog/core": { - "version": "1.69.1", - "resolved": "https://registry.npmmirror.com/@posthog/core/-/core-1.69.1.tgz", - "integrity": "sha512-36hlJRZlVh5d+yBOmqObT162SrqNes9yY4x4wLDXVSu5Dzdt19KNxQ136cd37+U0yABZVx7ehjtWslyn1iG+0Q==", + "node_modules/@oxfmt/binding-linux-arm-gnueabihf": { + "version": "0.79.0", + "resolved": "https://registry.npmjs.org/@oxfmt/binding-linux-arm-gnueabihf/-/binding-linux-arm-gnueabihf-0.79.0.tgz", + "integrity": "sha512-Pt35GoxiMUfnr+23cuzk07XQVvISDFxxPcp/aFVB87+RQvJoQaBo/XN7Re9XxgElvbELdyxTLnV9XM2aTfJeUA==", + "cpu": [ + "arm" + ], + "dev": true, "license": "MIT", - "dependencies": { - "@posthog/types": "^1.425.1" + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" } }, - "node_modules/@posthog/types": { - "version": "1.425.1", - "resolved": "https://registry.npmmirror.com/@posthog/types/-/types-1.425.1.tgz", - "integrity": "sha512-mh7jyQ5lN+XCeOnMdYkBEFtO/G0TxeLOKTWNH6E6OZjxS4nVM0Tb2xQt+FG5DCFM9qzL2HmuX6A793TwlJVDvw==", - "license": "MIT" - }, - "node_modules/@radix-ui/number": { - "version": "1.1.3", - "resolved": "https://registry.npmmirror.com/@radix-ui/number/-/number-1.1.3.tgz", - "integrity": "sha512-Road2bidD0uu/1BGDOWNdPI06g0lIRy6IF9GZcIrDK2KGItfor8IQwQa+yM2ERgHM1MmHxaxpTzk0/Jp42lNfA==", - "dev": true - }, - "node_modules/@radix-ui/primitive": { - "version": "1.2.0", - "resolved": "https://registry.npmmirror.com/@radix-ui/primitive/-/primitive-1.2.0.tgz", - "integrity": "sha512-KABY+VMIRPJL+Vyzv/335FEhXXD/xDv8BMb1kl48/aXJZMH0LtHCTx5ga5RnxaEP3nZHtmTLf1P9vanmFX46bw==", - "dev": true - }, - "node_modules/@radix-ui/react-accessible-icon": { - "version": "1.2.0", - "resolved": "https://registry.npmmirror.com/@radix-ui/react-accessible-icon/-/react-accessible-icon-1.2.0.tgz", - "integrity": "sha512-BB4+HHkFl3HipEAhm/mLhrpXV+2kRX7MvY4AaImUcQVeWQt5KhV1JEByNs8NGfJOcr95RcQGijt9+OrCo68xGA==", + "node_modules/@oxfmt/binding-linux-arm-musleabihf": { + "version": "0.79.0", + "resolved": "https://registry.npmjs.org/@oxfmt/binding-linux-arm-musleabihf/-/binding-linux-arm-musleabihf-0.79.0.tgz", + "integrity": "sha512-zPi9Dni58VKp3r1QUcFvnbJNfBr49qyecq0vlM4SaX/MSjmguq77VngirghDua5tyhIDfqdUMTCK2KRlnZFp/g==", + "cpu": [ + "arm" + ], "dev": true, - "dependencies": { - "@radix-ui/react-visually-hidden": "1.2.13" - }, - "peerDependencies": { - "@types/react": "*", - "@types/react-dom": "*", - "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc", - "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" - }, - "peerDependenciesMeta": { - "@types/react": { - "optional": true - }, - "@types/react-dom": { - "optional": true - } + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" } }, - "node_modules/@radix-ui/react-accordion": { - "version": "1.3.1", - "resolved": "https://registry.npmmirror.com/@radix-ui/react-accordion/-/react-accordion-1.3.1.tgz", - "integrity": "sha512-lCZ6sbGS/7WO0j84yx4srIgOf0MRJ/sZ13RonADXxvKBym8xrxNCq5f6DibGcr38sIlwPk8/52uYdXeOPsbEDw==", + "node_modules/@oxfmt/binding-linux-arm64-gnu": { + "version": "0.79.0", + "resolved": "https://registry.npmjs.org/@oxfmt/binding-linux-arm64-gnu/-/binding-linux-arm64-gnu-0.79.0.tgz", + "integrity": "sha512-XhRehATEWjwX7VVEgDUD+7pfHYncQIJaEU0qsHvEKtu9XX0QYzcKvXhU9+URfiGX9WRh3wy2Ow+YCc3EeHtImg==", + "cpu": [ + "arm64" + ], "dev": true, - "dependencies": { - "@radix-ui/primitive": "1.2.0", - "@radix-ui/react-collapsible": "1.2.1", - "@radix-ui/react-collection": "1.2.0", - "@radix-ui/react-compose-refs": "1.1.5", - "@radix-ui/react-context": "1.3.0", - "@radix-ui/react-direction": "1.2.0", - "@radix-ui/react-id": "1.1.4", - "@radix-ui/react-primitive": "2.2.0", - "@radix-ui/react-use-controllable-state": "1.3.0" - }, - "peerDependencies": { - "@types/react": "*", - "@types/react-dom": "*", - "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc", - "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" - }, - "peerDependenciesMeta": { - "@types/react": { - "optional": true - }, - "@types/react-dom": { - "optional": true - } + "libc": [ + "glibc" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" } }, - "node_modules/@radix-ui/react-alert-dialog": { - "version": "1.2.1", - "resolved": "https://registry.npmmirror.com/@radix-ui/react-alert-dialog/-/react-alert-dialog-1.2.1.tgz", - "integrity": "sha512-MWC4N7RY+qsbNrFNo7yQ9ZbdoZEW+B5DtpWxJfUnVCqcQxxqqg3qis3RMPTDbCNaTIdHJSn5XDkl9ZdVWXknLg==", + "node_modules/@oxfmt/binding-linux-arm64-musl": { + "version": "0.79.0", + "resolved": "https://registry.npmjs.org/@oxfmt/binding-linux-arm64-musl/-/binding-linux-arm64-musl-0.79.0.tgz", + "integrity": "sha512-gbVjFZYug0MEyqvuTAzXGNxFJmBqBO32o1Fud1lG8bGs6oVz48ZtNQyEcAzqrOwaaG+Sxtv4gVzcsfht9aqmkg==", + "cpu": [ + "arm64" + ], "dev": true, - "dependencies": { - "@radix-ui/primitive": "1.2.0", - "@radix-ui/react-compose-refs": "1.1.5", - "@radix-ui/react-context": "1.3.0", - "@radix-ui/react-dialog": "1.3.1", - "@radix-ui/react-primitive": "2.2.0" - }, - "peerDependencies": { - "@types/react": "*", - "@types/react-dom": "*", - "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc", - "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" - }, - "peerDependenciesMeta": { - "@types/react": { - "optional": true - }, - "@types/react-dom": { - "optional": true - } + "libc": [ + "musl" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" } }, - "node_modules/@radix-ui/react-arrow": { - "version": "1.1.17", - "resolved": "https://registry.npmmirror.com/@radix-ui/react-arrow/-/react-arrow-1.1.17.tgz", - "integrity": "sha512-67jjcVvxjXCCStnTW3Z+M7jmaFMuMR7M2JgpDzH4w7JSRrikmzhjfYgP/09ECb8n7whnsgh1ifJ+Ie96qEj+pQ==", + "node_modules/@oxfmt/binding-linux-ppc64-gnu": { + "version": "0.79.0", + "resolved": "https://registry.npmjs.org/@oxfmt/binding-linux-ppc64-gnu/-/binding-linux-ppc64-gnu-0.79.0.tgz", + "integrity": "sha512-0N0sD3vnllyuiNh1r6zKvNXWE/CakcPKJAespg7XE2+sfvxpz5Q1iFah8sF5aedsOmVvbZaOPZcSHVmMosT1fA==", + "cpu": [ + "ppc64" + ], + "dev": true, + "libc": [ + "glibc" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@oxfmt/binding-linux-riscv64-gnu": { + "version": "0.79.0", + "resolved": "https://registry.npmjs.org/@oxfmt/binding-linux-riscv64-gnu/-/binding-linux-riscv64-gnu-0.79.0.tgz", + "integrity": "sha512-YtjqUHolcX6cv0ZMZuKQCM4H0ae/okcowy0wGcPHJk4O+8zjy3TvNhzDQ1/KGCkMJO8Fwulm1JcPJsraVJ3p+w==", + "cpu": [ + "riscv64" + ], + "dev": true, + "libc": [ + "glibc" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@oxfmt/binding-linux-riscv64-musl": { + "version": "0.79.0", + "resolved": "https://registry.npmjs.org/@oxfmt/binding-linux-riscv64-musl/-/binding-linux-riscv64-musl-0.79.0.tgz", + "integrity": "sha512-H2gb9bEBr5tcdP5FU8JYTfgOavXDorWcAAlwci/zEKF2jzgh/oEr/SAw6aHB9n3FLEvnKvOh0A1fjku+vgYoUA==", + "cpu": [ + "riscv64" + ], + "dev": true, + "libc": [ + "musl" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@oxfmt/binding-linux-s390x-gnu": { + "version": "0.79.0", + "resolved": "https://registry.npmjs.org/@oxfmt/binding-linux-s390x-gnu/-/binding-linux-s390x-gnu-0.79.0.tgz", + "integrity": "sha512-aZUbyWW5dSOxT/u6suWc4S9GVDt7YPPNMKQon+z79M8dpXmosadcFHAb7jBhpU7Hdsd2GN6/y3nd0JFTsGddZw==", + "cpu": [ + "s390x" + ], + "dev": true, + "libc": [ + "glibc" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@oxfmt/binding-linux-x64-gnu": { + "version": "0.79.0", + "resolved": "https://registry.npmjs.org/@oxfmt/binding-linux-x64-gnu/-/binding-linux-x64-gnu-0.79.0.tgz", + "integrity": "sha512-5pW/ZHYfjjQ71gQR+EKzDz8ZzWIDHlTUtWtxVFNgZbKxVZnRxiSXVrllbjpJtx1q8VtSPZ+Lyg9BLny3yw+PTA==", + "cpu": [ + "x64" + ], + "dev": true, + "libc": [ + "glibc" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@oxfmt/binding-linux-x64-musl": { + "version": "0.79.0", + "resolved": "https://registry.npmjs.org/@oxfmt/binding-linux-x64-musl/-/binding-linux-x64-musl-0.79.0.tgz", + "integrity": "sha512-3IVUerTDB7Dvd90c1EurAzlVnlE9Azl7Wn8e33qX3wL/IqnslF+P7HvwkD+VeMbHxRtuw0EEBGSArZFXpUAZrQ==", + "cpu": [ + "x64" + ], + "dev": true, + "libc": [ + "musl" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@oxfmt/binding-openharmony-arm64": { + "version": "0.79.0", + "resolved": "https://registry.npmjs.org/@oxfmt/binding-openharmony-arm64/-/binding-openharmony-arm64-0.79.0.tgz", + "integrity": "sha512-C5QDgJBtu9+/2BQScoP7ynv54PLOqfoSqhRWwI0D0RPOwYD4tYj0TUdJbXMO1fNegL/5zJiSOxkq6II2xvttWg==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "openharmony" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@oxfmt/binding-win32-arm64-msvc": { + "version": "0.79.0", + "resolved": "https://registry.npmjs.org/@oxfmt/binding-win32-arm64-msvc/-/binding-win32-arm64-msvc-0.79.0.tgz", + "integrity": "sha512-zlW1m8M49vNGgqQF/ze80KW8pZMicnW2XDZGBHuYtXTRYn4ewvgpqN9wwoqb6uLZZfb1R1zaQWKEB8cs7KYjwA==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@oxfmt/binding-win32-ia32-msvc": { + "version": "0.79.0", + "resolved": "https://registry.npmjs.org/@oxfmt/binding-win32-ia32-msvc/-/binding-win32-ia32-msvc-0.79.0.tgz", + "integrity": "sha512-wbb7hFv2wK3SCTfu8dl1ydNsXM5dmH+PJMU3sojCkfKcG29VDpITL5/AtouCzXjkOc90QRkcAZcg36gP0KqoHA==", + "cpu": [ + "ia32" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@oxfmt/binding-win32-x64-msvc": { + "version": "0.79.0", + "resolved": "https://registry.npmjs.org/@oxfmt/binding-win32-x64-msvc/-/binding-win32-x64-msvc-0.79.0.tgz", + "integrity": "sha512-JLaeaQ+4LkQiVXY06JIV1dBFEDJzssvDieK/3Poi6CsY+c4UxghZVrrsfcKGJ5R/0F2Sw3C5Lf5Hu0sM5qJfPw==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@oxlint-flat-config/composer": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/@oxlint-flat-config/composer/-/composer-0.3.1.tgz", + "integrity": "sha512-LGAbkgDZrwgiGc8/R4gyQCMT9aT3XugX1w5Uy86vbnmi4xGSrztPpVmie7ZqJFtlX/2BgOGW9MLi3TtFzu1LIQ==", + "dev": true, + "license": "MIT", + "peerDependencies": { + "oxlint": ">=1.85.0", + "oxlint-flat-config": "^0.4.0", + "vite-plus": ">=1.0.0" + }, + "peerDependenciesMeta": { + "oxlint": { + "optional": true + }, + "vite-plus": { + "optional": true + } + } + }, + "node_modules/@oxlint/binding-android-arm-eabi": { + "version": "1.94.0", + "resolved": "https://registry.npmjs.org/@oxlint/binding-android-arm-eabi/-/binding-android-arm-eabi-1.94.0.tgz", + "integrity": "sha512-730FKSBsKg/NawYnpI3gXRroXptOVqY32iYBPLUZaSx0vgYzOeiNtwojZL4gJdzo9wDvHUlstShmGRHrWcbRYg==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@oxlint/binding-android-arm64": { + "version": "1.94.0", + "resolved": "https://registry.npmjs.org/@oxlint/binding-android-arm64/-/binding-android-arm64-1.94.0.tgz", + "integrity": "sha512-8v8TICIiZpXLot1HSq5+vsG9NEKQ5czQBYlUqJR75OVfFDr3cGOmRU/CtHDWnS4tm8nW+Z4Y357qGToSfYqFvA==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@oxlint/binding-darwin-arm64": { + "version": "1.94.0", + "resolved": "https://registry.npmjs.org/@oxlint/binding-darwin-arm64/-/binding-darwin-arm64-1.94.0.tgz", + "integrity": "sha512-NePcRMO/ltt1Pnytohl6pl0bd/QyRX8HbpptuDz9LK7FTsFD4lKxDMBt7di9k6IFLO0J05jO2nm7wGqIh6dRHA==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@oxlint/binding-darwin-x64": { + "version": "1.94.0", + "resolved": "https://registry.npmjs.org/@oxlint/binding-darwin-x64/-/binding-darwin-x64-1.94.0.tgz", + "integrity": "sha512-QV+m+OaEgLmYyillvP1wKXhMm6tDZEWx3vG7Wjmx9ybg15+6YMfqzvp6e+uPukC6zNywuule0vMn0fZgihZzZA==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@oxlint/binding-freebsd-x64": { + "version": "1.94.0", + "resolved": "https://registry.npmjs.org/@oxlint/binding-freebsd-x64/-/binding-freebsd-x64-1.94.0.tgz", + "integrity": "sha512-KVZjca581nrV6P71kZ9M1otBib9LH0IMn9rr4mrnbRp18V0HiZhBHbU26gji/Ieq2G34qMacnMc3zrmKmvWqWA==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@oxlint/binding-linux-arm-gnueabihf": { + "version": "1.94.0", + "resolved": "https://registry.npmjs.org/@oxlint/binding-linux-arm-gnueabihf/-/binding-linux-arm-gnueabihf-1.94.0.tgz", + "integrity": "sha512-AMQtgQJk8DgdIV+qaQ5sFoHAko4iKa8zo+gYqELy2grtU8hXWB08DAGB3u90aQL1YSxbd3zqHjgcODBHDFyzBQ==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@oxlint/binding-linux-arm-musleabihf": { + "version": "1.94.0", + "resolved": "https://registry.npmjs.org/@oxlint/binding-linux-arm-musleabihf/-/binding-linux-arm-musleabihf-1.94.0.tgz", + "integrity": "sha512-ZLzoGVGAmQkp9leeB5rNxAXLcvlmkmd/GY71LKd5uikk+28NEApY3S2FB3pq6MkfOCFFnFg6QgD9lJIjd07D0Q==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@oxlint/binding-linux-arm64-gnu": { + "version": "1.94.0", + "resolved": "https://registry.npmjs.org/@oxlint/binding-linux-arm64-gnu/-/binding-linux-arm64-gnu-1.94.0.tgz", + "integrity": "sha512-N1dW6o7cY90hLVkDsvz8nWIFOwbO+n272pvW7uLYB7u47HagJVnLChfK6QA9dWFdiPudud9zfksVUOciHc5PNA==", + "cpu": [ + "arm64" + ], + "dev": true, + "libc": [ + "glibc" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@oxlint/binding-linux-arm64-musl": { + "version": "1.94.0", + "resolved": "https://registry.npmjs.org/@oxlint/binding-linux-arm64-musl/-/binding-linux-arm64-musl-1.94.0.tgz", + "integrity": "sha512-7tCF4OV/bGDQ2xxgb+sDI97SpmmDrUII4JxTG553voJVA9cnkbXSGSXzo78Ax73BuhEOPoQc2Qi6VrfT0cDG2A==", + "cpu": [ + "arm64" + ], + "dev": true, + "libc": [ + "musl" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@oxlint/binding-linux-ppc64-gnu": { + "version": "1.94.0", + "resolved": "https://registry.npmjs.org/@oxlint/binding-linux-ppc64-gnu/-/binding-linux-ppc64-gnu-1.94.0.tgz", + "integrity": "sha512-B5vUHE4wNisVEuaYxwFUn6tY+vw7A+9APxxqGKI+UmP3yKLpkhnt0qsaCrzjpX55F8rCRHBaTvIDdYo32NE36g==", + "cpu": [ + "ppc64" + ], + "dev": true, + "libc": [ + "glibc" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@oxlint/binding-linux-riscv64-gnu": { + "version": "1.94.0", + "resolved": "https://registry.npmjs.org/@oxlint/binding-linux-riscv64-gnu/-/binding-linux-riscv64-gnu-1.94.0.tgz", + "integrity": "sha512-/U0b15+c4hTodo8YhEqDlQ6OjnGKvc8igjM/mh23ukqqCUBKiBCaxqUV8bcaofK9uZ+f8wCygkyXLS6LN25YSA==", + "cpu": [ + "riscv64" + ], + "dev": true, + "libc": [ + "glibc" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@oxlint/binding-linux-riscv64-musl": { + "version": "1.94.0", + "resolved": "https://registry.npmjs.org/@oxlint/binding-linux-riscv64-musl/-/binding-linux-riscv64-musl-1.94.0.tgz", + "integrity": "sha512-ba94Vwl0qOnwXIXNDR33AEbLXuX++ckM74t+9Te7CiPSPAHivhOYyeEkUAicrvOEei1pxXkWggLbFeBFFBTuHA==", + "cpu": [ + "riscv64" + ], + "dev": true, + "libc": [ + "musl" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@oxlint/binding-linux-s390x-gnu": { + "version": "1.94.0", + "resolved": "https://registry.npmjs.org/@oxlint/binding-linux-s390x-gnu/-/binding-linux-s390x-gnu-1.94.0.tgz", + "integrity": "sha512-GVwwwms3O8pdgbCiPavwq2vltyB4661GkDz6kJduZ0E5nsSJUDJ0svaP+ePYpuDVYi4+K1qhCKnWa/Ec8I4LUA==", + "cpu": [ + "s390x" + ], + "dev": true, + "libc": [ + "glibc" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@oxlint/binding-linux-x64-gnu": { + "version": "1.94.0", + "resolved": "https://registry.npmjs.org/@oxlint/binding-linux-x64-gnu/-/binding-linux-x64-gnu-1.94.0.tgz", + "integrity": "sha512-iUfCFJN8ZIresSnpTfiIkhF3s8X+XA4I9KJ249QwR2QYTMwh0+pla1pj1xaFi+HtR9McjM4Jaemf70HzX7ilOQ==", + "cpu": [ + "x64" + ], + "dev": true, + "libc": [ + "glibc" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@oxlint/binding-linux-x64-musl": { + "version": "1.94.0", + "resolved": "https://registry.npmjs.org/@oxlint/binding-linux-x64-musl/-/binding-linux-x64-musl-1.94.0.tgz", + "integrity": "sha512-RqWVeWpDACS4Oh0m21OBmy+CQ50CbbhuHFmNNPVS2P/4R3d188MjEuEuV7So82/tAM8UAT+UuMDtRDESd9NJ7g==", + "cpu": [ + "x64" + ], + "dev": true, + "libc": [ + "musl" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@oxlint/binding-openharmony-arm64": { + "version": "1.94.0", + "resolved": "https://registry.npmjs.org/@oxlint/binding-openharmony-arm64/-/binding-openharmony-arm64-1.94.0.tgz", + "integrity": "sha512-K/2DHOUoypwYVqzxJMRPdMuBKjAetZEAsGPP7rHimd+2+5J1TxM+17pG8kw+ayH4+rqBXiPd+H9wgPcU+fF77A==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "openharmony" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@oxlint/binding-win32-arm64-msvc": { + "version": "1.94.0", + "resolved": "https://registry.npmjs.org/@oxlint/binding-win32-arm64-msvc/-/binding-win32-arm64-msvc-1.94.0.tgz", + "integrity": "sha512-hYOCaOJiB4ZCGswBWKl3JQrhqu6mnC5DCUw/1UMNzRXgsHIJ0V226J43LAVICVIDGlhFUZTYShFW+wHWpt6qCQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@oxlint/binding-win32-ia32-msvc": { + "version": "1.94.0", + "resolved": "https://registry.npmjs.org/@oxlint/binding-win32-ia32-msvc/-/binding-win32-ia32-msvc-1.94.0.tgz", + "integrity": "sha512-1l1FDlzbPmAeDoZ8UGspOE2dOmz1ZL6SlDsvOmRCmWSQjCdTy5LzUepS8mO/SGpAoz4D6WAt/yNZAUyHqbkmkQ==", + "cpu": [ + "ia32" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@oxlint/binding-win32-x64-msvc": { + "version": "1.94.0", + "resolved": "https://registry.npmjs.org/@oxlint/binding-win32-x64-msvc/-/binding-win32-x64-msvc-1.94.0.tgz", + "integrity": "sha512-I3eZdd4bemIJQDNv9XDV/FEofDxIoN32tzCv98wIgLdW05EqxZb5hF4AwPrRzHD/dQhl0n7KgPy5AQPfM0HWrA==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@oxlint/plugins": { + "version": "1.94.0", + "resolved": "https://registry.npmjs.org/@oxlint/plugins/-/plugins-1.94.0.tgz", + "integrity": "sha512-YT6htikBOBQ00XDxZpRZLZ0anEDo7h9s4+YvjRU0/Ng/cLd0D6SZQ3tsms4g/GDer/z8UKlegC5iptEfyRXJcw==", + "dev": true, + "license": "MIT", + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/oxc-project" + } + }, + "node_modules/@peculiar/asn1-schema": { + "version": "2.10.0", + "resolved": "https://registry.npmmirror.com/@peculiar/asn1-schema/-/asn1-schema-2.10.0.tgz", + "integrity": "sha512-GhokD41lV4gQrrLYm3wCkHfBOnJrnhDMgt4XeMW8gzfE1UdJqIuSwsE+ggf82XBjUXRJylcm+KIGQFa4utIVLw==", + "dev": true, + "dependencies": { + "@peculiar/utils": "^2.0.2", + "asn1js": "^3.0.10", + "tslib": "^2.8.1" + }, + "engines": { + "node": ">=14" + } + }, + "node_modules/@peculiar/json-schema": { + "version": "1.1.12", + "resolved": "https://registry.npmmirror.com/@peculiar/json-schema/-/json-schema-1.1.12.tgz", + "integrity": "sha512-coUfuoMeIB7B8/NMekxaDzLhaYmp0HZNPEjYRm9goRou8UZIC3z21s0sL9AWoCw4EG876QyO3kYrc61WNF9B/w==", + "dev": true, + "dependencies": { + "tslib": "^2.0.0" + }, + "engines": { + "node": ">=8.0.0" + } + }, + "node_modules/@peculiar/utils": { + "version": "2.0.3", + "resolved": "https://registry.npmmirror.com/@peculiar/utils/-/utils-2.0.3.tgz", + "integrity": "sha512-+oL3HPFRIZ1St2K50lWCXiioIgSoxzz7R1J3uF6neO2yl1sgmpgY6XXJH4BdpoDkMWznQTeYF6oWNDZLCdQ4eQ==", + "dev": true, + "dependencies": { + "tslib": "^2.8.1" + } + }, + "node_modules/@peculiar/webcrypto": { + "version": "1.7.1", + "resolved": "https://registry.npmmirror.com/@peculiar/webcrypto/-/webcrypto-1.7.1.tgz", + "integrity": "sha512-ODOov0sGMJMf3jPonOkgGqPknTsu+DdQ7kD++gz8aI+aFMOMHFbWAA2taqXXVTdP+OTOQR/znGvSpmkeI0WTYQ==", + "dev": true, + "dependencies": { + "@peculiar/asn1-schema": "^2.7.0", + "@peculiar/json-schema": "^1.1.12", + "@peculiar/utils": "^2.0.2", + "tslib": "^2.8.1", + "webcrypto-core": "^1.9.2" + }, + "engines": { + "node": ">=14.18.0" + } + }, + "node_modules/@polka/url": { + "version": "1.0.0-next.29", + "resolved": "https://registry.npmjs.org/@polka/url/-/url-1.0.0-next.29.tgz", + "integrity": "sha512-wwQAWhWSuHaag8c4q/KN/vCoeOJYshAIvMQwD4GpSb3OiZklFfvAgmj0VCBBImRpuF/aFgIRzllXlVX93Jevww==", + "dev": true, + "license": "MIT" + }, + "node_modules/@posthog/browser-common": { + "version": "0.12.0", + "resolved": "https://registry.npmmirror.com/@posthog/browser-common/-/browser-common-0.12.0.tgz", + "integrity": "sha512-P1CubrDp1xwYi2DQxjzJITEeMJpZ7qYcbHuhtXLHgkG8bE6gLy0JwkykjRtEFbElvJNbHQO1jQi7Cbb3JyazNw==", + "license": "MIT", + "dependencies": { + "@posthog/core": "^1.68.0", + "@posthog/types": "^1.425.1", + "dompurify": "^3.4.13", + "preact": "^10.29.3" + } + }, + "node_modules/@posthog/core": { + "version": "1.69.1", + "resolved": "https://registry.npmmirror.com/@posthog/core/-/core-1.69.1.tgz", + "integrity": "sha512-36hlJRZlVh5d+yBOmqObT162SrqNes9yY4x4wLDXVSu5Dzdt19KNxQ136cd37+U0yABZVx7ehjtWslyn1iG+0Q==", + "license": "MIT", + "dependencies": { + "@posthog/types": "^1.425.1" + } + }, + "node_modules/@posthog/types": { + "version": "1.425.1", + "resolved": "https://registry.npmmirror.com/@posthog/types/-/types-1.425.1.tgz", + "integrity": "sha512-mh7jyQ5lN+XCeOnMdYkBEFtO/G0TxeLOKTWNH6E6OZjxS4nVM0Tb2xQt+FG5DCFM9qzL2HmuX6A793TwlJVDvw==", + "license": "MIT" + }, + "node_modules/@radix-ui/number": { + "version": "1.1.3", + "resolved": "https://registry.npmmirror.com/@radix-ui/number/-/number-1.1.3.tgz", + "integrity": "sha512-Road2bidD0uu/1BGDOWNdPI06g0lIRy6IF9GZcIrDK2KGItfor8IQwQa+yM2ERgHM1MmHxaxpTzk0/Jp42lNfA==", + "dev": true + }, + "node_modules/@radix-ui/primitive": { + "version": "1.2.0", + "resolved": "https://registry.npmmirror.com/@radix-ui/primitive/-/primitive-1.2.0.tgz", + "integrity": "sha512-KABY+VMIRPJL+Vyzv/335FEhXXD/xDv8BMb1kl48/aXJZMH0LtHCTx5ga5RnxaEP3nZHtmTLf1P9vanmFX46bw==", + "dev": true + }, + "node_modules/@radix-ui/react-accessible-icon": { + "version": "1.2.0", + "resolved": "https://registry.npmmirror.com/@radix-ui/react-accessible-icon/-/react-accessible-icon-1.2.0.tgz", + "integrity": "sha512-BB4+HHkFl3HipEAhm/mLhrpXV+2kRX7MvY4AaImUcQVeWQt5KhV1JEByNs8NGfJOcr95RcQGijt9+OrCo68xGA==", + "dev": true, + "dependencies": { + "@radix-ui/react-visually-hidden": "1.2.13" + }, + "peerDependencies": { + "@types/react": "*", + "@types/react-dom": "*", + "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc", + "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + }, + "@types/react-dom": { + "optional": true + } + } + }, + "node_modules/@radix-ui/react-accordion": { + "version": "1.3.1", + "resolved": "https://registry.npmmirror.com/@radix-ui/react-accordion/-/react-accordion-1.3.1.tgz", + "integrity": "sha512-lCZ6sbGS/7WO0j84yx4srIgOf0MRJ/sZ13RonADXxvKBym8xrxNCq5f6DibGcr38sIlwPk8/52uYdXeOPsbEDw==", + "dev": true, + "dependencies": { + "@radix-ui/primitive": "1.2.0", + "@radix-ui/react-collapsible": "1.2.1", + "@radix-ui/react-collection": "1.2.0", + "@radix-ui/react-compose-refs": "1.1.5", + "@radix-ui/react-context": "1.3.0", + "@radix-ui/react-direction": "1.2.0", + "@radix-ui/react-id": "1.1.4", + "@radix-ui/react-primitive": "2.2.0", + "@radix-ui/react-use-controllable-state": "1.3.0" + }, + "peerDependencies": { + "@types/react": "*", + "@types/react-dom": "*", + "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc", + "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + }, + "@types/react-dom": { + "optional": true + } + } + }, + "node_modules/@radix-ui/react-alert-dialog": { + "version": "1.2.1", + "resolved": "https://registry.npmmirror.com/@radix-ui/react-alert-dialog/-/react-alert-dialog-1.2.1.tgz", + "integrity": "sha512-MWC4N7RY+qsbNrFNo7yQ9ZbdoZEW+B5DtpWxJfUnVCqcQxxqqg3qis3RMPTDbCNaTIdHJSn5XDkl9ZdVWXknLg==", + "dev": true, + "dependencies": { + "@radix-ui/primitive": "1.2.0", + "@radix-ui/react-compose-refs": "1.1.5", + "@radix-ui/react-context": "1.3.0", + "@radix-ui/react-dialog": "1.3.1", + "@radix-ui/react-primitive": "2.2.0" + }, + "peerDependencies": { + "@types/react": "*", + "@types/react-dom": "*", + "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc", + "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + }, + "@types/react-dom": { + "optional": true + } + } + }, + "node_modules/@radix-ui/react-arrow": { + "version": "1.1.17", + "resolved": "https://registry.npmmirror.com/@radix-ui/react-arrow/-/react-arrow-1.1.17.tgz", + "integrity": "sha512-67jjcVvxjXCCStnTW3Z+M7jmaFMuMR7M2JgpDzH4w7JSRrikmzhjfYgP/09ECb8n7whnsgh1ifJ+Ie96qEj+pQ==", "dev": true, "dependencies": { "@radix-ui/react-primitive": "2.2.0" @@ -4340,50 +5106,232 @@ "license": "0BSD", "optional": true }, - "node_modules/@tailwindcss/oxide-win32-arm64-msvc": { - "version": "4.3.5", - "resolved": "https://registry.npmmirror.com/@tailwindcss/oxide-win32-arm64-msvc/-/oxide-win32-arm64-msvc-4.3.5.tgz", - "integrity": "sha512-9o8jgthi+QE5eandnboiJT64VQfnIArfZzSTdgbhEK5aafdiu2jTW9Honi/mwYHxBZuH1vAC57IFyrh+0iK5Gg==", + "node_modules/@tailwindcss/oxide-win32-arm64-msvc": { + "version": "4.3.5", + "resolved": "https://registry.npmmirror.com/@tailwindcss/oxide-win32-arm64-msvc/-/oxide-win32-arm64-msvc-4.3.5.tgz", + "integrity": "sha512-9o8jgthi+QE5eandnboiJT64VQfnIArfZzSTdgbhEK5aafdiu2jTW9Honi/mwYHxBZuH1vAC57IFyrh+0iK5Gg==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">= 20" + } + }, + "node_modules/@tailwindcss/oxide-win32-x64-msvc": { + "version": "4.3.5", + "resolved": "https://registry.npmmirror.com/@tailwindcss/oxide-win32-x64-msvc/-/oxide-win32-x64-msvc-4.3.5.tgz", + "integrity": "sha512-XiKFfIy1RWe7qK4WqByxNW7Oz1/nkOy8o/BWhHminyV1PmpUd8Eedj5v2A8h2kpqeVlz6xRnwk9Fr/ZXNLcZfg==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">= 20" + } + }, + "node_modules/@tailwindcss/vite": { + "version": "4.3.5", + "resolved": "https://registry.npmmirror.com/@tailwindcss/vite/-/vite-4.3.5.tgz", + "integrity": "sha512-BCNiY0a1ZjdOHVqw7kyb7U72BwfMF3dfUuN+tQsLWky/J5JOI/r7abibglXfygrZhVO/3u3V+E25kkKTeMkXaQ==", + "dev": true, + "dependencies": { + "@tailwindcss/node": "4.3.5", + "@tailwindcss/oxide": "4.3.5", + "tailwindcss": "4.3.5" + }, + "peerDependencies": { + "vite": "^5.2.0 || ^6 || ^7 || ^8" + } + }, + "node_modules/@testing-library/dom": { + "version": "10.4.2", + "resolved": "https://registry.npmjs.org/@testing-library/dom/-/dom-10.4.2.tgz", + "integrity": "sha512-yzr2S9HyAIdhz2/6qHgbs665Q7PKVcDF05vsOlHPxG1mo36gKVesdYVeDLnXgfjJ03CrKRk08knc6+E/9m8v2Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/code-frame": "^7.10.4", + "@babel/runtime": "^7.12.5", + "@types/aria-query": "^5.0.1", + "aria-query": "5.3.0", + "dom-accessibility-api": "^0.5.9", + "lz-string": "^1.5.0", + "picocolors": "1.1.1", + "pretty-format": "^27.0.2" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/@testing-library/user-event": { + "version": "14.6.13", + "resolved": "https://registry.npmjs.org/@testing-library/user-event/-/user-event-14.6.13.tgz", + "integrity": "sha512-2LVZGptuB5un1Cu/u31o9adkCwbsUTMp4B4p04xupI7uobvTIpgKidSdShqZiReo/mQmvR9xjgdgTgge4oAbYA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12", + "npm": ">=6" + }, + "peerDependencies": { + "@testing-library/dom": ">=7.21.4" + } + }, + "node_modules/@tsrs/darwin-arm64": { + "version": "7.1.0-beta.tsrs2", + "resolved": "https://registry.npmjs.org/@tsrs/darwin-arm64/-/darwin-arm64-7.1.0-beta.tsrs2.tgz", + "integrity": "sha512-VMsXBPFD0SO5p7XrXhLutPmnpHc4kMIt7uztBJoHr/5Jd6qC8eH/TomobdPGugw27U3uiW2wJDqYjqYq5fxoCA==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "Apache-2.0", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=16.20.0" + } + }, + "node_modules/@tsrs/darwin-x64": { + "version": "7.1.0-beta.tsrs2", + "resolved": "https://registry.npmjs.org/@tsrs/darwin-x64/-/darwin-x64-7.1.0-beta.tsrs2.tgz", + "integrity": "sha512-cNVbvIaKasKYjAI4aBfCE+gpa188JMb3GORyK9SDMZOEib9toEAAO7XCImOkazkLPq45UZxmxfCgBKMpMNWfug==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "Apache-2.0", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=16.20.0" + } + }, + "node_modules/@tsrs/linux-arm64-gnu": { + "version": "7.1.0-beta.tsrs2", + "resolved": "https://registry.npmjs.org/@tsrs/linux-arm64-gnu/-/linux-arm64-gnu-7.1.0-beta.tsrs2.tgz", + "integrity": "sha512-g1wZyn53DDQsIeu19i0YTYZCwY8eEZetR2MjgZK8XIznA6GSir67pEBaAsxpLZzOD7Z6UPjnoSP6w6ft08JnWQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "libc": [ + "glibc" + ], + "license": "Apache-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=16.20.0" + } + }, + "node_modules/@tsrs/linux-arm64-musl": { + "version": "7.1.0-beta.tsrs2", + "resolved": "https://registry.npmjs.org/@tsrs/linux-arm64-musl/-/linux-arm64-musl-7.1.0-beta.tsrs2.tgz", + "integrity": "sha512-vt23JfDe8ECKOC9G7dpYY3dzC8EFKBKuNCLaYbTJgemKN0GbxvWN3chm5LotjNYuROv2cED1AUTJEE1+k5oDGw==", + "cpu": [ + "arm64" + ], + "dev": true, + "libc": [ + "musl" + ], + "license": "Apache-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=16.20.0" + } + }, + "node_modules/@tsrs/linux-x64-gnu": { + "version": "7.1.0-beta.tsrs2", + "resolved": "https://registry.npmjs.org/@tsrs/linux-x64-gnu/-/linux-x64-gnu-7.1.0-beta.tsrs2.tgz", + "integrity": "sha512-4QlsTwQSAnx5KrNeWDg/+HKSjBhsFPU2JsMZzK2vn+8hxNXDD3gbiP6dP7dD7ohdJdSAy+jm6uY2F4XyLpIyRQ==", + "cpu": [ + "x64" + ], + "dev": true, + "libc": [ + "glibc" + ], + "license": "Apache-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=16.20.0" + } + }, + "node_modules/@tsrs/linux-x64-musl": { + "version": "7.1.0-beta.tsrs2", + "resolved": "https://registry.npmjs.org/@tsrs/linux-x64-musl/-/linux-x64-musl-7.1.0-beta.tsrs2.tgz", + "integrity": "sha512-ZGwwZiaA8hUh5kKIktDifI5b9pfprjU0so4Pkkx9NLvgdIhJVjYt0sGOVdNPDdpk6NG+96ld8sH70hRUav7w/g==", + "cpu": [ + "x64" + ], + "dev": true, + "libc": [ + "musl" + ], + "license": "Apache-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=16.20.0" + } + }, + "node_modules/@tsrs/win32-arm64": { + "version": "7.1.0-beta.tsrs2", + "resolved": "https://registry.npmjs.org/@tsrs/win32-arm64/-/win32-arm64-7.1.0-beta.tsrs2.tgz", + "integrity": "sha512-P6WGeHGKNz3+BLrC0aBDiEHTvqTl95T15sBv20om3y7RwFpTNCWUYuxkDXUWciltxyGgjRh1enUJ4dTUZ7SQbQ==", "cpu": [ "arm64" ], "dev": true, + "license": "Apache-2.0", "optional": true, "os": [ "win32" ], "engines": { - "node": ">= 20" + "node": ">=16.20.0" } }, - "node_modules/@tailwindcss/oxide-win32-x64-msvc": { - "version": "4.3.5", - "resolved": "https://registry.npmmirror.com/@tailwindcss/oxide-win32-x64-msvc/-/oxide-win32-x64-msvc-4.3.5.tgz", - "integrity": "sha512-XiKFfIy1RWe7qK4WqByxNW7Oz1/nkOy8o/BWhHminyV1PmpUd8Eedj5v2A8h2kpqeVlz6xRnwk9Fr/ZXNLcZfg==", + "node_modules/@tsrs/win32-x64": { + "version": "7.1.0-beta.tsrs2", + "resolved": "https://registry.npmjs.org/@tsrs/win32-x64/-/win32-x64-7.1.0-beta.tsrs2.tgz", + "integrity": "sha512-ICto2KzEv99ScmQInd/ItESq0V8MBA7MYakNEQX45cgqGLeFIrv64X9X/avNcRJVqOE1SvAGXk68uysAPOqjWA==", "cpu": [ "x64" ], "dev": true, + "license": "Apache-2.0", "optional": true, "os": [ "win32" ], "engines": { - "node": ">= 20" - } - }, - "node_modules/@tailwindcss/vite": { - "version": "4.3.5", - "resolved": "https://registry.npmmirror.com/@tailwindcss/vite/-/vite-4.3.5.tgz", - "integrity": "sha512-BCNiY0a1ZjdOHVqw7kyb7U72BwfMF3dfUuN+tQsLWky/J5JOI/r7abibglXfygrZhVO/3u3V+E25kkKTeMkXaQ==", - "dev": true, - "dependencies": { - "@tailwindcss/node": "4.3.5", - "@tailwindcss/oxide": "4.3.5", - "tailwindcss": "4.3.5" - }, - "peerDependencies": { - "vite": "^5.2.0 || ^6 || ^7 || ^8" + "node": ">=16.20.0" } }, "node_modules/@tweenjs/tween.js": { @@ -4403,6 +5351,13 @@ "tslib": "^2.4.0" } }, + "node_modules/@types/aria-query": { + "version": "5.0.4", + "resolved": "https://registry.npmjs.org/@types/aria-query/-/aria-query-5.0.4.tgz", + "integrity": "sha512-rfT93uj5s0PRL7EzccGMs3brplhcrghnDoV26NqKhCAS1hVo+WdNsPvE/yb6ilfr5hi2MEk6d5EWJTKdxg8jVw==", + "dev": true, + "license": "MIT" + }, "node_modules/@types/babel__core": { "version": "7.20.5", "resolved": "https://registry.npmmirror.com/@types/babel__core/-/babel__core-7.20.5.tgz", @@ -4649,22 +5604,243 @@ "resolved": "https://registry.npmjs.org/@typescript/typescript-freebsd-arm64/-/typescript-freebsd-arm64-7.0.2.tgz", "integrity": "sha512-W5NH4y/J0plIIS5b2xvTEkU7JFxyqdMAOgf+Ilhl0vHQXKO5dZoxd+C/jEtq56c4F3wk71RB4BMRQ2XdI+bwYQ==", "cpu": [ - "arm64" + "arm64" + ], + "dev": true, + "license": "Apache-2.0", + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=16.20.0" + } + }, + "node_modules/@typescript/typescript-freebsd-x64": { + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/@typescript/typescript-freebsd-x64/-/typescript-freebsd-x64-7.0.2.tgz", + "integrity": "sha512-UMGDx5sTpzNw3WiPebH7l90IWfJggEd+egHt/q6p7/Cm3zqoV7VxkGXt+3DxPIw8CcmvAB0j3sVVfbhX+M4Tpw==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "Apache-2.0", + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=16.20.0" + } + }, + "node_modules/@typescript/typescript-linux-arm": { + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/@typescript/typescript-linux-arm/-/typescript-linux-arm-7.0.2.tgz", + "integrity": "sha512-gffT3xPz9sR7j/YJExkyPntrI0P2EP9XbOyWzth2/Gs0RstK+90RBcO0ncXoXy/beYll1SXw846Nf2zdnEz0QQ==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "Apache-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=16.20.0" + } + }, + "node_modules/@typescript/typescript-linux-arm64": { + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/@typescript/typescript-linux-arm64/-/typescript-linux-arm64-7.0.2.tgz", + "integrity": "sha512-Qh4eU4/y3yDjnfjjyPYihMj5/ODIlmt+Bzu17OI+fiSRDW57QmU5SiN63exPRNJPKUzcc1INa1NXdrJ+MqHjUQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "Apache-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=16.20.0" + } + }, + "node_modules/@typescript/typescript-linux-loong64": { + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/@typescript/typescript-linux-loong64/-/typescript-linux-loong64-7.0.2.tgz", + "integrity": "sha512-uEHck9i8hoAzXPiYRib1O7miOnz23SxIeVl6F4LXox+qov1K35jHcEW6VHKvZI+pyvl7fZEP4MCU5LYvIq1GuQ==", + "cpu": [ + "loong64" + ], + "dev": true, + "license": "Apache-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=16.20.0" + } + }, + "node_modules/@typescript/typescript-linux-mips64el": { + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/@typescript/typescript-linux-mips64el/-/typescript-linux-mips64el-7.0.2.tgz", + "integrity": "sha512-R4KvAMnE43W5Qeqb0Ly56O3mWMWIAgsMyz36DCaycd5nbg/9kzm0liw3JocfRqyJY0KPmzFjbswozXyW0DnIYA==", + "cpu": [ + "mips64el" + ], + "dev": true, + "license": "Apache-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=16.20.0" + } + }, + "node_modules/@typescript/typescript-linux-ppc64": { + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/@typescript/typescript-linux-ppc64/-/typescript-linux-ppc64-7.0.2.tgz", + "integrity": "sha512-DORx5b3sd/4S7eayxm4FQv+A7CrkUIGRaHiwI8oiHTAI1fAPWhF4J0vAlkC8biAlHSVVwxMQ3tjZ2/DVbnQiiA==", + "cpu": [ + "ppc64" + ], + "dev": true, + "license": "Apache-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=16.20.0" + } + }, + "node_modules/@typescript/typescript-linux-riscv64": { + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/@typescript/typescript-linux-riscv64/-/typescript-linux-riscv64-7.0.2.tgz", + "integrity": "sha512-wf0jqEDOjrPRnKwYRyyJDRo11KMbvMFrU+q4zqKyChODBzvlkbhNQfKvLxQCcwTpdDaXSHZTVuh0JoCrKCUMHQ==", + "cpu": [ + "riscv64" + ], + "dev": true, + "license": "Apache-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=16.20.0" + } + }, + "node_modules/@typescript/typescript-linux-s390x": { + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/@typescript/typescript-linux-s390x/-/typescript-linux-s390x-7.0.2.tgz", + "integrity": "sha512-IkwJc3L7yhytWd/ewjyxNDfOmswCm9GWMJT/ue/dU4aZNbwZeYAetq42VyLmsmSjvoX7z74X6ZaYCtzAr0EuGw==", + "cpu": [ + "s390x" + ], + "dev": true, + "license": "Apache-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=16.20.0" + } + }, + "node_modules/@typescript/typescript-linux-x64": { + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/@typescript/typescript-linux-x64/-/typescript-linux-x64-7.0.2.tgz", + "integrity": "sha512-EYdf2cNg7rgCWJnxCdJ+F3V39O8ihb37eHAu1LK8oAFizgTQbPOK7zHHXbPt8rX24COqODXeI3sIf0fCXG7H/A==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "Apache-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=16.20.0" + } + }, + "node_modules/@typescript/typescript-netbsd-arm64": { + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/@typescript/typescript-netbsd-arm64/-/typescript-netbsd-arm64-7.0.2.tgz", + "integrity": "sha512-+polYF4MF04aPpO5FTkHran9yUQDSXqy5GiSDKpsll5jy3l3+g9QLhpf39T+ePtefhXLOGrLl0QIjkQP6VnelA==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "Apache-2.0", + "optional": true, + "os": [ + "netbsd" + ], + "engines": { + "node": ">=16.20.0" + } + }, + "node_modules/@typescript/typescript-netbsd-x64": { + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/@typescript/typescript-netbsd-x64/-/typescript-netbsd-x64-7.0.2.tgz", + "integrity": "sha512-8YIT0EHM/3dq10ZOVF/A7pc/YSMtbcecct4rWtexrnSCHOPcpC2KTLXfTCR6vDpnSiY12heNb1GiN/wu+T/FyA==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "Apache-2.0", + "optional": true, + "os": [ + "netbsd" + ], + "engines": { + "node": ">=16.20.0" + } + }, + "node_modules/@typescript/typescript-openbsd-arm64": { + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/@typescript/typescript-openbsd-arm64/-/typescript-openbsd-arm64-7.0.2.tgz", + "integrity": "sha512-APT8+ClYnuYm1u9+kgGXoMj2VzWzcymwh2gNSQVySHfkRDGOTVkoWLjCmOQSaO+PoqQ57B0flRp9SA+7GnnkzQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "Apache-2.0", + "optional": true, + "os": [ + "openbsd" + ], + "engines": { + "node": ">=16.20.0" + } + }, + "node_modules/@typescript/typescript-openbsd-x64": { + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/@typescript/typescript-openbsd-x64/-/typescript-openbsd-x64-7.0.2.tgz", + "integrity": "sha512-yX7s+Q0Dln0Dt9tEzZsAjXXR/+ytBM7AlglaqyeMPxQszJ1JhlJdZ6jLA+IzldHtflX81em7lDao1xXu+aRRkg==", + "cpu": [ + "x64" ], "dev": true, "license": "Apache-2.0", "optional": true, "os": [ - "freebsd" + "openbsd" ], "engines": { "node": ">=16.20.0" } }, - "node_modules/@typescript/typescript-freebsd-x64": { + "node_modules/@typescript/typescript-sunos-x64": { "version": "7.0.2", - "resolved": "https://registry.npmjs.org/@typescript/typescript-freebsd-x64/-/typescript-freebsd-x64-7.0.2.tgz", - "integrity": "sha512-UMGDx5sTpzNw3WiPebH7l90IWfJggEd+egHt/q6p7/Cm3zqoV7VxkGXt+3DxPIw8CcmvAB0j3sVVfbhX+M4Tpw==", + "resolved": "https://registry.npmjs.org/@typescript/typescript-sunos-x64/-/typescript-sunos-x64-7.0.2.tgz", + "integrity": "sha512-dLJDGaLZ1D4HPQn62u1n8mBDkJREwMsAkCdkwd4Ieqw+x3TUyTsqY0YiBCtE6H6OzzgGk3iuZ3vFWRS+E8/d1g==", "cpu": [ "x64" ], @@ -4672,368 +5848,622 @@ "license": "Apache-2.0", "optional": true, "os": [ - "freebsd" + "sunos" ], "engines": { "node": ">=16.20.0" } }, - "node_modules/@typescript/typescript-linux-arm": { + "node_modules/@typescript/typescript-win32-arm64": { "version": "7.0.2", - "resolved": "https://registry.npmjs.org/@typescript/typescript-linux-arm/-/typescript-linux-arm-7.0.2.tgz", - "integrity": "sha512-gffT3xPz9sR7j/YJExkyPntrI0P2EP9XbOyWzth2/Gs0RstK+90RBcO0ncXoXy/beYll1SXw846Nf2zdnEz0QQ==", + "resolved": "https://registry.npmjs.org/@typescript/typescript-win32-arm64/-/typescript-win32-arm64-7.0.2.tgz", + "integrity": "sha512-Gyl1Vy6OsWesLzmq+EP0Fb7b4Nid5232AvcA2SFcdYreldpNtYFFofPjnt62y9hQy7VTaZp65ICJjuAQRaVcIQ==", "cpu": [ - "arm" + "arm64" ], "dev": true, "license": "Apache-2.0", "optional": true, "os": [ - "linux" + "win32" ], "engines": { "node": ">=16.20.0" } }, - "node_modules/@typescript/typescript-linux-arm64": { + "node_modules/@typescript/typescript-win32-x64": { "version": "7.0.2", - "resolved": "https://registry.npmjs.org/@typescript/typescript-linux-arm64/-/typescript-linux-arm64-7.0.2.tgz", - "integrity": "sha512-Qh4eU4/y3yDjnfjjyPYihMj5/ODIlmt+Bzu17OI+fiSRDW57QmU5SiN63exPRNJPKUzcc1INa1NXdrJ+MqHjUQ==", + "resolved": "https://registry.npmjs.org/@typescript/typescript-win32-x64/-/typescript-win32-x64-7.0.2.tgz", + "integrity": "sha512-0BQ3HkAHHlKLSp1qRvf3SUhGpGsDuhB/jgFw75guyqbxJqEaS0Cw/VFO8i2nHglJUzQCRtMMR/IBAKE3ETMC4g==", "cpu": [ - "arm64" + "x64" ], "dev": true, "license": "Apache-2.0", "optional": true, "os": [ - "linux" + "win32" ], "engines": { "node": ">=16.20.0" } }, - "node_modules/@typescript/typescript-linux-loong64": { - "version": "7.0.2", - "resolved": "https://registry.npmjs.org/@typescript/typescript-linux-loong64/-/typescript-linux-loong64-7.0.2.tgz", - "integrity": "sha512-uEHck9i8hoAzXPiYRib1O7miOnz23SxIeVl6F4LXox+qov1K35jHcEW6VHKvZI+pyvl7fZEP4MCU5LYvIq1GuQ==", + "node_modules/@typescript/typescript6": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/@typescript/typescript6/-/typescript6-6.0.2.tgz", + "integrity": "sha512-mbCddXd+jm7hfx7w2YU64/Av4/NqqeG3GoRZgxPcgoTxYjhrcfJRw9ULch71SS4G+Q3bOXFhRvPqjguN0Hyp5w==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "@typescript/old": "npm:typescript@^6" + }, + "bin": { + "tsc6": "bin/tsc6" + } + }, + "node_modules/@ungap/structured-clone": { + "version": "1.4.0", + "resolved": "https://registry.npmmirror.com/@ungap/structured-clone/-/structured-clone-1.4.0.tgz", + "integrity": "sha512-1mEZtMKPM09vDmQt5y7YvmN2+DFTP7Tg0EWXdic8/C6VRnpb33e4ghisCIE3WZjsE2N8mf+QV1Zqh7ZFYLWInQ==", + "dev": true + }, + "node_modules/@vitejs/plugin-react": { + "version": "5.2.0", + "resolved": "https://registry.npmmirror.com/@vitejs/plugin-react/-/plugin-react-5.2.0.tgz", + "integrity": "sha512-YmKkfhOAi3wsB1PhJq5Scj3GXMn3WvtQ/JC0xoopuHoXSdmtdStOpFrYaT1kie2YgFBcIe64ROzMYRjCrYOdYw==", + "dev": true, + "dependencies": { + "@babel/core": "^7.29.0", + "@babel/plugin-transform-react-jsx-self": "^7.27.1", + "@babel/plugin-transform-react-jsx-source": "^7.27.1", + "@rolldown/pluginutils": "1.0.0-rc.3", + "@types/babel__core": "^7.20.5", + "react-refresh": "^0.18.0" + }, + "engines": { + "node": "^20.19.0 || >=22.12.0" + }, + "peerDependencies": { + "vite": "^4.2.0 || ^5.0.0 || ^6.0.0 || ^7.0.0 || ^8.0.0" + } + }, + "node_modules/@vitejs/plugin-react/node_modules/@rolldown/pluginutils": { + "version": "1.0.0-rc.3", + "resolved": "https://registry.npmmirror.com/@rolldown/pluginutils/-/pluginutils-1.0.0-rc.3.tgz", + "integrity": "sha512-eybk3TjzzzV97Dlj5c+XrBFW57eTNhzod66y9HrBlzJ6NsCrWCp/2kaPS3K9wJmurBC0Tdw4yPjXKZqlznim3Q==", + "dev": true + }, + "node_modules/@vitest/browser": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/@vitest/browser/-/browser-5.1.0.tgz", + "integrity": "sha512-2sjGVAC/Rs8Jwv+xxBgklNG2g1LGyNgcFMBw71AcfBstLz25UGv1+fVvvZ+z8IfSuNg3nipERijnFtoEIdRDEA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@blazediff/core": "1.10.0", + "@vitest/mocker": "5.1.0", + "@vitest/ui": "5.1.0", + "@vitest/utils": "5.1.0", + "magic-string": "^1.4.3", + "pngjs": "^7.0.0", + "sirv": "^3.0.2", + "tinyrainbow": "^3.2.0", + "ws": "^8.22.0" + }, + "funding": { + "url": "https://opencollective.com/vitest" + }, + "peerDependencies": { + "vitest": "5.1.0" + } + }, + "node_modules/@vitest/browser-preview": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/@vitest/browser-preview/-/browser-preview-5.1.0.tgz", + "integrity": "sha512-z9SbodBSMoJtYy5VTCaSP5SSZfNYRlfIlR0P/uH1PAuhUJbstSyOYvxXCYmqG+EemIiZzd3uGUtREX5zbXLR8A==", + "dev": true, + "license": "MIT", + "dependencies": { + "@testing-library/dom": "^10.4.2", + "@testing-library/user-event": "^14.6.8", + "@vitest/browser": "5.1.0" + }, + "funding": { + "url": "https://opencollective.com/vitest" + }, + "peerDependencies": { + "vitest": "5.1.0" + } + }, + "node_modules/@vitest/browser/node_modules/magic-string": { + "version": "1.4.5", + "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-1.4.5.tgz", + "integrity": "sha512-oLLC2+YvQUfAa+vxoufE/yc1icb87M9iXIRqAoR/2EhE/8cb3SF/+Gi0c2By1B+5Vz2e2vQtUvHiu1+63Znh+w==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jridgewell/sourcemap-codec": "^1.6.0" + } + }, + "node_modules/@vitest/mocker": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/@vitest/mocker/-/mocker-5.1.0.tgz", + "integrity": "sha512-5umB9/jlWcqVS6fsrFmv5Gdnpu6wAUio/lEOwAmvB7v+lFo/IW2B9FhAD0p19GCULTgMzLCdUmuCDCnAzWgppQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jridgewell/trace-mapping": "0.3.31", + "@vitest/spy": "5.1.0", + "estree-walker": "^3.0.3", + "magic-string": "^1.4.3" + }, + "funding": { + "url": "https://opencollective.com/vitest" + }, + "peerDependencies": { + "msw": "^2.4.9 || ^3.0.0", + "vite": "^6.0.0 || ^7.0.0 || ^8.0.0" + }, + "peerDependenciesMeta": { + "msw": { + "optional": true + }, + "vite": { + "optional": true + } + } + }, + "node_modules/@vitest/mocker/node_modules/magic-string": { + "version": "1.4.5", + "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-1.4.5.tgz", + "integrity": "sha512-oLLC2+YvQUfAa+vxoufE/yc1icb87M9iXIRqAoR/2EhE/8cb3SF/+Gi0c2By1B+5Vz2e2vQtUvHiu1+63Znh+w==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jridgewell/sourcemap-codec": "^1.6.0" + } + }, + "node_modules/@vitest/pretty-format": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/@vitest/pretty-format/-/pretty-format-5.1.0.tgz", + "integrity": "sha512-IRx5mc30CrFzyMNni6SZKQ1r53kv049Mcvvk0WbWcD6PUz/bFjG4zYv0KosQAeonPpGp5WxqYBMqdSOfJfvVWw==", + "dev": true, + "license": "MIT", + "dependencies": { + "tinyrainbow": "^3.2.0" + }, + "funding": { + "url": "https://opencollective.com/vitest" + } + }, + "node_modules/@vitest/snapshot": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/@vitest/snapshot/-/snapshot-5.1.0.tgz", + "integrity": "sha512-6tLM70+37LVXz+A6QmOlMQUuj+taODAyXZhz58lNNNNKHH0D81yzPBEezKQQGPlABc8OpAQBOBVvssVLLQqixw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@vitest/pretty-format": "5.1.0", + "@vitest/utils": "5.1.0", + "magic-string": "^1.4.3", + "pathe": "^2.0.3" + }, + "funding": { + "url": "https://opencollective.com/vitest" + } + }, + "node_modules/@vitest/snapshot/node_modules/magic-string": { + "version": "1.4.5", + "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-1.4.5.tgz", + "integrity": "sha512-oLLC2+YvQUfAa+vxoufE/yc1icb87M9iXIRqAoR/2EhE/8cb3SF/+Gi0c2By1B+5Vz2e2vQtUvHiu1+63Znh+w==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jridgewell/sourcemap-codec": "^1.6.0" + } + }, + "node_modules/@vitest/spy": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/@vitest/spy/-/spy-5.1.0.tgz", + "integrity": "sha512-2DPO5OMHWKrBngC+fCmTQqemNF0gidRhp3lxbBmRhW+M1XJrfgPpqNqWVevXtn2f2ufD5ZaR1B6B641aAlcX5A==", + "dev": true, + "license": "MIT", + "funding": { + "url": "https://opencollective.com/vitest" + } + }, + "node_modules/@vitest/ui": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/@vitest/ui/-/ui-5.1.0.tgz", + "integrity": "sha512-00S3x4NRmqIBUiTVWF9/xLaA9EP9KeKv0+1sBO7e2Y4luBISlW+2ttnhlk/zjbTqEvVhJWCCo7MXzu6zNbefqQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@vitest/utils": "5.1.0", + "fflate": "^0.8.3", + "flatted": "^3.4.4", + "pathe": "^2.0.3", + "sirv": "^3.0.2", + "tinyrainbow": "^3.2.0" + }, + "funding": { + "url": "https://opencollective.com/vitest" + }, + "peerDependencies": { + "vitest": "5.1.0" + } + }, + "node_modules/@vitest/ui/node_modules/fflate": { + "version": "0.8.3", + "resolved": "https://registry.npmjs.org/fflate/-/fflate-0.8.3.tgz", + "integrity": "sha512-tbZNuJrLwGUp3zshBtdy4W+ORxZuIh8a5ilyIEQDC5rY1f3U20JMry0Ll3WBzU58EZKsEuJFXhb5gwv8CsPvgA==", + "dev": true, + "license": "MIT" + }, + "node_modules/@vitest/utils": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/@vitest/utils/-/utils-5.1.0.tgz", + "integrity": "sha512-V+qgCwkvVw+s1t1S5TaoBHsLi5Sz/YmohCMoOu0mZ8ZQst2bKhRYARAQucWpVg8D0mv0x5MHcWXY5QdOsoiGBQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@vitest/pretty-format": "5.1.0", + "convert-source-map": "^2.0.0", + "tinyrainbow": "^3.2.0" + }, + "funding": { + "url": "https://opencollective.com/vitest" + } + }, + "node_modules/@voidzero-dev/vite-plus-darwin-arm64": { + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/@voidzero-dev/vite-plus-darwin-arm64/-/vite-plus-darwin-arm64-1.7.0.tgz", + "integrity": "sha512-ozIv7lPzEEfGmNOvHiHublwsLHMUkZBTuSq05FuOvS9yw/4TZYiItESFC0Y2NchaotcSn4MeatxegatjgeRevA==", "cpu": [ - "loong64" + "arm64" ], "dev": true, - "license": "Apache-2.0", + "license": "MIT", "optional": true, "os": [ - "linux" + "darwin" ], "engines": { - "node": ">=16.20.0" + "node": ">=20.0.0" } }, - "node_modules/@typescript/typescript-linux-mips64el": { - "version": "7.0.2", - "resolved": "https://registry.npmjs.org/@typescript/typescript-linux-mips64el/-/typescript-linux-mips64el-7.0.2.tgz", - "integrity": "sha512-R4KvAMnE43W5Qeqb0Ly56O3mWMWIAgsMyz36DCaycd5nbg/9kzm0liw3JocfRqyJY0KPmzFjbswozXyW0DnIYA==", + "node_modules/@voidzero-dev/vite-plus-darwin-x64": { + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/@voidzero-dev/vite-plus-darwin-x64/-/vite-plus-darwin-x64-1.7.0.tgz", + "integrity": "sha512-SYEAvMJN0L4VO3brYqCU7aXExVwfIFnMjDLe9BauHedYwoG83BrezBN1wRviZt+SvZs1rpW9ttAwOHoQm7BoHw==", "cpu": [ - "mips64el" + "x64" ], "dev": true, - "license": "Apache-2.0", + "license": "MIT", "optional": true, "os": [ - "linux" + "darwin" ], "engines": { - "node": ">=16.20.0" + "node": ">=20.0.0" } }, - "node_modules/@typescript/typescript-linux-ppc64": { - "version": "7.0.2", - "resolved": "https://registry.npmjs.org/@typescript/typescript-linux-ppc64/-/typescript-linux-ppc64-7.0.2.tgz", - "integrity": "sha512-DORx5b3sd/4S7eayxm4FQv+A7CrkUIGRaHiwI8oiHTAI1fAPWhF4J0vAlkC8biAlHSVVwxMQ3tjZ2/DVbnQiiA==", + "node_modules/@voidzero-dev/vite-plus-linux-arm64-gnu": { + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/@voidzero-dev/vite-plus-linux-arm64-gnu/-/vite-plus-linux-arm64-gnu-1.7.0.tgz", + "integrity": "sha512-127UdNRXMZ/tQiNVYX+Hsy/RsodAwIJRdSG2reDdraAbxMWBCcdTJ5fyRTHCqjUl1aEuI/TUyuK35D1+0x7mGQ==", "cpu": [ - "ppc64" + "arm64" ], "dev": true, - "license": "Apache-2.0", + "libc": [ + "glibc" + ], + "license": "MIT", "optional": true, "os": [ "linux" ], "engines": { - "node": ">=16.20.0" + "node": ">=20.0.0" } }, - "node_modules/@typescript/typescript-linux-riscv64": { - "version": "7.0.2", - "resolved": "https://registry.npmjs.org/@typescript/typescript-linux-riscv64/-/typescript-linux-riscv64-7.0.2.tgz", - "integrity": "sha512-wf0jqEDOjrPRnKwYRyyJDRo11KMbvMFrU+q4zqKyChODBzvlkbhNQfKvLxQCcwTpdDaXSHZTVuh0JoCrKCUMHQ==", + "node_modules/@voidzero-dev/vite-plus-linux-arm64-musl": { + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/@voidzero-dev/vite-plus-linux-arm64-musl/-/vite-plus-linux-arm64-musl-1.7.0.tgz", + "integrity": "sha512-H1qQM2D49bByh5CNDTo1sJz99sinEGdbqj/7/G/prVhVeCnMQ3xDa7mj8Jr9ObMF1UiARhGznXuWdBd8TBBkwg==", "cpu": [ - "riscv64" + "arm64" ], "dev": true, - "license": "Apache-2.0", + "libc": [ + "musl" + ], + "license": "MIT", "optional": true, "os": [ "linux" ], "engines": { - "node": ">=16.20.0" + "node": ">=20.0.0" } }, - "node_modules/@typescript/typescript-linux-s390x": { - "version": "7.0.2", - "resolved": "https://registry.npmjs.org/@typescript/typescript-linux-s390x/-/typescript-linux-s390x-7.0.2.tgz", - "integrity": "sha512-IkwJc3L7yhytWd/ewjyxNDfOmswCm9GWMJT/ue/dU4aZNbwZeYAetq42VyLmsmSjvoX7z74X6ZaYCtzAr0EuGw==", + "node_modules/@voidzero-dev/vite-plus-linux-x64-gnu": { + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/@voidzero-dev/vite-plus-linux-x64-gnu/-/vite-plus-linux-x64-gnu-1.7.0.tgz", + "integrity": "sha512-OWee6VlSZbc0SemrqXzs5b2ukGTFNHg29tEAirqqmEYIBf/yOVSamXUL2L4I3fOMTJuT2dsXGc/Q30Z0xdsNjg==", "cpu": [ - "s390x" + "x64" ], "dev": true, - "license": "Apache-2.0", + "libc": [ + "glibc" + ], + "license": "MIT", "optional": true, "os": [ "linux" ], "engines": { - "node": ">=16.20.0" + "node": ">=20.0.0" } }, - "node_modules/@typescript/typescript-linux-x64": { - "version": "7.0.2", - "resolved": "https://registry.npmjs.org/@typescript/typescript-linux-x64/-/typescript-linux-x64-7.0.2.tgz", - "integrity": "sha512-EYdf2cNg7rgCWJnxCdJ+F3V39O8ihb37eHAu1LK8oAFizgTQbPOK7zHHXbPt8rX24COqODXeI3sIf0fCXG7H/A==", + "node_modules/@voidzero-dev/vite-plus-linux-x64-musl": { + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/@voidzero-dev/vite-plus-linux-x64-musl/-/vite-plus-linux-x64-musl-1.7.0.tgz", + "integrity": "sha512-htq0rkjaXr755gnq0NKh8JSJuE+sjImzRUZGcMsX35x2X31xrlHurb51du+/VM8YtluvXqatGDHwnQCbcTG16Q==", "cpu": [ "x64" ], "dev": true, - "license": "Apache-2.0", + "libc": [ + "musl" + ], + "license": "MIT", "optional": true, "os": [ "linux" ], "engines": { - "node": ">=16.20.0" + "node": ">=20.0.0" } }, - "node_modules/@typescript/typescript-netbsd-arm64": { - "version": "7.0.2", - "resolved": "https://registry.npmjs.org/@typescript/typescript-netbsd-arm64/-/typescript-netbsd-arm64-7.0.2.tgz", - "integrity": "sha512-+polYF4MF04aPpO5FTkHran9yUQDSXqy5GiSDKpsll5jy3l3+g9QLhpf39T+ePtefhXLOGrLl0QIjkQP6VnelA==", + "node_modules/@voidzero-dev/vite-plus-win32-arm64-msvc": { + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/@voidzero-dev/vite-plus-win32-arm64-msvc/-/vite-plus-win32-arm64-msvc-1.7.0.tgz", + "integrity": "sha512-CO3txOUEnzlncFFRUIKxqBxoEH1F34sOuGhpfBhZLpwLe/Bvuypcrcky2mlpT5g98H+hw/hQHMZukyIArYm7Cg==", "cpu": [ "arm64" ], "dev": true, - "license": "Apache-2.0", + "license": "MIT", "optional": true, "os": [ - "netbsd" + "win32" ], "engines": { - "node": ">=16.20.0" + "node": ">=20.0.0" } }, - "node_modules/@typescript/typescript-netbsd-x64": { - "version": "7.0.2", - "resolved": "https://registry.npmjs.org/@typescript/typescript-netbsd-x64/-/typescript-netbsd-x64-7.0.2.tgz", - "integrity": "sha512-8YIT0EHM/3dq10ZOVF/A7pc/YSMtbcecct4rWtexrnSCHOPcpC2KTLXfTCR6vDpnSiY12heNb1GiN/wu+T/FyA==", + "node_modules/@voidzero-dev/vite-plus-win32-x64-msvc": { + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/@voidzero-dev/vite-plus-win32-x64-msvc/-/vite-plus-win32-x64-msvc-1.7.0.tgz", + "integrity": "sha512-eA/Lg7eQTLwTiNhGBav9Lik6qiTSv8IPAETIziGgjNjEiTviCcFHNFlUyDOIFTY7uIWraGgMl8THY3zPnikoRg==", "cpu": [ "x64" ], "dev": true, - "license": "Apache-2.0", + "license": "MIT", "optional": true, "os": [ - "netbsd" + "win32" ], "engines": { - "node": ">=16.20.0" + "node": ">=20.0.0" } }, - "node_modules/@typescript/typescript-openbsd-arm64": { - "version": "7.0.2", - "resolved": "https://registry.npmjs.org/@typescript/typescript-openbsd-arm64/-/typescript-openbsd-arm64-7.0.2.tgz", - "integrity": "sha512-APT8+ClYnuYm1u9+kgGXoMj2VzWzcymwh2gNSQVySHfkRDGOTVkoWLjCmOQSaO+PoqQ57B0flRp9SA+7GnnkzQ==", + "node_modules/@xmldom/xmldom": { + "version": "0.8.15", + "resolved": "https://registry.npmmirror.com/@xmldom/xmldom/-/xmldom-0.8.15.tgz", + "integrity": "sha512-/5NV/vDALVFDXgLmfsy9TRCBlKwO2LNBFzpzvb9iIj+jR+eSc6DLYYvVOdivT/jm7MtU6TebYuRmzEOI7w40UA==", + "dev": true, + "engines": { + "node": ">=10.0.0" + } + }, + "node_modules/@yuku-core/binding-android-arm64": { + "version": "0.19.0", + "resolved": "https://registry.npmjs.org/@yuku-core/binding-android-arm64/-/binding-android-arm64-0.19.0.tgz", + "integrity": "sha512-wdL2XmTiZixAOaHk9Z0JJZ8u9Qm8d333Zjpc6gaxXFX+UR5BlsfxZ7a2+2Rm71pamppsPYGUGFq2oVLbh6DISw==", "cpu": [ "arm64" ], "dev": true, - "license": "Apache-2.0", + "license": "MIT", "optional": true, "os": [ - "openbsd" + "android" + ] + }, + "node_modules/@yuku-core/binding-darwin-arm64": { + "version": "0.19.0", + "resolved": "https://registry.npmjs.org/@yuku-core/binding-darwin-arm64/-/binding-darwin-arm64-0.19.0.tgz", + "integrity": "sha512-7sNJa6XJhyetnTy64jw3NEi4YgUcezHk1G5GH9FSvXAuC8wIlbaOwT9lgq5qo5sspjrZJQlBR1TWflP49uRpMw==", + "cpu": [ + "arm64" ], - "engines": { - "node": ">=16.20.0" - } + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ] }, - "node_modules/@typescript/typescript-openbsd-x64": { - "version": "7.0.2", - "resolved": "https://registry.npmjs.org/@typescript/typescript-openbsd-x64/-/typescript-openbsd-x64-7.0.2.tgz", - "integrity": "sha512-yX7s+Q0Dln0Dt9tEzZsAjXXR/+ytBM7AlglaqyeMPxQszJ1JhlJdZ6jLA+IzldHtflX81em7lDao1xXu+aRRkg==", + "node_modules/@yuku-core/binding-darwin-x64": { + "version": "0.19.0", + "resolved": "https://registry.npmjs.org/@yuku-core/binding-darwin-x64/-/binding-darwin-x64-0.19.0.tgz", + "integrity": "sha512-pTC7dYEc59isdyizc3nsuyFNBu2LU5wMYZ1be6UMr59PY/AJNtO1aBLWV0MgL/z7C1nv/2sX4TNjGgKLoeevJw==", "cpu": [ "x64" ], "dev": true, - "license": "Apache-2.0", + "license": "MIT", "optional": true, "os": [ - "openbsd" - ], - "engines": { - "node": ">=16.20.0" - } + "darwin" + ] }, - "node_modules/@typescript/typescript-sunos-x64": { - "version": "7.0.2", - "resolved": "https://registry.npmjs.org/@typescript/typescript-sunos-x64/-/typescript-sunos-x64-7.0.2.tgz", - "integrity": "sha512-dLJDGaLZ1D4HPQn62u1n8mBDkJREwMsAkCdkwd4Ieqw+x3TUyTsqY0YiBCtE6H6OzzgGk3iuZ3vFWRS+E8/d1g==", + "node_modules/@yuku-core/binding-freebsd-x64": { + "version": "0.19.0", + "resolved": "https://registry.npmjs.org/@yuku-core/binding-freebsd-x64/-/binding-freebsd-x64-0.19.0.tgz", + "integrity": "sha512-xrZjF6XOEwyLOiDIfrwDdRCS6ghxcJeirNC1KivQhVcUwlRonaU79S3/Uiyx3lBylPnT8qKJ3/aMT+H52nGTJQ==", "cpu": [ "x64" ], "dev": true, - "license": "Apache-2.0", + "license": "MIT", "optional": true, "os": [ - "sunos" - ], - "engines": { - "node": ">=16.20.0" - } + "freebsd" + ] }, - "node_modules/@typescript/typescript-win32-arm64": { - "version": "7.0.2", - "resolved": "https://registry.npmjs.org/@typescript/typescript-win32-arm64/-/typescript-win32-arm64-7.0.2.tgz", - "integrity": "sha512-Gyl1Vy6OsWesLzmq+EP0Fb7b4Nid5232AvcA2SFcdYreldpNtYFFofPjnt62y9hQy7VTaZp65ICJjuAQRaVcIQ==", + "node_modules/@yuku-core/binding-linux-arm-gnu": { + "version": "0.19.0", + "resolved": "https://registry.npmjs.org/@yuku-core/binding-linux-arm-gnu/-/binding-linux-arm-gnu-0.19.0.tgz", + "integrity": "sha512-0OyIH53C0I1CbADHn9FSdCfX5qbpeLwJhmOVhonFJNYheybOnkSJ50qGMfTJIb8y5zrwqvLs7FVBvz6Fk8maZg==", "cpu": [ - "arm64" + "arm" ], "dev": true, - "license": "Apache-2.0", + "libc": [ + "glibc" + ], + "license": "MIT", "optional": true, "os": [ - "win32" - ], - "engines": { - "node": ">=16.20.0" - } + "linux" + ] }, - "node_modules/@typescript/typescript-win32-x64": { - "version": "7.0.2", - "resolved": "https://registry.npmjs.org/@typescript/typescript-win32-x64/-/typescript-win32-x64-7.0.2.tgz", - "integrity": "sha512-0BQ3HkAHHlKLSp1qRvf3SUhGpGsDuhB/jgFw75guyqbxJqEaS0Cw/VFO8i2nHglJUzQCRtMMR/IBAKE3ETMC4g==", + "node_modules/@yuku-core/binding-linux-arm-musl": { + "version": "0.19.0", + "resolved": "https://registry.npmjs.org/@yuku-core/binding-linux-arm-musl/-/binding-linux-arm-musl-0.19.0.tgz", + "integrity": "sha512-z/iPfkCOCSXE34VXNt0uP1ORSW+4mEa9b5CiJcWZeqZH08g49bFU/jRM2T04f+Wpw5mJ6HIzNBiojxeAbrHjeg==", "cpu": [ - "x64" + "arm" ], "dev": true, - "license": "Apache-2.0", + "libc": [ + "musl" + ], + "license": "MIT", "optional": true, "os": [ - "win32" - ], - "engines": { - "node": ">=16.20.0" - } + "linux" + ] }, - "node_modules/@typescript/typescript6": { - "version": "6.0.2", - "resolved": "https://registry.npmjs.org/@typescript/typescript6/-/typescript6-6.0.2.tgz", - "integrity": "sha512-mbCddXd+jm7hfx7w2YU64/Av4/NqqeG3GoRZgxPcgoTxYjhrcfJRw9ULch71SS4G+Q3bOXFhRvPqjguN0Hyp5w==", + "node_modules/@yuku-core/binding-linux-arm64-gnu": { + "version": "0.19.0", + "resolved": "https://registry.npmjs.org/@yuku-core/binding-linux-arm64-gnu/-/binding-linux-arm64-gnu-0.19.0.tgz", + "integrity": "sha512-jLNTi+gzaRwBJ+gwhCJ+rDb5dmx/8hEBx93UWd7hjMSqPTL1D1wvVSvXVAldV5kALvju7b0/m51EHEhs4+I1fA==", + "cpu": [ + "arm64" + ], "dev": true, - "license": "Apache-2.0", - "dependencies": { - "@typescript/old": "npm:typescript@^6" - }, - "bin": { - "tsc6": "bin/tsc6" - } - }, - "node_modules/@ungap/structured-clone": { - "version": "1.4.0", - "resolved": "https://registry.npmmirror.com/@ungap/structured-clone/-/structured-clone-1.4.0.tgz", - "integrity": "sha512-1mEZtMKPM09vDmQt5y7YvmN2+DFTP7Tg0EWXdic8/C6VRnpb33e4ghisCIE3WZjsE2N8mf+QV1Zqh7ZFYLWInQ==", - "dev": true + "libc": [ + "glibc" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] }, - "node_modules/@vitejs/plugin-react": { - "version": "5.2.0", - "resolved": "https://registry.npmmirror.com/@vitejs/plugin-react/-/plugin-react-5.2.0.tgz", - "integrity": "sha512-YmKkfhOAi3wsB1PhJq5Scj3GXMn3WvtQ/JC0xoopuHoXSdmtdStOpFrYaT1kie2YgFBcIe64ROzMYRjCrYOdYw==", + "node_modules/@yuku-core/binding-linux-arm64-musl": { + "version": "0.19.0", + "resolved": "https://registry.npmjs.org/@yuku-core/binding-linux-arm64-musl/-/binding-linux-arm64-musl-0.19.0.tgz", + "integrity": "sha512-YwyPIdW/rN2Fmv0MTFWi47FaB3F9g+2b+sJISyAw83Yd60RWH4T3Nx6XkAHHVN+uKJNBAd6So7/BVihSiFYvuQ==", + "cpu": [ + "arm64" + ], "dev": true, - "dependencies": { - "@babel/core": "^7.29.0", - "@babel/plugin-transform-react-jsx-self": "^7.27.1", - "@babel/plugin-transform-react-jsx-source": "^7.27.1", - "@rolldown/pluginutils": "1.0.0-rc.3", - "@types/babel__core": "^7.20.5", - "react-refresh": "^0.18.0" - }, - "engines": { - "node": "^20.19.0 || >=22.12.0" - }, - "peerDependencies": { - "vite": "^4.2.0 || ^5.0.0 || ^6.0.0 || ^7.0.0 || ^8.0.0" - } - }, - "node_modules/@vitejs/plugin-react/node_modules/@rolldown/pluginutils": { - "version": "1.0.0-rc.3", - "resolved": "https://registry.npmmirror.com/@rolldown/pluginutils/-/pluginutils-1.0.0-rc.3.tgz", - "integrity": "sha512-eybk3TjzzzV97Dlj5c+XrBFW57eTNhzod66y9HrBlzJ6NsCrWCp/2kaPS3K9wJmurBC0Tdw4yPjXKZqlznim3Q==", - "dev": true + "libc": [ + "musl" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] }, - "node_modules/@vitest/mocker": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/@vitest/mocker/-/mocker-5.1.2.tgz", - "integrity": "sha512-UGc97wUIy0Ji2+9GxzHEJiOhiwkaukgE7VYcUNnjpX3sWnwQ8XogmNXX4WyOukxYgKb8Nh2XFa7KId0ZjpmVhQ==", + "node_modules/@yuku-core/binding-linux-x64-gnu": { + "version": "0.19.0", + "resolved": "https://registry.npmjs.org/@yuku-core/binding-linux-x64-gnu/-/binding-linux-x64-gnu-0.19.0.tgz", + "integrity": "sha512-/vskaAXVX3ESR43FiTdfiYS7z1b9uoQJwVQ/0RgUHgN2sWoAyCZs+aX4CgU7eKGIHTVfp9VFwv+c+2XchYiEtQ==", + "cpu": [ + "x64" + ], "dev": true, + "libc": [ + "glibc" + ], "license": "MIT", - "dependencies": { - "@jridgewell/trace-mapping": "0.3.31", - "@vitest/spy": "5.1.2", - "estree-walker": "^3.0.3", - "magic-string": "^1.4.5" - }, - "funding": { - "url": "https://opencollective.com/vitest" - }, - "peerDependencies": { - "msw": "^2.4.9 || ^3.0.0", - "vite": "^6.0.0 || ^7.0.0 || ^8.0.0" - }, - "peerDependenciesMeta": { - "msw": { - "optional": true - }, - "vite": { - "optional": true - } - } + "optional": true, + "os": [ + "linux" + ] }, - "node_modules/@vitest/mocker/node_modules/magic-string": { - "version": "1.4.5", - "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-1.4.5.tgz", - "integrity": "sha512-oLLC2+YvQUfAa+vxoufE/yc1icb87M9iXIRqAoR/2EhE/8cb3SF/+Gi0c2By1B+5Vz2e2vQtUvHiu1+63Znh+w==", + "node_modules/@yuku-core/binding-linux-x64-musl": { + "version": "0.19.0", + "resolved": "https://registry.npmjs.org/@yuku-core/binding-linux-x64-musl/-/binding-linux-x64-musl-0.19.0.tgz", + "integrity": "sha512-FuXL5igeSKib9Rye02TdH+D6SQezTyGxIATMu1Qsn/QywrzwpGl35OLpS2C1x5vpGLeVE2XgiLd5mVPFHmIglQ==", + "cpu": [ + "x64" + ], "dev": true, + "libc": [ + "musl" + ], "license": "MIT", - "dependencies": { - "@jridgewell/sourcemap-codec": "^1.6.0" - } + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@yuku-core/binding-win32-arm64": { + "version": "0.19.0", + "resolved": "https://registry.npmjs.org/@yuku-core/binding-win32-arm64/-/binding-win32-arm64-0.19.0.tgz", + "integrity": "sha512-YuJAe7zEKT1Xa7LuHlhGJpPnYQeVtvo0rZvNjJRqkH0hQGOw4C8QeP30Tg5VKGzZfo2x8CjhjEhKt4TmLwfmdg==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ] }, - "node_modules/@vitest/spy": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/@vitest/spy/-/spy-5.1.2.tgz", - "integrity": "sha512-PQl0/3+p9GaY71+MHywN6oyHfLhVDD5kcbm7oNRldA2F0ExMU3S8RQdnpteJ9gFAdK5P6KCgE6LqCpUgy57KzA==", + "node_modules/@yuku-core/binding-win32-x64": { + "version": "0.19.0", + "resolved": "https://registry.npmjs.org/@yuku-core/binding-win32-x64/-/binding-win32-x64-0.19.0.tgz", + "integrity": "sha512-o8iY/mXwlRkedp0LNTr4+TEfXTPQwoNZmv6k+1WIAd1ZXEn8xJJTBCtB0osaVvdZo/x/cNmV16UrWrrGpM5Mvw==", + "cpu": [ + "x64" + ], "dev": true, "license": "MIT", - "funding": { - "url": "https://opencollective.com/vitest" - } + "optional": true, + "os": [ + "win32" + ] }, - "node_modules/@xmldom/xmldom": { - "version": "0.8.15", - "resolved": "https://registry.npmmirror.com/@xmldom/xmldom/-/xmldom-0.8.15.tgz", - "integrity": "sha512-/5NV/vDALVFDXgLmfsy9TRCBlKwO2LNBFzpzvb9iIj+jR+eSc6DLYYvVOdivT/jm7MtU6TebYuRmzEOI7w40UA==", + "node_modules/@yuku-toolchain/types": { + "version": "0.19.0", + "resolved": "https://registry.npmjs.org/@yuku-toolchain/types/-/types-0.19.0.tgz", + "integrity": "sha512-tFkNbsP4WXX9UMUC5syJGdK9dPMLK0PPaIuXCcCYH75sZ8MrebfBZ2XvCILRTw8AgLivSSCfDa4R67iYBDa4Kg==", "dev": true, - "engines": { - "node": ">=10.0.0" - } + "license": "MIT" }, "node_modules/@zip.js/zip.js": { "version": "2.22.0", @@ -5216,6 +6646,16 @@ "node": ">=10" } }, + "node_modules/aria-query": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/aria-query/-/aria-query-5.3.0.tgz", + "integrity": "sha512-b0P0sZPKtyu8HkeRAfCq0IfURZK+SuwMjY1UXGBU27wpAiTwQAIlq56IbIO+ytk/JjS1fMR14ee5WBBfKi5J6A==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "dequal": "^2.0.3" + } + }, "node_modules/asn1js": { "version": "3.0.10", "resolved": "https://registry.npmmirror.com/asn1js/-/asn1js-3.0.10.tgz", @@ -5804,6 +7244,13 @@ "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==", "dev": true }, + "node_modules/common-path-prefix": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/common-path-prefix/-/common-path-prefix-3.0.0.tgz", + "integrity": "sha512-QE33hToZseCH3jS0qN96O/bSh3kaw/h+Tq7ngyY9eWDUnTlTNUyqfqvCXioLe5Na5jFsL78ra/wuBU4iuEgd4w==", + "dev": true, + "license": "ISC" + }, "node_modules/compare-version": { "version": "0.1.2", "resolved": "https://registry.npmmirror.com/compare-version/-/compare-version-0.1.2.tgz", @@ -6010,6 +7457,13 @@ "js-yaml": "^4.1.0" } }, + "node_modules/dom-accessibility-api": { + "version": "0.5.16", + "resolved": "https://registry.npmjs.org/dom-accessibility-api/-/dom-accessibility-api-0.5.16.tgz", + "integrity": "sha512-X7BJ2yElsnOJ30pZF4uIIDfBEVgF4XEBxL9Bxhy6dnrm5hkzqmsWHGTiHqRiITNhMyFLyAiWndIJP7Z1NTteDg==", + "dev": true, + "license": "MIT" + }, "node_modules/dompurify": { "version": "3.4.17", "resolved": "https://registry.npmjs.org/dompurify/-/dompurify-3.4.17.tgz", @@ -6509,6 +7963,48 @@ "minimatch": "^5.0.1" } }, + "node_modules/find-cache-dir": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/find-cache-dir/-/find-cache-dir-6.0.0.tgz", + "integrity": "sha512-nZMBQ0IuwcMgW8jsiShHtj2WQS6ReVTOMGiSnriCdWBUN/eVsolBlE0EPXe2R5MfIWtqkpM4grjGuqimbWhUFA==", + "deprecated": "Renamed to `find-cache-directory`.", + "dev": true, + "license": "MIT", + "dependencies": { + "common-path-prefix": "^3.0.0", + "pkg-dir": "^7.0.0" + }, + "engines": { + "node": ">=16" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/find-up": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-6.3.0.tgz", + "integrity": "sha512-v2ZsoEuVHYy8ZIlYqwPe/39Cy+cFDzp4dXPaxNvkEuouymu+2Jbz0PxpKarJHYJTmv2HWT3O382qY8l4jMWthw==", + "dev": true, + "license": "MIT", + "dependencies": { + "locate-path": "^7.1.0", + "path-exists": "^5.0.0" + }, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/flatted": { + "version": "3.4.4", + "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.4.4.tgz", + "integrity": "sha512-5+ybhBZANEJxaH3X5evAFatUxLfEHSr7n6kYJ+1Qd0mUqr4eu9gIf6GDbWHf8RJijHrjjO8G+la14SlL2SeS1Q==", + "dev": true, + "license": "ISC" + }, "node_modules/form-data": { "version": "4.0.6", "resolved": "https://registry.npmmirror.com/form-data/-/form-data-4.0.6.tgz", @@ -6625,6 +8121,27 @@ "node": ">=6" } }, + "node_modules/get-oxlint-rules": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/get-oxlint-rules/-/get-oxlint-rules-0.3.1.tgz", + "integrity": "sha512-dASXJ9xgkjEs0O/U7fmNcfJd6BUHD1rNJomFARTc/lhkqO0QnQRNuJWU5kNh2CEq9Nw8NPJnRy2yqaParVXLew==", + "dev": true, + "license": "MIT", + "dependencies": { + "find-cache-dir": "6.0.0", + "tinyexec": "1.3.1" + } + }, + "node_modules/get-oxlint-rules/node_modules/tinyexec": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/tinyexec/-/tinyexec-1.3.1.tgz", + "integrity": "sha512-GCvB3aoys96IuDFBMcTB46JOR6mdMtAToqwiW8JlWhsoh1mhHi/xn9ss/Dg7N555GiJyEt2qzoG/NHCwM6h1EA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=18" + } + }, "node_modules/get-proto": { "version": "1.0.1", "resolved": "https://registry.npmmirror.com/get-proto/-/get-proto-1.0.1.tgz", @@ -6659,6 +8176,13 @@ "url": "https://github.com/sponsors/isaacs" } }, + "node_modules/glob-distribute": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/glob-distribute/-/glob-distribute-0.1.0.tgz", + "integrity": "sha512-Z+EYFkNVV8e7BeciaFg5j6PyzyOsTQscXOH1SKmtGavMaRWjmW4U9n6+cN08VlRgyolYM1SD0gUsWL/pkQgJ+Q==", + "dev": true, + "license": "MIT" + }, "node_modules/gopd": { "version": "1.2.0", "resolved": "https://registry.npmmirror.com/gopd/-/gopd-1.2.0.tgz", @@ -7459,6 +8983,22 @@ "uc.micro": "^3.0.0" } }, + "node_modules/locate-path": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-7.2.0.tgz", + "integrity": "sha512-gvVijfZvn7R+2qyPX8mAuKcFGDf6Nc61GdvGafQsHL0sBIxfKzA+usWn4GFC/bk+QdwPUD4kWFJLhElipq+0VA==", + "dev": true, + "license": "MIT", + "dependencies": { + "p-locate": "^6.0.0" + }, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/lodash": { "version": "4.18.1", "resolved": "https://registry.npmmirror.com/lodash/-/lodash-4.18.1.tgz", @@ -7505,6 +9045,16 @@ } } }, + "node_modules/lz-string": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/lz-string/-/lz-string-1.5.0.tgz", + "integrity": "sha512-h5bgJWpxJNswbU7qCrV0tIKQCaS3blPDrqKWx+QxzuzL1zGUzij9XCWLrSLsJPu5t+eWA/ycetzYAO5IOMcWAQ==", + "dev": true, + "license": "MIT", + "bin": { + "lz-string": "bin/bin.js" + } + }, "node_modules/magic-string": { "version": "0.30.21", "resolved": "https://registry.npmmirror.com/magic-string/-/magic-string-0.30.21.tgz", @@ -8554,6 +10104,16 @@ "@types/wicg-file-system-access": "^2020.9.5" } }, + "node_modules/mrmime": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/mrmime/-/mrmime-2.0.1.tgz", + "integrity": "sha512-Y3wQdFg2Va6etvQ5I82yUhGdsKrcYox6p7FfL1LbK2J4V01F9TGlepTIhnK24t7koZibmg82KGglhA1XK5IsLQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=10" + } + }, "node_modules/ms": { "version": "2.1.3", "resolved": "https://registry.npmmirror.com/ms/-/ms-2.1.3.tgz", @@ -8579,24 +10139,6 @@ "node": "^10 || ^12 || ^13.7 || ^14 || >=15.0.1" } }, - "node_modules/napi-windows-process-start-time": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/napi-windows-process-start-time/-/napi-windows-process-start-time-0.1.0.tgz", - "integrity": "sha512-zHxhzKsIFu3elch3eFw69WEUGc79DFhbc3nD/WEOzWL/pFFLZRW13EHnuO0c+0YjncE5uCaS9ICHxOBXkb6vPw==", - "cpu": [ - "x64", - "arm64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "win32" - ], - "engines": { - "node": ">=20" - } - }, "node_modules/node-abi": { "version": "4.35.0", "resolved": "https://registry.npmmirror.com/node-abi/-/node-abi-4.35.0.tgz", @@ -8780,6 +10322,134 @@ "@oxc-parser/binding-win32-x64-msvc": "0.143.0" } }, + "node_modules/oxfmt": { + "version": "0.79.0", + "resolved": "https://registry.npmjs.org/oxfmt/-/oxfmt-0.79.0.tgz", + "integrity": "sha512-92iLHGxAgtYk6jLp/1ZBnEeABveNduHZgMDQj7tyqO9iafuJG3q+YHJq0R5Aa4YT+E6xswMQXdmPZYMwynS8ig==", + "dev": true, + "license": "MIT", + "dependencies": { + "tinypool": "2.2.0" + }, + "bin": { + "oxfmt": "bin/oxfmt" + }, + "engines": { + "node": "^20.19.0 || >=22.12.0" + }, + "funding": { + "url": "https://github.com/sponsors/oxc-project" + }, + "optionalDependencies": { + "@oxfmt/binding-android-arm-eabi": "0.79.0", + "@oxfmt/binding-android-arm64": "0.79.0", + "@oxfmt/binding-darwin-arm64": "0.79.0", + "@oxfmt/binding-darwin-x64": "0.79.0", + "@oxfmt/binding-freebsd-x64": "0.79.0", + "@oxfmt/binding-linux-arm-gnueabihf": "0.79.0", + "@oxfmt/binding-linux-arm-musleabihf": "0.79.0", + "@oxfmt/binding-linux-arm64-gnu": "0.79.0", + "@oxfmt/binding-linux-arm64-musl": "0.79.0", + "@oxfmt/binding-linux-ppc64-gnu": "0.79.0", + "@oxfmt/binding-linux-riscv64-gnu": "0.79.0", + "@oxfmt/binding-linux-riscv64-musl": "0.79.0", + "@oxfmt/binding-linux-s390x-gnu": "0.79.0", + "@oxfmt/binding-linux-x64-gnu": "0.79.0", + "@oxfmt/binding-linux-x64-musl": "0.79.0", + "@oxfmt/binding-openharmony-arm64": "0.79.0", + "@oxfmt/binding-win32-arm64-msvc": "0.79.0", + "@oxfmt/binding-win32-ia32-msvc": "0.79.0", + "@oxfmt/binding-win32-x64-msvc": "0.79.0" + }, + "peerDependencies": { + "@astrojs/compiler-rs": "^0.5.0", + "svelte": "^5.0.0", + "vite-plus": "*" + }, + "peerDependenciesMeta": { + "@astrojs/compiler-rs": { + "optional": true + }, + "svelte": { + "optional": true + }, + "vite-plus": { + "optional": true + } + } + }, + "node_modules/oxlint": { + "version": "1.94.0", + "resolved": "https://registry.npmjs.org/oxlint/-/oxlint-1.94.0.tgz", + "integrity": "sha512-Fnt+3wSKRhtLmvgRfxgRX0excSPCoyiXRol4eWKZLtXxWMQtwQ3KjKQUYXOw5loyinfnZfGzh4RCYf7opfL0vw==", + "dev": true, + "license": "MIT", + "bin": { + "oxlint": "bin/oxlint" + }, + "engines": { + "node": "^20.19.0 || >=22.12.0" + }, + "funding": { + "url": "https://github.com/sponsors/oxc-project" + }, + "optionalDependencies": { + "@oxlint/binding-android-arm-eabi": "1.94.0", + "@oxlint/binding-android-arm64": "1.94.0", + "@oxlint/binding-darwin-arm64": "1.94.0", + "@oxlint/binding-darwin-x64": "1.94.0", + "@oxlint/binding-freebsd-x64": "1.94.0", + "@oxlint/binding-linux-arm-gnueabihf": "1.94.0", + "@oxlint/binding-linux-arm-musleabihf": "1.94.0", + "@oxlint/binding-linux-arm64-gnu": "1.94.0", + "@oxlint/binding-linux-arm64-musl": "1.94.0", + "@oxlint/binding-linux-ppc64-gnu": "1.94.0", + "@oxlint/binding-linux-riscv64-gnu": "1.94.0", + "@oxlint/binding-linux-riscv64-musl": "1.94.0", + "@oxlint/binding-linux-s390x-gnu": "1.94.0", + "@oxlint/binding-linux-x64-gnu": "1.94.0", + "@oxlint/binding-linux-x64-musl": "1.94.0", + "@oxlint/binding-openharmony-arm64": "1.94.0", + "@oxlint/binding-win32-arm64-msvc": "1.94.0", + "@oxlint/binding-win32-ia32-msvc": "1.94.0", + "@oxlint/binding-win32-x64-msvc": "1.94.0" + }, + "peerDependencies": { + "oxlint-tsgolint": ">=7.0.2007", + "vite-plus": "*" + }, + "peerDependenciesMeta": { + "oxlint-tsgolint": { + "optional": true + }, + "vite-plus": { + "optional": true + } + } + }, + "node_modules/oxlint-flat-config": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/oxlint-flat-config/-/oxlint-flat-config-0.4.0.tgz", + "integrity": "sha512-Ts6BG501Nx5VpjKOHhRYRpRMlBMaZwD462cY7ha3gP2ri4BRmTAO/0epDeQ8CYwQADAQXp4nyqj/1rZerpCNKw==", + "dev": true, + "license": "MIT", + "dependencies": { + "get-oxlint-rules": "^0.3.1", + "glob-distribute": "^0.1.0" + }, + "peerDependencies": { + "oxlint": ">=1.85.0", + "vite-plus": ">=1.0.0" + }, + "peerDependenciesMeta": { + "oxlint": { + "optional": true + }, + "vite-plus": { + "optional": true + } + } + }, "node_modules/p-limit": { "version": "3.1.0", "resolved": "https://registry.npmmirror.com/p-limit/-/p-limit-3.1.0.tgz", @@ -8795,6 +10465,51 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/p-locate": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-6.0.0.tgz", + "integrity": "sha512-wPrq66Llhl7/4AGC6I+cqxT07LhXvWL08LNXz1fENOw0Ap4sRZZ/gZpTTJ5jpurzzzfS2W/Ge9BY3LgLjCShcw==", + "dev": true, + "license": "MIT", + "dependencies": { + "p-limit": "^4.0.0" + }, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/p-locate/node_modules/p-limit": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-4.0.0.tgz", + "integrity": "sha512-5b0R4txpzjPWVw/cXXUResoD4hb6U/x9BH08L7nw+GN1sezDzPdxeRvpc9c433fZhBan/wusjbCsqwqm4EIBIQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "yocto-queue": "^1.0.0" + }, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/p-locate/node_modules/yocto-queue": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-1.2.2.tgz", + "integrity": "sha512-4LCcse/U2MHZ63HAJVE+v71o7yOdIe4cZ70Wpf8D/IyjDKYQLV5GD46B+hSTjJsvV5PztjvHoU580EftxjDZFQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12.20" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/pako": { "version": "3.0.2", "resolved": "https://registry.npmmirror.com/pako/-/pako-3.0.2.tgz", @@ -8872,6 +10587,16 @@ "url": "https://github.com/fb55/entities?sponsor=1" } }, + "node_modules/path-exists": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-5.0.0.tgz", + "integrity": "sha512-RjhtfwJOxzcFmNOi6ltcbcu4Iu+FL3zEj83dk4kAS+fVpTxXLO1b38RvJgT/0QwvV/L3aY9TAnyv0EOqW4GoMQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + } + }, "node_modules/path-is-absolute": { "version": "1.0.1", "resolved": "https://registry.npmmirror.com/path-is-absolute/-/path-is-absolute-1.0.1.tgz", @@ -8915,6 +10640,13 @@ "node": "20 || >=22" } }, + "node_modules/pathe": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/pathe/-/pathe-2.0.3.tgz", + "integrity": "sha512-WUjGcAqP1gQacoQe+OBJsFA7Ld4DyXuUIjZ5cc75cLHvJ7dtNsTugphxIADwspS+AraAUePCKrSVtPLFj/F88w==", + "dev": true, + "license": "MIT" + }, "node_modules/pe-library": { "version": "0.4.1", "resolved": "https://registry.npmmirror.com/pe-library/-/pe-library-0.4.1.tgz", @@ -8947,6 +10679,22 @@ "url": "https://github.com/sponsors/jonschlinkert" } }, + "node_modules/pkg-dir": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-7.0.0.tgz", + "integrity": "sha512-Ie9z/WINcxxLp27BKOCHGde4ITq9UklYKDzVo1nhk5sqGEXU3FpkwP5GM2voTGJkGd9B3Otl+Q4uwSOeSUtOBA==", + "dev": true, + "license": "MIT", + "dependencies": { + "find-up": "^6.3.0" + }, + "engines": { + "node": ">=14.16" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/pkijs": { "version": "3.4.1", "resolved": "https://registry.npmmirror.com/pkijs/-/pkijs-3.4.1.tgz", @@ -8993,6 +10741,16 @@ "node": ">=10.4.0" } }, + "node_modules/pngjs": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/pngjs/-/pngjs-7.0.0.tgz", + "integrity": "sha512-LKWqWJRhstyYo9pGvgor/ivk2w94eSjE3RGVuzLGlr3NmD8bf7RcYGze1mNdEHRP6TRP6rMuDHk5t44hnTRyow==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=14.19.0" + } + }, "node_modules/postcss": { "version": "8.5.33", "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.5.33.tgz", @@ -9120,10 +10878,38 @@ "peerDependencies": { "preact-render-to-string": ">=5" }, - "peerDependenciesMeta": { - "preact-render-to-string": { - "optional": true - } + "peerDependenciesMeta": { + "preact-render-to-string": { + "optional": true + } + } + }, + "node_modules/pretty-format": { + "version": "27.5.1", + "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-27.5.1.tgz", + "integrity": "sha512-Qb1gy5OrP5+zDf2Bvnzdl3jsTf1qXVMazbvCoKhtKqVs4/YK4ozX4gKQJJVyNe+cajNPn0KoC0MC3FUmaHWEmQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-regex": "^5.0.1", + "ansi-styles": "^5.0.0", + "react-is": "^17.0.1" + }, + "engines": { + "node": "^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0" + } + }, + "node_modules/pretty-format/node_modules/ansi-styles": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-5.2.0.tgz", + "integrity": "sha512-Cxwpt2SfTzTtXcfOlzGEee8O+c+MmUgGrNiBcXnuWxuFJHe6a5Hz7qwhwe5OgaSYI0IJvkLqWX1ASG+cJOkEiA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" } }, "node_modules/proc-log": { @@ -9351,6 +11137,13 @@ "react": "^19.3.1" } }, + "node_modules/react-is": { + "version": "17.0.2", + "resolved": "https://registry.npmjs.org/react-is/-/react-is-17.0.2.tgz", + "integrity": "sha512-w2GsyukL62IJnlaff/nRegPQR94C/XXamvMWmSHRJ4y7Ts/4ocGRmTHvOs8PSE6pB3dWOrD/nueuU5sduBsQ4w==", + "dev": true, + "license": "MIT" + }, "node_modules/react-markdown": { "version": "10.1.0", "resolved": "https://registry.npmmirror.com/react-markdown/-/react-markdown-10.1.0.tgz", @@ -9797,1182 +11590,1032 @@ "dev": true, "dependencies": { "semver": "^7.5.3" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/source-map": { - "version": "0.6.1", - "resolved": "https://registry.npmmirror.com/source-map/-/source-map-0.6.1.tgz", - "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/source-map-js": { - "version": "1.2.2", - "resolved": "https://registry.npmmirror.com/source-map-js/-/source-map-js-1.2.2.tgz", - "integrity": "sha512-KGj/8Y43x35aZVDtt+J4mK1hoLGHULMYfSkODJNQjNDC3oW1PqPoxMwo0pLUsWM/UEGzON/NxeHywEfNXNP3Vw==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/source-map-support": { - "version": "0.5.21", - "resolved": "https://registry.npmmirror.com/source-map-support/-/source-map-support-0.5.21.tgz", - "integrity": "sha512-uBHU3L3czsIyYXKX88fdrGovxdSCoTGDRZ6SYXtSRxLZUzHg5P/66Ht6uoUlHu9EZod+inXhKo3qQgwXUT/y1w==", - "dev": true, - "dependencies": { - "buffer-from": "^1.0.0", - "source-map": "^0.6.0" - } - }, - "node_modules/space-separated-tokens": { - "version": "2.0.2", - "resolved": "https://registry.npmmirror.com/space-separated-tokens/-/space-separated-tokens-2.0.2.tgz", - "integrity": "sha512-PEGlAwrG8yXGXRjW32fGbg66JAlOAwbObuqVoJpv/mRgoWDQfgH1wDPvtzWyUSNAXBGSk8h755YDbbcEy3SH2Q==", - "dev": true, - "funding": { - "type": "github", - "url": "https://github.com/sponsors/wooorm" - } - }, - "node_modules/stat-mode": { - "version": "1.0.0", - "resolved": "https://registry.npmmirror.com/stat-mode/-/stat-mode-1.0.0.tgz", - "integrity": "sha512-jH9EhtKIjuXZ2cWxmXS8ZP80XyC3iasQxMDV8jzhNJpfDb7VbQLVW4Wvsxz9QZvzV+G4YoSfBUVKDOyxLzi/sg==", - "dev": true, - "engines": { - "node": ">= 6" - } - }, - "node_modules/std-env": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/std-env/-/std-env-4.3.0.tgz", - "integrity": "sha512-OtU/EgQ1kIm5KwqQpBC6ZEMXrZRui11w8zgfTWp8cdO9B8OaPsbA8bTHO2P+HNo1VlUTGMVBwPhydu6poeXiag==", - "dev": true, - "license": "MIT" - }, - "node_modules/string_decoder": { - "version": "1.1.1", - "resolved": "https://registry.npmmirror.com/string_decoder/-/string_decoder-1.1.1.tgz", - "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", - "dev": true, - "dependencies": { - "safe-buffer": "~5.1.0" - } - }, - "node_modules/string-width": { - "version": "4.2.3", - "resolved": "https://registry.npmmirror.com/string-width/-/string-width-4.2.3.tgz", - "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", - "dev": true, - "dependencies": { - "emoji-regex": "^8.0.0", - "is-fullwidth-code-point": "^3.0.0", - "strip-ansi": "^6.0.1" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/stringify-entities": { - "version": "4.0.5", - "resolved": "https://registry.npmmirror.com/stringify-entities/-/stringify-entities-4.0.5.tgz", - "integrity": "sha512-jNuI2fNNw5ecxrWmgm90R3iH0Kc/94AQwoQWoSUYphWzvmUA2pjFG34H56Z7Z3FkvH3FpYwwewKAa97oQnPFhw==", - "dev": true, - "dependencies": { - "character-entities-html4": "^2.0.0", - "character-entities-legacy": "^3.0.0" - }, - "funding": { - "type": "github", - "url": "https://github.com/sponsors/wooorm" - } - }, - "node_modules/strip-ansi": { - "version": "6.0.1", - "resolved": "https://registry.npmmirror.com/strip-ansi/-/strip-ansi-6.0.1.tgz", - "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", - "dev": true, - "dependencies": { - "ansi-regex": "^5.0.1" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/style-to-object": { - "version": "2.0.2", - "resolved": "https://registry.npmmirror.com/style-to-object/-/style-to-object-2.0.2.tgz", - "integrity": "sha512-QmbXPUylqU80HAgTOJeEOdbA40W9KtxmjMhQy+tq+b8F2aoh3aQLuy82hh2jm2qsC9hR9eI0+eQidTMydKcqRA==", - "dev": true, - "dependencies": { - "inline-style-parser": "0.2.9" - } - }, - "node_modules/sumchecker": { - "version": "3.0.1", - "resolved": "https://registry.npmmirror.com/sumchecker/-/sumchecker-3.0.1.tgz", - "integrity": "sha512-MvjXzkz/BOfyVDkG0oFOtBxHX2u3gKbMHIF/dXblZsgD3BWOFLmHovIpZY7BykJdAjcqRCBi1WYBNdEC9yI7vg==", - "dev": true, - "dependencies": { - "debug": "^4.1.0" - }, - "engines": { - "node": ">= 8.0" - } - }, - "node_modules/supports-color": { - "version": "7.2.0", - "resolved": "https://registry.npmmirror.com/supports-color/-/supports-color-7.2.0.tgz", - "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", - "dev": true, - "dependencies": { - "has-flag": "^4.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/tailwind-merge": { - "version": "3.7.1", - "resolved": "https://registry.npmmirror.com/tailwind-merge/-/tailwind-merge-3.7.1.tgz", - "integrity": "sha512-v7y4BV4FUlO8exj/4M5UXKeoowDiuugVUg3tkMNIyOUCOHy5xp8+5aWQeXCtZ2491sUV1YPsVeM9EveZ6/xuZQ==", - "dev": true, - "funding": { - "type": "github", - "url": "https://github.com/sponsors/dcastil" - } - }, - "node_modules/tailwindcss": { - "version": "4.3.5", - "resolved": "https://registry.npmmirror.com/tailwindcss/-/tailwindcss-4.3.5.tgz", - "integrity": "sha512-FcQk9BuffmEHJP2G0XmB2SplU1aLTI7j07Kunk+U74Ny+XiWOtzXz9aujFZ/avntw1e2cOv/3PkgzflQ7gX2vQ==", - "dev": true - }, - "node_modules/tapable": { - "version": "2.3.4", - "resolved": "https://registry.npmmirror.com/tapable/-/tapable-2.3.4.tgz", - "integrity": "sha512-NHFiWnAbMJxNNpBwiO7jJVGDuqMxT9/oV8v57RR+fgBQShkJil5inGD8/xWy0hjLyHQyX1tu27QANhlz3KBqCg==", - "dev": true, - "engines": { - "node": ">=6" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/webpack" - } - }, - "node_modules/tar": { - "version": "7.5.22", - "resolved": "https://registry.npmmirror.com/tar/-/tar-7.5.22.tgz", - "integrity": "sha512-MFO/QzvtAOmJbkhOaCTvbGcFN9L9b+JunIsDwaKljSOdcLMea3NJ1k9Usz/rjdfSXTq4dfzfeS7W4p4YOAAHeA==", - "dev": true, - "dependencies": { - "@isaacs/fs-minipass": "^4.0.0", - "chownr": "^3.0.0", - "minipass": "^7.1.2", - "minizlib": "^3.1.0", - "yallist": "^5.0.0" - }, - "engines": { - "node": ">=18" - } - }, - "node_modules/tar/node_modules/yallist": { - "version": "5.0.0", - "resolved": "https://registry.npmmirror.com/yallist/-/yallist-5.0.0.tgz", - "integrity": "sha512-YgvUTfwqyc7UXVMrB+SImsVYSmTS8X/tSrtdNZMImM+n7+QTriRXyXim0mBrTXNeqzVF0KWGgHPeiyViFFrNDw==", - "dev": true, - "engines": { - "node": ">=18" - } - }, - "node_modules/temp": { - "version": "0.9.4", - "resolved": "https://registry.npmmirror.com/temp/-/temp-0.9.4.tgz", - "integrity": "sha512-yYrrsWnrXMcdsnu/7YMYAofM1ktpL5By7vZhf15CrXijWWrEYZks5AXBudalfSWJLlnen/QUJUB5aoB0kqZUGA==", - "dev": true, - "peer": true, - "dependencies": { - "mkdirp": "^0.5.1", - "rimraf": "~2.6.2" - }, - "engines": { - "node": ">=6.0.0" - } - }, - "node_modules/temp-file": { - "version": "3.4.0", - "resolved": "https://registry.npmmirror.com/temp-file/-/temp-file-3.4.0.tgz", - "integrity": "sha512-C5tjlC/HCtVUOi3KWVokd4vHVViOmGjtLwIh4MuzPo/nMYTV/p1urt3RnMz2IWXDdKEGJH3k5+KPxtqRsUYGtg==", - "dev": true, - "dependencies": { - "async-exit-hook": "^2.0.1", - "fs-extra": "^10.0.0" - } - }, - "node_modules/tiny-async-pool": { - "version": "1.3.0", - "resolved": "https://registry.npmmirror.com/tiny-async-pool/-/tiny-async-pool-1.3.0.tgz", - "integrity": "sha512-01EAw5EDrcVrdgyCLgoSPvqznC0sVxDSVeiOz09FUpjh71G79VCqneOr+xvt7T1r76CF6ZZfPjHorN2+d+3mqA==", - "dev": true, - "dependencies": { - "semver": "^5.5.0" - } - }, - "node_modules/tiny-async-pool/node_modules/semver": { - "version": "5.7.2", - "resolved": "https://registry.npmmirror.com/semver/-/semver-5.7.2.tgz", - "integrity": "sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g==", - "dev": true, - "bin": { - "semver": "bin/semver" - } - }, - "node_modules/tinybench": { - "version": "6.2.5", - "resolved": "https://registry.npmjs.org/tinybench/-/tinybench-6.2.5.tgz", - "integrity": "sha512-b/8GRMdnY4cqkfCLyaFpTGIv1qwfi3oT0mWaepwT++6Z/ZrYehNfZZ2JDKVLKGhNoEkS3IIB1ELtCT0XS5DtOA==", - "dev": true, - "license": "MIT", + }, "engines": { - "node": ">=20.0.0" + "node": ">=10" } }, - "node_modules/tinyexec": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/tinyexec/-/tinyexec-1.4.0.tgz", - "integrity": "sha512-PV6lIcJQh57aFeJDwx16JNHmgFRh5xguzallrDW1qe8nAghYgr5MKz2K5k7wEyV/ygZhdnIAP8+HZSarHPBCsg==", + "node_modules/sirv": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/sirv/-/sirv-3.0.2.tgz", + "integrity": "sha512-2wcC/oGxHis/BoHkkPwldgiPSYcpZK3JU28WoMVv55yHJgcZ8rlXvuG9iZggz+sU1d4bRgIGASwyWqjxu3FM0g==", "dev": true, "license": "MIT", + "dependencies": { + "@polka/url": "^1.0.0-next.24", + "mrmime": "^2.0.0", + "totalist": "^3.0.0" + }, "engines": { "node": ">=18" } }, - "node_modules/tinyglobby": { - "version": "0.2.17", - "resolved": "https://registry.npmmirror.com/tinyglobby/-/tinyglobby-0.2.17.tgz", - "integrity": "sha512-wXR/dYpcqKmfWpEdZjiKJOwCNFndD0DMnrW/cYjVGttEkBfVgcLFHoNrlj47mjOVic9yyNu65alsgF4NQyTa2g==", + "node_modules/source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmmirror.com/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", "dev": true, - "dependencies": { - "fdir": "^6.5.0", - "picomatch": "^4.0.4" - }, "engines": { - "node": ">=12.0.0" - }, - "funding": { - "url": "https://github.com/sponsors/SuperchupuDev" + "node": ">=0.10.0" } }, - "node_modules/tldts": { - "version": "7.5.5", - "resolved": "https://registry.npmmirror.com/tldts/-/tldts-7.5.5.tgz", - "integrity": "sha512-Hy6IImaWALzJOgCIss4gIFi4G0M9lqk95pFKCUVxQPZw+biZ1Pv6f28JpYgahpJB+BufA0HYsIU/aP/WIx3KRg==", + "node_modules/source-map-js": { + "version": "1.2.2", + "resolved": "https://registry.npmmirror.com/source-map-js/-/source-map-js-1.2.2.tgz", + "integrity": "sha512-KGj/8Y43x35aZVDtt+J4mK1hoLGHULMYfSkODJNQjNDC3oW1PqPoxMwo0pLUsWM/UEGzON/NxeHywEfNXNP3Vw==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/source-map-support": { + "version": "0.5.21", + "resolved": "https://registry.npmmirror.com/source-map-support/-/source-map-support-0.5.21.tgz", + "integrity": "sha512-uBHU3L3czsIyYXKX88fdrGovxdSCoTGDRZ6SYXtSRxLZUzHg5P/66Ht6uoUlHu9EZod+inXhKo3qQgwXUT/y1w==", "dev": true, "dependencies": { - "tldts-core": "^7.5.5" - }, - "bin": { - "tldts": "bin/cli.js" + "buffer-from": "^1.0.0", + "source-map": "^0.6.0" } }, - "node_modules/tldts-core": { - "version": "7.5.5", - "resolved": "https://registry.npmmirror.com/tldts-core/-/tldts-core-7.5.5.tgz", - "integrity": "sha512-rEJz/8cJFY/bdF354gl14yxavbrIbvM+FcbkYVQ6CSCMQTJdUFUIm39TTWSiGPvcpQh7/F6qHrD3SkwwdgtDCw==", - "dev": true + "node_modules/space-separated-tokens": { + "version": "2.0.2", + "resolved": "https://registry.npmmirror.com/space-separated-tokens/-/space-separated-tokens-2.0.2.tgz", + "integrity": "sha512-PEGlAwrG8yXGXRjW32fGbg66JAlOAwbObuqVoJpv/mRgoWDQfgH1wDPvtzWyUSNAXBGSk8h755YDbbcEy3SH2Q==", + "dev": true, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } }, - "node_modules/tmp": { - "version": "0.2.7", - "resolved": "https://registry.npmmirror.com/tmp/-/tmp-0.2.7.tgz", - "integrity": "sha512-e0votIpp4Uo2AJYSzVHV6xCcawuiez3DzqDAbrTc3YxBkplN6e+dM13ZeIcZnDg/QpSuU2zfZ3rzwY8ukEnaXw==", + "node_modules/stat-mode": { + "version": "1.0.0", + "resolved": "https://registry.npmmirror.com/stat-mode/-/stat-mode-1.0.0.tgz", + "integrity": "sha512-jH9EhtKIjuXZ2cWxmXS8ZP80XyC3iasQxMDV8jzhNJpfDb7VbQLVW4Wvsxz9QZvzV+G4YoSfBUVKDOyxLzi/sg==", "dev": true, "engines": { - "node": ">=14.14" + "node": ">= 6" } }, - "node_modules/tmp-promise": { - "version": "3.0.3", - "resolved": "https://registry.npmmirror.com/tmp-promise/-/tmp-promise-3.0.3.tgz", - "integrity": "sha512-RwM7MoPojPxsOBYnyd2hy0bxtIlVrihNs9pj5SUvY8Zz1sQcQG2tG1hSr8PDxfgEB8RNKDhqbIlroIarSNDNsQ==", + "node_modules/std-env": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/std-env/-/std-env-4.3.0.tgz", + "integrity": "sha512-OtU/EgQ1kIm5KwqQpBC6ZEMXrZRui11w8zgfTWp8cdO9B8OaPsbA8bTHO2P+HNo1VlUTGMVBwPhydu6poeXiag==", "dev": true, - "dependencies": { - "tmp": "^0.2.0" - } + "license": "MIT" }, - "node_modules/topojson-client": { - "version": "3.1.0", - "resolved": "https://registry.npmmirror.com/topojson-client/-/topojson-client-3.1.0.tgz", - "integrity": "sha512-605uxS6bcYxGXw9qi62XyrV6Q3xwbndjachmNxu8HWTtVPxZfEJN9fd/SZS1Q54Sn2y0TMyMxFj/cJINqGHrKw==", + "node_modules/string_decoder": { + "version": "1.1.1", + "resolved": "https://registry.npmmirror.com/string_decoder/-/string_decoder-1.1.1.tgz", + "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", "dev": true, "dependencies": { - "commander": "2" - }, - "bin": { - "topo2geo": "bin/topo2geo", - "topomerge": "bin/topomerge", - "topoquantize": "bin/topoquantize" + "safe-buffer": "~5.1.0" } }, - "node_modules/tough-cookie": { - "version": "6.1.0", - "resolved": "https://registry.npmmirror.com/tough-cookie/-/tough-cookie-6.1.0.tgz", - "integrity": "sha512-FTxc8u8Kl2tz0Lat1u8ksvcy8bwHRyEMawwTWybo51JqaC6O7SvfuhAKg+Ld6VqyIe2QRJBzY9HA7y2WyFRT2w==", + "node_modules/string-width": { + "version": "4.2.3", + "resolved": "https://registry.npmmirror.com/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", "dev": true, "dependencies": { - "tldts": "^7.0.5" + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" }, "engines": { - "node": ">=16" + "node": ">=8" } }, - "node_modules/tr46": { - "version": "7.0.0", - "resolved": "https://registry.npmmirror.com/tr46/-/tr46-7.0.0.tgz", - "integrity": "sha512-BcDSDW+SIGWVOns1Zm6Yg91q9AEj7eaID0QDY9oIqJD1A8dscNwMcl9Sms2DeuWCNov1X0/oXanHGYQBSLwZsg==", + "node_modules/stringify-entities": { + "version": "4.0.5", + "resolved": "https://registry.npmmirror.com/stringify-entities/-/stringify-entities-4.0.5.tgz", + "integrity": "sha512-jNuI2fNNw5ecxrWmgm90R3iH0Kc/94AQwoQWoSUYphWzvmUA2pjFG34H56Z7Z3FkvH3FpYwwewKAa97oQnPFhw==", "dev": true, "dependencies": { - "punycode": "^2.3.1" + "character-entities-html4": "^2.0.0", + "character-entities-legacy": "^3.0.0" }, - "engines": { - "node": "^22.14.0 || >=24.0.0" - } - }, - "node_modules/trim-lines": { - "version": "3.0.1", - "resolved": "https://registry.npmmirror.com/trim-lines/-/trim-lines-3.0.1.tgz", - "integrity": "sha512-kRj8B+YHZCc9kQYdWfJB2/oUl9rA99qbowYYBtr4ui4mZyAQ2JpvVBd/6U2YloATfqBhBTSMhTpgBHtU0Mf3Rg==", - "dev": true, "funding": { "type": "github", "url": "https://github.com/sponsors/wooorm" } }, - "node_modules/trough": { - "version": "2.2.0", - "resolved": "https://registry.npmmirror.com/trough/-/trough-2.2.0.tgz", - "integrity": "sha512-tmMpK00BjZiUyVyvrBK7knerNgmgvcV/KLVyuma/SC+TQN167GrMRciANTz09+k3zW8L8t60jWO1GpfkZdjTaw==", + "node_modules/strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmmirror.com/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", "dev": true, - "funding": { - "type": "github", - "url": "https://github.com/sponsors/wooorm" + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" } }, - "node_modules/truncate-utf8-bytes": { - "version": "1.0.2", - "resolved": "https://registry.npmmirror.com/truncate-utf8-bytes/-/truncate-utf8-bytes-1.0.2.tgz", - "integrity": "sha512-95Pu1QXQvruGEhv62XCMO3Mm90GscOCClvrIUwCM0PYOXK3kaF3l3sIHxx71ThJfcbM2O5Au6SO3AWCSEfW4mQ==", + "node_modules/style-to-object": { + "version": "2.0.2", + "resolved": "https://registry.npmmirror.com/style-to-object/-/style-to-object-2.0.2.tgz", + "integrity": "sha512-QmbXPUylqU80HAgTOJeEOdbA40W9KtxmjMhQy+tq+b8F2aoh3aQLuy82hh2jm2qsC9hR9eI0+eQidTMydKcqRA==", "dev": true, "dependencies": { - "utf8-byte-length": "^1.0.1" + "inline-style-parser": "0.2.9" } }, - "node_modules/tslib": { - "version": "2.8.1", - "resolved": "https://registry.npmmirror.com/tslib/-/tslib-2.8.1.tgz", - "integrity": "sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==", - "dev": true - }, - "node_modules/tw-shimmer": { - "version": "0.4.14", - "resolved": "https://registry.npmmirror.com/tw-shimmer/-/tw-shimmer-0.4.14.tgz", - "integrity": "sha512-Df4Mhpxa/b/YYvwCxhe6M/C0pZ1bYxFkAUrMjgmRO2vimu+QYi1gNHxV+9ZNTMpBtLJHEq9p6zuSzC7wiPeYYA==", + "node_modules/sumchecker": { + "version": "3.0.1", + "resolved": "https://registry.npmmirror.com/sumchecker/-/sumchecker-3.0.1.tgz", + "integrity": "sha512-MvjXzkz/BOfyVDkG0oFOtBxHX2u3gKbMHIF/dXblZsgD3BWOFLmHovIpZY7BykJdAjcqRCBi1WYBNdEC9yI7vg==", "dev": true, - "peerDependencies": { - "tailwindcss": ">=4.0.0-0" + "dependencies": { + "debug": "^4.1.0" + }, + "engines": { + "node": ">= 8.0" } }, - "node_modules/typescript": { - "version": "7.0.2", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-7.0.2.tgz", - "integrity": "sha512-8FYau96o3NKOhbjKi/qNvG/W5jhzxkbdm5sj9AbZ/5T5sWqn3hJgLfGx27sRKZWTvyzCP8dLRBTf5tBTSRVUNA==", + "node_modules/supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmmirror.com/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", "dev": true, - "license": "Apache-2.0", - "bin": { - "tsc": "bin/tsc" + "dependencies": { + "has-flag": "^4.0.0" }, "engines": { - "node": ">=16.20.0" - }, - "optionalDependencies": { - "@typescript/typescript-aix-ppc64": "7.0.2", - "@typescript/typescript-darwin-arm64": "7.0.2", - "@typescript/typescript-darwin-x64": "7.0.2", - "@typescript/typescript-freebsd-arm64": "7.0.2", - "@typescript/typescript-freebsd-x64": "7.0.2", - "@typescript/typescript-linux-arm": "7.0.2", - "@typescript/typescript-linux-arm64": "7.0.2", - "@typescript/typescript-linux-loong64": "7.0.2", - "@typescript/typescript-linux-mips64el": "7.0.2", - "@typescript/typescript-linux-ppc64": "7.0.2", - "@typescript/typescript-linux-riscv64": "7.0.2", - "@typescript/typescript-linux-s390x": "7.0.2", - "@typescript/typescript-linux-x64": "7.0.2", - "@typescript/typescript-netbsd-arm64": "7.0.2", - "@typescript/typescript-netbsd-x64": "7.0.2", - "@typescript/typescript-openbsd-arm64": "7.0.2", - "@typescript/typescript-openbsd-x64": "7.0.2", - "@typescript/typescript-sunos-x64": "7.0.2", - "@typescript/typescript-win32-arm64": "7.0.2", - "@typescript/typescript-win32-x64": "7.0.2" + "node": ">=8" } }, - "node_modules/uc.micro": { - "version": "3.0.0", - "resolved": "https://registry.npmmirror.com/uc.micro/-/uc.micro-3.0.0.tgz", - "integrity": "sha512-U3PppEkleoTnIfi8BozMx3yju3qc/L6SwqWo2Sw+54PX+PX0q9I+r1Um5HCmqD7n9VDX5/v3vQH/AjA6deDdtw==", - "dev": true - }, - "node_modules/undici": { - "version": "7.30.1", - "resolved": "https://registry.npmjs.org/undici/-/undici-7.30.1.tgz", - "integrity": "sha512-03KrMbjIFDWQR5RNPrSw3bd1r12JpyFQl9/yxjUbJtqkjmllqC5lFjZh6ujeuJCKr8EOQvRW872Oy/az+nLYxg==", + "node_modules/tailwind-merge": { + "version": "3.7.1", + "resolved": "https://registry.npmmirror.com/tailwind-merge/-/tailwind-merge-3.7.1.tgz", + "integrity": "sha512-v7y4BV4FUlO8exj/4M5UXKeoowDiuugVUg3tkMNIyOUCOHy5xp8+5aWQeXCtZ2491sUV1YPsVeM9EveZ6/xuZQ==", "dev": true, - "license": "MIT", - "optional": true, - "engines": { - "node": ">=20.18.1" + "funding": { + "type": "github", + "url": "https://github.com/sponsors/dcastil" } }, - "node_modules/undici-types": { - "version": "8.9.0", - "resolved": "https://registry.npmmirror.com/undici-types/-/undici-types-8.9.0.tgz", - "integrity": "sha512-KTDyRTYX8sWmKXAikPHHSyc63CRPETMctyjKFupcC6OBLXT3xsN0e9aF7m+mIXutFWpUXuedtowG7iLOzp0kQg==", + "node_modules/tailwindcss": { + "version": "4.3.5", + "resolved": "https://registry.npmmirror.com/tailwindcss/-/tailwindcss-4.3.5.tgz", + "integrity": "sha512-FcQk9BuffmEHJP2G0XmB2SplU1aLTI7j07Kunk+U74Ny+XiWOtzXz9aujFZ/avntw1e2cOv/3PkgzflQ7gX2vQ==", "dev": true }, - "node_modules/unified": { - "version": "11.0.5", - "resolved": "https://registry.npmmirror.com/unified/-/unified-11.0.5.tgz", - "integrity": "sha512-xKvGhPWw3k84Qjh8bI3ZeJjqnyadK+GEFtazSfZv/rKeTkTjOJho6mFqh2SM96iIcZokxiOpg78GazTSg8+KHA==", + "node_modules/tapable": { + "version": "2.3.4", + "resolved": "https://registry.npmmirror.com/tapable/-/tapable-2.3.4.tgz", + "integrity": "sha512-NHFiWnAbMJxNNpBwiO7jJVGDuqMxT9/oV8v57RR+fgBQShkJil5inGD8/xWy0hjLyHQyX1tu27QANhlz3KBqCg==", "dev": true, - "dependencies": { - "@types/unist": "^3.0.0", - "bail": "^2.0.0", - "devlop": "^1.0.0", - "extend": "^3.0.0", - "is-plain-obj": "^4.0.0", - "trough": "^2.0.0", - "vfile": "^6.0.0" + "engines": { + "node": ">=6" }, "funding": { "type": "opencollective", - "url": "https://opencollective.com/unified" + "url": "https://opencollective.com/webpack" } }, - "node_modules/unist-util-is": { - "version": "6.0.1", - "resolved": "https://registry.npmmirror.com/unist-util-is/-/unist-util-is-6.0.1.tgz", - "integrity": "sha512-LsiILbtBETkDz8I9p1dQ0uyRUWuaQzd/cuEeS1hoRSyW5E5XGmTzlwY1OrNzzakGowI9Dr/I8HVaw4hTtnxy8g==", + "node_modules/tar": { + "version": "7.5.22", + "resolved": "https://registry.npmmirror.com/tar/-/tar-7.5.22.tgz", + "integrity": "sha512-MFO/QzvtAOmJbkhOaCTvbGcFN9L9b+JunIsDwaKljSOdcLMea3NJ1k9Usz/rjdfSXTq4dfzfeS7W4p4YOAAHeA==", "dev": true, "dependencies": { - "@types/unist": "^3.0.0" + "@isaacs/fs-minipass": "^4.0.0", + "chownr": "^3.0.0", + "minipass": "^7.1.2", + "minizlib": "^3.1.0", + "yallist": "^5.0.0" }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" + "engines": { + "node": ">=18" } }, - "node_modules/unist-util-position": { + "node_modules/tar/node_modules/yallist": { "version": "5.0.0", - "resolved": "https://registry.npmmirror.com/unist-util-position/-/unist-util-position-5.0.0.tgz", - "integrity": "sha512-fucsC7HjXvkB5R3kTCO7kUjRdrS0BJt3M/FPxmHMBOm8JQi2BsHAHFsy27E0EolP8rp0NzXsJ+jNPyDWvOJZPA==", + "resolved": "https://registry.npmmirror.com/yallist/-/yallist-5.0.0.tgz", + "integrity": "sha512-YgvUTfwqyc7UXVMrB+SImsVYSmTS8X/tSrtdNZMImM+n7+QTriRXyXim0mBrTXNeqzVF0KWGgHPeiyViFFrNDw==", + "dev": true, + "engines": { + "node": ">=18" + } + }, + "node_modules/temp": { + "version": "0.9.4", + "resolved": "https://registry.npmmirror.com/temp/-/temp-0.9.4.tgz", + "integrity": "sha512-yYrrsWnrXMcdsnu/7YMYAofM1ktpL5By7vZhf15CrXijWWrEYZks5AXBudalfSWJLlnen/QUJUB5aoB0kqZUGA==", "dev": true, + "peer": true, "dependencies": { - "@types/unist": "^3.0.0" + "mkdirp": "^0.5.1", + "rimraf": "~2.6.2" }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" + "engines": { + "node": ">=6.0.0" } }, - "node_modules/unist-util-stringify-position": { - "version": "4.0.0", - "resolved": "https://registry.npmmirror.com/unist-util-stringify-position/-/unist-util-stringify-position-4.0.0.tgz", - "integrity": "sha512-0ASV06AAoKCDkS2+xw5RXJywruurpbC4JZSm7nr7MOt1ojAzvyyaO+UxZf18j8FCF6kmzCZKcAgN/yu2gm2XgQ==", + "node_modules/temp-file": { + "version": "3.4.0", + "resolved": "https://registry.npmmirror.com/temp-file/-/temp-file-3.4.0.tgz", + "integrity": "sha512-C5tjlC/HCtVUOi3KWVokd4vHVViOmGjtLwIh4MuzPo/nMYTV/p1urt3RnMz2IWXDdKEGJH3k5+KPxtqRsUYGtg==", "dev": true, "dependencies": { - "@types/unist": "^3.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" + "async-exit-hook": "^2.0.1", + "fs-extra": "^10.0.0" } }, - "node_modules/unist-util-visit": { - "version": "5.2.0", - "resolved": "https://registry.npmmirror.com/unist-util-visit/-/unist-util-visit-5.2.0.tgz", - "integrity": "sha512-fpsYs/VVoZxfGY9/j3FQpZmN8wdLJaV1Pt38AaJNZu9uKIHcFU3halCdBveEq1HGKO1OEfJY65w1zvoFV1b3qQ==", + "node_modules/tiny-async-pool": { + "version": "1.3.0", + "resolved": "https://registry.npmmirror.com/tiny-async-pool/-/tiny-async-pool-1.3.0.tgz", + "integrity": "sha512-01EAw5EDrcVrdgyCLgoSPvqznC0sVxDSVeiOz09FUpjh71G79VCqneOr+xvt7T1r76CF6ZZfPjHorN2+d+3mqA==", "dev": true, "dependencies": { - "@types/unist": "^3.0.0", - "unist-util-is": "^6.0.0", - "unist-util-visit-parents": "^6.1.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" + "semver": "^5.5.0" } }, - "node_modules/unist-util-visit-parents": { - "version": "6.1.0", - "resolved": "https://registry.npmmirror.com/unist-util-visit-parents/-/unist-util-visit-parents-6.1.0.tgz", - "integrity": "sha512-vKXxz6O38sKDj1mtx/k2cWvkkFBuYGx6uGrlzBkVeWCRF/F8sdI0j3Wbkz/5rVNRRuVc8UrgRdbCxNhmYXgP3w==", + "node_modules/tiny-async-pool/node_modules/semver": { + "version": "5.7.2", + "resolved": "https://registry.npmmirror.com/semver/-/semver-5.7.2.tgz", + "integrity": "sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g==", + "dev": true, + "bin": { + "semver": "bin/semver" + } + }, + "node_modules/tinybench": { + "version": "6.2.5", + "resolved": "https://registry.npmjs.org/tinybench/-/tinybench-6.2.5.tgz", + "integrity": "sha512-b/8GRMdnY4cqkfCLyaFpTGIv1qwfi3oT0mWaepwT++6Z/ZrYehNfZZ2JDKVLKGhNoEkS3IIB1ELtCT0XS5DtOA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=20.0.0" + } + }, + "node_modules/tinyexec": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/tinyexec/-/tinyexec-1.4.0.tgz", + "integrity": "sha512-PV6lIcJQh57aFeJDwx16JNHmgFRh5xguzallrDW1qe8nAghYgr5MKz2K5k7wEyV/ygZhdnIAP8+HZSarHPBCsg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=18" + } + }, + "node_modules/tinyglobby": { + "version": "0.2.17", + "resolved": "https://registry.npmmirror.com/tinyglobby/-/tinyglobby-0.2.17.tgz", + "integrity": "sha512-wXR/dYpcqKmfWpEdZjiKJOwCNFndD0DMnrW/cYjVGttEkBfVgcLFHoNrlj47mjOVic9yyNu65alsgF4NQyTa2g==", "dev": true, "dependencies": { - "@types/unist": "^3.0.0", - "unist-util-is": "^6.0.0" + "fdir": "^6.5.0", + "picomatch": "^4.0.4" + }, + "engines": { + "node": ">=12.0.0" }, "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" + "url": "https://github.com/sponsors/SuperchupuDev" } }, - "node_modules/universalify": { - "version": "2.0.1", - "resolved": "https://registry.npmmirror.com/universalify/-/universalify-2.0.1.tgz", - "integrity": "sha512-gptHNQghINnc/vTGIk0SOFGFNXw7JVrlRUtConJRlvaw6DuX0wO5Jeko9sWrMBhh+PsYAZ7oXAiOnf/UKogyiw==", + "node_modules/tinypool": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/tinypool/-/tinypool-2.2.0.tgz", + "integrity": "sha512-jBrmx4lYmaC9k/mgPbylxs7kBUxHtD8256up+HjLaDFfXScKJQyil+SWXSvhAtT7XHo+yTVlpB81PGmHP8oLSQ==", "dev": true, + "license": "MIT", "engines": { - "node": ">= 10.0.0" + "node": "^20.0.0 || >=22.0.0" } }, - "node_modules/unzipper": { - "version": "0.12.5", - "resolved": "https://registry.npmmirror.com/unzipper/-/unzipper-0.12.5.tgz", - "integrity": "sha512-tXYOi9R57Uj/2Z25SOs5RRSzq886MBQj2gY8dPL+xl/kv6s6SvByoKfAtvfVeEuhntWDgjd2o9p2lb4TVPAz0A==", + "node_modules/tinyrainbow": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/tinyrainbow/-/tinyrainbow-3.2.0.tgz", + "integrity": "sha512-LgO3D9yZJjApUiuUfl9iFAwrtaX4+lok3wJIqttGoKCHlWUqHqbQpnxCf82L8FjgKsh4iGo78hqJwgL8F6To2A==", "dev": true, - "dependencies": { - "bluebird": "~3.7.2", - "duplexer2": "~0.1.4", - "fs-extra": "11.3.1", - "graceful-fs": "^4.2.2", - "node-int64": "^0.4.0" + "license": "MIT", + "engines": { + "node": ">=14.0.0" } }, - "node_modules/unzipper/node_modules/fs-extra": { - "version": "11.3.1", - "resolved": "https://registry.npmmirror.com/fs-extra/-/fs-extra-11.3.1.tgz", - "integrity": "sha512-eXvGGwZ5CL17ZSwHWd3bbgk7UUpF6IFHtP57NYYakPvHOs8GDgDe5KJI36jIJzDkJ6eJjuzRA8eBQb6SkKue0g==", + "node_modules/tldts": { + "version": "7.5.5", + "resolved": "https://registry.npmmirror.com/tldts/-/tldts-7.5.5.tgz", + "integrity": "sha512-Hy6IImaWALzJOgCIss4gIFi4G0M9lqk95pFKCUVxQPZw+biZ1Pv6f28JpYgahpJB+BufA0HYsIU/aP/WIx3KRg==", "dev": true, "dependencies": { - "graceful-fs": "^4.2.0", - "jsonfile": "^6.0.1", - "universalify": "^2.0.0" + "tldts-core": "^7.5.5" }, + "bin": { + "tldts": "bin/cli.js" + } + }, + "node_modules/tldts-core": { + "version": "7.5.5", + "resolved": "https://registry.npmmirror.com/tldts-core/-/tldts-core-7.5.5.tgz", + "integrity": "sha512-rEJz/8cJFY/bdF354gl14yxavbrIbvM+FcbkYVQ6CSCMQTJdUFUIm39TTWSiGPvcpQh7/F6qHrD3SkwwdgtDCw==", + "dev": true + }, + "node_modules/tmp": { + "version": "0.2.7", + "resolved": "https://registry.npmmirror.com/tmp/-/tmp-0.2.7.tgz", + "integrity": "sha512-e0votIpp4Uo2AJYSzVHV6xCcawuiez3DzqDAbrTc3YxBkplN6e+dM13ZeIcZnDg/QpSuU2zfZ3rzwY8ukEnaXw==", + "dev": true, "engines": { "node": ">=14.14" } }, - "node_modules/update-browserslist-db": { - "version": "1.3.3", - "resolved": "https://registry.npmmirror.com/update-browserslist-db/-/update-browserslist-db-1.3.3.tgz", - "integrity": "sha512-pJ2sYawQS0R/WI928Gj5GlPhTGzbMelq0+4INtSYNDV9ErKJcX6xjGWkoG/VnB3dpUm00zALaqkrUD77pO5TDQ==", + "node_modules/tmp-promise": { + "version": "3.0.3", + "resolved": "https://registry.npmmirror.com/tmp-promise/-/tmp-promise-3.0.3.tgz", + "integrity": "sha512-RwM7MoPojPxsOBYnyd2hy0bxtIlVrihNs9pj5SUvY8Zz1sQcQG2tG1hSr8PDxfgEB8RNKDhqbIlroIarSNDNsQ==", "dev": true, - "funding": [ - { - "type": "opencollective", - "url": "https://opencollective.com/browserslist" - }, - { - "type": "tidelift", - "url": "https://tidelift.com/funding/github/npm/browserslist" - }, - { - "type": "github", - "url": "https://github.com/sponsors/ai" - } - ], "dependencies": { - "escalade": "^3.2.0", - "picocolors": "^1.1.1" + "tmp": "^0.2.0" + } + }, + "node_modules/topojson-client": { + "version": "3.1.0", + "resolved": "https://registry.npmmirror.com/topojson-client/-/topojson-client-3.1.0.tgz", + "integrity": "sha512-605uxS6bcYxGXw9qi62XyrV6Q3xwbndjachmNxu8HWTtVPxZfEJN9fd/SZS1Q54Sn2y0TMyMxFj/cJINqGHrKw==", + "dev": true, + "dependencies": { + "commander": "2" }, "bin": { - "update-browserslist-db": "cli.js" - }, - "peerDependencies": { - "browserslist": ">= 4.21.0" + "topo2geo": "bin/topo2geo", + "topomerge": "bin/topomerge", + "topoquantize": "bin/topoquantize" } }, - "node_modules/urijs": { - "version": "1.19.11", - "resolved": "https://registry.npmmirror.com/urijs/-/urijs-1.19.11.tgz", - "integrity": "sha512-HXgFDgDommxn5/bIv0cnQZsPhHDA90NPHD6+c/v21U5+Sx5hoP8+dP9IZXBU1gIfvdRfhG8cel9QNPeionfcCQ==", - "dev": true + "node_modules/totalist": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/totalist/-/totalist-3.0.1.tgz", + "integrity": "sha512-sf4i37nQ2LBx4m3wB74y+ubopq6W/dIzXg0FDGjsYnZHVa1Da8FH853wlL2gtUhg+xJXjfk3kUZS3BRoQeoQBQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } }, - "node_modules/use-callback-ref": { - "version": "1.3.3", - "resolved": "https://registry.npmmirror.com/use-callback-ref/-/use-callback-ref-1.3.3.tgz", - "integrity": "sha512-jQL3lRnocaFtu3V00JToYz/4QkNWswxijDaCVNZRiRTO3HQDLsdu1ZtmIUvV4yPp+rvWm5j0y0TG/S61cuijTg==", + "node_modules/tough-cookie": { + "version": "6.1.0", + "resolved": "https://registry.npmmirror.com/tough-cookie/-/tough-cookie-6.1.0.tgz", + "integrity": "sha512-FTxc8u8Kl2tz0Lat1u8ksvcy8bwHRyEMawwTWybo51JqaC6O7SvfuhAKg+Ld6VqyIe2QRJBzY9HA7y2WyFRT2w==", "dev": true, "dependencies": { - "tslib": "^2.0.0" + "tldts": "^7.0.5" }, "engines": { - "node": ">=10" - }, - "peerDependencies": { - "@types/react": "*", - "react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0 || ^19.0.0-rc" + "node": ">=16" + } + }, + "node_modules/tr46": { + "version": "7.0.0", + "resolved": "https://registry.npmmirror.com/tr46/-/tr46-7.0.0.tgz", + "integrity": "sha512-BcDSDW+SIGWVOns1Zm6Yg91q9AEj7eaID0QDY9oIqJD1A8dscNwMcl9Sms2DeuWCNov1X0/oXanHGYQBSLwZsg==", + "dev": true, + "dependencies": { + "punycode": "^2.3.1" }, - "peerDependenciesMeta": { - "@types/react": { - "optional": true - } + "engines": { + "node": "^22.14.0 || >=24.0.0" } }, - "node_modules/use-composed-ref": { - "version": "1.4.0", - "resolved": "https://registry.npmmirror.com/use-composed-ref/-/use-composed-ref-1.4.0.tgz", - "integrity": "sha512-djviaxuOOh7wkj0paeO1Q/4wMZ8Zrnag5H6yBvzN7AKKe8beOaED9SF5/ByLqsku8NP4zQqsvM2u3ew/tJK8/w==", + "node_modules/trim-lines": { + "version": "3.0.1", + "resolved": "https://registry.npmmirror.com/trim-lines/-/trim-lines-3.0.1.tgz", + "integrity": "sha512-kRj8B+YHZCc9kQYdWfJB2/oUl9rA99qbowYYBtr4ui4mZyAQ2JpvVBd/6U2YloATfqBhBTSMhTpgBHtU0Mf3Rg==", "dev": true, - "peerDependencies": { - "react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0" - }, - "peerDependenciesMeta": { - "@types/react": { - "optional": true - } + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" } }, - "node_modules/use-isomorphic-layout-effect": { - "version": "1.2.1", - "resolved": "https://registry.npmmirror.com/use-isomorphic-layout-effect/-/use-isomorphic-layout-effect-1.2.1.tgz", - "integrity": "sha512-tpZZ+EX0gaghDAiFR37hj5MgY6ZN55kLiPkJsKxBMZ6GZdOSPJXiOzPM984oPYZ5AnehYx5WQp1+ME8I/P/pRA==", + "node_modules/trough": { + "version": "2.2.0", + "resolved": "https://registry.npmmirror.com/trough/-/trough-2.2.0.tgz", + "integrity": "sha512-tmMpK00BjZiUyVyvrBK7knerNgmgvcV/KLVyuma/SC+TQN167GrMRciANTz09+k3zW8L8t60jWO1GpfkZdjTaw==", "dev": true, - "peerDependencies": { - "react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0" - }, - "peerDependenciesMeta": { - "@types/react": { - "optional": true - } + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" } }, - "node_modules/use-latest": { - "version": "1.3.0", - "resolved": "https://registry.npmmirror.com/use-latest/-/use-latest-1.3.0.tgz", - "integrity": "sha512-mhg3xdm9NaM8q+gLT8KryJPnRFOz1/5XPBhmDEVZK1webPzDjrPk7f/mbpeLqTgB9msytYWANxgALOCJKnLvcQ==", + "node_modules/truncate-utf8-bytes": { + "version": "1.0.2", + "resolved": "https://registry.npmmirror.com/truncate-utf8-bytes/-/truncate-utf8-bytes-1.0.2.tgz", + "integrity": "sha512-95Pu1QXQvruGEhv62XCMO3Mm90GscOCClvrIUwCM0PYOXK3kaF3l3sIHxx71ThJfcbM2O5Au6SO3AWCSEfW4mQ==", "dev": true, "dependencies": { - "use-isomorphic-layout-effect": "^1.1.1" - }, - "peerDependencies": { - "react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0" - }, - "peerDependenciesMeta": { - "@types/react": { - "optional": true - } + "utf8-byte-length": "^1.0.1" } }, - "node_modules/use-sidecar": { - "version": "1.1.3", - "resolved": "https://registry.npmmirror.com/use-sidecar/-/use-sidecar-1.1.3.tgz", - "integrity": "sha512-Fedw0aZvkhynoPYlA5WXrMCAMm+nSWdZt6lzJQ7Ok8S6Q+VsHmHpRWndVRJ8Be0ZbkfPc5LRYH+5XrzXcEeLRQ==", + "node_modules/tslib": { + "version": "2.8.1", + "resolved": "https://registry.npmmirror.com/tslib/-/tslib-2.8.1.tgz", + "integrity": "sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==", + "dev": true + }, + "node_modules/tsrs": { + "version": "7.1.0-beta.tsrs2", + "resolved": "https://registry.npmjs.org/tsrs/-/tsrs-7.1.0-beta.tsrs2.tgz", + "integrity": "sha512-T6O1mYbPe7B5ZSudwqJcn7hfn66w3wXsCd+GpXyDPsRmei71W6WAidlj+QWaYgmfpbmMqzcryKcg5aVg8DOSXw==", "dev": true, - "dependencies": { - "detect-node-es": "^1.1.0", - "tslib": "^2.0.0" + "license": "Apache-2.0", + "bin": { + "tsrs": "bin/tsrs", + "tsrs-lint": "bin/tsrs-lint" }, "engines": { - "node": ">=10" - }, - "peerDependencies": { - "@types/react": "*", - "react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0 || ^19.0.0-rc" + "node": ">=16.20.0" }, - "peerDependenciesMeta": { - "@types/react": { - "optional": true - } + "optionalDependencies": { + "@tsrs/darwin-arm64": "7.1.0-beta.tsrs2", + "@tsrs/darwin-x64": "7.1.0-beta.tsrs2", + "@tsrs/linux-arm64-gnu": "7.1.0-beta.tsrs2", + "@tsrs/linux-arm64-musl": "7.1.0-beta.tsrs2", + "@tsrs/linux-x64-gnu": "7.1.0-beta.tsrs2", + "@tsrs/linux-x64-musl": "7.1.0-beta.tsrs2", + "@tsrs/win32-arm64": "7.1.0-beta.tsrs2", + "@tsrs/win32-x64": "7.1.0-beta.tsrs2" } }, - "node_modules/use-sync-external-store": { - "version": "1.7.0", - "resolved": "https://registry.npmmirror.com/use-sync-external-store/-/use-sync-external-store-1.7.0.tgz", - "integrity": "sha512-6L+EeigHMQhdaIPNIFUKwfWJSwWFQ8gJbJ2DLOs5sDIegTwR9fRxvnM3uciHKjIZhFz+KAv2emhWMRvDmMcY8A==", + "node_modules/tw-shimmer": { + "version": "0.4.14", + "resolved": "https://registry.npmmirror.com/tw-shimmer/-/tw-shimmer-0.4.14.tgz", + "integrity": "sha512-Df4Mhpxa/b/YYvwCxhe6M/C0pZ1bYxFkAUrMjgmRO2vimu+QYi1gNHxV+9ZNTMpBtLJHEq9p6zuSzC7wiPeYYA==", "dev": true, "peerDependencies": { - "react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0" + "tailwindcss": ">=4.0.0-0" } }, - "node_modules/utf8-byte-length": { - "version": "1.0.5", - "resolved": "https://registry.npmmirror.com/utf8-byte-length/-/utf8-byte-length-1.0.5.tgz", - "integrity": "sha512-Xn0w3MtiQ6zoz2vFyUVruaCL53O/DwUvkEeOvj+uulMm0BkUGYWmBYVyElqZaSLhY6ZD0ulfU3aBra2aVT4xfA==", + "node_modules/typescript": { + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-7.0.2.tgz", + "integrity": "sha512-8FYau96o3NKOhbjKi/qNvG/W5jhzxkbdm5sj9AbZ/5T5sWqn3hJgLfGx27sRKZWTvyzCP8dLRBTf5tBTSRVUNA==", + "dev": true, + "license": "Apache-2.0", + "bin": { + "tsc": "bin/tsc" + }, + "engines": { + "node": ">=16.20.0" + }, + "optionalDependencies": { + "@typescript/typescript-aix-ppc64": "7.0.2", + "@typescript/typescript-darwin-arm64": "7.0.2", + "@typescript/typescript-darwin-x64": "7.0.2", + "@typescript/typescript-freebsd-arm64": "7.0.2", + "@typescript/typescript-freebsd-x64": "7.0.2", + "@typescript/typescript-linux-arm": "7.0.2", + "@typescript/typescript-linux-arm64": "7.0.2", + "@typescript/typescript-linux-loong64": "7.0.2", + "@typescript/typescript-linux-mips64el": "7.0.2", + "@typescript/typescript-linux-ppc64": "7.0.2", + "@typescript/typescript-linux-riscv64": "7.0.2", + "@typescript/typescript-linux-s390x": "7.0.2", + "@typescript/typescript-linux-x64": "7.0.2", + "@typescript/typescript-netbsd-arm64": "7.0.2", + "@typescript/typescript-netbsd-x64": "7.0.2", + "@typescript/typescript-openbsd-arm64": "7.0.2", + "@typescript/typescript-openbsd-x64": "7.0.2", + "@typescript/typescript-sunos-x64": "7.0.2", + "@typescript/typescript-win32-arm64": "7.0.2", + "@typescript/typescript-win32-x64": "7.0.2" + } + }, + "node_modules/uc.micro": { + "version": "3.0.0", + "resolved": "https://registry.npmmirror.com/uc.micro/-/uc.micro-3.0.0.tgz", + "integrity": "sha512-U3PppEkleoTnIfi8BozMx3yju3qc/L6SwqWo2Sw+54PX+PX0q9I+r1Um5HCmqD7n9VDX5/v3vQH/AjA6deDdtw==", "dev": true }, - "node_modules/util-deprecate": { - "version": "1.0.2", - "resolved": "https://registry.npmmirror.com/util-deprecate/-/util-deprecate-1.0.2.tgz", - "integrity": "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==", + "node_modules/undici": { + "version": "7.30.1", + "resolved": "https://registry.npmjs.org/undici/-/undici-7.30.1.tgz", + "integrity": "sha512-03KrMbjIFDWQR5RNPrSw3bd1r12JpyFQl9/yxjUbJtqkjmllqC5lFjZh6ujeuJCKr8EOQvRW872Oy/az+nLYxg==", + "dev": true, + "license": "MIT", + "optional": true, + "engines": { + "node": ">=20.18.1" + } + }, + "node_modules/undici-types": { + "version": "8.9.0", + "resolved": "https://registry.npmmirror.com/undici-types/-/undici-types-8.9.0.tgz", + "integrity": "sha512-KTDyRTYX8sWmKXAikPHHSyc63CRPETMctyjKFupcC6OBLXT3xsN0e9aF7m+mIXutFWpUXuedtowG7iLOzp0kQg==", "dev": true }, - "node_modules/vfile": { - "version": "6.0.3", - "resolved": "https://registry.npmmirror.com/vfile/-/vfile-6.0.3.tgz", - "integrity": "sha512-KzIbH/9tXat2u30jf+smMwFCsno4wHVdNmzFyL+T/L3UGqqk6JKfVqOFOZEpZSHADH1k40ab6NUIXZq422ov3Q==", + "node_modules/unified": { + "version": "11.0.5", + "resolved": "https://registry.npmmirror.com/unified/-/unified-11.0.5.tgz", + "integrity": "sha512-xKvGhPWw3k84Qjh8bI3ZeJjqnyadK+GEFtazSfZv/rKeTkTjOJho6mFqh2SM96iIcZokxiOpg78GazTSg8+KHA==", "dev": true, "dependencies": { "@types/unist": "^3.0.0", - "vfile-message": "^4.0.0" + "bail": "^2.0.0", + "devlop": "^1.0.0", + "extend": "^3.0.0", + "is-plain-obj": "^4.0.0", + "trough": "^2.0.0", + "vfile": "^6.0.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/unified" } }, - "node_modules/vfile-message": { - "version": "4.0.4", - "resolved": "https://registry.npmmirror.com/vfile-message/-/vfile-message-4.0.4.tgz", - "integrity": "sha512-66ycRswIkNmHH9PHku7ADtv5RVwgIrOcuv3J8Svz6h4qgGRrKVa+9/neuKyJZUXyOpYwLTvS+whZ4R2urHHgQg==", + "node_modules/unist-util-is": { + "version": "6.0.1", + "resolved": "https://registry.npmmirror.com/unist-util-is/-/unist-util-is-6.0.1.tgz", + "integrity": "sha512-LsiILbtBETkDz8I9p1dQ0uyRUWuaQzd/cuEeS1hoRSyW5E5XGmTzlwY1OrNzzakGowI9Dr/I8HVaw4hTtnxy8g==", "dev": true, "dependencies": { - "@types/unist": "^3.0.0", - "unist-util-stringify-position": "^4.0.0" + "@types/unist": "^3.0.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/unified" } }, - "node_modules/vite": { - "version": "8.4.0", - "resolved": "https://registry.npmjs.org/vite/-/vite-8.4.0.tgz", - "integrity": "sha512-X2nUJg+9cutlz3hzqyO6p+WTwk9H257DjwAEf9EQYUFrQbDItmetadi9gYmb+l7VDy4r3VXLUnmLTwuPmzejDw==", + "node_modules/unist-util-position": { + "version": "5.0.0", + "resolved": "https://registry.npmmirror.com/unist-util-position/-/unist-util-position-5.0.0.tgz", + "integrity": "sha512-fucsC7HjXvkB5R3kTCO7kUjRdrS0BJt3M/FPxmHMBOm8JQi2BsHAHFsy27E0EolP8rp0NzXsJ+jNPyDWvOJZPA==", "dev": true, - "license": "MIT", "dependencies": { - "lightningcss": "^1.33.0", - "picomatch": "^4.0.7", - "postcss": "^8.5.33", - "rolldown": "~1.3.2", - "tinyglobby": "^0.2.17" - }, - "bin": { - "vite": "bin/vite.js" - }, - "engines": { - "node": "^20.19.0 || >=22.12.0" - }, - "funding": { - "url": "https://github.com/vitejs/vite?sponsor=1" - }, - "optionalDependencies": { - "fsevents": "~2.3.3", - "napi-windows-process-start-time": "^0.1.0" - }, - "peerDependencies": { - "@types/node": "^20.19.0 || >=22.12.0", - "@vitejs/devtools": "^0.7.1 || ^0.8.0", - "esbuild": "^0.27.0 || ^0.28.0", - "jiti": ">=1.21.0", - "less": "^4.0.0", - "sass": "^1.70.0", - "sass-embedded": "^1.70.0", - "stylus": ">=0.54.8", - "sugarss": "^5.0.0", - "terser": "^5.16.0", - "tsx": "^4.8.1", - "yaml": "^2.4.2" - }, - "peerDependenciesMeta": { - "@types/node": { - "optional": true - }, - "@vitejs/devtools": { - "optional": true - }, - "esbuild": { - "optional": true - }, - "jiti": { - "optional": true - }, - "less": { - "optional": true - }, - "sass": { - "optional": true - }, - "sass-embedded": { - "optional": true - }, - "stylus": { - "optional": true - }, - "sugarss": { - "optional": true - }, - "terser": { - "optional": true - }, - "tsx": { - "optional": true - }, - "yaml": { - "optional": true - } + "@types/unist": "^3.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" } }, - "node_modules/vite/node_modules/@oxc-project/types": { - "version": "0.160.0", - "resolved": "https://registry.npmjs.org/@oxc-project/types/-/types-0.160.0.tgz", - "integrity": "sha512-gw4k9syEmnckbOgw2A2FU1TBDdX9hfwV9jEn/uio65pguPzwWiXQS3OIJDMEhv9m06tj9XiEe6RoD0YA+LgreA==", + "node_modules/unist-util-stringify-position": { + "version": "4.0.0", + "resolved": "https://registry.npmmirror.com/unist-util-stringify-position/-/unist-util-stringify-position-4.0.0.tgz", + "integrity": "sha512-0ASV06AAoKCDkS2+xw5RXJywruurpbC4JZSm7nr7MOt1ojAzvyyaO+UxZf18j8FCF6kmzCZKcAgN/yu2gm2XgQ==", "dev": true, - "license": "MIT", + "dependencies": { + "@types/unist": "^3.0.0" + }, "funding": { - "url": "https://github.com/sponsors/oxc-project" + "type": "opencollective", + "url": "https://opencollective.com/unified" } }, - "node_modules/vite/node_modules/@rolldown/binding-android-arm-eabi": { - "version": "1.3.4", - "resolved": "https://registry.npmjs.org/@rolldown/binding-android-arm-eabi/-/binding-android-arm-eabi-1.3.4.tgz", - "integrity": "sha512-xCW8CkL/ualx/SbYqeG9iK87lJCZGDQ0soE+kaORJ0Bd+pHALyE4qK7BStmEAyYWLEzZ3/biSIpA6/7GDFvzIg==", - "cpu": [ - "arm" - ], + "node_modules/unist-util-visit": { + "version": "5.2.0", + "resolved": "https://registry.npmmirror.com/unist-util-visit/-/unist-util-visit-5.2.0.tgz", + "integrity": "sha512-fpsYs/VVoZxfGY9/j3FQpZmN8wdLJaV1Pt38AaJNZu9uKIHcFU3halCdBveEq1HGKO1OEfJY65w1zvoFV1b3qQ==", "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "android" - ], - "engines": { - "node": "^20.19.0 || >=22.12.0" + "dependencies": { + "@types/unist": "^3.0.0", + "unist-util-is": "^6.0.0", + "unist-util-visit-parents": "^6.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" } }, - "node_modules/vite/node_modules/@rolldown/binding-android-arm64": { - "version": "1.3.4", - "resolved": "https://registry.npmjs.org/@rolldown/binding-android-arm64/-/binding-android-arm64-1.3.4.tgz", - "integrity": "sha512-5lifIO+b/prcM9sx/bkPN4w6UEToEfQ3gjhx0+0neuL+dkYskI792CfAq03T51jc8JFcaYXs2hi3l8RjiH/VWQ==", - "cpu": [ - "arm64" - ], + "node_modules/unist-util-visit-parents": { + "version": "6.1.0", + "resolved": "https://registry.npmmirror.com/unist-util-visit-parents/-/unist-util-visit-parents-6.1.0.tgz", + "integrity": "sha512-vKXxz6O38sKDj1mtx/k2cWvkkFBuYGx6uGrlzBkVeWCRF/F8sdI0j3Wbkz/5rVNRRuVc8UrgRdbCxNhmYXgP3w==", "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "android" - ], - "engines": { - "node": "^20.19.0 || >=22.12.0" + "dependencies": { + "@types/unist": "^3.0.0", + "unist-util-is": "^6.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" } }, - "node_modules/vite/node_modules/@rolldown/binding-darwin-arm64": { - "version": "1.3.4", - "resolved": "https://registry.npmjs.org/@rolldown/binding-darwin-arm64/-/binding-darwin-arm64-1.3.4.tgz", - "integrity": "sha512-RCgxTI4AJQxhVF//BI3ImQOsXTHrF4Eg+f99jBy8WoETA2kSEGFxpnrVmW0leQq/2aBR4R5AC6csmy3rc66e3Q==", - "cpu": [ - "arm64" - ], + "node_modules/universalify": { + "version": "2.0.1", + "resolved": "https://registry.npmmirror.com/universalify/-/universalify-2.0.1.tgz", + "integrity": "sha512-gptHNQghINnc/vTGIk0SOFGFNXw7JVrlRUtConJRlvaw6DuX0wO5Jeko9sWrMBhh+PsYAZ7oXAiOnf/UKogyiw==", "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "darwin" - ], "engines": { - "node": "^20.19.0 || >=22.12.0" + "node": ">= 10.0.0" } }, - "node_modules/vite/node_modules/@rolldown/binding-darwin-x64": { - "version": "1.3.4", - "resolved": "https://registry.npmjs.org/@rolldown/binding-darwin-x64/-/binding-darwin-x64-1.3.4.tgz", - "integrity": "sha512-zNPJVVPUaDEj+L0lImoK3rFv2b+Z5gNijI6DWu/fcD3/1TfmRXKb9ZyxbSN+2AhlctqjbNzUvCsMa+EBhnEM4Q==", - "cpu": [ - "x64" - ], + "node_modules/unzipper": { + "version": "0.12.5", + "resolved": "https://registry.npmmirror.com/unzipper/-/unzipper-0.12.5.tgz", + "integrity": "sha512-tXYOi9R57Uj/2Z25SOs5RRSzq886MBQj2gY8dPL+xl/kv6s6SvByoKfAtvfVeEuhntWDgjd2o9p2lb4TVPAz0A==", "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "darwin" - ], - "engines": { - "node": "^20.19.0 || >=22.12.0" + "dependencies": { + "bluebird": "~3.7.2", + "duplexer2": "~0.1.4", + "fs-extra": "11.3.1", + "graceful-fs": "^4.2.2", + "node-int64": "^0.4.0" } }, - "node_modules/vite/node_modules/@rolldown/binding-freebsd-x64": { - "version": "1.3.4", - "resolved": "https://registry.npmjs.org/@rolldown/binding-freebsd-x64/-/binding-freebsd-x64-1.3.4.tgz", - "integrity": "sha512-upP6g7ZIRy5by1RDQ/EphHIdJ5xK0eUD7sUgfZFWJ49s4XdbYsIvIlAPtrFpayR70Hhf9J22lb4Pm8/9FhrZmg==", - "cpu": [ - "x64" - ], + "node_modules/unzipper/node_modules/fs-extra": { + "version": "11.3.1", + "resolved": "https://registry.npmmirror.com/fs-extra/-/fs-extra-11.3.1.tgz", + "integrity": "sha512-eXvGGwZ5CL17ZSwHWd3bbgk7UUpF6IFHtP57NYYakPvHOs8GDgDe5KJI36jIJzDkJ6eJjuzRA8eBQb6SkKue0g==", "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "freebsd" - ], + "dependencies": { + "graceful-fs": "^4.2.0", + "jsonfile": "^6.0.1", + "universalify": "^2.0.0" + }, "engines": { - "node": "^20.19.0 || >=22.12.0" + "node": ">=14.14" } }, - "node_modules/vite/node_modules/@rolldown/binding-linux-arm-gnueabihf": { - "version": "1.3.4", - "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-arm-gnueabihf/-/binding-linux-arm-gnueabihf-1.3.4.tgz", - "integrity": "sha512-SAX5C5+poMLCxu8dkPF6h5yst40rkzs+9Y3cbPn2OFSydmHjAEprrGi64zGgnYyPIVZfdGUFqJ2fJbfbnHI+mA==", - "cpu": [ - "arm" - ], + "node_modules/update-browserslist-db": { + "version": "1.3.3", + "resolved": "https://registry.npmmirror.com/update-browserslist-db/-/update-browserslist-db-1.3.3.tgz", + "integrity": "sha512-pJ2sYawQS0R/WI928Gj5GlPhTGzbMelq0+4INtSYNDV9ErKJcX6xjGWkoG/VnB3dpUm00zALaqkrUD77pO5TDQ==", "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "linux" + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/browserslist" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/browserslist" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } ], - "engines": { - "node": "^20.19.0 || >=22.12.0" + "dependencies": { + "escalade": "^3.2.0", + "picocolors": "^1.1.1" + }, + "bin": { + "update-browserslist-db": "cli.js" + }, + "peerDependencies": { + "browserslist": ">= 4.21.0" } }, - "node_modules/vite/node_modules/@rolldown/binding-linux-arm64-gnu": { - "version": "1.3.4", - "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-arm64-gnu/-/binding-linux-arm64-gnu-1.3.4.tgz", - "integrity": "sha512-nwHqdlRZS6GWBef3dG5/pMY6RNTBBUjj7s0Da+m6xsFpe7jx6IC46SLZcCu8f46JOfCovZmwnrz51EzGE+7Fyw==", - "cpu": [ - "arm64" - ], + "node_modules/urijs": { + "version": "1.19.11", + "resolved": "https://registry.npmmirror.com/urijs/-/urijs-1.19.11.tgz", + "integrity": "sha512-HXgFDgDommxn5/bIv0cnQZsPhHDA90NPHD6+c/v21U5+Sx5hoP8+dP9IZXBU1gIfvdRfhG8cel9QNPeionfcCQ==", + "dev": true + }, + "node_modules/use-callback-ref": { + "version": "1.3.3", + "resolved": "https://registry.npmmirror.com/use-callback-ref/-/use-callback-ref-1.3.3.tgz", + "integrity": "sha512-jQL3lRnocaFtu3V00JToYz/4QkNWswxijDaCVNZRiRTO3HQDLsdu1ZtmIUvV4yPp+rvWm5j0y0TG/S61cuijTg==", "dev": true, - "libc": [ - "glibc" - ], - "license": "MIT", - "optional": true, - "os": [ - "linux" - ], + "dependencies": { + "tslib": "^2.0.0" + }, "engines": { - "node": "^20.19.0 || >=22.12.0" + "node": ">=10" + }, + "peerDependencies": { + "@types/react": "*", + "react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0 || ^19.0.0-rc" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + } } }, - "node_modules/vite/node_modules/@rolldown/binding-linux-arm64-musl": { - "version": "1.3.4", - "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-arm64-musl/-/binding-linux-arm64-musl-1.3.4.tgz", - "integrity": "sha512-Gr78X2ur/AgLCkmZgHffk/FerIX8S5zb/eII4bCcvJo0ANzeXhTShahdNbpnY6bpiszIAgIfiuKS9ziziWsamw==", - "cpu": [ - "arm64" - ], + "node_modules/use-composed-ref": { + "version": "1.4.0", + "resolved": "https://registry.npmmirror.com/use-composed-ref/-/use-composed-ref-1.4.0.tgz", + "integrity": "sha512-djviaxuOOh7wkj0paeO1Q/4wMZ8Zrnag5H6yBvzN7AKKe8beOaED9SF5/ByLqsku8NP4zQqsvM2u3ew/tJK8/w==", "dev": true, - "libc": [ - "musl" - ], - "license": "MIT", - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": "^20.19.0 || >=22.12.0" + "peerDependencies": { + "react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + } } }, - "node_modules/vite/node_modules/@rolldown/binding-linux-ppc64-gnu": { - "version": "1.3.4", - "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-ppc64-gnu/-/binding-linux-ppc64-gnu-1.3.4.tgz", - "integrity": "sha512-o9Wcn8nWrsQasaBRYM4d//FwhlBsTJYWkPVlhlt6FwzpwEoovY4IopRZjk5Fq3+ntRuSDORJjF/nA8sFeF2q6w==", - "cpu": [ - "ppc64" - ], + "node_modules/use-isomorphic-layout-effect": { + "version": "1.2.1", + "resolved": "https://registry.npmmirror.com/use-isomorphic-layout-effect/-/use-isomorphic-layout-effect-1.2.1.tgz", + "integrity": "sha512-tpZZ+EX0gaghDAiFR37hj5MgY6ZN55kLiPkJsKxBMZ6GZdOSPJXiOzPM984oPYZ5AnehYx5WQp1+ME8I/P/pRA==", "dev": true, - "libc": [ - "glibc" - ], - "license": "MIT", - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": "^20.19.0 || >=22.12.0" + "peerDependencies": { + "react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + } } }, - "node_modules/vite/node_modules/@rolldown/binding-linux-s390x-gnu": { - "version": "1.3.4", - "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-s390x-gnu/-/binding-linux-s390x-gnu-1.3.4.tgz", - "integrity": "sha512-UDWu4jkVcx2kiBKm3Ec//4lVCbeTWj8gmJ9SyLWCdLWtTlyq7fQVeVV/14nXvRtSLErvJ2+yA/Ux5taS31Y17Q==", - "cpu": [ - "s390x" - ], + "node_modules/use-latest": { + "version": "1.3.0", + "resolved": "https://registry.npmmirror.com/use-latest/-/use-latest-1.3.0.tgz", + "integrity": "sha512-mhg3xdm9NaM8q+gLT8KryJPnRFOz1/5XPBhmDEVZK1webPzDjrPk7f/mbpeLqTgB9msytYWANxgALOCJKnLvcQ==", "dev": true, - "libc": [ - "glibc" - ], - "license": "MIT", - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": "^20.19.0 || >=22.12.0" + "dependencies": { + "use-isomorphic-layout-effect": "^1.1.1" + }, + "peerDependencies": { + "react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + } } }, - "node_modules/vite/node_modules/@rolldown/binding-linux-x64-gnu": { - "version": "1.3.4", - "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-x64-gnu/-/binding-linux-x64-gnu-1.3.4.tgz", - "integrity": "sha512-W9mGtTa0w4fWh8RLMNPyaEhhcuqUfO07Q4I1bBc4PDMNg7gQSw0yPQNQ3D0qwbkXwxbyL4YrIzc8n6k1vuFExQ==", - "cpu": [ - "x64" - ], + "node_modules/use-sidecar": { + "version": "1.1.3", + "resolved": "https://registry.npmmirror.com/use-sidecar/-/use-sidecar-1.1.3.tgz", + "integrity": "sha512-Fedw0aZvkhynoPYlA5WXrMCAMm+nSWdZt6lzJQ7Ok8S6Q+VsHmHpRWndVRJ8Be0ZbkfPc5LRYH+5XrzXcEeLRQ==", "dev": true, - "libc": [ - "glibc" - ], - "license": "MIT", - "optional": true, - "os": [ - "linux" - ], + "dependencies": { + "detect-node-es": "^1.1.0", + "tslib": "^2.0.0" + }, "engines": { - "node": "^20.19.0 || >=22.12.0" + "node": ">=10" + }, + "peerDependencies": { + "@types/react": "*", + "react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0 || ^19.0.0-rc" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + } } }, - "node_modules/vite/node_modules/@rolldown/binding-linux-x64-musl": { - "version": "1.3.4", - "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-x64-musl/-/binding-linux-x64-musl-1.3.4.tgz", - "integrity": "sha512-8B+ofyQZ7/aCmkqnyMonPr5zKLqMVNczhRGFNtdIuItiwNn8iQWJawMq2E58r7bxD1XEbtRRsULY/eCWwZQ01Q==", - "cpu": [ - "x64" - ], + "node_modules/use-sync-external-store": { + "version": "1.7.0", + "resolved": "https://registry.npmmirror.com/use-sync-external-store/-/use-sync-external-store-1.7.0.tgz", + "integrity": "sha512-6L+EeigHMQhdaIPNIFUKwfWJSwWFQ8gJbJ2DLOs5sDIegTwR9fRxvnM3uciHKjIZhFz+KAv2emhWMRvDmMcY8A==", "dev": true, - "libc": [ - "musl" - ], - "license": "MIT", - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": "^20.19.0 || >=22.12.0" + "peerDependencies": { + "react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0" } }, - "node_modules/vite/node_modules/@rolldown/binding-openharmony-arm64": { - "version": "1.3.4", - "resolved": "https://registry.npmjs.org/@rolldown/binding-openharmony-arm64/-/binding-openharmony-arm64-1.3.4.tgz", - "integrity": "sha512-TlD0FSZaC7o2B4NCe9V5N11ugTnhzTM9ksj4sgRLvrKosDzjEkvlsTX3ehkw4ZlPv8AADimZZTvJGEa16pfXug==", - "cpu": [ - "arm64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "openharmony" - ], - "engines": { - "node": "^20.19.0 || >=22.12.0" - } + "node_modules/utf8-byte-length": { + "version": "1.0.5", + "resolved": "https://registry.npmmirror.com/utf8-byte-length/-/utf8-byte-length-1.0.5.tgz", + "integrity": "sha512-Xn0w3MtiQ6zoz2vFyUVruaCL53O/DwUvkEeOvj+uulMm0BkUGYWmBYVyElqZaSLhY6ZD0ulfU3aBra2aVT4xfA==", + "dev": true }, - "node_modules/vite/node_modules/@rolldown/binding-wasm32-wasi": { - "version": "1.3.4", - "resolved": "https://registry.npmjs.org/@rolldown/binding-wasm32-wasi/-/binding-wasm32-wasi-1.3.4.tgz", - "integrity": "sha512-jwO8P3o53ygo7b5061B7BeaJ1BGv3BKZ6jroFdw/01qWry7Z+qNBlDvulzbTle5s/A0Fc1FRgsTxrke9DvsSbA==", - "cpu": [ - "wasm32" - ], + "node_modules/util-deprecate": { + "version": "1.0.2", + "resolved": "https://registry.npmmirror.com/util-deprecate/-/util-deprecate-1.0.2.tgz", + "integrity": "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==", + "dev": true + }, + "node_modules/vfile": { + "version": "6.0.3", + "resolved": "https://registry.npmmirror.com/vfile/-/vfile-6.0.3.tgz", + "integrity": "sha512-KzIbH/9tXat2u30jf+smMwFCsno4wHVdNmzFyL+T/L3UGqqk6JKfVqOFOZEpZSHADH1k40ab6NUIXZq422ov3Q==", "dev": true, - "license": "MIT", - "optional": true, "dependencies": { - "@oxc-project/types": "0.160.0" + "@types/unist": "^3.0.0", + "vfile-message": "^4.0.0" }, - "engines": { - "node": "^20.19.0 || ^22.13.0 || >=23.5.0" + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" } }, - "node_modules/vite/node_modules/@rolldown/binding-win32-arm64-msvc": { - "version": "1.3.4", - "resolved": "https://registry.npmjs.org/@rolldown/binding-win32-arm64-msvc/-/binding-win32-arm64-msvc-1.3.4.tgz", - "integrity": "sha512-8adGMrNtrdzi2WD1ozhYapER59gD8Q/DV6SCKJlyG2HqULPdeQUBvMa33lTsiEYwIqTZUaIU2MmvPp5f1wbtXA==", - "cpu": [ - "arm64" - ], + "node_modules/vfile-message": { + "version": "4.0.4", + "resolved": "https://registry.npmmirror.com/vfile-message/-/vfile-message-4.0.4.tgz", + "integrity": "sha512-66ycRswIkNmHH9PHku7ADtv5RVwgIrOcuv3J8Svz6h4qgGRrKVa+9/neuKyJZUXyOpYwLTvS+whZ4R2urHHgQg==", "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "win32" - ], - "engines": { - "node": "^20.19.0 || >=22.12.0" + "dependencies": { + "@types/unist": "^3.0.0", + "unist-util-stringify-position": "^4.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" } }, - "node_modules/vite/node_modules/@rolldown/binding-win32-x64-msvc": { - "version": "1.3.4", - "resolved": "https://registry.npmjs.org/@rolldown/binding-win32-x64-msvc/-/binding-win32-x64-msvc-1.3.4.tgz", - "integrity": "sha512-rIMjtESdXJCIoOiUTroQ1Y1rjVDZkuUVRUxs3APX2vNv175D7TDWvzdELiIhzGq9cUNUFat+co+PTmPHPqSREg==", - "cpu": [ - "x64" - ], + "node_modules/vite": { + "name": "@voidzero-dev/vite-plus-core", + "version": "8.3.8000", + "resolved": "https://registry.npmjs.org/@voidzero-dev/vite-plus-core/-/vite-plus-core-8.3.8000.tgz", + "integrity": "sha512-kWOoI7ut3UE83p87jJxcxxg92pbipmC/aakCm6mfm1nkPyPnEZngNaRjiVRPrvxk3vSgy54A4fdlTeb++dSKfg==", "dev": true, "license": "MIT", - "optional": true, - "os": [ - "win32" - ], + "dependencies": { + "@oxc-project/runtime": "=0.159.0", + "@oxc-project/types": "=0.159.0", + "lightningcss": "^1.33.0", + "postcss": "^8.5.32", + "yuku-parser": "0.19.0" + }, "engines": { - "node": "^20.19.0 || >=22.12.0" + "node": "^20.19.0 || ^22.18.0 || >=24.11.0" + }, + "optionalDependencies": { + "@voidzero-dev/vite-plus-darwin-arm64": "1.7.0", + "@voidzero-dev/vite-plus-darwin-x64": "1.7.0", + "@voidzero-dev/vite-plus-linux-arm64-gnu": "1.7.0", + "@voidzero-dev/vite-plus-linux-arm64-musl": "1.7.0", + "@voidzero-dev/vite-plus-linux-x64-gnu": "1.7.0", + "@voidzero-dev/vite-plus-linux-x64-musl": "1.7.0", + "@voidzero-dev/vite-plus-win32-arm64-msvc": "1.7.0", + "@voidzero-dev/vite-plus-win32-x64-msvc": "1.7.0", + "fsevents": "~2.3.3" + }, + "peerDependencies": { + "@arethetypeswrong/core": "^0.18.1", + "@types/node": "^20.19.0 || >=22.12.0", + "@typescript/native-preview": "*", + "@vitejs/devtools": "^0.7.1 || ^0.8.0", + "@volar/typescript": "~2.4.0", + "@vue/language-core": "~3.2.0 || ~3.3.0", + "esbuild": "^0.27.0 || ^0.28.0", + "jiti": ">=1.21.0", + "less": "^4.0.0", + "publint": "^0.3.8", + "sass": "^1.70.0", + "sass-embedded": "^1.70.0", + "stylus": ">=0.54.8", + "sugarss": "^5.0.0", + "terser": "^5.16.0", + "tsx": "^4.8.1", + "typescript": "^5.0.0 || ^6.0.0 || ^7.0.0", + "unplugin-unused": ">=0.5.0", + "unrun": "*", + "vue-tsc": "~3.2.0 || ~3.3.0", + "yaml": "^2.4.2" + }, + "peerDependenciesMeta": { + "@arethetypeswrong/core": { + "optional": true + }, + "@types/node": { + "optional": true + }, + "@typescript/native-preview": { + "optional": true + }, + "@vitejs/devtools": { + "optional": true + }, + "@volar/typescript": { + "optional": true + }, + "@vue/language-core": { + "optional": true + }, + "esbuild": { + "optional": true + }, + "jiti": { + "optional": true + }, + "less": { + "optional": true + }, + "publint": { + "optional": true + }, + "sass": { + "optional": true + }, + "sass-embedded": { + "optional": true + }, + "stylus": { + "optional": true + }, + "sugarss": { + "optional": true + }, + "terser": { + "optional": true + }, + "tsx": { + "optional": true + }, + "typescript": { + "optional": true + }, + "unplugin-unused": { + "optional": true + }, + "unrun": { + "optional": true + }, + "vue-tsc": { + "optional": true + }, + "yaml": { + "optional": true + } } }, - "node_modules/vite/node_modules/rolldown": { - "version": "1.3.4", - "resolved": "https://registry.npmjs.org/rolldown/-/rolldown-1.3.4.tgz", - "integrity": "sha512-p2rq4bfBmF0M6yaR8+A89fbkBQynZI2fxUW4G07eq9kpctAkpo7q5BZ4X4Mo4XZ7HHROu33cX9PeopUFN6u+2Q==", + "node_modules/vite-plus": { + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/vite-plus/-/vite-plus-1.7.0.tgz", + "integrity": "sha512-dWeTqWhRXZSIr9i45IjPXjiAuLtHOdiRrZNBCusyhb/06MxFHOSbVKqG5bq9svxsE494AMHmVocBvzem+a6qHw==", "dev": true, "license": "MIT", "dependencies": { - "@oxc-project/types": "=0.160.0", - "@rolldown/pluginutils": "^1.0.0" + "@oxc-project/runtime": "=0.159.0", + "@oxc-project/types": "=0.159.0", + "@oxlint/plugins": "=1.94.0", + "@vitest/browser": "5.1.0", + "@vitest/browser-preview": "5.1.0", + "@vitest/mocker": "5.1.0", + "@vitest/pretty-format": "5.1.0", + "@vitest/snapshot": "5.1.0", + "@vitest/spy": "5.1.0", + "@vitest/utils": "5.1.0", + "oxfmt": "=0.79.0", + "oxlint": "=1.94.0", + "tsrs": "=7.1.0-beta.tsrs2", + "vite": "npm:@voidzero-dev/vite-plus-core@8.3.8000", + "vitest": "5.1.0" }, "bin": { - "rolldown": "bin/cli.mjs" + "vp": "bin/vp", + "vpr": "bin/vpr", + "vpx": "bin/vpx" }, "engines": { - "node": "^20.19.0 || >=22.12.0" + "node": "^22.18.0 || ^24.11.0 || >=26.0.0" }, "optionalDependencies": { - "@rolldown/binding-android-arm-eabi": "1.3.4", - "@rolldown/binding-android-arm64": "1.3.4", - "@rolldown/binding-darwin-arm64": "1.3.4", - "@rolldown/binding-darwin-x64": "1.3.4", - "@rolldown/binding-freebsd-x64": "1.3.4", - "@rolldown/binding-linux-arm-gnueabihf": "1.3.4", - "@rolldown/binding-linux-arm64-gnu": "1.3.4", - "@rolldown/binding-linux-arm64-musl": "1.3.4", - "@rolldown/binding-linux-ppc64-gnu": "1.3.4", - "@rolldown/binding-linux-s390x-gnu": "1.3.4", - "@rolldown/binding-linux-x64-gnu": "1.3.4", - "@rolldown/binding-linux-x64-musl": "1.3.4", - "@rolldown/binding-openharmony-arm64": "1.3.4", - "@rolldown/binding-wasm32-wasi": "1.3.4", - "@rolldown/binding-win32-arm64-msvc": "1.3.4", - "@rolldown/binding-win32-x64-msvc": "1.3.4" + "@voidzero-dev/vite-plus-darwin-arm64": "1.7.0", + "@voidzero-dev/vite-plus-darwin-x64": "1.7.0", + "@voidzero-dev/vite-plus-linux-arm64-gnu": "1.7.0", + "@voidzero-dev/vite-plus-linux-arm64-musl": "1.7.0", + "@voidzero-dev/vite-plus-linux-x64-gnu": "1.7.0", + "@voidzero-dev/vite-plus-linux-x64-musl": "1.7.0", + "@voidzero-dev/vite-plus-win32-arm64-msvc": "1.7.0", + "@voidzero-dev/vite-plus-win32-x64-msvc": "1.7.0" + }, + "peerDependencies": { + "@vitest/browser-playwright": "5.1.0", + "@vitest/browser-webdriverio": "^5.0.0-beta.5 || >=5.0.0", + "playwright": "*" + }, + "peerDependenciesMeta": { + "@vitest/browser-playwright": { + "optional": true + }, + "@vitest/browser-webdriverio": { + "optional": true + }, + "playwright": { + "optional": true + } + } + }, + "node_modules/vite-plus/node_modules/@oxc-project/types": { + "version": "0.159.0", + "resolved": "https://registry.npmjs.org/@oxc-project/types/-/types-0.159.0.tgz", + "integrity": "sha512-QWjWhxheluOJ82kDHNyps00UvRpQCtI34B5A/SzpgQycUD/79FuvT4I0aQIfE/bdPwKmX4QPftnywFBH6FxJhQ==", + "dev": true, + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/oxc-project" + } + }, + "node_modules/vite/node_modules/@oxc-project/types": { + "version": "0.159.0", + "resolved": "https://registry.npmjs.org/@oxc-project/types/-/types-0.159.0.tgz", + "integrity": "sha512-QWjWhxheluOJ82kDHNyps00UvRpQCtI34B5A/SzpgQycUD/79FuvT4I0aQIfE/bdPwKmX4QPftnywFBH6FxJhQ==", + "dev": true, + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/oxc-project" } }, "node_modules/vitest": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/vitest/-/vitest-5.1.2.tgz", - "integrity": "sha512-VIa2wXV208WraXUbzH+dQUrGcFpPuaiRA8HlhXS8R6/sy9cynw6OMqGj8fmAlH1hot7huTCtWUE14+FdXU3eLw==", + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/vitest/-/vitest-5.1.0.tgz", + "integrity": "sha512-MzmNFnrwa8v8lF1bLxw3UJ4EREwVOVb75VqJZmUDRjJ6EluK/x9th7qTbaeDk41WxE1GxWqmTXcdsfobfH5sOA==", "dev": true, "license": "MIT", "dependencies": { "@types/chai": "^5.2.2", - "@vitest/mocker": "5.1.2", + "@vitest/mocker": "5.1.0", "chai": "^6.3.0", "es-module-lexer": "^2.3.2", "expect-type": "^1.4.0", - "magic-string": "^1.4.5", + "magic-string": "^1.4.3", "obug": "^3.0.0", "picomatch": "^4.0.7", "std-env": "^4.3.0", - "tinybench": "^6.2.3", + "tinybench": "^6.2.2", "tinyexec": "^1.3.1", "tinyglobby": "^0.2.17", "why-is-node-running": "3.2.1" @@ -10990,12 +12633,12 @@ "@edge-runtime/vm": "*", "@opentelemetry/api": "^1.9.0", "@types/node": "^22.0.0 || >=24.0.0", - "@vitest/browser-playwright": "5.1.2", - "@vitest/browser-preview": "5.1.2", + "@vitest/browser-playwright": "5.1.0", + "@vitest/browser-preview": "5.1.0", "@vitest/browser-webdriverio": "^5.0.0-beta.5 || >=5.0.0", - "@vitest/coverage-istanbul": "5.1.2", - "@vitest/coverage-v8": "5.1.2", - "@vitest/ui": "5.1.2", + "@vitest/coverage-istanbul": "5.1.0", + "@vitest/coverage-v8": "5.1.0", + "@vitest/ui": "5.1.0", "happy-dom": "*", "jsdom": "*", "vite": "^6.4.0 || ^7.0.0 || ^8.0.0" @@ -11169,6 +12812,28 @@ "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==", "dev": true }, + "node_modules/ws": { + "version": "8.23.0", + "resolved": "https://registry.npmjs.org/ws/-/ws-8.23.0.tgz", + "integrity": "sha512-wCkmX8QMOrKjgO8HW2WyDbTSGeqkocxgDzS9iR79rEAexty6/2qzilx3Ag8Tqf9ykop3irLKle0MtVn5qjVnoQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=10.0.0" + }, + "peerDependencies": { + "bufferutil": "^4.0.1", + "utf-8-validate": ">=5.0.2" + }, + "peerDependenciesMeta": { + "bufferutil": { + "optional": true + }, + "utf-8-validate": { + "optional": true + } + } + }, "node_modules/xml-name-validator": { "version": "5.0.0", "resolved": "https://registry.npmmirror.com/xml-name-validator/-/xml-name-validator-5.0.0.tgz", @@ -11247,6 +12912,49 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/yuku-core": { + "version": "0.19.0", + "resolved": "https://registry.npmjs.org/yuku-core/-/yuku-core-0.19.0.tgz", + "integrity": "sha512-kYK9e1XdfirNhkipzW0wmMcSWcVF/CWnuugodfVYRCUwvoBefweL9HzB96OiKEhsx78V5WbUxbJqlizMX869Qg==", + "deprecated": "Yuku is now one package with one core. Use \"yuku\" instead: https://yuku.fyi/javascript/. Existing installs keep working but get no more fixes.", + "dev": true, + "license": "MIT", + "dependencies": { + "@yuku-toolchain/types": "^0.19.0" + }, + "engines": { + "node": ">=14.18.0" + }, + "optionalDependencies": { + "@yuku-core/binding-android-arm64": "0.19.0", + "@yuku-core/binding-darwin-arm64": "0.19.0", + "@yuku-core/binding-darwin-x64": "0.19.0", + "@yuku-core/binding-freebsd-x64": "0.19.0", + "@yuku-core/binding-linux-arm-gnu": "0.19.0", + "@yuku-core/binding-linux-arm-musl": "0.19.0", + "@yuku-core/binding-linux-arm64-gnu": "0.19.0", + "@yuku-core/binding-linux-arm64-musl": "0.19.0", + "@yuku-core/binding-linux-x64-gnu": "0.19.0", + "@yuku-core/binding-linux-x64-musl": "0.19.0", + "@yuku-core/binding-win32-arm64": "0.19.0", + "@yuku-core/binding-win32-x64": "0.19.0" + } + }, + "node_modules/yuku-parser": { + "version": "0.19.0", + "resolved": "https://registry.npmjs.org/yuku-parser/-/yuku-parser-0.19.0.tgz", + "integrity": "sha512-XrBh9ZiQK5mJVRxZBAvD6LwRyAYrK3MFtH3+onyuxFL5hFD44EC3QOmIC1FjTj6H2MMwq46/NAI+NZxLZPZgxg==", + "deprecated": "Yuku is now one package with one core. Use \"yuku\" instead: https://yuku.fyi/javascript/. Existing installs keep working but get no more fixes.", + "dev": true, + "license": "MIT", + "dependencies": { + "@yuku-toolchain/types": "^0.19.0", + "yuku-core": "0.19.0" + }, + "engines": { + "node": ">=14.18.0" + } + }, "node_modules/zod": { "version": "4.6.7", "resolved": "https://registry.npmmirror.com/zod/-/zod-4.6.7.tgz", diff --git a/package.json b/package.json index 68accb4..4cc4f5b 100644 --- a/package.json +++ b/package.json @@ -16,20 +16,22 @@ "fetch:ffmpeg": "node scripts/fetch-ffmpeg.mjs", "fetch:hawdb": "node scripts/fetch-hawdb.mjs", "start": "electron-vite preview", - "typecheck": "node node_modules/typescript/bin/tsc --noEmit -p tsconfig.node.json && node node_modules/typescript/bin/tsc --noEmit -p tsconfig.web.json", - "test": "vitest run" + "test": "vp run ctest", + "check": "vp run ccheck" }, "overrides": { "app-builder-lib": { "@electron/get": "5.1.0" }, "katex": "^0.18.2", - "minimatch": "11.0.3" + "minimatch": "11.0.3", + "vite": "npm:@voidzero-dev/vite-plus-core@8.3.8000" }, "devDependencies": { "@assistant-ui/react": "^0.15.37", "@assistant-ui/react-markdown": "^0.14.26", "@base-ui/react": "^1.9.0", + "@liangmi/vp-config": "^1.0.2", "@sentry/electron": "^8.0.0", "@tailwindcss/vite": "^4.3.5", "@types/node": "^26.6.3", @@ -56,8 +58,8 @@ "tailwindcss": "^4.3.5", "tw-shimmer": "^0.4.14", "typescript": "^7.0.2", - "vite": "^8.4.0", - "vitest": "^5.1.2", + "vite": "npm:@voidzero-dev/vite-plus-core@8.3.8000", + "vite-plus": "1.7.0", "zustand": "^5.1.0" }, "dependencies": { diff --git a/tests/account-login.test.mjs b/tests/account-login.test.mjs index 5ca6738..74bdf26 100644 --- a/tests/account-login.test.mjs +++ b/tests/account-login.test.mjs @@ -2,7 +2,7 @@ import assert from 'node:assert/strict' import { readFileSync } from 'node:fs' import { createRequire } from 'node:module' import { setImmediate as nextTurn } from 'node:timers/promises' -import { test, vi } from 'vitest' +import { test, vi } from 'vite-plus/test' import { compileFunction } from 'node:vm' import { ModuleKind, ScriptTarget, transpileModule } from '@typescript/typescript6' import * as passport from '../src/common/passport.ts' diff --git a/tests/account-store.test.mjs b/tests/account-store.test.mjs index a93e9f7..a0de690 100644 --- a/tests/account-store.test.mjs +++ b/tests/account-store.test.mjs @@ -1,5 +1,5 @@ import assert from 'node:assert/strict' -import { test } from 'vitest' +import { test } from 'vite-plus/test' import { registerHooks } from 'node:module' import { resolve } from 'node:path' import { pathToFileURL } from 'node:url' diff --git a/tests/agri-regions.test.mjs b/tests/agri-regions.test.mjs index d59f885..1b08bf4 100644 --- a/tests/agri-regions.test.mjs +++ b/tests/agri-regions.test.mjs @@ -1,5 +1,5 @@ import assert from 'node:assert/strict' -import { test } from 'vitest' +import { test } from 'vite-plus/test' import { AGRI_CATEGORY_META, agriCategoryOf, agriculturalRegions, agriFacts } from '../src/renderer/src/thematic/agriculturalRegions.ts' import { industrialBases, industrialTransferFacts, industrialTransferFlows } from '../src/renderer/src/thematic/industrialBases.ts' diff --git a/tests/ai-history.test.mjs b/tests/ai-history.test.mjs index 70c2941..2f284e7 100644 --- a/tests/ai-history.test.mjs +++ b/tests/ai-history.test.mjs @@ -1,5 +1,5 @@ import assert from 'node:assert/strict' -import { test } from 'vitest' +import { test } from 'vite-plus/test' import { registerHooks } from 'node:module' import { mkdtemp, readFile, writeFile, readdir, rename, mkdir, rm } from 'node:fs/promises' import { tmpdir } from 'node:os' diff --git a/tests/ai-settings-draft.test.mjs b/tests/ai-settings-draft.test.mjs index c3971ea..9de2376 100644 --- a/tests/ai-settings-draft.test.mjs +++ b/tests/ai-settings-draft.test.mjs @@ -1,5 +1,5 @@ import assert from 'node:assert/strict' -import { test } from 'vitest' +import { test } from 'vite-plus/test' import { registerHooks } from 'node:module' registerHooks({ diff --git a/tests/annotation-references.test.mjs b/tests/annotation-references.test.mjs index fdc4de6..7d999d2 100644 --- a/tests/annotation-references.test.mjs +++ b/tests/annotation-references.test.mjs @@ -1,5 +1,5 @@ import assert from 'node:assert/strict' -import { test } from 'vitest' +import { test } from 'vite-plus/test' import { referencedShapeIds } from '../src/renderer/src/lib/annotationReferences.ts' diff --git a/tests/button-loading-icon.test.mjs b/tests/button-loading-icon.test.mjs index d2f456b..ea63aad 100644 --- a/tests/button-loading-icon.test.mjs +++ b/tests/button-loading-icon.test.mjs @@ -1,7 +1,7 @@ import assert from 'node:assert/strict' import { readdirSync, readFileSync } from 'node:fs' import { join, relative, resolve } from 'node:path' -import { test } from 'vitest' +import { test } from 'vite-plus/test' import ts from '@typescript/typescript6' const RENDERER_ROOT = resolve('src/renderer/src') diff --git a/tests/decision-sandbox.test.mjs b/tests/decision-sandbox.test.mjs index 7e68a9a..45cb7b6 100644 --- a/tests/decision-sandbox.test.mjs +++ b/tests/decision-sandbox.test.mjs @@ -1,5 +1,5 @@ import assert from 'node:assert/strict' -import { test } from 'vitest' +import { test } from 'vite-plus/test' import { buildDecisionPrompt, decisionCases, decisionSandboxIntro } from '../src/renderer/src/thematic/decisionSandbox.ts' test('decision cases: four contexts with essential factors and reachable places', () => { diff --git a/tests/drawing-store.test.mjs b/tests/drawing-store.test.mjs index 423e14e..ed8fec2 100644 --- a/tests/drawing-store.test.mjs +++ b/tests/drawing-store.test.mjs @@ -1,5 +1,5 @@ import assert from 'node:assert/strict' -import { test } from 'vitest' +import { test } from 'vite-plus/test' import { registerHooks } from 'node:module' import { resolve } from 'node:path' import { pathToFileURL } from 'node:url' diff --git a/tests/eoq-ui.test.mjs b/tests/eoq-ui.test.mjs index 5daf66d..5531329 100644 --- a/tests/eoq-ui.test.mjs +++ b/tests/eoq-ui.test.mjs @@ -2,7 +2,7 @@ import assert from 'node:assert/strict' import { readFileSync } from 'node:fs' import { registerHooks } from 'node:module' import { resolve } from 'node:path' -import { test } from 'vitest' +import { test } from 'vite-plus/test' import { pathToFileURL } from 'node:url' import { JSDOM } from 'jsdom' import { act, createElement } from 'react' diff --git a/tests/ffmpeg-fetch.test.mjs b/tests/ffmpeg-fetch.test.mjs index 8ef57dd..aaa1e6e 100644 --- a/tests/ffmpeg-fetch.test.mjs +++ b/tests/ffmpeg-fetch.test.mjs @@ -3,7 +3,7 @@ import { existsSync } from 'node:fs' import { mkdtemp, rm, writeFile } from 'node:fs/promises' import { tmpdir } from 'node:os' import { join } from 'node:path' -import { test } from 'vitest' +import { test } from 'vite-plus/test' import { fileURLToPath } from 'node:url' import { diff --git a/tests/flight-framing.test.mjs b/tests/flight-framing.test.mjs index dbb12ba..8ae5c21 100644 --- a/tests/flight-framing.test.mjs +++ b/tests/flight-framing.test.mjs @@ -1,5 +1,5 @@ import assert from 'node:assert/strict' -import { test } from 'vitest' +import { test } from 'vite-plus/test' import { conservativeFlightHeightM, destinationAt, diff --git a/tests/flight-stops.test.mjs b/tests/flight-stops.test.mjs index f81f460..7d8e847 100644 --- a/tests/flight-stops.test.mjs +++ b/tests/flight-stops.test.mjs @@ -1,5 +1,5 @@ import assert from 'node:assert/strict' -import { test } from 'vitest' +import { test } from 'vite-plus/test' import { registerHooks } from 'node:module' registerHooks({ diff --git a/tests/gcj02.test.mjs b/tests/gcj02.test.mjs index 7770f76..afdf524 100644 --- a/tests/gcj02.test.mjs +++ b/tests/gcj02.test.mjs @@ -1,6 +1,6 @@ import assert from 'node:assert/strict' import { readFileSync } from 'node:fs' -import { test } from 'vitest' +import { test } from 'vite-plus/test' import { gcj02ToWgs84, outsideChina, wgs84ToGcj02 } from '../src/main/geo/gcj02.ts' const citiesGcj02 = [ diff --git a/tests/globe-navigation.test.mjs b/tests/globe-navigation.test.mjs index dce146b..e491a1c 100644 --- a/tests/globe-navigation.test.mjs +++ b/tests/globe-navigation.test.mjs @@ -1,5 +1,5 @@ import assert from 'node:assert/strict' -import { test, vi } from 'vitest' +import { test, vi } from 'vite-plus/test' import { Cartographic, EllipsoidTerrainProvider, GeographicTilingScheme, HeightmapTerrainData, ImageryLayer, UrlTemplateImageryProvider, WebMercatorTilingScheme } from 'cesium' import { createBasemapImageryProvider } from '../src/renderer/src/composables/basemapImagery.ts' import { resolveFlightDestination } from '../src/renderer/src/composables/terrainFlight.ts' diff --git a/tests/globe-surface.test.mjs b/tests/globe-surface.test.mjs index e7ed497..db6c813 100644 --- a/tests/globe-surface.test.mjs +++ b/tests/globe-surface.test.mjs @@ -1,6 +1,6 @@ import assert from 'node:assert/strict' import { readFile } from 'node:fs/promises' -import { test } from 'vitest' +import { test } from 'vite-plus/test' import { BUFFER_MISSING_REPORT_MS, RENDER_FAULT_LIMIT, diff --git a/tests/hawdb-fetch.test.mjs b/tests/hawdb-fetch.test.mjs index 0b705bb..e8a98fd 100644 --- a/tests/hawdb-fetch.test.mjs +++ b/tests/hawdb-fetch.test.mjs @@ -1,5 +1,5 @@ import assert from 'node:assert/strict' -import { test } from 'vitest' +import { test } from 'vite-plus/test' import { archiveRedirectTarget, assertArchiveSource, diff --git a/tests/hawdb.test.mjs b/tests/hawdb.test.mjs index f2fa538..9d7d179 100644 --- a/tests/hawdb.test.mjs +++ b/tests/hawdb.test.mjs @@ -3,7 +3,7 @@ import { existsSync, readFileSync } from 'node:fs' import { mkdir, mkdtemp, chmod, rm, writeFile } from 'node:fs/promises' import { tmpdir } from 'node:os' import { join, resolve } from 'node:path' -import { test } from 'vitest' +import { test } from 'vite-plus/test' import { registerHooks } from 'node:module' import { fileURLToPath } from 'node:url' diff --git a/tests/hsr-lines.test.mjs b/tests/hsr-lines.test.mjs index edf4da4..a908d45 100644 --- a/tests/hsr-lines.test.mjs +++ b/tests/hsr-lines.test.mjs @@ -1,5 +1,5 @@ import assert from 'node:assert/strict' -import { test } from 'vitest' +import { test } from 'vite-plus/test' import { HSR_END_YEAR, HSR_START_YEAR, hsrFacts, hsrGrowthSeries, hsrLines, hsrLinesUpTo, hsrMileageAt } from '../src/renderer/src/thematic/hsrLines.ts' test('hsr lines: opening years within growth window and paths in China bounds', () => { diff --git a/tests/live-typhoons.test.mjs b/tests/live-typhoons.test.mjs index 00127c1..e5e1e78 100644 --- a/tests/live-typhoons.test.mjs +++ b/tests/live-typhoons.test.mjs @@ -1,5 +1,5 @@ import assert from 'node:assert/strict' -import { test } from 'vitest' +import { test } from 'vite-plus/test' import { CustomDataSource, JulianDate, PolylineDashMaterialProperty } from 'cesium' import { buildLiveTyphoons } from '../src/renderer/src/thematic/liveTyphoons.ts' diff --git a/tests/migration-geometry.test.mjs b/tests/migration-geometry.test.mjs index b5a9c7a..0e36d0e 100644 --- a/tests/migration-geometry.test.mjs +++ b/tests/migration-geometry.test.mjs @@ -1,5 +1,5 @@ import assert from 'node:assert/strict' -import { test } from 'vitest' +import { test } from 'vite-plus/test' import { fanMigrationEndpoints, migrationFlows, smoothMigrationPath } from '../src/renderer/src/thematic/populationCensus.ts' test('smoothed path passes through every waypoint', () => { diff --git a/tests/model-importer.test.mjs b/tests/model-importer.test.mjs index 64d3bb5..554d6c2 100644 --- a/tests/model-importer.test.mjs +++ b/tests/model-importer.test.mjs @@ -3,7 +3,7 @@ import { readFileSync } from 'node:fs' import { createRequire } from 'node:module' import { compileFunction } from 'node:vm' import { ModuleKind, ScriptTarget, transpileModule } from '@typescript/typescript6' -import { test } from 'vitest' +import { test } from 'vite-plus/test' import * as tileMirror from '../src/common/tileMirror.ts' const responseReaderSource = readFileSync(new URL('../src/main/ai/responseReader.ts', import.meta.url), 'utf8') diff --git a/tests/model-test.test.mjs b/tests/model-test.test.mjs index ccb4fed..bd91cbe 100644 --- a/tests/model-test.test.mjs +++ b/tests/model-test.test.mjs @@ -3,7 +3,7 @@ import { randomUUID } from 'node:crypto' import { readFileSync } from 'node:fs' import { compileFunction } from 'node:vm' import { ModuleKind, ScriptTarget, transpileModule } from '@typescript/typescript6' -import { test } from 'vitest' +import { test } from 'vite-plus/test' const aiTelemetrySource = readFileSync(new URL('../src/common/aiTelemetry.ts', import.meta.url), 'utf8') const aiTelemetryOutput = transpileModule(aiTelemetrySource, { diff --git a/tests/mountain-zonation.test.mjs b/tests/mountain-zonation.test.mjs index 1ddeb40..e5919e4 100644 --- a/tests/mountain-zonation.test.mjs +++ b/tests/mountain-zonation.test.mjs @@ -1,5 +1,5 @@ import assert from 'node:assert/strict' -import { test } from 'vitest' +import { test } from 'vite-plus/test' import { beltAtAltitude, mountainById, snowlineM, zonationMountains, zonationPrinciples } from '../src/renderer/src/thematic/mountainZonation.ts' import { bearingDeg, greatCircleKm, groundProfileImplausible, interpolateWaypoints, planTransectAltitudes, transectHops, transectLegsKm, transectTotalKm } from '../src/renderer/src/lib/transect.ts' diff --git a/tests/night-basemap.test.mjs b/tests/night-basemap.test.mjs index 214cd66..ceb33c1 100644 --- a/tests/night-basemap.test.mjs +++ b/tests/night-basemap.test.mjs @@ -1,6 +1,6 @@ import assert from 'node:assert/strict' import { readFile } from 'node:fs/promises' -import { test } from 'vitest' +import { test } from 'vite-plus/test' import { hidesThematicLayers, visibleThematicLayers } from '../src/renderer/src/lib/nightBasemap.ts' const appSource = await readFile(new URL('../src/renderer/src/App.tsx', import.meta.url), 'utf8') diff --git a/tests/notable-peaks.test.mjs b/tests/notable-peaks.test.mjs index ec8bbf0..aefef97 100644 --- a/tests/notable-peaks.test.mjs +++ b/tests/notable-peaks.test.mjs @@ -1,5 +1,5 @@ import assert from 'node:assert/strict' -import { test } from 'vitest' +import { test } from 'vite-plus/test' import { findPeaksNear, nearestPeaks, notablePeaks } from '../src/renderer/src/thematic/notablePeaks.ts' test('notable peaks: ids and names unique, coordinates and elevations plausible', () => { diff --git a/tests/offscreen-camera.test.mjs b/tests/offscreen-camera.test.mjs index 63bbbbc..af0504d 100644 --- a/tests/offscreen-camera.test.mjs +++ b/tests/offscreen-camera.test.mjs @@ -1,6 +1,6 @@ import assert from 'node:assert/strict' import { readFile } from 'node:fs/promises' -import { test } from 'vitest' +import { test } from 'vite-plus/test' const offscreenSource = await readFile(new URL('../src/renderer/src/offscreen.tsx', import.meta.url), 'utf8') const layersSource = await readFile(new URL('../src/renderer/src/composables/useThematicLayers.ts', import.meta.url), 'utf8') diff --git a/tests/offscreen-container.test.mjs b/tests/offscreen-container.test.mjs index 60c6a03..537ce30 100644 --- a/tests/offscreen-container.test.mjs +++ b/tests/offscreen-container.test.mjs @@ -3,7 +3,7 @@ import { spawnSync } from 'node:child_process' import { mkdtempSync, rmSync, writeFileSync } from 'node:fs' import { tmpdir } from 'node:os' import { join } from 'node:path' -import { test } from 'vitest' +import { test } from 'vite-plus/test' import { fileURLToPath } from 'node:url' import { findFfmpegBinary } from '../src/main/ffmpeg.ts' diff --git a/tests/offscreen-mac.test.mjs b/tests/offscreen-mac.test.mjs index f216365..b29ffb1 100644 --- a/tests/offscreen-mac.test.mjs +++ b/tests/offscreen-mac.test.mjs @@ -1,6 +1,6 @@ import assert from 'node:assert/strict' import { access, readFile } from 'node:fs/promises' -import { test } from 'vitest' +import { test } from 'vite-plus/test' const mainSource = await readFile(new URL('../src/main/index.ts', import.meta.url), 'utf8') const macSource = await readFile(new URL('../src/main/offscreenMac.ts', import.meta.url), 'utf8') diff --git a/tests/offscreen-paths.test.mjs b/tests/offscreen-paths.test.mjs index fefd7f2..5e999ed 100644 --- a/tests/offscreen-paths.test.mjs +++ b/tests/offscreen-paths.test.mjs @@ -3,7 +3,7 @@ import { mkdirSync, mkdtempSync, readdirSync, rmSync, symlinkSync } from 'node:f import { readFile } from 'node:fs/promises' import { tmpdir } from 'node:os' import { join, resolve, sep } from 'node:path' -import { test } from 'vitest' +import { test } from 'vite-plus/test' import { assertOffscreenRecordingSupported, resolveFfmpegBinary } from '../src/main/ffmpeg.ts' import { resolveOffscreenEntry } from '../src/main/offscreenPaths.ts' diff --git a/tests/offscreen-state.test.mjs b/tests/offscreen-state.test.mjs index a2be969..a2c3395 100644 --- a/tests/offscreen-state.test.mjs +++ b/tests/offscreen-state.test.mjs @@ -1,6 +1,6 @@ import assert from 'node:assert/strict' import { readFile } from 'node:fs/promises' -import { test } from 'vitest' +import { test } from 'vite-plus/test' import { wrapText } from '../src/renderer/src/offscreenText.ts' diff --git a/tests/offscreen-timing.test.mjs b/tests/offscreen-timing.test.mjs index 002c6c3..8cdca91 100644 --- a/tests/offscreen-timing.test.mjs +++ b/tests/offscreen-timing.test.mjs @@ -1,5 +1,5 @@ import assert from 'node:assert/strict' -import { test } from 'vitest' +import { test } from 'vite-plus/test' import { offscreenCaptureSize, offscreenConcatPlaylist, offscreenFrameDurations, offscreenFrameRate, offscreenScriptDurationMs } from '../src/main/offscreenTiming.ts' diff --git a/tests/online-data.test.mjs b/tests/online-data.test.mjs index 156a560..fbc1534 100644 --- a/tests/online-data.test.mjs +++ b/tests/online-data.test.mjs @@ -1,7 +1,7 @@ import assert from 'node:assert/strict' import { readFileSync } from 'node:fs' import { createRequire } from 'node:module' -import { test } from 'vitest' +import { test } from 'vite-plus/test' import { compileFunction } from 'node:vm' import { ModuleKind, ScriptTarget, transpileModule } from '@typescript/typescript6' import * as shared from '../src/common/onlineData.ts' diff --git a/tests/packaging.test.mjs b/tests/packaging.test.mjs index dcef632..e9ff82d 100644 --- a/tests/packaging.test.mjs +++ b/tests/packaging.test.mjs @@ -2,7 +2,7 @@ import assert from 'node:assert/strict' import { existsSync, readdirSync, readFileSync } from 'node:fs' import { builtinModules } from 'node:module' import { dirname, join, posix, relative, resolve } from 'node:path' -import { test } from 'vitest' +import { test } from 'vite-plus/test' import { fileURLToPath } from 'node:url' const repoRoot = fileURLToPath(new URL('..', import.meta.url)) diff --git a/tests/passport-account.test.mjs b/tests/passport-account.test.mjs index a20e454..20edba7 100644 --- a/tests/passport-account.test.mjs +++ b/tests/passport-account.test.mjs @@ -1,6 +1,6 @@ import assert from 'node:assert/strict' import { randomBytes } from 'node:crypto' -import { test } from 'vitest' +import { test } from 'vite-plus/test' import { accountPhaseLabel, buildDeviceName, diff --git a/tests/poi-aggregation.test.mjs b/tests/poi-aggregation.test.mjs index ce07fcb..d34d0dc 100644 --- a/tests/poi-aggregation.test.mjs +++ b/tests/poi-aggregation.test.mjs @@ -1,5 +1,5 @@ import assert from 'node:assert/strict' -import { test } from 'vitest' +import { test } from 'vite-plus/test' import { registerHooks } from 'node:module' registerHooks({ diff --git a/tests/poi-categories.test.mjs b/tests/poi-categories.test.mjs index 21e939e..36ae65c 100644 --- a/tests/poi-categories.test.mjs +++ b/tests/poi-categories.test.mjs @@ -1,5 +1,5 @@ import assert from 'node:assert/strict' -import { test } from 'vitest' +import { test } from 'vite-plus/test' import { POI_CATEGORY_LABELS, poiBigCategory } from '../src/main/ai/poiCategories.ts' test('real-shaped amap pois classify by their typecode, not the chinese type name', () => { diff --git a/tests/population-layer.test.mjs b/tests/population-layer.test.mjs index 7ec239e..d1a9c6f 100644 --- a/tests/population-layer.test.mjs +++ b/tests/population-layer.test.mjs @@ -1,6 +1,6 @@ import assert from 'node:assert/strict' import { readFileSync } from 'node:fs' -import { test } from 'vitest' +import { test } from 'vite-plus/test' import { censusAgeStructure, densityBins, densityColor, densityOf, densityRank, huComparison, huLineEndpoints, migrationFlows, nationalPopulation, populationRank, provincePopulation, provinceSummary, pyramid2020, pyramidAgeGroups, diff --git a/tests/pr-review.test.mjs b/tests/pr-review.test.mjs index e4300f4..eae5893 100644 --- a/tests/pr-review.test.mjs +++ b/tests/pr-review.test.mjs @@ -1,5 +1,5 @@ import assert from 'node:assert/strict' -import { test, vi } from 'vitest' +import { test, vi } from 'vite-plus/test' import { registerHooks } from 'node:module' import { mkdtemp, readFile, writeFile, readdir, mkdir, rm, utimes } from 'node:fs/promises' import { tmpdir } from 'node:os' diff --git a/tests/pr95-fixes.test.mjs b/tests/pr95-fixes.test.mjs index 82d8f03..8d9ecc1 100644 --- a/tests/pr95-fixes.test.mjs +++ b/tests/pr95-fixes.test.mjs @@ -1,6 +1,6 @@ import assert from 'node:assert/strict' import { readFileSync } from 'node:fs' -import { test } from 'vitest' +import { test } from 'vite-plus/test' import { formatActionError, runGuardedAction } from '../src/renderer/src/components/ui/actionError.ts' import { computeGuideCardPosition } from '../src/renderer/src/lib/guidePosition.ts' import { flattenVisibleTree, resolveTreeKeyAction } from '../src/renderer/src/lib/treeNavigation.ts' diff --git a/tests/privacy.test.mjs b/tests/privacy.test.mjs index 96c5a3a..0ac4afa 100644 --- a/tests/privacy.test.mjs +++ b/tests/privacy.test.mjs @@ -1,5 +1,5 @@ import assert from 'node:assert/strict' -import { test } from 'vitest' +import { test } from 'vite-plus/test' import { registerHooks } from 'node:module' import { resolve } from 'node:path' import { pathToFileURL } from 'node:url' diff --git a/tests/recording-state.test.mjs b/tests/recording-state.test.mjs index 83dc9de..642c38c 100644 --- a/tests/recording-state.test.mjs +++ b/tests/recording-state.test.mjs @@ -1,6 +1,6 @@ import assert from 'node:assert/strict' import { readFile } from 'node:fs/promises' -import { test } from 'vitest' +import { test } from 'vite-plus/test' import { ENSO_PHASES, HSR_END_YEAR, HSR_START_YEAR, SEA_LEVEL_SCENARIOS } from '../src/common/thematicState.ts' import { ensoPhaseOptions } from '../src/renderer/src/thematic/ensoPhases.ts' import { HSR_END_YEAR as rendererEndYear, HSR_START_YEAR as rendererStartYear } from '../src/renderer/src/thematic/hsrLines.ts' diff --git a/tests/recording.test.mjs b/tests/recording.test.mjs index d8581e5..226c20f 100644 --- a/tests/recording.test.mjs +++ b/tests/recording.test.mjs @@ -1,6 +1,6 @@ import assert from 'node:assert/strict' import { readFile } from 'node:fs/promises' -import { test } from 'vitest' +import { test } from 'vite-plus/test' const mainSource = await readFile(new URL('../src/main/index.ts', import.meta.url), 'utf8') const preloadSource = await readFile(new URL('../src/preload/index.ts', import.meta.url), 'utf8') diff --git a/tests/renderer-review.test.mjs b/tests/renderer-review.test.mjs index a4ffbeb..5be005a 100644 --- a/tests/renderer-review.test.mjs +++ b/tests/renderer-review.test.mjs @@ -1,5 +1,5 @@ import assert from 'node:assert/strict' -import { test, vi } from 'vitest' +import { test, vi } from 'vite-plus/test' import { registerHooks } from 'node:module' import { readFileSync } from 'node:fs' import { resolve } from 'node:path' diff --git a/tests/resource-failure.test.mjs b/tests/resource-failure.test.mjs index 10ce50a..8f050ff 100644 --- a/tests/resource-failure.test.mjs +++ b/tests/resource-failure.test.mjs @@ -1,5 +1,5 @@ import assert from 'node:assert/strict' -import { test } from 'vitest' +import { test } from 'vite-plus/test' import { describeResourceFailure, isRequestErrorShape, requestErrorRejectionLabel } from '../src/common/resourceFailure.ts' import { serveTileResponse, TILE_FAILURE_STATUS, tileFailureResponse } from '../src/common/tileProtocol.ts' diff --git a/tests/scene-camera.test.mjs b/tests/scene-camera.test.mjs index 560c5b3..b581cde 100644 --- a/tests/scene-camera.test.mjs +++ b/tests/scene-camera.test.mjs @@ -1,5 +1,5 @@ import assert from 'node:assert/strict' -import { test } from 'vitest' +import { test } from 'vite-plus/test' import * as Cesium from 'cesium' import { sanitizeCamera, sceneCameraView } from '../src/renderer/src/lib/sceneCamera.ts' diff --git a/tests/sea-level-seed.test.mjs b/tests/sea-level-seed.test.mjs index 7309563..b54ca05 100644 --- a/tests/sea-level-seed.test.mjs +++ b/tests/sea-level-seed.test.mjs @@ -1,6 +1,6 @@ import assert from 'node:assert/strict' import { readFile } from 'node:fs/promises' -import { test } from 'vitest' +import { test } from 'vite-plus/test' import { cacheKeyOf, coastalZones, gridPointsOf, heightCache, seaLevelGridPoints, seedSampleHeights } from '../src/renderer/src/thematic/seaLevelRise.ts' const mainSource = await readFile(new URL('../src/main/index.ts', import.meta.url), 'utf8') diff --git a/tests/sea-level.test.mjs b/tests/sea-level.test.mjs index eea61c5..cd268d2 100644 --- a/tests/sea-level.test.mjs +++ b/tests/sea-level.test.mjs @@ -1,5 +1,5 @@ import assert from 'node:assert/strict' -import { test } from 'vitest' +import { test } from 'vite-plus/test' import { SEA_LEVEL_SCENARIOS, buildLandMask, cacheKeyOf, cellAreaKm2, coastalZones, gridPointsOf, heightCache, inundationByZone, isLandCell, isInundated, recordSamples, seaLevelFacts, scenarioSummary, diff --git a/tests/shape-graphics.test.mjs b/tests/shape-graphics.test.mjs index 1a6c80f..19bd233 100644 --- a/tests/shape-graphics.test.mjs +++ b/tests/shape-graphics.test.mjs @@ -1,5 +1,5 @@ import assert from 'node:assert/strict' -import { test } from 'vitest' +import { test } from 'vite-plus/test' import { registerHooks } from 'node:module' import { resolve } from 'node:path' import { pathToFileURL } from 'node:url' diff --git a/tests/terrain-availability.test.mjs b/tests/terrain-availability.test.mjs index 86164f3..3c4cb26 100644 --- a/tests/terrain-availability.test.mjs +++ b/tests/terrain-availability.test.mjs @@ -1,5 +1,5 @@ import assert from 'node:assert/strict' -import { test } from 'vitest' +import { test } from 'vite-plus/test' import { withoutTileAvailability } from '../src/common/terrainAvailability.ts' function availabilityProbe() { diff --git a/tests/terrain-providers.test.mjs b/tests/terrain-providers.test.mjs index 689fc7e..3cb3907 100644 --- a/tests/terrain-providers.test.mjs +++ b/tests/terrain-providers.test.mjs @@ -1,6 +1,6 @@ import assert from 'node:assert/strict' import { readFile } from 'node:fs/promises' -import { test } from 'vitest' +import { test } from 'vite-plus/test' import { TERRAIN_PROVIDER_ID_SET, TERRAIN_PROVIDER_IDS } from '../src/common/terrainProviders.ts' const registrySource = await readFile(new URL('../src/renderer/src/terrain/terrainRegistry.ts', import.meta.url), 'utf8') diff --git a/tests/thematic-layer-ids.test.mjs b/tests/thematic-layer-ids.test.mjs index 9d92b5c..8926297 100644 --- a/tests/thematic-layer-ids.test.mjs +++ b/tests/thematic-layer-ids.test.mjs @@ -1,6 +1,6 @@ import assert from 'node:assert/strict' import { readFile } from 'node:fs/promises' -import { test } from 'vitest' +import { test } from 'vite-plus/test' import { THEMATIC_LAYER_ID_SET, THEMATIC_LAYER_IDS } from '../src/common/thematicLayers.ts' const climateSource = await readFile(new URL('../src/renderer/src/stores/climate.ts', import.meta.url), 'utf8') diff --git a/tests/thematic-request-render.test.mjs b/tests/thematic-request-render.test.mjs index 0470cae..e3e16d8 100644 --- a/tests/thematic-request-render.test.mjs +++ b/tests/thematic-request-render.test.mjs @@ -1,6 +1,6 @@ import assert from 'node:assert/strict' import { readFile } from 'node:fs/promises' -import { test } from 'vitest' +import { test } from 'vite-plus/test' const layersSource = await readFile(new URL('../src/renderer/src/composables/useThematicLayers.ts', import.meta.url), 'utf8') diff --git a/tests/theme-mode.test.mjs b/tests/theme-mode.test.mjs index 9f54ac4..7fe16fb 100644 --- a/tests/theme-mode.test.mjs +++ b/tests/theme-mode.test.mjs @@ -1,5 +1,5 @@ import assert from 'node:assert/strict' -import { test } from 'vitest' +import { test } from 'vite-plus/test' import { isThemeMode, normalizeThemeMode, resolveTheme, themeModes } from '../src/common/themeMode.ts' test('isThemeMode accepts only light, dark, and system', () => { diff --git a/tests/tile-mirror.test.mjs b/tests/tile-mirror.test.mjs index ff1466e..4bc7494 100644 --- a/tests/tile-mirror.test.mjs +++ b/tests/tile-mirror.test.mjs @@ -2,7 +2,7 @@ import assert from 'node:assert/strict' import { readFileSync } from 'node:fs' import { registerHooks } from 'node:module' import { resolve } from 'node:path' -import { test } from 'vitest' +import { test } from 'vite-plus/test' import { pathToFileURL } from 'node:url' import { attachOriginTerrainFallback } from '../src/common/terrainAvailability.ts' import { diff --git a/tests/touch-interaction.test.mjs b/tests/touch-interaction.test.mjs index b976dcb..01cb4eb 100644 --- a/tests/touch-interaction.test.mjs +++ b/tests/touch-interaction.test.mjs @@ -1,5 +1,5 @@ import assert from 'node:assert/strict' -import { test } from 'vitest' +import { test } from 'vite-plus/test' import { isTouchInteractionMode, normalizeTouchInteractionMode, diff --git a/tests/ui-no-antd.test.mjs b/tests/ui-no-antd.test.mjs index 6afe0cb..02d1de7 100644 --- a/tests/ui-no-antd.test.mjs +++ b/tests/ui-no-antd.test.mjs @@ -1,7 +1,7 @@ import assert from 'node:assert/strict' import { readdirSync, readFileSync } from 'node:fs' import { join, relative, resolve } from 'node:path' -import { test } from 'vitest' +import { test } from 'vite-plus/test' const SRC_ROOT = resolve('src') const FORBIDDEN_PATTERNS = [ diff --git a/tests/ui-triggers.test.mjs b/tests/ui-triggers.test.mjs index a744123..47686c6 100644 --- a/tests/ui-triggers.test.mjs +++ b/tests/ui-triggers.test.mjs @@ -2,7 +2,7 @@ import assert from 'node:assert/strict' import { readFileSync } from 'node:fs' import { registerHooks } from 'node:module' import { resolve } from 'node:path' -import { test } from 'vitest' +import { test } from 'vite-plus/test' import { pathToFileURL } from 'node:url' import { JSDOM } from 'jsdom' import { act, createElement } from 'react' diff --git a/tests/update-channel.test.mjs b/tests/update-channel.test.mjs index df35ae1..14dbacc 100644 --- a/tests/update-channel.test.mjs +++ b/tests/update-channel.test.mjs @@ -2,7 +2,7 @@ import assert from 'node:assert/strict' import { mkdirSync, mkdtempSync, readFileSync, realpathSync, rmSync, statSync, symlinkSync, writeFileSync } from 'node:fs' import { tmpdir } from 'node:os' import { delimiter, join } from 'node:path' -import { test } from 'vitest' +import { test } from 'vite-plus/test' import { updateInstallContent, updateReadyHint } from '../src/renderer/src/stores/updateCopy.ts' import { DEB_INSTALL_EXECUTABLE, diff --git a/tests/update-dialog.test.mjs b/tests/update-dialog.test.mjs index d974336..168fdc1 100644 --- a/tests/update-dialog.test.mjs +++ b/tests/update-dialog.test.mjs @@ -2,7 +2,7 @@ import assert from 'node:assert/strict' import { readFileSync } from 'node:fs' import { registerHooks } from 'node:module' import { resolve } from 'node:path' -import { test } from 'vitest' +import { test } from 'vite-plus/test' import { pathToFileURL } from 'node:url' import { JSDOM } from 'jsdom' import { JsxEmit, ModuleKind, ScriptTarget, transpileModule } from '@typescript/typescript6' diff --git a/tests/update-integrity.test.mjs b/tests/update-integrity.test.mjs index 811bf62..3d03824 100644 --- a/tests/update-integrity.test.mjs +++ b/tests/update-integrity.test.mjs @@ -3,7 +3,7 @@ import { createHash } from 'node:crypto' import { mkdtempSync, rmSync, writeFileSync } from 'node:fs' import { tmpdir } from 'node:os' import { join } from 'node:path' -import { test } from 'vitest' +import { test } from 'vite-plus/test' import { compareVersions, extractAssetDigest, hashFile, parseSha256, releaseTagCandidates } from '../src/main/updateIntegrity.ts' const HEX = 'a3b5c7d9e1f2031425364758697a8b9c0d1e2f30415263748596a7b8c9d0e1f2' diff --git a/tests/urban-cities.test.mjs b/tests/urban-cities.test.mjs index 263aa2b..d57e82b 100644 --- a/tests/urban-cities.test.mjs +++ b/tests/urban-cities.test.mjs @@ -1,5 +1,5 @@ import assert from 'node:assert/strict' -import { test } from 'vitest' +import { test } from 'vite-plus/test' import { CITY_TIER_META, cityTierOf, FUNCTIONAL_ZONES, functionalZoneCities, functionalZoneCityById, urbanCities } from '../src/renderer/src/thematic/urbanCities.ts' test('city tier metadata contains exactly five tiers with strictly shrinking service radii', () => { diff --git a/tests/viirs-granule.test.mjs b/tests/viirs-granule.test.mjs index d85520e..540419a 100644 --- a/tests/viirs-granule.test.mjs +++ b/tests/viirs-granule.test.mjs @@ -1,5 +1,5 @@ import assert from 'node:assert/strict' -import { test } from 'vitest' +import { test } from 'vite-plus/test' import { viirsCacheStyleId, viirsGranuleDate } from '../src/common/viirs.ts' test('viirsGranuleDate lags two UTC days behind the request time', () => { diff --git a/tsconfig.json b/tsconfig.json index e450151..31bac6e 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,24 +1,4 @@ { - "compilerOptions": { - "target": "ES2022", - "module": "ESNext", - "moduleResolution": "bundler", - "lib": ["ES2022", "DOM", "DOM.Iterable"], - "types": ["vite/client", "node"], - "strict": true, - "noEmit": true, - "skipLibCheck": true, - "esModuleInterop": true, - "resolveJsonModule": true, - "jsx": "preserve", - "paths": { - "@renderer/*": ["./src/renderer/src/*"] - } - }, - "include": [ - "src/renderer/src/**/*", - "src/renderer/src/**/*.vue", - "src/preload/index.d.ts", - "electron.vite.config.ts" - ] + "files": [], + "references": [{ "path": "./tsconfig.node.json" }, { "path": "./tsconfig.web.json" }] } diff --git a/tsconfig.node.json b/tsconfig.node.json index e13f0dc..402c7e0 100644 --- a/tsconfig.node.json +++ b/tsconfig.node.json @@ -14,6 +14,8 @@ "include": [ "src/common/**/*", "src/main/**/*", - "src/preload/index.ts" + "src/preload/index.ts", + "electron.vite.config.ts", + "vite.config.mts" ] } diff --git a/vite.config.mts b/vite.config.mts index e68b846..e0e216f 100644 --- a/vite.config.mts +++ b/vite.config.mts @@ -1,7 +1,10 @@ -import { defineConfig } from 'vitest/config' +import { liangmi } from '@liangmi/vp-config' -export default defineConfig({ +export default liangmi({ + // Lint rules and formatting are enabled in follow-ups. Until then, `vp check` only type-checks. + check: { fmt: false, lint: false }, test: { + environment: 'node', include: ['tests/*.test.mjs'], experimental: { viteModuleRunner: false } } From 394801d1ed13e25d75fad28f749fc5c3095e7019 Mon Sep 17 00:00:00 2001 From: Liang Date: Fri, 27 Nov 2026 06:17:39 +0800 Subject: [PATCH 5/9] build: enable lint rules Turn on the `@liangmi/vp-config` lint rules in `vp check`, and fix what they report. A few rules are off because they clash with how GuEarth is written, or because their fixes trust types that IPC and JSON payloads don't guarantee at runtime. Each one has a comment in `vite.config.mts`: - `unicorn/filename-case`, `import/no-default-export`, `import/no-named-as-default`: components use PascalCase files and default exports. - `unicorn/prefer-global-this`, `eslint/no-underscore-dangle`: the renderer uses `window` and Cesium's private `_` fields on purpose. - `unicorn/prefer-module`: the main process is bundled as CommonJS. - `eslint/max-classes-per-file`: stores and errors are classes. - `react-perf/*`: JSX props aren't memoized anywhere. - `typescript/no-unnecessary-condition`, `no-unnecessary-boolean-literal-compare`, `no-unnecessary-type-conversion`: the defensive checks they remove guard untyped runtime data. The boolean compare autofix turned `textFrame === true` into `undefined` for a missing value. - `typescript/prefer-nullish-coalescing`: `||` treats empty strings as missing on purpose. - `unicorn/no-array-sort`, `unicorn/no-array-reverse`: `toSorted` needs the ES2023 lib. - `unicorn/consistent-function-scoping`, `unicorn/max-nested-calls`, `promise/prefer-await-to-callbacks`, `typescript/method-signature-style`: style-only churn. --- vite.config.mts | 41 +++++++++++++++++++++++++++++++++++++++-- 1 file changed, 39 insertions(+), 2 deletions(-) diff --git a/vite.config.mts b/vite.config.mts index e0e216f..873b62f 100644 --- a/vite.config.mts +++ b/vite.config.mts @@ -1,8 +1,45 @@ import { liangmi } from '@liangmi/vp-config' export default liangmi({ - // Lint rules and formatting are enabled in follow-ups. Until then, `vp check` only type-checks. - check: { fmt: false, lint: false }, + // Formatting is enabled in a follow-up. Until then, `vp check` skips it. + check: { fmt: false }, + lint: [ + { + name: 'guearth/conventions', + rules: { + // React components and their files use PascalCase names and default exports. + 'unicorn/filename-case': 'off', + 'import/no-default-export': 'off', + 'import/no-named-as-default': 'off', + // The renderer talks to `window` and Cesium on purpose, including Cesium's private `_` fields. + 'unicorn/prefer-global-this': 'off', + 'eslint/no-underscore-dangle': 'off', + // The main process is bundled as CommonJS, so `__dirname` is valid there. + 'unicorn/prefer-module': 'off', + // Stores, errors and protocol readers are written as classes. + 'eslint/max-classes-per-file': 'off', + // JSX props are not memoized across the app, and there is no React Compiler to rely on. + 'react-perf/jsx-no-jsx-as-prop': 'off', + 'react-perf/jsx-no-new-object-as-prop': 'off', + 'react-perf/jsx-no-new-array-as-prop': 'off', + 'react-perf/jsx-no-new-function-as-prop': 'off', + // IPC and JSON payloads are validated defensively, even where their types say a value is always set. + 'typescript/no-unnecessary-condition': 'off', + 'typescript/no-unnecessary-boolean-literal-compare': 'off', + 'typescript/no-unnecessary-type-conversion': 'off', + // `||` treats empty strings as missing on purpose, such as for env variables. + 'typescript/prefer-nullish-coalescing': 'off', + // `toSorted` and `toReversed` need the ES2023 lib, and tsconfig targets ES2022. + 'unicorn/no-array-sort': 'off', + 'unicorn/no-array-reverse': 'off', + // Style-only rules that would move most helpers or rewrite callback-based Electron and Cesium APIs. + 'unicorn/consistent-function-scoping': 'off', + 'unicorn/max-nested-calls': 'off', + 'promise/prefer-await-to-callbacks': 'off', + 'typescript/method-signature-style': 'off' + } + } + ], test: { environment: 'node', include: ['tests/*.test.mjs'], From 767ac2dbf7e8bbc23b8c3a794526a186b94d71ea Mon Sep 17 00:00:00 2001 From: Liang Date: Fri, 27 Nov 2026 06:17:39 +0800 Subject: [PATCH 6/9] style: apply lint autofixes Apply `vp lint --fix`, then repair what it got wrong: - Keep `thinkingLevels` typed as a `Set` after `prefer-set-has`. - Keep the shape `kind` literal type that `no-unnecessary-type-assertion` dropped. - Match the `node:` specifiers from `prefer-node-protocol` in the tests' module stubs and resolve hooks. - Update source-text assertions for the braces from `curly` and the `() => {}` from `no-useless-undefined`. --- electron.vite.config.ts | 10 +- scripts/fetch-ffmpeg.mjs | 74 +-- scripts/fetch-hawdb.mjs | 44 +- src/common/aiTelemetry.ts | 16 +- src/common/flightStops.ts | 40 +- src/common/globeSurface.ts | 22 +- src/common/logger.ts | 16 +- src/common/mirrorPolicies.ts | 2 +- src/common/networkProxy.ts | 14 +- src/common/onlineData.ts | 4 +- src/common/passport.ts | 135 ++--- src/common/privacy.ts | 10 +- src/common/resourceFailure.ts | 4 +- src/common/terrainAvailability.ts | 16 +- src/common/themeMode.ts | 2 +- src/common/tileMirror.ts | 84 +-- src/common/tileProtocol.ts | 8 +- src/common/touchInteraction.ts | 4 +- src/main/account.ts | 129 ++--- src/main/ai/agent.ts | 304 +++++------ src/main/ai/amap.ts | 38 +- src/main/ai/baidu.ts | 36 +- src/main/ai/chatHistoryStore.ts | 70 +-- src/main/ai/hawdb/client.ts | 63 ++- src/main/ai/hawdb/engine.ts | 93 ++-- src/main/ai/hawdb/ffi.ts | 70 +-- src/main/ai/hawdb/graphBuilder.ts | 48 +- src/main/ai/hawdb/jsonCodec.ts | 58 +- src/main/ai/hawdb/paths.ts | 8 +- src/main/ai/hawdb/schema.ts | 2 +- src/main/ai/hawdb/worker.ts | 41 +- src/main/ai/knowledge/index.ts | 20 +- src/main/ai/locationAnalysis.ts | 17 +- src/main/ai/memoryStore.ts | 20 +- src/main/ai/modelImporter.ts | 109 ++-- src/main/ai/modelTest.ts | 32 +- src/main/ai/poiAggregation.ts | 2 +- src/main/ai/poiCategories.ts | 2 +- src/main/ai/posthog.ts | 22 +- src/main/ai/responseReader.ts | 6 +- src/main/ai/search/baidu.ts | 26 +- src/main/ai/search/index.ts | 13 +- src/main/ai/searchThrottle.ts | 6 +- src/main/ai/settingsStore.ts | 18 +- src/main/datasets.ts | 49 +- src/main/ffmpeg.ts | 8 +- src/main/geo.ts | 18 +- src/main/geo/gcj02.ts | 4 +- src/main/index.ts | 497 +++++++++--------- src/main/jsonStore.ts | 12 +- src/main/keyVault.ts | 14 +- src/main/laboratory.ts | 10 +- src/main/offscreenMac.ts | 81 +-- src/main/offscreenPaths.ts | 6 +- src/main/offscreenTiming.ts | 6 +- src/main/onlineData.ts | 22 +- src/main/posthogLogs.ts | 25 +- src/main/qweather.ts | 41 +- src/main/storagePath.ts | 10 +- src/main/tileCacheFiles.ts | 12 +- src/main/tileWarp.ts | 24 +- src/main/updateChannel.ts | 82 +-- src/main/updateIntegrity.ts | 50 +- src/main/updater.ts | 112 ++-- src/preload/index.d.ts | 2 +- src/preload/index.ts | 7 +- src/renderer/src/App.tsx | 72 +-- src/renderer/src/ai/annotationTools.ts | 135 ++--- src/renderer/src/ai/populationTools.ts | 6 +- src/renderer/src/ai/registerGlobeTools.ts | 168 +++--- .../src/components/AnnotationPanel.tsx | 43 +- .../src/components/AtmosphereLayersPanel.tsx | 11 +- src/renderer/src/components/CameraStatus.tsx | 4 +- src/renderer/src/components/CitiesPanel.tsx | 40 +- src/renderer/src/components/ContextMeter.tsx | 8 +- .../src/components/DrawingEditToolbar.tsx | 6 +- .../src/components/DrawingTouchBar.tsx | 2 +- .../src/components/EarthLayersPanel.tsx | 6 +- src/renderer/src/components/EnsoPanel.tsx | 5 +- .../src/components/EnvironmentPanel.tsx | 23 +- src/renderer/src/components/EoqAssistant.tsx | 37 +- src/renderer/src/components/ExogenicPanel.tsx | 10 +- src/renderer/src/components/FailureBanner.tsx | 7 +- src/renderer/src/components/FirstUseGuide.tsx | 72 ++- .../src/components/FlightStopSwitcher.tsx | 10 +- .../src/components/FoldFaultPanel.tsx | 10 +- .../src/components/FrontalCyclone.tsx | 10 +- src/renderer/src/components/GlobeToolbar.tsx | 2 +- src/renderer/src/components/HuLineOverlay.tsx | 10 +- .../src/components/InlineTextEditor.tsx | 17 +- .../src/components/LandformGuidePanel.tsx | 12 +- src/renderer/src/components/LayerPanel.tsx | 16 +- .../src/components/LocationDecisionPanel.tsx | 6 +- .../src/components/MemorySettings.tsx | 12 +- .../src/components/MirrorConsentModal.tsx | 7 +- .../src/components/MirrorPolicyModal.tsx | 15 +- src/renderer/src/components/MonthTimeline.tsx | 8 +- .../src/components/OceanPropertyPanel.tsx | 7 +- .../src/components/PlaceSearchBox.tsx | 37 +- .../src/components/PopulationPanel.tsx | 10 +- .../src/components/RiverLandformPanel.tsx | 33 +- .../src/components/RotationSpeedPanel.tsx | 5 +- .../src/components/SceneBookmarksPanel.tsx | 8 +- .../src/components/ScenePlayerOverlay.tsx | 17 +- .../src/components/SearchProviderSettings.tsx | 14 +- src/renderer/src/components/SettingsModal.tsx | 36 +- .../src/components/SolarChartPanel.tsx | 21 +- .../src/components/SolarPathPanel.tsx | 29 +- .../src/components/SolarTimePanel.tsx | 11 +- .../src/components/StreamingMarkdown.tsx | 33 +- src/renderer/src/components/TeachingLab.tsx | 45 +- .../src/components/ThematicInfoCard.tsx | 4 +- .../src/components/ThematicLegend.tsx | 23 +- .../components/ThermalCirculationPanel.tsx | 10 +- src/renderer/src/components/TideWavePanel.tsx | 2 +- src/renderer/src/components/TimezonePanel.tsx | 4 +- .../src/components/TransportPanel.tsx | 26 +- .../src/components/TyphoonOverlay.tsx | 8 +- src/renderer/src/components/UpdateDialog.tsx | 5 +- .../components/WalkerCirculationOverlay.tsx | 35 +- .../src/components/WaterBodyPanel.tsx | 13 +- .../src/components/WaterCyclePanel.tsx | 10 +- src/renderer/src/components/WindParticles.tsx | 66 +-- .../src/components/WindowControls.tsx | 10 +- src/renderer/src/components/YearTimeline.tsx | 4 +- .../src/components/ZonationFlightHud.tsx | 5 +- src/renderer/src/components/ZonationPanel.tsx | 42 +- .../src/components/charts/BarChart.tsx | 5 +- .../src/components/charts/EChartBase.tsx | 8 +- .../src/components/charts/LineChart.tsx | 7 +- .../src/components/eoq/EoqComposer.tsx | 17 +- .../src/components/eoq/EoqIconButton.tsx | 10 +- .../src/components/eoq/EoqMarkdownText.tsx | 3 +- .../src/components/eoq/EoqMessages.tsx | 70 ++- .../src/components/eoq/EoqReasoning.tsx | 15 +- .../src/components/eoq/EoqRuntimeProvider.tsx | 39 +- .../src/components/eoq/EoqToolCall.tsx | 22 +- .../src/components/eoq/EoqToolGroup.tsx | 6 +- .../src/components/eoq/EoqWebSearch.tsx | 2 +- .../src/components/eoq/collapsible.tsx | 5 +- .../src/components/settings/AboutSettings.tsx | 2 +- .../components/settings/AccountSettings.tsx | 14 +- .../components/settings/AiSettingsSection.tsx | 113 ++-- .../components/settings/GeneralSettings.tsx | 10 +- .../settings/LaboratorySettings.tsx | 46 +- .../src/components/settings/MapSettings.tsx | 39 +- .../components/settings/PrivacySettings.tsx | 17 +- .../components/settings/UnsavedChangesBar.tsx | 4 +- src/renderer/src/components/ui/actionError.ts | 6 +- src/renderer/src/components/ui/alert.tsx | 8 +- src/renderer/src/components/ui/badge.tsx | 7 +- src/renderer/src/components/ui/button.tsx | 10 +- src/renderer/src/components/ui/checkbox.tsx | 2 +- src/renderer/src/components/ui/dialog.tsx | 39 +- src/renderer/src/components/ui/drawer.tsx | 2 +- .../src/components/ui/dropdown-menu.tsx | 9 +- src/renderer/src/components/ui/input.tsx | 23 +- .../src/components/ui/month-day-picker.tsx | 2 +- src/renderer/src/components/ui/pagination.tsx | 20 +- src/renderer/src/components/ui/popconfirm.tsx | 12 +- src/renderer/src/components/ui/popover.tsx | 11 +- .../src/components/ui/radio-group.tsx | 4 +- src/renderer/src/components/ui/segmented.tsx | 4 +- src/renderer/src/components/ui/select.tsx | 9 +- src/renderer/src/components/ui/slider.tsx | 4 +- src/renderer/src/components/ui/spinner.tsx | 2 +- src/renderer/src/components/ui/tabs.tsx | 2 +- src/renderer/src/components/ui/toast.tsx | 6 +- src/renderer/src/components/ui/tooltip.tsx | 5 +- .../src/composables/basemapImagery.ts | 2 +- src/renderer/src/composables/polarCaps.ts | 2 +- .../src/composables/seaLevelSampling.ts | 4 +- src/renderer/src/composables/terrainFlight.ts | 19 +- .../src/composables/useCesiumViewer.ts | 294 ++++++----- src/renderer/src/composables/useDrawing.ts | 112 ++-- .../src/composables/useScenePlayer.ts | 96 ++-- .../src/composables/useThematicLayers.ts | 230 ++++---- .../src/composables/useTimezoneCompare.ts | 14 +- .../src/composables/useTransectFlight.ts | 73 +-- .../src/composables/useVisibleAnimation.ts | 4 +- src/renderer/src/lib/aiSettingsDraft.ts | 8 +- src/renderer/src/lib/annotationReferences.ts | 4 +- src/renderer/src/lib/crashReporter.ts | 16 +- src/renderer/src/lib/flightFraming.ts | 12 +- src/renderer/src/lib/polygonArea.ts | 46 +- src/renderer/src/lib/privacyRuntime.ts | 4 +- src/renderer/src/lib/sceneCamera.ts | 6 +- src/renderer/src/lib/shapeGraphics.ts | 20 +- src/renderer/src/lib/transect.ts | 14 +- src/renderer/src/lib/treeNavigation.ts | 6 +- src/renderer/src/lib/utils.ts | 3 +- src/renderer/src/main.tsx | 4 +- src/renderer/src/offscreen.tsx | 62 +-- src/renderer/src/offscreenEncoder.ts | 40 +- src/renderer/src/offscreenText.ts | 4 +- src/renderer/src/posthog.ts | 21 +- src/renderer/src/stores/account.ts | 28 +- src/renderer/src/stores/ai.ts | 110 ++-- src/renderer/src/stores/climate.ts | 2 +- src/renderer/src/stores/drawing.ts | 68 +-- src/renderer/src/stores/failure.ts | 6 +- src/renderer/src/stores/flightStops.ts | 19 +- src/renderer/src/stores/globe.ts | 96 ++-- src/renderer/src/stores/onlineData.ts | 8 +- src/renderer/src/stores/privacy.ts | 13 +- src/renderer/src/stores/scenes.ts | 4 +- src/renderer/src/stores/solar.ts | 19 +- src/renderer/src/stores/transport.ts | 2 +- src/renderer/src/stores/updateCopy.ts | 8 +- src/renderer/src/stores/updater.ts | 20 +- src/renderer/src/terrain/terrainRegistry.ts | 3 +- .../src/thematic/agriculturalRegions.ts | 76 +-- src/renderer/src/thematic/climateZones.ts | 48 +- src/renderer/src/thematic/coriolis.ts | 12 +- src/renderer/src/thematic/decisionSandbox.ts | 4 +- src/renderer/src/thematic/ensoPhases.ts | 14 +- src/renderer/src/thematic/hsrLines.ts | 26 +- src/renderer/src/thematic/industrialBases.ts | 34 +- src/renderer/src/thematic/koppenZones.ts | 2 +- src/renderer/src/thematic/liveTyphoons.ts | 6 +- src/renderer/src/thematic/monsoonArrows.ts | 2 +- src/renderer/src/thematic/mountainZonation.ts | 20 +- src/renderer/src/thematic/notablePeaks.ts | 2 +- src/renderer/src/thematic/oceanCurrents.ts | 6 +- src/renderer/src/thematic/plateBoundaries.ts | 4 +- src/renderer/src/thematic/populationCensus.ts | 42 +- src/renderer/src/thematic/pressureBelts.ts | 4 +- src/renderer/src/thematic/rainBelt.ts | 22 +- src/renderer/src/thematic/seaLevelRise.ts | 56 +- src/renderer/src/thematic/solarMath.ts | 20 +- src/renderer/src/thematic/urbanCities.ts | 16 +- src/renderer/src/thematic/volcanoes.ts | 4 +- src/renderer/src/thematic/windField.ts | 2 +- src/renderer/src/utils/markdown.ts | 33 +- tests/account-login.test.mjs | 40 +- tests/account-store.test.mjs | 8 +- tests/agri-regions.test.mjs | 6 +- tests/ai-history.test.mjs | 10 +- tests/ai-settings-draft.test.mjs | 6 +- tests/button-loading-icon.test.mjs | 30 +- tests/drawing-store.test.mjs | 4 +- tests/eoq-ui.test.mjs | 6 +- tests/ffmpeg-fetch.test.mjs | 18 +- tests/flight-framing.test.mjs | 30 +- tests/flight-stops.test.mjs | 38 +- tests/gcj02.test.mjs | 4 +- tests/globe-navigation.test.mjs | 28 +- tests/globe-surface.test.mjs | 20 +- tests/hawdb-fetch.test.mjs | 2 +- tests/hawdb.test.mjs | 8 +- tests/hsr-lines.test.mjs | 6 +- tests/migration-geometry.test.mjs | 2 +- tests/model-importer.test.mjs | 44 +- tests/model-test.test.mjs | 4 +- tests/mountain-zonation.test.mjs | 22 +- tests/night-basemap.test.mjs | 2 +- tests/notable-peaks.test.mjs | 4 +- tests/offscreen-mac.test.mjs | 240 ++++----- tests/offscreen-paths.test.mjs | 14 +- tests/offscreen-state.test.mjs | 4 +- tests/offscreen-timing.test.mjs | 16 +- tests/online-data.test.mjs | 34 +- tests/packaging.test.mjs | 20 +- tests/passport-account.test.mjs | 10 +- tests/poi-aggregation.test.mjs | 4 +- tests/poi-categories.test.mjs | 2 +- tests/population-layer.test.mjs | 16 +- tests/pr-review.test.mjs | 26 +- tests/pr95-fixes.test.mjs | 2 +- tests/privacy.test.mjs | 10 +- tests/recording-state.test.mjs | 2 +- tests/recording.test.mjs | 26 +- tests/renderer-review.test.mjs | 6 +- tests/resource-failure.test.mjs | 2 +- tests/sea-level-seed.test.mjs | 2 +- tests/sea-level.test.mjs | 2 +- tests/shape-graphics.test.mjs | 42 +- tests/terrain-availability.test.mjs | 12 +- tests/tile-mirror.test.mjs | 34 +- tests/ui-no-antd.test.mjs | 4 +- tests/ui-triggers.test.mjs | 2 +- tests/update-channel.test.mjs | 6 +- tests/update-dialog.test.mjs | 6 +- tests/update-integrity.test.mjs | 2 +- tests/urban-cities.test.mjs | 2 +- 285 files changed, 3846 insertions(+), 3879 deletions(-) diff --git a/electron.vite.config.ts b/electron.vite.config.ts index a141d2b..439a3eb 100644 --- a/electron.vite.config.ts +++ b/electron.vite.config.ts @@ -1,5 +1,5 @@ -import { cpSync, createReadStream, existsSync, statSync } from 'fs' -import { extname, join, resolve, sep } from 'path' +import { cpSync, createReadStream, existsSync, statSync } from 'node:fs' +import { extname, join, resolve, sep } from 'node:path' import { defineConfig } from 'electron-vite' import type { Connect, Plugin } from 'vite' import react from '@vitejs/plugin-react' @@ -22,8 +22,8 @@ const cesiumMimeTypes: Record = { const serveCesiumAsset: Connect.NextHandleFunction = (req, res, next) => { const assetPath = resolve(cesiumBuild, `.${(req.url ?? '/').split('?')[0]}`) - if (!assetPath.startsWith(cesiumBuild + sep)) return next() - if (!existsSync(assetPath) || !statSync(assetPath).isFile()) return next() + if (!assetPath.startsWith(cesiumBuild + sep)) { next(); return;} + if (!existsSync(assetPath) || !statSync(assetPath).isFile()) { next(); return;} res.setHeader('Content-Type', cesiumMimeTypes[extname(assetPath).toLowerCase()] ?? 'application/octet-stream') res.setHeader('Cache-Control', 'no-cache') createReadStream(assetPath).pipe(res) @@ -37,7 +37,7 @@ function cesiumStaticPlugin(): Plugin { }, writeBundle(options) { const outDir = options.dir - if (!outDir) return + if (!outDir) {return} for (const dir of cesiumDirs) { cpSync(join(cesiumBuild, dir), join(outDir, 'cesium', dir), { recursive: true }) } diff --git a/scripts/fetch-ffmpeg.mjs b/scripts/fetch-ffmpeg.mjs index 721b8ba..89141b0 100644 --- a/scripts/fetch-ffmpeg.mjs +++ b/scripts/fetch-ffmpeg.mjs @@ -19,11 +19,11 @@ export const FFMPEG_BUILDS = { arch: 'x64', archiveName: 'ffmpeg-8.1.3-win32-x64-lgpl.tar.xz', archiveSha256: '73422b77282a70b3012e4dc43ce6acbb220399a75039cc2bf15ce7b1ccf7993b', - archiveBytes: 127358740, + archiveBytes: 127_358_740, binaryMemberPath: 'ffmpeg-8.1.3-win32-x64-lgpl/bin/ffmpeg.exe', binaryName: 'ffmpeg.exe', binarySha256: '77e7a67a4651fad7b7b4e5802272229a15f7e8b9491ace4c637a160594889b85', - binaryBytes: 132246016 + binaryBytes: 132_246_016 }, 'linux-x64': { version: ffmpegVersion, @@ -31,11 +31,11 @@ export const FFMPEG_BUILDS = { arch: 'x64', archiveName: 'ffmpeg-8.1.3-linux-x64-lgpl.tar.xz', archiveSha256: 'f31e025dc380fd4aa99dd4dc98eeeea631e16f0a9f3703c31e4cc02e653a5a60', - archiveBytes: 136051144, + archiveBytes: 136_051_144, binaryMemberPath: 'ffmpeg-8.1.3-linux-x64-lgpl/bin/ffmpeg', binaryName: 'ffmpeg', binarySha256: 'c52d9dd02bb63874f9d2c5ab96c96f043ca450f4ec6ecdf495a0c93659be1066', - binaryBytes: 140970184 + binaryBytes: 140_970_184 }, 'linux-arm64': { version: ffmpegVersion, @@ -43,11 +43,11 @@ export const FFMPEG_BUILDS = { arch: 'arm64', archiveName: 'ffmpeg-8.1.3-linux-arm64-lgpl.tar.xz', archiveSha256: 'cdfcf36dc159c8173df9b970bc145d41a9092a26de0e49bc56c61ad171de1c59', - archiveBytes: 115301160, + archiveBytes: 115_301_160, binaryMemberPath: 'ffmpeg-8.1.3-linux-arm64-lgpl/bin/ffmpeg', binaryName: 'ffmpeg', binarySha256: 'bda9af06fd166c83dc43097477d34c25eebe077ebe4e21d646b605f710d59c70', - binaryBytes: 116169984 + binaryBytes: 116_169_984 } } @@ -62,8 +62,8 @@ const maxArchiveRedirects = 5 const pinnedArchiveNames = new Set(Object.values(FFMPEG_BUILDS).map((build) => build.archiveName)) export function normalizeFfmpegArch(arch) { - if (arch === 'x64' || arch === 'x86_64' || arch === 'amd64') return 'x64' - if (arch === 'arm64' || arch === 'aarch64') return 'arm64' + if (arch === 'x64' || arch === 'x86_64' || arch === 'amd64') {return 'x64'} + if (arch === 'arm64' || arch === 'aarch64') {return 'arm64'} return arch } @@ -102,17 +102,17 @@ function rejectedArchiveLabel(url) { export function isApprovedArchiveUrl(url) { const parsed = parseArchiveUrl(url) - return parsed != null && parsed.protocol === 'https:' && APPROVED_ARCHIVE_HOSTS.includes(parsed.hostname) + return parsed?.protocol === 'https:' && APPROVED_ARCHIVE_HOSTS.includes(parsed.hostname) } export function isApprovedArchiveRedirectUrl(url) { const parsed = parseArchiveUrl(url) - if (parsed == null || parsed.protocol !== 'https:') return false + if (parsed?.protocol !== 'https:') {return false} return APPROVED_ARCHIVE_HOSTS.includes(parsed.hostname) || APPROVED_ARCHIVE_REDIRECT_HOSTS.includes(parsed.hostname) } export function archiveRedirectTarget(location, currentUrl) { - if (location == null || location === '') throw new Error(`下载重定向缺少目标地址:${rejectedArchiveLabel(currentUrl)}`) + if (location == null || location === '') {throw new Error(`下载重定向缺少目标地址:${rejectedArchiveLabel(currentUrl)}`)} let resolved = null try { resolved = new URL(location, currentUrl).href @@ -127,7 +127,7 @@ export function archiveRedirectTarget(location, currentUrl) { export function matchesPinnedArchivePath(url) { const parsed = parseArchiveUrl(url) - if (parsed == null || parsed.search !== '' || parsed.hash !== '') return false + if (parsed?.search !== '' || parsed.hash !== '') {return false} const name = parsed.pathname.slice(parsed.pathname.lastIndexOf('/') + 1) return pinnedArchiveNames.has(name) && parsed.pathname.endsWith(`/v${ffmpegVersion}/${name}`) } @@ -158,7 +158,7 @@ export function assertArchiveSource(url) { export function archiveSources(overrideUrl, build = hostFfmpegBuild()) { const pinned = pinnedArchiveUrls(build) - if (!overrideUrl) return [...pinned] + if (!overrideUrl) {return [...pinned]} return [approvedArchiveSource(overrideUrl), ...pinned] } @@ -169,18 +169,18 @@ export function sha256Text(text) { export function defaultBinaryPath(repoRoot, platform = process.platform, arch = process.arch) { const normalized = normalizeFfmpegArch(arch) const build = FFMPEG_BUILDS[`${platform}-${normalized}`] - if (!build) return join(repoRoot, 'resources', 'bin', 'ffmpeg.exe') - if (build.platform !== 'linux') return join(repoRoot, 'resources', 'bin', build.binaryName) + if (!build) {return join(repoRoot, 'resources', 'bin', 'ffmpeg.exe')} + if (build.platform !== 'linux') {return join(repoRoot, 'resources', 'bin', build.binaryName)} const isHost = platform === process.platform && normalized === normalizeFfmpegArch(process.arch) - if (isHost) return join(repoRoot, 'resources', 'bin', build.binaryName) + if (isHost) {return join(repoRoot, 'resources', 'bin', build.binaryName)} return join(repoRoot, 'resources', 'bin', normalized, build.binaryName) } export function packagedBinaryPath(repoRoot, platform = process.platform, arch = process.arch) { const normalized = normalizeFfmpegArch(arch) const build = FFMPEG_BUILDS[`${platform}-${normalized}`] - if (!build) return defaultBinaryPath(repoRoot, platform, arch) - if (build.platform === 'linux') return join(repoRoot, 'resources', 'bin', normalized, build.binaryName) + if (!build) {return defaultBinaryPath(repoRoot, platform, arch)} + if (build.platform === 'linux') {return join(repoRoot, 'resources', 'bin', normalized, build.binaryName)} return join(repoRoot, 'resources', 'bin', build.binaryName) } @@ -193,7 +193,7 @@ function outputPaths(repoRoot, build) { async function sha256File(path) { const hash = createHash('sha256') - for await (const chunk of createReadStream(path)) hash.update(chunk) + for await (const chunk of createReadStream(path)) {hash.update(chunk)} return hash.digest('hex') } @@ -203,24 +203,24 @@ export async function verifyFile(path, { sha256, bytes }) { return { ok: false, reason: `大小不符(期望 ${bytes} 字节,实际 ${info.size} 字节)` } } const digest = await sha256File(path) - if (digest !== sha256) return { ok: false, reason: `SHA256 不符(期望 ${sha256},实际 ${digest})` } + if (digest !== sha256) {return { ok: false, reason: `SHA256 不符(期望 ${sha256},实际 ${digest})` }} return { ok: true } } export async function verifyFfmpegBinary(path, build = hostFfmpegBuild()) { - if (!existsSync(path)) return { ok: false, reason: `文件不存在:${path}` } + if (!existsSync(path)) {return { ok: false, reason: `文件不存在:${path}` }} return verifyFile(path, { sha256: build.binarySha256, bytes: build.binaryBytes }) } async function binaryMatches(path, build) { - if (!existsSync(path)) return false + if (!existsSync(path)) {return false} const current = await verifyFile(path, { sha256: build.binarySha256, bytes: build.binaryBytes }) return current.ok } function tarCommand() { - if (process.platform !== 'win32') return 'tar' - const systemTar = join(process.env.SystemRoot ?? 'C:\\Windows', 'System32', 'tar.exe') + if (process.platform !== 'win32') {return 'tar'} + const systemTar = join(process.env.SystemRoot ?? String.raw`C:\Windows`, 'System32', 'tar.exe') return existsSync(systemTar) ? systemTar : 'tar' } @@ -229,8 +229,8 @@ async function fetchArchive(url) { let current = url for (let hop = 0; hop <= maxArchiveRedirects; hop += 1) { const response = await fetch(current, { redirect: 'manual', headers: { 'user-agent': 'GuEarth-FFmpeg-Fetch' } }) - if (response.status < 300 || response.status >= 400) return response - if (hop === maxArchiveRedirects) break + if (response.status < 300 || response.status >= 400) {return response} + if (hop === maxArchiveRedirects) {break} current = archiveRedirectTarget(response.headers.get('location'), current) } throw new Error(`下载重定向次数过多:${rejectedArchiveLabel(url)}`) @@ -239,7 +239,7 @@ async function fetchArchive(url) { async function download(url, destination) { console.log(`下载内置视频编码器:${url}`) const response = await fetchArchive(url) - if (!response.ok || response.body == null) throw new Error(`HTTP ${response.status}`) + if (!response.ok || response.body == null) {throw new Error(`HTTP ${response.status}`)} await pipeline(Readable.fromWeb(response.body), createWriteStream(destination)) } @@ -248,7 +248,7 @@ async function placeBinary(extracted, targets) { await mkdir(dirname(target), { recursive: true }) await rm(target, { force: true }) await copyFile(extracted, target) - if (process.platform !== 'win32') await chmod(target, 0o755) + if (process.platform !== 'win32') {await chmod(target, 0o755)} } } @@ -271,14 +271,14 @@ export async function fetchFfmpeg({ repoRoot, force = false, platform = process. await copyFile(localArchive, archivePath) console.log(`使用本地归档:${localArchive}`) const localCheck = await verifyFile(archivePath, { sha256: build.archiveSha256, bytes: build.archiveBytes }) - if (!localCheck.ok) throw new Error(`归档校验失败:${localCheck.reason}`) + if (!localCheck.ok) {throw new Error(`归档校验失败:${localCheck.reason}`)} } else { let lastError = null for (const source of archiveSources(process.env.FFMPEG_FETCH_URL, build)) { try { await download(source, archivePath) const sourceCheck = await verifyFile(archivePath, { sha256: build.archiveSha256, bytes: build.archiveBytes }) - if (!sourceCheck.ok) throw new Error(`归档校验失败:${sourceCheck.reason}`) + if (!sourceCheck.ok) {throw new Error(`归档校验失败:${sourceCheck.reason}`)} lastError = null break } catch (error) { @@ -286,12 +286,12 @@ export async function fetchFfmpeg({ repoRoot, force = false, platform = process. console.warn(`来源不可用:${error instanceof Error ? error.message : String(error)}`) } } - if (lastError) throw lastError + if (lastError) {throw lastError} } await runFile(tarCommand(), ['-xf', archivePath, '-C', workDirectory, build.binaryMemberPath], { windowsHide: true }) const extracted = join(workDirectory, build.binaryMemberPath) const binaryCheck = await verifyFile(extracted, { sha256: build.binarySha256, bytes: build.binaryBytes }) - if (!binaryCheck.ok) throw new Error(`编码器校验失败:${binaryCheck.reason}`) + if (!binaryCheck.ok) {throw new Error(`编码器校验失败:${binaryCheck.reason}`)} await placeBinary(extracted, targets) console.log(`内置视频编码器已更新:${targets.join('、')}`) return targets[0] @@ -302,18 +302,18 @@ export async function fetchFfmpeg({ repoRoot, force = false, platform = process. function buildsFromArgs(argv) { const index = argv.indexOf('--arch') - if (index < 0) return [ffmpegBuildFor(process.platform, process.arch)] + if (index === -1) {return [ffmpegBuildFor(process.platform, process.arch)]} const value = argv[index + 1] - if (!value || value.startsWith('--')) throw new Error('请在 --arch 后指定 x64、arm64 或 all') - if (value === 'all') return [FFMPEG_BUILDS['linux-x64'], FFMPEG_BUILDS['linux-arm64']] - if (argv.includes('--linux') || process.platform === 'linux') return [ffmpegBuildFor('linux', value)] + if (!value || value.startsWith('--')) {throw new Error('请在 --arch 后指定 x64、arm64 或 all')} + if (value === 'all') {return [FFMPEG_BUILDS['linux-x64'], FFMPEG_BUILDS['linux-arm64']]} + if (argv.includes('--linux') || process.platform === 'linux') {return [ffmpegBuildFor('linux', value)]} return [ffmpegBuildFor(process.platform, value)] } const runsAsScript = process.argv[1] != null && pathToFileURL(resolve(process.argv[1])).href === import.meta.url if (runsAsScript) { - const repoRoot = resolve(dirname(fileURLToPath(import.meta.url)), '..') + const repoRoot = resolve(import.meta.dirname, '..') const force = process.argv.includes('--force') Promise.all(buildsFromArgs(process.argv).map((build) => fetchFfmpeg({ repoRoot, diff --git a/scripts/fetch-hawdb.mjs b/scripts/fetch-hawdb.mjs index f978034..8df6f48 100644 --- a/scripts/fetch-hawdb.mjs +++ b/scripts/fetch-hawdb.mjs @@ -82,8 +82,8 @@ const maxArchiveRedirects = 5 const pinnedArchiveNames = new Set(Object.values(HAWDB_BUILDS).map((build) => build.archiveName)) export function normalizeHawdbArch(arch) { - if (arch === 'x64' || arch === 'x86_64' || arch === 'amd64') return 'x64' - if (arch === 'arm64' || arch === 'aarch64') return 'arm64' + if (arch === 'x64' || arch === 'x86_64' || arch === 'amd64') {return 'x64'} + if (arch === 'arm64' || arch === 'aarch64') {return 'arm64'} return arch } @@ -119,17 +119,17 @@ function rejectedArchiveLabel(url) { export function isApprovedArchiveUrl(url) { const parsed = parseArchiveUrl(url) - return parsed != null && parsed.protocol === 'https:' && APPROVED_ARCHIVE_HOSTS.includes(parsed.hostname) + return parsed?.protocol === 'https:' && APPROVED_ARCHIVE_HOSTS.includes(parsed.hostname) } export function isApprovedArchiveRedirectUrl(url) { const parsed = parseArchiveUrl(url) - if (parsed == null || parsed.protocol !== 'https:') return false + if (parsed?.protocol !== 'https:') {return false} return APPROVED_ARCHIVE_HOSTS.includes(parsed.hostname) || APPROVED_ARCHIVE_REDIRECT_HOSTS.includes(parsed.hostname) } export function archiveRedirectTarget(location, currentUrl) { - if (location == null || location === '') throw new Error(`下载重定向缺少目标地址:${rejectedArchiveLabel(currentUrl)}`) + if (location == null || location === '') {throw new Error(`下载重定向缺少目标地址:${rejectedArchiveLabel(currentUrl)}`)} let resolved = null try { resolved = new URL(location, currentUrl).href @@ -144,7 +144,7 @@ export function archiveRedirectTarget(location, currentUrl) { export function matchesPinnedArchivePath(url) { const parsed = parseArchiveUrl(url) - if (parsed == null || parsed.search !== '' || parsed.hash !== '') return false + if (parsed?.search !== '' || parsed.hash !== '') {return false} const name = parsed.pathname.slice(parsed.pathname.lastIndexOf('/') + 1) return pinnedArchiveNames.has(name) && parsed.pathname.endsWith(`/v${HAWDB_VERSION}/${name}`) } @@ -166,18 +166,18 @@ export function assertFetchableUrl(url) { export function defaultHawdbBinaryPath(repoRoot, platform = process.platform, arch = process.arch) { const normalized = normalizeHawdbArch(arch) const build = HAWDB_BUILDS[`${platform}-${normalized}`] - if (!build) return join(repoRoot, 'resources', 'bin', 'hawdb_ffi.dll') - if (build.platform === 'win32') return join(repoRoot, 'resources', 'bin', build.binaryName) + if (!build) {return join(repoRoot, 'resources', 'bin', 'hawdb_ffi.dll')} + if (build.platform === 'win32') {return join(repoRoot, 'resources', 'bin', build.binaryName)} const isHost = platform === process.platform && normalized === normalizeHawdbArch(process.arch) - if (isHost) return join(repoRoot, 'resources', 'bin', build.binaryName) + if (isHost) {return join(repoRoot, 'resources', 'bin', build.binaryName)} return join(repoRoot, 'resources', 'bin', normalized, build.binaryName) } export function packagedHawdbBinaryPath(repoRoot, platform = process.platform, arch = process.arch) { const normalized = normalizeHawdbArch(arch) const build = HAWDB_BUILDS[`${platform}-${normalized}`] - if (!build) return defaultHawdbBinaryPath(repoRoot, platform, arch) - if (build.platform === 'win32') return join(repoRoot, 'resources', 'bin', build.binaryName) + if (!build) {return defaultHawdbBinaryPath(repoRoot, platform, arch)} + if (build.platform === 'win32') {return join(repoRoot, 'resources', 'bin', build.binaryName)} return join(repoRoot, 'resources', 'bin', normalized, build.binaryName) } @@ -194,7 +194,7 @@ function stampPath(binaryPath) { async function sha256File(path) { const hash = createHash('sha256') - for await (const chunk of createReadStream(path)) hash.update(chunk) + for await (const chunk of createReadStream(path)) {hash.update(chunk)} return hash.digest('hex') } @@ -204,12 +204,12 @@ export async function verifyFile(path, { sha256, bytes }) { return { ok: false, reason: `大小不符(期望 ${bytes} 字节,实际 ${info.size} 字节)` } } const digest = await sha256File(path) - if (digest !== sha256) return { ok: false, reason: `SHA256 不符(期望 ${sha256},实际 ${digest})` } + if (digest !== sha256) {return { ok: false, reason: `SHA256 不符(期望 ${sha256},实际 ${digest})` }} return { ok: true } } async function binaryMatchesStamp(path, build) { - if (!existsSync(path) || !existsSync(stampPath(path))) return false + if (!existsSync(path) || !existsSync(stampPath(path))) {return false} try { const stamp = JSON.parse(await readFile(stampPath(path), 'utf8')) if (stamp.version !== build.version || stamp.triple !== build.triple || stamp.archiveSha256 !== build.archiveSha256) { @@ -223,8 +223,8 @@ async function binaryMatchesStamp(path, build) { } function tarCommand() { - if (process.platform !== 'win32') return 'tar' - const systemTar = join(process.env.SystemRoot ?? 'C:\\Windows', 'System32', 'tar.exe') + if (process.platform !== 'win32') {return 'tar'} + const systemTar = join(process.env.SystemRoot ?? String.raw`C:\Windows`, 'System32', 'tar.exe') return existsSync(systemTar) ? systemTar : 'tar' } @@ -232,8 +232,8 @@ async function fetchArchive(url) { let current = assertArchiveSource(url) for (let hop = 0; hop <= maxArchiveRedirects; hop += 1) { const response = await fetch(assertFetchableUrl(current), { redirect: 'manual', headers: { 'user-agent': 'GuEarth-HawDB-Fetch' } }) - if (response.status < 300 || response.status >= 400) return response - if (hop === maxArchiveRedirects) break + if (response.status < 300 || response.status >= 400) {return response} + if (hop === maxArchiveRedirects) {break} current = archiveRedirectTarget(response.headers.get('location'), current) } throw new Error(`下载重定向次数过多:${rejectedArchiveLabel(url)}`) @@ -242,7 +242,7 @@ async function fetchArchive(url) { async function download(url, destination) { console.log(`下载 HawDB 引擎库:${url}`) const response = await fetchArchive(url) - if (!response.ok || response.body == null) throw new Error(`HTTP ${response.status}`) + if (!response.ok || response.body == null) {throw new Error(`HTTP ${response.status}`)} await pipeline(Readable.fromWeb(response.body), createWriteStream(destination)) } @@ -261,7 +261,7 @@ async function placeBinary(extracted, targets, stamp) { await mkdir(dirname(target), { recursive: true }) await rm(target, { force: true }) await copyFile(extracted, target) - if (process.platform !== 'win32') await chmod(target, 0o755) + if (process.platform !== 'win32') {await chmod(target, 0o755)} await writeFile(stampPath(target), stampText, 'utf8') } } @@ -285,11 +285,11 @@ export async function fetchHawdb({ repoRoot, force = false, platform = process.p await copyFile(localArchive, archivePath) console.log(`使用本地 HawDB 归档:${localArchive}`) const localCheck = await verifyFile(archivePath, { sha256: build.archiveSha256 }) - if (!localCheck.ok) throw new Error(`归档校验失败:${localCheck.reason}`) + if (!localCheck.ok) {throw new Error(`归档校验失败:${localCheck.reason}`)} } else { await download(pinnedArchiveUrl(build), archivePath) const sourceCheck = await verifyFile(archivePath, { sha256: build.archiveSha256 }) - if (!sourceCheck.ok) throw new Error(`归档校验失败:${sourceCheck.reason}`) + if (!sourceCheck.ok) {throw new Error(`归档校验失败:${sourceCheck.reason}`)} } await extractMembers(archivePath, [build.binaryMemberPath, build.manifestMemberPath], workDirectory) const extractedBinary = join(workDirectory, ...build.binaryMemberPath.split('/')) diff --git a/src/common/aiTelemetry.ts b/src/common/aiTelemetry.ts index 5db6a1e..f33ef5b 100644 --- a/src/common/aiTelemetry.ts +++ b/src/common/aiTelemetry.ts @@ -27,12 +27,12 @@ export function stripMemoryFromPrompt(content: string): string { } export function redactApiKey(text: string, apiKey: string): string { - if (!text || !apiKey) return text + if (!text || !apiKey) {return text} return text.replaceAll(apiKey, REDACTED_MARKER) } function sanitizeToolArguments(name: string, rawArguments: string): string { - if (name !== 'save_memory') return rawArguments + if (name !== 'save_memory') {return rawArguments} try { const parsed: unknown = JSON.parse(rawArguments) if (isRecord(parsed)) { @@ -56,9 +56,9 @@ export function formatTelemetryToolCalls(toolCalls: TelemetryToolCall[]): Record } function sanitizeToolContentValue(value: unknown, depth = 0): unknown { - if (depth > 6 || value === null || value === undefined) return value - if (Array.isArray(value)) return value.map((item) => sanitizeToolContentValue(item, depth + 1)) - if (!isRecord(value)) return value + if (depth > 6 || value === null || value === undefined) {return value} + if (Array.isArray(value)) {return value.map((item) => sanitizeToolContentValue(item, depth + 1))} + if (!isRecord(value)) {return value} const sanitized: Record = {} for (const [key, entry] of Object.entries(value)) { if (key === 'image' && isRecord(entry) && typeof entry.data === 'string') { @@ -94,7 +94,7 @@ function sanitizeToolMessageContent(name: string | undefined, content: string, h const parsed: unknown = JSON.parse(content) nextContent = JSON.stringify(sanitizeToolContentValue(parsed)) } catch { - nextContent = content.replace(/data:image\/[^;\s"']+;base64,[A-Za-z0-9+/=]+/g, '[image omitted]') + nextContent = content.replaceAll(/data:image\/[^;\s"']+;base64,[A-Za-z0-9+/=]+/g, '[image omitted]') } } return hadImage ? `${nextContent}\n[image omitted]` : nextContent @@ -154,10 +154,10 @@ export function normalizeModelTestOutput(protocol: AiProtocol, payload: Record[] = [] for (const choice of choices) { - if (!isRecord(choice) || !isRecord(choice.message)) continue + if (!isRecord(choice) || !isRecord(choice.message)) {continue} const role = typeof choice.message.role === 'string' ? choice.message.role : 'assistant' const content = typeof choice.message.content === 'string' ? choice.message.content : '' messages.push({ role, content }) } - return messages.length ? messages : [{ role: 'assistant', content: '' }] + return messages.length > 0 ? messages : [{ role: 'assistant', content: '' }] } diff --git a/src/common/flightStops.ts b/src/common/flightStops.ts index c9d01cb..e223795 100644 --- a/src/common/flightStops.ts +++ b/src/common/flightStops.ts @@ -23,8 +23,8 @@ export interface StopSwitchRequest { name?: unknown } -export const DEFAULT_FLIGHT_HEIGHT = 60000 -export const MAX_FLIGHT_HEIGHT = 20000000 +export const DEFAULT_FLIGHT_HEIGHT = 60_000 +export const MAX_FLIGHT_HEIGHT = 20_000_000 export const MAX_FLIGHT_STOPS = 12 const SWITCH_INTENT_PATTERN = /切换|切到|切回|换到|换个地点|下一|上一|下个|上个|下[一]?站|上[一]?站|跳到|跳转|飞到|飞往|飞去|移到|定位到|带我看|带我去|(?:看看|看|查看|去|回|回到)\s*第\s*[一二三四五六七八九十百\d]+|^\s*第\s*[一二三四五六七八九十百\d]+\s*[个站处地点]*\s*$|回到|去看看|过去看|switch|next|prev|previous|fly\s*to|go\s*to/i @@ -37,14 +37,14 @@ const SWITCH_CLAUSE_SEPARATOR = /[,。;!?:,;.!?:\n]+/ export function hasExplicitStopSwitchIntent(userText: string): boolean { const normalized = userText.trim() - if (!normalized) return false + if (!normalized) {return false} return normalized .split(SWITCH_CLAUSE_SEPARATOR) - .some((clause) => !NEGATED_SWITCH_PATTERN.test(clause) && SWITCH_INTENT_PATTERN.test(clause.replace(NON_FLIGHT_SWITCH_PATTERN, ' '))) + .some((clause) => !NEGATED_SWITCH_PATTERN.test(clause) && SWITCH_INTENT_PATTERN.test(clause.replaceAll(NON_FLIGHT_SWITCH_PATTERN, ' '))) } function cleanText(value: unknown, maxLength: number): string { - if (typeof value !== 'string') return '' + if (typeof value !== 'string') {return ''} return value.trim().slice(0, maxLength) } @@ -53,8 +53,8 @@ function isNearCoordinate(a: FlightStop, b: FlightStop): boolean { } function toNumber(value: unknown): number { - if (typeof value === 'number') return value - if (typeof value === 'string' && value.trim() !== '') return Number(value.trim()) + if (typeof value === 'number') {return value} + if (typeof value === 'string' && value.trim() !== '') {return Number(value.trim())} return Number.NaN } @@ -84,18 +84,18 @@ export function normalizeFlightStop(raw: FlightStopInput, index = 0): { stop?: F } export function normalizeFlightStopList(rawItems: unknown, startIndex = 0): { stops: FlightStop[]; errors: string[] } { - if (!Array.isArray(rawItems)) return { stops: [], errors: ['locations 需要是地点数组'] } + if (!Array.isArray(rawItems)) {return { stops: [], errors: ['locations 需要是地点数组'] }} const stops: FlightStop[] = [] const errors: string[] = [] for (const item of rawItems) { - if (stops.length >= MAX_FLIGHT_STOPS) break + if (stops.length >= MAX_FLIGHT_STOPS) {break} if (typeof item !== 'object' || item === null) { errors.push('地点项格式无效') continue } const normalized = normalizeFlightStop(item as FlightStopInput, startIndex + stops.length) if (normalized.error || !normalized.stop) { - if (normalized.error) errors.push(normalized.error) + if (normalized.error) {errors.push(normalized.error)} continue } if (!stops.some((existing) => isNearCoordinate(existing, normalized.stop!))) { @@ -108,8 +108,8 @@ export function normalizeFlightStopList(rawItems: unknown, startIndex = 0): { st export function mergeFlightStops(existing: readonly FlightStop[], incoming: readonly FlightStop[]): FlightStop[] { const result = [...existing] for (const candidate of incoming) { - if (result.length >= MAX_FLIGHT_STOPS) break - if (result.some((item) => isNearCoordinate(item, candidate))) continue + if (result.length >= MAX_FLIGHT_STOPS) {break} + if (result.some((item) => isNearCoordinate(item, candidate))) {continue} result.push({ ...candidate, id: `${result.length}:${candidate.longitude.toFixed(5)},${candidate.latitude.toFixed(5)}`, @@ -122,7 +122,7 @@ export function mergeFlightStops(existing: readonly FlightStop[], incoming: read export function parseFlyToArgs(args: Record, existingCount = 0): { stops: FlightStop[]; isBatch: boolean; error?: string } { if (args.locations !== undefined) { const { stops, errors } = normalizeFlightStopList(args.locations, existingCount) - if (!stops.length) return { stops: [], isBatch: true, error: errors[0] ?? 'locations 至少需要包含一个有效坐标地点' } + if (stops.length === 0) {return { stops: [], isBatch: true, error: errors[0] ?? 'locations 至少需要包含一个有效坐标地点' }} return { stops, isBatch: true } } const normalized = normalizeFlightStop( @@ -142,12 +142,12 @@ export function parseFlyToArgs(args: Record, existingCount = 0) } export function clampStopIndex(index: number, total: number): number { - if (total <= 0) return 0 + if (total <= 0) {return 0} return Math.max(0, Math.min(total - 1, Math.trunc(index))) } export function resolveStopTarget(stops: readonly FlightStop[], currentIndex: number, request: StopSwitchRequest): { index?: number; error?: string } { - if (!stops.length) return { error: '当前没有可切换的飞行地点列表' } + if (stops.length === 0) {return { error: '当前没有可切换的飞行地点列表' }} const rawAction = typeof request.action === 'string' ? request.action.trim().toLowerCase() : '' const action: StopSwitchAction = rawAction === 'prev' || rawAction === 'previous' ? 'prev' @@ -157,11 +157,11 @@ export function resolveStopTarget(stops: readonly FlightStop[], currentIndex: nu ? 'goto' : 'next' if (action === 'next') { - if (currentIndex >= stops.length - 1) return { error: '已经是最后一个地点' } + if (currentIndex >= stops.length - 1) {return { error: '已经是最后一个地点' }} return { index: currentIndex + 1 } } if (action === 'prev') { - if (currentIndex <= 0) return { error: '已经是第一个地点' } + if (currentIndex <= 0) {return { error: '已经是第一个地点' }} return { index: currentIndex - 1 } } if (request.index !== undefined && request.index !== null && request.index !== '') { @@ -174,9 +174,9 @@ export function resolveStopTarget(stops: readonly FlightStop[], currentIndex: nu const query = typeof request.name === 'string' ? request.name.trim().toLowerCase() : '' if (query) { const exact = stops.findIndex((stop) => stop.name.trim().toLowerCase() === query) - if (exact >= 0) return { index: exact } + if (exact !== -1) {return { index: exact }} const partial = stops.findIndex((stop) => stop.name.trim().toLowerCase().includes(query) || query.includes(stop.name.trim().toLowerCase())) - if (partial >= 0) return { index: partial } + if (partial !== -1) {return { index: partial }} return { error: `未在当前飞行地点列表中找到「${typeof request.name === 'string' ? request.name.trim() : ''}」` } } return { error: '请指定切换方向(next/prev)、地点序号或地点名称' } @@ -224,7 +224,7 @@ export function evaluateFlightToolGuard(guard: TurnFlightGuard, name: string, ar } if (name === 'fly_to') { const parsed = parseFlyToArgs(args) - if (parsed.error) return { allow: true, dispatchArgs: args } + if (parsed.error) {return { allow: true, dispatchArgs: args }} const flightMode = guard.flewInTurn ? 'queue' : 'initial' return { allow: true, diff --git a/src/common/globeSurface.ts b/src/common/globeSurface.ts index ca1bcb5..f19c0e5 100644 --- a/src/common/globeSurface.ts +++ b/src/common/globeSurface.ts @@ -73,7 +73,7 @@ export function contextOptionsForAttempt(attempt: WebGlContextAttempt): WebGlCon } export function errorText(error: unknown): string { - if (error instanceof Error) return error.message ? `${error.name}: ${error.message}` : error.name + if (error instanceof Error) {return error.message ? `${error.name}: ${error.message}` : error.name} return typeof error === 'string' ? error : '' } @@ -91,7 +91,7 @@ export function isContextLostError(error: unknown): boolean { } export function classifyRenderFault(error: unknown, contextLost: boolean): RenderFaultKind { - if (contextLost || isZeroFramebufferError(error) || isContextLostError(error)) return 'recover' + if (contextLost || isZeroFramebufferError(error) || isContextLostError(error)) {return 'recover'} return 'report' } @@ -100,7 +100,7 @@ export function shouldStopRenderLoop(kind: RenderFaultKind, consecutiveFaults: n } export function surfaceFailureCopy(contextLost: boolean): { message: string; detail: string } { - if (contextLost) return { message: WEBGL_UNAVAILABLE_MESSAGE, detail: WEBGL_UNAVAILABLE_DETAIL } + if (contextLost) {return { message: WEBGL_UNAVAILABLE_MESSAGE, detail: WEBGL_UNAVAILABLE_DETAIL }} return { message: SURFACE_UNAVAILABLE_MESSAGE, detail: SURFACE_UNAVAILABLE_DETAIL } } @@ -109,9 +109,9 @@ export function surfaceIsRenderable(size: SurfaceSize): boolean { } export function decideRenderFrame(size: SurfaceSize, recoveryAttempted: boolean): RenderFrameDecision { - if (size.clientWidth < 1 || size.clientHeight < 1) return { action: 'tick', reason: 'awaiting-layout' } - if (size.drawingBufferWidth >= 1 && size.drawingBufferHeight >= 1) return { action: 'render' } - if (!recoveryAttempted) return { action: 'recover-resize' } + if (size.clientWidth < 1 || size.clientHeight < 1) {return { action: 'tick', reason: 'awaiting-layout' }} + if (size.drawingBufferWidth >= 1 && size.drawingBufferHeight >= 1) {return { action: 'render' }} + if (!recoveryAttempted) {return { action: 'recover-resize' }} return { action: 'tick', reason: 'buffer-missing' } } @@ -125,9 +125,9 @@ export function advanceBufferGap(state: BufferGapState, kind: SurfaceFrameKind, state.since = 0 return 'ok' } - if (!state.since) state.since = now - if (state.reported) return 'waiting' - if (now - state.since < limitMs) return 'waiting' + if (!state.since) {state.since = now} + if (state.reported) {return 'waiting'} + if (now - state.since < limitMs) {return 'waiting'} state.reported = true return 'report' } @@ -140,7 +140,7 @@ export function backingStoreSize(clientWidth: number, clientHeight: number, pixe } export function nudgedCanvasSize(currentWidth: number, currentHeight: number, targetWidth: number, targetHeight: number): { width: number; height: number } { - if (currentWidth === targetWidth && currentHeight === targetHeight) return { width: targetWidth + 1, height: targetHeight } + if (currentWidth === targetWidth && currentHeight === targetHeight) {return { width: targetWidth + 1, height: targetHeight }} return { width: targetWidth, height: targetHeight } } @@ -155,7 +155,7 @@ export interface GlRendererSource { } export function glRendererName(gl: GlRendererSource | null): string { - if (!gl) return '' + if (!gl) {return ''} try { const info = gl.getExtension('WEBGL_debug_renderer_info') const value = info ? gl.getParameter(info.UNMASKED_RENDERER_WEBGL) : gl.getParameter(gl.RENDERER) diff --git a/src/common/logger.ts b/src/common/logger.ts index cbadd29..86da463 100644 --- a/src/common/logger.ts +++ b/src/common/logger.ts @@ -19,20 +19,20 @@ function clamp(text: string): string { } export function stringifyLogValue(value: unknown, depth = 0, seen?: WeakSet): string { - if (typeof value === 'string') return value - if (value === null || value === undefined || typeof value === 'number' || typeof value === 'boolean') return String(value) + if (typeof value === 'string') {return value} + if (value === null || value === undefined || typeof value === 'number' || typeof value === 'boolean') {return String(value)} if (value instanceof Error) { const stack = typeof value.stack === 'string' ? value.stack.split('\n').slice(0, 4).join('\n') : '' return clamp(stack ? `${value.name}: ${value.message}\n${stack}` : `${value.name}: ${value.message}`) } - if (depth >= 4) return '[深层结构省略]' - const marker = seen ?? new WeakSet() + if (depth >= 4) {return '[深层结构省略]'} + const marker = seen ?? new WeakSet() if (typeof value === 'object') { - if (marker.has(value)) return '[循环引用]' + if (marker.has(value)) {return '[循环引用]'} marker.add(value) if (Array.isArray(value)) { const items = value.slice(0, 20).map((item) => stringifyLogValue(item, depth + 1, marker)) - if (value.length > 20) items.push(`…共 ${value.length} 项`) + if (value.length > 20) {items.push(`…共 ${value.length} 项`)} return `[${items.join(', ')}]` } const parts = Object.entries(value as Record).slice(0, 20).map(([key, item]) => `${key}: ${stringifyLogValue(item, depth + 1, marker)}`) @@ -49,7 +49,7 @@ function push(level: LogLevel, scope: string, message: string, detail: unknown): message: clamp(message), detail: detail === undefined || detail === '' ? '' : clamp(stringifyLogValue(detail)) }) - if (entries.length > MAX_ENTRIES) entries.splice(0, entries.length - MAX_ENTRIES) + if (entries.length > MAX_ENTRIES) {entries.splice(0, entries.length - MAX_ENTRIES)} } function pad(value: number, width = 2): string { @@ -87,7 +87,7 @@ export const logger = { let consoleTeeInstalled = false export function attachConsoleLogTee(scope: string): void { - if (consoleTeeInstalled) return + if (consoleTeeInstalled) {return} consoleTeeInstalled = true const originalWarn = console.warn.bind(console) const originalError = console.error.bind(console) diff --git a/src/common/mirrorPolicies.ts b/src/common/mirrorPolicies.ts index 21a42db..a9afad2 100644 --- a/src/common/mirrorPolicies.ts +++ b/src/common/mirrorPolicies.ts @@ -13,7 +13,7 @@ export interface ParsedPolicyMarkdown { } export function parsePolicyMarkdown(markdown: string, fallbackTitle: string): ParsedPolicyMarkdown { - const normalized = markdown.replace(/^/, '').replace(/\r\n?/g, '\n').trim() + const normalized = markdown.replace(/^/, '').replaceAll(/\r\n?/g, '\n').trim() const match = /^#\s+(.+?)(?:\n+([\s\S]*))?$/.exec(normalized) if (!match) { return { diff --git a/src/common/networkProxy.ts b/src/common/networkProxy.ts index 5a6b092..6bffda3 100644 --- a/src/common/networkProxy.ts +++ b/src/common/networkProxy.ts @@ -4,17 +4,17 @@ const PROXY_URL_PATTERN = /^(https?|socks[45]):\/\/[^\s]+$/ const HOST_PORT_PATTERN = /^[a-zA-Z0-9.-]+:\d{1,5}$/ export function normalizeNetworkProxy(value: unknown): string { - if (typeof value !== 'string') return '' + if (typeof value !== 'string') {return ''} const trimmed = value.trim() - if (trimmed === '' || trimmed === 'direct') return trimmed - if (trimmed.length > 200) return '' - if (PROXY_URL_PATTERN.test(trimmed)) return trimmed - if (HOST_PORT_PATTERN.test(trimmed)) return `http://${trimmed}` + if (trimmed === '' || trimmed === 'direct') {return trimmed} + if (trimmed.length > 200) {return ''} + if (PROXY_URL_PATTERN.test(trimmed)) {return trimmed} + if (HOST_PORT_PATTERN.test(trimmed)) {return `http://${trimmed}`} return '' } export function networkProxyMode(value: string): NetworkProxyMode { - if (value === '') return 'system' - if (value === 'direct') return 'direct' + if (value === '') {return 'system'} + if (value === 'direct') {return 'direct'} return 'custom' } diff --git a/src/common/onlineData.ts b/src/common/onlineData.ts index 9ac7661..3a15f67 100644 --- a/src/common/onlineData.ts +++ b/src/common/onlineData.ts @@ -51,14 +51,14 @@ export interface OnlineDataSnapshot { } export function validateQWeatherApiKey(value: unknown): string { - if (typeof value !== 'string' || !/^[\x21-\x7e]{1,512}$/.test(value.trim())) { + if (typeof value !== 'string' || !/^[\x21-\x7E]{1,512}$/.test(value.trim())) { throw new Error('API Key 仅支持可见 ASCII 字符,长度 1-512,且不能包含空格或换行') } return value.trim() } export function normalizeQWeatherHost(value: unknown): string { - if (typeof value !== 'string') throw new Error('请输入和风天气 API Host') + if (typeof value !== 'string') {throw new Error('请输入和风天气 API Host')} const host = value.trim().replace(/^https:\/\//i, '').replace(/\/$/, '').toLowerCase() if (host.length > 253 || !/^(?:[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?\.)*qweatherapi\.com$/.test(host)) { throw new Error('API Host 必须为 qweatherapi.com 或其子域名,不含路径或端口') diff --git a/src/common/passport.ts b/src/common/passport.ts index ff18a12..eed0ef4 100644 --- a/src/common/passport.ts +++ b/src/common/passport.ts @@ -32,10 +32,10 @@ export function utf8ByteLength(value: string): number { let length = 0 for (const character of value) { const code = character.codePointAt(0) ?? 0 - if (code < 0x80) length += 1 - else if (code < 0x800) length += 2 - else if (code < 0x10000) length += 3 - else length += 4 + if (code < 0x80) {length += 1} + else if (code < 0x8_00) {length += 2} + else if (code < 0x1_00_00) {length += 3} + else {length += 4} } return length } @@ -49,19 +49,19 @@ export function encodeBase64Url(bytes: Uint8Array): string { bits += 8 while (bits >= 6) { bits -= 6 - output += BASE64URL_ALPHABET[(accumulator >>> bits) & 0x3f] + output += BASE64URL_ALPHABET[(accumulator >>> bits) & 0x3F] } } - if (bits > 0) output += BASE64URL_ALPHABET[(accumulator << (6 - bits)) & 0x3f] + if (bits > 0) {output += BASE64URL_ALPHABET[(accumulator << (6 - bits)) & 0x3f]} return output } export function truncateToUtf8Bytes(value: string, maxBytes: number): string { - if (utf8ByteLength(value) <= maxBytes) return value + if (utf8ByteLength(value) <= maxBytes) {return value} let output = '' for (const character of value) { const candidate = output + character - if (utf8ByteLength(candidate) > maxBytes) break + if (utf8ByteLength(candidate) > maxBytes) {break} output = candidate } return output @@ -72,14 +72,14 @@ export function isValidInstallationId(value: unknown): value is string { } export function sanitizeDeviceNameText(value: string): string { - return value.replace(/[\u0000-\u001f\u007f]/g, ' ').replace(/\s+/g, ' ').trim() + return value.replaceAll(/[\u0000-\u001F\u007F]/g, ' ').replaceAll(/\s+/g, ' ').trim() } export function isValidDeviceName(value: unknown): value is string { - if (typeof value !== 'string') return false - if (value !== value.trim()) return false - if (value === '') return false - if (/[\u0000\u000a\u000d]/.test(value)) return false + if (typeof value !== 'string') {return false} + if (value !== value.trim()) {return false} + if (value === '') {return false} + if (/[\u0000\u000A\u000D]/.test(value)) {return false} return utf8ByteLength(value) <= MAX_DEVICE_NAME_BYTES } @@ -91,11 +91,11 @@ export function buildDeviceName(hostname: string): string { } export function passportPlatform(platform: string): PassportPlatform { - if (platform === 'win32') return 'windows' - if (platform === 'darwin') return 'macos' - if (platform === 'linux') return 'linux' - if (platform === 'android') return 'android' - if (PASSPORT_PLATFORMS.includes(platform as PassportPlatform)) return platform as PassportPlatform + if (platform === 'win32') {return 'windows'} + if (platform === 'darwin') {return 'macos'} + if (platform === 'linux') {return 'linux'} + if (platform === 'android') {return 'android'} + if (PASSPORT_PLATFORMS.includes(platform as PassportPlatform)) {return platform as PassportPlatform} return 'other' } @@ -108,30 +108,30 @@ function isLocalHostname(hostname: string): boolean { } export function parseAbsoluteUrl(value: unknown): URL | null { - if (typeof value !== 'string' || value.trim() === '') return null + if (typeof value !== 'string' || value.trim() === '') {return null} let url: URL try { url = new URL(value.trim()) } catch { return null } - if (url.protocol !== 'https:' && !(url.protocol === 'http:' && isLocalHostname(url.hostname))) return null + if (url.protocol !== 'https:' && !(url.protocol === 'http:' && isLocalHostname(url.hostname))) {return null} return url } export function isTrustedVerificationUri(value: unknown, accountOrigin: string): value is string { const url = parseAbsoluteUrl(value) const origin = parseAbsoluteUrl(accountOrigin) - if (!url || !origin) return false - if (url.origin !== origin.origin) return false + if (!url || !origin) {return false} + if (url.origin !== origin.origin) {return false} return url.pathname === PASSPORT_DEVICE_VERIFICATION_PATH } export function isTrustedVerificationUriComplete(value: unknown, accountOrigin: string): value is string { - if (!isTrustedVerificationUri(value, accountOrigin)) return false + if (!isTrustedVerificationUri(value, accountOrigin)) {return false} const url = new URL(value) for (const key of url.searchParams.keys()) { - if (key !== 'user_code') return false + if (key !== 'user_code') {return false} } return true } @@ -145,16 +145,16 @@ export function buildVerificationUriComplete(verificationUri: string, userCode: export function deviceListUrl(accountOrigin: string): string { const origin = parseAbsoluteUrl(accountOrigin) - if (!origin) return '' + if (!origin) {return ''} origin.pathname = PASSPORT_DEVICE_LIST_PATH origin.search = '' return origin.toString() } export function retryAfterSeconds(headerValue: string | null): number { - if (typeof headerValue !== 'string') return 0 + if (typeof headerValue !== 'string') {return 0} const seconds = Number.parseInt(headerValue.trim(), 10) - if (!Number.isFinite(seconds) || seconds < 0) return 0 + if (!Number.isFinite(seconds) || seconds < 0) {return 0} return Math.min(MAX_RETRY_AFTER_SECONDS, seconds) } @@ -168,14 +168,14 @@ export interface PassportEndpoints { function endpointUnderIssuer(payload: Record, key: string, issuerUrl: URL): string { const url = parseAbsoluteUrl(payload[key]) - if (!url) return '' - if (url.origin !== issuerUrl.origin) return '' + if (!url) {return ''} + if (url.origin !== issuerUrl.origin) {return ''} return url.toString() } export function normalizeIssuer(value: unknown): string { const url = parseAbsoluteUrl(value) - if (!url) return '' + if (!url) {return ''} url.pathname = url.pathname === '/' ? '' : url.pathname.replace(/\/+$/, '') url.search = '' url.hash = '' @@ -183,17 +183,17 @@ export function normalizeIssuer(value: unknown): string { } export function parseDiscovery(payload: unknown, expectedIssuer?: string): PassportEndpoints | null { - if (!isRecord(payload)) return null + if (!isRecord(payload)) {return null} const issuer = normalizeIssuer(payload.issuer) - if (!issuer) return null - if (expectedIssuer !== undefined && normalizeIssuer(expectedIssuer) !== issuer) return null + if (!issuer) {return null} + if (expectedIssuer !== undefined && normalizeIssuer(expectedIssuer) !== issuer) {return null} const issuerUrl = parseAbsoluteUrl(issuer) - if (!issuerUrl) return null + if (!issuerUrl) {return null} const deviceAuthorizationEndpoint = endpointUnderIssuer(payload, 'device_authorization_endpoint', issuerUrl) const tokenEndpoint = endpointUnderIssuer(payload, 'token_endpoint', issuerUrl) const userinfoEndpoint = endpointUnderIssuer(payload, 'userinfo_endpoint', issuerUrl) const revocationEndpoint = endpointUnderIssuer(payload, 'revocation_endpoint', issuerUrl) - if (!deviceAuthorizationEndpoint || !tokenEndpoint || !userinfoEndpoint || !revocationEndpoint) return null + if (!deviceAuthorizationEndpoint || !tokenEndpoint || !userinfoEndpoint || !revocationEndpoint) {return null} return { issuer, deviceAuthorizationEndpoint, tokenEndpoint, userinfoEndpoint, revocationEndpoint } } @@ -207,32 +207,32 @@ export interface DeviceAuthorizationChallenge { } function boundedString(value: unknown, maxBytes: number): string { - if (typeof value !== 'string') return '' + if (typeof value !== 'string') {return ''} const trimmed = value.trim() - if (trimmed === '' || utf8ByteLength(trimmed) > maxBytes) return '' + if (trimmed === '' || utf8ByteLength(trimmed) > maxBytes) {return ''} return trimmed } function positiveNumber(value: unknown, fallback: number, max: number): number { - if (typeof value !== 'number' || !Number.isFinite(value) || value <= 0) return fallback + if (typeof value !== 'number' || !Number.isFinite(value) || value <= 0) {return fallback} return Math.min(max, value) } export function parseDeviceAuthorization(payload: unknown, accountOrigin: string): DeviceAuthorizationChallenge | null { - if (!isRecord(payload)) return null + if (!isRecord(payload)) {return null} const deviceCode = boundedString(payload.device_code, 512) const userCode = boundedString(payload.user_code, 64) - if (!deviceCode || !userCode) return null - if (!isTrustedVerificationUri(payload.verification_uri, accountOrigin)) return null - const verificationUri = new URL(payload.verification_uri as string) + if (!deviceCode || !userCode) {return null} + if (!isTrustedVerificationUri(payload.verification_uri, accountOrigin)) {return null} + const verificationUri = new URL(payload.verification_uri) verificationUri.search = '' const advertisedComplete = payload.verification_uri_complete const hasAdvertisedComplete = advertisedComplete !== undefined && advertisedComplete !== null && advertisedComplete !== '' - if (hasAdvertisedComplete && !isTrustedVerificationUriComplete(advertisedComplete, accountOrigin)) return null + if (hasAdvertisedComplete && !isTrustedVerificationUriComplete(advertisedComplete, accountOrigin)) {return null} const complete = hasAdvertisedComplete - ? (advertisedComplete as string) + ? (advertisedComplete) : buildVerificationUriComplete(verificationUri.toString(), userCode) - if (!isTrustedVerificationUriComplete(complete, accountOrigin)) return null + if (!isTrustedVerificationUriComplete(complete, accountOrigin)) {return null} return { deviceCode, userCode, @@ -252,12 +252,12 @@ export interface PassportTokenResponse { } export function parseTokenResponse(payload: unknown): PassportTokenResponse | null { - if (!isRecord(payload)) return null + if (!isRecord(payload)) {return null} const accessToken = boundedString(payload.access_token, MAX_SECRET_BYTES) const refreshToken = boundedString(payload.refresh_token, MAX_SECRET_BYTES) - if (!accessToken || !refreshToken) return null + if (!accessToken || !refreshToken) {return null} const tokenType = typeof payload.token_type === 'string' ? payload.token_type.trim().toLowerCase() : '' - if (tokenType !== '' && tokenType !== 'bearer') return null + if (tokenType !== '' && tokenType !== 'bearer') {return null} return { accessToken, refreshToken, @@ -276,9 +276,9 @@ export interface PassportUserInfo { } export function parseUserInfo(payload: unknown): PassportUserInfo | null { - if (!isRecord(payload)) return null + if (!isRecord(payload)) {return null} const sub = boundedString(payload.sub, 256) - if (!sub) return null + if (!sub) {return null} return { sub, username: boundedString(payload.preferred_username, 256), @@ -298,16 +298,16 @@ export interface AuthorizationFailure { } export function parseOAuthError(payload: unknown): { error: string; description: string } | null { - if (!isRecord(payload)) return null + if (!isRecord(payload)) {return null} const error = typeof payload.error === 'string' ? payload.error.trim() : '' - if (!error) return null + if (!error) {return null} return { error, description: typeof payload.error_description === 'string' ? payload.error_description : '' } } export function parseErrorEnvelope(payload: unknown): { code: string; message: string } | null { - if (!isRecord(payload) || !isRecord(payload.error)) return null + if (!isRecord(payload) || !isRecord(payload.error)) {return null} const code = typeof payload.error.code === 'string' ? payload.error.code.trim() : '' - if (!code) return null + if (!code) {return null} return { code, message: typeof payload.error.message === 'string' ? payload.error.message : '' } } @@ -381,9 +381,9 @@ export function describeAuthorizationFailure(status: number, payload: unknown, r retryAfterSeconds: retryAfter }) } - if (status === 429) return failure(ENVELOPE_MESSAGES.rate_limited, { retryable: true, retryAfterSeconds: retryAfter }) - if (status >= 500) return failure('鸽巢通行证服务暂时不可用,请稍后再试', { retryable: true, retryAfterSeconds: retryAfter }) - if (status === 401 || status === 403) return failure('登录服务拒绝了本次请求,请稍后再试', { terminal: true }) + if (status === 429) {return failure(ENVELOPE_MESSAGES.rate_limited, { retryable: true, retryAfterSeconds: retryAfter })} + if (status >= 500) {return failure('鸽巢通行证服务暂时不可用,请稍后再试', { retryable: true, retryAfterSeconds: retryAfter })} + if (status === 401 || status === 403) {return failure('登录服务拒绝了本次请求,请稍后再试', { terminal: true })} return failure('登录服务暂时不可用,请稍后再试', { terminal: status < 500 }) } @@ -436,19 +436,26 @@ export function signedOutAccountState(deviceListUrlValue: string, error = '', pe export function accountPhaseLabel(phase: AccountPhase): string { switch (phase) { - case 'creating': + case 'creating': { return '正在发起登录' - case 'awaiting-approval': + } + case 'awaiting-approval': { return '等待浏览器确认' - case 'finalizing': + } + case 'finalizing': { return '正在完成登录' - case 'restoring': + } + case 'restoring': { return '正在恢复登录状态' - case 'signing-out': + } + case 'signing-out': { return '正在退出登录' - case 'signed-in': + } + case 'signed-in': { return '已登录' - default: + } + default: { return '未登录' + } } } diff --git a/src/common/privacy.ts b/src/common/privacy.ts index 919860c..956761e 100644 --- a/src/common/privacy.ts +++ b/src/common/privacy.ts @@ -24,7 +24,7 @@ export const DEFAULT_PRIVACY_SETTINGS: PrivacySettings = { } export function resolvePrivacySettings(raw: Record | null | undefined): PrivacySettings { - if (!raw) return { ...DEFAULT_PRIVACY_SETTINGS } + if (!raw) {return { ...DEFAULT_PRIVACY_SETTINGS }} return { errorReportingEnabled: typeof raw.errorReportingEnabled === 'boolean' ? raw.errorReportingEnabled @@ -82,14 +82,14 @@ export const PRIVACY_DISCLOSURES: readonly PrivacyDisclosureItem[] = [ export function privacyDisclosureFor(key: PrivacySettingKey): PrivacyDisclosureItem { const item = PRIVACY_DISCLOSURES.find((entry) => entry.key === key) - if (!item) throw new Error(`Unknown privacy setting key: ${key}`) + if (!item) {throw new Error(`Unknown privacy setting key: ${key}`)} return item } export function filterPosthogEvent(event: T | null | undefined, privacy: PrivacySettings): T | null { - if (!event) return null + if (!event) {return null} const name = event.event ?? '' - if (name === '$exception') return privacy.errorReportingEnabled ? event : null - if (name === 'ai_prompt_submitted' || name.startsWith('$ai_')) return privacy.aiTelemetryEnabled ? event : null + if (name === '$exception') {return privacy.errorReportingEnabled ? event : null} + if (name === 'ai_prompt_submitted' || name.startsWith('$ai_')) {return privacy.aiTelemetryEnabled ? event : null} return privacy.telemetryEnabled ? event : null } diff --git a/src/common/resourceFailure.ts b/src/common/resourceFailure.ts index 8066a19..245f041 100644 --- a/src/common/resourceFailure.ts +++ b/src/common/resourceFailure.ts @@ -5,9 +5,9 @@ export interface RequestErrorShape { } export function isRequestErrorShape(reason: unknown): reason is RequestErrorShape { - if (!reason || typeof reason !== 'object' || reason instanceof Error || Array.isArray(reason)) return false + if (!reason || typeof reason !== 'object' || reason instanceof Error || Array.isArray(reason)) {return false} const keys = Object.keys(reason) - if (keys.length !== REQUEST_ERROR_KEYS.length) return false + if (keys.length !== REQUEST_ERROR_KEYS.length) {return false} return REQUEST_ERROR_KEYS.every((key) => keys.includes(key)) } diff --git a/src/common/terrainAvailability.ts b/src/common/terrainAvailability.ts index 7062862..13330ef 100644 --- a/src/common/terrainAvailability.ts +++ b/src/common/terrainAvailability.ts @@ -6,13 +6,13 @@ interface AvailabilityFlagged { _hasAvailability?: boolean } -const availabilityStripped = new WeakSet() +const availabilityStripped = new WeakSet() export function withoutTileAvailability(terrain: Terrain): Terrain { availabilityStripped.add(terrain) const flagged = terrain as Terrain & AvailabilityFlagged flagged._hasAvailability = false - flagged.getTileDataAvailable = () => undefined + flagged.getTileDataAvailable = () => {} return terrain } @@ -47,7 +47,7 @@ export function attachOriginTerrainFallback< let resolvedOrigin: Terrain | undefined const getOriginProvider = (): Promise => { - if (resolvedOrigin) return Promise.resolve(resolvedOrigin) + if (resolvedOrigin) {return Promise.resolve(resolvedOrigin)} if (!originPromise) { originPromise = createOrigin().then( (origin) => { @@ -65,15 +65,15 @@ export function attachOriginTerrainFallback< mirrorProvider.requestTileGeometry = (x: number, y: number, level: number, request?: Request) => { if (fallenBackToOrigin) { - if (resolvedOrigin) return resolvedOrigin.requestTileGeometry(x, y, level, request) + if (resolvedOrigin) {return resolvedOrigin.requestTileGeometry(x, y, level, request)} return getOriginProvider().then((origin) => { const fallbackAttempt = origin.requestTileGeometry(x, y, level, request) - if (!fallbackAttempt) return Promise.reject(new Error('Origin terrain tile request deferred')) + if (!fallbackAttempt) {return Promise.reject(new Error('Origin terrain tile request deferred'))} return fallbackAttempt }) } const attempt = mirrorRequestTileGeometry(x, y, level, request) - if (!attempt) return attempt + if (!attempt) {return attempt} return attempt.then( (tile) => { consecutiveFailures = 0 @@ -81,10 +81,10 @@ export function attachOriginTerrainFallback< }, async (error) => { consecutiveFailures += 1 - if (consecutiveFailures >= failureThreshold) fallenBackToOrigin = true + if (consecutiveFailures >= failureThreshold) {fallenBackToOrigin = true} const origin = await getOriginProvider() const fallbackAttempt = origin.requestTileGeometry(x, y, level, request) - if (!fallbackAttempt) throw error + if (!fallbackAttempt) {throw error} return fallbackAttempt } ) diff --git a/src/common/themeMode.ts b/src/common/themeMode.ts index e2d134c..3c47bfb 100644 --- a/src/common/themeMode.ts +++ b/src/common/themeMode.ts @@ -12,6 +12,6 @@ export function normalizeThemeMode(value: unknown): ThemeMode { } export function resolveTheme(mode: ThemeMode, systemPrefersDark: boolean): ResolvedTheme { - if (mode === 'system') return systemPrefersDark ? 'dark' : 'light' + if (mode === 'system') {return systemPrefersDark ? 'dark' : 'light'} return mode } diff --git a/src/common/tileMirror.ts b/src/common/tileMirror.ts index 5eca293..04494f0 100644 --- a/src/common/tileMirror.ts +++ b/src/common/tileMirror.ts @@ -43,7 +43,7 @@ export const mirrorEndpoints: Record = { } } -export const MIRROR_ENDPOINT_PROBE_TIMEOUT_MS = 5_000 +export const MIRROR_ENDPOINT_PROBE_TIMEOUT_MS = 5000 export function isMirrorEndpointId(value: unknown): value is MirrorEndpointId { return value === 'edgeone' || value === 'cloudflare' @@ -97,7 +97,7 @@ export function selectBestMirrorEndpoint( .filter((probe) => probe.ok && typeof probe.latencyMs === 'number' && Number.isFinite(probe.latencyMs)) .sort((a, b) => { const diff = (a.latencyMs as number) - (b.latencyMs as number) - if (diff !== 0) return diff + if (diff !== 0) {return diff} return mirrorEndpointIds.indexOf(a.endpoint) - mirrorEndpointIds.indexOf(b.endpoint) }) return reachable[0]?.endpoint ?? fallback @@ -142,8 +142,8 @@ export function withinMirrorSatelliteDetail(longitude: number, latitude: number) } export function isValidTileCoordinate(level: number, x: number, y: number, maxLevel: number): boolean { - if (!Number.isInteger(level) || !Number.isInteger(x) || !Number.isInteger(y)) return false - if (level < 0 || level > maxLevel || x < 0 || y < 0) return false + if (!Number.isInteger(level) || !Number.isInteger(x) || !Number.isInteger(y)) {return false} + if (level < 0 || level > maxLevel || x < 0 || y < 0) {return false} const span = 2 ** level return x < span && y < span } @@ -157,13 +157,13 @@ export function mirrorTileUrl( endpoint: MirrorEndpointId = DEFAULT_MIRROR_ENDPOINT ): string | undefined { const maxLevel = mirrorMaxZoomByProvider[providerId] - if (maxLevel === undefined || !isValidTileCoordinate(level, x, y, maxLevel)) return undefined + if (maxLevel === undefined || !isValidTileCoordinate(level, x, y, maxLevel)) {return undefined} const baseUrl = mirrorBaseUrl(endpoint) - if (providerId === 'osm') return `${baseUrl}/tiles/osm/${level}/${x}/${y}.png` - if (providerId === 'esri-imagery') return `${baseUrl}/tiles/esri/${level}/${y}/${x}` - if (providerId === 'opentopomap') return `${baseUrl}/tiles/opentopo/${level}/${x}/${y}.png` + if (providerId === 'osm') {return `${baseUrl}/tiles/osm/${level}/${x}/${y}.png`} + if (providerId === 'esri-imagery') {return `${baseUrl}/tiles/esri/${level}/${y}/${x}`} + if (providerId === 'opentopomap') {return `${baseUrl}/tiles/opentopo/${level}/${x}/${y}.png`} if (providerId === 'viirs-night') { - if (typeof granuleDate !== 'string' || !/^\d{4}-\d{2}-\d{2}$/.test(granuleDate)) return undefined + if (typeof granuleDate !== 'string' || !/^\d{4}-\d{2}-\d{2}$/.test(granuleDate)) {return undefined} return `${baseUrl}/tiles/viirs/${granuleDate}/${level}/${y}/${x}.jpeg` } return undefined @@ -214,7 +214,7 @@ export function isTileMirrorMode(value: unknown): value is TileMirrorMode { } export function normalizeTileMirrorMode(value: unknown, legacyEnabled?: unknown): TileMirrorMode { - if (isTileMirrorMode(value)) return value + if (isTileMirrorMode(value)) {return value} return legacyEnabled === true ? 'on' : 'auto' } @@ -246,8 +246,8 @@ export function originProbeReachable(status: number): boolean { } export function isMirrorCoverageNotFound(status: number, headers: Pick): boolean { - if (status !== 404) return false - if (headers.get('x-proxy-upstream')) return true + if (status !== 404) {return false} + if (headers.get('x-proxy-upstream')) {return true} const contentType = headers.get('content-type') ?? '' return contentType.toLowerCase().includes('application/json') } @@ -267,7 +267,7 @@ export class TileMirrorRouter { private isMirrorFallbackActive(providerId: string): boolean { const until = this.mirrorFallbackUntil.get(providerId) - if (until === undefined) return false + if (until === undefined) {return false} if (this.now() >= until) { this.mirrorFallbackUntil.delete(providerId) this.mirrorFailures.delete(providerId) @@ -289,8 +289,8 @@ export class TileMirrorRouter { } sourceFor(providerId: string): TileSource { - if (this.mode === 'off') return 'origin' - if (this.mode === 'on') return this.isMirrorFallbackActive(providerId) ? 'origin' : 'mirror' + if (this.mode === 'off') {return 'origin'} + if (this.mode === 'on') {return this.isMirrorFallbackActive(providerId) ? 'origin' : 'mirror'} return this.reachability.get(providerId) === 'blocked' ? 'mirror' : 'origin' } @@ -299,7 +299,7 @@ export class TileMirrorRouter { } fallenBackProviders(providerIds: readonly string[]): string[] { - if (this.mode !== 'on') return [] + if (this.mode !== 'on') {return []} return providerIds.filter((providerId) => this.isMirrorFallbackActive(providerId)) } @@ -309,8 +309,8 @@ export class TileMirrorRouter { noteOriginSuccess(providerId: string): boolean { this.originFailures.set(providerId, 0) - if (this.mode !== 'auto') return false - if (this.reachability.get(providerId) !== 'blocked') return false + if (this.mode !== 'auto') {return false} + if (this.reachability.get(providerId) !== 'blocked') {return false} this.reachability.set(providerId, 'reachable') return true } @@ -318,9 +318,9 @@ export class TileMirrorRouter { noteOriginFailure(providerId: string): boolean { const failures = (this.originFailures.get(providerId) ?? 0) + 1 this.originFailures.set(providerId, failures) - if (this.mode !== 'auto') return false - if (failures < ORIGIN_FAILURES_BEFORE_MIRROR) return false - if (this.reachability.get(providerId) === 'blocked') return false + if (this.mode !== 'auto') {return false} + if (failures < ORIGIN_FAILURES_BEFORE_MIRROR) {return false} + if (this.reachability.get(providerId) === 'blocked') {return false} this.reachability.set(providerId, 'blocked') this.mirrorFailures.set(providerId, 0) return true @@ -332,12 +332,12 @@ export class TileMirrorRouter { const next: OriginReachability = reachable ? 'reachable' : 'blocked' const previous = this.reachability.get(providerId) ?? 'unknown' this.reachability.set(providerId, next) - if (this.mode !== 'auto') return false + if (this.mode !== 'auto') {return false} return previous !== next } nextMirrorFallbackExpiryAt(): number | null { - if (this.mode !== 'on') return null + if (this.mode !== 'on') {return null} let earliest: number | null = null const current = this.now() for (const [providerId, until] of [...this.mirrorFallbackUntil.entries()]) { @@ -345,43 +345,43 @@ export class TileMirrorRouter { this.mirrorFallbackUntil.delete(providerId) continue } - if (earliest === null || until < earliest) earliest = until + if (earliest === null || until < earliest) {earliest = until} } return earliest } noteMirrorSuccess(providerId: string, expectedGeneration?: number): void { - if (expectedGeneration !== undefined && expectedGeneration !== this.modeGeneration) return + if (expectedGeneration !== undefined && expectedGeneration !== this.modeGeneration) {return} this.mirrorFailures.set(providerId, 0) this.mirrorFallbackUntil.delete(providerId) } recordMirrorFailure(providerId: string, expectedGeneration?: number): boolean { - if (expectedGeneration !== undefined && expectedGeneration !== this.modeGeneration) return false + if (expectedGeneration !== undefined && expectedGeneration !== this.modeGeneration) {return false} if (this.mode === 'on') { - if (this.isMirrorFallbackActive(providerId)) return false + if (this.isMirrorFallbackActive(providerId)) {return false} } else if (this.mode === 'auto') { - if (this.reachability.get(providerId) !== 'blocked') return false + if (this.reachability.get(providerId) !== 'blocked') {return false} } else { return false } const failures = (this.mirrorFailures.get(providerId) ?? 0) + 1 this.mirrorFailures.set(providerId, failures) - if (failures < MIRROR_FAILURES_BEFORE_FALLBACK) return false + if (failures < MIRROR_FAILURES_BEFORE_FALLBACK) {return false} this.mirrorFailures.set(providerId, 0) return true } commitMirrorFallback(providerId: string, expectedGeneration?: number): boolean { - if (expectedGeneration !== undefined && expectedGeneration !== this.modeGeneration) return false + if (expectedGeneration !== undefined && expectedGeneration !== this.modeGeneration) {return false} if (this.mode === 'on') { - if (this.isMirrorFallbackActive(providerId)) return false + if (this.isMirrorFallbackActive(providerId)) {return false} this.mirrorFailures.set(providerId, 0) this.mirrorFallbackUntil.set(providerId, this.now() + MIRROR_FALLBACK_COOLDOWN_MS) return true } - if (this.mode !== 'auto') return false - if (this.reachability.get(providerId) !== 'blocked') return false + if (this.mode !== 'auto') {return false} + if (this.reachability.get(providerId) !== 'blocked') {return false} this.mirrorFailures.set(providerId, 0) this.originFailures.set(providerId, 0) this.reachability.set(providerId, 'reachable') @@ -389,7 +389,7 @@ export class TileMirrorRouter { } noteMirrorFailure(providerId: string, expectedGeneration?: number): boolean { - if (!this.recordMirrorFailure(providerId, expectedGeneration)) return false + if (!this.recordMirrorFailure(providerId, expectedGeneration)) {return false} return this.commitMirrorFallback(providerId, expectedGeneration) } @@ -402,7 +402,7 @@ export class TileMirrorRouter { } let hadFallback = false for (const id of [...this.mirrorFallbackUntil.keys()]) { - if (this.isMirrorFallbackActive(id)) hadFallback = true + if (this.isMirrorFallbackActive(id)) {hadFallback = true} } this.mirrorFailures.clear() this.mirrorFallbackUntil.clear() @@ -424,7 +424,7 @@ export class MirrorEndpointManager { private isEndpointFailed(endpoint: MirrorEndpointId): boolean { const until = this.failedUntil.get(endpoint) - if (until === undefined) return false + if (until === undefined) {return false} if (this.now() >= until) { this.failedUntil.delete(endpoint) this.failedAt.delete(endpoint) @@ -468,11 +468,11 @@ export class MirrorEndpointManager { this.preference = preference this.failedUntil.clear() this.failedAt.clear() - if (preference !== 'auto') { - this.active = preference - } else { + if (preference === 'auto') { const probes = this.getProbeResults() if (probes.length > 0) this.active = selectBestMirrorEndpoint(probes, this.active) + } else { + this.active = preference } return this.active !== previousActive } @@ -509,13 +509,13 @@ export class MirrorEndpointManager { } tryFailover(failedEndpoint: MirrorEndpointId): MirrorEndpointId | null { - if (this.preference !== 'auto') return null - if (this.active !== failedEndpoint) return null + if (this.preference !== 'auto') {return null} + if (this.active !== failedEndpoint) {return null} const now = this.now() this.failedUntil.set(failedEndpoint, now + MIRROR_FALLBACK_COOLDOWN_MS) this.failedAt.set(failedEndpoint, now) const candidate = alternateMirrorEndpoint(failedEndpoint) - if (this.isEndpointFailed(candidate)) return null + if (this.isEndpointFailed(candidate)) {return null} this.active = candidate return candidate } diff --git a/src/common/tileProtocol.ts b/src/common/tileProtocol.ts index dd80ee9..49ba666 100644 --- a/src/common/tileProtocol.ts +++ b/src/common/tileProtocol.ts @@ -1,6 +1,6 @@ export const TILE_FAILURE_STATUS = 502 -export const TILE_FETCH_TIMEOUT_MS = 8_000 +export const TILE_FETCH_TIMEOUT_MS = 8000 export const TILE_FETCH_ATTEMPTS = 3 @@ -33,7 +33,7 @@ function defaultSleep(ms: number): Promise { } function normalizeRetryAttempts(attempts: number | undefined): number { - if (attempts === undefined || !Number.isFinite(attempts)) return TILE_FETCH_ATTEMPTS + if (attempts === undefined || !Number.isFinite(attempts)) {return TILE_FETCH_ATTEMPTS} return Math.max(1, Math.trunc(attempts)) } @@ -53,14 +53,14 @@ export async function fetchTilePayloadWithRetry( const data = await response.arrayBuffer() return { ok: true, status: response.status, headers: response.headers, data } } - void response.body?.cancel().catch(() => undefined) + void response.body?.cancel().catch(() => {}) if (!isRetryableTileStatus(response.status) || attempt === attempts - 1) { return { ok: false, status: response.status, headers: response.headers } } await sleep(tileRetryDelayMs(attempt, baseDelayMs)) } catch (error) { lastError = error - if (attempt < attempts - 1) await sleep(tileRetryDelayMs(attempt, baseDelayMs)) + if (attempt < attempts - 1) {await sleep(tileRetryDelayMs(attempt, baseDelayMs))} } } throw lastError diff --git a/src/common/touchInteraction.ts b/src/common/touchInteraction.ts index 1c88de7..206be0c 100644 --- a/src/common/touchInteraction.ts +++ b/src/common/touchInteraction.ts @@ -16,7 +16,7 @@ export interface TouchEnvironment { } export function resolveTouchInteractionActive(mode: TouchInteractionMode, environment: TouchEnvironment): boolean { - if (mode === 'on') return true - if (mode === 'off') return false + if (mode === 'on') {return true} + if (mode === 'off') {return false} return environment.coarsePointer || environment.maxTouchPoints > 0 } diff --git a/src/main/account.ts b/src/main/account.ts index 0807054..1c84bcc 100644 --- a/src/main/account.ts +++ b/src/main/account.ts @@ -1,41 +1,10 @@ import { app, BrowserWindow, ipcMain, net, shell } from 'electron' -import { randomBytes } from 'crypto' -import { hostname } from 'os' -import { join } from 'path' +import { randomBytes } from 'node:crypto' +import { hostname } from 'node:os' +import { join } from 'node:path' import { logger } from '../common/logger' -import { - accountPhaseLabel, - buildDeviceName, - describeAuthorizationFailure, - deviceListUrl, - encodeBase64Url, - isValidDeviceName, - isValidInstallationId, - isTrustedVerificationUriComplete, - normalizeIssuer, - parseDeviceAuthorization, - parseDiscovery, - parseTokenResponse, - parseUserInfo, - passportPlatform, - retryAfterSeconds, - scopeParameter, - signedOutAccountState, - truncateToUtf8Bytes, - PASSPORT_DEFAULT_ACCOUNT_ORIGIN, - PASSPORT_DEFAULT_CLIENT_ID, - PASSPORT_DEFAULT_ISSUER, - PASSPORT_DEVICE_GRANT_TYPE, - PASSPORT_DISCOVERY_PATH, - PASSPORT_REFRESH_GRANT_TYPE, - PASSPORT_SCOPES, - SLOW_DOWN_INCREMENT_SECONDS, - type AccountPhase, - type AccountProfile, - type AccountState, - type PassportEndpoints, - type PassportTokenResponse -} from '../common/passport' +import { accountPhaseLabel, buildDeviceName, describeAuthorizationFailure, deviceListUrl, encodeBase64Url, isValidDeviceName, isValidInstallationId, isTrustedVerificationUriComplete, normalizeIssuer, parseDeviceAuthorization, parseDiscovery, parseTokenResponse, parseUserInfo, passportPlatform, retryAfterSeconds, scopeParameter, signedOutAccountState, truncateToUtf8Bytes, PASSPORT_DEFAULT_ACCOUNT_ORIGIN, PASSPORT_DEFAULT_CLIENT_ID, PASSPORT_DEFAULT_ISSUER, PASSPORT_DEVICE_GRANT_TYPE, PASSPORT_DISCOVERY_PATH, PASSPORT_REFRESH_GRANT_TYPE, PASSPORT_SCOPES, SLOW_DOWN_INCREMENT_SECONDS } from '../common/passport'; +import type { AccountPhase, AccountProfile, AccountState, PassportEndpoints, PassportTokenResponse } from '../common/passport'; import { clearProviderKey, readProviderKey, writeProviderKey } from './keyVault' import { readJson, serialQueue, writeJson } from './jsonStore' @@ -79,11 +48,11 @@ let restoring = false const enqueueAccount = serialQueue() function passportIssuer(): string { - return normalizeIssuer(process.env['GUEARTH_PASSPORT_ISSUER'] ?? PASSPORT_DEFAULT_ISSUER) || PASSPORT_DEFAULT_ISSUER + return normalizeIssuer(process.env.GUEARTH_PASSPORT_ISSUER ?? PASSPORT_DEFAULT_ISSUER) || PASSPORT_DEFAULT_ISSUER } function passportAccountOrigin(): string { - const raw = process.env['GUEARTH_PASSPORT_ACCOUNT_ORIGIN'] ?? PASSPORT_DEFAULT_ACCOUNT_ORIGIN + const raw = process.env.GUEARTH_PASSPORT_ACCOUNT_ORIGIN ?? PASSPORT_DEFAULT_ACCOUNT_ORIGIN try { return new URL(raw).origin } catch { @@ -92,7 +61,7 @@ function passportAccountOrigin(): string { } function passportClientId(): string { - const raw = process.env['GUEARTH_PASSPORT_CLIENT_ID'] ?? PASSPORT_DEFAULT_CLIENT_ID + const raw = process.env.GUEARTH_PASSPORT_CLIENT_ID ?? PASSPORT_DEFAULT_CLIENT_ID return truncateToUtf8Bytes(raw.trim(), 128) } @@ -113,7 +82,7 @@ function snapshot(): AccountState { function emitState(): void { const state = snapshot() for (const window of BrowserWindow.getAllWindows()) { - if (!window.isDestroyed()) window.webContents.send('account:event', state) + if (!window.isDestroyed()) {window.webContents.send('account:event', state)} } } @@ -160,7 +129,7 @@ async function readPayload(response: Response): Promise { async function resolveEndpoints(signal?: AbortSignal): Promise { const issuer = passportIssuer() const cached = endpoints - if (cached && cached.issuer === issuer && Date.now() - endpointsFetchedAt < DISCOVERY_TTL_MS) return cached + if (cached?.issuer === issuer && Date.now() - endpointsFetchedAt < DISCOVERY_TTL_MS) {return cached} const timeoutSignal = requestSignal(signal) try { const response = await net.fetch(`${issuer}${PASSPORT_DISCOVERY_PATH}`, { @@ -190,9 +159,9 @@ async function resolveEndpoints(signal?: AbortSignal): Promise - if (typeof record.profile !== 'object' || record.profile === null || Array.isArray(record.profile)) return null + if (typeof record.profile !== 'object' || record.profile === null || Array.isArray(record.profile)) {return null} const cached = record.profile as Record - if (typeof cached.sub !== 'string' || cached.sub === '') return null + if (typeof cached.sub !== 'string' || cached.sub === '') {return null} const scopes = Array.isArray(cached.scopes) ? cached.scopes.filter((scope): scope is string => typeof scope === 'string') : [] return { sub: cached.sub, @@ -267,7 +236,7 @@ function delay(ms: number, signal: AbortSignal): Promise { } function clampInterval(seconds: number): number { - if (!Number.isFinite(seconds) || seconds <= 0) return 5 + if (!Number.isFinite(seconds) || seconds <= 0) {return 5} return Math.min(MAX_POLL_INTERVAL_SECONDS, Math.max(1, Math.round(seconds))) } @@ -284,7 +253,7 @@ async function fetchUserInfo(token: string, signal?: AbortSignal): Promise= expiresAt) throw new Error('登录确认已超时,请重新发起登录') + if (Date.now() >= expiresAt) {throw new Error('登录确认已超时,请重新发起登录')} let tokens: PassportTokenResponse try { tokens = await requestToken( @@ -330,7 +299,7 @@ async function exchangeDeviceCode(deviceCode: string, initialInterval: number, e signal ) } catch (error) { - if (signal.aborted) throw new LoginCancelledError() + if (signal.aborted) {throw new LoginCancelledError()} const failure = error as Error & { terminal?: boolean; slowDown?: boolean; retryable?: boolean; retryAfterSeconds?: number } if (failure.slowDown) { interval = clampInterval(interval + SLOW_DOWN_INCREMENT_SECONDS) @@ -368,11 +337,11 @@ async function adoptTokens(tokens: PassportTokenResponse): Promise { - if (loginController) throw new Error('已有登录流程正在进行') - if (phase === 'signed-in') throw new Error('当前已登录,请先退出登录') + if (loginController) {throw new Error('已有登录流程正在进行')} + if (phase === 'signed-in') {throw new Error('当前已登录,请先退出登录')} if (readRefreshToken()) { await restoreSession() - if (snapshot().phase === 'signed-in') return snapshot() + if (snapshot().phase === 'signed-in') {return snapshot()} } const controller = new AbortController() loginController = controller @@ -383,8 +352,8 @@ async function startLogin(): Promise { setPhase('creating') const installation = installationId() const deviceName = buildDeviceName(hostname()) - if (!isValidInstallationId(installation)) throw new Error('本机安装标识无效,无法发起登录') - if (!isValidDeviceName(deviceName)) throw new Error('设备名称无效,无法发起登录') + if (!isValidInstallationId(installation)) {throw new Error('本机安装标识无效,无法发起登录')} + if (!isValidDeviceName(deviceName)) {throw new Error('设备名称无效,无法发起登录')} const created = await resolveEndpoints(controller.signal) const response = await postForm( created.deviceAuthorizationEndpoint, @@ -404,7 +373,7 @@ async function startLogin(): Promise { } const accountOrigin = passportAccountOrigin() const authorization = parseDeviceAuthorization(payload, accountOrigin) - if (!authorization) throw new Error('登录确认信息无效,请重新发起登录') + if (!authorization) {throw new Error('登录确认信息无效,请重新发起登录')} if (!isTrustedVerificationUriComplete(authorization.verificationUriComplete, accountOrigin)) { throw new Error('登录确认页地址不受信任,已终止本次登录') } @@ -417,13 +386,13 @@ async function startLogin(): Promise { } verificationUriComplete = authorization.verificationUriComplete setPhase('awaiting-approval') - void shell.openExternal(authorization.verificationUriComplete).catch(() => undefined) + void shell.openExternal(authorization.verificationUriComplete).catch(() => {}) const tokens = await exchangeDeviceCode(authorization.deviceCode, authorization.interval, expiresAt, controller.signal) - if (controller.signal.aborted) throw new LoginCancelledError() + if (controller.signal.aborted) {throw new LoginCancelledError()} setPhase('finalizing') await adoptTokens(tokens) adopted = true - if (controller.signal.aborted) throw new LoginCancelledError() + if (controller.signal.aborted) {throw new LoginCancelledError()} challenge = null verificationUriComplete = '' setPhase('signed-in') @@ -432,8 +401,8 @@ async function startLogin(): Promise { challenge = null verificationUriComplete = '' if (error instanceof LoginCancelledError || controller.signal.aborted) { - if (adopted) await discardAdoptedSession() - else setPhase('signed-out') + if (adopted) {await discardAdoptedSession()} + else {setPhase('signed-out')} return snapshot() } const message = error instanceof Error ? error.message : '登录失败,请稍后再试' @@ -450,25 +419,25 @@ function cancelLogin(): void { } function beginLogin(): Promise { - if (loginTask) return Promise.reject(new Error('已有登录流程正在进行')) + if (loginTask) {return Promise.reject(new Error('已有登录流程正在进行'))} const task = startLogin() loginTask = task void task.then( () => { - if (loginTask === task) loginTask = null + if (loginTask === task) {loginTask = null} }, () => { - if (loginTask === task) loginTask = null + if (loginTask === task) {loginTask = null} } ) return task } async function refreshAccessToken(): Promise { - if (accessToken && Date.now() < accessTokenExpiresAt - ACCESS_TOKEN_MARGIN_MS) return accessToken - if (refreshInFlight) return refreshInFlight + if (accessToken && Date.now() < accessTokenExpiresAt - ACCESS_TOKEN_MARGIN_MS) {return accessToken} + if (refreshInFlight) {return refreshInFlight} const refreshToken = readRefreshToken() - if (!refreshToken) throw new Error('登录状态已失效,请重新登录') + if (!refreshToken) {throw new Error('登录状态已失效,请重新登录')} const controller = new AbortController() const timer = setTimeout(() => controller.abort(), REQUEST_TIMEOUT_MS) const task = (async () => { @@ -491,7 +460,7 @@ async function refreshAccessToken(): Promise { return await task } catch (error) { const failure = error as Error & { invalidatesSession?: boolean } - if (failure.invalidatesSession) await endSessionLocally('登录状态已失效,请重新登录') + if (failure.invalidatesSession) {await endSessionLocally('登录状态已失效,请重新登录')} throw error } finally { refreshInFlight = null @@ -527,7 +496,7 @@ async function revokeRemote(refreshToken: string, signal: AbortSignal): Promise< body.set('token', refreshToken) body.set('token_type_hint', 'refresh_token') const response = await postForm(active.revocationEndpoint, body, signal) - if (response.ok) return true + if (response.ok) {return true} logger.warn('account', `Passport 撤销请求返回 HTTP ${response.status}`) return false } catch (error) { @@ -537,9 +506,9 @@ async function revokeRemote(refreshToken: string, signal: AbortSignal): Promise< } async function signOut(): Promise { - if (phase === 'signing-out') return snapshot() + if (phase === 'signing-out') {return snapshot()} cancelLogin() - await loginTask?.catch(() => undefined) + await loginTask?.catch(() => {}) const refreshToken = readRefreshToken() setPhase('signing-out') let revokedRemotely = true @@ -562,7 +531,7 @@ async function signOut(): Promise { } async function restoreSession(): Promise { - if (restoring) return + if (restoring) {return} const refreshToken = readRefreshToken() if (!refreshToken) { if (profile || signedInAt) { @@ -581,8 +550,8 @@ async function restoreSession(): Promise { const info = await fetchUserInfo(accessToken) profile = { ...info, scopes: profile?.scopes?.length ? profile.scopes : info.scopes } } catch (error) { - if ((error as Error & { invalidatesSession?: boolean }).invalidatesSession) throw error - if (!profile) throw error + if ((error as Error & { invalidatesSession?: boolean }).invalidatesSession) {throw error} + if (!profile) {throw error} logger.warn('account', '恢复登录状态时获取账户信息失败,已沿用本机缓存的账户信息', error) } signedInAt = signedInAt || Date.now() @@ -603,7 +572,7 @@ async function restoreSession(): Promise { } async function dismissRevocationWarning(): Promise { - if (!pendingRemoteRevocation) return snapshot() + if (!pendingRemoteRevocation) {return snapshot()} pendingRemoteRevocation = false await persistAccount() setPhase('signed-out') @@ -612,13 +581,13 @@ async function dismissRevocationWarning(): Promise { async function openAccountDevices(): Promise { const url = accountDeviceListUrl() - if (!url) throw new Error('账号页地址不可用') + if (!url) {throw new Error('账号页地址不可用')} await shell.openExternal(url) } async function openVerificationPage(): Promise { const url = verificationUriComplete - if (!url || !isTrustedVerificationUriComplete(url, passportAccountOrigin())) throw new Error('当前没有可打开的登录确认页') + if (!url || !isTrustedVerificationUriComplete(url, passportAccountOrigin())) {throw new Error('当前没有可打开的登录确认页')} await shell.openExternal(url) } @@ -628,7 +597,7 @@ export function initAccount(): void { ipcMain.handle('account:login', (): Promise => beginLogin()) ipcMain.handle('account:cancel-login', async (): Promise => { cancelLogin() - await loginTask?.catch(() => undefined) + await loginTask?.catch(() => {}) return snapshot() }) ipcMain.handle('account:sign-out', (): Promise => signOut()) @@ -642,7 +611,7 @@ export function initAccount(): void { profile = persisted.profile signedInAt = persisted.signedInAt pendingRemoteRevocation = persisted.pendingRemoteRevocation - if (profile) emitState() + if (profile) {emitState()} } catch { profile = null } diff --git a/src/main/ai/agent.ts b/src/main/ai/agent.ts index 95b3e5a..6c85c3b 100644 --- a/src/main/ai/agent.ts +++ b/src/main/ai/agent.ts @@ -1,5 +1,6 @@ import { randomUUID } from 'node:crypto' -import { ipcMain, net, type IpcMainInvokeEvent, type WebContents } from 'electron' +import { ipcMain, net } from 'electron'; +import type { IpcMainInvokeEvent, WebContents } from 'electron'; import type { AgentMemory, AiChatEvent, @@ -24,7 +25,8 @@ import type { AiChatHistoryStore } from './chatHistoryStore' import type { AiSettingsStore } from './settingsStore' import type { AiMemoryStore } from './memoryStore' import type { EoqHawdbClient } from './hawdb/client' -import { createTurnFlightGuard, evaluateFlightToolGuard, type TurnFlightGuard } from '../../common/flightStops' +import { createTurnFlightGuard, evaluateFlightToolGuard } from '../../common/flightStops'; +import type { TurnFlightGuard } from '../../common/flightStops'; import { formatTelemetryToolCalls, redactApiKey, sanitizeTelemetryMessages, sanitizeTelemetryToolSpan } from '../../common/aiTelemetry' import { captureAiGeneration, captureAiSpan } from './posthog' @@ -183,18 +185,18 @@ interface MemoryRuntime { } function selectMemoriesForPrompt(allMemories: AgentMemory[], recalled?: AgentMemory[]): AgentMemory[] { - if (allMemories.length <= MEMORY_FULL_INJECT_LIMIT) return allMemories + if (allMemories.length <= MEMORY_FULL_INJECT_LIMIT) {return allMemories} const selected: AgentMemory[] = [] const seen = new Set() for (const item of recalled ?? []) { - if (seen.has(item.id)) continue + if (seen.has(item.id)) {continue} seen.add(item.id) selected.push(item) - if (selected.length >= MEMORY_RECALL_LIMIT) break + if (selected.length >= MEMORY_RECALL_LIMIT) {break} } const recent = [...allMemories].slice(-MEMORY_RECENT_LIMIT).reverse() for (const item of recent) { - if (seen.has(item.id)) continue + if (seen.has(item.id)) {continue} seen.add(item.id) selected.push(item) } @@ -209,7 +211,7 @@ function memoryPromptLines(memories: AgentMemory[], totalCount: number): string[ '- 一次性的临时信息(当前视角、本次会话的临时问题与数据)不要保存。', '- 发现某条记忆过时或错误时,调用 delete_memory 按 id 删除,需要时再保存新的。' ] - if (!memories.length) return [...rules, '当前暂无已保存的用户记忆。'] + if (memories.length === 0) {return [...rules, '当前暂无已保存的用户记忆。']} const heading = totalCount > memories.length ? `与当前话题最相关及最近保存的用户记忆(共 ${totalCount} 条,展示 ${memories.length} 条,id:内容):` : '已保存的用户记忆(id:内容):' @@ -225,7 +227,7 @@ const SOCRATIC_PROMPT_LINES = [ function buildSystemPrompt(memory: MemoryRuntime, socratic = false, recalledMemories?: AgentMemory[]): string { const blocks = [SYSTEM_PROMPT] - if (socratic) blocks.push(SOCRATIC_PROMPT_LINES) + if (socratic) {blocks.push(SOCRATIC_PROMPT_LINES)} if (memory.enabled) { const allMemories = memory.store.list() blocks.push(...memoryPromptLines(selectMemoriesForPrompt(allMemories, recalledMemories), allMemories.length)) @@ -275,7 +277,7 @@ interface AgentSession { const MAX_TOOL_ROUNDS = 16 const TOOL_RESULT_LIMIT = 24_000 const RENDERER_TOOL_TIMEOUT_MS = 60_000 -const ANALYZE_TERRAIN_TIMEOUT_MS = 8_000 +const ANALYZE_TERRAIN_TIMEOUT_MS = 8000 const SEARCH_FAILURE_GUIDANCE_THRESHOLD = 3 const SEARCH_FAILURE_GUIDANCE = [ @@ -294,12 +296,12 @@ const watchedSenders = new WeakSet() function abortSenderWork(sender: WebContents): void { for (const [sessionId, session] of sessions) { - if (session.sender !== sender) continue + if (session.sender !== sender) {continue} session.controller.abort() sessions.delete(sessionId) } for (const [callId, entry] of pendingRendererTools) { - if (entry.sender !== sender) continue + if (entry.sender !== sender) {continue} clearTimeout(entry.timer) pendingRendererTools.delete(callId) entry.resolve({ ok: false, content: JSON.stringify({ error: '页面已关闭或刷新,工具执行中止' }) }) @@ -307,11 +309,11 @@ function abortSenderWork(sender: WebContents): void { } function watchSenderLifecycle(sender: WebContents): void { - if (watchedSenders.has(sender)) return + if (watchedSenders.has(sender)) {return} watchedSenders.add(sender) sender.on('destroyed', () => abortSenderWork(sender)) sender.on('did-start-navigation', (_event, _url, isInPlace, isMainFrame) => { - if (isInPlace || !isMainFrame) return + if (isInPlace || !isMainFrame) {return} abortSenderWork(sender) }) } @@ -326,20 +328,20 @@ function safeParseJson(text: string): Record { } function clampToolResult(value: string): string { - if (value.length <= TOOL_RESULT_LIMIT) return value + if (value.length <= TOOL_RESULT_LIMIT) {return value} return `${value.slice(0, TOOL_RESULT_LIMIT / 2)}\n…(结果过长已截断)…\n${value.slice(-TOOL_RESULT_LIMIT / 2)}` } function extractImage(value: unknown): ToolImage | undefined { - if (typeof value !== 'object' || value === null) return undefined + if (typeof value !== 'object' || value === null) {return undefined} const image = (value as Record).image - if (typeof image !== 'string') return undefined + if (typeof image !== 'string') {return undefined} const match = /^data:([^;]+);base64,(.+)$/.exec(image) return match ? { mediaType: match[1], data: match[2] } : undefined } function withoutImage(value: unknown): unknown { - if (typeof value !== 'object' || value === null) return value + if (typeof value !== 'object' || value === null) {return value} const { image, ...rest } = value as Record return image === undefined ? value : rest } @@ -352,31 +354,31 @@ function streamError(message: string): Error { function streamErrorText(payload: Record): string { const raw = payload.error - if (typeof raw === 'string' && raw) return raw + if (typeof raw === 'string' && raw) {return raw} if (typeof raw === 'object' && raw !== null) { const record = raw as Record - if (typeof record.message === 'string' && record.message) return record.message - if (typeof record.type === 'string' && record.type) return record.type + if (typeof record.message === 'string' && record.message) {return record.message} + if (typeof record.type === 'string' && record.type) {return record.type} } - if (!Array.isArray(payload.choices) && typeof payload.message === 'string' && payload.message) return payload.message + if (!Array.isArray(payload.choices) && typeof payload.message === 'string' && payload.message) {return payload.message} return '' } function imageUnsupported(error: unknown): boolean { - if (error instanceof Error && error.name === 'StreamError') return false + if (error instanceof Error && error.name === 'StreamError') {return false} const message = error instanceof Error ? error.message : String(error) return /image|vision|multimodal|modal|unsupported|不支持|图片/i.test(message) } function stringifyArgSummary(args: unknown): string { - if (typeof args !== 'object' || args === null) return '' + if (typeof args !== 'object' || args === null) {return ''} const entries = Object.entries(args as Record).filter(([, value]) => value !== undefined) return entries.map(([key, value]) => `${key}=${typeof value === 'string' ? value : JSON.stringify(value)}`).join(' ') } function estimateTokens(text: string): number { let cjk = 0 - for (const char of text) if (/[\u4e00-\u9fff\u3000-\u303f\uff00-\uffef]/.test(char)) cjk += 1 + for (const char of text) {if (/[\u4e00-\u9fff\u3000-\u303f\uff00-\uffef]/.test(char)) cjk += 1} return cjk + Math.ceil((text.length - cjk) / 3.5) } @@ -397,9 +399,9 @@ function contextStatsForMessages(messages: WireMessage[], contextWindow: number) const cost = messageTokenCost(message) usedTokens += cost const category = categoryByKey.get(message.role) - if (category) category.tokens += cost + if (category) {category.tokens += cost} } - for (const category of categories) category.ratio = usedTokens ? Math.round(category.tokens / usedTokens * 100) : 0 + for (const category of categories) {category.ratio = usedTokens ? Math.round(category.tokens / usedTokens * 100) : 0} return { usedTokens, contextWindow, @@ -423,13 +425,13 @@ function contextMessagesForEntries(entries: AiContextEntry[], systemContent: str function retainedTurns(messages: WireMessage[]): AiChatTurn[] { return messages.flatMap((message): AiChatTurn[] => { - if (message.role !== 'user' && message.role !== 'assistant') return [] + if (message.role !== 'user' && message.role !== 'assistant') {return []} return [{ role: message.role, content: message.content }] }) } function trimHistory(messages: WireMessage[], contextWindow: number): WireMessage[] { - const budget = Math.max(2_000, Math.floor(contextWindow * 0.6)) + const budget = Math.max(2000, Math.floor(contextWindow * 0.6)) const system = messages.filter((message) => message.role === 'system') const rest = messages.filter((message) => message.role !== 'system') let total = system.reduce((sum, message) => sum + estimateTokens(message.content), 0) @@ -437,7 +439,7 @@ function trimHistory(messages: WireMessage[], contextWindow: number): WireMessag for (let index = rest.length - 1; index >= 0; index -= 1) { const message = rest[index] const cost = messageTokenCost(message) - if (kept.length >= 4 && total + cost > budget) break + if (kept.length >= 4 && total + cost > budget) {break} kept.unshift(message) total += cost } @@ -446,22 +448,22 @@ function trimHistory(messages: WireMessage[], contextWindow: number): WireMessag function apiEndpoint(baseUrl: string, protocol: AiProviderConfig['protocol'], path: string): string { let base = baseUrl.trim().replace(/\/+$/, '') - if (/^https?:\/\/[^/]+$/i.test(base)) base = `${base}/v1` + if (/^https?:\/\/[^/]+$/i.test(base)) {base = `${base}/v1`} return `${base}${path}` } function openaiThinkingBody(model: AiModelConfig, baseUrl: string): Record { - if (!model.thinking) return {} - if (/dashscope|qwen/i.test(baseUrl)) return { enable_thinking: true } + if (!model.thinking) {return {}} + if (/dashscope|qwen/i.test(baseUrl)) {return { enable_thinking: true }} return { reasoning_effort: model.thinkingLevel } } -const anthropicBudget: Record = { low: 1_024, medium: 4_096, high: 16_384 } +const anthropicBudget: Record = { low: 1024, medium: 4096, high: 16_384 } function toOpenAiMessages(messages: WireMessage[]): unknown[] { return messages.map((message) => { - if (message.role === 'system') return { role: 'system', content: message.content } - if (message.role === 'user') return { role: 'user', content: message.content } + if (message.role === 'system') {return { role: 'system', content: message.content }} + if (message.role === 'user') {return { role: 'user', content: message.content }} if (message.role === 'assistant') { const entry: Record = { role: 'assistant', content: message.content || '' } if (message.toolCalls?.length) { @@ -485,18 +487,16 @@ function toOpenAiMessages(messages: WireMessage[]): unknown[] { function toAnthropicMessages(messages: WireMessage[]): unknown[] { const result: { role: string; content: unknown }[] = [] for (const message of messages) { - if (message.role === 'system') continue + if (message.role === 'system') {continue} if (message.role === 'user') { result.push({ role: 'user', content: message.content }) continue } if (message.role === 'assistant') { - const blocks: Record[] = [ - ...(message.thinkingBlocks ?? []).map((block) => ({ type: 'thinking', thinking: block.thinking, signature: block.signature })) - ] - if (message.content) blocks.push({ type: 'text', text: message.content }) - for (const call of message.toolCalls ?? []) blocks.push({ type: 'tool_use', id: call.id, name: call.name, input: safeParseJson(call.arguments) }) - result.push({ role: 'assistant', content: blocks.length ? blocks : [{ type: 'text', text: '' }] }) + const blocks: Record[] = (message.thinkingBlocks ?? []).map((block) => ({ type: 'thinking', thinking: block.thinking, signature: block.signature })) + if (message.content) {blocks.push({ type: 'text', text: message.content })} + for (const call of message.toolCalls ?? []) {blocks.push({ type: 'tool_use', id: call.id, name: call.name, input: safeParseJson(call.arguments) })} + result.push({ role: 'assistant', content: blocks.length > 0 ? blocks : [{ type: 'text', text: '' }] }) continue } const content = message.image @@ -507,20 +507,20 @@ function toAnthropicMessages(messages: WireMessage[]): unknown[] { : message.content const block = { type: 'tool_result', tool_use_id: message.callId, content, is_error: message.isError === true } const last = result[result.length - 1] - if (last && last.role === 'user' && Array.isArray(last.content)) last.content.push(block) - else result.push({ role: 'user', content: [block] }) + if (last?.role === 'user' && Array.isArray(last.content)) {last.content.push(block)} + else {result.push({ role: 'user', content: [block] })} } return result } async function readSse(response: Response, onEvent: (data: string) => void): Promise { const reader = response.body?.getReader() - if (!reader) throw new Error('响应缺少数据流') + if (!reader) {throw new Error('响应缺少数据流')} const decoder = new TextDecoder() let buffer = '' for (;;) { const { done, value } = await reader.read() - if (done) break + if (done) {break} buffer += decoder.decode(value, { stream: true }) let newlineIndex = buffer.indexOf('\n') while (newlineIndex >= 0) { @@ -528,7 +528,7 @@ async function readSse(response: Response, onEvent: (data: string) => void): Pro buffer = buffer.slice(newlineIndex + 1) if (line.startsWith('data:')) { const data = line.slice(5).trim() - if (data) onEvent(data) + if (data) {onEvent(data)} } newlineIndex = buffer.indexOf('\n') } @@ -571,8 +571,8 @@ function observabilityProvider(provider: AiProviderConfig): string { [/cerebras\.ai$/, 'cerebras'] ] const known = knownProviders.find(([pattern]) => pattern.test(hostname)) - if (known) return known[1] - const configuredName = provider.name.trim().toLowerCase().replace(/[^a-z0-9]+/g, '_').replace(/^_+|_+$/g, '') + if (known) {return known[1]} + const configuredName = provider.name.trim().toLowerCase().replaceAll(/[^a-z0-9]+/g, '_').replaceAll(/^_+|_+$/g, '') return configuredName || provider.id } @@ -590,7 +590,7 @@ function captureModelGeneration(observability: AiObservabilityContext, provider: { role: 'assistant', content: result.text, - ...(result.toolCalls.length ? { tool_calls: formatTelemetryToolCalls(result.toolCalls) } : {}) + ...(result.toolCalls.length > 0 ? { tool_calls: formatTelemetryToolCalls(result.toolCalls) } : {}) } ] } @@ -599,7 +599,7 @@ function captureModelGeneration(observability: AiObservabilityContext, provider: requestUrl: apiEndpoint(provider.baseUrl, provider.protocol, provider.protocol === 'anthropic' ? '/messages' : '/chat/completions'), latencyMs: Date.now() - startedAt, stream: model.streaming, - ...(tools.length ? { tools } : {}), + ...(tools.length > 0 ? { tools } : {}), ...(failure ? { error: failure } : {}) }) } @@ -612,9 +612,9 @@ function httpFailureError(provider: AiProviderConfig, model: AiModelConfig, url: `接口:${url}` ] const requestId = response.headers.get('x-request-id') ?? response.headers.get('request-id') - if (requestId) parts.push(`请求ID:${requestId}`) + if (requestId) {parts.push(`请求ID:${requestId}`)} const detail = body.trim() - if (detail) parts.push(`服务端返回:${detail.slice(0, 1200)}`) + if (detail) {parts.push(`服务端返回:${detail.slice(0, 1200)}`)} return new Error(parts.join(';')) } @@ -624,7 +624,7 @@ async function fetchResponse(url: string, init: RequestInit, provider: AiProvide } catch (error) { if (error instanceof DOMException && error.name === 'AbortError') throw error const reason = error instanceof Error ? error.message : String(error) - throw new Error(`网络请求异常(供应商:${provider.name};模型:${model.id};接口:${url}):${reason}`) + throw new Error(`网络请求异常(供应商:${provider.name};模型:${model.id};接口:${url}):${reason}`, { cause: error }) } } @@ -647,8 +647,8 @@ function sleepAbortable(ms: number, signal: AbortSignal): Promise { signal.removeEventListener('abort', onAbort) reject(new DOMException('Aborted', 'AbortError')) } - if (signal.aborted) onAbort() - else signal.addEventListener('abort', onAbort) + if (signal.aborted) {onAbort()} + else {signal.addEventListener('abort', onAbort)} }) } @@ -658,14 +658,14 @@ async function fetchWithRetry(url: string, init: RequestInit, provider: AiProvid try { response = await fetchResponse(url, init, provider, model) } catch (error) { - if (isAbortError(error) || attempt >= MAX_LLM_RETRIES) throw error + if (isAbortError(error) || attempt >= MAX_LLM_RETRIES) {throw error} const reason = error instanceof Error ? error.message : String(error) const tail = reason.includes(':') ? reason.split(':').pop() ?? reason : reason onRetry?.(attempt + 1, MAX_LLM_RETRIES, `网络异常(${tail.slice(0, 60)})`) await sleepAbortable(RETRY_BASE_DELAY_MS * 2 ** attempt, signal) continue } - if (response.ok) return response + if (response.ok) {return response} const body = await response.text().catch(() => '') if (!RETRYABLE_STATUSES.has(response.status) || attempt >= MAX_LLM_RETRIES) { throw httpFailureError(provider, model, url, response, body) @@ -678,22 +678,22 @@ async function fetchWithRetry(url: string, init: RequestInit, provider: AiProvid async function fetchJson(url: string, init: RequestInit, provider: AiProviderConfig, model: AiModelConfig, signal: AbortSignal, onRetry?: (attempt: number, maxRetries: number, reason: string) => void): Promise> { const response = await fetchWithRetry(url, init, provider, model, signal, onRetry) const parsed: unknown = await response.json() - if (typeof parsed !== 'object' || parsed === null) throw new Error('响应格式错误') + if (typeof parsed !== 'object' || parsed === null) {throw new Error('响应格式错误')} return parsed as Record } function collectOpenAiToolCalls(raw: unknown): WireToolCall[] { - if (!Array.isArray(raw)) return [] + if (!Array.isArray(raw)) {return []} const byIndex = new Map() for (const [position, fragment] of raw.entries()) { - if (typeof fragment !== 'object' || fragment === null) continue + if (typeof fragment !== 'object' || fragment === null) {continue} const piece = fragment as { index?: unknown; id?: unknown; function?: { name?: unknown; arguments?: unknown } } const index = typeof piece.index === 'number' ? piece.index : position const current = byIndex.get(index) ?? { id: '', name: '', args: '' } - if (typeof piece.id === 'string' && piece.id) current.id = piece.id + if (typeof piece.id === 'string' && piece.id) {current.id = piece.id} if (piece.function) { - if (typeof piece.function.name === 'string' && piece.function.name && !current.name) current.name = piece.function.name - if (typeof piece.function.arguments === 'string') current.args += piece.function.arguments + if (typeof piece.function.name === 'string' && piece.function.name && !current.name) {current.name = piece.function.name} + if (typeof piece.function.arguments === 'string') {current.args += piece.function.arguments} } byIndex.set(index, current) } @@ -718,7 +718,7 @@ async function runOpenAiTurn(options: { messages: toOpenAiMessages(messages), ...openaiThinkingBody(model, provider.baseUrl) } - if (tools.length) { + if (tools.length > 0) { body.tools = tools.map((tool) => ({ type: 'function', function: { name: tool.name, description: tool.description, parameters: tool.parameters } })) body.tool_choice = 'auto' } @@ -726,11 +726,11 @@ async function runOpenAiTurn(options: { if (!model.streaming) { const json = await fetchJson(url, { method: 'POST', headers, body: JSON.stringify(body), signal }, provider, model, signal, onRetry) const jsonError = streamErrorText(json) - if (jsonError) throw streamError(`模型服务返回错误(${model.id}):${jsonError}`) + if (jsonError) {throw streamError(`模型服务返回错误(${model.id}):${jsonError}`)} const choice = Array.isArray(json.choices) && json.choices[0] && typeof json.choices[0] === 'object' ? json.choices[0] as Record : {} const message = typeof choice.message === 'object' && choice.message !== null ? choice.message as Record : {} const reasoning = typeof message.reasoning_content === 'string' ? message.reasoning_content : '' - if (reasoning) onReasoningDelta(reasoning) + if (reasoning) {onReasoningDelta(reasoning)} return { text: typeof message.content === 'string' ? message.content : '', reasoning, @@ -744,14 +744,14 @@ async function runOpenAiTurn(options: { let reasoning = '' const toolAccumulator = new Map() await readSse(response, (data) => { - if (data === '[DONE]') return + if (data === '[DONE]') {return} const json = safeParseJson(data) const errorText = streamErrorText(json) - if (errorText) throw streamError(`模型服务返回错误(${model.id}):${errorText}`) + if (errorText) {throw streamError(`模型服务返回错误(${model.id}):${errorText}`)} const choices = json.choices - if (!Array.isArray(choices) || !choices.length) return + if (!Array.isArray(choices) || choices.length === 0) {return} const delta = (typeof choices[0] === 'object' && choices[0] !== null ? (choices[0] as Record).delta : null) as Record | null - if (!delta) return + if (!delta) {return} if (typeof delta.content === 'string' && delta.content) { text += delta.content onTextDelta(delta.content) @@ -763,14 +763,14 @@ async function runOpenAiTurn(options: { } if (Array.isArray(delta.tool_calls)) { for (const fragment of delta.tool_calls) { - if (typeof fragment !== 'object' || fragment === null) continue + if (typeof fragment !== 'object' || fragment === null) {continue} const piece = fragment as { index?: unknown; id?: unknown; function?: { name?: unknown; arguments?: unknown } } const index = typeof piece.index === 'number' ? piece.index : 0 const current = toolAccumulator.get(index) ?? { id: '', name: '', args: '' } - if (typeof piece.id === 'string' && piece.id) current.id = piece.id + if (typeof piece.id === 'string' && piece.id) {current.id = piece.id} if (piece.function) { - if (typeof piece.function.name === 'string' && piece.function.name && !current.name) current.name = piece.function.name - if (typeof piece.function.arguments === 'string') current.args += piece.function.arguments + if (typeof piece.function.name === 'string' && piece.function.name && !current.name) {current.name = piece.function.name} + if (typeof piece.function.arguments === 'string') {current.args += piece.function.arguments} } toolAccumulator.set(index, current) } @@ -794,7 +794,7 @@ async function runAnthropicTurn(options: { const { provider, model, apiKey, messages, tools, signal, onTextDelta, onReasoningDelta, onRetry } = options const url = apiEndpoint(provider.baseUrl, provider.protocol, '/messages') const budgetTokens = anthropicBudget[model.thinkingLevel] ?? anthropicBudget.medium - const maxTokens = model.thinking ? Math.max(8_192, budgetTokens * 2) : 8_192 + const maxTokens = model.thinking ? Math.max(8192, budgetTokens * 2) : 8192 const systemContent = messages.find((message) => message.role === 'system')?.content ?? SYSTEM_PROMPT const body: Record = { model: model.id, @@ -802,19 +802,19 @@ async function runAnthropicTurn(options: { system: systemContent, messages: toAnthropicMessages(messages) } - if (model.thinking) body.thinking = { type: 'enabled', budget_tokens: budgetTokens } - if (tools.length) body.tools = tools.map((tool) => ({ name: tool.name, description: tool.description, input_schema: tool.parameters })) + if (model.thinking) {body.thinking = { type: 'enabled', budget_tokens: budgetTokens }} + if (tools.length > 0) {body.tools = tools.map((tool) => ({ name: tool.name, description: tool.description, input_schema: tool.parameters }))} const headers = { 'Content-Type': 'application/json', 'x-api-key': apiKey, 'anthropic-version': '2023-06-01' } if (!model.streaming) { const json = await fetchJson(url, { method: 'POST', headers, body: JSON.stringify(body), signal }, provider, model, signal, onRetry) const jsonError = streamErrorText(json) - if (jsonError) throw streamError(`模型服务返回错误(${model.id}):${jsonError}`) + if (jsonError) {throw streamError(`模型服务返回错误(${model.id}):${jsonError}`)} const blocks = Array.isArray(json.content) ? json.content.filter((block): block is Record => typeof block === 'object' && block !== null) : [] const text = blocks.filter((block) => block.type === 'text').map((block) => String(block.text ?? '')).join('') const thinkingBlocks = blocks.filter((block) => block.type === 'thinking').map((block) => ({ thinking: String(block.thinking ?? ''), signature: String(block.signature ?? '') })) const reasoning = thinkingBlocks.map((block) => block.thinking).join('') - if (reasoning) onReasoningDelta(reasoning) - if (text) onTextDelta(text) + if (reasoning) {onReasoningDelta(reasoning)} + if (text) {onTextDelta(text)} return { text, reasoning, @@ -831,7 +831,7 @@ async function runAnthropicTurn(options: { await readSse(response, (data) => { const json = safeParseJson(data) const type = json.type - if (type === 'error') throw streamError(`模型服务返回错误(${model.id}):${streamErrorText(json) || '未知错误'}`) + if (type === 'error') {throw streamError(`模型服务返回错误(${model.id}):${streamErrorText(json) || '未知错误'}`)} if (type === 'content_block_start') { const index = Number(json.index ?? 0) const block = typeof json.content_block === 'object' && json.content_block !== null ? json.content_block as Record : {} @@ -842,7 +842,7 @@ async function runAnthropicTurn(options: { const index = Number(json.index ?? 0) const block = blockTypes.get(index) const delta = typeof json.delta === 'object' && json.delta !== null ? json.delta as Record : {} - if (!block) return + if (!block) {return} if (delta.type === 'text_delta' && typeof delta.text === 'string') { text += delta.text onTextDelta(delta.text) @@ -859,9 +859,9 @@ async function runAnthropicTurn(options: { if (type === 'content_block_stop') { const index = Number(json.index ?? 0) const block = blockTypes.get(index) - if (!block) return - if (block.type === 'thinking' && block.thinking) thinkingBlocks.push({ thinking: block.thinking, signature: block.signature }) - if (block.type === 'tool_use' && block.name) toolCalls.push({ id: block.id || `call_${index}`, name: block.name, arguments: block.args || '{}' }) + if (!block) {return} + if (block.type === 'thinking' && block.thinking) {thinkingBlocks.push({ thinking: block.thinking, signature: block.signature })} + if (block.type === 'tool_use' && block.name) {toolCalls.push({ id: block.id || `call_${index}`, name: block.name, arguments: block.args || '{}' })} } }) const reasoning = thinkingBlocks.map((block) => block.thinking).join('') @@ -869,7 +869,7 @@ async function runAnthropicTurn(options: { } function emit(sender: WebContents, event: AiChatEvent): void { - if (sender.isDestroyed()) return + if (sender.isDestroyed()) {return} sender.send('ai:event', event) } @@ -911,7 +911,7 @@ async function runModelTurn(options: { try { return await invoke(messages) } catch (error) { - if (signal.aborted || !messages.some((message) => message.image) || !imageUnsupported(error)) throw error + if (signal.aborted || !messages.some((message) => message.image) || !imageUnsupported(error)) {throw error} return invoke(messages.map((message) => (message.image ? { ...message, image: undefined } : message))) } } @@ -942,7 +942,7 @@ async function executeTool( ): Promise { const startedAt = Date.now() const args = safeParseJson(argsJson) - if (name === 'web_search') args.query = typeof args.query === 'string' ? args.query.trim().slice(0, 500) : '' + if (name === 'web_search') {args.query = typeof args.query === 'string' ? args.query.trim().slice(0, 500) : ''} const callId = `${name}:${Date.now()}:${randomUUID()}` emit(sender, { sessionId, type: 'tool-start', callId, name, args }) let outcome: ToolOutcome @@ -965,11 +965,11 @@ async function executeTool( const limit = typeof args.limit === 'number' ? args.limit : 5 if (!query) { outcome = { ok: false, content: JSON.stringify({ error: '缺少检索关键词' }) } - } else if (!chatHistoryStore) { - outcome = { ok: false, content: JSON.stringify({ error: '历史对话检索暂不可用' }) } - } else { + } else if (chatHistoryStore) { const hits = await chatHistoryStore.search(query, limit) outcome = { ok: true, content: clampToolResult(JSON.stringify({ query, hits, total: hits.length })) } + } else { + outcome = { ok: false, content: JSON.stringify({ error: '历史对话检索暂不可用' }) } } } else if (name === 'web_search') { const result = await searchWeb(searchProvider, args.query, signal) @@ -981,7 +981,7 @@ async function executeTool( if (result.error) { const failures = (searchFailuresBySession.get(sessionId) ?? 0) + 1 searchFailuresBySession.set(sessionId, failures) - if (failures >= SEARCH_FAILURE_GUIDANCE_THRESHOLD) result.guidance = SEARCH_FAILURE_GUIDANCE + if (failures >= SEARCH_FAILURE_GUIDANCE_THRESHOLD) {result.guidance = SEARCH_FAILURE_GUIDANCE} } else { searchFailuresBySession.delete(sessionId) } @@ -1015,33 +1015,33 @@ async function executeTool( terrainTimer = setTimeout(() => resolve({ ok: false, content: JSON.stringify({ error: '地形查询超时' }) }), ANALYZE_TERRAIN_TIMEOUT_MS) }) ]) - if (terrainTimer) clearTimeout(terrainTimer) + if (terrainTimer) {clearTimeout(terrainTimer)} const terrain = safeParseJson(terrainOutcome.content) - if (typeof terrain.height === 'number') result.elevationMeters = terrain.height + if (typeof terrain.height === 'number') {result.elevationMeters = terrain.height} } outcome = { ok: !result.error, content: clampToolResult(JSON.stringify(result)) } } else if (name === 'save_memory') { - if (!memory?.enabled) { - outcome = { ok: false, content: JSON.stringify({ error: '记忆功能未开启,请在 AI 设置 → 记忆 中开启' }) } - } else { + if (memory?.enabled) { try { const saved = await memory.store.add(typeof args.content === 'string' ? args.content : '', 'agent') outcome = { ok: true, content: JSON.stringify({ memorySaved: true, id: saved.id, content: saved.content, message: '已写入记忆' }) } } catch (error) { outcome = { ok: false, content: JSON.stringify({ error: error instanceof Error ? error.message : '记忆写入失败' }) } } + } else { + outcome = { ok: false, content: JSON.stringify({ error: '记忆功能未开启,请在 AI 设置 → 记忆 中开启' }) } } } else if (name === 'delete_memory') { const id = typeof args.id === 'string' ? args.id.trim() : '' if (!memory?.enabled) { outcome = { ok: false, content: JSON.stringify({ error: '记忆功能未开启,请在 AI 设置 → 记忆 中开启' }) } - } else if (!id) { - outcome = { ok: false, content: JSON.stringify({ error: '缺少记忆 id' }) } - } else { + } else if (id) { const deleted = await memory.store.delete(id) outcome = deleted ? { ok: true, content: JSON.stringify({ memoryDeleted: true, id, message: '已删除记忆' }) } : { ok: false, content: JSON.stringify({ error: `未找到 id 为 ${id} 的记忆` }) } + } else { + outcome = { ok: false, content: JSON.stringify({ error: '缺少记忆 id' }) } } } else { outcome = await dispatchRendererTool(sender, sessionId, callId, name, guard.dispatchArgs) @@ -1060,7 +1060,7 @@ async function executeTool( input: sanitizedSpan.input, output: sanitizedSpan.output, latencyMs: Date.now() - startedAt, - ...(!outcome.ok ? { error: summarizeToolResult(outcome.content) } : {}) + ...(outcome.ok ? {} : { error: summarizeToolResult(outcome.content) }) }) return { ...outcome, callId, summary: summarizeToolResult(outcome.content) } } @@ -1086,7 +1086,7 @@ async function compressMessages(options: { const keepCount = Math.min(4, rest.length) const hasOlderMessages = rest.length > keepCount const older = hasOlderMessages ? rest.slice(0, rest.length - keepCount) : rest - if (!older.length) throw new Error('无法压缩上下文') + if (older.length === 0) {throw new Error('无法压缩上下文')} const transcript = older.map((message) => { const role = message.role === 'user' ? '用户' : message.role === 'assistant' ? '助手' : '工具' return `${role}:${message.content}` @@ -1117,7 +1117,7 @@ async function compressMessages(options: { throw error } const summary = summaryResult.text.trim() - if (!summary) throw new Error('无法压缩上下文') + if (!summary) {throw new Error('无法压缩上下文')} const summaryMessage: WireMessage = { role: 'assistant', content: `[上下文摘要]\n${summary}` } const kept = hasOlderMessages ? rest.slice(-keepCount) : [] const compressedMessages = [...(system ? [system] : []), summaryMessage, ...kept] @@ -1160,7 +1160,7 @@ async function runAgent(options: { for (const turn of turns) { if (turn.content.trim()) { conversationMessages.push({ role: turn.role, content: turn.content }) - if (turn.role === 'user') lastUserMessage = turn.content + if (turn.role === 'user') {lastUserMessage = turn.content} } } const recalledMemories = memory.enabled && memory.store.list().length > MEMORY_FULL_INJECT_LIMIT && lastUserMessage.trim() @@ -1172,7 +1172,7 @@ async function runAgent(options: { const historyTools = hawdb?.isReady() ? [SEARCH_CONVERSATIONS_TOOL] : [] const toolset: AiToolDefinition[] = [...tools.filter((tool) => !['retrieve_knowledge', 'search_conversations', 'search_place', 'web_search', 'save_memory', 'delete_memory', 'poi_statistics', 'analyze_location'].includes(tool.name)), KNOWLEDGE_TOOL, ...historyTools, SEARCH_PLACE_TOOL, POI_STATISTICS_TOOL, ANALYZE_LOCATION_TOOL, WEB_SEARCH_TOOL, ...memoryTools] for (let round = 0; round < MAX_TOOL_ROUNDS; round += 1) { - if (signal.aborted) throw new DOMException('Aborted', 'AbortError') + if (signal.aborted) {throw new DOMException('Aborted', 'AbortError')} const currentStats = contextStatsForMessages(messages, model.contextWindow) send({ sessionId, type: 'context-stats', stats: currentStats }) if (currentStats.usagePercent >= 80) { @@ -1200,8 +1200,8 @@ async function runAgent(options: { onRetry }) signal.throwIfAborted() - if (!model.streaming && result.text) send({ sessionId, type: 'text-delta', text: result.text }) - if (!result.toolCalls.length) { + if (!model.streaming && result.text) {send({ sessionId, type: 'text-delta', text: result.text })} + if (result.toolCalls.length === 0) { messages.push({ role: 'assistant', content: result.text }) if (!result.text.trim()) { send({ sessionId, type: 'error', message: result.reasoning.trim() ? '模型只返回了思考过程,没有给出结论,请重试' : '模型没有返回内容,请重试' }) @@ -1237,7 +1237,7 @@ async function runAgent(options: { onRetry }) signal.throwIfAborted() - if (!model.streaming && finalResult.text) send({ sessionId, type: 'text-delta', text: finalResult.text }) + if (!model.streaming && finalResult.text) {send({ sessionId, type: 'text-delta', text: finalResult.text })} messages.push({ role: 'assistant', content: finalResult.text }) if (!finalResult.text.trim()) { send({ sessionId, type: 'error', message: '工具调用轮次过多,已停止' }) @@ -1248,7 +1248,7 @@ async function runAgent(options: { function summarizeToolResult(content: string): string { const parsed = safeParseJson(content) - if (typeof parsed.error === 'string') return parsed.error.slice(0, 60) + if (typeof parsed.error === 'string') {return parsed.error.slice(0, 60)} if (parsed.status === 'queued' && typeof parsed.total === 'number') { const addedName = typeof parsed.addedName === 'string' && parsed.addedName ? `「${parsed.addedName}」` : '' return `已加入地点列表${addedName}(共 ${parsed.total} 个,停留在第 1 个)` @@ -1258,21 +1258,21 @@ function summarizeToolResult(content: string): string { const label = typeof current === 'string' && current ? `「${current}」` : '' return `已创建 ${parsed.stops.length} 个地点,停留在 1/${parsed.stops.length}${label}` } - if (typeof parsed.message === 'string' && parsed.message.trim()) return parsed.message.slice(0, 60) - if (parsed.memorySaved === true) return `已记住:${typeof parsed.content === 'string' ? parsed.content.slice(0, 40) : ''}` - if (parsed.memoryDeleted === true) return '已删除记忆' - if (Array.isArray(parsed.hits)) return parsed.hits.length ? `${parsed.hits.length} 条历史对话` : '未找到相关历史对话' - if (Array.isArray(parsed.matches)) return parsed.matches.length ? `${parsed.matches.length} 条知识条目` : '知识库未命中' - if (Array.isArray(parsed.references)) return parsed.references.length ? `${parsed.references.length} 条来源` : '未找到相关网页' - if (Array.isArray(parsed.places)) return `${parsed.places.length} 个地点` - if (parsed.status === 'vision_disabled') return '模型未开启视觉,已返回文字视角' - if (parsed.screenshot) return '已截图' - if (Array.isArray(parsed.shapes)) return `${parsed.shapes.length} 个标注` - if (typeof parsed.removed === 'number') return `已删除 ${parsed.removed} 个标注` - if (typeof parsed.added === 'number') return `已添加标记 ${parsed.added} 个${typeof parsed.skipped === 'number' ? `(${parsed.skipped} 个无效跳过)` : ''}` - if (typeof parsed.name === 'string' && parsed.name) return parsed.kind === 'point' ? `已添加标记「${parsed.name}」` : `已绘制「${parsed.name}」` - if (typeof parsed.measurement === 'string' && parsed.measurement) return parsed.measurement - if (typeof parsed.height === 'number') return `海拔 ${Math.round(parsed.height)} m` + if (typeof parsed.message === 'string' && parsed.message.trim()) {return parsed.message.slice(0, 60)} + if (parsed.memorySaved === true) {return `已记住:${typeof parsed.content === 'string' ? parsed.content.slice(0, 40) : ''}`} + if (parsed.memoryDeleted === true) {return '已删除记忆'} + if (Array.isArray(parsed.hits)) {return parsed.hits.length ? `${parsed.hits.length} 条历史对话` : '未找到相关历史对话'} + if (Array.isArray(parsed.matches)) {return parsed.matches.length ? `${parsed.matches.length} 条知识条目` : '知识库未命中'} + if (Array.isArray(parsed.references)) {return parsed.references.length ? `${parsed.references.length} 条来源` : '未找到相关网页'} + if (Array.isArray(parsed.places)) {return `${parsed.places.length} 个地点`} + if (parsed.status === 'vision_disabled') {return '模型未开启视觉,已返回文字视角'} + if (parsed.screenshot) {return '已截图'} + if (Array.isArray(parsed.shapes)) {return `${parsed.shapes.length} 个标注`} + if (typeof parsed.removed === 'number') {return `已删除 ${parsed.removed} 个标注`} + if (typeof parsed.added === 'number') {return `已添加标记 ${parsed.added} 个${typeof parsed.skipped === 'number' ? `(${parsed.skipped} 个无效跳过)` : ''}`} + if (typeof parsed.name === 'string' && parsed.name) {return parsed.kind === 'point' ? `已添加标记「${parsed.name}」` : `已绘制「${parsed.name}」`} + if (typeof parsed.measurement === 'string' && parsed.measurement) {return parsed.measurement} + if (typeof parsed.height === 'number') {return `海拔 ${Math.round(parsed.height)} m`} if (parsed.province === '全国' && typeof parsed.populationWan === 'number' && typeof parsed.urbanizationPct === 'number') { return `${parsed.province}:人口 ${parsed.populationWan} 万、城镇化 ${parsed.urbanizationPct}%` } @@ -1280,7 +1280,7 @@ function summarizeToolResult(content: string): string { const population = typeof parsed.populationWan === 'number' ? `人口 ${parsed.populationWan} 万、` : '' return `${parsed.province}:${population}密度约 ${parsed.densityPerKm2} 人/km²` } - if (typeof parsed.longitude === 'number') return '已定位' + if (typeof parsed.longitude === 'number') {return '已定位'} const center = typeof parsed.center === 'object' && parsed.center !== null ? parsed.center as { name?: unknown } : null if (center && Array.isArray(parsed.categories)) { const name = typeof center.name === 'string' && center.name ? center.name : '该地点' @@ -1291,21 +1291,21 @@ function summarizeToolResult(content: string): string { } function validateTurns(turns: unknown): AiChatTurn[] { - if (!Array.isArray(turns)) throw new Error('无效的对话历史') + if (!Array.isArray(turns)) {throw new Error('无效的对话历史')} return turns.flatMap((turn): AiChatTurn[] => { - if (typeof turn !== 'object' || turn === null) return [] + if (typeof turn !== 'object' || turn === null) {return []} const record = turn as { role?: unknown; content?: unknown } - if ((record.role !== 'user' && record.role !== 'assistant') || typeof record.content !== 'string') return [] + if ((record.role !== 'user' && record.role !== 'assistant') || typeof record.content !== 'string') {return []} return [{ role: record.role, content: record.content.slice(0, 20_000) }] }) } function validateContextEntries(entries: unknown): AiContextEntry[] { - if (!Array.isArray(entries)) throw new Error('无效的上下文') + if (!Array.isArray(entries)) {throw new Error('无效的上下文')} return entries.flatMap((entry): AiContextEntry[] => { - if (typeof entry !== 'object' || entry === null) return [] + if (typeof entry !== 'object' || entry === null) {return []} const record = entry as { role?: unknown; content?: unknown; callId?: unknown; name?: unknown; isError?: unknown } - if ((record.role !== 'user' && record.role !== 'assistant' && record.role !== 'tool') || typeof record.content !== 'string') return [] + if ((record.role !== 'user' && record.role !== 'assistant' && record.role !== 'tool') || typeof record.content !== 'string') {return []} return [{ role: record.role, content: record.content.slice(0, TOOL_RESULT_LIMIT), @@ -1317,15 +1317,15 @@ function validateContextEntries(entries: unknown): AiContextEntry[] { } function validateChatRequest(sessionId: unknown, turns: unknown, tools: unknown, aiSessionId: unknown, distinctId: unknown): { sessionId: string; aiSessionId: string; distinctId: string; turns: AiChatTurn[]; tools: AiToolDefinition[] } { - if (typeof sessionId !== 'string' || !/^[a-zA-Z0-9_-]{1,64}$/.test(sessionId)) throw new Error('无效的会话标识') + if (typeof sessionId !== 'string' || !/^[a-zA-Z0-9_-]{1,64}$/.test(sessionId)) {throw new Error('无效的会话标识')} const normalizedAiSessionId = typeof aiSessionId === 'string' && /^[a-zA-Z0-9_-]{1,64}$/.test(aiSessionId) ? aiSessionId : sessionId const normalizedDistinctId = typeof distinctId === 'string' ? distinctId.trim().slice(0, 256) : '' const normalizedTurns = validateTurns(turns) const normalizedTools = Array.isArray(tools) ? tools.flatMap((tool): AiToolDefinition[] => { - if (typeof tool !== 'object' || tool === null) return [] + if (typeof tool !== 'object' || tool === null) {return []} const record = tool as { name?: unknown; description?: unknown; parameters?: unknown } - if (typeof record.name !== 'string' || !/^[a-z0-9_]{1,64}$/i.test(record.name) || typeof record.description !== 'string') return [] - return [{ name: record.name, description: record.description.slice(0, 2_000), parameters: typeof record.parameters === 'object' && record.parameters !== null ? record.parameters as Record : { type: 'object', properties: {} } }] + if (typeof record.name !== 'string' || !/^[a-z0-9_]{1,64}$/i.test(record.name) || typeof record.description !== 'string') {return []} + return [{ name: record.name, description: record.description.slice(0, 2000), parameters: typeof record.parameters === 'object' && record.parameters !== null ? record.parameters as Record : { type: 'object', properties: {} } }] }) : [] return { sessionId, aiSessionId: normalizedAiSessionId, distinctId: normalizedDistinctId, turns: normalizedTurns, tools: normalizedTools } } @@ -1344,32 +1344,32 @@ export function registerAiIpcHandlers( ipcMain.handle('ai:history-get', (_event, id: unknown) => typeof id === 'string' ? chatHistoryStore.get(id) : null) ipcMain.handle('ai:history-save', (_event, value: unknown) => chatHistoryStore.save(value)) ipcMain.handle('ai:history-delete', (_event, id: unknown) => { - if (typeof id !== 'string' || !id) return chatHistoryStore.list() + if (typeof id !== 'string' || !id) {return chatHistoryStore.list()} return chatHistoryStore.delete(id) }) ipcMain.handle('ai:history-search', (_event, query: unknown, limit: unknown, excludeId: unknown) => { - if (typeof query !== 'string' || !query.trim()) return [] + if (typeof query !== 'string' || !query.trim()) {return []} const capped = typeof limit === 'number' && Number.isFinite(limit) ? limit : 5 return chatHistoryStore.search(query, capped, typeof excludeId === 'string' ? excludeId : undefined) }) ipcMain.handle('ai:memory-list', () => memoryStore.list()) ipcMain.handle('ai:memory-add', async (_event, content: unknown) => { - if (typeof content !== 'string') throw new Error('无效的记忆内容') + if (typeof content !== 'string') {throw new Error('无效的记忆内容')} await memoryStore.add(content, 'user') return memoryStore.list() }) ipcMain.handle('ai:memory-delete', async (_event, id: unknown) => { - if (typeof id !== 'string' || !id.trim()) throw new Error('无效的记忆标识') - if (!await memoryStore.delete(id.trim())) throw new Error('未找到该记忆,可能已被删除') + if (typeof id !== 'string' || !id.trim()) {throw new Error('无效的记忆标识')} + if (!await memoryStore.delete(id.trim())) {throw new Error('未找到该记忆,可能已被删除')} return memoryStore.list() }) ipcMain.handle('ai:memory-recall', (_event, query: unknown, limit: unknown) => { - if (typeof query !== 'string' || !query.trim()) return [] + if (typeof query !== 'string' || !query.trim()) {return []} const capped = typeof limit === 'number' && Number.isFinite(limit) ? limit : 8 return memoryStore.recall(query, capped) }) ipcMain.handle('ai:hawdb-status', async () => { - if (hawdb?.isReady()) return hawdb.status() + if (hawdb?.isReady()) {return hawdb.status()} return { ready: false, storageMode: 'disk' as const, @@ -1392,9 +1392,9 @@ export function registerAiIpcHandlers( const settings = settingsStore.snapshot() const provider = settings.providers.find((item) => item.id === settings.activeProviderId) const model = provider?.models.find((item) => item.id === settings.activeModelId) - if (!provider || !model) throw new Error('未选择 AI 模型,请先在 AI 设置中添加供应商与模型并设为默认') + if (!provider || !model) {throw new Error('未选择 AI 模型,请先在 AI 设置中添加供应商与模型并设为默认')} const apiKey = readProviderKey(`ai-${provider.id}`) - if (!apiKey) throw new Error(`未配置「${provider.name}」的 API Key,请在 AI 设置中保存`) + if (!apiKey) {throw new Error(`未配置「${provider.name}」的 API Key,请在 AI 设置中保存`)} const controller = new AbortController() const normalizedAiSessionId = typeof aiSessionId === 'string' && /^[a-zA-Z0-9_-]{1,64}$/.test(aiSessionId) ? aiSessionId : null const normalizedDistinctId = typeof distinctId === 'string' ? distinctId.trim().slice(0, 256) : '' @@ -1420,9 +1420,9 @@ export function registerAiIpcHandlers( const searchProvider = settings.searchProviders.find((item) => item.id === settings.activeSearchProviderId) const provider = settings.providers.find((item) => item.id === settings.activeProviderId) const model = provider?.models.find((item) => item.id === settings.activeModelId) - if (!provider || !model) throw new Error('未选择 AI 模型,请先在 AI 设置中添加供应商与模型并设为默认') + if (!provider || !model) {throw new Error('未选择 AI 模型,请先在 AI 设置中添加供应商与模型并设为默认')} const apiKey = readProviderKey(`ai-${provider.id}`) - if (!apiKey) throw new Error(`未配置「${provider.name}」的 API Key,请在 AI 设置中保存`) + if (!apiKey) {throw new Error(`未配置「${provider.name}」的 API Key,请在 AI 设置中保存`)} const existing = sessions.get(request.sessionId) existing?.controller.abort() const controller = new AbortController() @@ -1443,17 +1443,17 @@ export function registerAiIpcHandlers( }) .finally(() => { searchFailuresBySession.delete(request.sessionId) - if (sessions.get(request.sessionId)?.sender === sender) sessions.delete(request.sessionId) + if (sessions.get(request.sessionId)?.sender === sender) {sessions.delete(request.sessionId)} }) }) ipcMain.handle('ai:stop', (_event, sessionId: unknown) => { - if (typeof sessionId !== 'string') return + if (typeof sessionId !== 'string') {return} sessions.get(sessionId)?.controller.abort() }) ipcMain.handle('ai:tool-result', (_event, sessionId: unknown, callId: unknown, ok: unknown, result: unknown) => { - if (typeof sessionId !== 'string' || typeof callId !== 'string') return + if (typeof sessionId !== 'string' || typeof callId !== 'string') {return} const entry = pendingRendererTools.get(callId) - if (!entry) return + if (!entry) {return} clearTimeout(entry.timer) pendingRendererTools.delete(callId) const image = extractImage(result) @@ -1463,6 +1463,6 @@ export function registerAiIpcHandlers( } function signalAborted(controller: AbortController, error: unknown): boolean { - if (controller.signal.aborted) return true + if (controller.signal.aborted) {return true} return error instanceof Error && /abort/i.test(error.message) } diff --git a/src/main/ai/amap.ts b/src/main/ai/amap.ts index 0bfa8cd..bd4428c 100644 --- a/src/main/ai/amap.ts +++ b/src/main/ai/amap.ts @@ -1,4 +1,4 @@ -import { createHash } from 'crypto' +import { createHash } from 'node:crypto' import { net } from 'electron' import type { PoiCategoryCount, PoiStatisticsRequest, PoiStatisticsResult } from '../../common/poiStatistics' import { gcj02ToWgs84, wgs84ToGcj02 } from '../geo' @@ -53,7 +53,7 @@ function toPlaces(pois: AmapPoi[]): AmapPlace[] { const location = typeof poi.location === 'string' ? poi.location.split(',') : [] const longitude = Number(location[0]) const latitude = Number(location[1]) - if (!Number.isFinite(longitude) || !Number.isFinite(latitude)) return [] + if (!Number.isFinite(longitude) || !Number.isFinite(latitude)) {return []} const [wgsLongitude, wgsLatitude] = gcj02ToWgs84(longitude, latitude) const text = (value: unknown): string => (typeof value === 'string' ? value : '') return [{ @@ -77,16 +77,16 @@ interface AmapPoisResponse { } function parsePois(body: unknown): AmapPoisResponse { - if (typeof body !== 'object' || body === null) return { pois: [], total: 0, error: '高德返回了无效响应' } + if (typeof body !== 'object' || body === null) {return { pois: [], total: 0, error: '高德返回了无效响应' }} const result = body as { status?: unknown; info?: unknown; infocode?: unknown; count?: unknown; pois?: unknown } if (result.status !== '1') { - if (result.infocode === '10009') return { pois: [], total: 0, error: '高德 Key 的平台类型不匹配,请在高德控制台配置「Web 服务」类型的 Key (10009)' } + if (result.infocode === '10009') {return { pois: [], total: 0, error: '高德 Key 的平台类型不匹配,请在高德控制台配置「Web 服务」类型的 Key (10009)' }} const info = typeof result.info === 'string' ? result.info : '未知错误' const code = typeof result.infocode === 'string' ? ` (${result.infocode})` : '' const retryable = !/DAILY/i.test(info) && /QPS|FREQUENT/i.test(info) return { pois: [], total: 0, error: `高德地点搜索失败:${info}${code}`, retryable } } - if (!Array.isArray(result.pois)) return { pois: [], total: 0, error: '高德返回了无效地点数据' } + if (!Array.isArray(result.pois)) {return { pois: [], total: 0, error: '高德返回了无效地点数据' }} const total = typeof result.count === 'string' || typeof result.count === 'number' ? Number(result.count) : 0 return { pois: result.pois.filter((poi): poi is AmapPoi => typeof poi === 'object' && poi !== null), total: Number.isFinite(total) ? total : 0 } } @@ -121,9 +121,9 @@ function requestUrl(base: string, params: Record, securityKey?: return `${base}?${query.join('&')}` } -const SEARCH_MIN_INTERVAL_MS = 1_000 +const SEARCH_MIN_INTERVAL_MS = 1000 const SEARCH_MAX_RETRIES = 2 -const SEARCH_RETRY_DELAY_MS = 2_000 +const SEARCH_RETRY_DELAY_MS = 2000 const SEARCH_REQUEST_TIMEOUT_MS = 10_000 const amapThrottle = createSearchThrottle(SEARCH_MIN_INTERVAL_MS) @@ -175,7 +175,7 @@ export async function poiStatistics(request: PoiStatisticsRequest): Promise requestPois(url)) if (!first) { @@ -231,10 +231,10 @@ export async function poiStatistics(request: PoiStatisticsRequest): Promise = { ...aroundParams, page: String(page) } const pageUrl = requestUrl('https://restapi.amap.com/v3/place/around', pageParams, securityKey) const pageResult = await amapThrottle.run(() => requestPois(pageUrl)) - if (!pageResult || pageResult.error || pageResult.pois.length === 0) break + if (!pageResult || pageResult.error || pageResult.pois.length === 0) {break} pagesFetched = page aggregatePois(aggregation, pageResult.pois) - if (pageResult.pois.length < POI_STATS_PAGE_SIZE) break + if (pageResult.pois.length < POI_STATS_PAGE_SIZE) {break} } } const truncated = poiTruncated(reportedTotal, pagesFetched) @@ -255,9 +255,9 @@ export async function poiStatistics(request: PoiStatisticsRequest): Promise { const keywords = query.trim().slice(0, 90) - if (!keywords) return { query, places: [], error: '缺少搜索关键词' } + if (!keywords) {return { query, places: [], error: '缺少搜索关键词' }} const isSuperseded = (): boolean => isPlacesRequestSuperseded(requestId) - if (isSuperseded()) return { query, places: [], superseded: true } + if (isSuperseded()) {return { query, places: [], superseded: true }} const key = readProviderKey('amap') const securityKey = readProviderKey('amap-sk') if (!key) { @@ -268,19 +268,19 @@ export async function searchPlaces(query: string, city?: string, requestId?: num } } const params: Record = { key, keywords, offset: '8', page: '1', extensions: 'base' } - if (city?.trim()) params.city = city.trim().slice(0, 40) + if (city?.trim()) {params.city = city.trim().slice(0, 40)} const url = requestUrl('https://restapi.amap.com/v3/place/text', params, securityKey) const first = await amapThrottle.run(() => requestPois(url), isSuperseded) - if (!first) return { query, places: [], superseded: true } + if (!first) {return { query, places: [], superseded: true }} let result = first for (let attempt = 1; result.error !== undefined && result.retryable === true && attempt <= SEARCH_MAX_RETRIES; attempt += 1) { await delay(SEARCH_RETRY_DELAY_MS * attempt) const next = await amapThrottle.run(() => requestPois(url), isSuperseded) - if (!next) return { query, places: [], superseded: true } + if (!next) {return { query, places: [], superseded: true }} result = next } - if (result.error) return { query, places: [], error: result.error } + if (result.error) {return { query, places: [], error: result.error }} const places = toPlaces(result.pois).slice(0, 8) - if (places.length === 0) return { query, places: [], note: '没有找到匹配的地点,可换个说法或切换搜索源' } + if (places.length === 0) {return { query, places: [], note: '没有找到匹配的地点,可换个说法或切换搜索源' }} return { query, places } } diff --git a/src/main/ai/baidu.ts b/src/main/ai/baidu.ts index a2b3875..f01a512 100644 --- a/src/main/ai/baidu.ts +++ b/src/main/ai/baidu.ts @@ -1,4 +1,4 @@ -import { createHash } from 'crypto' +import { createHash } from 'node:crypto' import { net } from 'electron' import type { PlaceSearchResult, PlaceSuggestion } from '../../preload' import { gcj02ToWgs84 } from '../geo' @@ -21,9 +21,9 @@ interface BaiduSuggestionsResponse { retryable?: boolean } -const SEARCH_MIN_INTERVAL_MS = 1_000 +const SEARCH_MIN_INTERVAL_MS = 1000 const SEARCH_MAX_RETRIES = 2 -const SEARCH_RETRY_DELAY_MS = 2_000 +const SEARCH_RETRY_DELAY_MS = 2000 const SEARCH_REQUEST_TIMEOUT_MS = 10_000 const SUGGEST_PATH = '/place/v3/suggestion' const baiduThrottle = createSearchThrottle(SEARCH_MIN_INTERVAL_MS) @@ -38,13 +38,13 @@ function roundCoordinate(value: number): number { function toPlaces(results: BaiduSuggestion[]): PlaceSuggestion[] { return results.flatMap((result) => { - if (typeof result.location !== 'object' || result.location === null) return [] + if (typeof result.location !== 'object' || result.location === null) {return []} const location = result.location as { lng?: unknown; lat?: unknown } const longitude = location.lng const latitude = location.lat - if (typeof longitude !== 'number' || typeof latitude !== 'number') return [] - if (!Number.isFinite(longitude) || !Number.isFinite(latitude)) return [] - if (longitude < -180 || longitude > 180 || latitude < -90 || latitude > 90 || !text(result.name).trim()) return [] + if (typeof longitude !== 'number' || typeof latitude !== 'number') {return []} + if (!Number.isFinite(longitude) || !Number.isFinite(latitude)) {return []} + if (longitude < -180 || longitude > 180 || latitude < -90 || latitude > 90 || !text(result.name).trim()) {return []} const [wgsLongitude, wgsLatitude] = gcj02ToWgs84(longitude, latitude) return [{ name: text(result.name), @@ -60,14 +60,14 @@ function toPlaces(results: BaiduSuggestion[]): PlaceSuggestion[] { } function parseSuggestions(body: unknown): BaiduSuggestionsResponse { - if (typeof body !== 'object' || body === null) return { results: [], error: '百度返回了无效响应' } + if (typeof body !== 'object' || body === null) {return { results: [], error: '百度返回了无效响应' }} const result = body as { status?: unknown; message?: unknown; results?: unknown } if (result.status !== 0) { const message = text(result.message) || '未知错误' const code = typeof result.status === 'number' || typeof result.status === 'string' ? ` (${result.status})` : '' return { results: [], error: `百度地点搜索失败:${message}${code}` } } - if (!Array.isArray(result.results)) return { results: [], error: '百度返回了无效地点数据' } + if (!Array.isArray(result.results)) {return { results: [], error: '百度返回了无效地点数据' }} return { results: result.results.filter((item): item is BaiduSuggestion => typeof item === 'object' && item !== null) } } @@ -89,32 +89,32 @@ async function requestSuggestions(url: string): Promise = { query: keywords, region: '全国', region_limit: 'false', ak: key, ret_coordtype: 'gcj02ll', output: 'json' } - if (securityKey) params.timestamp = String(Math.floor(Date.now() / 1000)) + if (securityKey) {params.timestamp = String(Math.floor(Date.now() / 1000))} const query = Object.entries(params).map(([name, value]) => `${name}=${encodeURIComponent(value)}`).join('&') - if (!securityKey) return `https://api.map.baidu.com${SUGGEST_PATH}?${query}` + if (!securityKey) {return `https://api.map.baidu.com${SUGGEST_PATH}?${query}`} const sn = createHash('md5').update(encodeURIComponent(`${SUGGEST_PATH}?${query}${securityKey}`)).digest('hex') return `https://api.map.baidu.com${SUGGEST_PATH}?${query}&sn=${sn}` } export async function searchBaiduPlaces(query: string, requestId?: number): Promise { const keywords = query.trim().slice(0, 90) - if (!keywords) return { query, places: [], error: '缺少搜索关键词' } + if (!keywords) {return { query, places: [], error: '缺少搜索关键词' }} const isSuperseded = (): boolean => isPlacesRequestSuperseded(requestId) - if (isSuperseded()) return { query, places: [], superseded: true } + if (isSuperseded()) {return { query, places: [], superseded: true }} const key = readProviderKey('baidu') - if (!key) return { query, places: [], error: '未配置百度地图 API Key:请在「图层管理 → 供应商密钥」中保存 API Key' } + if (!key) {return { query, places: [], error: '未配置百度地图 API Key:请在「图层管理 → 供应商密钥」中保存 API Key' }} const securityKey = readProviderKey('baidu-sk') const first = await baiduThrottle.run(() => requestSuggestions(suggestUrl(keywords, key, securityKey)), isSuperseded) - if (!first) return { query, places: [], superseded: true } + if (!first) {return { query, places: [], superseded: true }} let result = first for (let attempt = 1; result.error !== undefined && result.retryable === true && attempt <= SEARCH_MAX_RETRIES; attempt += 1) { await delay(SEARCH_RETRY_DELAY_MS * attempt) const next = await baiduThrottle.run(() => requestSuggestions(suggestUrl(keywords, key, securityKey)), isSuperseded) - if (!next) return { query, places: [], superseded: true } + if (!next) {return { query, places: [], superseded: true }} result = next } - if (result.error) return { query, places: [], error: result.error } + if (result.error) {return { query, places: [], error: result.error }} const places = toPlaces(result.results).slice(0, 10) - if (places.length === 0) return { query, places: [], note: '没有找到匹配的地点,可换个说法或切换搜索源' } + if (places.length === 0) {return { query, places: [], note: '没有找到匹配的地点,可换个说法或切换搜索源' }} return { query, places } } diff --git a/src/main/ai/chatHistoryStore.ts b/src/main/ai/chatHistoryStore.ts index 18060b5..7a0589e 100644 --- a/src/main/ai/chatHistoryStore.ts +++ b/src/main/ai/chatHistoryStore.ts @@ -1,5 +1,5 @@ -import { copyFile, mkdir, unlink } from 'fs/promises' -import { randomUUID } from 'crypto' +import { copyFile, mkdir, unlink } from 'node:fs/promises' +import { randomUUID } from 'node:crypto' import { storageChildPath } from '../storagePath' import { readJson, serialQueue, writeJson } from '../jsonStore' import type { AiSearchReference, StoredAiCompression, StoredAiConversation, StoredAiConversationSummary, StoredAiMessage, StoredAiPart, StoredAiToolStep } from '../../preload' @@ -23,12 +23,12 @@ function clampTimestamp(value: unknown, fallback: number): number { } function normalizeReferences(value: unknown): AiSearchReference[] { - if (!Array.isArray(value)) return [] + if (!Array.isArray(value)) {return []} return value.flatMap((item): AiSearchReference[] => { - if (!isRecord(item)) return [] + if (!isRecord(item)) {return []} const title = clampString(item.title, 300) const url = clampString(item.url, 2000) - if (!title && !url) return [] + if (!title && !url) {return []} return [{ title, url, @@ -40,10 +40,10 @@ function normalizeReferences(value: unknown): AiSearchReference[] { } function normalizeToolStep(value: unknown): StoredAiToolStep | null { - if (!isRecord(value)) return null + if (!isRecord(value)) {return null} const callId = clampString(value.callId, 128) const name = clampString(value.name, 64) - if (!callId || !name) return null + if (!callId || !name) {return null} const status: StoredAiToolStep['status'] = value.status === 'error' ? 'error' : 'ok' return { callId, @@ -57,13 +57,13 @@ function normalizeToolStep(value: unknown): StoredAiToolStep | null { } function normalizePart(value: unknown): StoredAiPart | null { - if (!isRecord(value)) return null + if (!isRecord(value)) {return null} if (value.kind === 'reasoning') { const id = clampString(value.id, 128) - if (!id) return null + if (!id) {return null} return { kind: 'reasoning', id, text: clampString(value.text, 100_000), ms: clampTimestamp(value.ms, 0), startedAt: clampTimestamp(value.startedAt, 0) } } - if (value.kind === 'text') return { kind: 'text', text: clampString(value.text, 100_000) } + if (value.kind === 'text') {return { kind: 'text', text: clampString(value.text, 100_000) }} if (value.kind === 'tool') { const step = normalizeToolStep(value.step) return step ? { kind: 'tool', step } : null @@ -72,11 +72,11 @@ function normalizePart(value: unknown): StoredAiPart | null { } function normalizeMessage(value: unknown): StoredAiMessage | null { - if (!isRecord(value)) return null + if (!isRecord(value)) {return null} const id = clampString(value.id, 128) - if (!id) return null + if (!id) {return null} const role = value.role === 'user' ? 'user' : value.role === 'assistant' ? 'assistant' : null - if (!role) return null + if (!role) {return null} const parts = Array.isArray(value.parts) ? value.parts.map(normalizePart).filter((part): part is StoredAiPart => part !== null).slice(0, 200) : [] @@ -91,23 +91,23 @@ function normalizeMessage(value: unknown): StoredAiMessage | null { } function normalizeCompression(value: unknown): StoredAiCompression | undefined { - if (!isRecord(value)) return undefined + if (!isRecord(value)) {return undefined} const summary = clampString(value.summary, 100_000) const coveredMessageIds = Array.isArray(value.coveredMessageIds) ? value.coveredMessageIds.filter((id): id is string => typeof id === 'string' && id.length > 0).map((id) => id.slice(0, 128)).slice(0, MAX_MESSAGES) : [] - if (!summary || !coveredMessageIds.length) return undefined + if (!summary || coveredMessageIds.length === 0) {return undefined} return { summary, coveredMessageIds } } export function normalizeConversation(value: unknown): StoredAiConversation | null { - if (!isRecord(value)) return null + if (!isRecord(value)) {return null} const id = clampString(value.id, 64) - if (!ID_PATTERN.test(id)) return null + if (!ID_PATTERN.test(id)) {return null} const messages = Array.isArray(value.messages) ? value.messages.map(normalizeMessage).filter((message): message is StoredAiMessage => message !== null).slice(-MAX_MESSAGES) : [] - if (!messages.some((message) => message.role === 'user')) return null + if (!messages.some((message) => message.role === 'user')) {return null} const updatedAt = clampTimestamp(value.updatedAt, Date.now()) const compression = normalizeCompression(value.compression) return { @@ -140,23 +140,23 @@ interface RecoveryManifest { function sortedEntries(list: HistoryEntry[]): HistoryEntry[] { const unique = new Map() - for (const item of list) if (!unique.has(item.id)) unique.set(item.id, item) + for (const item of list) {if (!unique.has(item.id)) unique.set(item.id, item)} return [...unique.values()].sort((a, b) => b.updatedAt - a.updatedAt).slice(0, MAX_CONVERSATIONS) } function normalizeEntries(value: unknown): HistoryEntry[] { - if (!isRecord(value) || value.version !== 1 || !Array.isArray(value.conversations)) throw new Error('无效的会话索引') + if (!isRecord(value) || value.version !== 1 || !Array.isArray(value.conversations)) {throw new Error('无效的会话索引')} return sortedEntries(value.conversations.flatMap((item): HistoryEntry[] => { - if (!isRecord(item) || typeof item.id !== 'string' || !ID_PATTERN.test(item.id)) return [] + if (!isRecord(item) || typeof item.id !== 'string' || !ID_PATTERN.test(item.id)) {return []} const updatedAt = clampTimestamp(item.updatedAt, Date.now()) const file = typeof item.file === 'string' ? item.file : `${item.id}.json` - if (file === 'index.json' || file === 'recovery.json' || !/^[a-zA-Z0-9_-]+(?:\.[a-zA-Z0-9_-]+)?\.json$/.test(file)) return [] + if (file === 'index.json' || file === 'recovery.json' || !/^[a-zA-Z0-9_-]+(?:\.[a-zA-Z0-9_-]+)?\.json$/.test(file)) {return []} return [{ id: item.id, title: clampString(item.title, 80), createdAt: clampTimestamp(item.createdAt, updatedAt), updatedAt, file }] })) } function normalizeRecoveryManifest(value: unknown): RecoveryManifest { - if (!isRecord(value)) throw new Error('无效的会话恢复名单') + if (!isRecord(value)) {throw new Error('无效的会话恢复名单')} const migration = value.migration === 'pending' || value.migration === 'complete' ? value.migration : null return { entries: normalizeEntries(value), migration } } @@ -167,7 +167,7 @@ export class AiChatHistoryStore { private hawdb: EoqHawdbClient | null = null private hawdbSummaries: StoredAiConversationSummary[] = [] private migration: MigrationState = 'complete' - private enqueue = serialQueue() + private readonly enqueue = serialQueue() async init(path: string): Promise { this.hawdb = null @@ -220,13 +220,13 @@ export class AiChatHistoryStore { try { legacy = await readJson(path) } catch (error) { - if ((error as NodeJS.ErrnoException).code !== 'ENOENT') console.warn('[ai] 会话历史读取失败', error) + if ((error as NodeJS.ErrnoException).code !== 'ENOENT') {console.warn('[ai] 会话历史读取失败', error)} } const normalized = Array.isArray(legacy) ? legacy.map(normalizeConversation).filter((item): item is StoredAiConversation => item !== null) : [] const migrated = sortedEntries(normalized.map((item) => ({ ...summary(item), file: `${item.id}.${randomUUID()}.json` }))) for (const item of migrated) { const conversation = normalized.find((entry) => entry.id === item.id) - if (conversation) await writeJson(this.conversationPath(item.file), conversation) + if (conversation) {await writeJson(this.conversationPath(item.file), conversation)} } await this.persistIndex(migrated) this.migration = 'complete' @@ -250,7 +250,7 @@ export class AiChatHistoryStore { for (const entry of entries) { try { const item = normalizeConversation(await readJson(this.conversationPath(entry.file))) - if (item?.id === entry.id) recovered.push({ ...summary(item), file: entry.file }) + if (item?.id === entry.id) {recovered.push({ ...summary(item), file: entry.file })} } catch { continue } @@ -297,7 +297,7 @@ export class AiChatHistoryStore { private assertBackend(): 'hawdb' | 'json' { if (this.hawdb) { - if (!this.hawdb.isReady()) throw new Error('EOQ HawDB 后端不可用,请重启应用后重试') + if (!this.hawdb.isReady()) {throw new Error('EOQ HawDB 后端不可用,请重启应用后重试')} return 'hawdb' } return 'json' @@ -309,14 +309,14 @@ export class AiChatHistoryStore { return this.hawdb!.getConversation(id) } const entry = this.conversations.find((item) => item.id === id) - if (!entry) return null + if (!entry) {return null} return normalizeConversation(await readJson(this.conversationPath(entry.file))) }) } save(value: unknown): Promise { const conversation = normalizeConversation(value) - if (!conversation) return Promise.reject(new Error('无效的会话数据')) + if (!conversation) {return Promise.reject(new Error('无效的会话数据'))} return this.enqueue(async () => { if (this.assertBackend() === 'hawdb') { this.hawdbSummaries = (await this.hawdb!.saveConversation(conversation)).map(summary) @@ -329,11 +329,11 @@ export class AiChatHistoryStore { try { await this.persistIndex(next) } catch (error) { - await unlink(this.conversationPath(entry.file)).catch(() => undefined) + await unlink(this.conversationPath(entry.file)).catch(() => {}) throw error } - await Promise.all(removed.map((item) => unlink(this.conversationPath(item.file)).catch(() => undefined))) - if (!next.some((item) => item.file === entry.file)) await unlink(this.conversationPath(entry.file)).catch(() => undefined) + await Promise.all(removed.map((item) => unlink(this.conversationPath(item.file)).catch(() => {}))) + if (!next.some((item) => item.file === entry.file)) {await unlink(this.conversationPath(entry.file)).catch(() => undefined)} return this.list() }) } @@ -347,14 +347,14 @@ export class AiChatHistoryStore { const removed = this.conversations.find((item) => item.id === id) const next = this.conversations.filter((item) => item.id !== id) await this.persistIndex(next) - if (removed) await unlink(this.conversationPath(removed.file)).catch(() => undefined) + if (removed) {await unlink(this.conversationPath(removed.file)).catch(() => undefined)} return this.list() }) } async search(query: string, limit = 5, excludeId?: string): Promise { const clean = typeof query === 'string' ? query.trim() : '' - if (!clean) return [] + if (!clean) {return []} if (this.assertBackend() === 'hawdb') { return this.hawdb!.searchConversations(clean, limit, excludeId) } diff --git a/src/main/ai/hawdb/client.ts b/src/main/ai/hawdb/client.ts index f770d5b..66b4732 100644 --- a/src/main/ai/hawdb/client.ts +++ b/src/main/ai/hawdb/client.ts @@ -17,7 +17,7 @@ import type { } from './protocol' const REQUEST_TIMEOUT_MS = 30_000 -const CLOSE_TIMEOUT_MS = 3_000 +const CLOSE_TIMEOUT_MS = 3000 interface PendingRequest { resolve: (value: unknown) => void @@ -46,8 +46,8 @@ type RequestBody = | { op: 'knowledge:retrieve'; payload: { query: string; module?: string; topK?: number } } function defaultWorkerPath(): string { - if (typeof __dirname === 'string') return join(__dirname, 'hawdbWorker.js') - return join(dirname(fileURLToPath(import.meta.url)), 'hawdbWorker.js') + if (typeof __dirname === 'string') {return join(__dirname, 'hawdbWorker.js')} + return join(import.meta.dirname, 'hawdbWorker.js') } export class EoqHawdbClient { @@ -56,7 +56,7 @@ export class EoqHawdbClient { private worker: Worker | null = null private inProcessEngine: EoqHawdbEngine | null = null private inProcessQueue: Promise = Promise.resolve() - private pending = new Map() + private readonly pending = new Map() private nextRequestId = 1 private ready = false private lastStatus: HawdbStatusInfo | null = null @@ -83,11 +83,11 @@ export class EoqHawdbClient { } private ensureWorker(): Worker { - if (this.worker) return this.worker + if (this.worker) {return this.worker} const worker = new Worker(this.workerPath) worker.on('message', (response: HawdbWorkerResponse) => { const entry = this.pending.get(response.id) - if (!entry) return + if (!entry) {return} clearTimeout(entry.timer) this.pending.delete(response.id) if (response.ok) { @@ -103,7 +103,7 @@ export class EoqHawdbClient { }) worker.on('exit', (code) => { this.ready = false - if (this.worker === worker) this.worker = null + if (this.worker === worker) {this.worker = null} if (this.pending.size > 0) { this.rejectAllPending(new Error(`HawDB 工作线程已退出(code=${code})`)) } @@ -113,10 +113,10 @@ export class EoqHawdbClient { } private runInProcess(task: (engine: EoqHawdbEngine) => T | Promise): Promise { - if (!this.inProcessEngine) this.inProcessEngine = new EoqHawdbEngine() + if (!this.inProcessEngine) {this.inProcessEngine = new EoqHawdbEngine()} const engine = this.inProcessEngine const next = this.inProcessQueue.then(() => task(engine)) - this.inProcessQueue = next.catch(() => undefined) + this.inProcessQueue = next.catch(() => {}) return next } @@ -127,7 +127,7 @@ export class EoqHawdbClient { const worker = this.ensureWorker() const id = this.nextRequestId this.nextRequestId += 1 - const request: HawdbWorkerRequest = { ...body, id } as HawdbWorkerRequest + const request: HawdbWorkerRequest = { ...body, id } return new Promise((resolve, reject) => { const timer = setTimeout(() => { this.pending.delete(id) @@ -146,33 +146,46 @@ export class EoqHawdbClient { private dispatchInProcess(body: RequestBody): Promise { return this.runInProcess((engine) => { switch (body.op) { - case 'open': + case 'open': { return engine.open(body.payload) as Promise - case 'close': + } + case 'close': { engine.close() return true as T - case 'status': + } + case 'status': { return engine.status() as T - case 'memory:list': + } + case 'memory:list': { return engine.listMemories() as T - case 'memory:add': + } + case 'memory:add': { return engine.addMemory(body.payload.content, body.payload.source) as Promise - case 'memory:delete': + } + case 'memory:delete': { return engine.deleteMemory(body.payload.id) as Promise - case 'memory:recall': + } + case 'memory:recall': { return engine.recallMemories(body.payload.query, body.payload.limit) as T - case 'history:list': + } + case 'history:list': { return engine.listConversations() as T - case 'history:get': + } + case 'history:get': { return engine.getConversation(body.payload.id) as T - case 'history:save': + } + case 'history:save': { return engine.saveConversation(body.payload.conversation) as Promise - case 'history:delete': + } + case 'history:delete': { return engine.deleteConversation(body.payload.id) as Promise - case 'history:search': + } + case 'history:search': { return engine.searchConversations(body.payload.query, body.payload.limit, body.payload.excludeId) as T - case 'knowledge:retrieve': + } + case 'knowledge:retrieve': { return engine.retrieveKnowledge(body.payload.query, body.payload.module, body.payload.topK) as T + } } }) } @@ -194,14 +207,14 @@ export class EoqHawdbClient { } } const worker = this.worker - if (!worker) return + if (!worker) {return} try { await this.send({ op: 'close' }, CLOSE_TIMEOUT_MS) } catch { void 0 } finally { this.worker = null - await worker.terminate().catch(() => undefined) + await worker.terminate().catch(() => {}) } } diff --git a/src/main/ai/hawdb/engine.ts b/src/main/ai/hawdb/engine.ts index 6443a52..0fcac7d 100644 --- a/src/main/ai/hawdb/engine.ts +++ b/src/main/ai/hawdb/engine.ts @@ -8,7 +8,8 @@ import { storageChildPath } from '../../storagePath' import { conversationSummary, MAX_CONVERSATIONS, normalizeConversation } from '../chatHistoryStore' import type { KnowledgeEntry, KnowledgeMatch } from '../knowledge' import { MAX_MEMORIES, MAX_MEMORY_CONTENT_LENGTH, normalizeMemory } from '../memoryStore' -import { HawdbDatabase, HawdbError, HawdbLibrary } from './ffi' +import type { HawdbDatabase} from './ffi'; +import { HawdbError, HawdbLibrary } from './ffi' import { buildConversationSearchText, buildConversationSnippet, @@ -55,14 +56,14 @@ async function readJsonSafe(path: string): Promise { } async function loadLegacyMemories(path?: string): Promise { - if (!path || !existsSync(path)) return [] + if (!path || !existsSync(path)) {return []} const parsed = await readJsonSafe(path) - if (!Array.isArray(parsed)) return [] + if (!Array.isArray(parsed)) {return []} const seen = new Set() const memories: AgentMemory[] = [] for (const item of parsed) { const normalized = normalizeMemory(item) - if (!normalized || seen.has(normalized.id)) continue + if (!normalized || seen.has(normalized.id)) {continue} seen.add(normalized.id) memories.push(normalized) } @@ -70,7 +71,7 @@ async function loadLegacyMemories(path?: string): Promise { } async function loadLegacyConversations(path?: string): Promise { - if (!path) return [] + if (!path) {return []} const directory = `${path}.d` const byId = new Map() let indexValid = false @@ -80,12 +81,12 @@ async function loadLegacyConversations(path?: string): Promise { - if (!existsSync(path)) return null + if (!existsSync(path)) {return null} const parsed = await readJsonSafe(path) - if (!isRecord(parsed)) return null + if (!isRecord(parsed)) {return null} const memories: AgentMemory[] = [] const seenMemories = new Set() if (Array.isArray(parsed.memories)) { for (const item of parsed.memories) { const normalized = normalizeMemory(item) - if (!normalized || seenMemories.has(normalized.id)) continue + if (!normalized || seenMemories.has(normalized.id)) {continue} seenMemories.add(normalized.id) memories.push(normalized) } @@ -125,7 +126,7 @@ async function loadSnapshot(path: string): Promise { if (Array.isArray(parsed.conversations)) { for (const item of parsed.conversations) { const normalized = normalizeConversation(item) - if (!normalized || seenConversations.has(normalized.id)) continue + if (!normalized || seenConversations.has(normalized.id)) {continue} seenConversations.add(normalized.id) conversations.push(normalized) } @@ -141,7 +142,7 @@ async function loadSnapshot(path: string): Promise { function fieldMatchCount(value: string, terms: string[]): number { const normalized = normalizeLookupText(value) - if (!normalized) return 0 + if (!normalized) {return 0} return terms.reduce((score, term) => score + (normalized.includes(term) ? 1 : 0), 0) } @@ -158,10 +159,10 @@ function scoreEntryFields(entry: KnowledgeEntry, terms: string[], module?: strin boost += 25 matchedFields.push('module') } - if (nameScore) matchedFields.push('name') - if (aliasScore) matchedFields.push('aliases') - if (keywordScore) matchedFields.push('keywords') - if (contentScore) matchedFields.push('content') + if (nameScore) {matchedFields.push('name')} + if (aliasScore) {matchedFields.push('aliases')} + if (keywordScore) {matchedFields.push('keywords')} + if (contentScore) {matchedFields.push('content')} return { boost, matchedFields } } @@ -192,10 +193,10 @@ export class EoqHawdbEngine { private dbRoot = '' private hawdbVersion = '' private formatVersion = 0 - private knowledgeById = new Map() + private readonly knowledgeById = new Map() private requireDb(): HawdbDatabase { - if (!this.db) throw new HawdbError('not_open', 'HawDB 引擎尚未初始化') + if (!this.db) {throw new HawdbError('not_open', 'HawDB 引擎尚未初始化')} return this.db } @@ -216,10 +217,10 @@ export class EoqHawdbEngine { } private insertMemories(memories: AgentMemory[]): void { - if (!memories.length) return + if (memories.length === 0) {return} const existingIds = new Set(this.listMemories().map((item) => item.id)) const toInsert = memories.filter((item) => !existingIds.has(item.id)).slice(0, Math.max(0, MAX_MEMORIES - existingIds.size)) - if (!toInsert.length) return + if (toInsert.length === 0) {return} this.requireDb().transaction((tx) => { for (const memory of toInsert) { tx.querySQL( @@ -231,10 +232,10 @@ export class EoqHawdbEngine { } private insertConversations(conversations: StoredAiConversation[]): void { - if (!conversations.length) return + if (conversations.length === 0) {return} const existingIds = new Set(this.listConversations().map((item) => item.id)) const toInsert = conversations.filter((item) => !existingIds.has(item.id)) - if (!toInsert.length) return + if (toInsert.length === 0) {return} this.requireDb().transaction((tx) => { for (const conversation of toInsert) { tx.querySQL( @@ -256,7 +257,7 @@ export class EoqHawdbEngine { private trimConversations(): void { const db = this.requireDb() const rows = db.querySQL('SELECT id FROM eoq_conversations ORDER BY updated_at DESC, id ASC').dicts() - if (rows.length <= MAX_CONVERSATIONS) return + if (rows.length <= MAX_CONVERSATIONS) {return} const staleIds = rows.slice(MAX_CONVERSATIONS).map((row) => String(row.id)) db.transaction((tx) => { for (const id of staleIds) { @@ -271,10 +272,10 @@ export class EoqHawdbEngine { .dicts() const list: StoredAiConversation[] = [] for (const row of rows) { - if (typeof row.payload_json !== 'string') continue + if (typeof row.payload_json !== 'string') {continue} try { const normalized = normalizeConversation(JSON.parse(row.payload_json)) - if (normalized) list.push(normalized) + if (normalized) {list.push(normalized)} } catch { continue } @@ -283,7 +284,7 @@ export class EoqHawdbEngine { } private async persistSnapshotIfNeeded(): Promise { - if (this.storageMode !== 'memory-snapshot') return + if (this.storageMode !== 'memory-snapshot') {return} const doc: SnapshotDocument = { version: 1, memories: this.listMemories(), @@ -477,10 +478,10 @@ export class EoqHawdbEngine { async addMemory(content: string, source: AgentMemory['source']): Promise { const trimmed = typeof content === 'string' ? content.trim().slice(0, MAX_MEMORY_CONTENT_LENGTH) : '' - if (!trimmed) throw new Error('记忆内容不能为空') + if (!trimmed) {throw new Error('记忆内容不能为空')} const db = this.requireDb() const count = Number(db.querySQL('SELECT COUNT(*) AS cnt FROM eoq_memories').dicts()[0]?.cnt ?? 0) - if (count >= MAX_MEMORIES) throw new Error(`记忆已达上限(${MAX_MEMORIES} 条),请先删除部分记忆`) + if (count >= MAX_MEMORIES) {throw new Error(`记忆已达上限(${MAX_MEMORIES} 条),请先删除部分记忆`)} const memory: AgentMemory = { id: `m${randomUUID()}`, content: trimmed, @@ -509,7 +510,7 @@ export class EoqHawdbEngine { async deleteMemory(id: string): Promise { const db = this.requireDb() const existing = db.querySQL('SELECT id, content, source, created_at FROM eoq_memories WHERE id = $1', [id]).dicts() - if (!existing.length) return false + if (existing.length === 0) {return false} db.querySQL('DELETE FROM eoq_memories WHERE id = $1', [id]) try { await this.persistSnapshotIfNeeded() @@ -534,7 +535,7 @@ export class EoqHawdbEngine { recallMemories(query: string, limit = 8): MemoryRecallMatch[] { const cleanQuery = query.trim().slice(0, MAX_QUERY_LENGTH) - if (!cleanQuery) return [] + if (!cleanQuery) {return []} const topK = Math.min(20, Math.max(1, Math.round(limit))) try { const rows = this.requireDb() @@ -579,13 +580,13 @@ export class EoqHawdbEngine { const rows = this.requireDb() .querySQL('SELECT payload_json FROM eoq_conversations WHERE id = $1', [id]) .dicts() - if (!rows.length || typeof rows[0].payload_json !== 'string') return null + if (rows.length === 0 || typeof rows[0].payload_json !== 'string') {return null} return normalizeConversation(JSON.parse(rows[0].payload_json)) } async saveConversation(value: unknown): Promise { const conversation = normalizeConversation(value) - if (!conversation) throw new Error('无效的会话数据') + if (!conversation) {throw new Error('无效的会话数据')} const db = this.requireDb() const searchText = buildConversationSearchText(conversation) const payloadJson = JSON.stringify(conversation) @@ -609,7 +610,7 @@ export class EoqHawdbEngine { searchConversations(query: string, limit = 5, excludeId?: string): ConversationSearchHit[] { const cleanQuery = query.trim().slice(0, MAX_QUERY_LENGTH) - if (!cleanQuery) return [] + if (!cleanQuery) {return []} const cappedLimit = Math.min(10, Math.max(1, Math.round(limit))) const fetchLimit = cappedLimit + (excludeId ? 2 : 0) const hits: ConversationSearchHit[] = [] @@ -622,11 +623,11 @@ export class EoqHawdbEngine { .dicts() for (const row of rows) { const id = String(row.id) - if (excludeId && id === excludeId) continue - if (typeof row.payload_json !== 'string') continue + if (excludeId && id === excludeId) {continue} + if (typeof row.payload_json !== 'string') {continue} try { const conversation = normalizeConversation(JSON.parse(row.payload_json)) - if (!conversation) continue + if (!conversation) {continue} hits.push({ id: conversation.id, title: conversation.title, @@ -638,9 +639,9 @@ export class EoqHawdbEngine { } catch { continue } - if (hits.length >= cappedLimit) break + if (hits.length >= cappedLimit) {break} } - if (hits.length > 0) return hits + if (hits.length > 0) {return hits} } catch { void 0 } @@ -676,7 +677,7 @@ export class EoqHawdbEngine { const related: KnowledgeRelatedConcept[] = [] for (const row of rows) { const id = String(row.id ?? '') - if (!id || id === conceptId || seen.has(id)) continue + if (!id || id === conceptId || seen.has(id)) {continue} seen.add(id) related.push({ id, @@ -688,7 +689,7 @@ export class EoqHawdbEngine { } return related .sort((left, right) => { - if (left.relation !== right.relation) return left.relation === 'contrasts_with' ? -1 : 1 + if (left.relation !== right.relation) {return left.relation === 'contrasts_with' ? -1 : 1} return left.name.localeCompare(right.name, 'zh-CN') }) .slice(0, MAX_RELATED_CONCEPTS) @@ -699,7 +700,7 @@ export class EoqHawdbEngine { retrieveKnowledge(query: string, module?: string, topK = DEFAULT_TOP_K): KnowledgeSearchResult { const cleanQuery = query.trim().slice(0, MAX_QUERY_LENGTH) - if (!cleanQuery) return { query: '', matches: [], total: 0 } + if (!cleanQuery) {return { query: '', matches: [], total: 0 }} const limit = Math.min(MAX_TOP_K, Math.max(1, Math.round(topK))) const terms = extractQueryTerms(cleanQuery) const bm25Scores = new Map() @@ -716,15 +717,15 @@ export class EoqHawdbEngine { } catch { void 0 } - const ranked: Array<{ entry: KnowledgeEntry; score: number; matchedFields: string[] }> = [] + const ranked: { entry: KnowledgeEntry; score: number; matchedFields: string[] }[] = [] for (const entry of this.knowledgeById.values()) { - if (entry.status === 'deprecated') continue + if (entry.status === 'deprecated') {continue} const bm25 = bm25Scores.get(entry.id) ?? 0 const { boost, matchedFields } = scoreEntryFields(entry, terms, module) const combinedScore = Math.round((bm25 * 15 + boost) * 100) / 100 - if (combinedScore <= 0) continue + if (combinedScore <= 0) {continue} const fields = [...matchedFields] - if (bm25 > 0 && !fields.includes('bm25')) fields.push('bm25') + if (bm25 > 0 && !fields.includes('bm25')) {fields.push('bm25')} ranked.push({ entry, score: combinedScore, matchedFields: fields }) } ranked.sort((left, right) => right.score - left.score || left.entry.name.localeCompare(right.entry.name, 'zh-CN')) diff --git a/src/main/ai/hawdb/ffi.ts b/src/main/ai/hawdb/ffi.ts index 6857fba..c2f62e1 100644 --- a/src/main/ai/hawdb/ffi.ts +++ b/src/main/ai/hawdb/ffi.ts @@ -74,7 +74,7 @@ interface NativeSymbols { let bufferStructRegistered = false function ensureBufferStruct(): void { - if (bufferStructRegistered) return + if (bufferStructRegistered) {return} koffi.struct('HawdbBuffer', { ptr: 'void *', len: 'size_t' @@ -86,7 +86,7 @@ const EMPTY_BYTES = Buffer.alloc(1) const utf8Decoder = new TextDecoder() function encodeUtf8(value: string): { buf: Buffer; len: number } { - if (!value.length) return { buf: EMPTY_BYTES, len: 0 } + if (value.length === 0) {return { buf: EMPTY_BYTES, len: 0 }} const buf = Buffer.from(value, 'utf8') return { buf, len: buf.length } } @@ -96,13 +96,13 @@ function emptyBuffer(): RawHawdbBuffer { } function serializeOpenOptions(options?: HawdbOpenOptions): string { - if (!options) return '{}' + if (!options) {return '{}'} const payload: Record = {} - if (options.readOnly !== undefined) payload.read_only = options.readOnly - if (options.durability !== undefined) payload.durability = options.durability - if (options.maxReadResultRows !== undefined) payload.max_read_result_rows = options.maxReadResultRows - if (options.maxReadIntermediateRows !== undefined) payload.max_read_intermediate_rows = options.maxReadIntermediateRows - if (options.maxReadResultPayloadBytes !== undefined) payload.max_read_result_payload_bytes = options.maxReadResultPayloadBytes + if (options.readOnly !== undefined) {payload.read_only = options.readOnly} + if (options.durability !== undefined) {payload.durability = options.durability} + if (options.maxReadResultRows !== undefined) {payload.max_read_result_rows = options.maxReadResultRows} + if (options.maxReadIntermediateRows !== undefined) {payload.max_read_intermediate_rows = options.maxReadIntermediateRows} + if (options.maxReadResultPayloadBytes !== undefined) {payload.max_read_result_payload_bytes = options.maxReadResultPayloadBytes} if (options.relationalMonotonicAppendFastPath !== undefined) { payload.relational_monotonic_append_fast_path = options.relationalMonotonicAppendFastPath } @@ -110,9 +110,9 @@ function serializeOpenOptions(options?: HawdbOpenOptions): string { } function decodeResultPayload(text: string | null): HawdbQueryResult { - if (!text) return new HawdbQueryResult([], []) + if (!text) {return new HawdbQueryResult([], [])} const parsed = parseLosslessJson(text) - if (typeof parsed !== 'object' || parsed === null) return new HawdbQueryResult([], []) + if (typeof parsed !== 'object' || parsed === null) {return new HawdbQueryResult([], [])} const record = parsed as Record const columns = Array.isArray(record.columns) ? record.columns.map((item) => String(item)) : [] const rows = Array.isArray(record.rows) ? (record.rows as unknown[][]) : [] @@ -134,7 +134,7 @@ export class HawdbTransaction { } private assertActive(): void { - if (!this.active) throw new HawdbError('transaction_expired', '事务已结束,不可继续使用') + if (!this.active) {throw new HawdbError('transaction_expired', '事务已结束,不可继续使用')} } query(cypher: string, params?: Record): HawdbQueryResult { @@ -164,18 +164,18 @@ export class HawdbDatabase { } private assertOpen(): void { - if (this.closed) throw new HawdbError('database_closed', 'HawDB 数据库句柄已关闭') + if (this.closed) {throw new HawdbError('database_closed', 'HawDB 数据库句柄已关闭')} } query(cypher: string, params?: Record): HawdbQueryResult { this.assertOpen() - if (this.inTransaction) throw new HawdbError('active_transaction', '事务进行中请使用事务句柄执行查询') + if (this.inTransaction) {throw new HawdbError('active_transaction', '事务进行中请使用事务句柄执行查询')} return this.library.runQuery(this.handle, cypher, params ?? {}, false, false) } querySQL(sql: string, params?: unknown[]): HawdbQueryResult { this.assertOpen() - if (this.inTransaction) throw new HawdbError('active_transaction', '事务进行中请使用事务句柄执行查询') + if (this.inTransaction) {throw new HawdbError('active_transaction', '事务进行中请使用事务句柄执行查询')} return this.library.runQuery(this.handle, sql, params ?? [], false, true) } @@ -185,7 +185,7 @@ export class HawdbDatabase { transaction(body: (tx: HawdbTransaction) => T): T { this.assertOpen() - if (this.inTransaction) throw new HawdbError('nested_transaction', 'HawDB 不支持嵌套事务') + if (this.inTransaction) {throw new HawdbError('nested_transaction', 'HawDB 不支持嵌套事务')} this.library.beginTransaction(this.handle) this.inTransaction = true const tx = new HawdbTransaction(this.library, this.handle) @@ -227,8 +227,8 @@ export class HawdbDatabase { } close(): void { - if (this.closed) return - if (this.inTransaction) throw new HawdbError('active_transaction', '事务未结束前不可关闭数据库') + if (this.closed) {return} + if (this.inTransaction) {throw new HawdbError('active_transaction', '事务未结束前不可关闭数据库')} this.closed = true this.library.closeHandle(this.handle) } @@ -271,11 +271,11 @@ export class HawdbLibrary { private takeBuffer(buffer: RawHawdbBuffer): string | null { const length = Number(buffer.len) if (!buffer.ptr) { - if (length !== 0) throw new TypeError('HawDB 返回了空指针但长度非零的缓冲区') + if (length !== 0) {throw new TypeError('HawDB 返回了空指针但长度非零的缓冲区')} return null } try { - if (length === 0) return '' + if (length === 0) {return ''} const bytes = koffi.decode(buffer.ptr, 'uint8_t', length) as Uint8Array return utf8Decoder.decode(bytes) } finally { @@ -285,7 +285,7 @@ export class HawdbLibrary { private errorFrom(errorBuffer: RawHawdbBuffer, fallback: string): HawdbError { const text = this.takeBuffer(errorBuffer) - if (!text) return new HawdbError('ffi', fallback) + if (!text) {return new HawdbError('ffi', fallback)} try { const parsed = parseLosslessJson(text) if (typeof parsed === 'object' && parsed !== null) { @@ -301,7 +301,7 @@ export class HawdbLibrary { } private assertOpen(): void { - if (this.closed) throw new HawdbError('library_closed', 'HawDB 动态库已卸载,不可继续调用') + if (this.closed) {throw new HawdbError('library_closed', 'HawDB 动态库已卸载,不可继续调用')} } version(): string { @@ -309,7 +309,7 @@ export class HawdbLibrary { const out = emptyBuffer() this.symbols.hawdb_version(out) const text = this.takeBuffer(out) - if (text === null) throw new HawdbError('ffi', '无法读取 HawDB 版本号') + if (text === null) {throw new HawdbError('ffi', '无法读取 HawDB 版本号')} return text } @@ -329,7 +329,7 @@ export class HawdbLibrary { const optionBytes = encodeUtf8(serializeOpenOptions(options)) const errOut = emptyBuffer() const handle = this.symbols.hawdb_open(pathBytes.buf, pathBytes.len, optionBytes.buf, optionBytes.len, errOut) - if (!handle) throw this.errorFrom(errOut, `无法打开 HawDB 数据库:${path}`) + if (!handle) {throw this.errorFrom(errOut, `无法打开 HawDB 数据库:${path}`)} const stray = this.takeBuffer(errOut) if (stray !== null) { this.symbols.hawdb_close(handle) @@ -343,7 +343,7 @@ export class HawdbLibrary { this.assertOpen() const errOut = emptyBuffer() const handle = this.symbols.hawdb_open_in_memory(errOut) - if (!handle) throw this.errorFrom(errOut, '无法创建内存 HawDB 数据库') + if (!handle) {throw this.errorFrom(errOut, '无法创建内存 HawDB 数据库')} const stray = this.takeBuffer(errOut) if (stray !== null) { this.symbols.hawdb_close(handle) @@ -354,9 +354,9 @@ export class HawdbLibrary { } closeHandle(handle: unknown): void { - if (!this.handles.has(handle)) return + if (!this.handles.has(handle)) {return} this.handles.delete(handle) - if (!this.closed) this.symbols.hawdb_close(handle) + if (!this.closed) {this.symbols.hawdb_close(handle)} } runQuery(handle: unknown, statement: string, params: unknown, inTransaction: boolean, sql: boolean): HawdbQueryResult { @@ -378,7 +378,7 @@ export class HawdbLibrary { } const payload = this.takeBuffer(resultOut) const stray = this.takeBuffer(errOut) - if (stray !== null) throw new HawdbError('ffi', stray) + if (stray !== null) {throw new HawdbError('ffi', stray)} return decodeResultPayload(payload) } @@ -389,7 +389,7 @@ export class HawdbLibrary { throw this.errorFrom(errOut, '无法开启 HawDB 事务') } const stray = this.takeBuffer(errOut) - if (stray !== null) throw new HawdbError('ffi', stray) + if (stray !== null) {throw new HawdbError('ffi', stray)} } commitTransaction(handle: unknown): void { @@ -398,18 +398,18 @@ export class HawdbLibrary { const errOut = emptyBuffer() const ok = this.symbols.hawdb_commit_transaction(handle, resultOut, errOut) this.takeBuffer(resultOut) - if (!ok) throw this.errorFrom(errOut, '提交 HawDB 事务失败') + if (!ok) {throw this.errorFrom(errOut, '提交 HawDB 事务失败')} const stray = this.takeBuffer(errOut) - if (stray !== null) throw new HawdbError('ffi', stray) + if (stray !== null) {throw new HawdbError('ffi', stray)} } rollbackTransaction(handle: unknown): void { this.assertOpen() const errOut = emptyBuffer() const ok = this.symbols.hawdb_rollback_transaction(handle, errOut) - if (!ok) throw this.errorFrom(errOut, '回滚 HawDB 事务失败') + if (!ok) {throw this.errorFrom(errOut, '回滚 HawDB 事务失败')} const stray = this.takeBuffer(errOut) - if (stray !== null) throw new HawdbError('ffi', stray) + if (stray !== null) {throw new HawdbError('ffi', stray)} } private parseReport(reportOut: RawHawdbBuffer, errOut: RawHawdbBuffer, ok: boolean, fallback: string): Record { @@ -420,8 +420,8 @@ export class HawdbLibrary { } const payload = this.takeBuffer(reportOut) const stray = this.takeBuffer(errOut) - if (stray !== null) throw new HawdbError('ffi', stray) - if (!payload) return {} + if (stray !== null) {throw new HawdbError('ffi', stray)} + if (!payload) {return {}} const parsed = parseLosslessJson(payload) return typeof parsed === 'object' && parsed !== null ? (parsed as Record) : {} } @@ -467,7 +467,7 @@ export class HawdbLibrary { } close(): void { - if (this.closed) return + if (this.closed) {return} if (this.handles.size > 0) { throw new HawdbError('open_handles', '关闭 HawDB 动态库前必须先关闭全部数据库句柄') } diff --git a/src/main/ai/hawdb/graphBuilder.ts b/src/main/ai/hawdb/graphBuilder.ts index 82f8ad5..ffc056b 100644 --- a/src/main/ai/hawdb/graphBuilder.ts +++ b/src/main/ai/hawdb/graphBuilder.ts @@ -13,19 +13,19 @@ const MAX_RELATED_PER_ENTRY = 6 const MAX_SNIPPET_CHARS = 180 export function normalizeLookupText(value: string): string { - return value.toLocaleLowerCase('zh-CN').replace(/[\s,。;:、“”‘’!?()()、/\\|·_-]+/g, '') + return value.toLocaleLowerCase('zh-CN').replaceAll(/[\s,。;:、“”‘’!?()()、/\\|·_-]+/g, '') } export function extractQueryTerms(query: string): string[] { const normalized = normalizeLookupText(query) const terms = new Set() - if (normalized) terms.add(normalized) + if (normalized) {terms.add(normalized)} const words = query.toLocaleLowerCase('zh-CN').split(/[^\p{L}\p{N}]+/u).filter(Boolean) for (const word of words) { const clean = normalizeLookupText(word) - if (clean) terms.add(clean) + if (clean) {terms.add(clean)} } - const cjk = normalized.replace(/[^㐀-鿿]/g, '') + const cjk = normalized.replaceAll(/[^㐀-鿿]/g, '') for (let index = 0; index < cjk.length - 1; index += 1) { terms.add(cjk.slice(index, index + 2)) } @@ -52,11 +52,11 @@ export function buildKnowledgeSearchText(entry: KnowledgeEntry): string { export function buildConversationSearchText(conversation: StoredAiConversation): string { const summary = conversation.compression?.summary - const summaryBudget = summary ? Math.min(summary.length, 4_000) : 0 + const summaryBudget = summary ? Math.min(summary.length, 4000) : 0 let messageBudget = MAX_CONVERSATION_SEARCH_CHARS - conversation.title.length - (summaryBudget > 0 ? summaryBudget + 1 : 0) - if (messageBudget <= 0) messageBudget = 0 + if (messageBudget <= 0) {messageBudget = 0} const messageChunks: string[] = [] for (let i = conversation.messages.length - 1; i >= 0 && messageBudget > 0; i -= 1) { const message = conversation.messages[i] @@ -67,20 +67,20 @@ export function buildConversationSearchText(conversation: StoredAiConversation): .map((part) => part.text.trim()) .join(' ') } - if (!text) continue + if (!text) {continue} const chunk = text.length > messageBudget ? text.slice(0, messageBudget) : text messageChunks.unshift(chunk) messageBudget -= chunk.length + 1 } const chunks: string[] = [conversation.title] - if (summary && summaryBudget > 0) chunks.push(summary.slice(0, summaryBudget)) + if (summary && summaryBudget > 0) {chunks.push(summary.slice(0, summaryBudget))} chunks.push(...messageChunks) return chunks.join('\n').slice(0, MAX_CONVERSATION_SEARCH_CHARS) } export function buildConversationSnippet(conversation: StoredAiConversation, query: string): string { const candidates: string[] = [conversation.title] - if (conversation.compression?.summary) candidates.push(conversation.compression.summary) + if (conversation.compression?.summary) {candidates.push(conversation.compression.summary)} for (let i = conversation.messages.length - 1; i >= 0; i -= 1) { const msg = conversation.messages[i] if (msg.content.trim()) { @@ -90,7 +90,7 @@ export function buildConversationSnippet(conversation: StoredAiConversation, que .filter((part): part is { kind: 'text'; text: string } => part.kind === 'text' && Boolean(part.text.trim())) .map((part) => part.text.trim()) .join(' ') - if (partText) candidates.push(partText) + if (partText) {candidates.push(partText)} } } const terms = extractQueryTerms(query).sort((left, right) => right.length - left.length) @@ -98,17 +98,17 @@ export function buildConversationSnippet(conversation: StoredAiConversation, que for (const text of candidates) { const lower = text.toLocaleLowerCase('zh-CN') const idx = lower.indexOf(term) - if (idx >= 0) { + if (idx !== -1) { const start = Math.max(0, idx - 40) const end = Math.min(text.length, start + MAX_SNIPPET_CHARS) const prefix = start > 0 ? '…' : '' const suffix = end < text.length ? '…' : '' - return `${prefix}${text.slice(start, end).replace(/\s+/g, ' ').trim()}${suffix}` + return `${prefix}${text.slice(start, end).replaceAll(/\s+/g, ' ').trim()}${suffix}` } } } const fallback = candidates[0] ?? conversation.title - const clean = fallback.replace(/\s+/g, ' ').trim() + const clean = fallback.replaceAll(/\s+/g, ' ').trim() return clean.length > MAX_SNIPPET_CHARS ? `${clean.slice(0, MAX_SNIPPET_CHARS)}…` : clean } @@ -119,10 +119,10 @@ function pairKey(a: string, b: string): string { function candidateLabels(entry: KnowledgeEntry): string[] { const labels = new Set() const name = normalizeLookupText(entry.name) - if (name.length >= 2) labels.add(name) + if (name.length >= 2) {labels.add(name)} for (const alias of entry.aliases) { const clean = normalizeLookupText(alias) - if (clean.length >= 2) labels.add(clean) + if (clean.length >= 2) {labels.add(clean)} } return [...labels] } @@ -138,14 +138,14 @@ export function extractKnowledgeGraphEdges(entries: KnowledgeEntry[]): Knowledge for (const source of active) { const confusions = source.commonConfusions ?? [] - if (!confusions.length) continue + if (confusions.length === 0) {continue} for (const sentence of confusions) { const normSentence = normalizeLookupText(sentence) - if (!normSentence) continue + if (!normSentence) {continue} for (const target of active) { - if (target.id === source.id) continue + if (target.id === source.id) {continue} const key = pairKey(source.id, target.id) - if (seenPairs.has(key)) continue + if (seenPairs.has(key)) {continue} const targetLabels = labelsById.get(target.id) ?? [] if (targetLabels.some((label) => normSentence.includes(label))) { seenPairs.add(key) @@ -164,15 +164,15 @@ export function extractKnowledgeGraphEdges(entries: KnowledgeEntry[]): Knowledge const bodyText = normalizeLookupText( [source.definition, ...(source.formation ?? []), ...(source.features ?? [])].join(' ') ) - if (!bodyText) continue + if (!bodyText) {continue} let added = 0 for (const target of active) { - if (added >= MAX_RELATED_PER_ENTRY) break - if (target.id === source.id) continue + if (added >= MAX_RELATED_PER_ENTRY) {break} + if (target.id === source.id) {continue} const key = pairKey(source.id, target.id) - if (seenPairs.has(key)) continue + if (seenPairs.has(key)) {continue} const targetName = normalizeLookupText(target.name) - if (targetName.length < 2) continue + if (targetName.length < 2) {continue} if (bodyText.includes(targetName)) { seenPairs.add(key) edges.push({ diff --git a/src/main/ai/hawdb/jsonCodec.ts b/src/main/ai/hawdb/jsonCodec.ts index b8b25ed..52f5278 100644 --- a/src/main/ai/hawdb/jsonCodec.ts +++ b/src/main/ai/hawdb/jsonCodec.ts @@ -11,18 +11,18 @@ function isPlainObject(value: object): boolean { } function serializeValue(value: unknown, seen: WeakSet): string { - if (value === null) return 'null' - if (typeof value === 'boolean') return value ? 'true' : 'false' - if (typeof value === 'string') return JSON.stringify(value) + if (value === null) {return 'null'} + if (typeof value === 'boolean') {return value ? 'true' : 'false'} + if (typeof value === 'string') {return JSON.stringify(value)} if (typeof value === 'number') { - if (!Number.isFinite(value)) throw new TypeError('HawDB 参数不支持 NaN 或 Infinity') + if (!Number.isFinite(value)) {throw new TypeError('HawDB 参数不支持 NaN 或 Infinity')} if (Number.isInteger(value) && !Number.isSafeInteger(value)) { throw new TypeError('超出安全整数范围的整数必须使用 bigint 传入') } return JSON.stringify(value) } if (typeof value === 'bigint') { - if (value < INT64_MIN || value > INT64_MAX) throw new RangeError('bigint 超出 64 位有符号整数范围') + if (value < INT64_MIN || value > INT64_MAX) {throw new RangeError('bigint 超出 64 位有符号整数范围')} return value.toString() } if (typeof value !== 'object') { @@ -31,18 +31,18 @@ function serializeValue(value: unknown, seen: WeakSet): string { if (value instanceof Uint8Array) { return JSON.stringify({ $binary: encodeBinaryBase64(value) }) } - if (seen.has(value)) throw new TypeError('HawDB 参数存在循环引用') + if (seen.has(value)) {throw new TypeError('HawDB 参数存在循环引用')} seen.add(value) try { if (Array.isArray(value)) { const parts: string[] = [] for (let i = 0; i < value.length; i += 1) { - if (!Object.hasOwn(value, i)) throw new TypeError('HawDB 不支持稀疏数组参数') + if (!Object.hasOwn(value, i)) {throw new TypeError('HawDB 不支持稀疏数组参数')} parts.push(serializeValue(value[i], seen)) } return `[${parts.join(',')}]` } - if (!isPlainObject(value)) throw new TypeError('HawDB 仅支持普通对象参数') + if (!isPlainObject(value)) {throw new TypeError('HawDB 仅支持普通对象参数')} const entries = Object.entries(value) const parts = entries.map(([key, entryValue]) => `${JSON.stringify(key)}:${serializeValue(entryValue, seen)}`) return `{${parts.join(',')}}` @@ -76,22 +76,22 @@ class LosslessJsonParser { private skipWhitespace(): void { while (this.index < this.text.length) { const ch = this.text.charCodeAt(this.index) - if (ch === 0x20 || ch === 0x0a || ch === 0x0d || ch === 0x09) this.index += 1 - else break + if (ch === 0x20 || ch === 0x0A || ch === 0x0D || ch === 0x09) {this.index += 1} + else {break} } } private parseValue(): unknown { this.skipWhitespace() - if (this.index >= this.text.length) throw new SyntaxError(`HawDB JSON 意外结束,偏移 ${this.index}`) + if (this.index >= this.text.length) {throw new SyntaxError(`HawDB JSON 意外结束,偏移 ${this.index}`)} const ch = this.text[this.index] - if (ch === '"') return this.parseString() - if (ch === '{') return this.parseObject() - if (ch === '[') return this.parseArray() - if (ch === 't') return this.parseLiteral('true', true) - if (ch === 'f') return this.parseLiteral('false', false) - if (ch === 'n') return this.parseLiteral('null', null) - if (ch === '-' || (ch >= '0' && ch <= '9')) return this.parseNumber() + if (ch === '"') {return this.parseString()} + if (ch === '{') {return this.parseObject()} + if (ch === '[') {return this.parseArray()} + if (ch === 't') {return this.parseLiteral('true', true)} + if (ch === 'f') {return this.parseLiteral('false', false)} + if (ch === 'n') {return this.parseLiteral('null', null)} + if (ch === '-' || (ch >= '0' && ch <= '9')) {return this.parseNumber()} throw new SyntaxError(`HawDB JSON 遇到无效字符 ${ch},偏移 ${this.index}`) } @@ -123,12 +123,12 @@ class LosslessJsonParser { private parseNumber(): number | bigint { const start = this.index - if (this.text[this.index] === '-') this.index += 1 - if (this.index >= this.text.length) throw new SyntaxError(`HawDB JSON 数字无效,偏移 ${start}`) + if (this.text[this.index] === '-') {this.index += 1} + if (this.index >= this.text.length) {throw new SyntaxError(`HawDB JSON 数字无效,偏移 ${start}`)} if (this.text[this.index] === '0') { this.index += 1 const next = this.text[this.index] - if (next && next >= '0' && next <= '9') throw new SyntaxError(`HawDB JSON 不允许前导零,偏移 ${start}`) + if (next && next >= '0' && next <= '9') {throw new SyntaxError(`HawDB JSON 不允许前导零,偏移 ${start}`)} } else if (this.text[this.index] >= '1' && this.text[this.index] <= '9') { while (this.index < this.text.length && this.text[this.index] >= '0' && this.text[this.index] <= '9') { this.index += 1 @@ -144,20 +144,20 @@ class LosslessJsonParser { while (this.index < this.text.length && this.text[this.index] >= '0' && this.text[this.index] <= '9') { this.index += 1 } - if (this.index === fracStart) throw new SyntaxError(`HawDB JSON 小数部分为空,偏移 ${start}`) + if (this.index === fracStart) {throw new SyntaxError(`HawDB JSON 小数部分为空,偏移 ${start}`)} } if (this.text[this.index] === 'e' || this.text[this.index] === 'E') { isFloat = true this.index += 1 - if (this.text[this.index] === '+' || this.text[this.index] === '-') this.index += 1 + if (this.text[this.index] === '+' || this.text[this.index] === '-') {this.index += 1} const expStart = this.index while (this.index < this.text.length && this.text[this.index] >= '0' && this.text[this.index] <= '9') { this.index += 1 } - if (this.index === expStart) throw new SyntaxError(`HawDB JSON 指数部分为空,偏移 ${start}`) + if (this.index === expStart) {throw new SyntaxError(`HawDB JSON 指数部分为空,偏移 ${start}`)} } const token = this.text.slice(start, this.index) - if (isFloat) return Number(token) + if (isFloat) {return Number(token)} const big = BigInt(token) if (big >= BigInt(Number.MIN_SAFE_INTEGER) && big <= BigInt(Number.MAX_SAFE_INTEGER)) { return Number(big) @@ -181,7 +181,7 @@ class LosslessJsonParser { this.index += 1 return result } - if (ch !== ',') throw new SyntaxError(`HawDB JSON 数组缺少逗号或右括号,偏移 ${this.index}`) + if (ch !== ',') {throw new SyntaxError(`HawDB JSON 数组缺少逗号或右括号,偏移 ${this.index}`)} this.index += 1 } } @@ -196,10 +196,10 @@ class LosslessJsonParser { } while (true) { this.skipWhitespace() - if (this.text[this.index] !== '"') throw new SyntaxError(`HawDB JSON 对象键必须为字符串,偏移 ${this.index}`) + if (this.text[this.index] !== '"') {throw new SyntaxError(`HawDB JSON 对象键必须为字符串,偏移 ${this.index}`)} const key = this.parseString() this.skipWhitespace() - if (this.text[this.index] !== ':') throw new SyntaxError(`HawDB JSON 对象缺少冒号,偏移 ${this.index}`) + if (this.text[this.index] !== ':') {throw new SyntaxError(`HawDB JSON 对象缺少冒号,偏移 ${this.index}`)} this.index += 1 result[key] = this.parseValue() this.skipWhitespace() @@ -208,7 +208,7 @@ class LosslessJsonParser { this.index += 1 return result } - if (ch !== ',') throw new SyntaxError(`HawDB JSON 对象缺少逗号或右花括号,偏移 ${this.index}`) + if (ch !== ',') {throw new SyntaxError(`HawDB JSON 对象缺少逗号或右花括号,偏移 ${this.index}`)} this.index += 1 } } diff --git a/src/main/ai/hawdb/paths.ts b/src/main/ai/hawdb/paths.ts index 003b39c..eee1118 100644 --- a/src/main/ai/hawdb/paths.ts +++ b/src/main/ai/hawdb/paths.ts @@ -2,8 +2,8 @@ import { existsSync } from 'node:fs' import { join } from 'node:path' export function hawdbBinaryFileName(platform: string = process.platform): string { - if (platform === 'win32') return 'hawdb_ffi.dll' - if (platform === 'darwin') return 'libhawdb_ffi.dylib' + if (platform === 'win32') {return 'hawdb_ffi.dll'} + if (platform === 'darwin') {return 'libhawdb_ffi.dylib'} return 'libhawdb_ffi.so' } @@ -24,7 +24,7 @@ export function findHawdbBinary( platform: string = process.platform ): string | null { const envOverride = process.env.GUEARTH_HAWDB_LIB - if (envOverride && existsSync(envOverride)) return envOverride + if (envOverride && existsSync(envOverride)) {return envOverride} const binary = hawdbBinaryPathFor(appPath, resourcesPath, packaged, platform) return existsSync(binary) ? binary : null } @@ -36,7 +36,7 @@ export function resolveHawdbBinary( platform: string = process.platform ): string { const binary = findHawdbBinary(appPath, resourcesPath, packaged, platform) - if (binary) return binary + if (binary) {return binary} const expected = hawdbBinaryPathFor(appPath, resourcesPath, packaged, platform) throw new Error( packaged diff --git a/src/main/ai/hawdb/schema.ts b/src/main/ai/hawdb/schema.ts index 89d45f0..00bfded 100644 --- a/src/main/ai/hawdb/schema.ts +++ b/src/main/ai/hawdb/schema.ts @@ -12,7 +12,7 @@ function tableExists(db: HawdbDatabase, tableName: string): boolean { } function ensureTable(db: HawdbDatabase, tableName: string, ddl: string): void { - if (tableExists(db, tableName)) return + if (tableExists(db, tableName)) {return} db.querySQL(ddl) } diff --git a/src/main/ai/hawdb/worker.ts b/src/main/ai/hawdb/worker.ts index 9414a0d..bb0192b 100644 --- a/src/main/ai/hawdb/worker.ts +++ b/src/main/ai/hawdb/worker.ts @@ -8,33 +8,46 @@ let queue: Promise = Promise.resolve() async function dispatch(request: HawdbWorkerRequest): Promise { switch (request.op) { - case 'open': + case 'open': { return engine.open(request.payload) - case 'close': + } + case 'close': { engine.close() return true - case 'status': + } + case 'status': { return engine.status() - case 'memory:list': + } + case 'memory:list': { return engine.listMemories() - case 'memory:add': + } + case 'memory:add': { return engine.addMemory(request.payload.content, request.payload.source) - case 'memory:delete': + } + case 'memory:delete': { return engine.deleteMemory(request.payload.id) - case 'memory:recall': + } + case 'memory:recall': { return engine.recallMemories(request.payload.query, request.payload.limit) - case 'history:list': + } + case 'history:list': { return engine.listConversations() - case 'history:get': + } + case 'history:get': { return engine.getConversation(request.payload.id) - case 'history:save': + } + case 'history:save': { return engine.saveConversation(request.payload.conversation) - case 'history:delete': + } + case 'history:delete': { return engine.deleteConversation(request.payload.id) - case 'history:search': + } + case 'history:search': { return engine.searchConversations(request.payload.query, request.payload.limit, request.payload.excludeId) - case 'knowledge:retrieve': + } + case 'knowledge:retrieve': { return engine.retrieveKnowledge(request.payload.query, request.payload.module, request.payload.topK) + } } } @@ -58,6 +71,6 @@ if (parentPort) { }) } }) - .catch(() => undefined) + .catch(() => {}) }) } diff --git a/src/main/ai/knowledge/index.ts b/src/main/ai/knowledge/index.ts index af884b8..ea850cc 100644 --- a/src/main/ai/knowledge/index.ts +++ b/src/main/ai/knowledge/index.ts @@ -60,17 +60,17 @@ const DEFAULT_TOP_K = 3 const MAX_TOP_K = 5 function normalize(value: string): string { - return value.toLocaleLowerCase('zh-CN').replace(/[\s,。;:、“”‘’!?()()、/\\|·_-]+/g, '') + return value.toLocaleLowerCase('zh-CN').replaceAll(/[\s,。;:、“”‘’!?()()、/\\|·_-]+/g, '') } function queryTerms(query: string): string[] { const normalized = normalize(query) const terms = new Set() - if (normalized) terms.add(normalized) + if (normalized) {terms.add(normalized)} const words = query.toLocaleLowerCase('zh-CN').split(/[^\p{L}\p{N}]+/u).filter(Boolean) - for (const word of words) terms.add(normalize(word)) - const cjk = normalized.replace(/[^\u3400-\u9fff]/g, '') - for (let index = 0; index < cjk.length - 1; index += 1) terms.add(cjk.slice(index, index + 2)) + for (const word of words) {terms.add(normalize(word))} + const cjk = normalized.replaceAll(/[^\u3400-\u9FFF]/g, '') + for (let index = 0; index < cjk.length - 1; index += 1) {terms.add(cjk.slice(index, index + 2))} return [...terms].filter((term) => term.length > 0) } @@ -92,10 +92,10 @@ function scoreEntry(entry: KnowledgeEntry, terms: string[], module?: string): { score += 25 matchedFields.push('module') } - if (nameScore) matchedFields.push('name') - if (aliasScore) matchedFields.push('aliases') - if (keywordScore) matchedFields.push('keywords') - if (contentScore) matchedFields.push('content') + if (nameScore) {matchedFields.push('name')} + if (aliasScore) {matchedFields.push('aliases')} + if (keywordScore) {matchedFields.push('keywords')} + if (contentScore) {matchedFields.push('content')} return { score, matchedFields } } @@ -121,7 +121,7 @@ function toMatch(entry: KnowledgeEntry, score: number, matchedFields: string[]): export function retrieveKnowledge(query: string, module?: string, topK = DEFAULT_TOP_K): { query: string; matches: KnowledgeMatch[]; total: number } { const cleanQuery = query.trim().slice(0, MAX_QUERY_LENGTH) - if (!cleanQuery) return { query: '', matches: [], total: 0 } + if (!cleanQuery) {return { query: '', matches: [], total: 0 }} const terms = queryTerms(cleanQuery) const limit = Math.min(MAX_TOP_K, Math.max(1, Math.round(topK))) const ranked = knowledgeEntries diff --git a/src/main/ai/locationAnalysis.ts b/src/main/ai/locationAnalysis.ts index 285e065..03674da 100644 --- a/src/main/ai/locationAnalysis.ts +++ b/src/main/ai/locationAnalysis.ts @@ -1,4 +1,5 @@ -import { poiStatistics, type PoiCategoryCount } from './amap' +import { poiStatistics } from './amap'; +import type { PoiCategoryCount } from './amap'; import { retrieveKnowledge } from './knowledge' export interface AnalyzeLocationRequest { @@ -45,7 +46,7 @@ const DAILY_LIFE_CATEGORY_CODES = new Set(['05', '06', '07', '08', '09']) export async function analyzeLocation(request: AnalyzeLocationRequest): Promise { const focus = typeof request.focus === 'string' && FOCUS_LABELS[request.focus] ? request.focus : 'general' - const radiusMeters = Math.round(Math.min(50_000, Math.max(200, request.radiusMeters ?? 5_000))) + const radiusMeters = Math.round(Math.min(50_000, Math.max(200, request.radiusMeters ?? 5000))) const base: AnalyzeLocationResult = { center: { name: typeof request.centerName === 'string' ? request.centerName.trim().slice(0, 40) : '', @@ -71,7 +72,7 @@ export async function analyzeLocation(request: AnalyzeLocationRequest): Promise< radiusMeters, maxSamples: 400 }) - if (poi.error) return { ...base, center: poi.center, error: poi.error } + if (poi.error) {return { ...base, center: poi.center, error: poi.error }} const knowledge = retrieveKnowledge(`${poi.center.name} ${FOCUS_LABELS[focus]}区位因素`, '产业区位', 3) const highOrderCategories = poi.categories .filter((item) => HIGH_ORDER_CATEGORY_CODES.has(item.code) && item.count > 0) @@ -80,11 +81,11 @@ export async function analyzeLocation(request: AnalyzeLocationRequest): Promise< .filter((item) => DAILY_LIFE_CATEGORY_CODES.has(item.code) && item.count > 0) .map((item) => `${item.label}(${item.count})`) const notes: string[] = [] - if (poi.sampled < 60) notes.push('该地点周边 POI 样本较少,可能为乡村、低等级中心地或专业化功能区,POI 构成对区位判断的参考有限') - else if (highOrderCategories.length === 0) notes.push('统计半径内未见金融保险、科教文化、商务住宅、公司企业等高级职能类别,职能层级较低') - else notes.push(`出现高级职能类别:${highOrderCategories.join('、')},中心地等级较高`) - if (focus === 'agriculture') notes.push('农业区位以自然条件(气候、地形、土壤、水源)与社会经济条件(市场、交通、政策)为主,POI 构成仅反映周边聚落与市场概况,请结合海拔与你的地理知识分析') - if (focus === 'transport') notes.push('交通区位请关注 POI 中的交通设施服务(15 类)与道路附属设施(18 类)数量,并结合海陆位置、地形起伏综合判断') + if (poi.sampled < 60) {notes.push('该地点周边 POI 样本较少,可能为乡村、低等级中心地或专业化功能区,POI 构成对区位判断的参考有限')} + else if (highOrderCategories.length === 0) {notes.push('统计半径内未见金融保险、科教文化、商务住宅、公司企业等高级职能类别,职能层级较低')} + else {notes.push(`出现高级职能类别:${highOrderCategories.join('、')},中心地等级较高`)} + if (focus === 'agriculture') {notes.push('农业区位以自然条件(气候、地形、土壤、水源)与社会经济条件(市场、交通、政策)为主,POI 构成仅反映周边聚落与市场概况,请结合海拔与你的地理知识分析')} + if (focus === 'transport') {notes.push('交通区位请关注 POI 中的交通设施服务(15 类)与道路附属设施(18 类)数量,并结合海陆位置、地形起伏综合判断')} return { ...base, center: poi.center, diff --git a/src/main/ai/memoryStore.ts b/src/main/ai/memoryStore.ts index db162ee..a189e0d 100644 --- a/src/main/ai/memoryStore.ts +++ b/src/main/ai/memoryStore.ts @@ -14,10 +14,10 @@ function isRecord(value: unknown): value is Record { } export function normalizeMemory(value: unknown): AgentMemory | null { - if (!isRecord(value)) return null + if (!isRecord(value)) {return null} const id = typeof value.id === 'string' ? value.id.trim() : '' const content = typeof value.content === 'string' ? value.content.trim().slice(0, MAX_MEMORY_CONTENT_LENGTH) : '' - if (!ID_PATTERN.test(id) || !content) return null + if (!ID_PATTERN.test(id) || !content) {return null} return { id, content, @@ -31,7 +31,7 @@ export class AiMemoryStore { private memories: AgentMemory[] = [] private hawdb: EoqHawdbClient | null = null - private enqueue = serialQueue() + private readonly enqueue = serialQueue() async init(path: string): Promise { this.path = path @@ -51,7 +51,7 @@ export class AiMemoryStore { const seen = new Set() const memories: AgentMemory[] = [] for (const memory of list) { - if (!memory || seen.has(memory.id)) continue + if (!memory || seen.has(memory.id)) {continue} seen.add(memory.id) memories.push(memory) } @@ -67,7 +67,7 @@ export class AiMemoryStore { private assertBackend(): 'hawdb' | 'json' { if (this.hawdb) { - if (!this.hawdb.isReady()) throw new Error('EOQ HawDB 后端不可用,请重启应用后重试') + if (!this.hawdb.isReady()) {throw new Error('EOQ HawDB 后端不可用,请重启应用后重试')} return 'hawdb' } return 'json' @@ -81,8 +81,8 @@ export class AiMemoryStore { return memory } const trimmed = typeof content === 'string' ? content.trim().slice(0, MAX_MEMORY_CONTENT_LENGTH) : '' - if (!trimmed) throw new Error('记忆内容不能为空') - if (this.memories.length >= MAX_MEMORIES) throw new Error(`记忆已达上限(${MAX_MEMORIES} 条),请先删除部分记忆`) + if (!trimmed) {throw new Error('记忆内容不能为空')} + if (this.memories.length >= MAX_MEMORIES) {throw new Error(`记忆已达上限(${MAX_MEMORIES} 条),请先删除部分记忆`)} const memory: AgentMemory = { id: `m${randomUUID()}`, content: trimmed, @@ -100,11 +100,11 @@ export class AiMemoryStore { return this.enqueue(async () => { if (this.assertBackend() === 'hawdb') { const deleted = await this.hawdb!.deleteMemory(id) - if (deleted) this.memories = this.memories.filter((memory) => memory.id !== id) + if (deleted) {this.memories = this.memories.filter((memory) => memory.id !== id)} return deleted } const next = this.memories.filter((memory) => memory.id !== id) - if (next.length === this.memories.length) return false + if (next.length === this.memories.length) {return false} await writeJson(this.path, next) this.memories = next return true @@ -113,7 +113,7 @@ export class AiMemoryStore { async recall(query: string, limit = 8): Promise { const clean = typeof query === 'string' ? query.trim() : '' - if (!clean) return [] + if (!clean) {return []} if (this.assertBackend() === 'hawdb') { return this.hawdb!.recallMemories(clean, limit) } diff --git a/src/main/ai/modelImporter.ts b/src/main/ai/modelImporter.ts index 42a03ab..f619f92 100644 --- a/src/main/ai/modelImporter.ts +++ b/src/main/ai/modelImporter.ts @@ -6,14 +6,15 @@ import type { AiProtocol, AiProviderConfig } from '../../preload' -import { DEFAULT_MIRROR_ENDPOINT, mirrorModelsDevUrl, type MirrorEndpointId } from '../../common/tileMirror' +import { DEFAULT_MIRROR_ENDPOINT, mirrorModelsDevUrl } from '../../common/tileMirror'; +import type { MirrorEndpointId } from '../../common/tileMirror'; import { readProviderKey } from '../keyVault' import { readResponseText, ResponseTooLargeError } from './responseReader' const MODELS_DEV_URL = 'https://models.dev/api.json' const REQUEST_TIMEOUT_MS = 20_000 const MAX_RESPONSE_BYTES = 16 * 1024 * 1024 -const MAX_PROVIDER_MODELS = 2_000 +const MAX_PROVIDER_MODELS = 2000 const MAX_ANTHROPIC_PAGES = 100 const modelsDevCache: { expiresAt: number; value: Record | null } = { expiresAt: 0, value: null } let modelsDevMirrorEndpoint: MirrorEndpointId | null = null @@ -48,12 +49,12 @@ function isRecord(value: unknown): value is Record { } function normalized(value: string): string { - return value.trim().toLowerCase().replace(/[^a-z0-9]+/g, '') + return value.trim().toLowerCase().replaceAll(/[^a-z0-9]+/g, '') } function safeUrl(value: string): URL { const url = new URL(value.trim()) - if (!['http:', 'https:'].includes(url.protocol)) throw new Error('接口地址必须使用 HTTP 或 HTTPS') + if (!['http:', 'https:'].includes(url.protocol)) {throw new Error('接口地址必须使用 HTTP 或 HTTPS')} return url } @@ -61,11 +62,11 @@ function endpoint(baseUrl: string, protocol: AiProtocol): string { const base = safeUrl(baseUrl) const path = base.pathname.replace(/\/+$/, '') if (protocol === 'anthropic') { - if (!path || path === '/') base.pathname = '/v1/models' - else base.pathname = `${path}/models` + if (!path || path === '/') {base.pathname = '/v1/models'} + else {base.pathname = `${path}/models`} } else { - if (!path || path === '/') base.pathname = '/v1/models' - else base.pathname = `${path}/models` + if (!path || path === '/') {base.pathname = '/v1/models'} + else {base.pathname = `${path}/models`} } base.search = '' base.hash = '' @@ -86,11 +87,11 @@ async function fetchText(url: string, init: RequestInit): Promise { controller, tooLargeMessage: '模型列表响应过大' }) - if (!response.ok) throw new Error(`模型列表请求失败(HTTP ${response.status})`) + if (!response.ok) {throw new Error(`模型列表请求失败(HTTP ${response.status})`)} return body } catch (error) { if (error instanceof ResponseTooLargeError) throw error - if (timedOut || controller.signal.aborted) throw new Error('模型列表请求超时') + if (timedOut || controller.signal.aborted) throw new Error('模型列表请求超时', { cause: error }) throw error instanceof Error ? error : new Error('模型列表请求失败') } finally { clearTimeout(timer) @@ -100,25 +101,25 @@ async function fetchText(url: string, init: RequestInit): Promise { function parseJson(body: string): Record { try { const value: unknown = JSON.parse(body) - if (!isRecord(value)) throw new Error('响应格式错误') + if (!isRecord(value)) {throw new Error('响应格式错误')} return value } catch (error) { if (error instanceof Error && error.message === '响应格式错误') throw error - throw new Error('模型列表响应不是有效 JSON') + throw new Error('模型列表响应不是有效 JSON', { cause: error }) } } function modelIds(payload: Record): string[] { - if (!Array.isArray(payload.data)) throw new Error('模型列表响应缺少 data 数组') + if (!Array.isArray(payload.data)) {throw new Error('模型列表响应缺少 data 数组')} const seen = new Set() const ids: string[] = [] for (const item of payload.data) { - if (!isRecord(item) || typeof item.id !== 'string') continue + if (!isRecord(item) || typeof item.id !== 'string') {continue} const id = item.id.trim().slice(0, 200) - if (!id || seen.has(id)) continue + if (!id || seen.has(id)) {continue} seen.add(id) ids.push(id) - if (ids.length >= MAX_PROVIDER_MODELS) break + if (ids.length >= MAX_PROVIDER_MODELS) {break} } return ids } @@ -128,7 +129,7 @@ async function fetchProviderIds(provider: AiProviderConfig, apiKey: string): Pro ? { 'x-api-key': apiKey, 'anthropic-version': '2023-06-01' } : { Authorization: `Bearer ${apiKey}` } const url = endpoint(provider.baseUrl, provider.protocol) - if (provider.protocol === 'openai') return modelIds(parseJson(await fetchText(url, { headers }))) + if (provider.protocol === 'openai') {return modelIds(parseJson(await fetchText(url, { headers })))} const ids: string[] = [] const seen = new Set() const seenCursors = new Set() @@ -141,11 +142,11 @@ async function fetchProviderIds(provider: AiProviderConfig, apiKey: string): Pro ids.push(id) } } - if (payload.has_more !== true) return ids - if (typeof payload.last_id !== 'string' || !payload.last_id) throw new Error('Anthropic 模型列表缺少下一页游标') - if (seenCursors.has(payload.last_id)) throw new Error('Anthropic 模型列表分页游标未推进') + if (payload.has_more !== true) {return ids} + if (typeof payload.last_id !== 'string' || !payload.last_id) {throw new Error('Anthropic 模型列表缺少下一页游标')} + if (seenCursors.has(payload.last_id)) {throw new Error('Anthropic 模型列表分页游标未推进')} seenCursors.add(payload.last_id) - if (page + 1 >= MAX_ANTHROPIC_PAGES) throw new Error('Anthropic 模型列表页数超出上限') + if (page + 1 >= MAX_ANTHROPIC_PAGES) {throw new Error('Anthropic 模型列表页数超出上限')} const pageUrl = new URL(url) pageUrl.searchParams.set('limit', '1000') pageUrl.searchParams.set('after_id', payload.last_id) @@ -155,7 +156,7 @@ async function fetchProviderIds(provider: AiProviderConfig, apiKey: string): Pro } async function modelsDev(): Promise> { - if (modelsDevCache.value && modelsDevCache.expiresAt > Date.now()) return modelsDevCache.value + if (modelsDevCache.value && modelsDevCache.expiresAt > Date.now()) {return modelsDevCache.value} let payload: Record if (modelsDevMirrorEndpoint) { try { @@ -173,10 +174,10 @@ async function modelsDev(): Promise> { function providersFromCatalog(payload: Record): ProviderMetadata[] { return Object.entries(payload).flatMap(([id, value]): ProviderMetadata[] => { - if (!isRecord(value) || !isRecord(value.models)) return [] + if (!isRecord(value) || !isRecord(value.models)) {return []} const models = Object.fromEntries(Object.entries(value.models).flatMap(([modelId, model]) => { - if (!isRecord(model)) return [] - return [[modelId, model as ModelMetadata]] + if (!isRecord(model)) {return []} + return [[modelId, model]] })) return [{ id, name: typeof value.name === 'string' ? value.name : id, api: typeof value.api === 'string' ? value.api : undefined, models }] }) @@ -187,15 +188,15 @@ function providerCandidates(provider: AiProviderConfig, catalogs: ProviderMetada let host = '' try { host = safeUrl(provider.baseUrl).hostname.toLowerCase() } catch { return [] } const matches = catalogs.filter((catalog) => { - if (providerTokens.has(normalized(catalog.id)) || providerTokens.has(normalized(catalog.name))) return true - if (!catalog.api) return false + if (providerTokens.has(normalized(catalog.id)) || providerTokens.has(normalized(catalog.name))) {return true} + if (!catalog.api) {return false} try { return new URL(catalog.api).hostname.toLowerCase() === host } catch { return false } }) return matches } function effortLevel(options: unknown): { thinking: boolean; thinkingLevel: 'low' | 'medium' | 'high'; note?: string } { - if (!Array.isArray(options)) return { thinking: false, thinkingLevel: 'medium' } + if (!Array.isArray(options)) {return { thinking: false, thinkingLevel: 'medium' }} const effort = options.find((item): item is { type: string; values?: unknown[] } => isRecord(item) && item.type === 'effort') if (!effort || !Array.isArray(effort.values)) { return { thinking: false, thinkingLevel: 'medium', note: '元数据仅声明开关或预算控制,当前协议未自动启用思考参数' } @@ -203,7 +204,7 @@ function effortLevel(options: unknown): { thinking: boolean; thinkingLevel: 'low const values = effort.values.filter((value): value is string => typeof value === 'string').map((value) => value.toLowerCase()) const rank: Record = { none: 0, minimal: 1, low: 2, medium: 3, high: 4, xhigh: 5, max: 6 } const supported = values.filter((value) => value !== 'none' && value !== 'default' && value in rank) - if (!supported.length) return { thinking: false, thinkingLevel: 'medium', note: '元数据没有可用的思考等级' } + if (supported.length === 0) {return { thinking: false, thinkingLevel: 'medium', note: '元数据没有可用的思考等级' }} const selected = supported.includes('high') ? 'high' : supported.reduce((best, value) => rank[value] > rank[best] ? value : best, supported[0]) return { thinking: true, thinkingLevel: selected === 'low' || selected === 'minimal' ? 'low' : selected === 'medium' ? 'medium' : 'high' } } @@ -226,7 +227,7 @@ function metadataSignature(metadata: ModelMetadata): string { const effort = effortLevel(metadata.reasoning_options) return JSON.stringify({ name: typeof metadata.name === 'string' ? metadata.name.trim() : '', - context: Math.min(2_000_000, Math.max(4_096, Math.round(limit))), + context: Math.min(2_000_000, Math.max(4096, Math.round(limit))), vision: modalities.includes('image'), thinking: metadata.reasoning === true && effort.thinking, level: effort.thinkingLevel @@ -237,11 +238,11 @@ function resolveAmbiguous(matches: CatalogMatch[]): CatalogMatch | null { const labs = new Set(matches.flatMap((match) => typeof match.metadata.canonical_model_id === 'string' && match.metadata.canonical_model_id ? [match.metadata.canonical_model_id.split('/')[0].toLowerCase()] : [])) - if (labs.size > 1) return null + if (labs.size > 1) {return null} if (labs.size === 1) { const lab = [...labs][0] const official = matches.find((match) => normalized(match.catalog.id) === normalized(lab)) - if (official) return official + if (official) {return official} } const signatures = new Set(matches.map((match) => metadataSignature(match.metadata))) return signatures.size === 1 ? matches[0] : null @@ -258,16 +259,16 @@ function candidateScore(match: CatalogMatch): [number, number, number, number] { } function bestEffortMatch(result: MetadataMatch): MetadataMatch { - if (!result.candidates?.length) return result + if (!result.candidates?.length) {return result} const labs = new Set(result.candidates.flatMap((match) => typeof match.metadata.canonical_model_id === 'string' && match.metadata.canonical_model_id ? [match.metadata.canonical_model_id.split('/')[0].toLowerCase()] : [])) - if (labs.size > 1) return result + if (labs.size > 1) {return result} const candidate = [...result.candidates].sort((a, b) => { const left = candidateScore(a) const right = candidateScore(b) for (let index = 0; index < left.length; index += 1) { - if (left[index] !== right[index]) return right[index] - left[index] + if (left[index] !== right[index]) {return right[index] - left[index]} } return 0 })[0] @@ -277,22 +278,22 @@ function bestEffortMatch(result: MetadataMatch): MetadataMatch { function matchMetadata(id: string, provider: AiProviderConfig, catalogs: ProviderMetadata[]): MetadataMatch { const candidates = providerCandidates(provider, catalogs) const direct = candidates.flatMap((catalog) => catalog.models[id] ? [{ catalog, metadata: catalog.models[id] }] : []) - if (direct.length === 1) return direct[0] + if (direct.length === 1) {return direct[0]} if (direct.length > 1) { const resolved = resolveAmbiguous(direct) return resolved ?? { note: '多个供应商元数据均匹配,无法安全确定来源', conflict: true, candidates: direct } } const global = catalogs.flatMap((catalog) => catalog.models[id] ? [{ catalog, metadata: catalog.models[id] }] : []) - if (global.length === 1) return global[0] + if (global.length === 1) {return global[0]} if (global.length > 1) { const resolved = resolveAmbiguous(global) return resolved ?? { note: '多个供应商元数据均匹配,无法安全确定来源', conflict: true, candidates: global } } const canonical = catalogs.flatMap((catalog) => Object.values(catalog.models).flatMap((metadata) => { - if (typeof metadata.canonical_model_id === 'string' && normalized(metadata.canonical_model_id) === normalized(`${catalog.id}/${id}`)) return [{ catalog, metadata }] + if (typeof metadata.canonical_model_id === 'string' && normalized(metadata.canonical_model_id) === normalized(`${catalog.id}/${id}`)) {return [{ catalog, metadata }]} return [] })) - if (canonical.length === 1) return canonical[0] + if (canonical.length === 1) {return canonical[0]} if (canonical.length > 1) { const resolved = resolveAmbiguous(canonical) return resolved ?? { note: '多个供应商元数据均匹配,无法安全确定来源', conflict: true, candidates: canonical } @@ -302,16 +303,16 @@ function matchMetadata(id: string, provider: AiProviderConfig, catalogs: Provide function metadataFor(id: string, provider: AiProviderConfig, catalogs: ProviderMetadata[], modelGroupCompat: boolean): MetadataMatch { const direct = matchMetadata(id, provider, catalogs) - if (direct.metadata) return direct - if (direct.conflict) return modelGroupCompat ? bestEffortMatch(direct) : direct - if (!modelGroupCompat) return direct + if (direct.metadata) {return direct} + if (direct.conflict) {return modelGroupCompat ? bestEffortMatch(direct) : direct} + if (!modelGroupCompat) {return direct} const slash = id.indexOf('/') - if (slash < 0) return direct + if (slash === -1) {return direct} const grouped = id.slice(slash + 1).trim() - if (!grouped) return direct + if (!grouped) {return direct} const result = matchMetadata(grouped, provider, catalogs) - if (result.metadata) return result - if (result.conflict) return bestEffortMatch(result) + if (result.metadata) {return result} + if (result.conflict) {return bestEffortMatch(result)} return { note: result.note ? `模型组兼容:${result.note}` : '模型组兼容未找到匹配' } } @@ -324,7 +325,7 @@ function toRow(id: string, metadata: ModelMetadata | undefined, note: string | u return { id, label: typeof metadata?.name === 'string' && metadata.name.trim() ? metadata.name.trim().slice(0, 80) : id, - contextWindow: Math.min(2_000_000, Math.max(4_096, Math.round(limit))), + contextWindow: Math.min(2_000_000, Math.max(4096, Math.round(limit))), streaming: true, vision: modalities.includes('image'), thinking: reasoning && (provider.protocol === 'anthropic' || !effort.note) ? effort.thinking : false, @@ -337,12 +338,12 @@ function toRow(id: string, metadata: ModelMetadata | undefined, note: string | u } function validateRequest(value: unknown): AiModelImportRequest { - if (!isRecord(value)) throw new Error('无效的模型导入请求') - if (!['openai', 'anthropic'].includes(value.protocol as string)) throw new Error('该协议不支持自动导入模型') + if (!isRecord(value)) {throw new Error('无效的模型导入请求')} + if (!['openai', 'anthropic'].includes(value.protocol as string)) {throw new Error('该协议不支持自动导入模型')} const id = typeof value.id === 'string' ? value.id.trim() : '' const name = typeof value.name === 'string' ? value.name.trim() : '' const baseUrl = typeof value.baseUrl === 'string' ? value.baseUrl.trim() : '' - if (!/^[a-z0-9][a-z0-9_-]{0,63}$/i.test(id) || !name || !baseUrl) throw new Error('供应商信息不完整') + if (!/^[a-z0-9][a-z0-9_-]{0,63}$/i.test(id) || !name || !baseUrl) {throw new Error('供应商信息不完整')} safeUrl(baseUrl) const ids = Array.isArray(value.ids) ? [...new Set(value.ids.flatMap((item): string[] => typeof item === 'string' && item.trim() ? [item.trim().slice(0, 200)] : []))].slice(0, MAX_PROVIDER_MODELS) @@ -365,15 +366,15 @@ export async function importModels(value: unknown): Promise name: request.name, protocol: request.protocol, baseUrl: request.baseUrl, - models: request.models as AiProviderConfig['models'] + models: request.models } - const idsPromise = request.ids !== undefined - ? Promise.resolve(request.ids) - : (() => { + const idsPromise = request.ids === undefined + ? (() => { const apiKey = readProviderKey(`ai-${provider.id}`) if (!apiKey) return Promise.reject(new Error(`未配置「${provider.name}」的 API Key,请先保存 API Key`)) return fetchProviderIds(provider, apiKey) })() + : Promise.resolve(request.ids) const [ids, catalog] = await Promise.all([idsPromise, modelsDev()]) const catalogs = providersFromCatalog(catalog) const rows = ids.map((id) => { diff --git a/src/main/ai/modelTest.ts b/src/main/ai/modelTest.ts index 6476432..eb3a218 100644 --- a/src/main/ai/modelTest.ts +++ b/src/main/ai/modelTest.ts @@ -1,4 +1,4 @@ -import { randomUUID } from 'crypto' +import { randomUUID } from 'node:crypto' import { net } from 'electron' import type { AiModelTestRequest, AiModelTestResult, AiProtocol } from '../../preload' import { normalizeModelTestOutput, redactApiKey } from '../../common/aiTelemetry' @@ -15,17 +15,17 @@ function isRecord(value: unknown): value is Record { function endpoint(baseUrl: string, protocol: AiProtocol): string { let base = baseUrl.trim().replace(/\/+$/, '') - if (/^https?:\/\/[^/]+$/i.test(base)) base = `${base}/v1` + if (/^https?:\/\/[^/]+$/i.test(base)) {base = `${base}/v1`} return `${base}${protocol === 'anthropic' ? '/messages' : '/chat/completions'}` } function extractPayloadError(payload: Record): { message: string; code: string } | null { const raw = payload.error - if (typeof raw === 'string' && raw.trim()) return { message: raw, code: '' } + if (typeof raw === 'string' && raw.trim()) {return { message: raw, code: '' }} if (isRecord(raw)) { const message = typeof raw.message === 'string' ? raw.message : '' const code = typeof raw.code === 'string' ? raw.code : typeof raw.type === 'string' ? raw.type : '' - if (message || code || Object.keys(raw).length > 0) return { message, code } + if (message || code || Object.keys(raw).length > 0) {return { message, code }} } if (payload.type === 'error') { const message = typeof payload.message === 'string' ? payload.message : '' @@ -53,31 +53,31 @@ function failureMessage(status: number, text: string, apiKey: string): string { message = text } const hint = `${code} ${message}`.toLowerCase() - if (status === 402 || /insufficient|balance|quota|credit/.test(hint)) return '账户余额不足或额度已用尽' - if (status === 401 || status === 403 || /api.?key|unauthor|forbidden|auth/.test(hint)) return 'API Key 无效或无权限' - if (status === 404 || /model.*(not.*found|not.*exist|no such)/.test(hint)) return '模型不存在' - if (status === 429 || /rate.?limit|too many/.test(hint)) return '请求过于频繁,请稍后重试' + if (status === 402 || /insufficient|balance|quota|credit/.test(hint)) {return '账户余额不足或额度已用尽'} + if (status === 401 || status === 403 || /api.?key|unauthor|forbidden|auth/.test(hint)) {return 'API Key 无效或无权限'} + if (status === 404 || /model.*(not.*found|not.*exist|no such)/.test(hint)) {return '模型不存在'} + if (status === 429 || /rate.?limit|too many/.test(hint)) {return '请求过于频繁,请稍后重试'} const detail = (message || text).trim().replaceAll(apiKey, '[redacted]').slice(0, 160) return `响应失败(HTTP ${status})${detail ? `:${detail}` : ''}` } function validate(value: unknown): AiModelTestRequest { - if (!isRecord(value)) throw new Error('无效的响应测试请求') - if (!['openai', 'anthropic'].includes(value.protocol as string)) throw new Error('该协议不支持响应测试') + if (!isRecord(value)) {throw new Error('无效的响应测试请求')} + if (!['openai', 'anthropic'].includes(value.protocol as string)) {throw new Error('该协议不支持响应测试')} const id = typeof value.id === 'string' ? value.id.trim() : '' const name = typeof value.name === 'string' ? value.name.trim() : '' const baseUrl = typeof value.baseUrl === 'string' ? value.baseUrl.trim() : '' const modelId = typeof value.modelId === 'string' ? value.modelId.trim().slice(0, 200) : '' - if (!/^[a-z0-9][a-z0-9_-]{0,63}$/i.test(id) || !name || !modelId) throw new Error('模型信息不完整') + if (!/^[a-z0-9][a-z0-9_-]{0,63}$/i.test(id) || !name || !modelId) {throw new Error('模型信息不完整')} const url = new URL(baseUrl) - if (!['http:', 'https:'].includes(url.protocol)) throw new Error('接口地址必须使用 HTTP 或 HTTPS') + if (!['http:', 'https:'].includes(url.protocol)) {throw new Error('接口地址必须使用 HTTP 或 HTTPS')} return { id, name: name.slice(0, 80), protocol: value.protocol as AiProtocol, baseUrl: baseUrl.slice(0, 500), modelId } } export async function testModel(value: unknown): Promise { const request = validate(value) const apiKey = readProviderKey(`ai-${request.id}`) - if (!apiKey) throw new Error('请先保存 API Key') + if (!apiKey) {throw new Error('请先保存 API Key')} const headers = request.protocol === 'anthropic' ? { 'Content-Type': 'application/json', 'x-api-key': apiKey, 'anthropic-version': '2023-06-01' } : { 'Content-Type': 'application/json', Authorization: `Bearer ${apiKey}` } @@ -105,10 +105,10 @@ export async function testModel(value: unknown): Promise { controller, tooLargeMessage: '响应内容过大' }) - if (!response.ok) throw new Error(failureMessage(response.status, text, apiKey)) + if (!response.ok) {throw new Error(failureMessage(response.status, text, apiKey))} const payload: unknown = JSON.parse(text) - if (!isRecord(payload)) throw new Error('响应格式错误') - if (extractPayloadError(payload)) throw new Error(failureMessage(response.status, text, apiKey)) + if (!isRecord(payload)) {throw new Error('响应格式错误')} + if (extractPayloadError(payload)) {throw new Error(failureMessage(response.status, text, apiKey))} captureAiGeneration({ distinctId: `ai-model-test:${traceId}`, traceId, diff --git a/src/main/ai/poiAggregation.ts b/src/main/ai/poiAggregation.ts index 985e49e..3d60b06 100644 --- a/src/main/ai/poiAggregation.ts +++ b/src/main/ai/poiAggregation.ts @@ -22,7 +22,7 @@ export function aggregatePois(target: PoiAggregation, pois: readonly PoiSample[] for (const poi of pois) { target.fetched += 1 const code = poiBigCategory(poi) - if (!code) continue + if (!code) {continue} target.counts.set(code, (target.counts.get(code) ?? 0) + 1) target.sampled += 1 } diff --git a/src/main/ai/poiCategories.ts b/src/main/ai/poiCategories.ts index 1dbe945..b590ba1 100644 --- a/src/main/ai/poiCategories.ts +++ b/src/main/ai/poiCategories.ts @@ -27,7 +27,7 @@ export interface PoiLike { } export function poiBigCategory(poi: PoiLike): string | undefined { - if (typeof poi.typecode !== 'string') return undefined + if (typeof poi.typecode !== 'string') {return undefined} const code = poi.typecode.slice(0, 2) return POI_CATEGORY_LABELS[code] === undefined ? undefined : code } diff --git a/src/main/ai/posthog.ts b/src/main/ai/posthog.ts index b3d1439..4c7045f 100644 --- a/src/main/ai/posthog.ts +++ b/src/main/ai/posthog.ts @@ -8,12 +8,12 @@ let posthogClient: PostHog | null = null let missingWarned = false function ensureClient(): PostHog | null { - if (!aiPosthogEnabled) return null - if (posthogClient) return posthogClient + if (!aiPosthogEnabled) {return null} + if (posthogClient) {return posthogClient} if (!projectToken || !host) { if (!missingWarned && import.meta.env.DEV) { missingWarned = true - const missingConfiguration = !projectToken ? 'VITE_POSTHOG_PROJECT_TOKEN' : 'VITE_POSTHOG_HOST' + const missingConfiguration = projectToken ? 'VITE_POSTHOG_HOST' : 'VITE_POSTHOG_PROJECT_TOKEN' console.warn(`${missingConfiguration} variable required by PostHog is missing or un-configured, this causes events to be silently missed. This error stops appearing once ${missingConfiguration} is configured`) } return null @@ -28,7 +28,7 @@ function ensureClient(): PostHog | null { export function setAiPosthogEnabled(enabled: boolean): void { aiPosthogEnabled = enabled - if (enabled) ensureClient() + if (enabled) {ensureClient()} } export function isAiPosthogEnabled(): boolean { @@ -64,7 +64,7 @@ interface AiSpanCapture extends AiCaptureBase { export function captureAiGeneration(capture: AiGenerationCapture): void { const client = ensureClient() - if (!client) return + if (!client) {return} try { client.capture({ distinctId: capture.distinctId, @@ -76,7 +76,7 @@ export function captureAiGeneration(capture: AiGenerationCapture): void { $ai_provider: capture.provider, $ai_input: capture.input, ...(capture.output === undefined ? {} : { $ai_output_choices: capture.output }), - $ai_latency: capture.latencyMs / 1_000, + $ai_latency: capture.latencyMs / 1000, $ai_base_url: capture.baseUrl, $ai_request_url: capture.requestUrl, $ai_stream: capture.stream, @@ -91,7 +91,7 @@ export function captureAiGeneration(capture: AiGenerationCapture): void { export function captureAiSpan(capture: AiSpanCapture): void { const client = ensureClient() - if (!client) return + if (!client) {return} try { client.capture({ distinctId: capture.distinctId, @@ -103,7 +103,7 @@ export function captureAiSpan(capture: AiSpanCapture): void { $ai_span_name: capture.name, $ai_input_state: capture.input, $ai_output_state: capture.output, - $ai_latency: capture.latencyMs / 1_000, + $ai_latency: capture.latencyMs / 1000, ...(capture.error ? { $ai_is_error: true, $ai_error: capture.error } : {}) } }) @@ -113,19 +113,19 @@ export function captureAiSpan(capture: AiSpanCapture): void { } export async function shutdownPosthog(): Promise { - if (!posthogClient) return + if (!posthogClient) {return} let timeout: NodeJS.Timeout | undefined try { await Promise.race([ posthogClient.shutdown(), new Promise((resolve) => { - timeout = setTimeout(resolve, 1_000) + timeout = setTimeout(resolve, 1000) timeout.unref() }) ]) } catch { return } finally { - if (timeout) clearTimeout(timeout) + if (timeout) {clearTimeout(timeout)} } } diff --git a/src/main/ai/responseReader.ts b/src/main/ai/responseReader.ts index ab3a550..9482373 100644 --- a/src/main/ai/responseReader.ts +++ b/src/main/ai/responseReader.ts @@ -10,7 +10,7 @@ export async function readResponseText( options: { maxBytes: number; controller: AbortController; tooLargeMessage: string } ): Promise { const { maxBytes, controller, tooLargeMessage } = options - if (!response.body) return '' + if (!response.body) {return ''} const reader = response.body.getReader() const decoder = new TextDecoder() const chunks: string[] = [] @@ -18,7 +18,7 @@ export async function readResponseText( try { while (true) { const { done, value } = await reader.read() - if (done) break + if (done) {break} totalBytes += value.byteLength if (totalBytes > maxBytes) { const error = new ResponseTooLargeError(tooLargeMessage) @@ -34,7 +34,7 @@ export async function readResponseText( try { reader.releaseLock() } catch { - // reader may already be released or canceled + // Reader may already be released or canceled } } } diff --git a/src/main/ai/search/baidu.ts b/src/main/ai/search/baidu.ts index 41fc5b3..0f4746f 100644 --- a/src/main/ai/search/baidu.ts +++ b/src/main/ai/search/baidu.ts @@ -12,13 +12,13 @@ function text(value: unknown, limit: number): string { } function referenceFrom(value: unknown): AiSearchReference | null { - if (!isRecord(value) || (value.type !== undefined && value.type !== 'web')) return null - if (typeof value.url !== 'string' || value.url.length > 2048) return null + if (!isRecord(value) || (value.type !== undefined && value.type !== 'web')) {return null} + if (typeof value.url !== 'string' || value.url.length > 2048) {return null} try { const url = new URL(value.url) - if (!['https:', 'http:'].includes(url.protocol) || url.username || url.password) return null + if (!['https:', 'http:'].includes(url.protocol) || url.username || url.password) {return null} const title = text(value.title, 300) - if (!title) return null + if (!title) {return null} return { title, url: url.href, @@ -32,7 +32,7 @@ function referenceFrom(value: unknown): AiSearchReference | null { } function providerError(body: unknown, apiKey: string): string { - if (!isRecord(body) || body.code === undefined || body.code === null || body.code === 0 || body.code === '0') return '' + if (!isRecord(body) || body.code === undefined || body.code === null || body.code === 0 || body.code === '0') {return ''} const code = typeof body.code === 'number' || typeof body.code === 'string' ? String(body.code) : '' const message = typeof body.message === 'string' ? body.message : '未知错误' return `百度千帆搜索失败:${message}${code ? ` (${code})` : ''}`.replaceAll(apiKey, '[已隐藏]').slice(0, 400) @@ -58,23 +58,23 @@ export async function searchBaiduWeb(query: string, apiKey: string, signal: Abor const body: unknown = await response.json().catch(() => null) requestSignal.throwIfAborted() const error = providerError(body, apiKey) - if (error) return { query, error } - if (!response.ok) return { query, error: `百度千帆搜索请求失败 (HTTP ${response.status})` } - if (!isRecord(body) || !Array.isArray(body.references)) return { query, error: '百度千帆返回了无效搜索数据' } + if (error) {return { query, error }} + if (!response.ok) {return { query, error: `百度千帆搜索请求失败 (HTTP ${response.status})` }} + if (!isRecord(body) || !Array.isArray(body.references)) {return { query, error: '百度千帆返回了无效搜索数据' }} const references: AiSearchReference[] = [] const urls = new Set() for (const value of body.references) { const reference = referenceFrom(value) - if (!reference || urls.has(reference.url)) continue - if (JSON.stringify({ query, references: [...references, reference] }).length > 24_000) break + if (!reference || urls.has(reference.url)) {continue} + if (JSON.stringify({ query, references: [...references, reference] }).length > 24_000) {break} references.push(reference) urls.add(reference.url) - if (references.length === 10) break + if (references.length === 10) {break} } return { query, references } } catch { - if (signal.aborted) return { query, error: '搜索已取消' } - if (timeout.aborted) return { query, error: '百度千帆搜索超时,请稍后重试' } + if (signal.aborted) {return { query, error: '搜索已取消' }} + if (timeout.aborted) {return { query, error: '百度千帆搜索超时,请稍后重试' }} return { query, error: '百度千帆搜索网络请求失败,请稍后重试' } } } diff --git a/src/main/ai/search/index.ts b/src/main/ai/search/index.ts index 9df794c..373b8d3 100644 --- a/src/main/ai/search/index.ts +++ b/src/main/ai/search/index.ts @@ -1,7 +1,8 @@ import { net } from 'electron' import type { AiSearchProviderConfig } from '../../../preload' import { readProviderKey } from '../../keyVault' -import { searchBaiduWeb, type SearchFetch, type WebSearchResult } from './baidu' +import { searchBaiduWeb } from './baidu'; +import type { SearchFetch, WebSearchResult } from './baidu'; type SearchAdapter = (query: string, apiKey: string, signal: AbortSignal, fetch: SearchFetch) => Promise @@ -9,12 +10,12 @@ const searchAdapters: Record = { export async function searchWeb(provider: AiSearchProviderConfig | undefined, input: unknown, signal: AbortSignal): Promise { const query = typeof input === 'string' ? input.trim().slice(0, 500) : '' - if (signal.aborted) return { query, error: '搜索已取消' } - if (!query) return { query, error: '缺少搜索关键词' } - if (!provider) return { query, error: '请在「AI 设置 → 搜索供应商」中选择搜索供应商' } + if (signal.aborted) {return { query, error: '搜索已取消' }} + if (!query) {return { query, error: '缺少搜索关键词' }} + if (!provider) {return { query, error: '请在「AI 设置 → 搜索供应商」中选择搜索供应商' }} const adapter = searchAdapters[provider.kind] - if (!adapter) return { query, error: '不支持的搜索供应商' } + if (!adapter) {return { query, error: '不支持的搜索供应商' }} const apiKey = readProviderKey(`ai-search-${provider.id}`) - if (!apiKey) return { query, error: `未配置「${provider.name}」的 AppBuilder API Key,请在「AI 设置 → 搜索供应商」中保存` } + if (!apiKey) {return { query, error: `未配置「${provider.name}」的 AppBuilder API Key,请在「AI 设置 → 搜索供应商」中保存` }} return adapter(query, apiKey, signal, (url, init) => net.fetch(url, init)) } diff --git a/src/main/ai/searchThrottle.ts b/src/main/ai/searchThrottle.ts index e2ead18..696871a 100644 --- a/src/main/ai/searchThrottle.ts +++ b/src/main/ai/searchThrottle.ts @@ -13,12 +13,12 @@ export function createSearchThrottle(minIntervalMs: number): SearchThrottle { run: (task: () => Promise, isSuperseded?: () => boolean): Promise => { const scheduled: Promise = tail.then(async (): Promise => { const wait = lastStartedAt + minIntervalMs - Date.now() - if (wait > 0) await delay(wait) - if (isSuperseded?.()) return null + if (wait > 0) {await delay(wait)} + if (isSuperseded?.()) {return null} lastStartedAt = Date.now() return task() }) - tail = scheduled.catch(() => undefined) + tail = scheduled.catch(() => {}) return scheduled } } diff --git a/src/main/ai/settingsStore.ts b/src/main/ai/settingsStore.ts index 24be744..aad1ecf 100644 --- a/src/main/ai/settingsStore.ts +++ b/src/main/ai/settingsStore.ts @@ -2,7 +2,7 @@ import { readJson, serialQueue, writeJson } from '../jsonStore' import type { AiModelConfig, AiProviderConfig, AiProtocol, AiSearchProviderConfig, AiSettings, AiThinkingLevel } from '../../preload' import { defaultAiSettings, defaultSearchProviders } from '../../shared/aiSettings' -const thinkingLevels: AiThinkingLevel[] = ['low', 'medium', 'high'] +const thinkingLevels = new Set(['low', 'medium', 'high']) const protocols: AiProtocol[] = ['openai', 'anthropic'] const idPattern = /^[a-z0-9][a-z0-9_-]{0,63}$/i const maxModelsPerProvider = 256 @@ -19,7 +19,7 @@ function normalizeModel(value: unknown): AiModelConfig | null { const contextWindow = typeof value.contextWindow === 'number' && Number.isFinite(value.contextWindow) ? Math.min(2_000_000, Math.max(4_096, Math.round(value.contextWindow))) : 128_000 - const thinkingLevel = thinkingLevels.includes(value.thinkingLevel as AiThinkingLevel) ? value.thinkingLevel as AiThinkingLevel : 'medium' + const thinkingLevel = thinkingLevels.has(value.thinkingLevel as AiThinkingLevel) ? value.thinkingLevel as AiThinkingLevel : 'medium' return { id, label, @@ -33,13 +33,13 @@ function normalizeModel(value: unknown): AiModelConfig | null { } function normalizeProvider(value: unknown): AiProviderConfig | null { - if (!isRecord(value)) return null + if (!isRecord(value)) {return null} const id = typeof value.id === 'string' && idPattern.test(value.id) ? value.id : '' - if (!id) return null + if (!id) {return null} const name = typeof value.name === 'string' && value.name.trim() ? value.name.trim().slice(0, 80) : id const protocol = protocols.includes(value.protocol as AiProtocol) ? value.protocol as AiProtocol : 'openai' let baseUrl = typeof value.baseUrl === 'string' ? value.baseUrl.trim() : '' - if (!baseUrl) baseUrl = protocol === 'anthropic' ? 'https://api.anthropic.com' : '' + if (!baseUrl) {baseUrl = protocol === 'anthropic' ? 'https://api.anthropic.com' : ''} baseUrl = baseUrl.replace(/\/+$/, '').slice(0, 500) const models = Array.isArray(value.models) ? value.models.map(normalizeModel).filter((model): model is AiModelConfig => model !== null).slice(0, maxModelsPerProvider) : [] return { id, name, protocol, baseUrl, models } @@ -60,14 +60,14 @@ export function normalizeAiSettings(value: unknown): AiSettings { const seenSearchIds = new Set() const searchProviders = Array.isArray(source.searchProviders) ? source.searchProviders.flatMap((value): AiSearchProviderConfig[] => { - if (!isRecord(value) || value.kind !== 'baidu' || typeof value.id !== 'string') return [] - if (!/^[a-z0-9][a-z0-9_-]{0,53}$/i.test(value.id) || seenSearchIds.has(value.id)) return [] + if (!isRecord(value) || value.kind !== 'baidu' || typeof value.id !== 'string') {return []} + if (!/^[a-z0-9][a-z0-9_-]{0,53}$/i.test(value.id) || seenSearchIds.has(value.id)) {return []} seenSearchIds.add(value.id) const name = typeof value.name === 'string' && value.name.trim() ? value.name.trim().slice(0, 80) : '百度千帆' return [{ id: value.id, name, kind: 'baidu' }] }).slice(0, 16) : [] - if (!searchProviders.length) searchProviders.push(...defaultSearchProviders()) + if (searchProviders.length === 0) {searchProviders.push(...defaultSearchProviders())} const activeSearchProviderId = searchProviders.some((provider) => provider.id === source.activeSearchProviderId) ? source.activeSearchProviderId as string : searchProviders[0].id @@ -87,7 +87,7 @@ export class AiSettingsStore { private path = '' private settings: AiSettings = defaultAiSettings() - private enqueue = serialQueue() + private readonly enqueue = serialQueue() async init(path: string): Promise { this.path = path diff --git a/src/main/datasets.ts b/src/main/datasets.ts index 1eca529..cdfa453 100644 --- a/src/main/datasets.ts +++ b/src/main/datasets.ts @@ -1,14 +1,15 @@ -import { existsSync, readFileSync } from 'fs' -import { join } from 'path' +import { existsSync, readFileSync } from 'node:fs' +import { join } from 'node:path' import { net } from 'electron' import type { EarthquakeFeed, ProvinceFeature, ProvinceGeoDocument } from '../preload' -import { DEFAULT_MIRROR_ENDPOINT, mirrorEarthquakesUrl, type MirrorEndpointId } from '../common/tileMirror' +import { DEFAULT_MIRROR_ENDPOINT, mirrorEarthquakesUrl } from '../common/tileMirror'; +import type { MirrorEndpointId } from '../common/tileMirror'; import { gcj02ToWgs84 } from './geo/gcj02' import { writeJson } from './jsonStore' import provincesAssetPath from '../../resources/geo/china-provinces.geojson?asset' const EARTHQUAKE_FEED_URL = 'https://earthquake.usgs.gov/earthquakes/feed/v1.0/summary/4.5_month.geojson' -const FETCH_TIMEOUT_MS = 15000 +const FETCH_TIMEOUT_MS = 15_000 let earthquakesPath = '' let datasetMirrorEndpoint: MirrorEndpointId | null = null @@ -31,10 +32,10 @@ export function initDatasets(userDataPath: string): void { } function readCachedFeed(): EarthquakeFeed | null { - if (!existsSync(earthquakesPath)) return null + if (!existsSync(earthquakesPath)) {return null} try { const parsed: unknown = JSON.parse(readFileSync(earthquakesPath, 'utf8')) - if (!isRecord(parsed) || typeof parsed.fetchedAt !== 'number' || !Array.isArray(parsed.events)) return null + if (!isRecord(parsed) || typeof parsed.fetchedAt !== 'number' || !Array.isArray(parsed.events)) {return null} const events = parsed.events.filter((item): item is EarthquakeFeed['events'][number] => isRecord(item) && typeof item.magnitude === 'number' @@ -52,17 +53,17 @@ function readCachedFeed(): EarthquakeFeed | null { } function parseFeed(json: unknown): EarthquakeFeed['events'] { - if (!isRecord(json) || !Array.isArray(json.features)) throw new Error('USGS response is invalid') + if (!isRecord(json) || !Array.isArray(json.features)) {throw new Error('USGS response is invalid')} const events: EarthquakeFeed['events'] = [] for (const feature of json.features) { - if (!isRecord(feature)) continue + if (!isRecord(feature)) {continue} const properties = isRecord(feature.properties) ? feature.properties : {} const geometry = isRecord(feature.geometry) ? feature.geometry : {} const coordinates = Array.isArray(geometry.coordinates) ? geometry.coordinates : [] const [longitude, latitude, depth] = coordinates const magnitude = Number(properties.mag) - if (!Number.isFinite(magnitude) || magnitude < 4.5) continue - if (typeof longitude !== 'number' || typeof latitude !== 'number') continue + if (!Number.isFinite(magnitude) || magnitude < 4.5) {continue} + if (typeof longitude !== 'number' || typeof latitude !== 'number') {continue} events.push({ magnitude: Math.round(magnitude * 10) / 10, longitude: Math.max(-180, Math.min(180, longitude)), @@ -80,7 +81,7 @@ async function fetchFeedFromUrl(url: string): Promise headers: { 'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) GuEarth/0.1' }, signal: AbortSignal.timeout(FETCH_TIMEOUT_MS) }) - if (!response.ok) throw new Error(`USGS request failed: ${response.status}`) + if (!response.ok) {throw new Error(`USGS request failed: ${response.status}`)} return parseFeed(await response.json()) } @@ -102,46 +103,46 @@ export async function loadEarthquakeFeed(): Promise { const events = await fetchFeed() feed = { fetchedAt: Date.now(), events } } catch { - if (cached) return { ...cached, stale: true } + if (cached) {return { ...cached, stale: true }} throw new Error('USGS 地震数据获取失败,请检查网络后重新启动') } - await writeJson(earthquakesPath, feed).catch(() => undefined) + await writeJson(earthquakesPath, feed).catch(() => {}) return feed } function toLatLngPair(value: unknown): [number, number] | null { - if (!Array.isArray(value) || value.length < 2) return null + if (!Array.isArray(value) || value.length < 2) {return null} const [longitude, latitude] = value - if (typeof longitude !== 'number' || typeof latitude !== 'number') return null + if (typeof longitude !== 'number' || typeof latitude !== 'number') {return null} return [longitude, latitude] } function normalizePolygons(geometry: unknown): number[][][][] { - if (!isRecord(geometry) || !Array.isArray(geometry.coordinates)) return [] + if (!isRecord(geometry) || !Array.isArray(geometry.coordinates)) {return []} const sets = geometry.type === 'Polygon' ? [geometry.coordinates] : geometry.type === 'MultiPolygon' ? geometry.coordinates : [] const polygons: number[][][][] = [] for (const set of sets) { - if (!Array.isArray(set)) continue + if (!Array.isArray(set)) {continue} const rings = set .filter((ring): ring is number[][] => Array.isArray(ring) && ring.length >= 3) .map((ring) => ring.map((point) => gcj02ToWgs84(point[0], point[1]))) - if (rings.length > 0) polygons.push(rings) + if (rings.length > 0) {polygons.push(rings)} } return polygons } function normalizeProvinceFeatures(json: unknown): ProvinceFeature[] { - if (!isRecord(json) || !Array.isArray(json.features)) return [] + if (!isRecord(json) || !Array.isArray(json.features)) {return []} const features: ProvinceFeature[] = [] for (const feature of json.features) { - if (!isRecord(feature) || !isRecord(feature.properties)) continue + if (!isRecord(feature) || !isRecord(feature.properties)) {continue} const name = feature.properties.name const adcode = feature.properties.adcode const center = toLatLngPair(feature.properties.center) - if (typeof name !== 'string' || !name || typeof adcode !== 'number' || !center) continue + if (typeof name !== 'string' || !name || typeof adcode !== 'number' || !center) {continue} const centroid = toLatLngPair(feature.properties.centroid) ?? center const polygons = normalizePolygons(feature.geometry) - if (polygons.length === 0) continue + if (polygons.length === 0) {continue} features.push({ name, adcode, @@ -154,11 +155,11 @@ function normalizeProvinceFeatures(json: unknown): ProvinceFeature[] { } export function loadProvinceGeometry(): ProvinceGeoDocument { - if (provinceGeometry) return provinceGeometry + if (provinceGeometry) {return provinceGeometry} try { const parsed: unknown = JSON.parse(readFileSync(provincesAssetPath, 'utf8')) const features = normalizeProvinceFeatures(parsed) - if (features.length === 0) throw new Error('省级行政区划数据为空') + if (features.length === 0) {throw new Error('省级行政区划数据为空')} provinceGeometry = { features } } catch (error) { throw error instanceof Error ? error : new Error(String(error)) diff --git a/src/main/ffmpeg.ts b/src/main/ffmpeg.ts index 1589da8..9a8a94e 100644 --- a/src/main/ffmpeg.ts +++ b/src/main/ffmpeg.ts @@ -13,13 +13,13 @@ function binaryPathFor(appPath: string, resourcesPath: string, packaged: boolean } function platformLabel(platform: string): string { - if (platform === 'win32') return 'Windows x64' - if (platform === 'linux') return 'Linux x64/arm64' + if (platform === 'win32') {return 'Windows x64'} + if (platform === 'linux') {return 'Linux x64/arm64'} return platform } export function assertOffscreenRecordingSupported(platform: string): void { - if (platform === 'win32' || platform === 'linux') return + if (platform === 'win32' || platform === 'linux') {return} throw new Error(`离屏视频录制目前提供 Windows x64 与 Linux x64/arm64 构建,当前平台 ${platform} 暂不支持录制`) } @@ -38,6 +38,6 @@ function missingEncoderMessage(binary: string, packaged: boolean, platform: stri export function resolveFfmpegBinary(appPath: string, resourcesPath: string, packaged: boolean, platform: string = process.platform): string { assertOffscreenRecordingSupported(platform) const binary = binaryPathFor(appPath, resourcesPath, packaged, platform) - if (!existsSync(binary)) throw new Error(missingEncoderMessage(binary, packaged, platform)) + if (!existsSync(binary)) {throw new Error(missingEncoderMessage(binary, packaged, platform))} return binary } diff --git a/src/main/geo.ts b/src/main/geo.ts index 7839c12..ab15aef 100644 --- a/src/main/geo.ts +++ b/src/main/geo.ts @@ -1,5 +1,5 @@ const coordinatePi = Math.PI -const coordinateAxis = 6378245 +const coordinateAxis = 6_378_245 const coordinateEccentricity = 0.006693421622965943 function outOfChina(longitude: number, latitude: number): boolean { @@ -23,7 +23,7 @@ function transformLongitude(x: number, y: number): number { } export function wgs84ToGcj02(longitude: number, latitude: number): [number, number] { - if (outOfChina(longitude, latitude)) return [longitude, latitude] + if (outOfChina(longitude, latitude)) {return [longitude, latitude]} const deltaLatitude = transformLatitude(longitude - 105, latitude - 35) const deltaLongitude = transformLongitude(longitude - 105, latitude - 35) const latitudeRadians = latitude / 180 * coordinatePi @@ -35,7 +35,7 @@ export function wgs84ToGcj02(longitude: number, latitude: number): [number, numb } export function gcj02ToWgs84(longitude: number, latitude: number): [number, number] { - if (outOfChina(longitude, latitude)) return [longitude, latitude] + if (outOfChina(longitude, latitude)) {return [longitude, latitude]} const [guessedLongitude, guessedLatitude] = wgs84ToGcj02(longitude, latitude) return [longitude * 2 - guessedLongitude, latitude * 2 - guessedLatitude] } @@ -61,12 +61,12 @@ export function tileCenter(level: number, x: number, y: number): [number, number const baiduMercatorBands = [75, 60, 45, 30, 15, 0] const baiduMercatorFactors = [ - [-0.0015702102444, 111320.7020616939, 1704480524535203, -10338987376042340, 26112667856603880, -35149669176653700, 26595700718403920, -10725012454188240, 1800819912950474, 82.5], - [0.0008277824516172526, 111320.7020463578, 647795574.6671607, -4082003173.6413164, 10774905661.35142, -15171875531.51559, 12052655338.62167, -5124939663.577472, 913311935.9512032, 67.5], - [0.00337398766765, 111320.7020202162, 4481351.045890365, -23393751.19931662, 79682215.47186455, -115964993.2797253, 97236711.15602145, -43661946.33352821, 8477230.501135234, 52.5], - [0.00220636496208, 111320.7020209128, 51751.86112841131, 3796837.749470245, 992013.7397791013, -1221952.21711287, 1340652.697009075, -620943.6990984312, 144416.9293806241, 37.5], - [-0.0003441963504368392, 111320.7020576856, 278.2353980772752, 2485758.690035394, 6070.750963243378, 54821.18345352118, 9540.606633304236, -2710.55326746643, 1405.483844121726, 22.5], - [-0.0003218135878613132, 111320.7020701615, 0.00369383431289, 823725.6402795718, 0.46104986909093, 2351.343141331292, 1.58060784298199, 8.77738589078284, 0.37238584252424, 7.45] + [-0.0015702102444, 111_320.7020616939, 1_704_480_524_535_203, -10_338_987_376_042_340, 26_112_667_856_603_880, -35_149_669_176_653_700, 26_595_700_718_403_920, -10_725_012_454_188_240, 1_800_819_912_950_474, 82.5], + [0.0008277824516172526, 111_320.7020463578, 647_795_574.6671607, -4_082_003_173.6413164, 10_774_905_661.35142, -15_171_875_531.51559, 12_052_655_338.62167, -5_124_939_663.577472, 913_311_935.9512032, 67.5], + [0.00337398766765, 111_320.7020202162, 4_481_351.045890365, -23_393_751.19931662, 79_682_215.47186455, -115_964_993.2797253, 97_236_711.15602145, -43_661_946.33352821, 8_477_230.501135234, 52.5], + [0.00220636496208, 111_320.7020209128, 51_751.86112841131, 3_796_837.749470245, 992_013.7397791013, -1_221_952.21711287, 1_340_652.697009075, -620_943.6990984312, 144_416.9293806241, 37.5], + [-0.0003441963504368392, 111_320.7020576856, 278.2353980772752, 2_485_758.690035394, 6070.750963243378, 54_821.18345352118, 9540.606633304236, -2710.55326746643, 1405.483844121726, 22.5], + [-0.0003218135878613132, 111_320.7020701615, 0.00369383431289, 823_725.6402795718, 0.46104986909093, 2351.343141331292, 1.58060784298199, 8.77738589078284, 0.37238584252424, 7.45] ] export function baiduLngLatToPoint(longitude: number, latitude: number): [number, number] { diff --git a/src/main/geo/gcj02.ts b/src/main/geo/gcj02.ts index 75a56e7..e00870f 100644 --- a/src/main/geo/gcj02.ts +++ b/src/main/geo/gcj02.ts @@ -1,4 +1,4 @@ -const GCJ_ELLIPSE_A = 6378245 +const GCJ_ELLIPSE_A = 6_378_245 const GCJ_ELLIPSE_EE = 0.00669342162296594323 const GCJ_MAGIC_LAT = 35 const GCJ_MAGIC_LON = 105 @@ -24,7 +24,7 @@ export function outsideChina(lon: number, lat: number): boolean { } export function wgs84ToGcj02(lon: number, lat: number): [number, number] { - if (outsideChina(lon, lat)) return [lon, lat] + if (outsideChina(lon, lat)) {return [lon, lat]} const dLat = offsetLat(lon - GCJ_MAGIC_LON, lat - GCJ_MAGIC_LAT) const dLon = offsetLon(lon - GCJ_MAGIC_LON, lat - GCJ_MAGIC_LAT) const radLat = (lat / 180) * Math.PI diff --git a/src/main/index.ts b/src/main/index.ts index 4a3443b..e7a7b94 100644 --- a/src/main/index.ts +++ b/src/main/index.ts @@ -23,12 +23,16 @@ import { } from '../common/tileMirror' import type { MirrorEndpointId, MirrorEndpointPreference, MirrorEndpointProbeResult, MirrorTileKind, TileMirrorMode, TileSource } from '../common/tileMirror' import { viirsCacheStyleId, viirsGranuleDate } from '../common/viirs' -import { describeTileFetchError, fetchTilePayloadWithRetry, isRetryableTileStatus, sanitizeTileUrlForLog, serveTileResponse, TILE_FETCH_TIMEOUT_MS, type FetchedTilePayload } from '../common/tileProtocol' +import { describeTileFetchError, fetchTilePayloadWithRetry, isRetryableTileStatus, sanitizeTileUrlForLog, serveTileResponse, TILE_FETCH_TIMEOUT_MS } from '../common/tileProtocol'; +import type { FetchedTilePayload } from '../common/tileProtocol'; import { THEMATIC_LAYER_ID_SET } from '../common/thematicLayers' import { TERRAIN_PROVIDER_ID_SET } from '../common/terrainProviders' -import { isTouchInteractionMode, normalizeTouchInteractionMode, type TouchInteractionMode } from '../common/touchInteraction' -import { isThemeMode, normalizeThemeMode, type ThemeMode } from '../common/themeMode' -import { ENSO_PHASE_SET, HSR_END_YEAR, HSR_START_YEAR, SEA_LEVEL_SCENARIOS, type EnsoPhase } from '../common/thematicState' +import { isTouchInteractionMode, normalizeTouchInteractionMode } from '../common/touchInteraction'; +import type { TouchInteractionMode } from '../common/touchInteraction'; +import { isThemeMode, normalizeThemeMode } from '../common/themeMode'; +import type { ThemeMode } from '../common/themeMode'; +import { ENSO_PHASE_SET, HSR_END_YEAR, HSR_START_YEAR, SEA_LEVEL_SCENARIOS } from '../common/thematicState'; +import type { EnsoPhase } from '../common/thematicState'; import { DEFAULT_PRIVACY_SETTINGS, resolvePrivacySettings } from '../common/privacy' attachConsoleLogTee('main') @@ -43,7 +47,7 @@ function readInitialErrorReportingEnabled(): boolean { return resolvePrivacySettings(parsed as Record).errorReportingEnabled } catch (error) { const code = (error as NodeJS.ErrnoException | null)?.code - if (code === 'ENOENT') return DEFAULT_PRIVACY_SETTINGS.errorReportingEnabled + if (code === 'ENOENT') {return DEFAULT_PRIVACY_SETTINGS.errorReportingEnabled} return false } } @@ -56,25 +60,26 @@ Sentry.init({ enabled: errorReportingEnabled, sendClientReports: false, beforeSend(event) { - if (!errorReportingEnabled) return null + if (!errorReportingEnabled) {return null} event.extra = { ...event.extra, mainProcessLogs: logger.dump(80) } return event } }) -import { execFileSync, spawn } from 'child_process' -import { readFileSync, rmSync } from 'fs' -import { dirname, join } from 'path' +import { execFileSync, spawn } from 'node:child_process' +import { readFileSync, rmSync } from 'node:fs' +import { dirname, join } from 'node:path' import { flushJsonWrites, readJson, serialQueue, writeAtomic, writeJson } from './jsonStore' import { listTileFiles, pruneTileFiles } from './tileCacheFiles' import { storageChildPath } from './storagePath' -import { access, constants, mkdtemp, mkdir, readFile, readdir, rename as renameFile, stat, rm, writeFile } from 'fs/promises' -import { createHash, randomUUID } from 'crypto' +import { access, constants, mkdtemp, mkdir, readFile, readdir, rename as renameFile, stat, rm, writeFile } from 'node:fs/promises' +import { createHash, randomUUID } from 'node:crypto' import icon from '../../resources/icon.png?asset' import type { AnnotationDocument, AnnotationEntry, GeoPosition, GuEarthSettings, GuEarthSettingsPatch, NetworkProxyTestResult, OffscreenRecordingProbeResult, OffscreenRecordingScript, PlaceSearchProvider, ProviderCredentialStatus, RecordingSaveResult, SceneCamera, SceneDocument, SceneSnapshot, SceneSimTime, StoredShape, TeachingScene, TileCacheEntry, TileCacheStats, TileKey, TileMirrorStatus, WindowControlsState } from '../preload' import { assertOffscreenRecordingSupported, offscreenVideoEncoderArgs, resolveFfmpegBinary } from './ffmpeg' import { resolveOffscreenEntry } from './offscreenPaths' import { offscreenCaptureSize, offscreenConcatPlaylist, offscreenFrameDurations, offscreenFrameRate, offscreenScriptDurationMs } from './offscreenTiming' -import { deliverMacOffscreenVideo, deliverMacOffscreenVideoComplete, encodeMacOffscreenRecording, noteMacOffscreenFrameAck, type OffscreenMacSessionHost } from './offscreenMac' +import { deliverMacOffscreenVideo, deliverMacOffscreenVideoComplete, encodeMacOffscreenRecording, noteMacOffscreenFrameAck } from './offscreenMac'; +import type { OffscreenMacSessionHost } from './offscreenMac'; import { assertEncryptionAvailable, assertSafeId, clearProviderKey, hasProviderKey, initKeyVault, readProviderKey, writeProviderKey } from './keyVault' import { baiduLngLatToTile, tileCenter, wgs84ToBd09 } from './geo' import { AiSettingsStore } from './ai/settingsStore' @@ -189,12 +194,12 @@ const safeId = assertSafeId async function readSettings(): Promise { try { const parsed: unknown = await readJson(settingsPath) - if (!isRecord(parsed)) return { ...defaultSettings, providerCredentials: {} } + if (!isRecord(parsed)) {return { ...defaultSettings, providerCredentials: {} }} const credentials = isRecord(parsed.providerCredentials) ? parsed.providerCredentials : {} const providerCredentials: Record = {} for (const [providerId, value] of Object.entries(credentials)) { - if (!/^[a-z0-9][a-z0-9_-]{0,63}$/i.test(providerId)) continue - if (!isRecord(value)) continue + if (!/^[a-z0-9][a-z0-9_-]{0,63}$/i.test(providerId)) {continue} + if (!isRecord(value)) {continue} providerCredentials[providerId] = { configured: value.configured === true, updatedAt: typeof value.updatedAt === 'number' ? value.updatedAt : null @@ -203,7 +208,7 @@ async function readSettings(): Promise { const providerStyles = isRecord(parsed.providerStyles) ? parsed.providerStyles : {} const normalizedStyles: Record = { ...defaultSettings.providerStyles } for (const [providerId, styleId] of Object.entries(providerStyles)) { - if (/^[a-z0-9][a-z0-9_-]{0,63}$/i.test(providerId) && typeof styleId === 'string' && /^[a-z0-9][a-z0-9_-]{0,63}$/i.test(styleId)) normalizedStyles[providerId] = styleId + if (/^[a-z0-9][a-z0-9_-]{0,63}$/i.test(providerId) && typeof styleId === 'string' && /^[a-z0-9][a-z0-9_-]{0,63}$/i.test(styleId)) {normalizedStyles[providerId] = styleId} } const legacyTerrain = parsed.terrainExaggeration === undefined const storedTerrainProviderId = typeof parsed.selectedTerrainProviderId === 'string' ? parsed.selectedTerrainProviderId : defaultSettings.selectedTerrainProviderId @@ -247,8 +252,8 @@ function saveSettings(update: (current: PersistedSettings) => PersistedSettings) } function proxyConfig(proxy: string): Parameters[0] { - if (proxy === '') return { mode: 'system' } - if (proxy === 'direct') return { mode: 'direct' } + if (proxy === '') {return { mode: 'system' }} + if (proxy === 'direct') {return { mode: 'direct' }} return { mode: 'fixed_servers', proxyRules: proxy, proxyBypassRules: '' } } @@ -263,16 +268,16 @@ async function applyNetworkProxy(): Promise { function credentialStatus(providerId: string): ProviderCredentialStatus { const configured = hasProviderKey(providerId) const saved = settings.providerCredentials[providerId] - if (!configured) return { configured: false, updatedAt: saved?.updatedAt ?? null } + if (!configured) {return { configured: false, updatedAt: saved?.updatedAt ?? null }} return { configured: true, updatedAt: saved?.updatedAt ?? null } } async function usableRecordingDirectory(): Promise { const directory = settings.recordingDirectory - if (!directory) return null + if (!directory) {return null} try { const info = await stat(directory) - if (!info.isDirectory()) return null + if (!info.isDirectory()) {return null} await access(directory, constants.W_OK) return directory } catch { @@ -297,12 +302,12 @@ function applyPrivacySettings(current: PersistedSettings): void { function settingsSnapshot(): GuEarthSettings { const providerCredentials: Record = {} const providerIds = new Set([...Object.keys(settings.providerCredentials), 'amap', 'baidu']) - for (const providerId of providerIds) providerCredentials[providerId] = credentialStatus(providerId) + for (const providerId of providerIds) {providerCredentials[providerId] = credentialStatus(providerId)} return { ...settings, providerCredentials } } function pathPart(value: number): string { - if (!Number.isInteger(value)) throw new Error('无效的瓦片坐标') + if (!Number.isInteger(value)) {throw new Error('无效的瓦片坐标')} return value < 0 ? `n${Math.abs(value)}` : String(value) } @@ -328,9 +333,9 @@ async function readTile(key: TileKey, allowExpired = false): Promise { - if (!settings.tileCacheEnabled) return null + if (!settings.tileCacheEnabled) {return null} const cached = await readTile(key, allowExpired) - if (!cached) return null + if (!cached) {return null} const expired = cached.expiresAt !== null && cached.expiresAt <= Date.now() return new Response(cached.data, { headers: { 'content-type': cached.contentType, 'x-guearth-cache': expired ? 'stale' : 'hit' } }) } @@ -349,9 +354,9 @@ let tilePruneAt = 0 let tilePrunePromise: Promise | undefined async function enforceTileCacheLimit(): Promise { - if (tilePrunePromise) return tilePrunePromise + if (tilePrunePromise) {return tilePrunePromise} const now = Date.now() - if (now - tilePruneAt < TILE_CACHE_PRUNE_INTERVAL_MS) return + if (now - tilePruneAt < TILE_CACHE_PRUNE_INTERVAL_MS) {return} tilePruneAt = now tilePrunePromise = (async () => { await pruneTileFiles(tileCachePath, TILE_CACHE_MAX_BYTES) @@ -365,7 +370,7 @@ const enqueueTileMutation = serialQueue() let quitting = false function writeTile(entry: TileCacheEntry): Promise { - if (quitting) return Promise.resolve() + if (quitting) {return Promise.resolve()} return enqueueTileMutation(async () => { const key: TileKey = { providerId: entry.providerId, styleId: entry.styleId, level: entry.level, x: entry.x, y: entry.y } const basePath = tileBasePath(key) @@ -373,7 +378,7 @@ function writeTile(entry: TileCacheEntry): Promise { await mkdir(dirname(basePath), { recursive: true }) await writeAtomic(`${basePath}.bin`, Buffer.from(entry.data)) await writeJson(`${basePath}.json`, { contentType: entry.contentType, expiresAt: entry.expiresAt }) - void enqueueTileMutation(enforceTileCacheLimit).catch(() => undefined) + void enqueueTileMutation(enforceTileCacheLimit).catch(() => {}) } catch { void 0 } @@ -383,7 +388,7 @@ function writeTile(entry: TileCacheEntry): Promise { async function cacheStats(): Promise { const files = await listTileFiles(tileCachePath) return files.reduce((result, file) => { - if (file.path.endsWith('.bin')) result.files += 1 + if (file.path.endsWith('.bin')) {result.files += 1} result.bytes += file.size return result }, { files: 0, bytes: 0 }) @@ -395,28 +400,28 @@ function computeBaiduSn(path: string, queryString: string, sk: string): string { } function tileRemoteUrl(providerId: string, styleId: string, level: number, x: number, y: number, granuleDate?: string): string | undefined { - if (providerId === 'osm') return `https://tile.openstreetmap.org/${level}/${x}/${y}.png` + if (providerId === 'osm') {return `https://tile.openstreetmap.org/${level}/${x}/${y}.png`} if (providerId === 'viirs-night') { - if (level > 8) return undefined + if (level > 8) {return undefined} return `https://gibs.earthdata.nasa.gov/wmts/epsg3857/best/VIIRS_SNPP_DayNightBand_AtSensor_M15/default/${granuleDate ?? viirsGranuleDate()}/GoogleMapsCompatible_Level8/${level}/${y}/${x}.jpeg` } - if (providerId === 'esri-imagery') return `https://services.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer/tile/${level}/${y}/${x}` - if (providerId === 'opentopomap') return `https://${['a', 'b', 'c'][((x % 3) + 3) % 3]}.tile.opentopomap.org/${level}/${x}/${y}.png` + if (providerId === 'esri-imagery') {return `https://services.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer/tile/${level}/${y}/${x}`} + if (providerId === 'opentopomap') {return `https://${['a', 'b', 'c'][((x % 3) + 3) % 3]}.tile.opentopomap.org/${level}/${x}/${y}.png`} if (providerId === 'baidu') { const key = readProviderKey(providerId) - if (!key) return undefined + if (!key) {return undefined} const subdomain = String(((x % 4) + 4) % 4) const [translatedX, translatedY] = baiduLngLatToTile(level, ...wgs84ToBd09(...tileCenter(level, x, y))) const ak = key const sk = readProviderKey(`${providerId}-sk`) if (styleId === 'satellite') { const baseQueryString = `qt=satepc&x=${translatedX}&y=${translatedY}&z=${level}&udt=20230101&ak=${encodeURIComponent(ak)}` - if (!sk) return `https://maponline${subdomain}.bdimg.com/tile/?${baseQueryString}` + if (!sk) {return `https://maponline${subdomain}.bdimg.com/tile/?${baseQueryString}`} const sn = computeBaiduSn('/tile/', baseQueryString, sk) return `https://maponline${subdomain}.bdimg.com/tile/?${baseQueryString}&sn=${sn}` } const baseQueryString = `x=${translatedX}&y=${translatedY}&z=${level}&ak=${encodeURIComponent(ak)}` - if (!sk) return `https://online${subdomain}.map.bdimg.com/onlinelabel/?qt=tile&${baseQueryString}&styles=pl&scaler=1&udt=20230101` + if (!sk) {return `https://online${subdomain}.map.bdimg.com/onlinelabel/?qt=tile&${baseQueryString}&styles=pl&scaler=1&udt=20230101`} const pathWithQuery = `/onlinelabel/?qt=tile&${baseQueryString}&styles=pl&scaler=1&udt=20230101` const sn = computeBaiduSn('/onlinelabel/', `qt=tile&${baseQueryString}&styles=pl&scaler=1&udt=20230101`, sk) return `https://online${subdomain}.map.bdimg.com${pathWithQuery}&sn=${sn}` @@ -428,13 +433,13 @@ const TILE_FETCH_HEADERS = { 'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36', 'Accept': 'image/webp,image/apng,image/*,*/*;q=0.8' } -const TILE_ERROR_LOG_INTERVAL_MS = 5_000 +const TILE_ERROR_LOG_INTERVAL_MS = 5000 const tileErrorLogTimestamps = new Map() function shouldLogTileFailure(key: string): boolean { const now = Date.now() const last = tileErrorLogTimestamps.get(key) ?? 0 - if (now - last < TILE_ERROR_LOG_INTERVAL_MS) return false + if (now - last < TILE_ERROR_LOG_INTERVAL_MS) {return false} tileErrorLogTimestamps.set(key, now) return true } @@ -454,7 +459,7 @@ const mirrorEndpointManager = new MirrorEndpointManager() const MIRROR_PROBE_TIMEOUT_MS = 4000 const MIRROR_PROBE_INTERVAL_MS = 10 * 60 * 1000 -const STARTUP_MIRROR_PROBE_BUDGET_MS = 1_500 +const STARTUP_MIRROR_PROBE_BUDGET_MS = 1500 let mirrorEndpointProbing = false let mirrorEndpointProbeSeq = 0 @@ -472,13 +477,13 @@ function scheduleMirrorFallbackExpirySync(): void { mirrorFallbackExpiryTimer = undefined } const nextExpiryAt = tileMirrorRouter.nextMirrorFallbackExpiryAt() - if (nextExpiryAt === null) return + if (nextExpiryAt === null) {return} const delayMs = Math.max(1, nextExpiryAt - Date.now() + 20) mirrorFallbackExpiryTimer = setTimeout(() => { mirrorFallbackExpiryTimer = undefined const activeFallbacks = new Set(tileMirrorRouter.fallenBackProviders(mirrorEligibleProviderIds())) for (const providerId of [...mirrorFallenBackProviders]) { - if (!activeFallbacks.has(providerId)) mirrorFallenBackProviders.delete(providerId) + if (!activeFallbacks.has(providerId)) {mirrorFallenBackProviders.delete(providerId)} } broadcastMirrorStatus('') scheduleMirrorFallbackExpirySync() @@ -543,7 +548,7 @@ async function probeSingleMirrorEndpoint(endpoint: MirrorEndpointId): Promise undefined) + void response.body?.cancel().catch(() => {}) return { endpoint, ok: false, latencyMs: null, error: `HTTP ${response.status}`, checkedAt: startedAt } } const buffer = await response.arrayBuffer() @@ -560,7 +565,7 @@ async function probeMirrorEndpoints( reason: 'startup' | 'settings' | 'network' | 'manual', onFirstReachable?: () => void ): Promise { - if (reason !== 'manual' && (settings.tileMirrorMode !== 'on' || settings.tileMirrorSource !== 'auto')) return + if (reason !== 'manual' && (settings.tileMirrorMode !== 'on' || settings.tileMirrorSource !== 'auto')) {return} const seq = ++mirrorEndpointProbeSeq mirrorEndpointProbing = true broadcastMirrorStatus('') @@ -568,7 +573,7 @@ async function probeMirrorEndpoints( const roundProbes: MirrorEndpointProbeResult[] = [] const probePromises = mirrorEndpointIds.map((endpoint) => probeSingleMirrorEndpoint(endpoint).then((result) => { - if (seq !== mirrorEndpointProbeSeq) return result + if (seq !== mirrorEndpointProbeSeq) {return result} roundProbes.push(result) const outcome = mirrorEndpointManager.applyProbeResult(result, roundProbes) if (outcome.changed) { @@ -588,7 +593,7 @@ async function probeMirrorEndpoints( }) ) const results = await Promise.all(probePromises) - if (seq !== mirrorEndpointProbeSeq) return + if (seq !== mirrorEndpointProbeSeq) {return} mirrorEndpointProbing = false logger.info( 'tiles', @@ -604,12 +609,12 @@ async function clearProviderTileCache(providerId: string): Promise { } async function clearMirrorProviderTileCaches(): Promise { - for (const providerId of mirrorEligibleProviderIds()) await clearProviderTileCache(providerId) + for (const providerId of mirrorEligibleProviderIds()) {await clearProviderTileCache(providerId)} } function mirrorRouteNotice(previous: readonly string[], next: readonly string[]): string { - if (next.length === 0) return '已恢复直连原地图源' - if (previous.length === 0) return '已自动切换到国内加速地图源' + if (next.length === 0) {return '已恢复直连原地图源'} + if (previous.length === 0) {return '已自动切换到国内加速地图源'} return `已自动优化 ${next.length} 个地图源的网络线路` } @@ -620,8 +625,8 @@ function mirrorFallbackNotice(): string { } function mirrorModeNotice(mode: TileMirrorMode): string { - if (mode === 'off') return '国内地图加速已关闭' - if (mode === 'on') return '国内地图加速已开启' + if (mode === 'off') {return '国内地图加速已关闭'} + if (mode === 'on') {return '国内地图加速已开启'} return '国内地图加速已设为自动' } @@ -633,13 +638,13 @@ function notifyMirrorRouteChange(previous: readonly string[]): void { function originProbeUrl(providerId: string): string | undefined { const styleId = settings.providerStyles[providerId] ?? 'standard' const url = tileRemoteUrl(providerId, styleId, 0, 0, 0) - if (!url) return undefined + if (!url) {return undefined} return `${url}${url.includes('?') ? '&' : '?'}guearth-probe=${Date.now()}` } async function probeOriginProvider(providerId: string): Promise { const url = originProbeUrl(providerId) - if (!url) return null + if (!url) {return null} try { const response = await net.fetch(url, { headers: TILE_FETCH_HEADERS, signal: AbortSignal.timeout(MIRROR_PROBE_TIMEOUT_MS) }) await response.arrayBuffer() @@ -654,7 +659,7 @@ let mirrorProbeQueued = false let mirrorProbeTimer: NodeJS.Timeout | undefined async function refreshMirrorRoutes(reason: 'startup' | 'settings' | 'probe' | 'network'): Promise { - if (settings.tileMirrorMode !== 'auto') return + if (settings.tileMirrorMode !== 'auto') {return} if (mirrorProbePromise) { mirrorProbeQueued = true return mirrorProbePromise @@ -663,17 +668,17 @@ async function refreshMirrorRoutes(reason: 'startup' | 'settings' | 'probe' | 'n const previous = tileMirrorRouter.mirroredProviders(mirrorEligibleProviderIds()) const probes = await Promise.all(mirrorEligibleProviderIds().map(async (providerId) => [providerId, await probeOriginProvider(providerId)] as const)) for (const [providerId, reachable] of probes) { - if (reachable === null) continue + if (reachable === null) {continue} tileMirrorRouter.noteProbeResult(providerId, reachable) } - if (settings.tileMirrorMode !== 'auto') return + if (settings.tileMirrorMode !== 'auto') {return} const next = tileMirrorRouter.mirroredProviders(mirrorEligibleProviderIds()) - if (previous.join(',') === next.join(',')) return + if (previous.join(',') === next.join(',')) {return} logger.info('tiles', `网络环境检测(${reason})完成,镜像瓦片源:${next.join('、') || '未启用'}`) notifyMirrorRouteChange(previous) })().finally(() => { mirrorProbePromise = undefined - if (!mirrorProbeQueued) return + if (!mirrorProbeQueued) {return} mirrorProbeQueued = false void refreshMirrorRoutes(reason) }) @@ -681,12 +686,12 @@ async function refreshMirrorRoutes(reason: 'startup' | 'settings' | 'probe' | 'n } function scheduleMirrorRefresh(reason: 'startup' | 'settings' | 'probe' | 'network'): void { - if (settings.tileMirrorMode !== 'auto') return + if (settings.tileMirrorMode !== 'auto') {return} void refreshMirrorRoutes(reason) } function startMirrorProbeTimer(): void { - if (mirrorProbeTimer) return + if (mirrorProbeTimer) {return} mirrorProbeTimer = setInterval(() => scheduleMirrorRefresh('probe'), MIRROR_PROBE_INTERVAL_MS) mirrorProbeTimer.unref() } @@ -703,15 +708,15 @@ async function mirrorTileResponse( endpoint: MirrorEndpointId ): Promise { const url = mirrorTileUrl(providerId, key.level, key.x, key.y, granuleDate, endpoint) - if (!url) return { failure: 'coverage' } + if (!url) {return { failure: 'coverage' }} try { const payload = await fetchTilePayload(url) if (!payload.ok || !payload.data) { - if (isMirrorCoverageNotFound(payload.status, payload.headers)) return { failure: 'coverage' } + if (isMirrorCoverageNotFound(payload.status, payload.headers)) {return { failure: 'coverage' }} return { failure: 'network', detail: `HTTP ${payload.status} ${describeTileTarget(key, url)}` } } const contentType = payload.headers.get('content-type') ?? (providerId === 'viirs-night' ? 'image/jpeg' : 'image/png') - if (settings.tileCacheEnabled) void writeTile({ ...key, data: payload.data, contentType, expiresAt: Date.now() + TILE_TTL_MS }) + if (settings.tileCacheEnabled) {void writeTile({ ...key, data: payload.data, contentType, expiresAt: Date.now() + TILE_TTL_MS })} return { response: new Response(payload.data, { headers: { 'content-type': contentType, 'x-guearth-cache': 'miss', 'x-guearth-mirror': endpoint } }) } } catch (error) { return { failure: 'network', detail: `${describeTileFetchError(error)} ${describeTileTarget(key, url)}` } @@ -749,7 +754,7 @@ async function serveMirrorTile( } return outcome.response } - if (outcome.failure !== 'network') return null + if (outcome.failure !== 'network') {return null} if ( routeGeneration !== mirrorRouteGeneration || modeGeneration !== tileMirrorRouter.currentModeGeneration() @@ -785,7 +790,7 @@ async function serveMirrorTile( return null } if (tileMirrorRouter.commitMirrorFallback(providerId, modeGeneration)) { - if (settings.tileMirrorMode === 'on') mirrorFallenBackProviders.add(providerId) + if (settings.tileMirrorMode === 'on') {mirrorFallenBackProviders.add(providerId)} scheduleMirrorFallbackExpirySync() logger.warn('tiles', `镜像瓦片源(${mirrorEndpointLabel(endpoint)})连续失败,${providerId} 已临时回退到原影像源`, outcome.detail) broadcastMirrorStatus(mirrorFallbackNotice()) @@ -804,28 +809,28 @@ async function serveOriginTile(providerId: string, key: TileKey, remoteUrl: stri const payload = await fetchTilePayload(remoteUrl) if (payload.ok && payload.data) { const contentType = payload.headers.get('content-type') ?? 'image/png' - if (settings.tileCacheEnabled) void writeTile({ ...key, data: payload.data, contentType, expiresAt: Date.now() + TILE_TTL_MS }) - if (tileMirrorRouter.noteOriginSuccess(providerId)) notifyMirrorRouteChange(previous) + if (settings.tileCacheEnabled) {void writeTile({ ...key, data: payload.data, contentType, expiresAt: Date.now() + TILE_TTL_MS })} + if (tileMirrorRouter.noteOriginSuccess(providerId)) {notifyMirrorRouteChange(previous)} return new Response(payload.data, { headers: { 'content-type': contentType, 'x-guearth-cache': 'miss' } }) } if (shouldLogTileFailure(`origin:${providerId}`)) { logger.warn('tiles', `原影像瓦片请求失败,${providerId}`, `HTTP ${payload.status} ${describeTileTarget(key, remoteUrl)}`) } if (isRetryableTileStatus(payload.status)) { - if (tileMirrorRouter.noteOriginFailure(providerId)) notifyMirrorRouteChange(previous) + if (tileMirrorRouter.noteOriginFailure(providerId)) {notifyMirrorRouteChange(previous)} const stale = await cachedTileResponse(key, true) - if (stale) return stale + if (stale) {return stale} } else { - if (tileMirrorRouter.noteOriginSuccess(providerId)) notifyMirrorRouteChange(previous) + if (tileMirrorRouter.noteOriginSuccess(providerId)) {notifyMirrorRouteChange(previous)} } return new Response(`Tile request failed: ${payload.status}`, { status: payload.status }) } catch (error) { if (shouldLogTileFailure(`origin:${providerId}`)) { logger.warn('tiles', `原影像瓦片请求异常,${providerId}`, `${describeTileFetchError(error)} ${describeTileTarget(key, remoteUrl)}`) } - if (tileMirrorRouter.noteOriginFailure(providerId)) notifyMirrorRouteChange(previous) + if (tileMirrorRouter.noteOriginFailure(providerId)) {notifyMirrorRouteChange(previous)} const stale = await cachedTileResponse(key, true) - if (stale) return stale + if (stale) {return stale} return new Response('Tile unavailable', { status: 502 }) } } @@ -834,9 +839,9 @@ async function handleTileProtocol(request: Request): Promise { const parsed = new URL(request.url) const providerId = safeId(parsed.hostname) const parts = parsed.pathname.split('/').filter(Boolean) - if (parts.length !== 4) return new Response('Bad tile path', { status: 400 }) + if (parts.length !== 4) {return new Response('Bad tile path', { status: 400 })} const coordinates = parts.slice(1).map(Number) - if (!Number.isInteger(coordinates[0]) || coordinates[0] < 0 || !Number.isInteger(coordinates[1]) || !Number.isInteger(coordinates[2])) return new Response('Bad tile path', { status: 400 }) + if (!Number.isInteger(coordinates[0]) || coordinates[0] < 0 || !Number.isInteger(coordinates[1]) || !Number.isInteger(coordinates[2])) {return new Response('Bad tile path', { status: 400 })} const [level, x, y] = coordinates const granuleDate = viirsGranuleDate() const requestStyleId = providerId === 'viirs-night' ? viirsCacheStyleId(safeId(parts[0]), granuleDate) : safeId(parts[0]) @@ -849,31 +854,31 @@ async function handleTileProtocol(request: Request): Promise { const mirrored = Boolean(kind) && Boolean(mirrorTileUrl(providerId, level, x, y, granuleDate, endpoint)) && mirrorSource(providerId) === 'mirror' const key = mirrored ? mirrorKey : originKey const cached = await cachedTileResponse(key, false) - if (cached) return cached + if (cached) {return cached} const remoteUrl = tileRemoteUrl(providerId, requestStyleId, level, x, y, granuleDate) - if (!remoteUrl) return new Response('Unknown provider', { status: 404 }) + if (!remoteUrl) {return new Response('Unknown provider', { status: 404 })} if (kind && mirrored) { const mirror = await serveMirrorTile(providerId, kind, mirrorKey, granuleDate, modeGeneration, routeGeneration, endpoint) - if (mirror) return mirror + if (mirror) {return mirror} } return serveOriginTile(providerId, originKey, remoteUrl) } function normalizeShape(value: unknown): StoredShape { - if (!isRecord(value)) throw new Error('无效的标注数据') + if (!isRecord(value)) {throw new Error('无效的标注数据')} const id = safeId(value.id) - if (value.kind !== 'point' && value.kind !== 'polyline' && value.kind !== 'polygon' && value.kind !== 'arrow' && value.kind !== 'text') throw new Error('无效的标注类型') - if (!Array.isArray(value.positions)) throw new Error('无效的标注坐标') + if (value.kind !== 'point' && value.kind !== 'polyline' && value.kind !== 'polygon' && value.kind !== 'arrow' && value.kind !== 'text') {throw new Error('无效的标注类型')} + if (!Array.isArray(value.positions)) {throw new Error('无效的标注坐标')} const positions: GeoPosition[] = value.positions.map((item) => { - if (!isRecord(item)) throw new Error('无效的标注坐标') + if (!isRecord(item)) {throw new Error('无效的标注坐标')} const { longitude, latitude, height } = item - if (typeof longitude !== 'number' || !Number.isFinite(longitude) || longitude < -180 || longitude > 180) throw new Error('无效的标注坐标') - if (typeof latitude !== 'number' || !Number.isFinite(latitude) || latitude < -90 || latitude > 90) throw new Error('无效的标注坐标') - if (typeof height !== 'number' || !Number.isFinite(height) || height < -11000 || height > 20000) throw new Error('无效的标注坐标') + if (typeof longitude !== 'number' || !Number.isFinite(longitude) || longitude < -180 || longitude > 180) {throw new Error('无效的标注坐标')} + if (typeof latitude !== 'number' || !Number.isFinite(latitude) || latitude < -90 || latitude > 90) {throw new Error('无效的标注坐标')} + if (typeof height !== 'number' || !Number.isFinite(height) || height < -11_000 || height > 20_000) {throw new Error('无效的标注坐标')} return { longitude, latitude, height } }) const minimum = value.kind === 'point' || value.kind === 'text' ? 1 : value.kind === 'polygon' ? 3 : 2 - if (positions.length < minimum || positions.length > 500) throw new Error('无效的标注坐标') + if (positions.length < minimum || positions.length > 500) {throw new Error('无效的标注坐标')} const validColor = (color: unknown, fallback: string): string => typeof color === 'string' && /^#[\da-f]{6}$/i.test(color) ? color.toLowerCase() : fallback const fontFamily = typeof value.fontFamily === 'string' && value.fontFamily.length <= 128 && /^[\p{L}\p{N} .,'()&_\-]+$/u.test(value.fontFamily) ? value.fontFamily : 'Arial' const fontSize = typeof value.fontSize === 'number' && Number.isFinite(value.fontSize) ? Math.min(72, Math.max(8, value.fontSize)) : 13 @@ -894,39 +899,39 @@ function normalizeShape(value: unknown): StoredShape { } function normalizeAnnotations(value: unknown): AnnotationDocument { - if (!isRecord(value) || !Array.isArray(value.shapes) || !Array.isArray(value.entries)) throw new Error('无效的标注目录') + if (!isRecord(value) || !Array.isArray(value.shapes) || !Array.isArray(value.entries)) {throw new Error('无效的标注目录')} const shapes = value.shapes.map(normalizeShape) const shapeIds = new Set(shapes.map((shape) => shape.id)) - if (shapeIds.size !== shapes.length) throw new Error('重复的标注') + if (shapeIds.size !== shapes.length) {throw new Error('重复的标注')} const referenced = new Set() const folderIds = new Set() function normalizeEntries(items: unknown[], depth: number): AnnotationEntry[] { - if (items.length > 10000) throw new Error('标注目录过大') + if (items.length > 10_000) {throw new Error('标注目录过大')} return items.map((item) => { - if (!isRecord(item)) throw new Error('无效的目录项') + if (!isRecord(item)) {throw new Error('无效的目录项')} const id = safeId(item.id) if (item.type === 'shape') { - if (!shapeIds.has(id) || referenced.has(id)) throw new Error('无效的标注引用') + if (!shapeIds.has(id) || referenced.has(id)) {throw new Error('无效的标注引用')} referenced.add(id) return { type: 'shape', id } } - if (item.type !== 'folder' || depth > 5 || !Array.isArray(item.children) || typeof item.name !== 'string') throw new Error('无效的文件夹') - if (folderIds.has(id) || shapeIds.has(id)) throw new Error('重复的文件夹') + if (item.type !== 'folder' || depth > 5 || !Array.isArray(item.children) || typeof item.name !== 'string') {throw new Error('无效的文件夹')} + if (folderIds.has(id) || shapeIds.has(id)) {throw new Error('重复的文件夹')} folderIds.add(id) const name = item.name.trim().slice(0, 80) - if (!name) throw new Error('文件夹名称不能为空') + if (!name) {throw new Error('文件夹名称不能为空')} return { type: 'folder', id, name, children: normalizeEntries(item.children, depth + 1) } }) } const entries = normalizeEntries(value.entries, 1) - if (referenced.size !== shapeIds.size) throw new Error('缺少标注引用') + if (referenced.size !== shapeIds.size) {throw new Error('缺少标注引用')} return { shapes, entries } } async function readAnnotations(): Promise { try { const parsed: unknown = await readJson(annotationsPath) - if (!Array.isArray(parsed)) return normalizeAnnotations(parsed) + if (!Array.isArray(parsed)) {return normalizeAnnotations(parsed)} const shapes = parsed.flatMap((item) => { try { return [normalizeShape(item)] @@ -956,21 +961,21 @@ function normalizeNumber(value: unknown, min: number, max: number, fallback: num } function normalizeSceneCamera(value: unknown): SceneCamera { - if (!isRecord(value)) throw new Error('无效的场景视角') + if (!isRecord(value)) {throw new Error('无效的场景视角')} const longitude = Number(value.longitude) const latitude = Number(value.latitude) const height = Number(value.height) - if (!Number.isFinite(longitude) || longitude < -180 || longitude > 180) throw new Error('无效的场景视角') - if (!Number.isFinite(latitude) || latitude < -90 || latitude > 90) throw new Error('无效的场景视角') - if (!Number.isFinite(height) || height <= 0 || height > 20000000) throw new Error('无效的场景视角') + if (!Number.isFinite(longitude) || longitude < -180 || longitude > 180) {throw new Error('无效的场景视角')} + if (!Number.isFinite(latitude) || latitude < -90 || latitude > 90) {throw new Error('无效的场景视角')} + if (!Number.isFinite(height) || height <= 0 || height > 20_000_000) {throw new Error('无效的场景视角')} const heading = normalizeNumber(value.heading, -360, 360, 0) const pitch = normalizeNumber(value.pitch, -90, 90, -90) return { longitude, latitude, height, heading, pitch } } function normalizeSceneSimTime(value: unknown): SceneSimTime | null { - if (value === null || value === undefined) return null - if (!isRecord(value) || typeof value.date !== 'string' || !/^\d{4}-\d{2}-\d{2}$/.test(value.date)) throw new Error('无效的模拟时间') + if (value === null || value === undefined) {return null} + if (!isRecord(value) || typeof value.date !== 'string' || !/^\d{4}-\d{2}-\d{2}$/.test(value.date)) {throw new Error('无效的模拟时间')} return { date: value.date, hour: normalizeNumber(value.hour, 0, 24, 12) } } @@ -990,7 +995,7 @@ function normalizeStyleId(value: unknown): string | undefined { } function normalizeSceneSnapshot(value: unknown): SceneSnapshot { - if (!isRecord(value)) throw new Error('无效的场景快照') + if (!isRecord(value)) {throw new Error('无效的场景快照')} const overlays = Array.isArray(value.overlays) ? [...new Set(value.overlays.filter((item): item is string => typeof item === 'string' && THEMATIC_LAYER_ID_SET.has(item)))] : [] @@ -1010,26 +1015,26 @@ function normalizeSceneSnapshot(value: unknown): SceneSnapshot { } function normalizeTeachingScene(value: unknown): TeachingScene { - if (!isRecord(value)) throw new Error('无效的教学场景') + if (!isRecord(value)) {throw new Error('无效的教学场景')} const id = safeId(value.id) const name = typeof value.name === 'string' ? value.name.trim().slice(0, 80) : '' - if (!name) throw new Error('场景名称不能为空') + if (!name) {throw new Error('场景名称不能为空')} return { id, name, narration: typeof value.narration === 'string' ? value.narration.slice(0, 500) : '', - dwellMs: Math.round(normalizeNumber(value.dwellMs, 1000, 60000, 6000)), - flyDurationMs: Math.round(normalizeNumber(value.flyDurationMs, 500, 15000, 3500)), + dwellMs: Math.round(normalizeNumber(value.dwellMs, 1000, 60_000, 6000)), + flyDurationMs: Math.round(normalizeNumber(value.flyDurationMs, 500, 15_000, 3500)), snapshot: normalizeSceneSnapshot(value.snapshot), createdAt: typeof value.createdAt === 'number' && Number.isFinite(value.createdAt) ? value.createdAt : Date.now() } } function normalizeSceneDocument(value: unknown): SceneDocument { - if (!isRecord(value) || !Array.isArray(value.scenes)) throw new Error('无效的场景目录') - if (value.scenes.length > SCENE_MAX) throw new Error('场景目录过大') + if (!isRecord(value) || !Array.isArray(value.scenes)) {throw new Error('无效的场景目录')} + if (value.scenes.length > SCENE_MAX) {throw new Error('场景目录过大')} const scenes = value.scenes.map(normalizeTeachingScene) - if (new Set(scenes.map((scene) => scene.id)).size !== scenes.length) throw new Error('重复的场景') + if (new Set(scenes.map((scene) => scene.id)).size !== scenes.length) {throw new Error('重复的场景')} return { scenes } } @@ -1055,9 +1060,9 @@ function ffmpegPath(): string { const macRecordingHost: OffscreenMacSessionHost = { setCancelHook: (hook) => { cancelOffscreenRecording = hook }, - clearCancelHook: (hook) => { if (cancelOffscreenRecording === hook) cancelOffscreenRecording = null }, + clearCancelHook: (hook) => { if (cancelOffscreenRecording === hook) {cancelOffscreenRecording = null} }, setTeardownHook: (hook) => { teardownOffscreenRecording = hook }, - clearTeardownHook: (hook) => { if (teardownOffscreenRecording === hook) teardownOffscreenRecording = null }, + clearTeardownHook: (hook) => { if (teardownOffscreenRecording === hook) {teardownOffscreenRecording = null} }, adoptWindow: (window) => { offscreenRecordingWindow = window }, dropWindow: stopOffscreenRecordingWindow, notePaintFrame: () => { offscreenPaintFrames += 1 }, @@ -1098,11 +1103,11 @@ function registerIpcHandlers(): void { }) ipcMain.handle('window:minimize', (event): void => { const win = BrowserWindow.fromWebContents(event.sender) ?? mainWindow - if (win && !win.isDestroyed()) win.minimize() + if (win && !win.isDestroyed()) {win.minimize()} }) ipcMain.handle('window:toggle-maximize', (event): void => { const win = BrowserWindow.fromWebContents(event.sender) ?? mainWindow - if (!win || win.isDestroyed()) return + if (!win || win.isDestroyed()) {return} if (win.isFullScreen()) { win.setFullScreen(false) } else if (win.isMaximized()) { @@ -1113,26 +1118,26 @@ function registerIpcHandlers(): void { }) ipcMain.handle('window:close', (event): void => { const win = BrowserWindow.fromWebContents(event.sender) ?? mainWindow - if (win && !win.isDestroyed()) win.close() + if (win && !win.isDestroyed()) {win.close()} }) ipcMain.handle('system:fonts', (): string[] => { const families = new Set(process.platform === 'linux' ? ['Arial', 'Noto Sans', 'Noto Sans CJK SC', 'Noto Sans SC', 'WenQuanYi Micro Hei', 'DejaVu Sans'] : ['Arial', 'Segoe UI', 'Microsoft YaHei']) const registryKeys = [ - 'HKLM\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Fonts', - 'HKCU\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Fonts' + String.raw`HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Fonts`, + String.raw`HKCU\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Fonts` ] if (process.platform === 'win32') { for (const key of registryKeys) { try { const result = execFileSync('reg.exe', ['query', key], { encoding: 'utf8', windowsHide: true, timeout: 5000 }) for (const line of result.split(/\r?\n/)) { - const match = line.match(/^\s+(.+?)\s+REG_\w+\s+/) - if (!match) continue + const match = /^\s+(.+?)\s+REG_\w+\s+/.exec(line) + if (!match) {continue} for (const family of match[1].replace(/\s*\([^)]*\)\s*$/, '').split(/\s*&\s*/)) { const name = family.trim() - if (name && name.length <= 128) families.add(name) + if (name && name.length <= 128) {families.add(name)} } } } catch { @@ -1145,7 +1150,7 @@ function registerIpcHandlers(): void { for (const line of result.split(/\r?\n/)) { for (const family of line.split(',')) { const name = family.trim() - if (name && name.length <= 128) families.add(name) + if (name && name.length <= 128) {families.add(name)} } } } catch { @@ -1156,7 +1161,7 @@ function registerIpcHandlers(): void { }) ipcMain.handle('settings:get', () => settingsSnapshot()) ipcMain.handle('settings:update', async (_event, patch: GuEarthSettingsPatch): Promise => { - if (!isRecord(patch)) throw new Error('无效的设置') + if (!isRecord(patch)) {throw new Error('无效的设置')} let tileMirrorModeChanged = false let tileMirrorModeNow: TileMirrorMode = settings.tileMirrorMode let tileMirrorSourceChanged = false @@ -1167,53 +1172,53 @@ function registerIpcHandlers(): void { ...settings, providerCredentials: settings.providerCredentials } - if (patch.selectedImageryProviderId !== undefined) nextSettings.selectedImageryProviderId = safeId(patch.selectedImageryProviderId) - if (patch.selectedTerrainProviderId !== undefined) nextSettings.selectedTerrainProviderId = safeId(patch.selectedTerrainProviderId) + if (patch.selectedImageryProviderId !== undefined) {nextSettings.selectedImageryProviderId = safeId(patch.selectedImageryProviderId)} + if (patch.selectedTerrainProviderId !== undefined) {nextSettings.selectedTerrainProviderId = safeId(patch.selectedTerrainProviderId)} if (patch.terrainExaggeration !== undefined) { - if (typeof patch.terrainExaggeration !== 'number' || !Number.isFinite(patch.terrainExaggeration)) throw new Error('无效的地形夸张设置') + if (typeof patch.terrainExaggeration !== 'number' || !Number.isFinite(patch.terrainExaggeration)) {throw new Error('无效的地形夸张设置')} nextSettings.terrainExaggeration = Math.min(5, Math.max(1, patch.terrainExaggeration)) } if (patch.terrainLighting !== undefined) { - if (typeof patch.terrainLighting !== 'boolean') throw new Error('无效的光照设置') + if (typeof patch.terrainLighting !== 'boolean') {throw new Error('无效的光照设置')} nextSettings.terrainLighting = patch.terrainLighting } if (patch.tileCacheEnabled !== undefined) { - if (typeof patch.tileCacheEnabled !== 'boolean') throw new Error('无效的缓存设置') + if (typeof patch.tileCacheEnabled !== 'boolean') {throw new Error('无效的缓存设置')} nextSettings.tileCacheEnabled = patch.tileCacheEnabled } if (patch.tileMirrorMode !== undefined) { - if (!isTileMirrorMode(patch.tileMirrorMode)) throw new Error('无效的镜像瓦片设置') + if (!isTileMirrorMode(patch.tileMirrorMode)) {throw new Error('无效的镜像瓦片设置')} tileMirrorModeChanged = patch.tileMirrorMode !== nextSettings.tileMirrorMode tileMirrorModeNow = patch.tileMirrorMode nextSettings.tileMirrorMode = patch.tileMirrorMode } if (patch.tileMirrorSource !== undefined) { - if (!isMirrorEndpointPreference(patch.tileMirrorSource)) throw new Error('无效的镜像源设置') + if (!isMirrorEndpointPreference(patch.tileMirrorSource)) {throw new Error('无效的镜像源设置')} tileMirrorSourceChanged = patch.tileMirrorSource !== nextSettings.tileMirrorSource tileMirrorSourceNow = patch.tileMirrorSource nextSettings.tileMirrorSource = patch.tileMirrorSource } if (patch.mirrorConsentPrompted !== undefined) { - if (typeof patch.mirrorConsentPrompted !== 'boolean') throw new Error('无效的镜像协议确认设置') + if (typeof patch.mirrorConsentPrompted !== 'boolean') {throw new Error('无效的镜像协议确认设置')} nextSettings.mirrorConsentPrompted = patch.mirrorConsentPrompted } if (patch.touchInteractionMode !== undefined) { - if (!isTouchInteractionMode(patch.touchInteractionMode)) throw new Error('无效的触摸操作设置') + if (!isTouchInteractionMode(patch.touchInteractionMode)) {throw new Error('无效的触摸操作设置')} nextSettings.touchInteractionMode = patch.touchInteractionMode } if (patch.themeMode !== undefined) { - if (!isThemeMode(patch.themeMode)) throw new Error('无效的外观主题设置') + if (!isThemeMode(patch.themeMode)) {throw new Error('无效的外观主题设置')} nextSettings.themeMode = patch.themeMode } if (patch.networkProxy !== undefined) { - if (typeof patch.networkProxy !== 'string') throw new Error('无效的代理设置') + if (typeof patch.networkProxy !== 'string') {throw new Error('无效的代理设置')} const normalized = normalizeNetworkProxy(patch.networkProxy) - if (normalized === '' && patch.networkProxy.trim() !== '') throw new Error('无效的代理地址') + if (normalized === '' && patch.networkProxy.trim() !== '') {throw new Error('无效的代理地址')} networkProxyChanged = normalized !== nextSettings.networkProxy nextSettings.networkProxy = normalized } if (patch.providerStyles !== undefined) { - if (!isRecord(patch.providerStyles)) throw new Error('无效的影像样式') + if (!isRecord(patch.providerStyles)) {throw new Error('无效的影像样式')} const providerStyles = { ...settings.providerStyles } for (const [providerId, styleId] of Object.entries(patch.providerStyles)) { providerStyles[safeId(providerId)] = safeId(styleId) @@ -1221,19 +1226,19 @@ function registerIpcHandlers(): void { nextSettings.providerStyles = providerStyles } if (patch.setupGuideDismissed !== undefined) { - if (typeof patch.setupGuideDismissed !== 'boolean') throw new Error('无效的向导设置') + if (typeof patch.setupGuideDismissed !== 'boolean') {throw new Error('无效的向导设置')} nextSettings.setupGuideDismissed = patch.setupGuideDismissed } if (patch.errorReportingEnabled !== undefined) { - if (typeof patch.errorReportingEnabled !== 'boolean') throw new Error('无效的错误报告设置') + if (typeof patch.errorReportingEnabled !== 'boolean') {throw new Error('无效的错误报告设置')} nextSettings.errorReportingEnabled = patch.errorReportingEnabled } if (patch.telemetryEnabled !== undefined) { - if (typeof patch.telemetryEnabled !== 'boolean') throw new Error('无效的遥测设置') + if (typeof patch.telemetryEnabled !== 'boolean') {throw new Error('无效的遥测设置')} nextSettings.telemetryEnabled = patch.telemetryEnabled } if (patch.aiTelemetryEnabled !== undefined) { - if (typeof patch.aiTelemetryEnabled !== 'boolean') throw new Error('无效的 AI 使用信息上报设置') + if (typeof patch.aiTelemetryEnabled !== 'boolean') {throw new Error('无效的 AI 使用信息上报设置')} nextSettings.aiTelemetryEnabled = patch.aiTelemetryEnabled } return nextSettings @@ -1288,11 +1293,11 @@ function registerIpcHandlers(): void { logger.info('tiles', `镜像服务源已切换为「${sourceDesc}」,当前使用 ${mirrorEndpointLabel(mirrorEndpointManager.getActive())}`) } broadcastMirrorStatus(tileMirrorModeChanged ? mirrorModeNotice(tileMirrorModeNow) : '') - if (tileMirrorModeChanged) scheduleMirrorRefresh('settings') + if (tileMirrorModeChanged) {scheduleMirrorRefresh('settings')} if (settings.tileMirrorMode === 'on' && settings.tileMirrorSource === 'auto') { void probeMirrorEndpoints('settings') } - if (tileMirrorModeChanged && tileMirrorModeNow === 'on') void refreshEarthquakes().catch(() => undefined) + if (tileMirrorModeChanged && tileMirrorModeNow === 'on') {void refreshEarthquakes().catch(() => undefined)} } return settingsSnapshot() }) @@ -1314,13 +1319,13 @@ function registerIpcHandlers(): void { ipcMain.handle('settings:test-network-proxy', async (_event, proxy: unknown): Promise => { const raw = typeof proxy === 'string' ? proxy : '' const normalized = normalizeNetworkProxy(raw) - if (normalized === '' && raw.trim() !== '') return { ok: false, elapsedMs: 0, error: '无效的代理地址' } + if (normalized === '' && raw.trim() !== '') {return { ok: false, elapsedMs: 0, error: '无效的代理地址' }} const startedAt = Date.now() try { const testSession = session.fromPartition('guearth-network-test') await testSession.setProxy(proxyConfig(normalized)) const response = await testSession.fetch('https://services.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer/tile/0/0/0', { headers: TILE_FETCH_HEADERS, signal: AbortSignal.timeout(TILE_FETCH_TIMEOUT_MS) }) - if (!response.ok) return { ok: false, elapsedMs: Date.now() - startedAt, error: `HTTP ${response.status}` } + if (!response.ok) {return { ok: false, elapsedMs: Date.now() - startedAt, error: `HTTP ${response.status}` }} await response.arrayBuffer() return { ok: true, elapsedMs: Date.now() - startedAt, error: '' } } catch (error) { @@ -1328,20 +1333,20 @@ function registerIpcHandlers(): void { } }) ipcMain.handle('places:search', async (_event, keyword: unknown, provider: unknown) => { - if (typeof keyword !== 'string') throw new Error('无效的搜索关键词') - if (provider !== undefined && provider !== 'amap' && provider !== 'baidu') throw new Error('无效的搜索源') + if (typeof keyword !== 'string') {throw new Error('无效的搜索关键词')} + if (provider !== undefined && provider !== 'amap' && provider !== 'baidu') {throw new Error('无效的搜索源')} const preferred: PlaceSearchProvider = provider ?? (hasProviderKey('amap') ? 'amap' : hasProviderKey('baidu') ? 'baidu' : 'amap') const requestId = beginPlacesRequest() const primary = preferred === 'baidu' ? await searchBaiduPlaces(keyword, requestId) : await searchPlaces(keyword, undefined, requestId) - if (primary.superseded || !primary.error) return { ...primary, source: preferred } + if (primary.superseded || !primary.error) {return { ...primary, source: preferred }} const alternative: PlaceSearchProvider = preferred === 'baidu' ? 'amap' : 'baidu' - if (!hasProviderKey(alternative)) return { ...primary, source: preferred } + if (!hasProviderKey(alternative)) {return { ...primary, source: preferred }} const fallback = alternative === 'baidu' ? await searchBaiduPlaces(keyword) : await searchPlaces(keyword) - if (fallback.error || fallback.superseded) return { ...primary, source: preferred } + if (fallback.error || fallback.superseded) {return { ...primary, source: preferred }} return { ...fallback, source: alternative, fellBackFrom: preferred } }) ipcMain.handle('places:poi-statistics', async (_event, request: unknown) => { - if (!isRecord(request)) throw new Error('无效的 POI 统计请求') + if (!isRecord(request)) {throw new Error('无效的 POI 统计请求')} const numberArg = (value: unknown): number | undefined => typeof value === 'number' && Number.isFinite(value) ? value : undefined const stringArg = (value: unknown): string | undefined => typeof value === 'string' && value.trim() ? value : undefined return poiStatistics({ @@ -1378,12 +1383,12 @@ function registerIpcHandlers(): void { advanceMirrorRouteGeneration() const recovered = tileMirrorRouter.resetMirrorFallback(id) mirrorEndpointManager.clearFailures() - if (id) mirrorFallenBackProviders.delete(id) - else mirrorFallenBackProviders.clear() + if (id) {mirrorFallenBackProviders.delete(id)} + else {mirrorFallenBackProviders.clear()} scheduleMirrorFallbackExpirySync() if (recovered) { logger.info('tiles', `已重置镜像回退状态,${id ?? '全部底图源'} 重新尝试镜像服务`) - if (notify !== false) broadcastMirrorStatus('') + if (notify !== false) {broadcastMirrorStatus('')} } return mirrorStatus() }) @@ -1395,7 +1400,7 @@ function registerIpcHandlers(): void { ipcMain.handle('tiles:clear', (_event, providerId?: string) => { const target = providerId === undefined ? tileCachePath : storageChildPath(tileCachePath, safeId(providerId)) return enqueueTileMutation(async () => { - if (tilePrunePromise) await tilePrunePromise + if (tilePrunePromise) {await tilePrunePromise} await rm(target, { recursive: true, force: true }) await mkdir(tileCachePath, { recursive: true }) tilePruneAt = 0 @@ -1425,11 +1430,11 @@ function registerIpcHandlers(): void { properties: ['openDirectory', 'createDirectory'] as ('openDirectory' | 'createDirectory')[] } const result = owner ? await dialog.showOpenDialog(owner, options) : await dialog.showOpenDialog(options) - if (result.canceled || !result.filePaths[0]) return null + if (result.canceled || !result.filePaths[0]) {return null} const directory = result.filePaths[0] try { const info = await stat(directory) - if (!info.isDirectory()) throw new Error('请选择文件夹') + if (!info.isDirectory()) {throw new Error('请选择文件夹')} await access(directory, constants.W_OK) } catch { throw new Error('所选文件夹不可写,请选择其他文件夹') @@ -1439,7 +1444,7 @@ function registerIpcHandlers(): void { }) ipcMain.handle('recordings:offscreen-probe', async (_event, script: unknown): Promise => { assertOffscreenRecordingIdle() - if (script === undefined) return startOffscreenRecordingWindow() + if (script === undefined) {return startOffscreenRecordingWindow()} return startOffscreenRecordingWindow(normalizeOffscreenRecordingScript(script)) }) ipcMain.handle('recordings:offscreen-encode', async (event, script: unknown): Promise => { @@ -1450,7 +1455,7 @@ function registerIpcHandlers(): void { try { return await encodeMacOffscreenRecording(normalizeOffscreenRecordingScript(script), macRecordingHost) } finally { - if (offscreenRecordRequester === requester) offscreenRecordRequester = null + if (offscreenRecordRequester === requester) {offscreenRecordRequester = null} } } assertOffscreenRecordingSupported(process.platform) @@ -1460,13 +1465,13 @@ function registerIpcHandlers(): void { try { return await encodeOffscreenRecording(normalizeOffscreenRecordingScript(script)) } finally { - if (offscreenRecordRequester === requester) offscreenRecordRequester = null + if (offscreenRecordRequester === requester) {offscreenRecordRequester = null} } }) ipcMain.on('recordings:offscreen-progress', (event, payload: unknown): void => { const target = offscreenRecordRequester - if (!target || target.isDestroyed() || event.sender !== offscreenRecordingWindow?.webContents) return - if (!isRecord(payload)) return + if (!target || target.isDestroyed() || event.sender !== offscreenRecordingWindow?.webContents) {return} + if (!isRecord(payload)) {return} const sceneIndex = normalizeNumber(payload.sceneIndex, 0, 1000, 0) const totalScenes = normalizeNumber(payload.totalScenes, 0, 1000, 0) const preparing = payload.phase === 'preparing' @@ -1482,8 +1487,8 @@ function registerIpcHandlers(): void { }) ipcMain.on('recordings:offscreen-notice', (event, message: unknown): void => { const target = offscreenRecordRequester - if (!target || target.isDestroyed() || event.sender !== offscreenRecordingWindow?.webContents) return - if (typeof message !== 'string' || !message.trim()) return + if (!target || target.isDestroyed() || event.sender !== offscreenRecordingWindow?.webContents) {return} + if (typeof message !== 'string' || !message.trim()) {return} target.send('recordings:offscreen-notice', message.trim().slice(0, 200)) }) ipcMain.on('recordings:offscreen-next', (event): void => { @@ -1499,7 +1504,7 @@ function registerIpcHandlers(): void { ipcMain.handle('recordings:offscreen-cancel', (): void => { cancelOffscreenRecording?.() }) ipcMain.handle('recordings:offscreen-stats', (): OffscreenRecordingProbeResult => offscreenRecordingStats()) ipcMain.handle('logging:copy-report', (_event, rendererDump: unknown): void => { - if (typeof rendererDump !== 'string') throw new Error('无效的日志数据') + if (typeof rendererDump !== 'string') {throw new Error('无效的日志数据')} clipboard.writeText([ '=== 咕咕地球诊断日志 ===', `版本 ${app.getVersion()} | Electron ${process.versions.electron} | Chrome ${process.versions.chrome} | Node ${process.versions.node} | ${process.platform} ${process.getSystemVersion()}`, @@ -1513,29 +1518,29 @@ function registerIpcHandlers(): void { ].join('\n')) }) ipcMain.on('recordings:offscreen-frame-ack', (event, count: unknown): void => { - if (event.sender !== offscreenRecordingWindow?.webContents) return + if (event.sender !== offscreenRecordingWindow?.webContents) {return} noteMacOffscreenFrameAck(count) }) ipcMain.on('recordings:offscreen-video-chunk', (event, bytes: unknown, position: unknown): void => { - if (event.sender !== offscreenRecordingWindow?.webContents) return + if (event.sender !== offscreenRecordingWindow?.webContents) {return} deliverMacOffscreenVideo(bytes, position) }) ipcMain.on('recordings:offscreen-video-complete', (event): void => { - if (event.sender !== offscreenRecordingWindow?.webContents) return + if (event.sender !== offscreenRecordingWindow?.webContents) {return} deliverMacOffscreenVideoComplete() }) } function assertOffscreenRecordingIdle(): void { - if (!offscreenRecordingWindow && !cancelOffscreenRecording && !teardownOffscreenRecording && !offscreenRecordRequester) return + if (!offscreenRecordingWindow && !cancelOffscreenRecording && !teardownOffscreenRecording && !offscreenRecordRequester) {return} throw new Error('已有离屏录制任务正在进行,请稍后再试') } function stopOffscreenRecordingWindow(): void { const window = offscreenRecordingWindow offscreenRecordingWindow = null - if (!window || window.isDestroyed()) return - if (!window.webContents.isDestroyed()) window.webContents.stopPainting() + if (!window || window.isDestroyed()) {return} + if (!window.webContents.isDestroyed()) {window.webContents.stopPainting()} window.destroy() } @@ -1549,8 +1554,8 @@ function taskkillProcessTree(pid: number): boolean { } function terminateOffscreenEncoder(encoder: ReturnType | null): void { - if (!encoder) return - if (process.platform === 'win32' && encoder.pid && taskkillProcessTree(encoder.pid)) return + if (!encoder) {return} + if (process.platform === 'win32' && encoder.pid && taskkillProcessTree(encoder.pid)) {return} try { encoder.kill() } catch { @@ -1590,19 +1595,19 @@ async function startOffscreenRecordingWindow(script?: OffscreenRecordingScript): window.webContents.once('did-finish-load', () => resolve()) window.webContents.once('did-fail-load', (_event, code, description) => reject(new Error(`${code}: ${description}`))) }) - const loading = process.env['ELECTRON_RENDERER_URL'] - ? window.loadURL(`${process.env['ELECTRON_RENDERER_URL']}/offscreen.html`) + const loading = process.env.ELECTRON_RENDERER_URL + ? window.loadURL(`${process.env.ELECTRON_RENDERER_URL}/offscreen.html`) : window.loadFile(join(__dirname, '../renderer/offscreen.html')) await Promise.all([loading, ready]) if (script) { - const serialized = JSON.stringify(script).replace(/ setTimeout(resolve, 1000)) @@ -1610,7 +1615,7 @@ async function startOffscreenRecordingWindow(script?: OffscreenRecordingScript): const elapsed = Math.max(1, Date.now() - offscreenPaintStartedAt) return { fps: Math.round(offscreenPaintFrames * 1000 / elapsed), frames: offscreenPaintFrames } } finally { - if (created && offscreenRecordingWindow === created) stopOffscreenRecordingWindow() + if (created && offscreenRecordingWindow === created) {stopOffscreenRecordingWindow()} } } @@ -1620,7 +1625,7 @@ function offscreenRecordingStats(): { fps: number; frames: number } { } function normalizeOffscreenTerrain(value: unknown): OffscreenRecordingScript['terrain'] { - if (!isRecord(value)) return { providerId: 'ellipsoid', exaggeration: 1, lighting: false } + if (!isRecord(value)) {return { providerId: 'ellipsoid', exaggeration: 1, lighting: false }} return { providerId: typeof value.providerId === 'string' && TERRAIN_PROVIDER_ID_SET.has(value.providerId) ? value.providerId : 'ellipsoid', exaggeration: normalizeNumber(value.exaggeration, 1, 5, 1), @@ -1629,16 +1634,16 @@ function normalizeOffscreenTerrain(value: unknown): OffscreenRecordingScript['te } function normalizeOffscreenRecordingScript(value: unknown): OffscreenRecordingScript { - if (!isRecord(value) || !Array.isArray(value.scenes)) throw new Error('无效的离屏录制脚本') + if (!isRecord(value) || !Array.isArray(value.scenes)) {throw new Error('无效的离屏录制脚本')} const sceneDocument = normalizeSceneDocument({ scenes: value.scenes }) return { title: typeof value.title === 'string' ? value.title.slice(0, 120) : '', scenes: sceneDocument.scenes, annotations: Array.isArray(value.annotations) ? value.annotations.flatMap((entry) => { - if (!isRecord(entry) || typeof entry.sceneId !== 'string' || typeof entry.name !== 'string' || !Array.isArray(entry.positions)) return [] - if (entry.kind !== 'point' && entry.kind !== 'polyline' && entry.kind !== 'polygon') return [] - const positions = entry.positions.flatMap((position) => isRecord(position) ? [{ longitude: normalizeNumber(position.longitude, -180, 180, 0), latitude: normalizeNumber(position.latitude, -90, 90, 0), height: normalizeNumber(position.height, -10000, 100000000, 0) }] : []) - if (!positions.length) return [] + if (!isRecord(entry) || typeof entry.sceneId !== 'string' || typeof entry.name !== 'string' || !Array.isArray(entry.positions)) {return []} + if (entry.kind !== 'point' && entry.kind !== 'polyline' && entry.kind !== 'polygon') {return []} + const positions = entry.positions.flatMap((position) => isRecord(position) ? [{ longitude: normalizeNumber(position.longitude, -180, 180, 0), latitude: normalizeNumber(position.latitude, -90, 90, 0), height: normalizeNumber(position.height, -10_000, 100_000_000, 0) }] : []) + if (positions.length === 0) {return []} return [{ sceneId: entry.sceneId, kind: entry.kind, @@ -1683,25 +1688,25 @@ function withOffscreenTimeout(task: Promise, timeoutMs: number, message: s } function forwardOffscreenCommand(event: Electron.IpcMainEvent, expression: string): void { - if (event.sender !== offscreenRecordRequester) return + if (event.sender !== offscreenRecordRequester) {return} const window = offscreenRecordingWindow - if (!window || window.isDestroyed() || window.webContents.isDestroyed()) return - void window.webContents.executeJavaScript(expression).catch(() => undefined) + if (!window || window.isDestroyed() || window.webContents.isDestroyed()) {return} + void window.webContents.executeJavaScript(expression).catch(() => {}) } async function offscreenFrameDirectoryActive(directory: string, entryName: string): Promise { const path = resolveOffscreenEntry(directory, entryName) - if (!path) return true + if (!path) {return true} try { const owner = Number.parseInt((await readFile(join(path, OFFSCREEN_OWNER_FILE), 'utf8')).trim(), 10) - if (!Number.isInteger(owner) || owner <= 0) return false - if (owner === process.pid) return true + if (!Number.isInteger(owner) || owner <= 0) {return false} + if (owner === process.pid) {return true} process.kill(owner, 0) return true } catch (error) { const code = (error as NodeJS.ErrnoException).code - if (code === 'ESRCH') return false - if (code !== 'ENOENT') return true + if (code === 'ESRCH') {return false} + if (code !== 'ENOENT') {return true} try { const info = await stat(path) return Date.now() - info.mtimeMs < OFFSCREEN_SWEEP_GRACE_MS @@ -1717,10 +1722,10 @@ async function removeStaleOffscreenDirectories(directory: string): Promise await Promise.all(entries .filter((entry) => entry.isDirectory() && entry.name.startsWith(OFFSCREEN_TEMP_PREFIX)) .map(async (entry) => { - if (await offscreenFrameDirectoryActive(directory, entry.name)) return + if (await offscreenFrameDirectoryActive(directory, entry.name)) {return} const path = resolveOffscreenEntry(directory, entry.name) - if (!path) return - await rm(path, { recursive: true, force: true }).catch(() => undefined) + if (!path) {return} + await rm(path, { recursive: true, force: true }).catch(() => {}) })) } catch { return @@ -1734,36 +1739,36 @@ function encodeOffscreenRecording(script: OffscreenRecordingScript): Promise | null = null let recorderWindow: BrowserWindow | null = null const release = (): void => { - if (cancelOffscreenRecording === cancel) cancelOffscreenRecording = null - if (teardownOffscreenRecording === teardown) teardownOffscreenRecording = null + if (cancelOffscreenRecording === cancel) {cancelOffscreenRecording = null} + if (teardownOffscreenRecording === teardown) {teardownOffscreenRecording = null} stopOffscreenRecordingWindow() terminateOffscreenEncoder(ffmpeg) ffmpeg = null - if (tempDir) void rm(tempDir, { recursive: true, force: true }).catch(() => undefined) + if (tempDir) {void rm(tempDir, { recursive: true, force: true }).catch(() => undefined)} } const teardown = (): void => { const pending = !settled settled = true - if (cancelOffscreenRecording === cancel) cancelOffscreenRecording = null - if (teardownOffscreenRecording === teardown) teardownOffscreenRecording = null + if (cancelOffscreenRecording === cancel) {cancelOffscreenRecording = null} + if (teardownOffscreenRecording === teardown) {teardownOffscreenRecording = null} stopOffscreenRecordingWindow() terminateOffscreenEncoder(ffmpeg) ffmpeg = null const directory = tempDir tempDir = null - if (directory) rmSync(directory, { recursive: true, force: true }) + if (directory) {rmSync(directory, { recursive: true, force: true })} logger.info('recording', pending ? '应用退出,已中止离屏录制并清理临时文件' : '应用退出,已清理离屏录制临时文件') - if (pending) resolve({ path: '', bytes: 0, cancelled: true }) + if (pending) {resolve({ path: '', bytes: 0, cancelled: true })} } teardownOffscreenRecording = teardown const fail = (error: unknown): void => { - if (settled) return + if (settled) {return} settled = true release() reject(error instanceof Error ? error : new Error(String(error))) } const cancel = (): void => { - if (settled) return + if (settled) {return} settled = true release() logger.info('recording', '离屏录制已取消,未生成视频文件') @@ -1774,18 +1779,18 @@ function encodeOffscreenRecording(script: OffscreenRecordingScript): Promise { stopOffscreenRecordingWindow() const directory = await usableRecordingDirectory() - if (settled) return - if (!directory) throw new Error('请先选择可用的视频保存文件夹') + if (settled) {return} + if (!directory) {throw new Error('请先选择可用的视频保存文件夹')} await removeStaleOffscreenDirectories(directory) - if (settled) return + if (settled) {return} const createdTempDir = await mkdtemp(join(directory, OFFSCREEN_TEMP_PREFIX)) if (settled) { - void rm(createdTempDir, { recursive: true, force: true }).catch(() => undefined) + void rm(createdTempDir, { recursive: true, force: true }).catch(() => {}) return } tempDir = createdTempDir await writeFile(join(tempDir, OFFSCREEN_OWNER_FILE), String(process.pid), 'utf8') - if (settled) return + if (settled) {return} const frameDirectory = createdTempDir const temporaryPath = join(frameDirectory, 'recording.mp4.part') const now = new Date() @@ -1828,15 +1833,15 @@ function encodeOffscreenRecording(script: OffscreenRecordingScript): Promise { offscreenPaintFrames += 1 - if (settled || !capturing || image.isEmpty() || pendingFrames >= OFFSCREEN_MAX_PENDING_FRAMES) return + if (settled || !capturing || image.isEmpty() || pendingFrames >= OFFSCREEN_MAX_PENDING_FRAMES) {return} const size = image.getSize() if (!captureLogged) { captureLogged = true logger.info('recording', `离屏采集 ${size.width}x${size.height},输出 ${script.width}x${script.height}`, `窗口 ${capture.width}x${capture.height} 工作区 ${workArea.width}x${workArea.height}`) - if (Math.abs(size.width / size.height - script.width / script.height) > 0.02) logger.warn('recording', '离屏采集比例与输出比例不一致,将以补边方式适配') + if (Math.abs(size.width / size.height - script.width / script.height) > 0.02) {logger.warn('recording', '离屏采集比例与输出比例不一致,将以补边方式适配')} } const frame = image.toJPEG(95) - if (frame.length === 0) return + if (frame.length === 0) {return} const name = `frame-${String(frameIndex).padStart(8, '0')}.jpg` frameNames.push(name) frameTimes.push(Date.now() - recordingStartedAt) @@ -1848,13 +1853,13 @@ function encodeOffscreenRecording(script: OffscreenRecordingScript): Promise resolveReady()) window.webContents.once('did-fail-load', (_event, code, description) => rejectReady(new Error(`${code}: ${description}`))) }) - const loading = process.env['ELECTRON_RENDERER_URL'] - ? window.loadURL(`${process.env['ELECTRON_RENDERER_URL']}/offscreen.html`) + const loading = process.env.ELECTRON_RENDERER_URL + ? window.loadURL(`${process.env.ELECTRON_RENDERER_URL}/offscreen.html`) : window.loadFile(join(__dirname, '../renderer/offscreen.html')) await Promise.all([loading, ready]) - if (settled) return + if (settled) {return} window.webContents.setFrameRate(targetFps) - const serialized = JSON.stringify(script).replace(/ total + seconds, 0) await writeFile(join(frameDirectory, 'frames.txt'), offscreenConcatPlaylist(frameNames, durations), 'utf8') - if (settled) return + if (settled) {return} const outputFps = Math.min(60, Math.max(1, Math.round(script.fps))) const stderr: Buffer[] = [] const encoder = spawn(ffmpegPath(), [ @@ -1906,25 +1911,25 @@ function encodeOffscreenRecording(script: OffscreenRecordingScript): Promise { throw error instanceof Error ? error : new Error(String(error)) }) - if (settled) return + if (settled) {return} if (code !== 0) { const detail = Buffer.concat(stderr).toString('utf8').trim() fail(new Error(`离屏视频编码失败(FFmpeg 退出码 ${code ?? '未知'})${detail ? `:${detail.slice(-1000)}` : ''}`)) return } const bytes = await readFileSize(temporaryPath) - if (settled) return + if (settled) {return} if (bytes === 0) { fail(new Error('未能生成离屏视频数据')) return } await renameFile(temporaryPath, outputPath) - if (settled) return - await rm(frameDirectory, { recursive: true, force: true }).catch(() => undefined) - if (settled) return + if (settled) {return} + await rm(frameDirectory, { recursive: true, force: true }).catch(() => {}) + if (settled) {return} settled = true - if (cancelOffscreenRecording === cancel) cancelOffscreenRecording = null - if (teardownOffscreenRecording === teardown) teardownOffscreenRecording = null + if (cancelOffscreenRecording === cancel) {cancelOffscreenRecording = null} + if (teardownOffscreenRecording === teardown) {teardownOffscreenRecording = null} ffmpeg = null tempDir = null stopOffscreenRecordingWindow() @@ -1980,7 +1985,7 @@ function createWindow(): void { win.on('enter-full-screen', emitWindowState) win.on('leave-full-screen', emitWindowState) win.on('closed', () => { - if (mainWindow === win) mainWindow = null + if (mainWindow === win) {mainWindow = null} }) win.on('ready-to-show', () => win.show()) @@ -1990,7 +1995,7 @@ function createWindow(): void { }) win.webContents.setWindowOpenHandler((details) => { - if (/^https?:\/\//i.test(details.url)) void shell.openExternal(details.url) + if (/^https?:\/\//i.test(details.url)) {void shell.openExternal(details.url)} return { action: 'deny' } }) @@ -2002,15 +2007,15 @@ function createWindow(): void { }) win.webContents.on('did-fail-load', (_event, errorCode, errorDescription, validatedURL, isMainFrame) => { - if (!isMainFrame || errorCode === -3) return + if (!isMainFrame || errorCode === -3) {return} logger.error('window', '页面加载失败', `${errorCode} ${errorDescription} ${validatedURL}`) if (errorReportingEnabled) { Sentry.captureMessage('渲染页面加载失败', { level: 'error', extra: { errorCode, errorDescription, url: validatedURL } }) } }) - if (process.env['ELECTRON_RENDERER_URL']) { - win.loadURL(process.env['ELECTRON_RENDERER_URL']) + if (process.env.ELECTRON_RENDERER_URL) { + win.loadURL(process.env.ELECTRON_RENDERER_URL) } else { win.loadFile(join(__dirname, '../renderer/index.html')) } @@ -2024,13 +2029,13 @@ if (!hasSingleInstanceLock) { app.on('second-instance', () => { const window = mainWindow - if (!window || window.isDestroyed()) return - if (window.isMinimized()) window.restore() + if (!window || window.isDestroyed()) {return} + if (window.isMinimized()) {window.restore()} window.focus() }) app.whenReady().then(async () => { - if (!hasSingleInstanceLock) return + if (!hasSingleInstanceLock) {return} logger.info('app', '应用启动', `version=${app.getVersion()} packaged=${app.isPackaged}`) const userDataPath = app.getPath('userData') settingsPath = join(userDataPath, 'settings.json') @@ -2090,7 +2095,7 @@ app.whenReady().then(async () => { return } catch (error) { logger.warn('ai', 'EOQ HawDB 初始化失败,已降级为 JSON 存储', error) - await eoqHawdb.close().catch(() => undefined) + await eoqHawdb.close().catch(() => {}) } } else { logger.warn('ai', '未找到内置 HawDB 引擎库,已降级为 JSON 存储') @@ -2106,10 +2111,10 @@ app.whenReady().then(async () => { aiSettings.init(join(userDataPath, 'ai-settings.json')), initEoqStores() ]) - if (startupMirrorProbeReady) await startupMirrorProbeReady + if (startupMirrorProbeReady) {await startupMirrorProbeReady} void startOnlineData(userDataPath, (snapshot) => { for (const window of BrowserWindow.getAllWindows()) { - if (!window.isDestroyed() && !window.webContents.isDestroyed()) window.webContents.send('datasets:online-data-changed', snapshot) + if (!window.isDestroyed() && !window.webContents.isDestroyed()) {window.webContents.send('datasets:online-data-changed', snapshot)} } }) ;[annotations, scenes] = loaded @@ -2132,19 +2137,19 @@ app.whenReady().then(async () => { scheduleMirrorRefresh('startup') app.on('activate', () => { - if (BrowserWindow.getAllWindows().length === 0) createWindow() + if (BrowserWindow.getAllWindows().length === 0) {createWindow()} }) }) app.on('before-quit', (event) => { - if (quitting) return + if (quitting) {return} event.preventDefault() quitting = true void Promise.all([shutdownPosthog(), shutdownPosthogLogs()]) - .catch(() => undefined) + .catch(() => {}) .finally(() => flushJsonWrites()) .then(() => eoqHawdb.close()) - .catch(() => undefined) + .catch(() => {}) .finally(() => app.quit()) }) @@ -2162,20 +2167,20 @@ app.on('will-quit', () => { }) app.on('window-all-closed', () => { - if (process.platform !== 'darwin') app.quit() + if (process.platform !== 'darwin') {app.quit()} }) let gpuCrashReportedAt = 0 app.on('child-process-gone', (_event, details) => { - if (details.type !== 'GPU') return + if (details.type !== 'GPU') {return} logger.error('gpu', `GPU 进程退出(${details.reason})`, `exitCode=${details.exitCode}`) capturePosthogLog('error', 'gpu_process_exited', { exit_code: details.exitCode, reason: details.reason }) - if (!errorReportingEnabled) return - if (Date.now() - gpuCrashReportedAt < 60_000) return + if (!errorReportingEnabled) {return} + if (Date.now() - gpuCrashReportedAt < 60_000) {return} gpuCrashReportedAt = Date.now() Sentry.captureMessage(`GPU 进程退出:${details.reason}`, { level: 'error', extra: { exitCode: details.exitCode } }) }) diff --git a/src/main/jsonStore.ts b/src/main/jsonStore.ts index 8d6ca46..f4e80d2 100644 --- a/src/main/jsonStore.ts +++ b/src/main/jsonStore.ts @@ -1,5 +1,5 @@ -import { readFile, rename, unlink, writeFile } from 'fs/promises' -import { randomUUID } from 'crypto' +import { readFile, rename, unlink, writeFile } from 'node:fs/promises' +import { randomUUID } from 'node:crypto' const pending = new Set>() @@ -7,7 +7,7 @@ export function serialQueue() { let tail: Promise = Promise.resolve() return function enqueue(operation: () => Promise): Promise { const result = tail.then(operation) - tail = result.catch(() => undefined) + tail = result.catch(() => {}) pending.add(result) void result.then(() => pending.delete(result), () => pending.delete(result)) return result @@ -32,15 +32,15 @@ export async function writeAtomic(path: string, data: string | Buffer): Promise< break } catch (error) { const code = (error as NodeJS.ErrnoException).code - if (attempt >= 4 || !['EACCES', 'EBUSY', 'EEXIST', 'EPERM'].includes(code ?? '')) throw error + if (attempt >= 4 || !['EACCES', 'EBUSY', 'EEXIST', 'EPERM'].includes(code ?? '')) {throw error} await new Promise((resolve) => setTimeout(resolve, 20 * (attempt + 1))) } } } finally { - await unlink(temporaryPath).catch(() => undefined) + await unlink(temporaryPath).catch(() => {}) } } export async function flushJsonWrites(): Promise { - while (pending.size) await Promise.allSettled([...pending]) + while (pending.size > 0) {await Promise.allSettled([...pending])} } diff --git a/src/main/keyVault.ts b/src/main/keyVault.ts index 41b2ab0..23119e2 100644 --- a/src/main/keyVault.ts +++ b/src/main/keyVault.ts @@ -1,6 +1,6 @@ import { safeStorage } from 'electron' -import { existsSync, mkdirSync, readFileSync, unlinkSync, writeFileSync } from 'fs' -import { join } from 'path' +import { existsSync, mkdirSync, readFileSync, unlinkSync, writeFileSync } from 'node:fs' +import { join } from 'node:path' let credentialsPath = '' @@ -14,7 +14,7 @@ export function isSafeId(value: unknown): value is string { } export function assertSafeId(value: unknown): string { - if (!isSafeId(value)) throw new Error('无效的供应商标识') + if (!isSafeId(value)) {throw new Error('无效的供应商标识')} return value } @@ -27,23 +27,23 @@ export function hasProviderKey(providerId: string): boolean { } export function assertEncryptionAvailable(): void { - if (!safeStorage.isEncryptionAvailable()) throw new Error('系统安全存储不可用') + if (!safeStorage.isEncryptionAvailable()) {throw new Error('系统安全存储不可用')} } export function writeProviderKey(providerId: string, apiKey: string): void { assertEncryptionAvailable() - if (typeof apiKey !== 'string' || apiKey.length < 1 || apiKey.length > 4096) throw new Error('无效的供应商密钥') + if (typeof apiKey !== 'string' || apiKey.length === 0 || apiKey.length > 4096) {throw new Error('无效的供应商密钥')} writeFileSync(credentialPath(providerId), safeStorage.encryptString(apiKey)) } export function clearProviderKey(providerId: string): void { const path = credentialPath(providerId) - if (existsSync(path)) unlinkSync(path) + if (existsSync(path)) {unlinkSync(path)} } export function readProviderKey(providerId: string): string | undefined { const path = credentialPath(providerId) - if (!existsSync(path) || !safeStorage.isEncryptionAvailable()) return undefined + if (!existsSync(path) || !safeStorage.isEncryptionAvailable()) {return undefined} try { return safeStorage.decryptString(readFileSync(path)) } catch { diff --git a/src/main/laboratory.ts b/src/main/laboratory.ts index ffb9800..bea25a2 100644 --- a/src/main/laboratory.ts +++ b/src/main/laboratory.ts @@ -10,10 +10,10 @@ export interface QWeatherCredentials { } export function getQWeatherCredentials(): QWeatherCredentials | null { - if (!hasProviderKey(CREDENTIAL_ID)) return null + if (!hasProviderKey(CREDENTIAL_ID)) {return null} try { const saved = readProviderKey(CREDENTIAL_ID) - if (!saved) throw new Error('无法解密') + if (!saved) {throw new Error('无法解密')} const value = JSON.parse(saved) return { apiHost: normalizeQWeatherHost(value.apiHost), apiKey: validateQWeatherApiKey(value.apiKey) } } catch { @@ -31,18 +31,18 @@ export function listLaboratoryProviders(): LaboratoryProvider[] { } export function saveLaboratoryProvider(input: LaboratoryProviderInput): LaboratoryProvider[] { - if (!input || input.category !== 'weather' || input.provider !== 'qweather') throw new Error('不支持的数据源或提供商') + if (input?.category !== 'weather' || input.provider !== 'qweather') {throw new Error('不支持的数据源或提供商')} const apiHost = normalizeQWeatherHost(input.apiHost) const apiKey = input.apiKey === undefined || input.apiKey === '' ? getQWeatherCredentials()?.apiKey : validateQWeatherApiKey(input.apiKey) - if (!apiKey) throw new Error('请输入 API Key') + if (!apiKey) {throw new Error('请输入 API Key')} writeProviderKey(CREDENTIAL_ID, JSON.stringify({ apiHost, apiKey })) return listLaboratoryProviders() } export function removeLaboratoryProvider(provider: unknown): LaboratoryProvider[] { - if (provider !== 'qweather') throw new Error('不支持的提供商') + if (provider !== 'qweather') {throw new Error('不支持的提供商')} clearProviderKey(CREDENTIAL_ID) return [] } diff --git a/src/main/offscreenMac.ts b/src/main/offscreenMac.ts index 8e587ad..f025641 100644 --- a/src/main/offscreenMac.ts +++ b/src/main/offscreenMac.ts @@ -1,7 +1,8 @@ -import { rmSync } from 'fs' -import { mkdtemp, open, rename as renameFile, rm, stat, writeFile, type FileHandle } from 'fs/promises' -import { randomUUID } from 'crypto' -import { format, join } from 'path' +import { rmSync } from 'node:fs' +import { mkdtemp, open, rename as renameFile, rm, stat, writeFile } from 'fs/promises'; +import type { FileHandle } from 'fs/promises'; +import { randomUUID } from 'node:crypto' +import { format, join } from 'node:path' import { BrowserWindow, shell } from 'electron' import { logger } from '../common/logger' import type { OffscreenRecordingScript, RecordingSaveResult } from '../preload' @@ -46,14 +47,14 @@ let activeMacSession: OffscreenMacIpcSession | null = null export function noteMacOffscreenFrameAck(count: unknown): void { const session = activeMacSession - if (!session || typeof count !== 'number' || !Number.isFinite(count) || count <= 0) return + if (!session || typeof count !== 'number' || !Number.isFinite(count) || count <= 0) {return} session.noteFrameAck(Math.min(1024, Math.round(count))) } export function deliverMacOffscreenVideo(value: unknown, position: unknown): void { const session = activeMacSession - if (!session || !ArrayBuffer.isView(value)) return - if (typeof position !== 'number' || !Number.isSafeInteger(position) || position < 0) return + if (!session || !ArrayBuffer.isView(value)) {return} + if (typeof position !== 'number' || !Number.isSafeInteger(position) || position < 0) {return} session.appendVideoChunk(new Uint8Array(value.buffer, value.byteOffset, value.byteLength), position) } @@ -91,8 +92,8 @@ export function encodeMacOffscreenRecording(script: OffscreenRecordingScript, ho host.clearTeardownHook(teardown) activeMacSession = null host.dropWindow() - if (videoFile) void videoFile.close().catch(() => undefined) - if (tempDir) void rm(tempDir, { recursive: true, force: true }).catch(() => undefined) + if (videoFile) {void videoFile.close().catch(() => undefined)} + if (tempDir) {void rm(tempDir, { recursive: true, force: true }).catch(() => undefined)} } const teardown = (): void => { const pending = !settled @@ -101,22 +102,22 @@ export function encodeMacOffscreenRecording(script: OffscreenRecordingScript, ho host.clearTeardownHook(teardown) activeMacSession = null host.dropWindow() - if (videoFile) void videoFile.close().catch(() => undefined) + if (videoFile) {void videoFile.close().catch(() => undefined)} const directory = tempDir tempDir = null - if (directory) rmSync(directory, { recursive: true, force: true }) + if (directory) {rmSync(directory, { recursive: true, force: true })} logger.info('recording', pending ? '应用退出,已中止离屏录制并清理临时文件' : '应用退出,已清理离屏录制临时文件') - if (pending) resolve({ path: '', bytes: 0, cancelled: true }) + if (pending) {resolve({ path: '', bytes: 0, cancelled: true })} } host.setTeardownHook(teardown) const fail = (error: unknown): void => { - if (settled) return + if (settled) {return} settled = true release() reject(error instanceof Error ? error : new Error(String(error))) } const cancel = (): void => { - if (settled) return + if (settled) {return} settled = true release() logger.info('recording', '离屏录制已取消,未生成视频文件') @@ -127,12 +128,12 @@ export function encodeMacOffscreenRecording(script: OffscreenRecordingScript, ho activeMacSession = { noteFrameAck: (count) => { pendingFrames = Math.max(0, pendingFrames - count) - if (pendingFrames === 0) frameDrainResolve?.() + if (pendingFrames === 0) {frameDrainResolve?.()} }, appendVideoChunk: (bytes, position) => { - if (!videoFile) return + if (!videoFile) {return} const copy = new Uint8Array(bytes) - videoWrite = videoWrite.then(() => videoFile!.write(copy, 0, copy.byteLength, position)).then(() => undefined) + videoWrite = videoWrite.then(() => videoFile!.write(copy, 0, copy.byteLength, position)).then(() => {}) }, completeVideo: () => { void videoWrite.then(() => videoCompleteResolve?.(), (error) => videoCompleteReject?.(error)) @@ -140,18 +141,18 @@ export function encodeMacOffscreenRecording(script: OffscreenRecordingScript, ho } void (async () => { const directory = await host.usableDirectory() - if (settled) return - if (!directory) throw new Error('请先选择可用的视频保存文件夹') + if (settled) {return} + if (!directory) {throw new Error('请先选择可用的视频保存文件夹')} await host.sweepStaleDirectories(directory) - if (settled) return + if (settled) {return} const createdTempDir = await mkdtemp(recordingPath(directory, OFFSCREEN_TEMP_PREFIX)) if (settled) { - void rm(createdTempDir, { recursive: true, force: true }).catch(() => undefined) + void rm(createdTempDir, { recursive: true, force: true }).catch(() => {}) return } tempDir = createdTempDir await writeFile(recordingPath(tempDir, OFFSCREEN_OWNER_FILE), String(process.pid), 'utf8') - if (settled) return + if (settled) {return} const temporaryPath = recordingPath(tempDir, 'recording.mp4.part') videoFile = await open(temporaryPath, 'w') const now = new Date() @@ -187,15 +188,15 @@ export function encodeMacOffscreenRecording(script: OffscreenRecordingScript, ho let frameIndex = 0 window.webContents.on('paint', (_event, _dirty, image) => { host.notePaintFrame() - if (settled || !capturing || image.isEmpty() || pendingFrames >= OFFSCREEN_MAX_PENDING_FRAMES) return + if (settled || !capturing || image.isEmpty() || pendingFrames >= OFFSCREEN_MAX_PENDING_FRAMES) {return} const size = image.getSize() if (!captureLogged) { captureLogged = true logger.info('recording', `离屏采集 ${size.width}x${size.height},输出 ${script.width}x${script.height}`, `窗口 ${script.width}x${script.height}(未按工作区缩放)`) - if (Math.abs(size.width / size.height - script.width / script.height) > 0.02) logger.warn('recording', '离屏采集比例与输出比例不一致,将以补边方式适配') + if (Math.abs(size.width / size.height - script.width / script.height) > 0.02) {logger.warn('recording', '离屏采集比例与输出比例不一致,将以补边方式适配')} } const frame = image.toJPEG(95) - if (frame.length === 0) return + if (frame.length === 0) {return} const captureTimeMs = Date.now() - recordingStartedAt pendingFrames += 1 window.webContents.send('recordings:offscreen-frame', frameIndex, captureTimeMs, frame) @@ -205,13 +206,13 @@ export function encodeMacOffscreenRecording(script: OffscreenRecordingScript, ho window.webContents.once('did-finish-load', () => resolveReady()) window.webContents.once('did-fail-load', (_event, code, description) => rejectReady(new Error(`${code}: ${description}`))) }) - const loading = process.env['ELECTRON_RENDERER_URL'] - ? window.loadURL(`${process.env['ELECTRON_RENDERER_URL']}/offscreen.html`) + const loading = process.env.ELECTRON_RENDERER_URL + ? window.loadURL(`${process.env.ELECTRON_RENDERER_URL}/offscreen.html`) : window.loadFile(join(__dirname, '../renderer/offscreen.html')) await Promise.all([loading, ready]) - if (settled) return + if (settled) {return} window.webContents.setFrameRate(targetFps) - const serialized = JSON.stringify(script).replace(/((resolveDrain) => { if (pendingFrames === 0) { @@ -249,7 +250,7 @@ export function encodeMacOffscreenRecording(script: OffscreenRecordingScript, ho } const timer = setTimeout(() => { frameDrainResolve = null - if (!settled) logger.warn('recording', '部分离屏帧尚未送达编码页,已按已到达帧继续编码') + if (!settled) {logger.warn('recording', '部分离屏帧尚未送达编码页,已按已到达帧继续编码')} resolveDrain() }, OFFSCREEN_ACK_DRAIN_TIMEOUT_MS) timer.unref?.() @@ -259,14 +260,14 @@ export function encodeMacOffscreenRecording(script: OffscreenRecordingScript, ho resolveDrain() } }) - if (settled) return + if (settled) {return} if (frameIndex === 0) { fail(new Error('离屏渲染未产生有效视频帧')) return } const measuredFps = offscreenFrameRate(frameIndex, recordingElapsedMs) logger.info('recording', `离屏录制 ${frameIndex} 帧 / ${(recordingElapsedMs / 1000).toFixed(1)} 秒,实测约 ${measuredFps.toFixed(1)} FPS`) - if (measuredFps < OFFSCREEN_MIN_FLUENT_FPS) logger.warn('recording', `离屏采集帧率偏低(${measuredFps.toFixed(1)} FPS),画面可能不够流畅`) + if (measuredFps < OFFSCREEN_MIN_FLUENT_FPS) {logger.warn('recording', `离屏采集帧率偏低(${measuredFps.toFixed(1)} FPS),画面可能不够流畅`)} const videoReady = new Promise((resolveVideo, rejectVideo) => { videoCompleteResolve = resolveVideo videoCompleteReject = rejectVideo @@ -281,20 +282,20 @@ export function encodeMacOffscreenRecording(script: OffscreenRecordingScript, ho ), withOffscreenTimeout(videoReady, encodeBudgetMs, '离屏视频编码超时,已中止录制') ]) - if (settled) return + if (settled) {return} await videoWrite await videoFile?.close() videoFile = null const bytes = await readFileSize(temporaryPath) - if (settled) return + if (settled) {return} await renameFile(temporaryPath, outputPath) if (settled) { - await rm(outputPath, { force: true }).catch(() => undefined) + await rm(outputPath, { force: true }).catch(() => {}) return } - await rm(tempDir, { recursive: true, force: true }).catch(() => undefined) + await rm(tempDir, { recursive: true, force: true }).catch(() => {}) if (settled) { - await rm(outputPath, { force: true }).catch(() => undefined) + await rm(outputPath, { force: true }).catch(() => {}) return } settled = true diff --git a/src/main/offscreenPaths.ts b/src/main/offscreenPaths.ts index a56ef48..7d30ded 100644 --- a/src/main/offscreenPaths.ts +++ b/src/main/offscreenPaths.ts @@ -1,11 +1,11 @@ import { isAbsolute, relative, resolve, sep } from 'node:path' export function resolveOffscreenEntry(directory: string, name: string): string | null { - if (!name || name.includes('/') || name.includes('\\')) return null - if (isAbsolute(name)) return null + if (!name || name.includes('/') || name.includes('\\')) {return null} + if (isAbsolute(name)) {return null} const base = resolve(directory) const candidate = resolve(base, name) const within = relative(base, candidate) - if (!within || within === '..' || within.startsWith(`..${sep}`) || isAbsolute(within)) return null + if (!within || within === '..' || within.startsWith(`..${sep}`) || isAbsolute(within)) {return null} return candidate } diff --git a/src/main/offscreenTiming.ts b/src/main/offscreenTiming.ts index e25e3aa..feeca30 100644 --- a/src/main/offscreenTiming.ts +++ b/src/main/offscreenTiming.ts @@ -8,8 +8,8 @@ export function offscreenScriptDurationMs(scenes: OffscreenSceneTiming[]): numbe } export function offscreenFrameRate(frameCount: number, elapsedMs: number): number { - if (!Number.isFinite(frameCount) || frameCount <= 0) return 1 - if (!Number.isFinite(elapsedMs) || elapsedMs <= 0) return 1 + if (!Number.isFinite(frameCount) || frameCount <= 0) {return 1} + if (!Number.isFinite(elapsedMs) || elapsedMs <= 0) {return 1} return Math.max(1, frameCount * 1000 / elapsedMs) } @@ -49,7 +49,7 @@ export function offscreenConcatPlaylist(frameNames: string[], durations: number[ lines.push(`option framerate ${concatFileFramerate}`) lines.push(`duration ${(durations[index] ?? 1 / 30).toFixed(6)}`) }) - if (frameNames.length) { + if (frameNames.length > 0) { lines.push(`file '${frameNames[frameNames.length - 1]}'`) lines.push(`option framerate ${concatFileFramerate}`) } diff --git a/src/main/onlineData.ts b/src/main/onlineData.ts index 2f1a757..78dca80 100644 --- a/src/main/onlineData.ts +++ b/src/main/onlineData.ts @@ -1,5 +1,5 @@ -import { createHash } from 'crypto' -import { join } from 'path' +import { createHash } from 'node:crypto' +import { join } from 'node:path' import type { EarthquakeFeed } from '../preload' import type { OnlineDataSnapshot, TyphoonFeed } from '../common/onlineData' import { loadEarthquakeFeed } from './datasets' @@ -29,14 +29,14 @@ async function loadTyphoons(signal: AbortSignal): Promise { let cached: TyphoonFeed | null = null try { const credentials = getQWeatherCredentials() - if (!credentials) return { typhoons: null, typhoonError: '', typhoonConfigured: false, typhoonStatus: 'unconfigured' } + if (!credentials) {return { typhoons: null, typhoonError: '', typhoonConfigured: false, typhoonStatus: 'unconfigured' }} const hostId = createHash('sha256').update(credentials.apiHost).digest('hex').slice(0, 16) const cachePath = join(dataPath, `typhoons-${hostId}.json`) cached = parseCachedTyphoons(await readJson(cachePath).catch(() => null)) signal.throwIfAborted() const typhoons = await fetchTyphoonFeed(credentials, signal) signal.throwIfAborted() - await writeJson(cachePath, typhoons).catch(() => undefined) + await writeJson(cachePath, typhoons).catch(() => {}) return { typhoons, typhoonError: '', typhoonConfigured: true, typhoonStatus: 'ready' } } catch (error) { return { typhoons: cached, typhoonError: error instanceof Error ? error.message : '台风数据获取失败', typhoonConfigured: true, typhoonStatus: 'error' } @@ -51,13 +51,13 @@ export function invalidateTyphoons(configured: boolean): void { } export function ensureTyphoons(retry = false): Promise { - if (typhoonRequest) return typhoonRequest - if (snapshot.typhoonStatus !== 'pending' && !(retry && snapshot.typhoonStatus === 'error')) return Promise.resolve(snapshot) + if (typhoonRequest) {return typhoonRequest} + if (snapshot.typhoonStatus !== 'pending' && !(retry && snapshot.typhoonStatus === 'error')) {return Promise.resolve(snapshot)} const controller = new AbortController() typhoonController = controller publish({ typhoonStatus: 'loading' }) const request = loadTyphoons(controller.signal).then((typhoons) => { - if (!controller.signal.aborted) publish(typhoons) + if (!controller.signal.aborted) {publish(typhoons)} return snapshot }).finally(() => { if (typhoonRequest === request) { @@ -83,19 +83,19 @@ export function startOnlineData(userDataPath: string, listener: (snapshot: Onlin } export async function getOnlineData(): Promise { - if (!startupData) throw new Error('在线数据尚未初始化') + if (!startupData) {throw new Error('在线数据尚未初始化')} await startupData return snapshot } export async function getStartupEarthquakes(): Promise { const data = await getOnlineData() - if (!data.earthquakes) throw new Error(data.earthquakeError) + if (!data.earthquakes) {throw new Error(data.earthquakeError)} return data.earthquakes } export function refreshEarthquakes(): Promise { - if (earthquakeRequest) return earthquakeRequest + if (earthquakeRequest) {return earthquakeRequest} const request = loadEarthquakeFeed().then((earthquakes) => { publish({ earthquakes, earthquakeError: earthquakes.stale ? '地震数据更新失败,暂显示上次数据' : '' }) return earthquakes @@ -103,7 +103,7 @@ export function refreshEarthquakes(): Promise { publish({ earthquakeError: '地震数据更新失败,请检查网络后重试' }) throw error instanceof Error ? error : new Error('地震数据更新失败,请检查网络后重试') }).finally(() => { - if (earthquakeRequest === request) earthquakeRequest = null + if (earthquakeRequest === request) {earthquakeRequest = null} }) earthquakeRequest = request return request diff --git a/src/main/posthogLogs.ts b/src/main/posthogLogs.ts index 5181183..70c3720 100644 --- a/src/main/posthogLogs.ts +++ b/src/main/posthogLogs.ts @@ -1,6 +1,7 @@ import { OTLPLogExporter } from '@opentelemetry/exporter-logs-otlp-http' import { resourceFromAttributes } from '@opentelemetry/resources' -import { BatchLogRecordProcessor, LoggerProvider, type LogRecordExporter } from '@opentelemetry/sdk-logs' +import { BatchLogRecordProcessor, LoggerProvider } from '@opentelemetry/sdk-logs'; +import type { LogRecordExporter } from '@opentelemetry/sdk-logs'; const viteEnv = import.meta.env as Partial | undefined const projectToken = (viteEnv ? import.meta.env.VITE_POSTHOG_PROJECT_TOKEN : undefined) || process.env.VITE_POSTHOG_PROJECT_TOKEN @@ -26,7 +27,7 @@ export function createGatedLogRecordExporter( exporter.export(logs, resultCallback) }, forceFlush() { - if (!isEnabled()) return Promise.resolve() + if (!isEnabled()) {return Promise.resolve()} return exporter.forceFlush() }, shutdown() { @@ -36,12 +37,12 @@ export function createGatedLogRecordExporter( } function ensureLogger(): ReturnType | null { - if (!posthogLogsEnabled) return null - if (posthogLogger) return posthogLogger + if (!posthogLogsEnabled) {return null} + if (posthogLogger) {return posthogLogger} if (!projectToken || !host) { if (!missingWarned && isDev) { missingWarned = true - const missingConfiguration = !projectToken ? 'VITE_POSTHOG_PROJECT_TOKEN' : 'VITE_POSTHOG_HOST' + const missingConfiguration = projectToken ? 'VITE_POSTHOG_HOST' : 'VITE_POSTHOG_PROJECT_TOKEN' console.warn(`${missingConfiguration} variable required by PostHog is missing or un-configured, this causes events to be silently missed. This error stops appearing once ${missingConfiguration} is configured`) } return null @@ -65,7 +66,7 @@ function ensureLogger(): ReturnType | null { activeExporterController = controller posthogLogger = provider.getLogger('guearth.posthog') } catch (error) { - if (isDev) console.warn('PostHog log export could not be initialized', error) + if (isDev) {console.warn('PostHog log export could not be initialized', error)} } return posthogLogger } @@ -80,7 +81,7 @@ export function setPosthogLogsEnabled(enabled: boolean): void { const activeProvider = provider provider = null posthogLogger = null - if (activeProvider) void activeProvider.shutdown().catch(() => undefined) + if (activeProvider) {void activeProvider.shutdown().catch(() => undefined)} return } ensureLogger() @@ -92,7 +93,7 @@ export function capturePosthogLog( attributes?: Record ): void { const activeLogger = ensureLogger() - if (!activeLogger) return + if (!activeLogger) {return} try { activeLogger.emit({ severityText, body, attributes }) } catch { @@ -103,7 +104,7 @@ export function capturePosthogLog( export async function shutdownPosthogLogs(): Promise { const activeProvider = provider const controller = activeExporterController - if (!activeProvider) return + if (!activeProvider) {return} provider = null posthogLogger = null activeExporterController = null @@ -112,14 +113,14 @@ export async function shutdownPosthogLogs(): Promise { await Promise.race([ activeProvider.shutdown(), new Promise((resolve) => { - timeout = setTimeout(resolve, 1_000) + timeout = setTimeout(resolve, 1000) timeout.unref() }) ]) } catch { return } finally { - if (controller) controller.active = false - if (timeout) clearTimeout(timeout) + if (controller) {controller.active = false} + if (timeout) {clearTimeout(timeout)} } } diff --git a/src/main/qweather.ts b/src/main/qweather.ts index 93649f6..444bc78 100644 --- a/src/main/qweather.ts +++ b/src/main/qweather.ts @@ -1,5 +1,6 @@ import { net } from 'electron' -import { normalizeQWeatherHost, type LiveStorm, type StormPoint, type TyphoonFeed } from '../common/onlineData' +import { normalizeQWeatherHost } from '../common/onlineData'; +import type { LiveStorm, StormPoint, TyphoonFeed } from '../common/onlineData'; import type { QWeatherCredentials } from './laboratory' function isRecord(value: unknown): value is Record { @@ -7,18 +8,18 @@ function isRecord(value: unknown): value is Record { } function numberValue(value: unknown): number | null { - if ((typeof value !== 'string' && typeof value !== 'number') || String(value).trim() === '') return null + if ((typeof value !== 'string' && typeof value !== 'number') || String(value).trim() === '') {return null} const number = Number(value) return Number.isFinite(number) ? number : null } function parsePoint(value: unknown, timeKey: 'time' | 'pubTime' | 'fxTime'): StormPoint { - if (!isRecord(value)) throw new Error('和风天气台风路径格式无效') + if (!isRecord(value)) {throw new Error('和风天气台风路径格式无效')} const longitude = numberValue(value.lon) const latitude = numberValue(value.lat) const time = value[timeKey] if (longitude === null || latitude === null || Math.abs(longitude) > 180 || Math.abs(latitude) > 90 - || typeof time !== 'string' || !Number.isFinite(Date.parse(time))) throw new Error('和风天气台风坐标或时间无效') + || typeof time !== 'string' || !Number.isFinite(Date.parse(time))) {throw new Error('和风天气台风坐标或时间无效')} const pressure = numberValue(value.pressure) const windSpeed = numberValue(value.windSpeed) return { @@ -30,23 +31,23 @@ function parsePoint(value: unknown, timeKey: 'time' | 'pubTime' | 'fxTime'): Sto } function parsePoints(value: unknown, timeKey: 'time' | 'fxTime'): StormPoint[] { - if (!Array.isArray(value) || value.length > 5000) throw new Error('和风天气台风路径格式无效') + if (!Array.isArray(value) || value.length > 5000) {throw new Error('和风天气台风路径格式无效')} const points = value.map((point) => parsePoint(point, timeKey)) return [...new Map(points.map((point) => [point.time, point])).values()].sort((a, b) => Date.parse(a.time) - Date.parse(b.time)) } -export function parseStormList(value: unknown): Array<{ id: string; name: string }> { - if (!Array.isArray(value) || value.length > 200) throw new Error('和风天气台风列表格式无效') +export function parseStormList(value: unknown): { id: string; name: string }[] { + if (!Array.isArray(value) || value.length > 200) {throw new Error('和风天气台风列表格式无效')} return value.flatMap((storm) => { if (!isRecord(storm) || !['0', '1'].includes(String(storm.isActive)) || typeof storm.id !== 'string' - || !/^[a-z0-9_-]{1,64}$/i.test(storm.id)) throw new Error('和风天气台风列表格式无效') - if (String(storm.isActive) !== '1') return [] + || !/^[a-z0-9_-]{1,64}$/i.test(storm.id)) {throw new Error('和风天气台风列表格式无效')} + if (String(storm.isActive) !== '1') {return []} return [{ id: storm.id, name: typeof storm.name === 'string' && storm.name ? storm.name.slice(0, 100) : storm.id }] }) } export function parseStormTrack(id: string, name: string, value: unknown): LiveStorm { - if (!isRecord(value) || !['0', '1'].includes(String(value.isActive))) throw new Error('和风天气台风实况格式无效') + if (!isRecord(value) || !['0', '1'].includes(String(value.isActive))) {throw new Error('和风天气台风实况格式无效')} return { id, name, active: String(value.isActive) === '1', now: value.now == null ? null : parsePoint(value.now, 'pubTime'), @@ -74,7 +75,7 @@ function apiError(code: string): Error { export async function fetchTyphoonFeed(credentials: QWeatherCredentials, cancellation?: AbortSignal): Promise { const host = normalizeQWeatherHost(credentials.apiHost) const controller = new AbortController() - const signal = AbortSignal.any([controller.signal, AbortSignal.timeout(20000), ...(cancellation ? [cancellation] : [])]) + const signal = AbortSignal.any([controller.signal, AbortSignal.timeout(20_000), ...(cancellation ? [cancellation] : [])]) const sources = new Set() const license = new Set() async function request(endpoint: string, params: Record): Promise> { @@ -87,16 +88,16 @@ export async function fetchTyphoonFeed(credentials: QWeatherCredentials, cancell } catch { throw new Error(signal.aborted ? '请求超时,请重试' : '连接失败,请检查网络或配置') } - if (!response.ok) throw apiError(String(response.status)) - if (response.status === 204) return { storm: [], forecast: [] } + if (!response.ok) {throw apiError(String(response.status))} + if (response.status === 204) {return { storm: [], forecast: [] }} const body = await response.text() - if (body.length > 5_000_000) throw new Error('返回数据异常') + if (body.length > 5_000_000) {throw new Error('返回数据异常')} let data: unknown try { data = JSON.parse(body) } catch { throw new Error('返回数据异常') } - if (!isRecord(data)) throw new Error('返回数据异常') + if (!isRecord(data)) {throw new Error('返回数据异常')} const code = String(data.code) - if (code === '204') return { storm: [], forecast: [] } - if (code !== '200') throw apiError(code) + if (code === '204') {return { storm: [], forecast: [] }} + if (code !== '200') {throw apiError(code)} if (isRecord(data.refer)) { strings(data.refer.sources).forEach((source) => sources.add(source)) strings(data.refer.license).forEach((item) => license.add(item)) @@ -132,15 +133,15 @@ export async function fetchTyphoonFeed(credentials: QWeatherCredentials, cancell export function parseCachedTyphoons(value: unknown): TyphoonFeed | null { if (!isRecord(value) || typeof value.fetchedAt !== 'number' || !Number.isFinite(value.fetchedAt) - || !Array.isArray(value.storms) || value.storms.length > 200) return null + || !Array.isArray(value.storms) || value.storms.length > 200) {return null} try { const fromCachedPoint = (point: unknown): StormPoint => { - if (!isRecord(point)) throw new Error('无效缓存') + if (!isRecord(point)) {throw new Error('无效缓存')} return parsePoint({ ...point, lon: point.longitude, lat: point.latitude }, 'time') } const storms: LiveStorm[] = value.storms.map((storm) => { if (!isRecord(storm) || typeof storm.id !== 'string' || typeof storm.name !== 'string' || typeof storm.active !== 'boolean' - || !Array.isArray(storm.track) || !Array.isArray(storm.forecast) || storm.track.length > 5000 || storm.forecast.length > 5000) throw new Error('无效缓存') + || !Array.isArray(storm.track) || !Array.isArray(storm.forecast) || storm.track.length > 5000 || storm.forecast.length > 5000) {throw new Error('无效缓存')} return { id: storm.id, name: storm.name, active: storm.active, now: storm.now === null ? null : fromCachedPoint(storm.now), track: storm.track.map(fromCachedPoint), forecast: storm.forecast.map(fromCachedPoint), diff --git a/src/main/storagePath.ts b/src/main/storagePath.ts index 1d647ff..ce9075b 100644 --- a/src/main/storagePath.ts +++ b/src/main/storagePath.ts @@ -1,7 +1,7 @@ -import { isAbsolute, join, normalize, relative } from 'path' +import { isAbsolute, join, normalize, relative } from 'node:path' function sanitizeStorageRoot(value: string): string { - if (!isAbsolute(value) || value.includes('\0')) throw new Error('Invalid storage directory') + if (!isAbsolute(value) || value.includes('\0')) {throw new Error('Invalid storage directory')} return normalize(value) } @@ -13,11 +13,11 @@ function sanitizeStorageSegment(value: string): string { } export function storageChildPath(directory: string, ...segments: string[]): string { - if (!segments.length) throw new Error('Missing storage path segment') + if (segments.length === 0) {throw new Error('Missing storage path segment')} const root = sanitizeStorageRoot(directory) let result = root - for (const segment of segments) result = join(result, sanitizeStorageSegment(segment)) + for (const segment of segments) {result = join(result, sanitizeStorageSegment(segment))} const child = relative(root, result) - if (!child || child.startsWith('..') || isAbsolute(child)) throw new Error('Storage path escapes its directory') + if (!child || child.startsWith('..') || isAbsolute(child)) {throw new Error('Storage path escapes its directory')} return result } diff --git a/src/main/tileCacheFiles.ts b/src/main/tileCacheFiles.ts index f30d52b..8962544 100644 --- a/src/main/tileCacheFiles.ts +++ b/src/main/tileCacheFiles.ts @@ -1,5 +1,5 @@ -import { readdir, stat, unlink } from 'fs/promises' -import { sep } from 'path' +import { readdir, stat, unlink } from 'node:fs/promises' +import { sep } from 'node:path' interface TileFile { path: string @@ -10,7 +10,7 @@ interface TileFile { export async function listTileFiles(directory: string): Promise { const files: TileFile[] = [] const pending = [directory] - while (pending.length) { + while (pending.length > 0) { const current = pending.pop()! let entries try { @@ -19,7 +19,7 @@ export async function listTileFiles(directory: string): Promise { continue } for (const entry of entries) { - if (entry.name === '.' || entry.name === '..' || entry.name.includes('/') || entry.name.includes('\\')) continue + if (entry.name === '.' || entry.name === '..' || entry.name.includes('/') || entry.name.includes('\\')) {continue} const path = `${current}${sep}${entry.name}` if (entry.isDirectory()) { pending.push(path) @@ -48,13 +48,13 @@ export async function pruneTileFiles(directory: string, maxBytes: number): Promi } const oldestFirst = [...tiles.values()].sort((a, b) => Math.max(...a.map((file) => file.mtimeMs)) - Math.max(...b.map((file) => file.mtimeMs))) for (const pair of oldestFirst) { - if (total <= maxBytes) break + if (total <= maxBytes) {break} for (const file of pair) { try { await unlink(file.path) total -= file.size } catch (error) { - if ((error as NodeJS.ErrnoException).code === 'ENOENT') total -= file.size + if ((error as NodeJS.ErrnoException).code === 'ENOENT') {total -= file.size} } } } diff --git a/src/main/tileWarp.ts b/src/main/tileWarp.ts index 1638847..178fdae 100644 --- a/src/main/tileWarp.ts +++ b/src/main/tileWarp.ts @@ -1,5 +1,5 @@ import { nativeImage } from 'electron' -import { endianness } from 'os' +import { endianness } from 'node:os' import { tileCenter, wgs84ToGcj02 } from './geo' const TILE_SIZE = 256 @@ -28,16 +28,16 @@ export function tileWgs84ShiftPixels(level: number, x: number, y: number): { dx: const [gcjLongitude, gcjLatitude] = wgs84ToGcj02(longitude, latitude) const deltaLongitude = gcjLongitude - longitude const deltaLatitude = gcjLatitude - latitude - if (deltaLongitude === 0 && deltaLatitude === 0) return null + if (deltaLongitude === 0 && deltaLatitude === 0) {return null} const worldPixels = TILE_SIZE * 2 ** level const dx = (deltaLongitude / 360) * worldPixels const dy = mercatorYFromLatitude(latitude + deltaLatitude, worldPixels) - mercatorYFromLatitude(latitude, worldPixels) - if (Math.abs(dx) < 0.5 && Math.abs(dy) < 0.5) return null + if (Math.abs(dx) < 0.5 && Math.abs(dy) < 0.5) {return null} return { dx, dy } } function swapRedBlueChannels(pixels: Buffer): void { - if (!NATIVE_BITMAP_IS_BGRA) return + if (!NATIVE_BITMAP_IS_BGRA) {return} for (let offset = 0; offset < pixels.length; offset += 4) { const first = pixels[offset] pixels[offset] = pixels[offset + 2] @@ -47,9 +47,9 @@ function swapRedBlueChannels(pixels: Buffer): void { function decodeTilePixels(tile: WarpSourceTile): Buffer | null { const image = nativeImage.createFromBuffer(Buffer.from(tile.buffer)) - if (image.isEmpty()) return null + if (image.isEmpty()) {return null} const size = image.getSize() - if (size.width !== TILE_SIZE || size.height !== TILE_SIZE) return null + if (size.width !== TILE_SIZE || size.height !== TILE_SIZE) {return null} const pixels = image.toBitmap() swapRedBlueChannels(pixels) return pixels @@ -61,7 +61,7 @@ function bufferToArrayBuffer(data: Buffer): ArrayBuffer { export async function warpTileToWgs84(level: number, x: number, y: number, fetchSourceTile: WarpSourceFetcher): Promise { const shift = tileWgs84ShiftPixels(level, x, y) - if (!shift) return null + if (!shift) {return null} const worldTiles = 2 ** level const baseX = x * TILE_SIZE const baseY = y * TILE_SIZE @@ -87,11 +87,11 @@ export async function warpTileToWgs84(level: number, x: number, y: number, fetch let contentType: string | null = null for (let index = 0; index < fetched.length; index += 1) { const tile = fetched[index] - if (!tile) return null + if (!tile) {return null} const pixels = decodeTilePixels(tile) - if (!pixels) return null - if (tile.contentType.includes('png')) contentType = 'image/png' - else if (contentType === null) contentType = 'image/jpeg' + if (!pixels) {return null} + if (tile.contentType.includes('png')) {contentType = 'image/png'} + else if (contentType === null) {contentType = 'image/jpeg'} const canvasX = (index % columns) * TILE_SIZE const canvasY = Math.floor(index / columns) * TILE_SIZE for (let line = 0; line < TILE_SIZE; line += 1) { @@ -182,7 +182,7 @@ export async function warpTileToWgs84(level: number, x: number, y: number, fetch } swapRedBlueChannels(output) const image = nativeImage.createFromBitmap(output, { width: TILE_SIZE, height: TILE_SIZE }) - if (image.isEmpty()) return null + if (image.isEmpty()) {return null} const data = contentType === 'image/png' ? image.toPNG() : image.toJPEG(92) return { data: bufferToArrayBuffer(data), contentType: contentType ?? 'image/png' } } diff --git a/src/main/updateChannel.ts b/src/main/updateChannel.ts index dd5cdf9..e4c5716 100644 --- a/src/main/updateChannel.ts +++ b/src/main/updateChannel.ts @@ -1,5 +1,5 @@ -import { chmodSync, copyFileSync, linkSync, lstatSync, realpathSync, renameSync, rmSync } from 'fs' -import { basename, dirname, isAbsolute, join, resolve, sep } from 'path' +import { chmodSync, copyFileSync, linkSync, lstatSync, realpathSync, renameSync, rmSync } from 'node:fs' +import { basename, dirname, isAbsolute, join, resolve, sep } from 'node:path' const SAFE_ASSET_NAME = /^[A-Za-z0-9][A-Za-z0-9._+-]*$/ const VERSIONED_FILE_NAME = /\d+\.\d+\.\d+/ @@ -54,9 +54,9 @@ export interface CommandPlan { } export function canonicalHazelPlatform(platform: string): string | null { - if (Object.prototype.hasOwnProperty.call(HAZEL_ALIASES, platform)) return platform + if (Object.hasOwn(HAZEL_ALIASES, platform)) {return platform} for (const [guess, aliases] of Object.entries(HAZEL_ALIASES)) { - if (aliases.includes(platform)) return guess + if (aliases.includes(platform)) {return guess} } return null } @@ -65,9 +65,9 @@ export function hazelPlatformForAssetName(fileName: string): string | null { const slash = Math.max(fileName.lastIndexOf('/'), fileName.lastIndexOf('\\')) const base = slash >= 0 ? fileName.slice(slash + 1) : fileName const dot = base.lastIndexOf('.') - if (dot <= 0) return null + if (dot <= 0) {return null} const extension = base.slice(dot + 1) - if (!HAZEL_EXTENSIONS.has(extension)) return null + if (!HAZEL_EXTENSIONS.has(extension)) {return null} const archSuffix = base.includes('arm64') || base.includes('aarch64') ? '_arm64' : '' return `${extension}${archSuffix}` } @@ -76,13 +76,13 @@ export function assetNameFromUrl(downloadUrl: string): string | null { let pathname = '' try { const parsed = new URL(downloadUrl) - if (parsed.protocol !== 'https:' && parsed.protocol !== 'http:') return null + if (parsed.protocol !== 'https:' && parsed.protocol !== 'http:') {return null} pathname = parsed.pathname } catch { return null } const raw = pathname.split('/').pop() ?? '' - if (!raw) return null + if (!raw) {return null} let name = '' try { name = decodeURIComponent(raw) @@ -103,44 +103,44 @@ export function updateFeedPath(baseUrl: string, feedPlatform: string, currentVer } export function feedPlatformFor(kind: UpdatePackageKind, arch: UpdateArch): string | null { - if (kind === 'nsis' && arch === 'x64') return 'win32' - if (kind === 'appimage' && arch === 'x64') return 'appimage' - if (kind === 'appimage' && arch === 'arm64') return 'appimage_arm64' - if (kind === 'deb' && arch === 'x64') return 'deb' - if (kind === 'deb' && arch === 'arm64') return 'deb_arm64' + if (kind === 'nsis' && arch === 'x64') {return 'win32'} + if (kind === 'appimage' && arch === 'x64') {return 'appimage'} + if (kind === 'appimage' && arch === 'arm64') {return 'appimage_arm64'} + if (kind === 'deb' && arch === 'x64') {return 'deb'} + if (kind === 'deb' && arch === 'arm64') {return 'deb_arm64'} return null } function asArch(arch: string): UpdateArch | null { - if (arch === 'x64' || arch === 'arm64') return arch + if (arch === 'x64' || arch === 'arm64') {return arch} return null } export function resolveLinuxPackageKind(runtime: UpdateRuntime): 'appimage' | 'deb' | null { const override = runtime.packageKindOverride?.trim() - if (runtime.allowPackageKindOverride && (override === 'appimage' || override === 'deb')) return override - if (runtime.appImagePath && runtime.appImagePath.trim()) return 'appimage' - if (runtime.debInstalled) return 'deb' + if (runtime.allowPackageKindOverride && (override === 'appimage' || override === 'deb')) {return override} + if (runtime.appImagePath?.trim()) {return 'appimage'} + if (runtime.debInstalled) {return 'deb'} return null } export function resolveUpdateTarget(runtime: UpdateRuntime): UpdateTarget | null { const arch = asArch(runtime.arch) - if (!arch) return null + if (!arch) {return null} if (runtime.platform === 'win32') { - if (arch !== 'x64') return null + if (arch !== 'x64') {return null} return { kind: 'nsis', arch, feedPlatform: 'win32' } } - if (runtime.platform !== 'linux') return null + if (runtime.platform !== 'linux') {return null} const kind = resolveLinuxPackageKind(runtime) - if (!kind) return null + if (!kind) {return null} const feedPlatform = feedPlatformFor(kind, arch) - if (!feedPlatform) return null + if (!feedPlatform) {return null} return { kind, arch, feedPlatform } } export function isPathInsideDirectory(filePath: string, directory: string): boolean { - if (!filePath || !directory) return false + if (!filePath || !directory) {return false} const root = resolve(directory) const target = resolve(filePath) const prefix = root.endsWith(sep) ? root : `${root}${sep}` @@ -148,17 +148,17 @@ export function isPathInsideDirectory(filePath: string, directory: string): bool } export function appImageInstallDestination(currentPath: string, assetFileName: string): string | null { - if (!isAbsolute(currentPath) || currentPath.includes('\0')) return null - if (!SAFE_ASSET_NAME.test(assetFileName)) return null + if (!isAbsolute(currentPath) || currentPath.includes('\0')) {return null} + if (!SAFE_ASSET_NAME.test(assetFileName)) {return null} const existingBaseName = basename(currentPath) - if (existingBaseName === assetFileName || !VERSIONED_FILE_NAME.test(existingBaseName)) return currentPath + if (existingBaseName === assetFileName || !VERSIONED_FILE_NAME.test(existingBaseName)) {return currentPath} return join(dirname(currentPath), assetFileName) } export function installAppImageFile(installerPath: string, currentAppImage: string, assetFileName: string): string { - if (!ABSOLUTE_PATH.test(installerPath)) throw new Error('更新包路径无效') + if (!ABSOLUTE_PATH.test(installerPath)) {throw new Error('更新包路径无效')} const destination = appImageInstallDestination(currentAppImage, assetFileName) - if (!destination) throw new Error('AppImage 路径无效,无法安装更新') + if (!destination) {throw new Error('AppImage 路径无效,无法安装更新')} chmodSync(installerPath, 0o755) const staged = join(dirname(destination), `.${basename(destination)}.update`) rmSync(staged, { force: true }) @@ -173,37 +173,37 @@ export function installAppImageFile(installerPath: string, currentAppImage: stri } catch (error) { rmSync(staged, { force: true }) const reason = error instanceof Error ? error.message : String(error) - throw new Error(`无法替换 AppImage:${reason}`) + throw new Error(`无法替换 AppImage:${reason}`, { cause: error }) } chmodSync(destination, 0o755) - if (installerPath !== destination) rmSync(installerPath, { force: true }) - if (destination !== currentAppImage) rmSync(currentAppImage, { force: true }) + if (installerPath !== destination) {rmSync(installerPath, { force: true })} + if (destination !== currentAppImage) {rmSync(currentAppImage, { force: true })} return destination } function isTrustedDebTool(filePath: string | null, name: string): filePath is string { - if (!filePath || !ABSOLUTE_PATH.test(filePath)) return false + if (!filePath || !ABSOLUTE_PATH.test(filePath)) {return false} return basename(filePath) === name && TRUSTED_EXECUTABLE_DIRS.includes(dirname(filePath)) } export function findTrustedExecutable(name: string, directories: readonly string[] = TRUSTED_EXECUTABLE_DIRS): string | null { - if (!TRUSTED_DEB_TOOLS.has(name)) return null + if (!TRUSTED_DEB_TOOLS.has(name)) {return null} const seen = new Set() for (const dir of directories) { - if (!isAbsolute(dir) || dir.includes('\0')) continue + if (!isAbsolute(dir) || dir.includes('\0')) {continue} let root: string try { root = realpathSync(dir) } catch { continue } - if (seen.has(root)) continue + if (seen.has(root)) {continue} seen.add(root) const candidate = join(root, name) try { - if (!lstatSync(candidate).isFile()) continue + if (!lstatSync(candidate).isFile()) {continue} const real = realpathSync(candidate) - if (dirname(real) !== root || basename(real) !== name) continue + if (dirname(real) !== root || basename(real) !== name) {continue} return real } catch { void 0 @@ -213,9 +213,9 @@ export function findTrustedExecutable(name: string, directories: readonly string } export function debInstallPlan(installerPath: string, uid: number, dpkgPath: string | null, pkexecPath: string | null): CommandPlan | null { - if (!ABSOLUTE_PATH.test(installerPath)) return null - if (!isTrustedDebTool(dpkgPath, 'dpkg')) return null - if (uid === 0) return { command: dpkgPath, args: ['-i', installerPath] } - if (!isTrustedDebTool(pkexecPath, 'pkexec')) return null + if (!ABSOLUTE_PATH.test(installerPath)) {return null} + if (!isTrustedDebTool(dpkgPath, 'dpkg')) {return null} + if (uid === 0) {return { command: dpkgPath, args: ['-i', installerPath] }} + if (!isTrustedDebTool(pkexecPath, 'pkexec')) {return null} return { command: pkexecPath, args: ['--disable-internal-agent', dpkgPath, '-i', installerPath] } } diff --git a/src/main/updateIntegrity.ts b/src/main/updateIntegrity.ts index dfb7650..3f75bc6 100644 --- a/src/main/updateIntegrity.ts +++ b/src/main/updateIntegrity.ts @@ -1,21 +1,21 @@ -import { createHash } from 'crypto' -import { createReadStream } from 'fs' +import { createHash } from 'node:crypto' +import { createReadStream } from 'node:fs' const SHA256_HEX_PATTERN = /^[0-9a-f]{64}$/ const SHA256_BASE64_PATTERN = /^[A-Za-z0-9+/]{43}=$/ function stripSha256Prefix(value: string): { prefixed: boolean; value: string } { const lowered = value.toLowerCase() - if (lowered.startsWith('sha256-')) return { prefixed: true, value: value.slice('sha256-'.length) } - if (lowered.startsWith('sha256:')) return { prefixed: true, value: value.slice('sha256:'.length) } + if (lowered.startsWith('sha256-')) {return { prefixed: true, value: value.slice('sha256-'.length) }} + if (lowered.startsWith('sha256:')) {return { prefixed: true, value: value.slice('sha256:'.length) }} return { prefixed: false, value } } export function parseSha256(raw: unknown): string | null { - if (typeof raw !== 'string') return null + if (typeof raw !== 'string') {return null} const { prefixed, value } = stripSha256Prefix(raw.trim()) const lowered = value.toLowerCase() - if (SHA256_HEX_PATTERN.test(lowered)) return lowered + if (SHA256_HEX_PATTERN.test(lowered)) {return lowered} if (prefixed && SHA256_BASE64_PATTERN.test(value)) { const decoded = Buffer.from(value, 'base64').toString('hex') return SHA256_HEX_PATTERN.test(decoded) ? decoded : null @@ -41,24 +41,24 @@ export function releaseTagCandidates(rawName: unknown, version: string): string[ const candidates: string[] = [] if (typeof rawName === 'string') { const name = rawName.trim() - if (name) candidates.push(name) + if (name) {candidates.push(name)} } for (const candidate of [`v${version}`, version]) { - if (!candidates.includes(candidate)) candidates.push(candidate) + if (!candidates.includes(candidate)) {candidates.push(candidate)} } return candidates } export function extractAssetDigest(release: unknown, downloadUrl: string): string | null { - if (!isRecord(release) || !Array.isArray(release['assets'])) return null + if (!isRecord(release) || !Array.isArray(release.assets)) {return null} const fileName = downloadUrl.split('/').pop() ?? '' - for (const entry of release['assets']) { - if (!isRecord(entry) || entry['state'] !== 'uploaded') continue - const urlMatches = entry['browser_download_url'] === downloadUrl - const nameMatches = fileName !== '' && entry['name'] === fileName - if (!urlMatches && !nameMatches) continue - const digest = parseSha256(entry['digest']) - if (digest) return digest + for (const entry of release.assets) { + if (!isRecord(entry) || entry.state !== 'uploaded') {continue} + const urlMatches = entry.browser_download_url === downloadUrl + const nameMatches = fileName !== '' && entry.name === fileName + if (!urlMatches && !nameMatches) {continue} + const digest = parseSha256(entry.digest) + if (digest) {return digest} } return null } @@ -66,8 +66,8 @@ export function extractAssetDigest(release: unknown, downloadUrl: string): strin function splitVersion(version: string): [number[], string] { const withoutBuild = version.trim().replace(/^v/, '').split('+')[0] const hyphen = withoutBuild.indexOf('-') - const core = hyphen >= 0 ? withoutBuild.slice(0, hyphen) : withoutBuild - const prerelease = hyphen >= 0 ? withoutBuild.slice(hyphen + 1) : '' + const core = hyphen !== -1 ? withoutBuild.slice(0, hyphen) : withoutBuild + const prerelease = hyphen !== -1 ? withoutBuild.slice(hyphen + 1) : '' const numbers = core.split('.').map((part) => Number.parseInt(part, 10) || 0) return [numbers, prerelease] } @@ -77,20 +77,20 @@ function isNumericIdentifier(identifier: string): boolean { } function comparePrerelease(left: string, right: string): number { - if (left === right) return 0 - if (!left) return 1 - if (!right) return -1 + if (left === right) {return 0} + if (!left) {return 1} + if (!right) {return -1} const leftParts = left.split('.') const rightParts = right.split('.') const length = Math.max(leftParts.length, rightParts.length) for (let index = 0; index < length; index += 1) { const leftPart = leftParts[index] const rightPart = rightParts[index] - if (leftPart === undefined) return -1 - if (rightPart === undefined) return 1 + if (leftPart === undefined) {return -1} + if (rightPart === undefined) {return 1} if (isNumericIdentifier(leftPart) && isNumericIdentifier(rightPart)) { const diff = Number(leftPart) - Number(rightPart) - if (diff !== 0) return diff < 0 ? -1 : 1 + if (diff !== 0) {return diff < 0 ? -1 : 1} } else if (isNumericIdentifier(leftPart) !== isNumericIdentifier(rightPart)) { return isNumericIdentifier(leftPart) ? -1 : 1 } else if (leftPart !== rightPart) { @@ -106,7 +106,7 @@ export function compareVersions(left: string, right: string): number { const length = Math.max(leftCore.length, rightCore.length) for (let index = 0; index < length; index += 1) { const diff = (leftCore[index] ?? 0) - (rightCore[index] ?? 0) - if (diff !== 0) return diff < 0 ? -1 : 1 + if (diff !== 0) {return diff < 0 ? -1 : 1} } return comparePrerelease(leftPre, rightPre) } diff --git a/src/main/updater.ts b/src/main/updater.ts index 1b1eaa5..9216689 100644 --- a/src/main/updater.ts +++ b/src/main/updater.ts @@ -1,29 +1,19 @@ import { app, BrowserWindow, ipcMain, net } from 'electron' -import { spawn } from 'child_process' -import { createHash } from 'crypto' -import { createWriteStream, existsSync, mkdirSync, readdirSync, realpathSync, renameSync, rmSync, type WriteStream } from 'fs' -import { join } from 'path' +import { spawn } from 'node:child_process' +import { createHash } from 'node:crypto' +import { createWriteStream, existsSync, mkdirSync, readdirSync, realpathSync, renameSync, rmSync } from 'fs'; +import type { WriteStream } from 'fs'; +import { join } from 'node:path' import { logger } from '../common/logger' import type { UpdateCheckOutcome, UpdateState, UpdaterEvent } from '../preload' -import { - assetNameFromUrl, - assetNameMatchesFeed, - debInstallPlan, - findTrustedExecutable, - installAppImageFile, - isDebInstallLocation, - isPathInsideDirectory, - resolveUpdateTarget, - updateFeedPath, - type UpdateRuntime, - type UpdateTarget -} from './updateChannel' +import { assetNameFromUrl, assetNameMatchesFeed, debInstallPlan, findTrustedExecutable, installAppImageFile, isDebInstallLocation, isPathInsideDirectory, resolveUpdateTarget, updateFeedPath } from './updateChannel'; +import type { UpdateRuntime, UpdateTarget } from './updateChannel'; import { compareVersions, extractAssetDigest, hashFile, isRecord, parseSha256, releaseTagCandidates } from './updateIntegrity' const DEFAULT_UPDATE_BASE_URL = 'https://guearth-updater.isla.fan' const GITHUB_API_BASE = 'https://api.github.com' const RELEASES_REPO = 'Proj-Pigeon/GuEarth' -const CHECK_TIMEOUT_MS = 15000 +const CHECK_TIMEOUT_MS = 15_000 const PROGRESS_EMIT_INTERVAL_MS = 400 const VERSION_PATTERN = /^\d+\.\d+\.\d+(?:[-+][0-9A-Za-z.-]+)?$/ const INSTALL_QUIT_DELAY_MS = 300 @@ -48,7 +38,7 @@ function debInstallDetected(): boolean { resolved.push(candidate) try { const real = realpathSync(candidate) - if (real !== candidate) resolved.push(real) + if (real !== candidate) {resolved.push(real)} } catch { void 0 } @@ -60,10 +50,10 @@ function updateRuntime(): UpdateRuntime { return { platform: process.platform, arch: process.arch, - appImagePath: process.env['APPIMAGE'], + appImagePath: process.env.APPIMAGE, debInstalled: debInstallDetected(), - packageKindOverride: process.env['GUEARTH_UPDATE_PACKAGE'], - allowPackageKindOverride: process.env['GUEARTH_UPDATE_URL'] !== undefined + packageKindOverride: process.env.GUEARTH_UPDATE_PACKAGE, + allowPackageKindOverride: process.env.GUEARTH_UPDATE_URL !== undefined } } @@ -72,16 +62,16 @@ function currentTarget(): UpdateTarget | null { } function updateCheckEnabled(): boolean { - return (app.isPackaged || process.env['GUEARTH_UPDATE_URL'] !== undefined) && currentTarget() !== null + return (app.isPackaged || process.env.GUEARTH_UPDATE_URL !== undefined) && currentTarget() !== null } function updateBaseUrl(): string { - return process.env['GUEARTH_UPDATE_URL'] ?? DEFAULT_UPDATE_BASE_URL + return process.env.GUEARTH_UPDATE_URL ?? DEFAULT_UPDATE_BASE_URL } function installerPathFor(target: UpdateTarget, targetVersion: string): string { - if (target.kind === 'nsis') return join(downloadsDir, `guearth-${targetVersion}-setup.exe`) - if (target.kind === 'appimage') return join(downloadsDir, `guearth-${targetVersion}-${target.arch}.AppImage`) + if (target.kind === 'nsis') {return join(downloadsDir, `guearth-${targetVersion}-setup.exe`)} + if (target.kind === 'appimage') {return join(downloadsDir, `guearth-${targetVersion}-${target.arch}.AppImage`)} return join(downloadsDir, `guearth-${targetVersion}-${target.arch}.deb`) } @@ -99,12 +89,12 @@ function snapshot(): UpdateState { function emit(event: UpdaterEvent): void { for (const win of BrowserWindow.getAllWindows()) { - if (!win.isDestroyed()) win.webContents.send('updater:event', event) + if (!win.isDestroyed()) {win.webContents.send('updater:event', event)} } } function cleanupStaleInstallers(keepPath: string): void { - if (!existsSync(downloadsDir)) return + if (!existsSync(downloadsDir)) {return} for (const name of readdirSync(downloadsDir)) { const path = join(downloadsDir, name) if (path !== keepPath) { @@ -124,7 +114,7 @@ async function resolveDigestFromGitHub(rawName: unknown, version: string, downlo headers: { Accept: 'application/vnd.github+json' }, signal: AbortSignal.timeout(CHECK_TIMEOUT_MS) }) - if (response.status !== 200) continue + if (response.status !== 200) {continue} const digest = extractAssetDigest(await response.json(), downloadUrl) if (digest) { logger.info('updater', '更新源清单未携带 sha256,已从 GitHub 发布资产摘要解析校验值', { tag }) @@ -138,20 +128,20 @@ async function resolveDigestFromGitHub(rawName: unknown, version: string, downlo } async function checkForUpdate(): Promise { - if (status === 'downloading' || status === 'ready') return 'available' + if (status === 'downloading' || status === 'ready') {return 'available'} const target = currentTarget() - if (!target) return 'disabled' + if (!target) {return 'disabled'} try { const response = await net.fetch(updateFeedPath(updateBaseUrl(), target.feedPlatform, app.getVersion()), { signal: AbortSignal.timeout(CHECK_TIMEOUT_MS) }) - if (response.status === 204) return 'latest' - if (!response.ok) return 'failed' + if (response.status === 204) {return 'latest'} + if (!response.ok) {return 'failed'} const payload: unknown = await response.json() - if (!isRecord(payload)) return 'failed' + if (!isRecord(payload)) {return 'failed'} const remoteVersion = typeof payload.name === 'string' ? payload.name.replace(/^v/, '').trim() : '' const url = typeof payload.url === 'string' ? payload.url.trim() : '' - if (!VERSION_PATTERN.test(remoteVersion)) return 'failed' - if (compareVersions(remoteVersion, app.getVersion()) <= 0) return 'latest' - if (!/^https?:\/\/\S+$/i.test(url)) return 'failed' + if (!VERSION_PATTERN.test(remoteVersion)) {return 'failed'} + if (compareVersions(remoteVersion, app.getVersion()) <= 0) {return 'latest'} + if (!/^https?:\/\/\S+$/i.test(url)) {return 'failed'} const assetName = assetNameFromUrl(url) if (!assetName || !assetNameMatchesFeed(assetName, target.feedPlatform)) { logger.warn('updater', '更新包与当前安装平台不匹配,已忽略该更新', { feedPlatform: target.feedPlatform, assetName: assetName ?? '' }) @@ -186,7 +176,7 @@ function finishStream(stream: WriteStream): Promise { } async function cachedInstallerIsTrustworthy(path: string): Promise { - if (!expectedSha256) return false + if (!expectedSha256) {return false} try { return (await hashFile(path)) === expectedSha256 } catch { @@ -196,7 +186,7 @@ async function cachedInstallerIsTrustworthy(path: string): Promise { async function downloadUpdate(): Promise { const target = activeTarget - if (status !== 'available' || !downloadUrl || !target) throw new Error('当前没有可用更新') + if (status !== 'available' || !downloadUrl || !target) {throw new Error('当前没有可用更新')} status = 'downloading' const finalPath = installerPathFor(target, version) if (existsSync(finalPath) && (await cachedInstallerIsTrustworthy(finalPath))) { @@ -226,19 +216,19 @@ async function downloadUpdate(): Promise { const streamFailure = new Promise((_, reject) => { activeStream.once('error', (error) => reject(error)) }) - void streamFailure.catch(() => undefined) + void streamFailure.catch(() => {}) const response = await net.fetch(downloadUrl, { redirect: 'follow' }) - if (!response.ok || !response.body) throw new Error(`下载失败(HTTP ${response.status})`) + if (!response.ok || !response.body) {throw new Error(`下载失败(HTTP ${response.status})`)} const contentType = response.headers.get('content-type') ?? '' - if (contentType.includes('text/html')) throw new Error('更新下载地址无效') + if (contentType.includes('text/html')) {throw new Error('更新下载地址无效')} const lengthHeader = Number(response.headers.get('content-length') ?? 0) totalBytes = Number.isFinite(lengthHeader) && lengthHeader > 0 ? lengthHeader : 0 reader = response.body.getReader() let lastEmitAt = 0 for (;;) { const { done, value } = await Promise.race([reader.read(), streamFailure]) - if (done) break - if (!value?.byteLength) continue + if (done) {break} + if (!value?.byteLength) {continue} receivedBytes += value.byteLength hash.update(value) if (!activeStream.write(Buffer.from(value))) { @@ -250,9 +240,9 @@ async function downloadUpdate(): Promise { emit({ type: 'progress', received: receivedBytes, total: totalBytes }) } } - if (totalBytes > 0 && receivedBytes !== totalBytes) throw new Error('更新下载不完整') + if (totalBytes > 0 && receivedBytes !== totalBytes) {throw new Error('更新下载不完整')} await Promise.race([finishStream(activeStream), streamFailure]) - if (hash.digest('hex') !== expectedSha256) throw new Error('更新包校验失败,安装包可能与发布版本不一致') + if (hash.digest('hex') !== expectedSha256) {throw new Error('更新包校验失败,安装包可能与发布版本不一致')} renameSync(tempPath, finalPath) installerPath = finalPath status = 'ready' @@ -266,7 +256,7 @@ async function downloadUpdate(): Promise { stream!.destroy() }) } - void reader?.cancel().catch(() => undefined) + void reader?.cancel().catch(() => {}) try { rmSync(tempPath, { force: true }) } catch { @@ -323,19 +313,19 @@ function relaunch(binary: string, extraEnv?: Record): void { async function installDebPackage(filePath: string): Promise { const uid = typeof process.getuid === 'function' ? process.getuid() : -1 const plan = debInstallPlan(filePath, uid, findTrustedExecutable('dpkg'), findTrustedExecutable('pkexec')) - if (!plan) throw new Error('未找到 dpkg 或 pkexec,无法安装 deb 更新') + if (!plan) {throw new Error('未找到 dpkg 或 pkexec,无法安装 deb 更新')} const code = await runCommand(plan.command, plan.args) - if (code === 0) return - if (code === 126 || code === 127) throw new Error('系统授权未完成,更新未安装') + if (code === 0) {return} + if (code === 126 || code === 127) {throw new Error('系统授权未完成,更新未安装')} throw new Error(`deb 安装失败(退出码 ${code})`) } async function installUpdate(): Promise { - if (installing) return + if (installing) {return} const target = activeTarget const filePath = installerPath - if (status !== 'ready' || !filePath || !target || !existsSync(filePath)) throw new Error('更新尚未下载完成') - if (!isPathInsideDirectory(filePath, downloadsDir)) throw new Error('更新包路径无效') + if (status !== 'ready' || !filePath || !target || !existsSync(filePath)) {throw new Error('更新尚未下载完成')} + if (!isPathInsideDirectory(filePath, downloadsDir)) {throw new Error('更新包路径无效')} installing = true try { if (!(await cachedInstallerIsTrustworthy(filePath))) { @@ -349,10 +339,10 @@ async function installUpdate(): Promise { installWindows(filePath) return } - if (!assetNameMatchesFeed(assetFileName, target.feedPlatform)) throw new Error('更新包与当前平台不匹配') + if (!assetNameMatchesFeed(assetFileName, target.feedPlatform)) {throw new Error('更新包与当前平台不匹配')} if (target.kind === 'appimage') { - const appImagePath = process.env['APPIMAGE'] - if (!appImagePath) throw new Error('当前不是 AppImage 运行环境,无法替换安装文件') + const appImagePath = process.env.APPIMAGE + if (!appImagePath) {throw new Error('当前不是 AppImage 运行环境,无法替换安装文件')} const destination = installAppImageFile(filePath, appImagePath, assetFileName) relaunch(destination, { APPIMAGE: destination, APPIMAGE_SILENT_INSTALL: 'true' }) return @@ -374,16 +364,16 @@ export function initUpdater(userDataUpdatesPath: string): void { downloadsDir = userDataUpdatesPath ipcMain.handle('updater:get-state', () => snapshot()) ipcMain.handle('updater:download', () => { - if (status === 'downloading') throw new Error('更新正在下载中') - if (status === 'ready') return - if (status !== 'available' || !downloadUrl || !activeTarget) throw new Error('当前没有可用更新') + if (status === 'downloading') {throw new Error('更新正在下载中')} + if (status === 'ready') {return} + if (status !== 'available' || !downloadUrl || !activeTarget) {throw new Error('当前没有可用更新')} void downloadUpdate() }) ipcMain.handle('updater:install', () => installUpdate()) ipcMain.handle('updater:check', (): Promise => { - if (!updateCheckEnabled()) return Promise.resolve('disabled') + if (!updateCheckEnabled()) {return Promise.resolve('disabled')} return checkForUpdate() }) - if (!updateCheckEnabled()) return + if (!updateCheckEnabled()) {return} void checkForUpdate() } diff --git a/src/preload/index.d.ts b/src/preload/index.d.ts index bdfb254..a1055dc 100644 --- a/src/preload/index.d.ts +++ b/src/preload/index.d.ts @@ -6,4 +6,4 @@ declare global { } } -export {} + diff --git a/src/preload/index.ts b/src/preload/index.ts index 287b12d..1c6d100 100644 --- a/src/preload/index.ts +++ b/src/preload/index.ts @@ -4,7 +4,8 @@ import type { PoiStatisticsRequest, PoiStatisticsResult } from '../common/poiSta import type { AccountDeviceChallenge, AccountPhase, AccountProfile, AccountState } from '../common/passport' import type { MirrorEndpointId, MirrorEndpointPreference, MirrorEndpointProbeResult, TileMirrorMode } from '../common/tileMirror' import type { TouchInteractionMode } from '../common/touchInteraction' -import { isThemeMode, type ResolvedTheme, type ThemeMode } from '../common/themeMode' +import { isThemeMode } from '../common/themeMode'; +import type { ResolvedTheme, ThemeMode } from '../common/themeMode'; import type { EnsoPhase } from '../common/thematicState' import type { LaboratoryProvider, LaboratoryProviderInput, OnlineDataSnapshot } from '../common/onlineData' @@ -435,7 +436,7 @@ export interface OffscreenRecordingScript { scenes: TeachingScene[] annotations: OffscreenRecordingAnnotation[] terrain: OffscreenRecordingTerrain - seaLevelHeights?: Array + seaLevelHeights?: (number | null)[] prewarmQuality: OffscreenPrewarmQuality centerTarget: boolean width: number @@ -511,7 +512,7 @@ interface PreloadGlobal { function applyInitialDocumentAttributes(): void { const host = globalThis as unknown as PreloadGlobal const root = host.document?.documentElement - if (!root) return + if (!root) {return} root.classList.toggle('dark', initialTheme.resolvedTheme === 'dark') root.style.colorScheme = initialTheme.resolvedTheme root.dataset.platform = process.platform diff --git a/src/renderer/src/App.tsx b/src/renderer/src/App.tsx index 73d7add..eb26c86 100644 --- a/src/renderer/src/App.tsx +++ b/src/renderer/src/App.tsx @@ -1,10 +1,12 @@ -import { useCallback, useEffect, useMemo, useRef, useState, type MouseEvent as ReactMouseEvent } from 'react' +import { useCallback, useEffect, useMemo, useRef, useState } from 'react'; +import type { MouseEvent as ReactMouseEvent } from 'react'; import { RotateCwIcon } from 'lucide-react' import { Alert, Button, Modal, Spinner, useConfirm, useToast } from '@renderer/components/ui' import 'cesium/Build/Cesium/Widgets/widgets.css' import { isLikelyMainlandChinaEnv } from '../../common/tileMirror' import type { PlaceSuggestion } from '../../preload' -import { registerGlobeTools, type GlobeToolsBridge } from '@renderer/ai/registerGlobeTools' +import { registerGlobeTools } from '@renderer/ai/registerGlobeTools'; +import type { GlobeToolsBridge } from '@renderer/ai/registerGlobeTools'; import { useCesiumViewer } from '@renderer/composables/useCesiumViewer' import { useDrawing } from '@renderer/composables/useDrawing' import { useScenePlayer } from '@renderer/composables/useScenePlayer' @@ -18,7 +20,8 @@ import { useAiStore } from '@renderer/stores/ai' import { useAtmosphereStore } from '@renderer/stores/atmosphere' import { thematicLayerCatalog, useClimateStore } from '@renderer/stores/climate' import { useDecisionStore } from '@renderer/stores/decision' -import { useDrawingStore, type DrawTool } from '@renderer/stores/drawing' +import { useDrawingStore } from '@renderer/stores/drawing'; +import type { DrawTool } from '@renderer/stores/drawing'; import { useEnvironmentStore } from '@renderer/stores/environment' import { useFailureStore } from '@renderer/stores/failure' import { useGlobeStore } from '@renderer/stores/globe' @@ -39,7 +42,8 @@ import AtmosphereLayersPanel from '@renderer/components/AtmosphereLayersPanel' import CameraStatus from '@renderer/components/CameraStatus' import CitiesPanel from '@renderer/components/CitiesPanel' import CrashDialog from '@renderer/components/CrashDialog' -import DrawingEditToolbar, { type DrawnShapeStylePatch } from '@renderer/components/DrawingEditToolbar' +import DrawingEditToolbar from '@renderer/components/DrawingEditToolbar'; +import type { DrawnShapeStylePatch } from '@renderer/components/DrawingEditToolbar'; import DrawingTouchBar from '@renderer/components/DrawingTouchBar' import EarthLayersPanel from '@renderer/components/EarthLayersPanel' import EnsoPanel from '@renderer/components/EnsoPanel' @@ -47,7 +51,8 @@ import EnvironmentPanel from '@renderer/components/EnvironmentPanel' import EoqAssistant from '@renderer/components/EoqAssistant' import ExogenicPanel from '@renderer/components/ExogenicPanel' import FailureBanner from '@renderer/components/FailureBanner' -import FirstUseGuide, { type FirstUseGuideHandle } from '@renderer/components/FirstUseGuide' +import FirstUseGuide from '@renderer/components/FirstUseGuide'; +import type { FirstUseGuideHandle } from '@renderer/components/FirstUseGuide'; import FlightStopSwitcher from '@renderer/components/FlightStopSwitcher' import FoldFaultPanel from '@renderer/components/FoldFaultPanel' import FrontalCyclone from '@renderer/components/FrontalCyclone' @@ -66,7 +71,8 @@ import PlaceSearchBox from '@renderer/components/PlaceSearchBox' import PopulationPanel from '@renderer/components/PopulationPanel' import RiverLandformPanel from '@renderer/components/RiverLandformPanel' import RotationSpeedPanel from '@renderer/components/RotationSpeedPanel' -import SceneBookmarksPanel, { type SceneEditPayload } from '@renderer/components/SceneBookmarksPanel' +import SceneBookmarksPanel from '@renderer/components/SceneBookmarksPanel'; +import type { SceneEditPayload } from '@renderer/components/SceneBookmarksPanel'; import ScenePlayerOverlay from '@renderer/components/ScenePlayerOverlay' import SettingsModal from '@renderer/components/SettingsModal' import SolarPathPanel from '@renderer/components/SolarPathPanel' @@ -181,7 +187,7 @@ export function App() { () => shapes.find((shape) => shape.id === selectedShapeId) ?? null, [selectedShapeId, shapes] ) - const levelSwitcherVisible = isGlobeReady && camera.height < 5000000 + const levelSwitcherVisible = isGlobeReady && camera.height < 5_000_000 const showGlobeLoading = !isGlobeReady || onlineDataLoading || Boolean(webglNotice) const globeLoadingText = webglNotice ? webglNotice.message @@ -209,9 +215,8 @@ export function App() { zonationPanel !== null || activeTool === 'timezone' - const drawHint = !activeTool - ? '' - : activeTool === 'timezone' + const drawHint = activeTool + ? activeTool === 'timezone' ? touchInteractionActive ? '点按选取两个地点对比地方时 · 用下方按钮退出' : '单击选取两个地点对比地方时 · Esc 退出' @@ -230,10 +235,11 @@ export function App() { : touchInteractionActive ? '点按加点 · 用下方按钮撤销或完成' : '单击加点 · 双击或右键完成 · Esc 取消' + : '' const handleGlobeContextMenu = useCallback( (event: ReactMouseEvent) => { - if (!touchInteractionActive) return + if (!touchInteractionActive) {return} event.preventDefault() }, [touchInteractionActive] @@ -256,22 +262,22 @@ export function App() { const closeAllTeachingFeatures = useCallback(() => { closeAllTeachingPanels() const climate = useClimateStore.getState() - for (const layer of thematicLayerCatalog) climate.setOverlay(layer.id, false) + for (const layer of thematicLayerCatalog) {climate.setOverlay(layer.id, false)} }, [closeAllTeachingPanels]) useEffect(() => { - if (!nightBasemapActive) return + if (!nightBasemapActive) {return} closeAllTeachingFeatures() setIsLabOpen(false) }, [closeAllTeachingFeatures, nightBasemapActive]) const ensureRecordingDirectory = useCallback(async (): Promise => { try { - if (await window.guEarth.recordings.getDirectory()) return true + if (await window.guEarth.recordings.getDirectory()) {return true} } catch { setRecordingDirectoryDialogError('暂时无法检查视频保存文件夹,请重新选择') } - if (recordingDirectoryResolverRef.current) return false + if (recordingDirectoryResolverRef.current) {return false} setRecordingDirectoryDialogError('') setRecordingDirectoryDialogOpen(true) return new Promise((resolve) => { @@ -343,8 +349,8 @@ export function App() { }, []) useEffect(() => { - if (!settingsHydrated) return - if (mirrorConsentPrompted || mirrorConsentOpen) return + if (!settingsHydrated) {return} + if (mirrorConsentPrompted || mirrorConsentOpen) {return} const timeZone = (() => { try { return Intl.DateTimeFormat().resolvedOptions().timeZone @@ -360,7 +366,7 @@ export function App() { useGlobeStore.getState().openMirrorConsent('slow') return } - if (isGlobeReady) return + if (isGlobeReady) {return} const timer = window.setTimeout(() => { const current = useGlobeStore.getState() if (!current.mirrorConsentPrompted && !current.mirrorConsentOpen && !current.isGlobeReady) { @@ -384,11 +390,11 @@ export function App() { void (async () => { try { const installedFonts = await window.guEarth.system.fonts() - if (cancelled) return + if (cancelled) {return} const existingFonts = useDrawingStore.getState().shapes.map((shape) => shape.fontFamily) setSystemFonts([...new Set([...installedFonts, ...existingFonts])].sort((first, second) => first.localeCompare(second))) } catch { - if (!cancelled) setSystemFonts(DEFAULT_SYSTEM_FONTS) + if (!cancelled) {setSystemFonts(DEFAULT_SYSTEM_FONTS)} } })() return () => { @@ -410,8 +416,8 @@ export function App() { const settingsWindow = useSettingsWindowStore.getState() settingsWindow.close() useAiStore.getState().setPanelOpen(false) - if (step === 6) settingsWindow.open('map') - if (step === 8) settingsWindow.open('ai') + if (step === 6) {settingsWindow.open('map')} + if (step === 8) {settingsWindow.open('ai')} }, []) const handleRestartGuide = useCallback(() => { @@ -427,13 +433,13 @@ export function App() { }, []) const handleHome = useCallback(() => { - void flyTo(105, 35, 15000000) + void flyTo(105, 35, 15_000_000) }, [flyTo]) const handleRetry = useCallback(() => { const failureStore = useFailureStore.getState() for (const notice of failureStore.active) { - if (notice.retryable) void failureStore.retry(notice.scope) + if (notice.retryable) {void failureStore.retry(notice.scope)} } }, []) @@ -475,7 +481,7 @@ export function App() { const scenesStore = useScenesStore.getState() await scenesStore.addScene(scene) const nextState = useScenesStore.getState() - if (!nextState.saveError) captureTelemetryEvent('scene_saved', { scene_count: nextState.scenes.length }) + if (!nextState.saveError) {captureTelemetryEvent('scene_saved', { scene_count: nextState.scenes.length })} } catch (error) { toast.warning(error instanceof Error ? error.message : '地球尚未就绪,暂时无法保存场景') } @@ -486,7 +492,7 @@ export function App() { const handlePreviewScene = useCallback( (id: string) => { const scene = useScenesStore.getState().scenes.find((item) => item.id === id) - if (scene) void scenePlayer.previewScene(scene) + if (scene) {void scenePlayer.previewScene(scene)} }, [scenePlayer] ) @@ -506,7 +512,7 @@ export function App() { const handlePlayScenes = useCallback( (mode: 'manual' | 'auto') => { const currentScenes = useScenesStore.getState().scenes - if (!currentScenes.length) return + if (currentScenes.length === 0) {return} const drawingStore = useDrawingStore.getState() drawingStore.setActiveTool(null) drawingStore.setSelectedShapeId(null) @@ -545,19 +551,19 @@ export function App() { const handleFlyShape = useCallback( (id: string) => { const shape = useDrawingStore.getState().shapes.find((item) => item.id === id) - if (shape) flyToShape(shape) + if (shape) {flyToShape(shape)} }, [flyToShape] ) const updateSelectedShape = useCallback((changes: DrawnShapeStylePatch) => { const id = useDrawingStore.getState().selectedShapeId - if (id) useDrawingStore.getState().updateShape(id, changes) + if (id) {useDrawingStore.getState().updateShape(id, changes)} }, []) const deleteSelectedShape = useCallback(() => { const id = useDrawingStore.getState().selectedShapeId - if (id) useDrawingStore.getState().removeShape(id) + if (id) {useDrawingStore.getState().removeShape(id)} }, []) return ( @@ -600,11 +606,11 @@ export function App() { {thematicOverlays['wind-particles'] && } {thematicOverlays['frontal-cyclone'] && } - {thematicOverlays['typhoon'] && + {thematicOverlays.typhoon && (onlineSnapshot?.typhoonConfigured === false || typhoonMode === 'history') && ( )} - {thematicOverlays['enso'] && } + {thematicOverlays.enso && } {thematicOverlays['hu-line'] && } {!isPresenting && ( @@ -671,7 +677,7 @@ export function App() { {atmospherePanel === 'layers' && ( useAtmosphereStore.getState().setPanel(null)} /> )} - {thematicOverlays['enso'] && ( + {thematicOverlays.enso && ( useClimateStore.getState().setOverlay('enso', false)} /> )} {hydrologyPanel === 'water-cycle' && ( diff --git a/src/renderer/src/ai/annotationTools.ts b/src/renderer/src/ai/annotationTools.ts index 885c40e..b0c7f17 100644 --- a/src/renderer/src/ai/annotationTools.ts +++ b/src/renderer/src/ai/annotationTools.ts @@ -1,6 +1,7 @@ import type { AnnotationEntry } from '../../../preload' import { useAiStore } from '@renderer/stores/ai' -import { DEFAULT_DRAW_STYLE, useDrawingStore, type DrawnShape, type GeoPosition } from '@renderer/stores/drawing' +import { DEFAULT_DRAW_STYLE, useDrawingStore } from '@renderer/stores/drawing'; +import type { DrawnShape, GeoPosition } from '@renderer/stores/drawing'; import { measureShape } from '@renderer/composables/useDrawing' type FolderEntry = Extract @@ -10,31 +11,31 @@ const MAX_FOLDER_OPERATIONS = 20 const COLOR_PATTERN = /^#[0-9a-fA-F]{6}$/ export function parsePositions(raw: unknown, minCount: number): GeoPosition[] | null { - if (!Array.isArray(raw)) return null + if (!Array.isArray(raw)) {return null} const positions: GeoPosition[] = [] for (const item of raw) { - if (typeof item !== 'object' || item === null) continue + if (typeof item !== 'object' || item === null) {continue} const record = item as Record const longitude = Number(record.longitude) const latitude = Number(record.latitude) - if (!Number.isFinite(longitude) || !Number.isFinite(latitude)) continue - if (longitude < -180 || longitude > 180 || latitude < -90 || latitude > 90) continue - if (!positions.some((existing) => existing.longitude === longitude && existing.latitude === latitude)) positions.push({ longitude, latitude, height: 0 }) + if (!Number.isFinite(longitude) || !Number.isFinite(latitude)) {continue} + if (longitude < -180 || longitude > 180 || latitude < -90 || latitude > 90) {continue} + if (!positions.some((existing) => existing.longitude === longitude && existing.latitude === latitude)) {positions.push({ longitude, latitude, height: 0 })} } return positions.length >= minCount && positions.length <= 500 ? positions : null } export function collectStrings(raw: unknown): string[] { - if (!Array.isArray(raw)) return [] + if (!Array.isArray(raw)) {return []} return raw.flatMap((item) => (typeof item === 'string' && item.trim() ? [item.trim()] : [])) } function entryById(entries: AnnotationEntry[], id: string): AnnotationEntry | undefined { for (const entry of entries) { - if (entry.id === id) return entry + if (entry.id === id) {return entry} if (entry.type === 'folder') { const found = entryById(entry.children, id) - if (found) return found + if (found) {return found} } } return undefined @@ -45,11 +46,11 @@ function folderSegments(path: string): string[] { } function folderByPath(entries: AnnotationEntry[], segments: string[]): FolderEntry | undefined { - if (!segments.length) return undefined + if (segments.length === 0) {return undefined} const [head, ...rest] = segments const child = entries.find((entry) => entry.type === 'folder' && entry.name === head) - if (!child || child.type !== 'folder') return undefined - return rest.length ? folderByPath(child.children, rest) : child + if (child?.type !== 'folder') {return undefined} + return rest.length > 0 ? folderByPath(child.children, rest) : child } function countShapes(entries: AnnotationEntry[]): number { @@ -58,21 +59,21 @@ function countShapes(entries: AnnotationEntry[]): number { function folderRefId(ref: string): string | null { const trimmed = ref.trim() - if (!trimmed) return null + if (!trimmed) {return null} const { entries } = useDrawingStore.getState() const byId = entryById(entries, trimmed) - if (byId) return byId.type === 'folder' ? byId.id : null + if (byId) {return byId.type === 'folder' ? byId.id : null} return folderByPath(entries, folderSegments(trimmed))?.id ?? null } function folderPathOf(id: string): string { const walk = (entries: AnnotationEntry[], prefix: string): string => { for (const entry of entries) { - if (entry.type !== 'folder') continue + if (entry.type !== 'folder') {continue} const path = prefix ? `${prefix}/${entry.name}` : entry.name - if (entry.id === id) return path + if (entry.id === id) {return path} const found = walk(entry.children, path) - if (found) return found + if (found) {return found} } return '' } @@ -80,7 +81,7 @@ function folderPathOf(id: string): string { } function ensureFolderPath(segments: string[]): string | null { - if (!segments.length) return null + if (segments.length === 0) {return null} let parentId: string | null = null for (const segment of segments) { const drawingStore = useDrawingStore.getState() @@ -88,7 +89,7 @@ function ensureFolderPath(segments: string[]): string | null { const siblings: AnnotationEntry[] = parent?.type === 'folder' ? parent.children : drawingStore.entries const existing: AnnotationEntry | undefined = siblings.find((entry) => entry.type === 'folder' && entry.name === segment) parentId = existing?.id ?? drawingStore.addFolder(segment, parentId) - if (!parentId) return null + if (!parentId) {return null} } return parentId } @@ -125,7 +126,7 @@ export function registerAnnotationTools(): void { }, execute: async (args) => { const entries: unknown[] = Array.isArray(args.markers) ? args.markers : [args] - if (entries.length > MAX_MARKER_BATCH) return { error: `单次最多添加 ${MAX_MARKER_BATCH} 个标记,请分批调用` } + if (entries.length > MAX_MARKER_BATCH) {return { error: `单次最多添加 ${MAX_MARKER_BATCH} 个标记,请分批调用` }} const added: { id: string; name: string; longitude: number; latitude: number }[] = [] let skipped = 0 for (const entry of entries) { @@ -137,8 +138,8 @@ export function registerAnnotationTools(): void { useDrawingStore.getState().addShape({ ...DEFAULT_DRAW_STYLE, id, kind: 'point', positions, annotation: name, createdAt: Date.now() }) added.push({ id, name, longitude: positions[0].longitude, latitude: positions[0].latitude }) } - if (!added.length) return { error: '没有有效标记:需要名称与 WGS-84 经纬度坐标' } - if (entries.length === 1) return { status: 'ok', id: added[0].id, kind: 'point', name: added[0].name, longitude: added[0].longitude, latitude: added[0].latitude } + if (added.length === 0) {return { error: '没有有效标记:需要名称与 WGS-84 经纬度坐标' }} + if (entries.length === 1) {return { status: 'ok', id: added[0].id, kind: 'point', name: added[0].name, longitude: added[0].longitude, latitude: added[0].latitude }} return { status: 'ok', added: added.length, skipped: skipped || undefined, markers: added } } }) @@ -162,18 +163,18 @@ export function registerAnnotationTools(): void { }, execute: async (args) => { const text = typeof args.text === 'string' ? args.text.trim().slice(0, 200) : '' - if (!text) return { error: 'text 不能为空' } + if (!text) {return { error: 'text 不能为空' }} const positions = parsePositions([args], 1) - if (!positions) return { error: '坐标无效,需要 WGS-84 经纬度' } + if (!positions) {return { error: '坐标无效,需要 WGS-84 经纬度' }} let fontSize = DEFAULT_DRAW_STYLE.fontSize if (args.fontSize !== undefined) { const value = Number(args.fontSize) - if (!Number.isFinite(value) || value < 8 || value > 48) return { error: 'fontSize 需为 8-48 的数字' } + if (!Number.isFinite(value) || value < 8 || value > 48) {return { error: 'fontSize 需为 8-48 的数字' }} fontSize = Math.round(value) } let textColor = DEFAULT_DRAW_STYLE.textColor if (args.color !== undefined) { - if (typeof args.color !== 'string' || !COLOR_PATTERN.test(args.color)) return { error: 'color 需为 #RRGGBB 格式' } + if (typeof args.color !== 'string' || !COLOR_PATTERN.test(args.color)) {return { error: 'color 需为 #RRGGBB 格式' }} textColor = args.color } const id = crypto.randomUUID() @@ -206,17 +207,17 @@ export function registerAnnotationTools(): void { { longitude: args.fromLongitude, latitude: args.fromLatitude }, { longitude: args.toLongitude, latitude: args.toLatitude } ], 2) - if (!positions) return { error: '坐标无效:箭头需要起点与终点两个不同位置的 WGS-84 经纬度' } + if (!positions) {return { error: '坐标无效:箭头需要起点与终点两个不同位置的 WGS-84 经纬度' }} const name = typeof args.name === 'string' ? args.name.trim().slice(0, 200) : '' let color = DEFAULT_DRAW_STYLE.color if (args.color !== undefined) { - if (typeof args.color !== 'string' || !COLOR_PATTERN.test(args.color)) return { error: 'color 需为 #RRGGBB 格式' } + if (typeof args.color !== 'string' || !COLOR_PATTERN.test(args.color)) {return { error: 'color 需为 #RRGGBB 格式' }} color = args.color } let lineWidth = DEFAULT_DRAW_STYLE.lineWidth if (args.lineWidth !== undefined) { const value = Number(args.lineWidth) - if (!Number.isFinite(value) || value < 1 || value > 10) return { error: 'lineWidth 需为 1-10 的数字' } + if (!Number.isFinite(value) || value < 1 || value > 10) {return { error: 'lineWidth 需为 1-10 的数字' }} lineWidth = Math.round(value) } const id = crypto.randomUUID() @@ -253,11 +254,11 @@ export function registerAnnotationTools(): void { }, execute: async (args) => { let kind: 'polyline' | 'polygon' | null = null - if (args.kind === 'polygon') kind = 'polygon' - else if (args.kind === 'polyline') kind = 'polyline' - if (!kind) return { error: 'kind 必须为 polyline 或 polygon' } + if (args.kind === 'polygon') {kind = 'polygon'} + else if (args.kind === 'polyline') {kind = 'polyline'} + if (!kind) {return { error: 'kind 必须为 polyline 或 polygon' }} const positions = parsePositions(args.points, kind === 'polygon' ? 3 : 2) - if (!positions) return { error: `坐标无效:${kind === 'polygon' ? '多边形需要至少 3 个' : '线需要至少 2 个'}有效且不重复的经纬度顶点` } + if (!positions) {return { error: `坐标无效:${kind === 'polygon' ? '多边形需要至少 3 个' : '线需要至少 2 个'}有效且不重复的经纬度顶点` }} const name = typeof args.name === 'string' ? args.name.trim().slice(0, 200) : '' const shape: DrawnShape = { ...DEFAULT_DRAW_STYLE, id: crypto.randomUUID(), kind, positions, annotation: name, createdAt: Date.now() } useDrawingStore.getState().addShape(shape) @@ -282,7 +283,7 @@ export function registerAnnotationTools(): void { const path = prefix ? `${prefix}/${entry.name}` : entry.name folders.push({ id: entry.id, name: entry.name, path, shapes: countShapes(entry.children) }) walk(entry.children, path) - } else shapeFolder.set(entry.id, prefix) + } else {shapeFolder.set(entry.id, prefix)} } } const { entries, shapes } = useDrawingStore.getState() @@ -294,11 +295,11 @@ export function registerAnnotationTools(): void { name: shape.annotation || undefined, folder: shapeFolder.get(shape.id) || undefined, vertices: shape.positions.length, - longitude: shape.positions.length ? Math.round(shape.positions[0].longitude * 10000) / 10000 : undefined, - latitude: shape.positions.length ? Math.round(shape.positions[0].latitude * 10000) / 10000 : undefined, + longitude: shape.positions.length > 0 ? Math.round(shape.positions[0].longitude * 10_000) / 10_000 : undefined, + latitude: shape.positions.length > 0 ? Math.round(shape.positions[0].latitude * 10_000) / 10_000 : undefined, measurement: measureShape(shape) || undefined })), - folders: folders.length ? folders : undefined + folders: folders.length > 0 ? folders : undefined } } }) @@ -320,10 +321,10 @@ export function registerAnnotationTools(): void { }, execute: async (args) => { const ids = new Set(collectStrings(args.ids)) - if (typeof args.id === 'string' && args.id.trim()) ids.add(args.id.trim()) + if (typeof args.id === 'string' && args.id.trim()) {ids.add(args.id.trim())} const names = new Set(collectStrings(args.names)) - if (typeof args.name === 'string' && args.name.trim()) names.add(args.name.trim()) - if (!ids.size && !names.size) return { error: '需要提供 id/ids 或 name/names' } + if (typeof args.name === 'string' && args.name.trim()) {names.add(args.name.trim())} + if (ids.size === 0 && names.size === 0) {return { error: '需要提供 id/ids 或 name/names' }} const missingIds: string[] = [] const missingNames: string[] = [] let removed = 0 @@ -336,8 +337,8 @@ export function registerAnnotationTools(): void { for (const name of names) { const drawingStore = useDrawingStore.getState() const matched = drawingStore.shapes.filter((shape) => shape.annotation === name) - if (!matched.length) { missingNames.push(name); continue } - for (const shape of matched) useDrawingStore.getState().removeShape(shape.id) + if (matched.length === 0) { missingNames.push(name); continue } + for (const shape of matched) {useDrawingStore.getState().removeShape(shape.id)} removed += matched.length } if (!removed) { @@ -348,8 +349,8 @@ export function registerAnnotationTools(): void { status: 'ok', removed, message: `已删除 ${removed} 个标注`, - missingIds: missingIds.length ? missingIds : undefined, - missingNames: missingNames.length ? missingNames : undefined + missingIds: missingIds.length > 0 ? missingIds : undefined, + missingNames: missingNames.length > 0 ? missingNames : undefined } } }) @@ -384,8 +385,8 @@ export function registerAnnotationTools(): void { } }, execute: async (args) => { - const operations = Array.isArray(args.operations) && args.operations.length ? args.operations : [args] - if (operations.length > MAX_FOLDER_OPERATIONS) return { error: `单次最多 ${MAX_FOLDER_OPERATIONS} 个操作,请分批调用` } + const operations = Array.isArray(args.operations) && args.operations.length > 0 ? args.operations : [args] + if (operations.length > MAX_FOLDER_OPERATIONS) {return { error: `单次最多 ${MAX_FOLDER_OPERATIONS} 个操作,请分批调用` }} const created: { id: string; name: string; path: string }[] = [] let renamed = 0 let removed = 0 @@ -407,8 +408,8 @@ export function registerAnnotationTools(): void { if (!folderRef || !name) { errors.push('rename 操作需要 folder 与 name'); continue } const id = folderRefId(folderRef) if (!id) { errors.push(`未找到文件夹「${folderRef}」`); continue } - if (useDrawingStore.getState().renameFolder(id, name)) renamed += 1 - else errors.push(`无法重命名「${folderRef}」`) + if (useDrawingStore.getState().renameFolder(id, name)) {renamed += 1} + else {errors.push(`无法重命名「${folderRef}」`)} } else if (record.action === 'remove') { const folderRef = typeof record.folder === 'string' ? record.folder.trim() : '' if (!folderRef) { errors.push('remove 操作需要 folder'); continue } @@ -416,17 +417,17 @@ export function registerAnnotationTools(): void { if (!id) { errors.push(`未找到文件夹「${folderRef}」`); continue } useDrawingStore.getState().removeFolder(id) removed += 1 - } else errors.push(`未知 action「${String(record.action)}」,需为 create、rename 或 remove`) + } else {errors.push(`未知 action「${String(record.action)}」,需为 create、rename 或 remove`)} } - if (!created.length && !renamed && !removed) return { error: errors[0] ?? '没有有效操作' } + if (created.length === 0 && !renamed && !removed) {return { error: errors[0] ?? '没有有效操作' }} const parts: string[] = [] - if (created.length === 1) parts.push(`已创建文件夹「${created[0].name}」`) - else if (created.length > 1) parts.push(`已创建 ${created.length} 个文件夹`) - if (renamed === 1) parts.push('已重命名 1 个文件夹') - else if (renamed > 1) parts.push(`已重命名 ${renamed} 个文件夹`) - if (removed === 1) parts.push('已删除 1 个文件夹(其中标注上移一级)') - else if (removed > 1) parts.push(`已删除 ${removed} 个文件夹(其中标注上移一级)`) - return { status: 'ok', created, renamed, removed, message: parts.join(','), errors: errors.length ? errors : undefined } + if (created.length === 1) {parts.push(`已创建文件夹「${created[0].name}」`)} + else if (created.length > 1) {parts.push(`已创建 ${created.length} 个文件夹`)} + if (renamed === 1) {parts.push('已重命名 1 个文件夹')} + else if (renamed > 1) {parts.push(`已重命名 ${renamed} 个文件夹`)} + if (removed === 1) {parts.push('已删除 1 个文件夹(其中标注上移一级)')} + else if (removed > 1) {parts.push(`已删除 ${removed} 个文件夹(其中标注上移一级)`)} + return { status: 'ok', created, renamed, removed, message: parts.join(','), errors: errors.length > 0 ? errors : undefined } } }) @@ -449,10 +450,10 @@ export function registerAnnotationTools(): void { }, execute: async (args) => { const ids = new Set(collectStrings(args.ids)) - if (typeof args.id === 'string' && args.id.trim()) ids.add(args.id.trim()) + if (typeof args.id === 'string' && args.id.trim()) {ids.add(args.id.trim())} const names = new Set(collectStrings(args.names)) - if (typeof args.name === 'string' && args.name.trim()) names.add(args.name.trim()) - if (!ids.size && !names.size) return { error: '需要提供 id/ids 或 name/names' } + if (typeof args.name === 'string' && args.name.trim()) {names.add(args.name.trim())} + if (ids.size === 0 && names.size === 0) {return { error: '需要提供 id/ids 或 name/names' }} const missingIds: string[] = [] const missingNames: string[] = [] const seen = new Set() @@ -465,22 +466,22 @@ export function registerAnnotationTools(): void { } for (const name of names) { const matched = shapes.filter((item) => item.annotation === name) - if (!matched.length) { missingNames.push(name); continue } + if (matched.length === 0) { missingNames.push(name); continue } for (const shape of matched) { if (!seen.has(shape.id)) { seen.add(shape.id); targets.push(shape) } } } - if (!targets.length) return { error: `未找到标注「${missingIds[0] ?? missingNames[0]}」,可先调用 list_shapes 查看` } + if (targets.length === 0) {return { error: `未找到标注「${missingIds[0] ?? missingNames[0]}」,可先调用 list_shapes 查看` }} const folderRef = typeof args.folder === 'string' ? args.folder.trim() : '' let folderId: string | null = null if (folderRef) { folderId = folderRefId(folderRef) - if (!folderId && args.createFolder === true) folderId = ensureFolderPath(folderSegments(folderRef)) - if (!folderId) return { error: `未找到文件夹「${folderRef}」:可先用 manage_folders 创建,或设置 createFolder 为 true 自动创建` } + if (!folderId && args.createFolder === true) {folderId = ensureFolderPath(folderSegments(folderRef))} + if (!folderId) {return { error: `未找到文件夹「${folderRef}」:可先用 manage_folders 创建,或设置 createFolder 为 true 自动创建` }} } let moved = 0 for (const shape of targets) { - if (useDrawingStore.getState().moveEntry(shape.id, folderId, 'inside')) moved += 1 + if (useDrawingStore.getState().moveEntry(shape.id, folderId, 'inside')) {moved += 1} } const targetLabel = folderId ? folderPathOf(folderId) : '根目录' return { @@ -488,8 +489,8 @@ export function registerAnnotationTools(): void { moved, folder: targetLabel, message: `已移动 ${moved} 个标注到「${targetLabel}」`, - missingIds: missingIds.length ? missingIds : undefined, - missingNames: missingNames.length ? missingNames : undefined + missingIds: missingIds.length > 0 ? missingIds : undefined, + missingNames: missingNames.length > 0 ? missingNames : undefined } } }) diff --git a/src/renderer/src/ai/populationTools.ts b/src/renderer/src/ai/populationTools.ts index 0f922fc..3a2bf2c 100644 --- a/src/renderer/src/ai/populationTools.ts +++ b/src/renderer/src/ai/populationTools.ts @@ -27,20 +27,20 @@ export function registerPopulationTools(): void { }, execute: async (args) => { const name = typeof args.province === 'string' ? args.province.trim() : '' - if (!name) return { error: '需要 province 参数,省级行政区全称或「全国」' } + if (!name) {return { error: '需要 province 参数,省级行政区全称或「全国」' }} if (name === '全国') { return { province: '全国', year: POPULATION_CENSUS_YEAR, populationWan: national.populationWan, - mainland31Wan: 140978, + mainland31Wan: 140_978, urbanizationPct: latestUrbanization[1], urbanizationYear: latestUrbanization[0], note: `全国人口 ${national.populationWan} 万为大陆口径(含现役军人);大陆31个省区市合计约140978万。城镇化率 ${latestUrbanization[1]}% 为常住人口口径(${latestUrbanization[0]} 年)。` } } const province = provincePopulation.find((item) => item.name === name) - if (!province) return { error: `未收录省级行政区「${name}」,请使用枚举中的全称`, available: provinceNames } + if (!province) {return { error: `未收录省级行政区「${name}」,请使用枚举中的全称`, available: provinceNames }} const density = Math.round(densityOf(province) * 10) / 10 return { province: province.name, diff --git a/src/renderer/src/ai/registerGlobeTools.ts b/src/renderer/src/ai/registerGlobeTools.ts index e92e205..a812950 100644 --- a/src/renderer/src/ai/registerGlobeTools.ts +++ b/src/renderer/src/ai/registerGlobeTools.ts @@ -19,7 +19,8 @@ import { registerPopulationTools } from '@renderer/ai/populationTools' import type { RecordingStep } from '@renderer/composables/useScenePlayer' import { flyTransect } from '@renderer/composables/useTransectFlight' import { hidesThematicLayers, visibleThematicLayers } from '@renderer/lib/nightBasemap' -import { ensoPhaseOptions, type EnsoPhase } from '@renderer/thematic/ensoPhases' +import { ensoPhaseOptions } from '@renderer/thematic/ensoPhases'; +import type { EnsoPhase } from '@renderer/thematic/ensoPhases'; import { HSR_END_YEAR, HSR_START_YEAR } from '@renderer/thematic/hsrLines' import { mountainById, zonationMountains } from '@renderer/thematic/mountainZonation' import { findPeaksNear, nearestPeaks } from '@renderer/thematic/notablePeaks' @@ -46,22 +47,22 @@ export interface GlobeToolsBridge { } const optionalFiniteNumber = (value: unknown): number | undefined => { - if (value === null || value === undefined || value === '') return undefined + if (value === null || value === undefined || value === '') {return undefined} const parsed = Number(value) return Number.isFinite(parsed) ? parsed : undefined } export function parseRecordingStep(raw: unknown, index: number): RecordingStep | { error: string } { - if (typeof raw !== 'object' || raw === null) return { error: `第 ${index + 1} 步格式无效` } + if (typeof raw !== 'object' || raw === null) {return { error: `第 ${index + 1} 步格式无效` }} const record = raw as Record const longitude = Number(record.longitude) const latitude = Number(record.latitude) if (!Number.isFinite(longitude) || longitude < -180 || longitude > 180 || !Number.isFinite(latitude) || latitude < -90 || latitude > 90) { return { error: `第 ${index + 1} 步缺少有效经纬度` } } - const height = record.height === undefined ? 600000 : Number(record.height) - if (!Number.isFinite(height) || height <= 0 || height > 20000000) return { error: `第 ${index + 1} 步视点高度无效` } - const clampedHeight = Math.min(12000000, Math.max(10000, height)) + const height = record.height === undefined ? 600_000 : Number(record.height) + if (!Number.isFinite(height) || height <= 0 || height > 20_000_000) {return { error: `第 ${index + 1} 步视点高度无效` }} + const clampedHeight = Math.min(12_000_000, Math.max(10_000, height)) const heading = record.heading === undefined ? 0 : Number(record.heading) const pitch = record.pitch === undefined ? -90 : Number(record.pitch) if (!Number.isFinite(heading) || heading < -360 || heading > 360 || !Number.isFinite(pitch) || pitch < -90 || pitch > 90) { @@ -73,19 +74,19 @@ export function parseRecordingStep(raw: unknown, index: number): RecordingStep | const requestedOverlays = collectStrings(record.overlays) const knownOverlays = thematicLayerCatalog.filter((layer) => requestedOverlays.includes(layer.id)).map((layer) => layer.id) const month = record.month === undefined ? climateStore.month : Number(record.month) - if (!Number.isFinite(month) || month < 1 || month > 12) return { error: `第 ${index + 1} 步 month 需为 1-12` } + if (!Number.isFinite(month) || month < 1 || month > 12) {return { error: `第 ${index + 1} 步 month 需为 1-12` }} let simTime: { date: string; hour: number } | null = null if (record.simTime !== null && record.simTime !== undefined) { - if (typeof record.simTime !== 'object') return { error: `第 ${index + 1} 步 simTime 格式无效` } + if (typeof record.simTime !== 'object') {return { error: `第 ${index + 1} 步 simTime 格式无效` }} const time = record.simTime as Record - if (typeof time.date !== 'string' || !isValidDate(time.date)) return { error: `第 ${index + 1} 步 simTime.date 需为合法 YYYY-MM-DD` } + if (typeof time.date !== 'string' || !isValidDate(time.date)) {return { error: `第 ${index + 1} 步 simTime.date 需为合法 YYYY-MM-DD` }} const hour = time.hour === undefined ? 12 : Number(time.hour) - if (!Number.isFinite(hour) || hour < 0 || hour >= 24) return { error: `第 ${index + 1} 步 simTime.hour 需为 0-24` } + if (!Number.isFinite(hour) || hour < 0 || hour >= 24) {return { error: `第 ${index + 1} 步 simTime.hour 需为 0-24` }} simTime = { date: time.date, hour } } const markers = Array.isArray(record.markers) ? record.markers.flatMap((item) => { - if (typeof item !== 'object' || item === null) return [] + if (typeof item !== 'object' || item === null) {return []} const entry = item as Record const name = typeof entry.name === 'string' ? entry.name.trim().slice(0, 200) : '' const markerLon = Number(entry.longitude) @@ -98,13 +99,14 @@ export function parseRecordingStep(raw: unknown, index: number): RecordingStep | : [] const shapes = Array.isArray(record.shapes) ? record.shapes.flatMap((item) => { - if (typeof item !== 'object' || item === null) return [] + if (typeof item !== 'object' || item === null) {return []} const entry = item as Record - if (entry.kind !== 'polyline' && entry.kind !== 'polygon') return [] + if (entry.kind !== 'polyline' && entry.kind !== 'polygon') {return []} const positions = parsePositions(entry.points, entry.kind === 'polygon' ? 3 : 2) - if (!positions) return [] + if (!positions) {return []} const name = typeof entry.name === 'string' ? entry.name.trim().slice(0, 200) : '' - return [{ kind: entry.kind as 'polyline' | 'polygon', name, positions }] + const kind: 'polyline' | 'polygon' = entry.kind + return [{ kind, name, positions }] }) : [] const dwellMs = record.dwellMs === undefined ? 6000 : Number(record.dwellMs) @@ -128,8 +130,8 @@ export function parseRecordingStep(raw: unknown, index: number): RecordingStep | ensoPhase, seaLevelRise, transportYear, - dwellMs: Math.min(60000, Math.max(1000, dwellMs)), - flyDurationMs: Math.min(15000, Math.max(500, flyDurationMs)), + dwellMs: Math.min(60_000, Math.max(1000, dwellMs)), + flyDurationMs: Math.min(15_000, Math.max(500, flyDurationMs)), markers, shapes } @@ -211,10 +213,10 @@ export function registerGlobeTools(bridge: GlobeToolsBridge): void { const turnToken = typeof args.__turnToken === 'string' ? args.__turnToken : '' const flightMode = args.__flightMode === 'queue' ? 'queue' : 'initial' const parsed = parseFlyToArgs(args, flightMode === 'queue' ? flightStopsStore.total : 0) - if (parsed.error || !parsed.stops.length) return { error: parsed.error ?? '坐标无效,需要 WGS-84 经纬度' } + if (parsed.error || parsed.stops.length === 0) {return { error: parsed.error ?? '坐标无效,需要 WGS-84 经纬度' }} if (flightMode === 'queue') { const { added, total } = flightStopsStore.appendTurnStops(turnToken, parsed.stops) - if (!added.length) return { error: `「${parsed.stops[0].name}」未加入待查看列表:列表已满或地点重复(共 ${total} 个)` } + if (added.length === 0) {return { error: `「${parsed.stops[0].name}」未加入待查看列表:列表已满或地点重复(共 ${total} 个)` }} const current = useFlightStopsStore.getState().currentStop const addedName = added[0].name return { @@ -227,7 +229,7 @@ export function registerGlobeTools(bridge: GlobeToolsBridge): void { } } const first = flightStopsStore.beginTurnStops(turnToken, parsed.stops) - if (!first) return { error: '没有有效飞行地点' } + if (!first) {return { error: '没有有效飞行地点' }} const actualHeight = await bridge.flyTo(first.longitude, first.latitude, first.height) if (actualHeight === undefined) { useFlightStopsStore.getState().clear() @@ -312,7 +314,7 @@ export function registerGlobeTools(bridge: GlobeToolsBridge): void { }, execute: async (args) => { const current = bridge.getViewer() - if (!current || current.isDestroyed()) return { error: '地球尚未就绪' } + if (!current || current.isDestroyed()) {return { error: '地球尚未就绪' }} const longitude = Number(args.longitude) const latitude = Number(args.latitude) if (!Number.isFinite(longitude) || !Number.isFinite(latitude) || longitude < -180 || longitude > 180 || latitude < -90 || latitude > 90) { @@ -321,7 +323,7 @@ export function registerGlobeTools(bridge: GlobeToolsBridge): void { const cartographic = Cesium.Cartographic.fromDegrees(longitude, latitude) try { const [sampled] = await Cesium.sampleTerrainMostDetailed(current.terrainProvider, [cartographic.clone()]) - if (sampled && Number.isFinite(sampled.height)) return { height: Math.round(sampled.height * 100) / 100, unit: '米(WGS-84 椭球高)', longitude, latitude } + if (sampled && Number.isFinite(sampled.height)) {return { height: Math.round(sampled.height * 100) / 100, unit: '米(WGS-84 椭球高)', longitude, latitude }} } catch { void 0 } @@ -358,13 +360,13 @@ export function registerGlobeTools(bridge: GlobeToolsBridge): void { return { error: '坐标无效,需要 WGS-84 经纬度' } } const radiusKm = args.radiusKm === undefined ? 300 : Number(args.radiusKm) - if (!Number.isFinite(radiusKm) || radiusKm < 10 || radiusKm > 3000) return { error: 'radiusKm 需为 10-3000 的千米数' } + if (!Number.isFinite(radiusKm) || radiusKm < 10 || radiusKm > 3000) {return { error: 'radiusKm 需为 10-3000 的千米数' }} const found = findPeaksNear(longitude, latitude, radiusKm) - if (!found.length) { + if (found.length === 0) { const nearest = nearestPeaks(longitude, latitude, 3) return { status: 'none', - center: { longitude: Math.round(longitude * 10000) / 10000, latitude: Math.round(latitude * 10000) / 10000 }, + center: { longitude: Math.round(longitude * 10_000) / 10_000, latitude: Math.round(latitude * 10_000) / 10_000 }, radiusKm, nearest, message: '查询范围内没有收录的名山高峰,nearest 为全球范围内距该点最近的三座;名录仅收录教材常用名山,不代表当地没有其他山峰' @@ -372,7 +374,7 @@ export function registerGlobeTools(bridge: GlobeToolsBridge): void { } return { status: 'ok', - center: { longitude: Math.round(longitude * 10000) / 10000, latitude: Math.round(latitude * 10000) / 10000 }, + center: { longitude: Math.round(longitude * 10_000) / 10_000, latitude: Math.round(latitude * 10_000) / 10_000 }, radiusKm, peaks: found.slice(0, 8), totalMatches: found.length, @@ -392,7 +394,7 @@ export function registerGlobeTools(bridge: GlobeToolsBridge): void { mountainId: { type: 'string', enum: zonationMountains.map((mountain) => mountain.id), - description: '内置剖面:' + zonationMountains.map((mountain) => `${mountain.id}(${mountain.name})`).join('、') + description: `内置剖面:${ zonationMountains.map((mountain) => `${mountain.id}(${mountain.name})`).join('、')}` }, waypoints: { type: 'array', @@ -412,12 +414,12 @@ export function registerGlobeTools(bridge: GlobeToolsBridge): void { }, execute: async (args) => { const current = bridge.getViewer() - if (!current || current.isDestroyed()) return { error: '地球尚未就绪' } - let waypoints: Array<[number, number]> + if (!current || current.isDestroyed()) {return { error: '地球尚未就绪' }} + let waypoints: [number, number][] let expectedMaxGroundM: number | undefined if (typeof args.mountainId === 'string') { const mountain = mountainById(args.mountainId) - if (!mountain) return { error: `未知山脉 ${String(args.mountainId)},可用剖面:${zonationMountains.map((item) => `${item.id}(${item.name})`).join('、')}` } + if (!mountain) {return { error: `未知山脉 ${String(args.mountainId)},可用剖面:${zonationMountains.map((item) => `${item.id}(${item.name})`).join('、')}` }} waypoints = mountain.transect expectedMaxGroundM = mountain.summitM } else if (Array.isArray(args.waypoints)) { @@ -426,10 +428,10 @@ export function registerGlobeTools(bridge: GlobeToolsBridge): void { return { error: '请提供 mountainId(内置山脉剖面)或 waypoints(2-6 个途经点)' } } const result = await flyTransect(current, waypoints, args.altitudeM === undefined ? { expectedMaxGroundM } : { altitudeM: Number(args.altitudeM), expectedMaxGroundM }) - if ('error' in result) return result - const samplingNote = result.maxGroundM !== undefined - ? `沿线采样最高地表 ${result.maxGroundM} 米${result.degraded ? '(地形数据不完整,已启用安全盲飞高度)' : ''}` - : '' + if ('error' in result) {return result} + const samplingNote = result.maxGroundM === undefined + ? '' + : `沿线采样最高地表 ${result.maxGroundM} 米${result.degraded ? '(地形数据不完整,已启用安全盲飞高度)' : ''}` if (result.status === 'interrupted') { const reason = result.reason === 'exaggeration-changed' ? '飞行中垂直夸张被调整,高度计划已失效,飞行自动中断' @@ -457,8 +459,8 @@ export function registerGlobeTools(bridge: GlobeToolsBridge): void { execute: async () => { const camera = useGlobeStore.getState().camera return { - longitude: Math.round(camera.longitude * 10000) / 10000, - latitude: Math.round(camera.latitude * 10000) / 10000, + longitude: Math.round(camera.longitude * 10_000) / 10_000, + latitude: Math.round(camera.latitude * 10_000) / 10_000, height: Math.round(camera.height), heading: Math.round(camera.heading * 10) / 10, pitch: Math.round(camera.pitch * 10) / 10 @@ -475,7 +477,7 @@ export function registerGlobeTools(bridge: GlobeToolsBridge): void { }, execute: async () => { const current = bridge.getViewer() - if (!current || current.isDestroyed()) return { error: '地球尚未就绪' } + if (!current || current.isDestroyed()) {return { error: '地球尚未就绪' }} const canvas = current.scene.canvas const viewContext = () => { const cartographic = current.camera.positionCartographic @@ -486,16 +488,16 @@ export function registerGlobeTools(bridge: GlobeToolsBridge): void { .map((cartesian) => Cesium.Cartographic.fromCartesian(cartesian)) const extent = picked.length >= 3 ? { - west: Math.round(Cesium.Math.toDegrees(Math.min(...picked.map((item) => item.longitude))) * 10000) / 10000, - south: Math.round(Cesium.Math.toDegrees(Math.min(...picked.map((item) => item.latitude))) * 10000) / 10000, - east: Math.round(Cesium.Math.toDegrees(Math.max(...picked.map((item) => item.longitude))) * 10000) / 10000, - north: Math.round(Cesium.Math.toDegrees(Math.max(...picked.map((item) => item.latitude))) * 10000) / 10000 + west: Math.round(Cesium.Math.toDegrees(Math.min(...picked.map((item) => item.longitude))) * 10_000) / 10_000, + south: Math.round(Cesium.Math.toDegrees(Math.min(...picked.map((item) => item.latitude))) * 10_000) / 10_000, + east: Math.round(Cesium.Math.toDegrees(Math.max(...picked.map((item) => item.longitude))) * 10_000) / 10_000, + north: Math.round(Cesium.Math.toDegrees(Math.max(...picked.map((item) => item.latitude))) * 10_000) / 10_000 } : undefined return { camera: { - longitude: Math.round(Cesium.Math.toDegrees(cartographic.longitude) * 10000) / 10000, - latitude: Math.round(Cesium.Math.toDegrees(cartographic.latitude) * 10000) / 10000, + longitude: Math.round(Cesium.Math.toDegrees(cartographic.longitude) * 10_000) / 10_000, + latitude: Math.round(Cesium.Math.toDegrees(cartographic.latitude) * 10_000) / 10_000, height: Math.round(cartographic.height), heading: Math.round(headingDegrees < 0 ? headingDegrees + 360 : headingDegrees), pitch: Math.round(Cesium.Math.toDegrees(current.camera.pitch) * 10) / 10 @@ -519,10 +521,10 @@ export function registerGlobeTools(bridge: GlobeToolsBridge): void { offscreen.width = Math.max(1, Math.round(canvas.width * scale)) offscreen.height = Math.max(1, Math.round(canvas.height * scale)) const context = offscreen.getContext('2d') - if (!context) return { error: '截图失败' } + if (!context) {return { error: '截图失败' }} context.drawImage(canvas, 0, 0, offscreen.width, offscreen.height) const image = offscreen.toDataURL('image/jpeg', 0.85) - if (!image.startsWith('data:image/')) return { error: '截图失败' } + if (!image.startsWith('data:image/')) {return { error: '截图失败' }} return { status: 'ok', screenshot: true, @@ -551,12 +553,12 @@ export function registerGlobeTools(bridge: GlobeToolsBridge): void { execute: async (args) => { const solarStore = useSolarStore.getState() if (args.date !== undefined) { - if (!isValidDate(args.date)) return { error: 'date 需为合法的 YYYY-MM-DD 日期' } + if (!isValidDate(args.date)) {return { error: 'date 需为合法的 YYYY-MM-DD 日期' }} solarStore.setDate(args.date) } if (args.hour !== undefined) { const hour = Number(args.hour) - if (!Number.isFinite(hour) || hour < 0 || hour >= 24) return { error: 'hour 需为 0-24 的小时数' } + if (!Number.isFinite(hour) || hour < 0 || hour >= 24) {return { error: 'hour 需为 0-24 的小时数' }} solarStore.setHour(hour) } if (typeof args.play === 'boolean') { @@ -594,10 +596,10 @@ export function registerGlobeTools(bridge: GlobeToolsBridge): void { }, execute: async (args) => { const latitude = Number(args.latitude) - if (!Number.isFinite(latitude) || latitude < -90 || latitude > 90) return { error: '纬度无效,需 -90 到 90' } + if (!Number.isFinite(latitude) || latitude < -90 || latitude > 90) {return { error: '纬度无效,需 -90 到 90' }} let dateStr = useSolarStore.getState().date if (args.date !== undefined) { - if (!isValidDate(args.date)) return { error: 'date 需为合法的 YYYY-MM-DD 日期' } + if (!isValidDate(args.date)) {return { error: 'date 需为合法的 YYYY-MM-DD 日期' }} dateStr = args.date } const { month, day } = datePartsOf(dateStr) @@ -612,8 +614,8 @@ export function registerGlobeTools(bridge: GlobeToolsBridge): void { noonAltitudeDeg: round1(noonAltitudeDeg(latitude, declination)), dayLengthHours: round1(length.hours), polar: length.state === 'polar-day' ? '极昼' : length.state === 'polar-night' ? '极夜' : undefined, - sunriseLocalSolarTime: times.sunrise !== undefined ? formatClock(times.sunrise) : undefined, - sunsetLocalSolarTime: times.sunset !== undefined ? formatClock(times.sunset) : undefined, + sunriseLocalSolarTime: times.sunrise === undefined ? undefined : formatClock(times.sunrise), + sunsetLocalSolarTime: times.sunset === undefined ? undefined : formatClock(times.sunset), note: '日出日落为地方时(平太阳时近似)' } } @@ -637,7 +639,7 @@ export function registerGlobeTools(bridge: GlobeToolsBridge): void { city: { type: 'string', enum: functionalZoneCities.map((city) => city.id), - description: '仅 functional-zones 城市功能分区图层使用:切换展示的城市(' + functionalZoneCities.map((city) => `${city.id}(${city.name})`).join('、') + '),默认武汉' + description: `仅 functional-zones 城市功能分区图层使用:切换展示的城市(${ functionalZoneCities.map((city) => `${city.id}(${city.name})`).join('、') }),默认武汉` } }, required: ['layerId', 'enabled'] @@ -645,23 +647,23 @@ export function registerGlobeTools(bridge: GlobeToolsBridge): void { }, execute: async (args) => { const layer = thematicLayerCatalog.find((item) => item.id === args.layerId) - if (!layer) return { error: `未知图层 ${String(args.layerId)},可用图层:${thematicLayerCatalog.map((item) => `${item.id}(${item.name})`).join('、')}` } - if (typeof args.enabled !== 'boolean') return { error: 'enabled 需为布尔值' } + if (!layer) {return { error: `未知图层 ${String(args.layerId)},可用图层:${thematicLayerCatalog.map((item) => `${item.id}(${item.name})`).join('、')}` }} + if (typeof args.enabled !== 'boolean') {return { error: 'enabled 需为布尔值' }} const nightActive = hidesThematicLayers(useGlobeStore.getState().selectedLayerId) - if (args.enabled && nightActive) return { error: '夜光底图下教学图层已隐藏,请先用 set_basemap 切换回其他底图再开启图层' } + if (args.enabled && nightActive) {return { error: '夜光底图下教学图层已隐藏,请先用 set_basemap 切换回其他底图再开启图层' }} const climateStore = useClimateStore.getState() let cityName: string | undefined if (args.city !== undefined) { - if (layer.id !== 'functional-zones') return { error: 'city 参数仅用于 functional-zones 城市功能分区图层' } + if (layer.id !== 'functional-zones') {return { error: 'city 参数仅用于 functional-zones 城市功能分区图层' }} const city = functionalZoneCityById(String(args.city)) - if (!city) return { error: `未知城市 ${String(args.city)},可用城市:${functionalZoneCities.map((item) => `${item.id}(${item.name})`).join('、')}` } + if (!city) {return { error: `未知城市 ${String(args.city)},可用城市:${functionalZoneCities.map((item) => `${item.id}(${item.name})`).join('、')}` }} climateStore.setFunctionalZoneCity(city.id) cityName = city.name } climateStore.setOverlay(layer.id, args.enabled) if (args.month !== undefined) { const month = Number(args.month) - if (!Number.isFinite(month) || month < 1 || month > 12) return { error: 'month 需为 1-12 的月份' } + if (!Number.isFinite(month) || month < 1 || month > 12) {return { error: 'month 需为 1-12 的月份' }} climateStore.setMonth(month) useClimateStore.setState({ isPlaying: false }) } @@ -674,7 +676,7 @@ export function registerGlobeTools(bridge: GlobeToolsBridge): void { month: nextMonth, city: cityName, message: args.enabled - ? `已开启「${layer.name}」图层${cityName ? `,展示城市:${cityName}` : ''}${args.month !== undefined ? `并设置月份为 ${nextMonth} 月` : ''};可在地球上点击图层要素查看成因` + ? `已开启「${layer.name}」图层${cityName ? `,展示城市:${cityName}` : ''}${args.month === undefined ? '' : `并设置月份为 ${nextMonth} 月`};可在地球上点击图层要素查看成因` : `已关闭「${layer.name}」图层` } } @@ -691,7 +693,7 @@ export function registerGlobeTools(bridge: GlobeToolsBridge): void { panelId: { type: 'string', enum: teachingPanelCatalog.map((panel) => panel.id), - description: '面板 id:' + teachingPanelCatalog.map((panel) => `${panel.id}(${panel.name})`).join('、') + description: `面板 id:${ teachingPanelCatalog.map((panel) => `${panel.id}(${panel.name})`).join('、')}` }, close: { type: 'boolean', description: 'true 时关闭全部教学面板并退出地方时点选模式,忽略 panelId' } } @@ -703,8 +705,8 @@ export function registerGlobeTools(bridge: GlobeToolsBridge): void { return { status: 'ok', closed: true, message: '已关闭全部教学演示面板' } } const panel = teachingPanelCatalog.find((item) => item.id === args.panelId) - if (!panel) return { error: `未知面板 ${String(args.panelId)},可用面板:${teachingPanelCatalog.map((item) => `${item.id}(${item.name})`).join('、')}` } - if (hidesThematicLayers(useGlobeStore.getState().selectedLayerId)) return { error: '夜光模式下教学面板不可用,请先用 set_basemap 切回其他底图' } + if (!panel) {return { error: `未知面板 ${String(args.panelId)},可用面板:${teachingPanelCatalog.map((item) => `${item.id}(${item.name})`).join('、')}` }} + if (hidesThematicLayers(useGlobeStore.getState().selectedLayerId)) {return { error: '夜光模式下教学面板不可用,请先用 set_basemap 切回其他底图' }} panel.open() return { status: 'ok', panelId: panel.id, name: panel.name, message: `已打开「${panel.name}」面板:${panel.hint}` } } @@ -721,7 +723,7 @@ export function registerGlobeTools(bridge: GlobeToolsBridge): void { basemapId: { type: 'string', enum: basemapChoices.map((provider) => provider.id), - description: '底图 id:' + basemapChoices.map((provider) => `${provider.id}(${provider.name},${provider.description})`).join('、') + description: `底图 id:${ basemapChoices.map((provider) => `${provider.id}(${provider.name},${provider.description})`).join('、')}` } }, required: ['basemapId'] @@ -729,8 +731,8 @@ export function registerGlobeTools(bridge: GlobeToolsBridge): void { }, execute: async (args) => { const basemap = basemapChoices.find((provider) => provider.id === args.basemapId) - if (!basemap) return { error: `未知底图 ${String(args.basemapId)},可用底图:${basemapChoices.map((provider) => `${provider.id}(${provider.name})`).join('、')}` } - if (useGlobeStore.getState().selectedLayerId === basemap.id) return { status: 'ok', basemapId: basemap.id, name: basemap.name, message: `当前已是「${basemap.name}」底图` } + if (!basemap) {return { error: `未知底图 ${String(args.basemapId)},可用底图:${basemapChoices.map((provider) => `${provider.id}(${provider.name})`).join('、')}` }} + if (useGlobeStore.getState().selectedLayerId === basemap.id) {return { status: 'ok', basemapId: basemap.id, name: basemap.name, message: `当前已是「${basemap.name}」底图` }} bridge.switchBasemap(basemap.id) return { status: 'ok', basemapId: basemap.id, name: basemap.name, message: `已切换到「${basemap.name}」底图(${basemap.description})` } } @@ -747,7 +749,7 @@ export function registerGlobeTools(bridge: GlobeToolsBridge): void { terrainId: { type: 'string', enum: terrainCatalog.map((terrain) => terrain.id), - description: '地形数据源:' + terrainCatalog.map((terrain) => `${terrain.id}(${terrain.name},${terrain.description})`).join('、') + description: `地形数据源:${ terrainCatalog.map((terrain) => `${terrain.id}(${terrain.name},${terrain.description})`).join('、')}` }, exaggeration: { type: 'number', description: '垂直夸张倍数(1-5):1 为真实比例,讲山系褶皱、峡谷下切可用 3-5' }, lighting: { type: 'boolean', description: '地形太阳光照开关,开启后山脉有明暗立体感' } @@ -758,20 +760,20 @@ export function registerGlobeTools(bridge: GlobeToolsBridge): void { let terrain: (typeof terrainCatalog)[number] | undefined if (args.terrainId !== undefined) { terrain = terrainCatalog.find((item) => item.id === args.terrainId) - if (!terrain) return { error: `未知地形 ${String(args.terrainId)},可用地形:${terrainCatalog.map((item) => `${item.id}(${item.name})`).join('、')}` } + if (!terrain) {return { error: `未知地形 ${String(args.terrainId)},可用地形:${terrainCatalog.map((item) => `${item.id}(${item.name})`).join('、')}` }} } let exaggeration: number | undefined if (args.exaggeration !== undefined) { const value = Number(args.exaggeration) - if (!Number.isFinite(value) || value < 1 || value > 5) return { error: 'exaggeration 需为 1-5 的数字' } + if (!Number.isFinite(value) || value < 1 || value > 5) {return { error: 'exaggeration 需为 1-5 的数字' }} exaggeration = Math.round(value * 10) / 10 } let lighting: boolean | undefined if (args.lighting !== undefined) { - if (typeof args.lighting !== 'boolean') return { error: 'lighting 需为布尔值' } + if (typeof args.lighting !== 'boolean') {return { error: 'lighting 需为布尔值' }} lighting = args.lighting } - if (!terrain && exaggeration === undefined && lighting === undefined) return { error: '请至少提供 terrainId、exaggeration 或 lighting 之一' } + if (!terrain && exaggeration === undefined && lighting === undefined) {return { error: '请至少提供 terrainId、exaggeration 或 lighting 之一' }} const applied: string[] = [] if (terrain) { bridge.setTerrain(terrain.id) @@ -806,7 +808,7 @@ export function registerGlobeTools(bridge: GlobeToolsBridge): void { }, execute: async (args) => { const current = bridge.getViewer() - if (!current || current.isDestroyed()) return { error: '地球尚未就绪' } + if (!current || current.isDestroyed()) {return { error: '地球尚未就绪' }} const longitude = Number(args.longitude) const latitude = Number(args.latitude) if (!Number.isFinite(longitude) || !Number.isFinite(latitude) || longitude < -180 || longitude > 180 || latitude < -90 || latitude > 90) { @@ -816,13 +818,13 @@ export function registerGlobeTools(bridge: GlobeToolsBridge): void { let heightMeters: number | null = null try { const [sampled] = await Cesium.sampleTerrainMostDetailed(current.terrainProvider, [cartographic.clone()]) - if (sampled && Number.isFinite(sampled.height)) heightMeters = Math.round(sampled.height * 100) / 100 + if (sampled && Number.isFinite(sampled.height)) {heightMeters = Math.round(sampled.height * 100) / 100} } catch { void 0 } if (heightMeters === null) { const fallback = current.scene.globe.getHeight(cartographic) - if (typeof fallback === 'number' && Number.isFinite(fallback)) heightMeters = Math.round(fallback * 100) / 100 + if (typeof fallback === 'number' && Number.isFinite(fallback)) {heightMeters = Math.round(fallback * 100) / 100} } const nearest = nearestBoundary(longitude, latitude) const distanceKm = Math.round(nearest.distanceKm) @@ -860,14 +862,14 @@ export function registerGlobeTools(bridge: GlobeToolsBridge): void { }, execute: async (args) => { const name = typeof args.name === 'string' ? args.name.trim().slice(0, 80) : '' - if (!name) return { error: '需要提供场景名称' } + if (!name) {return { error: '需要提供场景名称' }} const narration = typeof args.narration === 'string' ? args.narration.trim().slice(0, 500) : '' try { const scene = bridge.captureScene(name, narration) const scenesStore = useScenesStore.getState() await scenesStore.addScene(scene) const saveError = useScenesStore.getState().saveError - if (saveError) return { error: `场景保存失败:${saveError}` } + if (saveError) {return { error: `场景保存失败:${saveError}` }} return { status: 'ok', id: scene.id, name, hint: '场景已保存,可在底部工具栏「教学场景」面板中查看、排序与播放' } } catch (error) { return { error: error instanceof Error ? error.message : '地球尚未就绪,无法捕获当前画面' } @@ -896,8 +898,8 @@ export function registerGlobeTools(bridge: GlobeToolsBridge): void { month: scene.snapshot.month, solarSimulation: Boolean(scene.snapshot.simTime), camera: { - longitude: Math.round(scene.snapshot.camera.longitude * 10000) / 10000, - latitude: Math.round(scene.snapshot.camera.latitude * 10000) / 10000, + longitude: Math.round(scene.snapshot.camera.longitude * 10_000) / 10_000, + latitude: Math.round(scene.snapshot.camera.latitude * 10_000) / 10_000, height: Math.round(scene.snapshot.camera.height) } })) @@ -926,7 +928,7 @@ export function registerGlobeTools(bridge: GlobeToolsBridge): void { height: { type: 'number', description: '本幕视点高度(米),默认 600000。宁远勿近,观众要看清地理格局而非街道:国家/大区域尺度 800000-3000000,省域/城市群 200000-800000,单个城市 80000-200000,地貌细节也不低于 15000' }, heading: { type: 'number', description: '可选朝向角(度,默认 0)' }, pitch: { type: 'number', description: '可选俯仰角(度,-90 正俯视为默认,看地形起伏可用 -55 至 -70,中心点仍保持画面居中)' }, - overlays: { type: 'array', description: '本幕开启的教学图层 id 列表(未列出的图层会被关闭),可选项:' + thematicLayerCatalog.map((layer) => `${layer.id}(${layer.name})`).join('、'), items: { type: 'string' } }, + overlays: { type: 'array', description: `本幕开启的教学图层 id 列表(未列出的图层会被关闭),可选项:${ thematicLayerCatalog.map((layer) => `${layer.id}(${layer.name})`).join('、')}`, items: { type: 'string' } }, month: { type: 'number', description: '可选专题月份 1-12(配合季节性图层对比 1 月/7 月)' }, simTime: { type: 'object', description: '可选昼夜模拟 { date: "YYYY-MM-DD", hour: 北京时间 0-24 },如夏至 2026-06-22', properties: { date: { type: 'string' }, hour: { type: 'number' } } }, ensoPhase: { type: 'string', description: '可选 ENSO 相位:normal(正常)/ el-nino(厄尔尼诺)/ la-nina(拉尼娜),配合 enso 图层讲解', enum: ['normal', 'el-nino', 'la-nina'] }, @@ -946,18 +948,18 @@ export function registerGlobeTools(bridge: GlobeToolsBridge): void { } }, execute: async (args) => { - if (!Array.isArray(args.steps) || !args.steps.length) return { error: 'steps 需为非空数组' } - if (args.steps.length > MAX_RECORD_STEPS) return { error: `单次录制最多 ${MAX_RECORD_STEPS} 幕,请精简剧本` } + if (!Array.isArray(args.steps) || args.steps.length === 0) {return { error: 'steps 需为非空数组' }} + if (args.steps.length > MAX_RECORD_STEPS) {return { error: `单次录制最多 ${MAX_RECORD_STEPS} 幕,请精简剧本` }} const title = typeof args.title === 'string' && args.title.trim() ? args.title.trim().slice(0, 80) : '地理教学视频' const steps: RecordingStep[] = [] for (let index = 0; index < args.steps.length; index += 1) { const step = parseRecordingStep(args.steps[index], index) - if ('error' in step) return { error: step.error } + if ('error' in step) {return { error: step.error }} steps.push(step) } - if (!await bridge.ensureRecordingDirectory()) return { error: '已取消视频保存文件夹选择,录制未开始' } + if (!await bridge.ensureRecordingDirectory()) {return { error: '已取消视频保存文件夹选择,录制未开始' }} const result = await bridge.recordVideo(title, steps) - if ('error' in result) return { error: result.error } + if ('error' in result) {return { error: result.error }} return { status: 'started', title, diff --git a/src/renderer/src/components/AnnotationPanel.tsx b/src/renderer/src/components/AnnotationPanel.tsx index 0fc3ab9..5cc30e9 100644 --- a/src/renderer/src/components/AnnotationPanel.tsx +++ b/src/renderer/src/components/AnnotationPanel.tsx @@ -1,4 +1,5 @@ -import { useMemo, useRef, useState, type DragEvent, type KeyboardEvent, type ReactNode } from 'react' +import { useMemo, useRef, useState } from 'react'; +import type { DragEvent, KeyboardEvent, ReactNode } from 'react'; import { ChevronRightIcon, FolderIcon, @@ -24,9 +25,11 @@ import { useConfirm, useToast } from '@renderer/components/ui' -import { flattenVisibleTree, resolveTreeKeyAction, type TreeNavNode } from '@renderer/lib/treeNavigation' +import { flattenVisibleTree, resolveTreeKeyAction } from '@renderer/lib/treeNavigation'; +import type { TreeNavNode } from '@renderer/lib/treeNavigation'; import type { AnnotationEntry } from '../../../preload' -import { useDrawingStore, type DrawnShape } from '@renderer/stores/drawing' +import { useDrawingStore } from '@renderer/stores/drawing'; +import type { DrawnShape } from '@renderer/stores/drawing'; import styles from './AnnotationPanel.module.css' export interface AnnotationPanelProps { @@ -61,10 +64,10 @@ const kindLabels: Record = { } function renderKindIcon(kind: DrawnShape['kind']): ReactNode { - if (kind === 'point') return - if (kind === 'polyline') return - if (kind === 'polygon') return - if (kind === 'arrow') return + if (kind === 'point') {return } + if (kind === 'polyline') {return } + if (kind === 'polygon') {return } + if (kind === 'arrow') {return } return } @@ -176,7 +179,7 @@ export function AnnotationPanel({ function saveFolder(): void { const name = folderName.trim() - if (!name) return + if (!name) {return} if (folderDialogMode === 'create') { const id = addFolder(name, folderTargetId) if (!id) { @@ -227,8 +230,8 @@ export function AnnotationPanel({ const rect = event.currentTarget.getBoundingClientRect() const ratio = (event.clientY - rect.top) / Math.max(1, rect.height) if (node.nodeType === 'folder') { - if (ratio < 0.28) return 'before' - if (ratio > 0.72) return 'after' + if (ratio < 0.28) {return 'before'} + if (ratio > 0.72) {return 'after'} return 'inside' } return ratio < 0.5 ? 'before' : 'after' @@ -241,7 +244,7 @@ export function AnnotationPanel({ const placement = resolvePlacement(event, node) setDraggingId(null) setDropHint(null) - if (!sourceId || sourceId === node.entryId) return + if (!sourceId || sourceId === node.entryId) {return} if (!moveEntry(sourceId, node.entryId, placement)) { toast.warning('无法移动到这里,文件夹最多嵌套 5 层') return @@ -252,7 +255,7 @@ export function AnnotationPanel({ } function dropAtTopLevel(): void { - if (draggingId) moveEntry(draggingId, null, 'inside') + if (draggingId) {moveEntry(draggingId, null, 'inside')} setDraggingId(null) setDropHint(null) } @@ -260,12 +263,12 @@ export function AnnotationPanel({ function selectNode(node: AnnotationTreeNode): void { setSelectedEntryKey(node.key) setFocusedKey(node.key) - if (node.nodeType === 'shape') onFly(node.entryId) - else toggleExpand(node.key) + if (node.nodeType === 'shape') {onFly(node.entryId)} + else {toggleExpand(node.key)} } function handleTreeKeyDown(event: KeyboardEvent, node: AnnotationTreeNode): void { - if (event.target !== event.currentTarget) return + if (event.target !== event.currentTarget) {return} const action = resolveTreeKeyAction(event.key, node.key, visibleItems, expandedSet) if ( action || @@ -278,7 +281,7 @@ export function AnnotationPanel({ ) { event.preventDefault() } - if (!action) return + if (!action) {return} if (action.type === 'focus') { focusTreeItem(action.key) } else if (action.type === 'expand') { @@ -303,8 +306,8 @@ export function AnnotationPanel({
{ - if (element) treeItemRefs.current.set(node.key, element) - else treeItemRefs.current.delete(node.key) + if (element) {treeItemRefs.current.set(node.key, element)} + else {treeItemRefs.current.delete(node.key)} }} role="treeitem" aria-level={depth + 1} @@ -316,7 +319,7 @@ export function AnnotationPanel({ tabIndex={node.key === rovingKey ? 0 : -1} className={styles.treeNodeWrap} onFocus={(event) => { - if (event.target === event.currentTarget) setFocusedKey(node.key) + if (event.target === event.currentTarget) {setFocusedKey(node.key)} }} onKeyDown={(event) => handleTreeKeyDown(event, node)} > @@ -343,7 +346,7 @@ export function AnnotationPanel({ setDropHint(null) }} onDragOver={(event) => { - if (!draggingId || draggingId === node.entryId) return + if (!draggingId || draggingId === node.entryId) {return} event.preventDefault() event.stopPropagation() setDropHint({ key: node.key, placement: resolvePlacement(event, node) }) diff --git a/src/renderer/src/components/AtmosphereLayersPanel.tsx b/src/renderer/src/components/AtmosphereLayersPanel.tsx index 4110d0b..5f308b9 100644 --- a/src/renderer/src/components/AtmosphereLayersPanel.tsx +++ b/src/renderer/src/components/AtmosphereLayersPanel.tsx @@ -1,7 +1,8 @@ import { useMemo } from 'react' import { XIcon } from 'lucide-react' import { Button } from '@renderer/components/ui' -import LineChart, { type ChartSeries } from './charts/LineChart' +import LineChart from './charts/LineChart'; +import type { ChartSeries } from './charts/LineChart'; import styles from './AtmosphereLayersPanel.module.css' export interface AtmosphereLayersPanelProps { @@ -10,10 +11,10 @@ export interface AtmosphereLayersPanelProps { const TEMP_COLOR = '#1677ff' -const profilePoints: Array<[number, number]> = [] -for (let h = 0; h <= 12; h += 1) profilePoints.push([15 - (h * 70) / 12, h]) -for (let h = 13; h <= 50; h += 1) profilePoints.push([-55 + ((h - 12) * 52) / 38, h]) -for (let h = 51; h <= 85; h += 1) profilePoints.push([-3 - ((h - 50) * 87) / 35, h]) +const profilePoints: [number, number][] = [] +for (let h = 0; h <= 12; h += 1) {profilePoints.push([15 - (h * 70) / 12, h])} +for (let h = 13; h <= 50; h += 1) {profilePoints.push([-55 + ((h - 12) * 52) / 38, h])} +for (let h = 51; h <= 85; h += 1) {profilePoints.push([-3 - ((h - 50) * 87) / 35, h])} const layers = [ { diff --git a/src/renderer/src/components/CameraStatus.tsx b/src/renderer/src/components/CameraStatus.tsx index 066d499..34d1521 100644 --- a/src/renderer/src/components/CameraStatus.tsx +++ b/src/renderer/src/components/CameraStatus.tsx @@ -12,8 +12,8 @@ function formatCoordinate(value: number, isLongitude: boolean): string { } function formatHeight(height: number): string { - if (height > 1000000) return `${(height / 1000000).toFixed(2)} Mm` - if (height > 1000) return `${(height / 1000).toFixed(2)} km` + if (height > 1_000_000) {return `${(height / 1000000).toFixed(2)} Mm`} + if (height > 1000) {return `${(height / 1000).toFixed(2)} km`} return `${height.toFixed(0)} m` } diff --git a/src/renderer/src/components/CitiesPanel.tsx b/src/renderer/src/components/CitiesPanel.tsx index bf23bb4..776e0fc 100644 --- a/src/renderer/src/components/CitiesPanel.tsx +++ b/src/renderer/src/components/CitiesPanel.tsx @@ -4,14 +4,10 @@ import { Button, Select } from '@renderer/components/ui' import { useClimateStore } from '@renderer/stores/climate' import { useGlobeStore } from '@renderer/stores/globe' import type { PoiStatisticsResult } from '../../../preload' -import { - CENTRAL_PLACE_CASES, - CITY_TIER_META, - centralPlaceFacts, - urbanCities, - type CentralPlaceCase -} from '@renderer/thematic/urbanCities' -import BarChart, { type BarSeries } from './charts/BarChart' +import { CENTRAL_PLACE_CASES, CITY_TIER_META, centralPlaceFacts, urbanCities } from '@renderer/thematic/urbanCities'; +import type { CentralPlaceCase } from '@renderer/thematic/urbanCities'; +import BarChart from './charts/BarChart'; +import type { BarSeries } from './charts/BarChart'; import styles from './CitiesPanel.module.css' export interface CitiesPanelProps { @@ -40,21 +36,21 @@ export function CitiesPanel({ onClose }: CitiesPanelProps) { const [statusText, setStatusText] = useState('') const requestSeqRef = useRef(0) - useEffect(() => { - return () => { + useEffect(() => + () => { requestSeqRef.current += 1 } - }, []) + , []) function selectCase(tier: 'high' | 'low', name: string): void { const item = CENTRAL_PLACE_CASES.find((candidate) => candidate.name === name) - if (!item) return + if (!item) {return} requestSeqRef.current += 1 if (tier === 'high') { - if (item.name === selectedLow.name) setSelectedLow(selectedHigh) + if (item.name === selectedLow.name) {setSelectedLow(selectedHigh)} setSelectedHigh(item) } else { - if (item.name === selectedHigh.name) setSelectedHigh(selectedLow) + if (item.name === selectedHigh.name) {setSelectedHigh(selectedLow)} setSelectedLow(item) } setRunning(false) @@ -64,7 +60,7 @@ export function CitiesPanel({ onClose }: CitiesPanelProps) { } async function runVerification(): Promise { - if (running) return + if (running) {return} requestSeqRef.current += 1 const seq = requestSeqRef.current setRunning(true) @@ -86,7 +82,7 @@ export function CitiesPanel({ onClose }: CitiesPanelProps) { maxSamples: 400 }) ]) - if (requestSeqRef.current !== seq) return + if (requestSeqRef.current !== seq) {return} setHighResult(high) setLowResult(low) if (high.error || low.error) { @@ -103,17 +99,17 @@ export function CitiesPanel({ onClose }: CitiesPanelProps) { }` ) } catch (error) { - if (requestSeqRef.current !== seq) return + if (requestSeqRef.current !== seq) {return} setStatusText(error instanceof Error ? error.message : '数据请求失败,请重试') } finally { - if (requestSeqRef.current === seq) setRunning(false) + if (requestSeqRef.current === seq) {setRunning(false)} } } const topCategories = useMemo(() => { const union = new Map() - for (const item of highResult?.categories ?? []) union.set(item.code, item.label) - for (const item of lowResult?.categories ?? []) union.set(item.code, item.label) + for (const item of highResult?.categories ?? []) {union.set(item.code, item.label)} + for (const item of lowResult?.categories ?? []) {union.set(item.code, item.label)} const rank = (code: string, result: PoiStatisticsResult | null): number => result?.categories.find((item) => item.code === code)?.count ?? 0 return [...union.entries()] @@ -177,7 +173,7 @@ export function CitiesPanel({ onClose }: CitiesPanelProps) { className={styles.caseSelect} options={caseOptions} onChange={(value) => { - if (value) selectCase('high', String(value)) + if (value) {selectCase('high', String(value))} }} /> vs @@ -187,7 +183,7 @@ export function CitiesPanel({ onClose }: CitiesPanelProps) { className={styles.caseSelect} options={caseOptions} onChange={(value) => { - if (value) selectCase('low', String(value)) + if (value) {selectCase('low', String(value))} }} />
diff --git a/src/renderer/src/components/ContextMeter.tsx b/src/renderer/src/components/ContextMeter.tsx index 77b2e09..66cbda2 100644 --- a/src/renderer/src/components/ContextMeter.tsx +++ b/src/renderer/src/components/ContextMeter.tsx @@ -31,10 +31,10 @@ const FREE_COLOR = 'var(--muted)' function formatTokens(tokens: number): string { const trim = (value: string): string => value.replace(/\.0$/, '') - if (tokens >= 1_000_000) return `${trim((tokens / 1_000_000).toFixed(1))}M` - if (tokens <= 0) return '0' - if (tokens < 1_000) return `${Math.max(0.1, tokens / 1_000).toFixed(1)}k` - return `${trim((tokens / 1_000).toFixed(1))}k` + if (tokens >= 1_000_000) {return `${trim((tokens / 1_000_000).toFixed(1))}M`} + if (tokens <= 0) {return '0'} + if (tokens < 1000) {return `${Math.max(0.1, tokens / 1_000).toFixed(1)}k`} + return `${trim((tokens / 1000).toFixed(1))}k` } function formatShare(share: number | undefined): string { diff --git a/src/renderer/src/components/DrawingEditToolbar.tsx b/src/renderer/src/components/DrawingEditToolbar.tsx index 2ce85d6..d2c9ea3 100644 --- a/src/renderer/src/components/DrawingEditToolbar.tsx +++ b/src/renderer/src/components/DrawingEditToolbar.tsx @@ -68,7 +68,7 @@ export function DrawingEditToolbar({ shape, fonts, onChange, onRemove }: Drawing className={styles.numberControl} aria-label="线宽" onChange={(value) => { - if (typeof value === 'number') onChange({ lineWidth: value }) + if (typeof value === 'number') {onChange({ lineWidth: value })} }} /> @@ -94,7 +94,7 @@ export function DrawingEditToolbar({ shape, fonts, onChange, onRemove }: Drawing className={styles.fontSelect} aria-label="系统字体" onChange={(value) => { - if (value) onChange({ fontFamily: value }) + if (value) {onChange({ fontFamily: value })} }} /> @@ -108,7 +108,7 @@ export function DrawingEditToolbar({ shape, fonts, onChange, onRemove }: Drawing className={styles.numberControl} aria-label="字号" onChange={(value) => { - if (typeof value === 'number') onChange({ fontSize: value }) + if (typeof value === 'number') {onChange({ fontSize: value })} }} /> diff --git a/src/renderer/src/components/DrawingTouchBar.tsx b/src/renderer/src/components/DrawingTouchBar.tsx index e7442dd..b5dc353 100644 --- a/src/renderer/src/components/DrawingTouchBar.tsx +++ b/src/renderer/src/components/DrawingTouchBar.tsx @@ -18,7 +18,7 @@ export function DrawingTouchBar({ onUndo, onFinish }: DrawingTouchBarProps) { - if (!activeTool) return null + if (!activeTool) {return null} const canUndo = activeTool === 'line' || activeTool === 'polygon' || activeTool === 'arrow' const canFinish = activeTool === 'line' || activeTool === 'polygon' diff --git a/src/renderer/src/components/EarthLayersPanel.tsx b/src/renderer/src/components/EarthLayersPanel.tsx index a762327..340d9c6 100644 --- a/src/renderer/src/components/EarthLayersPanel.tsx +++ b/src/renderer/src/components/EarthLayersPanel.tsx @@ -60,9 +60,9 @@ const layers: Record = { } } -const layerEntries = Object.entries(layers) as Array<[LayerId, LayerMeta]> +const layerEntries = Object.entries(layers) as [LayerId, LayerMeta][] -const arcs: Array<{ id: LayerId; r: number }> = [ +const arcs: { id: LayerId; r: number }[] = [ { id: 'inner-core', r: 40 }, { id: 'outer-core', r: 86 }, { id: 'mantle', r: 138 }, @@ -71,7 +71,7 @@ const arcs: Array<{ id: LayerId; r: number }> = [ const reversedArcs = [...arcs].reverse() -const callouts: Array<{ id: LayerId; x: number; y: number; anchorX: number; anchorY: number; side: 'left' | 'right' }> = [ +const callouts: { id: LayerId; x: number; y: number; anchorX: number; anchorY: number; side: 'left' | 'right' }[] = [ { id: 'crust', x: 44, y: 40, anchorX: 100, anchorY: 40, side: 'left' }, { id: 'mantle', x: 40, y: 96, anchorX: 82, anchorY: 118, side: 'left' }, { id: 'outer-core', x: 306, y: 84, anchorX: 262, anchorY: 116, side: 'right' }, diff --git a/src/renderer/src/components/EnsoPanel.tsx b/src/renderer/src/components/EnsoPanel.tsx index 762e188..8178b5c 100644 --- a/src/renderer/src/components/EnsoPanel.tsx +++ b/src/renderer/src/components/EnsoPanel.tsx @@ -1,7 +1,8 @@ import { XIcon } from 'lucide-react' import { Button, Segmented } from '@renderer/components/ui' import { useClimateStore } from '@renderer/stores/climate' -import { ensoPhaseMeta, ensoPhaseOptions, type EnsoPhase } from '@renderer/thematic/ensoPhases' +import { ensoPhaseMeta, ensoPhaseOptions } from '@renderer/thematic/ensoPhases'; +import type { EnsoPhase } from '@renderer/thematic/ensoPhases'; import styles from './EnsoPanel.module.css' export interface EnsoPanelProps { @@ -24,7 +25,7 @@ export function EnsoPanel({ onClose }: EnsoPanelProps) { options={ensoPhaseOptions} size="sm" aria-label="ENSO 相位" - onChange={(value) => setEnsoPhase(value as EnsoPhase)} + onChange={(value) => setEnsoPhase(value)} />
{meta.summary}
diff --git a/src/renderer/src/components/EnvironmentPanel.tsx b/src/renderer/src/components/EnvironmentPanel.tsx index 13f48b0..a29a95b 100644 --- a/src/renderer/src/components/EnvironmentPanel.tsx +++ b/src/renderer/src/components/EnvironmentPanel.tsx @@ -3,18 +3,11 @@ import * as Cesium from 'cesium' import { MapPinIcon, XIcon } from 'lucide-react' import { Button, Segmented } from '@renderer/components/ui' import { useClimateStore } from '@renderer/stores/climate' -import { - SEA_LEVEL_SCENARIOS, - coastalZones, - inundationByZone, - scenarioSummary, - seaLevelFacts, - totalGridCellCount, - useSeaLevelStore, - type SeaLevelScenario -} from '@renderer/thematic/seaLevelRise' +import { SEA_LEVEL_SCENARIOS, coastalZones, inundationByZone, scenarioSummary, seaLevelFacts, totalGridCellCount, useSeaLevelStore } from '@renderer/thematic/seaLevelRise'; +import type { SeaLevelScenario } from '@renderer/thematic/seaLevelRise'; import { ensureSeaLevelSamples } from '@renderer/composables/seaLevelSampling' -import BarChart, { type BarSeries } from './charts/BarChart' +import BarChart from './charts/BarChart'; +import type { BarSeries } from './charts/BarChart'; import styles from './EnvironmentPanel.module.css' export interface EnvironmentPanelProps { @@ -56,7 +49,7 @@ export function EnvironmentPanel({ viewer, onClose }: EnvironmentPanelProps) { ) const beginSampling = useCallback(async (): Promise => { - if (!viewer || viewer.isDestroyed()) return + if (!viewer || viewer.isDestroyed()) {return} await ensureSeaLevelSamples(viewer) }, [viewer]) @@ -65,8 +58,8 @@ export function EnvironmentPanel({ viewer, onClose }: EnvironmentPanelProps) { }, [beginSampling]) function flyToZone(index: number): void { - if (flyingRef.current) return - if (!viewer || viewer.isDestroyed()) return + if (flyingRef.current) {return} + if (!viewer || viewer.isDestroyed()) {return} flyingRef.current = true try { const zone = coastalZones[index] @@ -91,7 +84,7 @@ export function EnvironmentPanel({ viewer, onClose }: EnvironmentPanelProps) { value={rise} options={scenarioOptions} className={styles.scenarioPicker} - onChange={(value) => setSeaLevelRise(value as SeaLevelScenario)} + onChange={(value) => setSeaLevelRise(value)} /> {sampledReady ? ( diff --git a/src/renderer/src/components/EoqAssistant.tsx b/src/renderer/src/components/EoqAssistant.tsx index 147982e..17d108b 100644 --- a/src/renderer/src/components/EoqAssistant.tsx +++ b/src/renderer/src/components/EoqAssistant.tsx @@ -1,4 +1,5 @@ -import { useCallback, useEffect, useMemo, useRef, useState, type KeyboardEvent, type MouseEvent, type PointerEvent as ReactPointerEvent } from 'react' +import { useCallback, useEffect, useMemo, useRef, useState } from 'react'; +import type { KeyboardEvent, MouseEvent, PointerEvent as ReactPointerEvent } from 'react'; import { ThreadPrimitive } from '@assistant-ui/react' import { HistoryIcon, @@ -8,11 +9,13 @@ import { Trash2Icon, XIcon } from 'lucide-react' -import { Button, Checkbox, Drawer, DropdownMenu, Modal, Tooltip, type DropdownMenuEntry } from '@renderer/components/ui' +import { Button, Checkbox, Drawer, DropdownMenu, Modal, Tooltip } from '@renderer/components/ui'; +import type { DropdownMenuEntry } from '@renderer/components/ui'; import { useAiStore } from '@renderer/stores/ai' import { useSettingsWindowStore } from '@renderer/stores/settingsWindow' import type { StoredAiConversationSummary } from '../../../preload' -import EoqComposer, { type EoqSlashCommand } from './eoq/EoqComposer' +import EoqComposer from './eoq/EoqComposer'; +import type { EoqSlashCommand } from './eoq/EoqComposer'; import EoqIconButton from './eoq/EoqIconButton' import EoqMessages from './eoq/EoqMessages' import EoqRuntimeProvider from './eoq/EoqRuntimeProvider' @@ -22,7 +25,7 @@ import styles from './EoqAssistant.module.css' function formatConversationTime(timestamp: number): string { const date = new Date(timestamp) const time = date.toLocaleTimeString('zh-CN', { hour: '2-digit', minute: '2-digit' }) - if (date.toDateString() === new Date().toDateString()) return time + if (date.toDateString() === new Date().toDateString()) {return time} if (date.getFullYear() === new Date().getFullYear()) { return `${date.toLocaleDateString('zh-CN', { month: 'numeric', day: 'numeric' })} ${time}` } @@ -104,7 +107,7 @@ export function EoqAssistant() { }, [clampDrawerWidth]) const stopDrawerResize = useCallback(() => { - if (!resizingRef.current) return + if (!resizingRef.current) {return} resizingRef.current = false document.body.style.userSelect = '' persistDrawerWidth(drawerWidthRef.current) @@ -112,7 +115,7 @@ export function EoqAssistant() { useEffect(() => { const handleDrawerResize = (event: PointerEvent): void => { - if (!resizingRef.current) return + if (!resizingRef.current) {return} const maxWidth = Math.max(0, Math.floor(window.innerWidth / 3)) setDrawerWidth(clampDrawerWidth(window.innerWidth - event.clientX, maxWidth)) } @@ -128,7 +131,7 @@ export function EoqAssistant() { }, [clampDrawerWidth, stopDrawerResize]) const startDrawerResize = useCallback((event: ReactPointerEvent) => { - if (event.button !== 0) return + if (event.button !== 0) {return} resizingRef.current = true document.body.style.userSelect = 'none' event.preventDefault() @@ -146,10 +149,10 @@ export function EoqAssistant() { } const step = event.shiftKey ? 80 : 20 let nextWidth = drawerWidthRef.current - if (event.key === 'ArrowLeft') nextWidth = clampDrawerWidth(drawerWidthRef.current + step) - if (event.key === 'ArrowRight') nextWidth = clampDrawerWidth(drawerWidthRef.current - step) - if (event.key === 'Home') nextWidth = drawerMinWidth - if (event.key === 'End') nextWidth = drawerMaxWidth + if (event.key === 'ArrowLeft') {nextWidth = clampDrawerWidth(drawerWidthRef.current + step)} + if (event.key === 'ArrowRight') {nextWidth = clampDrawerWidth(drawerWidthRef.current - step)} + if (event.key === 'Home') {nextWidth = drawerMinWidth} + if (event.key === 'End') {nextWidth = drawerMaxWidth} setDrawerWidth(nextWidth) persistDrawerWidth(nextWidth) event.preventDefault() @@ -169,10 +172,10 @@ export function EoqAssistant() { const handleInterceptSend = useCallback( (text: string): boolean => { - const command = text.trim().match(/^\/([^\s]+)(?:\s+.*)?$/)?.[1].toLowerCase() - if (!command) return false + const command = (/^\/([^\s]+)(?:\s+.*)?$/.exec(text.trim()))?.[1].toLowerCase() + if (!command) {return false} const matched = agentCommands.find((item) => item.name.slice(1) === command) - if (!matched) return false + if (!matched) {return false} void matched.run() return true }, @@ -182,7 +185,7 @@ export function EoqAssistant() { const handleSubmitPrompt = useCallback( (prompt: string) => { const text = prompt.trim() - if (!text || isStreaming) return + if (!text || isStreaming) {return} void send(text) }, [isStreaming, send] @@ -215,8 +218,8 @@ export function EoqAssistant() { const target = deleteTarget setDeleteConfirmOpen(false) setDeleteTarget(null) - if (!target) return - if (deleteNoAsk) setSkipDeleteConversationConfirm(true) + if (!target) {return} + if (deleteNoAsk) {setSkipDeleteConversationConfirm(true)} void deleteConversation(target.id) }, [deleteConversation, deleteNoAsk, deleteTarget, setSkipDeleteConversationConfirm]) diff --git a/src/renderer/src/components/ExogenicPanel.tsx b/src/renderer/src/components/ExogenicPanel.tsx index 9d59c5e..64fa876 100644 --- a/src/renderer/src/components/ExogenicPanel.tsx +++ b/src/renderer/src/components/ExogenicPanel.tsx @@ -25,7 +25,7 @@ const stages: ChainStage[] = [ force: '温差、冻融、水、生物', description: '岩石原地被破坏、崩解碎裂,不发生位移。花岗岩球状风化、石灰岩化学溶蚀都属于风化。', color: '#faad14', - site: { label: '黄山球状风化', longitude: 118.17, latitude: 30.13, height: 30000 } + site: { label: '黄山球状风化', longitude: 118.17, latitude: 30.13, height: 30_000 } }, { id: 'erosion', @@ -33,7 +33,7 @@ const stages: ChainStage[] = [ force: '流水、风力、冰川、海浪', description: '风化产物与岩石被外力破坏并搬离原地:流水下切成 V 形谷、风蚀雅丹、冰川刨蚀 U 形谷、海浪蚀出海蚀崖。', color: '#fa8c16', - site: { label: '虎跳峡流水侵蚀', longitude: 100.05, latitude: 27.25, height: 45000 } + site: { label: '虎跳峡流水侵蚀', longitude: 100.05, latitude: 27.25, height: 45_000 } }, { id: 'transportation', @@ -41,7 +41,7 @@ const stages: ChainStage[] = [ force: '流水、风力、冰川', description: '外力将碎屑物质搬运离开:河流挟带泥沙(黄河“一碗水半碗沙”)、风沙运移、冰川携带冰碛物。', color: '#722ed1', - site: { label: '黄河中游泥沙搬运', longitude: 110.5, latitude: 35.5, height: 400000 } + site: { label: '黄河中游泥沙搬运', longitude: 110.5, latitude: 35.5, height: 400_000 } }, { id: 'deposition', @@ -49,7 +49,7 @@ const stages: ChainStage[] = [ force: '流速/风速降低、冰川消融', description: '外力减弱,物质沉积:山前冲积扇、河流三角洲、风积沙丘、冰碛垄。粒径大的先沉积、小的后沉积,出现分选性。', color: '#13c2c2', - site: { label: '长江三角洲堆积', longitude: 120.7, latitude: 31.6, height: 300000 } + site: { label: '长江三角洲堆积', longitude: 120.7, latitude: 31.6, height: 300_000 } }, { id: 'lithification', @@ -68,7 +68,7 @@ export function ExogenicPanel({ viewer, onClose }: ExogenicPanelProps) { } function flyToSite(stage: ChainStage): void { - if (!stage.site) return + if (!stage.site) {return} if (viewer && !viewer.isDestroyed()) { viewer.camera.flyTo({ destination: Cesium.Cartesian3.fromDegrees(stage.site.longitude, stage.site.latitude, stage.site.height), diff --git a/src/renderer/src/components/FailureBanner.tsx b/src/renderer/src/components/FailureBanner.tsx index 75a992b..d487edf 100644 --- a/src/renderer/src/components/FailureBanner.tsx +++ b/src/renderer/src/components/FailureBanner.tsx @@ -1,7 +1,8 @@ import { useEffect } from 'react' import { RotateCwIcon, XIcon } from 'lucide-react' import { Alert, Button, Tooltip, useToast } from '@renderer/components/ui' -import { useFailureStore, type FailureNotice } from '@renderer/stores/failure' +import { useFailureStore } from '@renderer/stores/failure'; +import type { FailureNotice } from '@renderer/stores/failure'; import styles from './FailureBanner.module.css' export interface FailureBannerProps {} @@ -20,14 +21,14 @@ export function FailureBanner(_props: FailureBannerProps) { const clearFailure = useFailureStore((state) => state.clearFailure) useEffect(() => { - if (!degradationCount) return + if (!degradationCount) {return} for (const notice of takeDegradations()) { toast.warning(notice.message, 6) } }, [degradationCount, takeDegradations, toast]) const bannerNotices = active.filter((notice) => notice.scope !== 'webgl') - if (!bannerNotices.length) return null + if (bannerNotices.length === 0) {return null} return (
diff --git a/src/renderer/src/components/FirstUseGuide.tsx b/src/renderer/src/components/FirstUseGuide.tsx index 98aec86..928e3d2 100644 --- a/src/renderer/src/components/FirstUseGuide.tsx +++ b/src/renderer/src/components/FirstUseGuide.tsx @@ -1,22 +1,10 @@ -import { - useCallback, - useEffect, - useImperativeHandle, - useLayoutEffect, - useMemo, - useRef, - useState, - type ReactNode, - type Ref -} from 'react' +import { useCallback, useEffect, useImperativeHandle, useLayoutEffect, useMemo, useRef, useState } from 'react'; +import type { ReactNode, Ref } from 'react'; import { createPortal } from 'react-dom' import { XIcon } from 'lucide-react' import { Button, Checkbox } from '@renderer/components/ui' -import { - computeGuideCardPosition, - type GuidePlacement, - type GuideRectBox -} from '@renderer/lib/guidePosition' +import { computeGuideCardPosition } from '@renderer/lib/guidePosition'; +import type { GuidePlacement, GuideRectBox } from '@renderer/lib/guidePosition'; export interface FirstUseGuideHandle { start: () => void @@ -70,7 +58,7 @@ function waitNextFrame(): Promise { } function getFocusableElements(container: HTMLElement): HTMLElement[] { - return Array.from(container.querySelectorAll(FOCUSABLE_SELECTOR)).filter( + return [...container.querySelectorAll(FOCUSABLE_SELECTOR)].filter( (element) => element.getClientRects().length > 0 ) } @@ -82,8 +70,8 @@ export function FirstUseGuide({ ready, onStepChange, ref }: FirstUseGuideProps) const [targetRect, setTargetRect] = useState(null) const [cardSize, setCardSize] = useState({ width: DEFAULT_CARD_WIDTH, height: DEFAULT_CARD_HEIGHT }) const [viewport, setViewport] = useState(() => ({ - width: typeof window !== 'undefined' ? window.innerWidth : 1440, - height: typeof window !== 'undefined' ? window.innerHeight : 900 + width: typeof window === 'undefined' ? 1440 : window.innerWidth, + height: typeof window === 'undefined' ? 900 : window.innerHeight })) const cardRef = useRef(null) @@ -198,9 +186,9 @@ export function FirstUseGuide({ ready, onStepChange, ref }: FirstUseGuideProps) const activeStep = steps[current] ?? steps[0] const measureTarget = useCallback(() => { - if (!openRef.current) return + if (!openRef.current) {return} const step = steps[currentRef.current] - if (!step) return + if (!step) {return} const element = getTargetElement(step.targetName) if (!element) { setTargetRect(null) @@ -220,7 +208,7 @@ export function FirstUseGuide({ ready, onStepChange, ref }: FirstUseGuideProps) }, [steps]) useEffect(() => { - if (!open) return + if (!open) {return} const handleViewportResize = (): void => { setViewport({ width: window.innerWidth, height: window.innerHeight }) measureTarget() @@ -237,9 +225,9 @@ export function FirstUseGuide({ ready, onStepChange, ref }: FirstUseGuideProps) }, [open, current, measureTarget]) useLayoutEffect(() => { - if (!open) return + if (!open) {return} const card = cardRef.current - if (!card) return + if (!card) {return} const measureCard = (): void => { const rect = card.getBoundingClientRect() const nextWidth = Math.round(rect.width) || DEFAULT_CARD_WIDTH @@ -251,14 +239,14 @@ export function FirstUseGuide({ ready, onStepChange, ref }: FirstUseGuideProps) ) } measureCard() - if (typeof ResizeObserver === 'undefined') return + if (typeof ResizeObserver === 'undefined') {return} const observer = new ResizeObserver(measureCard) observer.observe(card) return () => observer.disconnect() }, [open, current]) async function handleChange(nextStep: number): Promise { - if (transitioningRef.current) return + if (transitioningRef.current) {return} transitioningRef.current = true onStepChangeRef.current?.(nextStep) await waitNextFrame() @@ -277,7 +265,7 @@ export function FirstUseGuide({ ready, onStepChange, ref }: FirstUseGuideProps) const savePreference = useCallback((value: boolean): void => { dontPromptAgainRef.current = value setDontPromptAgain(value) - void window.guEarth.settings.update({ setupGuideDismissed: value }).catch(() => undefined) + void window.guEarth.settings.update({ setupGuideDismissed: value }).catch(() => {}) }, []) const handleClose = useCallback((): void => { @@ -299,15 +287,15 @@ export function FirstUseGuide({ ready, onStepChange, ref }: FirstUseGuideProps) useEffect(() => { async function checkFirstUse(): Promise { - if (!readyRef.current || autoPromptCheckedRef.current) return + if (!readyRef.current || autoPromptCheckedRef.current) {return} autoPromptCheckedRef.current = true try { const settings = await window.guEarth.settings.get() - if (unmountedRef.current) return + if (unmountedRef.current) {return} if (settings.setupGuideDismissed !== null) { dontPromptAgainRef.current = settings.setupGuideDismissed setDontPromptAgain(settings.setupGuideDismissed) - if (!settings.setupGuideDismissed && readyRef.current && !openRef.current) start() + if (!settings.setupGuideDismissed && readyRef.current && !openRef.current) {start()} return } if (readLegacyCompletion()) { @@ -323,12 +311,12 @@ export function FirstUseGuide({ ready, onStepChange, ref }: FirstUseGuideProps) } dontPromptAgainRef.current = true setDontPromptAgain(true) - if (readyRef.current && !openRef.current) start() + if (readyRef.current && !openRef.current) {start()} } catch { - if (unmountedRef.current) return + if (unmountedRef.current) {return} dontPromptAgainRef.current = true setDontPromptAgain(true) - if (readyRef.current && !openRef.current) start() + if (readyRef.current && !openRef.current) {start()} } } @@ -336,7 +324,7 @@ export function FirstUseGuide({ ready, onStepChange, ref }: FirstUseGuideProps) }, [ready, start]) useEffect(() => { - if (!open) return + if (!open) {return} previousFocusRef.current = document.activeElement instanceof HTMLElement ? document.activeElement : null cardRef.current?.focus({ preventScroll: true }) @@ -350,25 +338,25 @@ export function FirstUseGuide({ ready, onStepChange, ref }: FirstUseGuideProps) }, [open]) useEffect(() => { - if (!open) return + if (!open) {return} const card = cardRef.current - if (!card) return + if (!card) {return} if (!card.contains(document.activeElement)) { card.focus({ preventScroll: true }) } }, [open, current]) useEffect(() => { - if (!open) return + if (!open) {return} const handleKeyDown = (event: KeyboardEvent): void => { if (event.key === 'Escape') { event.preventDefault() handleClose() return } - if (event.key !== 'Tab') return + if (event.key !== 'Tab') {return} const card = cardRef.current - if (!card) return + if (!card) {return} const focusables = getFocusableElements(card) if (focusables.length === 0) { event.preventDefault() @@ -397,7 +385,7 @@ export function FirstUseGuide({ ready, onStepChange, ref }: FirstUseGuideProps) return () => window.removeEventListener('keydown', handleKeyDown) }, [open, handleClose]) - if (!open || typeof document === 'undefined') return null + if (!open || typeof document === 'undefined') {return null} const { top: cardTop, left: cardLeft } = computeGuideCardPosition( targetRect, @@ -482,8 +470,8 @@ export function FirstUseGuide({ ready, onStepChange, ref }: FirstUseGuideProps) size="sm" variant="primary" onClick={() => { - if (isLast) handleFinish() - else void handleChange(current + 1) + if (isLast) {handleFinish()} + else {void handleChange(current + 1)} }} > {isLast ? '完成' : '下一步'} diff --git a/src/renderer/src/components/FlightStopSwitcher.tsx b/src/renderer/src/components/FlightStopSwitcher.tsx index 7b643e7..dc09188 100644 --- a/src/renderer/src/components/FlightStopSwitcher.tsx +++ b/src/renderer/src/components/FlightStopSwitcher.tsx @@ -1,7 +1,9 @@ import { useState } from 'react' import { ChevronDownIcon, ChevronLeftIcon, ChevronRightIcon, XIcon } from 'lucide-react' -import { Button, DropdownMenu, Separator, Tooltip, type DropdownMenuEntry } from '@renderer/components/ui' -import { useFlightStopsStore, type FlyToExecutor } from '@renderer/stores/flightStops' +import { Button, DropdownMenu, Separator, Tooltip } from '@renderer/components/ui'; +import type { DropdownMenuEntry } from '@renderer/components/ui'; +import { useFlightStopsStore } from '@renderer/stores/flightStops'; +import type { FlyToExecutor } from '@renderer/stores/flightStops'; import styles from './FlightStopSwitcher.module.css' export interface FlightStopSwitcherProps { @@ -23,7 +25,7 @@ export function FlightStopSwitcher({ flyTo }: FlightStopSwitcherProps) { const [menuOpen, setMenuOpen] = useState(false) - if (!visible) return null + if (!visible) {return null} function handlePrev(): void { setMenuOpen(false) @@ -38,7 +40,7 @@ export function FlightStopSwitcher({ flyTo }: FlightStopSwitcherProps) { function handleSelect(key: string): void { const index = Number(key) setMenuOpen(false) - if (Number.isInteger(index)) void goTo(index, flyTo) + if (Number.isInteger(index)) {void goTo(index, flyTo)} } function handleClose(): void { diff --git a/src/renderer/src/components/FoldFaultPanel.tsx b/src/renderer/src/components/FoldFaultPanel.tsx index bb82dac..f0d83aa 100644 --- a/src/renderer/src/components/FoldFaultPanel.tsx +++ b/src/renderer/src/components/FoldFaultPanel.tsx @@ -40,14 +40,14 @@ const faultFacts = [ ] const foldCases: GlobeCase[] = [ - { name: '喜马拉雅褶皱山系', longitude: 86.9, latitude: 27.9, height: 900000, summary: '板块碰撞挤压形成的典型褶皱山系' }, - { name: '欧洲阿尔卑斯山', longitude: 9.5, latitude: 46.5, height: 900000, summary: '非洲板块与亚欧板块挤压形成' } + { name: '喜马拉雅褶皱山系', longitude: 86.9, latitude: 27.9, height: 900_000, summary: '板块碰撞挤压形成的典型褶皱山系' }, + { name: '欧洲阿尔卑斯山', longitude: 9.5, latitude: 46.5, height: 900_000, summary: '非洲板块与亚欧板块挤压形成' } ] const faultCases: GlobeCase[] = [ - { name: '东非大裂谷(地堑)', longitude: 36, latitude: -3, height: 1200000, summary: '大陆断裂拉伸下陷形成的巨型地堑带' }, - { name: '华山(地垒)', longitude: 110.08, latitude: 34.48, height: 45000, summary: '秦岭北麓断层上升形成的块状山地' }, - { name: '渭河平原(地堑)', longitude: 109.2, latitude: 34.4, height: 260000, summary: '断陷下陷形成的地堑谷地' } + { name: '东非大裂谷(地堑)', longitude: 36, latitude: -3, height: 1_200_000, summary: '大陆断裂拉伸下陷形成的巨型地堑带' }, + { name: '华山(地垒)', longitude: 110.08, latitude: 34.48, height: 45_000, summary: '秦岭北麓断层上升形成的块状山地' }, + { name: '渭河平原(地堑)', longitude: 109.2, latitude: 34.4, height: 260_000, summary: '断陷下陷形成的地堑谷地' } ] export function FoldFaultPanel({ viewer, onClose }: FoldFaultPanelProps) { diff --git a/src/renderer/src/components/FrontalCyclone.tsx b/src/renderer/src/components/FrontalCyclone.tsx index 3c2335d..682e117 100644 --- a/src/renderer/src/components/FrontalCyclone.tsx +++ b/src/renderer/src/components/FrontalCyclone.tsx @@ -13,7 +13,7 @@ interface Dot { } const ANCHOR = Cesium.Cartesian3.fromDegrees(125, 34) -const ANCHOR_VIEW_HEIGHT = 4800000 +const ANCHOR_VIEW_HEIGHT = 4_800_000 const warmRainDots: Dot[] = [] for (let row = 0; row < 3; row += 1) { @@ -35,13 +35,13 @@ for (let row = 0; row < 2; row += 1) { } } -const coldFrontBarbs: Array<{ x: number; y: number; angle: number }> = [ +const coldFrontBarbs: { x: number; y: number; angle: number }[] = [ { x: 156, y: 213, angle: 35 }, { x: 136, y: 241, angle: 40 }, { x: 116, y: 271, angle: 48 } ] -const warmFrontBarbs: Array<{ x: number; y: number; angle: number }> = [ +const warmFrontBarbs: { x: number; y: number; angle: number }[] = [ { x: 221, y: 199, angle: -60 }, { x: 252, y: 217, angle: -55 }, { x: 282, y: 238, angle: -55 } @@ -53,7 +53,7 @@ export function FrontalCyclone({ viewer }: FrontalCycloneProps) { useEffect(() => { const activeViewer = viewer && !viewer.isDestroyed() ? viewer : undefined if (!activeViewer) { - if (overlayRef.current) overlayRef.current.style.display = 'none' + if (overlayRef.current) {overlayRef.current.style.display = 'none'} return } const scratch = new Cesium.Cartesian2() @@ -62,7 +62,7 @@ export function FrontalCyclone({ viewer }: FrontalCycloneProps) { function frame(): void { const element = overlayRef.current - if (!activeViewer || activeViewer.isDestroyed() || !element) return + if (!activeViewer || activeViewer.isDestroyed() || !element) {return} let facing = true if (activeViewer.scene.mode === Cesium.SceneMode.SCENE3D) { activeViewer.scene.globe.ellipsoid.geodeticSurfaceNormal(ANCHOR, scratchNormal) diff --git a/src/renderer/src/components/GlobeToolbar.tsx b/src/renderer/src/components/GlobeToolbar.tsx index 966fa68..6236fb6 100644 --- a/src/renderer/src/components/GlobeToolbar.tsx +++ b/src/renderer/src/components/GlobeToolbar.tsx @@ -46,7 +46,7 @@ export interface GlobeToolbarProps { onUpdateClick: () => void } -const tools: Array<{ id: DrawTool; label: string; icon: ReactNode }> = [ +const tools: { id: DrawTool; label: string; icon: ReactNode }[] = [ { id: 'point', label: '绘制点', icon: }, { id: 'line', label: '绘制线', icon: }, { id: 'polygon', label: '绘制多边形', icon: }, diff --git a/src/renderer/src/components/HuLineOverlay.tsx b/src/renderer/src/components/HuLineOverlay.tsx index 55ae33a..72de975 100644 --- a/src/renderer/src/components/HuLineOverlay.tsx +++ b/src/renderer/src/components/HuLineOverlay.tsx @@ -13,7 +13,7 @@ interface CardScratch { toCamera: Cesium.Cartesian3 } -const ANCHOR_VIEW_HEIGHT = 9000000 +const ANCHOR_VIEW_HEIGHT = 9_000_000 const eastAnchor = Cesium.Cartesian3.fromDegrees(119.5, 33) const westAnchor = Cesium.Cartesian3.fromDegrees(96, 37.5) @@ -23,7 +23,7 @@ function updateCard( anchor: Cesium.Cartesian3, scratch: CardScratch ): void { - if (!element) return + if (!element) {return} let facing = true if (current.scene.mode === Cesium.SceneMode.SCENE3D) { current.scene.globe.ellipsoid.geodeticSurfaceNormal(anchor, scratch.normal) @@ -50,8 +50,8 @@ export function HuLineOverlay({ viewer }: HuLineOverlayProps) { useEffect(() => { const activeViewer = viewer && !viewer.isDestroyed() ? viewer : undefined if (!activeViewer) { - if (eastRef.current) eastRef.current.style.display = 'none' - if (westRef.current) westRef.current.style.display = 'none' + if (eastRef.current) {eastRef.current.style.display = 'none'} + if (westRef.current) {westRef.current.style.display = 'none'} return } const eastScratch: CardScratch = { @@ -66,7 +66,7 @@ export function HuLineOverlay({ viewer }: HuLineOverlayProps) { } function frame(): void { - if (!activeViewer || activeViewer.isDestroyed()) return + if (!activeViewer || activeViewer.isDestroyed()) {return} updateCard(activeViewer, eastRef.current, eastAnchor, eastScratch) updateCard(activeViewer, westRef.current, westAnchor, westScratch) } diff --git a/src/renderer/src/components/InlineTextEditor.tsx b/src/renderer/src/components/InlineTextEditor.tsx index e5b7569..7aecd70 100644 --- a/src/renderer/src/components/InlineTextEditor.tsx +++ b/src/renderer/src/components/InlineTextEditor.tsx @@ -1,4 +1,5 @@ -import { useCallback, useEffect, useLayoutEffect, useMemo, useRef, type CSSProperties } from 'react' +import { useCallback, useEffect, useLayoutEffect, useMemo, useRef } from 'react'; +import type { CSSProperties } from 'react'; import * as Cesium from 'cesium' import type { DrawnShape } from '@renderer/stores/drawing' import styles from './InlineTextEditor.module.css' @@ -10,9 +11,9 @@ export interface InlineTextEditorProps { } function editorTextShadow(color: string, framed: boolean): string { - if (framed) return 'none' + if (framed) {return 'none'} const match = /^#([\da-f]{6})$/i.exec(color) - if (!match) return '0 0 3px rgba(0, 0, 0, 0.9)' + if (!match) {return '0 0 3px rgba(0, 0, 0, 0.9)'} const red = Number.parseInt(match[1].slice(0, 2), 16) const green = Number.parseInt(match[1].slice(2, 4), 16) const blue = Number.parseInt(match[1].slice(4, 6), 16) @@ -35,7 +36,7 @@ export function InlineTextEditor({ viewer, shape, onUpdate }: InlineTextEditorPr const currentShape = shapeRef.current const root = rootRef.current const editor = editorRef.current - if (!editor) return + if (!editor) {return} if (!currentViewer || currentViewer.isDestroyed() || !root || !currentShape || currentShape.kind !== 'text') { editor.style.visibility = 'hidden' return @@ -67,7 +68,7 @@ export function InlineTextEditor({ viewer, shape, onUpdate }: InlineTextEditorPr const resizeEditor = useCallback((): void => { const editor = editorRef.current - if (!editor) return + if (!editor) {return} editor.style.height = 'auto' editor.style.height = `${Math.max(32, editor.scrollHeight)}px` }, []) @@ -85,7 +86,7 @@ export function InlineTextEditor({ viewer, shape, onUpdate }: InlineTextEditorPr }, [viewer, updatePosition]) useLayoutEffect(() => { - if (!shape || shape.kind !== 'text') return + if (shape?.kind !== 'text') {return} const editor = editorRef.current if (editor) { editor.focus() @@ -96,13 +97,13 @@ export function InlineTextEditor({ viewer, shape, onUpdate }: InlineTextEditorPr }, [shape?.id, shape?.kind, resizeEditor, updatePosition]) useLayoutEffect(() => { - if (!shape || shape.kind !== 'text') return + if (shape?.kind !== 'text') {return} resizeEditor() updatePosition() }, [shape?.annotation, shape?.positions, shape?.fontSize, shape?.fontFamily, shape?.textFrame, shape?.kind, resizeEditor, updatePosition]) const editorStyle = useMemo(() => { - if (!shape || shape.kind !== 'text') return {} + if (shape?.kind !== 'text') {return {}} return { color: shape.textColor, fontFamily: `"${shape.fontFamily}", sans-serif`, diff --git a/src/renderer/src/components/LandformGuidePanel.tsx b/src/renderer/src/components/LandformGuidePanel.tsx index da31f4e..1d5aeb9 100644 --- a/src/renderer/src/components/LandformGuidePanel.tsx +++ b/src/renderer/src/components/LandformGuidePanel.tsx @@ -28,8 +28,8 @@ const sites: LandformSite[] = [ type: '流水溶蚀(湿蚀)', color: '#52c41a', longitude: 110.5, - latitude: 25.0, - height: 70000, + latitude: 25, + height: 70_000, features: ['峰林、峰丛、孤峰,溶洞与地下河', '地面崎岖,地表水易渗漏', '“山水甲天下”的塔状山体'], cause: '石灰岩(可溶性岩石)+ 湿热气候:流水对碳酸盐岩长期溶蚀与沉积,形成地上峰林、地下溶洞的双重喀斯特景观。云贵高原为上游,多溶洞洼地;广西盆地边缘水流集中,峰林发育最典型。' }, @@ -40,7 +40,7 @@ const sites: LandformSite[] = [ color: '#fa8c16', longitude: 92.9, latitude: 40.4, - height: 90000, + height: 90_000, features: ['沟垄相间、垄脊与沟槽定向排列', '“魔鬼城”式残丘、风蚀蘑菇、风蚀柱', '地表干旱、植被稀少'], cause: '干旱区风力侵蚀:古湖沉积的固结较差的泥岩、粉砂岩,经受盛行风长期吹蚀与磨蚀,软弱处形成沟槽、坚硬处残留为垄岗,延伸方向与盛行风向一致。' }, @@ -51,7 +51,7 @@ const sites: LandformSite[] = [ color: '#1677ff', longitude: 101.95, latitude: 29.6, - height: 100000, + height: 100_000, features: ['U 形谷(槽谷)、角峰、刃脊', '冰碛垄、冰碛湖等堆积地貌', '现代海洋性冰川伸入森林带'], cause: '高山高纬地区冰川运动:冰川体对谷地底部与两侧强烈刨蚀、磨蚀,把 V 形谷改造为 U 形谷;冰川消融后携带的碎屑(冰碛物)堆积形成冰碛地貌。' }, @@ -62,7 +62,7 @@ const sites: LandformSite[] = [ color: '#13c2c2', longitude: 122.05, latitude: 39.08, - height: 60000, + height: 60_000, features: ['海蚀崖、海蚀拱桥、海蚀柱', '邻近海湾发育沙滩等堆积地貌', '基岩海岸与沙质海岸并存'], cause: '海浪长期拍击基岩海岸,软弱处被掏蚀形成海蚀穴→海蚀洞→海蚀拱桥→海蚀柱的演变链;被侵蚀的泥沙在波浪动能减弱的海湾堆积,形成沙滩与沙嘴。' }, @@ -73,7 +73,7 @@ const sites: LandformSite[] = [ color: '#faad14', longitude: 109.5, latitude: 36.5, - height: 400000, + height: 400_000, features: ['塬、梁、峁千沟万壑', '水土流失严重,河流含沙量大', '黄土直立性强、多孔隙'], cause: '风力从西北内陆搬运的粉尘堆积形成厚层黄土;黄土疏松多孔,夏季暴雨冲刷形成密集沟壑,塬被切割为梁、峁,是“风成黄土、流水塑造”的组合地貌。' } diff --git a/src/renderer/src/components/LayerPanel.tsx b/src/renderer/src/components/LayerPanel.tsx index 1b08e97..ce16b49 100644 --- a/src/renderer/src/components/LayerPanel.tsx +++ b/src/renderer/src/components/LayerPanel.tsx @@ -1,4 +1,5 @@ -import { useMemo, useState, type MouseEvent } from 'react' +import { useMemo, useState } from 'react'; +import type { MouseEvent } from 'react'; import { MoreHorizontalIcon, RotateCwIcon, XIcon } from 'lucide-react' import { Accordion, @@ -14,13 +15,8 @@ import { Switch, Tooltip } from '@renderer/components/ui' -import { - basemapCategories, - providerCatalog, - terrainCatalog, - type LayerMeta, - type ProviderMeta -} from '@renderer/stores/globe' +import { basemapCategories, providerCatalog, terrainCatalog } from '@renderer/stores/globe'; +import type { LayerMeta, ProviderMeta } from '@renderer/stores/globe'; import styles from './LayerPanel.module.css' export interface LayerPanelProps { @@ -119,7 +115,7 @@ export function LayerPanel({ function handleSettingsOpacity(value: number): void { const layer = settingsCategory?.activeLayer - if (layer) onOpacity(layer.id, value / 100) + if (layer) {onOpacity(layer.id, value / 100)} } return ( @@ -207,7 +203,7 @@ export function LayerPanel({ options={terrainSelectOptions} aria-label="选择 3D 地形" onChange={(value) => { - if (value) onTerrain(value) + if (value) {onTerrain(value)} }} /> {terrainDegraded && ( diff --git a/src/renderer/src/components/LocationDecisionPanel.tsx b/src/renderer/src/components/LocationDecisionPanel.tsx index 30c8dae..631d0aa 100644 --- a/src/renderer/src/components/LocationDecisionPanel.tsx +++ b/src/renderer/src/components/LocationDecisionPanel.tsx @@ -47,8 +47,8 @@ export function LocationDecisionPanel({ viewer, onClose }: LocationDecisionPanel } function flyToPlace(): void { - if (flyingRef.current) return - if (!viewer || viewer.isDestroyed()) return + if (flyingRef.current) {return} + if (!viewer || viewer.isDestroyed()) {return} flyingRef.current = true const settle = (): void => { flyingRef.current = false @@ -56,7 +56,7 @@ export function LocationDecisionPanel({ viewer, onClose }: LocationDecisionPanel try { const [lon, lat] = activeCase.placeLonLat viewer.camera.flyTo({ - destination: Cesium.Cartesian3.fromDegrees(lon, lat, 220000), + destination: Cesium.Cartesian3.fromDegrees(lon, lat, 220_000), duration: 1.5, complete: settle, cancel: settle diff --git a/src/renderer/src/components/MemorySettings.tsx b/src/renderer/src/components/MemorySettings.tsx index 32a91ee..e10b9f4 100644 --- a/src/renderer/src/components/MemorySettings.tsx +++ b/src/renderer/src/components/MemorySettings.tsx @@ -31,19 +31,19 @@ export function MemorySettings({ active }: MemorySettingsProps) { const sortedMemories = useMemo(() => [...memories].reverse(), [memories]) useEffect(() => { - if (!active) return + if (!active) {return} let cancelled = false setLoading(true) window.guEarth.ai.memory .list() .then((list) => { - if (!cancelled) setMemories(list) + if (!cancelled) {setMemories(list)} }) .catch(() => { - if (!cancelled) toast.error('无法读取记忆列表,请重试') + if (!cancelled) {toast.error('无法读取记忆列表,请重试')} }) .finally(() => { - if (!cancelled) setLoading(false) + if (!cancelled) {setLoading(false)} }) return () => { cancelled = true @@ -52,7 +52,7 @@ export function MemorySettings({ active }: MemorySettingsProps) { async function addMemory(): Promise { const content = draft.trim() - if (!content || adding) return + if (!content || adding) {return} setAdding(true) try { const next = await window.guEarth.ai.memory.add(content) @@ -77,7 +77,7 @@ export function MemorySettings({ active }: MemorySettingsProps) { } async function toggleEnabled(value: boolean): Promise { - if (switchBusy) return + if (switchBusy) {return} setSwitchBusy(true) try { await setMemoryEnabled(value) diff --git a/src/renderer/src/components/MirrorConsentModal.tsx b/src/renderer/src/components/MirrorConsentModal.tsx index 15bdbeb..6d800e5 100644 --- a/src/renderer/src/components/MirrorConsentModal.tsx +++ b/src/renderer/src/components/MirrorConsentModal.tsx @@ -1,4 +1,5 @@ -import { useEffect, useState, type MouseEvent } from 'react' +import { useEffect, useState } from 'react'; +import type { MouseEvent } from 'react'; import { Button, Checkbox, Modal } from '@renderer/components/ui' import type { MirrorPolicyId } from '../../../common/mirrorPolicies' import { useGlobeStore } from '@renderer/stores/globe' @@ -16,7 +17,7 @@ export function MirrorConsentModal(_props: MirrorConsentModalProps) { const [agreed, setAgreed] = useState(false) useEffect(() => { - if (mirrorConsentOpen) setAgreed(false) + if (mirrorConsentOpen) {setAgreed(false)} }, [mirrorConsentOpen]) const detectionNotice = @@ -41,7 +42,7 @@ export function MirrorConsentModal(_props: MirrorConsentModalProps) { } function handleAccept(): void { - if (!agreed) return + if (!agreed) {return} acceptMirrorConsent() } diff --git a/src/renderer/src/components/MirrorPolicyModal.tsx b/src/renderer/src/components/MirrorPolicyModal.tsx index 76fa729..08a74ae 100644 --- a/src/renderer/src/components/MirrorPolicyModal.tsx +++ b/src/renderer/src/components/MirrorPolicyModal.tsx @@ -1,13 +1,10 @@ import { useEffect, useMemo, useRef } from 'react' -import { Button, Modal, Tabs, type TabItem } from '@renderer/components/ui' +import { Button, Modal, Tabs } from '@renderer/components/ui'; +import type { TabItem } from '@renderer/components/ui'; import agreementMarkdown from '../../../../docs/policies/MIRROR-SERVICE-AGREEMENT.md?raw' import acceptableUseMarkdown from '../../../../docs/policies/ACCEPTABLE-USE-POLICY.md?raw' -import { - MIRROR_POLICY_FALLBACK_TITLES, - parsePolicyMarkdown, - type MirrorPolicyId, - type ParsedPolicyMarkdown -} from '../../../common/mirrorPolicies' +import { MIRROR_POLICY_FALLBACK_TITLES, parsePolicyMarkdown } from '../../../common/mirrorPolicies'; +import type { MirrorPolicyId, ParsedPolicyMarkdown } from '../../../common/mirrorPolicies'; import { useGlobeStore } from '@renderer/stores/globe' import { renderMarkdown } from '@renderer/utils/markdown' import styles from './MirrorPolicyModal.module.css' @@ -36,8 +33,8 @@ export function MirrorPolicyModal(_props: MirrorPolicyModalProps) { const renderedNodes = useMemo(() => renderMarkdown(activePolicy.body), [activePolicy.body]) useEffect(() => { - if (!mirrorPolicyOpen) return - if (policyBodyRef.current) policyBodyRef.current.scrollTop = 0 + if (!mirrorPolicyOpen) {return} + if (policyBodyRef.current) {policyBodyRef.current.scrollTop = 0} }, [mirrorPolicyOpen, mirrorPolicyActiveId]) function handleTabChange(key: string): void { diff --git a/src/renderer/src/components/MonthTimeline.tsx b/src/renderer/src/components/MonthTimeline.tsx index b83c3ff..5540ae1 100644 --- a/src/renderer/src/components/MonthTimeline.tsx +++ b/src/renderer/src/components/MonthTimeline.tsx @@ -25,15 +25,15 @@ export function MonthTimeline({ viewer }: MonthTimelineProps) { const flightStopsVisible = useFlightStopsStore((state) => state.visible) useVisibleAnimation(isPlaying && hasSeasonalOverlay, (dt) => { - if (dt > 0) advance(dt) - if (viewer && !viewer.isDestroyed()) viewer.scene.requestRender() + if (dt > 0) {advance(dt)} + if (viewer && !viewer.isDestroyed()) {viewer.scene.requestRender()} }) useEffect(() => { - if (viewer && !viewer.isDestroyed()) viewer.scene.requestRender() + if (viewer && !viewer.isDestroyed()) {viewer.scene.requestRender()} }, [month, viewer]) - if (!hasSeasonalOverlay) return null + if (!hasSeasonalOverlay) {return null} const displayMonth = Math.min(12, Math.floor(month)) const seasonText = diff --git a/src/renderer/src/components/OceanPropertyPanel.tsx b/src/renderer/src/components/OceanPropertyPanel.tsx index 923eb4d..cf8ffa9 100644 --- a/src/renderer/src/components/OceanPropertyPanel.tsx +++ b/src/renderer/src/components/OceanPropertyPanel.tsx @@ -1,14 +1,15 @@ import { useMemo } from 'react' import { XIcon } from 'lucide-react' import { Button } from '@renderer/components/ui' -import LineChart, { type ChartSeries } from './charts/LineChart' +import LineChart from './charts/LineChart'; +import type { ChartSeries } from './charts/LineChart'; import styles from './OceanPropertyPanel.module.css' export interface OceanPropertyPanelProps { onClose: () => void } -const temperatureStops: Array<[number, number]> = [ +const temperatureStops: [number, number][] = [ [-60, 2.5], [-50, 4.5], [-40, 9], @@ -24,7 +25,7 @@ const temperatureStops: Array<[number, number]> = [ [60, 8] ] -const salinityStops: Array<[number, number]> = [ +const salinityStops: [number, number][] = [ [-60, 33.6], [-50, 33.9], [-40, 34.4], diff --git a/src/renderer/src/components/PlaceSearchBox.tsx b/src/renderer/src/components/PlaceSearchBox.tsx index d74aeaa..8352e23 100644 --- a/src/renderer/src/components/PlaceSearchBox.tsx +++ b/src/renderer/src/components/PlaceSearchBox.tsx @@ -1,7 +1,8 @@ import { useCallback, useEffect, useMemo, useRef, useState } from 'react' import { Autocomplete as BaseAutocomplete } from '@base-ui/react/autocomplete' import { ChevronDownIcon, Loader2Icon, SearchIcon, XIcon } from 'lucide-react' -import { Button, DropdownMenu, type DropdownMenuEntry } from '@renderer/components/ui' +import { Button, DropdownMenu } from '@renderer/components/ui'; +import type { DropdownMenuEntry } from '@renderer/components/ui'; import { useGlobeStore } from '@renderer/stores/globe' import { useFailureStore } from '@renderer/stores/failure' import type { PlaceSearchProvider, PlaceSuggestion } from '../../../preload' @@ -22,7 +23,7 @@ interface PlaceOption { place?: PlaceSuggestion } -const providerDefinitions: Array<{ id: PlaceSearchProvider; name: string }> = [ +const providerDefinitions: { id: PlaceSearchProvider; name: string }[] = [ { id: 'amap', name: '高德' }, { id: 'baidu', name: '百度' } ] @@ -105,7 +106,7 @@ export function PlaceSearchBox({ onSelect }: PlaceSearchBoxProps) { } const retryLast = (): void => { const query = lastQueryRef.current.trim() - if (query) void search(query) + if (query) {void search(query)} } setOptions([ { @@ -125,14 +126,14 @@ export function PlaceSearchBox({ onSelect }: PlaceSearchBoxProps) { } return } - if (seq !== requestSeqRef.current) return - if (result.superseded) return + if (seq !== requestSeqRef.current) {return} + if (result.superseded) {return} if (result.fellBackFrom) { reportDegrade(`${providerName(result.fellBackFrom)}不可用,已改用${providerName(result.source)}`) } if (result.error) { setOptions([statusOption(result.error, true, retryLast)]) - } else if (!result.places.length) { + } else if (result.places.length === 0) { setOptions([ statusOption(result.note ?? '没有找到匹配的地点,可换个说法或切换搜索源', false) ]) @@ -148,34 +149,34 @@ export function PlaceSearchBox({ onSelect }: PlaceSearchBoxProps) { const previousProvider = previousRef.current.providerId previousRef.current = { text: keyword, providerId } - if (debounceTimerRef.current) clearTimeout(debounceTimerRef.current) + if (debounceTimerRef.current) {clearTimeout(debounceTimerRef.current)} requestSeqRef.current += 1 setOptions([]) if (suppressWatchRef.current) { suppressWatchRef.current = false - if (providerId === previousProvider && keyword !== previousText) return + if (providerId === previousProvider && keyword !== previousText) {return} } const query = keyword.trim() - if (!query) return + if (!query) {return} debounceTimerRef.current = setTimeout(() => { void search(query) }, 300) }, [keyword, providerId, credentialUpdatedAt, search]) useEffect(() => { - if (!showProviderSelect) setProviderMenuOpen(false) + if (!showProviderSelect) {setProviderMenuOpen(false)} }, [showProviderSelect]) - useEffect(() => { - return () => { + useEffect(() => + () => { if (debounceTimerRef.current) clearTimeout(debounceTimerRef.current) requestSeqRef.current += 1 } - }, []) + , []) function handleSelectOption(option: PlaceOption): void { - if (!option.place) return - if (debounceTimerRef.current) clearTimeout(debounceTimerRef.current) + if (!option.place) {return} + if (debounceTimerRef.current) {clearTimeout(debounceTimerRef.current)} requestSeqRef.current += 1 suppressWatchRef.current = keyword !== option.place.name setKeyword(option.place.name) @@ -185,8 +186,8 @@ export function PlaceSearchBox({ onSelect }: PlaceSearchBoxProps) { } function handleProviderSelect(key: string): void { - if (key !== 'amap' && key !== 'baidu') return - if (!availableProviders.some((item) => item.id === key)) return + if (key !== 'amap' && key !== 'baidu') {return} + if (!availableProviders.some((item) => item.id === key)) {return} setPreferredProvider(key) setProviderMenuOpen(false) requestAnimationFrame(() => { @@ -262,7 +263,7 @@ export function PlaceSearchBox({ onSelect }: PlaceSearchBoxProps) { aria-expanded={providerMenuOpen} onMouseDown={(event) => event.stopPropagation()} onKeyDown={(event) => { - if (event.key === 'Escape') setProviderMenuOpen(false) + if (event.key === 'Escape') {setProviderMenuOpen(false)} }} > {provider?.name} diff --git a/src/renderer/src/components/PopulationPanel.tsx b/src/renderer/src/components/PopulationPanel.tsx index 2eb0e0f..29d2e38 100644 --- a/src/renderer/src/components/PopulationPanel.tsx +++ b/src/renderer/src/components/PopulationPanel.tsx @@ -14,8 +14,10 @@ import { urbanizationFacts, urbanizationSeries } from '@renderer/thematic/populationCensus' -import BarChart, { type BarSeries } from './charts/BarChart' -import LineChart, { type ChartSeries } from './charts/LineChart' +import BarChart from './charts/BarChart'; +import type { BarSeries } from './charts/BarChart'; +import LineChart from './charts/LineChart'; +import type { ChartSeries } from './charts/LineChart'; import styles from './PopulationPanel.module.css' export interface PopulationPanelProps { @@ -24,7 +26,7 @@ export interface PopulationPanelProps { type Tab = 'pyramid' | 'urbanization' | 'hu-line' -const tabOptions: Array<{ value: Tab; label: string }> = [ +const tabOptions: { value: Tab; label: string }[] = [ { value: 'pyramid', label: '金字塔' }, { value: 'urbanization', label: '城镇化' }, { value: 'hu-line', label: '胡焕庸线' } @@ -69,7 +71,7 @@ export function PopulationPanel({ onClose }: PopulationPanelProps) { size="sm" options={tabOptions} aria-label="人口面板标签" - onChange={(value) => setTab(value as Tab)} + onChange={(value) => setTab(value)} />
diff --git a/src/renderer/src/components/RiverLandformPanel.tsx b/src/renderer/src/components/RiverLandformPanel.tsx index b2c4717..428d284 100644 --- a/src/renderer/src/components/RiverLandformPanel.tsx +++ b/src/renderer/src/components/RiverLandformPanel.tsx @@ -2,7 +2,8 @@ import { useCallback, useEffect, useMemo, useRef, useState } from 'react' import * as Cesium from 'cesium' import { Loader2Icon, XIcon } from 'lucide-react' import { Alert, Button } from '@renderer/components/ui' -import LineChart, { type ChartSeries } from './charts/LineChart' +import LineChart from './charts/LineChart'; +import type { ChartSeries } from './charts/LineChart'; import styles from './RiverLandformPanel.module.css' export interface RiverLandformPanelProps { @@ -15,7 +16,7 @@ interface RiverReach { name: string stage: string center: [number, number, number] - waypoints: Array<[number, number]> + waypoints: [number, number][] landform: string facts: string[] } @@ -25,7 +26,7 @@ const reaches: RiverReach[] = [ id: 'upper', name: '上游 · 金沙江虎跳峡', stage: '上游:V 形谷', - center: [100.05, 27.25, 46000], + center: [100.05, 27.25, 46_000], waypoints: [ [99.8, 27.48], [99.92, 27.37], @@ -44,13 +45,13 @@ const reaches: RiverReach[] = [ id: 'middle', name: '中游 · 荆江河曲', stage: '中游:河曲', - center: [112.5, 29.75, 150000], + center: [112.5, 29.75, 150_000], waypoints: [ [111.8, 29.9], [112.1, 29.72], [112.4, 29.82], [112.7, 29.62], - [113.0, 29.72] + [113, 29.72] ], landform: '河曲:侧蚀为主,凹岸侵蚀、凸岸堆积', facts: [ @@ -63,13 +64,13 @@ const reaches: RiverReach[] = [ id: 'lower', name: '下游 · 长江三角洲', stage: '下游:三角洲', - center: [120.7, 31.6, 300000], + center: [120.7, 31.6, 300_000], waypoints: [ [118.8, 31.95], [119.8, 31.75], [120.6, 31.58], [121.4, 31.42], - [122.0, 31.3] + [122, 31.3] ], landform: '三角洲:流速骤降,泥沙堆积为主', facts: [ @@ -80,8 +81,8 @@ const reaches: RiverReach[] = [ } ] -function interpolate(waypoints: Array<[number, number]>): Array<[number, number]> { - const points: Array<[number, number]> = [] +function interpolate(waypoints: [number, number][]): [number, number][] { + const points: [number, number][] = [] for (let index = 0; index < waypoints.length - 1; index += 1) { const [x0, y0] = waypoints[index] const [x1, y1] = waypoints[index + 1] @@ -95,7 +96,7 @@ function interpolate(waypoints: Array<[number, number]>): Array<[number, number] export function RiverLandformPanel({ viewer, onClose }: RiverLandformPanelProps) { const [activeReach, setActiveReach] = useState(reaches[0]) - const [profile, setProfile] = useState>([]) + const [profile, setProfile] = useState<[number, number][]>([]) const [sampling, setSampling] = useState(false) const [degraded, setDegraded] = useState(false) @@ -108,7 +109,7 @@ export function RiverLandformPanel({ viewer, onClose }: RiverLandformPanelProps) sampleSeqRef.current += 1 const seq = sampleSeqRef.current setProfile([]) - if (!targetViewer || targetViewer.isDestroyed()) return + if (!targetViewer || targetViewer.isDestroyed()) {return} setSampling(true) setDegraded(false) try { @@ -118,7 +119,7 @@ export function RiverLandformPanel({ viewer, onClose }: RiverLandformPanelProps) let isDegraded = false try { const sampled = await Cesium.sampleTerrainMostDetailed(targetViewer.terrainProvider, cartographics) - if (sampleSeqRef.current !== seq || targetViewer.isDestroyed()) return + if (sampleSeqRef.current !== seq || targetViewer.isDestroyed()) {return} heights = sampled.map((item) => Number.isFinite(item.height) ? item.height @@ -128,11 +129,11 @@ export function RiverLandformPanel({ viewer, onClose }: RiverLandformPanelProps) ) isDegraded = sampled.some((item) => !Number.isFinite(item.height)) } catch { - if (sampleSeqRef.current !== seq || targetViewer.isDestroyed()) return + if (sampleSeqRef.current !== seq || targetViewer.isDestroyed()) {return} heights = cartographics.map((item) => targetViewer.scene.globe.getHeight(item) ?? 0) isDegraded = true } - if (sampleSeqRef.current !== seq) return + if (sampleSeqRef.current !== seq) {return} setDegraded(isDegraded) let distance = 0 setProfile( @@ -180,8 +181,8 @@ export function RiverLandformPanel({ viewer, onClose }: RiverLandformPanelProps) } const xMax = Math.max(60, Math.ceil(profile[profile.length - 1]?.[0] ?? 60)) - const yMin = Math.min(0, Math.floor((profile.length ? Math.min(...profile.map((p) => p[1])) : 0) / 500) * 500) - const yMax = Math.ceil((profile.length ? Math.max(...profile.map((p) => p[1])) : 1000) / 500) * 500 + const yMin = Math.min(0, Math.floor((profile.length > 0 ? Math.min(...profile.map((p) => p[1])) : 0) / 500) * 500) + const yMax = Math.ceil((profile.length > 0 ? Math.max(...profile.map((p) => p[1])) : 1000) / 500) * 500 return (
diff --git a/src/renderer/src/components/RotationSpeedPanel.tsx b/src/renderer/src/components/RotationSpeedPanel.tsx index 57f290a..9f3e264 100644 --- a/src/renderer/src/components/RotationSpeedPanel.tsx +++ b/src/renderer/src/components/RotationSpeedPanel.tsx @@ -1,7 +1,8 @@ import { useMemo } from 'react' import { XIcon } from 'lucide-react' import { Button } from '@renderer/components/ui' -import LineChart, { type ChartSeries } from './charts/LineChart' +import LineChart from './charts/LineChart'; +import type { ChartSeries } from './charts/LineChart'; import styles from './RotationSpeedPanel.module.css' export interface RotationSpeedPanelProps { @@ -46,7 +47,7 @@ const facts = [ export function RotationSpeedPanel({ onClose }: RotationSpeedPanelProps) { const speedSeries = useMemo(() => { - const points: Array<[number, number]> = [] + const points: [number, number][] = [] for (let lat = -90; lat <= 90; lat += 2) { points.push([lat, EQUATOR_SPEED_KMH * Math.cos((lat * Math.PI) / 180)]) } diff --git a/src/renderer/src/components/SceneBookmarksPanel.tsx b/src/renderer/src/components/SceneBookmarksPanel.tsx index b8408df..273eb59 100644 --- a/src/renderer/src/components/SceneBookmarksPanel.tsx +++ b/src/renderer/src/components/SceneBookmarksPanel.tsx @@ -51,7 +51,7 @@ const narrationPreview = (scene: TeachingScene): string => const sceneTags = (scene: TeachingScene): string[] => { const names = scene.snapshot.overlays.slice(0, 2).map(layerNameOf) - if (scene.snapshot.overlays.length > 2) names.push(`+${scene.snapshot.overlays.length - 2}`) + if (scene.snapshot.overlays.length > 2) {names.push(`+${scene.snapshot.overlays.length - 2}`)} return names } @@ -86,7 +86,7 @@ export function SceneBookmarksPanel({ function confirmSave(): void { const name = saveName.trim() - if (!name) return + if (!name) {return} setSaveVisible(false) onSave(name, saveNarration.trim()) } @@ -101,7 +101,7 @@ export function SceneBookmarksPanel({ function confirmEdit(): void { const name = editName.trim() - if (!name) return + if (!name) {return} setEditVisible(false) onUpdate(editId, { name, @@ -138,7 +138,7 @@ export function SceneBookmarksPanel({ {saveError && }
- {!scenes.length ? ( + {scenes.length === 0 ? (
将当前视角与图层保存为场景,方便课堂播放。 diff --git a/src/renderer/src/components/ScenePlayerOverlay.tsx b/src/renderer/src/components/ScenePlayerOverlay.tsx index 581931b..f15697f 100644 --- a/src/renderer/src/components/ScenePlayerOverlay.tsx +++ b/src/renderer/src/components/ScenePlayerOverlay.tsx @@ -1,7 +1,8 @@ import { useEffect } from 'react' import { SkipForwardIcon } from 'lucide-react' import { Button, Segmented, Spinner } from '@renderer/components/ui' -import { useScenesStore, type RecordingPrewarmQuality } from '@renderer/stores/scenes' +import { useScenesStore } from '@renderer/stores/scenes'; +import type { RecordingPrewarmQuality } from '@renderer/stores/scenes'; import type { PlayerState } from '@renderer/composables/useScenePlayer' import styles from './ScenePlayerOverlay.module.css' @@ -11,7 +12,7 @@ export interface ScenePlayerOverlayProps { onStop: () => void } -const prewarmQualityOptions: Array<{ label: string; value: RecordingPrewarmQuality }> = [ +const prewarmQualityOptions: { label: string; value: RecordingPrewarmQuality }[] = [ { label: '标准', value: 'standard' }, { label: '高清', value: 'high' }, { label: '极清', value: 'ultra' } @@ -24,7 +25,7 @@ export function ScenePlayerOverlay({ player, onNext, onStop }: ScenePlayerOverla useEffect(() => { function handleKeydown(event: KeyboardEvent): void { - if (!player.active) return + if (!player.active) {return} if (event.key === 'Escape') { event.preventDefault() onStop() @@ -39,7 +40,7 @@ export function ScenePlayerOverlay({ player, onNext, onStop }: ScenePlayerOverla return () => window.removeEventListener('keydown', handleKeydown) }, [player.active, onNext, onStop]) - if (!player.active) return null + if (!player.active) {return null} const recordingActive = recording.state === 'recording' || recording.state === 'preparing' const isRecordingPreparing = recording.state === 'preparing' @@ -52,10 +53,10 @@ export function ScenePlayerOverlay({ player, onNext, onStop }: ScenePlayerOverla : '' let recordNotice = '' - if (recording.state === 'preparing') recordNotice = '正在准备录制…' - else if (recording.state === 'recording') recordNotice = `录制中 ${recording.currentStep}/${recording.totalSteps}` - else if (recording.state === 'saving') recordNotice = '正在保存视频…' - else if (recording.state === 'error') recordNotice = `录制失败:${recording.error}` + if (recording.state === 'preparing') {recordNotice = '正在准备录制…'} + else if (recording.state === 'recording') {recordNotice = `录制中 ${recording.currentStep}/${recording.totalSteps}`} + else if (recording.state === 'saving') {recordNotice = '正在保存视频…'} + else if (recording.state === 'error') {recordNotice = `录制失败:${recording.error}`} return (
diff --git a/src/renderer/src/components/SearchProviderSettings.tsx b/src/renderer/src/components/SearchProviderSettings.tsx index 3c89b40..8c2f5b4 100644 --- a/src/renderer/src/components/SearchProviderSettings.tsx +++ b/src/renderer/src/components/SearchProviderSettings.tsx @@ -38,16 +38,16 @@ export function SearchProviderSettings({ const [error, setError] = useState('') const refreshCredential = useCallback(async (providerId = selectedIdRef.current): Promise => { - if (!providerId) return + if (!providerId) {return} setLoading(true) setError('') try { const status = await window.guEarth.settings.hasProviderApiKey(`ai-search-${providerId}`) - if (selectedIdRef.current === providerId) setCredential(status) + if (selectedIdRef.current === providerId) {setCredential(status)} } catch { - if (selectedIdRef.current === providerId) setError('无法读取搜索密钥状态,请重试') + if (selectedIdRef.current === providerId) {setError('无法读取搜索密钥状态,请重试')} } finally { - if (selectedIdRef.current === providerId) setLoading(false) + if (selectedIdRef.current === providerId) {setLoading(false)} } }, []) @@ -65,7 +65,7 @@ export function SearchProviderSettings({ async function saveKey(): Promise { const providerId = selectedIdRef.current const key = apiKeyDraft.trim() - if (!providerId || !key || saving || clearing) return + if (!providerId || !key || saving || clearing) {return} setSaving(true) setError('') try { @@ -84,7 +84,7 @@ export function SearchProviderSettings({ async function clearKey(): Promise { const providerId = selectedIdRef.current - if (!providerId || saving || clearing) return + if (!providerId || saving || clearing) {return} setClearing(true) setError('') try { @@ -111,7 +111,7 @@ export function SearchProviderSettings({ aria-label="默认搜索供应商" className={styles.searchProviderSelect} onChange={(value) => { - if (value) onActiveProviderIdChange(value) + if (value) {onActiveProviderIdChange(value)} }} /> )} diff --git a/src/renderer/src/components/SettingsModal.tsx b/src/renderer/src/components/SettingsModal.tsx index d891ce0..760dcb2 100644 --- a/src/renderer/src/components/SettingsModal.tsx +++ b/src/renderer/src/components/SettingsModal.tsx @@ -1,20 +1,14 @@ import { useCallback, useRef, useState } from 'react' -import { - BotIcon, - FlaskConicalIcon, - GlobeIcon, - InfoIcon, - ShieldCheckIcon, - SlidersHorizontalIcon, - UserIcon, - type LucideIcon -} from 'lucide-react' +import { BotIcon, FlaskConicalIcon, GlobeIcon, InfoIcon, ShieldCheckIcon, SlidersHorizontalIcon, UserIcon } from 'lucide-react'; +import type { LucideIcon } from 'lucide-react'; import { Modal } from '@renderer/components/ui' -import { useSettingsWindowStore, type SettingsSection } from '@renderer/stores/settingsWindow' +import { useSettingsWindowStore } from '@renderer/stores/settingsWindow'; +import type { SettingsSection } from '@renderer/stores/settingsWindow'; import AccountSettings from './settings/AccountSettings' import GeneralSettings from './settings/GeneralSettings' import MapSettings from './settings/MapSettings' -import AiSettingsSection, { type AiSettingsSectionHandle } from './settings/AiSettingsSection' +import AiSettingsSection from './settings/AiSettingsSection'; +import type { AiSettingsSectionHandle } from './settings/AiSettingsSection'; import PrivacySettings from './settings/PrivacySettings' import LaboratorySettings from './settings/LaboratorySettings' import AboutSettings from './settings/AboutSettings' @@ -81,7 +75,7 @@ export function SettingsModal({ onRestartGuide }: SettingsModalProps) { const unsavedBarOpen = activeSection === 'ai' && aiDirty && !confirmOpen const handleBarSave = useCallback(async () => { - if (barSaving) return + if (barSaving) {return} setBarSaving(true) try { await aiSectionRef.current?.saveDrafts() @@ -96,16 +90,16 @@ export function SettingsModal({ onRestartGuide }: SettingsModalProps) { const runPendingAction = useCallback( (action: PendingAction | null) => { - if (!action) return - if (action.kind === 'navigate') setActiveSection(action.section) - else closeWindow() + if (!action) {return} + if (action.kind === 'navigate') {setActiveSection(action.section)} + else {closeWindow()} }, [closeWindow, setActiveSection] ) const requestNavigate = useCallback( (section: SettingsSection) => { - if (!settingsInteractive || section === activeSection) return + if (!settingsInteractive || section === activeSection) {return} const dirty = aiSectionRef.current?.isDirty() ?? aiDirty if (activeSection === 'ai' && dirty) { setPendingAction({ kind: 'navigate', section }) @@ -118,7 +112,7 @@ export function SettingsModal({ onRestartGuide }: SettingsModalProps) { ) const requestClose = useCallback(() => { - if (!settingsInteractive) return + if (!settingsInteractive) {return} const dirty = aiSectionRef.current?.isDirty() ?? aiDirty if (dirty) { setPendingAction({ kind: 'close' }) @@ -129,7 +123,7 @@ export function SettingsModal({ onRestartGuide }: SettingsModalProps) { }, [aiDirty, closeWindow, settingsInteractive]) const handleConfirmIgnore = useCallback(() => { - if (confirmSaving) return + if (confirmSaving) {return} aiSectionRef.current?.discardDrafts() const action = pendingAction setPendingAction(null) @@ -138,14 +132,14 @@ export function SettingsModal({ onRestartGuide }: SettingsModalProps) { }, [confirmSaving, pendingAction, runPendingAction]) const handleConfirmSave = useCallback(async () => { - if (confirmSaving) return + if (confirmSaving) {return} setConfirmSaving(true) try { const saved = await (aiSectionRef.current?.saveDrafts() ?? Promise.resolve(false)) const action = pendingAction setPendingAction(null) setConfirmOpen(false) - if (saved) runPendingAction(action) + if (saved) {runPendingAction(action)} } finally { setConfirmSaving(false) } diff --git a/src/renderer/src/components/SolarChartPanel.tsx b/src/renderer/src/components/SolarChartPanel.tsx index de4aa1f..aaea151 100644 --- a/src/renderer/src/components/SolarChartPanel.tsx +++ b/src/renderer/src/components/SolarChartPanel.tsx @@ -3,7 +3,8 @@ import { XIcon } from 'lucide-react' import { Button, Segmented, Slider } from '@renderer/components/ui' import { useSolarStore } from '@renderer/stores/solar' import { dayLength, declinationForDate, monthStartDayOfYear, noonAltitudeDeg, solarDeclinationDeg } from '@renderer/thematic/solarMath' -import LineChart, { type ChartSeries } from './charts/LineChart' +import LineChart from './charts/LineChart'; +import type { ChartSeries } from './charts/LineChart'; import styles from './SolarChartPanel.module.css' export interface SolarChartPanelProps { @@ -31,7 +32,7 @@ const latitudeFormatter = (value: number): string => (value === 0 ? '0°' : `${M const dateFormatter = (value: number): string => { const index = monthStarts.findIndex((start, i) => value >= start && value < (monthStarts[i + 1] ?? 366)) - return index >= 0 ? `${index + 1}月` : '' + return index !== -1 ? `${index + 1}月` : '' } export function SolarChartPanel({ className, onClose }: SolarChartPanelProps) { @@ -45,23 +46,23 @@ export function SolarChartPanel({ className, onClose }: SolarChartPanelProps) { const dayLengthSeries = useMemo(() => { if (mode === 'latitude') { - const points: Array<[number, number]> = [] - for (let lat = -90; lat <= 90; lat += 2) points.push([lat, dayLength(lat, declination).hours]) + const points: [number, number][] = [] + for (let lat = -90; lat <= 90; lat += 2) {points.push([lat, dayLength(lat, declination).hours])} return [{ name: '昼长', color: DAY_LENGTH_COLOR, points, markY: [12] }] } - const points: Array<[number, number]> = [] - for (let day = 1; day <= 365; day += 2) points.push([day, dayLength(latitude, solarDeclinationDeg(day)).hours]) + const points: [number, number][] = [] + for (let day = 1; day <= 365; day += 2) {points.push([day, dayLength(latitude, solarDeclinationDeg(day)).hours])} return [{ name: `昼长(${latLabel(latitude)})`, color: DAY_LENGTH_COLOR, points, markY: [12] }] }, [mode, declination, latitude]) const altitudeSeries = useMemo(() => { if (mode === 'latitude') { - const points: Array<[number, number]> = [] - for (let lat = -90; lat <= 90; lat += 2) points.push([lat, noonAltitudeDeg(lat, declination)]) + const points: [number, number][] = [] + for (let lat = -90; lat <= 90; lat += 2) {points.push([lat, noonAltitudeDeg(lat, declination)])} return [{ name: '正午太阳高度', color: ALTITUDE_COLOR, points, markY: [0] }] } - const points: Array<[number, number]> = [] - for (let day = 1; day <= 365; day += 2) points.push([day, noonAltitudeDeg(latitude, solarDeclinationDeg(day))]) + const points: [number, number][] = [] + for (let day = 1; day <= 365; day += 2) {points.push([day, noonAltitudeDeg(latitude, solarDeclinationDeg(day))])} return [{ name: `正午太阳高度(${latLabel(latitude)})`, color: ALTITUDE_COLOR, points, markY: [0] }] }, [mode, declination, latitude]) diff --git a/src/renderer/src/components/SolarPathPanel.tsx b/src/renderer/src/components/SolarPathPanel.tsx index e235c0d..4fd4f89 100644 --- a/src/renderer/src/components/SolarPathPanel.tsx +++ b/src/renderer/src/components/SolarPathPanel.tsx @@ -3,15 +3,8 @@ import { PauseIcon, PlayIcon, XIcon } from 'lucide-react' import { Button, MonthDayPicker, Slider } from '@renderer/components/ui' import { useVisibleAnimation } from '@renderer/composables/useVisibleAnimation' import { useSolarStore } from '@renderer/stores/solar' -import { - dayLength, - declinationForDate, - formatClock, - horizonCrossingsDeg, - noonAltitudeDeg, - solarHorizontalPositionDeg, - type DayState -} from '@renderer/thematic/solarMath' +import { dayLength, declinationForDate, formatClock, horizonCrossingsDeg, noonAltitudeDeg, solarHorizontalPositionDeg } from '@renderer/thematic/solarMath'; +import type { DayState } from '@renderer/thematic/solarMath'; import styles from './SolarPathPanel.module.css' export interface SolarPathPanelProps { @@ -47,7 +40,7 @@ function polarPoint(azimuthDeg: number, altitudeDeg: number): { x: number; y: nu function directionText(azimuthDeg: number): string { const sector = Math.round(azimuthDeg / 45) % 8 const offset = Math.round(azimuthDeg - sector * 45) - if (offset === 0) return sector % 2 === 0 ? `正${DIRECTION_NAMES[sector]}` : DIRECTION_NAMES[sector] + if (offset === 0) {return sector % 2 === 0 ? `正${DIRECTION_NAMES[sector]}` : DIRECTION_NAMES[sector]} return offset > 0 ? `${DIRECTION_NAMES[sector]}偏${DIRECTION_NAMES[(sector + 1) % 8]}${offset}°` : `${DIRECTION_NAMES[sector]}偏${DIRECTION_NAMES[(sector + 7) % 8]}${-offset}°` @@ -78,13 +71,13 @@ export function SolarPathPanel({ onClose }: SolarPathPanelProps) { const sunNow = useMemo(() => solarHorizontalPositionDeg(latitude, declination, localHour), [latitude, declination, localHour]) const pathPoints = useMemo(() => { - if (length.state === 'polar-night') return '' - const points: Array<{ x: number; y: number }> = [] + if (length.state === 'polar-night') {return ''} + const points: { x: number; y: number }[] = [] for (let t = 0; t <= 24.001; t += 0.1) { const position = solarHorizontalPositionDeg(latitude, declination, t) - if (position.altitudeDeg > 0.3) points.push(polarPoint(position.azimuthDeg, position.altitudeDeg)) + if (position.altitudeDeg > 0.3) {points.push(polarPoint(position.azimuthDeg, position.altitudeDeg))} } - if (length.state === 'polar-day' && points.length > 1) points.push(points[0]) + if (length.state === 'polar-day' && points.length > 1) {points.push(points[0])} return points.map((point, index) => `${index === 0 ? 'M' : 'L'}${point.x.toFixed(1)},${point.y.toFixed(1)}`).join(' ') }, [length.state, latitude, declination]) @@ -112,7 +105,7 @@ export function SolarPathPanel({ onClose }: SolarPathPanelProps) { ) const noonSkyText = useMemo(() => { - if (noonPosition.altitudeDeg > 89) return '太阳位于天顶' + if (noonPosition.altitudeDeg > 89) {return '太阳位于天顶'} return noonPosition.azimuthDeg <= 22.5 || noonPosition.azimuthDeg >= 337.5 ? '正午太阳位于正北天空' : '正午太阳位于正南天空' @@ -120,13 +113,13 @@ export function SolarPathPanel({ onClose }: SolarPathPanelProps) { const stateText = useMemo(() => { const state: DayState = length.state - if (state === 'polar-day') return '当日极昼:太阳整日不落,轨迹为完整圆环' - if (state === 'polar-night') return '当日极夜:太阳始终位于地平圈以下,无视运动轨迹' + if (state === 'polar-day') {return '当日极昼:太阳整日不落,轨迹为完整圆环'} + if (state === 'polar-night') {return '当日极夜:太阳始终位于地平圈以下,无视运动轨迹'} return '' }, [length.state]) useVisibleAnimation(isPlaying, (dt) => { - if (dt > 0) setLocalHour((prev) => (prev + dt * LOCAL_HOURS_PER_SECOND) % 24) + if (dt > 0) {setLocalHour((prev) => (prev + dt * LOCAL_HOURS_PER_SECOND) % 24)} }) return ( diff --git a/src/renderer/src/components/SolarTimePanel.tsx b/src/renderer/src/components/SolarTimePanel.tsx index fdea5f6..302b73d 100644 --- a/src/renderer/src/components/SolarTimePanel.tsx +++ b/src/renderer/src/components/SolarTimePanel.tsx @@ -1,4 +1,5 @@ -import { useEffect, useState, type ReactNode } from 'react' +import { useEffect, useState } from 'react'; +import type { ReactNode } from 'react'; import { LineChartIcon, PauseIcon, PlayIcon, RepeatIcon } from 'lucide-react' import type * as Cesium from 'cesium' import { Button, MonthDayPicker, Slider, Tooltip } from '@renderer/components/ui' @@ -43,15 +44,15 @@ export function SolarTimePanel({ viewer, renderChart }: SolarTimePanelProps) { const [chartOpen, setChartOpen] = useState(false) useVisibleAnimation(active && (isPlaying || isAnnualPlaying), (dt) => { - if (dt > 0) advance(dt) - if (viewer && !viewer.isDestroyed()) viewer.scene.requestRender() + if (dt > 0) {advance(dt)} + if (viewer && !viewer.isDestroyed()) {viewer.scene.requestRender()} }) useEffect(() => { - if (viewer && !viewer.isDestroyed()) viewer.scene.requestRender() + if (viewer && !viewer.isDestroyed()) {viewer.scene.requestRender()} }, [date, hour, active, viewer]) - if (!active) return null + if (!active) {return null} const panelClasses = [ styles.solarPanel, diff --git a/src/renderer/src/components/StreamingMarkdown.tsx b/src/renderer/src/components/StreamingMarkdown.tsx index 63c4cd1..963b6dd 100644 --- a/src/renderer/src/components/StreamingMarkdown.tsx +++ b/src/renderer/src/components/StreamingMarkdown.tsx @@ -1,12 +1,7 @@ -import { useLayoutEffect, useRef, useState, type ReactNode } from 'react' -import { - createStreamingDelayState, - renderMarkdown, - renderStreamingMarkdown, - resetStreamingDelayState, - settleStreamingDelayState, - type StreamingDelayState -} from '@renderer/utils/markdown' +import { useLayoutEffect, useRef, useState } from 'react'; +import type { ReactNode } from 'react'; +import { createStreamingDelayState, renderMarkdown, renderStreamingMarkdown, resetStreamingDelayState, settleStreamingDelayState } from '@renderer/utils/markdown'; +import type { StreamingDelayState } from '@renderer/utils/markdown'; import styles from './StreamingMarkdown.module.css' const STREAM_RENDER_INTERVAL_MS = 50 @@ -55,7 +50,7 @@ export function StreamingMarkdown({ text, streaming = false, onRendered }: Strea function settle(): void { settleTimerRef.current = undefined const current = latestPropsRef.current - if (!current.streaming) return + if (!current.streaming) {return} settledRef.current = true settleStreamingDelayState(delayStateRef.current!, current.text) const nextNodes = renderMarkdown(current.text) @@ -68,18 +63,18 @@ export function StreamingMarkdown({ text, streaming = false, onRendered }: Strea settledRef.current = false const current = latestPropsRef.current const delayState = delayStateRef.current! - if (!current.streaming) { - resetStreamingDelayState(delayState) - const nextNodes = renderMarkdown(current.text) - hasNodesRef.current = nextNodes.length > 0 - setNodes(nextNodes) - } else { + if (current.streaming) { const nextNodes = renderStreamingMarkdown(current.text, delayState) hasNodesRef.current = nextNodes.length > 0 setNodes(nextNodes) if (current.text) { settleTimerRef.current = setTimeout(settle, STREAM_IDLE_SETTLE_MS) } + } else { + resetStreamingDelayState(delayState) + const nextNodes = renderMarkdown(current.text) + hasNodesRef.current = nextNodes.length > 0 + setNodes(nextNodes) } onRenderedRef.current?.() } @@ -108,11 +103,11 @@ export function StreamingMarkdown({ text, streaming = false, onRendered }: Strea } }, [text, streaming]) - useLayoutEffect(() => { - return () => { + useLayoutEffect(() => + () => { clearTimers() } - }, []) + , []) return
{nodes}
} diff --git a/src/renderer/src/components/TeachingLab.tsx b/src/renderer/src/components/TeachingLab.tsx index 921409b..cfa5e3a 100644 --- a/src/renderer/src/components/TeachingLab.tsx +++ b/src/renderer/src/components/TeachingLab.tsx @@ -1,10 +1,15 @@ import { XIcon } from 'lucide-react' import { Button } from '@renderer/components/ui' -import { thematicLayerCatalog, useClimateStore, type ThematicLayerId } from '@renderer/stores/climate' -import { useSolarStore, type MotionPanel as SolarMotionPanel } from '@renderer/stores/solar' -import { useAtmosphereStore, type AtmospherePanel } from '@renderer/stores/atmosphere' -import { useHydrologyStore, type HydrologyPanel } from '@renderer/stores/hydrology' -import { useLandformStore, type LandformPanel } from '@renderer/stores/landform' +import { thematicLayerCatalog, useClimateStore } from '@renderer/stores/climate'; +import type { ThematicLayerId } from '@renderer/stores/climate'; +import { useSolarStore } from '@renderer/stores/solar'; +import type { MotionPanel as SolarMotionPanel } from '@renderer/stores/solar'; +import { useAtmosphereStore } from '@renderer/stores/atmosphere'; +import type { AtmospherePanel } from '@renderer/stores/atmosphere'; +import { useHydrologyStore } from '@renderer/stores/hydrology'; +import type { HydrologyPanel } from '@renderer/stores/hydrology'; +import { useLandformStore } from '@renderer/stores/landform'; +import type { LandformPanel } from '@renderer/stores/landform'; import { usePopulationStore } from '@renderer/stores/population' import { useTransportStore } from '@renderer/stores/transport' import { useEnvironmentStore } from '@renderer/stores/environment' @@ -60,7 +65,7 @@ export function TeachingLab({ open, onClose }: TeachingLabProps) { const zonationPanel = useZonationStore((state) => state.panel) const drawingActiveTool = useDrawingStore((state) => state.activeTool) - if (!open) return null + if (!open) {return null} function layerEntry(id: ThematicLayerId): LabEntry { const layer = thematicLayerCatalog.find((item) => item.id === id) @@ -86,7 +91,7 @@ export function TeachingLab({ open, onClose }: TeachingLabProps) { toggle: () => { const next = useSolarStore.getState().motionPanel !== panel closeAllPanels() - if (next) useSolarStore.getState().setMotionPanel(panel) + if (next) {useSolarStore.getState().setMotionPanel(panel)} return next } } @@ -101,7 +106,7 @@ export function TeachingLab({ open, onClose }: TeachingLabProps) { toggle: () => { const next = useAtmosphereStore.getState().panel !== panel closeAllPanels() - if (next) useAtmosphereStore.getState().setPanel(panel) + if (next) {useAtmosphereStore.getState().setPanel(panel)} return next } } @@ -116,7 +121,7 @@ export function TeachingLab({ open, onClose }: TeachingLabProps) { toggle: () => { const next = useHydrologyStore.getState().panel !== panel closeAllPanels() - if (next) useHydrologyStore.getState().setPanel(panel) + if (next) {useHydrologyStore.getState().setPanel(panel)} return next } } @@ -131,7 +136,7 @@ export function TeachingLab({ open, onClose }: TeachingLabProps) { toggle: () => { const next = useLandformStore.getState().panel !== panel closeAllPanels() - if (next) useLandformStore.getState().setPanel(panel) + if (next) {useLandformStore.getState().setPanel(panel)} return next } } @@ -146,7 +151,7 @@ export function TeachingLab({ open, onClose }: TeachingLabProps) { toggle: () => { const next = usePopulationStore.getState().panel !== 'population' closeAllPanels() - if (next) usePopulationStore.getState().setPanel('population') + if (next) {usePopulationStore.getState().setPanel('population')} return next } } @@ -161,7 +166,7 @@ export function TeachingLab({ open, onClose }: TeachingLabProps) { toggle: () => { const next = usePopulationStore.getState().panel !== 'cities' closeAllPanels() - if (next) usePopulationStore.getState().setPanel('cities') + if (next) {usePopulationStore.getState().setPanel('cities')} return next } } @@ -176,7 +181,7 @@ export function TeachingLab({ open, onClose }: TeachingLabProps) { toggle: () => { const next = useTransportStore.getState().panel !== 'transport' closeAllPanels() - if (next) useTransportStore.getState().setPanel('transport') + if (next) {useTransportStore.getState().setPanel('transport')} return next } } @@ -191,7 +196,7 @@ export function TeachingLab({ open, onClose }: TeachingLabProps) { toggle: () => { const next = useEnvironmentStore.getState().panel !== 'environment' closeAllPanels() - if (next) useEnvironmentStore.getState().setPanel('environment') + if (next) {useEnvironmentStore.getState().setPanel('environment')} return next } } @@ -206,7 +211,7 @@ export function TeachingLab({ open, onClose }: TeachingLabProps) { toggle: () => { const next = useDecisionStore.getState().panel !== 'location' closeAllPanels() - if (next) useDecisionStore.getState().setPanel('location') + if (next) {useDecisionStore.getState().setPanel('location')} return next } } @@ -221,7 +226,7 @@ export function TeachingLab({ open, onClose }: TeachingLabProps) { toggle: () => { const next = useZonationStore.getState().panel !== 'zonation-profile' closeAllPanels() - if (next) useZonationStore.getState().setPanel('zonation-profile') + if (next) {useZonationStore.getState().setPanel('zonation-profile')} return next } } @@ -254,7 +259,7 @@ export function TeachingLab({ open, onClose }: TeachingLabProps) { toggle: () => { const next = !useClimateStore.getState().overlays['temperature-zones'] useClimateStore.getState().setOverlay('temperature-zones', next) - if (next) useSolarStore.getState().setActive(true) + if (next) {useSolarStore.getState().setActive(true)} return next } }, @@ -266,7 +271,7 @@ export function TeachingLab({ open, onClose }: TeachingLabProps) { toggle: () => { const next = useDrawingStore.getState().activeTool !== 'timezone' closeAllPanels() - if (next) useDrawingStore.getState().setActiveTool('timezone') + if (next) {useDrawingStore.getState().setActiveTool('timezone')} return next } }, @@ -299,9 +304,9 @@ export function TeachingLab({ open, onClose }: TeachingLabProps) { key: 'enso', name: 'ENSO(厄尔尼诺与拉尼娜)', description: '三相位海温距平着色 + 沃克环流剖面,点击海区看影响', - active: overlays['enso'], + active: overlays.enso, toggle: () => { - const next = !useClimateStore.getState().overlays['enso'] + const next = !useClimateStore.getState().overlays.enso useClimateStore.getState().setOverlay('enso', next) return next } diff --git a/src/renderer/src/components/ThematicInfoCard.tsx b/src/renderer/src/components/ThematicInfoCard.tsx index d94abdb..39dc68f 100644 --- a/src/renderer/src/components/ThematicInfoCard.tsx +++ b/src/renderer/src/components/ThematicInfoCard.tsx @@ -15,10 +15,10 @@ export function ThematicInfoCard(_props: ThematicInfoCardProps) { const isLayerPanelOpen = useGlobeStore((state) => state.isLayerPanelOpen) const setLayerPanelOpen = useGlobeStore((state) => state.setLayerPanelOpen) - if (!focused) return null + if (!focused) {return null} function explainWithAi(): void { - if (!focused) return + if (!focused) {return} setAiPanelOpen(true) void sendAi( `请结合「${focused.layerName}」图层,讲解${focused.name}的成因、分布规律及其对地理环境的影响。参考信息:${focused.summary}` diff --git a/src/renderer/src/components/ThematicLegend.tsx b/src/renderer/src/components/ThematicLegend.tsx index e5176bd..bb04bc8 100644 --- a/src/renderer/src/components/ThematicLegend.tsx +++ b/src/renderer/src/components/ThematicLegend.tsx @@ -7,7 +7,8 @@ import { densityBins } from '@renderer/thematic/populationCensus' import { CITY_TIER_META, FUNCTIONAL_ZONES, functionalZoneCities } from '@renderer/thematic/urbanCities' import { AGRI_CATEGORY_META } from '@renderer/thematic/agriculturalRegions' import { industrialBases } from '@renderer/thematic/industrialBases' -import { useOnlineDataStore, type TyphoonMode } from '@renderer/stores/onlineData' +import { useOnlineDataStore } from '@renderer/stores/onlineData'; +import type { TyphoonMode } from '@renderer/stores/onlineData'; import { useSettingsWindowStore } from '@renderer/stores/settingsWindow' import { typhoonIntensityStyles } from '@renderer/thematic/typhoonTracks' import { @@ -28,7 +29,7 @@ const liveTyphoonEntries = [ })), unknownTyphoonIntensityStyle ] -const typhoonModeOptions: Array<{ label: string; value: TyphoonMode }> = [ +const typhoonModeOptions: { label: string; value: TyphoonMode }[] = [ { label: '实时台风', value: 'live' }, { label: '历史案例', value: 'history' } ] @@ -72,7 +73,7 @@ export function ThematicLegend(_props: ThematicLegendProps) { const openSettingsWindow = useSettingsWindowStore((state) => state.open) - if (!hasActiveOverlay) return null + if (!hasActiveOverlay) {return null} const typhoonFeed = snapshot?.typhoons const typhoonHistory = snapshot?.typhoonConfigured === false || typhoonMode === 'history' @@ -140,7 +141,7 @@ export function ThematicLegend(_props: ThematicLegendProps) { ))}
)} - {overlays['enso'] && ( + {overlays.enso && (
@@ -180,7 +181,7 @@ export function ThematicLegend(_props: ThematicLegendProps) {
)} - {overlays['typhoon'] && ( + {overlays.typhoon && (
台风(热带气旋)
{snapshot?.typhoonConfigured && ( @@ -231,16 +232,16 @@ export function ThematicLegend(_props: ThematicLegendProps) {

更新时间:{formatOnlineTime(typhoonFeed.fetchedAt)}

- {!activeStormCount ? ( + {activeStormCount ? ( +

+ 当前有 {activeStormCount} 个活跃台风,点击路径点查看详情 +

+ ) : ( - ) : ( -

- 当前有 {activeStormCount} 个活跃台风,点击路径点查看详情 -

)} {forecastErrors && ( { - if (value) setFunctionalZoneCity(value) + if (value) {setFunctionalZoneCity(value)} }} /> {functionalZoneEntries.map((zone) => ( diff --git a/src/renderer/src/components/ThermalCirculationPanel.tsx b/src/renderer/src/components/ThermalCirculationPanel.tsx index 58a943b..3d99b59 100644 --- a/src/renderer/src/components/ThermalCirculationPanel.tsx +++ b/src/renderer/src/components/ThermalCirculationPanel.tsx @@ -26,7 +26,7 @@ interface GroundShape { interface SceneConfig { grounds: GroundShape[] arrows: FlowArrow[] - placeLabels: Array<{ text: string; at: [number, number] }> + placeLabels: { text: string; at: [number, number] }[] caption: string } @@ -45,7 +45,7 @@ const periodOptions = [ { value: 'night', label: '夜晚' } ] -const BUILDINGS: Array<[number, number, number]> = [ +const BUILDINGS: [number, number, number][] = [ [128, 24, 14], [144, 34, 12], [160, 20, 16], @@ -53,7 +53,7 @@ const BUILDINGS: Array<[number, number, number]> = [ [188, 16, 11] ] -const SUBURB_HOUSES: Array<[number, number]> = [ +const SUBURB_HOUSES: [number, number][] = [ [30, 6], [46, 8], [248, 7], @@ -160,8 +160,8 @@ export function ThermalCirculationPanel({ onClose }: ThermalCirculationPanelProp const [period, setPeriod] = useState('day') const sceneConfig = useMemo(() => { - if (scene === 'sea-land') return seaLandConfig(period) - if (scene === 'valley') return valleyConfig(period) + if (scene === 'sea-land') {return seaLandConfig(period)} + if (scene === 'valley') {return valleyConfig(period)} return urbanConfig() }, [scene, period]) diff --git a/src/renderer/src/components/TideWavePanel.tsx b/src/renderer/src/components/TideWavePanel.tsx index 56ef836..3cb6f88 100644 --- a/src/renderer/src/components/TideWavePanel.tsx +++ b/src/renderer/src/components/TideWavePanel.tsx @@ -21,7 +21,7 @@ const tideModeOptions = [ { value: 'neap', label: '小潮(上下弦)' } ] -const waveParticles: Array<{ cx: number; cy: number; r: number; delay: number }> = [ +const waveParticles: { cx: number; cy: number; r: number; delay: number }[] = [ { cx: 62, cy: 100, r: 7, delay: 0 }, { cx: 122, cy: 100, r: 7, delay: -0.7 }, { cx: 182, cy: 100, r: 7, delay: -1.4 }, diff --git a/src/renderer/src/components/TimezonePanel.tsx b/src/renderer/src/components/TimezonePanel.tsx index 5467038..461c0eb 100644 --- a/src/renderer/src/components/TimezonePanel.tsx +++ b/src/renderer/src/components/TimezonePanel.tsx @@ -21,7 +21,7 @@ export function TimezonePanel({ comparison, onClear }: TimezonePanelProps) { const beijingClock = useSolarStore((state) => state.beijingClock) const utcHours = useMemo(() => { - if (solarActive) return solarUtcHour + if (solarActive) {return solarUtcHour} const now = new Date() return now.getUTCHours() + now.getUTCMinutes() / 60 }, [solarActive, solarUtcHour]) @@ -30,7 +30,7 @@ export function TimezonePanel({ comparison, onClear }: TimezonePanelProps) { const differenceText = useMemo(() => { const difference = comparison.differenceHours - if (Math.abs(difference) < 1 / 60) return '两地经度相近,地方时基本相同' + if (Math.abs(difference) < 1 / 60) {return '两地经度相近,地方时基本相同'} const abs = Math.abs(difference) const hours = Math.floor(abs) const minutes = Math.round((abs - hours) * 60) diff --git a/src/renderer/src/components/TransportPanel.tsx b/src/renderer/src/components/TransportPanel.tsx index d161298..e044235 100644 --- a/src/renderer/src/components/TransportPanel.tsx +++ b/src/renderer/src/components/TransportPanel.tsx @@ -1,20 +1,14 @@ import { useRef } from 'react' -import * as Cesium from 'cesium' +import type * as Cesium from 'cesium' import { MapPinIcon, XIcon } from 'lucide-react' import { Button } from '@renderer/components/ui' import { useClimateStore } from '@renderer/stores/climate' import { useTransportStore } from '@renderer/stores/transport' -import { - HSR_END_YEAR, - hsrFacts, - hsrGrowthSeries, - hsrLines, - hsrLinesUpTo, - hsrMileageAt, - type HsrLine -} from '@renderer/thematic/hsrLines' +import { HSR_END_YEAR, hsrFacts, hsrGrowthSeries, hsrLines, hsrLinesUpTo, hsrMileageAt } from '@renderer/thematic/hsrLines'; +import type { HsrLine } from '@renderer/thematic/hsrLines'; import { resolveFlightDestination } from '@renderer/composables/terrainFlight' -import LineChart, { type ChartSeries } from './charts/LineChart' +import LineChart from './charts/LineChart'; +import type { ChartSeries } from './charts/LineChart'; import YearTimeline from './YearTimeline' import styles from './TransportPanel.module.css' @@ -43,18 +37,18 @@ export function TransportPanel({ viewer, onClose }: TransportPanelProps) { const flyingRef = useRef(false) const displayYear = Math.floor(year) - const mileageWan = (hsrMileageAt(displayYear) / 10000).toFixed(2) + const mileageWan = (hsrMileageAt(displayYear) / 10_000).toFixed(2) const openedCount = hsrLinesUpTo(displayYear).length async function flyToLine(line: HsrLine): Promise { - if (flyingRef.current) return - if (!viewer || viewer.isDestroyed()) return + if (flyingRef.current) {return} + if (!viewer || viewer.isDestroyed()) {return} flyingRef.current = true try { const mid = line.path[Math.floor(line.path.length / 2)] - const span = Math.min(1200000, Math.max(250000, line.lengthKm * 420)) + const span = Math.min(1_200_000, Math.max(250_000, line.lengthKm * 420)) const destination = await resolveFlightDestination(viewer.scene, mid[0], mid[1], span) - if (!destination || viewer.isDestroyed()) return + if (!destination || viewer.isDestroyed()) {return} viewer.camera.flyTo({ destination, duration: 1.6 }) } finally { flyingRef.current = false diff --git a/src/renderer/src/components/TyphoonOverlay.tsx b/src/renderer/src/components/TyphoonOverlay.tsx index 20b1f28..c239baa 100644 --- a/src/renderer/src/components/TyphoonOverlay.tsx +++ b/src/renderer/src/components/TyphoonOverlay.tsx @@ -8,7 +8,7 @@ export interface TyphoonOverlayProps { } const ANCHOR = Cesium.Cartesian3.fromDegrees(138, 15) -const ANCHOR_VIEW_HEIGHT = 6200000 +const ANCHOR_VIEW_HEIGHT = 6_200_000 function spiralArm(startAngle: number): string { const cx = 170 @@ -27,7 +27,7 @@ function spiralArm(startAngle: number): string { const arms = [spiralArm(20), spiralArm(140), spiralArm(260)] -const inflowArrows: Array<{ x: number; y: number; angle: number }> = [ +const inflowArrows: { x: number; y: number; angle: number }[] = [ { x: 300, y: 96, angle: 145 }, { x: 62, y: 122, angle: -55 }, { x: 100, y: 286, angle: -20 }, @@ -40,7 +40,7 @@ export function TyphoonOverlay({ viewer }: TyphoonOverlayProps) { useEffect(() => { const activeViewer = viewer && !viewer.isDestroyed() ? viewer : undefined if (!activeViewer) { - if (overlayRef.current) overlayRef.current.style.display = 'none' + if (overlayRef.current) {overlayRef.current.style.display = 'none'} return } const scratch = new Cesium.Cartesian2() @@ -49,7 +49,7 @@ export function TyphoonOverlay({ viewer }: TyphoonOverlayProps) { function frame(): void { const element = overlayRef.current - if (!activeViewer || activeViewer.isDestroyed() || !element) return + if (!activeViewer || activeViewer.isDestroyed() || !element) {return} let facing = true if (activeViewer.scene.mode === Cesium.SceneMode.SCENE3D) { activeViewer.scene.globe.ellipsoid.geodeticSurfaceNormal(ANCHOR, scratchNormal) diff --git a/src/renderer/src/components/UpdateDialog.tsx b/src/renderer/src/components/UpdateDialog.tsx index 7f431e7..f6c300f 100644 --- a/src/renderer/src/components/UpdateDialog.tsx +++ b/src/renderer/src/components/UpdateDialog.tsx @@ -1,4 +1,5 @@ -import { Component, useMemo, useState, type ReactNode } from 'react' +import { Component, useMemo, useState } from 'react'; +import type { ReactNode } from 'react'; import { Modal } from '@renderer/components/ui' import { useUpdaterStore } from '@renderer/stores/updater' import { tryRenderMarkdown } from '@renderer/utils/markdown' @@ -27,7 +28,7 @@ class MarkdownNotesBoundary extends Component = { normal: [ @@ -54,7 +55,7 @@ export function WalkerCirculationOverlay({ viewer, phase }: WalkerCirculationOve useEffect(() => { const activeViewer = viewer && !viewer.isDestroyed() ? viewer : undefined if (!activeViewer) { - if (overlayRef.current) overlayRef.current.style.display = 'none' + if (overlayRef.current) {overlayRef.current.style.display = 'none'} return } const scratch = new Cesium.Cartesian2() @@ -63,7 +64,7 @@ export function WalkerCirculationOverlay({ viewer, phase }: WalkerCirculationOve function frame(): void { const element = overlayRef.current - if (!activeViewer || activeViewer.isDestroyed() || !element) return + if (!activeViewer || activeViewer.isDestroyed() || !element) {return} let facing = true if (activeViewer.scene.mode === Cesium.SceneMode.SCENE3D) { activeViewer.scene.globe.ellipsoid.geodeticSurfaceNormal(ANCHOR, scratchNormal) @@ -109,10 +110,10 @@ export function WalkerCirculationOverlay({ viewer, phase }: WalkerCirculationOve - {phase !== 'el-nino' ? ( - - ) : ( + {phase === 'el-nino' ? ( + ) : ( + )} 东太平洋(南美沿岸) - {phase !== 'el-nino' ? ( - - 上升气流 - - ) : ( + {phase === 'el-nino' ? ( 上升气流东移 + ) : ( + + 上升气流 + )} 下沉气流 @@ -160,14 +161,14 @@ export function WalkerCirculationOverlay({ viewer, phase }: WalkerCirculationOve 高空向东流 - {phase !== 'el-nino' ? ( - - 信风(近地面自东向西) - - ) : ( + {phase === 'el-nino' ? ( 信风减弱甚至转向 + ) : ( + + 信风(近地面自东向西) + )} 温跃层 diff --git a/src/renderer/src/components/WaterBodyPanel.tsx b/src/renderer/src/components/WaterBodyPanel.tsx index c15ea76..9882e60 100644 --- a/src/renderer/src/components/WaterBodyPanel.tsx +++ b/src/renderer/src/components/WaterBodyPanel.tsx @@ -1,7 +1,8 @@ import { useMemo, useState } from 'react' import { XIcon } from 'lucide-react' import { Button, Segmented } from '@renderer/components/ui' -import LineChart, { type ChartSeries } from './charts/LineChart' +import LineChart from './charts/LineChart'; +import type { ChartSeries } from './charts/LineChart'; import styles from './WaterBodyPanel.module.css' export interface WaterBodyPanelProps { @@ -22,7 +23,7 @@ const rechargeOptions = [ { value: 'lake', label: '湖泊水' } ] -const monthlyDischarge: Record> = { +const monthlyDischarge: Record = { rain: [ [1, 2.2], [2, 2.8], @@ -47,7 +48,7 @@ const monthlyDischarge: Record> = { [7, 8.8], [8, 7.2], [9, 2.6], - [10, 1.0], + [10, 1], [11, 0.5], [12, 0.4] ], @@ -57,17 +58,17 @@ const monthlyDischarge: Record> = { [3, 4.6], [4, 4.6], [5, 4.8], - [6, 5.0], + [6, 5], [7, 5.3], [8, 5.2], - [9, 5.0], + [9, 5], [10, 4.9], [11, 4.8], [12, 4.8] ], lake: [ [1, 3.6], - [2, 4.0], + [2, 4], [3, 4.8], [4, 5.8], [5, 6.8], diff --git a/src/renderer/src/components/WaterCyclePanel.tsx b/src/renderer/src/components/WaterCyclePanel.tsx index b39e340..31bc8ae 100644 --- a/src/renderer/src/components/WaterCyclePanel.tsx +++ b/src/renderer/src/components/WaterCyclePanel.tsx @@ -26,7 +26,7 @@ export function WaterCyclePanel({ viewer, onClose }: WaterCyclePanelProps) { playingRef.current = playing useEffect(() => { - if (!playing) return + if (!playing) {return} const timer = setInterval(() => { setAnimationStep((prev) => (prev + 1) % (STEPS.length + 1)) }, 1600) @@ -36,15 +36,15 @@ export function WaterCyclePanel({ viewer, onClose }: WaterCyclePanelProps) { }, [playing]) useEffect(() => { - if (!playingRef.current) return + if (!playingRef.current) {return} if (viewer && !viewer.isDestroyed()) { - viewer.camera.flyTo({ destination: Cesium.Cartesian3.fromDegrees(128, 22, 7200000), duration: 1.2 }) + viewer.camera.flyTo({ destination: Cesium.Cartesian3.fromDegrees(128, 22, 7_200_000), duration: 1.2 }) } }, [viewer]) function stepActive(step: number): boolean { - if (animationStep === 0) return false - if (animationStep === 4) return true + if (animationStep === 0) {return false} + if (animationStep === 4) {return true} return animationStep >= step } diff --git a/src/renderer/src/components/WindParticles.tsx b/src/renderer/src/components/WindParticles.tsx index 0f30604..ce71b9c 100644 --- a/src/renderer/src/components/WindParticles.tsx +++ b/src/renderer/src/components/WindParticles.tsx @@ -35,9 +35,9 @@ const SPAWN_ROWS = 12 function hexToRgb(hex: string): [number, number, number] { const value = hex.replace('#', '') return [ - parseInt(value.slice(0, 2), 16), - parseInt(value.slice(2, 4), 16), - parseInt(value.slice(4, 6), 16) + Number.parseInt(value.slice(0, 2), 16), + Number.parseInt(value.slice(2, 4), 16), + Number.parseInt(value.slice(4, 6), 16) ] } @@ -64,7 +64,7 @@ export function WindParticles({ viewer }: WindParticlesProps) { useEffect(() => { const canvas = canvasRef.current - if (!canvas) return + if (!canvas) {return} const activeViewer = viewer && !viewer.isDestroyed() ? viewer : undefined const trailBins: number[][] = Array.from({ length: COLOR_BINS }, () => []) @@ -101,7 +101,7 @@ export function WindParticles({ viewer }: WindParticlesProps) { if (currentViewer.scene.mode === Cesium.SceneMode.SCENE3D) { currentViewer.scene.globe.ellipsoid.geodeticSurfaceNormal(position, scratchNormal) Cesium.Cartesian3.subtract(currentViewer.camera.positionWC, position, scratchToCamera) - if (Cesium.Cartesian3.dot(scratchNormal, scratchToCamera) <= 0) return false + if (Cesium.Cartesian3.dot(scratchNormal, scratchToCamera) <= 0) {return false} } const projected = Cesium.SceneTransforms.worldToWindowCoordinates(currentViewer.scene, position, result) return Boolean(projected && Number.isFinite(projected.x) && Number.isFinite(projected.y)) @@ -131,7 +131,7 @@ export function WindParticles({ viewer }: WindParticlesProps) { particle.trailScreens.length = 0 particle.age = 0 particle.maxAge = 3 + Math.random() * 3 - for (let attempt = 0; attempt < 8 && spawnCells.length; attempt += 1) { + for (let attempt = 0; attempt < 8 && spawnCells.length > 0; attempt += 1) { const cell = spawnCells[Math.floor(Math.random() * spawnCells.length)] scratchScreen.x = (((cell % SPAWN_COLUMNS) + Math.random()) * cssWidth) / SPAWN_COLUMNS scratchScreen.y = ((Math.floor(cell / SPAWN_COLUMNS) + Math.random()) * cssHeight) / SPAWN_ROWS @@ -140,13 +140,13 @@ export function WindParticles({ viewer }: WindParticlesProps) { currentViewer.scene.globe.ellipsoid, scratchPosition ) - if (!position) continue + if (!position) {continue} const location = currentViewer.scene.globe.ellipsoid.cartesianToCartographic(position, scratchCartographic) particle.lon = Cesium.Math.toDegrees(location.longitude) particle.lat = Cesium.Math.toDegrees(location.latitude) particle.height = 0 updatePosition(particle, currentViewer) - if (!projectToScreen(particle.position, currentViewer, scratchHead) || !isOnscreen(scratchHead)) continue + if (!projectToScreen(particle.position, currentViewer, scratchHead) || !isOnscreen(scratchHead)) {continue} particle.trail.push(Cesium.Cartesian3.clone(particle.position)) particle.trailScreens.push(scratchHead.x, scratchHead.y) return true @@ -179,10 +179,10 @@ export function WindParticles({ viewer }: WindParticlesProps) { } } const visibleArea = (cssWidth * cssHeight * spawnCells.length) / (SPAWN_COLUMNS * SPAWN_ROWS) - const target = spawnCells.length + const target = spawnCells.length > 0 ? Math.min(MAX_PARTICLES, Math.max(MIN_PARTICLES, Math.round(visibleArea / AREA_PER_PARTICLE))) : 0 - if (particles.length > target) particles.length = target + if (particles.length > target) {particles.length = target} while (particles.length < target) { const particle: Particle = { lon: 0, @@ -194,15 +194,15 @@ export function WindParticles({ viewer }: WindParticlesProps) { trail: [], trailScreens: [] } - if (respawn(particle, currentViewer)) particle.age = Math.random() * particle.maxAge + if (respawn(particle, currentViewer)) {particle.age = Math.random() * particle.maxAge} particles.push(particle) } } function resizeCanvas(): void { - if (!canvas) return + if (!canvas) {return} const dpr = Math.min(2, window.devicePixelRatio || 1) - if (cssWidth === canvas.clientWidth && cssHeight === canvas.clientHeight && pixelRatio === dpr) return + if (cssWidth === canvas.clientWidth && cssHeight === canvas.clientHeight && pixelRatio === dpr) {return} cssWidth = canvas.clientWidth cssHeight = canvas.clientHeight pixelRatio = dpr @@ -231,7 +231,7 @@ export function WindParticles({ viewer }: WindParticlesProps) { const last = particle.trail[particle.trail.length - 1] if (!last || Cesium.Cartesian3.distance(last, particle.position) >= metersPerPixel * TRAIL_SAMPLE_PIXELS) { const recycled = particle.trail.length >= TRAIL_MAX_POINTS ? particle.trail.shift() : undefined - if (recycled) particle.trailScreens.splice(0, 2) + if (recycled) {particle.trailScreens.splice(0, 2)} particle.trail.push(Cesium.Cartesian3.clone(particle.position, recycled)) if (projectToScreen(particle.position, currentViewer, scratchTrail)) { particle.trailScreens.push(scratchTrail.x, scratchTrail.y) @@ -245,8 +245,8 @@ export function WindParticles({ viewer }: WindParticlesProps) { const screens = particle.trailScreens screens.length = 0 for (const point of particle.trail) { - if (projectToScreen(point, currentViewer, scratchTrail)) screens.push(scratchTrail.x, scratchTrail.y) - else screens.push(Number.NaN, Number.NaN) + if (projectToScreen(point, currentViewer, scratchTrail)) {screens.push(scratchTrail.x, scratchTrail.y)} + else {screens.push(Number.NaN, Number.NaN)} } } @@ -258,7 +258,7 @@ export function WindParticles({ viewer }: WindParticlesProps) { currentViewer.scene.globe.ellipsoid, scratchPosition ) - if (!center) return 0 + if (!center) {return 0} Cesium.Cartesian3.clone(center, particleBounds.center) const value = currentViewer.camera.getPixelSize(particleBounds, cssWidth, cssHeight) return Number.isFinite(value) && value > 0 ? value : 0 @@ -274,10 +274,10 @@ export function WindParticles({ viewer }: WindParticlesProps) { for (let i = screens.length - 2; i >= 0 && remaining > 0; i -= 2) { const trailX = screens[i] const trailY = screens[i + 1] - if (!Number.isFinite(trailX) || !Number.isFinite(trailY)) break + if (!Number.isFinite(trailX) || !Number.isFinite(trailY)) {break} const distance = Math.hypot(trailX - x, trailY - y) - if (distance < 0.01) continue - if (distance > Math.max(cssWidth, cssHeight) * 0.5) break + if (distance < 0.01) {continue} + if (distance > Math.max(cssWidth, cssHeight) * 0.5) {break} const ratio = Math.min(1, remaining / distance) x += (trailX - x) * ratio y += (trailY - y) * ratio @@ -291,7 +291,7 @@ export function WindParticles({ viewer }: WindParticlesProps) { function frame(): void { const currentViewer = activeViewer const ctx = context - if (!currentViewer || currentViewer.isDestroyed() || !ctx || !cssWidth || !cssHeight) return + if (!currentViewer || currentViewer.isDestroyed() || !ctx || !cssWidth || !cssHeight) {return} if (document.hidden) { lastTime = 0 return @@ -310,7 +310,7 @@ export function WindParticles({ viewer }: WindParticlesProps) { !Cesium.Matrix4.equals(previousView, currentViewer.camera.viewMatrix) || !Cesium.Matrix4.equals(previousProjection, currentViewer.camera.frustum.projectionMatrix) if (viewMoved) { - for (const particle of particles) particle.trailScreens.length = 0 + for (const particle of particles) {particle.trailScreens.length = 0} trailsStale = true reprojectIndex = 0 } @@ -322,27 +322,27 @@ export function WindParticles({ viewer }: WindParticlesProps) { reprojectIndex += 1 remaining -= 1 } - if (reprojectIndex >= particles.length) trailsStale = false + if (reprojectIndex >= particles.length) {trailsStale = false} } const metersPerPixel = frameMetersPerPixel(currentViewer) - for (const bin of trailBins) bin.length = 0 - for (const bin of headBins) bin.length = 0 + for (const bin of trailBins) {bin.length = 0} + for (const bin of headBins) {bin.length = 0} const month = useClimateStore.getState().month for (const particle of particles) { particle.age += dt if ( particle.age > particle.maxAge || - !particle.trail.length || + particle.trail.length === 0 || !projectToScreen(particle.position, currentViewer, scratchHead) || !isOnscreen(scratchHead) ) { - if (!respawn(particle, currentViewer)) continue + if (!respawn(particle, currentViewer)) {continue} } const wind = sampleWind(particle.lon, particle.lat, month) const speed = Math.hypot(wind.u, wind.v) - if (metersPerPixel > 0) advanceParticle(particle, currentViewer, dt, wind.u, wind.v, metersPerPixel) - if (!projectToScreen(particle.position, currentViewer, scratchHead) || !isOnscreen(scratchHead)) continue + if (metersPerPixel > 0) {advanceParticle(particle, currentViewer, dt, wind.u, wind.v, metersPerPixel)} + if (!projectToScreen(particle.position, currentViewer, scratchHead) || !isOnscreen(scratchHead)) {continue} const bin = Math.min(COLOR_BINS - 1, Math.floor((speed / WIND_RAMP_MAX_SPEED) * COLOR_BINS)) collectTrail(particle, bin) } @@ -356,8 +356,8 @@ export function WindParticles({ viewer }: WindParticlesProps) { ctx.beginPath() let drawing = false for (let i = 0; i < segments.length; i += 2) { - if (Number.isNaN(segments[i])) drawing = false - else if (drawing) ctx.lineTo(segments[i], segments[i + 1]) + if (Number.isNaN(segments[i])) {drawing = false} + else if (drawing) {ctx.lineTo(segments[i], segments[i + 1])} else { ctx.moveTo(segments[i], segments[i + 1]) drawing = true @@ -383,8 +383,8 @@ export function WindParticles({ viewer }: WindParticlesProps) { function animate(now: number): void { animationFrame = 0 - if (document.hidden || !activeViewer || activeViewer.isDestroyed()) return - if (!lastTime || now - lastTime >= 1000 / 60) frame() + if (document.hidden || !activeViewer || activeViewer.isDestroyed()) {return} + if (!lastTime || now - lastTime >= 1000 / 60) {frame()} animationFrame = requestAnimationFrame(animate) } diff --git a/src/renderer/src/components/WindowControls.tsx b/src/renderer/src/components/WindowControls.tsx index 928dd9a..f7bda64 100644 --- a/src/renderer/src/components/WindowControls.tsx +++ b/src/renderer/src/components/WindowControls.tsx @@ -32,13 +32,13 @@ export function WindowControls() { useEffect(() => { const api = window.guEarth?.windowControls - if (!api) return + if (!api) {return} let active = true void api.getState().then((initial) => { - if (active) setState(initial) + if (active) {setState(initial)} }) const unsubscribe = api.onStateChange((next) => { - if (active) setState(next) + if (active) {setState(next)} }) return () => { active = false @@ -47,14 +47,14 @@ export function WindowControls() { }, []) useEffect(() => { - if (typeof document === 'undefined') return + if (typeof document === 'undefined') {return} document.documentElement.dataset.fullscreen = state.fullScreen ? 'true' : 'false' return () => { delete document.documentElement.dataset.fullscreen } }, [state.fullScreen]) - if (!window.guEarth?.windowControls) return null + if (!window.guEarth?.windowControls) {return null} const isMac = state.platform === 'darwin' const expanded = state.maximized || state.fullScreen diff --git a/src/renderer/src/components/YearTimeline.tsx b/src/renderer/src/components/YearTimeline.tsx index 431f161..fffc832 100644 --- a/src/renderer/src/components/YearTimeline.tsx +++ b/src/renderer/src/components/YearTimeline.tsx @@ -23,11 +23,11 @@ export function YearTimeline(_props: YearTimelineProps) { const advance = useTransportStore((state) => state.advance) useVisibleAnimation(isPlaying, (dt) => { - if (dt > 0) advance(dt) + if (dt > 0) {advance(dt)} }) const displayYear = Math.floor(year) - const mileageText = `约 ${(hsrMileageAt(displayYear) / 10000).toFixed(2)} 万公里` + const mileageText = `约 ${(hsrMileageAt(displayYear) / 10_000).toFixed(2)} 万公里` return (
diff --git a/src/renderer/src/components/ZonationFlightHud.tsx b/src/renderer/src/components/ZonationFlightHud.tsx index 308a746..8d013f2 100644 --- a/src/renderer/src/components/ZonationFlightHud.tsx +++ b/src/renderer/src/components/ZonationFlightHud.tsx @@ -1,5 +1,6 @@ import { Button, Progress } from '@renderer/components/ui' -import { useZonationStore, type ZonationFlightStage } from '@renderer/stores/zonation' +import { useZonationStore } from '@renderer/stores/zonation'; +import type { ZonationFlightStage } from '@renderer/stores/zonation'; import { cancelTransectFlight } from '@renderer/composables/useTransectFlight' import styles from './ZonationFlightHud.module.css' @@ -14,7 +15,7 @@ const stageText: Record = { export function ZonationFlightHud(_props: ZonationFlightHudProps) { const flightHud = useZonationStore((state) => state.flightHud) - if (!flightHud) return null + if (!flightHud) {return null} const percent = flightHud.total > 0 ? Math.min(100, Math.round((flightHud.completed / flightHud.total) * 100)) : 0 diff --git a/src/renderer/src/components/ZonationPanel.tsx b/src/renderer/src/components/ZonationPanel.tsx index ff05083..4262c15 100644 --- a/src/renderer/src/components/ZonationPanel.tsx +++ b/src/renderer/src/components/ZonationPanel.tsx @@ -2,14 +2,8 @@ import { useCallback, useEffect, useMemo, useRef, useState } from 'react' import * as Cesium from 'cesium' import { Loader2Icon, XIcon } from 'lucide-react' import { Alert, Button, Select } from '@renderer/components/ui' -import { - mountainById, - snowlineM, - zonationMountains, - zonationPrinciples, - type ZonationMountain, - type ZonationSlope -} from '@renderer/thematic/mountainZonation' +import { mountainById, snowlineM, zonationMountains, zonationPrinciples } from '@renderer/thematic/mountainZonation'; +import type { ZonationMountain, ZonationSlope } from '@renderer/thematic/mountainZonation'; import { greatCircleKm } from '@renderer/lib/transect' import { cancelTransectFlight, @@ -47,7 +41,7 @@ function spectrumY(mountain: ZonationMountain, elevationM: number): number { export function ZonationPanel({ viewer, onClose }: ZonationPanelProps) { const [activeId, setActiveId] = useState(zonationMountains[0].id) - const [profile, setProfile] = useState>([]) + const [profile, setProfile] = useState<[number, number][]>([]) const [sampling, setSampling] = useState(false) const [degraded, setDegraded] = useState(false) const [flying, setFlying] = useState(false) @@ -80,7 +74,7 @@ export function ZonationPanel({ viewer, onClose }: ZonationPanelProps) { clipId: `zonation-clip-${active.id}-${index}`, triangle: `M ${cx - halfW} ${SPECTRUM_BASE_Y} L ${cx} ${SPECTRUM_TOP_Y} L ${cx + halfW} ${SPECTRUM_BASE_Y} Z`, belts, - snowY: snow !== undefined ? spectrumY(active, snow) : undefined + snowY: snow === undefined ? undefined : spectrumY(active, snow) } }) }, [active]) @@ -93,7 +87,7 @@ export function ZonationPanel({ viewer, onClose }: ZonationPanelProps) { PROFILE_TOP + (1 - elevationM / elevMax) * (PROFILE_H - PROFILE_TOP - PROFILE_BOTTOM) let summit: { x: number; y: number; elevationM: number } | undefined for (const [km, elevationM] of profile) { - if (!summit || elevationM > summit.elevationM) summit = { x: toX(km), y: toY(elevationM), elevationM } + if (!summit || elevationM > summit.elevationM) {summit = { x: toX(km), y: toY(elevationM), elevationM }} } const stripeSlope = active.slopes[0] const snow = snowlineM(stripeSlope) @@ -105,7 +99,7 @@ export function ZonationPanel({ viewer, onClose }: ZonationPanelProps) { y: toY(belt.toM), height: Math.max(1, toY(belt.fromM) - toY(belt.toM)) })), - snowY: snow !== undefined ? toY(snow) : undefined, + snowY: snow === undefined ? undefined : toY(snow), summit, baseY: toY(0), peakElevation: summit ? Math.round(summit.elevationM) : active.summitM, @@ -118,7 +112,7 @@ export function ZonationPanel({ viewer, onClose }: ZonationPanelProps) { profileRequestIdRef.current += 1 const requestId = profileRequestIdRef.current setProfile([]) - if (!targetViewer || targetViewer.isDestroyed()) return + if (!targetViewer || targetViewer.isDestroyed()) {return} setSampling(true) setDegraded(false) try { @@ -128,7 +122,7 @@ export function ZonationPanel({ viewer, onClose }: ZonationPanelProps) { undefined, mountain.summitM ) - if (requestId !== profileRequestIdRef.current) return + if (requestId !== profileRequestIdRef.current) {return} setDegraded(sampledDegraded) let distance = 0 setProfile( @@ -141,7 +135,7 @@ export function ZonationPanel({ viewer, onClose }: ZonationPanelProps) { }) ) } finally { - if (requestId === profileRequestIdRef.current) setSampling(false) + if (requestId === profileRequestIdRef.current) {setSampling(false)} } }, [] @@ -180,7 +174,7 @@ export function ZonationPanel({ viewer, onClose }: ZonationPanelProps) { function selectMountain(mountainId: string): void { const mountain = mountainById(mountainId) - if (!mountain) return + if (!mountain) {return} activeIdRef.current = mountain.id setActiveId(mountain.id) setFlightNote('') @@ -188,7 +182,7 @@ export function ZonationPanel({ viewer, onClose }: ZonationPanelProps) { } async function startFlight(): Promise { - if (flying) return + if (flying) {return} if (!viewer || viewer.isDestroyed()) { setFlightNote('地球尚未就绪,稍后再试') return @@ -199,7 +193,7 @@ export function ZonationPanel({ viewer, onClose }: ZonationPanelProps) { const result = await flyTransect(viewer, active.transect, { expectedMaxGroundM: active.summitM, onProgress: ({ stage, completed, total }) => { - if (!mountedRef.current) return + if (!mountedRef.current) {return} if (stage === 'prewarm') { setFlightNote(`飞行准备:并发预载沿线影像(画面短暂降暗)${completed}/${total}…`) } else if (stage === 'flying') { @@ -207,7 +201,7 @@ export function ZonationPanel({ viewer, onClose }: ZonationPanelProps) { } } }) - if (!mountedRef.current) return + if (!mountedRef.current) {return} if ('error' in result) { setFlightNote(result.error) } else if (result.status === 'interrupted') { @@ -220,15 +214,15 @@ export function ZonationPanel({ viewer, onClose }: ZonationPanelProps) { setFlightNote(reason) } else { const samplingNote = - result.maxGroundM !== undefined - ? `,沿线最高地表 ${result.maxGroundM} 米${result.degraded ? '(数据不完整,已用安全盲飞高度)' : ''}` - : '' + result.maxGroundM === undefined + ? '' + : `,沿线最高地表 ${result.maxGroundM} 米${result.degraded ? '(数据不完整,已用安全盲飞高度)' : ''}` setFlightNote( `剖面飞行完成:全程约 ${result.totalKm} 千米,最高飞行高度约 ${result.flightAltitudeM} 米${samplingNote}` ) } } finally { - if (mountedRef.current) setFlying(false) + if (mountedRef.current) {setFlying(false)} } } @@ -245,7 +239,7 @@ export function ZonationPanel({ viewer, onClose }: ZonationPanelProps) { options={mountainOptions} aria-label="选择山脉" onChange={(value) => { - if (value) selectMountain(String(value)) + if (value) {selectMountain(String(value))} }} /> diff --git a/src/renderer/src/components/charts/BarChart.tsx b/src/renderer/src/components/charts/BarChart.tsx index 73bde95..fb620b0 100644 --- a/src/renderer/src/components/charts/BarChart.tsx +++ b/src/renderer/src/components/charts/BarChart.tsx @@ -1,5 +1,6 @@ import { useMemo } from 'react' -import { use, type EChartsCoreOption } from 'echarts/core' +import { use } from 'echarts/core'; +import type { EChartsCoreOption } from 'echarts/core'; import { BarChart as EChartsBarChart } from 'echarts/charts' import { GridComponent, LegendComponent, TooltipComponent } from 'echarts/components' import { SVGRenderer } from 'echarts/renderers' @@ -116,7 +117,7 @@ export function BarChart({ textStyle: { color: '#ffffff', fontSize: 12, lineHeight: 20 }, formatter: (params: unknown) => { const list = Array.isArray(params) ? (params as TooltipParam[]) : [params as TooltipParam] - if (!list.length) return '' + if (list.length === 0) {return ''} const rows = list .filter((item) => item && item.seriesName) .map( diff --git a/src/renderer/src/components/charts/EChartBase.tsx b/src/renderer/src/components/charts/EChartBase.tsx index 32a1077..ee6625b 100644 --- a/src/renderer/src/components/charts/EChartBase.tsx +++ b/src/renderer/src/components/charts/EChartBase.tsx @@ -1,5 +1,7 @@ -import { useEffect, useRef, type CSSProperties } from 'react' -import { init, use, type EChartsCoreOption, type EChartsType } from 'echarts/core' +import { useEffect, useRef } from 'react'; +import type { CSSProperties } from 'react'; +import { init, use } from 'echarts/core'; +import type { EChartsCoreOption, EChartsType } from 'echarts/core'; import { SVGRenderer } from 'echarts/renderers' use([SVGRenderer]) @@ -17,7 +19,7 @@ export function EChartBase({ option, className, style, notMerge = true }: EChart useEffect(() => { const element = containerRef.current - if (!element) return + if (!element) {return} const chart = init(element, undefined, { renderer: 'svg' }) chartRef.current = chart const observer = new ResizeObserver(() => { diff --git a/src/renderer/src/components/charts/LineChart.tsx b/src/renderer/src/components/charts/LineChart.tsx index 7dd149f..bcaca1c 100644 --- a/src/renderer/src/components/charts/LineChart.tsx +++ b/src/renderer/src/components/charts/LineChart.tsx @@ -1,5 +1,6 @@ import { useMemo } from 'react' -import { use, type EChartsCoreOption } from 'echarts/core' +import { use } from 'echarts/core'; +import type { EChartsCoreOption } from 'echarts/core'; import { LineChart as EChartsLineChart } from 'echarts/charts' import { GridComponent, MarkLineComponent, TooltipComponent } from 'echarts/components' import { SVGRenderer } from 'echarts/renderers' @@ -12,7 +13,7 @@ use([EChartsLineChart, GridComponent, TooltipComponent, MarkLineComponent, SVGRe export interface ChartSeries { name: string color: string - points: Array<[number, number]> + points: [number, number][] dashed?: boolean markY?: number[] } @@ -69,7 +70,7 @@ export function LineChart({ textStyle: { color: '#ffffff', fontSize: 12, lineHeight: 20 }, formatter: (params: unknown) => { const list = Array.isArray(params) ? (params as TooltipParam[]) : [] - if (!list.length) return '' + if (list.length === 0) {return ''} const head = xFormatter ? xFormatter(list[0].value[0]) : String(list[0].value[0]) const rows = list .map((item) => `${item.marker}${item.seriesName} ${Math.round(item.value[1] * 10) / 10}`) diff --git a/src/renderer/src/components/eoq/EoqComposer.tsx b/src/renderer/src/components/eoq/EoqComposer.tsx index de07469..4d310d7 100644 --- a/src/renderer/src/components/eoq/EoqComposer.tsx +++ b/src/renderer/src/components/eoq/EoqComposer.tsx @@ -1,7 +1,10 @@ -import { useCallback, useEffect, useMemo, useRef, useState, type KeyboardEvent } from 'react' +import { useCallback, useEffect, useMemo, useRef, useState } from 'react'; +import type { KeyboardEvent } from 'react'; import { AuiIf, ComposerPrimitive, useAui, useAuiState } from '@assistant-ui/react' -import { ArrowUpIcon, ChevronUpIcon, SquareIcon, type LucideIcon } from 'lucide-react' -import { DropdownMenu, type DropdownMenuEntry } from '@renderer/components/ui' +import { ArrowUpIcon, ChevronUpIcon, SquareIcon } from 'lucide-react'; +import type { LucideIcon } from 'lucide-react'; +import { DropdownMenu } from '@renderer/components/ui'; +import type { DropdownMenuEntry } from '@renderer/components/ui'; import { useAiStore } from '@renderer/stores/ai' import type { AiModelConfig, AiProviderConfig } from '../../../../preload' import { cn } from '@renderer/lib/utils' @@ -78,8 +81,8 @@ export function EoqComposer({ commands }: EoqComposerProps) { const handleKeyDown = useCallback( (event: KeyboardEvent) => { - if (event.nativeEvent.isComposing || event.keyCode === 229) return - if (!commandMenuOpen || filteredCommands.length === 0) return + if (event.nativeEvent.isComposing || event.keyCode === 229) {return} + if (!commandMenuOpen || filteredCommands.length === 0) {return} if (event.key === 'ArrowDown' || event.key === 'ArrowUp') { const offset = event.key === 'ArrowDown' ? 1 : -1 @@ -128,7 +131,7 @@ export function EoqComposer({ commands }: EoqComposerProps) { const handleModelSelect = useCallback( (choice: string) => { const separatorIndex = choice.indexOf(':') - if (separatorIndex < 0) return + if (separatorIndex === -1) {return} setModelMenuOpen(false) void setActiveModel(choice.slice(0, separatorIndex), choice.slice(separatorIndex + 1)) }, @@ -209,7 +212,7 @@ export function EoqComposer({ commands }: EoqComposerProps) {
{ - if (event.target === event.currentTarget) inputRef.current?.focus() + if (event.target === event.currentTarget) {inputRef.current?.focus()} }} className="flex cursor-text flex-col gap-2 rounded-2xl border border-border-strong bg-elevated px-3 pt-2.5 pb-2 transition-[border-color,box-shadow] duration-200 hover:border-ink/25 focus-within:border-ring focus-within:ring-2 focus-within:ring-ring/12 motion-reduce:transition-none" > diff --git a/src/renderer/src/components/eoq/EoqIconButton.tsx b/src/renderer/src/components/eoq/EoqIconButton.tsx index 6868c27..fafa443 100644 --- a/src/renderer/src/components/eoq/EoqIconButton.tsx +++ b/src/renderer/src/components/eoq/EoqIconButton.tsx @@ -1,5 +1,7 @@ -import { forwardRef, type ButtonHTMLAttributes } from 'react' -import { cva, type VariantProps } from 'class-variance-authority' +import { forwardRef } from 'react'; +import type { ButtonHTMLAttributes } from 'react'; +import { cva } from 'class-variance-authority'; +import type { VariantProps } from 'class-variance-authority'; import { Tooltip } from '@renderer/components/ui' import { cn } from '@renderer/lib/utils' @@ -37,7 +39,7 @@ export interface EoqIconButtonProps } export const EoqIconButton = forwardRef( - function EoqIconButton( + ( { tooltip, tooltipPlacement = 'top', @@ -49,7 +51,7 @@ export const EoqIconButton = forwardRef( ...props }, ref - ) { + ) => { const button = (
@@ -322,7 +318,7 @@ export function LaboratorySettings({ active, onBusyChange }: LaboratorySettingsP options={PROVIDER_OPTIONS} aria-label="数据源平台" onChange={(value) => { - if (value) setDraft((prev) => ({ ...prev, provider: value })) + if (value) {setDraft((prev) => ({ ...prev, provider: value }))} }} />
diff --git a/src/renderer/src/components/settings/MapSettings.tsx b/src/renderer/src/components/settings/MapSettings.tsx index 4d60104..a9ffa6a 100644 --- a/src/renderer/src/components/settings/MapSettings.tsx +++ b/src/renderer/src/components/settings/MapSettings.tsx @@ -2,17 +2,12 @@ import { useEffect, useMemo, useState } from 'react' import { SaveIcon, Trash2Icon } from 'lucide-react' import { Alert, Button, PasswordInput, Input, Segmented, Select, Switch, Tag, useToast } from '@renderer/components/ui' import { credentialOnlyProviders, providerCatalog, useGlobeStore } from '@renderer/stores/globe' -import { networkProxyMode, normalizeNetworkProxy, type NetworkProxyMode } from '../../../../common/networkProxy' -import { - mirrorEndpointLabel, - mirrorEndpointShortLabel, - type MirrorEndpointPreference -} from '../../../../common/tileMirror' -import { - normalizeTouchInteractionMode, - touchInteractionModes, - type TouchInteractionMode -} from '../../../../common/touchInteraction' +import { networkProxyMode, normalizeNetworkProxy } from '../../../../common/networkProxy'; +import type { NetworkProxyMode } from '../../../../common/networkProxy'; +import { mirrorEndpointLabel, mirrorEndpointShortLabel } from '../../../../common/tileMirror'; +import type { MirrorEndpointPreference } from '../../../../common/tileMirror'; +import { normalizeTouchInteractionMode, touchInteractionModes } from '../../../../common/touchInteraction'; +import type { TouchInteractionMode } from '../../../../common/touchInteraction'; import styles from './MapSettings.module.css' export interface MapSettingsProps {} @@ -36,13 +31,13 @@ const touchInteractionModeOptions = touchInteractionModes.map((mode) => ({ label: touchInteractionModeLabels[mode] })) -const proxyModeOptions: Array<{ value: NetworkProxyMode; label: string }> = [ +const proxyModeOptions: { value: NetworkProxyMode; label: string }[] = [ { value: 'system', label: '跟随系统' }, { value: 'direct', label: '直连' }, { value: 'custom', label: '自定义' } ] -const mirrorSourceOptions: Array<{ value: MirrorEndpointPreference; label: string }> = [ +const mirrorSourceOptions: { value: MirrorEndpointPreference; label: string }[] = [ { value: 'auto', label: '自动匹配' }, { value: 'edgeone', label: 'EdgeOne' }, { value: 'cloudflare', label: 'Cloudflare' } @@ -84,13 +79,13 @@ export function MapSettings(_props: MapSettingsProps) { const [proxyTestResult, setProxyTestResult] = useState<{ ok: boolean; text: string } | null>(null) useEffect(() => { - if (typeof window.guEarth?.tiles?.getMirrorStatus !== 'function') return + if (typeof window.guEarth?.tiles?.getMirrorStatus !== 'function') {return} void window.guEarth.tiles .getMirrorStatus() .then((status) => { applyTileMirrorStatus(status) }) - .catch(() => undefined) + .catch(() => {}) }, [applyTileMirrorStatus]) useEffect(() => { @@ -164,14 +159,14 @@ export function MapSettings(_props: MapSettingsProps) { const proxyApplyEnabled = normalizedProxyDraft !== '' && normalizedProxyDraft !== networkProxy function handleCredentialProviderChange(nextId: string | undefined): void { - if (!nextId) return + if (!nextId) {return} setCredentialProviderId(nextId) setCredentialDraft('') setCredentialSkDraft('') } async function reprobeMirrorEndpoints(): Promise { - if (mirrorProbingEndpoints || typeof window.guEarth?.tiles?.probeMirrorEndpoints !== 'function') return + if (mirrorProbingEndpoints || typeof window.guEarth?.tiles?.probeMirrorEndpoints !== 'function') {return} try { const status = await window.guEarth.tiles.probeMirrorEndpoints() applyTileMirrorStatus(status) @@ -193,7 +188,7 @@ export function MapSettings(_props: MapSettingsProps) { } async function retryTileMirror(): Promise { - if (typeof window.guEarth?.tiles?.resetMirrorFallback !== 'function') return + if (typeof window.guEarth?.tiles?.resetMirrorFallback !== 'function') {return} try { const status = await window.guEarth.tiles.resetMirrorFallback() applyTileMirrorStatus(status) @@ -215,7 +210,7 @@ export function MapSettings(_props: MapSettingsProps) { const id = credentialProviderId const value = credentialDraft.trim() const sk = credentialSkDraft.trim() - if (!id || !value || (requiresSecurityKey && !sk)) return + if (!id || !value || (requiresSecurityKey && !sk)) {return} const touchesSecurityKey = sk !== '' || id === 'amap' try { const status = await window.guEarth.settings.setProviderApiKey(id, value) @@ -242,7 +237,7 @@ export function MapSettings(_props: MapSettingsProps) { async function clearCredential(): Promise { const id = credentialProviderId - if (!id) return + if (!id) {return} try { const status = await window.guEarth.settings.clearProviderApiKey(id) setCredentialStatus(id, status) @@ -266,12 +261,12 @@ export function MapSettings(_props: MapSettingsProps) { } function applyProxy(): void { - if (!proxyApplyEnabled) return + if (!proxyApplyEnabled) {return} setNetworkProxy(normalizedProxyDraft) } async function testProxy(): Promise { - if (proxyTesting) return + if (proxyTesting) {return} if (proxyModeView === 'custom' && normalizedProxyDraft === '') { setProxyTestResult({ ok: false, text: '请输入有效的代理地址' }) return diff --git a/src/renderer/src/components/settings/PrivacySettings.tsx b/src/renderer/src/components/settings/PrivacySettings.tsx index 1f894cd..8552237 100644 --- a/src/renderer/src/components/settings/PrivacySettings.tsx +++ b/src/renderer/src/components/settings/PrivacySettings.tsx @@ -1,6 +1,7 @@ import { useEffect, useState } from 'react' import { Button, Modal, Switch, Tag, useToast } from '@renderer/components/ui' -import { PRIVACY_DISCLOSURES, privacyDisclosureFor, type PrivacySettingKey } from '../../../../common/privacy' +import { PRIVACY_DISCLOSURES, privacyDisclosureFor } from '../../../../common/privacy'; +import type { PrivacySettingKey } from '../../../../common/privacy'; import { usePrivacyStore } from '@renderer/stores/privacy' import styles from './PrivacySettings.module.css' @@ -26,13 +27,13 @@ export function PrivacySettings(_props: PrivacySettingsProps) { }, [hydrate]) function isEnabled(key: PrivacySettingKey): boolean { - if (key === 'errorReportingEnabled') return errorReportingEnabled - if (key === 'telemetryEnabled') return telemetryEnabled + if (key === 'errorReportingEnabled') {return errorReportingEnabled} + if (key === 'telemetryEnabled') {return telemetryEnabled} return aiTelemetryEnabled } async function handleSwitchChange(key: PrivacySettingKey, checked: boolean): Promise { - if (!hydrated || savingKey || confirmLoading) return + if (!hydrated || savingKey || confirmLoading) {return} if (checked) { setPendingKey(key) return @@ -40,21 +41,21 @@ export function PrivacySettings(_props: PrivacySettingsProps) { setSavingKey(key) try { const saved = await setPrivacySetting(key, false) - if (saved) toast.success(`已关闭“${privacyDisclosureFor(key).title}”`) - else toast.error('隐私设置保存失败,请重试') + if (saved) {toast.success(`已关闭“${privacyDisclosureFor(key).title}”`)} + else {toast.error('隐私设置保存失败,请重试')} } finally { setSavingKey(null) } } function cancelEnable(): void { - if (confirmLoading) return + if (confirmLoading) {return} setPendingKey(null) } async function confirmEnable(): Promise { const key = pendingKey - if (!key || confirmLoading) return + if (!key || confirmLoading) {return} setConfirmLoading(true) try { const saved = await setPrivacySetting(key, true) diff --git a/src/renderer/src/components/settings/UnsavedChangesBar.tsx b/src/renderer/src/components/settings/UnsavedChangesBar.tsx index 1d7d385..c05c9ef 100644 --- a/src/renderer/src/components/settings/UnsavedChangesBar.tsx +++ b/src/renderer/src/components/settings/UnsavedChangesBar.tsx @@ -29,7 +29,7 @@ export function UnsavedChangesBar({ open, saving, onSave, onDiscard }: UnsavedCh return () => clearTimeout(timer) }, [open]) - if (!rendered) return null + if (!rendered) {return null} return (
{ - if (!open) setRendered(false) + if (!open) {setRendered(false)} }} >