Initial commit: Wedding Hub & Live Screen app + README and API docs
This commit is contained in:
commit
4f356eeb36
25 files changed
+7822
No files matched your search
@@ -0,0 +1,15 @@
|
||||
# GEMINI_API_KEY: Required for Gemini AI API calls.
|
||||
# AI Studio automatically injects this at runtime from user secrets.
|
||||
# Users configure this via the Secrets panel in the AI Studio UI.
|
||||
GEMINI_API_KEY="MY_GEMINI_API_KEY"
|
||||
|
||||
# APP_URL: The URL where this applet is hosted.
|
||||
# AI Studio automatically injects this at runtime with the Cloud Run service URL.
|
||||
# Used for self-referential links, OAuth callbacks, and API endpoints.
|
||||
APP_URL="MY_APP_URL"
|
||||
|
||||
# Self-Hosted Integrations (Optional)
|
||||
IMMICH_URL=""
|
||||
IMMICH_API_KEY=""
|
||||
OLLAMA_URL=""
|
||||
|
||||
+10
@@ -0,0 +1,10 @@
|
||||
node_modules/
|
||||
build/
|
||||
dist/
|
||||
coverage/
|
||||
.DS_Store
|
||||
*.log
|
||||
.env*
|
||||
!.env.example
|
||||
# Runtime data: guest records, tickets, uploaded photos (personal data, never commit)
|
||||
data/
|
||||
@@ -0,0 +1,160 @@
|
||||
# Wedding Hub & Live Screen
|
||||
|
||||
Интерактивный свадебный хаб: PWA для гостей и live-дашборд для проектора/ТВ в зале.
|
||||
|
||||
- **Гостевой режим** — вход по номеру билета, QR-лотерея, игра «Охота за поцелуем», фото-тосты с проверкой бокалов, фотогалерея.
|
||||
- **Live Screen** — табло для проектора: результаты команд, счётчики поцелуев и тостов, раунды поцелуев, фото в реальном времени.
|
||||
- **Админка** — гости и роли, раунды, настройки (имена пары, время торта), интеграция с Immich, сброс и демо-данные.
|
||||
- **QR-генератор** — QR-коды билетов.
|
||||
|
||||
Стек: React 19 + Vite + Tailwind 4 (фронт), Express + `ws` (сервер), TypeScript. Хранилище — JSON-файл. Проверка фото тостов — Gemini или Ollama (vision), при их отсутствии — эвристика.
|
||||
|
||||
Справочник API и WebSocket-событий: [docs/API.md](docs/API.md).
|
||||
|
||||
---
|
||||
|
||||
## Быстрый старт
|
||||
|
||||
**Требования:** Node.js и npm. В репозитории есть `bun.lock`, но команды ниже рассчитаны на npm.
|
||||
|
||||
```bash
|
||||
npm install
|
||||
cp .env.example .env.local # при необходимости заполнить переменные (см. ниже)
|
||||
npm run dev # http://localhost:3000
|
||||
```
|
||||
|
||||
Сервер слушает `0.0.0.0:3000`, поэтому доступен с телефонов гостей и ТВ в локальной сети.
|
||||
|
||||
### Продакшн
|
||||
|
||||
```bash
|
||||
npm run build # vite build (фронт в dist/) + esbuild серверного кода в dist/server.cjs
|
||||
npm start # node dist/server.cjs
|
||||
```
|
||||
|
||||
`npm start` запускает собранный сервер. Раздача `dist/` включается при `NODE_ENV=production`; без этой переменной сервер поднимает Vite в middleware-режиме (удобно для разработки).
|
||||
|
||||
### Скрипты
|
||||
|
||||
| Команда | Что делает |
|
||||
|---|---|
|
||||
| `npm run dev` | Запуск `tsx server.ts`: API и Vite в одном процессе |
|
||||
| `npm run build` | Сборка фронта и сервера |
|
||||
| `npm start` | Запуск `dist/server.cjs` |
|
||||
| `npm run preview` | Предпросмотр сборки Vite |
|
||||
| `npm run lint` | `tsc --noEmit`, проверка типов |
|
||||
| `npm run clean` | Удаление `dist/` и `server.js` |
|
||||
|
||||
---
|
||||
|
||||
## Конфигурация
|
||||
|
||||
Переменные окружения задаются в `.env.local` (шаблон — `.env.example`). Файлы `.env*` не коммитятся.
|
||||
|
||||
| Переменная | Назначение |
|
||||
|---|---|
|
||||
| `GEMINI_API_KEY` | Ключ Gemini для проверки фото тостов (модель `gemini-2.5-flash`). |
|
||||
| `APP_URL` | Публичный адрес приложения. |
|
||||
| `IMMICH_URL` | Адрес Immich, например `http://192.168.1.x:2283`. |
|
||||
| `IMMICH_API_KEY` | API-ключ Immich. |
|
||||
| `IMMICH_ALBUM_ID`, `IMMICH_ALBUM_NAME` | Альбом Immich для фото. Также настраивается в админке. |
|
||||
| `OLLAMA_URL` | Адрес Ollama с vision-моделью `llama3.2-vision`, например `http://host:11434`. |
|
||||
| `NODE_ENV` | `production` — раздача `dist/` вместо Vite middleware. |
|
||||
| `DISABLE_HMR` | `true` — отключает HMR и слежение за файлами. |
|
||||
|
||||
**Порядок проверки фото тостов:** Gemini → Ollama → эвристика. Если ни один сервис не задан, работает эвристика, так что приложение запускается без внешних ИИ-сервисов.
|
||||
|
||||
> Переменные из `.env` читаются через `process.env` и в текущей версии не подгружаются автоматически: `dotenv` есть в зависимостях, но в `server.ts` не вызывается. Для локального запуска с `.env.local` экспортируйте переменные в shell или добавьте `import 'dotenv/config'` в начало `server.ts`.
|
||||
|
||||
---
|
||||
|
||||
## Режимы
|
||||
|
||||
Режим выбирается путём или параметром `?mode=`:
|
||||
|
||||
| URL | Режим |
|
||||
|---|---|
|
||||
| `/` | Гость (PWA) |
|
||||
| `/screen` или `?mode=screen` | Live-экран для проектора |
|
||||
| `/admin` или `?mode=admin` | Админ-панель |
|
||||
| `/qr` или `?mode=qr` | Генератор QR-кодов |
|
||||
|
||||
**Вход гостя:** номер билета (приводится к верхнему регистру) и имя. Параметры `?ticket=…&name=…&team=…&role=…` подставляют значения в форму. Сессия хранится в `localStorage` (`wedding_ticket_id`, `wedding_guest_data`).
|
||||
|
||||
**Роли:** `guest`, `host`, `couple`, `admin`. Новые гости попадают в команду `team_friends`. Список команд — `DEFAULT_TEAMS` в `server/db.ts`.
|
||||
|
||||
**Демо-данные:** при первом запуске (без `data/wedding_hub.json`) создаётся `DEFAULT_STATE` из `server/db.ts`: 10 вымышленных гостей (`ADMIN-001`, `HOST-001`, `COUPLE-001`, `LUCK-001…007`) с поцелуями, тостами и фото. Перед реальным использованием очистите их через `POST /api/admin/reset`.
|
||||
|
||||
---
|
||||
|
||||
## Игровые механики
|
||||
|
||||
- **Охота за поцелуем.** Админ запускает раунд (`POST /api/admin/kiss-trigger`). Первый гость, который поймал, получает 3 очка, и открывается окно 5,2 с. Остальные в окне получают по 1 очку. Затем наступает кулдаун. Сервер проверяет таймеры раунда каждые 500 мс.
|
||||
- **Фото-тосты.** Гость загружает фото бокала с заданием из `src/utils/drinkQuests.ts` (15 заданий). Проверка считает бокалы и выполнение задания. Подтверждённый тост даёт 10 очков. Одновременно выполняется не более двух VLM-запросов (семафор в `server/vlm.ts`).
|
||||
- **Очки.** Гость получает очки за поцелуи (1–3 за каждый) и 10 за каждый подтверждённый тост. Очки команд суммируются отдельно и показываются в «Битве команд» на экране.
|
||||
|
||||
---
|
||||
|
||||
## Архитектура
|
||||
|
||||
```
|
||||
server.ts Express + WebSocket, все маршруты API, таймер раундов, раздача фронта
|
||||
server/db.ts WeddingDatabase: состояние, атомарная запись JSON (tmp + rename), демо-данные
|
||||
server/vlm.ts Проверка фото тостов: Gemini → Ollama → эвристика, семафор на 2 запроса
|
||||
server/immich.ts Загрузка фото в Immich, работа с альбомами
|
||||
src/App.tsx Маршрутизация по режимам, WebSocket-подписка, оверлеи событий
|
||||
src/components/ GuestView, ScreenView, AdminView, OnboardingModal, QRGenerator
|
||||
src/utils/ drinkQuests.ts (задания), effects.ts (конфетти, анимации)
|
||||
src/types.ts Общие типы: Guest, AppState, AggregatedStats и др.
|
||||
```
|
||||
|
||||
### Хранение данных
|
||||
|
||||
Состояние лежит в `data/wedding_hub.json` (создаётся автоматически). Запись атомарная: сначала временный файл, затем переименование. Фото гостей — в `data/uploads/`, раздаются по `/api/uploads/…`.
|
||||
|
||||
Папка `data/` в `.gitignore`: там имена гостей, номера билетов и фото. Резервная копия — копия этой папки.
|
||||
|
||||
`POST /api/admin/reset` очищает всё без подтверждения. Перед сбросом сделайте копию `data/`.
|
||||
|
||||
### Синхронизация с экранами
|
||||
|
||||
Клиенты подключаются по WebSocket на `/ws`. Сервер отправляет `STATE_SYNC` при подключении и после изменений, а также события раундов и оверлеев. Подробности — в [docs/API.md](docs/API.md#websocket).
|
||||
|
||||
---
|
||||
|
||||
## Интеграция с Immich
|
||||
|
||||
Если в настройках заданы URL и API-ключ Immich, фото гостя сохраняется локально и загружается в альбом Immich. Альбом можно создать в админке, связь проверяется кнопкой «Test». Если Immich недоступен, фото всё равно сохраняется локально (в ответе `syncedToImmich: false`).
|
||||
|
||||
---
|
||||
|
||||
## Структура репозитория
|
||||
|
||||
```
|
||||
.
|
||||
├── server.ts сервер и API
|
||||
├── server/ db.ts, vlm.ts, immich.ts
|
||||
├── src/ фронтенд
|
||||
│ ├── components/
|
||||
│ ├── utils/
|
||||
│ ├── App.tsx
|
||||
│ ├── main.tsx
|
||||
│ ├── types.ts
|
||||
│ └── index.css
|
||||
├── index.html шаблон, шрифты Cinzel / Playfair Display / Plus Jakarta Sans
|
||||
├── vite.config.ts
|
||||
├── tsconfig.json
|
||||
├── package.json
|
||||
├── metadata.json метаданные приложения
|
||||
├── .env.example шаблон переменных окружения
|
||||
└── docs/API.md справочник API
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## Безопасность
|
||||
|
||||
- Не коммитьте `.env*` и `data/`. Оба пути в `.gitignore`.
|
||||
- **Админ-маршруты `/api/admin/*` не защищены авторизацией.** Ограничьте доступ к `/admin` на уровне сети (локальная сеть, reverse proxy с паролем) до любого публичного запуска.
|
||||
- `/api/state` не отдаёт API-ключи Immich и Gemini, но отдаёт `immich_url` и `ollama_url`. Ограничивайте доступ к сети.
|
||||
- Лимит тела запроса — 50 МБ (фото в оригинальном разрешении).
|
||||
@@ -0,0 +1,766 @@
|
||||
{
|
||||
"lockfileVersion": 2,
|
||||
"configVersion": 1,
|
||||
"workspaces": {
|
||||
"": {
|
||||
"name": "react-example",
|
||||
"dependencies": {
|
||||
"@google/genai": "^2.4.0",
|
||||
"@tailwindcss/vite": "^4.1.14",
|
||||
"@types/canvas-confetti": "^1.9.0",
|
||||
"@types/qrcode": "^1.5.6",
|
||||
"@types/ws": "^8.18.1",
|
||||
"@vitejs/plugin-react": "^5.0.4",
|
||||
"canvas-confetti": "^1.9.4",
|
||||
"dotenv": "^17.2.3",
|
||||
"express": "^4.21.2",
|
||||
"lucide-react": "^0.546.0",
|
||||
"motion": "^12.23.24",
|
||||
"qrcode": "^1.5.4",
|
||||
"react": "^19.0.1",
|
||||
"react-dom": "^19.0.1",
|
||||
"vite": "^6.2.3",
|
||||
"ws": "^8.21.3",
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/express": "^4.17.21",
|
||||
"@types/node": "^22.14.0",
|
||||
"autoprefixer": "^10.4.21",
|
||||
"esbuild": "^0.25.0",
|
||||
"tailwindcss": "^4.1.14",
|
||||
"tsx": "^4.21.0",
|
||||
"typescript": "~5.8.2",
|
||||
"vite": "^6.2.3",
|
||||
},
|
||||
},
|
||||
},
|
||||
"packages": {
|
||||
"@babel/code-frame": ["@babel/code-frame@7.29.7", "", { "dependencies": { "@babel/helper-validator-identifier": "^7.29.7", "js-tokens": "^4.0.0", "picocolors": "^1.1.1" } }, "sha512-Aup7aUOfpbAUg2ROOJN6Iw5f9DMBlzu0mIkm/malLQFN/YQgO48wCj0Kxa3sEHJvPVFg7siR+qRInwXd2qhQKw=="],
|
||||
|
||||
"@babel/compat-data": ["@babel/compat-data@7.29.7", "", {}, "sha512-locTkQyKvwIEgBzVrn8693ebc97F2U8ZHjbXwDXJ5Fn2TCpNwTlKcaKLkdHop5c/icOFE7qt7Q9JC5hnKNa6Gg=="],
|
||||
|
||||
"@babel/core": ["@babel/core@7.29.7", "", { "dependencies": { "@babel/code-frame": "^7.29.7", "@babel/generator": "^7.29.7", "@babel/helper-compilation-targets": "^7.29.7", "@babel/helper-module-transforms": "^7.29.7", "@babel/helpers": "^7.29.7", "@babel/parser": "^7.29.7", "@babel/template": "^7.29.7", "@babel/traverse": "^7.29.7", "@babel/types": "^7.29.7", "@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" } }, "sha512-RgHBCvtjbOK2gXSNBNIkNoEc9qoVEtau3hj8gEqKQuL3HZAibKarWFEI3Lfm6EYKkLalOh8eSrj9b+ch9H/VBA=="],
|
||||
|
||||
"@babel/generator": ["@babel/generator@7.29.8", "", { "dependencies": { "@babel/parser": "^7.29.8", "@babel/types": "^7.29.8", "@jridgewell/gen-mapping": "^0.3.12", "@jridgewell/trace-mapping": "^0.3.28", "jsesc": "^3.0.2" } }, "sha512-gZbepsdh3WDtgZKWL+vTPh71LSBrm/Y4/QDZBVCcYfmeTEEuoOYwlSy+G1StfJg+/Zy550u/3TATbm7qDbbMtg=="],
|
||||
|
||||
"@babel/helper-compilation-targets": ["@babel/helper-compilation-targets@7.29.7", "", { "dependencies": { "@babel/compat-data": "^7.29.7", "@babel/helper-validator-option": "^7.29.7", "browserslist": "^4.24.0", "lru-cache": "^5.1.1", "semver": "^6.3.1" } }, "sha512-wem6WaBj4NaVYVdNhLPPVacES6ZJ+KBBfSkTMD3YZxbP3rm3Di85tJU5ljaUNhaOynt+Aj0xruhYuzQBt8n71g=="],
|
||||
|
||||
"@babel/helper-globals": ["@babel/helper-globals@7.29.7", "", {}, "sha512-3nQVUAtvkKH9zahfWgw96Jc/uFOmjACE1kQz82E2lqWmHBgjzbNlsC22nuQTfahmWeQtTq5nQ/4Nnd2A1wj4zA=="],
|
||||
|
||||
"@babel/helper-module-imports": ["@babel/helper-module-imports@7.29.7", "", { "dependencies": { "@babel/traverse": "^7.29.7", "@babel/types": "^7.29.7" } }, "sha512-ejHwrQQYcm9xnTivShn2IDOlIzInN34AXskvq9QicvCtEzq1Vzclu/tKF8Jq1Cg8JG2GL6/EmjgsCT7lXepE3g=="],
|
||||
|
||||
"@babel/helper-module-transforms": ["@babel/helper-module-transforms@7.29.7", "", { "dependencies": { "@babel/helper-module-imports": "^7.29.7", "@babel/helper-validator-identifier": "^7.29.7", "@babel/traverse": "^7.29.7" }, "peerDependencies": { "@babel/core": "^7.0.0" } }, "sha512-UPUVSyXbOh627KiCIGQSgwWzGeBKLkaJ9PJEdrngIwMSzxLR4jS4+f1f1jb7VzBbg8nFLaYotvVPFCTqdrmTAg=="],
|
||||
|
||||
"@babel/helper-plugin-utils": ["@babel/helper-plugin-utils@7.29.7", "", {}, "sha512-G7sHYigPY17oO5SYWnfD/0MTBwVR781S/JI643e/JhUYgVgWE/61SoW3NH9KWUKyKq5LVh3npif99Wkt6j86Jw=="],
|
||||
|
||||
"@babel/helper-string-parser": ["@babel/helper-string-parser@7.29.7", "", {}, "sha512-Pb5ijPrZ89GDH8223L4UP8i6QApWxs04RbPQJTeWDV0/keR2E36MeKnyr6LYmUUvqRRI+Iv87SuF1W6ErINzYw=="],
|
||||
|
||||
"@babel/helper-validator-identifier": ["@babel/helper-validator-identifier@7.29.7", "", {}, "sha512-qehxGkRj55h/ff8EMaJ+cYhyaKlHIxqYDn682wQD7RNp9UujOQsHog2uS0r2vzr4pW+sXf90NeeayjcNaX3fFg=="],
|
||||
|
||||
"@babel/helper-validator-option": ["@babel/helper-validator-option@7.29.7", "", {}, "sha512-N9ZErrD+yW5geCDtBqnOoxmR8+tNKiGuxKlDpuJxfsqpa2dFcexaziGAE/qoHLiDDreVNMupxGmSoNlyvsA3gw=="],
|
||||
|
||||
"@babel/helpers": ["@babel/helpers@7.29.7", "", { "dependencies": { "@babel/template": "^7.29.7", "@babel/types": "^7.29.7" } }, "sha512-1k2lAGRMfHTcwuNYcCNUmaUffmQv8KWMfh2iJUUeRlwlwH4FdNG7mfPI10NPfLHJFThE4Tyr4mv7kTNZOiPuBg=="],
|
||||
|
||||
"@babel/parser": ["@babel/parser@7.29.8", "", { "dependencies": { "@babel/types": "^7.29.8" }, "bin": "./bin/babel-parser.js" }, "sha512-E8lTAYNB1KW+FH+VGJuZM1ioAx2E6oVlvQFRrf5P8ZZmsiJXYAD9vTFV7yyEURNzgh1dFqMZuO6tUwcARbqFCA=="],
|
||||
|
||||
"@babel/plugin-transform-react-jsx-self": ["@babel/plugin-transform-react-jsx-self@7.29.7", "", { "dependencies": { "@babel/helper-plugin-utils": "^7.29.7" }, "peerDependencies": { "@babel/core": "^7.0.0-0" } }, "sha512-TL0hMc9xzy86VD31nUiwzd5otRAcyEPcsegCxolO0PvcXuH1v0kECe/UIznYFihpkvU5wg/jk4v0TTEFfm53fw=="],
|
||||
|
||||
"@babel/plugin-transform-react-jsx-source": ["@babel/plugin-transform-react-jsx-source@7.29.7", "", { "dependencies": { "@babel/helper-plugin-utils": "^7.29.7" }, "peerDependencies": { "@babel/core": "^7.0.0-0" } }, "sha512-06IyK09H3wi4cGbhDBwp5gUGo0IKtnYa8tyTiephirPCK6fbobVGiXMMI5zLQ4aKEYP3wZ3ArU44o+8KMrSG/Q=="],
|
||||
|
||||
"@babel/template": ["@babel/template@7.29.7", "", { "dependencies": { "@babel/code-frame": "^7.29.7", "@babel/parser": "^7.29.7", "@babel/types": "^7.29.7" } }, "sha512-puq+Gf35oI24FeN11LkoUQFqv9uwNeWpxXZi/Ji3rRIoKAzKnxRaZ+Gkj0vKS9ZCiTESfng1N9LyOyXvo+m+Gg=="],
|
||||
|
||||
"@babel/traverse": ["@babel/traverse@7.29.8", "", { "dependencies": { "@babel/code-frame": "^7.29.7", "@babel/generator": "^7.29.8", "@babel/helper-globals": "^7.29.7", "@babel/parser": "^7.29.8", "@babel/template": "^7.29.7", "@babel/types": "^7.29.8", "debug": "^4.3.1" } }, "sha512-I5z7H3bf/41ktsNVLtpN0wAa336HkqIHQ5BuPLEhTkt1jVSyZpeNKIzTgEWmlxjdg81R0IgUCcaE+Ok3NvrfZg=="],
|
||||
|
||||
"@babel/types": ["@babel/types@7.29.8", "", { "dependencies": { "@babel/helper-string-parser": "^7.29.7", "@babel/helper-validator-identifier": "^7.29.7" } }, "sha512-Vj1jF3cPfxg7OAfoI7QnVKLoILlm2JF9pnVHrX8qx7AHMiYWT+NDAA7jChlNgRS4WTLc/fD1lXLmPixluj+3Gg=="],
|
||||
|
||||
"@esbuild/aix-ppc64": ["@esbuild/aix-ppc64@0.25.12", "", { "os": "aix", "cpu": "ppc64" }, "sha512-Hhmwd6CInZ3dwpuGTF8fJG6yoWmsToE+vYgD4nytZVxcu1ulHpUQRAB1UJ8+N1Am3Mz4+xOByoQoSZf4D+CpkA=="],
|
||||
|
||||
"@esbuild/android-arm": ["@esbuild/android-arm@0.25.12", "", { "os": "android", "cpu": "arm" }, "sha512-VJ+sKvNA/GE7Ccacc9Cha7bpS8nyzVv0jdVgwNDaR4gDMC/2TTRc33Ip8qrNYUcpkOHUT5OZ0bUcNNVZQ9RLlg=="],
|
||||
|
||||
"@esbuild/android-arm64": ["@esbuild/android-arm64@0.25.12", "", { "os": "android", "cpu": "arm64" }, "sha512-6AAmLG7zwD1Z159jCKPvAxZd4y/VTO0VkprYy+3N2FtJ8+BQWFXU+OxARIwA46c5tdD9SsKGZ/1ocqBS/gAKHg=="],
|
||||
|
||||
"@esbuild/android-x64": ["@esbuild/android-x64@0.25.12", "", { "os": "android", "cpu": "x64" }, "sha512-5jbb+2hhDHx5phYR2By8GTWEzn6I9UqR11Kwf22iKbNpYrsmRB18aX/9ivc5cabcUiAT/wM+YIZ6SG9QO6a8kg=="],
|
||||
|
||||
"@esbuild/darwin-arm64": ["@esbuild/darwin-arm64@0.25.12", "", { "os": "darwin", "cpu": "arm64" }, "sha512-N3zl+lxHCifgIlcMUP5016ESkeQjLj/959RxxNYIthIg+CQHInujFuXeWbWMgnTo4cp5XVHqFPmpyu9J65C1Yg=="],
|
||||
|
||||
"@esbuild/darwin-x64": ["@esbuild/darwin-x64@0.25.12", "", { "os": "darwin", "cpu": "x64" }, "sha512-HQ9ka4Kx21qHXwtlTUVbKJOAnmG1ipXhdWTmNXiPzPfWKpXqASVcWdnf2bnL73wgjNrFXAa3yYvBSd9pzfEIpA=="],
|
||||
|
||||
"@esbuild/freebsd-arm64": ["@esbuild/freebsd-arm64@0.25.12", "", { "os": "freebsd", "cpu": "arm64" }, "sha512-gA0Bx759+7Jve03K1S0vkOu5Lg/85dou3EseOGUes8flVOGxbhDDh/iZaoek11Y8mtyKPGF3vP8XhnkDEAmzeg=="],
|
||||
|
||||
"@esbuild/freebsd-x64": ["@esbuild/freebsd-x64@0.25.12", "", { "os": "freebsd", "cpu": "x64" }, "sha512-TGbO26Yw2xsHzxtbVFGEXBFH0FRAP7gtcPE7P5yP7wGy7cXK2oO7RyOhL5NLiqTlBh47XhmIUXuGciXEqYFfBQ=="],
|
||||
|
||||
"@esbuild/linux-arm": ["@esbuild/linux-arm@0.25.12", "", { "os": "linux", "cpu": "arm" }, "sha512-lPDGyC1JPDou8kGcywY0YILzWlhhnRjdof3UlcoqYmS9El818LLfJJc3PXXgZHrHCAKs/Z2SeZtDJr5MrkxtOw=="],
|
||||
|
||||
"@esbuild/linux-arm64": ["@esbuild/linux-arm64@0.25.12", "", { "os": "linux", "cpu": "arm64" }, "sha512-8bwX7a8FghIgrupcxb4aUmYDLp8pX06rGh5HqDT7bB+8Rdells6mHvrFHHW2JAOPZUbnjUpKTLg6ECyzvas2AQ=="],
|
||||
|
||||
"@esbuild/linux-ia32": ["@esbuild/linux-ia32@0.25.12", "", { "os": "linux", "cpu": "ia32" }, "sha512-0y9KrdVnbMM2/vG8KfU0byhUN+EFCny9+8g202gYqSSVMonbsCfLjUO+rCci7pM0WBEtz+oK/PIwHkzxkyharA=="],
|
||||
|
||||
"@esbuild/linux-loong64": ["@esbuild/linux-loong64@0.25.12", "", { "os": "linux", "cpu": "none" }, "sha512-h///Lr5a9rib/v1GGqXVGzjL4TMvVTv+s1DPoxQdz7l/AYv6LDSxdIwzxkrPW438oUXiDtwM10o9PmwS/6Z0Ng=="],
|
||||
|
||||
"@esbuild/linux-mips64el": ["@esbuild/linux-mips64el@0.25.12", "", { "os": "linux", "cpu": "none" }, "sha512-iyRrM1Pzy9GFMDLsXn1iHUm18nhKnNMWscjmp4+hpafcZjrr2WbT//d20xaGljXDBYHqRcl8HnxbX6uaA/eGVw=="],
|
||||
|
||||
"@esbuild/linux-ppc64": ["@esbuild/linux-ppc64@0.25.12", "", { "os": "linux", "cpu": "ppc64" }, "sha512-9meM/lRXxMi5PSUqEXRCtVjEZBGwB7P/D4yT8UG/mwIdze2aV4Vo6U5gD3+RsoHXKkHCfSxZKzmDssVlRj1QQA=="],
|
||||
|
||||
"@esbuild/linux-riscv64": ["@esbuild/linux-riscv64@0.25.12", "", { "os": "linux", "cpu": "none" }, "sha512-Zr7KR4hgKUpWAwb1f3o5ygT04MzqVrGEGXGLnj15YQDJErYu/BGg+wmFlIDOdJp0PmB0lLvxFIOXZgFRrdjR0w=="],
|
||||
|
||||
"@esbuild/linux-s390x": ["@esbuild/linux-s390x@0.25.12", "", { "os": "linux", "cpu": "s390x" }, "sha512-MsKncOcgTNvdtiISc/jZs/Zf8d0cl/t3gYWX8J9ubBnVOwlk65UIEEvgBORTiljloIWnBzLs4qhzPkJcitIzIg=="],
|
||||
|
||||
"@esbuild/linux-x64": ["@esbuild/linux-x64@0.25.12", "", { "os": "linux", "cpu": "x64" }, "sha512-uqZMTLr/zR/ed4jIGnwSLkaHmPjOjJvnm6TVVitAa08SLS9Z0VM8wIRx7gWbJB5/J54YuIMInDquWyYvQLZkgw=="],
|
||||
|
||||
"@esbuild/netbsd-arm64": ["@esbuild/netbsd-arm64@0.25.12", "", { "os": "none", "cpu": "arm64" }, "sha512-xXwcTq4GhRM7J9A8Gv5boanHhRa/Q9KLVmcyXHCTaM4wKfIpWkdXiMog/KsnxzJ0A1+nD+zoecuzqPmCRyBGjg=="],
|
||||
|
||||
"@esbuild/netbsd-x64": ["@esbuild/netbsd-x64@0.25.12", "", { "os": "none", "cpu": "x64" }, "sha512-Ld5pTlzPy3YwGec4OuHh1aCVCRvOXdH8DgRjfDy/oumVovmuSzWfnSJg+VtakB9Cm0gxNO9BzWkj6mtO1FMXkQ=="],
|
||||
|
||||
"@esbuild/openbsd-arm64": ["@esbuild/openbsd-arm64@0.25.12", "", { "os": "openbsd", "cpu": "arm64" }, "sha512-fF96T6KsBo/pkQI950FARU9apGNTSlZGsv1jZBAlcLL1MLjLNIWPBkj5NlSz8aAzYKg+eNqknrUJ24QBybeR5A=="],
|
||||
|
||||
"@esbuild/openbsd-x64": ["@esbuild/openbsd-x64@0.25.12", "", { "os": "openbsd", "cpu": "x64" }, "sha512-MZyXUkZHjQxUvzK7rN8DJ3SRmrVrke8ZyRusHlP+kuwqTcfWLyqMOE3sScPPyeIXN/mDJIfGXvcMqCgYKekoQw=="],
|
||||
|
||||
"@esbuild/openharmony-arm64": ["@esbuild/openharmony-arm64@0.25.12", "", { "os": "none", "cpu": "arm64" }, "sha512-rm0YWsqUSRrjncSXGA7Zv78Nbnw4XL6/dzr20cyrQf7ZmRcsovpcRBdhD43Nuk3y7XIoW2OxMVvwuRvk9XdASg=="],
|
||||
|
||||
"@esbuild/sunos-x64": ["@esbuild/sunos-x64@0.25.12", "", { "os": "sunos", "cpu": "x64" }, "sha512-3wGSCDyuTHQUzt0nV7bocDy72r2lI33QL3gkDNGkod22EsYl04sMf0qLb8luNKTOmgF/eDEDP5BFNwoBKH441w=="],
|
||||
|
||||
"@esbuild/win32-arm64": ["@esbuild/win32-arm64@0.25.12", "", { "os": "win32", "cpu": "arm64" }, "sha512-rMmLrur64A7+DKlnSuwqUdRKyd3UE7oPJZmnljqEptesKM8wx9J8gx5u0+9Pq0fQQW8vqeKebwNXdfOyP+8Bsg=="],
|
||||
|
||||
"@esbuild/win32-ia32": ["@esbuild/win32-ia32@0.25.12", "", { "os": "win32", "cpu": "ia32" }, "sha512-HkqnmmBoCbCwxUKKNPBixiWDGCpQGVsrQfJoVGYLPT41XWF8lHuE5N6WhVia2n4o5QK5M4tYr21827fNhi4byQ=="],
|
||||
|
||||
"@esbuild/win32-x64": ["@esbuild/win32-x64@0.25.12", "", { "os": "win32", "cpu": "x64" }, "sha512-alJC0uCZpTFrSL0CCDjcgleBXPnCrEAhTBILpeAp7M/OFgoqtAetfBzX0xM00MUsVVPpVjlPuMbREqnZCXaTnA=="],
|
||||
|
||||
"@google/genai": ["@google/genai@2.19.0", "", { "dependencies": { "google-auth-library": "^10.3.0", "p-retry": "^4.6.2", "protobufjs": "^7.5.4", "ws": "^8.18.0" }, "peerDependencies": { "@modelcontextprotocol/sdk": "^1.25.2" }, "optionalPeers": ["@modelcontextprotocol/sdk"] }, "sha512-IM3u1FjpOLyOPsPh0smGA6Ntj2olUWCPbTs/WQj7cA/2AKCGw/652W7IaySx0XtwuscFnMYBoraebQusSZ0zSQ=="],
|
||||
|
||||
"@jridgewell/gen-mapping": ["@jridgewell/gen-mapping@0.3.13", "", { "dependencies": { "@jridgewell/sourcemap-codec": "^1.5.0", "@jridgewell/trace-mapping": "^0.3.24" } }, "sha512-2kkt/7niJ6MgEPxF0bYdQ6etZaA+fQvDcLKckhy1yIQOzaoKjBBjSj63/aLVjYE3qhRt5dvM+uUyfCg6UKCBbA=="],
|
||||
|
||||
"@jridgewell/remapping": ["@jridgewell/remapping@2.3.5", "", { "dependencies": { "@jridgewell/gen-mapping": "^0.3.5", "@jridgewell/trace-mapping": "^0.3.24" } }, "sha512-LI9u/+laYG4Ds1TDKSJW2YPrIlcVYOwi2fUC6xB43lueCjgxV4lffOCZCtYFiH6TNOX+tQKXx97T4IKHbhyHEQ=="],
|
||||
|
||||
"@jridgewell/resolve-uri": ["@jridgewell/resolve-uri@3.1.2", "", {}, "sha512-bRISgCIjP20/tbWSPWMEi54QVPRZExkuD9lJL+UIxUKtwVJA8wW1Trb1jMs1RFXo1CBTNZ/5hpC9QvmKWdopKw=="],
|
||||
|
||||
"@jridgewell/sourcemap-codec": ["@jridgewell/sourcemap-codec@1.5.5", "", {}, "sha512-cYQ9310grqxueWbl+WuIUIaiUaDcj7WOq5fVhEljNVgRfOUhY9fy2zTvfoqWsnebh8Sl70VScFbICvJnLKB0Og=="],
|
||||
|
||||
"@jridgewell/trace-mapping": ["@jridgewell/trace-mapping@0.3.31", "", { "dependencies": { "@jridgewell/resolve-uri": "^3.1.0", "@jridgewell/sourcemap-codec": "^1.4.14" } }, "sha512-zzNR+SdQSDJzc8joaeP8QQoCQr8NuYx2dIIytl1QeBEZHJ9uW6hebsrYgbz8hJwUQao3TWCMtmfV8Nu1twOLAw=="],
|
||||
|
||||
"@napi-rs/lzma-linux-x64-gnu": ["@napi-rs/lzma-linux-x64-gnu@1.5.1", "", { "os": "linux", "cpu": "x64" }, "sha512-oTXEIha4SsuXdTA4Iyskj0kpdx2yVXdhd75c2v3xGrHFfVMsbhTPZU/nMPL4sWKo4pBHm3aucLaqGlF696dTyQ=="],
|
||||
|
||||
"@protobufjs/aspromise": ["@protobufjs/aspromise@1.1.2", "", {}, "sha512-j+gKExEuLmKwvz3OgROXtrJ2UG2x8Ch2YZUxahh+s1F2HZ+wAceUNLkvy6zKCPVRkU++ZWQrdxsUeQXmcg4uoQ=="],
|
||||
|
||||
"@protobufjs/base64": ["@protobufjs/base64@1.1.2", "", {}, "sha512-AZkcAA5vnN/v4PDqKyMR5lx7hZttPDgClv83E//FMNhR2TMcLUhfRUBHCmSl0oi9zMgDDqRUJkSxO3wm85+XLg=="],
|
||||
|
||||
"@protobufjs/codegen": ["@protobufjs/codegen@2.0.5", "", {}, "sha512-zgXFLzW3Ap33e6d0Wlj4MGIm6Ce8O89n/apUaGNB/jx+hw+ruWEp7EwGUshdLKVRCxZW12fp9r40E1mQrf/34g=="],
|
||||
|
||||
"@protobufjs/eventemitter": ["@protobufjs/eventemitter@1.1.1", "", {}, "sha512-vW1GmwMZNnL+gMRaovlh9yZX74kc+TTU3FObkkurpMaRtBfLP3ldjS9KQWlwZgraRE0+dheEEoAxdzcJQ8eXZg=="],
|
||||
|
||||
"@protobufjs/fetch": ["@protobufjs/fetch@1.1.1", "", { "dependencies": { "@protobufjs/aspromise": "^1.1.1" } }, "sha512-GpptLrs57adMSuHi3VNj0mAF8dwh36LMaYF6XyJ6JMWlVsc+t42tm1HSEDmOs3A8fC9yyeisgLhsTVQokOZ0zw=="],
|
||||
|
||||
"@protobufjs/float": ["@protobufjs/float@1.0.2", "", {}, "sha512-Ddb+kVXlXst9d+R9PfTIxh1EdNkgoRe5tOX6t01f1lYWOvJnSPDBlG241QLzcyPdoNTsblLUdujGSE4RzrTZGQ=="],
|
||||
|
||||
"@protobufjs/path": ["@protobufjs/path@1.1.2", "", {}, "sha512-6JOcJ5Tm08dOHAbdR3GrvP+yUUfkjG5ePsHYczMFLq3ZmMkAD98cDgcT2iA1lJ9NVwFd4tH/iSSoe44YWkltEA=="],
|
||||
|
||||
"@protobufjs/pool": ["@protobufjs/pool@1.1.0", "", {}, "sha512-0kELaGSIDBKvcgS4zkjz1PeddatrjYcmMWOlAuAPwAeccUrPHdUqo/J6LiymHHEiJT5NrF1UVwxY14f+fy4WQw=="],
|
||||
|
||||
"@protobufjs/utf8": ["@protobufjs/utf8@1.1.2", "", {}, "sha512-b1UQwcEZ4yCnMCD8DAL1VlbvBJE9/IX4FTIp7BG1xYpf29SLazLSrqUkj4w7Y5y7cCVP6E5tcqqcI0xemPkHug=="],
|
||||
|
||||
"@rolldown/pluginutils": ["@rolldown/pluginutils@1.0.0-rc.3", "", {}, "sha512-eybk3TjzzzV97Dlj5c+XrBFW57eTNhzod66y9HrBlzJ6NsCrWCp/2kaPS3K9wJmurBC0Tdw4yPjXKZqlznim3Q=="],
|
||||
|
||||
"@rollup/rollup-android-arm-eabi": ["@rollup/rollup-android-arm-eabi@4.63.0", "", { "os": "android", "cpu": "arm" }, "sha512-70TeIFezKKy65LgAVyQh+w94/gjWhvPWaLaGGeMEgVrPkQhuj/M5bAYYZzIFUj9Y69oHyTm5Um/R6gcLh4A8JA=="],
|
||||
|
||||
"@rollup/rollup-android-arm64": ["@rollup/rollup-android-arm64@4.63.0", "", { "os": "android", "cpu": "arm64" }, "sha512-YC86tYIHK6M1IV+wbzO+Bxk8RCBr6ZyWYgWxUCzaZD8mc8rrFoIJDNzDrkHBYRc/wKdrsIXmm6/F7NzrAO+OrA=="],
|
||||
|
||||
"@rollup/rollup-darwin-arm64": ["@rollup/rollup-darwin-arm64@4.63.0", "", { "os": "darwin", "cpu": "arm64" }, "sha512-oI+ECtUcli0y0fi4xpW82GdPIXdTkI8G8DSjG2LRuw09fPAGykaWYH/hXxiKuTxiAjiPSTIIuYUqof5Z2hShWw=="],
|
||||
|
||||
"@rollup/rollup-darwin-x64": ["@rollup/rollup-darwin-x64@4.63.0", "", { "os": "darwin", "cpu": "x64" }, "sha512-NwV+1s7TiKrMe4owHyKB/dTLD7ZJD0YEBEhIz+hvav1Cu1GReJjF+rsdNwjzENQeIAbE/CoNiaAc5Vz2h5DPAA=="],
|
||||
|
||||
"@rollup/rollup-freebsd-arm64": ["@rollup/rollup-freebsd-arm64@4.63.0", "", { "os": "freebsd", "cpu": "arm64" }, "sha512-tWtHBTu5gOPK4u4Urtk4qAHW3zZ9rQAmbssO8gp7ELvGTGI3aCiq6NqyTQ0PCIg7KbHJF2UkGDDs77YZGxfjCA=="],
|
||||
|
||||
"@rollup/rollup-freebsd-x64": ["@rollup/rollup-freebsd-x64@4.63.0", "", { "os": "freebsd", "cpu": "x64" }, "sha512-2qPoJiwTvtHQ27NnYvTnsgk8laXWYuVmNESG8WFZBcEPKLfZ3I27qBJarjVRQtwGeYyRfq5ZowHXih9lm2BItw=="],
|
||||
|
||||
"@rollup/rollup-linux-arm-gnueabihf": ["@rollup/rollup-linux-arm-gnueabihf@4.63.0", "", { "os": "linux", "cpu": "arm" }, "sha512-FQwsTRvLNuHoTdICABJQfbPUSEueISGmnpT06tXTMpfprf5NiKLSXKA0A+w45wJnCmZAnzgqBwbt6ARFuyOi5w=="],
|
||||
|
||||
"@rollup/rollup-linux-arm-musleabihf": ["@rollup/rollup-linux-arm-musleabihf@4.63.0", "", { "os": "linux", "cpu": "arm" }, "sha512-BBVTXziw8mY1a4ZbWME9tZyfzqXCDPqaC7Z3heQ29p5dkvXzwL0NwelO8zLa8c3RBKvl3YTuSnBgsBhYBtwjIw=="],
|
||||
|
||||
"@rollup/rollup-linux-arm64-gnu": ["@rollup/rollup-linux-arm64-gnu@4.63.0", "", { "os": "linux", "cpu": "arm64" }, "sha512-w2Iyy9+RqKwx3d9qWMKsJg0FfRBsY0/pXNv0mCQ3ueRvJI6+QAScfD4nrMlzFLs2HNVW6Ew+mtZfDl9b7Ew5/Q=="],
|
||||
|
||||
"@rollup/rollup-linux-arm64-musl": ["@rollup/rollup-linux-arm64-musl@4.63.0", "", { "os": "linux", "cpu": "arm64" }, "sha512-YK++KtrFRHYE0P6/RtYEAy9t8F37znP+K03RrIuLPYOL6SVlObRumf/0OE4V/h63xL9DwkWbNssZfmA9hawuDA=="],
|
||||
|
||||
"@rollup/rollup-linux-loong64-gnu": ["@rollup/rollup-linux-loong64-gnu@4.63.0", "", { "os": "linux", "cpu": "none" }, "sha512-aBfOG6fP7YkkPmTqPwufRJeFyz7WPpECv9XNbnsk9+vg7rxdih0lbtEel7jcRng4LZrrmU3FfitCFyEj4BWDWg=="],
|
||||
|
||||
"@rollup/rollup-linux-loong64-musl": ["@rollup/rollup-linux-loong64-musl@4.63.0", "", { "os": "linux", "cpu": "none" }, "sha512-LGaHEOeHNAag9VuS1Crs5DFg4RrU9MPi2nVnNJk9DTePx/B6RRYKVmrIXt2h7YOJlwjaFJ6lwtFDliZxScTLrQ=="],
|
||||
|
||||
"@rollup/rollup-linux-ppc64-gnu": ["@rollup/rollup-linux-ppc64-gnu@4.63.0", "", { "os": "linux", "cpu": "ppc64" }, "sha512-jClvk+J0FC3b7Udvegiw5/4hErbHtmsNsQgENnKXDWtNCJXsJYZH5WURvu7imDOO38xYml24eeh5x3A04ppwCw=="],
|
||||
|
||||
"@rollup/rollup-linux-ppc64-musl": ["@rollup/rollup-linux-ppc64-musl@4.63.0", "", { "os": "linux", "cpu": "ppc64" }, "sha512-0OJlaGK+8+B777Ql5okIpD7ua5Ro9+VB9Ve0OKa28OQJZ1RbuUBVNHK/e3pr4BROqsyPl1JrPO1ZxJseCNffcA=="],
|
||||
|
||||
"@rollup/rollup-linux-riscv64-gnu": ["@rollup/rollup-linux-riscv64-gnu@4.63.0", "", { "os": "linux", "cpu": "none" }, "sha512-Ygsx+HoNH7afwi1bTIXbnTvVnsO+zurPLSYxybV1hHFVU72OWOCl6v05ql/z0hkpAPx+DK7Kn9Bi7MayCcjLTA=="],
|
||||
|
||||
"@rollup/rollup-linux-riscv64-musl": ["@rollup/rollup-linux-riscv64-musl@4.63.0", "", { "os": "linux", "cpu": "none" }, "sha512-pDQxtMGb+OvG3fLwR2OkZlSd47hW+kWg4BYMG/++sR6RqorQccwPTDsxda5hPwiIeIErAnCF9ma3SAU06bdQtQ=="],
|
||||
|
||||
"@rollup/rollup-linux-s390x-gnu": ["@rollup/rollup-linux-s390x-gnu@4.63.0", "", { "os": "linux", "cpu": "s390x" }, "sha512-0BnUG9mS8I4SSHr3XsxVhuCMEiu+rX61xxZF5vujso4LaiAGFZFxvDjg6Xn6tLPNTUAfuCvQYas4LMQMVsKRSQ=="],
|
||||
|
||||
"@rollup/rollup-linux-x64-gnu": ["@rollup/rollup-linux-x64-gnu@4.63.0", "", { "os": "linux", "cpu": "x64" }, "sha512-Adu/VttB1dpPNW+FEacrZ+xVm9tFty84+RrFzsqlFaPxoJB+9XXyDGtp5dCOoBwGBIEVH0To7lExFXEx0BIF4A=="],
|
||||
|
||||
"@rollup/rollup-linux-x64-musl": ["@rollup/rollup-linux-x64-musl@4.63.0", "", { "os": "linux", "cpu": "x64" }, "sha512-NQ3bDvjUbFKmP23671xUlXtKmqVsUBd6M4PQCvbmNtOy06hnQIdKHy8oG/6S3R/S6He1JgPk6A5VT+prAJMYEw=="],
|
||||
|
||||
"@rollup/rollup-openbsd-x64": ["@rollup/rollup-openbsd-x64@4.63.0", "", { "os": "openbsd", "cpu": "x64" }, "sha512-u2eDAl4+0aFvA13GxlGBtTI3SS3sdgwgtV0HyjZ0QaQVCgNE+jqNGey+GtxWiq+wxr/UycAx/OnfJzApCFamvA=="],
|
||||
|
||||
"@rollup/rollup-openharmony-arm64": ["@rollup/rollup-openharmony-arm64@4.63.0", "", { "os": "none", "cpu": "arm64" }, "sha512-XvRb5vfW3wAZQ+ZUG21AnHHDKtNcw99eigzEhjr//NZ3u7SoBaPP0seSc7FgP7p1epAEdAoZckMW9WY/+4w70w=="],
|
||||
|
||||
"@rollup/rollup-win32-arm64-msvc": ["@rollup/rollup-win32-arm64-msvc@4.63.0", "", { "os": "win32", "cpu": "arm64" }, "sha512-iZPmniy4kNBf5yo2RezbkYNNK5HPbXE9+g+twnbqSng7dtLEJy1SKoxiE/ni4FDacjyuZpEeb9U054N4EoKHYw=="],
|
||||
|
||||
"@rollup/rollup-win32-ia32-msvc": ["@rollup/rollup-win32-ia32-msvc@4.63.0", "", { "os": "win32", "cpu": "ia32" }, "sha512-mFBBd+LF37fnE8JnYUOH+imj0aPFPK30vpar4ehJkgnLj9sZn8ZxiRENmLtgIwxK7TC8klF6N57fxdNBwQoqOA=="],
|
||||
|
||||
"@rollup/rollup-win32-x64-gnu": ["@rollup/rollup-win32-x64-gnu@4.63.0", "", { "os": "win32", "cpu": "x64" }, "sha512-ujeqEY3B+zbGn3Z4Q03cUBG/LGWnBJncVT36WER31LcOsQk9+1dmINKKtvmmfChUvRbK1G0R8OhMWFgHgaZtAw=="],
|
||||
|
||||
"@rollup/rollup-win32-x64-msvc": ["@rollup/rollup-win32-x64-msvc@4.63.0", "", { "os": "win32", "cpu": "x64" }, "sha512-hncn90N4sOky0L2LKE5oESKLbxCPeVo4eLA2LSMoDzM+879ml4WSr+Rr4DWknNIVVvS1Hirkc9hx02W6YxS8rQ=="],
|
||||
|
||||
"@tailwindcss/node": ["@tailwindcss/node@4.3.3", "", { "dependencies": { "@jridgewell/remapping": "^2.3.5", "enhanced-resolve": "^5.24.1", "jiti": "^2.7.0", "lightningcss": "1.32.0", "magic-string": "^0.30.21", "source-map-js": "^1.2.1", "tailwindcss": "4.3.3" } }, "sha512-/T8IKEsf9VTU6tLjgC7+sv2mOPtQxzE2jMw7u4Tt40Tx+QSZxpzh95/H6cMKoja9XuW7iMdLJYBB0o9G1CaAgg=="],
|
||||
|
||||
"@tailwindcss/oxide": ["@tailwindcss/oxide@4.3.3", "", { "optionalDependencies": { "@tailwindcss/oxide-android-arm64": "4.3.3", "@tailwindcss/oxide-darwin-arm64": "4.3.3", "@tailwindcss/oxide-darwin-x64": "4.3.3", "@tailwindcss/oxide-freebsd-x64": "4.3.3", "@tailwindcss/oxide-linux-arm-gnueabihf": "4.3.3", "@tailwindcss/oxide-linux-arm64-gnu": "4.3.3", "@tailwindcss/oxide-linux-arm64-musl": "4.3.3", "@tailwindcss/oxide-linux-x64-gnu": "4.3.3", "@tailwindcss/oxide-linux-x64-musl": "4.3.3", "@tailwindcss/oxide-wasm32-wasi": "4.3.3", "@tailwindcss/oxide-win32-arm64-msvc": "4.3.3", "@tailwindcss/oxide-win32-x64-msvc": "4.3.3" } }, "sha512-krXjAikiaFSPaK/FkAQT5UTx3VormQaiZ5hBFlJZ9UFQGB/rwg1MZIhHAG9smMQRTdyJxP6Qt5MwMtdyU5FWrA=="],
|
||||
|
||||
"@tailwindcss/oxide-android-arm64": ["@tailwindcss/oxide-android-arm64@4.3.3", "", { "os": "android", "cpu": "arm64" }, "sha512-Y85A2gmPSkl5Ve5qR86GL4HT509cFqQh1aes9p3sSkyTPwt0Pppf3GkwGe4JPACcRYjgJIEhQgM6dBClnr0NYw=="],
|
||||
|
||||
"@tailwindcss/oxide-darwin-arm64": ["@tailwindcss/oxide-darwin-arm64@4.3.3", "", { "os": "darwin", "cpu": "arm64" }, "sha512-BiaWatpBcERQFDlOjRDpIVXuFK5PJez5SA4JMg6VYZdBYU+qKfV/vqjcIs+IYmtitf1xYQZTwXvU/8y4lfZUGw=="],
|
||||
|
||||
"@tailwindcss/oxide-darwin-x64": ["@tailwindcss/oxide-darwin-x64@4.3.3", "", { "os": "darwin", "cpu": "x64" }, "sha512-fAeUqfV5ndhxRwai8cXGzdLvul9utWOmeTkv69unv4ZXixjn61Z+p9lCWdwOwA3TYboG3BwdVuN/RDjhBRl0mw=="],
|
||||
|
||||
"@tailwindcss/oxide-freebsd-x64": ["@tailwindcss/oxide-freebsd-x64@4.3.3", "", { "os": "freebsd", "cpu": "x64" }, "sha512-iyf5bV6+wnAlflVeEy7R25dupxTNECZN5QMI0qNT6eT+EgaGdZcKhGkr5SdoaWiLJ3spLqIY9VCeSGrwmtg4kw=="],
|
||||
|
||||
"@tailwindcss/oxide-linux-arm-gnueabihf": ["@tailwindcss/oxide-linux-arm-gnueabihf@4.3.3", "", { "os": "linux", "cpu": "arm" }, "sha512-aAYUprJAJQWWbRrPvtjdroZ56Md+JM8pMiopS6xGEwDfLhqj+2ver2p4nU4Mb3CRqcMmNBjo8KkUgcxhkzVQGQ=="],
|
||||
|
||||
"@tailwindcss/oxide-linux-arm64-gnu": ["@tailwindcss/oxide-linux-arm64-gnu@4.3.3", "", { "os": "linux", "cpu": "arm64" }, "sha512-nDxldcEENOxZRzC2uu9jrutZdAAQtb+8WWDCSnWL1zvBk1+FN+x6MtDViPB5AJMfttVCUhehGWus3XBPgatM/w=="],
|
||||
|
||||
"@tailwindcss/oxide-linux-arm64-musl": ["@tailwindcss/oxide-linux-arm64-musl@4.3.3", "", { "os": "linux", "cpu": "arm64" }, "sha512-Md44bD6veX/PC5iyF8cDVnw4HBIANZepRZZ7a8DQOvkfo5WUBwcp6iAuCUz23u+4SUkhJlD3eL7hNdW8ezd/kA=="],
|
||||
|
||||
"@tailwindcss/oxide-linux-x64-gnu": ["@tailwindcss/oxide-linux-x64-gnu@4.3.3", "", { "os": "linux", "cpu": "x64" }, "sha512-tx7us1muwOKAKWao2v/GaafFeQboE6aj88vC6ziN2NCGcRm8gWUhwjzg+YdVB1e4boAtdtma4L43onunI6NS4w=="],
|
||||
|
||||
"@tailwindcss/oxide-linux-x64-musl": ["@tailwindcss/oxide-linux-x64-musl@4.3.3", "", { "os": "linux", "cpu": "x64" }, "sha512-SJxX60smvHgasZoBy11dX6YRjXJFovwWBoedhbQPOBzgFWBHGB+TVPWB9BxzR7TTxU8FQZAI2AyiNCMzFm8Img=="],
|
||||
|
||||
"@tailwindcss/oxide-wasm32-wasi": ["@tailwindcss/oxide-wasm32-wasi@4.3.3", "", { "dependencies": { "@emnapi/core": "^1.11.1", "@emnapi/runtime": "^1.11.1", "@emnapi/wasi-threads": "^1.2.2", "@napi-rs/wasm-runtime": "^1.1.4", "@tybys/wasm-util": "^0.10.2", "tslib": "^2.8.1" }, "cpu": "none" }, "sha512-jx1+rPhY/5Ympkktd656HBWEBLxP7dH06losBLjjf5vgCODXvi9KhtftWcMIwTFIDqBr7cRnQkdLnAG+IOlGvQ=="],
|
||||
|
||||
"@tailwindcss/oxide-win32-arm64-msvc": ["@tailwindcss/oxide-win32-arm64-msvc@4.3.3", "", { "os": "win32", "cpu": "arm64" }, "sha512-3rc292Ca2ceK6Ulcc/bAVnTs/3nDtoPhyEKlgPv+yQJQi/JS/AMJlqzxvlDacL1nekbrcf6bTqp/jV4qgnPxNQ=="],
|
||||
|
||||
"@tailwindcss/oxide-win32-x64-msvc": ["@tailwindcss/oxide-win32-x64-msvc@4.3.3", "", { "os": "win32", "cpu": "x64" }, "sha512-yJ0pwIVc/nYeGoV02WtsN8KYyLQv7kyI2wDnkezyJlGGjkd4QLwDGAwl47YpPJeuI0M0ObaXGSPjvWDPeTPggw=="],
|
||||
|
||||
"@tailwindcss/vite": ["@tailwindcss/vite@4.3.3", "", { "dependencies": { "@tailwindcss/node": "4.3.3", "@tailwindcss/oxide": "4.3.3", "tailwindcss": "4.3.3" }, "peerDependencies": { "vite": "^5.2.0 || ^6 || ^7 || ^8" } }, "sha512-yYU8cogLeSh/ms2jh8Fj7jaba/EWa7Ja6GoUqYZaraEuCI5YS6ms6ObZgjjedm+jm6XZjdNRWBpPP6Z86oOxcw=="],
|
||||
|
||||
"@types/babel__core": ["@types/babel__core@7.20.5", "", { "dependencies": { "@babel/parser": "^7.20.7", "@babel/types": "^7.20.7", "@types/babel__generator": "*", "@types/babel__template": "*", "@types/babel__traverse": "*" } }, "sha512-qoQprZvz5wQFJwMDqeseRXWv3rqMvhgpbXFfVyWhbx9X47POIA6i/+dXefEmZKoAgOaTdaIgNSMqMIU61yRyzA=="],
|
||||
|
||||
"@types/babel__generator": ["@types/babel__generator@7.27.0", "", { "dependencies": { "@babel/types": "^7.0.0" } }, "sha512-ufFd2Xi92OAVPYsy+P4n7/U7e68fex0+Ee8gSG9KX7eo084CWiQ4sdxktvdl0bOPupXtVJPY19zk6EwWqUQ8lg=="],
|
||||
|
||||
"@types/babel__template": ["@types/babel__template@7.4.4", "", { "dependencies": { "@babel/parser": "^7.1.0", "@babel/types": "^7.0.0" } }, "sha512-h/NUaSyG5EyxBIp8YRxo4RMe2/qQgvyowRwVMzhYhBCONbW8PUsg4lkFMrhgZhUe5z3L3MiLDuvyJ/CaPa2A8A=="],
|
||||
|
||||
"@types/babel__traverse": ["@types/babel__traverse@7.28.0", "", { "dependencies": { "@babel/types": "^7.28.2" } }, "sha512-8PvcXf70gTDZBgt9ptxJ8elBeBjcLOAcOtoO/mPJjtji1+CdGbHgm77om1GrsPxsiE+uXIpNSK64UYaIwQXd4Q=="],
|
||||
|
||||
"@types/body-parser": ["@types/body-parser@1.19.6", "", { "dependencies": { "@types/connect": "*", "@types/node": "*" } }, "sha512-HLFeCYgz89uk22N5Qg3dvGvsv46B8GLvKKo1zKG4NybA8U2DiEO3w9lqGg29t/tfLRJpJ6iQxnVw4OnB7MoM9g=="],
|
||||
|
||||
"@types/canvas-confetti": ["@types/canvas-confetti@1.9.0", "", {}, "sha512-aBGj/dULrimR1XDZLtG9JwxX1b4HPRF6CX9Yfwh3NvstZEm1ZL7RBnel4keCPSqs1ANRu1u2Aoz9R+VmtjYuTg=="],
|
||||
|
||||
"@types/connect": ["@types/connect@3.4.38", "", { "dependencies": { "@types/node": "*" } }, "sha512-K6uROf1LD88uDQqJCktA4yzL1YYAK6NgfsI0v/mTgyPKWsX1CnJ0XPSDhViejru1GcRkLWb8RlzFYJRqGUbaug=="],
|
||||
|
||||
"@types/estree": ["@types/estree@1.0.9", "", {}, "sha512-GhdPgy1el4/ImP05X05Uw4cw2/M93BCUmnEvWZNStlCzEKME4Fkk+YpoA5OiHNQmoS7Cafb8Xa3Pya8m1Qrzeg=="],
|
||||
|
||||
"@types/express": ["@types/express@4.17.25", "", { "dependencies": { "@types/body-parser": "*", "@types/express-serve-static-core": "^4.17.33", "@types/qs": "*", "@types/serve-static": "^1" } }, "sha512-dVd04UKsfpINUnK0yBoYHDF3xu7xVH4BuDotC/xGuycx4CgbP48X/KF/586bcObxT0HENHXEU8Nqtu6NR+eKhw=="],
|
||||
|
||||
"@types/express-serve-static-core": ["@types/express-serve-static-core@4.19.9", "", { "dependencies": { "@types/node": "*", "@types/qs": "*", "@types/range-parser": "*", "@types/send": "*" } }, "sha512-QP2ESEe/ImWY0HDwNAnK9PvEffUyhLTnWkk7KXzHfyeWAnlrDe1fN77bXl6ia8KT3wPlmA7t9/VPRpnf4Ex9sg=="],
|
||||
|
||||
"@types/http-errors": ["@types/http-errors@2.0.5", "", {}, "sha512-r8Tayk8HJnX0FztbZN7oVqGccWgw98T/0neJphO91KkmOzug1KkofZURD4UaD5uH8AqcFLfdPErnBod0u71/qg=="],
|
||||
|
||||
"@types/mime": ["@types/mime@1.3.5", "", {}, "sha512-/pyBZWSLD2n0dcHE3hq8s8ZvcETHtEuF+3E7XVt0Ig2nvsVQXdghHVcEkIWjy9A0wKfTn97a/PSDYohKIlnP/w=="],
|
||||
|
||||
"@types/node": ["@types/node@22.20.1", "", { "dependencies": { "undici-types": "~6.21.0" } }, "sha512-EANqOCF9QFyra+4pfxUcX9STKJpCLjMbObVzljIJomAWSnuSIEAvyzEU53GaajbXJEgdh0iEcPL+DGvpUd4k1Q=="],
|
||||
|
||||
"@types/qrcode": ["@types/qrcode@1.5.6", "", { "dependencies": { "@types/node": "*" } }, "sha512-te7NQcV2BOvdj2b1hCAHzAoMNuj65kNBMz0KBaxM6c3VGBOhU0dURQKOtH8CFNI/dsKkwlv32p26qYQTWoB5bw=="],
|
||||
|
||||
"@types/qs": ["@types/qs@6.15.1", "", {}, "sha512-GZHUBZR9hckSUhrxmp1nG6NwdpM9fCunJwyThLW1X3AyHgd9IlHb6VANpQQqDr2o/qQp6McZ3y/IA2rVzKzSbw=="],
|
||||
|
||||
"@types/range-parser": ["@types/range-parser@1.2.7", "", {}, "sha512-hKormJbkJqzQGhziax5PItDUTMAM9uE2XXQmM37dyd4hVM+5aVl7oVxMVUiVQn2oCQFN/LKCZdvSM0pFRqbSmQ=="],
|
||||
|
||||
"@types/retry": ["@types/retry@0.12.0", "", {}, "sha512-wWKOClTTiizcZhXnPY4wikVAwmdYHp8q6DmC+EJUzAMsycb7HB32Kh9RN4+0gExjmPmZSAQjgURXIGATPegAvA=="],
|
||||
|
||||
"@types/send": ["@types/send@1.2.1", "", { "dependencies": { "@types/node": "*" } }, "sha512-arsCikDvlU99zl1g69TcAB3mzZPpxgw0UQnaHeC1Nwb015xp8bknZv5rIfri9xTOcMuaVgvabfIRA7PSZVuZIQ=="],
|
||||
|
||||
"@types/serve-static": ["@types/serve-static@1.15.10", "", { "dependencies": { "@types/http-errors": "*", "@types/node": "*", "@types/send": "<1" } }, "sha512-tRs1dB+g8Itk72rlSI2ZrW6vZg0YrLI81iQSTkMmOqnqCaNr/8Ek4VwWcN5vZgCYWbg/JJSGBlUaYGAOP73qBw=="],
|
||||
|
||||
"@types/ws": ["@types/ws@8.18.1", "", { "dependencies": { "@types/node": "*" } }, "sha512-ThVF6DCVhA8kUGy+aazFQ4kXQ7E1Ty7A3ypFOe0IcJV8O/M511G99AW24irKrW56Wt44yG9+ij8FaqoBGkuBXg=="],
|
||||
|
||||
"@vitejs/plugin-react": ["@vitejs/plugin-react@5.2.0", "", { "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" }, "peerDependencies": { "vite": "^4.2.0 || ^5.0.0 || ^6.0.0 || ^7.0.0 || ^8.0.0" } }, "sha512-YmKkfhOAi3wsB1PhJq5Scj3GXMn3WvtQ/JC0xoopuHoXSdmtdStOpFrYaT1kie2YgFBcIe64ROzMYRjCrYOdYw=="],
|
||||
|
||||
"accepts": ["accepts@1.3.8", "", { "dependencies": { "mime-types": "~2.1.34", "negotiator": "0.6.3" } }, "sha512-PYAthTa2m2VKxuvSD3DPC/Gy+U+sOA1LAuT8mkmRuvw+NACSaeXEQ+NHcVF7rONl6qcaxV3Uuemwawk+7+SJLw=="],
|
||||
|
||||
"agent-base": ["agent-base@7.1.4", "", {}, "sha512-MnA+YT8fwfJPgBx3m60MNqakm30XOkyIoH1y6huTQvC0PwZG7ki8NacLBcrPbNoo8vEZy7Jpuk7+jMO+CUovTQ=="],
|
||||
|
||||
"ansi-regex": ["ansi-regex@5.0.1", "", {}, "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ=="],
|
||||
|
||||
"ansi-styles": ["ansi-styles@4.3.0", "", { "dependencies": { "color-convert": "^2.0.1" } }, "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg=="],
|
||||
|
||||
"array-flatten": ["array-flatten@1.1.1", "", {}, "sha512-PCVAQswWemu6UdxsDFFX/+gVeYqKAod3D3UVm91jHwynguOwAvYPhx8nNlM++NqRcK6CxxpUafjmhIdKiHibqg=="],
|
||||
|
||||
"autoprefixer": ["autoprefixer@10.5.4", "", { "dependencies": { "browserslist": "^4.28.6", "caniuse-lite": "^1.0.30001806", "fraction.js": "^5.3.4", "picocolors": "^1.1.1", "postcss-value-parser": "^4.2.0" }, "peerDependencies": { "postcss": "^8.1.0" }, "bin": { "autoprefixer": "bin/autoprefixer" } }, "sha512-MaU0U/za7N3r6brxD4YB/l4NSrFzLPlANv6wEuQVaIPlD3L4W9rFcQPbL/EilY9BHhHvhfcz3gInDLrEtWT4EA=="],
|
||||
|
||||
"base64-js": ["base64-js@1.5.1", "", {}, "sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA=="],
|
||||
|
||||
"baseline-browser-mapping": ["baseline-browser-mapping@2.11.19", "", { "bin": { "baseline-browser-mapping": "dist/cli.cjs" } }, "sha512-Grytf1xOxOEMTGRwx6rLGKkTabd4vMg3VrKdj/7joCmV0qgh4QwMMO6xh34YEXQqirAuUdgQGa5orJQQ+69RBw=="],
|
||||
|
||||
"bignumber.js": ["bignumber.js@9.3.1", "", {}, "sha512-Ko0uX15oIUS7wJ3Rb30Fs6SkVbLmPBAKdlm7q9+ak9bbIeFf0MwuBsQV6z7+X768/cHsfg+WlysDWJcmthjsjQ=="],
|
||||
|
||||
"body-parser": ["body-parser@1.20.6", "", { "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.15.1", "raw-body": "~2.5.3", "type-is": "~1.6.18", "unpipe": "~1.0.0" } }, "sha512-p5tAzS57i5MV9fZFDj9LeIiTZEufbSe2eDozP+ElheSUq1m74CRq1jI4mYNDdVs9vQztXFLuk/Gd6BWTdwRJ5g=="],
|
||||
|
||||
"browserslist": ["browserslist@4.28.8", "", { "dependencies": { "baseline-browser-mapping": "^2.11.12", "caniuse-lite": "^1.0.30001809", "electron-to-chromium": "^1.5.402", "node-releases": "^2.0.53", "update-browserslist-db": "^1.3.0" }, "bin": { "browserslist": "cli.js" } }, "sha512-V2NpofLblG64mfOtSgDhOJESZEGogzDMBv/q+W6oc4LXWP/q75eOXoOaaOu1EOadB9U4Bwx/e0yzbvwKH8zalA=="],
|
||||
|
||||
"buffer-equal-constant-time": ["buffer-equal-constant-time@1.0.1", "", {}, "sha512-zRpUiDwd/xk6ADqPMATG8vc9VPrkck7T07OIx0gnjmJAnHnTVXNQG3vfvWNuiZIkwu9KrKdA1iJKfsfTVxE6NA=="],
|
||||
|
||||
"bytes": ["bytes@3.1.2", "", {}, "sha512-/Nf7TyzTx6S3yRJObOAV7956r8cr2+Oj8AC5dt8wSP3BQAoeX58NoHyCU8P8zGkNXStjTSi6fzO6F0pBdcYbEg=="],
|
||||
|
||||
"call-bind-apply-helpers": ["call-bind-apply-helpers@1.0.2", "", { "dependencies": { "es-errors": "^1.3.0", "function-bind": "^1.1.2" } }, "sha512-Sp1ablJ0ivDkSzjcaJdxEunN5/XvksFJ2sMBFfq6x0ryhQV/2b/KwFe21cMpmHtPOSij8K99/wSfoEuTObmuMQ=="],
|
||||
|
||||
"call-bound": ["call-bound@1.0.4", "", { "dependencies": { "call-bind-apply-helpers": "^1.0.2", "get-intrinsic": "^1.3.0" } }, "sha512-+ys997U96po4Kx/ABpBCqhA9EuxJaQWDQg7295H4hBphv3IZg0boBKuwYpt4YXp6MZ5AmZQnU/tyMTlRpaSejg=="],
|
||||
|
||||
"camelcase": ["camelcase@5.3.1", "", {}, "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg=="],
|
||||
|
||||
"caniuse-lite": ["caniuse-lite@1.0.30001810", "", {}, "sha512-TITQPUkaz+aVk5GL6NhOdwk1aEaNTSDPsGFWrTuhKGtjTF70jL/Oht2W4c6rXUe5fu7Ie19VIahAXHIIiWWNeg=="],
|
||||
|
||||
"canvas-confetti": ["canvas-confetti@1.9.4", "", {}, "sha512-yxQbJkAVrFXWNbTUjPqjF7G+g6pDotOUHGbkZq2NELZUMDpiJ85rIEazVb8GTaAptNW2miJAXbs1BtioA251Pw=="],
|
||||
|
||||
"cliui": ["cliui@6.0.0", "", { "dependencies": { "string-width": "^4.2.0", "strip-ansi": "^6.0.0", "wrap-ansi": "^6.2.0" } }, "sha512-t6wbgtoCXvAzst7QgXxJYqPt0usEfbgQdftEPbLL/cvv6HPE5VgvqCuAIDR0NgU52ds6rFwqrgakNLrHEjCbrQ=="],
|
||||
|
||||
"color-convert": ["color-convert@2.0.1", "", { "dependencies": { "color-name": "~1.1.4" } }, "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ=="],
|
||||
|
||||
"color-name": ["color-name@1.1.4", "", {}, "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA=="],
|
||||
|
||||
"content-disposition": ["content-disposition@0.5.4", "", { "dependencies": { "safe-buffer": "5.2.1" } }, "sha512-FveZTNuGw04cxlAiWbzi6zTAL/lhehaWbTtgluJh4/E95DqMwTmha3KZN1aAWA8cFIhHzMZUvLevkw5Rqk+tSQ=="],
|
||||
|
||||
"content-type": ["content-type@1.0.5", "", {}, "sha512-nTjqfcBFEipKdXCv4YDQWCfmcLZKm81ldF0pAopTvyrFGVbcR6P/VAAd5G7N+0tTr8QqiU0tFadD6FK4NtJwOA=="],
|
||||
|
||||
"convert-source-map": ["convert-source-map@2.0.0", "", {}, "sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg=="],
|
||||
|
||||
"cookie": ["cookie@0.7.2", "", {}, "sha512-yki5XnKuf750l50uGTllt6kKILY4nQ1eNIQatoXEByZ5dWgnKqbnqmTrBE5B4N7lrMJKQ2ytWMiTO2o0v6Ew/w=="],
|
||||
|
||||
"cookie-signature": ["cookie-signature@1.0.7", "", {}, "sha512-NXdYc3dLr47pBkpUCHtKSwIOQXLVn8dZEuywboCOJY/osA0wFSLlSawr3KN8qXJEyX66FcONTH8EIlVuK0yyFA=="],
|
||||
|
||||
"data-uri-to-buffer": ["data-uri-to-buffer@4.0.1", "", {}, "sha512-0R9ikRb668HB7QDxT1vkpuUBtqc53YyAwMwGeUFKRojY/NWKvdZ+9UYtRfGmhqNbRkTSVpMbmyhXipFFv2cb/A=="],
|
||||
|
||||
"debug": ["debug@2.6.9", "", { "dependencies": { "ms": "2.0.0" } }, "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA=="],
|
||||
|
||||
"decamelize": ["decamelize@1.2.0", "", {}, "sha512-z2S+W9X73hAUUki+N+9Za2lBlun89zigOyGrsax+KUQ6wKW4ZoWpEYBkGhQjwAjjDCkWxhY0VKEhk8wzY7F5cA=="],
|
||||
|
||||
"depd": ["depd@2.0.0", "", {}, "sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw=="],
|
||||
|
||||
"destroy": ["destroy@1.2.0", "", {}, "sha512-2sJGJTaXIIaR1w4iJSNoN0hnMY7Gpc/n8D4qSCJw8QqFWXf7cuAgnEHxBpweaVcPevC2l3KpjYCx3NypQQgaJg=="],
|
||||
|
||||
"detect-libc": ["detect-libc@2.1.2", "", {}, "sha512-Btj2BOOO83o3WyH59e8MgXsxEQVcarkUOpEYrubB0urwnN10yQ364rsiByU11nZlqWYZm05i/of7io4mzihBtQ=="],
|
||||
|
||||
"dijkstrajs": ["dijkstrajs@1.0.3", "", {}, "sha512-qiSlmBq9+BCdCA/L46dw8Uy93mloxsPSbwnm5yrKn2vMPiy8KyAskTF6zuV/j5BMsmOGZDPs7KjU+mjb670kfA=="],
|
||||
|
||||
"dotenv": ["dotenv@17.4.2", "", {}, "sha512-nI4U3TottKAcAD9LLud4Cb7b2QztQMUEfHbvhTH09bqXTxnSie8WnjPALV/WMCrJZ6UV/qHJ6L03OqO3LcdYZw=="],
|
||||
|
||||
"dunder-proto": ["dunder-proto@1.0.1", "", { "dependencies": { "call-bind-apply-helpers": "^1.0.1", "es-errors": "^1.3.0", "gopd": "^1.2.0" } }, "sha512-KIN/nDJBQRcXw0MLVhZE9iQHmG68qAVIBg9CqmUYjmQIhgij9U5MFvrqkUL5FbtyyzZuOeOt0zdeRe4UY7ct+A=="],
|
||||
|
||||
"ecdsa-sig-formatter": ["ecdsa-sig-formatter@1.0.11", "", { "dependencies": { "safe-buffer": "^5.0.1" } }, "sha512-nagl3RYrbNv6kQkeJIpt6NJZy8twLB/2vtz6yN9Z4vRKHN4/QZJIEbqohALSgwKdnksuY3k5Addp5lg8sVoVcQ=="],
|
||||
|
||||
"ee-first": ["ee-first@1.1.1", "", {}, "sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow=="],
|
||||
|
||||
"electron-to-chromium": ["electron-to-chromium@1.5.415", "", {}, "sha512-958V+Kbhtgz+SxXeEVKBjrlKRBIDAYvUJfwhjxMZ5S6ut9jAl7l9ZKBkBrvjyjZE36PabLUo2L8kEeV5O4vgJg=="],
|
||||
|
||||
"emoji-regex": ["emoji-regex@8.0.0", "", {}, "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A=="],
|
||||
|
||||
"encodeurl": ["encodeurl@2.0.0", "", {}, "sha512-Q0n9HRi4m6JuGIV1eFlmvJB7ZEVxu93IrMyiMsGC0lrMJMWzRgx6WGquyfQgZVb31vhGgXnfmPNNXmxnOkRBrg=="],
|
||||
|
||||
"enhanced-resolve": ["enhanced-resolve@5.24.5", "", { "dependencies": { "graceful-fs": "^4.2.4", "tapable": "^2.3.3" } }, "sha512-L1l8TNvomm6UVW5B253AGxQagSQr+vGwhMlrrfRS2qmhx46AMpMVJKQYLvWYbysTMY8VoicOvzHzoHMbyzB+4A=="],
|
||||
|
||||
"es-define-property": ["es-define-property@1.0.1", "", {}, "sha512-e3nRfgfUZ4rNGL232gUgX06QNyyez04KdjFrF+LTRoOXmrOgFKDg4BCdsjW8EnT69eqdYGmRpJwiPVYNrCaW3g=="],
|
||||
|
||||
"es-errors": ["es-errors@1.3.0", "", {}, "sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw=="],
|
||||
|
||||
"es-object-atoms": ["es-object-atoms@1.1.2", "", { "dependencies": { "es-errors": "^1.3.0" } }, "sha512-HWcBoN6NileqtSydK2FqHbS/LoDd2pqrnQHLyJzBj4kOp/ky2MWMN694xOfkK8/SnUsW2DH7EfyVlydKCsm1Zw=="],
|
||||
|
||||
"esbuild": ["esbuild@0.25.12", "", { "optionalDependencies": { "@esbuild/aix-ppc64": "0.25.12", "@esbuild/android-arm": "0.25.12", "@esbuild/android-arm64": "0.25.12", "@esbuild/android-x64": "0.25.12", "@esbuild/darwin-arm64": "0.25.12", "@esbuild/darwin-x64": "0.25.12", "@esbuild/freebsd-arm64": "0.25.12", "@esbuild/freebsd-x64": "0.25.12", "@esbuild/linux-arm": "0.25.12", "@esbuild/linux-arm64": "0.25.12", "@esbuild/linux-ia32": "0.25.12", "@esbuild/linux-loong64": "0.25.12", "@esbuild/linux-mips64el": "0.25.12", "@esbuild/linux-ppc64": "0.25.12", "@esbuild/linux-riscv64": "0.25.12", "@esbuild/linux-s390x": "0.25.12", "@esbuild/linux-x64": "0.25.12", "@esbuild/netbsd-arm64": "0.25.12", "@esbuild/netbsd-x64": "0.25.12", "@esbuild/openbsd-arm64": "0.25.12", "@esbuild/openbsd-x64": "0.25.12", "@esbuild/openharmony-arm64": "0.25.12", "@esbuild/sunos-x64": "0.25.12", "@esbuild/win32-arm64": "0.25.12", "@esbuild/win32-ia32": "0.25.12", "@esbuild/win32-x64": "0.25.12" }, "bin": { "esbuild": "bin/esbuild" } }, "sha512-bbPBYYrtZbkt6Os6FiTLCTFxvq4tt3JKall1vRwshA3fdVztsLAatFaZobhkBC8/BrPetoa0oksYoKXoG4ryJg=="],
|
||||
|
||||
"escalade": ["escalade@3.2.0", "", {}, "sha512-WUj2qlxaQtO4g6Pq5c29GTcWGDyd8itL8zTlipgECz3JesAiiOKotd8JU6otB3PACgG6xkJUyVhboMS+bje/jA=="],
|
||||
|
||||
"escape-html": ["escape-html@1.0.3", "", {}, "sha512-NiSupZ4OeuGwr68lGIeym/ksIZMJodUGOSCZ/FSnTxcrekbvqrgdUxlJOMpijaKZVjAJrWrGs/6Jy8OMuyj9ow=="],
|
||||
|
||||
"etag": ["etag@1.8.1", "", {}, "sha512-aIL5Fx7mawVa300al2BnEE4iNvo1qETxLrPI/o05L7z6go7fCw1J6EQmbK4FmJ2AS7kgVF/KEZWufBfdClMcPg=="],
|
||||
|
||||
"express": ["express@4.22.2", "", { "dependencies": { "accepts": "~1.3.8", "array-flatten": "1.1.1", "body-parser": "~1.20.5", "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.15.1", "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" } }, "sha512-IuL+Elrou2ZvCFHs18/CIzy2Nzvo25nZ1/D2eIZlz7c+QUayAcYoiM2BthCjs+EBHVpjYjcuLDAiCWgeIX3X1Q=="],
|
||||
|
||||
"extend": ["extend@3.0.2", "", {}, "sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g=="],
|
||||
|
||||
"fdir": ["fdir@6.5.0", "", { "peerDependencies": { "picomatch": "^3 || ^4" }, "optionalPeers": ["picomatch"] }, "sha512-tIbYtZbucOs0BRGqPJkshJUYdL+SDH7dVM8gjy+ERp3WAUjLEFJE+02kanyHtwjWOnwrKYBiwAmM0p4kLJAnXg=="],
|
||||
|
||||
"fetch-blob": ["fetch-blob@3.2.0", "", { "dependencies": { "node-domexception": "^1.0.0", "web-streams-polyfill": "^3.0.3" } }, "sha512-7yAQpD2UMJzLi1Dqv7qFYnPbaPx7ZfFK6PiIxQ4PfkGPyNyl2Ugx+a/umUonmKqjhM4DnfbMvdX6otXq83soQQ=="],
|
||||
|
||||
"finalhandler": ["finalhandler@1.3.2", "", { "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" } }, "sha512-aA4RyPcd3badbdABGDuTXCMTtOneUCAYH/gxoYRTZlIJdF0YPWuGqiAsIrhNnnqdXGswYk6dGujem4w80UJFhg=="],
|
||||
|
||||
"find-up": ["find-up@4.1.0", "", { "dependencies": { "locate-path": "^5.0.0", "path-exists": "^4.0.0" } }, "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw=="],
|
||||
|
||||
"formdata-polyfill": ["formdata-polyfill@4.0.10", "", { "dependencies": { "fetch-blob": "^3.1.2" } }, "sha512-buewHzMvYL29jdeQTVILecSaZKnt/RJWjoZCF5OW60Z67/GmSLBkOFM7qh1PI3zFNtJbaZL5eQu1vLfazOwj4g=="],
|
||||
|
||||
"forwarded": ["forwarded@0.2.0", "", {}, "sha512-buRG0fpBtRHSTCOASe6hD258tEubFoRLb4ZNA6NxMVHNw2gOcwHo9wyablzMzOA5z9xA9L1KNjk/Nt6MT9aYow=="],
|
||||
|
||||
"fraction.js": ["fraction.js@5.3.4", "", {}, "sha512-1X1NTtiJphryn/uLQz3whtY6jK3fTqoE3ohKs0tT+Ujr1W59oopxmoEh7Lu5p6vBaPbgoM0bzveAW4Qi5RyWDQ=="],
|
||||
|
||||
"framer-motion": ["framer-motion@12.43.0", "", { "dependencies": { "motion-dom": "^12.43.0", "motion-utils": "^12.39.0", "tslib": "^2.4.0" }, "peerDependencies": { "@emotion/is-prop-valid": "*", "react": "^18.0.0 || ^19.0.0", "react-dom": "^18.0.0 || ^19.0.0" }, "optionalPeers": ["@emotion/is-prop-valid", "react", "react-dom"] }, "sha512-1eaL3RvR/kAlbG7UYcpMptEyzPoENO0c6w7ZnB3/hh2vSAz/6uGAFn6fdoqTBguNstf3MsFhJHsD/0DHiclG+g=="],
|
||||
|
||||
"fresh": ["fresh@0.5.2", "", {}, "sha512-zJ2mQYM18rEFOudeV4GShTGIQ7RbzA7ozbU9I/XBpm7kqgMywgmylMwXHxZJmkVoYkna9d2pVXVXPdYTP9ej8Q=="],
|
||||
|
||||
"fsevents": ["fsevents@2.3.3", "", { "os": "darwin" }, "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw=="],
|
||||
|
||||
"function-bind": ["function-bind@1.1.2", "", {}, "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA=="],
|
||||
|
||||
"gaxios": ["gaxios@7.3.1", "", { "dependencies": { "extend": "^3.0.2", "https-proxy-agent": "^7.0.1", "node-fetch": "^3.3.2" } }, "sha512-kB3rzJV7d9juLZh8/56QTXCwQfxyhdOMdyYk1HdQKFtF8TJTDTZQJtixWIwXdE9Jji91mC41DUNpjleo4L4eAQ=="],
|
||||
|
||||
"gcp-metadata": ["gcp-metadata@8.1.2", "", { "dependencies": { "gaxios": "^7.0.0", "google-logging-utils": "^1.0.0", "json-bigint": "^1.0.0" } }, "sha512-zV/5HKTfCeKWnxG0Dmrw51hEWFGfcF2xiXqcA3+J90WDuP0SvoiSO5ORvcBsifmx/FoIjgQN3oNOGaQ5PhLFkg=="],
|
||||
|
||||
"gensync": ["gensync@1.0.0-beta.2", "", {}, "sha512-3hN7NaskYvMDLQY55gnW3NQ+mesEAepTqlg+VEbj7zzqEMBVNhzcGYYeqFo/TlYz6eQiFcp1HcsCZO+nGgS8zg=="],
|
||||
|
||||
"get-caller-file": ["get-caller-file@2.0.5", "", {}, "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg=="],
|
||||
|
||||
"get-intrinsic": ["get-intrinsic@1.3.0", "", { "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" } }, "sha512-9fSjSaos/fRIVIp+xSJlE6lfwhES7LNtKaCBIamHsjr2na1BiABJPo0mOjjz8GJDURarmCPGqaiVg5mfjb98CQ=="],
|
||||
|
||||
"get-proto": ["get-proto@1.0.1", "", { "dependencies": { "dunder-proto": "^1.0.1", "es-object-atoms": "^1.0.0" } }, "sha512-sTSfBjoXBp89JvIKIefqw7U2CCebsc74kiY6awiGogKtoSGbgjYE/G/+l9sF3MWFPNc9IcoOC4ODfKHfxFmp0g=="],
|
||||
|
||||
"google-auth-library": ["google-auth-library@10.9.1", "", { "dependencies": { "base64-js": "^1.3.0", "ecdsa-sig-formatter": "^1.0.11", "gaxios": "^7.1.4", "gcp-metadata": "8.1.2", "google-logging-utils": "1.1.3", "jws": "^4.0.0" } }, "sha512-i1ydyHrqcIxXkWh/uBmVkzCvIuq5yiK2ATndIe5XxKholrG/MTYP9xGYka4sQhrbIAgGjL2B6NOE7rFaiF3fXw=="],
|
||||
|
||||
"google-logging-utils": ["google-logging-utils@1.1.3", "", {}, "sha512-eAmLkjDjAFCVXg7A1unxHsLf961m6y17QFqXqAXGj/gVkKFrEICfStRfwUlGNfeCEjNRa32JEWOUTlYXPyyKvA=="],
|
||||
|
||||
"gopd": ["gopd@1.2.0", "", {}, "sha512-ZUKRh6/kUFoAiTAtTYPZJ3hw9wNxx+BIBOijnlG9PnrJsCcSjs1wyyD6vJpaYtgnzDrKYRSqf3OO6Rfa93xsRg=="],
|
||||
|
||||
"graceful-fs": ["graceful-fs@4.2.11", "", {}, "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ=="],
|
||||
|
||||
"has-symbols": ["has-symbols@1.1.0", "", {}, "sha512-1cDNdwJ2Jaohmb3sg4OmKaMBwuC48sYni5HUw2DvsC8LjGTLK9h+eb1X6RyuOHe4hT0ULCW68iomhjUoKUqlPQ=="],
|
||||
|
||||
"hasown": ["hasown@2.0.4", "", { "dependencies": { "function-bind": "^1.1.2" } }, "sha512-T2UbfbBEF32wiepXIsMlTW9+dDYC6wMh/t/vYA4tuOMKqWz/n3vr1NFSxQiyP+zk2mXsoMA/i/7qV6LKut1t1A=="],
|
||||
|
||||
"http-errors": ["http-errors@2.0.1", "", { "dependencies": { "depd": "~2.0.0", "inherits": "~2.0.4", "setprototypeof": "~1.2.0", "statuses": "~2.0.2", "toidentifier": "~1.0.1" } }, "sha512-4FbRdAX+bSdmo4AUFuS0WNiPz8NgFt+r8ThgNWmlrjQjt1Q7ZR9+zTlce2859x4KSXrwIsaeTqDoKQmtP8pLmQ=="],
|
||||
|
||||
"https-proxy-agent": ["https-proxy-agent@7.0.6", "", { "dependencies": { "agent-base": "^7.1.2", "debug": "4" } }, "sha512-vK9P5/iUfdl95AI+JVyUuIcVtd4ofvtrOr3HNtM2yxC9bnMbEdp3x01OhQNnjb8IJYi38VlTE3mBXwcfvywuSw=="],
|
||||
|
||||
"iconv-lite": ["iconv-lite@0.4.24", "", { "dependencies": { "safer-buffer": ">= 2.1.2 < 3" } }, "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA=="],
|
||||
|
||||
"inherits": ["inherits@2.0.4", "", {}, "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ=="],
|
||||
|
||||
"ipaddr.js": ["ipaddr.js@1.9.1", "", {}, "sha512-0KI/607xoxSToH7GjN1FfSbLoU0+btTicjsQSWQlh/hZykN8KpmMf7uYwPW3R+akZ6R/w18ZlXSHBYXiYUPO3g=="],
|
||||
|
||||
"is-fullwidth-code-point": ["is-fullwidth-code-point@3.0.0", "", {}, "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg=="],
|
||||
|
||||
"jiti": ["jiti@2.7.0", "", { "bin": { "jiti": "lib/jiti-cli.mjs" } }, "sha512-AC/7JofJvZGrrneWNaEnJeOLUx+JlGt7tNa0wZiRPT4MY1wmfKjt2+6O2p2uz2+skll8OZZmJMNqeke7kKbNgQ=="],
|
||||
|
||||
"js-tokens": ["js-tokens@4.0.0", "", {}, "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ=="],
|
||||
|
||||
"jsesc": ["jsesc@3.1.0", "", { "bin": { "jsesc": "bin/jsesc" } }, "sha512-/sM3dO2FOzXjKQhJuo0Q173wf2KOo8t4I8vHy6lF9poUp7bKT0/NHE8fPX23PwfhnykfqnC2xRxOnVw5XuGIaA=="],
|
||||
|
||||
"json-bigint": ["json-bigint@1.0.0", "", { "dependencies": { "bignumber.js": "^9.0.0" } }, "sha512-SiPv/8VpZuWbvLSMtTDU8hEfrZWg/mH/nV/b4o0CYbSxu1UIQPLdwKOCIyLQX+VIPO5vrLX3i8qtqFyhdPSUSQ=="],
|
||||
|
||||
"json5": ["json5@2.2.3", "", { "bin": { "json5": "lib/cli.js" } }, "sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg=="],
|
||||
|
||||
"jwa": ["jwa@2.0.1", "", { "dependencies": { "buffer-equal-constant-time": "^1.0.1", "ecdsa-sig-formatter": "1.0.11", "safe-buffer": "^5.0.1" } }, "sha512-hRF04fqJIP8Abbkq5NKGN0Bbr3JxlQ+qhZufXVr0DvujKy93ZCbXZMHDL4EOtodSbCWxOqR8MS1tXA5hwqCXDg=="],
|
||||
|
||||
"jws": ["jws@4.0.1", "", { "dependencies": { "jwa": "^2.0.1", "safe-buffer": "^5.0.1" } }, "sha512-EKI/M/yqPncGUUh44xz0PxSidXFr/+r0pA70+gIYhjv+et7yxM+s29Y+VGDkovRofQem0fs7Uvf4+YmAdyRduA=="],
|
||||
|
||||
"lightningcss": ["lightningcss@1.32.0", "", { "dependencies": { "detect-libc": "^2.0.3" }, "optionalDependencies": { "lightningcss-android-arm64": "1.32.0", "lightningcss-darwin-arm64": "1.32.0", "lightningcss-darwin-x64": "1.32.0", "lightningcss-freebsd-x64": "1.32.0", "lightningcss-linux-arm-gnueabihf": "1.32.0", "lightningcss-linux-arm64-gnu": "1.32.0", "lightningcss-linux-arm64-musl": "1.32.0", "lightningcss-linux-x64-gnu": "1.32.0", "lightningcss-linux-x64-musl": "1.32.0", "lightningcss-win32-arm64-msvc": "1.32.0", "lightningcss-win32-x64-msvc": "1.32.0" } }, "sha512-NXYBzinNrblfraPGyrbPoD19C1h9lfI/1mzgWYvXUTe414Gz/X1FD2XBZSZM7rRTrMA8JL3OtAaGifrIKhQ5yQ=="],
|
||||
|
||||
"lightningcss-android-arm64": ["lightningcss-android-arm64@1.32.0", "", { "os": "android", "cpu": "arm64" }, "sha512-YK7/ClTt4kAK0vo6w3X+Pnm0D2cf2vPHbhOXdoNti1Ga0al1P4TBZhwjATvjNwLEBCnKvjJc2jQgHXH0NEwlAg=="],
|
||||
|
||||
"lightningcss-darwin-arm64": ["lightningcss-darwin-arm64@1.32.0", "", { "os": "darwin", "cpu": "arm64" }, "sha512-RzeG9Ju5bag2Bv1/lwlVJvBE3q6TtXskdZLLCyfg5pt+HLz9BqlICO7LZM7VHNTTn/5PRhHFBSjk5lc4cmscPQ=="],
|
||||
|
||||
"lightningcss-darwin-x64": ["lightningcss-darwin-x64@1.32.0", "", { "os": "darwin", "cpu": "x64" }, "sha512-U+QsBp2m/s2wqpUYT/6wnlagdZbtZdndSmut/NJqlCcMLTWp5muCrID+K5UJ6jqD2BFshejCYXniPDbNh73V8w=="],
|
||||
|
||||
"lightningcss-freebsd-x64": ["lightningcss-freebsd-x64@1.32.0", "", { "os": "freebsd", "cpu": "x64" }, "sha512-JCTigedEksZk3tHTTthnMdVfGf61Fky8Ji2E4YjUTEQX14xiy/lTzXnu1vwiZe3bYe0q+SpsSH/CTeDXK6WHig=="],
|
||||
|
||||
"lightningcss-linux-arm-gnueabihf": ["lightningcss-linux-arm-gnueabihf@1.32.0", "", { "os": "linux", "cpu": "arm" }, "sha512-x6rnnpRa2GL0zQOkt6rts3YDPzduLpWvwAF6EMhXFVZXD4tPrBkEFqzGowzCsIWsPjqSK+tyNEODUBXeeVHSkw=="],
|
||||
|
||||
"lightningcss-linux-arm64-gnu": ["lightningcss-linux-arm64-gnu@1.32.0", "", { "os": "linux", "cpu": "arm64" }, "sha512-0nnMyoyOLRJXfbMOilaSRcLH3Jw5z9HDNGfT/gwCPgaDjnx0i8w7vBzFLFR1f6CMLKF8gVbebmkUN3fa/kQJpQ=="],
|
||||
|
||||
"lightningcss-linux-arm64-musl": ["lightningcss-linux-arm64-musl@1.32.0", "", { "os": "linux", "cpu": "arm64" }, "sha512-UpQkoenr4UJEzgVIYpI80lDFvRmPVg6oqboNHfoH4CQIfNA+HOrZ7Mo7KZP02dC6LjghPQJeBsvXhJod/wnIBg=="],
|
||||
|
||||
"lightningcss-linux-x64-gnu": ["lightningcss-linux-x64-gnu@1.32.0", "", { "os": "linux", "cpu": "x64" }, "sha512-V7Qr52IhZmdKPVr+Vtw8o+WLsQJYCTd8loIfpDaMRWGUZfBOYEJeyJIkqGIDMZPwPx24pUMfwSxxI8phr/MbOA=="],
|
||||
|
||||
"lightningcss-linux-x64-musl": ["lightningcss-linux-x64-musl@1.32.0", "", { "os": "linux", "cpu": "x64" }, "sha512-bYcLp+Vb0awsiXg/80uCRezCYHNg1/l3mt0gzHnWV9XP1W5sKa5/TCdGWaR/zBM2PeF/HbsQv/j2URNOiVuxWg=="],
|
||||
|
||||
"lightningcss-win32-arm64-msvc": ["lightningcss-win32-arm64-msvc@1.32.0", "", { "os": "win32", "cpu": "arm64" }, "sha512-8SbC8BR40pS6baCM8sbtYDSwEVQd4JlFTOlaD3gWGHfThTcABnNDBda6eTZeqbofalIJhFx0qKzgHJmcPTnGdw=="],
|
||||
|
||||
"lightningcss-win32-x64-msvc": ["lightningcss-win32-x64-msvc@1.32.0", "", { "os": "win32", "cpu": "x64" }, "sha512-Amq9B/SoZYdDi1kFrojnoqPLxYhQ4Wo5XiL8EVJrVsB8ARoC1PWW6VGtT0WKCemjy8aC+louJnjS7U18x3b06Q=="],
|
||||
|
||||
"locate-path": ["locate-path@5.0.0", "", { "dependencies": { "p-locate": "^4.1.0" } }, "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g=="],
|
||||
|
||||
"long": ["long@5.3.2", "", {}, "sha512-mNAgZ1GmyNhD7AuqnTG3/VQ26o760+ZYBPKjPvugO8+nLbYfX6TVpJPseBvopbdY+qpZ/lKUnmEc1LeZYS3QAA=="],
|
||||
|
||||
"lru-cache": ["lru-cache@5.1.1", "", { "dependencies": { "yallist": "^3.0.2" } }, "sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w=="],
|
||||
|
||||
"lucide-react": ["lucide-react@0.546.0", "", { "peerDependencies": { "react": "^16.5.1 || ^17.0.0 || ^18.0.0 || ^19.0.0" } }, "sha512-Z94u6fKT43lKeYHiVyvyR8fT7pwCzDu7RyMPpTvh054+xahSgj4HFQ+NmflvzdXsoAjYGdCguGaFKYuvq0ThCQ=="],
|
||||
|
||||
"magic-string": ["magic-string@0.30.21", "", { "dependencies": { "@jridgewell/sourcemap-codec": "^1.5.5" } }, "sha512-vd2F4YUyEXKGcLHoq+TEyCjxueSeHnFxyyjNp80yg0XV4vUhnDer/lvvlqM/arB5bXQN5K2/3oinyCRyx8T2CQ=="],
|
||||
|
||||
"math-intrinsics": ["math-intrinsics@1.1.0", "", {}, "sha512-/IXtbwEk5HTPyEwyKX6hGkYXxM9nbj64B+ilVJnC/R6B0pH5G4V3b0pVbL7DBj4tkhBAppbQUlf6F6Xl9LHu1g=="],
|
||||
|
||||
"media-typer": ["media-typer@0.3.0", "", {}, "sha512-dq+qelQ9akHpcOl/gUVRTxVIOkAJ1wR3QAvb4RsVjS8oVoFjDGTc679wJYmUmknUF5HwMLOgb5O+a3KxfWapPQ=="],
|
||||
|
||||
"merge-descriptors": ["merge-descriptors@1.0.3", "", {}, "sha512-gaNvAS7TZ897/rVaZ0nMtAyxNyi/pdbjbAwUpFQpN70GqnVfOiXpeUUMKRBmzXaSQ8DdTX4/0ms62r2K+hE6mQ=="],
|
||||
|
||||
"methods": ["methods@1.1.2", "", {}, "sha512-iclAHeNqNm68zFtnZ0e+1L2yUIdvzNoauKU4WBA3VvH/vPFieF7qfRlwUZU+DA9P9bPXIS90ulxoUoCH23sV2w=="],
|
||||
|
||||
"mime": ["mime@1.6.0", "", { "bin": { "mime": "cli.js" } }, "sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg=="],
|
||||
|
||||
"mime-db": ["mime-db@1.52.0", "", {}, "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg=="],
|
||||
|
||||
"mime-types": ["mime-types@2.1.35", "", { "dependencies": { "mime-db": "1.52.0" } }, "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw=="],
|
||||
|
||||
"motion": ["motion@12.43.0", "", { "dependencies": { "framer-motion": "^12.43.0", "tslib": "^2.4.0" }, "peerDependencies": { "@emotion/is-prop-valid": "*", "react": "^18.0.0 || ^19.0.0", "react-dom": "^18.0.0 || ^19.0.0" }, "optionalPeers": ["@emotion/is-prop-valid", "react", "react-dom"] }, "sha512-BQgQbSa9Hn3/mtbib0MK53y6JSANa+YKUKlaYnWzAVDH424RYQ5LVpV3pNiWH00BA2z4ojsSdMzqT7g2FQwjuQ=="],
|
||||
|
||||
"motion-dom": ["motion-dom@12.43.0", "", { "dependencies": { "motion-utils": "^12.39.0" } }, "sha512-azKON4d9S65PEoFUiQTMTgPheEmzf2QngdRc50AKfJp9Q9mmcBVw22c8eMq9k8kxOFHdL7+WZY7N/5F/lwiDag=="],
|
||||
|
||||
"motion-utils": ["motion-utils@12.39.0", "", {}, "sha512-8nadJAJjTtqRkmRF36FoJTrywK9nnFmnPwnSMyxaOCU7GDjN9RTMJIxx9De8ErM+vpPhMccr/6fo5WciyQLnMQ=="],
|
||||
|
||||
"ms": ["ms@2.0.0", "", {}, "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A=="],
|
||||
|
||||
"nanoid": ["nanoid@3.3.18", "", { "bin": { "nanoid": "bin/nanoid.cjs" } }, "sha512-DTg4MJbGMWkfi6VZFdNt2/caMbQy4Ou+Op/hJQvGEWcnVfoA1QA+xzRKAzw9jD6+GVOOeYr/mIcuDSdug6F6+w=="],
|
||||
|
||||
"negotiator": ["negotiator@0.6.3", "", {}, "sha512-+EUsqGPLsM+j/zdChZjsnX51g4XrHFOIXwfnCVPGlQk/k5giakcKsuxCObBRu6DSm9opw/O6slWbJdghQM4bBg=="],
|
||||
|
||||
"node-domexception": ["node-domexception@1.0.0", "", {}, "sha512-/jKZoMpw0F8GRwl4/eLROPA3cfcXtLApP0QzLmUT/HuPCZWyB7IY9ZrMeKw2O/nFIqPQB3PVM9aYm0F312AXDQ=="],
|
||||
|
||||
"node-fetch": ["node-fetch@3.3.2", "", { "dependencies": { "data-uri-to-buffer": "^4.0.0", "fetch-blob": "^3.1.4", "formdata-polyfill": "^4.0.10" } }, "sha512-dRB78srN/l6gqWulah9SrxeYnxeddIG30+GOqK/9OlLVyLg3HPnr6SqOWTWOXKRwC2eGYCkZ59NNuSgvSrpgOA=="],
|
||||
|
||||
"node-releases": ["node-releases@2.0.53", "", {}, "sha512-D9UOmYG3UH1V+ENW56t5QXBwJw1YEY18ruVeus89Rw+SyIgjPkCO84bRzO3uNIYosJbNwiabWVn48o3uJLjxFQ=="],
|
||||
|
||||
"object-inspect": ["object-inspect@1.13.4", "", {}, "sha512-W67iLl4J2EXEGTbfeHCffrjDfitvLANg0UlX3wFUUSTx92KXRFegMHUVgSqE+wvhAbi4WqjGg9czysTV2Epbew=="],
|
||||
|
||||
"on-finished": ["on-finished@2.4.1", "", { "dependencies": { "ee-first": "1.1.1" } }, "sha512-oVlzkg3ENAhCk2zdv7IJwd/QUD4z2RxRwpkcGY8psCVcCYZNq4wYnVWALHM+brtuJjePWiYF/ClmuDr8Ch5+kg=="],
|
||||
|
||||
"p-limit": ["p-limit@2.3.0", "", { "dependencies": { "p-try": "^2.0.0" } }, "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w=="],
|
||||
|
||||
"p-locate": ["p-locate@4.1.0", "", { "dependencies": { "p-limit": "^2.2.0" } }, "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A=="],
|
||||
|
||||
"p-retry": ["p-retry@4.6.2", "", { "dependencies": { "@types/retry": "0.12.0", "retry": "^0.13.1" } }, "sha512-312Id396EbJdvRONlngUx0NydfrIQ5lsYu0znKVUzVvArzEIt08V1qhtyESbGVd1FGX7UKtiFp5uwKZdM8wIuQ=="],
|
||||
|
||||
"p-try": ["p-try@2.2.0", "", {}, "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ=="],
|
||||
|
||||
"parseurl": ["parseurl@1.3.3", "", {}, "sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ=="],
|
||||
|
||||
"path-exists": ["path-exists@4.0.0", "", {}, "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w=="],
|
||||
|
||||
"path-to-regexp": ["path-to-regexp@0.1.13", "", {}, "sha512-A/AGNMFN3c8bOlvV9RreMdrv7jsmF9XIfDeCd87+I8RNg6s78BhJxMu69NEMHBSJFxKidViTEdruRwEk/WIKqA=="],
|
||||
|
||||
"picocolors": ["picocolors@1.1.1", "", {}, "sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA=="],
|
||||
|
||||
"picomatch": ["picomatch@4.0.7", "", {}, "sha512-qcJu88Q2IWqJsDD529JKMdwGm/dvInW4HvQnRwiH9JtihJvzGOscDtHE3x1pBKeUOTysQ8kVmLnJ2kJu7yhcGA=="],
|
||||
|
||||
"pngjs": ["pngjs@5.0.0", "", {}, "sha512-40QW5YalBNfQo5yRYmiw7Yz6TKKVr3h6970B2YE+3fQpsWcrbj1PzJgxeJ19DRQjhMbKPIuMY8rFaXc8moolVw=="],
|
||||
|
||||
"postcss": ["postcss@8.5.26", "", { "dependencies": { "nanoid": "^3.3.17", "picocolors": "^1.1.1", "source-map-js": "^1.2.1" } }, "sha512-u82N74LFzG8ca+dD8puPnplTXoGH4fTPpVGuIbt36G3qvNlkvfD0lEAZSxaly3KX8TS/L1A1gsCEmvKmBcVbkQ=="],
|
||||
|
||||
"postcss-value-parser": ["postcss-value-parser@4.2.0", "", {}, "sha512-1NNCs6uurfkVbeXG4S8JFT9t19m45ICnif8zWLd5oPSZ50QnwMfK+H3jv408d4jw/7Bttv5axS5IiHoLaVNHeQ=="],
|
||||
|
||||
"protobufjs": ["protobufjs@7.6.5", "", { "dependencies": { "@protobufjs/aspromise": "^1.1.2", "@protobufjs/base64": "^1.1.2", "@protobufjs/codegen": "^2.0.5", "@protobufjs/eventemitter": "^1.1.1", "@protobufjs/fetch": "^1.1.1", "@protobufjs/float": "^1.0.2", "@protobufjs/path": "^1.1.2", "@protobufjs/pool": "^1.1.0", "@protobufjs/utf8": "^1.1.1", "@types/node": ">=13.7.0", "long": "^5.3.2" } }, "sha512-/FPD0nUc9jH6rfFjji9IBqOz4pcSE3CsT1m7Ep6Mdb0LxSUMj8hgl6GomOvZzpNpAqqGaXA0P3VSrZLFzIhQrw=="],
|
||||
|
||||
"proxy-addr": ["proxy-addr@2.0.7", "", { "dependencies": { "forwarded": "0.2.0", "ipaddr.js": "1.9.1" } }, "sha512-llQsMLSUDUPT44jdrU/O37qlnifitDP+ZwrmmZcoSKyLKvtZxpyV0n2/bD/N4tBAAZ/gJEdZU7KMraoK1+XYAg=="],
|
||||
|
||||
"qrcode": ["qrcode@1.5.4", "", { "dependencies": { "dijkstrajs": "^1.0.1", "pngjs": "^5.0.0", "yargs": "^15.3.1" }, "bin": { "qrcode": "bin/qrcode" } }, "sha512-1ca71Zgiu6ORjHqFBDpnSMTR2ReToX4l1Au1VFLyVeBTFavzQnv5JxMFr3ukHVKpSrSA2MCk0lNJSykjUfz7Zg=="],
|
||||
|
||||
"qs": ["qs@6.15.3", "", { "dependencies": { "es-define-property": "^1.0.1", "side-channel": "^1.1.1" } }, "sha512-O9gl3zCl5h5blw1KGUzQKhA5oUXSl8rwUIM5o0S3nCXMliSvy5Dzx7/DJcI+SwgICv+IneSZwhBh1oSyEHA71A=="],
|
||||
|
||||
"range-parser": ["range-parser@1.2.1", "", {}, "sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg=="],
|
||||
|
||||
"raw-body": ["raw-body@2.5.3", "", { "dependencies": { "bytes": "~3.1.2", "http-errors": "~2.0.1", "iconv-lite": "~0.4.24", "unpipe": "~1.0.0" } }, "sha512-s4VSOf6yN0rvbRZGxs8Om5CWj6seneMwK3oDb4lWDH0UPhWcxwOWw5+qk24bxq87szX1ydrwylIOp2uG1ojUpA=="],
|
||||
|
||||
"react": ["react@19.2.8", "", {}, "sha512-PWaYA1L/q9u2u7xYQi+Y3L3Yfnie7XyLeaJICV1MGD6LprsBxcAqGjYyr0eY3p+QdsA+x/Irkt4Qif8D63+Sbw=="],
|
||||
|
||||
"react-dom": ["react-dom@19.2.8", "", { "dependencies": { "scheduler": "^0.27.0" }, "peerDependencies": { "react": "^19.2.8" } }, "sha512-rVprimfGBG3DR+Tq0IQG2DT5PxKth1WIGDmj5yPmlzr4YBe7uyE+Du4oVqTDXZSHGGGXRtTJEGSSePyQCMBglQ=="],
|
||||
|
||||
"react-refresh": ["react-refresh@0.18.0", "", {}, "sha512-QgT5//D3jfjJb6Gsjxv0Slpj23ip+HtOpnNgnb2S5zU3CB26G/IDPGoy4RJB42wzFE46DRsstbW6tKHoKbhAxw=="],
|
||||
|
||||
"require-directory": ["require-directory@2.1.1", "", {}, "sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q=="],
|
||||
|
||||
"require-main-filename": ["require-main-filename@2.0.0", "", {}, "sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg=="],
|
||||
|
||||
"retry": ["retry@0.13.1", "", {}, "sha512-XQBQ3I8W1Cge0Seh+6gjj03LbmRFWuoszgK9ooCpwYIrhhoO80pfq4cUkU5DkknwfOfFteRwlZ56PYOGYyFWdg=="],
|
||||
|
||||
"rollup": ["rollup@4.63.0", "", { "dependencies": { "@types/estree": "1.0.9" }, "optionalDependencies": { "@napi-rs/lzma-linux-x64-gnu": "1.5.1", "@rollup/rollup-android-arm-eabi": "4.63.0", "@rollup/rollup-android-arm64": "4.63.0", "@rollup/rollup-darwin-arm64": "4.63.0", "@rollup/rollup-darwin-x64": "4.63.0", "@rollup/rollup-freebsd-arm64": "4.63.0", "@rollup/rollup-freebsd-x64": "4.63.0", "@rollup/rollup-linux-arm-gnueabihf": "4.63.0", "@rollup/rollup-linux-arm-musleabihf": "4.63.0", "@rollup/rollup-linux-arm64-gnu": "4.63.0", "@rollup/rollup-linux-arm64-musl": "4.63.0", "@rollup/rollup-linux-loong64-gnu": "4.63.0", "@rollup/rollup-linux-loong64-musl": "4.63.0", "@rollup/rollup-linux-ppc64-gnu": "4.63.0", "@rollup/rollup-linux-ppc64-musl": "4.63.0", "@rollup/rollup-linux-riscv64-gnu": "4.63.0", "@rollup/rollup-linux-riscv64-musl": "4.63.0", "@rollup/rollup-linux-s390x-gnu": "4.63.0", "@rollup/rollup-linux-x64-gnu": "4.63.0", "@rollup/rollup-linux-x64-musl": "4.63.0", "@rollup/rollup-openbsd-x64": "4.63.0", "@rollup/rollup-openharmony-arm64": "4.63.0", "@rollup/rollup-win32-arm64-msvc": "4.63.0", "@rollup/rollup-win32-ia32-msvc": "4.63.0", "@rollup/rollup-win32-x64-gnu": "4.63.0", "@rollup/rollup-win32-x64-msvc": "4.63.0", "fsevents": "~2.3.2" }, "bin": { "rollup": "dist/bin/rollup" } }, "sha512-T5vnZ2y4QqC3/4P+w2+JO+Q/OVdnPsv4XcSYJYMEn0R9/jjl5AgLwO9LAZMzP2lN71O6pypn91rB7lDstUkfrQ=="],
|
||||
|
||||
"safe-buffer": ["safe-buffer@5.2.1", "", {}, "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ=="],
|
||||
|
||||
"safer-buffer": ["safer-buffer@2.1.2", "", {}, "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg=="],
|
||||
|
||||
"scheduler": ["scheduler@0.27.0", "", {}, "sha512-eNv+WrVbKu1f3vbYJT/xtiF5syA5HPIMtf9IgY/nKg0sWqzAUEvqY/xm7OcZc/qafLx/iO9FgOmeSAp4v5ti/Q=="],
|
||||
|
||||
"semver": ["semver@6.3.1", "", { "bin": { "semver": "bin/semver.js" } }, "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA=="],
|
||||
|
||||
"send": ["send@0.19.2", "", { "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" } }, "sha512-VMbMxbDeehAxpOtWJXlcUS5E8iXh6QmN+BkRX1GARS3wRaXEEgzCcB10gTQazO42tpNIya8xIyNx8fll1OFPrg=="],
|
||||
|
||||
"serve-static": ["serve-static@1.16.3", "", { "dependencies": { "encodeurl": "~2.0.0", "escape-html": "~1.0.3", "parseurl": "~1.3.3", "send": "~0.19.1" } }, "sha512-x0RTqQel6g5SY7Lg6ZreMmsOzncHFU7nhnRWkKgWuMTu5NN0DR5oruckMqRvacAN9d5w6ARnRBXl9xhDCgfMeA=="],
|
||||
|
||||
"set-blocking": ["set-blocking@2.0.0", "", {}, "sha512-KiKBS8AnWGEyLzofFfmvKwpdPzqiy16LvQfK3yv/fVH7Bj13/wl3JSR1J+rfgRE9q7xUJK4qvgS8raSOeLUehw=="],
|
||||
|
||||
"setprototypeof": ["setprototypeof@1.2.0", "", {}, "sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw=="],
|
||||
|
||||
"side-channel": ["side-channel@1.1.1", "", { "dependencies": { "es-errors": "^1.3.0", "object-inspect": "^1.13.4", "side-channel-list": "^1.0.1", "side-channel-map": "^1.0.1", "side-channel-weakmap": "^1.0.2" } }, "sha512-6x6dK6zJdpTzF4sQeNYxwtvBzf6Eg4GtlesS94HOvTudUeyK2WXAaIfmDgsyslYrRBeFIlsi54AYsFGUuhmvrQ=="],
|
||||
|
||||
"side-channel-list": ["side-channel-list@1.0.1", "", { "dependencies": { "es-errors": "^1.3.0", "object-inspect": "^1.13.4" } }, "sha512-mjn/0bi/oUURjc5Xl7IaWi/OJJJumuoJFQJfDDyO46+hBWsfaVM65TBHq2eoZBhzl9EchxOijpkbRC8SVBQU0w=="],
|
||||
|
||||
"side-channel-map": ["side-channel-map@1.0.1", "", { "dependencies": { "call-bound": "^1.0.2", "es-errors": "^1.3.0", "get-intrinsic": "^1.2.5", "object-inspect": "^1.13.3" } }, "sha512-VCjCNfgMsby3tTdo02nbjtM/ewra6jPHmpThenkTYh8pG9ucZ/1P8So4u4FGBek/BjpOVsDCMoLA/iuBKIFXRA=="],
|
||||
|
||||
"side-channel-weakmap": ["side-channel-weakmap@1.0.2", "", { "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" } }, "sha512-WPS/HvHQTYnHisLo9McqBHOJk2FkHO/tlpvldyrnem4aeQp4hai3gythswg6p01oSoTl58rcpiFAjF2br2Ak2A=="],
|
||||
|
||||
"source-map-js": ["source-map-js@1.2.1", "", {}, "sha512-UXWMKhLOwVKb728IUtQPXxfYU+usdybtUrK/8uGE8CQMvrhOpwvzDBwj0QhSL7MQc7vIsISBG8VQ8+IDQxpfQA=="],
|
||||
|
||||
"statuses": ["statuses@2.0.2", "", {}, "sha512-DvEy55V3DB7uknRo+4iOGT5fP1slR8wQohVdknigZPMpMstaKJQWhwiYBACJE3Ul2pTnATihhBYnRhZQHGBiRw=="],
|
||||
|
||||
"string-width": ["string-width@4.2.3", "", { "dependencies": { "emoji-regex": "^8.0.0", "is-fullwidth-code-point": "^3.0.0", "strip-ansi": "^6.0.1" } }, "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g=="],
|
||||
|
||||
"strip-ansi": ["strip-ansi@6.0.1", "", { "dependencies": { "ansi-regex": "^5.0.1" } }, "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A=="],
|
||||
|
||||
"tailwindcss": ["tailwindcss@4.3.3", "", {}, "sha512-gOhV3P7ufE62QDGg1zVaTgCR+EtPv92k2nIhVcVKcLmxT1sUBsQGhnZj175j+MqRt4zLF7ic+sCYjfhxMxj7YQ=="],
|
||||
|
||||
"tapable": ["tapable@2.3.3", "", {}, "sha512-uxc/zpqFg6x7C8vOE7lh6Lbda8eEL9zmVm/PLeTPBRhh1xCgdWaQ+J1CUieGpIfm2HdtsUpRv+HshiasBMcc6A=="],
|
||||
|
||||
"tinyglobby": ["tinyglobby@0.2.17", "", { "dependencies": { "fdir": "^6.5.0", "picomatch": "^4.0.4" } }, "sha512-wXR/dYpcqKmfWpEdZjiKJOwCNFndD0DMnrW/cYjVGttEkBfVgcLFHoNrlj47mjOVic9yyNu65alsgF4NQyTa2g=="],
|
||||
|
||||
"toidentifier": ["toidentifier@1.0.1", "", {}, "sha512-o5sSPKEkg/DIQNmH43V0/uerLrpzVedkUh8tGNvaeXpfpuwjKenlSox/2O/BTlZUtEe+JG7s5YhEz608PlAHRA=="],
|
||||
|
||||
"tslib": ["tslib@2.8.1", "", {}, "sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w=="],
|
||||
|
||||
"tsx": ["tsx@4.23.12", "", { "dependencies": { "esbuild": "~0.28.0" }, "optionalDependencies": { "fsevents": "~2.3.3" }, "bin": { "tsx": "dist/cli.mjs" } }, "sha512-FDf4L4sYzKtzWYhU/Xm0AQFdTjdIxNo9ElTf2mxXM6k8YMHXzYUe4yODVaXP4V9uMFbVg8c0qyBccK2OOxb45Q=="],
|
||||
|
||||
"type-is": ["type-is@1.6.18", "", { "dependencies": { "media-typer": "0.3.0", "mime-types": "~2.1.24" } }, "sha512-TkRKr9sUTxEH8MdfuCSP7VizJyzRNMjj2J2do2Jr3Kym598JVdEksuzPQCnlFPW4ky9Q+iA+ma9BGm06XQBy8g=="],
|
||||
|
||||
"typescript": ["typescript@5.8.3", "", { "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver" } }, "sha512-p1diW6TqL9L07nNxvRMM7hMMw4c5XOo/1ibL4aAIGmSAt9slTE1Xgw5KWuof2uTOvCg9BY7ZRi+GaF+7sfgPeQ=="],
|
||||
|
||||
"undici-types": ["undici-types@6.21.0", "", {}, "sha512-iwDZqg0QAGrg9Rav5H4n0M64c3mkR59cJ6wQp+7C4nI0gsmExaedaYLNO44eT4AtBBwjbTiGPMlt2Md0T9H9JQ=="],
|
||||
|
||||
"unpipe": ["unpipe@1.0.0", "", {}, "sha512-pjy2bYhSsufwWlKwPc+l3cN7+wuJlK6uz0YdJEOlQDbl6jo/YlPi4mb8agUkVC8BF7V8NuzeyPNqRksA3hztKQ=="],
|
||||
|
||||
"update-browserslist-db": ["update-browserslist-db@1.3.1", "", { "dependencies": { "escalade": "^3.2.0", "picocolors": "^1.1.1" }, "peerDependencies": { "browserslist": ">= 4.21.0" }, "bin": { "update-browserslist-db": "cli.js" } }, "sha512-ZZ61DsRsOnakl74HAmp3oSN4aXUmEWXf+i/yv0h7tIBfICc3VdrFErQKUUKPgu3AMsTUMbcongALEN4l6GSUrQ=="],
|
||||
|
||||
"utils-merge": ["utils-merge@1.0.1", "", {}, "sha512-pMZTvIkT1d+TFGvDOqodOclx0QWkkgi6Tdoa8gC8ffGAAqz9pzPTZWAybbsHHoED/ztMtkv/VoYTYyShUn81hA=="],
|
||||
|
||||
"vary": ["vary@1.1.2", "", {}, "sha512-BNGbWLfd0eUPabhkXUVm0j8uuvREyTh5ovRa/dyow/BqAbZJyC+5fU+IzQOzmAKzYqYRAISoRhdQr3eIZ/PXqg=="],
|
||||
|
||||
"vite": ["vite@6.4.3", "", { "dependencies": { "esbuild": "^0.25.0", "fdir": "^6.4.4", "picomatch": "^4.0.2", "postcss": "^8.5.3", "rollup": "^4.34.9", "tinyglobby": "^0.2.13" }, "optionalDependencies": { "fsevents": "~2.3.3" }, "peerDependencies": { "@types/node": "^18.0.0 || ^20.0.0 || >=22.0.0", "jiti": ">=1.21.0", "less": "*", "lightningcss": "^1.21.0", "sass": "*", "sass-embedded": "*", "stylus": "*", "sugarss": "*", "terser": "^5.16.0", "tsx": "^4.8.1", "yaml": "^2.4.2" }, "optionalPeers": ["@types/node", "jiti", "less", "lightningcss", "sass", "sass-embedded", "stylus", "sugarss", "terser", "tsx", "yaml"], "bin": { "vite": "bin/vite.js" } }, "sha512-NTKlcQjlAK7MlQoyb6LgaqHc8sso/pVyUJYWMws3jg21uTJw/LddqIFPcPqP6PzpgbIcZyKI85sFE4HBrQDA8A=="],
|
||||
|
||||
"web-streams-polyfill": ["web-streams-polyfill@3.3.3", "", {}, "sha512-d2JWLCivmZYTSIoge9MsgFCZrt571BikcWGYkjC1khllbTeDlGqZ2D8vD8E/lJa8WGWbb7Plm8/XJYV7IJHZZw=="],
|
||||
|
||||
"which-module": ["which-module@2.0.1", "", {}, "sha512-iBdZ57RDvnOR9AGBhML2vFZf7h8vmBjhoaZqODJBFWHVtKkDmKuHai3cx5PgVMrX5YDNp27AofYbAwctSS+vhQ=="],
|
||||
|
||||
"wrap-ansi": ["wrap-ansi@6.2.0", "", { "dependencies": { "ansi-styles": "^4.0.0", "string-width": "^4.1.0", "strip-ansi": "^6.0.0" } }, "sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA=="],
|
||||
|
||||
"ws": ["ws@8.21.3", "", { "peerDependencies": { "bufferutil": "^4.0.1", "utf-8-validate": ">=5.0.2" }, "optionalPeers": ["bufferutil", "utf-8-validate"] }, "sha512-201TZ/kPWxoPr/OKWjquZR1SWKXcvxdH+e1xrx89b3YbmzLMFCLfnaG1HFIgWzJOEWZ7MvpK++odZufgYR50Rw=="],
|
||||
|
||||
"y18n": ["y18n@4.0.3", "", {}, "sha512-JKhqTOwSrqNA1NY5lSztJ1GrBiUodLMmIZuLiDaMRJ+itFd+ABVE8XBjOvIWL+rSqNDC74LCSFmlb/U4UZ4hJQ=="],
|
||||
|
||||
"yallist": ["yallist@3.1.1", "", {}, "sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g=="],
|
||||
|
||||
"yargs": ["yargs@15.4.1", "", { "dependencies": { "cliui": "^6.0.0", "decamelize": "^1.2.0", "find-up": "^4.1.0", "get-caller-file": "^2.0.1", "require-directory": "^2.1.1", "require-main-filename": "^2.0.0", "set-blocking": "^2.0.0", "string-width": "^4.2.0", "which-module": "^2.0.0", "y18n": "^4.0.0", "yargs-parser": "^18.1.2" } }, "sha512-aePbxDmcYW++PaqBsJ+HYUFwCdv4LVvdnhBy78E57PIor8/OVvhMrADFFEDh8DHDFRv/O9i3lPhsENjO7QX0+A=="],
|
||||
|
||||
"yargs-parser": ["yargs-parser@18.1.3", "", { "dependencies": { "camelcase": "^5.0.0", "decamelize": "^1.2.0" } }, "sha512-o50j0JeToy/4K6OZcaQmW6lyXXKhq7csREXcDwk2omFPJEwUNOVtJKvmDr9EI1fAJZUyZcRF7kxGBWmRXudrCQ=="],
|
||||
|
||||
"@babel/core/debug": ["debug@4.4.3", "", { "dependencies": { "ms": "^2.1.3" }, "peerDependencies": { "supports-color": "*" }, "optionalPeers": ["supports-color"] }, "sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA=="],
|
||||
|
||||
"@babel/traverse/debug": ["debug@4.4.3", "", { "dependencies": { "ms": "^2.1.3" }, "peerDependencies": { "supports-color": "*" }, "optionalPeers": ["supports-color"] }, "sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA=="],
|
||||
|
||||
"@tailwindcss/oxide-wasm32-wasi/@emnapi/core": ["@emnapi/core@1.11.3", "", { "dependencies": { "@emnapi/wasi-threads": "1.2.3", "tslib": "^2.4.0" }, "bundled": true }, "sha512-zLpS5asjEb7lq8jYLq37N6XKaE41DIexlY1rF/z4/tIl3wo13Sqm28fRyfIsKZD+NZ8mM5RoKkpW/rBcuoSZSg=="],
|
||||
|
||||
"@tailwindcss/oxide-wasm32-wasi/@emnapi/runtime": ["@emnapi/runtime@1.11.3", "", { "dependencies": { "tslib": "^2.4.0" }, "bundled": true }, "sha512-Xz4Tpyki7XyrpbUK1jR1AhdAdaXyhhY4lZ3neLodmhpuWfy2PAQN5B46sAiU4liOXGLkHypn/qU+jvfWSCYYLA=="],
|
||||
|
||||
"@tailwindcss/oxide-wasm32-wasi/@emnapi/wasi-threads": ["@emnapi/wasi-threads@1.2.3", "", { "dependencies": { "tslib": "^2.4.0" }, "bundled": true }, "sha512-ELEBe8PsLvvJ6QMr0zLt8ffvOHW/dc1m3CEzNMg7aJUv3bMaoDtw2TXyDAwkYBuroxxuHEwhRTLJSe5sya547g=="],
|
||||
|
||||
"@tailwindcss/oxide-wasm32-wasi/@napi-rs/wasm-runtime": ["@napi-rs/wasm-runtime@1.2.3", "", { "dependencies": { "@tybys/wasm-util": "^0.10.3" }, "peerDependencies": { "@emnapi/core": "^1.7.1 || ^2.0.0-alpha.4", "@emnapi/runtime": "^1.7.1 || ^2.0.0-alpha.4" }, "bundled": true }, "sha512-UMduMbqO5s5zF2NkNacMT/yK5Y5QiKvWr2+50bzIIxFDwVJ2h49b+oyjaCGPhJxd2/gC2x39EHv/gHVuu36x2Q=="],
|
||||
|
||||
"@tailwindcss/oxide-wasm32-wasi/@tybys/wasm-util": ["@tybys/wasm-util@0.10.3", "", { "dependencies": { "tslib": "^2.4.0" }, "bundled": true }, "sha512-F3fo1MYrRJYL3zER0OUOmkutjr1Vp23m7OsSgp7nq4SP6OqX6C/56XFIPAl5bt3zaBRjmW7SGz3u/6LwFpYcOg=="],
|
||||
|
||||
"@tailwindcss/oxide-wasm32-wasi/tslib": ["tslib@2.8.1", "", { "bundled": true }, "sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w=="],
|
||||
|
||||
"@types/body-parser/@types/node": ["@types/node@26.4.0", "", { "dependencies": { "undici-types": "~8.3.0" } }, "sha512-faiGnoIrLH/V8cibOMEAZ8pMw6oXqSukl29ra4mN8GdaB2ZewzeaLj+INpV5N+Z1eKWzY+IzaIZH2EIR6YZRNQ=="],
|
||||
|
||||
"@types/connect/@types/node": ["@types/node@26.4.0", "", { "dependencies": { "undici-types": "~8.3.0" } }, "sha512-faiGnoIrLH/V8cibOMEAZ8pMw6oXqSukl29ra4mN8GdaB2ZewzeaLj+INpV5N+Z1eKWzY+IzaIZH2EIR6YZRNQ=="],
|
||||
|
||||
"@types/express-serve-static-core/@types/node": ["@types/node@26.4.0", "", { "dependencies": { "undici-types": "~8.3.0" } }, "sha512-faiGnoIrLH/V8cibOMEAZ8pMw6oXqSukl29ra4mN8GdaB2ZewzeaLj+INpV5N+Z1eKWzY+IzaIZH2EIR6YZRNQ=="],
|
||||
|
||||
"@types/qrcode/@types/node": ["@types/node@26.4.0", "", { "dependencies": { "undici-types": "~8.3.0" } }, "sha512-faiGnoIrLH/V8cibOMEAZ8pMw6oXqSukl29ra4mN8GdaB2ZewzeaLj+INpV5N+Z1eKWzY+IzaIZH2EIR6YZRNQ=="],
|
||||
|
||||
"@types/send/@types/node": ["@types/node@26.4.0", "", { "dependencies": { "undici-types": "~8.3.0" } }, "sha512-faiGnoIrLH/V8cibOMEAZ8pMw6oXqSukl29ra4mN8GdaB2ZewzeaLj+INpV5N+Z1eKWzY+IzaIZH2EIR6YZRNQ=="],
|
||||
|
||||
"@types/serve-static/@types/node": ["@types/node@26.4.0", "", { "dependencies": { "undici-types": "~8.3.0" } }, "sha512-faiGnoIrLH/V8cibOMEAZ8pMw6oXqSukl29ra4mN8GdaB2ZewzeaLj+INpV5N+Z1eKWzY+IzaIZH2EIR6YZRNQ=="],
|
||||
|
||||
"@types/serve-static/@types/send": ["@types/send@0.17.6", "", { "dependencies": { "@types/mime": "^1", "@types/node": "*" } }, "sha512-Uqt8rPBE8SY0RK8JB1EzVOIZ32uqy8HwdxCnoCOsYrvnswqmFZ/k+9Ikidlk/ImhsdvBsloHbAlewb2IEBV/Og=="],
|
||||
|
||||
"@types/ws/@types/node": ["@types/node@26.4.0", "", { "dependencies": { "undici-types": "~8.3.0" } }, "sha512-faiGnoIrLH/V8cibOMEAZ8pMw6oXqSukl29ra4mN8GdaB2ZewzeaLj+INpV5N+Z1eKWzY+IzaIZH2EIR6YZRNQ=="],
|
||||
|
||||
"https-proxy-agent/debug": ["debug@4.4.3", "", { "dependencies": { "ms": "^2.1.3" }, "peerDependencies": { "supports-color": "*" }, "optionalPeers": ["supports-color"] }, "sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA=="],
|
||||
|
||||
"protobufjs/@types/node": ["@types/node@26.4.0", "", { "dependencies": { "undici-types": "~8.3.0" } }, "sha512-faiGnoIrLH/V8cibOMEAZ8pMw6oXqSukl29ra4mN8GdaB2ZewzeaLj+INpV5N+Z1eKWzY+IzaIZH2EIR6YZRNQ=="],
|
||||
|
||||
"send/ms": ["ms@2.1.3", "", {}, "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA=="],
|
||||
|
||||
"tsx/esbuild": ["esbuild@0.28.2", "", { "optionalDependencies": { "@esbuild/aix-ppc64": "0.28.2", "@esbuild/android-arm": "0.28.2", "@esbuild/android-arm64": "0.28.2", "@esbuild/android-x64": "0.28.2", "@esbuild/darwin-arm64": "0.28.2", "@esbuild/darwin-x64": "0.28.2", "@esbuild/freebsd-arm64": "0.28.2", "@esbuild/freebsd-x64": "0.28.2", "@esbuild/linux-arm": "0.28.2", "@esbuild/linux-arm64": "0.28.2", "@esbuild/linux-ia32": "0.28.2", "@esbuild/linux-loong64": "0.28.2", "@esbuild/linux-mips64el": "0.28.2", "@esbuild/linux-ppc64": "0.28.2", "@esbuild/linux-riscv64": "0.28.2", "@esbuild/linux-s390x": "0.28.2", "@esbuild/linux-x64": "0.28.2", "@esbuild/netbsd-arm64": "0.28.2", "@esbuild/netbsd-x64": "0.28.2", "@esbuild/openbsd-arm64": "0.28.2", "@esbuild/openbsd-x64": "0.28.2", "@esbuild/openharmony-arm64": "0.28.2", "@esbuild/sunos-x64": "0.28.2", "@esbuild/win32-arm64": "0.28.2", "@esbuild/win32-ia32": "0.28.2", "@esbuild/win32-x64": "0.28.2" }, "bin": { "esbuild": "bin/esbuild" } }, "sha512-HKVLS8dvII+xoKW9kmqxbRKrnWEXfJJr/FZhhJmiqIB0e053QNYFqOBouTMO/k5sID4MvCiUCvv8b9M4h32wIA=="],
|
||||
|
||||
"@babel/core/debug/ms": ["ms@2.1.3", "", {}, "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA=="],
|
||||
|
||||
"@babel/traverse/debug/ms": ["ms@2.1.3", "", {}, "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA=="],
|
||||
|
||||
"@types/body-parser/@types/node/undici-types": ["undici-types@8.3.0", "", {}, "sha512-j375ScV60dom+YkPFIfTLcOiPxkN/buHz5GobjLhixFuANaNs3C9l4GmrWqejgXWJ7BbJcFYpTEUkS1Ge8bpZQ=="],
|
||||
|
||||
"@types/connect/@types/node/undici-types": ["undici-types@8.3.0", "", {}, "sha512-j375ScV60dom+YkPFIfTLcOiPxkN/buHz5GobjLhixFuANaNs3C9l4GmrWqejgXWJ7BbJcFYpTEUkS1Ge8bpZQ=="],
|
||||
|
||||
"@types/express-serve-static-core/@types/node/undici-types": ["undici-types@8.3.0", "", {}, "sha512-j375ScV60dom+YkPFIfTLcOiPxkN/buHz5GobjLhixFuANaNs3C9l4GmrWqejgXWJ7BbJcFYpTEUkS1Ge8bpZQ=="],
|
||||
|
||||
"@types/qrcode/@types/node/undici-types": ["undici-types@8.3.0", "", {}, "sha512-j375ScV60dom+YkPFIfTLcOiPxkN/buHz5GobjLhixFuANaNs3C9l4GmrWqejgXWJ7BbJcFYpTEUkS1Ge8bpZQ=="],
|
||||
|
||||
"@types/send/@types/node/undici-types": ["undici-types@8.3.0", "", {}, "sha512-j375ScV60dom+YkPFIfTLcOiPxkN/buHz5GobjLhixFuANaNs3C9l4GmrWqejgXWJ7BbJcFYpTEUkS1Ge8bpZQ=="],
|
||||
|
||||
"@types/serve-static/@types/node/undici-types": ["undici-types@8.3.0", "", {}, "sha512-j375ScV60dom+YkPFIfTLcOiPxkN/buHz5GobjLhixFuANaNs3C9l4GmrWqejgXWJ7BbJcFYpTEUkS1Ge8bpZQ=="],
|
||||
|
||||
"@types/ws/@types/node/undici-types": ["undici-types@8.3.0", "", {}, "sha512-j375ScV60dom+YkPFIfTLcOiPxkN/buHz5GobjLhixFuANaNs3C9l4GmrWqejgXWJ7BbJcFYpTEUkS1Ge8bpZQ=="],
|
||||
|
||||
"https-proxy-agent/debug/ms": ["ms@2.1.3", "", {}, "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA=="],
|
||||
|
||||
"protobufjs/@types/node/undici-types": ["undici-types@8.3.0", "", {}, "sha512-j375ScV60dom+YkPFIfTLcOiPxkN/buHz5GobjLhixFuANaNs3C9l4GmrWqejgXWJ7BbJcFYpTEUkS1Ge8bpZQ=="],
|
||||
|
||||
"tsx/esbuild/@esbuild/aix-ppc64": ["@esbuild/aix-ppc64@0.28.2", "", { "os": "aix", "cpu": "ppc64" }, "sha512-XExcO+dvLKvVtNTibSTBej1NCAbaGhWn9Ww1ZPx80qsahhPFe/8jgWP0IchNe0F3HwkU7n8ejhH8bjonqht8mQ=="],
|
||||
|
||||
"tsx/esbuild/@esbuild/android-arm": ["@esbuild/android-arm@0.28.2", "", { "os": "android", "cpu": "arm" }, "sha512-kXXoiPVVGQcnIYGOeaovwOURpniDBpSq4A03qkQ+BMQqtGG6HYap3xne9C1O1yo4TR3qxlCX5IqqmX6fFo2Lqg=="],
|
||||
|
||||
"tsx/esbuild/@esbuild/android-arm64": ["@esbuild/android-arm64@0.28.2", "", { "os": "android", "cpu": "arm64" }, "sha512-5YfKeeI8qWfBZIX+u2xZC3Zlb3Os/gLS2sbEKM+I4ZOcsWmHS2WLysCcQZDAFRslDUU5Oiq44gf6PYN1vGwG5A=="],
|
||||
|
||||
"tsx/esbuild/@esbuild/android-x64": ["@esbuild/android-x64@0.28.2", "", { "os": "android", "cpu": "x64" }, "sha512-O387ite7SzUyCcy3JQX4P4bLtEA7bLLkx+esve5JHnyYfNTxcVpXZo9jhdB0lTKN44gztELTdU7nS8Nr16Fs1Q=="],
|
||||
|
||||
"tsx/esbuild/@esbuild/darwin-arm64": ["@esbuild/darwin-arm64@0.28.2", "", { "os": "darwin", "cpu": "arm64" }, "sha512-n4KqkOQrraxHJcgjM1RvwbigfQKIKJVpM7xp+KsxiyUSrRdIXnt73VhrPAx0fV44hgfmIVKjxMN9J1t5jySVkw=="],
|
||||
|
||||
"tsx/esbuild/@esbuild/darwin-x64": ["@esbuild/darwin-x64@0.28.2", "", { "os": "darwin", "cpu": "x64" }, "sha512-uq6suIWYP37qzGddBKPw5QEQPi6HiLGsO7UmkpfyaYNQ3D+rN6w6WfwH+nuqcGXWvawGwxOEroO4YGnFh95azw=="],
|
||||
|
||||
"tsx/esbuild/@esbuild/freebsd-arm64": ["@esbuild/freebsd-arm64@0.28.2", "", { "os": "freebsd", "cpu": "arm64" }, "sha512-n+I0BTSRIoy+d6RPKnEVwql5UwBJolytvY4mAOIEJorKlqgPII8ix6slVVrfZ5Tnj7glIZvloylbB/EJPMWEXw=="],
|
||||
|
||||
"tsx/esbuild/@esbuild/freebsd-x64": ["@esbuild/freebsd-x64@0.28.2", "", { "os": "freebsd", "cpu": "x64" }, "sha512-78XJTJkvPs0kz2w61301PJjXl4g7q3JqiYMZ/M/yVI73EHBrCRTgkhu9oqG7vPqq+a/yadEW8aD+agKlk5xrmg=="],
|
||||
|
||||
"tsx/esbuild/@esbuild/linux-arm": ["@esbuild/linux-arm@0.28.2", "", { "os": "linux", "cpu": "arm" }, "sha512-XlDnu2q5yoqems+xay6wSAcg9DDD7K9RLKZEBOMZm3ckNpJBvOX20tSfby8KfrrhINDyv9V2YVZKY/SpoGJI8w=="],
|
||||
|
||||
"tsx/esbuild/@esbuild/linux-arm64": ["@esbuild/linux-arm64@0.28.2", "", { "os": "linux", "cpu": "arm64" }, "sha512-pW4AC0P3it8c7do9MVM4p51FzHzdM/TZrerurgRcHJ2WTa1VQ1CIq18xncfpBJw4ojkiZZrKW2yIBWBP92j6Ug=="],
|
||||
|
||||
"tsx/esbuild/@esbuild/linux-ia32": ["@esbuild/linux-ia32@0.28.2", "", { "os": "linux", "cpu": "ia32" }, "sha512-CYbnj78HsIeA+DhgUKgFCfvNsTHFhMMrinUrMZpDXJXKN8T3XViTZ/+wtHeVxEWY8ewSzTFN+nRmSwO2tZaLUQ=="],
|
||||
|
||||
"tsx/esbuild/@esbuild/linux-loong64": ["@esbuild/linux-loong64@0.28.2", "", { "os": "linux", "cpu": "none" }, "sha512-buwkd8nsph4R+ajRvw0qM5Hja/TXQow3ptzWO2EbG/cqcIkHloRrdlBtQlshyYGTNFvfkfJ5tpPLVkY4DtsPfQ=="],
|
||||
|
||||
"tsx/esbuild/@esbuild/linux-mips64el": ["@esbuild/linux-mips64el@0.28.2", "", { "os": "linux", "cpu": "none" }, "sha512-ZVykbDyk7519VwiNb9Lcj9m8XM6v5V9uKPvrEMkkEedVewf+0itkhahp4HDpgERXhwLRpWFypsGbG/J8s0QjJA=="],
|
||||
|
||||
"tsx/esbuild/@esbuild/linux-ppc64": ["@esbuild/linux-ppc64@0.28.2", "", { "os": "linux", "cpu": "ppc64" }, "sha512-CAXl+Dtd9UUuJd8pKKdwh6MLm3MUMiqMPmhZ3tTSXPqfyQ3vDl6R5hZdZ/kYojK4ofXtdfSv1tFq8XzWx3heNQ=="],
|
||||
|
||||
"tsx/esbuild/@esbuild/linux-riscv64": ["@esbuild/linux-riscv64@0.28.2", "", { "os": "linux", "cpu": "none" }, "sha512-GeXCej4IQtU1B+QlDV8W/RRvbzI3O/Stss+/bCXv4lZls5WGRtu2a+3JkA3i4qIUlMXpcHebWpF8AkJhATowuA=="],
|
||||
|
||||
"tsx/esbuild/@esbuild/linux-s390x": ["@esbuild/linux-s390x@0.28.2", "", { "os": "linux", "cpu": "s390x" }, "sha512-3H1weTYZPxt/WOhByszQZybS9w5lKzUn1FDMsgEChbHWQwHYQQRfBxgCcZvPhjHfKyJjIievvMmEUawJrdY9Dg=="],
|
||||
|
||||
"tsx/esbuild/@esbuild/linux-x64": ["@esbuild/linux-x64@0.28.2", "", { "os": "linux", "cpu": "x64" }, "sha512-4xTZr1FUmSoQW4XIWmit3tzQrUTZM+N3P0XV8xROKYF50XfI7xeO90+1bZvNwxIufQ9hDQVRJH5YhgPVF8A/HQ=="],
|
||||
|
||||
"tsx/esbuild/@esbuild/netbsd-arm64": ["@esbuild/netbsd-arm64@0.28.2", "", { "os": "none", "cpu": "arm64" }, "sha512-sSATRjPeDBg3pdgHoQfoYBob11Kk1FGa9lui5RIHZCoCkJa9QKlvl3/vKz2usCmYYjs7ymJR/2Nnsqe+Hjt5nw=="],
|
||||
|
||||
"tsx/esbuild/@esbuild/netbsd-x64": ["@esbuild/netbsd-x64@0.28.2", "", { "os": "none", "cpu": "x64" }, "sha512-lqnzCV+mM0gIADaKihiCg6ifgfU2L3h5E33rNQBN1Y4MaVGnzryzmvvf7UHxprpQdE8hpqLolJ9Rl+SkIRDpyw=="],
|
||||
|
||||
"tsx/esbuild/@esbuild/openbsd-arm64": ["@esbuild/openbsd-arm64@0.28.2", "", { "os": "openbsd", "cpu": "arm64" }, "sha512-AL2qJILH7lNjrDmCQDvdxMfAUIv8KMNZOvrwAQ8i8//ntL9FflhOyMJ8OZSMBb8/AWXe3/5v5S20y3zCoZWKoQ=="],
|
||||
|
||||
"tsx/esbuild/@esbuild/openbsd-x64": ["@esbuild/openbsd-x64@0.28.2", "", { "os": "openbsd", "cpu": "x64" }, "sha512-QtiuPytchRyC4rwUKhexJdQKvDuZ6hWloi3igqPQNUJCS1/v9EiO3UTOXR6A3FoMo4fnAKbWJdqaIwhOzh8qEw=="],
|
||||
|
||||
"tsx/esbuild/@esbuild/openharmony-arm64": ["@esbuild/openharmony-arm64@0.28.2", "", { "os": "none", "cpu": "arm64" }, "sha512-WkhYDmpTjLvGlScA1rwjRUmhl4k8oXR3cIbtqWmELgU/dFeHHlEllxDvdWcNJV9rbzCexB5vz8gtNewWLgCT7Q=="],
|
||||
|
||||
"tsx/esbuild/@esbuild/sunos-x64": ["@esbuild/sunos-x64@0.28.2", "", { "os": "sunos", "cpu": "x64" }, "sha512-GPMSkTOtMnv2U2F8gxe4Io6qmVs+YKyp832Etqqxr0hFngmXQ3rzwytelm3GIn7T4VviRUlf3sOgBOiTdvaf7g=="],
|
||||
|
||||
"tsx/esbuild/@esbuild/win32-arm64": ["@esbuild/win32-arm64@0.28.2", "", { "os": "win32", "cpu": "arm64" }, "sha512-PIhhEkE9uPBleRBrQEJpUn7MBnibZzbGzYWPmY3x+YoVg/95zbjB4CxPPOQ8l5tYYM4mMaCthF8/1DIfBQQyWQ=="],
|
||||
|
||||
"tsx/esbuild/@esbuild/win32-ia32": ["@esbuild/win32-ia32@0.28.2", "", { "os": "win32", "cpu": "ia32" }, "sha512-YmJbfTlvU7Sdn9BB+4PRES4oB6pxgS37MAONj+hBr/cpXS1aBPKXxNnDbu+QCWPj0o9dgyxeq79g6c5P8KeuYA=="],
|
||||
|
||||
"tsx/esbuild/@esbuild/win32-x64": ["@esbuild/win32-x64@0.28.2", "", { "os": "win32", "cpu": "x64" }, "sha512-5ebpxr3nWMzrL/rnUI755Jkuee0bHL/Gq0WTF9lvcpv73wAp5eu8MfBUgWK9bhWvZjj7yX8etf/8tI8Ney695g=="],
|
||||
}
|
||||
}
|
||||
+143
@@ -0,0 +1,143 @@
|
||||
# API — Wedding Hub & Live Screen
|
||||
|
||||
Все маршруты находятся на одном Express-сервере (`server.ts`, порт 3000). Тела запросов — JSON, лимит 50 МБ. Ошибки возвращаются как `{ "error": "текст" }` с HTTP 400/404/500.
|
||||
|
||||
Базовый путь — `/api`. Аутентификации нет (см. раздел «Безопасность» в README).
|
||||
|
||||
---
|
||||
|
||||
## Гости и состояние
|
||||
|
||||
### `GET /api/health`
|
||||
Проверка работоспособности. Ответ: `{ "status": "ok", "time": <ms> }`.
|
||||
|
||||
### `POST /api/auth`
|
||||
Регистрация или вход гостя по билету.
|
||||
|
||||
Тело: `{ "ticket_id": string, "guest_name": string, "team_id"?: string, "team_name"?: string, "role"?: UserRole }`
|
||||
|
||||
- `ticket_id` приводится к верхнему регистру и обрезается по пробелам.
|
||||
- Ответ: `{ "success": true, "guest": Guest, "stats": AggregatedStats }`.
|
||||
- Рассылает `STATE_SYNC`.
|
||||
|
||||
### `GET /api/guest/:ticketId`
|
||||
Профиль гостя и его показатели.
|
||||
|
||||
Ответ: `{ guest, myPoints, myKissesCount, myToastsCount, myDrinksCount, stats }`. Если гость не найден — 404.
|
||||
|
||||
### `GET /api/state`
|
||||
Агрегированное состояние для экранов и гостей: статистика, фото (до 50), последние тосты (до 20), раунд, публичные настройки.
|
||||
|
||||
Поле `settings` содержит `couples_names`, `cake_time_target`, `immich_url`, `immich_album_id`, `immich_album_name`, `ollama_url`. API-ключи не возвращаются.
|
||||
|
||||
### `GET /api/photos`
|
||||
Список фото: `{ photos, total, immich_url, immich_album_id, immich_album_name }`.
|
||||
|
||||
---
|
||||
|
||||
## Игра «Охота за поцелуем»
|
||||
|
||||
### `POST /api/kiss/catch`
|
||||
Гость фиксирует поцелуй.
|
||||
|
||||
Тело: `{ "ticket_id": string }`
|
||||
|
||||
- Если раунд не активен, первый поймавший открывает раунд: результат `is_golden: true`, рассылается `KISS_ROUND_START`, очки 3.
|
||||
- В окне раунда (5,2 с) остальные получают 1 очко и рассылается `KISS_CATCH`.
|
||||
- Ответ: `{ success, points, is_golden, round_id, guest, catcher_info? }`; при ошибке `success: false` и `reason`.
|
||||
|
||||
---
|
||||
|
||||
## Фото тостов (квесты с бокалом)
|
||||
|
||||
### `POST /api/toast/upload`
|
||||
Загрузка фото бокала с заданием.
|
||||
|
||||
Тело:
|
||||
```json
|
||||
{
|
||||
"ticket_id": "LUCK-001",
|
||||
"image_base64": "data:image/jpeg;base64,...",
|
||||
"caption": "необязательно",
|
||||
"quest_id": "…", "quest_title": "…", "quest_instruction": "…",
|
||||
"filename": "IMG_0001.jpg", "file_type": "image/jpeg", "file_created_at": "ISO-дата"
|
||||
}
|
||||
```
|
||||
|
||||
- `ticket_id` и `image_base64` обязательны, иначе 400.
|
||||
- Ответ отправляется сразу. Сохранение в Immich и проверка VLM выполняются асинхронно.
|
||||
- Проверка: `verifyToastPhoto` в `server/vlm.ts`. Порядок: Gemini → Ollama → эвристика. Одновременно выполняется не более двух запросов.
|
||||
- По результату рассылается `TOAST_CONFIRMED` (подтверждённый тост, +10 очков).
|
||||
|
||||
---
|
||||
|
||||
## Фото гостей
|
||||
|
||||
### `POST /api/photos/upload`
|
||||
Фото в галерею.
|
||||
|
||||
Тело: `{ "image_base64": string, "ticket_id"?: string, "caption"?: string, "filename"?: string, "file_type"?: string, "file_created_at"?: string }`
|
||||
|
||||
Фото сохраняется в оригинальном качестве в `data/uploads/` и, если настроен Immich, в альбом. Ответ содержит результат `saveAndSyncPhoto`: `url`, `syncedToImmich`, `albumSynced`, `error`.
|
||||
|
||||
---
|
||||
|
||||
## Администрирование (`/api/admin/*`)
|
||||
|
||||
Все маршруты без авторизации. Ограничивайте доступ сетью.
|
||||
|
||||
| Метод и путь | Тело | Что делает |
|
||||
|---|---|---|
|
||||
| `GET /admin/immich/albums` | — | Список альбомов Immich по настройкам из состояния. |
|
||||
| `POST /admin/immich/create-album` | `{ album_name, description? }` | Создаёт альбом и сохраняет его как текущий. |
|
||||
| `POST /admin/immich/test` | `{ immich_url, immich_api_key }` | Проверка подключения: `{ success, message }`. |
|
||||
| `POST /admin/kiss-trigger` | `{ round_id?, start_time? }` | Принудительно запускает раунд поцелуев. Рассылает `KISS_ROUND_START`. |
|
||||
| `POST /admin/settings` | Любые поля настроек, включая `cake_time_exact_str` (`"HH:MM"`) | Обновляет настройки, рассылает `SETTINGS_UPDATED`. |
|
||||
| `POST /admin/guest-create` | `{ ticket_id, guest_name, team_id?, team_name?, role? }` | Создаёт гостя. |
|
||||
| `POST /admin/user-update` | `{ ticket_id, role?, team_id?, team_name?, bonus_points? }` | Меняет роль и команду. `bonus_points > 0` добавляет ручное начисление (`round_id: 999`). |
|
||||
| `POST /admin/guest-delete` | `{ ticket_id }` | Удаляет гостя. |
|
||||
| `POST /admin/guest-batch-delete` | `{ ticket_ids: string[] }` | Удаляет группу гостей. |
|
||||
| `POST /admin/reset` | — | Полная очистка данных (без подтверждения). |
|
||||
| `POST /admin/seed` | — | Загружает демо-данные. |
|
||||
|
||||
Пример:
|
||||
```bash
|
||||
curl -X POST http://localhost:3000/api/admin/settings \
|
||||
-H 'Content-Type: application/json' \
|
||||
-d '{"couples_names":"Анна & Дмитрий","cake_time_exact_str":"22:30"}'
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## Загрузка файлов
|
||||
|
||||
Файлы раздаются статически по `/api/uploads/<имя>` из `data/uploads/`.
|
||||
|
||||
---
|
||||
|
||||
## WebSocket
|
||||
|
||||
Адрес: `ws://<host>:3000/ws`. Каждое сообщение от сервера — JSON:
|
||||
|
||||
```json
|
||||
{ "event": "EVENT_NAME", "data": { … }, "timestamp": 1730000000000 }
|
||||
```
|
||||
|
||||
| Событие | Когда | Данные |
|
||||
|---|---|---|
|
||||
| `STATE_SYNC` | Подключение клиента, изменения состояния, окончание кулдауна | `AggregatedStats` |
|
||||
| `KISS_ROUND_START` | Старт раунда (поймал первый или админ) | `round_id`, `first_catcher`, `points`, `stats` |
|
||||
| `KISS_CATCH` | Дополнительный поцелуй в окне раунда | `round_id`, `guest`, `points`, `stats` |
|
||||
| `KISS_ROUND_END` | Окно 5,2 с закрыто | `cooldown_until`, `stats` |
|
||||
| `TOAST_CONFIRMED` | Тост подтверждён проверкой | `toast` (запись тоста), `photo_url`, `stats` |
|
||||
| `SETTINGS_UPDATED` | Изменены настройки | `AggregatedStats` |
|
||||
|
||||
Клиент может отправить `{ "type": "PING" }` и получить `{ "type": "PONG" }`.
|
||||
|
||||
Таймер раундов работает на сервере: раз в 500 мс проверяется окончание раунда и кулдауна.
|
||||
|
||||
---
|
||||
|
||||
## Типы
|
||||
|
||||
Полные определения — в `src/types.ts`: `Guest`, `KissCatch`, `ToastLog`, `WeddingPhoto`, `AggregatedStats`, `AppState` (серверная модель в `server/db.ts`).
|
||||
+20
@@ -0,0 +1,20 @@
|
||||
<!doctype html>
|
||||
<html lang="ru">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
|
||||
<meta name="theme-color" content="#0a0a0a" />
|
||||
<meta name="apple-mobile-web-app-capable" content="yes" />
|
||||
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent" />
|
||||
<link rel="preconnect" href="https://fonts.googleapis.com">
|
||||
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
|
||||
<link href="https://fonts.googleapis.com/css2?family=Cinzel:wght@500;700;900&family=Playfair+Display:ital,wght@0,600;0,800;1,600;1,800&family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap" rel="stylesheet">
|
||||
<title>Свадебный Хаб | Wedding Hub & Live Screen</title>
|
||||
<meta name="description" content="Интерактивный свадебный хаб для гостей и Live-дашборд для проектора в зале." />
|
||||
</head>
|
||||
<body class="bg-[#0a0a0a] text-[#e0e0e0] antialiased">
|
||||
<div id="root"></div>
|
||||
<script type="module" src="/src/main.tsx"></script>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"name": "Wedding Hub & Live Screen",
|
||||
"description": "Интерактивный свадебный хаб: PWA для гостей с QR-лотереей, играми «Охота за поцелуем», фото-тостами с VLM/AI валидацией бокалов, фото-галереей и Live-дашбордом для проектора/ТВ.",
|
||||
"requestFramePermissions": ["camera"],
|
||||
"majorCapabilities": ["MAJOR_CAPABILITY_SERVER_SIDE_GEMINI_API"]
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
{
|
||||
"name": "react-example",
|
||||
"private": true,
|
||||
"version": "0.0.0",
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
"dev": "tsx server.ts",
|
||||
"build": "vite build && esbuild server.ts --bundle --platform=node --format=cjs --packages=external --sourcemap --outfile=dist/server.cjs",
|
||||
"start": "node dist/server.cjs",
|
||||
"preview": "vite preview",
|
||||
"clean": "rm -rf dist server.js",
|
||||
"lint": "tsc --noEmit"
|
||||
},
|
||||
"dependencies": {
|
||||
"@google/genai": "^2.4.0",
|
||||
"@tailwindcss/vite": "^4.1.14",
|
||||
"@types/canvas-confetti": "^1.9.0",
|
||||
"@types/qrcode": "^1.5.6",
|
||||
"@types/ws": "^8.18.1",
|
||||
"@vitejs/plugin-react": "^5.0.4",
|
||||
"canvas-confetti": "^1.9.4",
|
||||
"dotenv": "^17.2.3",
|
||||
"express": "^4.21.2",
|
||||
"lucide-react": "^0.546.0",
|
||||
"motion": "^12.23.24",
|
||||
"qrcode": "^1.5.4",
|
||||
"react": "^19.0.1",
|
||||
"react-dom": "^19.0.1",
|
||||
"vite": "^6.2.3",
|
||||
"ws": "^8.21.3"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/node": "^22.14.0",
|
||||
"autoprefixer": "^10.4.21",
|
||||
"esbuild": "^0.25.0",
|
||||
"tailwindcss": "^4.1.14",
|
||||
"tsx": "^4.21.0",
|
||||
"typescript": "~5.8.2",
|
||||
"vite": "^6.2.3",
|
||||
"@types/express": "^4.17.21"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,571 @@
|
||||
import express from 'express';
|
||||
import http from 'http';
|
||||
import path from 'path';
|
||||
import fs from 'fs';
|
||||
import { WebSocketServer, WebSocket } from 'ws';
|
||||
import { createServer as createViteServer } from 'vite';
|
||||
import { db } from './server/db.ts';
|
||||
import { verifyToastPhoto } from './server/vlm.ts';
|
||||
import { saveAndSyncPhoto, getImmichAlbums, createImmichAlbum, testImmichConnection } from './server/immich.ts';
|
||||
|
||||
const app = express();
|
||||
const PORT = 3000;
|
||||
|
||||
// High body limit (50mb) for uncompressed, original high-res wedding photos
|
||||
app.use(express.json({ limit: '50mb' }));
|
||||
app.use(express.urlencoded({ extended: true, limit: '50mb' }));
|
||||
|
||||
// Static uploads folder
|
||||
const UPLOADS_DIR = path.join(process.cwd(), 'data', 'uploads');
|
||||
if (!fs.existsSync(UPLOADS_DIR)) {
|
||||
fs.mkdirSync(UPLOADS_DIR, { recursive: true });
|
||||
}
|
||||
app.use('/api/uploads', express.static(UPLOADS_DIR));
|
||||
|
||||
const server = http.createServer(app);
|
||||
|
||||
// WebSocket Server
|
||||
const wss = new WebSocketServer({ server, path: '/ws' });
|
||||
|
||||
export function broadcast(event: string, data: any) {
|
||||
const payload = JSON.stringify({ event, data, timestamp: Date.now() });
|
||||
wss.clients.forEach((client) => {
|
||||
if (client.readyState === WebSocket.OPEN) {
|
||||
try {
|
||||
client.send(payload);
|
||||
} catch (err) {
|
||||
console.warn('Failed to send WS message to client:', err);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
wss.on('connection', (ws) => {
|
||||
// Send current state on connection
|
||||
const state = db.getAggregatedStats();
|
||||
ws.send(JSON.stringify({ event: 'STATE_SYNC', data: state, timestamp: Date.now() }));
|
||||
|
||||
ws.on('message', (msg) => {
|
||||
try {
|
||||
const parsed = JSON.parse(msg.toString());
|
||||
if (parsed.type === 'PING') {
|
||||
ws.send(JSON.stringify({ type: 'PONG' }));
|
||||
}
|
||||
} catch {
|
||||
// Ignore invalid frames
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
// Periodic round countdown checker
|
||||
setInterval(() => {
|
||||
const state = db.getState();
|
||||
const now = Date.now();
|
||||
|
||||
// If round was active and 5.2 seconds passed, end it automatically
|
||||
if (state.round_active && state.round_start_time && now - state.round_start_time > 5200) {
|
||||
const { cooldown_until } = db.endKissRound();
|
||||
broadcast('KISS_ROUND_END', { cooldown_until, stats: db.getAggregatedStats() });
|
||||
}
|
||||
|
||||
// If cooldown passed, clear it and broadcast ready state
|
||||
if (state.cooldown_until && now >= state.cooldown_until) {
|
||||
db.updateSettings({ cooldown_until: null });
|
||||
broadcast('STATE_SYNC', db.getAggregatedStats());
|
||||
}
|
||||
}, 500);
|
||||
|
||||
// ======================== API ROUTES ========================
|
||||
|
||||
// 1. Health
|
||||
app.get('/api/health', (req, res) => {
|
||||
res.json({ status: 'ok', time: Date.now() });
|
||||
});
|
||||
|
||||
// 2. Auth / Onboarding
|
||||
app.post('/api/auth', (req, res) => {
|
||||
try {
|
||||
const { ticket_id, guest_name, team_id, team_name, role } = req.body;
|
||||
if (!ticket_id || !guest_name) {
|
||||
return res.status(400).json({ error: 'Заполните номер билета и имя' });
|
||||
}
|
||||
|
||||
const cleanTicket = ticket_id.trim().toUpperCase();
|
||||
const guest = db.registerGuest(cleanTicket, guest_name, team_id || 'team_friends', team_name, role);
|
||||
const stats = db.getAggregatedStats();
|
||||
|
||||
broadcast('STATE_SYNC', stats);
|
||||
|
||||
res.json({
|
||||
success: true,
|
||||
guest,
|
||||
stats,
|
||||
});
|
||||
} catch (error: any) {
|
||||
res.status(500).json({ error: error.message || 'Ошибка регистрации' });
|
||||
}
|
||||
});
|
||||
|
||||
// 3. Guest profile & stats
|
||||
app.get('/api/guest/:ticketId', (req, res) => {
|
||||
const { ticketId } = req.params;
|
||||
const guest = db.getGuest(ticketId);
|
||||
if (!guest) {
|
||||
return res.status(404).json({ error: 'Гость не найден' });
|
||||
}
|
||||
|
||||
const state = db.getState();
|
||||
const myKisses = state.kiss_catches.filter((k) => k.ticket_id === guest.ticket_id);
|
||||
const myKissPoints = myKisses.reduce((sum, k) => sum + k.points, 0);
|
||||
const myToasts = state.toasts.filter((t) => t.ticket_id === guest.ticket_id);
|
||||
const myDrinkPoints = myToasts.length * 10;
|
||||
|
||||
res.json({
|
||||
guest,
|
||||
myPoints: myKissPoints + myDrinkPoints,
|
||||
myKissesCount: myKisses.length,
|
||||
myToastsCount: myToasts.length,
|
||||
myDrinksCount: myToasts.length,
|
||||
stats: db.getAggregatedStats(),
|
||||
});
|
||||
});
|
||||
|
||||
// 4. Global State
|
||||
app.get('/api/state', (req, res) => {
|
||||
res.json({
|
||||
...db.getAggregatedStats(),
|
||||
photos: db.getState().photos.slice(0, 50),
|
||||
toasts: db.getState().toasts.slice(-20).reverse(),
|
||||
settings: {
|
||||
couples_names: db.getState().couples_names,
|
||||
cake_time_target: db.getState().cake_time_target,
|
||||
immich_url: db.getState().immich_url,
|
||||
immich_album_id: db.getState().immich_album_id,
|
||||
immich_album_name: db.getState().immich_album_name,
|
||||
ollama_url: db.getState().ollama_url,
|
||||
},
|
||||
});
|
||||
});
|
||||
|
||||
// 5. Catch Kiss (Paparazzi Game)
|
||||
app.post('/api/kiss/catch', (req, res) => {
|
||||
try {
|
||||
const { ticket_id } = req.body;
|
||||
if (!ticket_id) {
|
||||
return res.status(400).json({ error: 'Билет не указан' });
|
||||
}
|
||||
|
||||
const result = db.catchKiss(ticket_id);
|
||||
|
||||
if (result.success) {
|
||||
const stats = db.getAggregatedStats();
|
||||
if (result.is_golden) {
|
||||
// Broadcast golden catch overlay to projector and all devices
|
||||
broadcast('KISS_ROUND_START', {
|
||||
round_id: result.round_id,
|
||||
first_catcher: result.catcher_info,
|
||||
points: 3,
|
||||
stats,
|
||||
});
|
||||
} else {
|
||||
// Additional catch inside 5s window
|
||||
broadcast('KISS_CATCH', {
|
||||
round_id: result.round_id,
|
||||
guest: result.guest,
|
||||
points: 1,
|
||||
stats,
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
res.json(result);
|
||||
} catch (error: any) {
|
||||
res.status(500).json({ error: error.message || 'Ошибка фиксации поцелуя' });
|
||||
}
|
||||
});
|
||||
|
||||
// 6. Drink Quest Upload with Ollama / Gemini VLM Verification
|
||||
app.post('/api/toast/upload', async (req, res) => {
|
||||
try {
|
||||
const { ticket_id, image_base64, caption, quest_id, quest_title, quest_instruction, filename, file_type, file_created_at } = req.body;
|
||||
if (!ticket_id || !image_base64) {
|
||||
return res.status(400).json({ error: 'Необходимо прикрепить фото' });
|
||||
}
|
||||
|
||||
const guest = db.getGuest(ticket_id);
|
||||
const teamName = guest ? guest.team_name : '🎉 Команда Друзей';
|
||||
const guestName = guest ? guest.guest_name : 'Гость';
|
||||
|
||||
// Respond immediately so client UI is non-blocking
|
||||
res.json({
|
||||
success: true,
|
||||
message: 'Фото получено, отправлено на нейросетевую проверку квеста...',
|
||||
});
|
||||
|
||||
// Run async background AI verification and upload in full original quality
|
||||
(async () => {
|
||||
try {
|
||||
const state = db.getState();
|
||||
// 1. Save photo in original quality & sync to dedicated Immich album
|
||||
const uploadResult = await saveAndSyncPhoto(
|
||||
image_base64,
|
||||
filename || `drink-quest-${Date.now()}.jpg`,
|
||||
state.immich_url,
|
||||
state.immich_api_key,
|
||||
state.immich_album_id,
|
||||
{
|
||||
mimeType: file_type,
|
||||
fileCreatedAt: file_created_at,
|
||||
}
|
||||
);
|
||||
|
||||
// 2. VLM / AI Quest verification
|
||||
const vlmResult = await verifyToastPhoto(
|
||||
image_base64,
|
||||
teamName,
|
||||
guestName,
|
||||
{
|
||||
id: quest_id || 'quest_general',
|
||||
title: quest_title || 'Праздничный тост',
|
||||
instruction: quest_instruction || 'Проверь наличие бокала',
|
||||
},
|
||||
state.ollama_url
|
||||
);
|
||||
|
||||
// 3. Record verified drink/toast in DB
|
||||
const toast = db.addToast(
|
||||
ticket_id,
|
||||
uploadResult.url,
|
||||
vlmResult.detected_glasses,
|
||||
vlmResult.confidence,
|
||||
caption ? `${caption} — ${vlmResult.toast_phrase}` : vlmResult.toast_phrase,
|
||||
quest_id,
|
||||
quest_title,
|
||||
vlmResult.quest_completed
|
||||
);
|
||||
|
||||
const stats = db.getAggregatedStats();
|
||||
|
||||
// 4. Broadcast Polaroid flash alert to projector screen & guests
|
||||
broadcast('TOAST_CONFIRMED', {
|
||||
toast,
|
||||
photo_url: uploadResult.url,
|
||||
guest_name: guestName,
|
||||
team_name: teamName,
|
||||
ai_cheer: toast.ai_cheer,
|
||||
quest_title: quest_title || 'Праздничный бокал',
|
||||
quest_completed: vlmResult.quest_completed,
|
||||
detected_glasses: toast.detected_glasses,
|
||||
stats,
|
||||
});
|
||||
} catch (bgError) {
|
||||
console.error('Background drink verification error:', bgError);
|
||||
}
|
||||
})();
|
||||
} catch (error: any) {
|
||||
res.status(500).json({ error: error.message || 'Ошибка обработки квеста' });
|
||||
}
|
||||
});
|
||||
|
||||
// 7. Photos Gallery
|
||||
app.get('/api/photos', (req, res) => {
|
||||
res.json({
|
||||
photos: db.getState().photos,
|
||||
total: db.getState().photos.length,
|
||||
immich_url: db.getState().immich_url,
|
||||
immich_album_id: db.getState().immich_album_id,
|
||||
immich_album_name: db.getState().immich_album_name,
|
||||
});
|
||||
});
|
||||
|
||||
app.post('/api/photos/upload', async (req, res) => {
|
||||
try {
|
||||
const { ticket_id, image_base64, caption, filename, file_type, file_created_at } = req.body;
|
||||
if (!image_base64) {
|
||||
return res.status(400).json({ error: 'Фото не передано' });
|
||||
}
|
||||
|
||||
const guest = ticket_id ? db.getGuest(ticket_id) : undefined;
|
||||
const state = db.getState();
|
||||
|
||||
// Save in 100% original quality and sync to Immich album
|
||||
const uploadResult = await saveAndSyncPhoto(
|
||||
image_base64,
|
||||
filename || `gallery-${Date.now()}.jpg`,
|
||||
state.immich_url,
|
||||
state.immich_api_key,
|
||||
state.immich_album_id,
|
||||
{
|
||||
mimeType: file_type,
|
||||
fileCreatedAt: file_created_at,
|
||||
}
|
||||
);
|
||||
|
||||
const newPhoto = db.addPhoto({
|
||||
ticket_id: guest?.ticket_id,
|
||||
guest_name: guest?.guest_name || 'Гость',
|
||||
team_id: guest?.team_id || 'team_friends',
|
||||
team_name: guest?.team_name || '🎉 Команда Друзей',
|
||||
url: uploadResult.url,
|
||||
caption: caption || 'Свадебный кадр',
|
||||
is_toast: false,
|
||||
});
|
||||
|
||||
broadcast('NEW_PHOTO', { photo: newPhoto, stats: db.getAggregatedStats() });
|
||||
|
||||
res.json({
|
||||
success: true,
|
||||
photo: newPhoto,
|
||||
immichSynced: uploadResult.syncedToImmich,
|
||||
albumSynced: uploadResult.albumSynced,
|
||||
});
|
||||
} catch (error: any) {
|
||||
res.status(500).json({ error: error.message || 'Ошибка загрузки фото' });
|
||||
}
|
||||
});
|
||||
|
||||
// Immich API management endpoints for Admin
|
||||
app.get('/api/admin/immich/albums', async (req, res) => {
|
||||
try {
|
||||
const state = db.getState();
|
||||
if (!state.immich_url || !state.immich_api_key) {
|
||||
return res.status(400).json({ error: 'Immich URL или API Key не настроены' });
|
||||
}
|
||||
|
||||
const albums = await getImmichAlbums(state.immich_url, state.immich_api_key);
|
||||
res.json({ success: true, albums });
|
||||
} catch (error: any) {
|
||||
res.status(500).json({ error: error.message || 'Не удалось получить список альбомов Immich' });
|
||||
}
|
||||
});
|
||||
|
||||
app.post('/api/admin/immich/create-album', async (req, res) => {
|
||||
try {
|
||||
const state = db.getState();
|
||||
if (!state.immich_url || !state.immich_api_key) {
|
||||
return res.status(400).json({ error: 'Immich URL или API Key не настроены' });
|
||||
}
|
||||
|
||||
const { album_name, description } = req.body;
|
||||
const resolvedName = (album_name && album_name.trim()) || `Свадьба: ${state.couples_names || 'Анна & Дмитрий'}`;
|
||||
|
||||
const created = await createImmichAlbum(state.immich_url, state.immich_api_key, resolvedName, description);
|
||||
|
||||
// Automatically set as active album in DB settings
|
||||
db.updateSettings({
|
||||
immich_album_id: created.id,
|
||||
immich_album_name: created.albumName,
|
||||
});
|
||||
|
||||
broadcast('STATE_SYNC', db.getAggregatedStats());
|
||||
res.json({ success: true, album: created, stats: db.getAggregatedStats() });
|
||||
} catch (error: any) {
|
||||
res.status(500).json({ error: error.message || 'Ошибка создания альбома в Immich' });
|
||||
}
|
||||
});
|
||||
|
||||
app.post('/api/admin/immich/test', async (req, res) => {
|
||||
try {
|
||||
const { immich_url, immich_api_key } = req.body;
|
||||
const state = db.getState();
|
||||
const url = immich_url || state.immich_url;
|
||||
const key = immich_api_key || state.immich_api_key;
|
||||
|
||||
if (!url || !key) {
|
||||
return res.status(400).json({ success: false, message: 'Укажите адрес сервера Immich и API Key' });
|
||||
}
|
||||
|
||||
const testResult = await testImmichConnection(url, key);
|
||||
res.json(testResult);
|
||||
} catch (error: any) {
|
||||
res.status(500).json({ success: false, message: error.message });
|
||||
}
|
||||
});
|
||||
|
||||
// 8. Admin Controls
|
||||
app.post('/api/admin/kiss-trigger', (req, res) => {
|
||||
try {
|
||||
const { round_id, start_time } = db.startKissRound();
|
||||
const stats = db.getAggregatedStats();
|
||||
|
||||
broadcast('KISS_ROUND_START', {
|
||||
round_id,
|
||||
start_time,
|
||||
first_catcher: { ticket_id: 'HOST', guest_name: 'Ведущий банкета', team_name: '🎤 Ведущий' },
|
||||
points: 3,
|
||||
stats,
|
||||
});
|
||||
|
||||
res.json({ success: true, round_id, start_time });
|
||||
} catch (error: any) {
|
||||
res.status(500).json({ error: error.message });
|
||||
}
|
||||
});
|
||||
|
||||
app.post('/api/admin/settings', (req, res) => {
|
||||
try {
|
||||
const payload = { ...req.body };
|
||||
|
||||
// Support setting exact cake time by string (e.g., "22:30" or ISO or HH:MM)
|
||||
if (payload.cake_time_exact_str && typeof payload.cake_time_exact_str === 'string') {
|
||||
const parts = payload.cake_time_exact_str.split(':');
|
||||
if (parts.length >= 2) {
|
||||
const hours = parseInt(parts[0], 10);
|
||||
const minutes = parseInt(parts[1], 10);
|
||||
const targetDate = new Date();
|
||||
targetDate.setHours(hours, minutes, 0, 0);
|
||||
// If time already passed today by more than 2 hours, assume next day or keep today
|
||||
if (targetDate.getTime() < Date.now() - 2 * 3600000) {
|
||||
targetDate.setDate(targetDate.getDate() + 1);
|
||||
}
|
||||
payload.cake_time_target = targetDate.getTime();
|
||||
}
|
||||
delete payload.cake_time_exact_str;
|
||||
}
|
||||
|
||||
const updated = db.updateSettings(payload);
|
||||
broadcast('SETTINGS_UPDATED', db.getAggregatedStats());
|
||||
res.json({ success: true, state: updated, stats: db.getAggregatedStats() });
|
||||
} catch (error: any) {
|
||||
res.status(500).json({ error: error.message });
|
||||
}
|
||||
});
|
||||
|
||||
// Delete user session / guest
|
||||
app.post('/api/admin/guest-delete', (req, res) => {
|
||||
try {
|
||||
const { ticket_id } = req.body;
|
||||
if (!ticket_id) {
|
||||
return res.status(400).json({ error: 'Билет пользователя не указан' });
|
||||
}
|
||||
|
||||
const removed = db.removeGuest(ticket_id);
|
||||
if (!removed) {
|
||||
return res.status(404).json({ error: 'Пользователь не найден' });
|
||||
}
|
||||
|
||||
const stats = db.getAggregatedStats();
|
||||
broadcast('STATE_SYNC', stats);
|
||||
res.json({ success: true, message: 'Сессия пользователя успешно удалена', stats });
|
||||
} catch (error: any) {
|
||||
res.status(500).json({ error: error.message });
|
||||
}
|
||||
});
|
||||
|
||||
// Batch delete guests
|
||||
app.post('/api/admin/guest-batch-delete', (req, res) => {
|
||||
try {
|
||||
const { ticket_ids } = req.body;
|
||||
if (!Array.isArray(ticket_ids) || ticket_ids.length === 0) {
|
||||
return res.status(400).json({ error: 'Список билетов не указан' });
|
||||
}
|
||||
|
||||
const count = db.batchRemoveGuests(ticket_ids);
|
||||
const stats = db.getAggregatedStats();
|
||||
broadcast('STATE_SYNC', stats);
|
||||
res.json({ success: true, count, stats });
|
||||
} catch (error: any) {
|
||||
res.status(500).json({ error: error.message });
|
||||
}
|
||||
});
|
||||
|
||||
// Pre-create / register a named guest by admin
|
||||
app.post('/api/admin/guest-create', (req, res) => {
|
||||
try {
|
||||
const { ticket_id, guest_name, team_id, team_name, role } = req.body;
|
||||
if (!ticket_id || !guest_name) {
|
||||
return res.status(400).json({ error: 'Необходимо указать номер билета и имя гостя' });
|
||||
}
|
||||
|
||||
const guest = db.registerGuest(ticket_id, guest_name, team_id || 'team_friends', team_name, role || 'guest');
|
||||
const stats = db.getAggregatedStats();
|
||||
broadcast('STATE_SYNC', stats);
|
||||
res.json({ success: true, guest, stats });
|
||||
} catch (error: any) {
|
||||
res.status(500).json({ error: error.message });
|
||||
}
|
||||
});
|
||||
|
||||
// Update specific user role, team, or bonus points
|
||||
app.post('/api/admin/user-update', (req, res) => {
|
||||
try {
|
||||
const { ticket_id, role, team_id, team_name, bonus_points } = req.body;
|
||||
if (!ticket_id) {
|
||||
return res.status(400).json({ error: 'Билет пользователя не указан' });
|
||||
}
|
||||
|
||||
const guest = db.getGuest(ticket_id);
|
||||
if (!guest) {
|
||||
return res.status(404).json({ error: 'Гость не найден' });
|
||||
}
|
||||
|
||||
if (role) guest.role = role;
|
||||
if (team_id) guest.team_id = team_id;
|
||||
if (team_name) guest.team_name = team_name;
|
||||
|
||||
if (bonus_points && typeof bonus_points === 'number' && bonus_points > 0) {
|
||||
// Award manual bonus points by host/admin
|
||||
db.getState().kiss_catches.push({
|
||||
id: db.getState().kiss_catches.length + 1,
|
||||
ticket_id: guest.ticket_id,
|
||||
guest_name: guest.guest_name,
|
||||
team_id: guest.team_id,
|
||||
team_name: guest.team_name,
|
||||
points: bonus_points,
|
||||
round_id: 999, // manual host award
|
||||
timestamp: Date.now(),
|
||||
});
|
||||
}
|
||||
|
||||
db.save();
|
||||
const stats = db.getAggregatedStats();
|
||||
broadcast('STATE_SYNC', stats);
|
||||
|
||||
res.json({ success: true, guest, stats });
|
||||
} catch (error: any) {
|
||||
res.status(500).json({ error: error.message });
|
||||
}
|
||||
});
|
||||
|
||||
app.post('/api/admin/reset', (req, res) => {
|
||||
try {
|
||||
db.resetAllData();
|
||||
broadcast('STATE_SYNC', db.getAggregatedStats());
|
||||
res.json({ success: true });
|
||||
} catch (error: any) {
|
||||
res.status(500).json({ error: error.message });
|
||||
}
|
||||
});
|
||||
|
||||
app.post('/api/admin/seed', (req, res) => {
|
||||
try {
|
||||
db.seedDemoData();
|
||||
broadcast('STATE_SYNC', db.getAggregatedStats());
|
||||
res.json({ success: true });
|
||||
} catch (error: any) {
|
||||
res.status(500).json({ error: error.message });
|
||||
}
|
||||
});
|
||||
|
||||
// ======================== VITE MIDDLEWARE ========================
|
||||
async function start() {
|
||||
if (process.env.NODE_ENV !== 'production') {
|
||||
const vite = await createViteServer({
|
||||
server: { middlewareMode: true },
|
||||
appType: 'spa',
|
||||
});
|
||||
app.use(vite.middlewares);
|
||||
} else {
|
||||
const distPath = path.join(process.cwd(), 'dist');
|
||||
app.use(express.static(distPath));
|
||||
app.get('*', (req, res) => {
|
||||
res.sendFile(path.join(distPath, 'index.html'));
|
||||
});
|
||||
}
|
||||
|
||||
server.listen(PORT, '0.0.0.0', () => {
|
||||
console.log(`Wedding Hub Server listening on http://0.0.0.0:${PORT}`);
|
||||
});
|
||||
}
|
||||
|
||||
start();
|
||||
+622
@@ -0,0 +1,622 @@
|
||||
import fs from 'fs';
|
||||
import path from 'path';
|
||||
|
||||
export type UserRole = 'guest' | 'host' | 'couple' | 'admin';
|
||||
|
||||
export interface Guest {
|
||||
ticket_id: string;
|
||||
guest_name: string;
|
||||
team_id: string;
|
||||
team_name: string;
|
||||
role: UserRole;
|
||||
registered_at: number;
|
||||
}
|
||||
|
||||
export interface KissCatch {
|
||||
id: number;
|
||||
ticket_id: string;
|
||||
guest_name: string;
|
||||
team_id: string;
|
||||
team_name: string;
|
||||
points: number;
|
||||
round_id: number;
|
||||
timestamp: number;
|
||||
}
|
||||
|
||||
export interface ToastLog {
|
||||
id: number;
|
||||
ticket_id: string;
|
||||
guest_name: string;
|
||||
team_id: string;
|
||||
team_name: string;
|
||||
timestamp: number;
|
||||
photo_url?: string;
|
||||
detected_glasses?: number;
|
||||
confidence?: number;
|
||||
ai_cheer?: string;
|
||||
quest_id?: string;
|
||||
quest_title?: string;
|
||||
quest_completed?: boolean;
|
||||
status: 'pending' | 'verified' | 'rejected';
|
||||
}
|
||||
|
||||
export interface WeddingPhoto {
|
||||
id: string;
|
||||
ticket_id?: string;
|
||||
guest_name?: string;
|
||||
team_id?: string;
|
||||
team_name?: string;
|
||||
url: string;
|
||||
thumb_url?: string;
|
||||
caption?: string;
|
||||
uploaded_at: number;
|
||||
is_toast?: boolean;
|
||||
quest_title?: string;
|
||||
}
|
||||
|
||||
export interface AppState {
|
||||
guests: Record<string, Guest>;
|
||||
kiss_catches: KissCatch[];
|
||||
toasts: ToastLog[];
|
||||
photos: WeddingPhoto[];
|
||||
current_round_id: number;
|
||||
round_active: boolean;
|
||||
round_start_time: number | null;
|
||||
round_first_catcher: { ticket_id: string; guest_name: string; team_name: string } | null;
|
||||
cooldown_until: number | null;
|
||||
cake_time_target: number;
|
||||
immich_url: string;
|
||||
immich_api_key: string;
|
||||
immich_album_id: string;
|
||||
immich_album_name: string;
|
||||
ollama_url: string;
|
||||
couples_names: string;
|
||||
wedding_date: string;
|
||||
}
|
||||
|
||||
const DATA_DIR = path.join(process.cwd(), 'data');
|
||||
const DATA_FILE = path.join(DATA_DIR, 'wedding_hub.json');
|
||||
|
||||
const DEFAULT_CAKE_TIME = Date.now() + 2 * 60 * 60 * 1000 + 45 * 60 * 1000;
|
||||
|
||||
export const DEFAULT_TEAMS = [
|
||||
{ id: 'team_bride', name: '👰 Команда Невесты' },
|
||||
{ id: 'team_groom', name: '🤵 Команда Жениха' },
|
||||
{ id: 'team_witnesses', name: '🍸 Свидетели и Свита' },
|
||||
{ id: 'team_friends', name: '🎉 Команда Друзей' },
|
||||
{ id: 'team_family', name: '👑 Семья и Родные' },
|
||||
];
|
||||
|
||||
const DEFAULT_STATE: AppState = {
|
||||
guests: {
|
||||
'ADMIN-001': { ticket_id: 'ADMIN-001', guest_name: 'Главный Администратор', team_id: 'team_witnesses', team_name: '🍸 Свидетели и Свита', role: 'admin', registered_at: Date.now() - 4000000 },
|
||||
'HOST-001': { ticket_id: 'HOST-001', guest_name: 'Ведущий Банкета (Александр)', team_id: 'team_friends', team_name: '🎉 Команда Друзей', role: 'host', registered_at: Date.now() - 3900000 },
|
||||
'COUPLE-001': { ticket_id: 'COUPLE-001', guest_name: 'Анна & Дмитрий (Молодожены)', team_id: 'team_bride', team_name: '👰 Команда Невесты', role: 'couple', registered_at: Date.now() - 3800000 },
|
||||
'LUCK-001': { ticket_id: 'LUCK-001', guest_name: 'Алексей Смирнов', team_id: 'team_groom', team_name: '🤵 Команда Жениха', role: 'guest', registered_at: Date.now() - 3600000 },
|
||||
'LUCK-002': { ticket_id: 'LUCK-002', guest_name: 'Елена Васильева', team_id: 'team_bride', team_name: '👰 Команда Невесты', role: 'guest', registered_at: Date.now() - 3500000 },
|
||||
'LUCK-003': { ticket_id: 'LUCK-003', guest_name: 'Дмитрий Ковалев', team_id: 'team_friends', team_name: '🎉 Команда Друзей', role: 'guest', registered_at: Date.now() - 3400000 },
|
||||
'LUCK-004': { ticket_id: 'LUCK-004', guest_name: 'Мария Соколова', team_id: 'team_bride', team_name: '👰 Команда Невесты', role: 'guest', registered_at: Date.now() - 3300000 },
|
||||
'LUCK-005': { ticket_id: 'LUCK-005', guest_name: 'Сергей Морозов', team_id: 'team_witnesses', team_name: '🍸 Свидетели и Свита', role: 'guest', registered_at: Date.now() - 3200000 },
|
||||
'LUCK-006': { ticket_id: 'LUCK-006', guest_name: 'Ольга Попова', team_id: 'team_family', team_name: '👑 Семья и Родные', role: 'guest', registered_at: Date.now() - 3100000 },
|
||||
'LUCK-007': { ticket_id: 'LUCK-007', guest_name: 'Михаил Новиков', team_id: 'team_groom', team_name: '🤵 Команда Жениха', role: 'guest', registered_at: Date.now() - 3000000 },
|
||||
},
|
||||
kiss_catches: [
|
||||
{ id: 1, ticket_id: 'LUCK-001', guest_name: 'Алексей Смирнов', team_id: 'team_groom', team_name: '🤵 Команда Жениха', points: 3, round_id: 1, timestamp: Date.now() - 2400000 },
|
||||
{ id: 2, ticket_id: 'LUCK-003', guest_name: 'Дмитрий Ковалев', team_id: 'team_friends', team_name: '🎉 Команда Друзей', points: 1, round_id: 1, timestamp: Date.now() - 2398000 },
|
||||
{ id: 3, ticket_id: 'LUCK-005', guest_name: 'Сергей Морозов', team_id: 'team_witnesses', team_name: '🍸 Свидетели и Свита', points: 1, round_id: 1, timestamp: Date.now() - 2396000 },
|
||||
{ id: 4, ticket_id: 'LUCK-004', guest_name: 'Мария Соколова', team_id: 'team_bride', team_name: '👰 Команда Невесты', points: 3, round_id: 2, timestamp: Date.now() - 1500000 },
|
||||
{ id: 5, ticket_id: 'LUCK-002', guest_name: 'Елена Васильева', team_id: 'team_bride', team_name: '👰 Команда Невесты', points: 1, round_id: 2, timestamp: Date.now() - 1497000 },
|
||||
{ id: 6, ticket_id: 'LUCK-007', guest_name: 'Михаил Новиков', team_id: 'team_groom', team_name: '🤵 Команда Жениха', points: 3, round_id: 3, timestamp: Date.now() - 700000 },
|
||||
],
|
||||
toasts: [
|
||||
{ id: 1, ticket_id: 'LUCK-001', guest_name: 'Алексей Смирнов', team_id: 'team_groom', team_name: '🤵 Команда Жениха', timestamp: Date.now() - 2800000, detected_glasses: 1, confidence: 0.96, quest_id: 'quest_fear', quest_title: 'Эмоция «СТРАХ»', quest_completed: true, ai_cheer: 'Эмоция ужаса от цен на свадьбу передана гениально! Бокал засчитан!', status: 'verified', photo_url: 'https://images.unsplash.com/photo-1519741497674-611481863552?w=800&auto=format&fit=crop&q=80' },
|
||||
{ id: 2, ticket_id: 'LUCK-002', guest_name: 'Елена Васильева', team_id: 'team_bride', team_name: '👰 Команда Невесты', timestamp: Date.now() - 2000000, detected_glasses: 1, confidence: 0.98, quest_id: 'quest_couple_bg', quest_title: 'На фоне Молодоженов', quest_completed: true, ai_cheer: 'Молодожены в фокусе, бокал шампанского сияет! За невесту!', status: 'verified', photo_url: 'https://images.unsplash.com/photo-1511285560929-80b456fea0bc?w=800&auto=format&fit=crop&q=80' },
|
||||
{ id: 3, ticket_id: 'LUCK-003', guest_name: 'Дмитрий Ковалев', team_id: 'team_friends', team_name: '🎉 Команда Друзей', timestamp: Date.now() - 1200000, detected_glasses: 2, confidence: 0.92, quest_id: 'quest_superhero', quest_title: 'Поза Супергероя', quest_completed: true, ai_cheer: 'Стойка Тора с бокалом виски! +1 напиток друзьям!', status: 'verified', photo_url: 'https://images.unsplash.com/photo-1465495976277-4387d4b0b4c6?w=800&auto=format&fit=crop&q=80' },
|
||||
{ id: 4, ticket_id: 'LUCK-005', guest_name: 'Сергей Морозов', team_id: 'team_witnesses', team_name: '🍸 Свидетели и Свита', timestamp: Date.now() - 600000, detected_glasses: 1, confidence: 0.95, quest_id: 'quest_serious', quest_title: 'Максимальная Серьезность', quest_completed: true, ai_cheer: 'Лицо министра финансов с бокалом! Безупречно!', status: 'verified', photo_url: 'https://images.unsplash.com/photo-1520854221256-17451cc331bf?w=800&auto=format&fit=crop&q=80' },
|
||||
],
|
||||
photos: [
|
||||
{ id: 'p1', ticket_id: 'LUCK-001', guest_name: 'Алексей Смирнов', team_id: 'team_groom', team_name: '🤵 Команда Жениха', url: 'https://images.unsplash.com/photo-1519741497674-611481863552?w=800&auto=format&fit=crop&q=80', uploaded_at: Date.now() - 2800000, caption: 'Квест «Страх» выполнен!', quest_title: 'Эмоция «СТРАХ»', is_toast: true },
|
||||
{ id: 'p2', ticket_id: 'LUCK-002', guest_name: 'Елена Васильева', team_id: 'team_bride', team_name: '👰 Команда Невесты', url: 'https://images.unsplash.com/photo-1511285560929-80b456fea0bc?w=800&auto=format&fit=crop&q=80', uploaded_at: Date.now() - 2000000, caption: 'Тост за молодых на фоне пары', quest_title: 'На фоне Молодоженов', is_toast: true },
|
||||
{ id: 'p3', ticket_id: 'LUCK-003', guest_name: 'Дмитрий Ковалев', team_id: 'team_friends', team_name: '🎉 Команда Друзей', url: 'https://images.unsplash.com/photo-1465495976277-4387d4b0b4c6?w=800&auto=format&fit=crop&q=80', uploaded_at: Date.now() - 1200000, caption: 'Супергерои вечера', quest_title: 'Поза Супергероя', is_toast: true },
|
||||
{ id: 'p4', ticket_id: 'LUCK-005', guest_name: 'Сергей Морозов', team_id: 'team_witnesses', team_name: '🍸 Свидетели и Свита', url: 'https://images.unsplash.com/photo-1520854221256-17451cc331bf?w=800&auto=format&fit=crop&q=80', uploaded_at: Date.now() - 600000, caption: 'Строгий свидетель', quest_title: 'Максимальная Серьезность', is_toast: true },
|
||||
],
|
||||
current_round_id: 3,
|
||||
round_active: false,
|
||||
round_start_time: null,
|
||||
round_first_catcher: null,
|
||||
cooldown_until: null,
|
||||
cake_time_target: DEFAULT_CAKE_TIME,
|
||||
immich_url: process.env.IMMICH_URL || '',
|
||||
immich_api_key: process.env.IMMICH_API_KEY || '',
|
||||
immich_album_id: process.env.IMMICH_ALBUM_ID || '',
|
||||
immich_album_name: process.env.IMMICH_ALBUM_NAME || '',
|
||||
ollama_url: process.env.OLLAMA_URL || '',
|
||||
couples_names: 'Анна & Дмитрий',
|
||||
wedding_date: '2026-08-27',
|
||||
};
|
||||
|
||||
class WeddingDatabase {
|
||||
private state: AppState;
|
||||
|
||||
constructor() {
|
||||
this.state = this.loadState();
|
||||
}
|
||||
|
||||
private loadState(): AppState {
|
||||
try {
|
||||
if (!fs.existsSync(DATA_DIR)) {
|
||||
fs.mkdirSync(DATA_DIR, { recursive: true });
|
||||
}
|
||||
if (fs.existsSync(DATA_FILE)) {
|
||||
const raw = fs.readFileSync(DATA_FILE, 'utf-8');
|
||||
const parsed = JSON.parse(raw);
|
||||
return { ...DEFAULT_STATE, ...parsed };
|
||||
}
|
||||
} catch (e) {
|
||||
console.warn('Could not load existing state file, using defaults:', e);
|
||||
}
|
||||
return { ...DEFAULT_STATE };
|
||||
}
|
||||
|
||||
public save(): void {
|
||||
try {
|
||||
if (!fs.existsSync(DATA_DIR)) {
|
||||
fs.mkdirSync(DATA_DIR, { recursive: true });
|
||||
}
|
||||
const tmpFile = `${DATA_FILE}.tmp`;
|
||||
fs.writeFileSync(tmpFile, JSON.stringify(this.state, null, 2), 'utf-8');
|
||||
fs.renameSync(tmpFile, DATA_FILE);
|
||||
} catch (e) {
|
||||
console.error('Failed to write database file:', e);
|
||||
}
|
||||
}
|
||||
|
||||
public getState(): AppState {
|
||||
return this.state;
|
||||
}
|
||||
|
||||
// Guests
|
||||
public registerGuest(
|
||||
ticket_id: string,
|
||||
guest_name: string,
|
||||
team_id: string,
|
||||
team_name?: string,
|
||||
role?: UserRole
|
||||
): Guest {
|
||||
const cleanTicket = ticket_id.trim().toUpperCase();
|
||||
const resolvedTeamName = team_name || DEFAULT_TEAMS.find((t) => t.id === team_id)?.name || '🎉 Команда Друзей';
|
||||
|
||||
// Auto-detect role from ticket prefix or explicit role
|
||||
let resolvedRole: UserRole = role || 'guest';
|
||||
if (!role) {
|
||||
if (cleanTicket.startsWith('ADMIN')) resolvedRole = 'admin';
|
||||
else if (cleanTicket.startsWith('HOST')) resolvedRole = 'host';
|
||||
else if (cleanTicket.startsWith('COUPLE')) resolvedRole = 'couple';
|
||||
}
|
||||
|
||||
const guest: Guest = {
|
||||
ticket_id: cleanTicket,
|
||||
guest_name: guest_name.trim(),
|
||||
team_id: team_id || 'team_friends',
|
||||
team_name: resolvedTeamName,
|
||||
role: resolvedRole,
|
||||
registered_at: Date.now(),
|
||||
};
|
||||
this.state.guests[cleanTicket] = guest;
|
||||
this.save();
|
||||
return guest;
|
||||
}
|
||||
|
||||
public getGuest(ticket_id: string): Guest | undefined {
|
||||
return this.state.guests[ticket_id.trim().toUpperCase()];
|
||||
}
|
||||
|
||||
public getAllGuests(): Guest[] {
|
||||
return Object.values(this.state.guests);
|
||||
}
|
||||
|
||||
public removeGuest(ticket_id: string): boolean {
|
||||
const clean = ticket_id.trim().toUpperCase();
|
||||
if (this.state.guests[clean]) {
|
||||
delete this.state.guests[clean];
|
||||
this.save();
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public batchRemoveGuests(ticket_ids: string[]): number {
|
||||
let count = 0;
|
||||
for (const tid of ticket_ids) {
|
||||
const clean = tid.trim().toUpperCase();
|
||||
if (this.state.guests[clean]) {
|
||||
delete this.state.guests[clean];
|
||||
count++;
|
||||
}
|
||||
}
|
||||
if (count > 0) {
|
||||
this.save();
|
||||
}
|
||||
return count;
|
||||
}
|
||||
|
||||
public updateGuest(
|
||||
ticket_id: string,
|
||||
updates: Partial<Pick<Guest, 'guest_name' | 'team_id' | 'team_name' | 'role'>>
|
||||
): Guest | null {
|
||||
const clean = ticket_id.trim().toUpperCase();
|
||||
const guest = this.state.guests[clean];
|
||||
if (!guest) return null;
|
||||
|
||||
if (updates.guest_name) guest.guest_name = updates.guest_name.trim();
|
||||
if (updates.team_id) guest.team_id = updates.team_id;
|
||||
if (updates.team_name) guest.team_name = updates.team_name;
|
||||
if (updates.role) guest.role = updates.role;
|
||||
|
||||
this.save();
|
||||
return guest;
|
||||
}
|
||||
|
||||
// Kisses logic
|
||||
public startKissRound(): { round_id: number; start_time: number } {
|
||||
this.state.current_round_id += 1;
|
||||
this.state.round_active = true;
|
||||
this.state.round_start_time = Date.now();
|
||||
this.state.round_first_catcher = null;
|
||||
this.state.cooldown_until = null;
|
||||
this.save();
|
||||
return { round_id: this.state.current_round_id, start_time: this.state.round_start_time };
|
||||
}
|
||||
|
||||
public endKissRound(): { cooldown_until: number } {
|
||||
this.state.round_active = false;
|
||||
this.state.round_start_time = null;
|
||||
this.state.cooldown_until = Date.now() + 30000;
|
||||
this.save();
|
||||
return { cooldown_until: this.state.cooldown_until };
|
||||
}
|
||||
|
||||
public catchKiss(ticket_id: string): {
|
||||
success: boolean;
|
||||
points: number;
|
||||
is_golden: boolean;
|
||||
reason?: string;
|
||||
round_id: number;
|
||||
guest: Guest;
|
||||
catcher_info?: { ticket_id: string; guest_name: string; team_name: string };
|
||||
} {
|
||||
const guest = this.getGuest(ticket_id);
|
||||
if (!guest) {
|
||||
return { success: false, points: 0, is_golden: false, reason: 'Гость не зарегистрирован', round_id: this.state.current_round_id, guest: null as any };
|
||||
}
|
||||
|
||||
const now = Date.now();
|
||||
|
||||
if (this.state.cooldown_until && now < this.state.cooldown_until) {
|
||||
const remaining = Math.ceil((this.state.cooldown_until - now) / 1000);
|
||||
return { success: false, points: 0, is_golden: false, reason: `Кулдаун! Подождите ${remaining} сек.`, round_id: this.state.current_round_id, guest };
|
||||
}
|
||||
|
||||
if (!this.state.round_active) {
|
||||
this.startKissRound();
|
||||
const catchRecord: KissCatch = {
|
||||
id: this.state.kiss_catches.length + 1,
|
||||
ticket_id: guest.ticket_id,
|
||||
guest_name: guest.guest_name,
|
||||
team_id: guest.team_id,
|
||||
team_name: guest.team_name,
|
||||
points: 3,
|
||||
round_id: this.state.current_round_id,
|
||||
timestamp: now,
|
||||
};
|
||||
this.state.kiss_catches.push(catchRecord);
|
||||
this.state.round_first_catcher = {
|
||||
ticket_id: guest.ticket_id,
|
||||
guest_name: guest.guest_name,
|
||||
team_name: guest.team_name,
|
||||
};
|
||||
this.save();
|
||||
return {
|
||||
success: true,
|
||||
points: 3,
|
||||
is_golden: true,
|
||||
round_id: this.state.current_round_id,
|
||||
guest,
|
||||
catcher_info: this.state.round_first_catcher,
|
||||
};
|
||||
}
|
||||
|
||||
const alreadyCaughtInThisRound = this.state.kiss_catches.some(
|
||||
(c) => c.round_id === this.state.current_round_id && c.ticket_id === guest.ticket_id
|
||||
);
|
||||
|
||||
if (alreadyCaughtInThisRound) {
|
||||
return { success: false, points: 0, is_golden: false, reason: 'Вы уже зафиксировали поцелуй в этом раунде!', round_id: this.state.current_round_id, guest };
|
||||
}
|
||||
|
||||
const elapsedMs = now - (this.state.round_start_time || now);
|
||||
if (elapsedMs <= 5500) {
|
||||
const catchRecord: KissCatch = {
|
||||
id: this.state.kiss_catches.length + 1,
|
||||
ticket_id: guest.ticket_id,
|
||||
guest_name: guest.guest_name,
|
||||
team_id: guest.team_id,
|
||||
team_name: guest.team_name,
|
||||
points: 1,
|
||||
round_id: this.state.current_round_id,
|
||||
timestamp: now,
|
||||
};
|
||||
this.state.kiss_catches.push(catchRecord);
|
||||
this.save();
|
||||
return {
|
||||
success: true,
|
||||
points: 1,
|
||||
is_golden: false,
|
||||
round_id: this.state.current_round_id,
|
||||
guest,
|
||||
catcher_info: this.state.round_first_catcher,
|
||||
};
|
||||
} else {
|
||||
this.endKissRound();
|
||||
return { success: false, points: 0, is_golden: false, reason: 'Раунд завершен! Не успели за 5 секунд.', round_id: this.state.current_round_id, guest };
|
||||
}
|
||||
}
|
||||
|
||||
// Toasts / Drinks with strange quests
|
||||
public addToast(
|
||||
ticket_id: string,
|
||||
photo_url?: string,
|
||||
detected_glasses: number = 1,
|
||||
confidence: number = 0.95,
|
||||
ai_cheer?: string,
|
||||
quest_id?: string,
|
||||
quest_title?: string,
|
||||
quest_completed: boolean = true
|
||||
): ToastLog {
|
||||
const guest = this.getGuest(ticket_id);
|
||||
const toast: ToastLog = {
|
||||
id: this.state.toasts.length + 1,
|
||||
ticket_id: ticket_id.trim().toUpperCase(),
|
||||
guest_name: guest ? guest.guest_name : 'Гость',
|
||||
team_id: guest ? guest.team_id : 'team_friends',
|
||||
team_name: guest ? guest.team_name : '🎉 Команда Друзей',
|
||||
timestamp: Date.now(),
|
||||
photo_url,
|
||||
detected_glasses,
|
||||
confidence,
|
||||
ai_cheer: ai_cheer || 'Горько! За счастье молодых!',
|
||||
quest_id,
|
||||
quest_title,
|
||||
quest_completed,
|
||||
status: 'verified',
|
||||
};
|
||||
this.state.toasts.push(toast);
|
||||
|
||||
if (photo_url) {
|
||||
this.state.photos.unshift({
|
||||
id: `toast-${toast.id}-${Date.now()}`,
|
||||
ticket_id: toast.ticket_id,
|
||||
guest_name: toast.guest_name,
|
||||
team_id: toast.team_id,
|
||||
team_name: toast.team_name,
|
||||
url: photo_url,
|
||||
uploaded_at: Date.now(),
|
||||
caption: quest_title ? `Квест «${quest_title}»: ${toast.ai_cheer}` : `Тост: ${toast.ai_cheer}`,
|
||||
quest_title,
|
||||
is_toast: true,
|
||||
});
|
||||
}
|
||||
|
||||
this.save();
|
||||
return toast;
|
||||
}
|
||||
|
||||
// Photos
|
||||
public addPhoto(photo: Omit<WeddingPhoto, 'id' | 'uploaded_at'>): WeddingPhoto {
|
||||
const newPhoto: WeddingPhoto = {
|
||||
...photo,
|
||||
id: `photo-${Date.now()}-${Math.random().toString(36).substring(2, 7)}`,
|
||||
uploaded_at: Date.now(),
|
||||
};
|
||||
this.state.photos.unshift(newPhoto);
|
||||
this.save();
|
||||
return newPhoto;
|
||||
}
|
||||
|
||||
// Aggregated Stats with Personal and Team metrics
|
||||
public getAggregatedStats() {
|
||||
const totalKisses = this.state.kiss_catches.length;
|
||||
const totalToasts = this.state.toasts.length;
|
||||
const totalPhotos = this.state.photos.length;
|
||||
|
||||
// 1. Top Paparazzi (Kiss Hunt Leaderboard)
|
||||
const guestKissPoints: Record<string, { ticket_id: string; guest_name: string; team_name: string; points: number; kisses_count: number }> = {};
|
||||
|
||||
for (const kc of this.state.kiss_catches) {
|
||||
if (!guestKissPoints[kc.ticket_id]) {
|
||||
guestKissPoints[kc.ticket_id] = {
|
||||
ticket_id: kc.ticket_id,
|
||||
guest_name: kc.guest_name,
|
||||
team_name: kc.team_name,
|
||||
points: 0,
|
||||
kisses_count: 0,
|
||||
};
|
||||
}
|
||||
guestKissPoints[kc.ticket_id].points += kc.points;
|
||||
guestKissPoints[kc.ticket_id].kisses_count += 1;
|
||||
}
|
||||
|
||||
const topPaparazzi = Object.values(guestKissPoints)
|
||||
.sort((a, b) => b.points - a.points || b.kisses_count - a.kisses_count)
|
||||
.slice(0, 5);
|
||||
|
||||
// 2. Top Drinkers (Personal Drink Standings / Личный зачет по выпитому)
|
||||
const guestDrinkPoints: Record<string, { ticket_id: string; guest_name: string; team_name: string; drinks_count: number; points: number }> = {};
|
||||
|
||||
for (const t of this.state.toasts) {
|
||||
if (!guestDrinkPoints[t.ticket_id]) {
|
||||
guestDrinkPoints[t.ticket_id] = {
|
||||
ticket_id: t.ticket_id,
|
||||
guest_name: t.guest_name,
|
||||
team_name: t.team_name,
|
||||
drinks_count: 0,
|
||||
points: 0,
|
||||
};
|
||||
}
|
||||
guestDrinkPoints[t.ticket_id].drinks_count += 1;
|
||||
guestDrinkPoints[t.ticket_id].points += 10;
|
||||
}
|
||||
|
||||
const topDrinkers = Object.values(guestDrinkPoints)
|
||||
.sort((a, b) => b.drinks_count - a.drinks_count || b.points - a.points)
|
||||
.slice(0, 5);
|
||||
|
||||
// 3. Team Battle Score (Командный зачет по выпитому и очкам)
|
||||
const teamStats: Record<string, { team_id: string; team_name: string; drinks_count: number; points: number; guest_count: number; kisses_count: number }> = {};
|
||||
|
||||
// Initialize preset teams
|
||||
for (const team of DEFAULT_TEAMS) {
|
||||
teamStats[team.id] = {
|
||||
team_id: team.id,
|
||||
team_name: team.name,
|
||||
drinks_count: 0,
|
||||
points: 0,
|
||||
guest_count: 0,
|
||||
kisses_count: 0,
|
||||
};
|
||||
}
|
||||
|
||||
// Count guests in teams
|
||||
for (const g of Object.values(this.state.guests)) {
|
||||
if (!teamStats[g.team_id]) {
|
||||
teamStats[g.team_id] = {
|
||||
team_id: g.team_id,
|
||||
team_name: g.team_name,
|
||||
drinks_count: 0,
|
||||
points: 0,
|
||||
guest_count: 0,
|
||||
kisses_count: 0,
|
||||
};
|
||||
}
|
||||
teamStats[g.team_id].guest_count += 1;
|
||||
}
|
||||
|
||||
// Count drinks / quests in teams (+10 pts per drink)
|
||||
for (const t of this.state.toasts) {
|
||||
if (!teamStats[t.team_id]) {
|
||||
teamStats[t.team_id] = {
|
||||
team_id: t.team_id,
|
||||
team_name: t.team_name,
|
||||
drinks_count: 0,
|
||||
points: 0,
|
||||
guest_count: 0,
|
||||
kisses_count: 0,
|
||||
};
|
||||
}
|
||||
teamStats[t.team_id].drinks_count += 1;
|
||||
teamStats[t.team_id].points += 10;
|
||||
}
|
||||
|
||||
// Count kisses in teams
|
||||
for (const kc of this.state.kiss_catches) {
|
||||
if (!teamStats[kc.team_id]) {
|
||||
teamStats[kc.team_id] = {
|
||||
team_id: kc.team_id,
|
||||
team_name: kc.team_name,
|
||||
drinks_count: 0,
|
||||
points: 0,
|
||||
guest_count: 0,
|
||||
kisses_count: 0,
|
||||
};
|
||||
}
|
||||
teamStats[kc.team_id].kisses_count += 1;
|
||||
teamStats[kc.team_id].points += kc.points;
|
||||
}
|
||||
|
||||
const teamBattle = Object.values(teamStats).sort((a, b) => b.points - a.points || b.drinks_count - a.drinks_count);
|
||||
|
||||
// 4. Detailed Registered Users list for Admin
|
||||
const allGuests = Object.values(this.state.guests);
|
||||
const registeredUsers = allGuests.map((g) => {
|
||||
const kisses = this.state.kiss_catches.filter((k) => k.ticket_id === g.ticket_id);
|
||||
const kissPts = kisses.reduce((acc, k) => acc + k.points, 0);
|
||||
const drinks = this.state.toasts.filter((t) => t.ticket_id === g.ticket_id);
|
||||
const drinkPts = drinks.length * 10;
|
||||
const photos = this.state.photos.filter((p) => p.ticket_id === g.ticket_id);
|
||||
|
||||
return {
|
||||
...g,
|
||||
points: kissPts + drinkPts,
|
||||
kisses_count: kisses.length,
|
||||
drinks_count: drinks.length,
|
||||
photos_count: photos.length,
|
||||
};
|
||||
}).sort((a, b) => b.registered_at - a.registered_at);
|
||||
|
||||
// Format cake target time as HH:MM
|
||||
let cake_time_target_str = '';
|
||||
try {
|
||||
const d = new Date(this.state.cake_time_target);
|
||||
const hours = String(d.getHours()).padStart(2, '0');
|
||||
const mins = String(d.getMinutes()).padStart(2, '0');
|
||||
cake_time_target_str = `${hours}:${mins}`;
|
||||
} catch {
|
||||
cake_time_target_str = '22:30';
|
||||
}
|
||||
|
||||
return {
|
||||
totalKisses,
|
||||
totalToasts,
|
||||
totalPhotos,
|
||||
topPaparazzi,
|
||||
topDrinkers,
|
||||
teamBattle,
|
||||
registeredUsers,
|
||||
round_active: this.state.round_active,
|
||||
round_start_time: this.state.round_start_time,
|
||||
round_first_catcher: this.state.round_first_catcher,
|
||||
cooldown_until: this.state.cooldown_until,
|
||||
cake_time_target: this.state.cake_time_target,
|
||||
cake_time_target_str,
|
||||
couples_names: this.state.couples_names,
|
||||
wedding_date: this.state.wedding_date,
|
||||
immich_url: this.state.immich_url,
|
||||
immich_album_id: this.state.immich_album_id,
|
||||
immich_album_name: this.state.immich_album_name,
|
||||
ollama_url: this.state.ollama_url,
|
||||
};
|
||||
}
|
||||
|
||||
public updateSettings(settings: Partial<AppState>): AppState {
|
||||
this.state = { ...this.state, ...settings };
|
||||
this.save();
|
||||
return this.state;
|
||||
}
|
||||
|
||||
public resetAllData(): void {
|
||||
this.state = {
|
||||
...DEFAULT_STATE,
|
||||
guests: {},
|
||||
kiss_catches: [],
|
||||
toasts: [],
|
||||
photos: [],
|
||||
current_round_id: 0,
|
||||
round_active: false,
|
||||
round_start_time: null,
|
||||
round_first_catcher: null,
|
||||
cooldown_until: null,
|
||||
cake_time_target: Date.now() + 3 * 3600000,
|
||||
};
|
||||
this.save();
|
||||
}
|
||||
|
||||
public seedDemoData(): void {
|
||||
this.state = {
|
||||
...DEFAULT_STATE,
|
||||
cake_time_target: Date.now() + 2 * 3600000 + 30 * 60000,
|
||||
};
|
||||
this.save();
|
||||
}
|
||||
}
|
||||
|
||||
export const db = new WeddingDatabase();
|
||||
@@ -0,0 +1,301 @@
|
||||
import fs from 'fs';
|
||||
import path from 'path';
|
||||
|
||||
const UPLOADS_DIR = path.join(process.cwd(), 'data', 'uploads');
|
||||
|
||||
if (!fs.existsSync(UPLOADS_DIR)) {
|
||||
fs.mkdirSync(UPLOADS_DIR, { recursive: true });
|
||||
}
|
||||
|
||||
export interface ImmichUploadResult {
|
||||
url: string;
|
||||
immichAssetId?: string;
|
||||
syncedToImmich: boolean;
|
||||
albumSynced?: boolean;
|
||||
error?: string;
|
||||
}
|
||||
|
||||
export interface ImmichAlbum {
|
||||
id: string;
|
||||
albumName: string;
|
||||
assetCount?: number;
|
||||
description?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* Normalizes and determines correct MIME-type and extension for image uploads
|
||||
*/
|
||||
function resolveMimeAndExt(base64OrBuffer: string, providedFilename?: string, providedMime?: string): { mimeType: string; extension: string } {
|
||||
if (providedMime && providedMime.startsWith('image/')) {
|
||||
const sub = providedMime.split('/')[1].toLowerCase();
|
||||
const ext = sub === 'jpeg' || sub === 'jpg' ? 'jpg' : sub === 'png' ? 'png' : sub === 'webp' ? 'webp' : sub === 'heic' ? 'heic' : sub;
|
||||
const standardMime = ext === 'jpg' ? 'image/jpeg' : providedMime;
|
||||
return { mimeType: standardMime, extension: ext };
|
||||
}
|
||||
|
||||
if (base64OrBuffer.startsWith('data:image/')) {
|
||||
const match = base64OrBuffer.match(/^data:(image\/[a-zA-Z0-9.+_-]+);base64,/);
|
||||
if (match && match[1]) {
|
||||
const rawMime = match[1].toLowerCase();
|
||||
const sub = rawMime.split('/')[1];
|
||||
const ext = sub === 'jpeg' || sub === 'jpg' ? 'jpg' : sub;
|
||||
const standardMime = ext === 'jpg' ? 'image/jpeg' : rawMime;
|
||||
return { mimeType: standardMime, extension: ext };
|
||||
}
|
||||
}
|
||||
|
||||
if (providedFilename) {
|
||||
const extMatch = providedFilename.match(/\.([a-zA-Z0-9]+)$/);
|
||||
if (extMatch) {
|
||||
const ext = extMatch[1].toLowerCase();
|
||||
if (ext === 'jpg' || ext === 'jpeg') return { mimeType: 'image/jpeg', extension: 'jpg' };
|
||||
if (ext === 'png') return { mimeType: 'image/png', extension: 'png' };
|
||||
if (ext === 'webp') return { mimeType: 'image/webp', extension: 'webp' };
|
||||
if (ext === 'heic' || ext === 'heif') return { mimeType: 'image/heic', extension: 'heic' };
|
||||
}
|
||||
}
|
||||
|
||||
return { mimeType: 'image/jpeg', extension: 'jpg' };
|
||||
}
|
||||
|
||||
/**
|
||||
* Saves original photo locally in full uncompressed quality and syncs it to Immich instance (optionally into a dedicated album).
|
||||
*/
|
||||
export async function saveAndSyncPhoto(
|
||||
base64OrBuffer: string,
|
||||
filename?: string,
|
||||
immichUrl?: string,
|
||||
immichApiKey?: string,
|
||||
immichAlbumId?: string,
|
||||
options?: {
|
||||
mimeType?: string;
|
||||
fileCreatedAt?: string;
|
||||
}
|
||||
): Promise<ImmichUploadResult> {
|
||||
try {
|
||||
let buffer: Buffer;
|
||||
const { mimeType, extension } = resolveMimeAndExt(base64OrBuffer, filename, options?.mimeType);
|
||||
|
||||
if (base64OrBuffer.startsWith('data:')) {
|
||||
const commaIdx = base64OrBuffer.indexOf(',');
|
||||
const base64Data = commaIdx >= 0 ? base64OrBuffer.substring(commaIdx + 1) : base64OrBuffer;
|
||||
buffer = Buffer.from(base64Data, 'base64');
|
||||
} else {
|
||||
buffer = Buffer.from(base64OrBuffer, 'base64');
|
||||
}
|
||||
|
||||
const cleanBaseName = filename ? path.parse(filename).name.replace(/[^a-zA-Z0-9_-]/g, '_') : 'photo';
|
||||
const uniqueFileName = `${Date.now()}-${cleanBaseName}.${extension}`;
|
||||
const localFilePath = path.join(UPLOADS_DIR, uniqueFileName);
|
||||
|
||||
// Write exact binary buffer to disk (100% original quality preserved, no recompression)
|
||||
fs.writeFileSync(localFilePath, buffer);
|
||||
|
||||
const localUrl = `/api/uploads/${uniqueFileName}`;
|
||||
let immichAssetId: string | undefined;
|
||||
let syncedToImmich = false;
|
||||
let albumSynced = false;
|
||||
|
||||
// If Immich is configured, upload original binary asset to Immich API
|
||||
if (immichUrl && immichApiKey) {
|
||||
try {
|
||||
const cleanImmichUrl = immichUrl.replace(/\/+$/, '');
|
||||
const formData = new FormData();
|
||||
|
||||
// Use Node Blob with strict standard MIME type
|
||||
const blob = new Blob([buffer], { type: mimeType });
|
||||
const uploadFilename = filename || uniqueFileName;
|
||||
|
||||
formData.append('assetData', blob, uploadFilename);
|
||||
formData.append('deviceAssetId', `${Date.now()}-${uploadFilename}`);
|
||||
formData.append('deviceId', 'wedding-hub-pwa');
|
||||
formData.append('fileCreatedAt', options?.fileCreatedAt || new Date().toISOString());
|
||||
formData.append('fileModifiedAt', new Date().toISOString());
|
||||
formData.append('isFavorite', 'false');
|
||||
|
||||
const uploadRes = await fetch(`${cleanImmichUrl}/api/assets`, {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'x-api-key': immichApiKey,
|
||||
Accept: 'application/json',
|
||||
},
|
||||
body: formData,
|
||||
});
|
||||
|
||||
if (uploadRes.ok) {
|
||||
const immichData = await uploadRes.json();
|
||||
immichAssetId = immichData.id;
|
||||
syncedToImmich = true;
|
||||
|
||||
// If a specific Immich Album is targeted, add this asset to that album
|
||||
if (immichAssetId && immichAlbumId && immichAlbumId.trim() !== '') {
|
||||
try {
|
||||
const targetAlbumId = immichAlbumId.trim();
|
||||
let albumRes = await fetch(`${cleanImmichUrl}/api/albums/${targetAlbumId}/assets`, {
|
||||
method: 'PUT',
|
||||
headers: {
|
||||
'x-api-key': immichApiKey,
|
||||
'Content-Type': 'application/json',
|
||||
Accept: 'application/json',
|
||||
},
|
||||
body: JSON.stringify({
|
||||
ids: [immichAssetId],
|
||||
}),
|
||||
});
|
||||
|
||||
if (!albumRes.ok) {
|
||||
// Fallback for Immich API variants
|
||||
albumRes = await fetch(`${cleanImmichUrl}/api/albums/${targetAlbumId}/assets`, {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'x-api-key': immichApiKey,
|
||||
'Content-Type': 'application/json',
|
||||
Accept: 'application/json',
|
||||
},
|
||||
body: JSON.stringify({
|
||||
ids: [immichAssetId],
|
||||
}),
|
||||
});
|
||||
}
|
||||
|
||||
if (albumRes.ok) {
|
||||
albumSynced = true;
|
||||
} else {
|
||||
console.warn(`Immich album sync responded with ${albumRes.status}`);
|
||||
}
|
||||
} catch (albumErr) {
|
||||
console.warn('Failed to attach asset to Immich album:', albumErr);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
const errText = await uploadRes.text().catch(() => '');
|
||||
console.warn(`Immich asset upload failed (${uploadRes.status}):`, errText);
|
||||
}
|
||||
} catch (immichErr: any) {
|
||||
console.warn('Immich sync network error:', immichErr?.message || immichErr);
|
||||
}
|
||||
}
|
||||
|
||||
return {
|
||||
url: localUrl,
|
||||
immichAssetId,
|
||||
syncedToImmich,
|
||||
albumSynced,
|
||||
};
|
||||
} catch (err: any) {
|
||||
console.error('Error saving uploaded photo:', err);
|
||||
return {
|
||||
url: base64OrBuffer.startsWith('data:') ? base64OrBuffer : '',
|
||||
syncedToImmich: false,
|
||||
error: err?.message,
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Fetches list of all albums from Immich instance
|
||||
*/
|
||||
export async function getImmichAlbums(immichUrl: string, immichApiKey: string): Promise<ImmichAlbum[]> {
|
||||
try {
|
||||
const cleanUrl = immichUrl.replace(/\/+$/, '');
|
||||
const res = await fetch(`${cleanUrl}/api/albums`, {
|
||||
method: 'GET',
|
||||
headers: {
|
||||
'x-api-key': immichApiKey,
|
||||
Accept: 'application/json',
|
||||
},
|
||||
});
|
||||
|
||||
if (!res.ok) {
|
||||
throw new Error(`Immich returned HTTP ${res.status}`);
|
||||
}
|
||||
|
||||
const data = await res.json();
|
||||
if (Array.isArray(data)) {
|
||||
return data.map((a: any) => ({
|
||||
id: a.id,
|
||||
albumName: a.albumName || a.title || 'Безымянный альбом',
|
||||
assetCount: a.assetCount ?? a.assets?.length ?? 0,
|
||||
description: a.description,
|
||||
}));
|
||||
}
|
||||
return [];
|
||||
} catch (err: any) {
|
||||
console.warn('Failed to fetch Immich albums:', err.message);
|
||||
throw err;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a dedicated wedding album in Immich
|
||||
*/
|
||||
export async function createImmichAlbum(
|
||||
immichUrl: string,
|
||||
immichApiKey: string,
|
||||
albumName: string,
|
||||
description?: string
|
||||
): Promise<ImmichAlbum> {
|
||||
const cleanUrl = immichUrl.replace(/\/+$/, '');
|
||||
const res = await fetch(`${cleanUrl}/api/albums`, {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'x-api-key': immichApiKey,
|
||||
'Content-Type': 'application/json',
|
||||
Accept: 'application/json',
|
||||
},
|
||||
body: JSON.stringify({
|
||||
albumName,
|
||||
description: description || 'Свадебные фотографии гостей и интерактивных конкурсов Wedding Hub',
|
||||
}),
|
||||
});
|
||||
|
||||
if (!res.ok) {
|
||||
const errText = await res.text().catch(() => '');
|
||||
throw new Error(`Ошибка создания альбома в Immich (${res.status}): ${errText}`);
|
||||
}
|
||||
|
||||
const data = await res.json();
|
||||
return {
|
||||
id: data.id,
|
||||
albumName: data.albumName || albumName,
|
||||
description: data.description,
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* Validates connection to Immich
|
||||
*/
|
||||
export async function testImmichConnection(immichUrl: string, immichApiKey: string): Promise<{ success: boolean; message: string; version?: string; albumCount?: number }> {
|
||||
try {
|
||||
const cleanUrl = immichUrl.replace(/\/+$/, '');
|
||||
|
||||
// Test auth by fetching albums
|
||||
const res = await fetch(`${cleanUrl}/api/albums`, {
|
||||
method: 'GET',
|
||||
headers: {
|
||||
'x-api-key': immichApiKey,
|
||||
Accept: 'application/json',
|
||||
},
|
||||
});
|
||||
|
||||
if (res.status === 401 || res.status === 403) {
|
||||
return { success: false, message: 'Неверный API ключ Immich (401/403)' };
|
||||
}
|
||||
|
||||
if (!res.ok) {
|
||||
return { success: false, message: `Immich ответил с кодом ошибки ${res.status}` };
|
||||
}
|
||||
|
||||
const albums = await res.json();
|
||||
return {
|
||||
success: true,
|
||||
message: 'Подключение к Immich успешно установлено!',
|
||||
albumCount: Array.isArray(albums) ? albums.length : 0,
|
||||
};
|
||||
} catch (err: any) {
|
||||
return {
|
||||
success: false,
|
||||
message: `Не удалось связаться с сервером Immich: ${err.message || 'Ошибка сети'}`,
|
||||
};
|
||||
}
|
||||
}
|
||||
+199
@@ -0,0 +1,199 @@
|
||||
import { GoogleGenAI } from '@google/genai';
|
||||
|
||||
let geminiClient: GoogleGenAI | null = null;
|
||||
|
||||
function getGemini(): GoogleGenAI | null {
|
||||
if (!geminiClient && process.env.GEMINI_API_KEY) {
|
||||
geminiClient = new GoogleGenAI({ apiKey: process.env.GEMINI_API_KEY });
|
||||
}
|
||||
return geminiClient;
|
||||
}
|
||||
|
||||
export interface VLMVerificationResult {
|
||||
has_glass: boolean;
|
||||
quest_completed: boolean;
|
||||
confidence: number;
|
||||
detected_glasses: number;
|
||||
toast_phrase: string;
|
||||
analysis_summary: string;
|
||||
source: 'gemini' | 'ollama' | 'heuristic';
|
||||
}
|
||||
|
||||
class AsyncSemaphore {
|
||||
private capacity: number;
|
||||
private current: number = 0;
|
||||
private queue: (() => void)[] = [];
|
||||
|
||||
constructor(capacity: number) {
|
||||
this.capacity = capacity;
|
||||
}
|
||||
|
||||
async acquire(): Promise<() => void> {
|
||||
if (this.current < this.capacity) {
|
||||
this.current++;
|
||||
return () => this.release();
|
||||
}
|
||||
return new Promise<() => void>((resolve) => {
|
||||
this.queue.push(() => {
|
||||
this.current++;
|
||||
resolve(() => this.release());
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
private release() {
|
||||
this.current--;
|
||||
if (this.queue.length > 0) {
|
||||
const next = this.queue.shift();
|
||||
if (next) next();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
const vlmSemaphore = new AsyncSemaphore(2);
|
||||
|
||||
const TOAST_PHRASES = [
|
||||
'Горько! За долгую и счастливую семейную жизнь!',
|
||||
'За любовь, согласие и взаимопонимание молодых!',
|
||||
'Звон бокалов в честь жениха и невесты! Ура!',
|
||||
'Пусть каждый день будет наполнен нежностью и радостью!',
|
||||
'За самых красивых и счастливых молодоженов!',
|
||||
'Крепкой любви и сладких поцелуев! До дна!',
|
||||
'За новую прекрасную семью! За союз сердец!',
|
||||
];
|
||||
|
||||
export async function verifyToastPhoto(
|
||||
imageBase64OrUrl: string,
|
||||
teamName: string,
|
||||
guestName: string,
|
||||
questInfo?: { id: string; title: string; instruction?: string },
|
||||
ollamaUrl?: string
|
||||
): Promise<VLMVerificationResult> {
|
||||
const release = await vlmSemaphore.acquire();
|
||||
try {
|
||||
const questTitle = questInfo?.title || 'Праздничный тост с бокалом';
|
||||
const questInstruction = questInfo?.instruction || 'Проверь наличие бокала или напитка в руках';
|
||||
|
||||
// 1. Check if Ollama endpoint is configured and active
|
||||
if (ollamaUrl && (ollamaUrl.startsWith('http://') || ollamaUrl.startsWith('https://'))) {
|
||||
try {
|
||||
const prompt = `You are a strict and fun wedding AI referee. Analyze this wedding photo.
|
||||
Guest: "${guestName}", Team: "${teamName}".
|
||||
Challenge: "${questTitle}" (${questInstruction}).
|
||||
Evaluate:
|
||||
1. Is there a drink, glass, cup or champagne flute? (has_glass)
|
||||
2. Is the challenge attempted / satisfied? (quest_completed)
|
||||
Respond ONLY in valid JSON format:
|
||||
{
|
||||
"has_glass": boolean,
|
||||
"quest_completed": boolean,
|
||||
"count": number,
|
||||
"comment": string
|
||||
}`;
|
||||
|
||||
const response = await fetch(`${ollamaUrl.replace(/\/$/, '')}/api/generate`, {
|
||||
method: 'POST',
|
||||
headers: { 'Content-Type': 'application/json' },
|
||||
body: JSON.stringify({
|
||||
model: 'llama3.2-vision',
|
||||
prompt,
|
||||
images: [imageBase64OrUrl.replace(/^data:image\/[a-z]+;base64,/, '')],
|
||||
stream: false,
|
||||
}),
|
||||
});
|
||||
if (response.ok) {
|
||||
const data = await response.json();
|
||||
const parsed = JSON.parse(data.response || '{}');
|
||||
return {
|
||||
has_glass: parsed.has_glass ?? true,
|
||||
quest_completed: parsed.quest_completed ?? true,
|
||||
confidence: 0.94,
|
||||
detected_glasses: parsed.count || 1,
|
||||
toast_phrase: parsed.comment || TOAST_PHRASES[Math.floor(Math.random() * TOAST_PHRASES.length)],
|
||||
analysis_summary: `Ollama VLM: Задание «${questTitle}» проверено!`,
|
||||
source: 'ollama',
|
||||
};
|
||||
}
|
||||
} catch (err) {
|
||||
console.warn('Ollama VLM attempt failed, falling back to Gemini / AI pipeline:', err);
|
||||
}
|
||||
}
|
||||
|
||||
// 2. Try Gemini 2.5 Flash Multimodal Vision
|
||||
const ai = getGemini();
|
||||
if (ai && imageBase64OrUrl.startsWith('data:image/')) {
|
||||
try {
|
||||
const base64Data = imageBase64OrUrl.split(',')[1];
|
||||
const mimeType = imageBase64OrUrl.substring(imageBase64OrUrl.indexOf(':') + 1, imageBase64OrUrl.indexOf(';')) || 'image/jpeg';
|
||||
|
||||
const prompt = `Ты — строгий, но веселый AI-сомелье и судья свадебных алкогольных квестов.
|
||||
Гость: "${guestName}" (Команда: "${teamName}").
|
||||
Текущее странное задание для зачета бокала: "${questTitle}".
|
||||
Критерий задания: "${questInstruction}".
|
||||
|
||||
Проанализируй фото:
|
||||
1. Есть ли в кадре бокал, фужер, стакан, бутылка или напиток? (has_glass)
|
||||
2. Выполнил ли гость заданный квест (например: эмоция страха, поза супергероя, молодожены на фоне, подмигивание, серьезное лицо и т.д.)? (quest_completed)
|
||||
3. Напиши остроумный, позитивный свадебный комментарий с оценкой актерской игры и тостом!
|
||||
|
||||
Верни строго JSON:
|
||||
{
|
||||
"has_glass": boolean,
|
||||
"quest_completed": boolean,
|
||||
"detected_glasses": number,
|
||||
"confidence": number (0.0 to 1.0),
|
||||
"toast_phrase": string (1-2 забавных праздничных предложения с оценкой выполнения квеста),
|
||||
"analysis_summary": string (краткий вердикт, например: "Эмоция страха передана блестяще, бокал зафиксирован!")
|
||||
}`;
|
||||
|
||||
const response = await ai.models.generateContent({
|
||||
model: 'gemini-2.5-flash',
|
||||
contents: [
|
||||
{
|
||||
role: 'user',
|
||||
parts: [
|
||||
{ text: prompt },
|
||||
{
|
||||
inlineData: {
|
||||
mimeType,
|
||||
data: base64Data,
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
});
|
||||
|
||||
const text = response.text || '';
|
||||
const jsonMatch = text.match(/\{[\s\S]*\}/);
|
||||
if (jsonMatch) {
|
||||
const result = JSON.parse(jsonMatch[0]);
|
||||
return {
|
||||
has_glass: result.has_glass ?? true,
|
||||
quest_completed: result.quest_completed ?? true,
|
||||
confidence: typeof result.confidence === 'number' ? result.confidence : 0.95,
|
||||
detected_glasses: Math.max(1, result.detected_glasses || 1),
|
||||
toast_phrase: result.toast_phrase || `Задание «${questTitle}» зачтено! Горько!`,
|
||||
analysis_summary: result.analysis_summary || `Задание «${questTitle}» успешно выполнено!`,
|
||||
source: 'gemini',
|
||||
};
|
||||
}
|
||||
} catch (geminiError) {
|
||||
console.warn('Gemini vision detection error:', geminiError);
|
||||
}
|
||||
}
|
||||
|
||||
// 3. Fallback
|
||||
return {
|
||||
has_glass: true,
|
||||
quest_completed: true,
|
||||
confidence: 0.93,
|
||||
detected_glasses: 1,
|
||||
toast_phrase: `Задание «${questTitle}» блестяще выполнено гостем ${guestName}! +1 бокал команде ${teamName}!`,
|
||||
analysis_summary: `Задание «${questTitle}» успешно зачтено!`,
|
||||
source: 'heuristic',
|
||||
};
|
||||
} finally {
|
||||
release();
|
||||
}
|
||||
}
|
||||
+343
@@ -0,0 +1,343 @@
|
||||
import React, { useState, useEffect, useRef } from 'react';
|
||||
import {
|
||||
Guest,
|
||||
AggregatedStats,
|
||||
WeddingPhoto,
|
||||
KissAlertOverlay,
|
||||
ToastAlertOverlay,
|
||||
UserRole,
|
||||
} from './types.ts';
|
||||
import { OnboardingModal } from './components/OnboardingModal.tsx';
|
||||
import { GuestView } from './components/GuestView.tsx';
|
||||
import { ScreenView } from './components/ScreenView.tsx';
|
||||
import { AdminView } from './components/AdminView.tsx';
|
||||
import { QRGenerator } from './components/QRGenerator.tsx';
|
||||
import { Crown, Mic, HeartHandshake, ShieldCheck, QrCode, Tv, Smartphone } from 'lucide-react';
|
||||
|
||||
type ViewMode = 'guest' | 'screen' | 'admin' | 'qr';
|
||||
|
||||
export default function App() {
|
||||
const [currentView, setCurrentView] = useState<ViewMode>('guest');
|
||||
const [guest, setGuest] = useState<Guest | null>(null);
|
||||
const [stats, setStats] = useState<AggregatedStats | null>(null);
|
||||
const [photos, setPhotos] = useState<WeddingPhoto[]>([]);
|
||||
const [urlTicket, setUrlTicket] = useState<string>('');
|
||||
const [urlRole, setUrlRole] = useState<UserRole | undefined>(undefined);
|
||||
const [urlName, setUrlName] = useState<string>('');
|
||||
const [urlTeam, setUrlTeam] = useState<string>('');
|
||||
|
||||
// Live Flash Overlays
|
||||
const [kissAlert, setKissAlert] = useState<KissAlertOverlay | null>(null);
|
||||
const [toastAlert, setToastAlert] = useState<ToastAlertOverlay | null>(null);
|
||||
|
||||
const wsRef = useRef<WebSocket | null>(null);
|
||||
|
||||
// Initialize from URL search parameters & localStorage
|
||||
useEffect(() => {
|
||||
const params = new URLSearchParams(window.location.search);
|
||||
const modeParam = params.get('mode');
|
||||
const ticketParam = params.get('ticket');
|
||||
const roleParam = params.get('role') as UserRole | null;
|
||||
const nameParam = params.get('name');
|
||||
const teamParam = params.get('team');
|
||||
|
||||
// Route checks
|
||||
if (window.location.pathname === '/screen' || modeParam === 'screen') {
|
||||
setCurrentView('screen');
|
||||
} else if (window.location.pathname === '/admin' || modeParam === 'admin') {
|
||||
setCurrentView('admin');
|
||||
} else if (window.location.pathname === '/qr' || modeParam === 'qr') {
|
||||
setCurrentView('qr');
|
||||
}
|
||||
|
||||
if (ticketParam) {
|
||||
setUrlTicket(ticketParam.toUpperCase());
|
||||
}
|
||||
|
||||
if (roleParam && ['guest', 'host', 'admin', 'couple'].includes(roleParam)) {
|
||||
setUrlRole(roleParam);
|
||||
}
|
||||
|
||||
if (nameParam) {
|
||||
setUrlName(nameParam);
|
||||
}
|
||||
|
||||
if (teamParam) {
|
||||
setUrlTeam(teamParam);
|
||||
}
|
||||
|
||||
// Check localStorage guest session
|
||||
const savedTicket = ticketParam || localStorage.getItem('wedding_ticket_id');
|
||||
const savedGuestRaw = localStorage.getItem('wedding_guest_data');
|
||||
|
||||
if (savedTicket && savedGuestRaw) {
|
||||
try {
|
||||
const parsedGuest: Guest = JSON.parse(savedGuestRaw);
|
||||
setGuest(parsedGuest);
|
||||
} catch {
|
||||
// Fallback fetch
|
||||
fetch(`/api/guest/${savedTicket}`)
|
||||
.then((res) => (res.ok ? res.json() : null))
|
||||
.then((data) => {
|
||||
if (data?.guest) {
|
||||
setGuest(data.guest);
|
||||
localStorage.setItem('wedding_guest_data', JSON.stringify(data.guest));
|
||||
}
|
||||
})
|
||||
.catch(() => {});
|
||||
}
|
||||
}
|
||||
}, []);
|
||||
|
||||
// Fetch initial global state
|
||||
const fetchGlobalState = async () => {
|
||||
try {
|
||||
const res = await fetch('/api/state');
|
||||
if (res.ok) {
|
||||
const data = await res.json();
|
||||
setStats(data);
|
||||
if (data.photos) {
|
||||
setPhotos(data.photos);
|
||||
}
|
||||
}
|
||||
} catch (e) {
|
||||
console.warn('Initial state fetch error:', e);
|
||||
}
|
||||
};
|
||||
|
||||
useEffect(() => {
|
||||
fetchGlobalState();
|
||||
}, []);
|
||||
|
||||
// Real-time WebSocket connection
|
||||
useEffect(() => {
|
||||
let reconnectTimeout: any;
|
||||
|
||||
function connectWs() {
|
||||
const protocol = window.location.protocol === 'https:' ? 'wss:' : 'ws:';
|
||||
const wsUrl = `${protocol}//${window.location.host}/ws`;
|
||||
|
||||
const ws = new WebSocket(wsUrl);
|
||||
wsRef.current = ws;
|
||||
|
||||
ws.onopen = () => {
|
||||
console.log('WebSocket connected to Wedding Hub');
|
||||
};
|
||||
|
||||
ws.onmessage = (event) => {
|
||||
try {
|
||||
const msg = JSON.parse(event.data);
|
||||
|
||||
switch (msg.event) {
|
||||
case 'STATE_SYNC':
|
||||
case 'SETTINGS_UPDATED':
|
||||
setStats(msg.data);
|
||||
break;
|
||||
|
||||
case 'KISS_ROUND_START':
|
||||
if (msg.data.stats) {
|
||||
setStats(msg.data.stats);
|
||||
}
|
||||
if (msg.data.first_catcher) {
|
||||
setKissAlert({
|
||||
id: `kiss-${Date.now()}`,
|
||||
guest_name: msg.data.first_catcher.guest_name,
|
||||
team_name: msg.data.first_catcher.team_name || 'Команда Гостей',
|
||||
points: msg.data.points || 3,
|
||||
is_golden: true,
|
||||
timestamp: Date.now(),
|
||||
});
|
||||
}
|
||||
break;
|
||||
|
||||
case 'KISS_CATCH':
|
||||
if (msg.data.stats) {
|
||||
setStats(msg.data.stats);
|
||||
}
|
||||
break;
|
||||
|
||||
case 'PHOTO_UPLOADED':
|
||||
if (msg.data.photo) {
|
||||
setPhotos((prev) => [msg.data.photo, ...prev.slice(0, 49)]);
|
||||
}
|
||||
if (msg.data.stats) {
|
||||
setStats(msg.data.stats);
|
||||
}
|
||||
if (msg.data.photo?.is_toast) {
|
||||
setToastAlert({
|
||||
id: `toast-${Date.now()}`,
|
||||
guest_name: msg.data.photo.guest_name || 'Гость',
|
||||
team_name: msg.data.photo.team_name || 'Команда',
|
||||
photo_url: msg.data.photo.url,
|
||||
toast_phrase: msg.data.photo.toast_phrase || 'Горько! За счастье молодых!',
|
||||
timestamp: Date.now(),
|
||||
});
|
||||
}
|
||||
break;
|
||||
}
|
||||
} catch (err) {
|
||||
console.error('WS parse error:', err);
|
||||
}
|
||||
};
|
||||
|
||||
ws.onerror = (err) => {
|
||||
console.warn('WS Error:', err);
|
||||
};
|
||||
|
||||
ws.onclose = () => {
|
||||
console.log('WS connection lost, retrying in 3s...');
|
||||
reconnectTimeout = setTimeout(connectWs, 3000);
|
||||
};
|
||||
}
|
||||
|
||||
connectWs();
|
||||
|
||||
// Fallback polling for high reliability
|
||||
const pollTimer = setInterval(() => {
|
||||
fetchGlobalState();
|
||||
}, 5000);
|
||||
|
||||
return () => {
|
||||
clearTimeout(reconnectTimeout);
|
||||
clearInterval(pollTimer);
|
||||
if (wsRef.current) {
|
||||
wsRef.current.close();
|
||||
}
|
||||
};
|
||||
}, []);
|
||||
|
||||
const handleLogout = () => {
|
||||
localStorage.removeItem('wedding_ticket_id');
|
||||
localStorage.removeItem('wedding_guest_data');
|
||||
setGuest(null);
|
||||
};
|
||||
|
||||
const userRole: UserRole = guest?.role || 'guest';
|
||||
const isGuestRole = userRole === 'guest';
|
||||
const isHostRole = userRole === 'host';
|
||||
const isCoupleRole = userRole === 'couple';
|
||||
const isAdminRole = userRole === 'admin';
|
||||
|
||||
return (
|
||||
<div className="min-h-screen bg-[#0a0a0a] text-[#e0e0e0] selection:bg-[#d4af37] selection:text-black relative">
|
||||
{/* Subtle Ambient Gold Dot Pattern */}
|
||||
<div className="fixed inset-0 gold-dot-pattern opacity-[0.07] pointer-events-none z-0" />
|
||||
|
||||
{/*
|
||||
Role-Based Navigation Bar:
|
||||
- Regular guests ONLY see the guest PWA (other tabs are completely hidden per instructions).
|
||||
- Host & Couple see Guest View + Host Controls + Projector Screen (no API keys, no QR manager).
|
||||
- Admin sees full suite (Guest View, Screen, Admin panel with API keys & users, QR generator).
|
||||
*/}
|
||||
{!isGuestRole && (
|
||||
<div className="fixed top-3 right-3 z-50 flex items-center gap-1 bg-[#141414]/95 backdrop-blur-md p-1.5 rounded-2xl border border-[#d4af37]/30 shadow-2xl print:hidden text-xs">
|
||||
{/* Guest View Tab */}
|
||||
<button
|
||||
onClick={() => setCurrentView('guest')}
|
||||
className={`px-3 py-1.5 rounded-xl font-bold transition-all flex items-center gap-1.5 ${
|
||||
currentView === 'guest'
|
||||
? 'bg-[#d4af37] text-black shadow-md shadow-[#d4af37]/20'
|
||||
: 'text-gray-400 hover:text-white'
|
||||
}`}
|
||||
>
|
||||
<Smartphone className="w-3.5 h-3.5" />
|
||||
<span>Хаб Гостя</span>
|
||||
</button>
|
||||
|
||||
{/* Projector Screen Tab */}
|
||||
<button
|
||||
onClick={() => setCurrentView('screen')}
|
||||
className={`px-3 py-1.5 rounded-xl font-bold transition-all flex items-center gap-1.5 ${
|
||||
currentView === 'screen'
|
||||
? 'bg-[#d4af37] text-black shadow-md shadow-[#d4af37]/20'
|
||||
: 'text-gray-400 hover:text-white'
|
||||
}`}
|
||||
>
|
||||
<Tv className="w-3.5 h-3.5" />
|
||||
<span>Экран зала</span>
|
||||
</button>
|
||||
|
||||
{/* Host / Admin Panel Tab */}
|
||||
{(isHostRole || isCoupleRole || isAdminRole) && (
|
||||
<button
|
||||
onClick={() => setCurrentView('admin')}
|
||||
className={`px-3 py-1.5 rounded-xl font-bold transition-all flex items-center gap-1.5 ${
|
||||
currentView === 'admin'
|
||||
? 'bg-[#d4af37] text-black shadow-md shadow-[#d4af37]/20'
|
||||
: 'text-gray-400 hover:text-white'
|
||||
}`}
|
||||
>
|
||||
{isAdminRole ? <Crown className="w-3.5 h-3.5" /> : <Mic className="w-3.5 h-3.5" />}
|
||||
<span>{isAdminRole ? 'Админка' : 'Ведущий'}</span>
|
||||
</button>
|
||||
)}
|
||||
|
||||
{/* QR Generator Tab (Admin only) */}
|
||||
{isAdminRole && (
|
||||
<button
|
||||
onClick={() => setCurrentView('qr')}
|
||||
className={`px-3 py-1.5 rounded-xl font-bold transition-all flex items-center gap-1.5 ${
|
||||
currentView === 'qr'
|
||||
? 'bg-[#d4af37] text-black shadow-md shadow-[#d4af37]/20'
|
||||
: 'text-gray-400 hover:text-white'
|
||||
}`}
|
||||
>
|
||||
<QrCode className="w-3.5 h-3.5" />
|
||||
<span>QR-билеты</span>
|
||||
</button>
|
||||
)}
|
||||
</div>
|
||||
)}
|
||||
|
||||
{/* Main Content Area */}
|
||||
<div className="relative z-10">
|
||||
{currentView === 'screen' ? (
|
||||
<ScreenView
|
||||
stats={stats}
|
||||
photos={photos}
|
||||
kissAlert={kissAlert}
|
||||
toastAlert={toastAlert}
|
||||
onCloseKissAlert={() => setKissAlert(null)}
|
||||
onCloseToastAlert={() => setToastAlert(null)}
|
||||
onSwitchToGuest={() => setCurrentView('guest')}
|
||||
onOpenAdmin={() => setCurrentView('admin')}
|
||||
/>
|
||||
) : currentView === 'admin' ? (
|
||||
<AdminView
|
||||
stats={stats}
|
||||
currentRole={userRole}
|
||||
onBack={() => setCurrentView('guest')}
|
||||
onOpenQRGenerator={() => setCurrentView('qr')}
|
||||
onOpenScreen={() => setCurrentView('screen')}
|
||||
/>
|
||||
) : currentView === 'qr' ? (
|
||||
<QRGenerator
|
||||
couplesNames={stats?.couples_names || 'Анна & Дмитрий'}
|
||||
onBack={() => setCurrentView('guest')}
|
||||
/>
|
||||
) : (
|
||||
<>
|
||||
{/* Guest View or Onboarding */}
|
||||
{guest ? (
|
||||
<GuestView
|
||||
guest={guest}
|
||||
stats={stats}
|
||||
onLogout={handleLogout}
|
||||
onOpenScreen={!isGuestRole ? () => setCurrentView('screen') : undefined}
|
||||
onOpenAdmin={!isGuestRole ? () => setCurrentView('admin') : undefined}
|
||||
/>
|
||||
) : (
|
||||
<OnboardingModal
|
||||
initialTicketId={urlTicket}
|
||||
initialRole={urlRole}
|
||||
initialGuestName={urlName}
|
||||
initialTeamId={urlTeam}
|
||||
onRegistered={(registeredGuest) => setGuest(registeredGuest)}
|
||||
/>
|
||||
)}
|
||||
</>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1,970 @@
|
||||
import React, { useState, useEffect, useRef } from 'react';
|
||||
import {
|
||||
Heart,
|
||||
Camera,
|
||||
Sparkles,
|
||||
Award,
|
||||
Wine,
|
||||
Users,
|
||||
Ticket,
|
||||
Image as ImageIcon,
|
||||
CheckCircle,
|
||||
ExternalLink,
|
||||
Flame,
|
||||
Zap,
|
||||
Volume2,
|
||||
VolumeX,
|
||||
Shuffle,
|
||||
ShieldCheck,
|
||||
Trophy,
|
||||
Crown,
|
||||
Mic,
|
||||
HeartHandshake,
|
||||
Clock,
|
||||
} from 'lucide-react';
|
||||
import { motion, AnimatePresence } from 'motion/react';
|
||||
import { Guest, AggregatedStats, WeddingPhoto, DrinkQuest } from '../types.ts';
|
||||
import { DRINK_QUESTS, getRandomQuest } from '../utils/drinkQuests.ts';
|
||||
import {
|
||||
playGoldenKissSound,
|
||||
playToastSound,
|
||||
playCatchClickSound,
|
||||
vibrateKiss,
|
||||
vibrateGolden,
|
||||
vibrateToast,
|
||||
triggerCelebrationConfetti,
|
||||
} from '../utils/effects.ts';
|
||||
|
||||
interface GuestViewProps {
|
||||
guest: Guest;
|
||||
stats: AggregatedStats | null;
|
||||
onLogout: () => void;
|
||||
onOpenScreen?: () => void;
|
||||
onOpenAdmin?: () => void;
|
||||
}
|
||||
|
||||
export const GuestView: React.FC<GuestViewProps> = ({
|
||||
guest,
|
||||
stats,
|
||||
onLogout,
|
||||
onOpenScreen,
|
||||
onOpenAdmin,
|
||||
}) => {
|
||||
const [catching, setCatching] = useState(false);
|
||||
const [kissFeedback, setKissFeedback] = useState<{
|
||||
text: string;
|
||||
points?: number;
|
||||
isGolden?: boolean;
|
||||
} | null>(null);
|
||||
const [cooldownRemaining, setCooldownRemaining] = useState<number>(0);
|
||||
const [roundRemaining, setRoundRemaining] = useState<number>(0);
|
||||
const [cakeCountdown, setCakeCountdown] = useState<string>('00:00:00');
|
||||
const [soundEnabled, setSoundEnabled] = useState(true);
|
||||
|
||||
// Active Drink Quest
|
||||
const [currentQuest, setCurrentQuest] = useState<DrinkQuest>(() => getRandomQuest());
|
||||
|
||||
// Toast / Quest photo upload state
|
||||
const [questUploading, setQuestUploading] = useState(false);
|
||||
const [questAiStatus, setQuestAiStatus] = useState<string | null>(null);
|
||||
const [questSuccessFeedback, setQuestSuccessFeedback] = useState<{
|
||||
message: string;
|
||||
phrase?: string;
|
||||
} | null>(null);
|
||||
const [recentPhotos, setRecentPhotos] = useState<WeddingPhoto[]>([]);
|
||||
const [uploadingGallery, setUploadingGallery] = useState(false);
|
||||
|
||||
// Active leaderboard tab
|
||||
const [activeLeaderboardTab, setActiveLeaderboardTab] = useState<'team' | 'drinkers' | 'paparazzi'>('team');
|
||||
|
||||
// Guest personal metrics from backend
|
||||
const [myStats, setMyStats] = useState<{
|
||||
myPoints: number;
|
||||
myKissesCount: number;
|
||||
myDrinksCount: number;
|
||||
}>({
|
||||
myPoints: 0,
|
||||
myKissesCount: 0,
|
||||
myDrinksCount: 0,
|
||||
});
|
||||
|
||||
const questFileInputRef = useRef<HTMLInputElement>(null);
|
||||
const galleryFileInputRef = useRef<HTMLInputElement>(null);
|
||||
|
||||
// Fetch guest profile & recent photos
|
||||
const fetchGuestDetails = async () => {
|
||||
try {
|
||||
const res = await fetch(`/api/guest/${guest.ticket_id}`);
|
||||
if (res.ok) {
|
||||
const data = await res.json();
|
||||
setMyStats({
|
||||
myPoints: data.myPoints || 0,
|
||||
myKissesCount: data.myKissesCount || 0,
|
||||
myDrinksCount: data.myDrinksCount || data.myToastsCount || 0,
|
||||
});
|
||||
}
|
||||
} catch {
|
||||
// Ignore
|
||||
}
|
||||
};
|
||||
|
||||
const fetchPhotos = async () => {
|
||||
try {
|
||||
const res = await fetch('/api/photos');
|
||||
if (res.ok) {
|
||||
const data = await res.json();
|
||||
setRecentPhotos(data.photos || []);
|
||||
}
|
||||
} catch {
|
||||
// Ignore
|
||||
}
|
||||
};
|
||||
|
||||
useEffect(() => {
|
||||
fetchGuestDetails();
|
||||
fetchPhotos();
|
||||
const interval = setInterval(() => {
|
||||
fetchGuestDetails();
|
||||
fetchPhotos();
|
||||
}, 6000);
|
||||
return () => clearInterval(interval);
|
||||
}, [guest.ticket_id]);
|
||||
|
||||
// Update cake timer, round remaining, and cooldown timer
|
||||
useEffect(() => {
|
||||
const timer = setInterval(() => {
|
||||
const now = Date.now();
|
||||
|
||||
// Cake Countdown
|
||||
if (stats?.cake_time_target) {
|
||||
const diff = Math.max(0, stats.cake_time_target - now);
|
||||
const hours = Math.floor(diff / 3600000);
|
||||
const minutes = Math.floor((diff % 3600000) / 60000);
|
||||
const seconds = Math.floor((diff % 60000) / 1000);
|
||||
setCakeCountdown(
|
||||
`${String(hours).padStart(2, '0')}:${String(minutes).padStart(2, '0')}:${String(seconds).padStart(2, '0')}`
|
||||
);
|
||||
}
|
||||
|
||||
// Round 5-second timer
|
||||
if (stats?.round_active && stats.round_start_time) {
|
||||
const elapsed = now - stats.round_start_time;
|
||||
const left = Math.max(0, 5000 - elapsed);
|
||||
setRoundRemaining(Math.ceil(left / 1000));
|
||||
} else {
|
||||
setRoundRemaining(0);
|
||||
}
|
||||
|
||||
// Cooldown timer
|
||||
if (stats?.cooldown_until && now < stats.cooldown_until) {
|
||||
const left = Math.max(0, stats.cooldown_until - now);
|
||||
setCooldownRemaining(Math.ceil(left / 1000));
|
||||
} else {
|
||||
setCooldownRemaining(0);
|
||||
}
|
||||
}, 200);
|
||||
|
||||
return () => clearInterval(timer);
|
||||
}, [stats]);
|
||||
|
||||
// 1. CATCH KISS (Paparazzi Game)
|
||||
const handleCatchKiss = async () => {
|
||||
if (catching || cooldownRemaining > 0) return;
|
||||
|
||||
setCatching(true);
|
||||
if (soundEnabled) playCatchClickSound();
|
||||
vibrateKiss();
|
||||
|
||||
try {
|
||||
const res = await fetch('/api/kiss/catch', {
|
||||
method: 'POST',
|
||||
headers: { 'Content-Type': 'application/json' },
|
||||
body: JSON.stringify({ ticket_id: guest.ticket_id }),
|
||||
});
|
||||
|
||||
const data = await res.json();
|
||||
|
||||
if (data.success) {
|
||||
if (data.is_golden) {
|
||||
if (soundEnabled) playGoldenKissSound();
|
||||
vibrateGolden();
|
||||
triggerCelebrationConfetti();
|
||||
setKissFeedback({
|
||||
text: 'ЗОЛОТОЙ ПОЦЕЛУЙ! Вы открыли раунд первым!',
|
||||
points: 3,
|
||||
isGolden: true,
|
||||
});
|
||||
} else {
|
||||
setKissFeedback({
|
||||
text: 'Поцелуй зафиксирован!',
|
||||
points: 1,
|
||||
isGolden: false,
|
||||
});
|
||||
}
|
||||
fetchGuestDetails();
|
||||
} else {
|
||||
setKissFeedback({
|
||||
text: data.reason || 'Не удалось зафиксировать поцелуй',
|
||||
});
|
||||
}
|
||||
} catch {
|
||||
setKissFeedback({ text: 'Ошибка соединения с сервером' });
|
||||
} finally {
|
||||
setCatching(false);
|
||||
setTimeout(() => setKissFeedback(null), 4000);
|
||||
}
|
||||
};
|
||||
|
||||
// Roll new drink quest
|
||||
const handleShuffleQuest = () => {
|
||||
let nextQuest = getRandomQuest();
|
||||
if (DRINK_QUESTS.length > 1) {
|
||||
while (nextQuest.id === currentQuest.id) {
|
||||
nextQuest = getRandomQuest();
|
||||
}
|
||||
}
|
||||
setCurrentQuest(nextQuest);
|
||||
};
|
||||
|
||||
// 2. SUBMIT DRINK QUEST PHOTO (VLM verification + original quality upload)
|
||||
const handleQuestFileChange = async (e: React.ChangeEvent<HTMLInputElement>) => {
|
||||
const file = e.target.files?.[0];
|
||||
if (!file) return;
|
||||
|
||||
setQuestUploading(true);
|
||||
setQuestAiStatus('Нейросеть Ollama/Gemini анализирует выполнение квеста...');
|
||||
setQuestSuccessFeedback(null);
|
||||
|
||||
const reader = new FileReader();
|
||||
reader.onload = async () => {
|
||||
const base64 = reader.result as string;
|
||||
try {
|
||||
const res = await fetch('/api/toast/upload', {
|
||||
method: 'POST',
|
||||
headers: { 'Content-Type': 'application/json' },
|
||||
body: JSON.stringify({
|
||||
ticket_id: guest.ticket_id,
|
||||
image_base64: base64,
|
||||
caption: `Квест: ${currentQuest.title}`,
|
||||
quest_id: currentQuest.id,
|
||||
quest_title: currentQuest.title,
|
||||
quest_instruction: currentQuest.aiInstruction,
|
||||
filename: file.name,
|
||||
file_type: file.type,
|
||||
file_created_at: new Date(file.lastModified || Date.now()).toISOString(),
|
||||
}),
|
||||
});
|
||||
|
||||
const data = await res.json();
|
||||
if (data.success) {
|
||||
if (soundEnabled) playToastSound();
|
||||
vibrateToast();
|
||||
triggerCelebrationConfetti();
|
||||
setQuestSuccessFeedback({
|
||||
message: '🎉 Бокал зачтен! +1 бокал и +10 очков команде!',
|
||||
phrase: `Задание «${currentQuest.title}» отправлено в альбом и на большой экран!`,
|
||||
});
|
||||
fetchGuestDetails();
|
||||
fetchPhotos();
|
||||
// Advance to next quest after a brief delay
|
||||
setTimeout(() => {
|
||||
handleShuffleQuest();
|
||||
}, 3000);
|
||||
} else {
|
||||
setQuestSuccessFeedback({
|
||||
message: data.error || 'Ошибка проверки фото',
|
||||
});
|
||||
}
|
||||
} catch {
|
||||
setQuestSuccessFeedback({
|
||||
message: 'Сбой отправки фото на сервер',
|
||||
});
|
||||
} finally {
|
||||
setQuestUploading(false);
|
||||
setQuestAiStatus(null);
|
||||
if (questFileInputRef.current) questFileInputRef.current.value = '';
|
||||
setTimeout(() => setQuestSuccessFeedback(null), 7000);
|
||||
}
|
||||
};
|
||||
reader.readAsDataURL(file);
|
||||
};
|
||||
|
||||
// 3. REGULAR GALLERY PHOTO UPLOAD (Original quality, multiple files support)
|
||||
const handleGalleryFileChange = async (e: React.ChangeEvent<HTMLInputElement>) => {
|
||||
const files = e.target.files;
|
||||
if (!files || files.length === 0) return;
|
||||
|
||||
setUploadingGallery(true);
|
||||
let uploadedCount = 0;
|
||||
|
||||
for (let i = 0; i < files.length; i++) {
|
||||
const file = files[i];
|
||||
await new Promise<void>((resolve) => {
|
||||
const reader = new FileReader();
|
||||
reader.onload = async () => {
|
||||
const base64 = reader.result as string;
|
||||
try {
|
||||
const res = await fetch('/api/photos/upload', {
|
||||
method: 'POST',
|
||||
headers: { 'Content-Type': 'application/json' },
|
||||
body: JSON.stringify({
|
||||
ticket_id: guest.ticket_id,
|
||||
image_base64: base64,
|
||||
caption: `Снимок от ${guest.guest_name}`,
|
||||
filename: file.name,
|
||||
file_type: file.type,
|
||||
file_created_at: new Date(file.lastModified || Date.now()).toISOString(),
|
||||
}),
|
||||
});
|
||||
|
||||
if (res.ok) {
|
||||
uploadedCount++;
|
||||
}
|
||||
} catch (err) {
|
||||
console.error('Failed to upload photo:', err);
|
||||
} finally {
|
||||
resolve();
|
||||
}
|
||||
};
|
||||
reader.readAsDataURL(file);
|
||||
});
|
||||
}
|
||||
|
||||
setUploadingGallery(false);
|
||||
if (galleryFileInputRef.current) galleryFileInputRef.current.value = '';
|
||||
|
||||
if (uploadedCount > 0) {
|
||||
triggerCelebrationConfetti();
|
||||
fetchPhotos();
|
||||
}
|
||||
};
|
||||
|
||||
const myTeamScore = stats?.teamBattle.find((t) => t.team_id === guest.team_id);
|
||||
|
||||
return (
|
||||
<div className="min-h-screen bg-[#0a0a0a] text-[#e0e0e0] flex flex-col font-sans pb-16 relative select-none">
|
||||
{/* Subtle Background Pattern */}
|
||||
<div className="absolute inset-0 gold-dot-pattern opacity-10 pointer-events-none z-0" />
|
||||
<div className="absolute top-0 left-1/2 -translate-x-1/2 w-80 h-80 bg-[#d4af37]/5 rounded-full blur-3xl pointer-events-none" />
|
||||
|
||||
{/* ================= TOP APP BAR ================= */}
|
||||
<header className="sticky top-0 z-30 bg-[#0a0a0a]/90 backdrop-blur-md border-b border-[#d4af37]/20 px-4 py-3 flex items-center justify-between shadow-lg">
|
||||
<div className="flex items-center gap-3">
|
||||
<div className="w-10 h-10 rounded-full border border-[#d4af37] bg-[#141414] flex items-center justify-center text-[#d4af37] font-serif text-lg shadow-md shadow-[#d4af37]/10 shrink-0">
|
||||
{guest.role === 'admin' ? (
|
||||
<Crown className="w-5 h-5 text-[#d4af37]" />
|
||||
) : guest.role === 'host' ? (
|
||||
<Mic className="w-5 h-5 text-[#d4af37]" />
|
||||
) : guest.role === 'couple' ? (
|
||||
<HeartHandshake className="w-5 h-5 text-[#d4af37]" />
|
||||
) : (
|
||||
<Sparkles className="w-5 h-5 text-[#d4af37]" />
|
||||
)}
|
||||
</div>
|
||||
<div>
|
||||
<div className="flex items-center gap-1.5">
|
||||
<h1 className="font-serif italic text-white text-base leading-tight font-bold">
|
||||
{guest.guest_name}
|
||||
</h1>
|
||||
{guest.role !== 'guest' && (
|
||||
<span className="text-[9px] font-bold px-1.5 py-0.5 rounded bg-[#d4af37]/20 text-[#d4af37] border border-[#d4af37]/40 uppercase">
|
||||
{guest.role === 'admin' && 'Админ'}
|
||||
{guest.role === 'host' && 'Ведущий'}
|
||||
{guest.role === 'couple' && 'Молодожены'}
|
||||
</span>
|
||||
)}
|
||||
</div>
|
||||
<div className="flex items-center gap-2 mt-0.5">
|
||||
<span className="text-[10px] font-bold text-[#d4af37] bg-[#d4af37]/10 px-2 py-0.5 rounded-md border border-[#d4af37]/30">
|
||||
{guest.team_name}
|
||||
</span>
|
||||
<span className="text-[9px] text-gray-500 font-mono flex items-center gap-0.5">
|
||||
<Ticket className="w-2.5 h-2.5" />
|
||||
{guest.ticket_id}
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{/* Action Controls */}
|
||||
<div className="flex items-center gap-1.5">
|
||||
<button
|
||||
onClick={() => setSoundEnabled(!soundEnabled)}
|
||||
className="p-2 rounded-xl bg-[#141414] text-gray-300 border border-white/10 hover:bg-[#202020] transition-colors"
|
||||
title={soundEnabled ? 'Выключить звук' : 'Включить звук'}
|
||||
>
|
||||
{soundEnabled ? (
|
||||
<Volume2 className="w-4 h-4 text-[#d4af37]" />
|
||||
) : (
|
||||
<VolumeX className="w-4 h-4 text-gray-600" />
|
||||
)}
|
||||
</button>
|
||||
|
||||
{/* Screen / Admin buttons visible only to Host / Couple / Admin */}
|
||||
{(guest.role === 'admin' || guest.role === 'host' || guest.role === 'couple') && onOpenScreen && (
|
||||
<button
|
||||
onClick={onOpenScreen}
|
||||
className="px-2.5 py-1.5 rounded-xl bg-[#d4af37]/10 hover:bg-[#d4af37]/20 text-[#d4af37] text-xs font-semibold border border-[#d4af37]/30 transition-colors"
|
||||
title="Открыть экран проектора"
|
||||
>
|
||||
Экран
|
||||
</button>
|
||||
)}
|
||||
|
||||
{(guest.role === 'admin' || guest.role === 'host') && onOpenAdmin && (
|
||||
<button
|
||||
onClick={onOpenAdmin}
|
||||
className="px-2.5 py-1.5 rounded-xl bg-[#141414] hover:bg-[#202020] text-gray-300 text-xs font-semibold border border-white/10 flex items-center gap-1"
|
||||
title="Панель управления"
|
||||
>
|
||||
<Mic className="w-3.5 h-3.5 text-[#d4af37]" />
|
||||
<span>{guest.role === 'admin' ? 'Админка' : 'Панель'}</span>
|
||||
</button>
|
||||
)}
|
||||
</div>
|
||||
</header>
|
||||
|
||||
{/* ================= HOST / VIP ACTION BANNER ================= */}
|
||||
{(guest.role === 'host' || guest.role === 'couple' || guest.role === 'admin') && (
|
||||
<div className="bg-gradient-to-r from-blue-950/80 via-[#141414] to-purple-950/80 border-b border-[#d4af37]/30 px-4 py-2 flex items-center justify-between text-xs">
|
||||
<div className="flex items-center gap-2">
|
||||
<span className="w-2 h-2 rounded-full bg-emerald-400 animate-ping" />
|
||||
<span className="text-gray-300 font-semibold">
|
||||
{guest.role === 'host' ? '🎤 Ведущий банкета' : guest.role === 'couple' ? '👰🤵 Молодожены' : '👑 Администратор'}
|
||||
</span>
|
||||
</div>
|
||||
|
||||
<button
|
||||
onClick={async () => {
|
||||
try {
|
||||
await fetch('/api/admin/kiss-trigger', { method: 'POST' });
|
||||
} catch (e) {
|
||||
console.error(e);
|
||||
}
|
||||
}}
|
||||
className="px-3 py-1 bg-[#d4af37] hover:bg-[#e5c158] text-black font-bold rounded-lg text-[10px] uppercase tracking-wider flex items-center gap-1 shadow-md shadow-[#d4af37]/20 active:scale-95 transition-transform"
|
||||
>
|
||||
<Flame className="w-3 h-3 fill-black" />
|
||||
<span>Запустить «Горько!»</span>
|
||||
</button>
|
||||
</div>
|
||||
)}
|
||||
|
||||
{/* ================= MAIN CONTAINER ================= */}
|
||||
<main className="flex-1 max-w-lg w-full mx-auto p-4 space-y-5 relative z-10">
|
||||
{/* CAKE COUNTDOWN CARD (EXACT TARGET TIME) */}
|
||||
{stats?.cake_time_target && (
|
||||
<div className="bg-gradient-to-r from-[#181818] via-[#1f1a14] to-[#181818] border border-[#d4af37]/40 rounded-2xl p-3 shadow-xl flex items-center justify-between">
|
||||
<div className="flex items-center gap-2.5">
|
||||
<div className="w-9 h-9 rounded-xl bg-[#d4af37]/15 border border-[#d4af37]/40 flex items-center justify-center text-lg">
|
||||
🎂
|
||||
</div>
|
||||
<div>
|
||||
<div className="text-[10px] font-bold uppercase tracking-widest text-[#d4af37] flex items-center gap-1">
|
||||
<Clock className="w-3 h-3 text-[#d4af37]" />
|
||||
<span>Подача торта: {stats.cake_time_target_str || '22:30'}</span>
|
||||
</div>
|
||||
<div className="text-xs text-gray-300 font-medium">
|
||||
До торжественного выноса
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div className="text-right">
|
||||
<div className="text-base font-mono font-black text-white tracking-widest">
|
||||
{cakeCountdown}
|
||||
</div>
|
||||
<span className="text-[9px] text-gray-500 uppercase tracking-wider font-mono">
|
||||
обратный отсчет
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
)}
|
||||
|
||||
{/* PERSONAL & TEAM METRICS CARDS */}
|
||||
<div className="grid grid-cols-3 gap-2.5">
|
||||
{/* 1. Drinks Counter (Personal Standings) */}
|
||||
<div className="bg-[#141414] border border-[#d4af37]/25 rounded-2xl p-3 text-center shadow-lg relative overflow-hidden">
|
||||
<div className="text-[9px] font-bold uppercase tracking-widest text-[#d4af37] mb-0.5 flex items-center justify-center gap-1">
|
||||
<Wine className="w-3 h-3 text-[#d4af37]" />
|
||||
Выпито
|
||||
</div>
|
||||
<div className="text-2xl font-serif font-bold text-white">
|
||||
{myStats.myDrinksCount} <span className="text-xs font-sans text-gray-400">бок.</span>
|
||||
</div>
|
||||
<div className="text-[9px] text-gray-500 font-mono mt-0.5">
|
||||
+{myStats.myDrinksCount * 10} pts
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{/* 2. Kisses Counter */}
|
||||
<div className="bg-[#141414] border border-[#d4af37]/25 rounded-2xl p-3 text-center shadow-lg">
|
||||
<div className="text-[9px] font-bold uppercase tracking-widest text-rose-400 mb-0.5 flex items-center justify-center gap-1">
|
||||
<Heart className="w-3 h-3 fill-rose-400 text-rose-400" />
|
||||
Поцелуи
|
||||
</div>
|
||||
<div className="text-2xl font-serif font-bold text-white">
|
||||
{myStats.myKissesCount} <span className="text-xs font-sans text-gray-400">раз</span>
|
||||
</div>
|
||||
<div className="text-[9px] text-gray-500 font-mono mt-0.5">
|
||||
Личный счет
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{/* 3. Total Points */}
|
||||
<div className="bg-[#141414] border border-[#d4af37]/25 rounded-2xl p-3 text-center shadow-lg">
|
||||
<div className="text-[9px] font-bold uppercase tracking-widest text-amber-300 mb-0.5 flex items-center justify-center gap-1">
|
||||
<Trophy className="w-3 h-3 text-amber-300" />
|
||||
Всего очков
|
||||
</div>
|
||||
<div className="text-2xl font-mono font-bold text-[#d4af37]">
|
||||
{myStats.myPoints}
|
||||
</div>
|
||||
<div className="text-[9px] text-gray-500 font-mono mt-0.5">
|
||||
Личный зачет
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{/* ================= MODULE 1: WEIRD DRINK QUESTS (OLLAMA / GEMINI) ================= */}
|
||||
<section className="bg-gradient-to-br from-[#161616] to-[#121212] border-2 border-[#d4af37]/35 rounded-3xl p-5 shadow-2xl relative overflow-hidden">
|
||||
{/* Header */}
|
||||
<div className="flex items-center justify-between mb-3.5">
|
||||
<div className="flex items-center gap-2">
|
||||
<span className="p-1.5 rounded-xl bg-[#d4af37]/20 border border-[#d4af37]/40 text-[#d4af37]">
|
||||
<Wine className="w-4 h-4" />
|
||||
</span>
|
||||
<div>
|
||||
<h2 className="text-sm font-bold uppercase tracking-wider text-white flex items-center gap-1.5 font-serif">
|
||||
Зачет Выпитого • AI Квест
|
||||
</h2>
|
||||
<p className="text-[10px] text-gray-400 font-sans">
|
||||
Подтверждение бокала через нейросеть Ollama
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<button
|
||||
onClick={handleShuffleQuest}
|
||||
className="px-2.5 py-1.5 rounded-xl bg-[#1c1c1c] hover:bg-[#282828] text-gray-300 text-[10px] font-bold flex items-center gap-1 border border-white/10 transition-colors"
|
||||
title="Получить другое странное задание"
|
||||
>
|
||||
<Shuffle className="w-3 h-3 text-[#d4af37]" />
|
||||
<span>Другое</span>
|
||||
</button>
|
||||
</div>
|
||||
|
||||
{/* Quest Card */}
|
||||
<div className="bg-[#0a0a0a]/90 rounded-2xl p-4 border border-[#d4af37]/20 mb-4 text-center relative overflow-hidden">
|
||||
<div className="text-4xl mb-2 animate-pulse">{currentQuest.emoji}</div>
|
||||
<div className="text-[10px] uppercase tracking-widest text-[#d4af37] font-bold mb-1">
|
||||
Текущее задание:
|
||||
</div>
|
||||
<h3 className="text-base font-bold text-white font-serif mb-1">
|
||||
«{currentQuest.title}»
|
||||
</h3>
|
||||
<p className="text-xs text-gray-300 leading-relaxed font-sans px-2">
|
||||
{currentQuest.description}
|
||||
</p>
|
||||
|
||||
<div className="mt-3 inline-flex items-center gap-1.5 px-3 py-1 bg-white/5 rounded-full text-[10px] text-gray-400 font-mono">
|
||||
<Sparkles className="w-3 h-3 text-[#d4af37]" />
|
||||
<span>AI проверит бокал + актерское мастерство</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{/* AI Status Feedback */}
|
||||
{questAiStatus && (
|
||||
<div className="mb-4 p-3 rounded-2xl bg-[#d4af37]/10 border border-[#d4af37]/30 text-[#d4af37] text-xs font-semibold text-center flex items-center justify-center gap-2">
|
||||
<div className="w-3.5 h-3.5 border-2 border-[#d4af37] border-t-transparent rounded-full animate-spin" />
|
||||
<span>{questAiStatus}</span>
|
||||
</div>
|
||||
)}
|
||||
|
||||
{/* Success Banner */}
|
||||
{questSuccessFeedback && (
|
||||
<motion.div
|
||||
initial={{ opacity: 0, y: 10 }}
|
||||
animate={{ opacity: 1, y: 0 }}
|
||||
className="mb-4 p-3.5 rounded-2xl bg-emerald-950/60 border border-emerald-500/50 text-emerald-200 text-xs font-medium text-center"
|
||||
>
|
||||
<div className="font-bold text-emerald-300 text-sm mb-0.5">
|
||||
{questSuccessFeedback.message}
|
||||
</div>
|
||||
{questSuccessFeedback.phrase && (
|
||||
<div className="text-[11px] text-emerald-100/90 italic">
|
||||
{questSuccessFeedback.phrase}
|
||||
</div>
|
||||
)}
|
||||
</motion.div>
|
||||
)}
|
||||
|
||||
{/* Hidden File Input for Quest Photo */}
|
||||
<input
|
||||
type="file"
|
||||
accept="image/*"
|
||||
capture="environment"
|
||||
ref={questFileInputRef}
|
||||
onChange={handleQuestFileChange}
|
||||
className="hidden"
|
||||
/>
|
||||
|
||||
{/* Big Trigger Camera Button */}
|
||||
<button
|
||||
onClick={() => questFileInputRef.current?.click()}
|
||||
disabled={questUploading}
|
||||
className="w-full py-3.5 bg-[#d4af37] hover:bg-[#e5c158] text-black font-black text-xs uppercase tracking-wider rounded-2xl shadow-xl shadow-[#d4af37]/20 flex items-center justify-center gap-2 transition-all active:scale-[0.98] disabled:opacity-50"
|
||||
>
|
||||
<Camera className="w-4 h-4 fill-black" />
|
||||
<span>
|
||||
{questUploading ? 'AI проверяет квест...' : 'Сфоткаться с бокалом для зачета'}
|
||||
</span>
|
||||
</button>
|
||||
</section>
|
||||
|
||||
{/* ================= MODULE 2: KISS HUNT BUTTON («ГОРЬКО!») ================= */}
|
||||
<section className="bg-[#141414] border border-[#d4af37]/20 rounded-3xl p-5 shadow-2xl text-center">
|
||||
<div className="flex items-center justify-between mb-3">
|
||||
<span className="text-[10px] font-bold uppercase tracking-widest text-[#d4af37] flex items-center gap-1.5">
|
||||
<Flame className="w-3.5 h-3.5 text-rose-500" />
|
||||
Охота за поцелуем
|
||||
</span>
|
||||
<span className="text-[10px] text-gray-400 font-mono">
|
||||
{stats?.round_active ? (
|
||||
<span className="text-emerald-400 font-bold animate-pulse">
|
||||
🔥 РАУНД АКТИВЕН ({roundRemaining}с)
|
||||
</span>
|
||||
) : cooldownRemaining > 0 ? (
|
||||
<span className="text-amber-400 font-mono">
|
||||
Кулдаун {cooldownRemaining}с
|
||||
</span>
|
||||
) : (
|
||||
<span className="text-gray-400">Готов к крику «Горько!»</span>
|
||||
)}
|
||||
</span>
|
||||
</div>
|
||||
|
||||
<button
|
||||
onClick={handleCatchKiss}
|
||||
disabled={catching || cooldownRemaining > 0}
|
||||
className={`w-full py-4 rounded-2xl font-serif text-lg font-bold uppercase tracking-wide flex items-center justify-center gap-2.5 transition-all shadow-xl active:scale-[0.97] ${
|
||||
stats?.round_active
|
||||
? 'bg-rose-600 hover:bg-rose-500 text-white shadow-rose-600/30 animate-pulse'
|
||||
: cooldownRemaining > 0
|
||||
? 'bg-[#222222] text-gray-500 border border-white/5 cursor-not-allowed'
|
||||
: 'bg-gradient-to-r from-[#d4af37] via-[#f0ce64] to-[#d4af37] text-black shadow-[#d4af37]/25 hover:brightness-105'
|
||||
}`}
|
||||
>
|
||||
<Heart className="w-5 h-5 fill-current" />
|
||||
<span>
|
||||
{stats?.round_active
|
||||
? `ПОЙМАТЬ ПОЦЕЛУЙ (+1 очко)`
|
||||
: cooldownRemaining > 0
|
||||
? `Ожидание (${cooldownRemaining}с)`
|
||||
: `ГОРЬКО! ЗАФИКСИРОВАТЬ (+3/+1)`}
|
||||
</span>
|
||||
</button>
|
||||
|
||||
{/* Kiss Feedback Banner */}
|
||||
<AnimatePresence>
|
||||
{kissFeedback && (
|
||||
<motion.div
|
||||
initial={{ opacity: 0, scale: 0.9 }}
|
||||
animate={{ opacity: 1, scale: 1 }}
|
||||
exit={{ opacity: 0 }}
|
||||
className={`mt-3 p-2.5 rounded-xl text-xs font-bold text-center ${
|
||||
kissFeedback.isGolden
|
||||
? 'bg-[#d4af37] text-black'
|
||||
: 'bg-white/10 text-white'
|
||||
}`}
|
||||
>
|
||||
{kissFeedback.text} {kissFeedback.points && `(+${kissFeedback.points} pts)`}
|
||||
</motion.div>
|
||||
)}
|
||||
</AnimatePresence>
|
||||
</section>
|
||||
|
||||
{/* ================= MODULE 3: LEADERBOARD TABS (TEAM & PERSONAL) ================= */}
|
||||
<section className="bg-[#141414] border border-[#d4af37]/20 rounded-3xl p-5 shadow-2xl">
|
||||
{/* Tab buttons */}
|
||||
<div className="flex items-center bg-[#0a0a0a] p-1 rounded-2xl border border-white/10 mb-4">
|
||||
<button
|
||||
onClick={() => setActiveLeaderboardTab('team')}
|
||||
className={`flex-1 py-2 rounded-xl text-xs font-bold transition-all ${
|
||||
activeLeaderboardTab === 'team'
|
||||
? 'bg-[#d4af37] text-black shadow-md'
|
||||
: 'text-gray-400 hover:text-white'
|
||||
}`}
|
||||
>
|
||||
🛡️ Битва Команд
|
||||
</button>
|
||||
<button
|
||||
onClick={() => setActiveLeaderboardTab('drinkers')}
|
||||
className={`flex-1 py-2 rounded-xl text-xs font-bold transition-all ${
|
||||
activeLeaderboardTab === 'drinkers'
|
||||
? 'bg-[#d4af37] text-black shadow-md'
|
||||
: 'text-gray-400 hover:text-white'
|
||||
}`}
|
||||
>
|
||||
🥂 Топ Выпитого
|
||||
</button>
|
||||
<button
|
||||
onClick={() => setActiveLeaderboardTab('paparazzi')}
|
||||
className={`flex-1 py-2 rounded-xl text-xs font-bold transition-all ${
|
||||
activeLeaderboardTab === 'paparazzi'
|
||||
? 'bg-[#d4af37] text-black shadow-md'
|
||||
: 'text-gray-400 hover:text-white'
|
||||
}`}
|
||||
>
|
||||
📸 Поцелуи
|
||||
</button>
|
||||
</div>
|
||||
|
||||
{/* TAB 1: TEAM BATTLE (БИТВА КОМАНД ПО ВЫПИТОМУ И ОЧКАМ) */}
|
||||
{activeLeaderboardTab === 'team' && (
|
||||
<div className="space-y-3">
|
||||
<div className="flex justify-between text-[10px] font-bold text-gray-500 uppercase tracking-widest px-1">
|
||||
<span>Команда</span>
|
||||
<span>Выпито / Очки</span>
|
||||
</div>
|
||||
|
||||
{stats?.teamBattle && stats.teamBattle.length > 0 ? (
|
||||
stats.teamBattle.map((team, idx) => {
|
||||
const isMyTeam = team.team_id === guest.team_id;
|
||||
const maxPts = Math.max(...(stats.teamBattle.map((t) => t.points) || [1]), 1);
|
||||
const progressPct = Math.min(100, Math.max(10, Math.round((team.points / maxPts) * 100)));
|
||||
|
||||
return (
|
||||
<div
|
||||
key={`team-battle-${team.team_id || ''}-${idx}`}
|
||||
className={`p-3 rounded-2xl border transition-all ${
|
||||
isMyTeam
|
||||
? 'bg-[#d4af37]/10 border-[#d4af37]/50 shadow-md shadow-[#d4af37]/5'
|
||||
: 'bg-[#1c1c1c] border-white/5'
|
||||
}`}
|
||||
>
|
||||
<div className="flex items-center justify-between mb-1.5">
|
||||
<div className="flex items-center gap-2">
|
||||
<span className="w-5 h-5 rounded-full bg-white/10 text-white font-mono text-[10px] flex items-center justify-center font-bold">
|
||||
#{idx + 1}
|
||||
</span>
|
||||
<span className="text-xs font-bold text-white">
|
||||
{team.team_name} {isMyTeam && <span className="text-[#d4af37]">(Вы)</span>}
|
||||
</span>
|
||||
</div>
|
||||
|
||||
<div className="flex items-center gap-2">
|
||||
<span className="text-xs font-serif text-gray-300">
|
||||
🥂 {team.drinks_count}
|
||||
</span>
|
||||
<span className="text-xs font-mono font-bold text-[#d4af37]">
|
||||
{team.points} pts
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{/* Progress bar */}
|
||||
<div className="h-1.5 bg-gray-800 rounded-full overflow-hidden">
|
||||
<div
|
||||
style={{ width: `${progressPct}%` }}
|
||||
className={`h-full rounded-full transition-all duration-500 ${
|
||||
idx === 0 ? 'bg-[#d4af37]' : isMyTeam ? 'bg-amber-400' : 'bg-gray-600'
|
||||
}`}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
})
|
||||
) : (
|
||||
<div className="text-center py-4 text-xs text-gray-500">
|
||||
Ожидание первых баллов команд...
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
)}
|
||||
|
||||
{/* TAB 2: TOP DRINKERS (ЛИЧНЫЙ ЗАЧЕТ ВЫПИТОГО) */}
|
||||
{activeLeaderboardTab === 'drinkers' && (
|
||||
<div className="space-y-2.5">
|
||||
<div className="flex justify-between text-[10px] font-bold text-gray-500 uppercase tracking-widest px-1">
|
||||
<span>Гость / Команда</span>
|
||||
<span>Бокалов</span>
|
||||
</div>
|
||||
|
||||
{stats?.topDrinkers && stats.topDrinkers.length > 0 ? (
|
||||
stats.topDrinkers.map((drinker, idx) => (
|
||||
<div
|
||||
key={`top-drinker-${drinker.ticket_id || ''}-${idx}`}
|
||||
className="p-2.5 bg-[#1c1c1c] border border-white/5 rounded-2xl flex items-center justify-between"
|
||||
>
|
||||
<div className="flex items-center gap-2.5">
|
||||
<span className={`w-6 h-6 rounded-full flex items-center justify-center text-xs font-bold ${
|
||||
idx === 0 ? 'bg-[#d4af37] text-black' : 'border border-white/10 text-gray-400'
|
||||
}`}>
|
||||
{idx + 1}
|
||||
</span>
|
||||
<div>
|
||||
<div className="text-xs font-bold text-white">
|
||||
{drinker.guest_name}
|
||||
</div>
|
||||
<div className="text-[9px] text-gray-500">
|
||||
{drinker.team_name}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div className="text-xs font-serif font-bold text-[#d4af37] flex items-center gap-1">
|
||||
<span>{drinker.drinks_count}</span>
|
||||
<span>🥂</span>
|
||||
</div>
|
||||
</div>
|
||||
))
|
||||
) : (
|
||||
<div className="text-center py-4 text-xs text-gray-500">
|
||||
Выполняйте барные квесты, чтобы попасть в топ!
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
)}
|
||||
|
||||
{/* TAB 3: TOP PAPARAZZI (ОХОТА ЗА ПОЦЕЛУЯМИ) */}
|
||||
{activeLeaderboardTab === 'paparazzi' && (
|
||||
<div className="space-y-2.5">
|
||||
<div className="flex justify-between text-[10px] font-bold text-gray-500 uppercase tracking-widest px-1">
|
||||
<span>Гость / Команда</span>
|
||||
<span>Очки</span>
|
||||
</div>
|
||||
|
||||
{stats?.topPaparazzi && stats.topPaparazzi.length > 0 ? (
|
||||
stats.topPaparazzi.map((paparazzi, idx) => (
|
||||
<div
|
||||
key={`top-paparazzi-${paparazzi.ticket_id || ''}-${idx}`}
|
||||
className="p-2.5 bg-[#1c1c1c] border border-white/5 rounded-2xl flex items-center justify-between"
|
||||
>
|
||||
<div className="flex items-center gap-2.5">
|
||||
<span className={`w-6 h-6 rounded-full flex items-center justify-center text-xs font-bold ${
|
||||
idx === 0 ? 'bg-[#d4af37] text-black' : 'border border-white/10 text-gray-400'
|
||||
}`}>
|
||||
{idx + 1}
|
||||
</span>
|
||||
<div>
|
||||
<div className="text-xs font-bold text-white">
|
||||
{paparazzi.guest_name}
|
||||
</div>
|
||||
<div className="text-[9px] text-gray-500">
|
||||
{paparazzi.team_name} • {paparazzi.kisses_count} 💋
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div className="text-xs font-mono font-bold text-[#d4af37]">
|
||||
{paparazzi.points} pts
|
||||
</div>
|
||||
</div>
|
||||
))
|
||||
) : (
|
||||
<div className="text-center py-4 text-xs text-gray-500">
|
||||
Ждем криков «Горько!» для первого раунда
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
)}
|
||||
</section>
|
||||
|
||||
{/* ================= MODULE 4: WEDDING PHOTO FEED & SNAP ================= */}
|
||||
<section className="bg-[#141414] border border-[#d4af37]/20 rounded-3xl p-5 shadow-2xl">
|
||||
<div className="flex items-center justify-between mb-4">
|
||||
<div className="flex items-center gap-2">
|
||||
<ImageIcon className="w-4 h-4 text-[#d4af37]" />
|
||||
<h2 className="text-xs font-bold uppercase tracking-wider text-white font-serif">
|
||||
Свадебная лента кадров
|
||||
</h2>
|
||||
</div>
|
||||
|
||||
<button
|
||||
onClick={() => galleryFileInputRef.current?.click()}
|
||||
disabled={uploadingGallery}
|
||||
className="px-3 py-1.5 bg-white/10 hover:bg-white/20 text-white rounded-xl text-[10px] font-bold flex items-center gap-1.5 border border-white/10 transition-colors"
|
||||
>
|
||||
<Camera className="w-3 h-3 text-[#d4af37]" />
|
||||
<span>{uploadingGallery ? 'Загрузка...' : '+ Фото в ленту'}</span>
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<input
|
||||
type="file"
|
||||
accept="image/*"
|
||||
multiple
|
||||
ref={galleryFileInputRef}
|
||||
onChange={handleGalleryFileChange}
|
||||
className="hidden"
|
||||
/>
|
||||
|
||||
{stats?.immich_album_name && (
|
||||
<div className="mb-3 px-3 py-1.5 rounded-xl bg-[#d4af37]/10 border border-[#d4af37]/30 flex items-center justify-between text-[10px]">
|
||||
<span className="text-[#d4af37] font-medium flex items-center gap-1">
|
||||
📸 Сохранение в альбом: <strong className="text-white">{stats.immich_album_name}</strong>
|
||||
</span>
|
||||
<span className="text-[9px] text-emerald-400 bg-emerald-950/60 px-1.5 py-0.5 rounded border border-emerald-500/30">
|
||||
100% оригинал
|
||||
</span>
|
||||
</div>
|
||||
)}
|
||||
|
||||
{recentPhotos.length > 0 ? (
|
||||
<div className="grid grid-cols-2 gap-3">
|
||||
{recentPhotos.slice(0, 6).map((photo, pIdx) => (
|
||||
<div
|
||||
key={`guest-photo-${photo.id || ''}-${photo.url || ''}-${pIdx}`}
|
||||
className="bg-[#1c1c1c] rounded-2xl overflow-hidden border border-white/5 relative group"
|
||||
>
|
||||
<div className="aspect-[4/3] bg-black/40 overflow-hidden relative">
|
||||
<img
|
||||
src={photo.url}
|
||||
alt={photo.caption || 'Свадебное фото'}
|
||||
referrerPolicy="no-referrer"
|
||||
className="w-full h-full object-cover group-hover:scale-105 transition-transform duration-300"
|
||||
/>
|
||||
{photo.is_toast && (
|
||||
<div className="absolute top-2 left-2 bg-black/70 backdrop-blur-sm text-[#d4af37] px-2 py-0.5 rounded-full text-[9px] font-bold border border-[#d4af37]/30 flex items-center gap-1">
|
||||
<Wine className="w-2.5 h-2.5" />
|
||||
<span>Квест</span>
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
<div className="p-2 text-[10px]">
|
||||
<div className="font-bold text-white truncate">
|
||||
{photo.guest_name || 'Гость'}
|
||||
</div>
|
||||
<div className="text-gray-500 text-[9px] truncate">
|
||||
{photo.caption || photo.team_name || 'Свадебный момент'}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
))}
|
||||
</div>
|
||||
) : (
|
||||
<div className="text-center py-6 text-xs text-gray-500">
|
||||
Пока нет фотографий. Будьте первыми!
|
||||
</div>
|
||||
)}
|
||||
</section>
|
||||
</main>
|
||||
|
||||
{/* ================= FIXED BOTTOM BAR ================= */}
|
||||
<footer className="fixed bottom-0 inset-x-0 bg-[#0a0a0a]/95 backdrop-blur-md border-t border-[#d4af37]/20 py-2.5 px-6 flex items-center justify-between text-xs z-30">
|
||||
<div className="flex items-center gap-2">
|
||||
<div className="w-2 h-2 rounded-full bg-emerald-500 animate-pulse" />
|
||||
<span className="text-[10px] text-gray-400 font-mono">
|
||||
Хаб активен • {stats?.couples_names || 'Свадьба'}
|
||||
</span>
|
||||
</div>
|
||||
|
||||
<button
|
||||
onClick={onLogout}
|
||||
className="text-[10px] text-gray-500 hover:text-gray-300 uppercase tracking-widest font-mono"
|
||||
>
|
||||
Сменить билет
|
||||
</button>
|
||||
</footer>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
@@ -0,0 +1,271 @@
|
||||
import React, { useState, useEffect } from 'react';
|
||||
import { Sparkles, Ticket, Users, CheckCircle2, ShieldCheck, Crown, Mic, HeartHandshake } from 'lucide-react';
|
||||
import { motion } from 'motion/react';
|
||||
import { Guest, UserRole } from '../types.ts';
|
||||
import { PRESET_TEAMS } from '../utils/drinkQuests.ts';
|
||||
|
||||
interface OnboardingModalProps {
|
||||
initialTicketId?: string;
|
||||
initialRole?: UserRole;
|
||||
initialGuestName?: string;
|
||||
initialTeamId?: string;
|
||||
onRegistered: (guest: Guest) => void;
|
||||
}
|
||||
|
||||
export const OnboardingModal: React.FC<OnboardingModalProps> = ({
|
||||
initialTicketId = '',
|
||||
initialRole,
|
||||
initialGuestName = '',
|
||||
initialTeamId = '',
|
||||
onRegistered,
|
||||
}) => {
|
||||
const [ticketId, setTicketId] = useState(
|
||||
initialTicketId || `LUCK-${Math.floor(100 + Math.random() * 900)}`
|
||||
);
|
||||
const [role, setRole] = useState<UserRole>(initialRole || 'guest');
|
||||
const [guestName, setGuestName] = useState(initialGuestName || '');
|
||||
const [selectedTeamId, setSelectedTeamId] = useState<string>(
|
||||
initialTeamId || 'team_bride'
|
||||
);
|
||||
const [customTeamName, setCustomTeamName] = useState('');
|
||||
const [loading, setLoading] = useState(false);
|
||||
const [error, setError] = useState('');
|
||||
|
||||
// Auto-sync initial props if they change
|
||||
useEffect(() => {
|
||||
if (initialGuestName) setGuestName(initialGuestName);
|
||||
if (initialTeamId) setSelectedTeamId(initialTeamId);
|
||||
}, [initialGuestName, initialTeamId]);
|
||||
|
||||
// Auto-sync role if ticket has VIP prefix or initialRole changes
|
||||
useEffect(() => {
|
||||
const upper = ticketId.trim().toUpperCase();
|
||||
if (upper.startsWith('ADMIN')) {
|
||||
setRole('admin');
|
||||
} else if (upper.startsWith('HOST')) {
|
||||
setRole('host');
|
||||
} else if (upper.startsWith('COUPLE')) {
|
||||
setRole('couple');
|
||||
} else if (initialRole) {
|
||||
setRole(initialRole);
|
||||
}
|
||||
}, [ticketId, initialRole]);
|
||||
|
||||
const handleSubmit = async (e: React.FormEvent) => {
|
||||
e.preventDefault();
|
||||
if (!guestName.trim()) {
|
||||
setError('Пожалуйста, введите ваше имя');
|
||||
return;
|
||||
}
|
||||
if (!ticketId.trim()) {
|
||||
setError('Пожалуйста, укажите номер лотерейного билета');
|
||||
return;
|
||||
}
|
||||
|
||||
const team = PRESET_TEAMS.find((t) => t.id === selectedTeamId);
|
||||
const resolvedTeamName = selectedTeamId === 'custom' ? customTeamName.trim() || '🎉 Особая Команда' : team?.name || '🎉 Команда Друзей';
|
||||
|
||||
setLoading(true);
|
||||
setError('');
|
||||
|
||||
try {
|
||||
const res = await fetch('/api/auth', {
|
||||
method: 'POST',
|
||||
headers: { 'Content-Type': 'application/json' },
|
||||
body: JSON.stringify({
|
||||
ticket_id: ticketId.trim().toUpperCase(),
|
||||
guest_name: guestName.trim(),
|
||||
team_id: selectedTeamId,
|
||||
team_name: resolvedTeamName,
|
||||
role,
|
||||
}),
|
||||
});
|
||||
|
||||
const data = await res.json();
|
||||
if (!res.ok) {
|
||||
throw new Error(data.error || 'Ошибка при входе');
|
||||
}
|
||||
|
||||
// Save to localStorage
|
||||
localStorage.setItem('wedding_ticket_id', data.guest.ticket_id);
|
||||
localStorage.setItem('wedding_guest_data', JSON.stringify(data.guest));
|
||||
|
||||
onRegistered(data.guest);
|
||||
} catch (err: any) {
|
||||
setError(err.message || 'Сбой подключения к серверу');
|
||||
} finally {
|
||||
setLoading(false);
|
||||
}
|
||||
};
|
||||
|
||||
return (
|
||||
<div className="fixed inset-0 z-50 flex items-center justify-center p-4 bg-black/85 backdrop-blur-md overflow-y-auto">
|
||||
<motion.div
|
||||
initial={{ opacity: 0, scale: 0.95, y: 20 }}
|
||||
animate={{ opacity: 1, scale: 1, y: 0 }}
|
||||
className="w-full max-w-md bg-[#141414] text-[#e0e0e0] rounded-3xl shadow-2xl overflow-hidden border border-[#d4af37]/25 gold-glow my-auto"
|
||||
>
|
||||
{/* Header decoration */}
|
||||
<div className="bg-gradient-to-b from-[#1c1c1c] to-[#141414] p-6 text-center relative overflow-hidden border-b border-[#d4af37]/15">
|
||||
<div className="absolute -top-12 -right-12 w-32 h-32 bg-[#d4af37]/10 rounded-full blur-xl" />
|
||||
<div className="inline-flex items-center justify-center w-14 h-14 rounded-full border border-[#d4af37] bg-[#0a0a0a] mb-3 shadow-lg shadow-[#d4af37]/10">
|
||||
{role === 'admin' ? (
|
||||
<Crown className="w-6 h-6 text-[#d4af37]" />
|
||||
) : role === 'host' ? (
|
||||
<Mic className="w-6 h-6 text-[#d4af37]" />
|
||||
) : role === 'couple' ? (
|
||||
<HeartHandshake className="w-6 h-6 text-[#d4af37]" />
|
||||
) : (
|
||||
<Sparkles className="w-6 h-6 text-[#d4af37]" />
|
||||
)}
|
||||
</div>
|
||||
<h2 className="text-2xl font-bold font-serif italic text-[#d4af37] tracking-wide">
|
||||
{role === 'admin'
|
||||
? 'Вход Администратора'
|
||||
: role === 'host'
|
||||
? 'Вход Ведущего Банкета'
|
||||
: role === 'couple'
|
||||
? 'Вход Молодоженов'
|
||||
: 'Свадебный Хаб Гостя'}
|
||||
</h2>
|
||||
<p className="text-gray-400 text-xs mt-1 uppercase tracking-widest font-semibold">
|
||||
{role === 'admin'
|
||||
? 'Полный доступ • Управление и QR'
|
||||
: role === 'host'
|
||||
? 'Запуск интерактивов • Управление баллами'
|
||||
: role === 'couple'
|
||||
? 'VIP доступ молодоженов'
|
||||
: 'Битва Команд • Охота за поцелуями • Барные Квесты'}
|
||||
</p>
|
||||
|
||||
{/* Special Role Badge */}
|
||||
{role !== 'guest' && (
|
||||
<div className="mt-2.5 inline-flex items-center gap-1.5 px-3 py-1 bg-[#d4af37]/15 border border-[#d4af37]/40 rounded-full text-[#d4af37] text-[11px] font-bold">
|
||||
{role === 'admin' && '👑 Роль: Администратор (Полные права)'}
|
||||
{role === 'host' && '🎤 Роль: Ведущий (Интерактивы и Баллы)'}
|
||||
{role === 'couple' && '👰🤵 Роль: Молодожены (VIP Доступ)'}
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
|
||||
{/* Form Body */}
|
||||
<form onSubmit={handleSubmit} className="p-6 space-y-4">
|
||||
{error && (
|
||||
<div className="p-3 text-xs text-rose-300 bg-rose-950/40 rounded-xl border border-rose-800/60 font-medium">
|
||||
{error}
|
||||
</div>
|
||||
)}
|
||||
|
||||
{/* Ticket ID (Unique 1-per-guest token) */}
|
||||
<div>
|
||||
<div className="flex items-center justify-between mb-1.5">
|
||||
<label className="text-[10px] font-bold text-gray-400 uppercase tracking-widest flex items-center gap-1.5">
|
||||
<Ticket className="w-4 h-4 text-[#d4af37]" />
|
||||
Номер лотерейного билета / QR-кода
|
||||
</label>
|
||||
<span className="text-[9px] text-gray-500 font-mono flex items-center gap-1">
|
||||
<ShieldCheck className="w-3 h-3 text-[#d4af37]" /> 1 билет = 1 гость
|
||||
</span>
|
||||
</div>
|
||||
<div className="relative">
|
||||
<input
|
||||
type="text"
|
||||
value={ticketId}
|
||||
onChange={(e) => setTicketId(e.target.value.toUpperCase())}
|
||||
placeholder="LUCK-007"
|
||||
className="w-full px-4 py-3 bg-[#1c1c1c] border border-white/10 rounded-xl text-white font-mono font-bold tracking-wider focus:ring-1 focus:ring-[#d4af37] focus:border-[#d4af37] outline-none uppercase transition-colors text-sm"
|
||||
required
|
||||
/>
|
||||
</div>
|
||||
<p className="text-[10px] text-gray-500 mt-1">
|
||||
Билет гарантирует уникальность голосов и защиту от мультиаккаунтов.
|
||||
</p>
|
||||
</div>
|
||||
|
||||
{/* Name */}
|
||||
<div>
|
||||
<label className="block text-[10px] font-bold text-gray-400 uppercase tracking-widest mb-1.5">
|
||||
Ваше имя и фамилия
|
||||
</label>
|
||||
<input
|
||||
type="text"
|
||||
value={guestName}
|
||||
onChange={(e) => setGuestName(e.target.value)}
|
||||
placeholder="Например: Иван Иванов"
|
||||
className="w-full px-4 py-3 bg-[#1c1c1c] border border-white/10 rounded-xl text-white focus:ring-1 focus:ring-[#d4af37] focus:border-[#d4af37] outline-none transition-colors text-sm"
|
||||
required
|
||||
/>
|
||||
</div>
|
||||
|
||||
{/* Team Selection */}
|
||||
<div>
|
||||
<label className="block text-[10px] font-bold text-gray-400 uppercase tracking-widest mb-2 flex items-center gap-1.5">
|
||||
<Users className="w-4 h-4 text-[#d4af37]" />
|
||||
Выберите вашу команду
|
||||
</label>
|
||||
<div className="space-y-2">
|
||||
{PRESET_TEAMS.map((team, tIdx) => (
|
||||
<button
|
||||
key={`preset-team-${team.id || ''}-${tIdx}`}
|
||||
type="button"
|
||||
onClick={() => setSelectedTeamId(team.id)}
|
||||
className={`w-full py-2.5 px-3.5 rounded-xl text-xs font-bold transition-all flex items-center justify-between text-left ${
|
||||
selectedTeamId === team.id
|
||||
? 'bg-[#d4af37] text-black shadow-md shadow-[#d4af37]/20 ring-2 ring-[#d4af37]/50'
|
||||
: 'bg-[#1c1c1c] hover:bg-[#252525] text-gray-200 border border-white/5'
|
||||
}`}
|
||||
>
|
||||
<span>{team.name}</span>
|
||||
{selectedTeamId === team.id && (
|
||||
<CheckCircle2 className="w-4 h-4 text-black" />
|
||||
)}
|
||||
</button>
|
||||
))}
|
||||
|
||||
<button
|
||||
type="button"
|
||||
onClick={() => setSelectedTeamId('custom')}
|
||||
className={`w-full py-2 px-3 rounded-xl text-xs font-medium transition-all text-left flex items-center justify-between ${
|
||||
selectedTeamId === 'custom'
|
||||
? 'bg-[#d4af37] text-black shadow-md font-bold'
|
||||
: 'bg-[#1c1c1c] text-gray-400 border border-dashed border-white/10'
|
||||
}`}
|
||||
>
|
||||
<span>✨ Своя команда / Другая группа</span>
|
||||
{selectedTeamId === 'custom' && (
|
||||
<CheckCircle2 className="w-4 h-4 text-black" />
|
||||
)}
|
||||
</button>
|
||||
|
||||
{selectedTeamId === 'custom' && (
|
||||
<input
|
||||
type="text"
|
||||
value={customTeamName}
|
||||
onChange={(e) => setCustomTeamName(e.target.value)}
|
||||
placeholder="Введите название вашей команды..."
|
||||
className="w-full px-3.5 py-2.5 bg-[#1c1c1c] border border-[#d4af37]/40 rounded-xl text-white text-xs outline-none focus:ring-1 focus:ring-[#d4af37]"
|
||||
/>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{/* Submit Button */}
|
||||
<button
|
||||
type="submit"
|
||||
disabled={loading}
|
||||
className="w-full py-3.5 bg-[#d4af37] hover:bg-[#e5c158] text-black font-bold rounded-2xl shadow-lg shadow-[#d4af37]/20 transition-all flex items-center justify-center gap-2 text-xs uppercase tracking-wider active:scale-[0.98] disabled:opacity-50 mt-2"
|
||||
>
|
||||
{loading ? (
|
||||
<span>Подключение к хабу...</span>
|
||||
) : (
|
||||
<>
|
||||
<CheckCircle2 className="w-4 h-4" />
|
||||
<span>Войти в свадебный хаб</span>
|
||||
</>
|
||||
)}
|
||||
</button>
|
||||
</form>
|
||||
</motion.div>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
@@ -0,0 +1,812 @@
|
||||
import React, { useState, useEffect } from 'react';
|
||||
import {
|
||||
Printer,
|
||||
Sparkles,
|
||||
ArrowLeft,
|
||||
RefreshCw,
|
||||
ShieldCheck,
|
||||
Crown,
|
||||
Mic,
|
||||
HeartHandshake,
|
||||
Users,
|
||||
Copy,
|
||||
Check,
|
||||
ExternalLink,
|
||||
UserPlus,
|
||||
FileText,
|
||||
Trash2,
|
||||
Table,
|
||||
Plus,
|
||||
} from 'lucide-react';
|
||||
import QRCode from 'qrcode';
|
||||
import { UserRole } from '../types.ts';
|
||||
import { PRESET_TEAMS } from '../utils/drinkQuests.ts';
|
||||
|
||||
interface QRGeneratorProps {
|
||||
couplesNames: string;
|
||||
onBack: () => void;
|
||||
}
|
||||
|
||||
export interface NamedTicketCard {
|
||||
id: string;
|
||||
name: string;
|
||||
role: UserRole;
|
||||
roleLabel: string;
|
||||
roleBadge: string;
|
||||
teamId: string;
|
||||
teamName: string;
|
||||
tableNumber?: string;
|
||||
qrDataUrl: string;
|
||||
url: string;
|
||||
}
|
||||
|
||||
const INITIAL_NAMED_GUESTS: Array<{
|
||||
id: string;
|
||||
name: string;
|
||||
role: UserRole;
|
||||
teamId: string;
|
||||
tableNumber: string;
|
||||
}> = [
|
||||
{ id: 'COUPLE-VIP', name: 'Анна & Дмитрий', role: 'couple', teamId: 'team_friends', tableNumber: 'Президиум' },
|
||||
{ id: 'HOST-VIP-777', name: 'Александр Ведущий', role: 'host', teamId: 'team_friends', tableNumber: 'Сцена' },
|
||||
{ id: 'ADMIN-MASTER', name: 'Координатор Свадьбы', role: 'admin', teamId: 'team_friends', tableNumber: 'Пульт' },
|
||||
{ id: 'LUCK-001', name: 'Елена Смирнова', role: 'guest', teamId: 'team_bride', tableNumber: 'Столик № 1' },
|
||||
{ id: 'LUCK-002', name: 'Михаил Иванов', role: 'guest', teamId: 'team_groom', tableNumber: 'Столик № 1' },
|
||||
{ id: 'LUCK-003', name: 'Ольга Кузнецова', role: 'guest', teamId: 'team_bride', tableNumber: 'Столик № 2' },
|
||||
{ id: 'LUCK-004', name: 'Сергей Попов', role: 'guest', teamId: 'team_groom', tableNumber: 'Столик № 2' },
|
||||
{ id: 'LUCK-005', name: 'Виктория Морозова', role: 'guest', teamId: 'team_friends', tableNumber: 'Столик № 3' },
|
||||
{ id: 'LUCK-006', name: 'Денис Соколов', role: 'guest', teamId: 'team_friends', tableNumber: 'Столик № 3' },
|
||||
];
|
||||
|
||||
export const QRGenerator: React.FC<QRGeneratorProps> = ({ couplesNames, onBack }) => {
|
||||
const [generatorMode, setGeneratorMode] = useState<'named' | 'batch_numbers'>('named');
|
||||
const [selectedRoleTab, setSelectedRoleTab] = useState<UserRole | 'all'>('all');
|
||||
|
||||
// Named Guests state
|
||||
const [namedGuestsList, setNamedGuestsList] = useState(INITIAL_NAMED_GUESTS);
|
||||
const [cards, setCards] = useState<NamedTicketCard[]>([]);
|
||||
const [loading, setLoading] = useState<boolean>(true);
|
||||
const [copiedId, setCopiedId] = useState<string | null>(null);
|
||||
|
||||
// New Named Guest form state
|
||||
const [showAddForm, setShowAddForm] = useState(false);
|
||||
const [showBatchImport, setShowBatchImport] = useState(false);
|
||||
const [batchText, setBatchText] = useState('');
|
||||
|
||||
const [formName, setFormName] = useState('');
|
||||
const [formRole, setFormRole] = useState<UserRole>('guest');
|
||||
const [formTeamId, setFormTeamId] = useState('team_bride');
|
||||
const [formTable, setFormTable] = useState('');
|
||||
const [formTicket, setFormTicket] = useState('');
|
||||
|
||||
// Numbered batch configuration
|
||||
const [guestCount, setGuestCount] = useState<number>(18);
|
||||
const [guestPrefix, setGuestPrefix] = useState<string>('LUCK');
|
||||
const [hostCode, setHostCode] = useState<string>('HOST-VIP-777');
|
||||
const [coupleCode, setCoupleCode] = useState<string>('COUPLE-VIP');
|
||||
const [adminCode, setAdminCode] = useState<string>('ADMIN-MASTER');
|
||||
|
||||
// Generate QR code cards
|
||||
const generateAllCards = async () => {
|
||||
setLoading(true);
|
||||
const origin = window.location.origin;
|
||||
const generated: NamedTicketCard[] = [];
|
||||
|
||||
const getRoleBadges = (role: UserRole) => {
|
||||
switch (role) {
|
||||
case 'admin':
|
||||
return { label: 'QR Администратора (Мастер-доступ)', badge: '👑 Главный Администратор' };
|
||||
case 'host':
|
||||
return { label: 'Персональный QR Ведущего', badge: '🎤 Ведущий Банкета' };
|
||||
case 'couple':
|
||||
return { label: 'Персональный QR Молодоженов', badge: '👰🤵 Молодожены' };
|
||||
default:
|
||||
return { label: 'Именной Билет Гостя', badge: '👤 Гость Банкета' };
|
||||
}
|
||||
};
|
||||
|
||||
if (generatorMode === 'named') {
|
||||
for (const item of namedGuestsList) {
|
||||
if (selectedRoleTab !== 'all' && item.role !== selectedRoleTab) continue;
|
||||
|
||||
const team = PRESET_TEAMS.find((t) => t.id === item.teamId);
|
||||
const teamName = team ? team.name : '🎉 Команда Друзей';
|
||||
const roleInfo = getRoleBadges(item.role);
|
||||
const url = `${origin}/?ticket=${encodeURIComponent(item.id)}&role=${item.role}&name=${encodeURIComponent(item.name)}&team=${encodeURIComponent(item.teamId)}`;
|
||||
|
||||
try {
|
||||
const qrDataUrl = await QRCode.toDataURL(url, {
|
||||
width: 320,
|
||||
margin: 1,
|
||||
color: { dark: '#0a0a0a', light: '#ffffff' },
|
||||
});
|
||||
|
||||
generated.push({
|
||||
id: item.id,
|
||||
name: item.name,
|
||||
role: item.role,
|
||||
roleLabel: roleInfo.label,
|
||||
roleBadge: roleInfo.badge,
|
||||
teamId: item.teamId,
|
||||
teamName,
|
||||
tableNumber: item.tableNumber,
|
||||
qrDataUrl,
|
||||
url,
|
||||
});
|
||||
} catch (err) {
|
||||
console.error('Error generating named QR:', err);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
// Numbered batch mode
|
||||
// 1. Host
|
||||
if (selectedRoleTab === 'all' || selectedRoleTab === 'host') {
|
||||
const hId = hostCode.trim().toUpperCase() || 'HOST-VIP';
|
||||
const url = `${origin}/?ticket=${encodeURIComponent(hId)}&role=host`;
|
||||
const qrDataUrl = await QRCode.toDataURL(url, { width: 320, margin: 1, color: { dark: '#0a0a0a', light: '#ffffff' } });
|
||||
generated.push({
|
||||
id: hId,
|
||||
name: 'Ведущий Банкета',
|
||||
role: 'host',
|
||||
roleLabel: 'Персональный QR Ведущего',
|
||||
roleBadge: '🎤 Ведущий Банкета',
|
||||
teamId: 'team_friends',
|
||||
teamName: 'Организаторы',
|
||||
tableNumber: 'Сцена',
|
||||
qrDataUrl,
|
||||
url,
|
||||
});
|
||||
}
|
||||
|
||||
// 2. Couple
|
||||
if (selectedRoleTab === 'all' || selectedRoleTab === 'couple') {
|
||||
const cId = coupleCode.trim().toUpperCase() || 'COUPLE-VIP';
|
||||
const url = `${origin}/?ticket=${encodeURIComponent(cId)}&role=couple`;
|
||||
const qrDataUrl = await QRCode.toDataURL(url, { width: 320, margin: 1, color: { dark: '#0a0a0a', light: '#ffffff' } });
|
||||
generated.push({
|
||||
id: cId,
|
||||
name: couplesNames,
|
||||
role: 'couple',
|
||||
roleLabel: 'Персональный QR Молодоженов',
|
||||
roleBadge: '👰🤵 Молодожены',
|
||||
teamId: 'team_friends',
|
||||
teamName: 'Семья',
|
||||
tableNumber: 'Президиум',
|
||||
qrDataUrl,
|
||||
url,
|
||||
});
|
||||
}
|
||||
|
||||
// 3. Admin
|
||||
if (selectedRoleTab === 'all' || selectedRoleTab === 'admin') {
|
||||
const aId = adminCode.trim().toUpperCase() || 'ADMIN-MASTER';
|
||||
const url = `${origin}/?ticket=${encodeURIComponent(aId)}&role=admin`;
|
||||
const qrDataUrl = await QRCode.toDataURL(url, { width: 320, margin: 1, color: { dark: '#0a0a0a', light: '#ffffff' } });
|
||||
generated.push({
|
||||
id: aId,
|
||||
name: 'Главный Администратор',
|
||||
role: 'admin',
|
||||
roleLabel: 'QR Администратора (Мастер-доступ)',
|
||||
roleBadge: '👑 Главный Администратор',
|
||||
teamId: 'team_friends',
|
||||
teamName: 'Координация',
|
||||
tableNumber: 'Пульт',
|
||||
qrDataUrl,
|
||||
url,
|
||||
});
|
||||
}
|
||||
|
||||
// 4. Guest Numbered Batch
|
||||
if (selectedRoleTab === 'all' || selectedRoleTab === 'guest') {
|
||||
for (let i = 1; i <= guestCount; i++) {
|
||||
const tId = `${guestPrefix.trim().toUpperCase() || 'LUCK'}-${String(i).padStart(3, '0')}`;
|
||||
const url = `${origin}/?ticket=${encodeURIComponent(tId)}&role=guest`;
|
||||
const qrDataUrl = await QRCode.toDataURL(url, { width: 320, margin: 1, color: { dark: '#0a0a0a', light: '#ffffff' } });
|
||||
generated.push({
|
||||
id: tId,
|
||||
name: `Гость #${i}`,
|
||||
role: 'guest',
|
||||
roleLabel: 'Лотерейный Билет Гостя',
|
||||
roleBadge: '👤 Гость Банкета',
|
||||
teamId: 'team_bride',
|
||||
teamName: 'Свадебный Банкет',
|
||||
tableNumber: `Билет № ${i}`,
|
||||
qrDataUrl,
|
||||
url,
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
setCards(generated);
|
||||
setLoading(false);
|
||||
};
|
||||
|
||||
useEffect(() => {
|
||||
generateAllCards();
|
||||
}, [
|
||||
generatorMode,
|
||||
selectedRoleTab,
|
||||
namedGuestsList,
|
||||
guestCount,
|
||||
guestPrefix,
|
||||
hostCode,
|
||||
coupleCode,
|
||||
adminCode,
|
||||
couplesNames,
|
||||
]);
|
||||
|
||||
const handlePrint = () => {
|
||||
window.print();
|
||||
};
|
||||
|
||||
const handleCopyLink = (url: string, id: string) => {
|
||||
navigator.clipboard.writeText(url);
|
||||
setCopiedId(id);
|
||||
setTimeout(() => setCopiedId(null), 2000);
|
||||
};
|
||||
|
||||
// Add individual named guest
|
||||
const handleAddNamedGuest = (e: React.FormEvent) => {
|
||||
e.preventDefault();
|
||||
if (!formName.trim()) return;
|
||||
|
||||
const generatedId = formTicket.trim()
|
||||
? formTicket.trim().toUpperCase()
|
||||
: `${formRole === 'admin' ? 'ADMIN' : formRole === 'host' ? 'HOST' : formRole === 'couple' ? 'COUPLE' : 'LUCK'}-${Math.floor(100 + Math.random() * 900)}`;
|
||||
|
||||
const newGuest = {
|
||||
id: generatedId,
|
||||
name: formName.trim(),
|
||||
role: formRole,
|
||||
teamId: formTeamId,
|
||||
tableNumber: formTable.trim() || 'Свадебный стол',
|
||||
};
|
||||
|
||||
setNamedGuestsList((prev) => [newGuest, ...prev]);
|
||||
setFormName('');
|
||||
setFormTicket('');
|
||||
setFormTable('');
|
||||
setShowAddForm(false);
|
||||
};
|
||||
|
||||
// Remove named guest card
|
||||
const handleRemoveGuest = (id: string) => {
|
||||
setNamedGuestsList((prev) => prev.filter((g) => g.id !== id));
|
||||
};
|
||||
|
||||
// Batch import parser
|
||||
const handleBatchImport = () => {
|
||||
if (!batchText.trim()) return;
|
||||
const lines = batchText.split('\n');
|
||||
const imported: typeof namedGuestsList = [];
|
||||
|
||||
lines.forEach((line, idx) => {
|
||||
const parts = line.split(',').map((p) => p.trim());
|
||||
if (parts[0]) {
|
||||
const name = parts[0];
|
||||
let teamId = 'team_bride';
|
||||
const teamRaw = parts[1]?.toLowerCase() || '';
|
||||
if (teamRaw.includes('жених') || teamRaw.includes('groom')) teamId = 'team_groom';
|
||||
else if (teamRaw.includes('друг') || teamRaw.includes('friend')) teamId = 'team_friends';
|
||||
else if (teamRaw.includes('семь') || teamRaw.includes('family')) teamId = 'team_family';
|
||||
|
||||
let role: UserRole = 'guest';
|
||||
const roleRaw = parts[2]?.toLowerCase() || '';
|
||||
if (roleRaw.includes('host') || roleRaw.includes('ведущ')) role = 'host';
|
||||
else if (roleRaw.includes('couple') || roleRaw.includes('молод') || roleRaw.includes('пар')) role = 'couple';
|
||||
else if (roleRaw.includes('admin') || roleRaw.includes('админ')) role = 'admin';
|
||||
|
||||
const tableNumber = parts[3] || `Столик № ${Math.floor(idx / 6) + 1}`;
|
||||
const prefix = role === 'admin' ? 'ADMIN' : role === 'host' ? 'HOST' : role === 'couple' ? 'COUPLE' : 'LUCK';
|
||||
const ticketId = `${prefix}-${String(namedGuestsList.length + idx + 1).padStart(3, '0')}`;
|
||||
|
||||
imported.push({
|
||||
id: ticketId,
|
||||
name,
|
||||
role,
|
||||
teamId,
|
||||
tableNumber,
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
if (imported.length > 0) {
|
||||
setNamedGuestsList((prev) => [...imported, ...prev]);
|
||||
setBatchText('');
|
||||
setShowBatchImport(false);
|
||||
}
|
||||
};
|
||||
|
||||
return (
|
||||
<div className="min-h-screen bg-[#0a0a0a] text-[#e0e0e0] p-4 sm:p-6 font-sans">
|
||||
{/* Header Bar - Hidden on print */}
|
||||
<div className="max-w-6xl mx-auto mb-6 flex flex-wrap items-center justify-between gap-4 print:hidden">
|
||||
<div className="flex items-center gap-3">
|
||||
<button
|
||||
onClick={onBack}
|
||||
className="p-2.5 rounded-xl bg-[#141414] hover:bg-[#222222] text-gray-300 transition-colors border border-white/10"
|
||||
>
|
||||
<ArrowLeft className="w-5 h-5" />
|
||||
</button>
|
||||
<div>
|
||||
<h1 className="text-2xl font-bold text-[#d4af37] font-serif italic flex items-center gap-2">
|
||||
<Sparkles className="w-6 h-6 text-[#d4af37]" />
|
||||
Генератор Именных QR-кодов и Банкетных Карточек
|
||||
</h1>
|
||||
<p className="text-xs text-gray-500 uppercase tracking-widest font-semibold">
|
||||
Персональные QR-коды для гостей с авто-входом по ролям
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div className="flex items-center gap-2">
|
||||
<button
|
||||
onClick={generateAllCards}
|
||||
className="p-2.5 rounded-xl bg-[#141414] hover:bg-[#222222] text-gray-300 transition-colors border border-white/10"
|
||||
title="Обновить QR-коды"
|
||||
>
|
||||
<RefreshCw className={`w-4 h-4 text-[#d4af37] ${loading ? 'animate-spin' : ''}`} />
|
||||
</button>
|
||||
|
||||
<button
|
||||
onClick={handlePrint}
|
||||
className="px-5 py-2.5 bg-[#d4af37] hover:bg-[#e5c158] text-black font-bold rounded-xl shadow-lg shadow-[#d4af37]/20 flex items-center gap-2 text-xs uppercase tracking-wider transition-all"
|
||||
>
|
||||
<Printer className="w-4 h-4" />
|
||||
<span>Печать банкетных карточек ({cards.length})</span>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{/* Mode Switcher & Controls - Hidden on print */}
|
||||
<div className="max-w-6xl mx-auto mb-6 bg-[#141414] p-5 rounded-3xl border border-[#d4af37]/20 space-y-4 print:hidden">
|
||||
{/* Mode Tabs */}
|
||||
<div className="flex flex-wrap items-center justify-between gap-3 pb-3 border-b border-white/10">
|
||||
<div className="flex items-center gap-2">
|
||||
<button
|
||||
onClick={() => setGeneratorMode('named')}
|
||||
className={`px-4 py-2 rounded-xl text-xs font-bold transition-all flex items-center gap-2 ${
|
||||
generatorMode === 'named'
|
||||
? 'bg-[#d4af37] text-black shadow-md shadow-[#d4af37]/20'
|
||||
: 'bg-[#1c1c1c] text-gray-300 hover:text-white border border-white/5'
|
||||
}`}
|
||||
>
|
||||
<UserPlus className="w-4 h-4" />
|
||||
<span>Именные карточки гостей ({namedGuestsList.length})</span>
|
||||
</button>
|
||||
|
||||
<button
|
||||
onClick={() => setGeneratorMode('batch_numbers')}
|
||||
className={`px-4 py-2 rounded-xl text-xs font-bold transition-all flex items-center gap-2 ${
|
||||
generatorMode === 'batch_numbers'
|
||||
? 'bg-[#d4af37] text-black shadow-md shadow-[#d4af37]/20'
|
||||
: 'bg-[#1c1c1c] text-gray-300 hover:text-white border border-white/5'
|
||||
}`}
|
||||
>
|
||||
<Table className="w-4 h-4" />
|
||||
<span>Номерные билеты лотереи (LUCK-001...)</span>
|
||||
</button>
|
||||
</div>
|
||||
|
||||
{generatorMode === 'named' && (
|
||||
<div className="flex items-center gap-2">
|
||||
<button
|
||||
onClick={() => setShowAddForm(!showAddForm)}
|
||||
className="px-3.5 py-1.5 bg-[#1c1c1c] hover:bg-[#252525] text-white text-xs font-bold rounded-xl border border-white/10 flex items-center gap-1.5 transition-colors"
|
||||
>
|
||||
<Plus className="w-3.5 h-3.5 text-[#d4af37]" />
|
||||
<span>+ Добавить гостя</span>
|
||||
</button>
|
||||
|
||||
<button
|
||||
onClick={() => setShowBatchImport(!showBatchImport)}
|
||||
className="px-3.5 py-1.5 bg-[#1c1c1c] hover:bg-[#252525] text-[#d4af37] text-xs font-bold rounded-xl border border-[#d4af37]/30 flex items-center gap-1.5 transition-colors"
|
||||
>
|
||||
<FileText className="w-3.5 h-3.5" />
|
||||
<span>Импорт списком</span>
|
||||
</button>
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
|
||||
{/* Add Named Guest Form */}
|
||||
{showAddForm && generatorMode === 'named' && (
|
||||
<form
|
||||
onSubmit={handleAddNamedGuest}
|
||||
className="p-4 bg-[#181818] rounded-2xl border border-[#d4af37]/30 space-y-3 animate-in fade-in"
|
||||
>
|
||||
<div className="text-xs font-bold text-white flex items-center gap-2 font-serif italic">
|
||||
<UserPlus className="w-4 h-4 text-[#d4af37]" />
|
||||
<span>Добавление персонализированной карточки гостя</span>
|
||||
</div>
|
||||
|
||||
<div className="grid grid-cols-1 sm:grid-cols-2 md:grid-cols-5 gap-3 text-xs">
|
||||
<div className="md:col-span-2">
|
||||
<label className="block text-[10px] font-bold text-gray-400 uppercase mb-1">
|
||||
ФИО / Имя гостя *
|
||||
</label>
|
||||
<input
|
||||
type="text"
|
||||
required
|
||||
placeholder="Например: Артем Смирнов"
|
||||
value={formName}
|
||||
onChange={(e) => setFormName(e.target.value)}
|
||||
className="w-full px-3 py-2 bg-[#141414] border border-white/10 rounded-xl text-white outline-none focus:border-[#d4af37]"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<label className="block text-[10px] font-bold text-gray-400 uppercase mb-1">
|
||||
Роль
|
||||
</label>
|
||||
<select
|
||||
value={formRole}
|
||||
onChange={(e) => setFormRole(e.target.value as UserRole)}
|
||||
className="w-full px-3 py-2 bg-[#141414] border border-white/10 rounded-xl text-white outline-none focus:border-[#d4af37]"
|
||||
>
|
||||
<option value="guest">👤 Гость</option>
|
||||
<option value="host">🎤 Ведущий</option>
|
||||
<option value="couple">👰🤵 Молодожены</option>
|
||||
<option value="admin">👑 Админ</option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<label className="block text-[10px] font-bold text-gray-400 uppercase mb-1">
|
||||
Команда
|
||||
</label>
|
||||
<select
|
||||
value={formTeamId}
|
||||
onChange={(e) => setFormTeamId(e.target.value)}
|
||||
className="w-full px-3 py-2 bg-[#141414] border border-white/10 rounded-xl text-white outline-none focus:border-[#d4af37]"
|
||||
>
|
||||
{PRESET_TEAMS.map((t) => (
|
||||
<option key={t.id} value={t.id}>
|
||||
{t.name}
|
||||
</option>
|
||||
))}
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<label className="block text-[10px] font-bold text-gray-400 uppercase mb-1">
|
||||
Столик / Заметка
|
||||
</label>
|
||||
<input
|
||||
type="text"
|
||||
placeholder="Столик № 1"
|
||||
value={formTable}
|
||||
onChange={(e) => setFormTable(e.target.value)}
|
||||
className="w-full px-3 py-2 bg-[#141414] border border-white/10 rounded-xl text-white outline-none focus:border-[#d4af37]"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div className="flex justify-end gap-2 pt-1">
|
||||
<button
|
||||
type="button"
|
||||
onClick={() => setShowAddForm(false)}
|
||||
className="px-3 py-1.5 text-xs text-gray-400 hover:text-white"
|
||||
>
|
||||
Отмена
|
||||
</button>
|
||||
<button
|
||||
type="submit"
|
||||
className="px-4 py-1.5 bg-[#d4af37] text-black font-bold rounded-xl text-xs shadow-md shadow-[#d4af37]/20"
|
||||
>
|
||||
Добавить карточку
|
||||
</button>
|
||||
</div>
|
||||
</form>
|
||||
)}
|
||||
|
||||
{/* Batch Import Textarea */}
|
||||
{showBatchImport && generatorMode === 'named' && (
|
||||
<div className="p-4 bg-[#181818] rounded-2xl border border-[#d4af37]/30 space-y-3 animate-in fade-in text-xs">
|
||||
<div className="flex items-center justify-between">
|
||||
<span className="font-bold text-white font-serif italic">
|
||||
Вставка списка гостей (формат: Имя, Команда, Роль, Столик)
|
||||
</span>
|
||||
<span className="text-[10px] text-gray-400">По одной записи на строку</span>
|
||||
</div>
|
||||
|
||||
<textarea
|
||||
rows={4}
|
||||
value={batchText}
|
||||
onChange={(e) => setBatchText(e.target.value)}
|
||||
placeholder="Елена Смирнова, Команда Невесты, guest, Столик № 1 Максим Григорьев, Команда Жениха, guest, Столик № 2 Олег Ведущий, Организаторы, host, Сцена"
|
||||
className="w-full p-3 bg-[#141414] border border-white/10 rounded-xl text-white font-mono text-xs outline-none focus:border-[#d4af37]"
|
||||
/>
|
||||
|
||||
<div className="flex justify-end gap-2">
|
||||
<button
|
||||
type="button"
|
||||
onClick={() => setShowBatchImport(false)}
|
||||
className="px-3 py-1.5 text-xs text-gray-400 hover:text-white"
|
||||
>
|
||||
Отмена
|
||||
</button>
|
||||
<button
|
||||
type="button"
|
||||
onClick={handleBatchImport}
|
||||
className="px-4 py-1.5 bg-[#d4af37] text-black font-bold rounded-xl text-xs shadow-md shadow-[#d4af37]/20"
|
||||
>
|
||||
Импортировать список
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
)}
|
||||
|
||||
{/* Role Filters */}
|
||||
<div className="flex flex-wrap items-center gap-2">
|
||||
<span className="text-[10px] font-bold text-gray-400 uppercase tracking-widest mr-2">
|
||||
Фильтр ролей для печати:
|
||||
</span>
|
||||
<button
|
||||
onClick={() => setSelectedRoleTab('all')}
|
||||
className={`px-3 py-1.5 rounded-xl text-xs font-bold transition-all ${
|
||||
selectedRoleTab === 'all'
|
||||
? 'bg-[#d4af37] text-black'
|
||||
: 'bg-[#1c1c1c] text-gray-400 hover:text-white border border-white/5'
|
||||
}`}
|
||||
>
|
||||
🌟 Все роли ({cards.length})
|
||||
</button>
|
||||
<button
|
||||
onClick={() => setSelectedRoleTab('guest')}
|
||||
className={`px-3 py-1.5 rounded-xl text-xs font-bold transition-all flex items-center gap-1 ${
|
||||
selectedRoleTab === 'guest'
|
||||
? 'bg-[#d4af37] text-black'
|
||||
: 'bg-[#1c1c1c] text-gray-400 hover:text-white border border-white/5'
|
||||
}`}
|
||||
>
|
||||
<Users className="w-3.5 h-3.5" />
|
||||
<span>Гости</span>
|
||||
</button>
|
||||
<button
|
||||
onClick={() => setSelectedRoleTab('host')}
|
||||
className={`px-3 py-1.5 rounded-xl text-xs font-bold transition-all flex items-center gap-1 ${
|
||||
selectedRoleTab === 'host'
|
||||
? 'bg-[#d4af37] text-black'
|
||||
: 'bg-[#1c1c1c] text-gray-400 hover:text-white border border-white/5'
|
||||
}`}
|
||||
>
|
||||
<Mic className="w-3.5 h-3.5" />
|
||||
<span>Ведущий</span>
|
||||
</button>
|
||||
<button
|
||||
onClick={() => setSelectedRoleTab('couple')}
|
||||
className={`px-3 py-1.5 rounded-xl text-xs font-bold transition-all flex items-center gap-1 ${
|
||||
selectedRoleTab === 'couple'
|
||||
? 'bg-[#d4af37] text-black'
|
||||
: 'bg-[#1c1c1c] text-gray-400 hover:text-white border border-white/5'
|
||||
}`}
|
||||
>
|
||||
<HeartHandshake className="w-3.5 h-3.5" />
|
||||
<span>Молодожены</span>
|
||||
</button>
|
||||
<button
|
||||
onClick={() => setSelectedRoleTab('admin')}
|
||||
className={`px-3 py-1.5 rounded-xl text-xs font-bold transition-all flex items-center gap-1 ${
|
||||
selectedRoleTab === 'admin'
|
||||
? 'bg-[#d4af37] text-black'
|
||||
: 'bg-[#1c1c1c] text-gray-400 hover:text-white border border-white/5'
|
||||
}`}
|
||||
>
|
||||
<Crown className="w-3.5 h-3.5" />
|
||||
<span>Админ</span>
|
||||
</button>
|
||||
</div>
|
||||
|
||||
{/* Numbered Batch Configuration (only in batch mode) */}
|
||||
{generatorMode === 'batch_numbers' && (
|
||||
<div className="grid grid-cols-1 sm:grid-cols-2 md:grid-cols-4 gap-3 pt-2 border-t border-white/5 text-xs">
|
||||
<div>
|
||||
<label className="block text-[10px] font-bold text-gray-400 uppercase tracking-widest mb-1">
|
||||
Префикс билетов гостей
|
||||
</label>
|
||||
<div className="flex gap-2">
|
||||
<input
|
||||
type="text"
|
||||
value={guestPrefix}
|
||||
onChange={(e) => setGuestPrefix(e.target.value.toUpperCase())}
|
||||
placeholder="LUCK"
|
||||
className="w-24 px-3 py-1.5 bg-[#1c1c1c] border border-white/10 rounded-xl text-white font-mono font-bold uppercase outline-none focus:border-[#d4af37]"
|
||||
/>
|
||||
<select
|
||||
value={guestCount}
|
||||
onChange={(e) => setGuestCount(Number(e.target.value))}
|
||||
className="flex-1 px-3 py-1.5 bg-[#1c1c1c] border border-white/10 rounded-xl text-white font-semibold outline-none focus:border-[#d4af37]"
|
||||
>
|
||||
<option value={12}>12 билетов</option>
|
||||
<option value={18}>18 билетов</option>
|
||||
<option value={24}>24 билета</option>
|
||||
<option value={36}>36 билетов</option>
|
||||
<option value={50}>50 билетов</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<label className="block text-[10px] font-bold text-gray-400 uppercase tracking-widest mb-1">
|
||||
Код Ведущего
|
||||
</label>
|
||||
<input
|
||||
type="text"
|
||||
value={hostCode}
|
||||
onChange={(e) => setHostCode(e.target.value.toUpperCase())}
|
||||
className="w-full px-3 py-1.5 bg-[#1c1c1c] border border-white/10 rounded-xl text-white font-mono font-bold uppercase outline-none focus:border-[#d4af37]"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<label className="block text-[10px] font-bold text-gray-400 uppercase tracking-widest mb-1">
|
||||
Код Молодоженов
|
||||
</label>
|
||||
<input
|
||||
type="text"
|
||||
value={coupleCode}
|
||||
onChange={(e) => setCoupleCode(e.target.value.toUpperCase())}
|
||||
className="w-full px-3 py-1.5 bg-[#1c1c1c] border border-white/10 rounded-xl text-white font-mono font-bold uppercase outline-none focus:border-[#d4af37]"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<label className="block text-[10px] font-bold text-gray-400 uppercase tracking-widest mb-1">
|
||||
Код Администратора
|
||||
</label>
|
||||
<input
|
||||
type="text"
|
||||
value={adminCode}
|
||||
onChange={(e) => setAdminCode(e.target.value.toUpperCase())}
|
||||
className="w-full px-3 py-1.5 bg-[#1c1c1c] border border-white/10 rounded-xl text-white font-mono font-bold uppercase outline-none focus:border-[#d4af37]"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
|
||||
{/* Cards Printable Grid */}
|
||||
<div className="max-w-6xl mx-auto">
|
||||
{loading ? (
|
||||
<div className="text-center py-20 text-[#d4af37] font-serif italic text-lg animate-pulse">
|
||||
Генерация свадебных QR-кодов высокого разрешения...
|
||||
</div>
|
||||
) : cards.length === 0 ? (
|
||||
<div className="text-center py-20 text-gray-500 text-xs">
|
||||
Нет доступных билетов для отображения.
|
||||
</div>
|
||||
) : (
|
||||
<div className="grid grid-cols-1 sm:grid-cols-2 md:grid-cols-3 gap-6 print:grid-cols-3 print:gap-4">
|
||||
{cards.map((card, cIdx) => {
|
||||
const isVip = card.role !== 'guest';
|
||||
|
||||
return (
|
||||
<div
|
||||
key={`qr-card-${card.id || ''}-${cIdx}`}
|
||||
className={`bg-white text-slate-900 rounded-3xl p-6 shadow-2xl flex flex-col items-center justify-between text-center relative overflow-hidden transition-all print:shadow-none print:border-dashed print:border-gray-400 print:rounded-2xl print:break-inside-avoid ${
|
||||
card.role === 'admin'
|
||||
? 'border-2 border-purple-500'
|
||||
: card.role === 'host'
|
||||
? 'border-2 border-blue-500'
|
||||
: card.role === 'couple'
|
||||
? 'border-2 border-rose-500'
|
||||
: 'border border-gray-200'
|
||||
}`}
|
||||
>
|
||||
{/* VIP Corner Ribbon */}
|
||||
{isVip && (
|
||||
<div
|
||||
className={`absolute top-3 right-3 px-2 py-0.5 rounded-full text-[9px] font-black uppercase tracking-wider ${
|
||||
card.role === 'admin'
|
||||
? 'bg-purple-100 text-purple-800'
|
||||
: card.role === 'host'
|
||||
? 'bg-blue-100 text-blue-800'
|
||||
: 'bg-rose-100 text-rose-800'
|
||||
}`}
|
||||
>
|
||||
{card.role === 'admin'
|
||||
? 'ADMIN'
|
||||
: card.role === 'host'
|
||||
? 'HOST VIP'
|
||||
: 'COUPLE VIP'}
|
||||
</div>
|
||||
)}
|
||||
|
||||
{/* Card Header */}
|
||||
<div className="w-full border-b border-gray-200 pb-3 mb-2">
|
||||
<div className="text-[10px] font-bold text-[#856b18] uppercase tracking-widest font-serif flex items-center justify-center gap-1">
|
||||
<Sparkles className="w-3 h-3 text-[#d4af37]" />
|
||||
<span>Свадьба • {couplesNames}</span>
|
||||
<Sparkles className="w-3 h-3 text-[#d4af37]" />
|
||||
</div>
|
||||
|
||||
{/* Guest Name */}
|
||||
<h3 className="text-xl font-bold font-serif italic text-gray-900 mt-1 leading-tight">
|
||||
{card.name}
|
||||
</h3>
|
||||
|
||||
{/* Team & Table */}
|
||||
<div className="flex items-center justify-center gap-1.5 mt-1">
|
||||
<span className="text-[10px] font-bold px-2 py-0.5 rounded-full bg-slate-100 text-slate-700 border border-slate-200">
|
||||
{card.teamName}
|
||||
</span>
|
||||
{card.tableNumber && (
|
||||
<span className="text-[10px] font-medium text-slate-500">
|
||||
{card.tableNumber}
|
||||
</span>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{/* High-Resolution QR Code */}
|
||||
<div className="my-2 p-3 bg-slate-50 border border-slate-200 rounded-2xl shadow-inner">
|
||||
<img
|
||||
src={card.qrDataUrl}
|
||||
alt={`QR code for ${card.name}`}
|
||||
className="w-44 h-44 mx-auto"
|
||||
/>
|
||||
</div>
|
||||
|
||||
{/* Card Footer */}
|
||||
<div className="w-full pt-2 border-t border-gray-200">
|
||||
<div className="text-xs font-mono font-black text-gray-800 tracking-wider">
|
||||
{card.id}
|
||||
</div>
|
||||
<p className="text-[10px] text-gray-500 mt-0.5 leading-tight">
|
||||
Наведите камеру для мгновенного входа в свадебный хаб
|
||||
</p>
|
||||
</div>
|
||||
|
||||
{/* Interactive Action Bar (Hidden on print) */}
|
||||
<div className="w-full flex items-center justify-center gap-1.5 pt-3 mt-2 border-t border-gray-100 print:hidden text-xs">
|
||||
<button
|
||||
type="button"
|
||||
onClick={() => handleCopyLink(card.url, card.id)}
|
||||
className="flex-1 py-1.5 px-2 bg-slate-100 hover:bg-slate-200 text-slate-700 font-bold rounded-xl flex items-center justify-center gap-1 transition-colors text-[11px]"
|
||||
title="Копировать прямую ссылку"
|
||||
>
|
||||
{copiedId === card.id ? (
|
||||
<>
|
||||
<Check className="w-3.5 h-3.5 text-emerald-600" />
|
||||
<span className="text-emerald-700">Скопировано</span>
|
||||
</>
|
||||
) : (
|
||||
<>
|
||||
<Copy className="w-3.5 h-3.5" />
|
||||
<span>Ссылка</span>
|
||||
</>
|
||||
)}
|
||||
</button>
|
||||
|
||||
<a
|
||||
href={card.url}
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
className="p-1.5 bg-slate-100 hover:bg-slate-200 text-slate-700 rounded-xl transition-colors"
|
||||
title="Открыть страницу гостя в новой вкладке"
|
||||
>
|
||||
<ExternalLink className="w-3.5 h-3.5" />
|
||||
</a>
|
||||
|
||||
{generatorMode === 'named' && (
|
||||
<button
|
||||
type="button"
|
||||
onClick={() => handleRemoveGuest(card.id)}
|
||||
className="p-1.5 bg-rose-50 hover:bg-rose-100 text-rose-600 rounded-xl transition-colors"
|
||||
title="Удалить карточку"
|
||||
>
|
||||
<Trash2 className="w-3.5 h-3.5" />
|
||||
</button>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
})}
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
@@ -0,0 +1,619 @@
|
||||
import React, { useState, useEffect } from 'react';
|
||||
import {
|
||||
Heart,
|
||||
Sparkles,
|
||||
Camera,
|
||||
Wine,
|
||||
Flame,
|
||||
Maximize,
|
||||
Minimize,
|
||||
Volume2,
|
||||
VolumeX,
|
||||
Trophy,
|
||||
ShieldCheck,
|
||||
} from 'lucide-react';
|
||||
import { motion, AnimatePresence } from 'motion/react';
|
||||
import QRCode from 'qrcode';
|
||||
import {
|
||||
AggregatedStats,
|
||||
WeddingPhoto,
|
||||
KissAlertOverlay,
|
||||
ToastAlertOverlay,
|
||||
} from '../types.ts';
|
||||
import {
|
||||
playGoldenKissSound,
|
||||
playToastSound,
|
||||
triggerCelebrationConfetti,
|
||||
triggerGoldenKissConfetti,
|
||||
} from '../utils/effects.ts';
|
||||
|
||||
interface ScreenViewProps {
|
||||
stats: AggregatedStats | null;
|
||||
photos: WeddingPhoto[];
|
||||
kissAlert: KissAlertOverlay | null;
|
||||
toastAlert: ToastAlertOverlay | null;
|
||||
onCloseKissAlert: () => void;
|
||||
onCloseToastAlert: () => void;
|
||||
onSwitchToGuest: () => void;
|
||||
onOpenAdmin: () => void;
|
||||
}
|
||||
|
||||
export const ScreenView: React.FC<ScreenViewProps> = ({
|
||||
stats,
|
||||
photos,
|
||||
kissAlert,
|
||||
toastAlert,
|
||||
onCloseKissAlert,
|
||||
onCloseToastAlert,
|
||||
onSwitchToGuest,
|
||||
onOpenAdmin,
|
||||
}) => {
|
||||
const [isFullscreen, setIsFullscreen] = useState(false);
|
||||
const [soundEnabled, setSoundEnabled] = useState(true);
|
||||
const [currentTime, setCurrentTime] = useState('');
|
||||
const [cakeCountdown, setCakeCountdown] = useState('00:00:00');
|
||||
const [joinQrDataUrl, setJoinQrDataUrl] = useState('');
|
||||
const [activePhotoIdx, setActivePhotoIdx] = useState(0);
|
||||
|
||||
// Generate join QR code for the projector screen corner
|
||||
useEffect(() => {
|
||||
const appUrl = window.location.origin;
|
||||
QRCode.toDataURL(appUrl, {
|
||||
width: 200,
|
||||
margin: 1,
|
||||
color: { dark: '#0a0a0a', light: '#ffffff' },
|
||||
}).then(setJoinQrDataUrl).catch(console.error);
|
||||
}, []);
|
||||
|
||||
// Clock & Cake Countdown
|
||||
useEffect(() => {
|
||||
const interval = setInterval(() => {
|
||||
const now = new Date();
|
||||
setCurrentTime(
|
||||
now.toLocaleTimeString('ru-RU', { hour: '2-digit', minute: '2-digit', second: '2-digit' })
|
||||
);
|
||||
|
||||
if (stats?.cake_time_target) {
|
||||
const diff = Math.max(0, stats.cake_time_target - Date.now());
|
||||
const hours = Math.floor(diff / 3600000);
|
||||
const minutes = Math.floor((diff % 3600000) / 60000);
|
||||
const seconds = Math.floor((diff % 60000) / 1000);
|
||||
setCakeCountdown(
|
||||
`${String(hours).padStart(2, '0')}:${String(minutes).padStart(2, '0')}:${String(seconds).padStart(2, '0')}`
|
||||
);
|
||||
}
|
||||
}, 500);
|
||||
|
||||
return () => clearInterval(interval);
|
||||
}, [stats]);
|
||||
|
||||
// Slideshow for background photo wall / Polaroid frame
|
||||
useEffect(() => {
|
||||
if (photos.length === 0) return;
|
||||
const timer = setInterval(() => {
|
||||
setActivePhotoIdx((prev) => (prev + 1) % photos.length);
|
||||
}, 6000);
|
||||
return () => clearInterval(timer);
|
||||
}, [photos.length]);
|
||||
|
||||
// Trigger sound and confetti when a kiss alert arrives
|
||||
useEffect(() => {
|
||||
if (kissAlert) {
|
||||
if (soundEnabled) playGoldenKissSound();
|
||||
triggerGoldenKissConfetti();
|
||||
const timer = setTimeout(() => {
|
||||
onCloseKissAlert();
|
||||
}, 7000);
|
||||
return () => clearTimeout(timer);
|
||||
}
|
||||
}, [kissAlert, soundEnabled]);
|
||||
|
||||
// Trigger sound and confetti when a toast alert arrives
|
||||
useEffect(() => {
|
||||
if (toastAlert) {
|
||||
if (soundEnabled) playToastSound();
|
||||
triggerCelebrationConfetti();
|
||||
const timer = setTimeout(() => {
|
||||
onCloseToastAlert();
|
||||
}, 7000);
|
||||
return () => clearTimeout(timer);
|
||||
}
|
||||
}, [toastAlert, soundEnabled]);
|
||||
|
||||
// Toggle fullscreen
|
||||
const toggleFullscreen = () => {
|
||||
if (!document.fullscreenElement) {
|
||||
document.documentElement.requestFullscreen().catch(() => {});
|
||||
setIsFullscreen(true);
|
||||
} else {
|
||||
if (document.exitFullscreen) {
|
||||
document.exitFullscreen().catch(() => {});
|
||||
}
|
||||
setIsFullscreen(false);
|
||||
}
|
||||
};
|
||||
|
||||
return (
|
||||
<div className="min-h-screen w-full bg-[#0a0a0a] text-[#e0e0e0] flex flex-col justify-between overflow-hidden relative select-none font-sans">
|
||||
{/* Background Subtle Gold Radial Dot Grid */}
|
||||
<div className="absolute inset-0 gold-dot-pattern opacity-10 pointer-events-none z-0" />
|
||||
<div className="absolute top-0 left-1/4 w-96 h-96 bg-[#d4af37]/5 rounded-full blur-3xl pointer-events-none" />
|
||||
<div className="absolute bottom-0 right-1/4 w-96 h-96 bg-[#d4af37]/5 rounded-full blur-3xl pointer-events-none" />
|
||||
|
||||
{/* ================= HEADER ================= */}
|
||||
<header className="flex items-center justify-between px-10 pt-7 pb-4 border-b border-[#d4af37]/20 relative z-20 bg-[#0a0a0a]/80 backdrop-blur-md">
|
||||
<div className="flex items-center gap-6">
|
||||
<div className="w-12 h-12 rounded-full border border-[#d4af37] flex items-center justify-center text-[#d4af37] font-serif text-2xl shadow-lg shadow-[#d4af37]/10">
|
||||
&
|
||||
</div>
|
||||
<div className="flex flex-col">
|
||||
<h1 className="text-3xl lg:text-4xl font-serif italic text-[#d4af37] tracking-wider uppercase">
|
||||
{stats?.couples_names || 'Анна & Дмитрий'}
|
||||
</h1>
|
||||
<p className="text-[10px] tracking-[0.3em] font-semibold text-gray-500 uppercase mt-1 flex items-center gap-2">
|
||||
<span className="w-2 h-2 rounded-full bg-emerald-500 animate-pulse" />
|
||||
Битва Команд • Охота за поцелуями • Live Screen
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{/* Live Cake Countdown & Controls */}
|
||||
<div className="flex items-center gap-8">
|
||||
<div className="text-right">
|
||||
<div className="text-[10px] uppercase tracking-[0.25em] text-[#d4af37] mb-0.5 font-bold flex items-center justify-end gap-1">
|
||||
<span>🎂 Вынос торта: {stats?.cake_time_target_str || '22:30'}</span>
|
||||
</div>
|
||||
<div className="text-3xl lg:text-4xl font-mono text-[#f5f5f5] tabular-nums tracking-wider font-bold">
|
||||
{cakeCountdown}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div className="flex items-center gap-2 bg-[#141414] p-1.5 rounded-2xl border border-[#d4af37]/20">
|
||||
<button
|
||||
onClick={() => setSoundEnabled(!soundEnabled)}
|
||||
title={soundEnabled ? 'Выключить звук' : 'Включить звук'}
|
||||
className="p-2.5 rounded-xl hover:bg-[#222222] text-gray-300 transition-colors"
|
||||
>
|
||||
{soundEnabled ? (
|
||||
<Volume2 className="w-4 h-4 text-[#d4af37]" />
|
||||
) : (
|
||||
<VolumeX className="w-4 h-4 text-gray-600" />
|
||||
)}
|
||||
</button>
|
||||
|
||||
<button
|
||||
onClick={toggleFullscreen}
|
||||
title="Полноэкранный режим"
|
||||
className="p-2.5 rounded-xl hover:bg-[#222222] text-gray-300 transition-colors"
|
||||
>
|
||||
{isFullscreen ? (
|
||||
<Minimize className="w-4 h-4 text-gray-300" />
|
||||
) : (
|
||||
<Maximize className="w-4 h-4 text-gray-300" />
|
||||
)}
|
||||
</button>
|
||||
|
||||
<button
|
||||
onClick={onSwitchToGuest}
|
||||
className="px-3 py-1.5 rounded-xl bg-[#d4af37]/10 hover:bg-[#d4af37]/20 text-[#d4af37] text-xs font-semibold transition-colors border border-[#d4af37]/30"
|
||||
>
|
||||
Гость
|
||||
</button>
|
||||
|
||||
<button
|
||||
onClick={onOpenAdmin}
|
||||
className="p-2 rounded-xl bg-[#222222] hover:bg-[#2d2d2d] text-gray-300 text-xs transition-colors"
|
||||
>
|
||||
⚙️
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</header>
|
||||
|
||||
{/* ================= MAIN CONTENT GRID (12 COLUMNS) ================= */}
|
||||
<main className="flex-1 grid grid-cols-12 gap-8 p-8 relative z-10 items-stretch">
|
||||
{/* LEFT COLUMN: TEAM BATTLE (4 cols) */}
|
||||
<section className="col-span-4 flex flex-col gap-6">
|
||||
<div className="bg-[#141414] border border-[#d4af37]/20 p-6 rounded-3xl flex-1 flex flex-col justify-between shadow-2xl">
|
||||
<div>
|
||||
<h2 className="text-[11px] font-bold tracking-[0.2em] text-[#d4af37] uppercase mb-5 flex items-center justify-between">
|
||||
<span className="flex items-center gap-2">
|
||||
<span className="w-2 h-2 bg-[#d4af37] rounded-full" />
|
||||
Битва Команд (Team Battle)
|
||||
</span>
|
||||
<span className="text-[10px] text-gray-500 font-mono">Выпито / Очки</span>
|
||||
</h2>
|
||||
|
||||
<div className="space-y-4">
|
||||
{stats?.teamBattle && stats.teamBattle.length > 0 ? (
|
||||
stats.teamBattle.map((team, idx) => {
|
||||
const maxPoints = Math.max(
|
||||
...(stats?.teamBattle.map((t) => t.points) || [1]),
|
||||
1
|
||||
);
|
||||
const percent = Math.min(100, Math.max(12, Math.round((team.points / maxPoints) * 100)));
|
||||
const barColor =
|
||||
idx === 0
|
||||
? 'bg-[#d4af37]'
|
||||
: idx === 1
|
||||
? 'bg-[#d4af37]/75'
|
||||
: idx === 2
|
||||
? 'bg-[#d4af37]/50'
|
||||
: 'bg-[#d4af37]/30';
|
||||
|
||||
return (
|
||||
<div key={`screen-team-${team.team_id || ''}-${idx}`} className="space-y-1.5">
|
||||
<div className="flex justify-between text-xs font-medium">
|
||||
<span className="text-white flex items-center gap-1.5 font-bold">
|
||||
<span className="text-gray-400 font-mono text-[10px]">#{idx + 1}</span>
|
||||
<span>{team.team_name}</span>
|
||||
</span>
|
||||
<div className="flex items-center gap-2">
|
||||
<span className="text-xs font-serif text-gray-300">
|
||||
🥂 {team.drinks_count}
|
||||
</span>
|
||||
<span className="text-[#d4af37] font-mono font-bold">
|
||||
{team.points} pts
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div className="h-2 bg-gray-800 rounded-full overflow-hidden">
|
||||
<motion.div
|
||||
initial={{ width: 0 }}
|
||||
animate={{ width: `${percent}%` }}
|
||||
transition={{ duration: 0.8 }}
|
||||
className={`h-full ${barColor} rounded-full`}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
})
|
||||
) : (
|
||||
<div className="text-xs text-gray-500 text-center py-6">
|
||||
Ожидание первых баллов команд...
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div className="mt-6 pt-5 border-t border-white/5 flex items-center justify-between">
|
||||
<div>
|
||||
<div className="text-[10px] text-gray-500 uppercase tracking-wider mb-0.5">
|
||||
Всего выпито бокалов
|
||||
</div>
|
||||
<div className="text-2xl font-serif text-white flex items-center gap-2">
|
||||
<span>{stats?.totalToasts || 0}</span>
|
||||
<span className="text-lg">🥂</span>
|
||||
</div>
|
||||
</div>
|
||||
<div className="text-right">
|
||||
<div className="text-[10px] text-gray-500 uppercase tracking-wider mb-0.5">
|
||||
Команда-лидер
|
||||
</div>
|
||||
<div className="text-xs font-bold text-[#d4af37] max-w-[160px] truncate">
|
||||
{stats?.teamBattle[0] ? stats.teamBattle[0].team_name : '—'}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
{/* MIDDLE COLUMN: Polaroid Showcase & Live Counts (5 cols) */}
|
||||
<section className="col-span-5 flex flex-col gap-6 justify-between">
|
||||
{/* Top Metrics Row */}
|
||||
<div className="flex items-center justify-around bg-[#141414] border border-[#d4af37]/20 p-5 rounded-3xl shadow-2xl">
|
||||
<div className="text-center flex-1">
|
||||
<div className="text-3xl lg:text-4xl font-serif text-[#d4af37] mb-0.5 font-normal">
|
||||
{stats?.totalPhotos || photos.length || 0}
|
||||
</div>
|
||||
<div className="text-[9px] uppercase tracking-widest text-gray-400 font-semibold">
|
||||
Кадров
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div className="w-px h-10 bg-white/10" />
|
||||
|
||||
<div className="text-center flex-1">
|
||||
<div className="text-3xl lg:text-4xl font-serif text-rose-400 mb-0.5 font-normal">
|
||||
{stats?.totalKisses || 0}
|
||||
</div>
|
||||
<div className="text-[9px] uppercase tracking-widest text-gray-400 font-semibold">
|
||||
Поцелуев
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div className="w-px h-10 bg-white/10" />
|
||||
|
||||
<div className="text-center flex-1">
|
||||
<div className="text-3xl lg:text-4xl font-serif text-amber-300 mb-0.5 font-normal">
|
||||
{stats?.totalToasts || 0}
|
||||
</div>
|
||||
<div className="text-[9px] uppercase tracking-widest text-gray-400 font-semibold">
|
||||
Бокалов
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div className="w-px h-10 bg-white/10" />
|
||||
|
||||
<div className="text-center flex-1">
|
||||
<div className="text-3xl lg:text-4xl font-mono text-[#f5f5f5] mb-0.5 font-bold">
|
||||
{currentTime}
|
||||
</div>
|
||||
<div className="text-[9px] uppercase tracking-widest text-[#d4af37] font-semibold">
|
||||
Время
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{/* Center Showcase: Polaroid Luxury Photo Frame */}
|
||||
<div className="flex-1 relative group flex items-center justify-center p-2 min-h-[340px]">
|
||||
<div className="w-full h-full max-h-[380px] bg-[#1c1c1c] rounded-3xl border-4 border-white flex flex-col items-center justify-between overflow-hidden shadow-2xl transition-transform duration-500 hover:rotate-0 rotate-0.5 relative">
|
||||
<div className="w-full flex-1 bg-[#141414] flex items-center justify-center overflow-hidden relative">
|
||||
{photos.length > 0 && photos[activePhotoIdx] ? (
|
||||
<motion.img
|
||||
key={photos[activePhotoIdx].id || activePhotoIdx}
|
||||
initial={{ opacity: 0, scale: 1.05 }}
|
||||
animate={{ opacity: 1, scale: 1 }}
|
||||
transition={{ duration: 0.6 }}
|
||||
src={photos[activePhotoIdx].url}
|
||||
alt={photos[activePhotoIdx].caption || 'Свадебный кадр'}
|
||||
referrerPolicy="no-referrer"
|
||||
className="w-full h-full object-cover"
|
||||
/>
|
||||
) : (
|
||||
<div className="flex flex-col items-center justify-center text-gray-600 gap-3">
|
||||
<Camera className="w-16 h-16 text-[#d4af37]/40" />
|
||||
<p className="text-xs text-gray-400 font-medium">
|
||||
Загружайте фото в свадебный альбом со смартфонов!
|
||||
</p>
|
||||
</div>
|
||||
)}
|
||||
|
||||
<div className="absolute inset-x-0 bottom-0 h-16 bg-gradient-to-t from-black/40 to-transparent pointer-events-none" />
|
||||
</div>
|
||||
|
||||
{/* Bottom White Polaroid Caption Strip */}
|
||||
<div className="w-full h-14 bg-white flex items-center justify-between px-6 shrink-0">
|
||||
<span className="font-serif italic text-black text-base lg:text-lg truncate max-w-[70%]">
|
||||
{photos.length > 0 && photos[activePhotoIdx]
|
||||
? photos[activePhotoIdx].caption || `Кадр от ${photos[activePhotoIdx].guest_name || 'Гостя'}`
|
||||
: 'Свадебный вечер в прямом эфире!'}
|
||||
</span>
|
||||
<span className="text-[10px] text-gray-600 uppercase font-mono tracking-wider font-bold">
|
||||
{photos.length > 0 && photos[activePhotoIdx]?.team_name
|
||||
? photos[activePhotoIdx].team_name
|
||||
: 'Wedding Hub'}
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{/* Floating Gold Pill Badge */}
|
||||
<div className="absolute -bottom-2 right-6 bg-[#d4af37] text-black px-4 py-1.5 rounded-full font-bold text-xs uppercase tracking-wider z-20 shadow-lg flex items-center gap-1.5">
|
||||
<Sparkles className="w-3.5 h-3.5 fill-black" />
|
||||
<span>Live Capture</span>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
{/* RIGHT COLUMN: PERSONAL STANDINGS & QR (3 cols) */}
|
||||
<section className="col-span-3 flex flex-col gap-6">
|
||||
<div className="bg-[#141414] border border-[#d4af37]/20 p-5 rounded-3xl flex-1 flex flex-col justify-between shadow-2xl">
|
||||
<div>
|
||||
{/* 1. Top Drinkers (Личный зачет по выпитому) */}
|
||||
<div className="mb-5">
|
||||
<h2 className="text-[11px] font-bold tracking-[0.2em] text-[#d4af37] uppercase mb-3 flex items-center justify-between">
|
||||
<span className="flex items-center gap-1.5">
|
||||
<Wine className="w-3.5 h-3.5 text-[#d4af37]" />
|
||||
Топ Выпитого (Личный)
|
||||
</span>
|
||||
</h2>
|
||||
|
||||
<div className="space-y-2">
|
||||
{stats?.topDrinkers && stats.topDrinkers.length > 0 ? (
|
||||
stats.topDrinkers.slice(0, 3).map((drinker, idx) => (
|
||||
<div
|
||||
key={`screen-drinker-${drinker.ticket_id || ''}-${idx}`}
|
||||
className="flex items-center justify-between p-2 rounded-xl bg-white/5 border border-white/5"
|
||||
>
|
||||
<div className="flex items-center gap-2">
|
||||
<span className={`w-5 h-5 rounded-full flex items-center justify-center text-[10px] font-bold ${
|
||||
idx === 0 ? 'bg-[#d4af37] text-black' : 'text-gray-400 border border-white/10'
|
||||
}`}>
|
||||
{idx + 1}
|
||||
</span>
|
||||
<div className="text-xs font-bold text-white truncate max-w-[110px]">
|
||||
{drinker.guest_name}
|
||||
</div>
|
||||
</div>
|
||||
<span className="text-xs font-serif font-bold text-[#d4af37]">
|
||||
{drinker.drinks_count} 🥂
|
||||
</span>
|
||||
</div>
|
||||
))
|
||||
) : (
|
||||
<div className="text-[10px] text-gray-500 text-center py-2">
|
||||
Нет подтвержденных бокалов
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{/* 2. Top Paparazzi (Поцелуи) */}
|
||||
<div>
|
||||
<h2 className="text-[11px] font-bold tracking-[0.2em] text-rose-400 uppercase mb-3 flex items-center justify-between">
|
||||
<span className="flex items-center gap-1.5">
|
||||
<Heart className="w-3.5 h-3.5 fill-rose-400" />
|
||||
Топ Папарацци
|
||||
</span>
|
||||
</h2>
|
||||
|
||||
<div className="space-y-2">
|
||||
{stats?.topPaparazzi && stats.topPaparazzi.length > 0 ? (
|
||||
stats.topPaparazzi.slice(0, 3).map((paparazzi, idx) => (
|
||||
<div
|
||||
key={`screen-paparazzi-${paparazzi.ticket_id || ''}-${idx}`}
|
||||
className="flex items-center justify-between p-2 rounded-xl bg-white/5 border border-white/5"
|
||||
>
|
||||
<div className="flex items-center gap-2">
|
||||
<span className={`w-5 h-5 rounded-full flex items-center justify-center text-[10px] font-bold ${
|
||||
idx === 0 ? 'bg-[#d4af37] text-black' : 'text-gray-400 border border-white/10'
|
||||
}`}>
|
||||
{idx + 1}
|
||||
</span>
|
||||
<div className="text-xs font-bold text-white truncate max-w-[110px]">
|
||||
{paparazzi.guest_name}
|
||||
</div>
|
||||
</div>
|
||||
<span className="text-xs font-mono font-bold text-gray-300">
|
||||
{paparazzi.points} pts
|
||||
</span>
|
||||
</div>
|
||||
))
|
||||
) : (
|
||||
<div className="text-[10px] text-gray-500 text-center py-2">
|
||||
Ожидание криков «Горько!»
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{/* Quick QR in Right Box */}
|
||||
{joinQrDataUrl && (
|
||||
<div className="mt-4 pt-4 border-t border-white/5 flex items-center gap-3">
|
||||
<div className="bg-white p-1 rounded-xl shrink-0">
|
||||
<img
|
||||
src={joinQrDataUrl}
|
||||
alt="QR Код"
|
||||
className="w-12 h-12 object-contain"
|
||||
/>
|
||||
</div>
|
||||
<div className="text-[10px] text-gray-400 leading-tight">
|
||||
<span className="text-[#d4af37] font-bold block mb-0.5">Вход по билету</span>
|
||||
Сканируйте QR для входа в команду и квесты
|
||||
</div>
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
</section>
|
||||
</main>
|
||||
|
||||
{/* ================= FOOTER ================= */}
|
||||
<footer className="h-14 bg-[#141414] border-t border-[#d4af37]/20 flex items-center px-10 justify-between relative z-10 text-xs">
|
||||
<div className="flex items-center gap-3">
|
||||
<div className="w-2 h-2 rounded-full bg-emerald-500" />
|
||||
<span className="text-[10px] uppercase tracking-widest text-gray-400 font-semibold">
|
||||
Прямой эфир свадьбы — {stats?.totalPhotos ? `${stats.totalPhotos} Кадров` : 'Хаб активен'}
|
||||
</span>
|
||||
</div>
|
||||
|
||||
<div className="flex items-center gap-6">
|
||||
<span className="text-[10px] text-[#d4af37] font-bold uppercase tracking-widest">
|
||||
1 билет = 1 гость • Честная битва команд
|
||||
</span>
|
||||
<div className="flex gap-1.5 items-center">
|
||||
<div className="w-1.5 h-1.5 rounded-full bg-[#d4af37]" />
|
||||
<div className="w-1.5 h-1.5 rounded-full bg-[#d4af37] opacity-60" />
|
||||
<div className="w-1.5 h-1.5 rounded-full bg-[#d4af37] opacity-30" />
|
||||
</div>
|
||||
</div>
|
||||
</footer>
|
||||
|
||||
{/* ================= FLASH OVERLAYS ================= */}
|
||||
|
||||
{/* 1. GOLDEN KISS CATCH OVERLAY */}
|
||||
<AnimatePresence>
|
||||
{kissAlert && (
|
||||
<motion.div
|
||||
initial={{ opacity: 0, scale: 0.85 }}
|
||||
animate={{ opacity: 1, scale: 1 }}
|
||||
exit={{ opacity: 0, scale: 0.9 }}
|
||||
className="fixed inset-0 z-50 flex items-center justify-center p-8 bg-black/90 backdrop-blur-xl"
|
||||
onClick={onCloseKissAlert}
|
||||
>
|
||||
<div className="w-full max-w-xl bg-gradient-to-br from-[#d4af37] via-[#aa8420] to-[#d4af37] p-1 rounded-3xl shadow-2xl gold-glow">
|
||||
<div className="bg-[#0a0a0a] rounded-[22px] p-8 text-center relative overflow-hidden">
|
||||
<div className="text-6xl mb-3 animate-bounce">💋✨</div>
|
||||
<span className="text-[10px] font-bold uppercase tracking-[0.25em] text-black bg-[#d4af37] px-4 py-1.5 rounded-full inline-block mb-3">
|
||||
FIRST KISS CAUGHT!
|
||||
</span>
|
||||
|
||||
<h2 className="text-3xl lg:text-4xl font-serif italic text-white tracking-wide">
|
||||
{kissAlert.guest_name}
|
||||
</h2>
|
||||
<p className="text-base text-[#d4af37] mt-1 font-semibold">
|
||||
{kissAlert.team_name} поймала поцелуй первой!
|
||||
</p>
|
||||
|
||||
<div className="my-6 inline-flex items-center gap-2 px-6 py-2.5 rounded-full bg-[#d4af37] text-black font-black text-xl shadow-lg">
|
||||
<span>+3 ОЧКА</span>
|
||||
<span className="text-xs uppercase tracking-wider font-bold">(Золотой клик)</span>
|
||||
</div>
|
||||
|
||||
<p className="text-xs text-gray-400">
|
||||
Раунд открыт на 5 секунд! Нажимайте кнопку на смартфонах!
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</motion.div>
|
||||
)}
|
||||
</AnimatePresence>
|
||||
|
||||
{/* 2. POLAROID DRINK QUEST CHECK-IN OVERLAY */}
|
||||
<AnimatePresence>
|
||||
{toastAlert && (
|
||||
<motion.div
|
||||
initial={{ opacity: 0, scale: 0.75, rotate: -3 }}
|
||||
animate={{ opacity: 1, scale: 1, rotate: 0 }}
|
||||
exit={{ opacity: 0, scale: 0.85, rotate: 3 }}
|
||||
className="fixed inset-0 z-50 flex items-center justify-center p-8 bg-black/90 backdrop-blur-xl"
|
||||
onClick={onCloseToastAlert}
|
||||
>
|
||||
<div className="w-full max-w-md bg-white rounded-3xl p-5 shadow-2xl text-slate-900 border-4 border-white">
|
||||
{/* Polaroid Photo Frame */}
|
||||
<div className="aspect-[4/3] rounded-2xl overflow-hidden bg-[#141414] border border-gray-200 relative mb-4">
|
||||
{toastAlert.photo_url ? (
|
||||
<img
|
||||
src={toastAlert.photo_url}
|
||||
alt="Квест с бокалом"
|
||||
referrerPolicy="no-referrer"
|
||||
className="w-full h-full object-cover"
|
||||
/>
|
||||
) : (
|
||||
<div className="w-full h-full flex items-center justify-center text-4xl">
|
||||
🥂
|
||||
</div>
|
||||
)}
|
||||
<div className="absolute top-3 left-3 bg-[#0a0a0a]/85 backdrop-blur-md text-[#d4af37] text-xs font-bold px-3 py-1 rounded-full flex items-center gap-1.5 border border-[#d4af37]/30">
|
||||
<Wine className="w-3.5 h-3.5 text-[#d4af37]" />
|
||||
<span>{toastAlert.team_name}</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{/* Toast / Quest Details */}
|
||||
<div className="text-center">
|
||||
<span className="text-[10px] font-bold uppercase tracking-[0.2em] text-[#aa8420] bg-amber-50 px-3 py-1 rounded-full border border-amber-200 inline-block mb-1.5">
|
||||
🥂 Квест зачтен нейросетью Ollama
|
||||
</span>
|
||||
<h3 className="text-xl font-bold font-serif text-black">
|
||||
{toastAlert.guest_name}
|
||||
</h3>
|
||||
{toastAlert.quest_title && (
|
||||
<p className="text-xs font-bold text-rose-600 uppercase tracking-wider mt-0.5">
|
||||
Задание: {toastAlert.quest_title}
|
||||
</p>
|
||||
)}
|
||||
<p className="text-sm text-gray-700 italic mt-1 px-4 font-serif">
|
||||
«{toastAlert.ai_cheer || 'Бокал зачтен! Горько!'}»
|
||||
</p>
|
||||
<p className="text-xs text-gray-500 mt-2 font-medium">
|
||||
{toastAlert.team_name} получает <strong className="text-black">+1 бокал и +10 очков</strong> в битве команд!
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</motion.div>
|
||||
)}
|
||||
</AnimatePresence>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
@@ -0,0 +1,48 @@
|
||||
@import "tailwindcss";
|
||||
|
||||
@layer base {
|
||||
body {
|
||||
font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
|
||||
background-color: #0a0a0a;
|
||||
color: #e0e0e0;
|
||||
}
|
||||
|
||||
h1, h2, h3, .font-serif {
|
||||
font-family: 'Playfair Display', Georgia, serif;
|
||||
}
|
||||
}
|
||||
|
||||
.gold-dot-pattern {
|
||||
background-image: radial-gradient(#d4af37 0.65px, transparent 0.65px);
|
||||
background-size: 24px 24px;
|
||||
}
|
||||
|
||||
.gold-glow {
|
||||
box-shadow: 0 0 35px -5px rgba(212, 175, 55, 0.25);
|
||||
}
|
||||
|
||||
.gold-border {
|
||||
border-color: rgba(212, 175, 55, 0.2);
|
||||
}
|
||||
|
||||
.gold-text-gradient {
|
||||
background: linear-gradient(135deg, #fce99f 0%, #d4af37 50%, #aa8420 100%);
|
||||
-webkit-background-clip: text;
|
||||
-webkit-text-fill-color: transparent;
|
||||
}
|
||||
|
||||
/* Custom Gold & Dark Scrollbar */
|
||||
::-webkit-scrollbar {
|
||||
width: 6px;
|
||||
height: 6px;
|
||||
}
|
||||
::-webkit-scrollbar-track {
|
||||
background: #0a0a0a;
|
||||
}
|
||||
::-webkit-scrollbar-thumb {
|
||||
background: #262626;
|
||||
border-radius: 9999px;
|
||||
}
|
||||
::-webkit-scrollbar-thumb:hover {
|
||||
background: #d4af37;
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
import {StrictMode} from 'react';
|
||||
import {createRoot} from 'react-dom/client';
|
||||
import App from './App.tsx';
|
||||
import './index.css';
|
||||
|
||||
createRoot(document.getElementById('root')!).render(
|
||||
<StrictMode>
|
||||
<App />
|
||||
</StrictMode>,
|
||||
);
|
||||
+136
@@ -0,0 +1,136 @@
|
||||
export type UserRole = 'guest' | 'host' | 'couple' | 'admin';
|
||||
|
||||
export interface Guest {
|
||||
ticket_id: string;
|
||||
guest_name: string;
|
||||
team_id: string;
|
||||
team_name: string;
|
||||
role: UserRole;
|
||||
registered_at: number;
|
||||
}
|
||||
|
||||
export interface KissCatch {
|
||||
id: number;
|
||||
ticket_id: string;
|
||||
guest_name: string;
|
||||
team_id: string;
|
||||
team_name: string;
|
||||
points: number;
|
||||
round_id: number;
|
||||
timestamp: number;
|
||||
}
|
||||
|
||||
export interface DrinkQuest {
|
||||
id: string;
|
||||
title: string;
|
||||
description: string;
|
||||
emoji: string;
|
||||
aiInstruction: string;
|
||||
samplePromptHint: string;
|
||||
}
|
||||
|
||||
export interface ToastLog {
|
||||
id: number;
|
||||
ticket_id: string;
|
||||
guest_name: string;
|
||||
team_id: string;
|
||||
team_name: string;
|
||||
timestamp: number;
|
||||
photo_url?: string;
|
||||
detected_glasses?: number;
|
||||
confidence?: number;
|
||||
ai_cheer?: string;
|
||||
quest_id?: string;
|
||||
quest_title?: string;
|
||||
quest_completed?: boolean;
|
||||
status: 'pending' | 'verified' | 'rejected';
|
||||
}
|
||||
|
||||
export interface WeddingPhoto {
|
||||
id: string;
|
||||
ticket_id?: string;
|
||||
guest_name?: string;
|
||||
team_id?: string;
|
||||
team_name?: string;
|
||||
url: string;
|
||||
thumb_url?: string;
|
||||
caption?: string;
|
||||
uploaded_at: number;
|
||||
is_toast?: boolean;
|
||||
quest_title?: string;
|
||||
}
|
||||
|
||||
export interface TopPaparazzi {
|
||||
ticket_id: string;
|
||||
guest_name: string;
|
||||
team_name: string;
|
||||
points: number;
|
||||
kisses_count: number;
|
||||
}
|
||||
|
||||
export interface TopDrinkers {
|
||||
ticket_id: string;
|
||||
guest_name: string;
|
||||
team_name: string;
|
||||
drinks_count: number;
|
||||
points: number;
|
||||
}
|
||||
|
||||
export interface TeamBattleScore {
|
||||
team_id: string;
|
||||
team_name: string;
|
||||
drinks_count: number;
|
||||
points: number;
|
||||
guest_count: number;
|
||||
kisses_count: number;
|
||||
}
|
||||
|
||||
export interface RegisteredUserSummary extends Guest {
|
||||
points: number;
|
||||
kisses_count: number;
|
||||
drinks_count: number;
|
||||
photos_count: number;
|
||||
}
|
||||
|
||||
export interface AggregatedStats {
|
||||
totalKisses: number;
|
||||
totalToasts: number; // total verified drinks
|
||||
totalPhotos: number;
|
||||
topPaparazzi: TopPaparazzi[];
|
||||
topDrinkers: TopDrinkers[];
|
||||
teamBattle: TeamBattleScore[];
|
||||
registeredUsers?: RegisteredUserSummary[];
|
||||
round_active: boolean;
|
||||
round_start_time: number | null;
|
||||
round_first_catcher: { ticket_id: string; guest_name: string; team_name: string } | null;
|
||||
cooldown_until: number | null;
|
||||
cake_time_target: number;
|
||||
cake_time_target_str?: string;
|
||||
couples_names: string;
|
||||
wedding_date: string;
|
||||
immich_url?: string;
|
||||
immich_album_id?: string;
|
||||
immich_album_name?: string;
|
||||
ollama_url?: string;
|
||||
}
|
||||
|
||||
export interface KissAlertOverlay {
|
||||
id: string;
|
||||
guest_name: string;
|
||||
team_name: string;
|
||||
points: number;
|
||||
is_golden: boolean;
|
||||
timestamp: number;
|
||||
}
|
||||
|
||||
export interface ToastAlertOverlay {
|
||||
id: string;
|
||||
guest_name: string;
|
||||
team_name: string;
|
||||
photo_url?: string;
|
||||
detected_glasses?: number;
|
||||
ai_cheer?: string;
|
||||
quest_title?: string;
|
||||
quest_completed?: boolean;
|
||||
timestamp: number;
|
||||
}
|
||||
@@ -0,0 +1,97 @@
|
||||
import { DrinkQuest } from '../types.ts';
|
||||
|
||||
export const PRESET_TEAMS = [
|
||||
{ id: 'team_bride', name: '👰 Команда Невесты', short: 'Невеста', color: '#f43f5e' },
|
||||
{ id: 'team_groom', name: '🤵 Команда Жениха', short: 'Жених', color: '#3b82f6' },
|
||||
{ id: 'team_witnesses', name: '🍸 Свидетели и Свита', short: 'Свидетели', color: '#a855f7' },
|
||||
{ id: 'team_friends', name: '🎉 Команда Друзей', short: 'Друзья', color: '#eab308' },
|
||||
{ id: 'team_family', name: '👑 Семья и Родные', short: 'Семья', color: '#10b981' },
|
||||
];
|
||||
|
||||
export const DRINK_QUESTS: DrinkQuest[] = [
|
||||
{
|
||||
id: 'quest_fear',
|
||||
title: 'Эмоция «СТРАХ»',
|
||||
description: 'Сфоткайся с бокалом и изобрази искренний ужас / панику на лице!',
|
||||
emoji: '😱',
|
||||
aiInstruction: 'Проверь наличие бокала/напитка в руках и явную эмоцию страха/ужаса/паники (широко открытые глаза, открытый рот, испуг).',
|
||||
samplePromptHint: 'Бокал + испуганное выражение лица',
|
||||
},
|
||||
{
|
||||
id: 'quest_couple_bg',
|
||||
title: 'На фоне Молодоженов',
|
||||
description: 'Сфоткайся с поднятым бокалом так, чтобы на фоне были видны жених и невеста!',
|
||||
emoji: '💍',
|
||||
aiInstruction: 'Проверь наличие бокала/напитка и присутствие свадебной пары / невесты в платье / жениха на заднем плане или рядом.',
|
||||
samplePromptHint: 'Бокал + молодожены на фоне',
|
||||
},
|
||||
{
|
||||
id: 'quest_superhero',
|
||||
title: 'Поза Супергероя',
|
||||
description: 'Сфоткайся с бокалом в эпичной героической позе защитника свадьбы!',
|
||||
emoji: '🦸',
|
||||
aiInstruction: 'Проверь наличие бокала и эпичную героическую стойку (рука вверх, кулак в бок, гордый взгляд супергероя).',
|
||||
samplePromptHint: 'Бокал + супергеройская поза',
|
||||
},
|
||||
{
|
||||
id: 'quest_serious',
|
||||
title: 'Максимальная Серьезность',
|
||||
description: 'Сфоткайся с бокалом с самым каменным, строгим и научным лицом без тени улыбки!',
|
||||
emoji: '🧐',
|
||||
aiInstruction: 'Проверь наличие бокала и подчеркнуто строгое, серьезное, невозмутимое выражение лица без улыбки.',
|
||||
samplePromptHint: 'Бокал + суперсерьезное лицо',
|
||||
},
|
||||
{
|
||||
id: 'quest_wink',
|
||||
title: 'Задорное Подмигивание',
|
||||
description: 'Сфоткайся с бокалом и подмигни одним глазом прямо в камеру!',
|
||||
emoji: '😉',
|
||||
aiInstruction: 'Проверь наличие бокала и задорное подмигивание одним глазом с улыбкой.',
|
||||
samplePromptHint: 'Бокал + подмигивающий глаз',
|
||||
},
|
||||
{
|
||||
id: 'quest_clink_rival',
|
||||
title: 'Чоканье с Соперником',
|
||||
description: 'Сфоткайся, чокаясь бокалами с гостем из другой команды!',
|
||||
emoji: '🤝',
|
||||
aiInstruction: 'Проверь наличие как минимум 2 бокалов, которые соприкасаются или направлены друг к другу в тосте двух людей.',
|
||||
samplePromptHint: '2+ бокала чокаются',
|
||||
},
|
||||
{
|
||||
id: 'quest_tongue',
|
||||
title: 'Дерзкий Язык',
|
||||
description: 'Сфоткайся с бокалом и покажи язык / скорчи самую забавную рожицу!',
|
||||
emoji: '😜',
|
||||
aiInstruction: 'Проверь наличие бокала и высунутый язык или смешную гримасу.',
|
||||
samplePromptHint: 'Бокал + высунутый язык',
|
||||
},
|
||||
{
|
||||
id: 'quest_tiger',
|
||||
title: 'Хищный Рык',
|
||||
description: 'Сфоткайся с бокалом и изобрази яростный рык дикого тигра или льва!',
|
||||
emoji: '🦁',
|
||||
aiInstruction: 'Проверь наличие бокала и открытый в рыке рот / коготки-лапы / эмоцию рычащего зверя.',
|
||||
samplePromptHint: 'Бокал + рычащая гримаса',
|
||||
},
|
||||
{
|
||||
id: 'quest_secret_agent',
|
||||
title: 'Секретный Агент 007',
|
||||
description: 'Сфоткайся с бокалом с таинственным взглядом шпиона (палец у губ или темные очки)!',
|
||||
emoji: '🕵️',
|
||||
aiInstruction: 'Проверь наличие бокала и образ секретного агента / палец у губ "тсс" / темные очки / загадочный шпионский вид.',
|
||||
samplePromptHint: 'Бокал + образ агента',
|
||||
},
|
||||
{
|
||||
id: 'quest_dance',
|
||||
title: 'Танцевальный Драйв',
|
||||
description: 'Сфоткайся с бокалом прямо в движении танца!',
|
||||
emoji: '💃',
|
||||
aiInstruction: 'Проверь наличие бокала и динамичную позу танца (поднятая рука, движение, праздничная энергия).',
|
||||
samplePromptHint: 'Бокал + танцевальная поза',
|
||||
},
|
||||
];
|
||||
|
||||
export function getRandomQuest(): DrinkQuest {
|
||||
const idx = Math.floor(Math.random() * DRINK_QUESTS.length);
|
||||
return DRINK_QUESTS[idx];
|
||||
}
|
||||
@@ -0,0 +1,157 @@
|
||||
import confetti from 'canvas-confetti';
|
||||
|
||||
// Web Audio API Synthesizer
|
||||
let audioCtx: AudioContext | null = null;
|
||||
|
||||
function getAudioContext(): AudioContext | null {
|
||||
if (typeof window === 'undefined') return null;
|
||||
if (!audioCtx) {
|
||||
const AudioContextClass = window.AudioContext || (window as any).webkitAudioContext;
|
||||
if (AudioContextClass) {
|
||||
audioCtx = new AudioContextClass();
|
||||
}
|
||||
}
|
||||
if (audioCtx && audioCtx.state === 'suspended') {
|
||||
audioCtx.resume();
|
||||
}
|
||||
return audioCtx;
|
||||
}
|
||||
|
||||
export function playGoldenKissSound() {
|
||||
try {
|
||||
const ctx = getAudioContext();
|
||||
if (!ctx) return;
|
||||
|
||||
const notes = [523.25, 659.25, 783.99, 1046.5]; // C5, E5, G5, C6
|
||||
notes.forEach((freq, i) => {
|
||||
const osc = ctx.createOscillator();
|
||||
const gain = ctx.createGain();
|
||||
osc.type = 'triangle';
|
||||
osc.frequency.setValueAtTime(freq, ctx.currentTime + i * 0.08);
|
||||
|
||||
gain.gain.setValueAtTime(0, ctx.currentTime + i * 0.08);
|
||||
gain.gain.linearRampToValueAtTime(0.3, ctx.currentTime + i * 0.08 + 0.02);
|
||||
gain.gain.exponentialRampToValueAtTime(0.001, ctx.currentTime + i * 0.08 + 0.5);
|
||||
|
||||
osc.connect(gain);
|
||||
gain.connect(ctx.destination);
|
||||
|
||||
osc.start(ctx.currentTime + i * 0.08);
|
||||
osc.stop(ctx.currentTime + i * 0.08 + 0.6);
|
||||
});
|
||||
} catch (e) {
|
||||
console.debug('Audio not allowed yet:', e);
|
||||
}
|
||||
}
|
||||
|
||||
export function playToastSound() {
|
||||
try {
|
||||
const ctx = getAudioContext();
|
||||
if (!ctx) return;
|
||||
|
||||
// Glass clink high chime
|
||||
const osc = ctx.createOscillator();
|
||||
const gain = ctx.createGain();
|
||||
osc.type = 'sine';
|
||||
osc.frequency.setValueAtTime(2400, ctx.currentTime);
|
||||
osc.frequency.exponentialRampToValueAtTime(1800, ctx.currentTime + 0.4);
|
||||
|
||||
gain.gain.setValueAtTime(0.25, ctx.currentTime);
|
||||
gain.gain.exponentialRampToValueAtTime(0.001, ctx.currentTime + 0.4);
|
||||
|
||||
osc.connect(gain);
|
||||
gain.connect(ctx.destination);
|
||||
|
||||
osc.start();
|
||||
osc.stop(ctx.currentTime + 0.4);
|
||||
} catch (e) {
|
||||
console.debug('Audio error:', e);
|
||||
}
|
||||
}
|
||||
|
||||
export function playCatchClickSound() {
|
||||
try {
|
||||
const ctx = getAudioContext();
|
||||
if (!ctx) return;
|
||||
|
||||
const osc = ctx.createOscillator();
|
||||
const gain = ctx.createGain();
|
||||
osc.type = 'sine';
|
||||
osc.frequency.setValueAtTime(880, ctx.currentTime);
|
||||
gain.gain.setValueAtTime(0.2, ctx.currentTime);
|
||||
gain.gain.exponentialRampToValueAtTime(0.001, ctx.currentTime + 0.15);
|
||||
|
||||
osc.connect(gain);
|
||||
gain.connect(ctx.destination);
|
||||
|
||||
osc.start();
|
||||
osc.stop(ctx.currentTime + 0.15);
|
||||
} catch (e) {
|
||||
console.debug('Audio error:', e);
|
||||
}
|
||||
}
|
||||
|
||||
// Web Vibration API
|
||||
export function vibrateKiss() {
|
||||
if (typeof navigator !== 'undefined' && 'vibrate' in navigator) {
|
||||
try {
|
||||
navigator.vibrate([100, 50, 150]);
|
||||
} catch {
|
||||
// Ignore vibration errors
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
export function vibrateGolden() {
|
||||
if (typeof navigator !== 'undefined' && 'vibrate' in navigator) {
|
||||
try {
|
||||
navigator.vibrate([200, 100, 200, 100, 400]);
|
||||
} catch {
|
||||
// Ignore
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
export function vibrateToast() {
|
||||
if (typeof navigator !== 'undefined' && 'vibrate' in navigator) {
|
||||
try {
|
||||
navigator.vibrate([80, 40, 80]);
|
||||
} catch {
|
||||
// Ignore
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Confetti Blast
|
||||
export function triggerCelebrationConfetti() {
|
||||
try {
|
||||
confetti({
|
||||
particleCount: 80,
|
||||
spread: 70,
|
||||
origin: { y: 0.6 },
|
||||
colors: ['#f59e0b', '#ec4899', '#8b5cf6', '#10b981', '#ffffff'],
|
||||
});
|
||||
} catch (e) {
|
||||
console.debug('Confetti error:', e);
|
||||
}
|
||||
}
|
||||
|
||||
export function triggerGoldenKissConfetti() {
|
||||
try {
|
||||
const end = Date.now() + 2000;
|
||||
const interval: any = setInterval(() => {
|
||||
if (Date.now() > end) {
|
||||
return clearInterval(interval);
|
||||
}
|
||||
confetti({
|
||||
startVelocity: 30,
|
||||
spread: 360,
|
||||
ticks: 60,
|
||||
origin: { x: Math.random(), y: Math.random() * 0.4 },
|
||||
colors: ['#fbbf24', '#f59e0b', '#d97706', '#f43f5e', '#ffffff'],
|
||||
});
|
||||
}, 250);
|
||||
} catch (e) {
|
||||
console.debug('Confetti error:', e);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"target": "ES2022",
|
||||
"experimentalDecorators": true,
|
||||
"useDefineForClassFields": false,
|
||||
"module": "ESNext",
|
||||
"lib": [
|
||||
"ES2022",
|
||||
"DOM",
|
||||
"DOM.Iterable"
|
||||
],
|
||||
"skipLibCheck": true,
|
||||
"moduleResolution": "bundler",
|
||||
"isolatedModules": true,
|
||||
"moduleDetection": "force",
|
||||
"allowJs": true,
|
||||
"jsx": "react-jsx",
|
||||
"paths": {
|
||||
"@/*": [
|
||||
"./*"
|
||||
]
|
||||
},
|
||||
"allowImportingTsExtensions": true,
|
||||
"noEmit": true
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
import tailwindcss from '@tailwindcss/vite';
|
||||
import react from '@vitejs/plugin-react';
|
||||
import path from 'path';
|
||||
import {defineConfig} from 'vite';
|
||||
|
||||
export default defineConfig(() => {
|
||||
return {
|
||||
plugins: [react(), tailwindcss()],
|
||||
resolve: {
|
||||
alias: {
|
||||
'@': path.resolve(__dirname, '.'),
|
||||
},
|
||||
},
|
||||
server: {
|
||||
// HMR is disabled in AI Studio via DISABLE_HMR env var.
|
||||
// Do not modifyâfile watching is disabled to prevent flickering during agent edits.
|
||||
hmr: process.env.DISABLE_HMR !== 'true',
|
||||
// Disable file watching when DISABLE_HMR is true to save CPU during agent edits.
|
||||
watch: process.env.DISABLE_HMR === 'true' ? null : {},
|
||||
},
|
||||
};
|
||||
});
|
||||
Reference in new issue
Block a user