@serifpersia/dango 3.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +247 -0
- package/client/dist/assets/AnimeInfo-CMxs0nRH.css +1 -0
- package/client/dist/assets/AnimeInfo-DVdaocCl.js +1 -0
- package/client/dist/assets/AnimeInfoPage-Bx5EvGt-.js +2 -0
- package/client/dist/assets/Asmr-C2i9GKD4.css +1 -0
- package/client/dist/assets/Asmr-CIjmFtRH.js +2 -0
- package/client/dist/assets/Asmr.module-DPG2JhDJ.js +1 -0
- package/client/dist/assets/AvSyncCalibrator-CIYcyon5.css +1 -0
- package/client/dist/assets/AvSyncCalibrator-vqErH7Cm.js +10 -0
- package/client/dist/assets/ErrorMessage-BwSjzblw.js +1 -0
- package/client/dist/assets/ErrorMessage-CXoRbrLN.css +1 -0
- package/client/dist/assets/Home-D7YfGBUk.js +1 -0
- package/client/dist/assets/Home-DKCfEiwl.css +1 -0
- package/client/dist/assets/Insights-BljI64Ua.css +1 -0
- package/client/dist/assets/Insights-CLQGrlpX.js +1 -0
- package/client/dist/assets/Manga-DQ9HYnpk.js +1 -0
- package/client/dist/assets/Manga-H8Wb04w3.css +1 -0
- package/client/dist/assets/Map-CXFqXmsZ.css +1 -0
- package/client/dist/assets/Map-L_ryVBTq.js +1 -0
- package/client/dist/assets/Mature-BeWzAJ7B.js +1 -0
- package/client/dist/assets/Mature-DJmUUtlF.css +1 -0
- package/client/dist/assets/Player-CYpd__FP.js +30 -0
- package/client/dist/assets/Player-DreAhybc.css +1 -0
- package/client/dist/assets/PlayerRedirect-fxUAp9JV.js +1 -0
- package/client/dist/assets/PlayerSettings-BcsotxP9.js +1 -0
- package/client/dist/assets/PlayerSettings-Cqua1CDD.css +1 -0
- package/client/dist/assets/QueueRail-B9Pgbqc3.js +1 -0
- package/client/dist/assets/QueueRail-BnaltOP8.css +1 -0
- package/client/dist/assets/Radio-BvdY5twD.js +1 -0
- package/client/dist/assets/Radio-CUuYy3DY.css +1 -0
- package/client/dist/assets/Search-BzO-aRP7.css +1 -0
- package/client/dist/assets/Search-R9YLAXS1.js +1 -0
- package/client/dist/assets/Search.module-D8ZbQAiK.js +1 -0
- package/client/dist/assets/Settings-9kYcXdTR.js +21 -0
- package/client/dist/assets/Settings-DF8JThUL.css +1 -0
- package/client/dist/assets/SkeletonGrid-D5vRvX5q.js +1 -0
- package/client/dist/assets/SkeletonGrid-DEbYtO4H.css +1 -0
- package/client/dist/assets/SynopsisText-BlFw0R-0.js +1 -0
- package/client/dist/assets/SynopsisText-CUgOjOxt.css +1 -0
- package/client/dist/assets/Trackers-DfZlnnVq.js +2 -0
- package/client/dist/assets/Trackers-Dt9lR_uP.css +1 -0
- package/client/dist/assets/Tv-CVKC2YBs.css +1 -0
- package/client/dist/assets/Tv-Db1Wx_b7.js +15 -0
- package/client/dist/assets/Watchlist-B2nkNZqM.css +1 -0
- package/client/dist/assets/Watchlist-a77CYtzu.js +1 -0
- package/client/dist/assets/hls-6Owgw2Aj.js +1 -0
- package/client/dist/assets/hls-BOLXTnjL.js +42 -0
- package/client/dist/assets/index-B6qdXFtl.css +1 -0
- package/client/dist/assets/index-B8TPVaIS.js +30354 -0
- package/client/dist/assets/index-CpjgU8ou.js +178 -0
- package/client/dist/assets/useAnimeInfoData-BOfyi9UJ.js +1 -0
- package/client/dist/assets/useIsMobile-CM15uQn8.css +1 -0
- package/client/dist/assets/useIsMobile-Cb8HcKRj.js +1 -0
- package/client/dist/assets/useMatureConsent-CZMYBVXd.js +1 -0
- package/client/dist/assets/vendor-rLNfZm7Y.js +1 -0
- package/client/dist/av-sync-test.mp4 +0 -0
- package/client/dist/favicon.ico +0 -0
- package/client/dist/index.html +31 -0
- package/client/dist/logo-mochi.png +0 -0
- package/client/dist/logo-sakura.png +0 -0
- package/client/dist/logo.png +0 -0
- package/client/dist/placeholder.svg +4 -0
- package/client/dist/robots.txt +3 -0
- package/orchestrator.js +416 -0
- package/package.json +89 -0
- package/server/dist/app-auth.js +231 -0
- package/server/dist/config.js +133 -0
- package/server/dist/controllers/auth.controller.js +247 -0
- package/server/dist/controllers/data.controller.js +785 -0
- package/server/dist/controllers/insights.controller.js +197 -0
- package/server/dist/controllers/proxy.controller.js +665 -0
- package/server/dist/controllers/settings.controller.js +267 -0
- package/server/dist/controllers/watchlist.controller.js +967 -0
- package/server/dist/db.js +152 -0
- package/server/dist/discord-gateway.js +381 -0
- package/server/dist/discord-rpc.js +424 -0
- package/server/dist/github-sync.js +403 -0
- package/server/dist/google.js +549 -0
- package/server/dist/lib/anilist.js +1519 -0
- package/server/dist/lib/anischedule.js +202 -0
- package/server/dist/lib/ipc.js +32 -0
- package/server/dist/lib/kitsu.js +552 -0
- package/server/dist/lib/mal.js +886 -0
- package/server/dist/lib/migration.js +335 -0
- package/server/dist/lib/temp-ids.js +11 -0
- package/server/dist/lib/tmdb.js +71 -0
- package/server/dist/lib/tracker/anilist-tracker.js +250 -0
- package/server/dist/lib/tracker/sync.service.js +312 -0
- package/server/dist/logger.js +19 -0
- package/server/dist/providers/123anime.provider.js +240 -0
- package/server/dist/providers/anilight.provider.js +366 -0
- package/server/dist/providers/animepahe.provider.js +531 -0
- package/server/dist/providers/animeya.provider.js +746 -0
- package/server/dist/providers/base-provider.js +45 -0
- package/server/dist/providers/hn.provider.js +473 -0
- package/server/dist/providers/ht.provider.js +439 -0
- package/server/dist/providers/jasmr.provider.js +504 -0
- package/server/dist/providers/kaa.provider.js +388 -0
- package/server/dist/providers/manga/manga.types.js +10 -0
- package/server/dist/providers/manga/mangadex.provider.js +227 -0
- package/server/dist/providers/manga/mangapill.provider.js +232 -0
- package/server/dist/providers/megaplay.provider.js +583 -0
- package/server/dist/providers/op.provider.js +440 -0
- package/server/dist/providers/provider.interface.js +2 -0
- package/server/dist/providers/title-matching.js +234 -0
- package/server/dist/providers/wh.provider.js +600 -0
- package/server/dist/rclone.js +126 -0
- package/server/dist/repositories/insights.repository.js +43 -0
- package/server/dist/repositories/mal-cache.repository.js +66 -0
- package/server/dist/repositories/notifications.repository.js +40 -0
- package/server/dist/repositories/queue.repository.js +64 -0
- package/server/dist/repositories/settings.repository.js +15 -0
- package/server/dist/repositories/shows-meta.repository.js +43 -0
- package/server/dist/repositories/temp-show-ids.repository.js +54 -0
- package/server/dist/repositories/watched-episodes.repository.js +54 -0
- package/server/dist/repositories/watchlist.repository.js +74 -0
- package/server/dist/routes/asmr.routes.js +72 -0
- package/server/dist/routes/auth.routes.js +28 -0
- package/server/dist/routes/data.routes.js +50 -0
- package/server/dist/routes/discord-gateway.routes.js +57 -0
- package/server/dist/routes/insights.routes.js +12 -0
- package/server/dist/routes/lan-auth.routes.js +49 -0
- package/server/dist/routes/manga.routes.js +115 -0
- package/server/dist/routes/proxy.routes.js +15 -0
- package/server/dist/routes/radio.routes.js +143 -0
- package/server/dist/routes/settings.routes.js +27 -0
- package/server/dist/routes/tracker.routes.js +143 -0
- package/server/dist/routes/translate.routes.js +90 -0
- package/server/dist/routes/tv.routes.js +843 -0
- package/server/dist/routes/watchlist.routes.js +312 -0
- package/server/dist/server.js +310 -0
- package/server/dist/shipped-defaults.js +8 -0
- package/server/dist/sync-config.js +32 -0
- package/server/dist/sync.js +506 -0
- package/server/dist/utils/cookie.utils.js +17 -0
- package/server/dist/utils/db-utils.js +15 -0
- package/server/dist/utils/env.utils.js +83 -0
- package/server/dist/utils/machine-id.js +46 -0
- package/server/dist/utils/request-context.js +5 -0
- package/server/dist/utils/security.utils.js +99 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 serifpersia
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,247 @@
|
|
|
1
|
+
<div align="center">
|
|
2
|
+
|
|
3
|
+
<img src="client/public/logo.png" alt="dango logo" width="400"/>
|
|
4
|
+
|
|
5
|
+
_A local-first anime web app focused on performance, privacy, and personal library tracking._
|
|
6
|
+
|
|
7
|
+
[](https://opensource.org/licenses/MIT)
|
|
8
|
+

|
|
9
|
+
[](https://github.com/serifpersia/dango)
|
|
10
|
+
|
|
11
|
+

|
|
12
|
+
|
|
13
|
+

|
|
14
|
+
|
|
15
|
+

|
|
16
|
+
|
|
17
|
+
</div>
|
|
18
|
+
|
|
19
|
+
---
|
|
20
|
+
|
|
21
|
+
**dango** is a lightweight, self-hosted Node.js application built for querying anime metadata, managing personal watchlists, and logging viewing progress through a fast local interface.
|
|
22
|
+
|
|
23
|
+
## Highlights
|
|
24
|
+
|
|
25
|
+
- **Hardware Efficient:** Engineered with a minimal footprint to run effortlessly on low-spec hardware, SBCs, and mobile environments.
|
|
26
|
+
- **Metadata & Discovery:** Browse trending titles, search catalog entries, and view release schedules locally.
|
|
27
|
+
- **Multi-Provider Playback:** Switch seamlessly between multiple third-party streaming providers directly within the player interface.
|
|
28
|
+
- **Watchlist Tracking:** Categorize titles (Watching, Completed, Plan to Watch) with fine-grained progress states.
|
|
29
|
+
- **Library Insights:** Built-in dashboard tracking viewing habits, personal stats, and completion ratios.
|
|
30
|
+
- **Trackers & Sync:** Bi-directional AniList sync and one-way MyAnimeList list imports.
|
|
31
|
+
- **Expanded Media Hub:** Dedicated interfaces for ASMR, Manga, Internet Radio, and TV/Movies.
|
|
32
|
+
- **LAN Security:** Optional LAN authentication with password enforcement for multi-device local network deployments.
|
|
33
|
+
|
|
34
|
+
---
|
|
35
|
+
|
|
36
|
+
## Installation
|
|
37
|
+
|
|
38
|
+
### Prerequisites
|
|
39
|
+
|
|
40
|
+
| Requirement | Supported Version | Notes |
|
|
41
|
+
| :---------- | :---------------- | :------------------------------------------------- |
|
|
42
|
+
| **Node.js** | `>= 22.5.0` | Required runtime ([Download](https://nodejs.org/)) |
|
|
43
|
+
| **npm** | Latest with Node | Global binary installation |
|
|
44
|
+
|
|
45
|
+
---
|
|
46
|
+
|
|
47
|
+
### Quick Install (CLI)
|
|
48
|
+
|
|
49
|
+
Install the global CLI binary via npm:
|
|
50
|
+
|
|
51
|
+
```bash
|
|
52
|
+
npm install -g @serifpersia/dango
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
Launch the interface from anywhere:
|
|
56
|
+
|
|
57
|
+
```bash
|
|
58
|
+
dango
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
> [!IMPORTANT]
|
|
62
|
+
> Once the server initializes, navigate to `http://localhost:3000` in your browser. The background process runs locally until terminated (`Ctrl + C or q key press as well as window X button closing action`).
|
|
63
|
+
|
|
64
|
+
---
|
|
65
|
+
|
|
66
|
+
### Android Installation
|
|
67
|
+
|
|
68
|
+
<details>
|
|
69
|
+
<summary><b>Option 1: Termux Environment</b></summary>
|
|
70
|
+
|
|
71
|
+
<br>
|
|
72
|
+
|
|
73
|
+
Run standard dango via Termux:
|
|
74
|
+
|
|
75
|
+
1. Install **[Termux](https://termux.dev/)** (obtain via [F-Droid](https://f-droid.org/en/packages/com.termux/)).
|
|
76
|
+
2. Update base dependencies:
|
|
77
|
+
```bash
|
|
78
|
+
pkg update
|
|
79
|
+
```
|
|
80
|
+
```bash
|
|
81
|
+
pkg upgrade -y
|
|
82
|
+
```
|
|
83
|
+
3. Install Node.js:
|
|
84
|
+
```bash
|
|
85
|
+
pkg install nodejs -y
|
|
86
|
+
```
|
|
87
|
+
4. Install and run dango:
|
|
88
|
+
```bash
|
|
89
|
+
npm install -g @serifpersia/dango
|
|
90
|
+
dango
|
|
91
|
+
```
|
|
92
|
+
5. Open your mobile browser at `http://localhost:3000`.
|
|
93
|
+
|
|
94
|
+
</details>
|
|
95
|
+
|
|
96
|
+
<details>
|
|
97
|
+
<summary><b>Option 2: Standalone APK</b></summary>
|
|
98
|
+
|
|
99
|
+
<br>
|
|
100
|
+
|
|
101
|
+
A standalone bundle packaging Node.js, dango, and a local WebView container.
|
|
102
|
+
|
|
103
|
+
1. Grab the latest `.apk` from [Releases](https://github.com/serifpersia/dango/releases).
|
|
104
|
+
2. Install the APK (allow _Install from Unknown Sources_ when prompted).
|
|
105
|
+
3. Open the app. Core runtimes auto-provision on first launch.
|
|
106
|
+
|
|
107
|
+
**Compiling from Source:**
|
|
108
|
+
|
|
109
|
+
```bash
|
|
110
|
+
cd android-app
|
|
111
|
+
python fetch-termux-node.py
|
|
112
|
+
|
|
113
|
+
# Windows
|
|
114
|
+
build-debug.bat
|
|
115
|
+
|
|
116
|
+
# Linux / macOS
|
|
117
|
+
chmod +x build-debug.sh && ./build-debug.sh
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
_Build requirements: Python 3, JDK 17+, Android SDK (Platform 36, Build-Tools 36.0.0)._
|
|
121
|
+
|
|
122
|
+
</details>
|
|
123
|
+
|
|
124
|
+
---
|
|
125
|
+
|
|
126
|
+
## Manual Setup (Development)
|
|
127
|
+
|
|
128
|
+
The project is structured as an **npm workspace** (`client` and `server`) managed by a unified root lockfile.
|
|
129
|
+
|
|
130
|
+
```bash
|
|
131
|
+
# Clone the repository
|
|
132
|
+
git clone https://github.com/serifpersia/dango.git
|
|
133
|
+
cd dango
|
|
134
|
+
|
|
135
|
+
# Install dependencies (root + workspaces hoisted)
|
|
136
|
+
npm install
|
|
137
|
+
|
|
138
|
+
# Compile workspaces (Vite frontend + tsc backend)
|
|
139
|
+
npm run build
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
Run via interactive environment scripts:
|
|
143
|
+
|
|
144
|
+
```bash
|
|
145
|
+
# Linux / macOS
|
|
146
|
+
chmod +x run.sh && ./run.sh
|
|
147
|
+
|
|
148
|
+
# Windows
|
|
149
|
+
run.bat
|
|
150
|
+
```
|
|
151
|
+
|
|
152
|
+
### Command Reference
|
|
153
|
+
|
|
154
|
+
| Command | Action |
|
|
155
|
+
| :------------------------------------- | :----------------------------------------- |
|
|
156
|
+
| `dango` | Start the installed client daemon |
|
|
157
|
+
| `dango --version` | Display current installed version |
|
|
158
|
+
| `npm run dev` | Start full dev stack via `orchestrator.js` |
|
|
159
|
+
| `npm run --workspace=dango-client dev` | Run Vite frontend independently |
|
|
160
|
+
| `npm run --workspace=dango-server dev` | Run backend via `nodemon` + `ts-node` |
|
|
161
|
+
| `npm run lint --workspaces` | Run ESLint passes across all packages |
|
|
162
|
+
|
|
163
|
+
---
|
|
164
|
+
|
|
165
|
+
## Storage & Persistence
|
|
166
|
+
|
|
167
|
+
dango stores SQLite databases, cached indices, and credentials in the OS application data registry rather than the global `node_modules` path:
|
|
168
|
+
|
|
169
|
+
| Platform | Default Path |
|
|
170
|
+
| :---------- | :----------------------------------------------- |
|
|
171
|
+
| **Windows** | `%APPDATA%\dango` |
|
|
172
|
+
| **macOS** | `~/Library/Application Support/dango` |
|
|
173
|
+
| **Linux** | `$XDG_DATA_HOME/dango` or `~/.local/share/dango` |
|
|
174
|
+
|
|
175
|
+
> [!IMPORTANT]
|
|
176
|
+
> Legacy installs will automatically migrate `.env` variables and SQLite records from older `server/` structures into the proper user directory on launch.
|
|
177
|
+
|
|
178
|
+
---
|
|
179
|
+
|
|
180
|
+
## Data Synchronization
|
|
181
|
+
|
|
182
|
+
dango is **local-first**: primary application state lives in your local SQLite store. Cloud syncing creates point-in-time JSON snapshots to maintain seamless backups across multiple installations.
|
|
183
|
+
|
|
184
|
+
```
|
|
185
|
+
Sync Priority Engine:
|
|
186
|
+
[1] GitHub Sync ──(fallback)──> [2] Google Drive ──(fallback)──> [3] Rclone
|
|
187
|
+
```
|
|
188
|
+
|
|
189
|
+
### 1. GitHub Sync
|
|
190
|
+
|
|
191
|
+
1. Open **Settings → Synchronization**.
|
|
192
|
+
2. Click **Sign in with GitHub**.
|
|
193
|
+
3. Authorize via the OAuth device code flow.
|
|
194
|
+
|
|
195
|
+
dango creates a private repository named `dango-sync-data` to read/write JSON snapshots (`sync.json` for production, `sync.dev.json` for development).
|
|
196
|
+
|
|
197
|
+
### 2. Google Drive
|
|
198
|
+
|
|
199
|
+
1. Open **Settings → Synchronization**.
|
|
200
|
+
2. Click **Sign in with Google** and authorize permissions.
|
|
201
|
+
|
|
202
|
+
Data writes directly to a sandbox `appDataFolder` on your personal Drive. To clear backups, revoke app permissions under Google Drive's _Manage Apps_ menu.
|
|
203
|
+
|
|
204
|
+
> [!IMPORTANT]
|
|
205
|
+
> Advanced users can supply their own custom Github and Google OAuth Client ID & Secret in settings.
|
|
206
|
+
|
|
207
|
+
### 3. Rclone (Third-Party Remotes)
|
|
208
|
+
|
|
209
|
+
Used as a manual fallback for services like Mega, Dropbox, or custom WebDAV:
|
|
210
|
+
|
|
211
|
+
1. Ensure `rclone` is installed and mapped to your system `PATH`.
|
|
212
|
+
2. Configure your desired target via `rclone config`.
|
|
213
|
+
3. Pick your configured remote profile inside **Settings → Synchronization**.
|
|
214
|
+
|
|
215
|
+
---
|
|
216
|
+
|
|
217
|
+
## Tracker Integrations
|
|
218
|
+
|
|
219
|
+
### AniList
|
|
220
|
+
|
|
221
|
+
Bidirectional sync is fully supported:
|
|
222
|
+
|
|
223
|
+
- Go to **Trackers** in the navigation panel.
|
|
224
|
+
- Select **Sync Now**.
|
|
225
|
+
- Local episode progress updates remotely; external catalog updates merge safely into your local database without overwriting uncommitted states.
|
|
226
|
+
|
|
227
|
+
---
|
|
228
|
+
|
|
229
|
+
## Community
|
|
230
|
+
|
|
231
|
+
Need help configuring your setup, troubleshooting builds, discussing feature requests or simply just chat about anime?
|
|
232
|
+
|
|
233
|
+
<div align="left">
|
|
234
|
+
|
|
235
|
+
[](https://discord.gg/2FTSPXCsvn)
|
|
236
|
+
|
|
237
|
+
</div>
|
|
238
|
+
|
|
239
|
+
---
|
|
240
|
+
|
|
241
|
+
## Disclaimer & Legal
|
|
242
|
+
|
|
243
|
+
dango is an open-source, local-first web app. It does not scrape, host or distribute unauthorized media or copyrighted video assets. Users are solely responsible for ensuring their usage aligns with relevant local laws and digital copyright regulations.
|
|
244
|
+
|
|
245
|
+
## License
|
|
246
|
+
|
|
247
|
+
Distributed under the terms of the [MIT License](LICENSE).
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
._container_1mjg1_1{max-width:var(--max-width);margin:0 auto;padding:0;min-height:100vh;background:var(--bg-main);overflow-x:hidden}._heroSection_1mjg1_11{position:relative;width:100%;padding-bottom:var(--space-12)}._bannerContainer_1mjg1_17{position:absolute;top:0;left:0;right:0;height:500px;overflow:hidden;z-index:0}._banner_1mjg1_17{width:100%;height:100%;background-size:cover;background-position:center 20%;filter:brightness(.3) saturate(1.1);transform:scale(1.05);transition:transform var(--transition-slow)}._bannerOverlay_1mjg1_37{position:absolute;inset:0;background:linear-gradient(to bottom,rgba(5,5,5,.4) 0%,rgba(5,5,5,.7) 40%,var(--bg-main) 100%);box-shadow:inset 0 -100px 100px -20px var(--bg-main)}._heroContent_1mjg1_49{position:relative;z-index:1;display:grid;grid-template-columns:320px 1fr;gap:var(--space-10);max-width:1200px;margin:0 auto;padding:var(--space-16) var(--space-6) 0;align-items:flex-start}._posterContainer_1mjg1_62{position:sticky;top:120px;border-radius:var(--radius-lg);overflow:hidden;box-shadow:0 20px 50px #00000080;transform:translateY(0);animation:_floatIn_1mjg1_1 .8s var(--ease-spring);border:1px solid var(--border-secondary)}._poster_1mjg1_62{width:100%;display:block;object-fit:cover;aspect-ratio:2 / 3;transition:transform var(--transition-base)}._posterContainer_1mjg1_62:hover ._poster_1mjg1_62{transform:scale(1.05)}._infoGlass_1mjg1_86{background:var(--glass-bg);backdrop-filter:blur(20px);-webkit-backdrop-filter:blur(20px);border:1px solid var(--glass-border);border-radius:var(--radius-xl);padding:var(--space-8);box-shadow:var(--glass-shadow);animation:_slideUpIn_1mjg1_1 .8s var(--ease-smooth);display:flex;flex-direction:column;gap:var(--space-8)}._title_1mjg1_100{font-size:clamp(1.5rem,4vw,2.5rem);font-weight:800;color:var(--text-primary);line-height:1.1;margin:0 0 var(--space-4);letter-spacing:-.02em}._quickMeta_1mjg1_109{display:flex;flex-wrap:wrap;gap:var(--space-6);align-items:center;margin-bottom:var(--space-2)}._metaItem_1mjg1_117{display:flex;align-items:center;gap:var(--space-2);color:var(--text-secondary);font-size:var(--font-size-sm);font-weight:500}._iconStar_1mjg1_126{color:#fbbf24}._iconTv_1mjg1_129{color:var(--accent)}._iconType_1mjg1_132{color:#10b981}._iconClock_1mjg1_135{color:#60a5fa}._genres_1mjg1_139{display:flex;flex-wrap:wrap;gap:var(--space-2);margin-top:var(--space-4)}._genre_1mjg1_139{background:#ffffff0d;padding:.4rem 1rem;border-radius:var(--radius-full);font-size:var(--font-size-sm);color:var(--text-secondary);border:1px solid var(--border-primary);transition:all var(--transition-fast);font-weight:500}._genre_1mjg1_139:hover{background:var(--accent);border-color:var(--accent);color:#fff;transform:translateY(-2px)}._synopsisSection_1mjg1_165{border-top:1px solid var(--border-primary);padding-top:var(--space-6)}._sectionTitleSmall_1mjg1_170{font-size:var(--font-size-sm);text-transform:uppercase;letter-spacing:.1em;color:var(--text-tertiary);margin-bottom:var(--space-3)}._description_1mjg1_178{font-size:var(--font-size-base);color:var(--text-secondary);line-height:1.7;max-width:800px}._actions_1mjg1_186{display:flex;gap:var(--space-4);margin-top:auto}._watchBtn_1mjg1_192{display:inline-flex;align-items:center;gap:var(--space-3);background:linear-gradient(135deg,var(--accent) 0%,var(--accent-dark) 100%);color:#fff;padding:.8rem 1.8rem;border-radius:var(--radius-md);font-weight:600;font-size:var(--font-size-sm);border:none;cursor:pointer;transition:all var(--transition-base);box-shadow:0 4px 15px var(--accent-glow)}._watchBtn_1mjg1_192:hover{transform:translateY(-2px);box-shadow:0 8px 25px var(--accent-glow);opacity:.95}._watchlistBtn_1mjg1_214{display:inline-flex;align-items:center;gap:var(--space-3);background:#ffffff0d;color:var(--text-primary);border:1px solid var(--border-secondary);padding:.8rem 1.8rem;border-radius:var(--radius-md);font-weight:600;font-size:var(--font-size-sm);cursor:pointer;transition:all var(--transition-base)}._watchlistBtn_1mjg1_214:hover{background:#ffffff1a;border-color:var(--text-secondary)}._watchlistBtn_1mjg1_214._active_1mjg1_234{background:#10b9811a;border-color:#10b981;color:#10b981}._detailsSection_1mjg1_241{max-width:1200px;margin:0 auto var(--space-16);padding:0 var(--space-6)}._detailsToggleBtn_1mjg1_247{display:flex;align-items:center;justify-content:center;gap:var(--space-3);width:100%;padding:var(--space-4);background:var(--bg-secondary);color:var(--text-secondary);border:1px solid var(--border-primary);border-radius:var(--radius-lg);font-weight:600;cursor:pointer;transition:all var(--transition-base);margin-bottom:var(--space-6)}._detailsToggleBtn_1mjg1_247:hover{background:var(--bg-tertiary);color:var(--text-primary);border-color:var(--border-secondary)}._expandedContent_1mjg1_270{animation:_fadeIn_1mjg1_1 .5s var(--ease-smooth)}._detailsGridContainer_1mjg1_274{display:grid;grid-template-columns:repeat(auto-fill,minmax(240px,1fr));gap:var(--space-6);padding:var(--space-8);background:var(--bg-secondary);border-radius:var(--radius-xl);border:1px solid var(--border-primary)}._detailItem_1mjg1_284{display:flex;flex-direction:column;gap:var(--space-1)}._detailItem_1mjg1_284 strong{font-size:.7rem;color:var(--text-tertiary);text-transform:uppercase;letter-spacing:.1em}._detailItem_1mjg1_284 span{font-size:var(--font-size-sm);color:var(--text-primary);font-weight:500}._airingValue_1mjg1_303{color:var(--accent-light)!important}._loadingDetails_1mjg1_308{display:flex;flex-direction:column;align-items:center;gap:var(--space-4);padding:var(--space-12);color:var(--text-tertiary)}._spinner_1mjg1_317{width:30px;height:30px;border:3px solid rgba(255,255,255,.1);border-top-color:var(--accent);border-radius:50%;animation:_spin_1mjg1_317 .8s linear infinite}@keyframes _spin_1mjg1_317{to{transform:rotate(360deg)}}._heroSkeleton_1mjg1_332{width:100%}._skeletonBanner_1mjg1_336,._skeletonPoster_1mjg1_337,._skeletonTitle_1mjg1_338,._skeletonMeta_1mjg1_339,._skeletonDesc_1mjg1_340,._skeletonActions_1mjg1_341{position:relative;overflow:hidden;background:var(--bg-tertiary)}._skeletonBanner_1mjg1_336:after,._skeletonPoster_1mjg1_337:after,._skeletonTitle_1mjg1_338:after,._skeletonMeta_1mjg1_339:after,._skeletonDesc_1mjg1_340:after,._skeletonActions_1mjg1_341:after{content:"";position:absolute;inset:0;transform:translate(-100%);background-image:linear-gradient(90deg,#fff0 0,#ffffff0d 20%,#ffffff1f 60%,#fff0);animation:_skeleton-wave_1mjg1_1 1.8s infinite ease-in-out}._skeletonBanner_1mjg1_336{height:400px}._skeletonContent_1mjg1_374{max-width:1200px;margin:-100px auto 0;padding:0 var(--space-6);display:grid;grid-template-columns:320px 1fr;gap:var(--space-10)}._skeletonPoster_1mjg1_337{height:480px;border-radius:var(--radius-lg)}._skeletonInfo_1mjg1_388{background:var(--bg-secondary);border-radius:var(--radius-xl);padding:var(--space-8);display:flex;flex-direction:column;gap:var(--space-6)}._skeletonTitle_1mjg1_338{height:40px;width:60%;border-radius:var(--radius-sm)}._skeletonMeta_1mjg1_339{height:24px;width:40%;border-radius:var(--radius-sm)}._skeletonDesc_1mjg1_340{height:160px;width:100%;border-radius:var(--radius-sm)}._skeletonActions_1mjg1_341{height:50px;width:50%;border-radius:var(--radius-sm)}@keyframes _floatIn_1mjg1_1{0%{opacity:0;transform:translateY(30px) scale(.95)}to{opacity:1;transform:translateY(0) scale(1)}}@keyframes _slideUpIn_1mjg1_1{0%{opacity:0;transform:translateY(50px)}to{opacity:1;transform:translateY(0)}}@keyframes _fadeIn_1mjg1_1{0%{opacity:0}to{opacity:1}}@media(max-width:1024px){._heroContent_1mjg1_49{grid-template-columns:1fr;padding-top:var(--space-12)}._posterContainer_1mjg1_62{width:220px;margin:0 auto;position:relative;top:0}._infoGlass_1mjg1_86{margin-top:-40px;padding-top:var(--space-12);text-align:center}._quickMeta_1mjg1_109,._genres_1mjg1_139{justify-content:center}._actions_1mjg1_186{flex-direction:column}._watchBtn_1mjg1_192,._watchlistBtn_1mjg1_214{width:100%;justify-content:center}._skeletonContent_1mjg1_374{grid-template-columns:1fr}._skeletonPoster_1mjg1_337{width:220px;height:330px;margin:0 auto}}@media(max-width:768px){._heroSection_1mjg1_11{padding-bottom:var(--space-8)}._heroContent_1mjg1_49{grid-template-columns:1fr;gap:var(--space-6);padding:var(--space-12) var(--space-4) 0}._posterContainer_1mjg1_62{position:relative;top:0;max-width:240px;margin:0 auto;margin-bottom:var(--space-4);animation:none}._infoGlass_1mjg1_86{padding:var(--space-6);animation:none}}@media(max-width:480px){._infoGlass_1mjg1_86{padding:var(--space-6);animation:none}._title_1mjg1_100{font-size:1.5rem}._quickMeta_1mjg1_109{gap:var(--space-3)}._metaItem_1mjg1_117 span{font-size:.75rem}}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{p as C,f as y,d as S,h as g,T as I,e}from"./vendor-rLNfZm7Y.js";import{g as T,h as r,i as b,a7 as B,a_ as w,s as D,j as M,Q as x,ar as A,b as G,c as P,an as F,B as h}from"./index-CpjgU8ou.js";import{u as W}from"./useAnimeInfoData-BOfyi9UJ.js";import{u as O}from"./useMatureConsent-CZMYBVXd.js";import{S as U,A as $}from"./SynopsisText-BlFw0R-0.js";import{Q as q}from"./useIsMobile-Cb8HcKRj.js";const z="_container_1mjg1_1",Q="_heroSection_1mjg1_11",V="_bannerContainer_1mjg1_17",E="_banner_1mjg1_17",H="_bannerOverlay_1mjg1_37",L="_heroContent_1mjg1_49",J="_posterContainer_1mjg1_62",K="_floatIn_1mjg1_1",R="_poster_1mjg1_62",X="_infoGlass_1mjg1_86",Y="_slideUpIn_1mjg1_1",Z="_title_1mjg1_100",ee="_quickMeta_1mjg1_109",ne="_metaItem_1mjg1_117",te="_iconStar_1mjg1_126",se="_iconTv_1mjg1_129",ae="_iconType_1mjg1_132",ie="_iconClock_1mjg1_135",oe="_genres_1mjg1_139",le="_genre_1mjg1_139",ce="_synopsisSection_1mjg1_165",re="_sectionTitleSmall_1mjg1_170",me="_description_1mjg1_178",_e="_actions_1mjg1_186",de="_watchBtn_1mjg1_192",ge="_watchlistBtn_1mjg1_214",he="_active_1mjg1_234",pe="_detailsSection_1mjg1_241",ue="_detailsToggleBtn_1mjg1_247",ve="_expandedContent_1mjg1_270",ke="_fadeIn_1mjg1_1",je="_detailsGridContainer_1mjg1_274",fe="_detailItem_1mjg1_284",Ne="_airingValue_1mjg1_303",Ce="_loadingDetails_1mjg1_308",ye="_spinner_1mjg1_317",Se="_spin_1mjg1_317",Ie="_heroSkeleton_1mjg1_332",Te="_skeletonBanner_1mjg1_336",be="_skeletonPoster_1mjg1_337",Be="_skeletonTitle_1mjg1_338",we="_skeletonMeta_1mjg1_339",De="_skeletonDesc_1mjg1_340",Me="_skeletonActions_1mjg1_341",xe="_skeletonContent_1mjg1_374",Ae="_skeletonInfo_1mjg1_388",n={container:z,heroSection:Q,bannerContainer:V,banner:E,bannerOverlay:H,heroContent:L,posterContainer:J,floatIn:K,poster:R,infoGlass:X,slideUpIn:Y,title:Z,quickMeta:ee,metaItem:ne,iconStar:te,iconTv:se,iconType:ae,iconClock:ie,genres:oe,genre:le,synopsisSection:ce,sectionTitleSmall:re,description:me,actions:_e,watchBtn:de,watchlistBtn:ge,active:he,detailsSection:pe,detailsToggleBtn:ue,expandedContent:ve,fadeIn:ke,detailsGridContainer:je,detailItem:fe,airingValue:Ne,loadingDetails:Ce,spinner:ye,spin:Se,heroSkeleton:Ie,skeletonBanner:Te,skeletonPoster:be,skeletonTitle:Be,skeletonMeta:we,skeletonDesc:De,skeletonActions:Me,"skeleton-wave":"_skeleton-wave_1mjg1_1",skeletonContent:xe,skeletonInfo:Ae};function $e(){const{id:s}=C(),a=y(),{titlePreference:o}=T(),[i,p]=S(!1),{showMeta:t,loadingMeta:u,toggleWatchlist:v,inWatchlist:l}=W(s),{hasConsent:k,grant:j}=O();g(()=>{s&&t?.id&&t.id!==s&&a(`/anime/${t.id}`,{replace:!0})},[s,t,a]),g(()=>{document.title=t?.name?`${t.name} - dango`:"Anime - dango"},[t?.name]);const f=()=>t?.name?o==="name"?t.name:o==="nativeName"?t.names?.native||t.name:o==="englishName"&&t.names?.english||t.name:"",N=()=>{s&&a(`/watch/${s}`)},m=I(()=>t?.bannerImage?r(t.bannerImage):t?.thumbnail?r(t.thumbnail,1200,450):"",[t?.bannerImage,t?.thumbnail]);if(u||!t?.name)return e("div",{className:n.container,children:e("div",{className:n.heroSkeleton,children:[e("div",{className:n.skeletonBanner}),e("div",{className:n.skeletonContent,children:[e("div",{className:n.skeletonPoster}),e("div",{className:n.skeletonInfo,children:[e("div",{className:n.skeletonTitle}),e("div",{className:n.skeletonMeta}),e("div",{className:n.skeletonDesc}),e("div",{className:n.skeletonActions})]})]})]})});const _=t.isAdult===!0&&!k;return e("div",{className:n.container,style:_?{filter:"blur(14px)",pointerEvents:"none",userSelect:"none"}:void 0,children:[e("div",{className:n.heroSection,children:[e("div",{className:n.bannerContainer,children:[e("div",{className:n.banner,style:m?{backgroundImage:`url(${m})`}:void 0}),e("div",{className:n.bannerOverlay})]}),e("div",{className:n.heroContent,children:[e("div",{className:n.posterContainer,children:e("img",{src:r(t.thumbnail||"",320,480),alt:t.name,className:n.poster})}),e("div",{className:n.infoGlass,children:[e("div",{className:n.topInfo,children:[e("h1",{className:n.title,children:f()}),e("div",{className:n.quickMeta,children:[t.score&&e("div",{className:n.metaItem,children:[e(b,{className:n.iconStar}),e("span",{children:t.score})]}),t.status&&e("div",{className:n.metaItem,children:[e(B,{className:n.iconTv}),e("span",{children:t.status})]}),t.type&&e("div",{className:n.metaItem,children:[e(w,{className:n.iconType}),e("span",{children:t.type})]})]}),Array.isArray(t.genres)&&t.genres.length>0&&e("div",{className:n.genres,children:t.genres.filter(Boolean).slice(0,5).map(c=>{const d=typeof c=="string"?c:c?.name;return e("span",{className:n.genre,children:d},d)})})]}),e("div",{className:n.synopsisSection,children:[e("h2",{className:n.sectionTitleSmall,children:"Synopsis"}),e(U,{text:D(t.description),emptyText:"No description available."})]}),e("div",{className:n.actions,children:[e("button",{className:n.watchBtn,onClick:N,children:[e(M,{size:14}),"Start Watching"]}),e("button",{className:`${n.watchlistBtn} ${l?n.active:""}`,onClick:v,children:[l?e(x,{size:14}):e(A,{size:14}),l?"In Watchlist":"Add to Watchlist"]}),e(q,{showId:s,showName:t.name||t.names?.romaji,showThumbnail:t.thumbnail,nativeName:t.names?.native,englishName:t.names?.english,showType:t.type,className:n.watchlistBtn,activeClassName:n.active})]})]})]})]}),e("div",{className:n.detailsSection,children:[e("button",{className:n.detailsToggleBtn,onClick:()=>{p(!i)},children:[i?e(G,{}):e(P,{}),i?"Hide Details":"Show Details"]}),i&&e("div",{className:n.expandedContent,children:e($,{showMeta:t,styles:n})})]}),_&&e(F,{isOpen:!0,title:"Content Warning",onClose:()=>a("/"),children:e("div",{style:{padding:"1rem",textAlign:"center"},children:[e("p",{children:"This title contains mature content intended for adult audiences."}),e("p",{children:["By proceeding, you confirm that you are ",e("strong",{children:"18 years of age or older"})," (or the age of majority in your jurisdiction) and wish to view this content."]}),e("div",{style:{marginTop:"1rem",display:"flex",gap:"10px",justifyContent:"center"},children:[e(h,{variant:"secondary",onClick:()=>a("/"),children:"Go Back"}),e(h,{onClick:j,children:"I'm 18+, Continue"})]})]})})]})}export{$e as default};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/AnimeInfo-DVdaocCl.js","assets/vendor-rLNfZm7Y.js","assets/index-CpjgU8ou.js","assets/index-B6qdXFtl.css","assets/useAnimeInfoData-BOfyi9UJ.js","assets/useIsMobile-Cb8HcKRj.js","assets/useIsMobile-CM15uQn8.css","assets/useMatureConsent-CZMYBVXd.js","assets/SynopsisText-BlFw0R-0.js","assets/SynopsisText-CUgOjOxt.css","assets/AnimeInfo-CMxs0nRH.css"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{b1 as r,ae as e}from"./index-CpjgU8ou.js";import{e as o,P as a,z as t}from"./vendor-rLNfZm7Y.js";const i=t(()=>e(()=>import("./AnimeInfo-DVdaocCl.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10])));function m(){return o(a,{fallback:o(r,{}),children:o(i,{})})}export{m as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
._page_fb9s9_1{max-width:var(--layout-asmr-max-width);margin:0 auto;padding:var(--space-6) var(--space-4);min-height:calc(100vh - var(--layout-page-offset))}._pageWithPlayer_fb9s9_8{padding-bottom:var(--layout-page-offset)}._header_fb9s9_12{display:flex;align-items:center;gap:var(--space-4);flex-wrap:wrap;margin-bottom:var(--space-5)}._pageTitle_fb9s9_20{display:flex;align-items:center;gap:var(--space-2);font-size:var(--font-size-xl);margin:0;color:var(--text-primary)}._searchForm_fb9s9_29{display:flex;flex:1;min-width:var(--size-220);max-width:var(--size-480);border:var(--space-px) solid var(--border-primary);border-radius:var(--radius-md);background:var(--bg-secondary);overflow:hidden}._searchForm_fb9s9_29:focus-within{border-color:var(--accent)}._searchInput_fb9s9_44{flex:1;min-width:0;padding:var(--space-2-5) var(--space-3);border:none;background:transparent;color:var(--text-primary);font-size:var(--font-size-sm);outline:none}._searchBtn_fb9s9_55{display:flex;align-items:center;justify-content:center;flex-shrink:0;width:var(--size-44);border:none;border-left:var(--space-px) solid var(--border-primary);background:var(--accent);color:var(--text-primary);cursor:pointer}._sortSelect_fb9s9_68{padding:var(--space-2-5) var(--space-3);border:var(--space-px) solid var(--border-primary);border-radius:var(--radius-md);background:var(--bg-secondary);color:var(--text-primary);font-size:var(--font-size-sm);cursor:pointer}._grid_fb9s9_78{display:grid;grid-template-columns:repeat(auto-fill,minmax(var(--size-250),1fr));gap:var(--space-4);transition:opacity var(--transition-fast)}._fetching_fb9s9_85{opacity:.45;pointer-events:none}._card_fb9s9_90{display:flex;flex-direction:column;text-align:left;padding:0;border:none;background:none;cursor:pointer;color:inherit}._thumbWrap_fb9s9_101{position:relative;aspect-ratio:4 / 3;border-radius:var(--radius-lg);overflow:hidden;background:var(--bg-tertiary);transition:transform var(--transition-fast) var(--ease-smooth),box-shadow var(--transition-fast) var(--ease-smooth)}._card_fb9s9_90:hover ._thumbWrap_fb9s9_101{transform:translateY(calc(var(--space-1) * -1));box-shadow:var(--shadow-lg)}._thumb_fb9s9_101{width:100%;height:100%;object-fit:cover;display:block}._thumbPlaceholder_fb9s9_124{display:flex;align-items:center;justify-content:center;color:var(--text-tertiary);font-size:var(--font-size-sm)}._adultBadge_fb9s9_132{position:absolute;top:var(--space-2);right:var(--space-2);padding:var(--space-2px) var(--space-2);border-radius:var(--radius-full);background:var(--color-danger-bg);color:var(--text-primary);font-size:var(--font-size-xs);font-weight:var(--font-weight-semibold)}._cardTitle_fb9s9_144{margin:var(--space-2) 0 var(--space-2px);font-size:var(--font-size-sm);color:var(--text-primary);display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}._cardMeta_fb9s9_154{margin:0;font-size:var(--font-size-xs);color:var(--text-tertiary)}._statusMsg_fb9s9_160{text-align:center;color:var(--text-secondary);padding:var(--space-8) 0}._skeletonCard_fb9s9_168{display:flex;flex-direction:column}._skeletonThumb_fb9s9_173{aspect-ratio:4 / 3;border-radius:var(--radius-lg);background:var(--bg-tertiary)}._skeletonLine_fb9s9_179{height:var(--space-3);border-radius:var(--radius-xs);margin-top:var(--space-2);background:var(--bg-tertiary)}._shimmer_fb9s9_186{position:relative;overflow:hidden}._shimmer_fb9s9_186:after{content:"";position:absolute;inset:0;transform:translate(-100%);background:linear-gradient(90deg,transparent,var(--shimmer-highlight),transparent);animation:_skeleton-wave_fb9s9_1 var(--duration-shimmer) infinite}._pagination_fb9s9_200{display:flex;align-items:center;justify-content:center;gap:var(--space-4);margin-top:var(--space-6)}._pageBtn_fb9s9_208{padding:var(--space-2) var(--space-5);border:var(--space-px) solid var(--border-primary);border-radius:var(--radius-md);background:var(--bg-elevated);color:var(--text-primary);cursor:pointer}._pageBtn_fb9s9_208:disabled{opacity:.4;cursor:not-allowed}._pageIndicator_fb9s9_222{color:var(--text-secondary);font-size:var(--font-size-sm)}._matureToggleWrap_fb9s9_227{display:flex;align-items:center;gap:var(--space-2);margin-left:auto}._matureLabel_fb9s9_234{font-size:var(--font-size-xs);font-weight:var(--font-weight-bold);color:var(--text-secondary)}._translateToggleWrap_fb9s9_240{display:flex;align-items:center;gap:var(--space-2);margin-left:auto}._filterTogglesGroup_fb9s9_247{display:flex;align-items:center;gap:var(--space-4);margin-left:auto}._filterTogglesGroup_fb9s9_247 ._translateToggleWrap_fb9s9_240,._filterTogglesGroup_fb9s9_247 ._matureToggleWrap_fb9s9_227{margin-left:0}._filterBar_fb9s9_259{display:flex;align-items:center;gap:var(--space-2);margin-bottom:var(--space-4)}._filterLabel_fb9s9_266{font-size:var(--font-size-sm);color:var(--text-secondary)}._detailOverlay_fb9s9_271{position:fixed;inset:0;z-index:var(--z-modal);display:flex;align-items:center;justify-content:center;background:var(--bg-overlay-heavy);-webkit-backdrop-filter:blur(var(--blur-sm));backdrop-filter:blur(var(--blur-sm));padding:var(--space-4)}._detailModal_fb9s9_283{position:relative;width:min(var(--size-720),100%);max-height:85vh;overflow-y:auto;border-radius:var(--radius-xl);border:var(--space-px) solid var(--border-secondary);background:var(--bg-elevated);box-shadow:var(--glass-shadow);padding:var(--space-5)}._detailClose_fb9s9_295{position:absolute;top:var(--space-3);right:var(--space-3);display:flex;align-items:center;justify-content:center;width:var(--size-34);height:var(--size-34);border:none;border-radius:var(--radius-full);background:var(--bg-tertiary);color:var(--text-primary);cursor:pointer}._detailHeader_fb9s9_311{display:flex;gap:var(--space-4)}._detailCover_fb9s9_316{width:var(--size-180);aspect-ratio:2 / 3;object-fit:cover;border-radius:var(--radius-lg);flex-shrink:0;background:var(--bg-tertiary)}._detailInfo_fb9s9_325{min-width:0}._detailTitle_fb9s9_329{margin:0 0 var(--space-2);font-size:var(--font-size-lg);color:var(--text-primary);line-height:1.35}._detailRj_fb9s9_336{margin:0 0 var(--space-3);font-size:var(--font-size-xs);color:var(--text-tertiary)}._metaRow_fb9s9_342{margin:0 0 4px;font-size:var(--font-size-sm);color:var(--text-secondary)}._metaLabel_fb9s9_348{display:inline-block;min-width:var(--space-16);color:var(--text-tertiary)}._tagChips_fb9s9_354{display:inline-flex;flex-wrap:wrap;gap:var(--space-1)}._tagChip_fb9s9_354{padding:var(--space-2px) var(--space-2);border-radius:var(--radius-full);background:var(--bg-tertiary);color:var(--text-secondary);font-size:var(--font-size-xs)}._npOverlay_fb9s9_370{position:fixed;inset:0;z-index:var(--z-overlay);display:flex;flex-direction:column;background:var(--bg-dark);overflow:hidden;overscroll-behavior:contain}body.asmr-player-open{overflow:hidden}._playerBarDocked_fb9s9_385{position:static;transform:translateY(0);max-height:var(--size-240);overflow:visible;transition:transform var(--transition-emphasized),max-height var(--transition-emphasized),opacity var(--transition-base),padding var(--transition-base),border-width var(--transition-base);will-change:transform,max-height,opacity}._playerBarDockedHidden_fb9s9_399{max-height:0!important;opacity:0;transform:translateY(18%);padding-top:0!important;padding-bottom:0!important;border-width:0!important;pointer-events:none;overflow:hidden!important}._npOverlayControlsHidden_fb9s9_410 ._npArrow_fb9s9_410,._npOverlayControlsHidden_fb9s9_410 ._npImageCount_fb9s9_411{opacity:0;pointer-events:none;transform:translateY(-50%) scale(.96);transition:opacity var(--transition-base),transform var(--transition-emphasized)}._npOverlayControlsHidden_fb9s9_410 ._npStage_fb9s9_420{cursor:pointer}._npStage_fb9s9_420{position:relative;flex:1;min-height:0;display:flex;align-items:center;justify-content:center;background:var(--bg-black);transition:padding var(--transition-emphasized)}._npStage_fb9s9_420,._sliderViewport_fb9s9_436,._slide_fb9s9_436,._slideImg_fb9s9_438{-webkit-tap-highlight-color:transparent;-webkit-touch-callout:none;outline:none;-webkit-user-select:none;user-select:none}._npStage_fb9s9_420:focus,._sliderViewport_fb9s9_436:focus,._slide_fb9s9_436:focus,._slideImg_fb9s9_438:focus{outline:none!important;box-shadow:none!important}._slideImg_fb9s9_438::-moz-focus-inner{border:0}._npStageBlank_fb9s9_457{background:var(--bg-dark)}._npStageImg_fb9s9_461{max-width:min(92vw,var(--size-900));max-height:100%;object-fit:contain;-webkit-user-select:none;user-select:none}._sliderViewport_fb9s9_436{position:absolute;inset:0;overflow:hidden}._sliderTrack_fb9s9_476{display:flex;height:100%;transition:transform var(--transition-normal);will-change:transform}._slide_fb9s9_436{flex:0 0 100%;height:100%;display:flex;align-items:center;justify-content:center;padding:var(--space-5) var(--size-84);box-sizing:border-box;transition:padding var(--transition-emphasized)}._slideImg_fb9s9_438{max-width:100%;max-height:100%;object-fit:contain;-webkit-user-select:none;user-select:none;opacity:0;transform:scale(.985);-webkit-tap-highlight-color:transparent;outline:none;transition:opacity var(--transition-base),transform var(--transition-emphasized),max-height var(--transition-emphasized)}._slideImgLoaded_fb9s9_509{opacity:1;transform:none}._slideSpinner_fb9s9_514{position:absolute;left:50%;top:50%;width:var(--size-44);height:var(--size-44);margin:calc(var(--size-22) * -1) 0 0 calc(var(--size-22) * -1);border-radius:var(--radius-full);border:var(--space-2px) solid var(--border-strong);border-top-color:var(--text-primary);animation:_spin_fb9s9_1 var(--duration-spin) linear infinite;pointer-events:none}@keyframes _spin_fb9s9_1{to{transform:rotate(360deg)}}._npArrow_fb9s9_410{position:absolute;top:50%;transform:translateY(-50%);display:flex;align-items:center;justify-content:center;width:var(--size-48);height:var(--size-48);border:var(--space-px) solid var(--border-strong);border-radius:var(--radius-full);background:var(--bg-scrim);-webkit-backdrop-filter:blur(var(--blur-md));backdrop-filter:blur(var(--blur-md));box-shadow:var(--shadow-scrim);color:var(--text-primary);cursor:pointer;transition:background var(--transition-fast),opacity var(--transition-fast)}._npArrow_fb9s9_410:hover:not(:disabled){background:var(--bg-scrim-strong)}._npArrow_fb9s9_410:disabled{opacity:.25;cursor:not-allowed}._npArrowLeft_fb9s9_564{left:var(--space-5)}._npArrowRight_fb9s9_568{right:var(--space-5)}._npImageCount_fb9s9_411{position:absolute;top:calc(var(--space-4) + var(--space-16));right:var(--space-4);padding:var(--space-2px) var(--space-2-5);border-radius:var(--radius-full);background:var(--bg-overlay-strong);color:var(--text-secondary);font-size:var(--font-size-xs);font-variant-numeric:tabular-nums;z-index:var(--z-base)}._chapterPanel_fb9s9_585{position:absolute;bottom:calc(100% + var(--space-2-5));right:var(--space-5);width:min(var(--size-440),calc(100vw - var(--space-8)));max-height:min(46vh,var(--size-420));overflow-y:auto;background:var(--bg-elevated);border:var(--space-px) solid var(--border-secondary);border-radius:var(--radius-lg);box-shadow:var(--shadow-panel);padding:var(--space-1-5);z-index:var(--z-dropdown)}._chapterRow_fb9s9_600{display:flex;align-items:baseline;gap:var(--space-3);width:100%;text-align:left;padding:var(--space-2) var(--space-3);border:none;border-radius:var(--radius-md);background:transparent;color:var(--text-primary);cursor:pointer;font-size:var(--font-size-sm)}._chapterRow_fb9s9_600:hover{background:var(--bg-tertiary)}._chapterRowActive_fb9s9_619{background:var(--bg-selected)}._chapterRowTime_fb9s9_623{flex-shrink:0;color:var(--text-tertiary);font-variant-numeric:tabular-nums}._chapterRowActive_fb9s9_619 ._chapterRowTime_fb9s9_623{color:var(--accent);font-weight:var(--font-weight-semibold)}._chapterRowLabel_fb9s9_634{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}._npBackdrop_fb9s9_640{position:fixed;inset:0;z-index:-1}._playerBtnActive_fb9s9_646{color:var(--accent)}._tracksSection_fb9s9_650{margin-top:var(--space-5)}._tracksHeading_fb9s9_654{font-size:var(--font-size-base);color:var(--text-primary);margin:0 0 var(--space-2)}._trackList_fb9s9_660{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:var(--space-1-5)}._trackRow_fb9s9_669{display:flex;align-items:center;gap:var(--space-3);width:100%;padding:var(--space-2) var(--space-3);border:var(--space-px) solid var(--border-secondary);border-radius:var(--radius-md);background:var(--bg-secondary);color:var(--text-primary);cursor:pointer;font-size:var(--font-size-sm)}._trackRow_fb9s9_669:hover{border-color:var(--accent)}._trackIcon_fb9s9_687{color:var(--accent);flex-shrink:0}._trackLabel_fb9s9_692{flex:1;text-align:left}._trackType_fb9s9_697{font-size:var(--font-size-xs);color:var(--text-tertiary)}._noTracks_fb9s9_702{color:var(--text-secondary);font-size:var(--font-size-sm)}._playAllBtn_fb9s9_707{display:inline-flex;align-items:center;gap:var(--space-2);margin-top:var(--space-5);padding:var(--space-2-5) var(--space-5);border:none;border-radius:var(--radius-md);background:var(--accent);color:var(--text-primary);font-size:var(--font-size-base);cursor:pointer}._playerBar_fb9s9_385{position:fixed;left:0;right:0;bottom:0;z-index:var(--z-overlay);display:flex;align-items:center;gap:var(--space-4);padding:var(--space-2-5) var(--space-5);padding-bottom:calc(var(--space-2-5) + env(safe-area-inset-bottom,0px));background:var(--glass-bg);border-top:var(--space-px) solid var(--glass-border);-webkit-backdrop-filter:blur(var(--blur-lg));backdrop-filter:blur(var(--blur-lg))}._playerActions_fb9s9_737{display:flex;align-items:center;gap:var(--space-2)}._playerInfo_fb9s9_743{min-width:0;width:var(--size-240)}._playerTitle_fb9s9_748{margin:0;font-size:var(--font-size-sm);color:var(--text-primary);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}._playerTrack_fb9s9_757{margin:var(--space-2px) 0 0;font-size:var(--font-size-xs);color:var(--text-tertiary)}._playerControls_fb9s9_763{display:flex;align-items:center;gap:var(--space-3);flex:1}._seekRow_fb9s9_770{display:flex;align-items:center;gap:var(--space-3);flex:1;min-width:0}._playerButtons_fb9s9_778{display:flex;align-items:center;gap:var(--space-2)}._playerBtn_fb9s9_646{display:flex;align-items:center;justify-content:center;width:var(--size-36);height:var(--size-36);border:none;border-radius:var(--radius-full);background:transparent;color:var(--text-primary);cursor:pointer;transition:background var(--transition-fast),color var(--transition-fast),transform var(--transition-quick),opacity var(--transition-fast)}._playerBtn_fb9s9_646:disabled{opacity:.35;cursor:not-allowed}@media(hover:hover)and (pointer:fine){._playerBtn_fb9s9_646:hover:not(:disabled){background:var(--bg-hover);color:var(--text-primary)}._seekBtn_fb9s9_813:hover:not(:disabled){background:var(--bg-hover-strong);color:var(--accent)}._seekBtn_fb9s9_813:hover ._seekBtnLabel_fb9s9_818{background:var(--accent);color:var(--text-primary)}._playBtn_fb9s9_823:hover:not(:disabled){background:var(--accent-light);color:var(--text-primary);box-shadow:0 0 12px var(--accent-glow)}}._playerBtn_fb9s9_646:active:not(:disabled){transform:scale(.94);transition:transform var(--transition-quick),background var(--transition-quick)}._playBtn_fb9s9_823{background:var(--accent);color:var(--text-primary);width:var(--size-42);height:var(--size-42)}._playBtn_fb9s9_823:disabled{opacity:1}._seekBtn_fb9s9_813{position:relative;font-size:var(--font-size-sm);color:var(--text-primary)}._seekBtnLabel_fb9s9_818{position:absolute;bottom:var(--space-px);left:50%;transform:translate(-50%);font-size:var(--font-size-2xs);font-weight:var(--font-weight-bold);line-height:1;letter-spacing:-.02em;background:var(--bg-overlay);color:var(--text-primary);padding:var(--space-px) var(--space-2px);border-radius:var(--radius-sm);pointer-events:none}._seekBar_fb9s9_870,._volumeBar_fb9s9_871{-webkit-appearance:none;appearance:none;height:var(--size-18);background:transparent;cursor:pointer}._seekBar_fb9s9_870::-webkit-slider-runnable-track,._volumeBar_fb9s9_871::-webkit-slider-runnable-track{width:100%;height:var(--space-1);border-radius:var(--space-1)}._seekBar_fb9s9_870::-webkit-slider-runnable-track{background:linear-gradient(to right,var(--accent) 0%,var(--accent) var(--played-percent, 0%),var(--track-buffered) var(--played-percent, 0%),var(--track-buffered) var(--buffered-percent, 0%),var(--track-bg) var(--buffered-percent, 0%),var(--track-bg) 100%)}._volumeBar_fb9s9_871::-webkit-slider-runnable-track{background:linear-gradient(to right,var(--accent) 0%,var(--accent) var(--volume-percent, 100%),var(--track-bg) var(--volume-percent, 100%),var(--track-bg) 100%)}._seekBar_fb9s9_870::-moz-range-track{width:100%;height:var(--space-1);border-radius:var(--space-1);background:linear-gradient(to right,var(--accent) 0%,var(--accent) var(--played-percent, 0%),var(--track-buffered) var(--played-percent, 0%),var(--track-buffered) var(--buffered-percent, 0%),var(--track-bg) var(--buffered-percent, 0%),var(--track-bg) 100%)}._volumeBar_fb9s9_871::-moz-range-track{width:100%;height:var(--space-1);border-radius:var(--space-1);background:linear-gradient(to right,var(--accent) 0%,var(--accent) var(--volume-percent, 100%),var(--track-bg) var(--volume-percent, 100%),var(--track-bg) 100%)}._seekBar_fb9s9_870::-webkit-slider-thumb,._volumeBar_fb9s9_871::-webkit-slider-thumb{-webkit-appearance:none;appearance:none;height:var(--space-3);width:var(--space-3);border-radius:var(--radius-full);background:var(--text-primary);margin-top:calc(var(--space-1) * -1);box-shadow:var(--shadow-thumb)}._seekBar_fb9s9_870::-moz-range-thumb,._volumeBar_fb9s9_871::-moz-range-thumb{height:var(--space-3);width:var(--space-3);border:none;border-radius:var(--radius-full);background:var(--text-primary);box-shadow:var(--shadow-thumb)}._seekBar_fb9s9_870{flex:1;min-width:0}._timeLabel_fb9s9_963{font-size:var(--font-size-xs);color:var(--text-secondary);font-variant-numeric:tabular-nums}._playerRight_fb9s9_969{display:flex;align-items:center;gap:var(--space-2)}._volumeIcon_fb9s9_975{color:var(--text-secondary)}._volumeBar_fb9s9_871{width:var(--size-90)}@media(max-width:768px){._detailHeader_fb9s9_311{flex-direction:column}._detailCover_fb9s9_316{width:var(--size-140)}._filterBar_fb9s9_259{flex-wrap:wrap}._filterBar_fb9s9_259 ._sortSelect_fb9s9_68{flex:1 1 var(--size-140);min-width:0}._pageWithPlayer_fb9s9_8{padding-bottom:var(--layout-player-mobile)}._playerBar_fb9s9_385{display:grid;grid-template-columns:auto minmax(0,1fr) auto;grid-template-areas:"toggle info actions" "controls controls controls" "volume volume volume";align-items:center;column-gap:var(--space-2);row-gap:var(--space-2px);padding:var(--space-2) var(--space-3);padding-bottom:calc(var(--space-2) + env(safe-area-inset-bottom,0px))}._playerToggle_fb9s9_1019{grid-area:toggle}._playerInfo_fb9s9_743{grid-area:info;width:auto}._playerActions_fb9s9_737{grid-area:actions;margin-right:calc(var(--space-1-5) * -1)}._playerControls_fb9s9_763{grid-area:controls;gap:var(--space-2);min-width:0;justify-content:center}._playerRight_fb9s9_969{grid-area:volume;width:100%}._volumeBar_fb9s9_871{flex:1;width:auto;height:var(--space-6)}._slide_fb9s9_436{padding:0 var(--size-52)}._npArrow_fb9s9_410{width:var(--size-42);height:var(--size-42);opacity:.85}._npArrowLeft_fb9s9_564{left:var(--space-2)}._npArrowRight_fb9s9_568{right:var(--space-2)}._npImageCount_fb9s9_411{top:calc(var(--space-3) + env(safe-area-inset-top,0px));right:var(--space-3)}._chapterPanel_fb9s9_585{right:var(--space-3);max-height:55vh}}@media(max-width:768px)and (orientation:portrait){._npStage_fb9s9_420{height:100%}._sliderViewport_fb9s9_436{inset:0}._slide_fb9s9_436{padding:0}._npOverlay_fb9s9_370:not(._npOverlayControlsHidden_fb9s9_410) ._slide_fb9s9_436{padding-bottom:var(--space-2-5)}._npOverlay_fb9s9_370:not(._npOverlayControlsHidden_fb9s9_410) ._slideImg_fb9s9_438{max-height:calc(100% - var(--space-2-5))}._slideImg_fb9s9_438{width:auto;height:auto;max-width:100%;max-height:100%;object-fit:contain;object-position:center}._playerBar_fb9s9_385{grid-template-areas:"toggle info actions" "controls controls controls" "volume volume volume";row-gap:var(--space-2-5);padding:var(--space-2-5) var(--space-3);padding-bottom:calc(var(--space-2-5) + env(safe-area-inset-bottom,0px))}._playerControls_fb9s9_763{flex-direction:column;align-items:center;gap:var(--space-2);width:100%}._playerButtons_fb9s9_778{justify-content:center;width:100%;gap:var(--space-1-5)}._seekRow_fb9s9_770{width:100%;justify-content:center}._seekRow_fb9s9_770 ._seekBar_fb9s9_870{flex:1}._playerRight_fb9s9_969{justify-content:center;width:100%}._playerRight_fb9s9_969 ._volumeBar_fb9s9_871{flex:1;width:100%;max-width:var(--size-320)}}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{e,s as Ee,b as Ie,T as _e,A as ae,d as g,h as w,q as H,S as F,$ as ve,p as Re,f as Oe,u as je,g as Ue}from"./vendor-rLNfZm7Y.js";import{am as ke,al as Ce,j as pe,az as Je,aA as We,a5 as De,aB as He,aC as qe,c as Ve,b as Ye,ad as Ge,aD as Ke,aE as ze,aF as Qe,F as Ze,a as Xe,aG as B,an as Te,C as de,aH as ea,aI as aa,J as ta,T as Ne,B as we}from"./index-CpjgU8ou.js";import{a}from"./Asmr.module-DPG2JhDJ.js";import{l as na}from"./hls-6Owgw2Aj.js";const sa=({work:n,onSelect:r})=>e("button",{className:a.card,onClick:()=>r(n),title:n.name,children:[e("div",{className:a.thumbWrap,children:[n.thumbnail?e("img",{className:a.thumb,src:n.thumbnail,alt:n.name,loading:"lazy",draggable:!1}):e("div",{className:`${a.thumb} ${a.thumbPlaceholder}`,children:e("span",{children:"No Image"})}),n.isAdult&&e("span",{className:a.adultBadge,children:"18+"})]}),e("p",{className:a.cardTitle,children:n.name}),e("p",{className:a.cardMeta,children:n.id})]}),Me=300*1e3,ue=15,ra=(n,r,m,u)=>{const h=r+1,o=Ee({queries:Array.from({length:h},(b,M)=>{const k=M+1;return{queryKey:["asmrBrowse",n,k,m,u],queryFn:()=>{const i=new URLSearchParams;return n.trim()&&i.set("q",n.trim()),i.set("page",k.toString()),m&&m!=="latest"&&i.set("sort",m),u&&i.set("rating",u),ke(`/api/asmr/browse?${i.toString()}`)},staleTime:Me}})}),v=o.flatMap(b=>b.data?.shows??[]),N=v.slice((r-1)*ue,r*ue),c=o[o.length-1]?.data,p=!!(c&&(c.hasNext||v.length>r*ue)),$=o.some(b=>b.isLoading),E=o.some(b=>b.isFetching),S=o.some(b=>b.isError);return{data:{shows:N,hasNext:p},isLoading:$,isError:S,isFetching:E}},$e=n=>Ie({queryKey:["asmrWork",n],queryFn:()=>ke(`/api/asmr/work/${n}`),enabled:!!n,staleTime:Me,refetchOnMount:"always"}),la=({work:n,onClose:r,onPlay:m,t:u})=>{const{data:h,isLoading:o}=$e(n.id||null),v=_e(()=>(h?.description||n.description||"").split(`
|
|
2
|
+
`).map(c=>{const p=c.indexOf(":");return p===-1?null:{label:c.slice(0,p),value:c.slice(p+1).trim()}}).filter(c=>!!c&&!!c.value),[h?.description,n.description]),N=h?.tracks||[];return e("div",{className:a.detailOverlay,onClick:r,children:e("div",{className:a.detailModal,onClick:c=>c.stopPropagation(),children:[e("button",{className:a.detailClose,onClick:r,"aria-label":"Close",children:e(Ce,{})}),e("div",{className:a.detailHeader,children:[n.thumbnail?e("img",{className:a.detailCover,src:n.thumbnail,alt:n.name}):e("div",{className:`${a.detailCover} ${a.thumbPlaceholder}`}),e("div",{className:a.detailInfo,children:[e("h2",{className:a.detailTitle,children:u?u(n.name):n.name}),e("p",{className:a.detailRj,children:n.id}),v.map(c=>c.label==="Tags"?e("p",{className:a.metaRow,children:[e("span",{className:a.metaLabel,children:"Tags"}),e("span",{className:a.tagChips,children:c.value.split(", ").map(p=>e("span",{className:a.tagChip,children:p},p))})]},c.label):e("p",{className:a.metaRow,children:[e("span",{className:a.metaLabel,children:c.label}),c.value]},c.label))]})]}),e("div",{className:a.tracksSection,children:[e("h3",{className:a.tracksHeading,children:o?"Loading tracks…":`Tracks (${N.length})`}),!o&&(N.length>0?e("ul",{className:a.trackList,children:N.map((c,p)=>e("li",{children:e("button",{className:a.trackRow,onClick:()=>m(n,N,p),children:[e(pe,{className:a.trackIcon}),e("span",{className:a.trackLabel,children:c.resolutionStr}),e("span",{className:a.trackType,children:c.hls?"HLS":"MP3"})]})},c.link))}):e("p",{className:a.noTracks,children:"No audio streams available for this work."}))]}),!o&&N.length>0&&e("button",{className:a.playAllBtn,onClick:()=>m(n,N,0),children:[e(pe,{})," Play from start"]})]})})};function he(n){if(!Number.isFinite(n))return"0:00";const r=Math.floor(n/3600),m=Math.floor(n%3600/60),u=Math.floor(n%60);return r>0?`${r}:${String(m).padStart(2,"0")}:${String(u).padStart(2,"0")}`:`${m}:${String(u).padStart(2,"0")}`}const oa=({title:n,images:r,chapters:m,tracks:u,trackIndex:h,expanded:o,isAdult:v,rjCode:N,t:c,onTrackChange:p,onExpandedChange:$,onClose:E})=>{const S=ae(null),b=ae(null),[M,k]=g(!1),[i,C]=g(0),[d,P]=g(0),[q,R]=g(0),[T,le]=g(!0),[te,O]=g(0),[Q,ne]=g(new Set),[I,V]=g(!1),[Y,j]=g(!0),W=ae("");W.current||(W.current=typeof crypto<"u"&&"randomUUID"in crypto?crypto.randomUUID():`asmr-${Date.now()}-${Math.random().toString(36).slice(2)}`);const[_,U]=g(()=>{const t=parseFloat(localStorage.getItem("asmrVolume")||"");return Number.isFinite(t)?t:1}),Z=ae(_);w(()=>{Z.current=_},[_]);const X=u[h],D=X?.link,G=X?.hls,K=r.length>0,J=H(()=>{b.current&&(b.current.destroy(),b.current=null)},[]);w(()=>{const t=S.current;if(!(!t||!D)){if(C(0),P(0),R(0),k(!1),J(),G){let l=!1;return(async()=>{const y=await na();if(!l)if(y&&y.isSupported()){const A=new y({enableWorker:!0});b.current=A,A.loadSource(D),A.attachMedia(t),t.play().catch(()=>k(!1))}else t.src=D,t.load(),t.volume=Z.current,t.play().catch(()=>k(!1))})(),()=>{l=!0,J(),t.removeAttribute("src")}}else t.src=D;return t.load(),t.volume=Z.current,t.play().catch(()=>k(!1)),()=>{J(),t.removeAttribute("src")}}},[D,G,J]),w(()=>()=>J(),[J]),w(()=>{const t=S.current;t&&(t.volume=_)},[_]),w(()=>{if(o)return document.body.classList.add("asmr-player-open"),()=>document.body.classList.remove("asmr-player-open")},[o]),w(()=>{O(0)},[r]),w(()=>{o&&j(!0)},[o]),w(()=>{I&&j(!0)},[I]);const x=H(t=>{if(!n||u.length===0)return;const l=u[h],y=l?`${l.resolutionStr} (${h+1}/${u.length})`:"",A=S.current,re=A?A.currentTime:0,xe=A&&A.duration||0,Le=r[0]||"";fetch("/api/discord/asmr",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({title:n,trackLabel:y,isPlaying:t,thumbnail:Le,thumbnails:r,currentTime:re,duration:xe,isAdult:!!v,rjCode:N||"",sessionId:W.current})}).catch(()=>{}),fetch("/api/discord/heartbeat",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({sessionId:W.current})}).catch(()=>{})},[n,u,h,r,v,N]);w(()=>{x(M)},[x,M,h,n,o]),w(()=>{if(!M)return;const t=window.setInterval(()=>x(!0),15e3);return()=>window.clearInterval(t)},[M,x]),w(()=>{const t=W.current,l=()=>{if(!t)return;const re=JSON.stringify({sessionId:t});navigator.sendBeacon?(navigator.sendBeacon("/api/discord/clear",new Blob([re],{type:"application/json"})),navigator.sendBeacon("/api/discord/heartbeat",new Blob([JSON.stringify({sessionId:t,bye:!0})],{type:"application/json"}))):(fetch("/api/discord/clear",{method:"POST",headers:{"Content-Type":"application/json"},body:re,keepalive:!0}).catch(()=>{}),fetch("/api/discord/heartbeat",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({sessionId:t,bye:!0}),keepalive:!0}).catch(()=>{}))},y=()=>l(),A=()=>{document.visibilityState==="hidden"&&l()};return window.addEventListener("pagehide",y),window.addEventListener("beforeunload",y),document.addEventListener("visibilitychange",A),()=>{window.removeEventListener("pagehide",y),window.removeEventListener("beforeunload",y),document.removeEventListener("visibilitychange",A),l()}},[]);const z=H(t=>{ne(l=>{if(l.has(t))return l;const y=new Set(l);return y.add(t),y})},[]),oe=H((t,l)=>{t&&t.complete&&t.naturalWidth>0&&z(l)},[z]);w(()=>{if(!o)return;const t=l=>{if(l.key==="Escape"){I?V(!1):$(!1);return}!T||r.length<2||(l.key==="ArrowLeft"&&O(y=>Math.max(0,y-1)),l.key==="ArrowRight"&&O(y=>Math.min(r.length-1,y+1)))};return window.addEventListener("keydown",t),()=>window.removeEventListener("keydown",t)},[o,T,r.length,I,$]);const ie=()=>{const t=S.current;t&&(t.paused?t.play().catch(()=>{}):t.pause())},se=t=>{const l=S.current;if(!l||!d)return;const y=parseFloat(t.target.value);l.currentTime=y,C(y)},ce=()=>{h<u.length-1&&p(h+1)},s=m.reduce((t,l,y)=>i>=l.time?y:t,-1),f=t=>{const l=S.current;l&&(l.currentTime=t,C(t))},L=t=>{const l=S.current;if(!l)return;const y=Number.isFinite(l.currentTime)?l.currentTime:i,A=Math.max(0,Math.min(d||1/0,y+t));l.currentTime=A,C(A),j(!0)},ge=d?Math.min(100,i/d*100):0,Pe=d?Math.min(100,Math.max(ge,q/d*100)):0,Be=e(F,{children:[e("div",{className:a.playerButtons,children:[e("button",{className:a.playerBtn,onClick:()=>p(Math.max(0,h-1)),disabled:h===0,"aria-label":"Previous track",children:e(Je,{})}),e("button",{className:`${a.playerBtn} ${a.seekBtn}`,onClick:()=>L(-10),"aria-label":"Seek back 10 seconds",title:"Back 10s",children:[e(We,{}),e("span",{className:a.seekBtnLabel,children:"10"})]}),e("button",{className:`${a.playerBtn} ${a.playBtn}`,onClick:ie,"aria-label":M?"Pause":"Play",children:M?e(De,{}):e(pe,{})}),e("button",{className:`${a.playerBtn} ${a.seekBtn}`,onClick:()=>L(10),"aria-label":"Seek forward 10 seconds",title:"Forward 10s",children:[e(He,{}),e("span",{className:a.seekBtnLabel,children:"10"})]}),e("button",{className:a.playerBtn,onClick:()=>p(Math.min(u.length-1,h+1)),disabled:h>=u.length-1,"aria-label":"Next track",children:e(qe,{})})]}),e("div",{className:a.seekRow,children:[e("span",{className:a.timeLabel,children:he(i)}),e("input",{className:a.seekBar,type:"range",min:0,max:d||0,step:.1,value:Math.min(i,d||0),onChange:se,style:{"--played-percent":`${ge}%`,"--buffered-percent":`${Pe}%`},"aria-label":"Seek"}),e("span",{className:a.timeLabel,children:he(d)})]})]}),fe=e(F,{children:[e("button",{className:`${a.playerBtn} ${a.playerToggle}`,onClick:()=>$(!o),"aria-label":o?"Minimize player":"Expand player",title:o?"Minimize to browse":"Expand",children:o?e(Ve,{}):e(Ye,{})}),e("div",{className:a.playerInfo,children:[e("p",{className:a.playerTitle,title:n,children:c?c(n):n}),e("p",{className:a.playerTrack,children:[X?.resolutionStr||"",u.length>1?` (${h+1}/${u.length})`:""]})]}),e("div",{className:a.playerControls,children:Be}),e("div",{className:a.playerRight,children:[e(Ge,{className:a.volumeIcon}),e("input",{className:a.volumeBar,type:"range",min:0,max:1,step:.01,value:_,onChange:t=>{const l=parseFloat(t.target.value);U(l),localStorage.setItem("asmrVolume",String(l))},style:{"--volume-percent":`${_*100}%`},"aria-label":"Volume"})]}),e("div",{className:a.playerActions,children:[o&&K&&e("button",{className:a.playerBtn,onClick:()=>le(t=>!t),"aria-label":T?"Hide images":"Show images",title:T?"Hide images":"Show images",children:T?e(Ke,{}):e(ze,{})}),o&&m.length>0&&e("button",{className:`${a.playerBtn} ${I?a.playerBtnActive:""}`,onClick:()=>V(t=>!t),"aria-label":I?"Hide bookmarks":"Show bookmarks",title:"Timestamps",children:e(Qe,{})}),e("button",{className:a.playerBtn,onClick:E,"aria-label":"Close player",children:e(Ce,{})})]})]}),be=e("audio",{ref:S,preload:"metadata",onPlay:()=>k(!0),onPause:()=>k(!1),onTimeUpdate:t=>C(t.currentTarget.currentTime),onLoadedMetadata:t=>P(t.currentTarget.duration),onProgress:t=>{const l=t.currentTarget;l.buffered.length>0&&R(l.buffered.end(l.buffered.length-1))},onEnded:ce});if(!o)return ve(e(F,{children:[be,e("div",{className:a.playerBar,children:fe})]}),document.body);const ee=Math.min(te,Math.max(0,r.length-1)),ye=r[ee],Fe=T&&K&&!!ye&&!Q.has(ye);return ve(e(F,{children:[be,e("div",{className:`${a.npOverlay} ${Y?"":a.npOverlayControlsHidden}`,children:[e("div",{className:`${a.npStage} ${!T||!K?a.npStageBlank:""}`,onClick:()=>j(t=>!t),children:T&&K&&e(F,{children:[e("div",{className:a.sliderViewport,children:[e("div",{className:a.sliderTrack,style:{transform:`translateX(-${ee*100}%)`},children:r.map(t=>e("div",{className:a.slide,children:e("img",{ref:l=>oe(l,t),src:t,alt:`${c?c(n):n} — work image`,draggable:!1,onLoad:()=>z(t),onError:()=>z(t),className:`${a.slideImg} ${Q.has(t)?a.slideImgLoaded:""}`})},t))}),Fe&&e("span",{className:a.slideSpinner,"aria-label":"Loading image"})]}),r.length>1&&e(F,{children:[e("button",{className:`${a.npArrow} ${a.npArrowLeft}`,onClick:t=>{t.stopPropagation(),O(l=>Math.max(0,l-1)),j(!0)},disabled:ee===0,"aria-label":"Previous image",children:e(Ze,{})}),e("button",{className:`${a.npArrow} ${a.npArrowRight}`,onClick:t=>{t.stopPropagation(),O(l=>Math.min(r.length-1,l+1)),j(!0)},disabled:ee===r.length-1,"aria-label":"Next image",children:e(Xe,{})}),e("span",{className:a.npImageCount,onClick:t=>t.stopPropagation(),children:[ee+1," / ",r.length]})]})]})}),e("div",{className:`${a.playerBar} ${a.playerBarDocked} ${Y?"":a.playerBarDockedHidden}`,onClick:t=>t.stopPropagation(),children:[fe,I&&e(F,{children:[e("div",{className:a.npBackdrop,onClick:()=>V(!1)}),e("div",{className:a.chapterPanel,children:m.map((t,l)=>e("button",{className:`${a.chapterRow} ${l===s?a.chapterRowActive:""}`,title:c?c(t.label):t.label,onClick:()=>{f(t.time),V(!1)},children:[e("span",{className:a.chapterRowTime,children:he(t.time)}),e("span",{className:a.chapterRowLabel,title:c?c(t.label):t.label,children:c?c(t.label):t.label})]},`${t.time}-${l}`))})]})]})]})]}),document.body)},ia=({isOpen:n,onClose:r,onSuccess:m})=>{const[u,h]=g(1),[o,v]=g(typeof navigator<"u"?navigator.userAgent:""),[N,c]=g(""),[p,$]=g(!1);w(()=>{n&&(h(1),v(typeof navigator<"u"?navigator.userAgent:""),c(""))},[n]);const E=async()=>{localStorage.setItem("jasmr_ua",o),window.open("https://japaneseasmr.com","_blank","noopener,noreferrer"),h(2)},S=async()=>{if(!N.trim()){de.error("Please enter the cf_clearance cookie");return}$(!0);try{localStorage.setItem("jasmr_cookie",N.trim()),de.success("Cookie updated successfully!"),m?.(),r()}catch{de.error("Failed to save cookie")}finally{$(!1)}};return e(Te,{isOpen:n,onClose:r,title:"JapaneseASMR Verification Required",children:e("div",{className:B.container,children:u===1?e(F,{children:[e("p",{children:["JapaneseASMR is protected by a Cloudflare challenge. Solve it once in your browser and paste the ",e("strong",{children:"cf_clearance"})," cookie so the app can load the site for you."]}),e("div",{className:B.field,children:[e("label",{children:"Your User-Agent (must match the browser you solve the challenge with):"}),e("textarea",{value:o,onChange:b=>v(b.target.value),rows:3,className:B.textarea})]}),e("div",{className:B.actions,children:[e("button",{className:B.secondaryButton,onClick:r,children:"Cancel"}),e("button",{className:B.button,onClick:E,children:"Start Verification (Opens JapaneseASMR)"})]})]}):e(F,{children:[e("p",{children:["1. Solve the challenge on the ",e("strong",{children:"JapaneseASMR tab"})," (keep that tab open).",e("br",{}),"2. Copy the ",e("strong",{children:"cf_clearance"})," cookie value using one of these:",e("br",{}),e("br",{}),e("strong",{children:"Chrome / Edge — DevTools:"})," press ",e("code",{children:"F12"})," →"," ",e("strong",{children:"Application"})," → ",e("strong",{children:"Cookies"})," →"," ",e("code",{children:"https://japaneseasmr.com"}),". Find ",e("strong",{children:"cf_clearance"}),", double-click its ",e("strong",{children:"Value"})," to select it, then copy.",e("br",{}),e("br",{}),e("strong",{children:"Firefox — Storage Inspector:"})," press ",e("code",{children:"F12"})," →"," ",e("strong",{children:"Storage"})," → ",e("strong",{children:"Cookies"})," →"," ",e("code",{children:"https://japaneseasmr.com"}),". Find ",e("strong",{children:"cf_clearance"}),", right-click the value → ",e("strong",{children:"Copy Value"}),".",e("br",{}),e("br",{}),e("strong",{children:"Either browser — extension:"})," install a cookie manager like"," ",e("em",{children:"Cookie-Editor"})," or ",e("em",{children:"Cookie Manager"}),", open it while on the JapaneseASMR tab, find ",e("strong",{children:"cf_clearance"}),", and copy its value (or use the extension's export).",e("br",{}),e("br",{}),"3. Paste it below. Copy ",e("strong",{children:"only the value"})," — remove any"," ",e("code",{children:"cf_clearance="})," prefix or quotes if they were included."]}),e("div",{className:B.field,children:[e("label",{children:"cf_clearance cookie value:"}),e("input",{type:"text",value:N,onChange:b=>c(b.target.value),placeholder:"e.g. xxxxxxxx.xxxxxxxx.xxxxxxx-xxxxxxx",className:B.input})]}),e("div",{className:B.actions,children:[e("button",{className:B.secondaryButton,onClick:r,children:"Cancel"}),e("button",{className:B.secondaryButton,onClick:()=>h(1),children:"Back"}),e("button",{className:B.button,onClick:S,disabled:p,children:p?"Saving...":"Submit"})]})]})})})},Ae="asmrTranslateCache",ca=10080*60*1e3;function da(){try{const n=localStorage.getItem(Ae);if(!n)return new Map;const r=JSON.parse(n);return new Map(Object.entries(r))}catch{return new Map}}function ua(n){try{const r={};for(const[m,u]of n)r[m]=u;localStorage.setItem(Ae,JSON.stringify(r))}catch{}}function Se(n){return/[\u3040-\u309F\u30A0-\u30FF\u4E00-\u9FAF]/.test(n)}async function ha(n){const r=n.map(o=>o.trim()).filter(Boolean);if(r.length===0)return new Map;const m=await fetch("/api/translate",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({texts:r,source:"ja",target:"en"})});if(!m.ok)throw new Error(`translate ${m.status}`);const u=await m.json(),h=new Map;for(const[o,v]of Object.entries(u.translations||{}))h.set(o,v);for(const o of r)h.has(o)||h.set(o,o);return h}function ma(n,r){const[m,u]=g(new Map),[h,o]=g(!1),v=ae(null),N=n.join("");return w(()=>{const p=N?N.split(""):[];if(!r||p.length===0){u(new Map),o(!1);return}const $=Array.from(new Set(p.map(i=>i.trim()).filter(Boolean).filter(Se)));if($.length===0){u(new Map);return}v.current||(v.current=da());const E=Date.now(),S=new Map,b=[];for(const i of $){const C=v.current.get(i);C&&E-C.ts<ca?S.set(i,C.t):b.push(i)}if(b.length===0){u(S);return}let M=!1;o(!0);const k=[];for(let i=0;i<b.length;i+=15)k.push(b.slice(i,i+15));return(async()=>{const i=new Map;for(const d of k){try{const P=await ha(d);for(const[q,R]of P)i.set(q,R)}catch{}await new Promise(P=>setTimeout(P,120))}if(M)return;if(v.current){for(const[d,P]of i)v.current.set(d,{t:P,ts:Date.now()});ua(v.current)}const C=new Map([...S,...i]);u(C),o(!1)})(),()=>{M=!0}},[r,N]),{t:p=>!r||!p||!Se(p)?p:m.get(p.trim())||p,map:m,isTranslating:h}}const pa=[{label:"Date",options:[{value:"latest",label:"Latest"},{value:"oldest",label:"Oldest"}]},{label:"Title",options:[{value:"title_asc",label:"A → Z"},{value:"title_desc",label:"Z → A"}]},{label:"Popular (Views)",options:[{value:"popular_recent",label:"Recent"},{value:"popular_week",label:"Week"},{value:"popular_month",label:"Month"},{value:"popular_6_months",label:"6 Months"},{value:"popular_year",label:"Year"},{value:"popular",label:"All Time"}]},{label:"Most Commented",options:[{value:"comments_week",label:"Week"},{value:"comments_month",label:"Month"},{value:"comments_year",label:"Year"},{value:"comments",label:"All Time"}]},{label:"Other",options:[{value:"random",label:"Random"}]}],ga=[{value:"",label:"All"},{value:"sfw",label:"SFW / 全年齢"},{value:"r-15",label:"R-15"},{value:"r-18",label:"NSFW / R18"},{value:"yuri",label:"Yuri / Girls love / 百合"},{value:"otokonoko",label:"Otoko no ko / 男の娘"},{value:"futanari",label:"Futanari / フタナリ"},{value:"r-18g",label:"R-18G / グロ"}],fa=[{value:"sfw",label:"SFW / 全年齢"}],me="agreedToViewMature",wa=()=>{const{rj:n}=Re(),r=Oe(),[m,u]=g(()=>localStorage.getItem(me)==="true"),[h,o]=g(!1),[v,N]=g(""),[c,p]=g(""),[$,E]=g("latest"),[S,b]=g("sfw"),[M,k]=g(1),[i,C]=g(null),[d,P]=g(null),[q,R]=g(!0),[T,le]=g(()=>localStorage.getItem("asmrTranslateEN")==="true"),[te,O]=g(!1),Q=je();w(()=>ea("jasmr",()=>O(!0)),[]),w(()=>{localStorage.setItem("asmrTranslateEN",String(T))},[T]),w(()=>{const s=()=>u(localStorage.getItem(me)==="true");return window.addEventListener("focus",s),window.addEventListener("storage",s),()=>{window.removeEventListener("focus",s),window.removeEventListener("storage",s)}},[]);const ne=m,I=ne?S:"sfw",V=ne?ga:fa,{data:Y,isLoading:j,isError:W,isFetching:_}=ra(c,M,$,I),U=Ue.useMemo(()=>Y?.shows??[],[Y?.shows]),Z=Y?.hasNext??!1;w(()=>{if(!n){i&&!d&&C(null);return}const s=n.toUpperCase();if(d&&(d.work.id?.toUpperCase()===s||d.work._id?.toUpperCase()===s)){i&&C(null);return}const f=U.find(L=>(L.id||L._id)?.toUpperCase()===s);f?(!i||(i.id||i._id)!==(f.id||f._id))&&C(f):(!i||(i.id||i._id)?.toUpperCase()!==s)&&C({_id:s,id:s,name:s})},[n,U,d,i]);const X=H(s=>{const f=s.id||s._id;f?r(`/asmr/${f}`):C(s)},[r]),D=H(()=>{r("/asmr")},[r]);w(()=>{!n&&d&&P(null)},[n,d]);const{data:G}=$e(d&&d.work.id||null),K=d?[d.work.thumbnail,...G?.images||[]].filter(Boolean):[],J=[...U.map(s=>s.name),i?.name||"",d?.work.name||"",...G?.chapters?.map(s=>s.label)||[]].filter(Boolean),{t:x}=ma(J,T);w(()=>{const s=d?d.work.name:i?i.name:n?n.toUpperCase():"",f=s?T?x(s):s:"",L=f?`${f} - dango`:"dango";document.title=L;try{window.history.replaceState(window.history.state,L,window.location.href)}catch{}},[i,d,n,T,x]);const z=s=>{s.preventDefault(),p(v),k(1)},oe=s=>{s.target.checked&&!m&&o(!0)},ie=()=>{localStorage.setItem(me,"true"),u(!0),o(!1),k(1)},se=()=>{o(!1)},ce=H((s,f,L)=>{C(null),R(!0),P({work:s,tracks:f,index:L})},[]);return e("div",{className:`${a.page} ${d?a.pageWithPlayer:""}`,children:[!(d&&q)&&e(F,{children:[e("header",{className:a.header,children:[e("h1",{className:a.pageTitle,children:[e(aa,{})," ASMR"]}),e("form",{className:a.searchForm,onSubmit:z,children:[e("input",{className:a.searchInput,type:"text",value:v,onChange:s=>N(s.target.value),placeholder:"Search works, circles, CV… (-word excludes)","aria-label":"Search ASMR works"}),e("button",{className:a.searchBtn,type:"submit","aria-label":"Search",children:e(ta,{})})]})]}),e("div",{className:a.filterBar,children:[e("label",{className:a.filterLabel,htmlFor:"asmr-sort",children:"Sort"}),e("select",{id:"asmr-sort",className:a.sortSelect,value:$,onChange:s=>{E(s.target.value),k(1)},children:pa.map(s=>e("optgroup",{label:s.label,children:s.options.map(f=>e("option",{value:f.value,children:f.label},f.value))},s.label))}),e("label",{className:a.filterLabel,htmlFor:"asmr-rating",children:"Type"}),e("select",{id:"asmr-rating",className:a.sortSelect,value:S,onChange:s=>{b(s.target.value),k(1)},children:V.map(s=>e("option",{value:s.value,children:s.label},s.value))}),e("div",{className:a.filterTogglesGroup,children:[e("div",{className:a.translateToggleWrap,children:[e("span",{className:a.filterLabel,children:"JP"}),e(Ne,{id:"asmr-translate-toggle",isChecked:T,onChange:s=>le(s.target.checked)}),e("span",{className:a.filterLabel,children:"EN"})]}),!m&&e("div",{className:a.matureToggleWrap,children:[e("label",{className:a.matureLabel,htmlFor:"asmr-mature-toggle",children:"Mature"}),e(Ne,{id:"asmr-mature-toggle",isChecked:!1,onChange:oe})]})]})]}),W?e("p",{className:a.statusMsg,children:"Failed to load works. Please try again."}):j&&U.length===0?e("div",{className:a.grid,"aria-hidden":!0,children:Array.from({length:12}).map((s,f)=>e("div",{className:a.skeletonCard,children:[e("div",{className:`${a.skeletonThumb} ${a.shimmer}`}),e("div",{className:`${a.skeletonLine} ${a.shimmer}`,style:{width:"88%"}}),e("div",{className:`${a.skeletonLine} ${a.shimmer}`,style:{width:"55%"}})]},f))}):U.length===0?e("p",{className:a.statusMsg,children:"No works found."}):e(F,{children:[e("div",{className:`${a.grid} ${_?a.fetching:""}`,children:U.map(s=>{const f=T?{...s,name:x(s.name)}:s;return e(sa,{work:f,onSelect:X},s._id||s.id)})}),e("nav",{className:a.pagination,children:[e("button",{className:a.pageBtn,disabled:M<=1,onClick:()=>k(s=>Math.max(1,s-1)),children:"Previous"}),e("span",{className:a.pageIndicator,children:["Page ",M]}),e("button",{className:a.pageBtn,disabled:!Z,onClick:()=>k(s=>s+1),children:"Next"})]})]})]}),i&&e(la,{work:i,onClose:D,onPlay:ce,t:x}),te&&e(ia,{isOpen:te,onClose:()=>O(!1),onSuccess:()=>{Q.invalidateQueries({queryKey:["asmrBrowse"]}),Q.invalidateQueries({queryKey:["asmrWork"]})}}),h&&e(Te,{isOpen:h,title:"Content Warning",onClose:se,children:e("div",{style:{padding:"var(--space-4)",textAlign:"center"},children:[e("p",{children:"This section contains mature content intended for adult audiences."}),e("p",{children:["By proceeding, you confirm that you are ",e("strong",{children:"18 years of age or older"})," (or the age of majority in your jurisdiction) and wish to view this content."]}),e("p",{style:{fontSize:"var(--font-size-xs)",color:"var(--text-secondary)",marginTop:"var(--space-4)"},children:["You can reset this preference at any time in the ",e("strong",{children:"Settings"})," page."]}),e("div",{style:{marginTop:"var(--space-4)",display:"flex",gap:"var(--space-2-5)",justifyContent:"center"},children:[e(we,{variant:"secondary",onClick:se,children:"Go Back"}),e(we,{onClick:ie,children:"I'm 18+, Continue"})]})]})}),d&&e(oa,{title:d.work.name,images:K,chapters:G?.chapters||[],tracks:d.tracks,trackIndex:d.index,expanded:q,isAdult:!!d.work.isAdult,rjCode:d.work.id||d.work._id,t:x,onTrackChange:s=>P(f=>f&&{...f,index:s}),onExpandedChange:R,onClose:()=>{P(null),R(!0),n&&r("/asmr")}})]})};export{wa as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e="_page_fb9s9_1",t="_pageWithPlayer_fb9s9_8",a="_header_fb9s9_12",s="_pageTitle_fb9s9_20",_="_searchForm_fb9s9_29",o="_searchInput_fb9s9_44",r="_searchBtn_fb9s9_55",n="_sortSelect_fb9s9_68",l="_grid_fb9s9_78",c="_fetching_fb9s9_85",p="_card_fb9s9_90",i="_thumbWrap_fb9s9_101",b="_thumb_fb9s9_101",f="_thumbPlaceholder_fb9s9_124",d="_adultBadge_fb9s9_132",g="_cardTitle_fb9s9_144",h="_cardMeta_fb9s9_154",k="_statusMsg_fb9s9_160",y="_skeletonCard_fb9s9_168",m="_skeletonThumb_fb9s9_173",B="_skeletonLine_fb9s9_179",u="_shimmer_fb9s9_186",T="_pagination_fb9s9_200",w="_pageBtn_fb9s9_208",L="_pageIndicator_fb9s9_222",R="_matureToggleWrap_fb9s9_227",I="_matureLabel_fb9s9_234",v="_translateToggleWrap_fb9s9_240",C="_filterTogglesGroup_fb9s9_247",A="_filterBar_fb9s9_259",S="_filterLabel_fb9s9_266",H="_detailOverlay_fb9s9_271",W="_detailModal_fb9s9_283",M="_detailClose_fb9s9_295",O="_detailHeader_fb9s9_311",P="_detailCover_fb9s9_316",D="_detailInfo_fb9s9_325",j="_detailTitle_fb9s9_329",F="_detailRj_fb9s9_336",G="_metaRow_fb9s9_342",V="_metaLabel_fb9s9_348",x="_tagChips_fb9s9_354",q="_tagChip_fb9s9_354",z="_npOverlay_fb9s9_370",E="_playerBarDocked_fb9s9_385",J="_playerBarDockedHidden_fb9s9_399",K="_npOverlayControlsHidden_fb9s9_410",N="_npArrow_fb9s9_410",Q="_npImageCount_fb9s9_411",U="_npStage_fb9s9_420",X="_sliderViewport_fb9s9_436",Y="_slide_fb9s9_436",Z="_slideImg_fb9s9_438",$="_npStageBlank_fb9s9_457",ee="_sliderTrack_fb9s9_476",te="_slideImgLoaded_fb9s9_509",ae="_slideSpinner_fb9s9_514",se="_npArrowLeft_fb9s9_564",_e="_npArrowRight_fb9s9_568",oe="_chapterPanel_fb9s9_585",re="_chapterRow_fb9s9_600",ne="_chapterRowActive_fb9s9_619",le="_chapterRowTime_fb9s9_623",ce="_chapterRowLabel_fb9s9_634",pe="_npBackdrop_fb9s9_640",ie="_playerBtnActive_fb9s9_646",be="_tracksSection_fb9s9_650",fe="_tracksHeading_fb9s9_654",de="_trackList_fb9s9_660",ge="_trackRow_fb9s9_669",he="_trackIcon_fb9s9_687",ke="_trackLabel_fb9s9_692",ye="_trackType_fb9s9_697",me="_noTracks_fb9s9_702",Be="_playAllBtn_fb9s9_707",ue="_playerBar_fb9s9_385",Te="_playerActions_fb9s9_737",we="_playerInfo_fb9s9_743",Le="_playerTitle_fb9s9_748",Re="_playerTrack_fb9s9_757",Ie="_playerControls_fb9s9_763",ve="_seekRow_fb9s9_770",Ce="_playerButtons_fb9s9_778",Ae="_playerBtn_fb9s9_646",Se="_seekBtn_fb9s9_813",He="_seekBtnLabel_fb9s9_818",We="_playBtn_fb9s9_823",Me="_seekBar_fb9s9_870",Oe="_volumeBar_fb9s9_871",Pe="_timeLabel_fb9s9_963",De="_playerRight_fb9s9_969",je="_volumeIcon_fb9s9_975",Fe="_playerToggle_fb9s9_1019",Ge={page:e,pageWithPlayer:t,header:a,pageTitle:s,searchForm:_,searchInput:o,searchBtn:r,sortSelect:n,grid:l,fetching:c,card:p,thumbWrap:i,thumb:b,thumbPlaceholder:f,adultBadge:d,cardTitle:g,cardMeta:h,statusMsg:k,skeletonCard:y,skeletonThumb:m,skeletonLine:B,shimmer:u,pagination:T,pageBtn:w,pageIndicator:L,matureToggleWrap:R,matureLabel:I,translateToggleWrap:v,filterTogglesGroup:C,filterBar:A,filterLabel:S,detailOverlay:H,detailModal:W,detailClose:M,detailHeader:O,detailCover:P,detailInfo:D,detailTitle:j,detailRj:F,metaRow:G,metaLabel:V,tagChips:x,tagChip:q,npOverlay:z,playerBarDocked:E,playerBarDockedHidden:J,npOverlayControlsHidden:K,npArrow:N,npImageCount:Q,npStage:U,sliderViewport:X,slide:Y,slideImg:Z,npStageBlank:$,sliderTrack:ee,slideImgLoaded:te,slideSpinner:ae,npArrowLeft:se,npArrowRight:_e,chapterPanel:oe,chapterRow:re,chapterRowActive:ne,chapterRowTime:le,chapterRowLabel:ce,npBackdrop:pe,playerBtnActive:ie,tracksSection:be,tracksHeading:fe,trackList:de,trackRow:ge,trackIcon:he,trackLabel:ke,trackType:ye,noTracks:me,playAllBtn:Be,playerBar:ue,playerActions:Te,playerInfo:we,playerTitle:Le,playerTrack:Re,playerControls:Ie,seekRow:ve,playerButtons:Ce,playerBtn:Ae,seekBtn:Se,seekBtnLabel:He,playBtn:We,seekBar:Me,volumeBar:Oe,timeLabel:Pe,playerRight:De,volumeIcon:je,playerToggle:Fe};export{Ge as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
._centerControls_61n7k_1{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%) scale(1);display:flex;align-items:center;gap:3rem;gap:clamp(1rem,5cqw,3rem);z-index:10;pointer-events:auto;transition:transform .4s cubic-bezier(.2,.8,.2,1)}._centerSkipBtn_61n7k_15{background:transparent;border:none;border-radius:50%;color:#ffffffe6;width:56px;height:56px;width:clamp(2.5rem,6.5cqw,3.5rem);height:clamp(2.5rem,6.5cqw,3.5rem);font-size:1.8rem;font-size:clamp(1.1rem,2.8cqw,1.8rem);display:flex;align-items:center;justify-content:center;cursor:pointer;transition:all .35s cubic-bezier(.34,1.56,.64,1);filter:drop-shadow(0 2px 8px rgba(0,0,0,.85))}._centerSkipBtn_61n7k_15:hover{color:#fff;transform:scale(1.15);filter:drop-shadow(0 2px 8px rgba(0,0,0,.85)) drop-shadow(0 0 14px var(--accent-glow))}._centerPlayPause_61n7k_40{display:flex;align-items:center;justify-content:center;background:transparent;border:none;border-radius:50%;color:#fff;width:76px;height:76px;width:clamp(3rem,8cqw,5rem);height:clamp(3rem,8cqw,5rem);font-size:2.2rem;font-size:clamp(1.4rem,3.4cqw,2.3rem);cursor:pointer;transition:all .35s cubic-bezier(.34,1.56,.64,1);filter:drop-shadow(0 2px 8px rgba(0,0,0,.85))}@media(pointer:coarse){._centerSkipBtn_61n7k_15{width:clamp(2.75rem,7cqw,3.75rem);height:clamp(2.75rem,7cqw,3.75rem)}}._centerPlayPause_61n7k_40:hover{transform:scale(1.08);filter:drop-shadow(0 2px 8px rgba(0,0,0,.85)) drop-shadow(0 0 16px var(--accent-glow))}._playIconOffset_61n7k_71{transform:translate(3px)}._row_1t5g2_1{display:flex;flex-direction:column;gap:.3rem;padding:.5rem .75rem .6rem;min-width:0}._rowHeader_1t5g2_9{display:flex;align-items:baseline;justify-content:space-between;gap:.75rem;min-width:0}._rowLabel_1t5g2_17{font-size:.68rem;font-weight:700;color:var(--text-tertiary);text-transform:uppercase;letter-spacing:.05em;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}._rowValue_1t5g2_28{font-size:.72rem;font-weight:600;color:var(--text-secondary);font-variant-numeric:tabular-nums;white-space:nowrap}._slider_1t5g2_36{width:100%;min-width:8rem;cursor:pointer;-webkit-appearance:none;appearance:none;background:transparent;height:1.375rem;margin:0;touch-action:pan-y}._slider_1t5g2_36::-webkit-slider-runnable-track{width:100%;height:4px;background:linear-gradient(to right,var(--accent) 0%,var(--accent) var(--slider-percent, 0%),rgba(255,255,255,.25) var(--slider-percent, 0%),rgba(255,255,255,.25) 100%);border-radius:4px;border:none}._slider_1t5g2_36::-webkit-slider-thumb{-webkit-appearance:none;appearance:none;width:12px;height:12px;background-color:#fff;border:2px solid var(--accent);border-radius:50%;cursor:pointer;margin-top:-4px;box-shadow:0 0 8px #00000080}._slider_1t5g2_36::-moz-range-track{width:100%;height:4px;background:#ffffff40;border-radius:4px;border:none}._slider_1t5g2_36::-moz-range-progress{height:4px;background:var(--accent);border-radius:4px}._slider_1t5g2_36::-moz-range-thumb{width:10px;height:10px;background-color:#fff;border:2px solid var(--accent);border-radius:50%;cursor:pointer;box-shadow:0 0 8px #00000080}._swatches_1t5g2_99{display:flex;gap:.375rem;align-items:center}._swatch_1t5g2_99{width:1.25rem;height:1.25rem;padding:0;border-radius:50%;cursor:pointer;flex:0 0 auto}._swatchPicked_1t5g2_114{box-shadow:0 0 0 2px var(--panel-bg, #141416),0 0 0 3.5px var(--accent)}._colorInput_1t5g2_120{width:1.75rem;height:1.25rem;padding:0;border:none;border-radius:.3rem;background:transparent;cursor:pointer;flex:0 0 auto}._segmented_1t5g2_131{display:flex;gap:.25rem;background:#ffffff0d;border:1px solid var(--glass-border);border-radius:var(--radius-sm);padding:.2rem}._segmented_1t5g2_131 button{flex:1 1 0;min-width:0;background:transparent;border:none;border-radius:calc(var(--radius-sm) - 2px);color:var(--text-secondary);font-size:.72rem;font-weight:700;text-transform:capitalize;padding:.3rem .25rem;cursor:pointer;display:flex;align-items:center;justify-content:center;gap:.3rem;white-space:nowrap}._segmented_1t5g2_131 button:hover{color:var(--text-primary)}._segmented_1t5g2_131 button[aria-pressed=true]{background:#8b5cf640;color:var(--accent-light)}@media(pointer:coarse){._row_1t5g2_1{gap:.4rem;padding:.6rem .85rem .7rem}._slider_1t5g2_36{height:1.875rem}._slider_1t5g2_36::-webkit-slider-thumb{width:16px;height:16px;margin-top:-6px}._slider_1t5g2_36::-moz-range-thumb{width:14px;height:14px}._swatch_1t5g2_99{width:1.5rem;height:1.5rem}._segmented_1t5g2_131 button{padding:.5rem .25rem;min-height:2.5rem}}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import{e as r,A as m,h as L,d as V}from"./vendor-rLNfZm7Y.js";import{aP as O,a5 as q,j as G,Q as K,B as T,an as Q}from"./index-CpjgU8ou.js";const X=e=>(e.language??e.lang??"").toLowerCase(),Y=e=>(e.label??"").toLowerCase(),Z=e=>`${e.language??e.lang??""}|||${e.label??""}`,J=e=>X(e).startsWith("en")||Y(e).includes("english");function _e(e,a){if(e.length===0||a?.enabled===!1)return-1;const n=a?.lastKey??null;if(n){const t=e.findIndex(l=>Z(l)===n);if(t>=0)return t}const o=e.findIndex(J);return o>=0?o:0}const C={fontSize:1.8,position:0,bgOpacity:.5,bgColor:"#000000",textColor:"#ffffff",edge:"shadow",bold:!1},N=(e,a,n)=>Math.max(a,Math.min(n,e)),A=e=>typeof e=="string"&&/^#[0-9a-fA-F]{6}$/.test(e),E=(e,a,n,o)=>{try{const t=localStorage.getItem(e);if(t===null)return a;const l=parseFloat(t);return Number.isFinite(l)?N(l,n,o):a}catch{return a}};function ke(){let e=C.edge,a=C.bgColor,n=C.textColor,o=C.bold;try{const t=localStorage.getItem("subtitleEdge");(t==="shadow"||t==="outline"||t==="none")&&(e=t);const l=localStorage.getItem("subtitleBgColor");A(l)&&(a=l);const f=localStorage.getItem("subtitleTextColor");A(f)&&(n=f);const h=localStorage.getItem("subtitleBold");h!==null&&(o=h==="true")}catch{}return{fontSize:E("subtitleFontSize",C.fontSize,.5,10),position:E("subtitlePosition",C.position,0,100),bgOpacity:E("subtitleBgOpacity",C.bgOpacity,0,1),bgColor:a,textColor:n,edge:e,bold:o}}function D(e,a){const n=`rgba(0, 0, 0, ${N(a,0,1)})`;if(!A(e))return n;const o=parseInt(e.slice(1,3),16),t=parseInt(e.slice(3,5),16),l=parseInt(e.slice(5,7),16);return`rgba(${o}, ${t}, ${l}, ${N(a,0,1)})`}function W(e){return e==="none"?"none":e==="outline"?["-1px 0 0 black","1px 0 0 black","0 -1px 0 black","0 1px 0 black","-1px -1px 0 black","1px -1px 0 black","-1px 1px 0 black","1px 1px 0 black","0 0 6px rgba(0, 0, 0, 0.9)"].join(", "):"0 0 4px black, 0 1px 2px rgba(0, 0, 0, 0.8)"}function Se(e){return`
|
|
2
|
+
video::cue {
|
|
3
|
+
font-size: ${e.fontSize}rem !important;
|
|
4
|
+
color: ${e.textColor} !important;
|
|
5
|
+
background-color: ${D(e.bgColor,e.bgOpacity)} !important;
|
|
6
|
+
font-weight: ${e.bold?"bold":"normal"} !important;
|
|
7
|
+
text-shadow: ${W(e.edge)} !important;
|
|
8
|
+
}
|
|
9
|
+
`}function Me(e){return[`font-size: ${e.fontSize}rem`,`color: ${e.textColor}`,`background-color: ${D(e.bgColor,e.bgOpacity)}`,`font-weight: ${e.bold?"700":"400"}`,`text-shadow: ${W(e.edge)}`,"padding: 0.2em 0.5em","border-radius: 0.25em","text-align: center","position: absolute","left: 50%","transform: translateX(-50%)","max-width: 92%","white-space: pre-wrap","overflow-wrap: break-word","line-height: 1.4"].join(`;
|
|
10
|
+
`)+";"}const ee=new Set(["b","i","u","strong","em"]);function Te(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/<(\/?)([a-zA-Z]+)>/g,(n,o,t)=>ee.has(t.toLowerCase())?`<${o}${t.toLowerCase()}>`:n)}function $e(e){return e.replace(/<[^>]*>/g,"")}const Ie=["#ffffff","#ffff00","#7CFC00","#00e5ff","#ff9ff3","#ffa502"],Le=["#000000","#1e272e","#2f3542","#3d0c02","#0c3d2e","#ffffff"];function te(e){return O({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"},child:[]},{tag:"path",attr:{d:"M11.99 5V1l-5 5 5 5V7c3.31 0 6 2.69 6 6s-2.69 6-6 6-6-2.69-6-6h-2c0 4.42 3.58 8 8 8s8-3.58 8-8-3.58-8-8-8"},child:[]},{tag:"path",attr:{d:"M10.89 16h-.85v-3.26l-1.01.31v-.69l1.77-.63h.09zM15.17 14.24c0 .32-.03.6-.1.82s-.17.42-.29.57-.28.26-.45.33-.37.1-.59.1-.41-.03-.59-.1-.33-.18-.46-.33-.23-.34-.3-.57-.11-.5-.11-.82v-.74c0-.32.03-.6.1-.82s.17-.42.29-.57.28-.26.45-.33.37-.1.59-.1.41.03.59.1.33.18.46.33.23.34.3.57.11.5.11.82zm-.85-.86c0-.19-.01-.35-.04-.48s-.07-.23-.12-.31-.11-.14-.19-.17-.16-.05-.25-.05-.18.02-.25.05-.14.09-.19.17-.09.18-.12.31-.04.29-.04.48v.97c0 .19.01.35.04.48s.07.24.12.32.11.14.19.17.16.05.25.05.18-.02.25-.05.14-.09.19-.17.09-.19.11-.32.04-.29.04-.48v-.97z"},child:[]}]})(e)}function re(e){return O({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"},child:[]},{tag:"path",attr:{d:"M18 13c0 3.31-2.69 6-6 6s-6-2.69-6-6 2.69-6 6-6v4l5-5-5-5v4c-4.42 0-8 3.58-8 8s3.58 8 8 8 8-3.58 8-8z"},child:[]},{tag:"path",attr:{d:"M10.86 15.94v-4.27h-.09L9 12.3v.69l1.01-.31v3.26zM12.25 13.44v.74c0 1.9 1.31 1.82 1.44 1.82.14 0 1.44.09 1.44-1.82v-.74c0-1.9-1.31-1.82-1.44-1.82-.14 0-1.44-.09-1.44 1.82m2.04-.12v.97c0 .77-.21 1.03-.59 1.03s-.6-.26-.6-1.03v-.97c0-.75.22-1.01.59-1.01.38-.01.6.26.6 1.01"},child:[]}]})(e)}const ae="_centerControls_61n7k_1",ne="_centerSkipBtn_61n7k_15",oe="_centerPlayPause_61n7k_40",ce="_playIconOffset_61n7k_71",S={centerControls:ae,centerSkipBtn:ne,centerPlayPause:oe,playIconOffset:ce},Pe=({isPlaying:e,onTogglePlay:a,onSkipBack:n,onSkipForward:o,skipSeconds:t=10})=>r("div",{className:S.centerControls,onClick:l=>l.stopPropagation(),children:[r("button",{className:S.centerSkipBtn,onClick:n,title:`Skip back ${t}s`,"aria-label":`Skip back ${t} seconds`,children:r(te,{})}),r("button",{className:S.centerPlayPause,"data-speed-boost-ignore":"true",onClick:a,"aria-label":e?"Pause":"Play",children:e?r(q,{}):r(G,{className:S.playIconOffset})}),r("button",{className:S.centerSkipBtn,onClick:o,title:`Skip forward ${t}s`,"aria-label":`Skip forward ${t} seconds`,children:r(re,{})})]}),le=e=>Math.max(8,Math.min(40,Math.ceil(e/16.7)+4));function se({videoRef:e,canvasRef:a,delayMs:n,enabled:o}){const t=m(n);t.current=n;const l=m([]),f=m(-1),h=m(-1),i=m(!1),p=m(0),g=m(null);L(()=>{const c=s=>{if(s)try{s.close()}catch{}},w=()=>{for(const s of l.current)c(s.bitmap);l.current=[]};if(!o){w(),f.current=-1,h.current=-1,i.current=!1,p.current=0;return}let M=!1;const R=()=>{g.current!==null&&(cancelAnimationFrame(g.current),g.current=null)},x=()=>{M||(R(),g.current=requestAnimationFrame(()=>{U()}))};async function U(){if(M)return;const s=e.current,b=a.current;if(!s||!b||s.videoWidth===0){x();return}if(s.paused||s.ended||document.hidden||s.readyState<HTMLMediaElement.HAVE_CURRENT_DATA){x();return}const z=s.getVideoPlaybackQuality().totalVideoFrames;if(z===f.current){x();return}(s.seeking||h.current>=0&&Math.abs(s.currentTime-h.current)>.5)&&(w(),i.current=!1,p.current=0,f.current=-1),h.current=s.currentTime,(b.width!==s.videoWidth||b.height!==s.videoHeight)&&(b.width=s.videoWidth,b.height=s.videoHeight);const k=Math.max(0,t.current||0);k>p.current&&(i.current=!1);try{const v=await createImageBitmap(s);if(M){c(v);return}f.current=z;const B=performance.now(),F=b.getContext("2d"),_=u=>{F&&F.drawImage(u,0,0,b.width,b.height)};if(k<=0){w(),i.current=!1,p.current=0,_(v),c(v),x();return}const y=l.current;y.push({bitmap:v,capture:B});const j=le(k);for(;y.length>j;)c(y.shift()?.bitmap);let P=-1;for(let u=y.length-1;u>=0;u--)if(B-y[u].capture>=k){P=u;break}if(P!==-1){for(let H=0;H<P;H++)c(y.shift()?.bitmap);const u=y.shift();u?(_(u.bitmap),c(u.bitmap),i.current=!0,p.current=k):_(v)}else if(!i.current)_(v);else{const u=y.shift();u?(_(u.bitmap),c(u.bitmap)):_(v)}}catch{}x()}return x(),()=>{M=!0,R();for(const s of l.current)try{s.bitmap.close()}catch{}l.current=[]}},[o,e,a])}const ie="_row_1t5g2_1",de="_rowHeader_1t5g2_9",ue="_rowLabel_1t5g2_17",fe="_rowValue_1t5g2_28",he="_slider_1t5g2_36",pe="_swatches_1t5g2_99",me="_swatch_1t5g2_99",ge="_swatchPicked_1t5g2_114",be="_colorInput_1t5g2_120",ye="_segmented_1t5g2_131",d={row:ie,rowHeader:de,rowLabel:ue,rowValue:fe,slider:he,swatches:pe,swatch:me,swatchPicked:ge,colorInput:be,segmented:ye},we=({label:e,display:a,min:n,max:o,step:t,value:l,percent:f,onChange:h,onCommit:i})=>r("div",{className:d.row,children:[r("div",{className:d.rowHeader,children:[r("span",{className:d.rowLabel,children:e}),r("span",{className:d.rowValue,children:a})]}),r("input",{type:"range",className:d.slider,min:n,max:o,step:t,value:l,"aria-label":e,onInput:p=>h(Number(p.target.value)),onPointerUp:i,onTouchEnd:i,onKeyUp:i,onBlur:i,style:{"--slider-percent":`${f}%`}})]}),Ee=({label:e,colors:a,value:n,onChange:o})=>r("div",{className:d.row,children:[r("div",{className:d.rowHeader,children:r("span",{className:d.rowLabel,children:e})}),r("div",{className:d.swatches,children:[a.map(t=>r("button",{type:"button","aria-label":`${e} ${t}`,"aria-pressed":n.toLowerCase()===t.toLowerCase(),onClick:()=>o(t),className:`${d.swatch} ${n.toLowerCase()===t.toLowerCase()?d.swatchPicked:""}`,style:{backgroundColor:t}},t)),r("input",{type:"color","aria-label":`Custom ${e.toLowerCase()}`,className:d.colorInput,value:n,onInput:t=>o(t.target.value)})]})]});function Ne({label:e,options:a,value:n,onChange:o}){return r("div",{className:d.row,children:[r("div",{className:d.rowHeader,children:r("span",{className:d.rowLabel,children:e})}),r("div",{className:d.segmented,role:"group","aria-label":e,children:a.map(t=>r("button",{type:"button","aria-pressed":n===t,onClick:()=>o(t),children:[r("span",{children:t}),n===t&&r(K,{size:10})]},t))})]})}const $=10,I=500,ve="/av-sync-test.mp4",Ae=({isOpen:e,initialMs:a,onApply:n,onClose:o})=>{const[t,l]=V(a),[f,h]=V(!1),i=m(null),p=m(null);se({videoRef:i,canvasRef:p,delayMs:t,enabled:e&&!f}),L(()=>{e&&(l(Math.max(0,Math.min(I,Math.round(a)))),h(!1))},[e,a]),L(()=>{if(!e)return;const c=i.current;if(!c)return;c.currentTime=0;const w=()=>{c.play().catch(()=>{})};if(c.readyState>=HTMLMediaElement.HAVE_FUTURE_DATA)w();else return c.addEventListener("canplay",w,{once:!0}),()=>c.removeEventListener("canplay",w)},[e]),L(()=>{if(!e){const c=i.current;if(c){c.pause();try{c.currentTime=0}catch{}}}},[e]);const g=c=>Math.max(0,Math.min(I,Math.round(c)));return r(Q,{isOpen:e,onClose:o,title:"Calibrate A/V sync",children:r("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",gap:12},children:[f?r("div",{style:{fontSize:"0.8rem",color:"var(--text-tertiary)",textAlign:"center",maxWidth:320},children:"Test clip failed to load. You can still set the delay manually below."}):r("button",{type:"button","aria-label":"Replay test clip",onClick:()=>i.current?.play().catch(()=>{}),style:{width:"100%",maxWidth:420,aspectRatio:"16 / 9",padding:0,border:"1px solid var(--glass-border)",borderRadius:"var(--radius-md)",overflow:"hidden",background:"black",cursor:"pointer"},children:[r("video",{ref:i,src:ve,loop:!0,playsInline:!0,preload:"auto",onError:()=>h(!0),style:{display:"none"}}),r("canvas",{ref:p,style:{width:"100%",height:"100%",display:"block"}})]}),r("div",{style:{fontSize:"0.85rem",color:"var(--text-tertiary)",textAlign:"center",maxWidth:340},children:"The circle flashes white with a click every second. Adjust ms until the flash lands exactly on the heard click — this runs through the same video-delay pipeline as playback. The clip loops, so judge the average over several beats."}),r("div",{style:{display:"flex",alignItems:"center",gap:12},children:[r(T,{onClick:()=>l(c=>g(c-$)),"aria-label":"Decrease delay by 10 milliseconds",children:["− ",$,"ms"]}),r("div",{style:{fontSize:"1.5rem",fontWeight:800,minWidth:90,textAlign:"center"},children:[t,"ms"]}),r(T,{onClick:()=>l(c=>g(c+$)),"aria-label":"Increase delay by 10 milliseconds",children:["+ ",$,"ms"]})]}),r("div",{style:{width:"100%"},children:r(we,{label:"Video delay",display:`${t}ms`,min:0,max:I,step:5,value:t,percent:t/I*100,onChange:c=>l(g(c))})}),r("div",{style:{display:"flex",gap:8},children:[r(T,{onClick:o,children:"Cancel"}),r(T,{onClick:()=>n(t),children:["Use ",t,"ms"]})]})]})})};export{Ae as A,Le as B,Pe as C,C as D,we as M,Ee as S,Ie as T,Me as a,Se as b,$e as c,Ne as d,ke as l,_e as p,Te as r,Z as s,se as u};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{e as r}from"./vendor-rLNfZm7Y.js";import{aL as n}from"./index-CpjgU8ou.js";const e="_errorBox_1n4sy_1",a="_icon_1n4sy_13",o={errorBox:e,icon:a},t=({message:s})=>r("div",{className:o.errorBox,children:[r(n,{className:o.icon}),r("span",{children:s})]});export{t as E};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
._errorBox_1n4sy_1{background-color:#e53e3e1a;border:1px solid var(--danger-color);color:var(--danger-color);padding:1rem;border-radius:8px;display:flex;align-items:center;gap:1rem;margin:1rem 0}._icon_1n4sy_13{font-size:1.5rem}
|