commit 221edcda16562554506bbd0e82b7df71b4ae4a3a Author: Denozordec Date: Tue Mar 17 23:19:28 2026 +0700 init commit diff --git a/.cursor/rules/frontend-conventions.mdc b/.cursor/rules/frontend-conventions.mdc new file mode 100644 index 0000000..018d01b --- /dev/null +++ b/.cursor/rules/frontend-conventions.mdc @@ -0,0 +1,23 @@ +--- +description: Паттерны для React, api, utils +globs: src/**/*.{js,jsx} +alwaysApply: false +--- + +# Frontend conventions + +## React + +- Функциональные компоненты +- Страницы в `pages/`, общие компоненты в `components/` +- Данные загружаются в App.jsx через `loadDataSet()`, передаются в страницы как `db` и `actions` + +## API + +- `src/lib/api.js` — fetchApi, loadDataSet, createRecord, updateRecord, deleteRecord +- Коллекции: vps, providers, providerAccounts, payments, balanceLedger, settings +- Дополнительно: syncAccount, fetchAccountBalance, testApiConnection + +## Utils + +- `src/lib/utils.js` — форматирование (formatCurrency), конвертация валют, лейблы (paymentTypeLabel), CSV diff --git a/.cursor/rules/project-structure.mdc b/.cursor/rules/project-structure.mdc new file mode 100644 index 0000000..7476e82 --- /dev/null +++ b/.cursor/rules/project-structure.mdc @@ -0,0 +1,26 @@ +--- +description: Структура проекта vps-tracker и соглашения по именованию +alwaysApply: true +--- + +# Структура проекта vps-tracker + +## Папки + +- `server/` — Express backend, SQLite (sql.js) +- `src/` — React frontend (Vite) +- `server/adapters/` — один адаптер на провайдера API (billmanager) +- `server/routes/` — Express роутеры по сущностям +- `server/db/` — схема, миграции, seed + +## Именование + +- Файлы: kebab-case (provider-accounts.js, row-mappers.js) +- Роуты: `/api/vps`, `/api/provider-accounts`, `/api/sync/:accountId` +- ID записей: `vps-bm-{accountId}-{externalId}`, `pay-bm-{accountId}-{externalId}` + +## Barrel exports + +Модули с несколькими файлами экспортируют через `index.js`: +- `server/adapters/billmanager/index.js` — testConnection, syncFromBillmanager, fetchDashboardInfo +- `server/db/index.js` — initDb, getDb, saveDb diff --git a/.cursor/rules/server-conventions.mdc b/.cursor/rules/server-conventions.mdc new file mode 100644 index 0000000..7c7757c --- /dev/null +++ b/.cursor/rules/server-conventions.mdc @@ -0,0 +1,25 @@ +--- +description: Паттерны для Express, db, adapters +globs: server/**/*.js +alwaysApply: false +--- + +# Server conventions + +## Express + +- Роутеры в `routes/`, подключаются в `index.js` через `app.use('/api/...', router)` +- Ошибки: `res.status(500).json({ error: err.message })` +- 404: `res.status(404).json({ error: 'Not found' })` + +## Database + +- Доступ через `getDb()` — обёртка с `prepare().all()`, `prepare().get()`, `run()` +- После `run()` вызывается `saveDb()` автоматически +- Миграции в `db/migrations.js`, добавляют колонки через ALTER TABLE + +## Adapters + +- Один провайдер = папка в `adapters/` (billmanager) +- Разделение: client (HTTP), parsers, mappers, operations, sync +- Публичный API через `index.js` diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..5414092 --- /dev/null +++ b/.gitignore @@ -0,0 +1,25 @@ +# Logs +logs +*.log +npm-debug.log* +yarn-debug.log* +yarn-error.log* +pnpm-debug.log* +lerna-debug.log* + +node_modules +dist +data +dist-ssr +*.local + +# Editor directories and files +.vscode/* +!.vscode/extensions.json +.idea +.DS_Store +*.suo +*.ntvs* +*.njsproj +*.sln +*.sw? diff --git a/AGENTS.md b/AGENTS.md new file mode 100644 index 0000000..a029311 --- /dev/null +++ b/AGENTS.md @@ -0,0 +1,62 @@ +# VPS Tracker — Руководство для ИИ + +## Описание проекта + +VPS Tracker — приложение для учёта виртуальных серверов (VPS), провайдеров, аккаунтов, платежей и балансов. Поддерживает синхронизацию с BILLmanager 6 API. + +## Структура проекта + +``` +vps-tracker/ +├── server/ # Express backend +│ ├── index.js # Точка входа, подключение роутов +│ ├── db/ # База данных (SQLite via sql.js) +│ │ ├── schema.js # CREATE TABLE +│ │ ├── migrations.js # Миграции схемы +│ │ ├── seed.js # Начальные данные из public/data +│ │ └── index.js # initDb, getDb, saveDb +│ ├── adapters/ # Интеграции с внешними API +│ │ └── billmanager/ # BILLmanager 6 API +│ │ ├── client.js # HTTP-запросы +│ │ ├── parsers.js # Парсинг ответов API +│ │ ├── mappers.js # Маппинг в модель vps-tracker +│ │ ├── operations.js # fetchVds, fetchPayments и т.д. +│ │ ├── sync.js # syncFromBillmanager +│ │ └── index.js # Barrel export +│ ├── routes/ # Express роутеры +│ ├── utils/ # row-mappers и др. +│ └── sync-scheduler.js # Планировщик синка +├── src/ # React frontend (Vite) +│ ├── pages/ # Страницы приложения +│ ├── components/ # UI-компоненты +│ └── lib/ # api.js, utils.js +└── public/data/ # JSON для seed (providers, vps, payments...) +``` + +## Основные сущности + +| Сущность | Описание | +|----------|----------| +| **providers** | Хостинг-провайдеры (Selectel, Firstbyte и т.д.) | +| **provider_accounts** | Аккаунты у провайдера, могут иметь apiType=billmanager для синка | +| **vps** | Виртуальные серверы (ip, ram, disk, tariffType, paidUntil) | +| **payments** | Платежи (пополнение баланса, оплата VPS) | +| **balance_ledger** | Движения по балансу | +| **active_tariffs** | Тарифы, загруженные из BILLmanager vds.order | +| **settings** | Настройки приложения (baseCurrency, ratesUrl, syncEnabled) | + +## Где искать код по доменам + +- **Sync (BILLmanager)** — `server/adapters/billmanager/`, `server/routes/sync.js`, `server/sync-scheduler.js` +- **Тарифы** — `server/adapters/billmanager/operations.js` (fetchVdsOrderPricelist), `server/adapters/billmanager/sync.js` +- **VPS CRUD** — `server/routes/vps.js` +- **Платежи/баланс** — `server/routes/payments.js`, `server/routes/balance-ledger.js` +- **Курсы валют** — `src/lib/utils.js` (convertCurrency, formatInBaseCurrency), настройки в settings.ratesUrl + +## BILLmanager API + +- [Guide to ISPsystem API](https://www.ispsystem.com/docs/b6c/developer-section/working-with-api/guide-to-ispsystem-software-api) +- [VDS API](https://www.ispsystem.com/docs/b6c/developer-section/billmanager-api/virtual-private-servers-vds) +- [Payments API](https://www.ispsystem.com/docs/b6c/developer-section/billmanager-api/payments-payment) + +Формат запроса: `?authinfo=user:pass&out=bjson&func=vds|payment|dashboard.info|vds.order` diff --git a/README.md b/README.md new file mode 100644 index 0000000..18bc70e --- /dev/null +++ b/README.md @@ -0,0 +1,16 @@ +# React + Vite + +This template provides a minimal setup to get React working in Vite with HMR and some ESLint rules. + +Currently, two official plugins are available: + +- [@vitejs/plugin-react](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react) uses [Babel](https://babeljs.io/) (or [oxc](https://oxc.rs) when used in [rolldown-vite](https://vite.dev/guide/rolldown)) for Fast Refresh +- [@vitejs/plugin-react-swc](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react-swc) uses [SWC](https://swc.rs/) for Fast Refresh + +## React Compiler + +The React Compiler is not enabled on this template because of its impact on dev & build performances. To add it, see [this documentation](https://react.dev/learn/react-compiler/installation). + +## Expanding the ESLint configuration + +If you are developing a production application, we recommend using TypeScript with type-aware lint rules enabled. Check out the [TS template](https://github.com/vitejs/vite/tree/main/packages/create-vite/template-react-ts) for information on how to integrate TypeScript and [`typescript-eslint`](https://typescript-eslint.io) in your project. diff --git a/eslint.config.js b/eslint.config.js new file mode 100644 index 0000000..3b3ddee --- /dev/null +++ b/eslint.config.js @@ -0,0 +1,42 @@ +import js from '@eslint/js' +import globals from 'globals' +import reactHooks from 'eslint-plugin-react-hooks' +import reactRefresh from 'eslint-plugin-react-refresh' +import { defineConfig, globalIgnores } from 'eslint/config' + +export default defineConfig([ + globalIgnores(['dist']), + { + files: ['server/**/*.js'], + extends: [js.configs.recommended], + languageOptions: { + ecmaVersion: 2020, + globals: globals.node, + parserOptions: { ecmaVersion: 'latest', sourceType: 'module' }, + }, + rules: { + 'no-unused-vars': ['error', { argsIgnorePattern: '^_', varsIgnorePattern: '^_' }], + }, + }, + { + files: ['**/*.{js,jsx}'], + ignores: ['server/**/*.js'], + extends: [ + js.configs.recommended, + reactHooks.configs.flat.recommended, + reactRefresh.configs.vite, + ], + languageOptions: { + ecmaVersion: 2020, + globals: globals.browser, + parserOptions: { + ecmaVersion: 'latest', + ecmaFeatures: { jsx: true }, + sourceType: 'module', + }, + }, + rules: { + 'no-unused-vars': ['error', { varsIgnorePattern: '^[A-Z_]' }], + }, + }, +]) diff --git a/index.html b/index.html new file mode 100644 index 0000000..b33e2ef --- /dev/null +++ b/index.html @@ -0,0 +1,13 @@ + + + + + + + vps-tracker + + +
+ + + diff --git a/package-lock.json b/package-lock.json new file mode 100644 index 0000000..a7dd084 --- /dev/null +++ b/package-lock.json @@ -0,0 +1,4185 @@ +{ + "name": "vps-tracker", + "version": "0.0.0", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "name": "vps-tracker", + "version": "0.0.0", + "dependencies": { + "@tabler/core": "^1.4.0", + "@tabler/icons-react": "^3.40.0", + "chart.js": "^4.5.1", + "cors": "^2.8.5", + "express": "^4.21.1", + "react": "^19.2.0", + "react-dom": "^19.2.0", + "react-router-dom": "^7.13.1", + "sql.js": "^1.14.0" + }, + "devDependencies": { + "@eslint/js": "^9.39.1", + "@types/react": "^19.2.7", + "@types/react-dom": "^19.2.3", + "@vitejs/plugin-react": "^5.1.1", + "concurrently": "^9.1.0", + "eslint": "^9.39.1", + "eslint-plugin-react-hooks": "^7.0.1", + "eslint-plugin-react-refresh": "^0.4.24", + "globals": "^16.5.0", + "vite": "^7.3.1" + } + }, + "node_modules/@babel/code-frame": { + "version": "7.29.0", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.29.0.tgz", + "integrity": "sha512-9NhCeYjq9+3uxgdtp20LSiJXJvN0FeCtNGpJxuMFZ1Kv3cWUNb6DOhJwUvcVCzKGR66cw4njwM6hrJLqgOwbcw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-validator-identifier": "^7.28.5", + "js-tokens": "^4.0.0", + "picocolors": "^1.1.1" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/compat-data": { + "version": "7.29.0", + "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.29.0.tgz", + "integrity": "sha512-T1NCJqT/j9+cn8fvkt7jtwbLBfLC/1y1c7NtCeXFRgzGTsafi68MRv8yzkYSapBnFA6L3U2VSc02ciDzoAJhJg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/core": { + "version": "7.29.0", + "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.29.0.tgz", + "integrity": "sha512-CGOfOJqWjg2qW/Mb6zNsDm+u5vFQ8DxXfbM09z69p5Z6+mE1ikP2jUXw+j42Pf1XTYED2Rni5f95npYeuwMDQA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/code-frame": "^7.29.0", + "@babel/generator": "^7.29.0", + "@babel/helper-compilation-targets": "^7.28.6", + "@babel/helper-module-transforms": "^7.28.6", + "@babel/helpers": "^7.28.6", + "@babel/parser": "^7.29.0", + "@babel/template": "^7.28.6", + "@babel/traverse": "^7.29.0", + "@babel/types": "^7.29.0", + "@jridgewell/remapping": "^2.3.5", + "convert-source-map": "^2.0.0", + "debug": "^4.1.0", + "gensync": "^1.0.0-beta.2", + "json5": "^2.2.3", + "semver": "^6.3.1" + }, + "engines": { + "node": ">=6.9.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/babel" + } + }, + "node_modules/@babel/generator": { + "version": "7.29.1", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.29.1.tgz", + "integrity": "sha512-qsaF+9Qcm2Qv8SRIMMscAvG4O3lJ0F1GuMo5HR/Bp02LopNgnZBC/EkbevHFeGs4ls/oPz9v+Bsmzbkbe+0dUw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/parser": "^7.29.0", + "@babel/types": "^7.29.0", + "@jridgewell/gen-mapping": "^0.3.12", + "@jridgewell/trace-mapping": "^0.3.28", + "jsesc": "^3.0.2" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-compilation-targets": { + "version": "7.28.6", + "resolved": "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.28.6.tgz", + "integrity": "sha512-JYtls3hqi15fcx5GaSNL7SCTJ2MNmjrkHXg4FSpOA/grxK8KwyZ5bubHsCq8FXCkua6xhuaaBit+3b7+VZRfcA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/compat-data": "^7.28.6", + "@babel/helper-validator-option": "^7.27.1", + "browserslist": "^4.24.0", + "lru-cache": "^5.1.1", + "semver": "^6.3.1" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-globals": { + "version": "7.28.0", + "resolved": "https://registry.npmjs.org/@babel/helper-globals/-/helper-globals-7.28.0.tgz", + "integrity": "sha512-+W6cISkXFa1jXsDEdYA8HeevQT/FULhxzR99pxphltZcVaugps53THCeiWA8SguxxpSp3gKPiuYfSWopkLQ4hw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-module-imports": { + "version": "7.28.6", + "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.28.6.tgz", + "integrity": "sha512-l5XkZK7r7wa9LucGw9LwZyyCUscb4x37JWTPz7swwFE/0FMQAGpiWUZn8u9DzkSBWEcK25jmvubfpw2dnAMdbw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/traverse": "^7.28.6", + "@babel/types": "^7.28.6" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-module-transforms": { + "version": "7.28.6", + "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.28.6.tgz", + "integrity": "sha512-67oXFAYr2cDLDVGLXTEABjdBJZ6drElUSI7WKp70NrpyISso3plG9SAGEF6y7zbha/wOzUByWWTJvEDVNIUGcA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-module-imports": "^7.28.6", + "@babel/helper-validator-identifier": "^7.28.5", + "@babel/traverse": "^7.28.6" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0" + } + }, + "node_modules/@babel/helper-plugin-utils": { + "version": "7.28.6", + "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.28.6.tgz", + "integrity": "sha512-S9gzZ/bz83GRysI7gAD4wPT/AI3uCnY+9xn+Mx/KPs2JwHJIz1W8PZkg2cqyt3RNOBM8ejcXhV6y8Og7ly/Dug==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-string-parser": { + "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.27.1.tgz", + "integrity": "sha512-qMlSxKbpRlAridDExk92nSobyDdpPijUq2DW6oDnUqd0iOGxmQjyqhMIihI9+zv4LPyZdRje2cavWPbCbWm3eA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-validator-identifier": { + "version": "7.28.5", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.28.5.tgz", + "integrity": "sha512-qSs4ifwzKJSV39ucNjsvc6WVHs6b7S03sOh2OcHF9UHfVPqWWALUsNUVzhSBiItjRZoLHx7nIarVjqKVusUZ1Q==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-validator-option": { + "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-option/-/helper-validator-option-7.27.1.tgz", + "integrity": "sha512-YvjJow9FxbhFFKDSuFnVCe2WxXk1zWc22fFePVNEaWJEu8IrZVlda6N0uHwzZrUM1il7NC9Mlp4MaJYbYd9JSg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helpers": { + "version": "7.28.6", + "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.28.6.tgz", + "integrity": "sha512-xOBvwq86HHdB7WUDTfKfT/Vuxh7gElQ+Sfti2Cy6yIWNW05P8iUslOVcZ4/sKbE+/jQaukQAdz/gf3724kYdqw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/template": "^7.28.6", + "@babel/types": "^7.28.6" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/parser": { + "version": "7.29.0", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.29.0.tgz", + "integrity": "sha512-IyDgFV5GeDUVX4YdF/3CPULtVGSXXMLh1xVIgdCgxApktqnQV0r7/8Nqthg+8YLGaAtdyIlo2qIdZrbCv4+7ww==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/types": "^7.29.0" + }, + "bin": { + "parser": "bin/babel-parser.js" + }, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@babel/plugin-transform-react-jsx-self": { + "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-react-jsx-self/-/plugin-transform-react-jsx-self-7.27.1.tgz", + "integrity": "sha512-6UzkCs+ejGdZ5mFFC/OCUrv028ab2fp1znZmCZjAOBKiBK2jXD1O+BPSfX8X2qjJ75fZBMSnQn3Rq2mrBJK2mw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.27.1" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-react-jsx-source": { + "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-react-jsx-source/-/plugin-transform-react-jsx-source-7.27.1.tgz", + "integrity": "sha512-zbwoTsBruTeKB9hSq73ha66iFeJHuaFkUbwvqElnygoNbj/jHRsSeokowZFN3CZ64IvEqcmmkVe89OPXc7ldAw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.27.1" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/template": { + "version": "7.28.6", + "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.28.6.tgz", + "integrity": "sha512-YA6Ma2KsCdGb+WC6UpBVFJGXL58MDA6oyONbjyF/+5sBgxY/dwkhLogbMT2GXXyU84/IhRw/2D1Os1B/giz+BQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/code-frame": "^7.28.6", + "@babel/parser": "^7.28.6", + "@babel/types": "^7.28.6" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/traverse": { + "version": "7.29.0", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.29.0.tgz", + "integrity": "sha512-4HPiQr0X7+waHfyXPZpWPfWL/J7dcN1mx9gL6WdQVMbPnF3+ZhSMs8tCxN7oHddJE9fhNE7+lxdnlyemKfJRuA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/code-frame": "^7.29.0", + "@babel/generator": "^7.29.0", + "@babel/helper-globals": "^7.28.0", + "@babel/parser": "^7.29.0", + "@babel/template": "^7.28.6", + "@babel/types": "^7.29.0", + "debug": "^4.3.1" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/types": { + "version": "7.29.0", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.29.0.tgz", + "integrity": "sha512-LwdZHpScM4Qz8Xw2iKSzS+cfglZzJGvofQICy7W7v4caru4EaAmyUuO6BGrbyQ2mYV11W0U8j5mBhd14dd3B0A==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-string-parser": "^7.27.1", + "@babel/helper-validator-identifier": "^7.28.5" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@esbuild/aix-ppc64": { + "version": "0.27.3", + "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.27.3.tgz", + "integrity": "sha512-9fJMTNFTWZMh5qwrBItuziu834eOCUcEqymSH7pY+zoMVEZg3gcPuBNxH1EvfVYe9h0x/Ptw8KBzv7qxb7l8dg==", + "cpu": [ + "ppc64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "aix" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/android-arm": { + "version": "0.27.3", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.27.3.tgz", + "integrity": "sha512-i5D1hPY7GIQmXlXhs2w8AWHhenb00+GxjxRncS2ZM7YNVGNfaMxgzSGuO8o8SJzRc/oZwU2bcScvVERk03QhzA==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/android-arm64": { + "version": "0.27.3", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.27.3.tgz", + "integrity": "sha512-YdghPYUmj/FX2SYKJ0OZxf+iaKgMsKHVPF1MAq/P8WirnSpCStzKJFjOjzsW0QQ7oIAiccHdcqjbHmJxRb/dmg==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/android-x64": { + "version": "0.27.3", + "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.27.3.tgz", + "integrity": "sha512-IN/0BNTkHtk8lkOM8JWAYFg4ORxBkZQf9zXiEOfERX/CzxW3Vg1ewAhU7QSWQpVIzTW+b8Xy+lGzdYXV6UZObQ==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/darwin-arm64": { + "version": "0.27.3", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.27.3.tgz", + "integrity": "sha512-Re491k7ByTVRy0t3EKWajdLIr0gz2kKKfzafkth4Q8A5n1xTHrkqZgLLjFEHVD+AXdUGgQMq+Godfq45mGpCKg==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/darwin-x64": { + "version": "0.27.3", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.27.3.tgz", + "integrity": "sha512-vHk/hA7/1AckjGzRqi6wbo+jaShzRowYip6rt6q7VYEDX4LEy1pZfDpdxCBnGtl+A5zq8iXDcyuxwtv3hNtHFg==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/freebsd-arm64": { + "version": "0.27.3", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.27.3.tgz", + "integrity": "sha512-ipTYM2fjt3kQAYOvo6vcxJx3nBYAzPjgTCk7QEgZG8AUO3ydUhvelmhrbOheMnGOlaSFUoHXB6un+A7q4ygY9w==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/freebsd-x64": { + "version": "0.27.3", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.27.3.tgz", + "integrity": "sha512-dDk0X87T7mI6U3K9VjWtHOXqwAMJBNN2r7bejDsc+j03SEjtD9HrOl8gVFByeM0aJksoUuUVU9TBaZa2rgj0oA==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-arm": { + "version": "0.27.3", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.27.3.tgz", + "integrity": "sha512-s6nPv2QkSupJwLYyfS+gwdirm0ukyTFNl3KTgZEAiJDd+iHZcbTPPcWCcRYH+WlNbwChgH2QkE9NSlNrMT8Gfw==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-arm64": { + "version": "0.27.3", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.27.3.tgz", + "integrity": "sha512-sZOuFz/xWnZ4KH3YfFrKCf1WyPZHakVzTiqji3WDc0BCl2kBwiJLCXpzLzUBLgmp4veFZdvN5ChW4Eq/8Fc2Fg==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-ia32": { + "version": "0.27.3", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.27.3.tgz", + "integrity": "sha512-yGlQYjdxtLdh0a3jHjuwOrxQjOZYD/C9PfdbgJJF3TIZWnm/tMd/RcNiLngiu4iwcBAOezdnSLAwQDPqTmtTYg==", + "cpu": [ + "ia32" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-loong64": { + "version": "0.27.3", + "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.27.3.tgz", + "integrity": "sha512-WO60Sn8ly3gtzhyjATDgieJNet/KqsDlX5nRC5Y3oTFcS1l0KWba+SEa9Ja1GfDqSF1z6hif/SkpQJbL63cgOA==", + "cpu": [ + "loong64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-mips64el": { + "version": "0.27.3", + "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.27.3.tgz", + "integrity": "sha512-APsymYA6sGcZ4pD6k+UxbDjOFSvPWyZhjaiPyl/f79xKxwTnrn5QUnXR5prvetuaSMsb4jgeHewIDCIWljrSxw==", + "cpu": [ + "mips64el" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-ppc64": { + "version": "0.27.3", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.27.3.tgz", + "integrity": "sha512-eizBnTeBefojtDb9nSh4vvVQ3V9Qf9Df01PfawPcRzJH4gFSgrObw+LveUyDoKU3kxi5+9RJTCWlj4FjYXVPEA==", + "cpu": [ + "ppc64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-riscv64": { + "version": "0.27.3", + "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.27.3.tgz", + "integrity": "sha512-3Emwh0r5wmfm3ssTWRQSyVhbOHvqegUDRd0WhmXKX2mkHJe1SFCMJhagUleMq+Uci34wLSipf8Lagt4LlpRFWQ==", + "cpu": [ + "riscv64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-s390x": { + "version": "0.27.3", + "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.27.3.tgz", + "integrity": "sha512-pBHUx9LzXWBc7MFIEEL0yD/ZVtNgLytvx60gES28GcWMqil8ElCYR4kvbV2BDqsHOvVDRrOxGySBM9Fcv744hw==", + "cpu": [ + "s390x" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-x64": { + "version": "0.27.3", + "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.27.3.tgz", + "integrity": "sha512-Czi8yzXUWIQYAtL/2y6vogER8pvcsOsk5cpwL4Gk5nJqH5UZiVByIY8Eorm5R13gq+DQKYg0+JyQoytLQas4dA==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/netbsd-arm64": { + "version": "0.27.3", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-arm64/-/netbsd-arm64-0.27.3.tgz", + "integrity": "sha512-sDpk0RgmTCR/5HguIZa9n9u+HVKf40fbEUt+iTzSnCaGvY9kFP0YKBWZtJaraonFnqef5SlJ8/TiPAxzyS+UoA==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "netbsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/netbsd-x64": { + "version": "0.27.3", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.27.3.tgz", + "integrity": "sha512-P14lFKJl/DdaE00LItAukUdZO5iqNH7+PjoBm+fLQjtxfcfFE20Xf5CrLsmZdq5LFFZzb5JMZ9grUwvtVYzjiA==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "netbsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/openbsd-arm64": { + "version": "0.27.3", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-arm64/-/openbsd-arm64-0.27.3.tgz", + "integrity": "sha512-AIcMP77AvirGbRl/UZFTq5hjXK+2wC7qFRGoHSDrZ5v5b8DK/GYpXW3CPRL53NkvDqb9D+alBiC/dV0Fb7eJcw==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "openbsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/openbsd-x64": { + "version": "0.27.3", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.27.3.tgz", + "integrity": "sha512-DnW2sRrBzA+YnE70LKqnM3P+z8vehfJWHXECbwBmH/CU51z6FiqTQTHFenPlHmo3a8UgpLyH3PT+87OViOh1AQ==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "openbsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/openharmony-arm64": { + "version": "0.27.3", + "resolved": "https://registry.npmjs.org/@esbuild/openharmony-arm64/-/openharmony-arm64-0.27.3.tgz", + "integrity": "sha512-NinAEgr/etERPTsZJ7aEZQvvg/A6IsZG/LgZy+81wON2huV7SrK3e63dU0XhyZP4RKGyTm7aOgmQk0bGp0fy2g==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "openharmony" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/sunos-x64": { + "version": "0.27.3", + "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.27.3.tgz", + "integrity": "sha512-PanZ+nEz+eWoBJ8/f8HKxTTD172SKwdXebZ0ndd953gt1HRBbhMsaNqjTyYLGLPdoWHy4zLU7bDVJztF5f3BHA==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "sunos" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/win32-arm64": { + "version": "0.27.3", + "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.27.3.tgz", + "integrity": "sha512-B2t59lWWYrbRDw/tjiWOuzSsFh1Y/E95ofKz7rIVYSQkUYBjfSgf6oeYPNWHToFRr2zx52JKApIcAS/D5TUBnA==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/win32-ia32": { + "version": "0.27.3", + "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.27.3.tgz", + "integrity": "sha512-QLKSFeXNS8+tHW7tZpMtjlNb7HKau0QDpwm49u0vUp9y1WOF+PEzkU84y9GqYaAVW8aH8f3GcBck26jh54cX4Q==", + "cpu": [ + "ia32" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/win32-x64": { + "version": "0.27.3", + "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.27.3.tgz", + "integrity": "sha512-4uJGhsxuptu3OcpVAzli+/gWusVGwZZHTlS63hh++ehExkVT8SgiEf7/uC/PclrPPkLhZqGgCTjd0VWLo6xMqA==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@eslint-community/eslint-utils": { + "version": "4.9.1", + "resolved": "https://registry.npmjs.org/@eslint-community/eslint-utils/-/eslint-utils-4.9.1.tgz", + "integrity": "sha512-phrYmNiYppR7znFEdqgfWHXR6NCkZEK7hwWDHZUjit/2/U0r6XvkDl0SYnoM51Hq7FhCGdLDT6zxCCOY1hexsQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "eslint-visitor-keys": "^3.4.3" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + }, + "peerDependencies": { + "eslint": "^6.0.0 || ^7.0.0 || >=8.0.0" + } + }, + "node_modules/@eslint-community/eslint-utils/node_modules/eslint-visitor-keys": { + "version": "3.4.3", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.4.3.tgz", + "integrity": "sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/@eslint-community/regexpp": { + "version": "4.12.2", + "resolved": "https://registry.npmjs.org/@eslint-community/regexpp/-/regexpp-4.12.2.tgz", + "integrity": "sha512-EriSTlt5OC9/7SXkRSCAhfSxxoSUgBm33OH+IkwbdpgoqsSsUg7y3uh+IICI/Qg4BBWr3U2i39RpmycbxMq4ew==", + "dev": true, + "license": "MIT", + "engines": { + "node": "^12.0.0 || ^14.0.0 || >=16.0.0" + } + }, + "node_modules/@eslint/config-array": { + "version": "0.21.2", + "resolved": "https://registry.npmjs.org/@eslint/config-array/-/config-array-0.21.2.tgz", + "integrity": "sha512-nJl2KGTlrf9GjLimgIru+V/mzgSK0ABCDQRvxw5BjURL7WfH5uoWmizbH7QB6MmnMBd8cIC9uceWnezL1VZWWw==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "@eslint/object-schema": "^2.1.7", + "debug": "^4.3.1", + "minimatch": "^3.1.5" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + } + }, + "node_modules/@eslint/config-helpers": { + "version": "0.4.2", + "resolved": "https://registry.npmjs.org/@eslint/config-helpers/-/config-helpers-0.4.2.tgz", + "integrity": "sha512-gBrxN88gOIf3R7ja5K9slwNayVcZgK6SOUORm2uBzTeIEfeVaIhOpCtTox3P6R7o2jLFwLFTLnC7kU/RGcYEgw==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "@eslint/core": "^0.17.0" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + } + }, + "node_modules/@eslint/core": { + "version": "0.17.0", + "resolved": "https://registry.npmjs.org/@eslint/core/-/core-0.17.0.tgz", + "integrity": "sha512-yL/sLrpmtDaFEiUj1osRP4TI2MDz1AddJL+jZ7KSqvBuliN4xqYY54IfdN8qD8Toa6g1iloph1fxQNkjOxrrpQ==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "@types/json-schema": "^7.0.15" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + } + }, + "node_modules/@eslint/eslintrc": { + "version": "3.3.5", + "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-3.3.5.tgz", + "integrity": "sha512-4IlJx0X0qftVsN5E+/vGujTRIFtwuLbNsVUe7TO6zYPDR1O6nFwvwhIKEKSrl6dZchmYBITazxKoUYOjdtjlRg==", + "dev": true, + "license": "MIT", + "dependencies": { + "ajv": "^6.14.0", + "debug": "^4.3.2", + "espree": "^10.0.1", + "globals": "^14.0.0", + "ignore": "^5.2.0", + "import-fresh": "^3.2.1", + "js-yaml": "^4.1.1", + "minimatch": "^3.1.5", + "strip-json-comments": "^3.1.1" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/@eslint/eslintrc/node_modules/globals": { + "version": "14.0.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-14.0.0.tgz", + "integrity": "sha512-oahGvuMGQlPw/ivIYBjVSrWAfWLBeku5tpPE2fOPLi+WHffIWbuh2tCjhyQhTBPMf5E9jDEH4FOmTYgYwbKwtQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/@eslint/js": { + "version": "9.39.4", + "resolved": "https://registry.npmjs.org/@eslint/js/-/js-9.39.4.tgz", + "integrity": "sha512-nE7DEIchvtiFTwBw4Lfbu59PG+kCofhjsKaCWzxTpt4lfRjRMqG6uMBzKXuEcyXhOHoUp9riAm7/aWYGhXZ9cw==", + "dev": true, + "license": "MIT", + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "url": "https://eslint.org/donate" + } + }, + "node_modules/@eslint/object-schema": { + "version": "2.1.7", + "resolved": "https://registry.npmjs.org/@eslint/object-schema/-/object-schema-2.1.7.tgz", + "integrity": "sha512-VtAOaymWVfZcmZbp6E2mympDIHvyjXs/12LqWYjVw6qjrfF+VK+fyG33kChz3nnK+SU5/NeHOqrTEHS8sXO3OA==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + } + }, + "node_modules/@eslint/plugin-kit": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/@eslint/plugin-kit/-/plugin-kit-0.4.1.tgz", + "integrity": "sha512-43/qtrDUokr7LJqoF2c3+RInu/t4zfrpYdoSDfYyhg52rwLV6TnOvdG4fXm7IkSB3wErkcmJS9iEhjVtOSEjjA==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "@eslint/core": "^0.17.0", + "levn": "^0.4.1" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + } + }, + "node_modules/@humanfs/core": { + "version": "0.19.1", + "resolved": "https://registry.npmjs.org/@humanfs/core/-/core-0.19.1.tgz", + "integrity": "sha512-5DyQ4+1JEUzejeK1JGICcideyfUbGixgS9jNgex5nqkW+cY7WZhxBigmieN5Qnw9ZosSNVC9KQKyb+GUaGyKUA==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": ">=18.18.0" + } + }, + "node_modules/@humanfs/node": { + "version": "0.16.7", + "resolved": "https://registry.npmjs.org/@humanfs/node/-/node-0.16.7.tgz", + "integrity": "sha512-/zUx+yOsIrG4Y43Eh2peDeKCxlRt/gET6aHfaKpuq267qXdYDFViVHfMaLyygZOnl0kGWxFIgsBy8QFuTLUXEQ==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "@humanfs/core": "^0.19.1", + "@humanwhocodes/retry": "^0.4.0" + }, + "engines": { + "node": ">=18.18.0" + } + }, + "node_modules/@humanwhocodes/module-importer": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@humanwhocodes/module-importer/-/module-importer-1.0.1.tgz", + "integrity": "sha512-bxveV4V8v5Yb4ncFTT3rPSgZBOpCkjfK0y4oVVVJwIuDVBRMDXrPyXRL988i5ap9m9bnyEEjWfm5WkBmtffLfA==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": ">=12.22" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/nzakas" + } + }, + "node_modules/@humanwhocodes/retry": { + "version": "0.4.3", + "resolved": "https://registry.npmjs.org/@humanwhocodes/retry/-/retry-0.4.3.tgz", + "integrity": "sha512-bV0Tgo9K4hfPCek+aMAn81RppFKv2ySDQeMoSZuvTASywNTnVJCArCZE2FWqpvIatKu7VMRLWlR1EazvVhDyhQ==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": ">=18.18" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/nzakas" + } + }, + "node_modules/@jridgewell/gen-mapping": { + "version": "0.3.13", + "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.13.tgz", + "integrity": "sha512-2kkt/7niJ6MgEPxF0bYdQ6etZaA+fQvDcLKckhy1yIQOzaoKjBBjSj63/aLVjYE3qhRt5dvM+uUyfCg6UKCBbA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jridgewell/sourcemap-codec": "^1.5.0", + "@jridgewell/trace-mapping": "^0.3.24" + } + }, + "node_modules/@jridgewell/remapping": { + "version": "2.3.5", + "resolved": "https://registry.npmjs.org/@jridgewell/remapping/-/remapping-2.3.5.tgz", + "integrity": "sha512-LI9u/+laYG4Ds1TDKSJW2YPrIlcVYOwi2fUC6xB43lueCjgxV4lffOCZCtYFiH6TNOX+tQKXx97T4IKHbhyHEQ==", + "dev": true, + "license": "MIT", + "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.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.2.tgz", + "integrity": "sha512-bRISgCIjP20/tbWSPWMEi54QVPRZExkuD9lJL+UIxUKtwVJA8wW1Trb1jMs1RFXo1CBTNZ/5hpC9QvmKWdopKw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@jridgewell/sourcemap-codec": { + "version": "1.5.5", + "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.5.5.tgz", + "integrity": "sha512-cYQ9310grqxueWbl+WuIUIaiUaDcj7WOq5fVhEljNVgRfOUhY9fy2zTvfoqWsnebh8Sl70VScFbICvJnLKB0Og==", + "dev": true, + "license": "MIT" + }, + "node_modules/@jridgewell/trace-mapping": { + "version": "0.3.31", + "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.31.tgz", + "integrity": "sha512-zzNR+SdQSDJzc8joaeP8QQoCQr8NuYx2dIIytl1QeBEZHJ9uW6hebsrYgbz8hJwUQao3TWCMtmfV8Nu1twOLAw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jridgewell/resolve-uri": "^3.1.0", + "@jridgewell/sourcemap-codec": "^1.4.14" + } + }, + "node_modules/@kurkle/color": { + "version": "0.3.4", + "resolved": "https://registry.npmjs.org/@kurkle/color/-/color-0.3.4.tgz", + "integrity": "sha512-M5UknZPHRu3DEDWoipU6sE8PdkZ6Z/S+v4dD+Ke8IaNlpdSQah50lz1KtcFBa2vsdOnwbbnxJwVM4wty6udA5w==", + "license": "MIT" + }, + "node_modules/@popperjs/core": { + "version": "2.11.8", + "resolved": "https://registry.npmjs.org/@popperjs/core/-/core-2.11.8.tgz", + "integrity": "sha512-P1st0aksCrn9sGZhp8GMYwBnQsbvAWsZAX44oXNNvLHGqAOcoVxmjZiohstwQ7SqKnbR47akdNi+uleWD8+g6A==", + "license": "MIT", + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/popperjs" + } + }, + "node_modules/@rolldown/pluginutils": { + "version": "1.0.0-rc.3", + "resolved": "https://registry.npmjs.org/@rolldown/pluginutils/-/pluginutils-1.0.0-rc.3.tgz", + "integrity": "sha512-eybk3TjzzzV97Dlj5c+XrBFW57eTNhzod66y9HrBlzJ6NsCrWCp/2kaPS3K9wJmurBC0Tdw4yPjXKZqlznim3Q==", + "dev": true, + "license": "MIT" + }, + "node_modules/@rollup/rollup-android-arm-eabi": { + "version": "4.59.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.59.0.tgz", + "integrity": "sha512-upnNBkA6ZH2VKGcBj9Fyl9IGNPULcjXRlg0LLeaioQWueH30p6IXtJEbKAgvyv+mJaMxSm1l6xwDXYjpEMiLMg==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ] + }, + "node_modules/@rollup/rollup-android-arm64": { + "version": "4.59.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.59.0.tgz", + "integrity": "sha512-hZ+Zxj3SySm4A/DylsDKZAeVg0mvi++0PYVceVyX7hemkw7OreKdCvW2oQ3T1FMZvCaQXqOTHb8qmBShoqk69Q==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ] + }, + "node_modules/@rollup/rollup-darwin-arm64": { + "version": "4.59.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.59.0.tgz", + "integrity": "sha512-W2Psnbh1J8ZJw0xKAd8zdNgF9HRLkdWwwdWqubSVk0pUuQkoHnv7rx4GiF9rT4t5DIZGAsConRE3AxCdJ4m8rg==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ] + }, + "node_modules/@rollup/rollup-darwin-x64": { + "version": "4.59.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.59.0.tgz", + "integrity": "sha512-ZW2KkwlS4lwTv7ZVsYDiARfFCnSGhzYPdiOU4IM2fDbL+QGlyAbjgSFuqNRbSthybLbIJ915UtZBtmuLrQAT/w==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ] + }, + "node_modules/@rollup/rollup-freebsd-arm64": { + "version": "4.59.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-freebsd-arm64/-/rollup-freebsd-arm64-4.59.0.tgz", + "integrity": "sha512-EsKaJ5ytAu9jI3lonzn3BgG8iRBjV4LxZexygcQbpiU0wU0ATxhNVEpXKfUa0pS05gTcSDMKpn3Sx+QB9RlTTA==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ] + }, + "node_modules/@rollup/rollup-freebsd-x64": { + "version": "4.59.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-freebsd-x64/-/rollup-freebsd-x64-4.59.0.tgz", + "integrity": "sha512-d3DuZi2KzTMjImrxoHIAODUZYoUUMsuUiY4SRRcJy6NJoZ6iIqWnJu9IScV9jXysyGMVuW+KNzZvBLOcpdl3Vg==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ] + }, + "node_modules/@rollup/rollup-linux-arm-gnueabihf": { + "version": "4.59.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.59.0.tgz", + "integrity": "sha512-t4ONHboXi/3E0rT6OZl1pKbl2Vgxf9vJfWgmUoCEVQVxhW6Cw/c8I6hbbu7DAvgp82RKiH7TpLwxnJeKv2pbsw==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-arm-musleabihf": { + "version": "4.59.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-musleabihf/-/rollup-linux-arm-musleabihf-4.59.0.tgz", + "integrity": "sha512-CikFT7aYPA2ufMD086cVORBYGHffBo4K8MQ4uPS/ZnY54GKj36i196u8U+aDVT2LX4eSMbyHtyOh7D7Zvk2VvA==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-arm64-gnu": { + "version": "4.59.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.59.0.tgz", + "integrity": "sha512-jYgUGk5aLd1nUb1CtQ8E+t5JhLc9x5WdBKew9ZgAXg7DBk0ZHErLHdXM24rfX+bKrFe+Xp5YuJo54I5HFjGDAA==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-arm64-musl": { + "version": "4.59.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.59.0.tgz", + "integrity": "sha512-peZRVEdnFWZ5Bh2KeumKG9ty7aCXzzEsHShOZEFiCQlDEepP1dpUl/SrUNXNg13UmZl+gzVDPsiCwnV1uI0RUA==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-loong64-gnu": { + "version": "4.59.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-loong64-gnu/-/rollup-linux-loong64-gnu-4.59.0.tgz", + "integrity": "sha512-gbUSW/97f7+r4gHy3Jlup8zDG190AuodsWnNiXErp9mT90iCy9NKKU0Xwx5k8VlRAIV2uU9CsMnEFg/xXaOfXg==", + "cpu": [ + "loong64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-loong64-musl": { + "version": "4.59.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-loong64-musl/-/rollup-linux-loong64-musl-4.59.0.tgz", + "integrity": "sha512-yTRONe79E+o0FWFijasoTjtzG9EBedFXJMl888NBEDCDV9I2wGbFFfJQQe63OijbFCUZqxpHz1GzpbtSFikJ4Q==", + "cpu": [ + "loong64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-ppc64-gnu": { + "version": "4.59.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-ppc64-gnu/-/rollup-linux-ppc64-gnu-4.59.0.tgz", + "integrity": "sha512-sw1o3tfyk12k3OEpRddF68a1unZ5VCN7zoTNtSn2KndUE+ea3m3ROOKRCZxEpmT9nsGnogpFP9x6mnLTCaoLkA==", + "cpu": [ + "ppc64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-ppc64-musl": { + "version": "4.59.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-ppc64-musl/-/rollup-linux-ppc64-musl-4.59.0.tgz", + "integrity": "sha512-+2kLtQ4xT3AiIxkzFVFXfsmlZiG5FXYW7ZyIIvGA7Bdeuh9Z0aN4hVyXS/G1E9bTP/vqszNIN/pUKCk/BTHsKA==", + "cpu": [ + "ppc64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-riscv64-gnu": { + "version": "4.59.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.59.0.tgz", + "integrity": "sha512-NDYMpsXYJJaj+I7UdwIuHHNxXZ/b/N2hR15NyH3m2qAtb/hHPA4g4SuuvrdxetTdndfj9b1WOmy73kcPRoERUg==", + "cpu": [ + "riscv64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-riscv64-musl": { + "version": "4.59.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-musl/-/rollup-linux-riscv64-musl-4.59.0.tgz", + "integrity": "sha512-nLckB8WOqHIf1bhymk+oHxvM9D3tyPndZH8i8+35p/1YiVoVswPid2yLzgX7ZJP0KQvnkhM4H6QZ5m0LzbyIAg==", + "cpu": [ + "riscv64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-s390x-gnu": { + "version": "4.59.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-s390x-gnu/-/rollup-linux-s390x-gnu-4.59.0.tgz", + "integrity": "sha512-oF87Ie3uAIvORFBpwnCvUzdeYUqi2wY6jRFWJAy1qus/udHFYIkplYRW+wo+GRUP4sKzYdmE1Y3+rY5Gc4ZO+w==", + "cpu": [ + "s390x" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-x64-gnu": { + "version": "4.59.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.59.0.tgz", + "integrity": "sha512-3AHmtQq/ppNuUspKAlvA8HtLybkDflkMuLK4DPo77DfthRb71V84/c4MlWJXixZz4uruIH4uaa07IqoAkG64fg==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-x64-musl": { + "version": "4.59.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.59.0.tgz", + "integrity": "sha512-2UdiwS/9cTAx7qIUZB/fWtToJwvt0Vbo0zmnYt7ED35KPg13Q0ym1g442THLC7VyI6JfYTP4PiSOWyoMdV2/xg==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-openbsd-x64": { + "version": "4.59.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-openbsd-x64/-/rollup-openbsd-x64-4.59.0.tgz", + "integrity": "sha512-M3bLRAVk6GOwFlPTIxVBSYKUaqfLrn8l0psKinkCFxl4lQvOSz8ZrKDz2gxcBwHFpci0B6rttydI4IpS4IS/jQ==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "openbsd" + ] + }, + "node_modules/@rollup/rollup-openharmony-arm64": { + "version": "4.59.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-openharmony-arm64/-/rollup-openharmony-arm64-4.59.0.tgz", + "integrity": "sha512-tt9KBJqaqp5i5HUZzoafHZX8b5Q2Fe7UjYERADll83O4fGqJ49O1FsL6LpdzVFQcpwvnyd0i+K/VSwu/o/nWlA==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "openharmony" + ] + }, + "node_modules/@rollup/rollup-win32-arm64-msvc": { + "version": "4.59.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.59.0.tgz", + "integrity": "sha512-V5B6mG7OrGTwnxaNUzZTDTjDS7F75PO1ae6MJYdiMu60sq0CqN5CVeVsbhPxalupvTX8gXVSU9gq+Rx1/hvu6A==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ] + }, + "node_modules/@rollup/rollup-win32-ia32-msvc": { + "version": "4.59.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.59.0.tgz", + "integrity": "sha512-UKFMHPuM9R0iBegwzKF4y0C4J9u8C6MEJgFuXTBerMk7EJ92GFVFYBfOZaSGLu6COf7FxpQNqhNS4c4icUPqxA==", + "cpu": [ + "ia32" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ] + }, + "node_modules/@rollup/rollup-win32-x64-gnu": { + "version": "4.59.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-gnu/-/rollup-win32-x64-gnu-4.59.0.tgz", + "integrity": "sha512-laBkYlSS1n2L8fSo1thDNGrCTQMmxjYY5G0WFWjFFYZkKPjsMBsgJfGf4TLxXrF6RyhI60L8TMOjBMvXiTcxeA==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ] + }, + "node_modules/@rollup/rollup-win32-x64-msvc": { + "version": "4.59.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.59.0.tgz", + "integrity": "sha512-2HRCml6OztYXyJXAvdDXPKcawukWY2GpR5/nxKp4iBgiO3wcoEGkAaqctIbZcNB6KlUQBIqt8VYkNSj2397EfA==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ] + }, + "node_modules/@tabler/core": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/@tabler/core/-/core-1.4.0.tgz", + "integrity": "sha512-5BigzOlbOH9N0Is4u0rYNRCiwtnUXWO57K9zwuscygcicAa8UV9MGaS4zTgQsZEtZ9tsNANhN/YD8gCBGKYCiw==", + "license": "MIT", + "dependencies": { + "@popperjs/core": "^2.11.8", + "bootstrap": "5.3.7" + }, + "engines": { + "node": ">=20" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/codecalm" + } + }, + "node_modules/@tabler/icons": { + "version": "3.40.0", + "resolved": "https://registry.npmjs.org/@tabler/icons/-/icons-3.40.0.tgz", + "integrity": "sha512-V/Q4VgNPKubRTiLdmWjV/zscYcj5IIk+euicUtaVVqF6luSC9rDngYWgST5/yh3Mrg/mYUwRv1YVTk71Jp0twQ==", + "license": "MIT", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/codecalm" + } + }, + "node_modules/@tabler/icons-react": { + "version": "3.40.0", + "resolved": "https://registry.npmjs.org/@tabler/icons-react/-/icons-react-3.40.0.tgz", + "integrity": "sha512-oO5+6QCnna4a//mYubx4euZfECtzQZFDGsDMIdzZUhbdyBCT+3bRVFBPueGIcemWld4Vb/0UQ39C/cmGfGylAg==", + "license": "MIT", + "dependencies": { + "@tabler/icons": "3.40.0" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/codecalm" + }, + "peerDependencies": { + "react": ">= 16" + } + }, + "node_modules/@types/babel__core": { + "version": "7.20.5", + "resolved": "https://registry.npmjs.org/@types/babel__core/-/babel__core-7.20.5.tgz", + "integrity": "sha512-qoQprZvz5wQFJwMDqeseRXWv3rqMvhgpbXFfVyWhbx9X47POIA6i/+dXefEmZKoAgOaTdaIgNSMqMIU61yRyzA==", + "dev": true, + "license": "MIT", + "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.npmjs.org/@types/babel__generator/-/babel__generator-7.27.0.tgz", + "integrity": "sha512-ufFd2Xi92OAVPYsy+P4n7/U7e68fex0+Ee8gSG9KX7eo084CWiQ4sdxktvdl0bOPupXtVJPY19zk6EwWqUQ8lg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/types": "^7.0.0" + } + }, + "node_modules/@types/babel__template": { + "version": "7.4.4", + "resolved": "https://registry.npmjs.org/@types/babel__template/-/babel__template-7.4.4.tgz", + "integrity": "sha512-h/NUaSyG5EyxBIp8YRxo4RMe2/qQgvyowRwVMzhYhBCONbW8PUsg4lkFMrhgZhUe5z3L3MiLDuvyJ/CaPa2A8A==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/parser": "^7.1.0", + "@babel/types": "^7.0.0" + } + }, + "node_modules/@types/babel__traverse": { + "version": "7.28.0", + "resolved": "https://registry.npmjs.org/@types/babel__traverse/-/babel__traverse-7.28.0.tgz", + "integrity": "sha512-8PvcXf70gTDZBgt9ptxJ8elBeBjcLOAcOtoO/mPJjtji1+CdGbHgm77om1GrsPxsiE+uXIpNSK64UYaIwQXd4Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/types": "^7.28.2" + } + }, + "node_modules/@types/estree": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.8.tgz", + "integrity": "sha512-dWHzHa2WqEXI/O1E9OjrocMTKJl2mSrEolh1Iomrv6U+JuNwaHXsXx9bLu5gG7BUWFIN0skIQJQ/L1rIex4X6w==", + "dev": true, + "license": "MIT" + }, + "node_modules/@types/json-schema": { + "version": "7.0.15", + "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.15.tgz", + "integrity": "sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA==", + "dev": true, + "license": "MIT" + }, + "node_modules/@types/react": { + "version": "19.2.14", + "resolved": "https://registry.npmjs.org/@types/react/-/react-19.2.14.tgz", + "integrity": "sha512-ilcTH/UniCkMdtexkoCN0bI7pMcJDvmQFPvuPvmEaYA/NSfFTAgdUSLAoVjaRJm7+6PvcM+q1zYOwS4wTYMF9w==", + "dev": true, + "license": "MIT", + "dependencies": { + "csstype": "^3.2.2" + } + }, + "node_modules/@types/react-dom": { + "version": "19.2.3", + "resolved": "https://registry.npmjs.org/@types/react-dom/-/react-dom-19.2.3.tgz", + "integrity": "sha512-jp2L/eY6fn+KgVVQAOqYItbF0VY/YApe5Mz2F0aykSO8gx31bYCZyvSeYxCHKvzHG5eZjc+zyaS5BrBWya2+kQ==", + "dev": true, + "license": "MIT", + "peerDependencies": { + "@types/react": "^19.2.0" + } + }, + "node_modules/@vitejs/plugin-react": { + "version": "5.1.4", + "resolved": "https://registry.npmjs.org/@vitejs/plugin-react/-/plugin-react-5.1.4.tgz", + "integrity": "sha512-VIcFLdRi/VYRU8OL/puL7QXMYafHmqOnwTZY50U1JPlCNj30PxCMx65c494b1K9be9hX83KVt0+gTEwTWLqToA==", + "dev": true, + "license": "MIT", + "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" + } + }, + "node_modules/accepts": { + "version": "1.3.8", + "resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.8.tgz", + "integrity": "sha512-PYAthTa2m2VKxuvSD3DPC/Gy+U+sOA1LAuT8mkmRuvw+NACSaeXEQ+NHcVF7rONl6qcaxV3Uuemwawk+7+SJLw==", + "license": "MIT", + "dependencies": { + "mime-types": "~2.1.34", + "negotiator": "0.6.3" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/acorn": { + "version": "8.16.0", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.16.0.tgz", + "integrity": "sha512-UVJyE9MttOsBQIDKw1skb9nAwQuR5wuGD3+82K6JgJlm/Y+KI92oNsMNGZCYdDsVtRHSak0pcV5Dno5+4jh9sw==", + "dev": true, + "license": "MIT", + "bin": { + "acorn": "bin/acorn" + }, + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/acorn-jsx": { + "version": "5.3.2", + "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.3.2.tgz", + "integrity": "sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==", + "dev": true, + "license": "MIT", + "peerDependencies": { + "acorn": "^6.0.0 || ^7.0.0 || ^8.0.0" + } + }, + "node_modules/ajv": { + "version": "6.14.0", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.14.0.tgz", + "integrity": "sha512-IWrosm/yrn43eiKqkfkHis7QioDleaXQHdDVPKg0FSwwd/DuvyX79TZnFOnYpB7dcsFAMmtFztZuXPDvSePkFw==", + "dev": true, + "license": "MIT", + "dependencies": { + "fast-deep-equal": "^3.1.1", + "fast-json-stable-stringify": "^2.0.0", + "json-schema-traverse": "^0.4.1", + "uri-js": "^4.2.2" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/epoberezkin" + } + }, + "node_modules/ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "license": "MIT", + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/argparse": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", + "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==", + "dev": true, + "license": "Python-2.0" + }, + "node_modules/array-flatten": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/array-flatten/-/array-flatten-1.1.1.tgz", + "integrity": "sha512-PCVAQswWemu6UdxsDFFX/+gVeYqKAod3D3UVm91jHwynguOwAvYPhx8nNlM++NqRcK6CxxpUafjmhIdKiHibqg==", + "license": "MIT" + }, + "node_modules/balanced-match": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", + "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", + "dev": true, + "license": "MIT" + }, + "node_modules/baseline-browser-mapping": { + "version": "2.10.0", + "resolved": "https://registry.npmjs.org/baseline-browser-mapping/-/baseline-browser-mapping-2.10.0.tgz", + "integrity": "sha512-lIyg0szRfYbiy67j9KN8IyeD7q7hcmqnJ1ddWmNt19ItGpNN64mnllmxUNFIOdOm6by97jlL6wfpTTJrmnjWAA==", + "dev": true, + "license": "Apache-2.0", + "bin": { + "baseline-browser-mapping": "dist/cli.cjs" + }, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/body-parser": { + "version": "1.20.4", + "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.20.4.tgz", + "integrity": "sha512-ZTgYYLMOXY9qKU/57FAo8F+HA2dGX7bqGc71txDRC1rS4frdFI5R7NhluHxH6M0YItAP0sHB4uqAOcYKxO6uGA==", + "license": "MIT", + "dependencies": { + "bytes": "~3.1.2", + "content-type": "~1.0.5", + "debug": "2.6.9", + "depd": "2.0.0", + "destroy": "~1.2.0", + "http-errors": "~2.0.1", + "iconv-lite": "~0.4.24", + "on-finished": "~2.4.1", + "qs": "~6.14.0", + "raw-body": "~2.5.3", + "type-is": "~1.6.18", + "unpipe": "~1.0.0" + }, + "engines": { + "node": ">= 0.8", + "npm": "1.2.8000 || >= 1.4.16" + } + }, + "node_modules/body-parser/node_modules/debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "license": "MIT", + "dependencies": { + "ms": "2.0.0" + } + }, + "node_modules/body-parser/node_modules/ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==", + "license": "MIT" + }, + "node_modules/bootstrap": { + "version": "5.3.7", + "resolved": "https://registry.npmjs.org/bootstrap/-/bootstrap-5.3.7.tgz", + "integrity": "sha512-7KgiD8UHjfcPBHEpDNg+zGz8L3LqR3GVwqZiBRFX04a1BCArZOz1r2kjly2HQ0WokqTO0v1nF+QAt8dsW4lKlw==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/twbs" + }, + { + "type": "opencollective", + "url": "https://opencollective.com/bootstrap" + } + ], + "license": "MIT", + "peerDependencies": { + "@popperjs/core": "^2.11.8" + } + }, + "node_modules/brace-expansion": { + "version": "1.1.12", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.12.tgz", + "integrity": "sha512-9T9UjW3r0UW5c1Q7GTwllptXwhvYmEzFhzMfZ9H7FQWt+uZePjZPjBP/W1ZEyZ1twGWom5/56TF4lPcqjnDHcg==", + "dev": true, + "license": "MIT", + "dependencies": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "node_modules/browserslist": { + "version": "4.28.1", + "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.28.1.tgz", + "integrity": "sha512-ZC5Bd0LgJXgwGqUknZY/vkUQ04r8NXnJZ3yYi4vDmSiZmC/pdSN0NbNRPxZpbtO4uAfDUAFffO8IZoM3Gj8IkA==", + "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" + } + ], + "license": "MIT", + "dependencies": { + "baseline-browser-mapping": "^2.9.0", + "caniuse-lite": "^1.0.30001759", + "electron-to-chromium": "^1.5.263", + "node-releases": "^2.0.27", + "update-browserslist-db": "^1.2.0" + }, + "bin": { + "browserslist": "cli.js" + }, + "engines": { + "node": "^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7" + } + }, + "node_modules/bytes": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.2.tgz", + "integrity": "sha512-/Nf7TyzTx6S3yRJObOAV7956r8cr2+Oj8AC5dt8wSP3BQAoeX58NoHyCU8P8zGkNXStjTSi6fzO6F0pBdcYbEg==", + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/call-bind-apply-helpers": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/call-bind-apply-helpers/-/call-bind-apply-helpers-1.0.2.tgz", + "integrity": "sha512-Sp1ablJ0ivDkSzjcaJdxEunN5/XvksFJ2sMBFfq6x0ryhQV/2b/KwFe21cMpmHtPOSij8K99/wSfoEuTObmuMQ==", + "license": "MIT", + "dependencies": { + "es-errors": "^1.3.0", + "function-bind": "^1.1.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/call-bound": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/call-bound/-/call-bound-1.0.4.tgz", + "integrity": "sha512-+ys997U96po4Kx/ABpBCqhA9EuxJaQWDQg7295H4hBphv3IZg0boBKuwYpt4YXp6MZ5AmZQnU/tyMTlRpaSejg==", + "license": "MIT", + "dependencies": { + "call-bind-apply-helpers": "^1.0.2", + "get-intrinsic": "^1.3.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/callsites": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz", + "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/caniuse-lite": { + "version": "1.0.30001777", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001777.tgz", + "integrity": "sha512-tmN+fJxroPndC74efCdp12j+0rk0RHwV5Jwa1zWaFVyw2ZxAuPeG8ZgWC3Wz7uSjT3qMRQ5XHZ4COgQmsCMJAQ==", + "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" + } + ], + "license": "CC-BY-4.0" + }, + "node_modules/chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/chart.js": { + "version": "4.5.1", + "resolved": "https://registry.npmjs.org/chart.js/-/chart.js-4.5.1.tgz", + "integrity": "sha512-GIjfiT9dbmHRiYi6Nl2yFCq7kkwdkp1W/lp2J99rX0yo9tgJGn3lKQATztIjb5tVtevcBtIdICNWqlq5+E8/Pw==", + "license": "MIT", + "dependencies": { + "@kurkle/color": "^0.3.0" + }, + "engines": { + "pnpm": ">=8" + } + }, + "node_modules/cliui": { + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-8.0.1.tgz", + "integrity": "sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ==", + "dev": true, + "license": "ISC", + "dependencies": { + "string-width": "^4.2.0", + "strip-ansi": "^6.0.1", + "wrap-ansi": "^7.0.0" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true, + "license": "MIT" + }, + "node_modules/concat-map": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", + "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==", + "dev": true, + "license": "MIT" + }, + "node_modules/concurrently": { + "version": "9.2.1", + "resolved": "https://registry.npmjs.org/concurrently/-/concurrently-9.2.1.tgz", + "integrity": "sha512-fsfrO0MxV64Znoy8/l1vVIjjHa29SZyyqPgQBwhiDcaW8wJc2W3XWVOGx4M3oJBnv/zdUZIIp1gDeS98GzP8Ng==", + "dev": true, + "license": "MIT", + "dependencies": { + "chalk": "4.1.2", + "rxjs": "7.8.2", + "shell-quote": "1.8.3", + "supports-color": "8.1.1", + "tree-kill": "1.2.2", + "yargs": "17.7.2" + }, + "bin": { + "conc": "dist/bin/concurrently.js", + "concurrently": "dist/bin/concurrently.js" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/open-cli-tools/concurrently?sponsor=1" + } + }, + "node_modules/concurrently/node_modules/supports-color": { + "version": "8.1.1", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-8.1.1.tgz", + "integrity": "sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/supports-color?sponsor=1" + } + }, + "node_modules/content-disposition": { + "version": "0.5.4", + "resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-0.5.4.tgz", + "integrity": "sha512-FveZTNuGw04cxlAiWbzi6zTAL/lhehaWbTtgluJh4/E95DqMwTmha3KZN1aAWA8cFIhHzMZUvLevkw5Rqk+tSQ==", + "license": "MIT", + "dependencies": { + "safe-buffer": "5.2.1" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/content-type": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/content-type/-/content-type-1.0.5.tgz", + "integrity": "sha512-nTjqfcBFEipKdXCv4YDQWCfmcLZKm81ldF0pAopTvyrFGVbcR6P/VAAd5G7N+0tTr8QqiU0tFadD6FK4NtJwOA==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/convert-source-map": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-2.0.0.tgz", + "integrity": "sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg==", + "dev": true, + "license": "MIT" + }, + "node_modules/cookie": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/cookie/-/cookie-1.1.1.tgz", + "integrity": "sha512-ei8Aos7ja0weRpFzJnEA9UHJ/7XQmqglbRwnf2ATjcB9Wq874VKH9kfjjirM6UhU2/E5fFYadylyhFldcqSidQ==", + "license": "MIT", + "engines": { + "node": ">=18" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" + } + }, + "node_modules/cookie-signature": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.0.7.tgz", + "integrity": "sha512-NXdYc3dLr47pBkpUCHtKSwIOQXLVn8dZEuywboCOJY/osA0wFSLlSawr3KN8qXJEyX66FcONTH8EIlVuK0yyFA==", + "license": "MIT" + }, + "node_modules/cors": { + "version": "2.8.6", + "resolved": "https://registry.npmjs.org/cors/-/cors-2.8.6.tgz", + "integrity": "sha512-tJtZBBHA6vjIAaF6EnIaq6laBBP9aq/Y3ouVJjEfoHbRBcHBAHYcMh/w8LDrk2PvIMMq8gmopa5D4V8RmbrxGw==", + "license": "MIT", + "dependencies": { + "object-assign": "^4", + "vary": "^1" + }, + "engines": { + "node": ">= 0.10" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" + } + }, + "node_modules/cross-spawn": { + "version": "7.0.6", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.6.tgz", + "integrity": "sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA==", + "dev": true, + "license": "MIT", + "dependencies": { + "path-key": "^3.1.0", + "shebang-command": "^2.0.0", + "which": "^2.0.1" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/csstype": { + "version": "3.2.3", + "resolved": "https://registry.npmjs.org/csstype/-/csstype-3.2.3.tgz", + "integrity": "sha512-z1HGKcYy2xA8AGQfwrn0PAy+PB7X/GSj3UVJW9qKyn43xWa+gl5nXmU4qqLMRzWVLFC8KusUX8T/0kCiOYpAIQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/debug": { + "version": "4.4.3", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.3.tgz", + "integrity": "sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA==", + "dev": true, + "license": "MIT", + "dependencies": { + "ms": "^2.1.3" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/deep-is": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.4.tgz", + "integrity": "sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/depd": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/depd/-/depd-2.0.0.tgz", + "integrity": "sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw==", + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/destroy": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/destroy/-/destroy-1.2.0.tgz", + "integrity": "sha512-2sJGJTaXIIaR1w4iJSNoN0hnMY7Gpc/n8D4qSCJw8QqFWXf7cuAgnEHxBpweaVcPevC2l3KpjYCx3NypQQgaJg==", + "license": "MIT", + "engines": { + "node": ">= 0.8", + "npm": "1.2.8000 || >= 1.4.16" + } + }, + "node_modules/dunder-proto": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/dunder-proto/-/dunder-proto-1.0.1.tgz", + "integrity": "sha512-KIN/nDJBQRcXw0MLVhZE9iQHmG68qAVIBg9CqmUYjmQIhgij9U5MFvrqkUL5FbtyyzZuOeOt0zdeRe4UY7ct+A==", + "license": "MIT", + "dependencies": { + "call-bind-apply-helpers": "^1.0.1", + "es-errors": "^1.3.0", + "gopd": "^1.2.0" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/ee-first": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz", + "integrity": "sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow==", + "license": "MIT" + }, + "node_modules/electron-to-chromium": { + "version": "1.5.307", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.307.tgz", + "integrity": "sha512-5z3uFKBWjiNR44nFcYdkcXjKMbg5KXNdciu7mhTPo9tB7NbqSNP2sSnGR+fqknZSCwKkBN+oxiiajWs4dT6ORg==", + "dev": true, + "license": "ISC" + }, + "node_modules/emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", + "dev": true, + "license": "MIT" + }, + "node_modules/encodeurl": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-2.0.0.tgz", + "integrity": "sha512-Q0n9HRi4m6JuGIV1eFlmvJB7ZEVxu93IrMyiMsGC0lrMJMWzRgx6WGquyfQgZVb31vhGgXnfmPNNXmxnOkRBrg==", + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/es-define-property": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/es-define-property/-/es-define-property-1.0.1.tgz", + "integrity": "sha512-e3nRfgfUZ4rNGL232gUgX06QNyyez04KdjFrF+LTRoOXmrOgFKDg4BCdsjW8EnT69eqdYGmRpJwiPVYNrCaW3g==", + "license": "MIT", + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/es-errors": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/es-errors/-/es-errors-1.3.0.tgz", + "integrity": "sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==", + "license": "MIT", + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/es-object-atoms": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/es-object-atoms/-/es-object-atoms-1.1.1.tgz", + "integrity": "sha512-FGgH2h8zKNim9ljj7dankFPcICIK9Cp5bm+c2gQSYePhpaG5+esrLODihIorn+Pe6FGJzWhXQotPv73jTaldXA==", + "license": "MIT", + "dependencies": { + "es-errors": "^1.3.0" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/esbuild": { + "version": "0.27.3", + "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.27.3.tgz", + "integrity": "sha512-8VwMnyGCONIs6cWue2IdpHxHnAjzxnw2Zr7MkVxB2vjmQ2ivqGFb4LEG3SMnv0Gb2F/G/2yA8zUaiL1gywDCCg==", + "dev": true, + "hasInstallScript": true, + "license": "MIT", + "bin": { + "esbuild": "bin/esbuild" + }, + "engines": { + "node": ">=18" + }, + "optionalDependencies": { + "@esbuild/aix-ppc64": "0.27.3", + "@esbuild/android-arm": "0.27.3", + "@esbuild/android-arm64": "0.27.3", + "@esbuild/android-x64": "0.27.3", + "@esbuild/darwin-arm64": "0.27.3", + "@esbuild/darwin-x64": "0.27.3", + "@esbuild/freebsd-arm64": "0.27.3", + "@esbuild/freebsd-x64": "0.27.3", + "@esbuild/linux-arm": "0.27.3", + "@esbuild/linux-arm64": "0.27.3", + "@esbuild/linux-ia32": "0.27.3", + "@esbuild/linux-loong64": "0.27.3", + "@esbuild/linux-mips64el": "0.27.3", + "@esbuild/linux-ppc64": "0.27.3", + "@esbuild/linux-riscv64": "0.27.3", + "@esbuild/linux-s390x": "0.27.3", + "@esbuild/linux-x64": "0.27.3", + "@esbuild/netbsd-arm64": "0.27.3", + "@esbuild/netbsd-x64": "0.27.3", + "@esbuild/openbsd-arm64": "0.27.3", + "@esbuild/openbsd-x64": "0.27.3", + "@esbuild/openharmony-arm64": "0.27.3", + "@esbuild/sunos-x64": "0.27.3", + "@esbuild/win32-arm64": "0.27.3", + "@esbuild/win32-ia32": "0.27.3", + "@esbuild/win32-x64": "0.27.3" + } + }, + "node_modules/escalade": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.2.0.tgz", + "integrity": "sha512-WUj2qlxaQtO4g6Pq5c29GTcWGDyd8itL8zTlipgECz3JesAiiOKotd8JU6otB3PACgG6xkJUyVhboMS+bje/jA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/escape-html": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz", + "integrity": "sha512-NiSupZ4OeuGwr68lGIeym/ksIZMJodUGOSCZ/FSnTxcrekbvqrgdUxlJOMpijaKZVjAJrWrGs/6Jy8OMuyj9ow==", + "license": "MIT" + }, + "node_modules/escape-string-regexp": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", + "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/eslint": { + "version": "9.39.4", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-9.39.4.tgz", + "integrity": "sha512-XoMjdBOwe/esVgEvLmNsD3IRHkm7fbKIUGvrleloJXUZgDHig2IPWNniv+GwjyJXzuNqVjlr5+4yVUZjycJwfQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@eslint-community/eslint-utils": "^4.8.0", + "@eslint-community/regexpp": "^4.12.1", + "@eslint/config-array": "^0.21.2", + "@eslint/config-helpers": "^0.4.2", + "@eslint/core": "^0.17.0", + "@eslint/eslintrc": "^3.3.5", + "@eslint/js": "9.39.4", + "@eslint/plugin-kit": "^0.4.1", + "@humanfs/node": "^0.16.6", + "@humanwhocodes/module-importer": "^1.0.1", + "@humanwhocodes/retry": "^0.4.2", + "@types/estree": "^1.0.6", + "ajv": "^6.14.0", + "chalk": "^4.0.0", + "cross-spawn": "^7.0.6", + "debug": "^4.3.2", + "escape-string-regexp": "^4.0.0", + "eslint-scope": "^8.4.0", + "eslint-visitor-keys": "^4.2.1", + "espree": "^10.4.0", + "esquery": "^1.5.0", + "esutils": "^2.0.2", + "fast-deep-equal": "^3.1.3", + "file-entry-cache": "^8.0.0", + "find-up": "^5.0.0", + "glob-parent": "^6.0.2", + "ignore": "^5.2.0", + "imurmurhash": "^0.1.4", + "is-glob": "^4.0.0", + "json-stable-stringify-without-jsonify": "^1.0.1", + "lodash.merge": "^4.6.2", + "minimatch": "^3.1.5", + "natural-compare": "^1.4.0", + "optionator": "^0.9.3" + }, + "bin": { + "eslint": "bin/eslint.js" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "url": "https://eslint.org/donate" + }, + "peerDependencies": { + "jiti": "*" + }, + "peerDependenciesMeta": { + "jiti": { + "optional": true + } + } + }, + "node_modules/eslint-plugin-react-hooks": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/eslint-plugin-react-hooks/-/eslint-plugin-react-hooks-7.0.1.tgz", + "integrity": "sha512-O0d0m04evaNzEPoSW+59Mezf8Qt0InfgGIBJnpC0h3NH/WjUAR7BIKUfysC6todmtiZ/A0oUVS8Gce0WhBrHsA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/core": "^7.24.4", + "@babel/parser": "^7.24.4", + "hermes-parser": "^0.25.1", + "zod": "^3.25.0 || ^4.0.0", + "zod-validation-error": "^3.5.0 || ^4.0.0" + }, + "engines": { + "node": ">=18" + }, + "peerDependencies": { + "eslint": "^3.0.0 || ^4.0.0 || ^5.0.0 || ^6.0.0 || ^7.0.0 || ^8.0.0-0 || ^9.0.0" + } + }, + "node_modules/eslint-plugin-react-refresh": { + "version": "0.4.26", + "resolved": "https://registry.npmjs.org/eslint-plugin-react-refresh/-/eslint-plugin-react-refresh-0.4.26.tgz", + "integrity": "sha512-1RETEylht2O6FM/MvgnyvT+8K21wLqDNg4qD51Zj3guhjt433XbnnkVttHMyaVyAFD03QSV4LPS5iE3VQmO7XQ==", + "dev": true, + "license": "MIT", + "peerDependencies": { + "eslint": ">=8.40" + } + }, + "node_modules/eslint-scope": { + "version": "8.4.0", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-8.4.0.tgz", + "integrity": "sha512-sNXOfKCn74rt8RICKMvJS7XKV/Xk9kA7DyJr8mJik3S7Cwgy3qlkkmyS2uQB3jiJg6VNdZd/pDBJu0nvG2NlTg==", + "dev": true, + "license": "BSD-2-Clause", + "dependencies": { + "esrecurse": "^4.3.0", + "estraverse": "^5.2.0" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/eslint-visitor-keys": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-4.2.1.tgz", + "integrity": "sha512-Uhdk5sfqcee/9H/rCOJikYz67o0a2Tw2hGRPOG2Y1R2dg7brRe1uG0yaNQDHu+TO/uQPF/5eCapvYSmHUjt7JQ==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/espree": { + "version": "10.4.0", + "resolved": "https://registry.npmjs.org/espree/-/espree-10.4.0.tgz", + "integrity": "sha512-j6PAQ2uUr79PZhBjP5C5fhl8e39FmRnOjsD5lGnWrFU8i2G776tBK7+nP8KuQUTTyAZUwfQqXAgrVH5MbH9CYQ==", + "dev": true, + "license": "BSD-2-Clause", + "dependencies": { + "acorn": "^8.15.0", + "acorn-jsx": "^5.3.2", + "eslint-visitor-keys": "^4.2.1" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/esquery": { + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.7.0.tgz", + "integrity": "sha512-Ap6G0WQwcU/LHsvLwON1fAQX9Zp0A2Y6Y/cJBl9r/JbW90Zyg4/zbG6zzKa2OTALELarYHmKu0GhpM5EO+7T0g==", + "dev": true, + "license": "BSD-3-Clause", + "dependencies": { + "estraverse": "^5.1.0" + }, + "engines": { + "node": ">=0.10" + } + }, + "node_modules/esrecurse": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.3.0.tgz", + "integrity": "sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==", + "dev": true, + "license": "BSD-2-Clause", + "dependencies": { + "estraverse": "^5.2.0" + }, + "engines": { + "node": ">=4.0" + } + }, + "node_modules/estraverse": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", + "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", + "dev": true, + "license": "BSD-2-Clause", + "engines": { + "node": ">=4.0" + } + }, + "node_modules/esutils": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz", + "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==", + "dev": true, + "license": "BSD-2-Clause", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/etag": { + "version": "1.8.1", + "resolved": "https://registry.npmjs.org/etag/-/etag-1.8.1.tgz", + "integrity": "sha512-aIL5Fx7mawVa300al2BnEE4iNvo1qETxLrPI/o05L7z6go7fCw1J6EQmbK4FmJ2AS7kgVF/KEZWufBfdClMcPg==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/express": { + "version": "4.22.1", + "resolved": "https://registry.npmjs.org/express/-/express-4.22.1.tgz", + "integrity": "sha512-F2X8g9P1X7uCPZMA3MVf9wcTqlyNp7IhH5qPCI0izhaOIYXaW9L535tGA3qmjRzpH+bZczqq7hVKxTR4NWnu+g==", + "license": "MIT", + "dependencies": { + "accepts": "~1.3.8", + "array-flatten": "1.1.1", + "body-parser": "~1.20.3", + "content-disposition": "~0.5.4", + "content-type": "~1.0.4", + "cookie": "~0.7.1", + "cookie-signature": "~1.0.6", + "debug": "2.6.9", + "depd": "2.0.0", + "encodeurl": "~2.0.0", + "escape-html": "~1.0.3", + "etag": "~1.8.1", + "finalhandler": "~1.3.1", + "fresh": "~0.5.2", + "http-errors": "~2.0.0", + "merge-descriptors": "1.0.3", + "methods": "~1.1.2", + "on-finished": "~2.4.1", + "parseurl": "~1.3.3", + "path-to-regexp": "~0.1.12", + "proxy-addr": "~2.0.7", + "qs": "~6.14.0", + "range-parser": "~1.2.1", + "safe-buffer": "5.2.1", + "send": "~0.19.0", + "serve-static": "~1.16.2", + "setprototypeof": "1.2.0", + "statuses": "~2.0.1", + "type-is": "~1.6.18", + "utils-merge": "1.0.1", + "vary": "~1.1.2" + }, + "engines": { + "node": ">= 0.10.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" + } + }, + "node_modules/express/node_modules/cookie": { + "version": "0.7.2", + "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.7.2.tgz", + "integrity": "sha512-yki5XnKuf750l50uGTllt6kKILY4nQ1eNIQatoXEByZ5dWgnKqbnqmTrBE5B4N7lrMJKQ2ytWMiTO2o0v6Ew/w==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/express/node_modules/debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "license": "MIT", + "dependencies": { + "ms": "2.0.0" + } + }, + "node_modules/express/node_modules/ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==", + "license": "MIT" + }, + "node_modules/fast-deep-equal": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", + "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", + "dev": true, + "license": "MIT" + }, + "node_modules/fast-json-stable-stringify": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", + "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==", + "dev": true, + "license": "MIT" + }, + "node_modules/fast-levenshtein": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", + "integrity": "sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw==", + "dev": true, + "license": "MIT" + }, + "node_modules/fdir": { + "version": "6.5.0", + "resolved": "https://registry.npmjs.org/fdir/-/fdir-6.5.0.tgz", + "integrity": "sha512-tIbYtZbucOs0BRGqPJkshJUYdL+SDH7dVM8gjy+ERp3WAUjLEFJE+02kanyHtwjWOnwrKYBiwAmM0p4kLJAnXg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12.0.0" + }, + "peerDependencies": { + "picomatch": "^3 || ^4" + }, + "peerDependenciesMeta": { + "picomatch": { + "optional": true + } + } + }, + "node_modules/file-entry-cache": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-8.0.0.tgz", + "integrity": "sha512-XXTUwCvisa5oacNGRP9SfNtYBNAMi+RPwBFmblZEF7N7swHYQS6/Zfk7SRwx4D5j3CH211YNRco1DEMNVfZCnQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "flat-cache": "^4.0.0" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/finalhandler": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.3.2.tgz", + "integrity": "sha512-aA4RyPcd3badbdABGDuTXCMTtOneUCAYH/gxoYRTZlIJdF0YPWuGqiAsIrhNnnqdXGswYk6dGujem4w80UJFhg==", + "license": "MIT", + "dependencies": { + "debug": "2.6.9", + "encodeurl": "~2.0.0", + "escape-html": "~1.0.3", + "on-finished": "~2.4.1", + "parseurl": "~1.3.3", + "statuses": "~2.0.2", + "unpipe": "~1.0.0" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/finalhandler/node_modules/debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "license": "MIT", + "dependencies": { + "ms": "2.0.0" + } + }, + "node_modules/finalhandler/node_modules/ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==", + "license": "MIT" + }, + "node_modules/find-up": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz", + "integrity": "sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==", + "dev": true, + "license": "MIT", + "dependencies": { + "locate-path": "^6.0.0", + "path-exists": "^4.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/flat-cache": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-4.0.1.tgz", + "integrity": "sha512-f7ccFPK3SXFHpx15UIGyRJ/FJQctuKZ0zVuN3frBo4HnK3cay9VEW0R6yPYFHC0AgqhukPzKjq22t5DmAyqGyw==", + "dev": true, + "license": "MIT", + "dependencies": { + "flatted": "^3.2.9", + "keyv": "^4.5.4" + }, + "engines": { + "node": ">=16" + } + }, + "node_modules/flatted": { + "version": "3.4.1", + "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.4.1.tgz", + "integrity": "sha512-IxfVbRFVlV8V/yRaGzk0UVIcsKKHMSfYw66T/u4nTwlWteQePsxe//LjudR1AMX4tZW3WFCh3Zqa/sjlqpbURQ==", + "dev": true, + "license": "ISC" + }, + "node_modules/forwarded": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/forwarded/-/forwarded-0.2.0.tgz", + "integrity": "sha512-buRG0fpBtRHSTCOASe6hD258tEubFoRLb4ZNA6NxMVHNw2gOcwHo9wyablzMzOA5z9xA9L1KNjk/Nt6MT9aYow==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/fresh": { + "version": "0.5.2", + "resolved": "https://registry.npmjs.org/fresh/-/fresh-0.5.2.tgz", + "integrity": "sha512-zJ2mQYM18rEFOudeV4GShTGIQ7RbzA7ozbU9I/XBpm7kqgMywgmylMwXHxZJmkVoYkna9d2pVXVXPdYTP9ej8Q==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/fsevents": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz", + "integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==", + "dev": true, + "hasInstallScript": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": "^8.16.0 || ^10.6.0 || >=11.0.0" + } + }, + "node_modules/function-bind": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz", + "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==", + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/gensync": { + "version": "1.0.0-beta.2", + "resolved": "https://registry.npmjs.org/gensync/-/gensync-1.0.0-beta.2.tgz", + "integrity": "sha512-3hN7NaskYvMDLQY55gnW3NQ+mesEAepTqlg+VEbj7zzqEMBVNhzcGYYeqFo/TlYz6eQiFcp1HcsCZO+nGgS8zg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/get-caller-file": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", + "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==", + "dev": true, + "license": "ISC", + "engines": { + "node": "6.* || 8.* || >= 10.*" + } + }, + "node_modules/get-intrinsic": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.3.0.tgz", + "integrity": "sha512-9fSjSaos/fRIVIp+xSJlE6lfwhES7LNtKaCBIamHsjr2na1BiABJPo0mOjjz8GJDURarmCPGqaiVg5mfjb98CQ==", + "license": "MIT", + "dependencies": { + "call-bind-apply-helpers": "^1.0.2", + "es-define-property": "^1.0.1", + "es-errors": "^1.3.0", + "es-object-atoms": "^1.1.1", + "function-bind": "^1.1.2", + "get-proto": "^1.0.1", + "gopd": "^1.2.0", + "has-symbols": "^1.1.0", + "hasown": "^2.0.2", + "math-intrinsics": "^1.1.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/get-proto": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/get-proto/-/get-proto-1.0.1.tgz", + "integrity": "sha512-sTSfBjoXBp89JvIKIefqw7U2CCebsc74kiY6awiGogKtoSGbgjYE/G/+l9sF3MWFPNc9IcoOC4ODfKHfxFmp0g==", + "license": "MIT", + "dependencies": { + "dunder-proto": "^1.0.1", + "es-object-atoms": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/glob-parent": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-6.0.2.tgz", + "integrity": "sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A==", + "dev": true, + "license": "ISC", + "dependencies": { + "is-glob": "^4.0.3" + }, + "engines": { + "node": ">=10.13.0" + } + }, + "node_modules/globals": { + "version": "16.5.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-16.5.0.tgz", + "integrity": "sha512-c/c15i26VrJ4IRt5Z89DnIzCGDn9EcebibhAOjw5ibqEHsE1wLUgkPn9RDmNcUKyU87GeaL633nyJ+pplFR2ZQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/gopd": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.2.0.tgz", + "integrity": "sha512-ZUKRh6/kUFoAiTAtTYPZJ3hw9wNxx+BIBOijnlG9PnrJsCcSjs1wyyD6vJpaYtgnzDrKYRSqf3OO6Rfa93xsRg==", + "license": "MIT", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/has-symbols": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.1.0.tgz", + "integrity": "sha512-1cDNdwJ2Jaohmb3sg4OmKaMBwuC48sYni5HUw2DvsC8LjGTLK9h+eb1X6RyuOHe4hT0ULCW68iomhjUoKUqlPQ==", + "license": "MIT", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/hasown": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.2.tgz", + "integrity": "sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==", + "license": "MIT", + "dependencies": { + "function-bind": "^1.1.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/hermes-estree": { + "version": "0.25.1", + "resolved": "https://registry.npmjs.org/hermes-estree/-/hermes-estree-0.25.1.tgz", + "integrity": "sha512-0wUoCcLp+5Ev5pDW2OriHC2MJCbwLwuRx+gAqMTOkGKJJiBCLjtrvy4PWUGn6MIVefecRpzoOZ/UV6iGdOr+Cw==", + "dev": true, + "license": "MIT" + }, + "node_modules/hermes-parser": { + "version": "0.25.1", + "resolved": "https://registry.npmjs.org/hermes-parser/-/hermes-parser-0.25.1.tgz", + "integrity": "sha512-6pEjquH3rqaI6cYAXYPcz9MS4rY6R4ngRgrgfDshRptUZIc3lw0MCIJIGDj9++mfySOuPTHB4nrSW99BCvOPIA==", + "dev": true, + "license": "MIT", + "dependencies": { + "hermes-estree": "0.25.1" + } + }, + "node_modules/http-errors": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-2.0.1.tgz", + "integrity": "sha512-4FbRdAX+bSdmo4AUFuS0WNiPz8NgFt+r8ThgNWmlrjQjt1Q7ZR9+zTlce2859x4KSXrwIsaeTqDoKQmtP8pLmQ==", + "license": "MIT", + "dependencies": { + "depd": "~2.0.0", + "inherits": "~2.0.4", + "setprototypeof": "~1.2.0", + "statuses": "~2.0.2", + "toidentifier": "~1.0.1" + }, + "engines": { + "node": ">= 0.8" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" + } + }, + "node_modules/iconv-lite": { + "version": "0.4.24", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", + "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==", + "license": "MIT", + "dependencies": { + "safer-buffer": ">= 2.1.2 < 3" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/ignore": { + "version": "5.3.2", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.3.2.tgz", + "integrity": "sha512-hsBTNUqQTDwkWtcdYI2i06Y/nUBEsNEDJKjWdigLvegy8kDuJAS8uRlpkkcQpyEXL0Z/pjDy5HBmMjRCJ2gq+g==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 4" + } + }, + "node_modules/import-fresh": { + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.3.1.tgz", + "integrity": "sha512-TR3KfrTZTYLPB6jUjfx6MF9WcWrHL9su5TObK4ZkYgBdWKPOFoSoQIdEuTuR82pmtxH2spWG9h6etwfr1pLBqQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "parent-module": "^1.0.0", + "resolve-from": "^4.0.0" + }, + "engines": { + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/imurmurhash": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", + "integrity": "sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.8.19" + } + }, + "node_modules/inherits": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", + "license": "ISC" + }, + "node_modules/ipaddr.js": { + "version": "1.9.1", + "resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.9.1.tgz", + "integrity": "sha512-0KI/607xoxSToH7GjN1FfSbLoU0+btTicjsQSWQlh/hZykN8KpmMf7uYwPW3R+akZ6R/w18ZlXSHBYXiYUPO3g==", + "license": "MIT", + "engines": { + "node": ">= 0.10" + } + }, + "node_modules/is-extglob": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", + "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-fullwidth-code-point": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/is-glob": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", + "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", + "dev": true, + "license": "MIT", + "dependencies": { + "is-extglob": "^2.1.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/isexe": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", + "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==", + "dev": true, + "license": "ISC" + }, + "node_modules/js-tokens": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", + "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/js-yaml": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.1.tgz", + "integrity": "sha512-qQKT4zQxXl8lLwBtHMWwaTcGfFOZviOJet3Oy/xmGk2gZH677CJM9EvtfdSkgWcATZhj/55JZ0rmy3myCT5lsA==", + "dev": true, + "license": "MIT", + "dependencies": { + "argparse": "^2.0.1" + }, + "bin": { + "js-yaml": "bin/js-yaml.js" + } + }, + "node_modules/jsesc": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-3.1.0.tgz", + "integrity": "sha512-/sM3dO2FOzXjKQhJuo0Q173wf2KOo8t4I8vHy6lF9poUp7bKT0/NHE8fPX23PwfhnykfqnC2xRxOnVw5XuGIaA==", + "dev": true, + "license": "MIT", + "bin": { + "jsesc": "bin/jsesc" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/json-buffer": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/json-buffer/-/json-buffer-3.0.1.tgz", + "integrity": "sha512-4bV5BfR2mqfQTJm+V5tPPdf+ZpuhiIvTuAB5g8kcrXOZpTT/QwwVRWBywX1ozr6lEuPdbHxwaJlm9G6mI2sfSQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/json-schema-traverse": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", + "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", + "dev": true, + "license": "MIT" + }, + "node_modules/json-stable-stringify-without-jsonify": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz", + "integrity": "sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw==", + "dev": true, + "license": "MIT" + }, + "node_modules/json5": { + "version": "2.2.3", + "resolved": "https://registry.npmjs.org/json5/-/json5-2.2.3.tgz", + "integrity": "sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg==", + "dev": true, + "license": "MIT", + "bin": { + "json5": "lib/cli.js" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/keyv": { + "version": "4.5.4", + "resolved": "https://registry.npmjs.org/keyv/-/keyv-4.5.4.tgz", + "integrity": "sha512-oxVHkHR/EJf2CNXnWxRLW6mg7JyCCUcG0DtEGmL2ctUo1PNTin1PUil+r/+4r5MpVgC/fn1kjsx7mjSujKqIpw==", + "dev": true, + "license": "MIT", + "dependencies": { + "json-buffer": "3.0.1" + } + }, + "node_modules/levn": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/levn/-/levn-0.4.1.tgz", + "integrity": "sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "prelude-ls": "^1.2.1", + "type-check": "~0.4.0" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/locate-path": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz", + "integrity": "sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==", + "dev": true, + "license": "MIT", + "dependencies": { + "p-locate": "^5.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/lodash.merge": { + "version": "4.6.2", + "resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz", + "integrity": "sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/lru-cache": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-5.1.1.tgz", + "integrity": "sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w==", + "dev": true, + "license": "ISC", + "dependencies": { + "yallist": "^3.0.2" + } + }, + "node_modules/math-intrinsics": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/math-intrinsics/-/math-intrinsics-1.1.0.tgz", + "integrity": "sha512-/IXtbwEk5HTPyEwyKX6hGkYXxM9nbj64B+ilVJnC/R6B0pH5G4V3b0pVbL7DBj4tkhBAppbQUlf6F6Xl9LHu1g==", + "license": "MIT", + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/media-typer": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz", + "integrity": "sha512-dq+qelQ9akHpcOl/gUVRTxVIOkAJ1wR3QAvb4RsVjS8oVoFjDGTc679wJYmUmknUF5HwMLOgb5O+a3KxfWapPQ==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/merge-descriptors": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-1.0.3.tgz", + "integrity": "sha512-gaNvAS7TZ897/rVaZ0nMtAyxNyi/pdbjbAwUpFQpN70GqnVfOiXpeUUMKRBmzXaSQ8DdTX4/0ms62r2K+hE6mQ==", + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/methods": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/methods/-/methods-1.1.2.tgz", + "integrity": "sha512-iclAHeNqNm68zFtnZ0e+1L2yUIdvzNoauKU4WBA3VvH/vPFieF7qfRlwUZU+DA9P9bPXIS90ulxoUoCH23sV2w==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/mime": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/mime/-/mime-1.6.0.tgz", + "integrity": "sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg==", + "license": "MIT", + "bin": { + "mime": "cli.js" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/mime-db": { + "version": "1.52.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz", + "integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/mime-types": { + "version": "2.1.35", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz", + "integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==", + "license": "MIT", + "dependencies": { + "mime-db": "1.52.0" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/minimatch": { + "version": "3.1.5", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.5.tgz", + "integrity": "sha512-VgjWUsnnT6n+NUk6eZq77zeFdpW2LWDzP6zFGrCbHXiYNul5Dzqk2HHQ5uFH2DNW5Xbp8+jVzaeNt94ssEEl4w==", + "dev": true, + "license": "ISC", + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" + } + }, + "node_modules/ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", + "license": "MIT" + }, + "node_modules/nanoid": { + "version": "3.3.11", + "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.11.tgz", + "integrity": "sha512-N8SpfPUnUp1bK+PMYW8qSWdl9U+wwNWI4QKxOYDy9JAro3WMX7p2OeVRF9v+347pnakNevPmiHhNmZ2HbFA76w==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "license": "MIT", + "bin": { + "nanoid": "bin/nanoid.cjs" + }, + "engines": { + "node": "^10 || ^12 || ^13.7 || ^14 || >=15.0.1" + } + }, + "node_modules/natural-compare": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", + "integrity": "sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==", + "dev": true, + "license": "MIT" + }, + "node_modules/negotiator": { + "version": "0.6.3", + "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.3.tgz", + "integrity": "sha512-+EUsqGPLsM+j/zdChZjsnX51g4XrHFOIXwfnCVPGlQk/k5giakcKsuxCObBRu6DSm9opw/O6slWbJdghQM4bBg==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/node-releases": { + "version": "2.0.36", + "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.36.tgz", + "integrity": "sha512-TdC8FSgHz8Mwtw9g5L4gR/Sh9XhSP/0DEkQxfEFXOpiul5IiHgHan2VhYYb6agDSfp4KuvltmGApc8HMgUrIkA==", + "dev": true, + "license": "MIT" + }, + "node_modules/object-assign": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", + "integrity": "sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==", + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/object-inspect": { + "version": "1.13.4", + "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.4.tgz", + "integrity": "sha512-W67iLl4J2EXEGTbfeHCffrjDfitvLANg0UlX3wFUUSTx92KXRFegMHUVgSqE+wvhAbi4WqjGg9czysTV2Epbew==", + "license": "MIT", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/on-finished": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.4.1.tgz", + "integrity": "sha512-oVlzkg3ENAhCk2zdv7IJwd/QUD4z2RxRwpkcGY8psCVcCYZNq4wYnVWALHM+brtuJjePWiYF/ClmuDr8Ch5+kg==", + "license": "MIT", + "dependencies": { + "ee-first": "1.1.1" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/optionator": { + "version": "0.9.4", + "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.4.tgz", + "integrity": "sha512-6IpQ7mKUxRcZNLIObR0hz7lxsapSSIYNZJwXPGeF0mTVqGKFIXj1DQcMoT22S3ROcLyY/rz0PWaWZ9ayWmad9g==", + "dev": true, + "license": "MIT", + "dependencies": { + "deep-is": "^0.1.3", + "fast-levenshtein": "^2.0.6", + "levn": "^0.4.1", + "prelude-ls": "^1.2.1", + "type-check": "^0.4.0", + "word-wrap": "^1.2.5" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/p-limit": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", + "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "yocto-queue": "^0.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/p-locate": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-5.0.0.tgz", + "integrity": "sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==", + "dev": true, + "license": "MIT", + "dependencies": { + "p-limit": "^3.0.2" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/parent-module": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz", + "integrity": "sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==", + "dev": true, + "license": "MIT", + "dependencies": { + "callsites": "^3.0.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/parseurl": { + "version": "1.3.3", + "resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.3.tgz", + "integrity": "sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ==", + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/path-exists": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", + "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/path-key": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", + "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/path-to-regexp": { + "version": "0.1.12", + "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.12.tgz", + "integrity": "sha512-RA1GjUVMnvYFxuqovrEqZoxxW5NUZqbwKtYz/Tt7nXerk0LbLblQmrsgdeOxV5SFHf0UDggjS/bSeOZwt1pmEQ==", + "license": "MIT" + }, + "node_modules/picocolors": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.1.1.tgz", + "integrity": "sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==", + "dev": true, + "license": "ISC" + }, + "node_modules/picomatch": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.3.tgz", + "integrity": "sha512-5gTmgEY/sqK6gFXLIsQNH19lWb4ebPDLA4SdLP7dsWkIXHWlG66oPuVvXSGFPppYZz8ZDZq0dYYrbHfBCVUb1Q==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/jonschlinkert" + } + }, + "node_modules/postcss": { + "version": "8.5.8", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.5.8.tgz", + "integrity": "sha512-OW/rX8O/jXnm82Ey1k44pObPtdblfiuWnrd8X7GJ7emImCOstunGbXUpp7HdBrFQX6rJzn3sPT397Wp5aCwCHg==", + "dev": true, + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/postcss/" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/postcss" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "license": "MIT", + "dependencies": { + "nanoid": "^3.3.11", + "picocolors": "^1.1.1", + "source-map-js": "^1.2.1" + }, + "engines": { + "node": "^10 || ^12 || >=14" + } + }, + "node_modules/prelude-ls": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.2.1.tgz", + "integrity": "sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/proxy-addr": { + "version": "2.0.7", + "resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.7.tgz", + "integrity": "sha512-llQsMLSUDUPT44jdrU/O37qlnifitDP+ZwrmmZcoSKyLKvtZxpyV0n2/bD/N4tBAAZ/gJEdZU7KMraoK1+XYAg==", + "license": "MIT", + "dependencies": { + "forwarded": "0.2.0", + "ipaddr.js": "1.9.1" + }, + "engines": { + "node": ">= 0.10" + } + }, + "node_modules/punycode": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.1.tgz", + "integrity": "sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/qs": { + "version": "6.14.2", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.14.2.tgz", + "integrity": "sha512-V/yCWTTF7VJ9hIh18Ugr2zhJMP01MY7c5kh4J870L7imm6/DIzBsNLTXzMwUA3yZ5b/KBqLx8Kp3uRvd7xSe3Q==", + "license": "BSD-3-Clause", + "dependencies": { + "side-channel": "^1.1.0" + }, + "engines": { + "node": ">=0.6" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/range-parser": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/range-parser/-/range-parser-1.2.1.tgz", + "integrity": "sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/raw-body": { + "version": "2.5.3", + "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.5.3.tgz", + "integrity": "sha512-s4VSOf6yN0rvbRZGxs8Om5CWj6seneMwK3oDb4lWDH0UPhWcxwOWw5+qk24bxq87szX1ydrwylIOp2uG1ojUpA==", + "license": "MIT", + "dependencies": { + "bytes": "~3.1.2", + "http-errors": "~2.0.1", + "iconv-lite": "~0.4.24", + "unpipe": "~1.0.0" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/react": { + "version": "19.2.4", + "resolved": "https://registry.npmjs.org/react/-/react-19.2.4.tgz", + "integrity": "sha512-9nfp2hYpCwOjAN+8TZFGhtWEwgvWHXqESH8qT89AT/lWklpLON22Lc8pEtnpsZz7VmawabSU0gCjnj8aC0euHQ==", + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/react-dom": { + "version": "19.2.4", + "resolved": "https://registry.npmjs.org/react-dom/-/react-dom-19.2.4.tgz", + "integrity": "sha512-AXJdLo8kgMbimY95O2aKQqsz2iWi9jMgKJhRBAxECE4IFxfcazB2LmzloIoibJI3C12IlY20+KFaLv+71bUJeQ==", + "license": "MIT", + "dependencies": { + "scheduler": "^0.27.0" + }, + "peerDependencies": { + "react": "^19.2.4" + } + }, + "node_modules/react-refresh": { + "version": "0.18.0", + "resolved": "https://registry.npmjs.org/react-refresh/-/react-refresh-0.18.0.tgz", + "integrity": "sha512-QgT5//D3jfjJb6Gsjxv0Slpj23ip+HtOpnNgnb2S5zU3CB26G/IDPGoy4RJB42wzFE46DRsstbW6tKHoKbhAxw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/react-router": { + "version": "7.13.1", + "resolved": "https://registry.npmjs.org/react-router/-/react-router-7.13.1.tgz", + "integrity": "sha512-td+xP4X2/6BJvZoX6xw++A2DdEi++YypA69bJUV5oVvqf6/9/9nNlD70YO1e9d3MyamJEBQFEzk6mbfDYbqrSA==", + "license": "MIT", + "dependencies": { + "cookie": "^1.0.1", + "set-cookie-parser": "^2.6.0" + }, + "engines": { + "node": ">=20.0.0" + }, + "peerDependencies": { + "react": ">=18", + "react-dom": ">=18" + }, + "peerDependenciesMeta": { + "react-dom": { + "optional": true + } + } + }, + "node_modules/react-router-dom": { + "version": "7.13.1", + "resolved": "https://registry.npmjs.org/react-router-dom/-/react-router-dom-7.13.1.tgz", + "integrity": "sha512-UJnV3Rxc5TgUPJt2KJpo1Jpy0OKQr0AjgbZzBFjaPJcFOb2Y8jA5H3LT8HUJAiRLlWrEXWHbF1Z4SCZaQjWDHw==", + "license": "MIT", + "dependencies": { + "react-router": "7.13.1" + }, + "engines": { + "node": ">=20.0.0" + }, + "peerDependencies": { + "react": ">=18", + "react-dom": ">=18" + } + }, + "node_modules/require-directory": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", + "integrity": "sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/resolve-from": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz", + "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=4" + } + }, + "node_modules/rollup": { + "version": "4.59.0", + "resolved": "https://registry.npmjs.org/rollup/-/rollup-4.59.0.tgz", + "integrity": "sha512-2oMpl67a3zCH9H79LeMcbDhXW/UmWG/y2zuqnF2jQq5uq9TbM9TVyXvA4+t+ne2IIkBdrLpAaRQAvo7YI/Yyeg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/estree": "1.0.8" + }, + "bin": { + "rollup": "dist/bin/rollup" + }, + "engines": { + "node": ">=18.0.0", + "npm": ">=8.0.0" + }, + "optionalDependencies": { + "@rollup/rollup-android-arm-eabi": "4.59.0", + "@rollup/rollup-android-arm64": "4.59.0", + "@rollup/rollup-darwin-arm64": "4.59.0", + "@rollup/rollup-darwin-x64": "4.59.0", + "@rollup/rollup-freebsd-arm64": "4.59.0", + "@rollup/rollup-freebsd-x64": "4.59.0", + "@rollup/rollup-linux-arm-gnueabihf": "4.59.0", + "@rollup/rollup-linux-arm-musleabihf": "4.59.0", + "@rollup/rollup-linux-arm64-gnu": "4.59.0", + "@rollup/rollup-linux-arm64-musl": "4.59.0", + "@rollup/rollup-linux-loong64-gnu": "4.59.0", + "@rollup/rollup-linux-loong64-musl": "4.59.0", + "@rollup/rollup-linux-ppc64-gnu": "4.59.0", + "@rollup/rollup-linux-ppc64-musl": "4.59.0", + "@rollup/rollup-linux-riscv64-gnu": "4.59.0", + "@rollup/rollup-linux-riscv64-musl": "4.59.0", + "@rollup/rollup-linux-s390x-gnu": "4.59.0", + "@rollup/rollup-linux-x64-gnu": "4.59.0", + "@rollup/rollup-linux-x64-musl": "4.59.0", + "@rollup/rollup-openbsd-x64": "4.59.0", + "@rollup/rollup-openharmony-arm64": "4.59.0", + "@rollup/rollup-win32-arm64-msvc": "4.59.0", + "@rollup/rollup-win32-ia32-msvc": "4.59.0", + "@rollup/rollup-win32-x64-gnu": "4.59.0", + "@rollup/rollup-win32-x64-msvc": "4.59.0", + "fsevents": "~2.3.2" + } + }, + "node_modules/rxjs": { + "version": "7.8.2", + "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-7.8.2.tgz", + "integrity": "sha512-dhKf903U/PQZY6boNNtAGdWbG85WAbjT/1xYoZIC7FAY0yWapOBQVsVrDl58W86//e1VpMNBtRV4MaXfdMySFA==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "tslib": "^2.1.0" + } + }, + "node_modules/safe-buffer": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", + "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "license": "MIT" + }, + "node_modules/safer-buffer": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", + "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==", + "license": "MIT" + }, + "node_modules/scheduler": { + "version": "0.27.0", + "resolved": "https://registry.npmjs.org/scheduler/-/scheduler-0.27.0.tgz", + "integrity": "sha512-eNv+WrVbKu1f3vbYJT/xtiF5syA5HPIMtf9IgY/nKg0sWqzAUEvqY/xm7OcZc/qafLx/iO9FgOmeSAp4v5ti/Q==", + "license": "MIT" + }, + "node_modules/semver": { + "version": "6.3.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", + "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", + "dev": true, + "license": "ISC", + "bin": { + "semver": "bin/semver.js" + } + }, + "node_modules/send": { + "version": "0.19.2", + "resolved": "https://registry.npmjs.org/send/-/send-0.19.2.tgz", + "integrity": "sha512-VMbMxbDeehAxpOtWJXlcUS5E8iXh6QmN+BkRX1GARS3wRaXEEgzCcB10gTQazO42tpNIya8xIyNx8fll1OFPrg==", + "license": "MIT", + "dependencies": { + "debug": "2.6.9", + "depd": "2.0.0", + "destroy": "1.2.0", + "encodeurl": "~2.0.0", + "escape-html": "~1.0.3", + "etag": "~1.8.1", + "fresh": "~0.5.2", + "http-errors": "~2.0.1", + "mime": "1.6.0", + "ms": "2.1.3", + "on-finished": "~2.4.1", + "range-parser": "~1.2.1", + "statuses": "~2.0.2" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/send/node_modules/debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "license": "MIT", + "dependencies": { + "ms": "2.0.0" + } + }, + "node_modules/send/node_modules/debug/node_modules/ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==", + "license": "MIT" + }, + "node_modules/serve-static": { + "version": "1.16.3", + "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.16.3.tgz", + "integrity": "sha512-x0RTqQel6g5SY7Lg6ZreMmsOzncHFU7nhnRWkKgWuMTu5NN0DR5oruckMqRvacAN9d5w6ARnRBXl9xhDCgfMeA==", + "license": "MIT", + "dependencies": { + "encodeurl": "~2.0.0", + "escape-html": "~1.0.3", + "parseurl": "~1.3.3", + "send": "~0.19.1" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/set-cookie-parser": { + "version": "2.7.2", + "resolved": "https://registry.npmjs.org/set-cookie-parser/-/set-cookie-parser-2.7.2.tgz", + "integrity": "sha512-oeM1lpU/UvhTxw+g3cIfxXHyJRc/uidd3yK1P242gzHds0udQBYzs3y8j4gCCW+ZJ7ad0yctld8RYO+bdurlvw==", + "license": "MIT" + }, + "node_modules/setprototypeof": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.2.0.tgz", + "integrity": "sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw==", + "license": "ISC" + }, + "node_modules/shebang-command": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", + "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", + "dev": true, + "license": "MIT", + "dependencies": { + "shebang-regex": "^3.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/shebang-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", + "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/shell-quote": { + "version": "1.8.3", + "resolved": "https://registry.npmjs.org/shell-quote/-/shell-quote-1.8.3.tgz", + "integrity": "sha512-ObmnIF4hXNg1BqhnHmgbDETF8dLPCggZWBjkQfhZpbszZnYur5DUljTcCHii5LC3J5E0yeO/1LIMyH+UvHQgyw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/side-channel": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.1.0.tgz", + "integrity": "sha512-ZX99e6tRweoUXqR+VBrslhda51Nh5MTQwou5tnUDgbtyM0dBgmhEDtWGP/xbKn6hqfPRHujUNwz5fy/wbbhnpw==", + "license": "MIT", + "dependencies": { + "es-errors": "^1.3.0", + "object-inspect": "^1.13.3", + "side-channel-list": "^1.0.0", + "side-channel-map": "^1.0.1", + "side-channel-weakmap": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/side-channel-list": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/side-channel-list/-/side-channel-list-1.0.0.tgz", + "integrity": "sha512-FCLHtRD/gnpCiCHEiJLOwdmFP+wzCmDEkc9y7NsYxeF4u7Btsn1ZuwgwJGxImImHicJArLP4R0yX4c2KCrMrTA==", + "license": "MIT", + "dependencies": { + "es-errors": "^1.3.0", + "object-inspect": "^1.13.3" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/side-channel-map": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/side-channel-map/-/side-channel-map-1.0.1.tgz", + "integrity": "sha512-VCjCNfgMsby3tTdo02nbjtM/ewra6jPHmpThenkTYh8pG9ucZ/1P8So4u4FGBek/BjpOVsDCMoLA/iuBKIFXRA==", + "license": "MIT", + "dependencies": { + "call-bound": "^1.0.2", + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.5", + "object-inspect": "^1.13.3" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/side-channel-weakmap": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/side-channel-weakmap/-/side-channel-weakmap-1.0.2.tgz", + "integrity": "sha512-WPS/HvHQTYnHisLo9McqBHOJk2FkHO/tlpvldyrnem4aeQp4hai3gythswg6p01oSoTl58rcpiFAjF2br2Ak2A==", + "license": "MIT", + "dependencies": { + "call-bound": "^1.0.2", + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.5", + "object-inspect": "^1.13.3", + "side-channel-map": "^1.0.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/source-map-js": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.2.1.tgz", + "integrity": "sha512-UXWMKhLOwVKb728IUtQPXxfYU+usdybtUrK/8uGE8CQMvrhOpwvzDBwj0QhSL7MQc7vIsISBG8VQ8+IDQxpfQA==", + "dev": true, + "license": "BSD-3-Clause", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/sql.js": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/sql.js/-/sql.js-1.14.1.tgz", + "integrity": "sha512-gcj8zBWU5cFsi9WUP+4bFNXAyF1iRpA3LLyS/DP5xlrNzGmPIizUeBggKa8DbDwdqaKwUcTEnChtd2grWo/x/A==", + "license": "MIT" + }, + "node_modules/statuses": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/statuses/-/statuses-2.0.2.tgz", + "integrity": "sha512-DvEy55V3DB7uknRo+4iOGT5fP1slR8wQohVdknigZPMpMstaKJQWhwiYBACJE3Ul2pTnATihhBYnRhZQHGBiRw==", + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/string-width": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "dev": true, + "license": "MIT", + "dependencies": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/strip-json-comments": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz", + "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "license": "MIT", + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/tinyglobby": { + "version": "0.2.15", + "resolved": "https://registry.npmjs.org/tinyglobby/-/tinyglobby-0.2.15.tgz", + "integrity": "sha512-j2Zq4NyQYG5XMST4cbs02Ak8iJUdxRM0XI5QyxXuZOzKOINmWurp3smXu3y5wDcJrptwpSjgXHzIQxR0omXljQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "fdir": "^6.5.0", + "picomatch": "^4.0.3" + }, + "engines": { + "node": ">=12.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/SuperchupuDev" + } + }, + "node_modules/toidentifier": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.1.tgz", + "integrity": "sha512-o5sSPKEkg/DIQNmH43V0/uerLrpzVedkUh8tGNvaeXpfpuwjKenlSox/2O/BTlZUtEe+JG7s5YhEz608PlAHRA==", + "license": "MIT", + "engines": { + "node": ">=0.6" + } + }, + "node_modules/tree-kill": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/tree-kill/-/tree-kill-1.2.2.tgz", + "integrity": "sha512-L0Orpi8qGpRG//Nd+H90vFB+3iHnue1zSSGmNOOCh1GLJ7rUKVwV2HvijphGQS2UmhUZewS9VgvxYIdgr+fG1A==", + "dev": true, + "license": "MIT", + "bin": { + "tree-kill": "cli.js" + } + }, + "node_modules/tslib": { + "version": "2.8.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.8.1.tgz", + "integrity": "sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==", + "dev": true, + "license": "0BSD" + }, + "node_modules/type-check": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz", + "integrity": "sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==", + "dev": true, + "license": "MIT", + "dependencies": { + "prelude-ls": "^1.2.1" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/type-is": { + "version": "1.6.18", + "resolved": "https://registry.npmjs.org/type-is/-/type-is-1.6.18.tgz", + "integrity": "sha512-TkRKr9sUTxEH8MdfuCSP7VizJyzRNMjj2J2do2Jr3Kym598JVdEksuzPQCnlFPW4ky9Q+iA+ma9BGm06XQBy8g==", + "license": "MIT", + "dependencies": { + "media-typer": "0.3.0", + "mime-types": "~2.1.24" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/unpipe": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz", + "integrity": "sha512-pjy2bYhSsufwWlKwPc+l3cN7+wuJlK6uz0YdJEOlQDbl6jo/YlPi4mb8agUkVC8BF7V8NuzeyPNqRksA3hztKQ==", + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/update-browserslist-db": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.2.3.tgz", + "integrity": "sha512-Js0m9cx+qOgDxo0eMiFGEueWztz+d4+M3rGlmKPT+T4IS/jP4ylw3Nwpu6cpTTP8R1MAC1kF4VbdLt3ARf209w==", + "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" + } + ], + "license": "MIT", + "dependencies": { + "escalade": "^3.2.0", + "picocolors": "^1.1.1" + }, + "bin": { + "update-browserslist-db": "cli.js" + }, + "peerDependencies": { + "browserslist": ">= 4.21.0" + } + }, + "node_modules/uri-js": { + "version": "4.4.1", + "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz", + "integrity": "sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==", + "dev": true, + "license": "BSD-2-Clause", + "dependencies": { + "punycode": "^2.1.0" + } + }, + "node_modules/utils-merge": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/utils-merge/-/utils-merge-1.0.1.tgz", + "integrity": "sha512-pMZTvIkT1d+TFGvDOqodOclx0QWkkgi6Tdoa8gC8ffGAAqz9pzPTZWAybbsHHoED/ztMtkv/VoYTYyShUn81hA==", + "license": "MIT", + "engines": { + "node": ">= 0.4.0" + } + }, + "node_modules/vary": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz", + "integrity": "sha512-BNGbWLfd0eUPabhkXUVm0j8uuvREyTh5ovRa/dyow/BqAbZJyC+5fU+IzQOzmAKzYqYRAISoRhdQr3eIZ/PXqg==", + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/vite": { + "version": "7.3.1", + "resolved": "https://registry.npmjs.org/vite/-/vite-7.3.1.tgz", + "integrity": "sha512-w+N7Hifpc3gRjZ63vYBXA56dvvRlNWRczTdmCBBa+CotUzAPf5b7YMdMR/8CQoeYE5LX3W4wj6RYTgonm1b9DA==", + "dev": true, + "license": "MIT", + "dependencies": { + "esbuild": "^0.27.0", + "fdir": "^6.5.0", + "picomatch": "^4.0.3", + "postcss": "^8.5.6", + "rollup": "^4.43.0", + "tinyglobby": "^0.2.15" + }, + "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" + }, + "peerDependencies": { + "@types/node": "^20.19.0 || >=22.12.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", + "sugarss": "^5.0.0", + "terser": "^5.16.0", + "tsx": "^4.8.1", + "yaml": "^2.4.2" + }, + "peerDependenciesMeta": { + "@types/node": { + "optional": true + }, + "jiti": { + "optional": true + }, + "less": { + "optional": true + }, + "lightningcss": { + "optional": true + }, + "sass": { + "optional": true + }, + "sass-embedded": { + "optional": true + }, + "stylus": { + "optional": true + }, + "sugarss": { + "optional": true + }, + "terser": { + "optional": true + }, + "tsx": { + "optional": true + }, + "yaml": { + "optional": true + } + } + }, + "node_modules/which": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", + "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", + "dev": true, + "license": "ISC", + "dependencies": { + "isexe": "^2.0.0" + }, + "bin": { + "node-which": "bin/node-which" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/word-wrap": { + "version": "1.2.5", + "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.5.tgz", + "integrity": "sha512-BN22B5eaMMI9UMtjrGd5g5eCYPpCPDUy0FJXbYsaT5zYxjFOckS53SQDE3pWkVoWpHXVb3BrYcEN4Twa55B5cA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/wrap-ansi": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", + "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/wrap-ansi?sponsor=1" + } + }, + "node_modules/y18n": { + "version": "5.0.8", + "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz", + "integrity": "sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==", + "dev": true, + "license": "ISC", + "engines": { + "node": ">=10" + } + }, + "node_modules/yallist": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-3.1.1.tgz", + "integrity": "sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==", + "dev": true, + "license": "ISC" + }, + "node_modules/yargs": { + "version": "17.7.2", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-17.7.2.tgz", + "integrity": "sha512-7dSzzRQ++CKnNI/krKnYRV7JKKPUXMEh61soaHKg9mrWEhzFWhFnxPxGl+69cD1Ou63C13NUPCnmIcrvqCuM6w==", + "dev": true, + "license": "MIT", + "dependencies": { + "cliui": "^8.0.1", + "escalade": "^3.1.1", + "get-caller-file": "^2.0.5", + "require-directory": "^2.1.1", + "string-width": "^4.2.3", + "y18n": "^5.0.5", + "yargs-parser": "^21.1.1" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/yargs-parser": { + "version": "21.1.1", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-21.1.1.tgz", + "integrity": "sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==", + "dev": true, + "license": "ISC", + "engines": { + "node": ">=12" + } + }, + "node_modules/yocto-queue": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz", + "integrity": "sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/zod": { + "version": "4.3.6", + "resolved": "https://registry.npmjs.org/zod/-/zod-4.3.6.tgz", + "integrity": "sha512-rftlrkhHZOcjDwkGlnUtZZkvaPHCsDATp4pGpuOOMDaTdDDXF91wuVDJoWoPsKX/3YPQ5fHuF3STjcYyKr+Qhg==", + "dev": true, + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/colinhacks" + } + }, + "node_modules/zod-validation-error": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/zod-validation-error/-/zod-validation-error-4.0.2.tgz", + "integrity": "sha512-Q6/nZLe6jxuU80qb/4uJ4t5v2VEZ44lzQjPDhYJNztRQ4wyWc6VF3D3Kb/fAuPetZQnhS3hnajCf9CsWesghLQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=18.0.0" + }, + "peerDependencies": { + "zod": "^3.25.0 || ^4.0.0" + } + } + } +} diff --git a/package.json b/package.json new file mode 100644 index 0000000..e35251c --- /dev/null +++ b/package.json @@ -0,0 +1,36 @@ +{ + "name": "vps-tracker", + "private": true, + "version": "0.0.0", + "type": "module", + "scripts": { + "dev": "concurrently \"npm run server\" \"vite\"", + "server": "node server/index.js", + "build": "vite build", + "lint": "eslint .", + "preview": "vite preview" + }, + "dependencies": { + "@tabler/core": "^1.4.0", + "@tabler/icons-react": "^3.40.0", + "chart.js": "^4.5.1", + "react": "^19.2.0", + "react-dom": "^19.2.0", + "react-router-dom": "^7.13.1", + "sql.js": "^1.14.0", + "cors": "^2.8.5", + "express": "^4.21.1" + }, + "devDependencies": { + "@eslint/js": "^9.39.1", + "@types/react": "^19.2.7", + "@types/react-dom": "^19.2.3", + "@vitejs/plugin-react": "^5.1.1", + "eslint": "^9.39.1", + "eslint-plugin-react-hooks": "^7.0.1", + "eslint-plugin-react-refresh": "^0.4.24", + "concurrently": "^9.1.0", + "globals": "^16.5.0", + "vite": "^7.3.1" + } +} diff --git a/public/vite.svg b/public/vite.svg new file mode 100644 index 0000000..e7b8dfb --- /dev/null +++ b/public/vite.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/server/adapters/billmanager/client.js b/server/adapters/billmanager/client.js new file mode 100644 index 0000000..50c77b6 --- /dev/null +++ b/server/adapters/billmanager/client.js @@ -0,0 +1,30 @@ +/** + * BILLmanager 6 API HTTP client + * @see https://www.ispsystem.com/docs/b6c/developer-section/working-with-api/guide-to-ispsystem-software-api + */ + +/** + * @param {string} baseUrl - e.g. https://bill.example.com:1500/billmgr + * @param {string} authinfo - username:password + * @param {string} func - API function name (vds, payment, dedic) + * @param {Record} [params] - additional query params + * @returns {Promise} + */ +export async function billmanagerRequest(baseUrl, authinfo, func, params = {}) { + const url = new URL(baseUrl) + url.searchParams.set('authinfo', authinfo) + url.searchParams.set('out', 'bjson') + url.searchParams.set('func', func) + for (const [k, v] of Object.entries(params)) { + if (v != null && v !== '') url.searchParams.set(k, String(v)) + } + const res = await fetch(url.toString(), { method: 'GET' }) + if (!res.ok) { + throw new Error(`BILLmanager API HTTP ${res.status}: ${res.statusText}`) + } + const data = await res.json() + if (data.error) { + throw new Error(data.error.msg || data.error.$t || 'BILLmanager API error') + } + return data +} diff --git a/server/adapters/billmanager/index.js b/server/adapters/billmanager/index.js new file mode 100644 index 0000000..7532df2 --- /dev/null +++ b/server/adapters/billmanager/index.js @@ -0,0 +1,9 @@ +/** + * BILLmanager 6 API adapter + * @see https://www.ispsystem.com/docs/b6c/developer-section/working-with-api/guide-to-ispsystem-software-api + * @see https://www.ispsystem.com/docs/b6c/developer-section/billmanager-api/virtual-private-servers-vds + * @see https://www.ispsystem.com/docs/b6c/developer-section/billmanager-api/payments-payment + */ + +export { testConnection, fetchVds, fetchDashboardInfo, fetchPayments, fetchVdsOrderPricelist, fetchVdsOrderPricelistAllDatacenters } from './operations.js' +export { syncFromBillmanager } from './sync.js' diff --git a/server/adapters/billmanager/mappers.js b/server/adapters/billmanager/mappers.js new file mode 100644 index 0000000..411750b --- /dev/null +++ b/server/adapters/billmanager/mappers.js @@ -0,0 +1,94 @@ +/** + * BILLmanager API response → vps-tracker model mappers + */ + +import { parsePricelist } from './parsers.js' + +/** BILLmanager VDS status: 1=ordered, 2=active, 3=suspended, 4=deleted, 5=processing */ +const VDS_STATUS_MAP = { + 1: 'active', + 2: 'active', + 3: 'paused', + 4: 'archived', + 5: 'active', +} + +/** + * @param {object} item - BILLmanager vds item + * @returns {object} vps-tracker vps shape + */ +export function mapVdsToVps(item, providerId, providerAccountId) { + const status = VDS_STATUS_MAP[Number(item.item_status_orig ?? item.item_status)] ?? 'active' + // cost: "100.00 RUB / Месяц" — приоритет для ежемесячного платежа; item_cost — запасной + const costStr = String(item.cost || '').replace(/[^\d.-]/g, '') + const cost = parseFloat(costStr) || parseFloat(item.item_cost) || 0 + const createdate = item.createdate || '' + const expiredate = item.real_expiredate || item.expiredate || '' + const ip = (item.ip || '').trim() + const domain = (item.domain || '').trim() + const datacenter = (item.datacentername || item.datacenter || '').trim() + const ostempl = (item.ostempl || '').trim() + const currency = (item.currency_str || 'RUB').toString().trim() || 'RUB' + + const pricelist = item.pricelist || item.tariff || item.plan || '' + const parsed = parsePricelist(pricelist) + + return { + externalId: String(item.id || ''), + ip: ip || domain || `bm-${item.id}`, + dns: domain || ip || '', + ipv6: '', + additionalIps: [], + providerId, + providerAccountId, + country: '', + city: '', + datacenter, + os: ostempl, + vcpu: parsed.vcpu || 0, + ramGb: parsed.ramGb || 0, + diskGb: parsed.diskGb || 0, + diskType: parsed.diskType || 'NVMe', + virtualization: parsed.virtualization || 'KVM', + bandwidthTb: 0, + sshPort: 22, + rootUser: 'root', + purpose: '', + environment: 'prod', + project: '', + monitoringEnabled: false, + backupEnabled: false, + status, + tariffType: 'monthly', + currency: currency || 'RUB', + dailyRate: null, + monthlyRate: cost || null, + createdAt: createdate ? createdate.slice(0, 10) : new Date().toISOString().slice(0, 10), + paidUntil: expiredate ? expiredate.slice(0, 10) : '', + notes: `bm-${item.id}`, + } +} + +/** + * @param {object} item - BILLmanager payment item + * @returns {object|null} vps-tracker payment shape or null if not credited + */ +export function mapPaymentToPayment(item, providerAccountId) { + const rawAmount = item.subaccountamount_iso || item.paymethodamount_iso || '0' + const amount = parseFloat(String(rawAmount).replace(/[^\d.-]/g, '')) || 0 + const createDate = item.create_date || item.createdate || '' + const dateStr = createDate ? String(createDate).slice(0, 10) : new Date().toISOString().slice(0, 10) + // status_orig / real_status = "4" (credited), item.status может быть "Зачислен" + const statusNum = Number(item.status_orig ?? item.real_status ?? item.status) + if (statusNum !== 4) return null + return { + externalId: String(item.id || ''), + type: 'provider_balance_topup', + date: dateStr, + amount, + currency: (String(item.subaccountamount_iso || item.paymethodamount_iso || '').match(/([A-Z]{3})\b/) || [])[1] || 'USD', + providerAccountId, + vpsId: null, + note: `BILLmanager #${item.number || item.id}`, + } +} diff --git a/server/adapters/billmanager/operations.js b/server/adapters/billmanager/operations.js new file mode 100644 index 0000000..f271647 --- /dev/null +++ b/server/adapters/billmanager/operations.js @@ -0,0 +1,169 @@ +/** + * BILLmanager API operations — fetch VDS, payments, dashboard, tariffs + */ + +import { billmanagerRequest } from './client.js' +import { extractList, elemToObject, parseTariffDesc, parseDatacenterName, extractTariflist } from './parsers.js' + +/** + * @param {string} baseUrl + * @param {string} authinfo + * @returns {Promise} list of vps objects (raw BILLmanager format) + */ +export async function fetchVds(baseUrl, authinfo) { + const data = await billmanagerRequest(baseUrl, authinfo, 'vds') + const elems = extractList(data, 'vds') + return elems.map((e) => elemToObject(e)) +} + +/** + * Получить текущий баланс аккаунта (dashboard.info) + * @param {string} baseUrl - e.g. https://billing.example.com/billmgr + * @param {string} authinfo - username:password + * @param {object} [opts] - { fallbackCurrency } — валюта аккаунта, если API не возвращает + * @returns {Promise<{ balance: number, currency: string, enoughmoneyto?: string, realbalance?: string }>} + */ +export async function fetchDashboardInfo(baseUrl, authinfo, opts = {}) { + const data = await billmanagerRequest(baseUrl, authinfo, 'dashboard.info', { + dashboard: 'info', + sfrom: 'ajax', + }) + const elems = extractList(data, 'dashboard') || (Array.isArray(data.elem) ? data.elem : []) + const item = elems.length > 0 ? elemToObject(elems[0]) : {} + const balanceStr = String(item.realbalance || item.balance || item.available || '0') + const amount = parseFloat(balanceStr.replace(/[^\d.,-]/g, '').replace(',', '.')) || 0 + let currency = (balanceStr.match(/([A-Z]{3})\b/) || [])[1] + if (!currency) { + if (balanceStr.includes('€') || balanceStr.includes('EUR')) currency = 'EUR' + else if (balanceStr.includes('$') || balanceStr.includes('USD')) currency = 'USD' + else if (balanceStr.includes('₽') || balanceStr.includes('RUB')) currency = 'RUB' + else if (balanceStr.includes('£')) currency = 'GBP' + else currency = opts.fallbackCurrency || 'RUB' + } + return { + balance: amount, + currency: currency || opts.fallbackCurrency || 'RUB', + enoughmoneyto: item.enoughmoneyto || '', + realbalance: item.realbalance || '', + } +} + +/** + * @param {string} baseUrl - e.g. https://billing.example.com/billmgr + * @param {string} authinfo - username:password + * @param {object} [opts] - { createdatestart, createdateend } — опционально, не все API поддерживают + * @returns {Promise} list of payment objects + */ +export async function fetchPayments(baseUrl, authinfo, opts = {}) { + const params = {} + if (opts.createdatestart) params.createdatestart = opts.createdatestart + if (opts.createdateend) params.createdateend = opts.createdateend + if (opts.createdate === 'other') params.createdate = 'other' + if (opts.filter === 'on') params.filter = 'on' + if (opts.status != null) params.status = String(opts.status) + const data = await billmanagerRequest(baseUrl, authinfo, 'payment', params) + const elems = extractList(data, 'payment') + return elems.map((e) => elemToObject(e)) +} + +/** + * Получить список активных тарифов для заказа VDS (vds.order) для одного датацентра + * @param {string} baseUrl + * @param {string} authinfo + * @param {object} [opts] - { plid, period, datacenter } + * @returns {Promise<{ tariffItems: object[], slist: object }>} + */ +export async function fetchVdsOrderPricelist(baseUrl, authinfo, opts = {}) { + const params = { + plid: opts.plid || '', + sfrom: 'ajax', + } + if (opts.period) params.period = opts.period + if (opts.datacenter) params.datacenter = opts.datacenter + + const data = await billmanagerRequest(baseUrl, authinfo, 'vds.order', params) + + const tariflist = extractTariflist(data) + const slist = data?.list?.slist ?? data?.slist ?? {} + if (tariflist.length === 0) return { tariffItems: [], slist } + + const tariffItems = tariflist.map((rawItem) => { + const item = elemToObject(rawItem) + const parsed = parseTariffDesc(item.desc || '') + const descClean = (item.desc || '').replace(/<[^>]+>/g, ' ').replace(/\s+/g, ' ').trim() + const name = parsed.name || parsed.cpuModel || item.price?.split(' ')[0] || '—' + return { + externalId: String(item.pricelist || ''), + name, + desc: descClean, + vcpu: parsed.vcpu, + ramGb: parsed.ramGb, + diskGb: parsed.diskGb, + diskType: parsed.diskType, + virtualization: parsed.virtualization, + channel: parsed.channel, + location: parsed.location, + cpuModel: parsed.cpuModel, + orderAvailable: (item.order_available || '').toLowerCase() === 'on', + price: item.price || '', + } + }) + + return { tariffItems, slist } +} + +/** + * Получить тарифы по всем датацентрам — отдельный запрос на каждый ДЦ. + * @param {string} baseUrl + * @param {string} authinfo + * @returns {Promise<{ tariffItems: object[], slist: object }>} + */ +export async function fetchVdsOrderPricelistAllDatacenters(baseUrl, authinfo) { + const initial = await fetchVdsOrderPricelist(baseUrl, authinfo) + const slist = initial.slist || {} + const datacenters = Array.isArray(slist.datacenter) ? slist.datacenter : [] + + if (datacenters.length === 0) { + return { tariffItems: initial.tariffItems, slist } + } + + const allTariffItems = [] + + for (let i = 0; i < datacenters.length; i++) { + const dc = datacenters[i] + const dcKey = String(dc.k ?? dc.key ?? '') + const dcName = String(dc.v ?? dc.value ?? dc.name ?? '') + const { country, location } = parseDatacenterName(dcName) + + const result = i === 0 ? initial : await fetchVdsOrderPricelist(baseUrl, authinfo, { datacenter: dcKey }) + for (const t of result.tariffItems) { + allTariffItems.push({ + ...t, + datacenterKey: dcKey, + datacenterName: dcName, + country, + location: location || dcName, + }) + } + } + + return { tariffItems: allTariffItems, slist } +} + +/** + * Test API connection — запрос списка VDS + * @param {string} baseUrl + * @param {string} authinfo - username:password + * @returns {Promise<{ ok: boolean, error?: string, vdsCount?: number }>} + */ +export async function testConnection(baseUrl, authinfo) { + if (!baseUrl?.trim() || !authinfo?.trim()) { + return { ok: false, error: 'Укажите URL и учётные данные' } + } + try { + const items = await fetchVds(baseUrl.trim(), authinfo.trim()) + return { ok: true, vdsCount: items?.length ?? 0 } + } catch (err) { + return { ok: false, error: err.message || 'Ошибка подключения' } + } +} diff --git a/server/adapters/billmanager/parsers.js b/server/adapters/billmanager/parsers.js new file mode 100644 index 0000000..1848097 --- /dev/null +++ b/server/adapters/billmanager/parsers.js @@ -0,0 +1,252 @@ +/** + * BILLmanager API response parsers + */ + +/** + * Parse BILLmanager JSON list response. + * bjson: { elem: [ {...}, {...} ] } или { data: { elem: [...] } } + * xml/json: { doc: { vds: { elem: [...] } } } + */ +export function extractList(data, key) { + if (Array.isArray(data.elem)) return data.elem + if (data.data?.elem) return Array.isArray(data.data.elem) ? data.data.elem : [data.data.elem] + const doc = data.doc || data + let list = doc[key] + if (!list) return [] + if (Array.isArray(list)) return list + if (list.elem) { + const elems = Array.isArray(list.elem) ? list.elem : [list.elem] + return elems + } + return [] +} + +/** + * Extract flat object from BILLmanager elem (can be array of { $name, $t } or already flat object) + */ +export function elemToObject(elem) { + if (!elem) return {} + if (Array.isArray(elem)) { + const obj = {} + for (const e of elem) { + const name = e.$name || e.name + const val = e.$t ?? e.$ ?? e + if (name) obj[name] = typeof val === 'object' && val !== null ? (val.$t ?? val.$ ?? JSON.stringify(val)) : val + } + return obj + } + return typeof elem === 'object' ? elem : {} +} + +/** + * Parse pricelist string: "KVM SSD Start (1 CPU/768 MB RAM/7 GB SSD)" + * @returns {{ vcpu: number, ramGb: number, diskGb: number, diskType: string, virtualization: string }} + */ +export function parsePricelist(pricelist) { + const s = String(pricelist || '') + let vcpu = 0 + let ramGb = 0 + let diskGb = 0 + let diskType = 'NVMe' + let virtualization = 'KVM' + + const cpuMatch = s.match(/(\d+)\s*(?:CPU|СPU)/i) + if (cpuMatch) vcpu = parseInt(cpuMatch[1], 10) || 0 + + const ramMbMatch = s.match(/(\d+)\s*MB\s*RAM/i) + if (ramMbMatch) ramGb = Math.max(1, Math.round((parseInt(ramMbMatch[1], 10) || 0) / 1024)) + else { + const ramGbMatch = s.match(/(\d+)\s*GB\s*RAM/i) + if (ramGbMatch) ramGb = parseInt(ramGbMatch[1], 10) || 0 + } + + const diskMatch = s.match(/(\d+)\s*GB\s*(SSD|NVMe|HDD)/i) + if (diskMatch) { + diskGb = parseInt(diskMatch[1], 10) || 0 + diskType = diskMatch[2] || 'NVMe' + } + + if (/\bKVM\b/i.test(s)) virtualization = 'KVM' + else if (/\bOpenVZ\b/i.test(s)) virtualization = 'OpenVZ' + else if (/\bLXC\b/i.test(s)) virtualization = 'LXC' + + return { vcpu, ramGb, diskGb, diskType, virtualization } +} + +/** + * Парсит описание тарифа из vds.order.pricelist (desc) + * Поддерживает два формата: текстовый (Firstbyte) и HTML (Selectel и др.) + * @param {string} desc - HTML или текстовое описание тарифа + * @returns {{ name: string, vcpu: number, ramGb: number, diskGb: number, diskType: string, virtualization: string, channel: string, location: string, cpuModel: string }} + */ +export function parseTariffDesc(desc) { + const s = String(desc || '') + let name = '' + let vcpu = 0 + let ramGb = 0 + let diskGb = 0 + let diskType = 'SSD' + let virtualization = 'KVM' + let channel = '' + let location = '' + let cpuModel = '' + + const firstLine = s.split(/\r?\n|/i)[0]?.trim() || '' + name = firstLine.replace(/<[^>]+>/g, '').trim() + + // Формат 1: "Процессор: 1 ядро", "Память: 1 GB", "Диск: 20 GB SSD", "Канал: 200Mb/s" + const cpuMatch = s.match(/Процессор:\s*(\d+)\s*(?:ядро|ядра|ядер)/i) + if (cpuMatch) vcpu = parseInt(cpuMatch[1], 10) || 0 + + const ramMbMatch = s.match(/Память:\s*(\d+)\s*MB/i) + if (ramMbMatch) ramGb = Math.max(0.5, Math.round((parseInt(ramMbMatch[1], 10) || 0) / 1024 * 10) / 10) + else { + const ramGbMatch = s.match(/Память:\s*(\d+)\s*GB/i) + if (ramGbMatch) ramGb = parseInt(ramGbMatch[1], 10) || 0 + } + + const diskMatch = s.match(/Диск:\s*(\d+)\s*GB\s*(SSD|SAS|HDD|NVMe)/i) + if (diskMatch) { + diskGb = parseInt(diskMatch[1], 10) || 0 + diskType = diskMatch[2] || 'SSD' + } + + const channelMatch = s.match(/Канал:\s*(\d+Mb\/s)/i) + if (channelMatch) channel = channelMatch[1] + + if (/\bKVM\b/i.test(s)) virtualization = 'KVM' + else if (/\bOpenVZ\b/i.test(s)) virtualization = 'OpenVZ' + else if (/\bLXC\b/i.test(s)) virtualization = 'LXC' + + // Формат 2 (HTML): "Публичная сеть: 250 Мбит/с", "Локация: Москва, Россия", "Процессор: Ryzen 7 5800X", "NVMe накопитель" + if (!channel) { + const netMatch = s.match(/(?:Публичная сеть|Канал)[:\s]*\*?\*?(\d+)\s*Мбит/i) + if (netMatch) channel = `${netMatch[1]} Мбит/с` + } + if (!location) { + const locMatch = s.match(/Локация[:\s]*([^;]+)/i) + if (locMatch) location = locMatch[1].replace(/<[^>]+>/g, '').trim() + } + if (!cpuModel) { + const procMatch = s.match(/Процессор[:\s]*([^;]+?)(?:\s+до\s|$)/i) + if (procMatch) cpuModel = procMatch[1].replace(/<[^>]+>/g, '').trim() + } + if (!diskType || diskType === 'SSD') { + if (/\bNVMe\b/i.test(s)) diskType = 'NVMe' + else if (/\bSAS\b/i.test(s)) diskType = 'SAS' + else if (/\bHDD\b/i.test(s)) diskType = 'HDD' + else if (/\bSSD\b/i.test(s)) diskType = 'SSD' + } + + return { name, vcpu, ramGb, diskGb, diskType, virtualization, channel, location, cpuModel } +} + +/** + * Парсит название датацентра для извлечения страны и локации + * @param {string} dcName - название ДЦ, напр. "1 Датацентр Россия, Москва", "[DE] Франкфурт", "Франция" + * @returns {{ country: string, location: string }} + */ +export function parseDatacenterName(dcName) { + const s = String(dcName || '').trim() + if (!s) return { country: '', location: '' } + + const COUNTRY_CODE_MAP = { + DE: 'Германия', + FI: 'Финляндия', + RU: 'Россия', + FR: 'Франция', + GB: 'Великобритания', + NL: 'Нидерланды', + US: 'США', + SE: 'Швеция', + NO: 'Норвегия', + BE: 'Бельгия', + CH: 'Швейцария', + CZ: 'Чехия', + CA: 'Канада', + LV: 'Латвия', + LT: 'Литва', + EE: 'Эстония', + PL: 'Польша', + IT: 'Италия', + DK: 'Дания', + AU: 'Австралия', + ES: 'Испания', + SG: 'Сингапур', + } + + // "[DE] Франкфурт | AMD EPYC" -> country: DE/Германия, location: Франкфурт + const codeMatch = s.match(/\[([A-Z]{2})\]\s*([^|]+)/) + if (codeMatch) { + const code = codeMatch[1] + const loc = codeMatch[2].trim() + return { country: COUNTRY_CODE_MAP[code] || code, location: loc } + } + + // "N Датацентр Страна, Город" или "Датацентр Страна, Город" + const dcMatch = s.match(/(?:\d+\s+)?Датацентр\s+([^,]+),\s*(.+)/i) + if (dcMatch) { + return { country: dcMatch[1].trim(), location: dcMatch[2].trim() } + } + + // "Страна, Город" (без слова Датацентр) + const commaMatch = s.match(/^([^,]+),\s*(.+)$/) + if (commaMatch) { + return { country: commaMatch[1].trim(), location: commaMatch[2].trim() } + } + + // Только страна: "Франция", "Россия", "Германия", "Чехия" и т.д. + const countryOnly = [ + 'Россия', 'Чехия', 'Нидерланды', 'Франция', 'Великобритания', 'Германия', + 'Финляндия', 'Швеция', 'Норвегия', 'Бельгия', 'Швейцария', 'Канада', + 'Латвия', 'Литва', 'Эстония', 'Польша', 'Италия', 'Дания', 'Австралия', + 'Испания', 'Сингапур', 'США', 'Азия', 'Европа', + ] + for (const c of countryOnly) { + if (s === c || s.startsWith(c + ',') || s.startsWith(c + ' ')) { + const rest = s.slice(c.length).replace(/^[,\s]+/, '') + return { country: c, location: rest } + } + } + + // "ММТС-9", "Adman", "Европа DC1", "Москва DC3" — по ключевым словам + if (/ММТС|Adman|Москва/i.test(s)) { + return { country: 'Россия', location: s } + } + if (/Европа/i.test(s)) { + return { country: 'Европа', location: s.replace(/Европа\s*/i, '').trim() || s } + } + + // "США | Ryzen 9 9950X" — страна до | + const pipeMatch = s.match(/^([^|]+)\s*\|/) + if (pipeMatch) { + const part = pipeMatch[1].trim() + for (const c of countryOnly) { + if (part.includes(c)) return { country: c, location: '' } + } + return { country: part, location: '' } + } + + return { country: s, location: '' } +} + +/** + * Извлечь tariflist из ответа vds.order (поддержка разных форматов BILLmanager) + * @param {object} data - сырой ответ API + * @returns {Array} + */ +export function extractTariflist(data) { + if (!data) return [] + const listNode = data.list ?? data.doc?.list ?? data.doc + if (!listNode) return [] + + // tariflist / tarifflist / pricelist — разные варианты названия + let list = listNode.tariflist ?? listNode.tarifflist ?? listNode.pricelist + if (Array.isArray(list)) return list + + // elem-формат (как в vds, payment) + const elems = listNode.elem + if (elems) return Array.isArray(elems) ? elems : [elems] + + return [] +} diff --git a/server/adapters/billmanager/sync.js b/server/adapters/billmanager/sync.js new file mode 100644 index 0000000..09488a0 --- /dev/null +++ b/server/adapters/billmanager/sync.js @@ -0,0 +1,214 @@ +/** + * Sync BILLmanager data into vps-tracker DB + */ + +import { fetchVds, fetchPayments, fetchDashboardInfo, fetchVdsOrderPricelistAllDatacenters } from './operations.js' +import { mapVdsToVps, mapPaymentToPayment } from './mappers.js' + +/** + * Sync BILLmanager data into vps-tracker DB + * @param {object} account - provider_account with apiBaseUrl, apiCredentials + * @param {object} db - getDb() wrapper + * @param {object} [opts] - { paymentDaysBack } + * @returns {{ vpsCount: number, paymentsCount: number, tariffsCount: number, balance?: object }} + */ +export async function syncFromBillmanager(account, db, _opts = {}) { + const { apiBaseUrl, apiCredentials, providerId, id: accountId } = account + if (!apiBaseUrl?.trim() || !apiCredentials?.trim()) { + throw new Error('API URL and credentials are required') + } + const authinfo = apiCredentials.trim() + + const [vdsItems, paymentItems, dashboardInfo, tariffResult] = await Promise.all([ + fetchVds(apiBaseUrl, authinfo), + fetchPayments(apiBaseUrl, authinfo, {}), + fetchDashboardInfo(apiBaseUrl, authinfo, { fallbackCurrency: account.currency }).catch(() => null), + fetchVdsOrderPricelistAllDatacenters(apiBaseUrl, authinfo).catch((err) => { + console.warn('fetchVdsOrderPricelistAllDatacenters failed:', err.message) + return { tariffItems: [], slist: {} } + }), + ]) + const { tariffItems = [], slist = {} } = tariffResult || {} + + let vpsCount = 0 + const vpsInsertSql = `INSERT INTO vps (id, ip, ipv6, additionalIps, dns, providerId, providerAccountId, country, city, datacenter, os, vcpu, ramGb, diskGb, diskType, virtualization, bandwidthTb, sshPort, rootUser, purpose, environment, project, monitoringEnabled, backupEnabled, status, tariffType, currency, dailyRate, monthlyRate, createdAt, paidUntil, notes) + VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)` + const vpsUpdateSql = `UPDATE vps SET ip=?, ipv6=?, additionalIps=?, dns=?, country=?, city=?, datacenter=?, os=?, status=?, tariffType=?, currency=?, dailyRate=?, monthlyRate=?, paidUntil=?, notes=? + WHERE id=?` + + const SYNC_UPDATE_FIELDS = ['country', 'city', 'datacenter', 'os', 'notes', 'status', 'tariffType', 'currency', 'dailyRate', 'monthlyRate', 'paidUntil'] + + for (const item of vdsItems) { + const vps = mapVdsToVps(item, providerId, accountId) + const id = `vps-bm-${accountId}-${vps.externalId}` + const additionalIps = JSON.stringify(vps.additionalIps || []) + const dailyRate = vps.dailyRate + const monthlyRate = vps.monthlyRate + const paidUntil = vps.paidUntil || '' + const notes = vps.notes ? `${vps.notes} [bm-${vps.externalId}]` : `bm-${vps.externalId}` + + const existing = db.prepare('SELECT * FROM vps WHERE providerAccountId = ? AND (ip = ? OR notes LIKE ?)').get(accountId, vps.ip, `%bm-${vps.externalId}%`) + if (existing) { + let userOverrides = [] + try { + userOverrides = existing.userOverrides ? JSON.parse(existing.userOverrides) : [] + } catch { + userOverrides = [] + } + const merged = { + ip: vps.ip, + ipv6: vps.ipv6, + additionalIps, + dns: vps.dns, + country: vps.country, + city: vps.city, + datacenter: vps.datacenter, + os: vps.os, + status: vps.status, + tariffType: vps.tariffType, + currency: vps.currency, + dailyRate, + monthlyRate, + paidUntil, + notes, + } + for (const f of SYNC_UPDATE_FIELDS) { + if (userOverrides.includes(f)) { + merged[f] = existing[f] + } + } + db.run(vpsUpdateSql, + merged.ip, + merged.ipv6, + merged.additionalIps, + merged.dns, + merged.country, + merged.city, + merged.datacenter, + merged.os, + merged.status, + merged.tariffType, + merged.currency, + merged.dailyRate, + merged.monthlyRate, + merged.paidUntil, + merged.notes, + existing.id, + ) + } else { + db.run(vpsInsertSql, + id, + vps.ip, + vps.ipv6, + additionalIps, + vps.dns, + vps.providerId, + vps.providerAccountId, + vps.country, + vps.city, + vps.datacenter, + vps.os, + vps.vcpu, + vps.ramGb, + vps.diskGb, + vps.diskType, + vps.virtualization, + vps.bandwidthTb, + vps.sshPort, + vps.rootUser, + vps.purpose, + vps.environment, + vps.project, + vps.monitoringEnabled ? 1 : 0, + vps.backupEnabled ? 1 : 0, + vps.status, + vps.tariffType, + vps.currency, + dailyRate, + monthlyRate, + vps.createdAt, + paidUntil, + notes, + ) + } + vpsCount++ + } + + let paymentsCount = 0 + const existingPayments = new Set( + db.prepare('SELECT note FROM payments WHERE providerAccountId = ?').all(accountId).map((r) => r.note), + ) + const paymentInsertSql = `INSERT INTO payments (id, type, date, amount, currency, providerAccountId, vpsId, note) + VALUES (?, ?, ?, ?, ?, ?, ?, ?)` + + for (const item of paymentItems) { + const payment = mapPaymentToPayment(item, accountId) + if (!payment || payment.amount <= 0) continue + const note = payment.note + if (existingPayments.has(note)) continue + const id = `pay-bm-${accountId}-${payment.externalId}` + db.run(paymentInsertSql, id, payment.type, payment.date, payment.amount, payment.currency, payment.providerAccountId, payment.vpsId, note) + existingPayments.add(note) + paymentsCount++ + } + + if (dashboardInfo) { + db.run( + 'UPDATE provider_accounts SET balance_api=?, balance_currency=?, balance_updated_at=?, enoughmoneyto=? WHERE id=?', + dashboardInfo.balance, + dashboardInfo.currency || 'RUB', + new Date().toISOString(), + dashboardInfo.enoughmoneyto || '', + accountId, + ) + } + + let tariffsCount = 0 + const syncedAt = new Date().toISOString() + db.run('DELETE FROM active_tariffs WHERE providerAccountId = ?', accountId) + const tariffInsertSql = `INSERT INTO active_tariffs (id, providerAccountId, providerId, externalId, datacenterKey, datacenterName, name, desc, vcpu, ramGb, diskGb, diskType, virtualization, channel, location, country, cpuModel, orderAvailable, price, syncedAt) + VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)` + + for (const t of tariffItems) { + const dcKey = t.datacenterKey ?? '' + const dcName = t.datacenterName ?? '' + const id = dcKey ? `tariff-bm-${accountId}-${t.externalId}-${dcKey}` : `tariff-bm-${accountId}-${t.externalId}` + db.run(tariffInsertSql, + id, + accountId, + providerId, + t.externalId, + dcKey, + dcName, + t.name || '', + t.desc || '', + t.vcpu || 0, + t.ramGb || 0, + t.diskGb || 0, + t.diskType || 'SSD', + t.virtualization || 'KVM', + t.channel || '', + t.location || '', + t.country || '', + t.cpuModel || '', + t.orderAvailable ? 1 : 0, + t.price || '', + syncedAt, + ) + tariffsCount++ + } + + if (Object.keys(slist).length > 0) { + const datacenters = Array.isArray(slist.datacenter) ? JSON.stringify(slist.datacenter) : '[]' + const periods = Array.isArray(slist.period) ? JSON.stringify(slist.period) : '[]' + db.run( + `INSERT OR REPLACE INTO tariff_sync_options (providerAccountId, datacenters, periods, syncedAt) VALUES (?, ?, ?, ?)`, + accountId, + datacenters, + periods, + syncedAt, + ) + } + + return { vpsCount, paymentsCount, tariffsCount, balance: dashboardInfo } +} diff --git a/server/db.js b/server/db.js new file mode 100644 index 0000000..a04dc23 --- /dev/null +++ b/server/db.js @@ -0,0 +1,4 @@ +/** + * Re-export from db module + */ +export { initDb, getDb, saveDb } from './db/index.js' diff --git a/server/db/index.js b/server/db/index.js new file mode 100644 index 0000000..4f0753f --- /dev/null +++ b/server/db/index.js @@ -0,0 +1,109 @@ +/** + * Database initialization and access + */ + +import initSqlJs from 'sql.js' +import { readFileSync, writeFileSync, existsSync, mkdirSync } from 'fs' +import { join, dirname } from 'path' +import { fileURLToPath } from 'url' + +import { SCHEMA } from './schema.js' +import { MIGRATIONS } from './migrations.js' +import { seed, isDbEmpty } from './seed.js' + +const __dirname = dirname(fileURLToPath(import.meta.url)) +// db/ is in server/, so .. = server, .. again = project root +const DB_PATH = join(__dirname, '..', '..', 'data', 'vps-tracker.db') +const SEED_DIR = join(__dirname, '..', '..', 'public', 'data') + +let dbInstance = null + +export async function initDb() { + const dataDir = join(__dirname, '..', '..', 'data') + if (!existsSync(dataDir)) { + mkdirSync(dataDir, { recursive: true }) + } + + const SQL = await initSqlJs() + let db + + if (existsSync(DB_PATH)) { + const fileBuffer = readFileSync(DB_PATH) + db = new SQL.Database(fileBuffer) + } else { + db = new SQL.Database() + } + + db.exec(SCHEMA) + + for (const m of MIGRATIONS) { + try { + m.run(db) + } catch (err) { + console.warn(`Migration ${m.name} failed:`, err.message) + } + } + + if (isDbEmpty(db)) { + seed(db, SEED_DIR) + const data = db.export() + writeFileSync(DB_PATH, Buffer.from(data)) + } + + dbInstance = db + return db +} + +export function getDb() { + if (!dbInstance) throw new Error('Database not initialized') + return createDbWrapper(dbInstance) +} + +function createDbWrapper(db) { + return { + /** One-off run: prepare, bind, step, free. Use for statements that run once. */ + run(sql, ...params) { + const stmt = db.prepare(sql) + stmt.bind(params) + stmt.step() + const changes = db.getRowsModified() + stmt.free() + saveDb() + return { changes } + }, + prepare(sql) { + const stmt = db.prepare(sql) + return { + all(...params) { + stmt.bind(params) + const rows = [] + while (stmt.step()) { + rows.push(stmt.getAsObject()) + } + stmt.free() + return rows + }, + get(...params) { + stmt.bind(params) + const row = stmt.step() ? stmt.getAsObject() : null + stmt.free() + return row + }, + run(...params) { + stmt.bind(params) + stmt.step() + const changes = db.getRowsModified() + stmt.free() + saveDb() + return { changes } + }, + } + }, + } +} + +export function saveDb() { + if (!dbInstance) return + const data = dbInstance.export() + writeFileSync(DB_PATH, Buffer.from(data)) +} diff --git a/server/db/migrations.js b/server/db/migrations.js new file mode 100644 index 0000000..cc7eba2 --- /dev/null +++ b/server/db/migrations.js @@ -0,0 +1,121 @@ +/** + * Database migrations — add columns to existing tables + */ + +export const MIGRATIONS = [ + { + name: 'provider_accounts_api', + run(db) { + try { + db.exec('ALTER TABLE provider_accounts ADD COLUMN apiType TEXT') + } catch (e) { + if (!e.message?.includes('duplicate column')) throw e + } + try { + db.exec('ALTER TABLE provider_accounts ADD COLUMN apiBaseUrl TEXT') + } catch (e) { + if (!e.message?.includes('duplicate column')) throw e + } + try { + db.exec('ALTER TABLE provider_accounts ADD COLUMN apiCredentials TEXT') + } catch (e) { + if (!e.message?.includes('duplicate column')) throw e + } + }, + }, + { + name: 'settings_sync', + run(db) { + try { + db.exec('ALTER TABLE settings ADD COLUMN syncEnabled INTEGER') + } catch (e) { + if (!e.message?.includes('duplicate column')) throw e + } + try { + db.exec('ALTER TABLE settings ADD COLUMN syncIntervalMinutes INTEGER') + } catch (e) { + if (!e.message?.includes('duplicate column')) throw e + } + }, + }, + { + name: 'vps_paidUntil', + run(db) { + try { + db.exec('ALTER TABLE vps ADD COLUMN paidUntil TEXT') + } catch (e) { + if (!e.message?.includes('duplicate column')) throw e + } + }, + }, + { + name: 'provider_accounts_balance_api', + run(db) { + try { + db.exec('ALTER TABLE provider_accounts ADD COLUMN balance_api REAL') + } catch (e) { + if (!e.message?.includes('duplicate column')) throw e + } + try { + db.exec('ALTER TABLE provider_accounts ADD COLUMN balance_currency TEXT') + } catch (e) { + if (!e.message?.includes('duplicate column')) throw e + } + try { + db.exec('ALTER TABLE provider_accounts ADD COLUMN balance_updated_at TEXT') + } catch (e) { + if (!e.message?.includes('duplicate column')) throw e + } + try { + db.exec('ALTER TABLE provider_accounts ADD COLUMN enoughmoneyto TEXT') + } catch (e) { + if (!e.message?.includes('duplicate column')) throw e + } + }, + }, + { + name: 'vps_userOverrides', + run(db) { + try { + db.exec('ALTER TABLE vps ADD COLUMN userOverrides TEXT') + } catch (e) { + if (!e.message?.includes('duplicate column')) throw e + } + }, + }, + { + name: 'active_tariffs_location_cpu', + run(db) { + try { + db.exec('ALTER TABLE active_tariffs ADD COLUMN location TEXT') + } catch (e) { + if (!e.message?.includes('duplicate column')) throw e + } + try { + db.exec('ALTER TABLE active_tariffs ADD COLUMN cpuModel TEXT') + } catch (e) { + if (!e.message?.includes('duplicate column')) throw e + } + }, + }, + { + name: 'active_tariffs_country_datacenter', + run(db) { + try { + db.exec('ALTER TABLE active_tariffs ADD COLUMN country TEXT') + } catch (e) { + if (!e.message?.includes('duplicate column')) throw e + } + try { + db.exec('ALTER TABLE active_tariffs ADD COLUMN datacenterKey TEXT') + } catch (e) { + if (!e.message?.includes('duplicate column')) throw e + } + try { + db.exec('ALTER TABLE active_tariffs ADD COLUMN datacenterName TEXT') + } catch (e) { + if (!e.message?.includes('duplicate column')) throw e + } + }, + }, +] diff --git a/server/db/schema.js b/server/db/schema.js new file mode 100644 index 0000000..e04f0b1 --- /dev/null +++ b/server/db/schema.js @@ -0,0 +1,150 @@ +/** + * SQLite schema for vps-tracker + */ + +export const SCHEMA = ` +CREATE TABLE IF NOT EXISTS providers ( + id TEXT PRIMARY KEY, + name TEXT NOT NULL, + website TEXT, + contact TEXT, + baseCurrency TEXT, + usdRate TEXT, + eurRate TEXT, + notes TEXT +); + +CREATE TABLE IF NOT EXISTS provider_accounts ( + id TEXT PRIMARY KEY, + providerId TEXT NOT NULL, + name TEXT NOT NULL, + panelUrl TEXT, + currency TEXT, + billingMode TEXT, + notes TEXT, + apiType TEXT, + apiBaseUrl TEXT, + apiCredentials TEXT, + FOREIGN KEY (providerId) REFERENCES providers(id) +); + +CREATE TABLE IF NOT EXISTS vps ( + id TEXT PRIMARY KEY, + ip TEXT, + ipv6 TEXT, + additionalIps TEXT, + dns TEXT, + providerId TEXT, + providerAccountId TEXT, + country TEXT, + city TEXT, + datacenter TEXT, + os TEXT, + vcpu INTEGER, + ramGb INTEGER, + diskGb INTEGER, + diskType TEXT, + virtualization TEXT, + bandwidthTb INTEGER, + sshPort INTEGER, + rootUser TEXT, + purpose TEXT, + environment TEXT, + project TEXT, + monitoringEnabled INTEGER, + backupEnabled INTEGER, + status TEXT, + tariffType TEXT, + currency TEXT, + dailyRate REAL, + monthlyRate REAL, + createdAt TEXT, + paidUntil TEXT, + notes TEXT, + userOverrides TEXT, + FOREIGN KEY (providerId) REFERENCES providers(id), + FOREIGN KEY (providerAccountId) REFERENCES provider_accounts(id) +); + +CREATE TABLE IF NOT EXISTS payments ( + id TEXT PRIMARY KEY, + type TEXT NOT NULL, + date TEXT NOT NULL, + amount REAL NOT NULL, + currency TEXT, + providerAccountId TEXT, + vpsId TEXT, + note TEXT, + FOREIGN KEY (providerAccountId) REFERENCES provider_accounts(id), + FOREIGN KEY (vpsId) REFERENCES vps(id) +); + +CREATE TABLE IF NOT EXISTS balance_ledger ( + id TEXT PRIMARY KEY, + type TEXT NOT NULL, + date TEXT NOT NULL, + amount REAL NOT NULL, + currency TEXT, + direction TEXT, + providerAccountId TEXT, + vpsId TEXT, + note TEXT, + FOREIGN KEY (providerAccountId) REFERENCES provider_accounts(id), + FOREIGN KEY (vpsId) REFERENCES vps(id) +); + +CREATE TABLE IF NOT EXISTS settings ( + id TEXT PRIMARY KEY, + baseCurrency TEXT, + ratesUrl TEXT, + autoConvert INTEGER, + ratesUpdatedAt TEXT, + syncEnabled INTEGER, + syncIntervalMinutes INTEGER +); + +CREATE TABLE IF NOT EXISTS sync_log ( + id TEXT PRIMARY KEY, + accountId TEXT NOT NULL, + startedAt TEXT NOT NULL, + finishedAt TEXT, + status TEXT, + vpsCount INTEGER, + paymentsCount INTEGER, + error TEXT, + FOREIGN KEY (accountId) REFERENCES provider_accounts(id) +); + +CREATE TABLE IF NOT EXISTS active_tariffs ( + id TEXT PRIMARY KEY, + providerAccountId TEXT NOT NULL, + providerId TEXT NOT NULL, + externalId TEXT NOT NULL, + datacenterKey TEXT, + datacenterName TEXT, + name TEXT, + desc TEXT, + vcpu INTEGER, + ramGb REAL, + diskGb INTEGER, + diskType TEXT, + virtualization TEXT, + channel TEXT, + location TEXT, + country TEXT, + cpuModel TEXT, + orderAvailable INTEGER, + price TEXT, + syncedAt TEXT, + FOREIGN KEY (providerAccountId) REFERENCES provider_accounts(id), + FOREIGN KEY (providerId) REFERENCES providers(id) +); + +CREATE TABLE IF NOT EXISTS tariff_sync_options ( + providerAccountId TEXT PRIMARY KEY, + datacenters TEXT, + periods TEXT, + syncedAt TEXT, + FOREIGN KEY (providerAccountId) REFERENCES provider_accounts(id) +); +` diff --git a/server/db/seed.js b/server/db/seed.js new file mode 100644 index 0000000..29b1fef --- /dev/null +++ b/server/db/seed.js @@ -0,0 +1,124 @@ +/** + * Seed database with initial data from public/data/*.json + */ + +import { readFileSync, existsSync } from 'fs' +import { join } from 'path' + +/** + * @param {string} path - path to JSON file + * @returns {Array} + */ +function loadJson(path) { + if (!existsSync(path)) return [] + const raw = readFileSync(path, 'utf-8') + try { + const data = JSON.parse(raw) + return Array.isArray(data) ? data : [data] + } catch { + return [] + } +} + +/** + * @param {object} db - raw sql.js database (not wrapper) + * @param {string} seedDir - path to public/data + */ +export function seed(db, seedDir) { + const providers = loadJson(join(seedDir, 'providers.json')) + if (providers.length === 0) return + + const run = db.run.bind(db) + for (const r of providers) { + run( + 'INSERT OR IGNORE INTO providers (id, name, website, contact, baseCurrency, usdRate, eurRate, notes) VALUES (?, ?, ?, ?, ?, ?, ?, ?)', + [r.id, r.name ?? '', r.website ?? '', r.contact ?? '', r.baseCurrency ?? '', r.usdRate ?? '', r.eurRate ?? '', r.notes ?? ''], + ) + } + + const providerAccounts = loadJson(join(seedDir, 'provider-accounts.json')) + for (const r of providerAccounts) { + run( + 'INSERT OR IGNORE INTO provider_accounts (id, providerId, name, panelUrl, currency, billingMode, notes, apiType, apiBaseUrl, apiCredentials) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?)', + [r.id, r.providerId ?? '', r.name ?? '', r.panelUrl ?? '', r.currency ?? '', r.billingMode ?? '', r.notes ?? '', r.apiType ?? '', r.apiBaseUrl ?? '', r.apiCredentials ?? ''], + ) + } + + const vpsList = loadJson(join(seedDir, 'vps.json')) + for (const r of vpsList) { + const additionalIps = Array.isArray(r.additionalIps) ? JSON.stringify(r.additionalIps) : '[]' + const dailyRate = r.dailyRate === '' || r.dailyRate == null ? null : Number(r.dailyRate) + const monthlyRate = r.monthlyRate === '' || r.monthlyRate == null ? null : Number(r.monthlyRate) + run( + `INSERT OR IGNORE INTO vps (id, ip, ipv6, additionalIps, dns, providerId, providerAccountId, country, city, datacenter, os, vcpu, ramGb, diskGb, diskType, virtualization, bandwidthTb, sshPort, rootUser, purpose, environment, project, monitoringEnabled, backupEnabled, status, tariffType, currency, dailyRate, monthlyRate, createdAt, paidUntil, notes) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)`, + [ + r.id, + r.ip ?? '', + r.ipv6 ?? '', + additionalIps, + r.dns ?? '', + r.providerId ?? '', + r.providerAccountId ?? '', + r.country ?? '', + r.city ?? '', + r.datacenter ?? '', + r.os ?? '', + r.vcpu ?? 0, + r.ramGb ?? 0, + r.diskGb ?? 0, + r.diskType ?? '', + r.virtualization ?? '', + r.bandwidthTb ?? 0, + r.sshPort ?? 22, + r.rootUser ?? '', + r.purpose ?? '', + r.environment ?? '', + r.project ?? '', + r.monitoringEnabled ? 1 : 0, + r.backupEnabled ? 1 : 0, + r.status ?? 'active', + r.tariffType ?? '', + r.currency ?? '', + dailyRate, + monthlyRate, + r.createdAt ?? '', + r.paidUntil ?? '', + r.notes ?? '', + ], + ) + } + + const payments = loadJson(join(seedDir, 'payments.json')) + for (const r of payments) { + run( + 'INSERT OR IGNORE INTO payments (id, type, date, amount, currency, providerAccountId, vpsId, note) VALUES (?, ?, ?, ?, ?, ?, ?, ?)', + [r.id, r.type ?? '', r.date ?? '', Number(r.amount) || 0, r.currency ?? '', r.providerAccountId ?? '', r.vpsId ?? '', r.note ?? ''], + ) + } + + const ledger = loadJson(join(seedDir, 'balance-ledger.json')) + for (const r of ledger) { + run( + 'INSERT OR IGNORE INTO balance_ledger (id, type, date, amount, currency, direction, providerAccountId, vpsId, note) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?)', + [r.id, r.type ?? '', r.date ?? '', Number(r.amount) || 0, r.currency ?? '', r.direction ?? '', r.providerAccountId ?? '', r.vpsId ?? '', r.note ?? ''], + ) + } + + const settingsList = loadJson(join(seedDir, 'settings.json')) + for (const r of settingsList) { + run( + 'INSERT OR IGNORE INTO settings (id, baseCurrency, ratesUrl, autoConvert, ratesUpdatedAt, syncEnabled, syncIntervalMinutes) VALUES (?, ?, ?, ?, ?, ?, ?)', + [r.id ?? 'settings-main', r.baseCurrency ?? 'RUB', r.ratesUrl ?? '', r.autoConvert !== false ? 1 : 0, r.ratesUpdatedAt ?? '', r.syncEnabled ? 1 : 0, r.syncIntervalMinutes ?? 60], + ) + } +} + +/** + * @param {object} db - raw sql.js database + * @returns {boolean} + */ +export function isDbEmpty(db) { + const result = db.exec('SELECT COUNT(*) as c FROM providers') + if (!result.length || !result[0].values.length) return true + return result[0].values[0][0] === 0 +} diff --git a/server/index.js b/server/index.js new file mode 100644 index 0000000..a469171 --- /dev/null +++ b/server/index.js @@ -0,0 +1,39 @@ +import express from 'express' +import cors from 'cors' +import { initDb } from './db.js' +import dataRouter from './routes/data.js' +import migrateRouter from './routes/migrate.js' +import vpsRouter from './routes/vps.js' +import providersRouter from './routes/providers.js' +import providerAccountsRouter from './routes/provider-accounts.js' +import paymentsRouter from './routes/payments.js' +import balanceLedgerRouter from './routes/balance-ledger.js' +import settingsRouter from './routes/settings.js' +import syncRouter from './routes/sync.js' + +const app = express() +const PORT = process.env.PORT || 3001 + +app.use(cors()) +app.use(express.json()) + +;(async () => { + await initDb() + + app.use('/api/data', dataRouter) + app.use('/api/migrate', migrateRouter) + app.use('/api/vps', vpsRouter) + app.use('/api/providers', providersRouter) + app.use('/api/provider-accounts', providerAccountsRouter) + app.use('/api/payments', paymentsRouter) + app.use('/api/balance-ledger', balanceLedgerRouter) + app.use('/api/settings', settingsRouter) + app.use('/api/sync', syncRouter) + + const { startScheduler } = await import('./sync-scheduler.js') + startScheduler() + + app.listen(PORT, () => { + console.log(`Server running at http://localhost:${PORT}`) + }) +})() diff --git a/server/routes/balance-ledger.js b/server/routes/balance-ledger.js new file mode 100644 index 0000000..e02fb0a --- /dev/null +++ b/server/routes/balance-ledger.js @@ -0,0 +1,82 @@ +import { Router } from 'express' +import { getDb } from '../db.js' + +const router = Router() + +router.get('/', (req, res) => { + try { + const db = getDb() + const rows = db.prepare('SELECT * FROM balance_ledger ORDER BY date DESC').all() + res.json(rows) + } catch (err) { + res.status(500).json({ error: err.message }) + } +}) + +router.post('/', (req, res) => { + try { + const db = getDb() + const r = req.body + const id = r.id || `ledger-${Date.now()}-${Math.random().toString(36).slice(2, 9)}` + db.prepare(` + INSERT INTO balance_ledger (id, type, date, amount, currency, direction, providerAccountId, vpsId, note) + VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?) + `).run( + id, + r.type ?? '', + r.date ?? '', + Number(r.amount) || 0, + r.currency ?? '', + r.direction ?? '', + r.providerAccountId ?? '', + r.vpsId ?? '', + r.note ?? '', + ) + const row = db.prepare('SELECT * FROM balance_ledger WHERE id = ?').get(id) + res.status(201).json(row) + } catch (err) { + res.status(500).json({ error: err.message }) + } +}) + +router.put('/:id', (req, res) => { + try { + const db = getDb() + const { id } = req.params + const r = req.body + db.prepare(` + UPDATE balance_ledger SET + type = ?, date = ?, amount = ?, currency = ?, direction = ?, providerAccountId = ?, vpsId = ?, note = ? + WHERE id = ? + `).run( + r.type ?? '', + r.date ?? '', + Number(r.amount) || 0, + r.currency ?? '', + r.direction ?? '', + r.providerAccountId ?? '', + r.vpsId ?? '', + r.note ?? '', + id, + ) + const row = db.prepare('SELECT * FROM balance_ledger WHERE id = ?').get(id) + if (!row) return res.status(404).json({ error: 'Not found' }) + res.json(row) + } catch (err) { + res.status(500).json({ error: err.message }) + } +}) + +router.delete('/:id', (req, res) => { + try { + const db = getDb() + const { id } = req.params + const result = db.prepare('DELETE FROM balance_ledger WHERE id = ?').run(id) + if (result.changes === 0) return res.status(404).json({ error: 'Not found' }) + res.status(204).send() + } catch (err) { + res.status(500).json({ error: err.message }) + } +}) + +export default router diff --git a/server/routes/data.js b/server/routes/data.js new file mode 100644 index 0000000..9a606aa --- /dev/null +++ b/server/routes/data.js @@ -0,0 +1,36 @@ +import { Router } from 'express' +import { getDb } from '../db.js' +import { rowToVps } from './vps.js' +import { rowToSettings } from './settings.js' +import { sanitizeAccount, rowToActiveTariff, rowToTariffSyncOptions } from '../utils/row-mappers.js' + +const router = Router() + +router.get('/', (req, res) => { + try { + const db = getDb() + const vps = db.prepare('SELECT * FROM vps ORDER BY createdAt DESC').all() + const providers = db.prepare('SELECT * FROM providers ORDER BY name').all() + const providerAccounts = db.prepare('SELECT * FROM provider_accounts ORDER BY name').all() + const payments = db.prepare('SELECT * FROM payments ORDER BY date DESC').all() + const balanceLedger = db.prepare('SELECT * FROM balance_ledger ORDER BY date DESC').all() + const settingsRows = db.prepare('SELECT * FROM settings ORDER BY id').all() + const activeTariffs = db.prepare('SELECT * FROM active_tariffs ORDER BY name').all() + const tariffSyncOptions = db.prepare('SELECT * FROM tariff_sync_options').all() + + res.json({ + vps: vps.map(rowToVps), + providers, + providerAccounts: providerAccounts.map(sanitizeAccount), + payments, + balanceLedger, + settings: settingsRows.map(rowToSettings), + activeTariffs: activeTariffs.map(rowToActiveTariff), + tariffSyncOptions: tariffSyncOptions.map(rowToTariffSyncOptions), + }) + } catch (err) { + res.status(500).json({ error: err.message }) + } +}) + +export default router diff --git a/server/routes/migrate.js b/server/routes/migrate.js new file mode 100644 index 0000000..805ba1f --- /dev/null +++ b/server/routes/migrate.js @@ -0,0 +1,71 @@ +import { Router } from 'express' +import { getDb, saveDb } from '../db.js' + +const router = Router() + +router.post('/', (req, res) => { + try { + const db = getDb() + const data = req.body + if (!data || typeof data !== 'object') { + return res.status(400).json({ error: 'Invalid payload' }) + } + + const settingsList = Array.isArray(data.settings) ? data.settings : (data.settings ? [data.settings] : []) + + if (Array.isArray(data.providers) && data.providers.length > 0) { + const sql = `INSERT OR REPLACE INTO providers (id, name, website, contact, baseCurrency, usdRate, eurRate, notes) VALUES (?, ?, ?, ?, ?, ?, ?, ?)` + for (const r of data.providers) { + const p = typeof r === 'object' ? r : {} + db.run(sql, p.id ?? '', p.name ?? '', p.website ?? '', p.contact ?? '', p.baseCurrency ?? '', p.usdRate ?? '', p.eurRate ?? '', p.notes ?? '') + } + } + if (Array.isArray(data.providerAccounts) && data.providerAccounts.length > 0) { + const sql = `INSERT OR REPLACE INTO provider_accounts (id, providerId, name, panelUrl, currency, billingMode, notes, apiType, apiBaseUrl, apiCredentials) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?)` + for (const r of data.providerAccounts) { + const acc = typeof r === 'object' ? r : {} + db.run(sql, acc.id ?? '', acc.providerId ?? '', acc.name ?? '', acc.panelUrl ?? '', acc.currency ?? '', acc.billingMode ?? '', acc.notes ?? '', acc.apiType ?? '', acc.apiBaseUrl ?? '', acc.apiCredentials ?? '') + } + } + if (Array.isArray(data.vps) && data.vps.length > 0) { + const sql = `INSERT OR REPLACE INTO vps (id, ip, ipv6, additionalIps, dns, providerId, providerAccountId, country, city, datacenter, os, vcpu, ramGb, diskGb, diskType, virtualization, bandwidthTb, sshPort, rootUser, purpose, environment, project, monitoringEnabled, backupEnabled, status, tariffType, currency, dailyRate, monthlyRate, createdAt, paidUntil, notes, userOverrides) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)` + for (const r of data.vps) { + const v = typeof r === 'object' ? r : {} + const additionalIps = Array.isArray(v.additionalIps) ? JSON.stringify(v.additionalIps) : '[]' + const dailyRate = v.dailyRate === '' || v.dailyRate == null ? null : Number(v.dailyRate) + const monthlyRate = v.monthlyRate === '' || v.monthlyRate == null ? null : Number(v.monthlyRate) + const userOverrides = Array.isArray(v.userOverrides) ? JSON.stringify(v.userOverrides) : (v.userOverrides ?? '') + db.run(sql, v.id ?? '', v.ip ?? '', v.ipv6 ?? '', additionalIps, v.dns ?? '', v.providerId ?? '', v.providerAccountId ?? '', v.country ?? '', v.city ?? '', v.datacenter ?? '', v.os ?? '', v.vcpu ?? 0, v.ramGb ?? 0, v.diskGb ?? 0, v.diskType ?? '', v.virtualization ?? '', v.bandwidthTb ?? 0, v.sshPort ?? 22, v.rootUser ?? '', v.purpose ?? '', v.environment ?? '', v.project ?? '', v.monitoringEnabled ? 1 : 0, v.backupEnabled ? 1 : 0, v.status ?? 'active', v.tariffType ?? '', v.currency ?? '', dailyRate, monthlyRate, v.createdAt ?? '', v.paidUntil ?? '', v.notes ?? '', userOverrides) + } + } + if (Array.isArray(data.payments) && data.payments.length > 0) { + const sql = `INSERT OR REPLACE INTO payments (id, type, date, amount, currency, providerAccountId, vpsId, note) VALUES (?, ?, ?, ?, ?, ?, ?, ?)` + for (const r of data.payments) { + const pm = typeof r === 'object' ? r : {} + db.run(sql, pm.id ?? '', pm.type ?? '', pm.date ?? '', Number(pm.amount) || 0, pm.currency ?? '', pm.providerAccountId ?? '', pm.vpsId ?? '', pm.note ?? '') + } + } + if (Array.isArray(data.balanceLedger) && data.balanceLedger.length > 0) { + const sql = `INSERT OR REPLACE INTO balance_ledger (id, type, date, amount, currency, direction, providerAccountId, vpsId, note) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?)` + for (const r of data.balanceLedger) { + const bl = typeof r === 'object' ? r : {} + db.run(sql, bl.id ?? '', bl.type ?? '', bl.date ?? '', Number(bl.amount) || 0, bl.currency ?? '', bl.direction ?? '', bl.providerAccountId ?? '', bl.vpsId ?? '', bl.note ?? '') + } + } + if (settingsList.length > 0) { + const sql = `INSERT OR REPLACE INTO settings (id, baseCurrency, ratesUrl, autoConvert, ratesUpdatedAt, syncEnabled, syncIntervalMinutes) VALUES (?, ?, ?, ?, ?, ?, ?)` + for (const r of settingsList) { + const s = typeof r === 'object' ? r : {} + db.run(sql, s.id ?? 'settings-main', s.baseCurrency ?? 'RUB', s.ratesUrl ?? '', s.autoConvert !== false ? 1 : 0, s.ratesUpdatedAt ?? '', s.syncEnabled ? 1 : 0, s.syncIntervalMinutes ?? 60) + } + } + saveDb() + + res.json({ ok: true }) + } catch (err) { + console.error('Migrate error:', err) + res.status(500).json({ error: err.message || 'Migration failed' }) + } +}) + +export default router diff --git a/server/routes/payments.js b/server/routes/payments.js new file mode 100644 index 0000000..10f5151 --- /dev/null +++ b/server/routes/payments.js @@ -0,0 +1,80 @@ +import { Router } from 'express' +import { getDb } from '../db.js' + +const router = Router() + +router.get('/', (req, res) => { + try { + const db = getDb() + const rows = db.prepare('SELECT * FROM payments ORDER BY date DESC').all() + res.json(rows) + } catch (err) { + res.status(500).json({ error: err.message }) + } +}) + +router.post('/', (req, res) => { + try { + const db = getDb() + const r = req.body + const id = r.id || `pay-${Date.now()}-${Math.random().toString(36).slice(2, 9)}` + db.prepare(` + INSERT INTO payments (id, type, date, amount, currency, providerAccountId, vpsId, note) + VALUES (?, ?, ?, ?, ?, ?, ?, ?) + `).run( + id, + r.type ?? '', + r.date ?? '', + Number(r.amount) || 0, + r.currency ?? '', + r.providerAccountId ?? '', + r.vpsId ?? '', + r.note ?? '', + ) + const row = db.prepare('SELECT * FROM payments WHERE id = ?').get(id) + res.status(201).json(row) + } catch (err) { + res.status(500).json({ error: err.message }) + } +}) + +router.put('/:id', (req, res) => { + try { + const db = getDb() + const { id } = req.params + const r = req.body + db.prepare(` + UPDATE payments SET + type = ?, date = ?, amount = ?, currency = ?, providerAccountId = ?, vpsId = ?, note = ? + WHERE id = ? + `).run( + r.type ?? '', + r.date ?? '', + Number(r.amount) || 0, + r.currency ?? '', + r.providerAccountId ?? '', + r.vpsId ?? '', + r.note ?? '', + id, + ) + const row = db.prepare('SELECT * FROM payments WHERE id = ?').get(id) + if (!row) return res.status(404).json({ error: 'Not found' }) + res.json(row) + } catch (err) { + res.status(500).json({ error: err.message }) + } +}) + +router.delete('/:id', (req, res) => { + try { + const db = getDb() + const { id } = req.params + const result = db.prepare('DELETE FROM payments WHERE id = ?').run(id) + if (result.changes === 0) return res.status(404).json({ error: 'Not found' }) + res.status(204).send() + } catch (err) { + res.status(500).json({ error: err.message }) + } +}) + +export default router diff --git a/server/routes/provider-accounts.js b/server/routes/provider-accounts.js new file mode 100644 index 0000000..b45a35a --- /dev/null +++ b/server/routes/provider-accounts.js @@ -0,0 +1,94 @@ +import { Router } from 'express' +import { getDb } from '../db.js' + +const router = Router() + +function sanitizeAccount(row) { + if (!row) return row + const { apiCredentials, ...rest } = row + return { ...rest, apiCredentialsSet: Boolean(apiCredentials) } +} + +router.get('/', (req, res) => { + try { + const db = getDb() + const rows = db.prepare('SELECT * FROM provider_accounts ORDER BY name').all() + res.json(rows.map(sanitizeAccount)) + } catch (err) { + res.status(500).json({ error: err.message }) + } +}) + +router.post('/', (req, res) => { + try { + const db = getDb() + const r = req.body + const id = r.id || `account-${Date.now()}-${Math.random().toString(36).slice(2, 9)}` + db.prepare(` + INSERT INTO provider_accounts (id, providerId, name, panelUrl, currency, billingMode, notes, apiType, apiBaseUrl, apiCredentials) + VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?) + `).run( + id, + r.providerId ?? '', + r.name ?? '', + r.panelUrl ?? '', + r.currency ?? '', + r.billingMode ?? '', + r.notes ?? '', + r.apiType ?? '', + r.apiBaseUrl ?? '', + r.apiCredentials ?? '', + ) + const row = db.prepare('SELECT * FROM provider_accounts WHERE id = ?').get(id) + res.status(201).json(sanitizeAccount(row)) + } catch (err) { + res.status(500).json({ error: err.message }) + } +}) + +router.put('/:id', (req, res) => { + try { + const db = getDb() + const { id } = req.params + const r = req.body + const existing = db.prepare('SELECT * FROM provider_accounts WHERE id = ?').get(id) + if (!existing) return res.status(404).json({ error: 'Not found' }) + const apiType = r.apiType !== undefined ? String(r.apiType || '') : (existing.apiType || '') + const apiBaseUrl = r.apiBaseUrl !== undefined ? String(r.apiBaseUrl || '') : (existing.apiBaseUrl || '') + const apiCredentials = r.apiCredentials !== undefined ? String(r.apiCredentials || '') : (existing.apiCredentials || '') + db.prepare(` + UPDATE provider_accounts SET + providerId = ?, name = ?, panelUrl = ?, currency = ?, billingMode = ?, notes = ?, apiType = ?, apiBaseUrl = ?, apiCredentials = ? + WHERE id = ? + `).run( + r.providerId ?? existing.providerId ?? '', + r.name ?? existing.name ?? '', + r.panelUrl ?? existing.panelUrl ?? '', + r.currency ?? existing.currency ?? '', + r.billingMode ?? existing.billingMode ?? '', + r.notes ?? existing.notes ?? '', + apiType, + apiBaseUrl, + apiCredentials, + id, + ) + const row = db.prepare('SELECT * FROM provider_accounts WHERE id = ?').get(id) + res.json(sanitizeAccount(row)) + } catch (err) { + res.status(500).json({ error: err.message }) + } +}) + +router.delete('/:id', (req, res) => { + try { + const db = getDb() + const { id } = req.params + const result = db.prepare('DELETE FROM provider_accounts WHERE id = ?').run(id) + if (result.changes === 0) return res.status(404).json({ error: 'Not found' }) + res.status(204).send() + } catch (err) { + res.status(500).json({ error: err.message }) + } +}) + +export default router diff --git a/server/routes/providers.js b/server/routes/providers.js new file mode 100644 index 0000000..eaa5883 --- /dev/null +++ b/server/routes/providers.js @@ -0,0 +1,80 @@ +import { Router } from 'express' +import { getDb } from '../db.js' + +const router = Router() + +router.get('/', (req, res) => { + try { + const db = getDb() + const rows = db.prepare('SELECT * FROM providers ORDER BY name').all() + res.json(rows) + } catch (err) { + res.status(500).json({ error: err.message }) + } +}) + +router.post('/', (req, res) => { + try { + const db = getDb() + const r = req.body + const id = r.id || `provider-${Date.now()}-${Math.random().toString(36).slice(2, 9)}` + db.prepare(` + INSERT INTO providers (id, name, website, contact, baseCurrency, usdRate, eurRate, notes) + VALUES (?, ?, ?, ?, ?, ?, ?, ?) + `).run( + id, + r.name ?? '', + r.website ?? '', + r.contact ?? '', + r.baseCurrency ?? '', + r.usdRate ?? '', + r.eurRate ?? '', + r.notes ?? '', + ) + const row = db.prepare('SELECT * FROM providers WHERE id = ?').get(id) + res.status(201).json(row) + } catch (err) { + res.status(500).json({ error: err.message }) + } +}) + +router.put('/:id', (req, res) => { + try { + const db = getDb() + const { id } = req.params + const r = req.body + db.prepare(` + UPDATE providers SET + name = ?, website = ?, contact = ?, baseCurrency = ?, usdRate = ?, eurRate = ?, notes = ? + WHERE id = ? + `).run( + r.name ?? '', + r.website ?? '', + r.contact ?? '', + r.baseCurrency ?? '', + r.usdRate ?? '', + r.eurRate ?? '', + r.notes ?? '', + id, + ) + const row = db.prepare('SELECT * FROM providers WHERE id = ?').get(id) + if (!row) return res.status(404).json({ error: 'Not found' }) + res.json(row) + } catch (err) { + res.status(500).json({ error: err.message }) + } +}) + +router.delete('/:id', (req, res) => { + try { + const db = getDb() + const { id } = req.params + const result = db.prepare('DELETE FROM providers WHERE id = ?').run(id) + if (result.changes === 0) return res.status(404).json({ error: 'Not found' }) + res.status(204).send() + } catch (err) { + res.status(500).json({ error: err.message }) + } +}) + +export default router diff --git a/server/routes/settings.js b/server/routes/settings.js new file mode 100644 index 0000000..79ee514 --- /dev/null +++ b/server/routes/settings.js @@ -0,0 +1,97 @@ +import { Router } from 'express' +import { getDb } from '../db.js' +import { startScheduler } from '../sync-scheduler.js' + +const router = Router() + +export function rowToSettings(row) { + if (!row) return null + return { + ...row, + autoConvert: Boolean(row.autoConvert), + syncEnabled: Boolean(row.syncEnabled), + } +} + +router.get('/', (req, res) => { + try { + const db = getDb() + const rows = db.prepare('SELECT * FROM settings ORDER BY id').all() + res.json(rows.map(rowToSettings)) + } catch (err) { + res.status(500).json({ error: err.message }) + } +}) + +router.put('/:id', (req, res) => { + try { + const db = getDb() + const { id } = req.params + const r = req.body + const existing = db.prepare('SELECT * FROM settings WHERE id = ?').get(id) + const syncEnabled = r.syncEnabled !== undefined ? (r.syncEnabled ? 1 : 0) : (existing?.syncEnabled ? 1 : 0) + const syncIntervalMinutes = r.syncIntervalMinutes !== undefined ? Math.max(15, Number(r.syncIntervalMinutes) || 60) : (existing?.syncIntervalMinutes ?? 60) + if (existing) { + db.prepare(` + UPDATE settings SET + baseCurrency = ?, ratesUrl = ?, autoConvert = ?, ratesUpdatedAt = ?, syncEnabled = ?, syncIntervalMinutes = ? + WHERE id = ? + `).run( + r.baseCurrency ?? existing.baseCurrency ?? 'RUB', + r.ratesUrl ?? existing.ratesUrl ?? '', + r.autoConvert !== undefined ? (r.autoConvert !== false ? 1 : 0) : (existing.autoConvert ? 1 : 0), + r.ratesUpdatedAt ?? existing.ratesUpdatedAt ?? '', + syncEnabled, + syncIntervalMinutes, + id, + ) + } else { + db.prepare(` + INSERT INTO settings (id, baseCurrency, ratesUrl, autoConvert, ratesUpdatedAt, syncEnabled, syncIntervalMinutes) + VALUES (?, ?, ?, ?, ?, ?, ?) + `).run( + id, + r.baseCurrency ?? 'RUB', + r.ratesUrl ?? '', + r.autoConvert !== false ? 1 : 0, + r.ratesUpdatedAt ?? '', + syncEnabled, + syncIntervalMinutes, + ) + } + startScheduler() + const row = db.prepare('SELECT * FROM settings WHERE id = ?').get(id) + res.json(rowToSettings(row)) + } catch (err) { + res.status(500).json({ error: err.message }) + } +}) + +router.post('/', (req, res) => { + try { + const db = getDb() + const r = req.body + const id = r.id ?? 'settings-main' + const syncEnabled = r.syncEnabled ? 1 : 0 + const syncIntervalMinutes = Math.max(15, Number(r.syncIntervalMinutes) || 60) + db.prepare(` + INSERT INTO settings (id, baseCurrency, ratesUrl, autoConvert, ratesUpdatedAt, syncEnabled, syncIntervalMinutes) + VALUES (?, ?, ?, ?, ?, ?, ?) + `).run( + id, + r.baseCurrency ?? 'RUB', + r.ratesUrl ?? 'https://www.cbr-xml-daily.ru/latest.js', + r.autoConvert !== false ? 1 : 0, + r.ratesUpdatedAt ?? '', + syncEnabled, + syncIntervalMinutes, + ) + startScheduler() + const row = db.prepare('SELECT * FROM settings WHERE id = ?').get(id) + res.status(201).json(rowToSettings(row)) + } catch (err) { + res.status(500).json({ error: err.message }) + } +}) + +export default router diff --git a/server/routes/sync.js b/server/routes/sync.js new file mode 100644 index 0000000..740a68b --- /dev/null +++ b/server/routes/sync.js @@ -0,0 +1,116 @@ +import { Router } from 'express' +import { getDb } from '../db.js' +import { syncFromBillmanager, fetchDashboardInfo, testConnection } from '../adapters/billmanager/index.js' + +const router = Router() + +router.post('/test-connection', async (req, res) => { + try { + const { apiBaseUrl, apiCredentials } = req.body || {} + if (!apiBaseUrl?.trim() || !apiCredentials?.trim()) { + return res.status(400).json({ ok: false, error: 'Укажите URL и учётные данные' }) + } + const result = await testConnection(apiBaseUrl.trim(), apiCredentials.trim()) + res.json(result) + } catch (err) { + res.status(500).json({ ok: false, error: err.message || 'Ошибка проверки' }) + } +}) + +router.get('/status', (req, res) => { + try { + const db = getDb() + const rows = db.prepare(` + SELECT accountId, startedAt, finishedAt, status, vpsCount, paymentsCount, error + FROM sync_log ORDER BY startedAt DESC LIMIT 50 + `).all() + res.json(rows) + } catch (err) { + res.status(500).json({ error: err.message }) + } +}) + +router.get('/:accountId/balance', async (req, res) => { + try { + const db = getDb() + const { accountId } = req.params + const row = db.prepare('SELECT * FROM provider_accounts WHERE id = ?').get(accountId) + if (!row) { + return res.status(404).json({ error: 'Account not found' }) + } + if (row.apiType !== 'billmanager') { + return res.status(400).json({ error: 'Account is not configured for BILLmanager API' }) + } + if (!row.apiBaseUrl?.trim() || !row.apiCredentials?.trim()) { + return res.status(400).json({ error: 'API URL and credentials are required' }) + } + const info = await fetchDashboardInfo(row.apiBaseUrl, row.apiCredentials.trim(), { fallbackCurrency: row.currency }) + db.run( + 'UPDATE provider_accounts SET balance_api=?, balance_currency=?, balance_updated_at=?, enoughmoneyto=? WHERE id=?', + info.balance, + info.currency || 'RUB', + new Date().toISOString(), + info.enoughmoneyto || '', + accountId, + ) + res.json({ ok: true, balance: info }) + } catch (err) { + console.error('Balance fetch error:', err) + res.status(500).json({ ok: false, error: err.message || 'Failed to fetch balance' }) + } +}) + +router.post('/:accountId', async (req, res) => { + try { + const db = getDb() + const { accountId } = req.params + const row = db.prepare('SELECT * FROM provider_accounts WHERE id = ?').get(accountId) + if (!row) { + return res.status(404).json({ error: 'Account not found' }) + } + if (row.apiType !== 'billmanager') { + return res.status(400).json({ error: 'Account is not configured for BILLmanager API' }) + } + if (!row.apiBaseUrl?.trim() || !row.apiCredentials?.trim()) { + return res.status(400).json({ error: 'API URL and credentials are required' }) + } + + const logId = `sync-${accountId}-${Date.now()}` + db.prepare(` + INSERT INTO sync_log (id, accountId, startedAt, status) + VALUES (?, ?, ?, ?) + `).run(logId, accountId, new Date().toISOString(), 'running') + + const result = await syncFromBillmanager(row, db) + + db.prepare(` + UPDATE sync_log SET finishedAt=?, status=?, vpsCount=?, paymentsCount=? + WHERE id=? + `).run(new Date().toISOString(), 'ok', result.vpsCount, result.paymentsCount, logId) + + res.json({ + ok: true, + synced: { + vpsCount: result.vpsCount, + paymentsCount: result.paymentsCount, + tariffsCount: result.tariffsCount ?? 0, + }, + }) + } catch (err) { + console.error('Sync error:', err) + const { accountId } = req.params + const db = getDb() + const logRows = db.prepare('SELECT id FROM sync_log WHERE accountId=? AND status=? ORDER BY startedAt DESC LIMIT 1').all(accountId, 'running') + if (logRows.length > 0) { + db.prepare('UPDATE sync_log SET finishedAt=?, status=?, error=? WHERE id=?').run( + new Date().toISOString(), + 'error', + err.message || 'Unknown error', + logRows[0].id, + ) + } + res.status(500).json({ ok: false, error: err.message || 'Sync failed' }) + } +}) + +export default router diff --git a/server/routes/vps.js b/server/routes/vps.js new file mode 100644 index 0000000..7ac98c9 --- /dev/null +++ b/server/routes/vps.js @@ -0,0 +1,197 @@ +import { Router } from 'express' +import { getDb } from '../db.js' + +const router = Router() + +export function rowToVps(row) { + if (!row) return null + let additionalIps = [] + try { + additionalIps = row.additionalIps ? JSON.parse(row.additionalIps) : [] + } catch { + additionalIps = [] + } + let userOverrides = [] + try { + userOverrides = row.userOverrides ? JSON.parse(row.userOverrides) : [] + } catch { + userOverrides = [] + } + return { + ...row, + additionalIps, + userOverrides, + monitoringEnabled: Boolean(row.monitoringEnabled), + backupEnabled: Boolean(row.backupEnabled), + dailyRate: row.dailyRate != null ? row.dailyRate : '', + monthlyRate: row.monthlyRate != null ? row.monthlyRate : '', + } +} + +router.get('/', (req, res) => { + try { + const db = getDb() + const rows = db.prepare('SELECT * FROM vps ORDER BY createdAt DESC').all() + res.json(rows.map(rowToVps)) + } catch (err) { + res.status(500).json({ error: err.message }) + } +}) + +router.post('/', (req, res) => { + try { + const db = getDb() + const r = req.body + const id = r.id || `vps-${Date.now()}-${Math.random().toString(36).slice(2, 9)}` + const additionalIps = Array.isArray(r.additionalIps) ? JSON.stringify(r.additionalIps) : '[]' + const dailyRate = r.dailyRate === '' || r.dailyRate == null ? null : Number(r.dailyRate) + const monthlyRate = r.monthlyRate === '' || r.monthlyRate == null ? null : Number(r.monthlyRate) + + db.prepare(` + INSERT INTO vps ( + id, ip, ipv6, additionalIps, dns, providerId, providerAccountId, country, city, datacenter, + os, vcpu, ramGb, diskGb, diskType, virtualization, bandwidthTb, sshPort, rootUser, + purpose, environment, project, monitoringEnabled, backupEnabled, status, tariffType, + currency, dailyRate, monthlyRate, createdAt, paidUntil, notes, userOverrides + ) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) + `).run( + id, + r.ip ?? '', + r.ipv6 ?? '', + additionalIps, + r.dns ?? '', + r.providerId ?? '', + r.providerAccountId ?? '', + r.country ?? '', + r.city ?? '', + r.datacenter ?? '', + r.os ?? '', + r.vcpu ?? 0, + r.ramGb ?? 0, + r.diskGb ?? 0, + r.diskType ?? '', + r.virtualization ?? '', + r.bandwidthTb ?? 0, + r.sshPort ?? 22, + r.rootUser ?? '', + r.purpose ?? '', + r.environment ?? '', + r.project ?? '', + r.monitoringEnabled ? 1 : 0, + r.backupEnabled ? 1 : 0, + r.status ?? 'active', + r.tariffType ?? '', + r.currency ?? '', + dailyRate, + monthlyRate, + r.createdAt ?? new Date().toISOString().slice(0, 10), + r.paidUntil ?? '', + r.notes ?? '', + r.userOverrides ? (Array.isArray(r.userOverrides) ? JSON.stringify(r.userOverrides) : r.userOverrides) : '[]', + ) + const row = db.prepare('SELECT * FROM vps WHERE id = ?').get(id) + res.status(201).json(rowToVps(row)) + } catch (err) { + res.status(500).json({ error: err.message }) + } +}) + +const USER_OVERRIDABLE_FIELDS = ['country', 'city', 'datacenter', 'os', 'vcpu', 'ramGb', 'diskGb', 'diskType', 'virtualization', 'purpose', 'environment', 'project', 'notes', 'sshPort', 'rootUser', 'bandwidthTb', 'monitoringEnabled', 'backupEnabled'] + +router.put('/:id', (req, res) => { + try { + const db = getDb() + const { id } = req.params + const r = req.body + const existing = db.prepare('SELECT * FROM vps WHERE id = ?').get(id) + if (!existing) return res.status(404).json({ error: 'Not found' }) + + let userOverrides = [] + try { + userOverrides = existing.userOverrides ? JSON.parse(existing.userOverrides) : [] + } catch { + userOverrides = [] + } + if (r.userOverrides === 'clear' || (Array.isArray(r.userOverrides) && r.userOverrides.length === 0)) { + userOverrides = [] + } else { + for (const f of USER_OVERRIDABLE_FIELDS) { + const newVal = r[f] + const oldVal = existing[f] + const changed = String(newVal ?? '') !== String(oldVal ?? '') + if (changed && !userOverrides.includes(f)) { + userOverrides.push(f) + } + } + } + const userOverridesJson = JSON.stringify([...new Set(userOverrides)]) + + const additionalIps = Array.isArray(r.additionalIps) ? JSON.stringify(r.additionalIps) : '[]' + const dailyRate = r.dailyRate === '' || r.dailyRate == null ? null : Number(r.dailyRate) + const monthlyRate = r.monthlyRate === '' || r.monthlyRate == null ? null : Number(r.monthlyRate) + + db.prepare(` + UPDATE vps SET + ip = ?, ipv6 = ?, additionalIps = ?, dns = ?, providerId = ?, providerAccountId = ?, + country = ?, city = ?, datacenter = ?, os = ?, vcpu = ?, ramGb = ?, diskGb = ?, diskType = ?, + virtualization = ?, bandwidthTb = ?, sshPort = ?, rootUser = ?, purpose = ?, environment = ?, + project = ?, monitoringEnabled = ?, backupEnabled = ?, status = ?, tariffType = ?, + currency = ?, dailyRate = ?, monthlyRate = ?, createdAt = ?, paidUntil = ?, notes = ?, + userOverrides = ? + WHERE id = ? + `).run( + r.ip ?? '', + r.ipv6 ?? '', + additionalIps, + r.dns ?? '', + r.providerId ?? '', + r.providerAccountId ?? '', + r.country ?? '', + r.city ?? '', + r.datacenter ?? '', + r.os ?? '', + r.vcpu ?? 0, + r.ramGb ?? 0, + r.diskGb ?? 0, + r.diskType ?? '', + r.virtualization ?? '', + r.bandwidthTb ?? 0, + r.sshPort ?? 22, + r.rootUser ?? '', + r.purpose ?? '', + r.environment ?? '', + r.project ?? '', + r.monitoringEnabled ? 1 : 0, + r.backupEnabled ? 1 : 0, + r.status ?? 'active', + r.tariffType ?? '', + r.currency ?? '', + dailyRate, + monthlyRate, + r.createdAt ?? '', + r.paidUntil ?? '', + r.notes ?? '', + userOverridesJson, + id, + ) + const row = db.prepare('SELECT * FROM vps WHERE id = ?').get(id) + if (!row) return res.status(404).json({ error: 'Not found' }) + res.json(rowToVps(row)) + } catch (err) { + res.status(500).json({ error: err.message }) + } +}) + +router.delete('/:id', (req, res) => { + try { + const db = getDb() + const { id } = req.params + const result = db.prepare('DELETE FROM vps WHERE id = ?').run(id) + if (result.changes === 0) return res.status(404).json({ error: 'Not found' }) + res.status(204).send() + } catch (err) { + res.status(500).json({ error: err.message }) + } +}) + +export default router diff --git a/server/sync-scheduler.js b/server/sync-scheduler.js new file mode 100644 index 0000000..14dcd55 --- /dev/null +++ b/server/sync-scheduler.js @@ -0,0 +1,38 @@ +import { getDb } from './db.js' +import { syncFromBillmanager } from './adapters/billmanager/index.js' + +let syncIntervalId = null + +export function runScheduledSync() { + try { + const db = getDb() + const settings = db.prepare('SELECT * FROM settings WHERE id = ?').get('settings-main') + if (!settings?.syncEnabled) return + const accounts = db.prepare(` + SELECT * FROM provider_accounts + WHERE apiType = 'billmanager' AND apiBaseUrl IS NOT NULL AND apiBaseUrl != '' AND apiCredentials IS NOT NULL AND apiCredentials != '' + `).all() + for (const account of accounts) { + syncFromBillmanager(account, db).catch((err) => { + console.warn(`Sync failed for account ${account.id}:`, err.message) + }) + } + } catch (err) { + console.warn('Scheduled sync error:', err.message) + } +} + +export function startScheduler() { + if (syncIntervalId) clearInterval(syncIntervalId) + syncIntervalId = null + try { + const db = getDb() + const settings = db.prepare('SELECT * FROM settings WHERE id = ?').get('settings-main') + if (!settings?.syncEnabled) return + const interval = Math.max(15, Number(settings.syncIntervalMinutes) || 60) + syncIntervalId = setInterval(runScheduledSync, interval * 60 * 1000) + console.log(`Scheduled sync enabled: every ${interval} min`) + } catch { + // ignore + } +} diff --git a/server/utils/row-mappers.js b/server/utils/row-mappers.js new file mode 100644 index 0000000..513caa8 --- /dev/null +++ b/server/utils/row-mappers.js @@ -0,0 +1,51 @@ +/** + * Map database rows to API response format + */ + +/** + * @param {object} row - provider_account row + * @returns {object} sanitized (apiCredentials hidden) + */ +export function sanitizeAccount(row) { + if (!row) return row + const { apiCredentials, ...rest } = row + return { ...rest, apiCredentialsSet: Boolean(apiCredentials) } +} + +/** + * @param {object} row - active_tariffs row + * @returns {object|null} + */ +export function rowToActiveTariff(row) { + if (!row) return null + return { + ...row, + orderAvailable: Boolean(row.orderAvailable), + ramGb: row.ramGb != null ? Number(row.ramGb) : 0, + } +} + +/** + * @param {object} row - tariff_sync_options row + * @returns {object|null} + */ +export function rowToTariffSyncOptions(row) { + if (!row) return null + let datacenters = [] + let periods = [] + try { + datacenters = row.datacenters ? JSON.parse(row.datacenters) : [] + } catch { + /* ignore parse error */ + } + try { + periods = row.periods ? JSON.parse(row.periods) : [] + } catch { + /* ignore parse error */ + } + return { + ...row, + datacenters: Array.isArray(datacenters) ? datacenters : [], + periods: Array.isArray(periods) ? periods : [], + } +} diff --git a/src/App.css b/src/App.css new file mode 100644 index 0000000..b9d355d --- /dev/null +++ b/src/App.css @@ -0,0 +1,42 @@ +#root { + max-width: 1280px; + margin: 0 auto; + padding: 2rem; + text-align: center; +} + +.logo { + height: 6em; + padding: 1.5em; + will-change: filter; + transition: filter 300ms; +} +.logo:hover { + filter: drop-shadow(0 0 2em #646cffaa); +} +.logo.react:hover { + filter: drop-shadow(0 0 2em #61dafbaa); +} + +@keyframes logo-spin { + from { + transform: rotate(0deg); + } + to { + transform: rotate(360deg); + } +} + +@media (prefers-reduced-motion: no-preference) { + a:nth-of-type(2) .logo { + animation: logo-spin infinite 20s linear; + } +} + +.card { + padding: 2em; +} + +.read-the-docs { + color: #888; +} diff --git a/src/App.jsx b/src/App.jsx new file mode 100644 index 0000000..a214b9a --- /dev/null +++ b/src/App.jsx @@ -0,0 +1,186 @@ +import { useEffect, useMemo, useState } from 'react' +import { BrowserRouter, Navigate, Route, Routes } from 'react-router-dom' +import { AppLayout } from './components/AppLayout' +import { DashboardPage } from './pages/DashboardPage' +import { VpsPage } from './pages/VpsPage' +import { ProvidersPage } from './pages/ProvidersPage' +import { AccountsPage } from './pages/AccountsPage' +import { PaymentsPage } from './pages/PaymentsPage' +import { BalancePage } from './pages/BalancePage' +import { ReportsPage } from './pages/ReportsPage' +import { SettingsPage } from './pages/SettingsPage' +import { TariffsPage } from './pages/TariffsPage' +import { + createRecord, + deleteRecord, + initDataStore, + loadDataSet, + updateRecord, +} from './lib/api' + +function App() { + const [isReady, setIsReady] = useState(false) + const [loadError, setLoadError] = useState('') + const [db, setDb] = useState({ + vps: [], + providers: [], + providerAccounts: [], + payments: [], + balanceLedger: [], + settings: [], + activeTariffs: [], + tariffSyncOptions: [], + }) + const [ratesData, setRatesData] = useState(null) + const [ratesError, setRatesError] = useState('') + + useEffect(() => { + initDataStore() + .then(() => loadDataSet()) + .then((data) => { + setDb(data) + setIsReady(true) + setLoadError('') + }) + .catch((err) => { + setLoadError(err.message || 'Ошибка загрузки данных') + setIsReady(true) + }) + }, []) + + useEffect(() => { + const settings = db.settings?.[0] + if (!settings?.ratesUrl) { + return + } + fetch(settings.ratesUrl) + .then((response) => { + if (!response.ok) { + throw new Error('Не удалось получить курсы валют') + } + return response.json() + }) + .then((payload) => { + setRatesData(payload) + setRatesError('') + }) + .catch((error) => { + setRatesError(error.message || 'Ошибка загрузки курсов') + }) + }, [db.settings]) + + const actions = useMemo( + () => ({ + create: async (collectionName, record) => { + const nextCollection = await createRecord(collectionName, record) + setDb((prev) => ({ ...prev, [collectionName]: nextCollection })) + }, + update: async (collectionName, id, patch) => { + const nextCollection = await updateRecord(collectionName, id, patch) + setDb((prev) => ({ ...prev, [collectionName]: nextCollection })) + }, + remove: async (collectionName, id) => { + const nextCollection = await deleteRecord(collectionName, id) + setDb((prev) => ({ ...prev, [collectionName]: nextCollection })) + }, + upsertSettings: async (patch) => { + const current = db.settings?.[0] + if (current?.id) { + const nextCollection = await updateRecord('settings', current.id, patch) + setDb((prev) => ({ ...prev, settings: nextCollection })) + return + } + const nextCollection = await createRecord('settings', { + id: 'settings-main', + baseCurrency: 'RUB', + ratesUrl: 'https://www.cbr-xml-daily.ru/latest.js', + autoConvert: true, + ...patch, + }) + setDb((prev) => ({ ...prev, settings: nextCollection })) + }, + refreshData: async () => { + const data = await loadDataSet() + setDb(data) + }, + }), + [db.settings], + ) + + if (!isReady) { + return ( +
+
+
+
Загрузка данных...
+
+
+ ) + } + + if (loadError) { + return ( +
+
+
{loadError}
+
Убедитесь, что сервер запущен (npm run server)
+
+
+ ) + } + + return ( + + + + } /> + } + /> + } + /> + } + /> + } + /> + } + /> + } + /> + } + /> + } + /> + + } + /> + + + + ) +} + +export default App diff --git a/src/assets/react.svg b/src/assets/react.svg new file mode 100644 index 0000000..6c87de9 --- /dev/null +++ b/src/assets/react.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/components/AppLayout.jsx b/src/components/AppLayout.jsx new file mode 100644 index 0000000..373d848 --- /dev/null +++ b/src/components/AppLayout.jsx @@ -0,0 +1,84 @@ +import { NavLink, useLocation } from 'react-router-dom' +import { + IconBuildingSkyscraper, + IconChartHistogram, + IconCoin, + IconCreditCardPay, + IconLayoutDashboard, + IconSettings, + IconServer, + IconServer2, + IconWallet, +} from '@tabler/icons-react' + +const menuItems = [ + { to: '/dashboard', label: 'Дашборд', icon: IconLayoutDashboard }, + { to: '/vps', label: 'VPS', icon: IconServer }, + { to: '/tariffs', label: 'Активные тарифы', icon: IconServer2 }, + { to: '/providers', label: 'Хостеры', icon: IconBuildingSkyscraper }, + { to: '/accounts', label: 'Аккаунты хостеров', icon: IconWallet }, + { to: '/payments', label: 'Платежи', icon: IconCreditCardPay }, + { to: '/balance', label: 'Баланс и списания', icon: IconCoin }, + { to: '/reports', label: 'Отчёты', icon: IconChartHistogram }, + { to: '/settings', label: 'Настройки', icon: IconSettings }, +] + +export function AppLayout({ children }) { + const location = useLocation() + + return ( +
+ + +
+
+
+
+
+ {menuItems.map((item) => { + const Icon = item.icon + return ( + + + {item.label} + + ) + })} +
+
+
+
+
+
{children}
+
+
+
+ ) +} diff --git a/src/components/ConvertedAmount.jsx b/src/components/ConvertedAmount.jsx new file mode 100644 index 0000000..f60c3d5 --- /dev/null +++ b/src/components/ConvertedAmount.jsx @@ -0,0 +1,26 @@ +import { convertWithProviderRate, formatCurrency } from '../lib/utils' + +function sourceMeta(source) { + if (source === 'provider') { + return { label: 'Курс хостера', className: 'bg-green-lt text-green' } + } + if (source === 'global') { + return { label: 'Глобальный курс', className: 'bg-blue-lt text-blue' } + } + return { label: 'Без конвертации', className: 'bg-secondary-lt text-secondary' } +} + +export function ConvertedAmount({ amount, currency, provider, settings, ratesData }) { + const result = convertWithProviderRate(amount, currency, provider, settings, ratesData) + const meta = sourceMeta(result.source) + + return ( +
+
+ {formatCurrency(result.value, result.currency)} + {meta.label} +
+
{formatCurrency(amount, currency)}
+
+ ) +} diff --git a/src/components/EmptyState.jsx b/src/components/EmptyState.jsx new file mode 100644 index 0000000..2638e4f --- /dev/null +++ b/src/components/EmptyState.jsx @@ -0,0 +1,13 @@ +/** + * Tabler-style empty state for tables. + * @see https://docs.tabler.io/docs/components/empty-states.html + */ +export function EmptyState({ message = 'Нет данных', colSpan = 10 }) { + return ( + + + {message} + + + ) +} diff --git a/src/components/ExpenseChart.jsx b/src/components/ExpenseChart.jsx new file mode 100644 index 0000000..0e238f7 --- /dev/null +++ b/src/components/ExpenseChart.jsx @@ -0,0 +1,105 @@ +import { useEffect, useRef } from 'react' +import { + Chart as ChartJS, + BarController, + BarElement, + CategoryScale, + LinearScale, + Title, + Tooltip, +} from 'chart.js' + +ChartJS.register(BarController, BarElement, CategoryScale, LinearScale, Title, Tooltip) + +export function ExpenseChart({ data, baseCurrency, formatCurrency }) { + const canvasRef = useRef(null) + const chartRef = useRef(null) + + useEffect(() => { + const safeData = Array.isArray(data) ? data : [] + if (safeData.length === 0) return + + const canvas = canvasRef.current + if (!canvas) return + + try { + if (chartRef.current) { + chartRef.current.destroy() + chartRef.current = null + } + + const ctx = canvas.getContext('2d') + if (!ctx) return + + const chart = new ChartJS(ctx, { + type: 'bar', + data: { + labels: safeData.map((d) => d.monthLabel || ''), + datasets: [ + { + label: 'Расход', + data: safeData.map((d) => Number(d.amount) || 0), + backgroundColor: 'rgba(47, 179, 68, 0.6)', + borderColor: 'rgb(47, 179, 68)', + borderWidth: 1, + }, + ], + }, + options: { + responsive: true, + maintainAspectRatio: false, + plugins: { + legend: { display: false }, + tooltip: { + callbacks: { + label: (ctx) => + typeof formatCurrency === 'function' + ? formatCurrency(ctx.raw, baseCurrency) + : String(ctx.raw), + }, + }, + }, + scales: { + y: { + beginAtZero: true, + suggestedMax: (ctx) => { + const max = ctx.chart?.data?.datasets?.[0]?.data + ? Math.max(...ctx.chart.data.datasets[0].data, 0) + : 0 + return max > 0 ? undefined : 1 + }, + ticks: { + callback: (value) => + typeof formatCurrency === 'function' + ? formatCurrency(value, baseCurrency) + : String(value), + }, + }, + }, + }, + }) + chartRef.current = chart + } catch (err) { + console.warn('ExpenseChart error:', err) + } + + return () => { + if (chartRef.current) { + chartRef.current.destroy() + chartRef.current = null + } + } + }, [data, baseCurrency, formatCurrency]) + + const safeData = Array.isArray(data) ? data : [] + + return ( +
+ {safeData.length === 0 ? ( +
Нет данных за период
+ ) : ( + + )} +
+ ) +} diff --git a/src/components/PageHeader.jsx b/src/components/PageHeader.jsx new file mode 100644 index 0000000..216b59d --- /dev/null +++ b/src/components/PageHeader.jsx @@ -0,0 +1,12 @@ +export function PageHeader({ pretitle, title }) { + return ( +
+
+
+
{pretitle}
+

{title}

+
+
+
+ ) +} diff --git a/src/components/ProviderPieChart.jsx b/src/components/ProviderPieChart.jsx new file mode 100644 index 0000000..3fc0c1b --- /dev/null +++ b/src/components/ProviderPieChart.jsx @@ -0,0 +1,97 @@ +import { useEffect, useRef } from 'react' +import { + Chart as ChartJS, + ArcElement, + DoughnutController, + Legend, + Tooltip, +} from 'chart.js' + +ChartJS.register(ArcElement, DoughnutController, Legend, Tooltip) + +const COLORS = [ + 'rgba(32, 107, 196, 0.8)', + 'rgba(47, 179, 68, 0.8)', + 'rgba(245, 159, 0, 0.8)', + 'rgba(155, 93, 229, 0.8)', + 'rgba(214, 51, 132, 0.8)', + 'rgba(13, 202, 240, 0.8)', +] + +export function ProviderPieChart({ data, baseCurrency, formatCurrency }) { + const canvasRef = useRef(null) + const chartRef = useRef(null) + + useEffect(() => { + const safeData = Array.isArray(data) ? data : [] + if (safeData.length === 0) return + + const canvas = canvasRef.current + if (!canvas) return + + try { + if (chartRef.current) { + chartRef.current.destroy() + chartRef.current = null + } + + const ctx = canvas.getContext('2d') + if (!ctx) return + + chartRef.current = new ChartJS(ctx, { + type: 'doughnut', + data: { + labels: safeData.map((d) => d.providerName || '-'), + datasets: [ + { + data: safeData.map((d) => Number(d.amount) || 0), + backgroundColor: safeData.map((_, i) => COLORS[i % COLORS.length]), + borderWidth: 1, + }, + ], + }, + options: { + responsive: true, + maintainAspectRatio: false, + plugins: { + legend: { position: 'right' }, + tooltip: { + callbacks: { + label: (ctx) => { + const total = ctx.dataset.data.reduce((a, b) => a + b, 0) + const pct = total > 0 ? ((ctx.raw / total) * 100).toFixed(1) : 0 + const formatted = + typeof formatCurrency === 'function' + ? formatCurrency(ctx.raw, baseCurrency) + : String(ctx.raw) + return `${ctx.label}: ${formatted} (${pct}%)` + }, + }, + }, + }, + }, + }) + } catch (err) { + console.warn('ProviderPieChart error:', err) + } + + return () => { + if (chartRef.current) { + chartRef.current.destroy() + chartRef.current = null + } + } + }, [data, baseCurrency, formatCurrency]) + + const safeData = Array.isArray(data) ? data : [] + + return ( +
+ {safeData.length === 0 ? ( +
Нет расходов по хостеру
+ ) : ( + + )} +
+ ) +} diff --git a/src/components/UiModal.jsx b/src/components/UiModal.jsx new file mode 100644 index 0000000..6a29964 --- /dev/null +++ b/src/components/UiModal.jsx @@ -0,0 +1,68 @@ +import { useEffect } from 'react' +import { createPortal } from 'react-dom' + +export function UiModal({ open, title, onClose, size = 'modal-lg', footer, scrollable = false, children }) { + useEffect(() => { + if (!open) { + return undefined + } + const previousOverflow = document.body.style.overflow + document.body.style.overflow = 'hidden' + return () => { + document.body.style.overflow = previousOverflow + } + }, [open]) + + if (!open) { + return null + } + + const modalNode = ( +
+
+
+
+
+
+
{title}
+
+
+ {children} +
+ {footer ?
{footer}
: null} +
+
+
+
+ ) + + return createPortal(modalNode, document.body) +} diff --git a/src/index.css b/src/index.css new file mode 100644 index 0000000..ba74aaa --- /dev/null +++ b/src/index.css @@ -0,0 +1,169 @@ +body { + margin: 0; + min-width: 320px; + background: var(--tblr-bg-surface); + overflow-x: hidden; +} + +#root { + min-height: 100vh; +} + +.app-sidebar { + min-height: 100vh; + background: linear-gradient(180deg, #18233a 0%, #111a2d 100%); + border-right: 1px solid #23314b; +} + +.app-sidebar .nav-link { + border-radius: 8px; + margin-bottom: 4px; + color: #aebbd2; +} + +.app-sidebar .nav-link:hover, +.app-sidebar .nav-link.active { + background: rgba(61, 119, 255, 0.2); + color: #e8f0ff; +} + +.page-body { + background: #f5f7fb; + min-height: calc(100vh - 56px); +} + +.page-wrapper { + min-width: 0; +} + +.mobile-nav-scroll { + overflow-x: auto; + -webkit-overflow-scrolling: touch; +} + +.mobile-nav-scroll .nav { + width: max-content; +} + +.cursor-pointer { + cursor: pointer; +} + +.table td, +.table th { + vertical-align: middle; +} + +.stat-value { + font-size: 1.75rem; + font-weight: 600; +} + +.metric-card { + border-left: 4px solid transparent; +} + +.metric-card.metric-blue { + border-left-color: #206bc4; +} + +.metric-card.metric-green { + border-left-color: #2fb344; +} + +.metric-card.metric-yellow { + border-left-color: #f59f00; +} + +.metric-card.metric-purple { + border-left-color: #9b5de5; +} + +.metric-icon { + width: 36px; + height: 36px; + border-radius: 10px; + display: inline-flex; + align-items: center; + justify-content: center; +} + +.table-actions { + display: flex; + justify-content: flex-end; + gap: 0.35rem; + flex-wrap: wrap; +} + +.table-actions .btn { + white-space: nowrap; +} + +.vps-header-actions { + display: flex; + align-items: center; + gap: 0.5rem; +} + +/* VPS modal form sections */ +.vps-modal-form .vps-form-section { + padding-bottom: 1.25rem; + margin-bottom: 1.25rem; + border-bottom: 1px solid var(--tblr-border-color, #e6e7e9); +} + +.vps-modal-form .vps-form-section:last-child { + margin-bottom: 0; + padding-bottom: 0; + border-bottom: none; +} + +.vps-form-section-title { + font-size: 0.75rem; + font-weight: 600; + text-transform: uppercase; + letter-spacing: 0.05em; + color: var(--tblr-secondary, #656d77); + margin-bottom: 0.75rem; +} + +/* Компактный отступ между карточками в одной колонке */ +.card-stack .card { + margin-bottom: 0; +} +.card-stack .card + .card { + margin-top: 1rem; +} + +@media (max-width: 991.98px) { + .app-sidebar { + display: none; + } + + .page-body .container-fluid { + padding-left: 0.75rem; + padding-right: 0.75rem; + } + + .card .table-responsive { + margin-left: -0.75rem; + margin-right: -0.75rem; + width: calc(100% + 1.5rem); + } + + .table-actions { + flex-direction: column; + align-items: stretch; + min-width: 8.5rem; + } + + .table-actions .btn { + width: 100%; + } + + .vps-header-actions { + overflow-x: auto; + white-space: nowrap; + padding-bottom: 0.125rem; + } +} diff --git a/src/lib/api.js b/src/lib/api.js new file mode 100644 index 0000000..bd103d7 --- /dev/null +++ b/src/lib/api.js @@ -0,0 +1,144 @@ +import { uid } from './utils' + +const COLLECTIONS = { + vps: 'vps', + providers: 'providers', + providerAccounts: 'providerAccounts', + payments: 'payments', + balanceLedger: 'balanceLedger', + settings: 'settings', +} + +const API_PATHS = { + [COLLECTIONS.vps]: '/api/vps', + [COLLECTIONS.providers]: '/api/providers', + [COLLECTIONS.providerAccounts]: '/api/provider-accounts', + [COLLECTIONS.payments]: '/api/payments', + [COLLECTIONS.balanceLedger]: '/api/balance-ledger', + [COLLECTIONS.settings]: '/api/settings', +} + +const STORAGE_KEY_PREFIX = 'vps-tracker:' + +const API_BASE = import.meta.env.VITE_API_URL || '' + +function getLocalStorageData() { + const data = {} + for (const name of Object.values(COLLECTIONS)) { + const key = `${STORAGE_KEY_PREFIX}${name}` + const raw = localStorage.getItem(key) + if (raw) { + try { + data[name] = JSON.parse(raw) + } catch { + data[name] = [] + } + } + } + return data +} + +function clearLocalStorage() { + for (const name of Object.values(COLLECTIONS)) { + localStorage.removeItem(`${STORAGE_KEY_PREFIX}${name}`) + } +} + +async function fetchApi(path, options = {}) { + const url = `${API_BASE}${path.startsWith('/') ? path : `/${path}`}` + const res = await fetch(url, { + headers: { 'Content-Type': 'application/json', ...options.headers }, + ...options, + }) + if (!res.ok) { + const err = new Error(res.statusText || 'API error') + err.status = res.status + err.response = res + throw err + } + if (res.status === 204) return null + return res.json() +} + +export async function initDataStore() { + const localData = getLocalStorageData() + const hasLocalData = Object.keys(localData).some((k) => { + const arr = localData[k] + return Array.isArray(arr) ? arr.length > 0 : arr && typeof arr === 'object' + }) + + if (hasLocalData) { + try { + await fetchApi('/api/migrate', { + method: 'POST', + body: JSON.stringify(localData), + }) + clearLocalStorage() + } catch (err) { + console.warn('Migration from localStorage failed:', err) + } + } +} + +export async function loadDataSet() { + const data = await fetchApi('/api/data') + return { + [COLLECTIONS.vps]: data.vps ?? [], + [COLLECTIONS.providers]: data.providers ?? [], + [COLLECTIONS.providerAccounts]: data.providerAccounts ?? [], + [COLLECTIONS.payments]: data.payments ?? [], + [COLLECTIONS.balanceLedger]: data.balanceLedger ?? [], + [COLLECTIONS.settings]: data.settings ?? [], + activeTariffs: data.activeTariffs ?? [], + tariffSyncOptions: data.tariffSyncOptions ?? [], + } +} + +async function fetchCollection(collectionName) { + const path = API_PATHS[collectionName] + if (!path) throw new Error(`Unknown collection: ${collectionName}`) + return fetchApi(path) +} + +export async function createRecord(collectionName, record) { + const path = API_PATHS[collectionName] + if (!path) throw new Error(`Unknown collection: ${collectionName}`) + const payload = { ...record, id: record.id || uid() } + await fetchApi(path, { + method: 'POST', + body: JSON.stringify(payload), + }) + return fetchCollection(collectionName) +} + +export async function updateRecord(collectionName, id, patch) { + const path = API_PATHS[collectionName] + if (!path) throw new Error(`Unknown collection: ${collectionName}`) + await fetchApi(`${path}/${encodeURIComponent(id)}`, { + method: 'PUT', + body: JSON.stringify(patch), + }) + return fetchCollection(collectionName) +} + +export async function deleteRecord(collectionName, id) { + const path = API_PATHS[collectionName] + if (!path) throw new Error(`Unknown collection: ${collectionName}`) + await fetchApi(`${path}/${encodeURIComponent(id)}`, { method: 'DELETE' }) + return fetchCollection(collectionName) +} + +export async function syncAccount(accountId) { + return fetchApi(`/api/sync/${encodeURIComponent(accountId)}`, { method: 'POST' }) +} + +export async function fetchAccountBalance(accountId) { + return fetchApi(`/api/sync/${encodeURIComponent(accountId)}/balance`, { method: 'GET' }) +} + +export async function testApiConnection(apiBaseUrl, apiCredentials) { + return fetchApi('/api/sync/test-connection', { + method: 'POST', + body: JSON.stringify({ apiBaseUrl, apiCredentials }), + }) +} diff --git a/src/lib/utils.js b/src/lib/utils.js new file mode 100644 index 0000000..d427dea --- /dev/null +++ b/src/lib/utils.js @@ -0,0 +1,342 @@ +/** + * Утилиты vps-tracker: ID, URL, форматирование, валюта, лейблы, CSV + */ + +/** + * Генерирует уникальный ID (UUID или fallback) + * @returns {string} + */ +export function uid() { + if (crypto && crypto.randomUUID) { + return crypto.randomUUID() + } + return `id-${Date.now()}-${Math.random().toString(36).slice(2, 9)}` +} + +/** + * Добавляет https:// к URL при отсутствии протокола + * @param {string} website + * @returns {string} + */ +export function normalizeWebsiteUrl(website) { + if (!website) { + return '' + } + if (website.startsWith('http://') || website.startsWith('https://')) { + return website + } + return `https://${website}` +} + +/** + * URL иконки сайта через Google Favicon API + * @param {string} website + * @returns {string} + */ +export function faviconUrlFromWebsite(website) { + const normalized = normalizeWebsiteUrl(website) + if (!normalized) { + return '' + } + try { + const { hostname } = new URL(normalized) + return `https://www.google.com/s2/favicons?domain=${hostname}&sz=32` + } catch { + return '' + } +} + +const countryCodeByName = { + germany: 'DE', + netherlands: 'NL', + russia: 'RU', + usa: 'US', + 'united states': 'US', + ukraine: 'UA', + poland: 'PL', + france: 'FR', + spain: 'ES', + italy: 'IT', + estonia: 'EE', + finland: 'FI', + sweden: 'SE', + norway: 'NO', + latvia: 'LV', + lithuania: 'LT', + czechia: 'CZ', + czech: 'CZ', + singapore: 'SG', + japan: 'JP', + canada: 'CA', + brazil: 'BR', + turkey: 'TR', + georgia: 'GE', + kazakhstan: 'KZ', +} + +/** + * Эмодзи флага страны по названию (ru-RU) + * @param {string} country - название страны + * @returns {string} эмодзи флага или 🌐 + */ +export function getCountryFlagEmoji(country) { + if (!country) { + return '🌐' + } + const code = countryCodeByName[country.trim().toLowerCase()] + if (!code) { + return '🌐' + } + return code + .toUpperCase() + .split('') + .map((char) => String.fromCodePoint(127397 + char.charCodeAt(0))) + .join('') +} + +const paymentTypeLabels = { + direct_vps_payment: 'Прямой платеж за VPS', + provider_balance_topup: 'Пополнение баланса хостера', + daily_debit: 'Ежедневное списание', + monthly_debit: 'Ежемесячное списание', +} + +/** + * Человекочитаемая метка типа платежа + * @param {string} type - direct_vps_payment | provider_balance_topup | daily_debit | monthly_debit + * @returns {string} + */ +export function paymentTypeLabel(type) { + return paymentTypeLabels[type] || type +} + +const vpsStatusLabels = { + active: 'Активен', + paused: 'Приостановлен', + archived: 'Архив', +} + +/** + * Человекочитаемая метка статуса VPS + * @param {string} status - active | paused | archived + * @returns {string} + */ +export function vpsStatusLabel(status) { + return vpsStatusLabels[status] || status +} + +const billingModeLabels = { + daily: 'Ежедневно', + monthly: 'Ежемесячно', +} + +/** + * Человекочитаемая метка режима биллинга + * @param {string} mode - daily | monthly + * @returns {string} + */ +export function billingModeLabel(mode) { + return billingModeLabels[mode] || mode +} + +const tariffTypeLabels = { + daily: 'Суточный', + monthly: 'Месячный', +} + +/** + * Человекочитаемая метка типа тарифа + * @param {string} type - daily | monthly + * @returns {string} + */ +export function tariffTypeLabel(type) { + return tariffTypeLabels[type] || type +} + +const CURRENCY_SYMBOL_MAP = { + '€': 'EUR', + '$': 'USD', + '₽': 'RUB', + '£': 'GBP', + '¥': 'JPY', + '₴': 'UAH', + '₸': 'KZT', +} + +function toIsoCurrency(currency) { + if (!currency || typeof currency !== 'string') return 'USD' + const trimmed = currency.trim() + if (CURRENCY_SYMBOL_MAP[trimmed]) return CURRENCY_SYMBOL_MAP[trimmed] + if (trimmed.length === 3 && /^[A-Z]{3}$/i.test(trimmed)) return trimmed.toUpperCase() + return 'USD' +} + +/** + * Форматирует сумму в валюте (ru-RU) + * @param {number} amount + * @param {string} [currency='USD'] + * @returns {string} + */ +export function formatCurrency(amount, currency = 'USD') { + const safeAmount = Number.isFinite(Number(amount)) ? Number(amount) : 0 + const isoCurrency = toIsoCurrency(currency) + return new Intl.NumberFormat('ru-RU', { + style: 'currency', + currency: isoCurrency, + minimumFractionDigits: 2, + }).format(safeAmount) +} + +/** + * Конвертирует сумму из одной валюты в другую по ratesData (CBR и т.п.) + * @param {number} amount + * @param {string} fromCurrency + * @param {string} toCurrency + * @param {object} ratesData - { base, rates: { USD: 1.2, EUR: 1.1, ... } } + * @returns {number} + */ +export function convertCurrency(amount, fromCurrency, toCurrency, ratesData) { + const safeAmount = Number(amount) + if (!Number.isFinite(safeAmount)) { + return 0 + } + const from = toIsoCurrency(fromCurrency) + const to = toIsoCurrency(toCurrency) + if (!from || !to || from === to) { + return safeAmount + } + if (!ratesData || !ratesData.rates || !ratesData.base) { + return safeAmount + } + const apiBase = ratesData.base.toUpperCase() + const rates = { ...ratesData.rates, [apiBase]: 1 } + + if (!rates[from] || !rates[to]) { + return safeAmount + } + + const amountInApiBase = safeAmount / rates[from] + return amountInApiBase * rates[to] +} + +/** + * Форматирует сумму в базовой валюте приложения (settings.baseCurrency) + * @param {number} amount + * @param {string} currency + * @param {object[]} appSettings - settings из API + * @param {object} ratesData + * @returns {string} + */ +export function formatInBaseCurrency(amount, currency, appSettings, ratesData) { + const settings = appSettings?.[0] || {} + const baseCurrency = settings.baseCurrency || 'RUB' + const autoConvert = settings.autoConvert !== false + + if (!autoConvert) { + return formatCurrency(amount, currency) + } + + const converted = convertCurrency(amount, currency, baseCurrency, ratesData) + return formatCurrency(converted, baseCurrency) +} + +/** + * Конвертирует сумму в валюту отображения (из настроек). + * provider.baseCurrency — валюта, в которой хостер принимает платежи. + * settings.baseCurrency — валюта отображения на дашбордах. + * Курсы хостера (usdRate, eurRate) — курс 1 USD/EUR в валюту отображения. + */ +export function convertWithProviderRate(amount, currency, provider, appSettings, ratesData) { + const safeAmount = Number(amount) + const appBase = (appSettings?.[0]?.baseCurrency || 'RUB').toUpperCase() + if (!Number.isFinite(safeAmount)) { + return { value: 0, currency: appBase, source: 'global' } + } + + const fromCurrency = toIsoCurrency(currency || appBase) + + if (fromCurrency === appBase) { + return { value: safeAmount, currency: appBase, source: 'native' } + } + + const usdRate = Number(provider?.usdRate) + const eurRate = Number(provider?.eurRate) + if (fromCurrency === 'USD' && Number.isFinite(usdRate) && usdRate > 0) { + return { value: safeAmount * usdRate, currency: appBase, source: 'provider' } + } + if (fromCurrency === 'EUR' && Number.isFinite(eurRate) && eurRate > 0) { + return { value: safeAmount * eurRate, currency: appBase, source: 'provider' } + } + + return { + value: convertCurrency(safeAmount, fromCurrency, appBase, ratesData), + currency: appBase, + source: 'global', + } +} + +/** + * Форматирует сумму с учётом курсов провайдера (usdRate, eurRate) + * @param {number} amount + * @param {string} currency + * @param {object} provider + * @param {object[]} appSettings + * @param {object} ratesData + * @returns {string} + */ +export function formatInProviderCurrency(amount, currency, provider, appSettings, ratesData) { + const converted = convertWithProviderRate(amount, currency, provider, appSettings, ratesData) + return formatCurrency(converted.value, converted.currency) +} + +/** + * Ключ месяца для группировки: "2025-03" + * @param {string} dateString + * @returns {string} + */ +export function monthKey(dateString) { + const date = new Date(dateString) + if (Number.isNaN(date.getTime())) { + return '' + } + return `${date.getFullYear()}-${String(date.getMonth() + 1).padStart(2, '0')}` +} + +/** + * Преобразует массив объектов в CSV-строку + * @param {object[]} rows + * @returns {string} + */ +export function toCsv(rows) { + if (!rows.length) { + return '' + } + const headers = Object.keys(rows[0]) + const escapeValue = (value) => { + const str = `${value ?? ''}` + if (str.includes('"') || str.includes(',') || str.includes('\n')) { + return `"${str.replaceAll('"', '""')}"` + } + return str + } + const lines = [headers.join(',')] + for (const row of rows) { + lines.push(headers.map((h) => escapeValue(row[h])).join(',')) + } + return lines.join('\n') +} + +/** + * Инициирует скачивание текстового файла (CSV) + * @param {string} fileName + * @param {string} content + */ +export function downloadTextFile(fileName, content) { + const blob = new Blob([content], { type: 'text/csv;charset=utf-8;' }) + const url = URL.createObjectURL(blob) + const anchor = document.createElement('a') + anchor.href = url + anchor.download = fileName + anchor.click() + URL.revokeObjectURL(url) +} diff --git a/src/main.jsx b/src/main.jsx new file mode 100644 index 0000000..9b655d4 --- /dev/null +++ b/src/main.jsx @@ -0,0 +1,11 @@ +import { StrictMode } from 'react' +import { createRoot } from 'react-dom/client' +import './index.css' +import App from './App.jsx' +import '@tabler/core/dist/css/tabler.min.css' + +createRoot(document.getElementById('root')).render( + + + , +) diff --git a/src/pages/AccountsPage.jsx b/src/pages/AccountsPage.jsx new file mode 100644 index 0000000..1d0ad9d --- /dev/null +++ b/src/pages/AccountsPage.jsx @@ -0,0 +1,515 @@ +import { useMemo, useState } from 'react' +import { + billingModeLabel, + faviconUrlFromWebsite, +} from '../lib/utils' +import { UiModal } from '../components/UiModal' +import { EmptyState } from '../components/EmptyState' +import { PageHeader } from '../components/PageHeader' +import { ConvertedAmount } from '../components/ConvertedAmount' +import { syncAccount, testApiConnection, fetchAccountBalance } from '../lib/api' +import { IconRefresh, IconPlugConnected } from '@tabler/icons-react' + +const emptyForm = { + providerId: '', + name: '', + panelUrl: '', + currency: 'USD', + billingMode: 'monthly', + notes: '', + apiType: '', + apiBaseUrl: '', + apiLogin: '', + apiPassword: '', +} + +export function AccountsPage({ db, actions, settings, ratesData }) { + const [form, setForm] = useState(emptyForm) + const [editingId, setEditingId] = useState(null) + const [isModalOpen, setIsModalOpen] = useState(false) + const [syncLoadingId, setSyncLoadingId] = useState(null) + const [syncLoadingAll, setSyncLoadingAll] = useState(false) + const [syncMessage, setSyncMessage] = useState(null) + const [balanceLoadingId, setBalanceLoadingId] = useState(null) + const [saveError, setSaveError] = useState(null) + + const billmanagerAccounts = useMemo( + () => db.providerAccounts.filter((a) => a.apiType === 'billmanager' && a.apiBaseUrl), + [db.providerAccounts], + ) + const [testConnectionLoading, setTestConnectionLoading] = useState(false) + const [testConnectionResult, setTestConnectionResult] = useState(null) + + const balances = useMemo(() => { + return db.providerAccounts.map((account) => { + const rows = db.balanceLedger.filter((row) => row.providerAccountId === account.id) + const credits = rows + .filter((row) => row.direction === 'credit') + .reduce((acc, row) => acc + Number(row.amount || 0), 0) + const debits = rows + .filter((row) => row.direction === 'debit') + .reduce((acc, row) => acc + Number(row.amount || 0), 0) + return { accountId: account.id, balance: credits - debits } + }) + }, [db.balanceLedger, db.providerAccounts]) + + const getBalance = (accountId) => balances.find((item) => item.accountId === accountId)?.balance || 0 + + const getDisplayBalance = (account) => { + if (account.apiType === 'billmanager' && account.balance_api != null) { + return account.balance_api + } + return getBalance(account.id) + } + + const getDisplayCurrency = (account) => account.balance_currency || account.currency || 'USD' + + const onFetchBalance = async (accountId) => { + setBalanceLoadingId(accountId) + try { + await fetchAccountBalance(accountId) + await actions.refreshData() + } catch (err) { + console.error('Balance fetch failed:', err) + } finally { + setBalanceLoadingId(null) + } + } + + const onSubmit = async (event) => { + event.preventDefault() + if (!form.providerId || !form.name.trim()) { + return + } + const payload = { + providerId: form.providerId, + name: form.name, + panelUrl: form.panelUrl, + currency: form.currency, + billingMode: form.billingMode, + notes: form.notes, + apiType: form.apiType || '', + apiBaseUrl: form.apiType === 'billmanager' ? form.apiBaseUrl : '', + } + if (form.apiType === 'billmanager' && form.apiLogin && form.apiPassword) { + payload.apiCredentials = `${form.apiLogin}:${form.apiPassword}` + } + setSaveError(null) + try { + if (editingId) { + await actions.update('providerAccounts', editingId, payload) + } else { + await actions.create('providerAccounts', payload) + } + setForm(emptyForm) + setEditingId(null) + setIsModalOpen(false) + } catch (err) { + setSaveError(err.message || 'Ошибка сохранения') + } + } + + const onTestConnection = async () => { + if (!form.apiBaseUrl?.trim() || !form.apiLogin?.trim() || !form.apiPassword?.trim()) { + setTestConnectionResult({ ok: false, error: 'Заполните URL, логин и пароль' }) + return + } + setTestConnectionLoading(true) + setTestConnectionResult(null) + try { + const result = await testApiConnection(form.apiBaseUrl, `${form.apiLogin}:${form.apiPassword}`) + setTestConnectionResult(result) + } catch (err) { + setTestConnectionResult({ ok: false, error: err.message || 'Ошибка проверки' }) + } finally { + setTestConnectionLoading(false) + } + } + + const onEdit = (account) => { + setForm({ + providerId: account.providerId || '', + name: account.name || '', + panelUrl: account.panelUrl || '', + currency: account.currency || 'USD', + billingMode: account.billingMode || 'monthly', + notes: account.notes || '', + apiType: account.apiType || '', + apiBaseUrl: account.apiBaseUrl || '', + apiLogin: '', + apiPassword: '', + }) + setEditingId(account.id) + setIsModalOpen(true) + setTestConnectionResult(null) + } + + const editingAccount = editingId ? db.providerAccounts.find((a) => a.id === editingId) : null + const canTestConnection = form.apiType === 'billmanager' && form.apiBaseUrl?.trim() && form.apiLogin?.trim() && form.apiPassword?.trim() + + const onSync = async (accountId) => { + setSyncLoadingId(accountId) + setSyncMessage(null) + try { + const result = await syncAccount(accountId) + setSyncMessage(result.ok ? `Синхронизировано: ${result.synced?.vpsCount ?? 0} VPS, ${result.synced?.paymentsCount ?? 0} платежей${result.synced?.balance ? ', баланс обновлён' : ''}` : result.error || 'Ошибка') + if (result.ok) await actions.refreshData() + } catch (err) { + setSyncMessage(err.message || 'Ошибка синхронизации') + } finally { + setSyncLoadingId(null) + } + } + + const onSyncAll = async () => { + if (billmanagerAccounts.length === 0) return + setSyncLoadingAll(true) + setSyncMessage(null) + let totalVps = 0 + let totalPayments = 0 + let lastError = null + for (const account of billmanagerAccounts) { + try { + const result = await syncAccount(account.id) + if (result.ok) { + totalVps += result.synced?.vpsCount ?? 0 + totalPayments += result.synced?.paymentsCount ?? 0 + } else { + lastError = result.error + } + } catch (err) { + lastError = err.message + } + } + if (lastError && totalVps === 0 && totalPayments === 0) { + setSyncMessage(lastError) + } else { + setSyncMessage(`Синхронизировано: ${totalVps} VPS, ${totalPayments} платежей${lastError ? `. Ошибки: ${lastError}` : ''}`) + } + if (totalVps > 0 || totalPayments > 0) await actions.refreshData() + setSyncLoadingAll(false) + } + + return ( + <> + +
+
+
+
+

Аккаунты и привязанные VPS

+ {syncMessage ? ( +
+ {syncMessage} +
+ ) : null} +
+ {billmanagerAccounts.length > 0 ? ( + + ) : null} + +
+
+
+ + + + + + + + + + + {db.providerAccounts.map((account) => { + const provider = db.providers.find((item) => item.id === account.providerId) + const linkedVps = db.vps.filter((item) => item.providerAccountId === account.id) + return ( + + + + + + + + ) + })} + {db.providerAccounts.length === 0 ? ( + + ) : null} + +
АккаунтХостерVPSБаланс +
{account.name} +
+ {faviconUrlFromWebsite(provider?.website) ? ( + + ) : null} + {provider?.name || '-'} +
+
{linkedVps.map((item) => item.dns || item.ip).join(', ') || '-'} + + {account.balance_updated_at ? ( +
+ Обновлено: {new Date(account.balance_updated_at).toLocaleString('ru-RU')} +
+ ) : null} + {account.enoughmoneyto ? ( +
+ Хватит до: {account.enoughmoneyto} +
+ ) : null} +
+
+ {account.apiType === 'billmanager' && account.apiBaseUrl ? ( + <> + + + + ) : null} + + +
+
+
+
+
+
+ + { + setIsModalOpen(false) + setEditingId(null) + setForm(emptyForm) + setTestConnectionResult(null) + setSaveError(null) + }} + size="modal-md" + > +
+
+ + +
+
+ + setForm((prev) => ({ ...prev, name: e.target.value }))} + required + /> +
+
+ + setForm((prev) => ({ ...prev, panelUrl: e.target.value }))} + /> +
+
+ + +
+
+ + +
+
+
+
Интеграция API
+
+
+ + +
+ {form.apiType === 'billmanager' ? ( + <> +
+ + setForm((prev) => ({ ...prev, apiBaseUrl: e.target.value }))} + /> +
+
+ + setForm((prev) => ({ ...prev, apiLogin: e.target.value }))} + /> +
+
+ + setForm((prev) => ({ ...prev, apiPassword: e.target.value }))} + /> +
+
+ + {testConnectionResult ? ( + + {testConnectionResult.ok + ? `Соединение успешно${testConnectionResult.vdsCount != null ? `, VDS: ${testConnectionResult.vdsCount}` : ''}` + : testConnectionResult.error} + + ) : null} +
+ + ) : null} +
+ +