Nota — a free DAW for macOS, Windows and Linux. No subscription, no account — just open it and make music.
C# audioaudio-unitavaloniacpp20cross-platformdawdigital-audio-workstationdspjucelinux-audiomcp-servermidimusicmusic-productionpiano-rollplugin-hostsequencersynthesizervstvst3
(feat) Nota Remote wears Nota's theme, live, in the Studio look (#35)
Chris Laupama301d83cb3a76
diff --git a/CHANGELOG.md b/CHANGELOG.mdindex bc4c8c16..7f625912 100644--- a/CHANGELOG.md+++ b/CHANGELOG.md@@ -52,6 +52,14 @@ Entry categories: `Added`, `Changed`, `Fixed`, `Removed`.Studio Light follows the same system in light greys (see *Colour themes* above; yourDark / Light / System choice carries over). Every feature, shortcut and menu stays whereit was, and projects open unchanged (track colours keep their place in the new palette).+- **Nota Remote matches Nota:** the phone now wears the same colour theme as the+ computer, and switches with it — pick another theme in Preferences → Appearance, or let+ Follow system flip it, and the phone follows within a moment, without reloading or+ cutting a held note. Under the phone's own **Follow phone** setting (⋯ → Theme) it wears+ your In dark mode / In light mode themes as the phone itself turns dark or light. The+ phone's screens take the Studio look too: neutral greys, orange only for what is playing,+ held or switched on, mute amber, solo blue and arm red, sentence-case labels and nearly+ square corners. A phone that has connected before opens straight in its last theme.- **View switcher as icons:** Arrangement, Session and Modular are now three small iconkeys in the transport instead of words, freeing about 140 px. Hover one for its name.Every icon in the app now comes from one set, drawn at one line weight.diff --git a/DESIGN.md b/DESIGN.mdindex 6c4e7005..967ac714 100644--- a/DESIGN.md+++ b/DESIGN.md@@ -724,6 +724,27 @@ the mixer can live on a second screen. The command palette is the only in-window- **Titles are sentence case:** "Mixer", "Export audio", "Edit tags", "What's new inNota", "Connect phone".+### Nota Remote++The phone page (`src/web/remote`) follows the same system (spec 014). It holds no colour+value: Nota sends the theme it wears and the user's dark-mode and light-mode picks with all+their tokens (the `theme` message), and the page sets each token as a custom property named+after it — `BgApp` → `--bg-app`, `SurfaceRaised` → `--surface-raised` — plus the derived+inks `--ink-on-accent` / `-mute` / `-solo` / `-record` / `-success` (`NotaPalette.ReadableInkOn`'s+pair, which Nota sends). **Follow Nota** wears Nota's theme, **Follow phone** a pick by the+phone's own scheme. Before Nota answers, the page wears the last theme it stored (a head+script paints it before the app loads), or the Studio Dark fallback that `theme-plugin.ts`+builds from the theme files at `npm run build`. Elevation is built the same way:+`--bevel` (`ShadowBevel`), `--sunken` (`Rule`), `--popover` (`Seam` + `ShadowPopover`),+`--scrim` (`ShadowModal`).++Structure is Studio's — seams, the accent for live or chosen only, solid semantic fills with+derived ink, sentence case, radii 0 / 1 / 2 / 3 — at phone sizes: touch targets stay+36–56 px and words 11–16 px (the big position and the count-in larger). The phone's icons+are inline SVG drawn with the shared stroke (1.5, round caps and joins), since `Glyph` is+native. `npm run mock` serves the built page against a stand-in Nota with a demo project and+the real theme messages, for screenshots without the desktop app.+## Enforced by tests`tests/Nota.SmokeTest/DesignTokenCheck*.cs` runs in the smoke test (the `-- design: … --`@@ -745,6 +766,7 @@ sections) and fails the build on:| `RunIcons` | No path geometry outside `Controls/Glyph.cs`: no `Geometry.Parse` / `StreamGeometry.Parse` / `PathGeometry.Parse`, no axaml `Data="M…"`, no SVG path string. `IconAllowList.txt` is empty || `RunBrowser` | Every built-in device sits in exactly one category of its own tab (`DeviceCategories.cs`); no category names a missing device or is empty; names in sentence case; 18 / 26 / 6 devices shelved || `RunStudio` | Every `Radius.*` on the 0/1/2/3/4 scale; only `Shadow.Popover` / `Shadow.Modal` blurred, no literal `BoxShadow` in views; no positive `LetterSpacing` in the theme, `NotaType` tracking 0, no upper-casing in the shared label builders; knob arcs, slider fills and graph curves neutral at rest (`VizInk`); transport 44 · console 30 · seam 1; no Ember value in the Studio themes |+| `RunRemote` | Nota Remote's page: no colour literal (hex, `rgb()`, `hsl()`) in its sources or `index.html`; the first-paint fallback built from the theme files; no letter-spacing, `uppercase`, `.toUpperCase()` in a component or `.caps`; radii 0 / 1 / 2 / 3 / 4 px or 50 %; every custom property it reads is a theme token or one it defines |When a check fails, fix the view — or, for a genuine exception, add it to the check'sallow-list with a comment saying why. The ratchet lists in `tests/Nota.SmokeTest/`diff --git a/FEATURES.md b/FEATURES.mdindex 54ca2dc7..b9ddc170 100644--- a/FEATURES.md+++ b/FEATURES.md@@ -278,6 +278,11 @@ floating window (**View → Mixer**, ⌘M).permissions (play only / play and control) in **Settings → Remote**. Phone notes record likethe computer keyboard's; knobs and XY axes map through MIDI Learn (XY and tilt per track);several phones play at once, each on its own track, with players' names on the tracks.+- **Nota Remote in Nota's theme**: the phone wears the colour theme Nota wears and follows+ every change live (including Follow system); **Follow phone** (⋯ → Theme) wears the+ In dark mode / In light mode themes by the phone's own scheme. Its screens follow the+ Studio look — one orange accent for what is live or chosen, semantic mute / solo / arm+ colours, sentence-case labels — and a returning phone paints in its last theme at once.- **Nota Remote Keys — Expressive**: on a track whose instrument takes MPE, the phone'sKeyboard and Scale modes can keep each finger on the note it struck: sliding sideways bendsit (a key's width is its pitch step), the height on the key is its slide, and a screen thatdiff --git a/README.md b/README.mdindex a30ebe76..45df419e 100644--- a/README.md+++ b/README.md@@ -10,23 +10,23 @@</p><p align="center">- <a href="https://github.com/nota-daw/nota/releases/latest"><img src="https://img.shields.io/badge/Download-macOS%20%C2%B7%20Windows%20%C2%B7%20Linux-D9A13F?style=for-the-badge" alt="Download for macOS, Windows and Linux"></a>+ <a href="https://github.com/nota-daw/nota/releases/latest"><img src="https://img.shields.io/badge/Download-macOS%20%C2%B7%20Windows%20%C2%B7%20Linux-FF9F1C?style=for-the-badge" alt="Download for macOS, Windows and Linux"></a> - <a href="https://nota-daw.github.io/nota-site/"><img src="https://img.shields.io/badge/Website-2B2622?style=for-the-badge" alt="Website"></a>+ <a href="https://nota-daw.github.io/nota-site/"><img src="https://img.shields.io/badge/Website-2B2D31?style=for-the-badge" alt="Website"></a></p><p align="center">- <a href="https://github.com/nota-daw/nota/releases/latest"><img src="https://img.shields.io/github/v/release/nota-daw/nota?label=release&sort=semver&color=D9A13F" alt="Latest release"></a>+ <a href="https://github.com/nota-daw/nota/releases/latest"><img src="https://img.shields.io/github/v/release/nota-daw/nota?label=release&sort=semver&color=FF9F1C" alt="Latest release"></a><a href="https://github.com/nota-daw/nota/actions/workflows/release.yml"><img src="https://img.shields.io/github/actions/workflow/status/nota-daw/nota/release.yml?label=build" alt="Build status"></a>- <a href="https://github.com/nota-daw/nota/releases"><img src="https://img.shields.io/github/downloads/nota-daw/nota/total?color=D9A13F" alt="Downloads"></a>- <a href="LICENSES/"><img src="https://img.shields.io/badge/license-AGPL--3.0-D9A13F" alt="License: AGPL-3.0"></a>- <img src="https://img.shields.io/badge/platform-macOS%20%7C%20Windows%20%7C%20Linux-D9A13F" alt="Platforms: macOS, Windows, Linux">- <a href="https://nota-daw.github.io/nota-docs/"><img src="https://img.shields.io/badge/docs-user%20manual-D9A13F" alt="Documentation"></a>+ <a href="https://github.com/nota-daw/nota/releases"><img src="https://img.shields.io/github/downloads/nota-daw/nota/total?color=FF9F1C" alt="Downloads"></a>+ <a href="LICENSES/"><img src="https://img.shields.io/badge/license-AGPL--3.0-FF9F1C" alt="License: AGPL-3.0"></a>+ <img src="https://img.shields.io/badge/platform-macOS%20%7C%20Windows%20%7C%20Linux-FF9F1C" alt="Platforms: macOS, Windows, Linux">+ <a href="https://nota-daw.github.io/nota-docs/"><img src="https://img.shields.io/badge/docs-user%20manual-FF9F1C" alt="Documentation"></a><a href="https://t.me/notadaw"><img src="https://img.shields.io/badge/Telegram-2CA5E0?logo=telegram&logoColor=white" alt="Telegram"></a><a href="https://discord.gg/apf4Q2JKWk"><img src="https://img.shields.io/badge/Discord-5865F2?logo=discord&logoColor=white" alt="Discord"></a></p>-+<p align="center">▶ <a href="https://www.youtube.com/watch?v=zmvKOCIm4ig"><b>Watch the demo with sound</b></a> (1:45, YouTube)</p>@@ -43,6 +43,8 @@(Surge XT, Dexed, Dragonfly Reverb …) install in one click from Settings.- **Your phone is a controller.** Scan a QR code and play pads, keys and an XY pad, or ridethe mixer — over Wi-Fi or USB, nothing to install.+- **Easy on the eyes.** A calm Studio look: neutral greys, one orange accent for what is+ playing or chosen. Dark or light, or the warm Ember themes, and your phone follows along.- **Works where you do.** The same app on macOS, Windows and Linux, on Intel/AMD and ARM.## Demo@@ -54,18 +56,19 @@<table><tr><td width="50%"><img src="assets/screenshots/arrangement.webp" alt="Arrangement view with a song and its device chain"><br><sub><b>Arrangement</b> — the song, with the selected track's devices below</sub></td>- <td width="50%"><img src="assets/screenshots/modular.webp" alt="Modular view: LFOs and math nodes patched into effects with cables"><br><sub><b>Modular</b> — patch LFOs and modulators onto any parameter</sub></td>+ <td width="50%"><img src="assets/screenshots/modular.webp" alt="Modular view: a track's signal graph, from the instrument through its effects to the output"><br><sub><b>Modular</b> — patch LFOs and modulators onto any parameter</sub></td></tr><tr>- <td width="50%"><img src="assets/screenshots/piano-roll.gif" alt="Drawing notes in the piano roll and applying a transform"><br><sub><b>Piano roll</b> — draw, then arpeggiate, strum or ornament in one click</sub></td>- <td width="50%"><img src="assets/screenshots/filter.gif" alt="Sweeping the cutoff of Nota Auto Filter over a live spectrum"><br><sub><b>Built-in devices</b> — every one draws what it does to the sound</sub></td>+ <td width="50%"><img src="assets/screenshots/piano-roll.webp" alt="The piano roll following the playhead through a lead hook, with note velocities below"><br><sub><b>Piano roll</b> — draw, then arpeggiate, strum or ornament in one click</sub></td>+ <td width="50%"><img src="assets/screenshots/filter.webp" alt="Sweeping the cutoff of Nota Auto Filter over a live spectrum"><br><sub><b>Built-in devices</b> — every one draws what it does to the sound</sub></td></tr><tr>- <td width="50%"><img src="assets/screenshots/mixer.gif" alt="Mixer with faders and live meters"><br><sub><b>Mixer</b> — faders, sends and live meters</sub></td>+ <td width="50%"><img src="assets/screenshots/mixer.webp" alt="Mixer with faders and live meters"><br><sub><b>Mixer</b> — faders, sends and live meters</sub></td><td width="50%"><img src="assets/screenshots/plugin-downloads.webp" alt="Settings → Downloads: a catalogue of open-source plugins to install"><br><sub><b>Downloads</b> — 200+ free open-source plugins, one click to install</sub></td></tr><tr>- <td colspan="2"><img src="assets/screenshots/arrangement-light.webp" alt="Arrangement view in the light theme"><br><sub>…and a light theme, for daytime sessions.</sub></td>+ <td width="50%"><img src="assets/screenshots/arrangement-light.webp" alt="Arrangement view in the Studio Light theme"><br><sub><b>Studio Light</b> — the same look in light greys, for daytime sessions</sub></td>+ <td width="50%"><img src="assets/screenshots/appearance.webp" alt="Settings → Appearance: Dark, Light or Follow system, with the Studio and Ember colour themes as preview cards"><br><sub><b>Colour themes</b> — Studio or Ember, dark or light, or follow the system</sub></td></tr></table>@@ -90,6 +93,9 @@ A quick digest — see [`FEATURES.md`](FEATURES.md) for the full, categorised libranch off from it.- **Export** — the master or stems to WAV (16/24-bit or 32-bit float), with true-peaknormalize and dither.+- **Colour themes** — **Studio Dark** (the default), **Studio Light**, **Ember Graphite** and+ **Ember Paper**; pick one, or follow the system's dark / light mode. Nota Remote on your+ phone wears the same theme.- **AI control (optional)** — a local MCP server lets an AI assistant such as Claude workin the open project. Off by default.diff --git a/assets/icons/linux/nota-128.png b/assets/icons/linux/nota-128.pngindex 0c754ba7..da6ff6a5 100644Binary files a/assets/icons/linux/nota-128.png and b/assets/icons/linux/nota-128.png differdiff --git a/assets/icons/linux/nota-16.png b/assets/icons/linux/nota-16.pngindex 52735792..c0c4b7e5 100644Binary files a/assets/icons/linux/nota-16.png and b/assets/icons/linux/nota-16.png differdiff --git a/assets/icons/linux/nota-24.png b/assets/icons/linux/nota-24.pngindex d906fa9e..d5a992d6 100644Binary files a/assets/icons/linux/nota-24.png and b/assets/icons/linux/nota-24.png differdiff --git a/assets/icons/linux/nota-256.png b/assets/icons/linux/nota-256.pngindex 0315ef2a..579fec67 100644Binary files a/assets/icons/linux/nota-256.png and b/assets/icons/linux/nota-256.png differdiff --git a/assets/icons/linux/nota-32.png b/assets/icons/linux/nota-32.pngindex f734d13b..d97268af 100644Binary files a/assets/icons/linux/nota-32.png and b/assets/icons/linux/nota-32.png differdiff --git a/assets/icons/linux/nota-48.png b/assets/icons/linux/nota-48.pngindex cd4eee61..2a75f7ad 100644Binary files a/assets/icons/linux/nota-48.png and b/assets/icons/linux/nota-48.png differdiff --git a/assets/icons/linux/nota-512.png b/assets/icons/linux/nota-512.pngindex 7ba72c36..5c02eb5b 100644Binary files a/assets/icons/linux/nota-512.png and b/assets/icons/linux/nota-512.png differdiff --git a/assets/icons/linux/nota-64.png b/assets/icons/linux/nota-64.pngindex 2dc8364d..f777f9e7 100644Binary files a/assets/icons/linux/nota-64.png and b/assets/icons/linux/nota-64.png differdiff --git a/assets/icons/logo.png b/assets/icons/logo.pngindex 7ba72c36..5c02eb5b 100644Binary files a/assets/icons/logo.png and b/assets/icons/logo.png differdiff --git a/assets/icons/macos/nota-1024.png b/assets/icons/macos/nota-1024.pngindex 401ef70f..51a27790 100644Binary files a/assets/icons/macos/nota-1024.png and b/assets/icons/macos/nota-1024.png differdiff --git a/assets/icons/macos/nota-128.png b/assets/icons/macos/nota-128.pngindex 4a2ded95..f1e24ea3 100644Binary files a/assets/icons/macos/nota-128.png and b/assets/icons/macos/nota-128.png differdiff --git a/assets/icons/macos/nota-16.png b/assets/icons/macos/nota-16.pngindex 78902fcd..373bb6b1 100644Binary files a/assets/icons/macos/nota-16.png and b/assets/icons/macos/nota-16.png differdiff --git a/assets/icons/macos/nota-256.png b/assets/icons/macos/nota-256.pngindex 0b5ef01d..1f200109 100644Binary files a/assets/icons/macos/nota-256.png and b/assets/icons/macos/nota-256.png differdiff --git a/assets/icons/macos/nota-32.png b/assets/icons/macos/nota-32.pngindex 5288428a..2ffc051d 100644Binary files a/assets/icons/macos/nota-32.png and b/assets/icons/macos/nota-32.png differdiff --git a/assets/icons/macos/nota-512.png b/assets/icons/macos/nota-512.pngindex b45d065b..da3f3e7b 100644Binary files a/assets/icons/macos/nota-512.png and b/assets/icons/macos/nota-512.png differdiff --git a/assets/icons/macos/nota-64.png b/assets/icons/macos/nota-64.pngindex be825961..6dfd9e5e 100644Binary files a/assets/icons/macos/nota-64.png and b/assets/icons/macos/nota-64.png differdiff --git a/assets/icons/macos/nota.icns b/assets/icons/macos/nota.icnsindex d25c83ca..66fe6c1a 100644Binary files a/assets/icons/macos/nota.icns and b/assets/icons/macos/nota.icns differdiff --git a/assets/icons/svg/nota-macos.svg b/assets/icons/svg/nota-macos.svgindex d2ddea49..1579026f 100644--- a/assets/icons/svg/nota-macos.svg+++ b/assets/icons/svg/nota-macos.svg@@ -1 +1 @@-<svg xmlns="http://www.w3.org/2000/svg" width="1024" height="1024" viewBox="0 0 1024 1024"><defs><clipPath id="pl"><rect x="100" y="100" width="824" height="824" rx="185.4"/></clipPath></defs><rect x="100" y="100" width="824" height="824" rx="185.4" fill="#25221D" /><g clip-path="url(#pl)"><rect x="100" y="104" width="824" height="824" rx="185.4" fill="#1C1A16" /></g><rect x="102" y="102" width="820" height="820" rx="183.4" fill="none" stroke="#3A362D" stroke-width="4"/><circle cx="512" cy="512" r="241.40625" fill="none" stroke="#100F0D" stroke-width="69.203125" stroke-dasharray="1137.6001522959914 1516.800203061322" stroke-linecap="round" transform="rotate(135 512 512)"/><circle cx="512" cy="512" r="241.40625" fill="none" stroke="#D8A03D" stroke-width="69.203125" stroke-dasharray="705.2919777099463 1516.800203061322" stroke-linecap="round" transform="rotate(135 512 512)"/><line x1="512" y1="512" x2="512" y2="283.46875" stroke="#F2EDE1" stroke-width="69.203125" stroke-linecap="round" transform="rotate(32 512 512)"/></svg>\ No newline at end of file+<svg xmlns="http://www.w3.org/2000/svg" width="1024" height="1024" viewBox="0 0 1024 1024"><defs><clipPath id="pl"><rect x="100" y="100" width="824" height="824" rx="185.4"/></clipPath></defs><rect x="100" y="100" width="824" height="824" rx="185.4" fill="#2B2D31" /><g clip-path="url(#pl)"><rect x="100" y="104" width="824" height="824" rx="185.4" fill="#1E1F22" /></g><rect x="102" y="102" width="820" height="820" rx="183.4" fill="none" stroke="#45484E" stroke-width="4"/><circle cx="512" cy="512" r="241.40625" fill="none" stroke="#141517" stroke-width="69.203125" stroke-dasharray="1137.6001522959914 1516.800203061322" stroke-linecap="round" transform="rotate(135 512 512)"/><circle cx="512" cy="512" r="241.40625" fill="none" stroke="#FF9F1C" stroke-width="69.203125" stroke-dasharray="705.2919777099463 1516.800203061322" stroke-linecap="round" transform="rotate(135 512 512)"/><line x1="512" y1="512" x2="512" y2="283.46875" stroke="#F4F5F6" stroke-width="69.203125" stroke-linecap="round" transform="rotate(32 512 512)"/></svg>\ No newline at end of filediff --git a/assets/icons/svg/nota-mono-dark.svg b/assets/icons/svg/nota-mono-dark.svgindex 2eac4178..6898a083 100644--- a/assets/icons/svg/nota-mono-dark.svg+++ b/assets/icons/svg/nota-mono-dark.svg@@ -1 +1 @@-<svg xmlns="http://www.w3.org/2000/svg" width="1024" height="1024" viewBox="0 0 1024 1024"><circle cx="512" cy="512" r="300" fill="none" stroke="#A39D8F" stroke-width="96" stroke-dasharray="1413.7166941154069 1884.9555921538758" stroke-linecap="round" transform="rotate(135 512 512)"/><circle cx="512" cy="512" r="300" fill="none" stroke="#26231E" stroke-width="96" stroke-dasharray="876.4793509405157 1884.9555921538758" stroke-linecap="round" transform="rotate(135 512 512)"/><line x1="512" y1="512" x2="512" y2="240" stroke="#26231E" stroke-width="96" stroke-linecap="round" transform="rotate(32 512 512)"/></svg>\ No newline at end of file+<svg xmlns="http://www.w3.org/2000/svg" width="1024" height="1024" viewBox="0 0 1024 1024"><circle cx="512" cy="512" r="300" fill="none" stroke="#A4A9B0" stroke-width="96" stroke-dasharray="1413.7166941154069 1884.9555921538758" stroke-linecap="round" transform="rotate(135 512 512)"/><circle cx="512" cy="512" r="300" fill="none" stroke="#17181A" stroke-width="96" stroke-dasharray="876.4793509405157 1884.9555921538758" stroke-linecap="round" transform="rotate(135 512 512)"/><line x1="512" y1="512" x2="512" y2="240" stroke="#17181A" stroke-width="96" stroke-linecap="round" transform="rotate(32 512 512)"/></svg>\ No newline at end of filediff --git a/assets/icons/svg/nota-mono-light.svg b/assets/icons/svg/nota-mono-light.svgindex 04959478..aaa8ac4a 100644--- a/assets/icons/svg/nota-mono-light.svg+++ b/assets/icons/svg/nota-mono-light.svg@@ -1 +1 @@-<svg xmlns="http://www.w3.org/2000/svg" width="1024" height="1024" viewBox="0 0 1024 1024"><circle cx="512" cy="512" r="300" fill="none" stroke="#55514A" stroke-width="96" stroke-dasharray="1413.7166941154069 1884.9555921538758" stroke-linecap="round" transform="rotate(135 512 512)"/><circle cx="512" cy="512" r="300" fill="none" stroke="#E9E4D8" stroke-width="96" stroke-dasharray="876.4793509405157 1884.9555921538758" stroke-linecap="round" transform="rotate(135 512 512)"/><line x1="512" y1="512" x2="512" y2="240" stroke="#E9E4D8" stroke-width="96" stroke-linecap="round" transform="rotate(32 512 512)"/></svg>\ No newline at end of file+<svg xmlns="http://www.w3.org/2000/svg" width="1024" height="1024" viewBox="0 0 1024 1024"><circle cx="512" cy="512" r="300" fill="none" stroke="#4F535A" stroke-width="96" stroke-dasharray="1413.7166941154069 1884.9555921538758" stroke-linecap="round" transform="rotate(135 512 512)"/><circle cx="512" cy="512" r="300" fill="none" stroke="#E8E9EB" stroke-width="96" stroke-dasharray="876.4793509405157 1884.9555921538758" stroke-linecap="round" transform="rotate(135 512 512)"/><line x1="512" y1="512" x2="512" y2="240" stroke="#E8E9EB" stroke-width="96" stroke-linecap="round" transform="rotate(32 512 512)"/></svg>\ No newline at end of filediff --git a/assets/icons/svg/nota-small.svg b/assets/icons/svg/nota-small.svgindex 90135e4c..21e67de3 100644--- a/assets/icons/svg/nota-small.svg+++ b/assets/icons/svg/nota-small.svg@@ -1 +1 @@-<svg xmlns="http://www.w3.org/2000/svg" width="1024" height="1024" viewBox="0 0 1024 1024"><defs><clipPath id="pl"><rect x="0" y="0" width="1024" height="1024" rx="0"/></clipPath></defs><rect width="1024" height="1024" fill="#1C1A16"/><circle cx="512" cy="512" r="300" fill="none" stroke="#100F0D" stroke-width="132" stroke-dasharray="1413.7166941154069 1884.9555921538758" stroke-linecap="round" transform="rotate(135 512 512)"/><circle cx="512" cy="512" r="300" fill="none" stroke="#D8A03D" stroke-width="132" stroke-dasharray="876.4793509405157 1884.9555921538758" stroke-linecap="round" transform="rotate(135 512 512)"/><line x1="512" y1="512" x2="512" y2="300" stroke="#F2EDE1" stroke-width="132" stroke-linecap="round" transform="rotate(32 512 512)"/></svg>\ No newline at end of file+<svg xmlns="http://www.w3.org/2000/svg" width="1024" height="1024" viewBox="0 0 1024 1024"><defs><clipPath id="pl"><rect x="0" y="0" width="1024" height="1024" rx="0"/></clipPath></defs><rect width="1024" height="1024" fill="#1E1F22"/><circle cx="512" cy="512" r="300" fill="none" stroke="#141517" stroke-width="132" stroke-dasharray="1413.7166941154069 1884.9555921538758" stroke-linecap="round" transform="rotate(135 512 512)"/><circle cx="512" cy="512" r="300" fill="none" stroke="#FF9F1C" stroke-width="132" stroke-dasharray="876.4793509405157 1884.9555921538758" stroke-linecap="round" transform="rotate(135 512 512)"/><line x1="512" y1="512" x2="512" y2="300" stroke="#F4F5F6" stroke-width="132" stroke-linecap="round" transform="rotate(32 512 512)"/></svg>\ No newline at end of filediff --git a/assets/icons/svg/nota-windows.svg b/assets/icons/svg/nota-windows.svgindex da5056f4..23447015 100644--- a/assets/icons/svg/nota-windows.svg+++ b/assets/icons/svg/nota-windows.svg@@ -1 +1 @@-<svg xmlns="http://www.w3.org/2000/svg" width="1024" height="1024" viewBox="0 0 1024 1024"><defs><clipPath id="pl"><rect x="32" y="32" width="960" height="960" rx="172"/></clipPath></defs><rect x="32" y="32" width="960" height="960" rx="172" fill="#25221D" /><g clip-path="url(#pl)"><rect x="32" y="36" width="960" height="960" rx="172" fill="#1C1A16" /></g><rect x="34" y="34" width="956" height="956" rx="170" fill="none" stroke="#3A362D" stroke-width="4"/><circle cx="512" cy="512" r="281.25" fill="none" stroke="#100F0D" stroke-width="80.625" stroke-dasharray="1325.359400733194 1767.1458676442587" stroke-linecap="round" transform="rotate(135 512 512)"/><circle cx="512" cy="512" r="281.25" fill="none" stroke="#D8A03D" stroke-width="80.625" stroke-dasharray="821.6993915067336 1767.1458676442587" stroke-linecap="round" transform="rotate(135 512 512)"/><line x1="512" y1="512" x2="512" y2="245.75" stroke="#F2EDE1" stroke-width="80.625" stroke-linecap="round" transform="rotate(32 512 512)"/></svg>\ No newline at end of file+<svg xmlns="http://www.w3.org/2000/svg" width="1024" height="1024" viewBox="0 0 1024 1024"><defs><clipPath id="pl"><rect x="32" y="32" width="960" height="960" rx="172"/></clipPath></defs><rect x="32" y="32" width="960" height="960" rx="172" fill="#2B2D31" /><g clip-path="url(#pl)"><rect x="32" y="36" width="960" height="960" rx="172" fill="#1E1F22" /></g><rect x="34" y="34" width="956" height="956" rx="170" fill="none" stroke="#45484E" stroke-width="4"/><circle cx="512" cy="512" r="281.25" fill="none" stroke="#141517" stroke-width="80.625" stroke-dasharray="1325.359400733194 1767.1458676442587" stroke-linecap="round" transform="rotate(135 512 512)"/><circle cx="512" cy="512" r="281.25" fill="none" stroke="#FF9F1C" stroke-width="80.625" stroke-dasharray="821.6993915067336 1767.1458676442587" stroke-linecap="round" transform="rotate(135 512 512)"/><line x1="512" y1="512" x2="512" y2="245.75" stroke="#F4F5F6" stroke-width="80.625" stroke-linecap="round" transform="rotate(32 512 512)"/></svg>\ No newline at end of filediff --git a/assets/icons/svg/nota.svg b/assets/icons/svg/nota.svgindex 20e10530..e8d47ec0 100644--- a/assets/icons/svg/nota.svg+++ b/assets/icons/svg/nota.svg@@ -1 +1 @@-<svg xmlns="http://www.w3.org/2000/svg" width="1024" height="1024" viewBox="0 0 1024 1024"><defs><clipPath id="pl"><rect x="0" y="0" width="1024" height="1024" rx="0"/></clipPath></defs><rect width="1024" height="1024" fill="#1C1A16"/><circle cx="512" cy="512" r="300" fill="none" stroke="#100F0D" stroke-width="86" stroke-dasharray="1413.7166941154069 1884.9555921538758" stroke-linecap="round" transform="rotate(135 512 512)"/><circle cx="512" cy="512" r="300" fill="none" stroke="#D8A03D" stroke-width="86" stroke-dasharray="876.4793509405157 1884.9555921538758" stroke-linecap="round" transform="rotate(135 512 512)"/><line x1="512" y1="512" x2="512" y2="228" stroke="#F2EDE1" stroke-width="86" stroke-linecap="round" transform="rotate(32 512 512)"/></svg>\ No newline at end of file+<svg xmlns="http://www.w3.org/2000/svg" width="1024" height="1024" viewBox="0 0 1024 1024"><defs><clipPath id="pl"><rect x="0" y="0" width="1024" height="1024" rx="0"/></clipPath></defs><rect width="1024" height="1024" fill="#1E1F22"/><circle cx="512" cy="512" r="300" fill="none" stroke="#141517" stroke-width="86" stroke-dasharray="1413.7166941154069 1884.9555921538758" stroke-linecap="round" transform="rotate(135 512 512)"/><circle cx="512" cy="512" r="300" fill="none" stroke="#FF9F1C" stroke-width="86" stroke-dasharray="876.4793509405157 1884.9555921538758" stroke-linecap="round" transform="rotate(135 512 512)"/><line x1="512" y1="512" x2="512" y2="228" stroke="#F4F5F6" stroke-width="86" stroke-linecap="round" transform="rotate(32 512 512)"/></svg>\ No newline at end of filediff --git a/assets/icons/tray/nota-mono-dark-16.png b/assets/icons/tray/nota-mono-dark-16.pngindex 63042657..e3c5c0e9 100644Binary files a/assets/icons/tray/nota-mono-dark-16.png and b/assets/icons/tray/nota-mono-dark-16.png differdiff --git a/assets/icons/tray/nota-mono-dark-22.png b/assets/icons/tray/nota-mono-dark-22.pngindex 3270a0f6..ecc877d6 100644Binary files a/assets/icons/tray/nota-mono-dark-22.png and b/assets/icons/tray/nota-mono-dark-22.png differdiff --git a/assets/icons/tray/nota-mono-dark-24.png b/assets/icons/tray/nota-mono-dark-24.pngindex 39ebb5c0..5840396d 100644Binary files a/assets/icons/tray/nota-mono-dark-24.png and b/assets/icons/tray/nota-mono-dark-24.png differdiff --git a/assets/icons/tray/nota-mono-dark-32.png b/assets/icons/tray/nota-mono-dark-32.pngindex dea8e410..43a6341e 100644Binary files a/assets/icons/tray/nota-mono-dark-32.png and b/assets/icons/tray/nota-mono-dark-32.png differdiff --git a/assets/icons/tray/nota-mono-dark-44.png b/assets/icons/tray/nota-mono-dark-44.pngindex b6d8bb67..16e5668f 100644Binary files a/assets/icons/tray/nota-mono-dark-44.png and b/assets/icons/tray/nota-mono-dark-44.png differdiff --git a/assets/icons/tray/nota-mono-light-16.png b/assets/icons/tray/nota-mono-light-16.pngindex 1c3152a6..75af5f24 100644Binary files a/assets/icons/tray/nota-mono-light-16.png and b/assets/icons/tray/nota-mono-light-16.png differdiff --git a/assets/icons/tray/nota-mono-light-22.png b/assets/icons/tray/nota-mono-light-22.pngindex 8339f1bf..f7ffc276 100644Binary files a/assets/icons/tray/nota-mono-light-22.png and b/assets/icons/tray/nota-mono-light-22.png differdiff --git a/assets/icons/tray/nota-mono-light-24.png b/assets/icons/tray/nota-mono-light-24.pngindex 1ccd3bbc..55a28504 100644Binary files a/assets/icons/tray/nota-mono-light-24.png and b/assets/icons/tray/nota-mono-light-24.png differdiff --git a/assets/icons/tray/nota-mono-light-32.png b/assets/icons/tray/nota-mono-light-32.pngindex 2f945260..55379856 100644Binary files a/assets/icons/tray/nota-mono-light-32.png and b/assets/icons/tray/nota-mono-light-32.png differdiff --git a/assets/icons/tray/nota-mono-light-44.png b/assets/icons/tray/nota-mono-light-44.pngindex 7bc965dc..0f3b16ab 100644Binary files a/assets/icons/tray/nota-mono-light-44.png and b/assets/icons/tray/nota-mono-light-44.png differdiff --git a/assets/icons/windows/nota-128.png b/assets/icons/windows/nota-128.pngindex 0c754ba7..da6ff6a5 100644Binary files a/assets/icons/windows/nota-128.png and b/assets/icons/windows/nota-128.png differdiff --git a/assets/icons/windows/nota-16.png b/assets/icons/windows/nota-16.pngindex 52735792..c0c4b7e5 100644Binary files a/assets/icons/windows/nota-16.png and b/assets/icons/windows/nota-16.png differdiff --git a/assets/icons/windows/nota-20.png b/assets/icons/windows/nota-20.pngindex 26cc67ca..79e40443 100644Binary files a/assets/icons/windows/nota-20.png and b/assets/icons/windows/nota-20.png differdiff --git a/assets/icons/windows/nota-24.png b/assets/icons/windows/nota-24.pngindex d906fa9e..d5a992d6 100644Binary files a/assets/icons/windows/nota-24.png and b/assets/icons/windows/nota-24.png differdiff --git a/assets/icons/windows/nota-256.png b/assets/icons/windows/nota-256.pngindex 0315ef2a..579fec67 100644Binary files a/assets/icons/windows/nota-256.png and b/assets/icons/windows/nota-256.png differdiff --git a/assets/icons/windows/nota-32.png b/assets/icons/windows/nota-32.pngindex f734d13b..d97268af 100644Binary files a/assets/icons/windows/nota-32.png and b/assets/icons/windows/nota-32.png differdiff --git a/assets/icons/windows/nota-40.png b/assets/icons/windows/nota-40.pngindex cbe73163..b0066d66 100644Binary files a/assets/icons/windows/nota-40.png and b/assets/icons/windows/nota-40.png differdiff --git a/assets/icons/windows/nota-48.png b/assets/icons/windows/nota-48.pngindex cd4eee61..2a75f7ad 100644Binary files a/assets/icons/windows/nota-48.png and b/assets/icons/windows/nota-48.png differdiff --git a/assets/icons/windows/nota-64.png b/assets/icons/windows/nota-64.pngindex 2dc8364d..f777f9e7 100644Binary files a/assets/icons/windows/nota-64.png and b/assets/icons/windows/nota-64.png differdiff --git a/assets/icons/windows/nota.ico b/assets/icons/windows/nota.icoindex f1f7289d..94925134 100644Binary files a/assets/icons/windows/nota.ico and b/assets/icons/windows/nota.ico differdiff --git a/assets/screenshots/appearance.webp b/assets/screenshots/appearance.webpnew file mode 100644index 00000000..34449eb5Binary files /dev/null and b/assets/screenshots/appearance.webp differdiff --git a/assets/screenshots/arrangement-light.webp b/assets/screenshots/arrangement-light.webpindex 4e9be941..f267e195 100644Binary files a/assets/screenshots/arrangement-light.webp and b/assets/screenshots/arrangement-light.webp differdiff --git a/assets/screenshots/arrangement.webp b/assets/screenshots/arrangement.webpindex 75aa0c79..b40a3fd2 100644Binary files a/assets/screenshots/arrangement.webp and b/assets/screenshots/arrangement.webp differdiff --git a/assets/screenshots/filter.gif b/assets/screenshots/filter.gifdeleted file mode 100644index 04671936..00000000Binary files a/assets/screenshots/filter.gif and /dev/null differdiff --git a/assets/screenshots/filter.webp b/assets/screenshots/filter.webpnew file mode 100644index 00000000..9128a0eeBinary files /dev/null and b/assets/screenshots/filter.webp differdiff --git a/assets/screenshots/mixer.gif b/assets/screenshots/mixer.gifdeleted file mode 100644index 4cc70f74..00000000Binary files a/assets/screenshots/mixer.gif and /dev/null differdiff --git a/assets/screenshots/mixer.webp b/assets/screenshots/mixer.webpindex 0ddd0933..a5114d2b 100644Binary files a/assets/screenshots/mixer.webp and b/assets/screenshots/mixer.webp differdiff --git a/assets/screenshots/modular.webp b/assets/screenshots/modular.webpindex fcf97a96..ba081c26 100644Binary files a/assets/screenshots/modular.webp and b/assets/screenshots/modular.webp differdiff --git a/assets/screenshots/piano-roll.gif b/assets/screenshots/piano-roll.gifdeleted file mode 100644index b45887c0..00000000Binary files a/assets/screenshots/piano-roll.gif and /dev/null differdiff --git a/assets/screenshots/piano-roll.webp b/assets/screenshots/piano-roll.webpindex 6be3bf40..554ed2ea 100644Binary files a/assets/screenshots/piano-roll.webp and b/assets/screenshots/piano-roll.webp differdiff --git a/assets/screenshots/playback.gif b/assets/screenshots/playback.gifdeleted file mode 100644index e936f8f5..00000000Binary files a/assets/screenshots/playback.gif and /dev/null differdiff --git a/assets/screenshots/playback.webp b/assets/screenshots/playback.webpnew file mode 100644index 00000000..78cdaafaBinary files /dev/null and b/assets/screenshots/playback.webp differdiff --git a/assets/screenshots/plugin-downloads.webp b/assets/screenshots/plugin-downloads.webpindex c0ca6a2d..1956ca7a 100644Binary files a/assets/screenshots/plugin-downloads.webp and b/assets/screenshots/plugin-downloads.webp differdiff --git a/specs/014-remote-studio/checklists/requirements.md b/specs/014-remote-studio/checklists/requirements.mdnew file mode 100644index 00000000..c51f321a--- /dev/null+++ b/specs/014-remote-studio/checklists/requirements.md@@ -0,0 +1,36 @@+# Specification Quality Checklist: Nota Remote in Studio, wearing the app's theme++**Purpose**: Validate specification completeness and quality before proceeding to planning+**Created**: 2026-10-15+**Feature**: [spec.md](../spec.md)++## Content Quality++- [x] No implementation details (languages, frameworks, APIs)+- [x] Focused on user value and business needs+- [x] Written for non-technical stakeholders+- [x] All mandatory sections completed++## Requirement Completeness++- [x] No [NEEDS CLARIFICATION] markers remain+- [x] Requirements are testable and unambiguous+- [x] Success criteria are measurable+- [x] Success criteria are technology-agnostic (no implementation details)+- [x] All acceptance scenarios are defined+- [x] Edge cases are identified+- [x] Scope is clearly bounded+- [x] Dependencies and assumptions identified++## Feature Readiness++- [x] All functional requirements have clear acceptance criteria+- [x] User scenarios cover primary flows+- [x] Feature meets measurable outcomes defined in Success Criteria+- [x] No implementation details leak into specification++## Notes++- The spec names files and the build check (FR-019, FR-020, Nota Context) because the+ request itself is about where colour lives and the build gate; the user-facing+ requirements stay behaviour-level. Accepted as in specs 010–013.diff --git a/specs/014-remote-studio/contracts/theme-message.md b/specs/014-remote-studio/contracts/theme-message.mdnew file mode 100644index 00000000..3a291151--- /dev/null+++ b/specs/014-remote-studio/contracts/theme-message.md@@ -0,0 +1,36 @@+# Contract: the `theme` message (Nota → phone)++Sent over the Remote WebSocket, as one text frame of JSON.++```json+{+ "t": "theme",+ "on": "studio-dark",+ "dark": "ember-graphite",+ "light": "studio-light",+ "ink": ["#17181A", "#FFFFFF"],+ "th": {+ "studio-dark": { "name": "Studio Dark", "dark": true, "c": { "BgApp": "#1E1F22", "ShadowBevel": "#FFFFFF12", "…": "…" } },+ "ember-graphite": { "name": "Ember Graphite", "dark": true, "c": { "…": "…" } },+ "studio-light": { "name": "Studio Light", "dark": false, "c": { "…": "…" } }+ }+}+```++| Field | Meaning |+|---|---|+| `on` | The theme Nota is wearing now (Follow Nota wears it) |+| `dark` / `light` | The user's dark-mode and light-mode picks (Follow phone wears them) |+| `ink` | The dark and light inks text on a solid fill is chosen from |+| `th` | Each theme named by `on` / `dark` / `light`, once: name, kind, every token |+| `c` | Token name (as in `Theme/Themes/*.json`) → CSS hex; translucent tokens as `#RRGGBBAA` |++## Rules++- **T1** Sent to a phone right after `welcome`, before `proj`, and again whenever any field+ changes. Never re-sent unchanged.+- **T2** `th` holds exactly the distinct ids among `on`, `dark`, `light`.+- **T3** Every theme in `th` carries the full token catalogue.+- **T4** The phone ignores tokens it does not use and keeps its current value for a token a+ theme lacks.+- **T5** `proj.dark` stays, equal to `th[on].dark`, for pages from an older Nota.diff --git a/specs/014-remote-studio/contracts/ui-contract.md b/specs/014-remote-studio/contracts/ui-contract.mdnew file mode 100644index 00000000..468afcae--- /dev/null+++ b/specs/014-remote-studio/contracts/ui-contract.md@@ -0,0 +1,42 @@+# Contract: Studio on the phone++What each phone surface becomes. Variables are the theme tokens in kebab case+([theme-message.md](theme-message.md)); `ink-on-*` are derived+([data-model.md](../data-model.md)).++## Shared++| Thing | At rest | Live / chosen |+|---|---|---|+| Ground | `bg-app` | — |+| Docked bar (header, banner, tab bar, rail) | `bg-app` / `panel`, a 1 px `seam` edge to its neighbour, radius 0 | — |+| Button `.btn` | `surface-raised`, 1 px `seam` border, bevel `inset 0 1px 0 shadow-bevel`, radius 3, `text-strong` 12/500 | on: solid `accent`, `ink-on-accent`, no bevel · pressed: `bg-sunken`, no bevel |+| Segmented `.seg` | keys `surface-raised` butted on 1 px `seam`, group radius 3, outer corners only | chosen: solid `accent`, `ink-on-accent`, weight unchanged |+| Field / readout | `bg-sunken`, 1 px `rule` edge, radius 3, mono value | focus: edge `accent` |+| Switch | 28 × 16, radius 2, squared knob 12; off `bg-sunken` track + `text-tertiary` knob | on: `accent` track + `panel` knob |+| Section label `.label` | Geist 600 · 11, `text-muted`, sentence case, no tracking | — |+| Row | 52 tall, `rule` divider, radius 0 inside its sheet | selected: `surface-hover` + 2 px `accent` tick |+| Badge (You, a name, "Anna has it") | `bg-sunken`, radius 2, `text-secondary` 10/600 | — |+| Popover sheet, toast | `surface-raised`/`panel`, radius 3, `0 0 0 1px seam, 0 10px 28px shadow-popover` | — |+| Scrim | `shadow-modal` | — |+| Numbers | Geist Mono, tabular; U+2212 minus; thin space before units | — |+| Icons | inline SVG, stroke 1.5, round caps and joins, `currentColor` | — |++## Screens++| Surface | Change |+|---|---|+| Header | Track button raised with seam; colour bar 3 px radius 1; position readout a well with rule edge; Stop / Play / Record keys raised; Play on = solid accent; Record at rest = raised key with a `record` disc, on or counting in = solid `record` with a `record-ink` disc; link dot `success` / `warning` / `danger` |+| Banner | `panel` strip, `seam` below; MIDI Learn: an `accent` dot, title `text-primary`, sub `text-secondary`; reconnecting: `text-muted` dot |+| Screen tabs (portrait) | Ghost keys on the bar; selected = `text-primary` + 2 px `accent` line on the edge facing the screen |+| Rail (landscape, tablet) | Ghost rows; selected = `surface-hover` + 2 px `accent` tick |+| Pads | Tiles radius 3, raised with seam + bevel; under the finger = solid `accent`, `ink-on-accent`; played by the track = solid track colour, derived ink; note numbers mono `text-tertiary` |+| Keys | White keys `key-white`, black keys `key-black` with a `seam` edge, free-end corners 2; held = `accent` with `ink-on-accent`; lit band = track colour; scale cells and chords tiles radius 3; tonic cells `surface-hover`; key-source tag and chord numerals neutral (`text-muted`) |+| XY | A graph field: `bg-sunken`, 1 px `rule` frame, radius 3, `viz-grid` lines; crosshair `rule` at rest; point a `viz-ink` ring at rest — `accent` while dragged or under tilt; no fill under the point; axis labels mono `text-faint` in the corners; "Tilt is moving the point" an `accent` chip with `ink-on-accent` |+| Mixer | Strips `panel`, meeting on 1 px `seam`; group strips `bg-sunken`; fader slot a well; cap raised with seam + bevel, its line `text-primary` → `accent` while dragged; pan dot `viz-ink` → `accent` while dragged; dB mono, `accent-bright` while dragged; meters `success` → `warning` (−6 dB) → `danger` (0 dB); M on = solid `mute` + `ink-on-mute`, S on = solid `solo` + `ink-on-solo`, Arm on = solid `record` + `ink-on-record`; "Master" a label |+| Macros | Cells radius 3 on `panel`; knob: groove `bg-sunken` r21 stroke 5, face `surface-raised` r14 with a `seam` edge, value arc `viz-ink` → `accent` while dragged, pointer `text-primary`; name sentence case as the parameter is named (no forced caps); automated dot `text-muted` |+| Scenes | Clip slots radius 2; filled = raised; playing / queued = solid track colour with derived ink (queued blinks); recording = solid `record` + `ink-on-record`; progress line in the clip's ink; empty = `bg-sunken`; status words sentence case |+| Big transport | Keys radius 3, raised; Play on, Loop on, Click on = solid `accent`; Record on = solid `record`; position mono `text-primary` (`record` while recording); sections: current = 2 px `accent` tick, looping = solid `accent`; "Bar 5" / "Looping" sentence case |+| Covers (down, pair, left) | Full-screen `bg-app`, radius 0; steps list `panel` rows with `rule` dividers, radius 3; step numbers mono `text-muted`; code cells wells with `rule` edge, current = `accent` edge, caret `accent`; "Connect again" an ordinary raised key, 600 |+| Count-in | `bg-app`; the number mono `accent-bright`; caption sentence case in `record` |+| Empty (audio track) | Centred; title `text-primary` 13/600, line `text-tertiary`, an ordinary key |diff --git a/specs/014-remote-studio/data-model.md b/specs/014-remote-studio/data-model.mdnew file mode 100644index 00000000..6794441d--- /dev/null+++ b/specs/014-remote-studio/data-model.md@@ -0,0 +1,58 @@+# Data model: Nota Remote theme++## Host side (`Nota.Remote`, implemented by `Nota.App`)++### `RemoteTheme` (record)++| Field | Type | Rule |+|---|---|---|+| `Id` | string | A built-in theme id (`studio-dark` …) |+| `Name` | string | Display name ("Studio Dark") |+| `Dark` | bool | The theme's kind |+| `Colors` | `IReadOnlyDictionary<string, string>` | Every catalogue token → CSS hex: `#RRGGBB`, or `#RRGGBBAA` when translucent |++### `RemoteAppearance` (record)++| Field | Type | Rule |+|---|---|---|+| `Active` | `RemoteTheme` | The theme Nota is wearing now (`NotaPalette.Theme`) |+| `DarkPick` | `RemoteTheme` | `NotaThemeService.Choice.Dark` |+| `LightPick` | `RemoteTheme` | `NotaThemeService.Choice.Light` |+| `Ink` | `(string Dark, string Light)` | `NotaPalette.InkDark` / `InkLight` as CSS hex |++Identity: the app returns the **same instance** until the worn theme or the choice changes+(cache key `(NotaPalette.Theme, NotaThemeService.Choice)`); `RemoteTheme` instances are+cached per theme id. The hub relies on reference identity for change detection.++`IRemoteHost.DarkTheme` is replaced by `IRemoteHost.Appearance`. The `proj` message keeps+`dark` (now `Appearance.Active.Dark`) for a page cached from an older Nota.++### `RemoteClient.SentTheme`++The theme JSON string last sent to that phone (reference-compared). Null on a new+connection, so a phone always gets the theme first.++## Phone side (`src/web/remote/src/lib/theme.svelte.ts`)++### `ThemeMessage` (as received, see [contracts/theme-message.md](contracts/theme-message.md))++### Look state++| Field | Source | Notes |+|---|---|---|+| `msg` | last `theme` message, or the stored one | Persisted as `nota-remote:theme` |+| `phoneDark` | `matchMedia('(prefers-color-scheme: dark)')`, live | |+| `legacyDark` | `proj.dark` when no `theme` message was ever received | Older Nota only |+| `worn` | derived | `prefs.theme === 'phone'` → `msg.dark` / `msg.light` by `phoneDark`; else `msg.on`. No `msg` → the fallback (Studio Dark, or Studio Light when `legacyDark === false`) |+| `vars` | derived from `worn` | Every token as `--kebab-case`, plus the derived `--ink-on-*` |++Applying `vars`: set each on `document.documentElement.style`, set `data-theme` to+`dark` / `light` (drives `color-scheme`), set `meta[name=theme-color]` to `--bg-app`, and+store the resolved map as `nota-remote:vars` for the head script.++### Derived variables++| Variable | Rule |+|---|---|+| `--ink-on-accent` / `--ink-on-mute` / `--ink-on-solo` / `--ink-on-record` / `--ink-on-success` | `inkOn(fill)`: of `ink.dark` and `ink.light`, the one with the higher WCAG contrast against the fill (ties → dark), as `NotaPalette.ReadableInkOn` |+| Per-track ink | `inkOn(track.color)`, computed in the component for track-colour fills |diff --git a/specs/014-remote-studio/plan.md b/specs/014-remote-studio/plan.mdnew file mode 100644index 00000000..924fcfe1--- /dev/null+++ b/specs/014-remote-studio/plan.md@@ -0,0 +1,164 @@+# Implementation Plan: Nota Remote in Studio, wearing the app's theme++**Branch**: `feat/remote-studio` | **Date**: 2026-10-15 | **Spec**: [spec.md](spec.md)++**Input**: Feature specification from `specs/014-remote-studio/spec.md`++## Summary++Nota tells each phone the colours of the theme it wears, and the user's dark-mode and+light-mode picks, in a new `theme` message built from the theme files; the phone sets them+as CSS custom properties named after the tokens and re-applies on every change, on a+Follow-phone scheme flip, and from storage on first paint. A build-time fallback generated+from `studio-dark.json` / `studio-light.json` means the phone sources hold no colour. Every+phone surface is restyled to Studio per [contracts/ui-contract.md](contracts/ui-contract.md).+The smoke test checks the message and guards the phone sources.++## Nota: Read Before Planning++- **UI work** → [`DESIGN.md`](../../DESIGN.md) (Studio design language) and the `nota-design` skill.+- **Anything** → [`CONTRIBUTING.md`](../../CONTRIBUTING.md): licensing, dependency policy, PR expectations.++## Technical Context++**Language/Version**: C# / .NET 10 (hub, app host), TypeScript 6 + Svelte 5 (phone page)++**Primary Dependencies**: none new. Vite 8, Svelte 5, svelte-check (existing dev+dependencies of `src/web/remote`).++**Storage**: the phone's `localStorage` (`nota-remote:theme`, `nota-remote:vars`).++**Audio-Thread Impact**: None. The hub builds messages on the UI tick+(`RemoteHub.Tick`, UI thread); the app reads theme objects on the UI thread. Nothing+reaches the engine.++**Testing**: `tests/Nota.SmokeTest` — `RemoteTests.Session` (real WebSocket against+`RemoteServer` with a fake host) and a new `DesignTokenCheck.Remote` source check;+`svelte-check`; screenshots at phone width.++**Target Platform**: Nota on macOS / Windows / Linux; the page on iOS Safari 16+ and+Chrome 100+ (the Vite build target).++**Project Type**: desktop app + embedded web page.++**Performance Goals**: theme change on the phone < 1 s after the desktop switches+(SC-002); Follow-phone flip < 100 ms (SC-003); zero per-tick cost when nothing changed.++**Constraints**: no colour literal in the phone sources; touch sizes and behaviour+unchanged; the page bundle stays small (the theme module adds well under 2 KB).++**Scale/Scope**: ~1,700 lines of Svelte across 13 components and screens, ~60 lines of+C# in the hub and app, one smoke-test section.++## Constitution Check++| Principle | Status |+|---|---|+| I. Real-time audio safety | ✅ No audio-thread code touched |+| II. Boundary discipline | ✅ No C ABI change; no JUCE |+| III. Licensing hygiene | ✅ New files carry the SPDX header; no new dependency |+| IV. Verification gate | ✅ Smoke test extended (theme message + phone-source guard); `scripts/build.sh` before the PR |+| V. One logical change | ✅ One feature: the phone matches the app (theme + restyle), stacked on `feat/studio-ui` |+| VI. Docs in sync | ✅ CHANGELOG [Unreleased], FEATURES.md, DESIGN.md (Remote note), user manual via nota-docs |+| VII. Spec first | ✅ This spec, plan, tasks |+| VIII. Rules not weakened | ✅ |++Post-design re-check: unchanged — the design adds one host property, one message, one+phone module, one Vite plugin and one guard.++## Design++### Host → hub (`Nota.Remote/RemoteContracts.cs`, `Nota.App/MainWindow.Remote.cs`)++- New records `RemoteTheme` and `RemoteAppearance` ([data-model.md](data-model.md)).+- `IRemoteHost.DarkTheme` → `IRemoteHost.Appearance`.+- App: build a `RemoteTheme` per `NotaColourTheme` once (dictionary by id, CSS hex), and a+ `RemoteAppearance` cached on `(NotaPalette.Theme, NotaThemeService.Choice)`.+- `NotaPalette.InkDark` / `InkLight`: the two inks `ReadableInkOn` already uses, named.++### Hub (`Nota.Remote/RemoteHub.State.cs`, `RemoteClient.cs`)++- `ThemeJson(host)`: serialise the appearance when its reference changed; keep the+ string. `Push` sends it first, before `proj`, when it is not the string the phone last+ got (`RemoteClient.SentTheme`, reference comparison).+- `proj.dark` = `Appearance.Active.Dark` (kept for older pages).++### Phone (`src/web/remote`)++- `src/lib/palette.ts` (pure, also imported by the Vite config): `cssName(token)`,+ `inkOn(fill, ink)`, `cssVars(colors, ink)` → `{ '--bg-app': '#…', …, '--ink-on-accent': … }`.+- `theme-plugin.ts` (Vite plugin, beside `vite.config.ts`): resolves+ `virtual:nota-theme.css` to `:root{…}` from `studio-dark.json` and+ `[data-theme='light']{…}` from `studio-light.json`; watches both files.+- `src/lib/theme.svelte.ts`: `Look` — the stored message, the phone scheme listener,+ `worn(prefs)`, `apply()`, `inkOn(hex)` for track fills. `app.svelte.ts` handles+ `t: 'theme'` and drops `get dark`.+- `index.html`: a head script applying `nota-remote:vars` before first paint.+- `app.css`: the Ember palette blocks go; shared styles (`.btn`, `.seg`, `.switch`, `.label`,+ `.mono`) rewritten per the UI contract; `.caps` removed.+- Every component and screen restyled per [contracts/ui-contract.md](contracts/ui-contract.md).+- `mock/nota-mock.mjs` (`npm run mock`): a dependency-free stand-in Nota (static server ++ hand-rolled WebSocket) that serves `wwwroot` with a demo project and real theme+ messages, for screenshots and design review without the desktop app.++### Tests++- `RemoteTests`: `FakeHost.Appearance` with two switchable appearances; checks T1–T3 and+ "not re-sent unchanged".+- `DesignTokenCheck.Remote`: the phone-source guard (research R10).++## Project Structure++### Documentation (this feature)++```text+specs/014-remote-studio/+├── spec.md+├── plan.md+├── research.md+├── data-model.md+├── quickstart.md+├── contracts/+│ ├── theme-message.md+│ └── ui-contract.md+├── checklists/requirements.md+└── tasks.md+```++### Source Code++```text+src/managed/+├── Nota.Remote/+│ ├── RemoteContracts.cs # RemoteTheme, RemoteAppearance, IRemoteHost.Appearance+│ ├── RemoteHub.State.cs # theme message, proj.dark from Appearance+│ └── RemoteClient.cs # SentTheme+│ └── wwwroot/ # rebuilt bundle+└── Nota.App/+ ├── MainWindow.Remote.cs # IRemoteHost.Appearance+ └── Theme/NotaPalette.cs # InkDark / InkLight+src/web/remote/+├── index.html # first-paint head script+├── package.json # "mock" script+├── theme-plugin.ts # virtual:nota-theme.css from the theme files+├── vite.config.ts+├── mock/nota-mock.mjs+└── src/+ ├── app.css+ ├── main.ts+ ├── App.svelte+ ├── lib/{palette.ts, theme.svelte.ts, app.svelte.ts, types.ts}+ ├── components/{Header, Banner, Sheets, Overlays}.svelte+ └── screens/{Pads, Keys, XY, Mixer, Macros, Scenes, BigTransport, Empty}.svelte+tests/Nota.SmokeTest/+├── RemoteTests.cs+├── DesignTokenCheck.Remote.cs+└── Program.cs # registers the new section+```++**Structure Decision**: existing projects only; one new phone module pair, one Vite+plugin file, one dev mock, one smoke-test partial.++## Complexity Tracking++None.diff --git a/specs/014-remote-studio/quickstart.md b/specs/014-remote-studio/quickstart.mdnew file mode 100644index 00000000..fee0ea2b--- /dev/null+++ b/specs/014-remote-studio/quickstart.md@@ -0,0 +1,51 @@+# Quickstart: verifying Nota Remote in Studio++## Prerequisites++As for any Nota build ([`BUILD.md`](../../BUILD.md)), plus Node for the phone page.++## 1. Automated gate++```bash+cd src/web/remote && npm ci && npm run check && npm run build && cd -+scripts/build.sh+```++Expect:+- `svelte-check found 0 errors and 0 warnings`.+- `vite build` writes `src/managed/Nota.Remote/wwwroot` (index.html, assets/, fonts/,+ icons/, sw.js, manifest, keepawake.mp4).+- In the smoke test's Remote section: the phone receives a `theme` message right after+ `welcome` naming the active theme and both picks, with every catalogue token per theme+ ([contracts/theme-message.md](contracts/theme-message.md) T1–T3); a host theme change+ sends it once more; an unchanged one does not.+- In the design section: the phone-source checks (no colour literal outside the generated+ fallback, no tracking, no forced caps, radii 0–4).++## 2. Manual: Follow Nota (US1)++1. Run Nota, turn Remote on, pair a phone (or a desktop browser at 390 × 844 — the+ in-app browser or Chrome device mode).+2. Preferences → Appearance → pick each of Studio Dark, Studio Light, Ember Graphite,+ Ember Paper. The phone follows within a second each time; a held pad keeps sounding.+3. Follow system in Nota, flip the OS appearance: the phone follows.++## 3. Manual: Follow phone (US2)++1. In Nota set In dark mode = Ember Graphite, In light mode = Studio Light.+2. On the phone: ⋯ → Theme → Follow phone. Flip the phone's (or the browser's emulated)+ colour scheme. The page switches at once to the matching pick.+3. Change a pick in Nota: the phone updates.++## 4. Manual: first paint++Reload the page with Nota closed: the "Nota isn't responding" cover appears in the last+theme worn, with no flash. Clear site data and reload: Studio Dark.++## 5. Screenshots without a running Nota++`npm run mock` (in `src/web/remote`) serves the built page with a stand-in Nota that speaks+the Remote protocol with a fixed demo project and the real theme files. Open+`http://127.0.0.1:7790/#p=1234` at phone width. `?theme=studio-light` (any built-in id)+picks the theme the stand-in wears, `?pick=ember-graphite,studio-light` its dark-mode and+light-mode picks, and `?legacy=1` makes it an older Nota that sends only `dark`.diff --git a/specs/014-remote-studio/research.md b/specs/014-remote-studio/research.mdnew file mode 100644index 00000000..7597f0e7--- /dev/null+++ b/specs/014-remote-studio/research.md@@ -0,0 +1,103 @@+# Research: Nota Remote in Studio++## R1. What the hub sends: the full token set, three themes, on change++- **Decision**: a dedicated `theme` message carries the active theme, the dark-mode pick and+ the light-mode pick (deduplicated by id), each with **every** catalogue token, plus the+ derived-ink pair. Sent to a phone when it connects and when the host's appearance changes.+- **Rationale**: the phone can use any token without a C# change, so the theme files stay+ the one place a colour lives and adding a CSS use is a phone-only edit. Size: ~110+ tokens × ~24 bytes ≈ 2.6 KB per theme, ≤ 3 themes ≈ 8 KB, once per change on a LAN.+ Sending the picks lets Follow phone switch instantly (SC-003) without a round trip.+- **Alternatives**: (a) a phone-side subset list mirrored in C# — two lists to keep in step;+ (b) put the colours in the `proj` message — it is rebuilt and compared every few ticks,+ so 8 KB would be re-serialised constantly; (c) only the active theme — Follow phone+ would need a request/response.++## R2. Change detection without per-tick cost++- **Decision**: `IRemoteHost.Appearance` returns a cached `RemoteAppearance` object that the+ app replaces only when the worn theme or the appearance choice changes. The hub keeps+ the JSON for the last object it saw and compares by reference, per hub and per phone.+- **Rationale**: the hub ticks at 30 Hz; a reference check is free, and serialising happens+ once per change. `AppearanceChoice` is a record (value equality) and the worn theme is+ `NotaPalette.Theme` (one instance per theme), so the app's cache key is exact.+- **Alternatives**: an event from `NotaThemeService` — would need the hub to subscribe+ across the app/remote boundary; string comparison of 8 KB per phone per tick — wasteful.++## R3. Colours in CSS form++- **Decision**: the app formats each colour as CSS hex — `#RRGGBB`, or `#RRGGBBAA` for the+ translucent shadow tokens (Avalonia's `#AARRGGBB` reordered). The phone sets each token+ as a custom property named after it in kebab case: `BgApp` → `--bg-app`,+ `SystemAccentLight1` → `--system-accent-light1`.+- **Rationale**: one mechanical rule, no mapping table; CSS reads the names as the desktop+ code does (`--surface-raised` ↔ `SurfaceRaised`).++## R4. Derived ink++- **Decision**: the phone computes ink on a solid fill exactly as `NotaPalette.ReadableInkOn`+ does — the WCAG contrast of a dark and a light ink against the fill, the better one wins.+ Nota sends the ink pair in the theme message (`ink: [dark, light]`, from+ `NotaPalette.InkDark` / `InkLight`, two named constants factored out of+ `ReadableInkOn`). The phone exposes `--ink-on-accent`, `--ink-on-mute`, `--ink-on-solo`,+ `--ink-on-record`, `--ink-on-success` and computes per-track ink for track-colour fills.+- **Rationale**: identical result to the desktop; no ink literal in the phone.+- **First paint**: before any message, the pair is Studio Dark's `TextOnAccent` and+ `ShadeUp`, which are exactly the desktop's two inks; the fallback generator reads them+ from `studio-dark.json`.++## R5. First paint without a flash and without literals++- **Decision**: three layers.+ 1. **Fallback CSS generated at build time** from `studio-dark.json` (`:root`) and+ `studio-light.json` (`[data-theme='light']`, for a Nota that sends only `dark`) by a+ small Vite plugin, imported as `virtual:nota-theme.css`. The phone sources hold no+ colour value; the bundle does.+ 2. **The last worn theme**, stored on the phone (`localStorage`), applied by a short+ inline script in `index.html`'s head before first paint.+ 3. **Live**: the `theme` message, applied as it arrives.+- **Rationale**: a returning phone paints in its last theme on the first frame; a new one+ in Studio Dark, the desktop's default; a value change in a theme file reaches the+ fallback on the next `npm run build`.+- **Alternatives**: hand-copied fallback values — the drift that left the phone in Ember;+ a `prefers-color-scheme` fallback — Nota's default is Studio Dark regardless of OS.++## R6. Follow phone++- **Decision**: a `matchMedia('(prefers-color-scheme: dark)')` listener holds the phone's+ scheme as reactive state; the worn theme is `prefs.theme === 'phone' ? (dark ? picks.dark+ : picks.light) : on`. Changing the scheme, the preference or receiving a message+ re-applies at once.+- **Rationale**: today's `app.dark` reads `matchMedia` once per evaluation and does not+ react to a scheme change; the listener fixes that (SC-003).++## R7. Browser chrome++- **Decision**: `meta[name=theme-color]` takes the worn theme's `BgApp`; `color-scheme`+ follows the theme's kind; the manifest keeps its static colours (only used on install).++## R8. Restyle scope and the phone's sizes++- **Decision**: Studio's colour, case, corner, seam, elevation and type-family rules apply+ to every phone surface; its desktop control heights (26 px) and the 13 px shell cap do+ not — touch targets stay 36–56 px and phone type 10–16 px (bigger for position and+ count-in). Icons stay inline SVG with the shared stroke (round caps and joins, 1.5 px).+- **Rationale**: FR-018 (behaviour and layout unchanged) and the spec's assumptions.++## R9. Meters++- **Decision**: meter fills keep Studio's zones — `Success` up to −6 dB, `Warning` to 0 dB,+ `Danger` above — as hard colour stops on a full-height bar, clipped to the level. The+ hub maps −60…+6 dBFS onto 0…1, so −6 dB sits at 54/66 and 0 dB at 60/66.+- **Rationale**: matches `MeterBar`; hard stops are zones, not a decorative gradient.++## R10. Guarding the rules++- **Decision**: extend the smoke test with a phone-source check (in `DesignTokenCheck`):+ no hex / `rgb(` / `rgba(` colour in `src/web/remote/src` outside the theme module's+ fallback import, no `letter-spacing` other than 0, no `text-transform: uppercase`, no+ `.toUpperCase()` on a label, and `border-radius` values only 0 / 1 / 2 / 3 / 4 px or+ 50 % (round dots). Plus the hub's theme message (RemoteTests).+- **Rationale**: the same ratchet idea the desktop uses; it keeps the phone from drifting+ back.diff --git a/specs/014-remote-studio/spec.md b/specs/014-remote-studio/spec.mdnew file mode 100644index 00000000..958b0a99--- /dev/null+++ b/specs/014-remote-studio/spec.md@@ -0,0 +1,302 @@+# Feature Specification: Nota Remote in Studio, wearing the app's theme++**Feature Branch**: `feat/remote-studio`++**Created**: 2026-10-15++**Status**: Draft++**Input**: User description: "Nota Remote (the phone web app Nota serves on the local network, src/web/remote) matches the desktop app: it wears the app's current colour theme, live, and is restyled to the Studio design language. (1) Live theme colours: instead of the hub sending only a `dark` boolean and the phone choosing between two hard-coded Ember palettes, the hub sends the active theme's token values (from Theme/Themes/*.json) and the phone applies them as CSS variables, updating live when the user changes theme in Preferences → Appearance (including when Follow system flips). The phone's own "Follow phone" preference uses the user's dark-mode and light-mode theme picks. No colour values hard-coded in the phone beyond a first-paint fallback. (2) Studio restyle of every phone screen and sheet: sentence-case labels without letter-spacing, seams between panels, radii 2/3/4, neutral values at rest with the accent only for what is live or chosen, mute amber / solo blue / arm red with derived ink, Geist for words and Geist Mono for numbers. (3) The built bundle in Nota.Remote/wwwroot is rebuilt and svelte-check stays clean; the smoke test covers the theme payload."++## Nota Context *(fill in — drives plan and tasks)*++**Feature area** *(pick the main one)*:++- [ ] Engine (C++, `src/native/nota.engine`) — real-time audio rules apply, see `ARCHITECTURE.md` AR table+- [ ] Managed app (C#, `src/managed/*`) — domain, application, infrastructure, presentation+- [x] UI (Avalonia, `src/managed/Nota.Presentation`) — follow `DESIGN.md` (Studio)+- [ ] Plugin hosting (`pluginhost/`) — the only place JUCE is allowed+- [ ] Build / packaging / CI (`scripts/`, `.github/`) — see `BUILD.md`+- [ ] Docs only++The UI here is Nota Remote's web page (`src/web/remote`), plus a small change to what+Nota Remote's hub (`src/managed/Nota.Remote`) tells the phone and what the app+(`src/managed/Nota.App`) hands the hub.++**Nota docs to keep in mind** *(links relative to `specs/<slug>/`, where this file lands)*:+[`ARCHITECTURE.md`](../../ARCHITECTURE.md) (AR rules),+[`CONTRIBUTING.md`](../../CONTRIBUTING.md) (licensing, dependency policy, PR+expectations), [`BUILD.md`](../../BUILD.md), [`DESIGN.md`](../../DESIGN.md),+[`FEATURES.md`](../../FEATURES.md).++**Depends on**: [`010-studio-visual-style`](../010-studio-visual-style/spec.md) and+[`011-colour-themes`](../011-colour-themes/spec.md) (the Studio design language and colour+themes as data). This feature branches from `feat/studio-ui` and lands after it.++**Current state (for reference)**:++- The desktop app wears one of four colour themes (Studio Dark — the default — Studio+ Light, Ember Graphite, Ember Paper) or follows the OS with a dark-mode and a light-mode+ pick. Every colour lives in the theme files; the switch is live.+- Nota Remote was never restyled. It still wears the old Ember look: warm browns and a+ brass accent, two palettes hard-coded in the page. Nota tells the phone only whether it+ is dark or light, so a phone next to a Studio-themed Nota looks like another app.+- The phone has its own theme preference in its ⋯ menu: **Follow Nota** (the default) or+ **Follow phone** (the phone's own dark/light mode). Today Follow phone picks one of the+ two Ember palettes.+- The page uses tracked uppercase labels ("PLAY ON TRACK", "MASTER", "ARM", "BAR 5"),+ rounded corners of 5–8 px, an accent for resting values (knob arcs, XY lines, the scale+ key source tag), a wash-tinted brass for toggles that are on, and grey/accent instead of+ the semantic mute and solo colours.++## User Scenarios & Testing *(mandatory)*++### User Story 1 — The phone wears the theme Nota wears (Priority: P1)++A musician has Nota in Studio Dark and opens Nota Remote on their phone. The phone shows+the same greys, the same orange accent, the same track colours as the computer. They+switch Nota to Ember Paper in Preferences → Appearance; within a moment the phone turns+to Ember Paper too, without a reload and without dropping a held note.++**Why this priority**: it is the visible mismatch that prompted the feature, and it is+what makes the phone read as part of Nota.++**Independent Test**: with a phone (or a phone-width browser) connected and set to+Follow Nota, pick each built-in theme in Preferences → Appearance in turn and check the+phone's ground, panels, text and accent match the desktop's for that theme.++**Acceptance Scenarios**:++1. **Given** Nota in any built-in theme and the phone set to Follow Nota, **When** the+ phone connects, **Then** its first screen already wears that theme.+2. **Given** a connected phone, **When** the user picks another theme in Preferences →+ Appearance, **Then** the phone changes to it within one second, with no reload and the+ current screen, held notes and fader positions unaffected.+3. **Given** Nota set to Follow system, **When** the computer's OS switches between dark+ and light mode, **Then** the phone follows the theme Nota switches to.+4. **Given** the phone set to Follow Nota, **When** Nota's theme is light, **Then** the+ browser chrome tint (status bar, address bar where the browser shows one) matches the+ page's ground, not a dark colour.++---++### User Story 2 — Follow phone uses the user's own theme picks (Priority: P1)++A musician keeps Nota in Studio Dark but prefers their phone to follow its own dark/light+mode. In Preferences → Appearance they have picked Ember Graphite for dark mode and Studio+Light for light mode. With the phone on Follow phone, it wears Ember Graphite while the+phone is in dark mode and Studio Light when the phone turns light at sunrise.++**Why this priority**: the phone already offers Follow phone; without this it would fall+back to hard-coded colours that match no theme.++**Independent Test**: set distinct dark-mode and light-mode picks in Nota, set the phone+to Follow phone, switch the phone (or the browser's emulated colour scheme) between dark+and light, and check each time that the phone wears the matching pick.++**Acceptance Scenarios**:++1. **Given** Follow phone and a phone in dark mode, **When** connected, **Then** the phone+ wears the user's dark-mode pick, whatever Nota itself is wearing.+2. **Given** Follow phone, **When** the phone switches between dark and light mode,+ **Then** the page switches between the dark-mode and light-mode picks at once, without+ waiting for Nota.+3. **Given** Follow phone, **When** the user changes either pick in Preferences →+ Appearance, **Then** the phone updates live.+4. **Given** the user switches the phone's menu between Follow Nota and Follow phone,+ **Then** the page changes at once to the theme the new choice names.++---++### User Story 3 — Every phone screen reads as Studio (Priority: P2)++On every screen — Pads, Keys, XY, Mixer, Macros, Scenes, the big transport, the header,+the sheets (tracks, menu, key, devices), the pairing and connection covers, the count-in+and the toast — the phone follows the same rules the desktop app does: sentence-case labels+with no letter-spacing, flat panels meeting on 1 px seams, small square-ish corners, values+at rest drawn neutral with the accent only for what is playing, held, chosen or on, mute+amber, solo blue, arm and record red with ink derived from the fill, Geist for words and+Geist Mono for numbers.++**Why this priority**: the theme colours alone would still sit in Ember's shapes and+conventions (brass washes, tracked caps, accent knob arcs); the restyle completes the match.++**Independent Test**: screenshot every screen at phone width in Studio Dark and Studio+Light and review each against `DESIGN.md` § The rules.++**Acceptance Scenarios**:++1. **Given** any screen, **When** reviewed, **Then** no label is set in tracked capitals;+ capitals remain only for acronyms and units (BPM, MIDI, USB, dB), note names, Roman+ chord numerals, the axis letters X / Y and the M / S keys.+2. **Given** a toggle that is on (Play while playing, Loop, Click, Repeat, Full velocity,+ Expressive, Tilt, Follow), a chosen segment, the selected track row or a pad or key+ under the finger, **Then** it shows the accent, solid, with derived ink; **and** no+ element at rest (a knob arc, a fader, the XY crosshair, a resting pad, a tag) does.+3. **Given** the Mixer, **When** a track is muted, soloed or armed, **Then** the key turns+ solid amber, blue or red respectively with readable derived ink.+4. **Given** any surface, **Then** corners are 0, 2 or 3 px (4 is reserved for modals,+ which the phone has none of), panels and strips meet on seams, and no gradient, glow+ or inset dark shadow remains.++---++### User Story 4 — The theme travels with the build (Priority: P3)++A contributor changes a value in a theme file or adds a theme. The phone picks it up with+no edit to the phone app, and the build's smoke test checks that the phone is told the+theme's colours.++**Why this priority**: keeps the theme files the one place a colour lives, as on the+desktop.++**Independent Test**: the smoke test connects a phone over a real socket and checks the+theme message it receives.++**Acceptance Scenarios**:++1. **Given** the smoke test, **When** a phone connects, **Then** it receives a theme+ message naming the active theme, whether it is dark, and a value for each token the+ phone uses.+2. **Given** the host's theme changes, **When** the hub ticks, **Then** connected phones+ receive the new theme once, and an unchanged theme is not re-sent.++### Edge Cases++- **First paint before Nota answers** (the page opens, the socket is still connecting, the+ pairing cover, "Nota isn't responding"): the phone wears the last theme it received if+ it has one stored, otherwise a built-in Studio Dark fallback. No flash of Ember.+- **Follow phone before connection**: the phone uses the stored dark/light picks it last+ received; with none stored, the fallback.+- **An older Nota** (one that sends only `dark`): the phone wears the fallback, switching+ to the Studio Light fallback values when `dark` is false. *(Assumption: Nota serves its+ own page, so this only arises with a cached page; a reload heals it.)*+- **Track colours under Follow phone**: Nota sends each track's colour as it draws it, in+ Nota's active theme. When the phone wears a different theme, track colours stay Nota's.+ Track hues share one lightness across themes, so they stay readable on either ground.+- **A track-colour fill** (a pad the track plays, a playing or queued clip): the ink on it is+ derived from the fill, never fixed.+- **A theme file with a token the phone does not use, or a future token**: ignored by the+ phone. A token the phone uses but the message lacks keeps the fallback value.+- **The phone's own system colour scheme changes while backgrounded**: on return the page+ wears the right pick.++## Requirements *(mandatory)*++### Functional Requirements++**Theme on the phone**++- **FR-001**: Nota MUST tell each connected phone the colours of the theme it is wearing+ (its id, whether it is dark, and the values of the colour tokens the phone uses), when+ the phone connects and whenever the active theme changes — plus the two inks the desktop+ derives text on a solid fill from (dark and light), so the phone derives ink as Nota does.+- **FR-002**: Nota MUST also tell the phone the user's dark-mode and light-mode theme picks+ (with their colours), so Follow phone can wear them without asking Nota.+- **FR-003**: The phone MUST apply the theme by setting its colour variables from the+ message — no reload, no change to screen, held notes or controls.+- **FR-004**: Follow Nota MUST wear Nota's active theme; Follow phone MUST wear the dark-mode+ pick while the phone's colour scheme is dark and the light-mode pick while it is light,+ switching at once when either the phone's scheme or a pick changes.+- **FR-005**: The phone MUST NOT hold colour values of its own beyond a first-paint+ fallback (Studio Dark, with Studio Light for a light fallback). Every colour the page+ paints MUST come from a theme variable or be derived from one (a wash, a derived ink).+- **FR-006**: The phone MUST remember the last theme message it received and wear it on+ the next open until Nota answers.+- **FR-007**: The browser chrome tint MUST follow the worn theme's ground colour.+- **FR-008**: The theme message MUST be sent only when it changes (per phone), not on every+ tick.++**Studio on the phone**++- **FR-009**: Every label on the phone MUST be sentence case with no letter-spacing;+ capitals stay only on acronyms and units, product names ("Nota", "Nota Remote"), note+ names, Roman numerals, axis letters and the M / S key letters. The tracked-caps style+ is removed.+- **FR-010**: Corners MUST be 2 px (rows, inner keys, clips, badges, switch tracks), 3 px+ (buttons, fields, segmented groups, tiles — pads, scale cells, chords, macro cells —+ graph fields, popover sheets, the toast) or 4 px (modals only); docked bars, strips and+ full-screen covers 0. The piano keys' free ends keep the 2 px key corner.+- **FR-011**: Docked areas (header, banner, tab bar, rail, mixer strips, sheets) MUST meet on+ 1 px seams; items inside a panel MUST be divided by 1 px rules. No gradients, glows or+ inset black shadows; a raised control carries the theme's top bevel.+- **FR-012**: The accent MUST appear only for what is live or chosen: playing, recording+ count-in, a toggle that is on, a chosen segment or bank, the selected row or screen, a+ pad / key / cell / chord under the finger, a value control while it is being dragged,+ the caret in a focused field. Resting values (macro knob arcs, faders, the pan+ indicator, the XY crosshair and point, the key-source tag, chord numerals) MUST be+ neutral.+- **FR-013**: A toggle that is on and a chosen segment MUST be a solid accent fill with+ derived ink (no wash-tinted brass).+- **FR-014**: Mute on MUST be solid mute amber, solo on solid solo blue, arm on and record+ on solid record red — each with derived ink; mute and solo keep their letters so they+ do not rely on colour alone.+- **FR-015**: Geist MUST set every word and Geist Mono every number a user reads (position,+ tempo, dB, pan, percentages, note numbers, latency, counts); names are never mono.+- **FR-016**: Numbers MUST be set as on the desktop: U+2212 minus, a thin space before a+ unit, fixed precision (dB one decimal, tempo two where fractional).+- **FR-017**: Opacity MUST NOT signal a state (disabled, muted, dimmed) except the existing+ time states: the link-lost dimming of the play surface and the blinks (a queued clip, the+ connecting / reconnecting dot, the code caret).+- **FR-018**: Layout, sizes of touch targets, gestures, screens and behaviour MUST stay as+ they are: this is a visual change.++**Build**++- **FR-019**: The built phone page in `Nota.Remote/wwwroot` MUST be rebuilt from the+ sources, and the type check of the phone sources MUST pass with no errors or warnings.+- **FR-020**: The smoke test MUST check the theme message a phone receives (contents, and+ that it is re-sent only when the theme changes).++### Key Entities++- **Theme message**: what Nota tells a phone about colour — the active theme, the dark-mode+ pick and the light-mode pick, each with an id, a dark/light kind and a map of token name+ → colour.+- **Phone theme preference**: Follow Nota or Follow phone (exists today; stored on the+ phone).+- **Stored theme**: the last theme message, kept on the phone for first paint.++## Success Criteria *(mandatory)*++### Measurable Outcomes++- **SC-001**: For each of the four built-in themes, the phone's ground, panel, primary text+ and accent colours equal the desktop's values for that theme (exact match).+- **SC-002**: A theme change in Preferences reaches a connected phone in under one second,+ with no reload and no note cut.+- **SC-003**: Under Follow phone, switching the phone's colour scheme changes the page in+ under 100 ms, without waiting for Nota.+- **SC-004**: Zero colour literals in the phone's components; the only colour values in the+ phone sources are the first-paint fallback block.+- **SC-005**: Zero labels with letter-spacing or forced uppercase on any phone screen.+- **SC-006**: The full build and smoke test pass, including the new theme checks.+- **SC-007**: Screenshots of every phone screen in Studio Dark and Studio Light are reviewed+ against `DESIGN.md` § The rules with no open violations.++## Assumptions++- Phones are paired to and served by the same Nota, so the page and the hub are always the+ same version; protocol compatibility with older pages is best-effort (a cached page+ falls back gracefully and a reload fixes it).+- The phone uses a subset of the theme tokens; sending the full token set of three themes+ is acceptable on a local network (a few kilobytes, only on change).+- Track colours remain as Nota draws them in its active theme (see Edge Cases).+- The phone page keeps its own sizes (touch targets of 36–56 px) rather than the desktop's+ 26 px shell controls; Studio's rules (colour, corners, seams, type, case) apply, its+ desktop control heights do not.+- The phone's type sizes stay phone-sized (11–16 px for words, larger for the big position+ and count-in); Studio's "nothing larger than 13" shell rule is a desktop rule.+- Nota Remote's icons stay as small inline drawings in the page; the desktop `Glyph` set is+ native code the page cannot use. They keep the shared stroke style (round caps and joins,+ ~1.5 px).++## Nota Compliance Checklist *(review before implementation; re-check in tasks.md)*++- [x] Every new source file will carry the AGPL-3.0-only SPDX header (two lines, see CONTRIBUTING.md)+- [x] No new dependency+- [x] Audio-thread impact considered: none — the hub builds messages on the UI tick; nothing touches the engine's audio thread+- [x] Managed/native crossings go through the pure C ABI in `nota_engine.h` only (AR-7); no JUCE outside `pluginhost/` — no crossing changes+- [x] Smoke-test impact assessed: the Remote session test gains theme-message checks+- [x] User-visible change → `CHANGELOG.md` `[Unreleased]` entry and FEATURES.md planned; the user manual's Remote page via nota-docs+- [x] UI change → follows `DESIGN.md` (Studio design language)diff --git a/specs/014-remote-studio/tasks.md b/specs/014-remote-studio/tasks.mdnew file mode 100644index 00000000..1f0f93f6--- /dev/null+++ b/specs/014-remote-studio/tasks.md@@ -0,0 +1,118 @@+---++description: "Tasks: Nota Remote in Studio, wearing the app's theme"+---++# Tasks: Nota Remote in Studio, wearing the app's theme++**Input**: Design documents from `specs/014-remote-studio/`++**Prerequisites**: plan.md, spec.md, research.md, data-model.md, contracts/++**Tests**: requested by the spec (FR-020, US4): the smoke test checks the theme message and+guards the phone sources.++## Format: `[ID] [P?] [Story] Description`++- **[P]**: Can run in parallel (different files, no dependencies)+- **[Story]**: Which user story this task belongs to (US1–US4)++## Phase 1: Setup++- [X] T001 Install the phone page's dev dependencies and record the baseline: `npm ci && npm run check` in `src/web/remote` (expect 0 errors)+- [X] T002 [P] Write the stand-in Nota for screenshots: `src/web/remote/mock/nota-mock.mjs` (SPDX header; no dependencies — static server for `src/managed/Nota.Remote/wwwroot` plus a hand-rolled WebSocket; pairs any code, sends `welcome`, `theme` built from `src/managed/Nota.App/Theme/Themes/*.json` per contracts/theme-message.md, `proj` with a demo project of drum / instrument / audio / group / return tracks, sections and a key, `tp`, `mix`, `xy`, `mac`, `ses`; the page URL's `?theme=<id>` picks the theme the stand-in wears and `?pick=<dark>,<light>` the picks; `?legacy=1` sends only `proj.dark`); add `"mock": "node mock/nota-mock.mjs"` to `src/web/remote/package.json`+- [X] T003 Take "before" screenshots of every screen at 390 × 844 in the old Ember dark and light looks using the current bundle and the mock, into the scratchpad (PR material)++## Phase 2: Foundational (blocking)++- [X] T004 Add `RemoteTheme(string Id, string Name, bool Dark, IReadOnlyDictionary<string,string> Colors)` and `RemoteAppearance(RemoteTheme Active, RemoteTheme DarkPick, RemoteTheme LightPick, string InkDark, string InkLight)` to `src/managed/Nota.Remote/RemoteContracts.cs`; replace `bool DarkTheme` with `RemoteAppearance Appearance` on `IRemoteHost` (doc: "the same instance until the worn theme or the choice changes")+- [X] T005 [P] Name the two inks in `src/managed/Nota.App/Theme/NotaPalette.cs`: `InkDark` (#17181A) and `InkLight` (#FFFFFF) used by `ReadableInkOn`+- [X] T006 [P] Write `src/web/remote/src/lib/palette.ts` (pure, no DOM): `cssName(token)` (`BgApp` → `--bg-app`, `SystemAccentLight1` → `--system-accent-light1`, `Track1` → `--track1`), `inkOn(fill, [dark, light])` (WCAG contrast, ties → dark, as `NotaPalette.ReadableInkOn`), `cssVars(colors, ink)` returning every token plus `--ink-on-accent`, `--ink-on-mute`, `--ink-on-solo`, `--ink-on-record`, `--ink-on-success`+- [X] T007 Write `src/web/remote/theme-plugin.ts`: a Vite plugin resolving `virtual:nota-theme.css` to `:root{…}` from `studio-dark.json` and `[data-theme='light']{…}` from `studio-light.json` via `cssVars`, the ink pair being Studio Dark's `TextOnAccent` and `ShadeUp`; `addWatchFile` both; register it in `src/web/remote/vite.config.ts`++## Phase 3: User Story 1 — the phone wears Nota's theme (P1) 🎯 MVP++**Goal**: Follow Nota shows the desktop's theme and follows changes live.++**Independent test**: with the mock (`?theme=` each id) or a real Nota, the phone's+`--bg-app`, `--panel`, `--text-primary`, `--accent` equal the theme file's values.++- [X] T008 [US1] Implement `IRemoteHost.Appearance` in `src/managed/Nota.App/MainWindow.Remote.cs`: a per-id cache of `RemoteTheme` built from `NotaThemes.BuiltIn` (CSS hex `#RRGGBB`, `#RRGGBBAA` when alpha < 255), and a `RemoteAppearance` cached on `(NotaPalette.Theme, NotaThemeService.Choice)`; Active = `NotaPalette.Theme ?? NotaThemes.Default`, picks from `Choice.Dark` / `Choice.Light`+- [X] T009 [US1] Hub: in `src/managed/Nota.Remote/RemoteHub.State.cs` add `ThemeJson(host)` (serialise per contracts/theme-message.md — `t`, `on`, `dark`, `light`, `ink`, `th` with distinct ids; rebuild only when the `Appearance` reference changed); in `Push` send it before `proj` when `!ReferenceEquals(json, c.SentTheme)`; `proj.dark` from `Appearance.Active.Dark`; add `internal string? SentTheme;` to `src/managed/Nota.Remote/RemoteClient.cs`+- [X] T010 [US1] Smoke test: in `tests/Nota.SmokeTest/RemoteTests.cs` give `FakeHost` an `Appearance` (two prebuilt appearances, switchable) and check: a `theme` message arrives with `on`, both picks, `ink`, `th` holding exactly the distinct ids, each with the same full token set and `BgApp`; `proj.dark` equals `th[on].dark`; a switch sends one new `theme`; further ticks send none+- [X] T011 [US1] Phone theme module `src/web/remote/src/lib/theme.svelte.ts`: `Look` with `msg` (stored `nota-remote:theme`), `phoneDark` (live `matchMedia` listener), `legacyDark`; `worn(pref)`; `apply()` sets every var on `documentElement.style`, `data-theme`, `meta[name=theme-color]` = `--bg-app`, stores `nota-remote:vars`; `inkOn(hex)` for track fills+- [X] T012 [US1] Wire it: `src/web/remote/src/lib/app.svelte.ts` handles `t: 'theme'` (store + apply), feeds `proj.dark` to `legacyDark`, drops `get dark`; `src/web/remote/src/lib/types.ts` adds `ThemeMessage`; `src/web/remote/src/App.svelte` replaces the dark/light effect with an effect that applies the worn theme; `src/web/remote/src/main.ts` imports `virtual:nota-theme.css` before `app.css`+- [X] T013 [US1] First paint: a head script in `src/web/remote/index.html` that applies `nota-remote:vars` (and `data-theme`, theme-color) inside try/catch before the body renders; drop the hard-coded `theme-color` value and `data-theme="dark"` default stays++## Phase 4: User Story 2 — Follow phone uses the picks (P1)++**Goal**: Follow phone wears the dark-mode or light-mode pick by the phone's scheme, instantly.++**Independent test**: mock with `?pick=ember-graphite,studio-light`, phone menu → Follow+phone, toggle the emulated colour scheme: `--bg-app` switches between the two picks.++- [X] T014 [US2] In `src/web/remote/src/lib/theme.svelte.ts` make `worn` follow `prefs.theme === 'phone'` → `msg.dark` / `msg.light` by `phoneDark`, re-applying on a scheme change, a preference change and a new message (an `$effect.root` in the module, reading `app.prefs.theme`)+- [X] T015 [US2] In `src/web/remote/src/components/Sheets.svelte` keep the Theme segment (Follow Nota / Follow phone) and add the worn theme's name under it as a muted line ("Studio Light · from Nota's light-mode pick")++## Phase 5: User Story 3 — every screen reads as Studio (P2)++**Goal**: the ui-contract applied to every surface.++**Independent test**: screenshots of every screen in Studio Dark and Studio Light reviewed+against DESIGN.md § The rules.++- [X] T016 [US3] Rewrite `src/web/remote/src/app.css`: remove the Ember palette blocks and `.caps`; base type (Geist, 13 px, `--text-primary` on `--bg-app`), `.mono`, `.label` (600 · 11, `--text-muted`), `.btn`, `.seg`, `.switch` (28 × 16 squared), `.learnable` per contracts/ui-contract.md § Shared+- [X] T017 [P] [US3] Restyle `src/web/remote/src/App.svelte` (rail, tabs: selected = primary ink + 2 px accent line; seams)+- [X] T018 [P] [US3] Restyle `src/web/remote/src/components/Header.svelte` (track button, transport keys incl. record disc at rest, position well, link dot; thin space in "12 ms")+- [X] T019 [P] [US3] Restyle `src/web/remote/src/components/Banner.svelte`+- [X] T020 [P] [US3] Restyle `src/web/remote/src/components/Sheets.svelte` (popover, rows with accent tick, badges, field, switches, sentence-case heads, Disconnect an ordinary row)+- [X] T021 [P] [US3] Restyle `src/web/remote/src/components/Overlays.svelte` (covers, steps list, code cells, Connect again, count-in, toast)+- [X] T022 [P] [US3] Restyle `src/web/remote/src/screens/Pads.svelte` (tiles radius 3; held accent; lit = track colour + derived ink via `look.inkOn`; "Full velocity")+- [X] T023 [P] [US3] Restyle `src/web/remote/src/screens/Keys.svelte` (key-white / key-black, held accent, lit band; tiles; key source "Phone / Project / Default" neutral; numerals neutral)+- [X] T024 [P] [US3] Restyle `src/web/remote/src/screens/XY.svelte` (graph field, neutral crosshair and point at rest, accent while dragged or tilting, no fill; axis labels; tilt chip; percent with thin space)+- [X] T025 [P] [US3] Restyle `src/web/remote/src/screens/Mixer.svelte` (strips on seams, cap and pan neutral → accent while dragged, meter zones, M / S / Arm semantic fills with derived ink, "Arm", "Master" label)+- [X] T026 [P] [US3] Restyle `src/web/remote/src/screens/Macros.svelte` (desktop knob geometry and colours, names as written, automated dot muted, percent with thin space)+- [X] T027 [P] [US3] Restyle `src/web/remote/src/screens/Scenes.svelte` (clips radius 2, track fills with derived ink, recording solid record, progress in ink, sentence-case states)+- [X] T028 [P] [US3] Restyle `src/web/remote/src/screens/BigTransport.svelte` (keys, on states, record, sections tick / looping, "Bar 5" / "Looping", tap tempo label)+- [X] T029 [P] [US3] Restyle `src/web/remote/src/screens/Empty.svelte`++## Phase 6: User Story 4 — the theme travels with the build (P3)++- [X] T030 [US4] Phone-source guard `tests/Nota.SmokeTest/DesignTokenCheck.Remote.cs` (`RunRemote`): in `src/web/remote/src` (`.svelte`, `.ts`, `.css`, via `Files()` / `Rel()`) no `#hex` colour, `rgb(` / `rgba(` / `hsl(`; no `letter-spacing` other than 0; no `text-transform: uppercase`; no `.toUpperCase()`; `border-radius` only 0 / 1 / 2 / 3 / 4 px or 50 %; and `theme-plugin.ts` reads the theme files rather than holding values. Register the section in `tests/Nota.SmokeTest/Program.cs`+- [X] T031 [US4] Rebuild the bundle (`npm run build` in `src/web/remote` → `src/managed/Nota.Remote/wwwroot`), `npm run check` clean++## Phase 7: Polish++- [X] T032 Run `scripts/build.sh` (smoke test included); rerun timing-budget checks on an idle machine before calling one real+- [X] T033 "After" screenshots of every screen at 390 × 844 in Studio Dark and Studio Light (plus one each in Ember Graphite / Ember Paper and a Follow-phone flip) with the mock; review against DESIGN.md § The rules and fix+- [X] T034 [P] `CHANGELOG.md` [Unreleased] entry; `FEATURES.md` via nota-features; `DESIGN.md` § Shell note on Nota Remote; user manual's Remote page via nota-docs if the sibling repo is present (it is not checked out here — follow-up)+- [X] T035 Commit, push `feat/remote-studio`, open a draft PR on chrislaupama/nota into `feat/studio-ui` with before/after screenshots++## Dependencies++- T004 → T008, T009, T010. T006 → T007, T011. T011 → T012–T015, T022 (inkOn).+- US1 (T008–T013) before US2 (T014–T015). US3 tasks T017–T029 depend on T016 and are+ parallel with each other. T030 after US3. T031 after all phone edits. T032–T035 last.++## Parallel examples++- T005 ∥ T006 ∥ T002 (different files).+- T017 … T029 (one file each) once T016 lands.++## Implementation strategy++MVP = Phases 1–3 (the phone wears Nota's theme live). Then Follow phone, then the restyle,+then the guard, then the gate and the PR.++## Nota compliance (re-check)++- [X] SPDX header on `palette.ts`, `theme.svelte.ts`, `theme-plugin.ts`, `nota-mock.mjs`, `DesignTokenCheck.Remote.cs`+- [X] No new dependency+- [X] No audio-thread code touched+- [X] Smoke test extended (T010, T030)+- [X] CHANGELOG / FEATURES / DESIGN updated (T034)++## Phase 8: Convergence++- [X] T036 Set the number in a clip's length ("4 bars", "6 beats") in Geist Mono in `src/web/remote/src/screens/Scenes.svelte` per FR-015 (partial)+- [X] T037 Drop the `nota-remote-mock` entry added to the tracked `.claude/launch.json` (a local dev convenience outside the plan; `npm run mock` is the documented way) per plan: structure (unrequested)diff --git a/src/managed/Nota.App/MainWindow.Remote.cs b/src/managed/Nota.App/MainWindow.Remote.csindex a947827b..ee9334d7 100644--- a/src/managed/Nota.App/MainWindow.Remote.cs+++ b/src/managed/Nota.App/MainWindow.Remote.cs@@ -13,8 +13,8 @@ using System.Linq;using Avalonia.Controls;using Avalonia.Controls.Primitives;using Avalonia.Interactivity;-using Avalonia.Styling;using Microsoft.Extensions.DependencyInjection;+using Nota.Application;using Nota.Remote;namespace Nota.App;@@ -92,7 +92,39 @@ public partial class MainWindow : IRemoteHoststring IRemoteHost.HostName => _remote?.Hub.HostName ?? Environment.MachineName;- bool IRemoteHost.DarkTheme => Avalonia.Application.Current?.ActualThemeVariant != ThemeVariant.Light;+ // The phone wears the theme the window wears, or under Follow phone one of the user's two+ // picks (spec 014). Built once per theme and once per change, so the hub's reference check+ // costs nothing on the ticks in between.+ private readonly Dictionary<string, RemoteTheme> _remoteThemes = new();+ private RemoteAppearance? _remoteLook;+ private (NotaColourTheme, AppearanceChoice)? _remoteLookFor;++ RemoteAppearance IRemoteHost.Appearance+ {+ get+ {+ var key = (NotaPalette.Theme ?? NotaThemes.Default, NotaThemeService.Choice);+ if (_remoteLook is null || !key.Equals(_remoteLookFor))+ {+ RemoteTheme Of(NotaColourTheme? t) => RemoteThemeOf(t ?? NotaThemes.Default);+ _remoteLook = new RemoteAppearance(Of(key.Item1), Of(NotaThemes.Find(key.Item2.Dark)), Of(NotaThemes.Find(key.Item2.Light)),+ CssHex(NotaPalette.InkDark), CssHex(NotaPalette.InkLight));+ _remoteLookFor = key;+ }+ return _remoteLook;+ }+ }++ private RemoteTheme RemoteThemeOf(NotaColourTheme t)+ {+ if (!_remoteThemes.TryGetValue(t.Id, out var r))+ _remoteThemes[t.Id] = r = new RemoteTheme(t.Id, t.Name, t.IsDark, Enumerable.ToDictionary(t.Colors, c => c.Key, c => CssHex(c.Value)));+ return r;+ }++ // CSS order: #RRGGBB, or #RRGGBBAA when translucent (Avalonia writes #AARRGGBB).+ private static string CssHex(Avalonia.Media.Color c) =>+ c.A == 0xFF ? $"#{c.R:X2}{c.G:X2}{c.B:X2}" : $"#{c.R:X2}{c.G:X2}{c.B:X2}{c.A:X2}";string IRemoteHost.TrackColor(int trackId){diff --git a/src/managed/Nota.App/Theme/NotaPalette.cs b/src/managed/Nota.App/Theme/NotaPalette.csindex f9dba153..2cb786fb 100644--- a/src/managed/Nota.App/Theme/NotaPalette.cs+++ b/src/managed/Nota.App/Theme/NotaPalette.cs@@ -141,14 +141,14 @@ internal static class NotaPaletteprivate static readonly Dictionary<SolidColorBrush, SolidColorBrush> InkOnCache = new();+ /// <summary>The two inks <see cref="ReadableInkOn"/> chooses between. Nota Remote is sent+ /// them so the phone derives ink the same way (spec 014).</summary>+ public static readonly Color InkDark = Color.FromRgb(0x17, 0x18, 0x1A), InkLight = Color.FromRgb(0xFF, 0xFF, 0xFF);+/// <summary>Dark ink (#17181A) or white, whichever reads better on <paramref name="fill"/>/// (WCAG contrast ratio). For views that compute a fill at draw time.</summary>- public static Color ReadableInkOn(Color fill)- {- var dark = Color.FromRgb(0x17, 0x18, 0x1A);- var white = Color.FromRgb(0xFF, 0xFF, 0xFF);- return Contrast(dark, fill) >= Contrast(white, fill) ? dark : white;- }+ public static Color ReadableInkOn(Color fill) =>+ Contrast(InkDark, fill) >= Contrast(InkLight, fill) ? InkDark : InkLight;private static double Contrast(Color a, Color b){diff --git a/src/managed/Nota.Remote/RemoteClient.cs b/src/managed/Nota.Remote/RemoteClient.csindex 61b8ce1a..36f59824 100644--- a/src/managed/Nota.Remote/RemoteClient.cs+++ b/src/managed/Nota.Remote/RemoteClient.cs@@ -46,6 +46,7 @@ public sealed class RemoteClientpublic long LastActivityTicks;// What this phone was last sent, so a tick only sends what changed.+ internal string? SentTheme;internal string? SentProject;internal string? SentWho;internal string? SentTransport;diff --git a/src/managed/Nota.Remote/RemoteContracts.cs b/src/managed/Nota.Remote/RemoteContracts.csindex 05a1d6ca..e79b8852 100644--- a/src/managed/Nota.Remote/RemoteContracts.cs+++ b/src/managed/Nota.Remote/RemoteContracts.cs@@ -47,8 +47,10 @@ public interface IRemoteHost{/// <summary>The computer's name, as the phone shows it ("Reconnecting to Studio Mac…").</summary>string HostName { get; }- /// <summary>Nota's palette, which the phone follows unless set to follow its own theme.</summary>- bool DarkTheme { get; }+ /// <summary>The colour theme Nota wears and the user's dark-mode and light-mode picks, which+ /// the phone wears (spec 014). The same instance until one of them changes — the hub+ /// compares by reference.</summary>+ RemoteAppearance Appearance { get; }/// <summary>The track's colour as Nota draws it, "#RRGGBB".</summary>string TrackColor(int trackId);/// <summary>The track selected in Nota (0 = none), for "Follow Nota's selection".</summary>@@ -93,6 +95,15 @@ public interface IRemoteHostvoid Activity();}+/// <summary>One colour theme as the phone needs it: every token of Theme/Themes/<id>.json+/// as CSS hex (<c>#RRGGBB</c>, or <c>#RRGGBBAA</c> when translucent).</summary>+public sealed record RemoteTheme(string Id, string Name, bool Dark, IReadOnlyDictionary<string, string> Colors);++/// <summary>What the phone is told about colour: the theme Nota wears (Follow Nota), the user's+/// dark-mode and light-mode picks (Follow phone), and the two inks text on a solid fill is+/// chosen from, as <c>NotaPalette.ReadableInkOn</c> chooses.</summary>+public sealed record RemoteAppearance(RemoteTheme Active, RemoteTheme DarkPick, RemoteTheme LightPick, string InkDark, string InkLight);+/// <summary>Who may do what from a phone (Settings → Remote).</summary>public enum RemoteAccess{diff --git a/src/managed/Nota.Remote/RemoteHub.State.cs b/src/managed/Nota.Remote/RemoteHub.State.csindex 7d9300fd..5142ed91 100644--- a/src/managed/Nota.Remote/RemoteHub.State.cs+++ b/src/managed/Nota.Remote/RemoteHub.State.cs@@ -48,6 +48,10 @@ public sealed partial class RemoteHubprivate void Push(IRemoteHost host, Snapshot snap, RemoteClient c){+ // The theme first, so the phone paints its first screen in the right colours.+ string theme = ThemeJson(host);+ if (!ReferenceEquals(theme, c.SentTheme)) { c.Send(theme); c.SentTheme = theme; }+if (_projectJson is null || _tick % 6 == 0) RefreshProject(host);ResolveTrack(host, c);@@ -108,7 +112,7 @@ public sealed partial class RemoteHub{w.WriteString("t", "proj");w.WriteString("host", HostName);- w.WriteBoolean("dark", host.DarkTheme);+ w.WriteBoolean("dark", host.Appearance.Active.Dark); // for a page from an older Notaw.WriteStartArray("tracks");foreach (var r in rows){@@ -151,6 +155,48 @@ public sealed partial class RemoteHub_projectJson = _projectJson[..^1];}+ // ---- theme ----------------------------------------------------------------------++ private RemoteAppearance? _themeFor;+ private string _themeJson = "";++ // What the phone wears (specs/014 contracts/theme-message.md): the theme Nota wears, the+ // dark-mode and light-mode picks, each theme once with every token, and the two inks.+ // Rebuilt only when the host hands over a new appearance; the same string otherwise, so+ // Push's reference check tells a phone that already has it.+ private string ThemeJson(IRemoteHost host)+ {+ var a = host.Appearance;+ if (ReferenceEquals(a, _themeFor)) return _themeJson;+ _themeJson = Json(w =>+ {+ w.WriteString("t", "theme");+ w.WriteString("on", a.Active.Id);+ w.WriteString("dark", a.DarkPick.Id);+ w.WriteString("light", a.LightPick.Id);+ w.WriteStartArray("ink");+ w.WriteStringValue(a.InkDark);+ w.WriteStringValue(a.InkLight);+ w.WriteEndArray();+ w.WriteStartObject("th");+ var seen = new HashSet<string>();+ foreach (var t in new[] { a.Active, a.DarkPick, a.LightPick })+ {+ if (!seen.Add(t.Id)) continue;+ w.WriteStartObject(t.Id);+ w.WriteString("name", t.Name);+ w.WriteBoolean("dark", t.Dark);+ w.WriteStartObject("c");+ foreach (var (token, css) in t.Colors) w.WriteString(token, css);+ w.WriteEndObject();+ w.WriteEndObject();+ }+ w.WriteEndObject();+ });+ _themeFor = a;+ return _themeJson;+ }+// The pads a drum track has: a Drum Rack's chains by trigger note, Nota Rhythm's eight voices.private void WritePads(Utf8JsonWriter w, int trackId){diff --git a/src/managed/Nota.Remote/wwwroot/assets/index-DT5MFtDx.js b/src/managed/Nota.Remote/wwwroot/assets/index-DT5MFtDx.jsnew file mode 100644index 00000000..56b80e6d--- /dev/null+++ b/src/managed/Nota.Remote/wwwroot/assets/index-DT5MFtDx.js@@ -0,0 +1,2 @@+(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),t.credentials=e.crossOrigin===`use-credentials`?`include`:e.crossOrigin===`anonymous`?`omit`:`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var e=Array.isArray,t=Array.prototype.indexOf,n=Array.prototype.includes,r=Array.from,i=Object.defineProperty,a=Object.getOwnPropertyDescriptor,o=Object.getOwnPropertyDescriptors,s=Object.prototype,c=Array.prototype,l=Object.getPrototypeOf,u=Object.isExtensible,d=()=>{};function f(e){return e()}function p(e){for(var t=0;t<e.length;t++)e[t]()}function m(){var e,t;return{promise:new Promise((n,r)=>{e=n,t=r}),resolve:e,reject:t}}var h=1024,g=2048,_=4096,v=8192,y=16384,b=32768,x=1<<25,S=65536,C=1<<19,w=1<<20,ee=1<<25,T=1<<21,te=1<<22,E=1<<23,ne=Symbol(`$state`),re=Symbol(`component`),ie=Symbol(``),ae=Symbol(`attributes`),oe=Symbol(`class`),se=Symbol(`style`),ce=Symbol(`text`),le=Symbol(`form reset`),ue=new class extends Error{name=`StaleReactionError`;message="The reaction that called `getAbortSignal()` was re-run or destroyed"},de=!!globalThis.document?.contentType&&globalThis.document.contentType.includes(`xml`),fe={},D=Symbol(`uninitialized`),pe=`http://www.w3.org/1999/xhtml`;function me(){console.warn(`https://svelte.dev/e/derived_inert`)}function he(e){console.warn(`https://svelte.dev/e/hydration_mismatch`)}function ge(){console.warn(`https://svelte.dev/e/svelte_boundary_reset_noop`)}var O=!1;function _e(e){O=e}var k;function ve(e){if(e===null)throw he(),fe;return k=e}function ye(){return ve(Xt(k))}function A(e){if(O){if(Xt(k)!==null)throw he(),fe;k=e}}function be(e=1){if(O){for(var t=e,n=k;t--;)n=Xt(n);k=n}}function xe(e=!0){for(var t=0,n=k;;){if(n.nodeType===8){var r=n.data;if(r===`]`){if(t===0)return n;--t}else(r===`[`||r===`[!`||r[0]===`[`&&!isNaN(Number(r.slice(1))))&&(t+=1)}var i=Xt(n);e&&n.remove(),n=i}}function Se(e){if(!e||e.nodeType!==8)throw he(),fe;return e.data}function Ce(e){return e===this.v}function we(e,t){return e==e?e!==t||typeof e==`object`&&!!e||typeof e==`function`:t==t}function Te(e){return!we(e,this.v)}function Ee(){throw Error(`https://svelte.dev/e/async_derived_orphan`)}function De(e,t,n){throw Error(`https://svelte.dev/e/each_key_duplicate`)}function Oe(e){throw Error(`https://svelte.dev/e/effect_in_teardown`)}function ke(){throw Error(`https://svelte.dev/e/effect_in_unowned_derived`)}function Ae(e){throw Error(`https://svelte.dev/e/effect_orphan`)}function je(){throw Error(`https://svelte.dev/e/effect_update_depth_exceeded`)}function Me(){throw Error(`https://svelte.dev/e/state_descriptors_fixed`)}function Ne(){throw Error(`https://svelte.dev/e/state_prototype_fixed`)}function Pe(){throw Error(`https://svelte.dev/e/state_unsafe_mutation`)}function Fe(){throw Error(`https://svelte.dev/e/svelte_boundary_reset_onerror`)}var Ie=!1;function Le(){Ie=!0}var j=null;function Re(e){j=e}function ze(e,t=!1,n){j={p:j,i:!1,c:null,e:null,s:e,x:null,r:H,l:Ie&&!t?{s:null,u:null,$:[]}:null}}function Be(e){var t=j,n=t.e;if(n!==null){t.e=null;for(var r of n)dn(r)}return e!==void 0&&(t.x=e),t.i=!0,j=t.p,Ve(e)}function Ve(e={}){return i(e,re,{value:!0}),e}function He(){return!Ie||j!==null&&j.l===null}var Ue=[];function We(){var e=Ue;Ue=[],p(e)}function Ge(e){if(Ue.length===0&&!vt){var t=Ue;queueMicrotask(()=>{t===Ue&&We()})}Ue.push(e)}function Ke(){for(;Ue.length>0;)We()}var qe=~(g|_|h);function Je(e,t){e.f=e.f&qe|t}function Ye(e){e.f&512||e.deps===null?Je(e,h):Je(e,_)}function Xe(e,t,n){e.f&2048?t.add(e):e.f&4096&&n.add(e),Je(e,h)}var Ze=!1;function Qe(){Ze||(Ze=!0,document.addEventListener(`reset`,e=>{Promise.resolve().then(()=>{if(!e.defaultPrevented)for(let t of e.target.elements)t[le]?.()})},{capture:!0}))}function $e(e){var t=V,n=H;In(null),Ln(null);try{return e()}finally{In(t),Ln(n)}}function et(e,t,n,r=n){e.addEventListener(t,()=>$e(n));let i=e[le];e[le]=i?()=>{i(),r(!0)}:()=>r(!0),Qe()}function tt(e,t,n,r){let i=He()?at:ct;var a=e.filter(e=>!e.settled),o=t.map(i);if(n.length===0&&a.length===0){r(o);return}var s=H,c=nt(),l=a.length===1?a[0].promise:a.length>1?Promise.all(a.map(e=>e.promise)):null;function u(e){if(!(s.f&16384)){c();try{r([...o,...e])}catch(e){rn(e,s)}rt()}}var d=it();if(n.length===0){l.then(()=>u([])).finally(d);return}function f(){Promise.all(n.map(e=>st(e))).then(u).catch(e=>rn(e,s)).finally(d)}l?l.then(()=>{c(),f(),rt()}):f()}function nt(){var e=H,t=V,n=j,r=N;return function(i=!0){Ln(e),In(t),Re(n),i&&!(e.f&16384)&&(r?.activate(),r?.apply())}}function rt(e=!0){Ln(null),In(null),Re(null),e&&N?.deactivate()}function it(){var e=H,t=e.b,n=N,r=!!t?.is_rendered();return t?.update_pending_count(1,n),n.increment(r,e),()=>{t?.update_pending_count(-1,n),n.decrement(r,e)}}function at(e){var t=2|g;return H!==null&&(H.f|=C),{ctx:j,deps:null,effects:null,equals:Ce,f:t,fn:e,reactions:null,rv:0,v:D,wv:0,parent:H,ac:null}}var ot=Symbol(`obsolete`);function st(e,t,n){let r=H;r===null&&Ee();var i=void 0,a=Ft(D),o=!V,s=new Set;return gn(()=>{var t=H,n=m();i=n.promise;try{Promise.resolve(e()).then(n.resolve,e=>{e!==ue&&n.reject(e)}).finally(rt)}catch(e){n.reject(e),rt()}var c=N;if(o){if(t.f&32768)var l=it();if(r.b?.is_rendered())c.async_deriveds.get(t)?.reject(ot);else for(let e of s.values())e.reject(ot);s.add(n),c.async_deriveds.set(t,n)}let u=(e,t=void 0)=>{l?.(),s.delete(n),t!==ot&&(c.activate(),t?(a.f|=E,zt(a,t)):(a.f&8388608&&(a.f^=E),zt(a,e)),c.deactivate())};n.promise.then(u,e=>u(null,e||`unknown`))}),ln(()=>{for(let e of s)e.reject(ot)}),new Promise(e=>{function t(n){function r(){n===i?e(a):t(i)}n.then(r,r)}t(i)})}function M(e){let t=at(e);return zn(t),t}function ct(e){let t=at(e);return t.equals=Te,t}function lt(e){var t=e.effects;if(t!==null){e.effects=null;for(var n=0;n<t.length;n+=1)Cn(t[n])}}function ut(e){var t,n=H,r=e.parent;if(!Nn&&r!==null&&e.v!==D&&r.f&24576)return me(),e.v;Ln(r);try{lt(e),t=Zn(e)}finally{Ln(n)}return t}function dt(e){var t=ut(e);if(!e.equals(t)&&(e.wv=Jn(),(!N?.is_fork||e.deps===null)&&(N===null?e.v=t:(N.capture(e,t,!0),ht?.capture(e,t,!0)),e.deps===null))){Je(e,h);return}Nn||(gt===null?Ye(e):(cn()||N?.is_fork)&>.set(e,t))}function ft(e){if(e.effects!==null)for(let t of e.effects)(t.teardown||t.ac)&&(t.teardown?.(),t.ac!==null&&$e(()=>{t.ac.abort(ue),t.ac=null}),t.fn!==null&&(t.teardown=d),er(t,0),xn(t))}function pt(e){if(e.effects!==null)for(let t of e.effects)t.teardown&&t.fn!==null&&tr(t)}var mt=null,N=null,ht=null,gt=null,_t=null,vt=!1,yt=!1,bt=null,xt=null,St=0,Ct=1,wt=class e{id=Ct++;#e=!1;linked=!0;#t=null;#n=null;async_deriveds=new Map;current=new Map;previous=new Map;#r=new Set;#i=new Set;#a=0;#o=new Map;#s=null;#c=[];#l=[];#u=new Set;#d=new Set;#f=new Map;#p=new Set;is_fork=!1;#m=!1;constructor(){mt===null?mt=this:(mt.#n=this,this.#t=mt),mt=this}#h(){if(this.is_fork)return!0;for(let n of this.#o.keys()){for(var e=n,t=!1;e.parent!==null;){if(this.#f.has(e)){t=!0;break}e=e.parent}if(!t)return!0}return!1}skip_effect(e){this.#f.has(e)||this.#f.set(e,{d:[],m:[]}),this.#p.delete(e)}unskip_effect(e,t=e=>this.schedule(e)){var n=this.#f.get(e);if(n){this.#f.delete(e);for(var r of n.d)Je(r,g),t(r);for(r of n.m)Je(r,_),t(r)}this.#p.add(e)}#g(){var e=[];for(let i of this.#c)if(!(i.f&16384||!(i.f&6144))){for(var t=i,n=!1;t.parent!==null;){t=t.parent;var r=t.f;if(r&96){if(!(r&1024)){n=!0;break}t.f^=h}}n||e.push(t)}return this.#c=[],e}#_(){this.#e=!0;for(let e of this.#u)this.#d.delete(e),Je(e,g),this.schedule(e);for(let e of this.#d)Je(e,_),this.schedule(e);this.apply();for(var t=bt=[],n=[],r=xt=[];this.#c.length>0;){St++>1e3&&(this.#S(),Et());for(let e of this.#g())try{this.#v(e,t,n)}catch(t){throw jt(e),this.#h()||this.discard(),t}}if(N=null,r.length>0){var i=e.ensure();for(let e of r)i.schedule(e)}if(bt=null,xt=null,this.#h()){this.#x(n),this.#x(t);for(let[e,t]of this.#f)At(e,t);r.length>0&&N.#_();return}let a=this.#y();if(a){this.#x(n),this.#x(t),a.#b(this);return}this.#u.clear(),this.#d.clear();for(let e of this.#r)e(this);this.#r.clear(),ht=this,Ot(n),Ot(t),ht=null,this.#s?.resolve();var o=N;if(this.#a===0&&(this.#c.length===0||o!==null)&&this.#S(),this.#c.length>0){if(o!==null){for(let e of this.#c)o.#c.push(e);this.#c=[]}else o=this}o!==null&&(Nt.clear(),o.#_())}#v(e,t,n){e.f^=h;for(var r=e.first;r!==null;){var i=r.f,a=!!(i&96);if(!(a&&i&1024||i&8192||this.#f.has(r))&&r.fn!==null){a?r.f^=h:i&4?t.push(r):Yn(r)&&(i&16&&this.#d.add(r),tr(r));var o=r.first;if(o!==null){r=o;continue}}for(;r!==null;){var s=r.next;if(s!==null){r=s;break}r=r.parent}}}#y(){for(var e=this.#t;e!==null;){if(!e.is_fork){for(let[t,[,n]]of this.current)if(e.current.has(t)&&!n)return e}e=e.#t}return null}#b(e){for(let[t,n]of e.current)!this.previous.has(t)&&e.previous.has(t)&&this.previous.set(t,e.previous.get(t)),this.current.set(t,n);for(let[t,n]of e.async_deriveds){let e=this.async_deriveds.get(t);e&&n.promise.then(e.resolve).catch(e.reject)}e.async_deriveds.clear(),this.transfer_effects(e.#u,e.#d);let t=e=>{var n=e.reactions;if(n!==null&&!(e.f&2&&!(e.f&6144)))for(let e of n){var r=e.f;if(r&2)t(e);else{var i=e;r&4194320&&!this.async_deriveds.has(i)&&(this.#d.delete(i),Je(i,g),this.schedule(i))}}};for(let e of this.current.keys())t(e);this.oncommit(()=>e.discard()),e.#S(),N=this,this.#_()}#x(e){for(var t=0;t<e.length;t+=1)Xe(e[t],this.#u,this.#d)}capture(e,t,n=!1){e.v!==D&&!this.previous.has(e)&&this.previous.set(e,e.v),e.f&8388608||(this.current.set(e,[t,n]),gt?.set(e,t)),this.is_fork||(e.v=t)}activate(){N=this}deactivate(){N=null,gt=null}flush(){try{yt=!0,N=this,this.#_()}finally{St=0,_t=null,bt=null,xt=null,yt=!1,N=null,gt=null,Nt.clear()}}discard(){for(let e of this.#i)e(this);this.#i.clear();for(let e of this.async_deriveds.values())e.reject(ot);this.#S(),this.#s?.resolve()}register_created_effect(e){this.#l.push(e)}increment(e,t){if(this.#a+=1,e){let e=this.#o.get(t)??0;this.#o.set(t,e+1)}}decrement(e,t){if(--this.#a,e){let e=this.#o.get(t)??0;e===1?this.#o.delete(t):this.#o.set(t,e-1)}this.#m||(this.#m=!0,Ge(()=>{this.#m=!1,this.linked&&this.flush()}))}transfer_effects(e,t){for(let t of e)this.#u.add(t);for(let e of t)this.#d.add(e);e.clear(),t.clear()}oncommit(e){this.#r.add(e)}ondiscard(e){this.#i.add(e)}settled(){return(this.#s??=m()).promise}static ensure(){if(N===null){let t=N=new e;!yt&&!vt&&Ge(()=>{t.#e||t.flush()})}return N}apply(){gt=null}schedule(e){if(_t=e,e.b?.is_pending&&e.f&16777228&&!(e.f&32768)){e.b.defer_effect(e);return}this.#c.push(e)}#S(){if(this.linked){var e=this.#t,t=this.#n;e===null||(e.#n=t),t===null?mt=e:t.#t=e,this.linked=!1}}};function Tt(e){var t=vt;vt=!0;try{var n;for(e&&(N!==null&&!N.is_fork&&N.flush(),n=e());;){if(Ke(),N===null)return n;N.flush()}}finally{vt=t}}function Et(){try{je()}catch(e){rn(e,_t)}}var Dt=null;function Ot(e){var t=e.length;if(t!==0){for(var n=0;n<t;){var r=e[n++];if(!(r.f&24576)&&Yn(r)&&(Dt=new Set,tr(r),r.deps===null&&r.first===null&&r.nodes===null&&r.teardown===null&&r.ac===null&&Tn(r),Dt?.size>0)){Nt.clear();for(let e of Dt){if(e.f&24576)continue;let t=[e],n=e.parent;for(;n!==null;)Dt.has(n)&&(Dt.delete(n),t.push(n)),n=n.parent;for(let e=t.length-1;e>=0;e--){let n=t[e];n.f&24576||tr(n)}}Dt.clear()}}Dt=null}}function kt(e){N.schedule(e)}function At(e,t){if(!(e.f&32&&e.f&1024)){e.f&2048?t.d.push(e):e.f&4096&&t.m.push(e),Je(e,h);for(var n=e.first;n!==null;)At(n,t),n=n.next}}function jt(e){Je(e,h);for(var t=e.first;t!==null;)jt(t),t=t.next}var Mt=new Set,Nt=new Map,Pt=!1;function Ft(e,t){return{f:0,v:e,reactions:null,equals:Ce,rv:0,wv:0}}function P(e,t){let n=Ft(e,t);return zn(n),n}function It(e,t=!1,n=!0){let r=Ft(e);return t||(r.equals=Te),Ie&&n&&j!==null&&j.l!==null&&(j.l.s??=[]).push(r),r}function F(e,t,n=!1){return V!==null&&(!Fn||V.f&131072)&&He()&&V.f&4325394&&(Rn===null||!Rn.has(e))&&Pe(),zt(e,n?I(t):t,xt)}var Lt=null,Rt=0;function zt(e,t,n=null){if(!e.equals(t)){Nn?Nt.set(e,t):Nt.has(e)||Nt.set(e,e.v);var r=wt.ensure();if(r.capture(e,t),e.f&2){let t=e;e.f&2048&&ut(t),gt===null&&Ye(t)}e.wv=Jn(),Lt=null,Rt=0,Ht(e,g,n),Lt=null,He()&&H!==null&&H.f&1024&&!(H.f&96)&&(Hn===null?Un([e]):Hn.push(e)),!r.is_fork&&Mt.size>0&&!Pt&&Bt()}return t}function Bt(){Pt=!1;for(let e of Mt){e.f&1024&&Je(e,_);let t;try{t=Yn(e)}catch{t=!0}t&&tr(e)}Mt.clear()}function Vt(e){F(e,e.v+1)}function Ht(e,t,n){var r=e.reactions;if(r!==null){var i=He(),a=r.length;if(Rt+=a,Rt>1e5&&Lt===null&&(Lt=new Set),Lt!==null){if(Lt.has(e))return;Lt.add(e)}for(var o=0;o<a;o++){var s=r[o],c=s.f;if(i||s!==H){var l=(c&g)===0;if(l&&Je(s,t),c&131072)Mt.add(s);else if(c&2){var u=s;gt?.delete(u),Ht(u,_,n)}else if(l){var d=s;c&16&&Dt!==null&&Dt.add(d),n===null?kt(d):n.push(d)}}}}}function I(t){if(typeof t!=`object`||!t||ne in t||re in t)return t;let n=l(t);if(n!==s&&n!==c)return t;var r=new Map,i=e(t),o=P(0),u=null,d=Kn,f=e=>{if(Kn===d)return e();var t=V,n=Kn;In(null),qn(d);var r=e();return In(t),qn(n),r};return i&&r.set(`length`,P(t.length,u)),new Proxy(t,{defineProperty(e,t,n){(!(`value`in n)||n.configurable===!1||n.enumerable===!1||n.writable===!1)&&Me();var i=r.get(t);return i===void 0?f(()=>{var e=P(n.value,u);return r.set(t,e),e}):F(i,n.value,!0),!0},deleteProperty(e,t){var n=r.get(t);if(n===void 0){if(t in e){let e=f(()=>P(D,u));r.set(t,e),Vt(o)}}else F(n,D),Vt(o);return!0},get(e,n,i){if(n===ne)return t;var o=r.get(n),s=n in e;if(o===void 0&&(!s||a(e,n)?.writable)&&(o=f(()=>P(I(s?e[n]:D),u)),r.set(n,o)),o!==void 0){var c=U(o);return c===D?void 0:c}return Reflect.get(e,n,i)},getOwnPropertyDescriptor(e,t){this.has?.(e,t);var n=Reflect.getOwnPropertyDescriptor(e,t),i=r.get(t);if(i!==void 0){var a=U(i);if(a===D)return;if(n&&`value`in n)n.value=a;else return{enumerable:!0,configurable:!0,value:a,writable:!0}}return n},has(e,t){if(t===ne)return!0;var n=r.get(t),i=n!==void 0&&n.v!==D||Reflect.has(e,t);return(n!==void 0||H!==null&&(!i||a(e,t)?.writable))&&(n===void 0&&(n=f(()=>P(i?I(e[t]):D,u)),r.set(t,n)),U(n)===D)?!1:i},set(e,t,n,s){var c=r.get(t),l=t in e;if(i&&t===`length`)for(var d=n;d<c.v;d+=1){var p=r.get(d+``);p===void 0?d in e&&(p=f(()=>P(D,u)),r.set(d+``,p)):F(p,D)}if(c===void 0)(!l||a(e,t)?.writable)&&(c=f(()=>P(void 0,u)),F(c,I(n)),r.set(t,c));else{l=c.v!==D;var m=f(()=>I(n));F(c,m)}var h=Reflect.getOwnPropertyDescriptor(e,t);if(h?.set&&h.set.call(s,n),!l){if(i&&typeof t==`string`){var g=r.get(`length`),_=Number(t);Number.isInteger(_)&&_>=g.v&&F(g,_+1)}Vt(o)}return!0},ownKeys(e){U(o);var t=Reflect.ownKeys(e).filter(e=>{var t=r.get(e);return t===void 0||t.v!==D});for(var[n,i]of r)i.v!==D&&!(n in e)&&t.push(n);return t},setPrototypeOf(){Ne()}})}var Ut,Wt,Gt,Kt;function qt(){if(Ut===void 0){Ut=window,Wt=/Firefox/.test(navigator.userAgent);var e=Element.prototype,t=Node.prototype,n=Text.prototype;Gt=a(t,`firstChild`).get,Kt=a(t,`nextSibling`).get,u(e)&&(e[oe]=void 0,e[ae]=null,e[se]=void 0,e.__e=void 0),u(n)&&(n[ce]=void 0)}}function Jt(e=``){return document.createTextNode(e)}function Yt(e){return Gt.call(e)}function Xt(e){return Kt.call(e)}function L(e,t){if(!O)return Yt(e);var n=Yt(k);if(n===null)n=k.appendChild(Jt());else if(t&&n.nodeType!==3){var r=Jt();return n?.before(r),ve(r),r}return t&&tn(n),ve(n),n}function Zt(e,t=!1){if(!O){var n=Yt(e);return n instanceof Comment&&n.data===``?Xt(n):n}if(t){if(k?.nodeType!==3){var r=Jt();return k?.before(r),ve(r),r}tn(k)}return k}function R(e,t=!1){if(!O)return Yt(e);var n=L(e,t);return A(e),n}function z(e,t=1,n=!1){let r=O?k:e;for(var i;t--;)i=r,r=Xt(r);if(!O)return r;if(n){if(r?.nodeType!==3){var a=Jt();return r===null?i?.after(a):r.before(a),ve(a),a}tn(r)}return ve(r),r}function Qt(e){e.textContent=``}function $t(){return!1}function en(e,t,n){return t==null||t===`http://www.w3.org/1999/xhtml`?n?document.createElement(e,{is:n}):document.createElement(e):n?document.createElementNS(t,e,{is:n}):document.createElementNS(t,e)}function tn(e){if(e.nodeValue.length<65536)return;let t=e.nextSibling;for(;t!==null&&t.nodeType===3;)t.remove(),e.nodeValue+=t.nodeValue,t=e.nextSibling}function nn(e){var t=H;if(t===null)return V.f|=E,e;if(!(t.f&32768)&&!(t.f&4))throw e;rn(e,t)}function rn(e,t){if(!(t!==null&&t.f&16384)){for(;t!==null;){if(t.f&128&&!(t.f&33570816)){if(!(t.f&32768))throw e;try{t.b.error(e);return}catch(t){e=t}}t=t.parent}throw e}}function an(e){H===null&&(V===null&&Ae(e),ke()),Nn&&Oe(e)}function on(e,t){var n=t.last;n===null?t.last=t.first=e:(n.next=e,e.prev=n,t.last=e)}function sn(e,t){var n=H;n!==null&&n.f&8192&&(e|=v);var r={ctx:j,deps:null,nodes:null,f:e|g|512,first:null,fn:t,last:null,next:null,parent:n,b:n&&n.b,prev:null,teardown:null,wv:0,ac:null};N?.register_created_effect(r);var i=r;if(e&4)bt===null?wt.ensure().schedule(r):bt.push(r);else if(t!==null){try{tr(r)}catch(e){throw Cn(r),e}i.deps===null&&i.teardown===null&&i.nodes===null&&i.first===i.last&&!(i.f&524288)&&(i=i.first,e&16&&e&65536&&i!==null&&(i.f|=S))}if(i!==null&&(i.parent=n,n!==null&&on(i,n),V!==null&&V.f&2&&!(e&64))){var a=V;(a.effects??=[]).push(i)}return r}function cn(){return V!==null&&!Fn}function ln(e){let t=sn(8,null);return Je(t,h),t.teardown=e,t}function un(e){an(`$effect`);var t=H.f;if(!V&&t&32&&j!==null&&!j.i){var n=j;(n.e??=[]).push(e)}else return dn(e)}function dn(e){return sn(4|w,e)}function fn(e){return an(`$effect.pre`),sn(8|w,e)}function pn(e){wt.ensure();let t=sn(64|C,e);return()=>{Cn(t)}}function mn(e){wt.ensure();let t=sn(64|C,e);return(e={})=>new Promise(n=>{e.outro?En(t,()=>{Cn(t),n(void 0)}):(Cn(t),n(void 0))})}function hn(e){return sn(4,e)}function gn(e){return sn(te|C,e)}function _n(e,t=0){return sn(8|t,e)}function B(e,t=[],n=[],r=[]){tt(r,t,n,t=>{sn(8,()=>{e(...t.map(U))})})}function vn(e,t=0){return sn(16|t,e)}function yn(e){return sn(32|C,e)}function bn(e){var t=e.teardown;if(t!==null){let n=Nn,r=V;Pn(!0),In(null);try{t.call(null)}catch(t){rn(t,e.parent)}finally{Pn(n),In(r)}}}function xn(e,t=!1){var n=e.first;for(e.first=e.last=null;n!==null;){let e=n.ac;e!==null&&$e(()=>{e.abort(ue)});var r=n.next;n.f&64?n.parent=null:Cn(n,t),n=r}}function Sn(e){for(var t=e.first;t!==null;){var n=t.next;t.f&32||Cn(t),t=n}}function Cn(e,t=!0){var n=!1;(t||e.f&262144)&&e.nodes!==null&&e.nodes.end!==null&&(wn(e.nodes.start,e.nodes.end),n=!0),e.f|=x,xn(e,t&&!n),er(e,0);var r=e.nodes&&e.nodes.t;if(r!==null)for(let e of r)e.stop();bn(e),e.f^=x,e.f|=y;var i=e.parent;i!==null&&i.first!==null&&Tn(e),e.next=e.prev=e.teardown=e.ctx=e.deps=e.fn=e.nodes=e.ac=e.b=null}function wn(e,t){for(;e!==null;){var n=e===t?null:Xt(e);e.remove(),e=n}}function Tn(e){var t=e.parent,n=e.prev,r=e.next;n!==null&&(n.next=r),r!==null&&(r.prev=n),t!==null&&(t.first===e&&(t.first=r),t.last===e&&(t.last=n))}function En(e,t,n=!0){var r=[];e.f|=256,Dn(e,r,!0);var i=()=>{n&&Cn(e),t&&t()},a=r.length;if(a>0){var o=()=>--a||i();for(var s of r)s.out(o)}else i()}function Dn(e,t,n){if(!(e.f&8192)){e.f^=v;var r=e.nodes&&e.nodes.t;if(r!==null)for(let e of r)(e.is_global||n)&&t.push(e);for(var i=e.first;i!==null;){var a=i.next;if(!(i.f&64)){var o=!!(i.f&65536)||!!(i.f&32)&&!!(e.f&16);Dn(i,t,o?n:!1)}i=a}}}function On(e){e.f&=-257,kn(e,!0)}function kn(e,t){if(!(e.f&256)&&e.f&8192){e.f^=v,e.f&1024||(Je(e,g),wt.ensure().schedule(e));for(var n=e.first;n!==null;){var r=n.next,i=!!(n.f&65536)||!!(n.f&32);kn(n,i?t:!1),n=r}var a=e.nodes&&e.nodes.t;if(a!==null)for(let e of a)(e.is_global||t)&&e.in()}}function An(e,t){if(e.nodes)for(var n=e.nodes.start,r=e.nodes.end;n!==null;){var i=n===r?null:Xt(n);t.append(n),n=i}}var jn=null,Mn=!1,Nn=!1;function Pn(e){Nn=e}var V=null,Fn=!1;function In(e){V=e}var H=null;function Ln(e){H=e}var Rn=null;function zn(e){V!==null&&(V.f&2097152||V.f&2)&&(Rn??=new Set).add(e)}var Bn=null,Vn=0,Hn=null;function Un(e){Hn=e}var Wn=1,Gn=0,Kn=Gn;function qn(e){Kn=e}function Jn(){return++Wn}function Yn(e){var t=e.f;if(t&2048)return!0;if(t&4096){for(var n=e.deps,r=n.length,i=0;i<r;i++){var a=n[i];if(Yn(a)&&dt(a),a.wv>e.wv)return!0}t&512&>===null&&Je(e,h)}return!1}function Xn(e,t,n=!0){var r=e.reactions;if(r!==null&&!(Rn!==null&&Rn.has(e)))for(var i=0;i<r.length;i++){var a=r[i];a.f&2?Xn(a,t,!1):t===a&&(n?Je(a,g):a.f&1024&&Je(a,_),kt(a))}}function Zn(e){var t=Bn,n=Vn,r=Hn,i=V,a=Rn,o=j,s=Fn,c=Kn,l=e.f;Bn=null,Vn=0,Hn=null,V=l&96?null:e,Rn=null,Re(e.ctx),Fn=!1,Kn=++Gn,e.ac!==null&&($e(()=>{e.ac.abort(ue)}),e.ac=null);try{e.f|=T;var u=e.fn,d=u();e.f|=b;var f=Qn(e);if(He()&&Hn!==null&&!Fn&&f!==null&&!(e.f&6146))for(var p=0;p<Hn.length;p++)Xn(Hn[p],e);if(i!==null&&i!==e){if(Gn++,i.deps!==null)for(let e=0;e<n;e+=1)i.deps[e].rv=Gn;if(t!==null)for(let e of t)e.rv=Gn;Hn!==null&&(r===null?r=Hn:r.push(...Hn))}return e.f&8388608&&(e.f^=E),d}catch(t){return Qn(e),nn(t)}finally{e.f^=T,Bn=t,Vn=n,Hn=r,V=i,Rn=a,Re(o),Fn=s,Kn=c}}function Qn(e){var t=e.deps,n=N?.is_fork;if(Bn!==null){var r;if(n||er(e,Vn),t!==null&&Vn>0)for(t.length=Vn+Bn.length,r=0;r<Bn.length;r++)t[Vn+r]=Bn[r];else e.deps=t=Bn;if(cn()&&e.f&512)for(r=Vn;r<t.length;r++)(t[r].reactions??=[]).push(e)}else!n&&t!==null&&Vn<t.length&&(er(e,Vn),t.length=Vn);return t}function $n(e,r){let i=r.reactions;if(i!==null){var a=t.call(i,e);if(a!==-1){var o=i.length-1;o===0?i=r.reactions=null:(i[a]=i[o],i.pop())}}if(i===null&&r.f&2&&(Bn===null||!n.call(Bn,r))){var s=r;s.f&512&&(s.f^=512),s.v!==D&&Ye(s),s.ac!==null&&$e(()=>{s.ac.abort(ue),s.ac=null,Je(s,g)}),ft(s),er(s,0)}}function er(e,t){var n=e.deps;if(n!==null)for(var r=t;r<n.length;r++)$n(e,n[r])}function tr(e){var t=e.f;if(!(t&16384)){Je(e,h);var n=H,r=Mn;H=e,Mn=!(t&96);try{t&16777232?Sn(e):xn(e),bn(e);var i=Zn(e);e.teardown=typeof i==`function`?i:null,e.wv=Wn}finally{Mn=r,H=n}}}async function nr(){await Promise.resolve(),Tt()}function U(e){var t=!!(e.f&2);if(jn?.add(e),V!==null&&!Fn&&!(H!==null&&H.f&16384)&&(Rn===null||!Rn.has(e))){var r=V.deps;if(V.f&2097152)e.rv<Gn&&(e.rv=Gn,Bn===null&&r!==null&&r[Vn]===e?Vn++:Bn===null?Bn=[e]:Bn.push(e));else{V.deps??=[],n.call(V.deps,e)||V.deps.push(e);var i=e.reactions;i===null?e.reactions=[V]:n.call(i,V)||i.push(V)}}if(Nn&&Nt.has(e))return Nt.get(e);if(t){var a=e;if(Nn){var o=a.v;return(!(a.f&1024)&&a.reactions!==null||ir(a))&&(o=ut(a)),Nt.set(a,o),o}var s=!(a.f&512)&&!Fn&&V!==null&&(Mn||!!(V.f&512)),c=(a.f&b)===0;Yn(a)&&(s&&(a.f|=512),dt(a)),s&&!c&&(pt(a),rr(a))}if(gt?.has(e))return gt.get(e);if(e.f&8388608)throw e.v;return e.v}function rr(e){if(e.f|=512,e.deps!==null)for(let t of e.deps)(t.reactions??=[]).push(e),t.f&2&&!(t.f&512)&&(pt(t),rr(t))}function ir(e){if(e.v===D)return!0;if(e.deps===null)return!1;for(let t of e.deps)if(Nt.has(t)||t.f&2&&ir(t))return!0;return!1}function ar(e){var t=Fn;try{return Fn=!0,e()}finally{Fn=t}}function or(e){if(!(typeof e!=`object`||!e||e instanceof EventTarget)){if(ne in e)sr(e);else if(!Array.isArray(e))for(let t in e){let n=e[t];typeof n==`object`&&n&&ne in n&&sr(n)}}}function sr(e,t=new Set){if(typeof e==`object`&&e&&!(e instanceof EventTarget)&&!t.has(e)){t.add(e),e instanceof Date&&e.getTime();for(let n in e)try{sr(e[n],t)}catch{}let n=l(e);if(n!==Object.prototype&&n!==Array.prototype&&n!==Map.prototype&&n!==Set.prototype&&n!==Date.prototype){let t=o(n);for(let n in t){let r=t[n].get;if(r)try{r.call(e)}catch{}}}}}[...`allowfullscreen.async.autofocus.autoplay.checked.controls.default.disabled.formnovalidate.indeterminate.inert.ismap.loop.multiple.muted.nomodule.novalidate.open.playsinline.readonly.required.reversed.seamless.selected.webkitdirectory.defer.disablepictureinpicture.disableremoteplayback`.split(`.`)];var cr=[`touchstart`,`touchmove`];function lr(e){return cr.includes(e)}var ur=Symbol(`events`),dr=new Set,fr=new Set;function pr(e,t,n,r={}){function i(e){if(r.capture||vr.call(t,e),!e.cancelBubble)return $e(()=>n?.call(this,e))}return e.startsWith(`pointer`)||e.startsWith(`touch`)||e===`wheel`?(i.__removed=!1,Ge(()=>{i.__removed||t.addEventListener(e,i,r)})):t.addEventListener(e,i,r),i}function mr(e,t,n,r,i){var a={capture:r,passive:i},o=pr(e,t,n,a);(t===document.body||t===window||t===document||t instanceof HTMLMediaElement)&&ln(()=>{o.__removed=!0,t.removeEventListener(e,o,a)})}function W(e,t,n){(t[ur]??={})[e]=n}function hr(e){for(var t=0;t<e.length;t++)dr.add(e[t]);for(var n of fr)n(e)}var gr=null,_r=!1;function vr(e){var t=this,n=t.ownerDocument,r=e.type,a=e.composedPath?.()||[],o=a[0]||e.target;gr=e,_r||(_r=!0,setTimeout(()=>{_r=!1,gr=null}));var s=0,c=gr===e&&e[ur];if(c){var l=a.indexOf(c);if(l!==-1&&(t===document||t===window)){e[ur]=t;return}var u=a.indexOf(t);if(u===-1)return;l<=u&&(s=l)}if(o=a[s]||e.target,o!==t){i(e,`currentTarget`,{configurable:!0,get(){return o||n}});var d=V,f=H;In(null),Ln(null);try{for(var p,m=[];o!==null&&o!==t;){try{var h=o[ur]?.[r];h!=null&&(!o.disabled||e.target===o)&&h.call(o,e)}catch(e){p?m.push(e):p=e}if(e.cancelBubble)break;s++,o=s<a.length?a[s]:null}if(p){for(let e of m)queueMicrotask(()=>{throw e});throw p}}finally{e[ur]=t,delete e.currentTarget,In(d),Ln(f)}}}var yr=globalThis?.window?.trustedTypes&&globalThis.window.trustedTypes.createPolicy(`svelte-trusted-html`,{createHTML:e=>e});function br(e){return yr?.createHTML(e)??e}function xr(e){var t=en(`template`);return t.innerHTML=br(e.replaceAll(`<!>`,`<!---->`)),t.content}function Sr(e,t){var n=H;n.nodes===null&&(n.nodes={start:e,end:t,a:null,t:null})}function G(e,t){var n=!!(t&1),r=!!(t&2),i,a=!e.startsWith(`<!>`);return()=>{if(O)return Sr(k,null),k;i===void 0&&(i=xr(a?e:`<!>`+e),n||(i=Yt(i)));var t=r||Wt?document.importNode(i,!0):i.cloneNode(!0);if(n){var o=Yt(t),s=t.lastChild;Sr(o,s)}else Sr(t,t);return t}}function Cr(e,t,n=`svg`){var r=!e.startsWith(`<!>`),i=!!(t&1),a=`<${n}>${r?e:`<!>`+e}</${n}>`,o;return()=>{if(O)return Sr(k,null),k;if(!o){var e=Yt(xr(a));if(i)for(o=document.createDocumentFragment();Yt(e);)o.appendChild(Yt(e));else o=Yt(e)}var t=o.cloneNode(!0);if(i){var n=Yt(t),r=t.lastChild;Sr(n,r)}else Sr(t,t);return t}}function wr(e,t){return Cr(e,t,`svg`)}function Tr(e=``){if(!O){var t=Jt(e+``);return Sr(t,t),t}var n=k;return n.nodeType===3?tn(n):(n.before(n=Jt()),ve(n)),Sr(n,n),n}function Er(){if(O)return Sr(k,null),k;var e=document.createDocumentFragment(),t=document.createComment(``),n=Jt();return e.append(t,n),Sr(t,n),e}function K(e,t){if(O){var n=H;(!(n.f&32768)||n.nodes.end===null)&&(n.nodes.end=k),ye();return}e!==null&&e.before(t)}function Dr(e){let t=0,n=Ft(0),r;return()=>{cn()&&(U(n),_n(()=>(t===0&&(r=ar(()=>e(()=>Vt(n)))),t+=1,()=>{Ge(()=>{--t,t===0&&(r?.(),r=void 0,Vt(n))})})))}}var Or=S|C;function kr(e,t,n,r){new Ar(e,t,n,r)}var Ar=class{parent;is_pending=!1;transform_error;#e;#t=O?k:null;#n;#r;#i;#a=null;#o=null;#s=null;#c=null;#l=0;#u=0;#d=!1;#f=new Set;#p=new Set;#m=null;#h=Dr(()=>(this.#m=Ft(this.#l),()=>{this.#m=null}));constructor(e,t,n,r){this.#e=e,this.#n=t,this.#r=e=>{var t=H;t.b=this,t.f|=128,n(e)},this.parent=H.b,this.transform_error=r??this.parent?.transform_error??(e=>e),this.#i=vn(()=>{if(O){let e=this.#t;ye();let t=e.data===`[!`;if(e.data.startsWith(`[?`)){let t=JSON.parse(e.data.slice(2));this.#_(t)}else t?this.#y():this.#g()}else this.#b()},Or),O&&(this.#e=k)}#g(){try{this.#a=yn(()=>this.#r(this.#e))}catch(e){this.error(e)}}#_(e){let t=this.#n.failed,{reset:n,invoke_onerror:r}=this.#v(e);Ge(r),t&&(this.#s=yn(()=>{t(this.#e,()=>e,()=>n)}))}#v(e){var t=!1,n=!1;let r=()=>{if(t){ge();return}t=!0,n&&Fe(),this.#s!==null&&En(this.#s,()=>{this.#s=null}),this.#S(()=>{this.#b()})};return{reset:r,invoke_onerror:()=>{try{n=!0,this.#n.onerror?.(e,r),n=!1}catch(e){rn(e,this.#i&&this.#i.parent)}}}}#y(){let e=this.#n.pending;e&&(this.is_pending=!0,this.#o=yn(()=>e(this.#e)),Ge(()=>{var e=this.#c=document.createDocumentFragment(),t=Jt(),n=!1;if(e.append(t),this.#a=this.#S(()=>{try{return yn(()=>this.#r(t))}catch(e){try{this.error(e),n=!0}catch(e){rn(e,this.#i.parent)}return null}}),this.#a===null){this.#c=null,n&&this.#x(N);return}this.#u===0&&(this.#e.before(e),this.#c=null,En(this.#o,()=>{this.#o=null}),this.#x(N))}))}#b(){try{if(this.is_pending=this.has_pending_snippet(),this.#u=0,this.#l=0,this.#a=yn(()=>{this.#r(this.#e)}),this.#u>0){var e=this.#c=document.createDocumentFragment();An(this.#a,e);let t=this.#n.pending;this.#o=yn(()=>t(this.#e))}else this.#x(N)}catch(e){this.error(e)}}#x(e){this.is_pending=!1,e.transfer_effects(this.#f,this.#p)}defer_effect(e){Xe(e,this.#f,this.#p)}is_rendered(){return!this.is_pending&&(!this.parent||this.parent.is_rendered())}has_pending_snippet(){return!!this.#n.pending}#S(e){var t=H,n=V,r=j;Ln(this.#i),In(this.#i),Re(this.#i.ctx);try{return wt.ensure(),e()}finally{Ln(t),In(n),Re(r)}}#C(e,t){if(!this.has_pending_snippet()){this.parent&&this.parent.#C(e,t);return}this.#u+=e,this.#u===0&&(this.#x(t),this.#o&&En(this.#o,()=>{this.#o=null}),this.#c&&=(this.#e.before(this.#c),null))}update_pending_count(e,t){this.#C(e,t),this.#l+=e,!(!this.#m||this.#d)&&(this.#d=!0,Ge(()=>{this.#d=!1,this.#m&&zt(this.#m,this.#l)}))}get_effect_pending(){return this.#h(),U(this.#m)}error(e){if(!this.#n.onerror&&!this.#n.failed)throw e;N?.is_fork?(this.#a&&N.skip_effect(this.#a),this.#o&&N.skip_effect(this.#o),this.#s&&N.skip_effect(this.#s),N.oncommit(()=>{this.#w(e)})):this.#w(e)}#w(e){this.#a&&=(Cn(this.#a),null),this.#o&&=(Cn(this.#o),null),this.#s&&=(Cn(this.#s),null),O&&(ve(this.#t),be(),ve(xe()));let t=this.#n.failed,n=e=>{let{reset:n,invoke_onerror:r}=this.#v(e);r(),t&&(this.#s=this.#S(()=>{try{return yn(()=>{var r=H;r.b=this,r.f|=128,t(this.#e,()=>e,()=>n)})}catch(e){return rn(e,this.#i.parent),null}}))};Ge(()=>{var t;try{t=this.transform_error(e)}catch(e){rn(e,this.#i&&this.#i.parent);return}typeof t==`object`&&t&&typeof t.then==`function`?t.then(n,e=>rn(e,this.#i&&this.#i.parent)):n(t)})}};function q(e,t){var n=t==null?``:typeof t==`object`?`${t}`:t;n!==(e[ce]??=e.nodeValue)&&(e[ce]=n,e.nodeValue=`${n}`)}function jr(e,t){return Nr(e,t)}var Mr=new Map;function Nr(e,{target:t,anchor:n,props:i={},events:a,context:o,intro:s=!0,transformError:c}){qt();var l=void 0,u=mn(()=>{var s=n??t.appendChild(Jt());kr(s,{pending:()=>{}},t=>{ze({});var n=j;if(o&&(n.c=o),a&&(i.$$events=a),O&&Sr(t,null),l=e(t,i)||Ve(),O&&(H.nodes.end=k,k===null||k.nodeType!==8||k.data!==`]`))throw he(),fe;Be()},c);var u=new Set,d=e=>{for(var n=0;n<e.length;n++){var r=e[n];if(!u.has(r)){u.add(r);var i=lr(r);for(let e of[t,document]){var a=Mr.get(e);a===void 0&&(a=new Map,Mr.set(e,a));var o=a.get(r);o===void 0?(e.addEventListener(r,vr,{passive:i}),a.set(r,1)):a.set(r,o+1)}}}};return d(r(dr)),fr.add(d),()=>{for(var e of u)for(let n of[t,document]){var r=Mr.get(n),i=r.get(e);--i==0?(n.removeEventListener(e,vr),r.delete(e),r.size===0&&Mr.delete(n)):r.set(e,i)}fr.delete(d),s!==n&&s.parentNode?.removeChild(s)}});return Pr.set(l,u),l}var Pr=new WeakMap,Fr=class{anchor;#e=new Map;#t=new Map;#n=new Map;#r=new Set;#i=!0;constructor(e,t=!0){this.anchor=e,this.#i=t}#a=e=>{if(this.#e.has(e)){var t=this.#e.get(e),n=this.#t.get(t);if(n)On(n),this.#r.delete(t);else{var r=this.#n.get(t);r&&(On(r.effect),this.#t.set(t,r.effect),this.#n.delete(t),r.fragment.lastChild.remove(),this.anchor.before(r.fragment),n=r.effect)}for(let[t,n]of this.#e){if(this.#e.delete(t),t===e)break;let r=this.#n.get(n);r&&(Cn(r.effect),this.#n.delete(n))}for(let[e,r]of this.#t){if(e===t||this.#r.has(e))continue;let i=()=>{if(Array.from(this.#e.values()).includes(e)){var t=document.createDocumentFragment();An(r,t),t.append(Jt()),this.#n.set(e,{effect:r,fragment:t})}else Cn(r);this.#r.delete(e),this.#t.delete(e)};this.#i||!n?(this.#r.add(e),En(r,i,!1)):i()}}};#o=e=>{this.#e.delete(e);let t=Array.from(this.#e.values());for(let[e,n]of this.#n)t.includes(e)||(Cn(n.effect),this.#n.delete(e))};ensure(e,t){var n=N,r=$t();if(t&&!this.#t.has(e)&&!this.#n.has(e)){if(r){var i=document.createDocumentFragment(),a=Jt();i.append(a),this.#n.set(e,{effect:yn(()=>t(a)),fragment:i})}else this.#t.set(e,yn(()=>t(this.anchor)))}if(this.#e.set(n,e),r){for(let[t,r]of this.#t)t===e?n.unskip_effect(r):n.skip_effect(r);for(let[t,r]of this.#n)t===e?n.unskip_effect(r.effect):n.skip_effect(r.effect);n.oncommit(this.#a),n.ondiscard(this.#o)}else O&&(this.anchor=k),this.#a(n)}};function J(e,t,n=!1){var r;O&&(r=k,ye());var i=new Fr(e),a=n?S:0;function o(e,t){if(O){var n=Se(r);if(e!==parseInt(n.substring(1))){var a=xe();ve(a),i.anchor=a,_e(!1),i.ensure(e,t),_e(!0);return}}i.ensure(e,t)}vn(()=>{var e=!1;t((t,n=0)=>{e=!0,o(n,t)}),e||o(-1,null)},a)}function Ir(e,t){return t}function Lr(e,t,n){for(var i=[],a=t.length,o,s=t.length,c=0;c<a;c++){let n=t[c];En(n,()=>{if(o){if(o.pending.delete(n),o.done.add(n),o.pending.size===0){var t=e.outrogroups;Rr(e,r(o.done)),t.delete(o),t.size===0&&(e.outrogroups=null)}}else--s},!1)}if(s===0){var l=i.length===0&&n!==null&&e.pending.size===0;if(l){var u=n,d=u.parentNode;Qt(d),d.append(u),e.items.clear()}Rr(e,t,!l)}else o={pending:new Set(t),done:new Set},(e.outrogroups??=new Set).add(o)}function Rr(e,t,n=!0){var r;if(e.pending.size>0){r=new Set;for(let t of e.pending.values())for(let n of t)r.add(e.items.get(n).e)}for(var i=0;i<t.length;i++){var a=t[i];r?.has(a)?(a.f|=ee,An(a,document.createDocumentFragment())):Cn(t[i],n)}}var zr;function Y(t,n,i,a,o,s=null){var c=t,l=new Map;if(n&4){var u=t;c=O?ve(Yt(u)):u.appendChild(Jt())}O&&ye();var d=null,f=ct(()=>{var t=i();return e(t)?t:t==null?[]:r(t)}),p,m=new Map,h=!0;function g(e){v.effect.f&16384||(v.pending.delete(e),v.fallback=d,Vr(v,p,c,n,a),d!==null&&(p.length===0?d.f&33554432?(d.f^=ee,Ur(d,null,c)):On(d):En(d,()=>{d=null})))}function _(e){v.pending.delete(e)}var v={effect:vn(()=>{p=U(f);var e=p.length;let t=!1;O&&Se(c)===`[!`!=(e===0)&&(c=xe(),ve(c),_e(!1),t=!0);for(var r=new Set,u=N,v=$t(),y=0;y<e;y+=1){O&&k.nodeType===8&&k.data===`]`&&(c=k,t=!0,_e(!1));var b=p[y],x=a(b,y),S=h?null:l.get(x);S?(S.v&&zt(S.v,b),S.i&&zt(S.i,y),v&&u.unskip_effect(S.e)):(S=Hr(l,h?c:zr??=Jt(),b,x,y,o,n,i),h||(S.e.f|=ee),l.set(x,S)),r.add(x)}if(e===0&&s&&!d&&(h?d=yn(()=>s(c)):(d=yn(()=>s(zr??=Jt())),d.f|=ee)),e>r.size&&De(``,``,``),O&&e>0&&ve(xe()),!h){if(m.set(u,r),v){for(let[e,t]of l)r.has(e)||u.skip_effect(t.e);u.oncommit(g),u.ondiscard(_)}else g(u)}t&&_e(!0),U(f)}),flags:n,items:l,pending:m,outrogroups:null,fallback:d};h=!1,O&&(c=k)}function Br(e){for(;e!==null&&!(e.f&32);)e=e.next;return e}function Vr(e,t,n,i,a){var o=!!(i&8),s=t.length,c=e.items,l=Br(e.effect.first),u,d=null,f,p=[],m=[],h,g,_,v;if(o)for(v=0;v<s;v+=1)h=t[v],g=a(h,v),_=c.get(g).e,_.f&33554432||(_.nodes?.a?.measure(),(f??=new Set).add(_));for(v=0;v<s;v+=1){if(h=t[v],g=a(h,v),_=c.get(g).e,e.outrogroups!==null)for(let t of e.outrogroups)t.pending.delete(_),t.done.delete(_);if(_.f&8192&&(On(_),o&&(_.nodes?.a?.unfix(),(f??=new Set).delete(_))),_.f&33554432){if(_.f^=ee,_===l)Ur(_,null,n);else{var y=d?d.next:l;_===e.effect.last&&(e.effect.last=_.prev),_.prev&&(_.prev.next=_.next),_.next&&(_.next.prev=_.prev),Wr(e,d,_),Wr(e,_,y),Ur(_,y,n),d=_,p=[],m=[],l=Br(d.next);continue}}if(_!==l){if(u!==void 0&&u.has(_)){if(p.length<m.length){var b=m[0],x;d=b.prev;var S=p[0],C=p[p.length-1];for(x=0;x<p.length;x+=1)Ur(p[x],b,n);for(x=0;x<m.length;x+=1)u.delete(m[x]);Wr(e,S.prev,C.next),Wr(e,d,S),Wr(e,C,b),l=b,d=C,--v,p=[],m=[]}else u.delete(_),Ur(_,l,n),Wr(e,_.prev,_.next),Wr(e,_,d===null?e.effect.first:d.next),Wr(e,d,_),d=_;continue}for(p=[],m=[];l!==null&&l!==_;)(u??=new Set).add(l),m.push(l),l=Br(l.next);if(l===null)continue}_.f&33554432||p.push(_),d=_,l=Br(_.next)}if(e.outrogroups!==null){for(let t of e.outrogroups)t.pending.size===0&&(Rr(e,r(t.done)),e.outrogroups?.delete(t));e.outrogroups.size===0&&(e.outrogroups=null)}if(l!==null||u!==void 0){var w=[];if(u!==void 0)for(_ of u)_.f&8192||w.push(_);for(;l!==null;)!(l.f&8192)&&l!==e.fallback&&w.push(l),l=Br(l.next);var T=w.length;if(T>0){var te=i&4&&s===0?n:null;if(o){for(v=0;v<T;v+=1)w[v].nodes?.a?.measure();for(v=0;v<T;v+=1)w[v].nodes?.a?.fix()}Lr(e,w,te)}}o&&Ge(()=>{if(f!==void 0)for(_ of f)_.nodes?.a?.apply()})}function Hr(e,t,n,r,i,a,o,s){var c=o&1?o&16?Ft(n):It(n,!1,!1):null,l=o&2?Ft(i):null;return{v:c,i:l,e:yn(()=>(a(t,c??n,l??i,s),()=>{e.delete(r)}))}}function Ur(e,t,n){if(e.nodes)for(var r=e.nodes.start,i=e.nodes.end,a=t&&!(t.f&33554432)?t.nodes.start:n;r!==null;){var o=Xt(r);if(a.before(r),r===i)return;r=o}}function Wr(e,t,n){t===null?e.effect.first=n:t.next=n,n===null?e.effect.last=t:n.prev=t}function Gr(e){var t,n,r=``;if(typeof e==`string`||typeof e==`number`)r+=e;else if(typeof e==`object`){if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(n=Gr(e[t]))&&(r&&(r+=` `),r+=n)}else for(n in e)e[n]&&(r&&(r+=` `),r+=n)}return r}function Kr(){for(var e,t,n=0,r=``,i=arguments.length;n<i;n++)(e=arguments[n])&&(t=Gr(e))&&(r&&(r+=` `),r+=t);return r}function qr(e){return typeof e==`object`?Kr(e):e??``}var Jr=[...`+\r\f\xA0\v`];function Yr(e,t,n){var r=e==null?``:``+e;if(t&&(r=r?r+` `+t:t),n){for(var i of Object.keys(n))if(n[i])r=r?r+` `+i:i;else if(r.length)for(var a=i.length,o=0;(o=r.indexOf(i,o))>=0;){var s=o+a;(o===0||Jr.includes(r[o-1]))&&(s===r.length||Jr.includes(r[s]))?r=(o===0?``:r.substring(0,o))+r.substring(s+1):o=s}}return r===``?null:r}function Xr(e,t=!1){var n=t?` !important;`:`;`,r=``;for(var i of Object.keys(e)){var a=e[i];a!=null&&a!==``&&(r+=` `+i+`: `+a+n)}return r}function Zr(e){return e[0]!==`-`||e[1]!==`-`?e.toLowerCase():e}function Qr(e,t){if(t){var n=``,r,i;if(Array.isArray(t)?(r=t[0],i=t[1]):r=t,e){e=String(e).replaceAll(/\/\*.*?\*\//g,``).trim();var a=!1,o=0,s=!1,c=[];r&&c.push(...Object.keys(r).map(Zr)),i&&c.push(...Object.keys(i).map(Zr));var l=0,u=-1;let t=e.length;for(var d=0;d<t;d++){var f=e[d];if(s?f===`/`&&e[d-1]===`*`&&(s=!1):a?a===f&&(a=!1):f===`/`&&e[d+1]===`*`?s=!0:f===`"`||f===`'`?a=f:f===`(`?o++:f===`)`&&o--,!s&&a===!1&&o===0){if(f===`:`&&u===-1)u=d;else if(f===`;`||d===t-1){if(u!==-1){var p=Zr(e.substring(l,u).trim());if(!c.includes(p)){f!==`;`&&d++;var m=e.substring(l,d).trim();n+=` `+m+`;`}}l=d+1,u=-1}}}}return r&&(n+=Xr(r)),i&&(n+=Xr(i,!0)),n=n.trim(),n===``?null:n}return e==null?null:String(e)}function X(e,t,n,r,i,a){var o=e[oe];if(O||o!==n||o===void 0){var s=Yr(n,r,a);(!O||s!==e.getAttribute(`class`))&&(s==null?e.removeAttribute(`class`):t?e.className=s:e.setAttribute(`class`,s)),e[oe]=n}else if(a&&i!==a)for(var c in a){var l=!!a[c];(i==null||l!==!!i[c])&&e.classList.toggle(c,l)}return a}function $r(e,t={},n,r){for(var i in n){var a=n[i];t[i]!==a&&(n[i]==null?e.style.removeProperty(i):e.style.setProperty(i,a,r))}}function Z(e,t,n,r){var i=e[se];if(O||i!==t){var a=Qr(t,r);(!O||a!==e.getAttribute(`style`))&&(a==null?e.removeAttribute(`style`):e.style.cssText=a),e[se]=t}else r&&(Array.isArray(r)?($r(e,n?.[0],r[0]),$r(e,n?.[1],r[1],`important`)):$r(e,n,r));return r}var ei=Symbol(`is custom element`),ti=Symbol(`is html`),ni=de?`link`:`LINK`;function ri(e){if(O){var t=!1,n=()=>{if(!t){if(t=!0,e.hasAttribute(`value`)){var n=e.value;Q(e,`value`,null),e.value=n}if(e.hasAttribute(`checked`)){var r=e.checked;Q(e,`checked`,null),e.checked=r}}};e[le]=n,Ge(n),Qe()}}function Q(e,t,n,r){var i=ii(e);O&&(i[t]=e.getAttribute(t),t===`src`||t===`srcset`||t===`href`&&e.nodeName===ni)||i[t]!==(i[t]=n)&&(t===`loading`&&(e[ie]=n),n==null?e.removeAttribute(t):typeof n!=`string`&&oi(e).has(t)?e[t]=n:e.setAttribute(t,n))}function ii(e){return e[ae]??={[ei]:e.nodeName.includes(`-`),[ti]:e.namespaceURI===pe}}var ai=new Map;function oi(e){var t=e.getAttribute(`is`)||e.nodeName,n=ai.get(t);if(n)return n;ai.set(t,n=new Set);for(var r,i=e,a=Element.prototype;a!==i;){for(var s in r=o(i),r)r[s].set&&s!==`innerHTML`&&s!==`textContent`&&s!==`innerText`&&n.add(s);i=l(i)}return n}function si(e,t,n=t){var r=new WeakSet;et(e,`input`,async i=>{var a=i?e.defaultValue:e.value;if(a=ci(e)?li(a):a,n(a),N!==null&&r.add(N),await nr(),a!==(a=t())){var o=e.selectionStart,s=e.selectionEnd,c=e.value.length;if(e.value=a??``,s!==null){var l=e.value.length;o===s&&s===c&&l>c?(e.selectionStart=l,e.selectionEnd=l):(e.selectionStart=o,e.selectionEnd=Math.min(s,l))}}}),(O&&e.defaultValue!==e.value||ar(t)==null&&e.value)&&(n(ci(e)?li(e.value):e.value),N!==null&&r.add(N)),_n(()=>{var n=t();if(e===document.activeElement){var i=N;if(r.has(i))return}ci(e)&&n===li(e.value)||(e.type!==`date`||n||e.value)&&n!==e.value&&(e.value=n??``)})}function ci(e){var t=e.type;return t===`number`||t===`range`}function li(e){return e===``?null:+e}function ui(e,t){return e===t||e?.[ne]===t}function di(e=Ve(),t,n,r){var i=j.r,a=H;return hn(()=>{var o,s;return _n(()=>{o=s,s=r?.()||[],ar(()=>{ui(n(...s),e)||(t(e,...s),o&&ui(n(...o),e)&&t(null,...o))})}),()=>{let r=a;for(;r!==i&&r.parent!==null&&r.parent.f&33554432;)r=r.parent;let o=()=>{s&&ui(n(...s),e)&&t(null,...s)},c=r.teardown;r.teardown=()=>{o(),c?.()}}}),e}function fi(e=!1){let t=j,n=t.l.u;if(!n)return;let r=()=>or(t.s);if(e){let e=0,n={},i=at(()=>{let r=!1,i=t.s;for(let e in i)i[e]!==n[e]&&(n[e]=i[e],r=!0);return r&&e++,e});r=()=>U(i)}n.b.length&&fn(()=>{pi(t,r),p(n.b)}),un(()=>{let e=ar(()=>n.m.map(f));return()=>{for(let t of e)typeof t==`function`&&t()}}),n.a.length&&un(()=>{pi(t,r),p(n.a)})}function pi(e,t){if(e.l.s)for(let t of e.l.s)U(t);t()}function mi(e){var t=Ft(0);return function(){return arguments.length===1?(F(t,U(t)+1),arguments[0]):(U(t),e())}}typeof window<`u`&&((window.__svelte??={}).v??=new Set).add(`5`);var hi=e=>`--`+e.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).toLowerCase();function gi(e){let t=/^#([0-9a-f]{6})([0-9a-f]{2})?$/i.exec(e.trim());if(!t)return null;let n=parseInt(t[1],16);return[n>>16&255,n>>8&255,n&255]}function _i(e){let t=e=>{let t=e/255;return t<=.03928?t/12.92:((t+.055)/1.055)**2.4};return .2126*t(e[0])+.7152*t(e[1])+.0722*t(e[2])}var vi=(e,t)=>(Math.max(e,t)+.05)/(Math.min(e,t)+.05);function yi(e,t){let n=gi(e),r=gi(t[0]),i=gi(t[1]);if(!n||!r||!i)return t[0];let a=_i(n);return vi(_i(r),a)>=vi(_i(i),a)?t[0]:t[1]}var bi=[[`--ink-on-accent`,`Accent`],[`--ink-on-mute`,`Mute`],[`--ink-on-solo`,`Solo`],[`--ink-on-record`,`Record`],[`--ink-on-success`,`Success`]];function xi(e,t){let n={};for(let[t,r]of Object.entries(e))n[hi(t)]=r;n[`--ink-dark`]=t[0],n[`--ink-light`]=t[1];for(let[r,i]of bi)e[i]&&(n[r]=yi(e[i],t));return n}var Si=`nota-remote:theme`,Ci=`nota-remote:vars`,wi=matchMedia(`(prefers-color-scheme: dark)`);function Ti(){try{let e=JSON.parse(localStorage.getItem(Si)??`null`);return e&&e.t===`theme`&&e.th?.[e.on]?e:null}catch{return null}}var Ei=new class{#e=P(I(Ti()));get msg(){return U(this.#e)}set msg(e){F(this.#e,e,!0)}#t=P(I(wi.matches));get phoneDark(){return U(this.#t)}set phoneDark(e){F(this.#t,e,!0)}#n=P(null);get legacyDark(){return U(this.#n)}set legacyDark(e){F(this.#n,e,!0)}constructor(){wi.addEventListener(`change`,e=>this.phoneDark=e.matches)}receive(e){this.msg=e;try{localStorage.setItem(Si,JSON.stringify(e))}catch{}}worn(e){let t=this.msg;if(!t)return null;let n=e===`phone`?this.phoneDark?t.dark:t.light:t.on,r=t.th[n]??t.th[t.on];return r?{id:n,...r}:null}get ink(){if(this.msg)return this.msg.ink;let e=getComputedStyle(document.documentElement);return[e.getPropertyValue(`--ink-dark`).trim(),e.getPropertyValue(`--ink-light`).trim()]}inkOn(e){return yi(e,this.ink)}apply(e){let t=document.documentElement,n=this.worn(e),r=n?n.dark:this.legacyDark!==!1;if(t.dataset.theme=r?`dark`:`light`,n&&this.msg){let e=xi(n.c,this.msg.ink);for(let[n,r]of Object.entries(e))t.style.setProperty(n,r);try{localStorage.setItem(Ci,JSON.stringify({dark:r,v:e}))}catch{}}let i=getComputedStyle(t).getPropertyValue(`--bg-app`).trim();i&&document.querySelector(`meta[name=theme-color]`)?.setAttribute(`content`,i)}},Di=`nota-remote:`,Oi={get(e,t=``){try{return localStorage.getItem(Di+e)??t}catch{return t}},set(e,t){try{localStorage.setItem(Di+e,t)}catch{}},del(e){try{localStorage.removeItem(Di+e)}catch{}}},ki={theme:`nota`,haptics:!0,countIn:!0,fullVel:!1,keysMode:`Scale`,expressive:!1,octave:3,key:null,xyHold:!0,bank:0,groupsOpen:[]};function Ai(){let e=navigator.userAgent;return/iPad/.test(e)||/Macintosh/.test(e)&&navigator.maxTouchPoints>1?`iPad`:/iPhone/.test(e)?`iPhone`:/Android/.test(e)?/Mobile/.test(e)?`Android phone`:`Android tablet`:`Phone`}var $=new class{#e=P(null);get proj(){return U(this.#e)}set proj(e){F(this.#e,e,!0)}#t=P(I({play:!1,rec:!1,loop:!1,met:!1,pos:0,bpm:120,ls:0,le:16,can:!1}));get tp(){return U(this.#t)}set tp(e){F(this.#t,e,!0)}#n=P(I([]));get lit(){return U(this.#n)}set lit(e){F(this.#n,e,!0)}#r=P(I({}));get who(){return U(this.#r)}set who(e){F(this.#r,e,!0)}#i=P(null);get mix(){return U(this.#i)}set mix(e){F(this.#i,e,!0)}#a=P(null);get xy(){return U(this.#a)}set xy(e){F(this.#a,e,!0)}#o=P(null);get mac(){return U(this.#o)}set mac(e){F(this.#o,e,!0)}#s=P(null);get ses(){return U(this.#s)}set ses(e){F(this.#s,e,!0)}#c=P(I({on:!1,pend:null}));get learn(){return U(this.#c)}set learn(e){F(this.#c,e,!0)}#l=P(null);get learned(){return U(this.#l)}set learned(e){F(this.#l,e,!0)}#u=P(`connecting`);get link(){return U(this.#u)}set link(e){F(this.#u,e,!0)}#d=P(-1);get rtt(){return U(this.#d)}set rtt(e){F(this.#d,e,!0)}#f=P(`wifi`);get via(){return U(this.#f)}set via(e){F(this.#f,e,!0)}#p=P(0);get conn(){return U(this.#p)}set conn(e){F(this.#p,e,!0)}#m=P(I(Oi.get(`host`,`Nota`)));get host(){return U(this.#m)}set host(e){F(this.#m,e,!0)}#h=P(null);get deny(){return U(this.#h)}set deny(e){F(this.#h,e,!0)}everConnected=!1;#g=P(I(Oi.get(`screen`,``)||`Pads`));get screen(){return U(this.#g)}set screen(e){F(this.#g,e,!0)}#_=P(!1);get bigTransport(){return U(this.#_)}set bigTransport(e){F(this.#_,e,!0)}#v=P(null);get sheet(){return U(this.#v)}set sheet(e){F(this.#v,e,!0)}#y=P(null);get toast(){return U(this.#y)}set toast(e){F(this.#y,e,!0)}#b=P(null);get countIn(){return U(this.#b)}set countIn(e){F(this.#b,e,!0)}#x=P(I(Oi.get(`name`,Ai())));get name(){return U(this.#x)}set name(e){F(this.#x,e,!0)}#S=P(I({...ki,...JSON.parse(Oi.get(`prefs`,`{}`)||`{}`)}));get prefs(){return U(this.#S)}set prefs(e){F(this.#S,e,!0)}posAt=0;posBase=0;ws=null;pingTimer=0;retryTimer=0;lostSince=0;lastPong=0;rtts=[];toastTimer=0;learnedTimer=0;pairCode=null;screenChosen=!!Oi.get(`screen`,``);held=new Map;constructor(){let e=/[#&]p=(\d{4})/.exec(location.hash);e&&(this.pairCode=e[1],history.replaceState(null,``,location.pathname+location.search)),pn(()=>{un(()=>{Oi.set(`prefs`,JSON.stringify(this.prefs))}),un(()=>{Oi.set(`screen`,this.screen)})})}get token(){return Oi.get(`token`)}get track(){let e=this.proj;return e?e.tracks.find(t=>t.id===e.you)??null:null}get playable(){return this.proj?.tracks.filter(e=>e.kind===`drum`||e.kind===`inst`||e.kind===`audio`)??[]}get canControl(){return this.proj?.access!==`play`}connect(){clearTimeout(this.retryTimer),this.ws&&(this.ws.onclose=null,this.ws.close());let e=location.protocol===`https:`?`wss:`:`ws:`,t;try{t=new WebSocket(`${e}//${location.host}/ws`)}catch{this.retry();return}this.ws=t;let n=Date.now();t.onopen=()=>{let e={v:1,name:this.name,model:Ai(),track:Number(Oi.get(`track`,`0`)),screen:this.screen,follow:Oi.get(`follow`)===`1`};this.pairCode?this.raw({t:`pair`,code:this.pairCode,...e}):this.token?this.raw({t:`hello`,token:this.token,...e}):(this.link=`expired`,this.deny=`new`)},t.onmessage=e=>{try{this.onMessage(JSON.parse(e.data))}catch{}},t.onclose=()=>{this.ws=null,clearInterval(this.pingTimer),this.link!==`left`&&this.link!==`expired`&&(this.link===`ok`||this.link===`weak`?(this.link=`lost`,this.lostSince=Date.now()):(this.link===`connecting`&&Date.now()-n>0&&!this.everConnected&&Date.now()-this.firstTry>4e3||this.link===`lost`&&Date.now()-this.lostSince>1e4)&&(this.link=`down`),this.retry())}}firstTry=Date.now();retry(){clearTimeout(this.retryTimer);let e=this.link===`down`?3e3:this.link===`lost`?700:1200;this.retryTimer=window.setTimeout(()=>this.connect(),e)}wake(){this.link!==`left`&&(!this.ws||this.ws.readyState>1||Date.now()-this.lastPong>3e3)&&((this.link===`ok`||this.link===`weak`)&&(this.link=`lost`,this.lostSince=Date.now()),this.connect())}startPing(){clearInterval(this.pingTimer),this.lastPong=Date.now();let e=()=>{if(Date.now()-this.lastPong>3500&&(this.link===`ok`||this.link===`weak`)){this.link=`lost`,this.lostSince=Date.now(),this.connect();return}this.raw({t:`ping`,c:performance.now(),rtt:this.rtt,h:[...this.held.keys()]})};e(),this.pingTimer=window.setInterval(e,1e3)}pairWith(e){this.pairCode=e,this.deny=null,this.link=`connecting`,this.connect()}leave(){this.releaseHeld(),this.raw({t:`bye`}),this.link=`left`,this.sheet=null,clearInterval(this.pingTimer),this.ws?.close()}rejoin(){this.link=`connecting`,this.firstTry=Date.now(),this.connect()}onMessage(e){switch(e.t){case`welcome`:e.token&&Oi.set(`token`,e.token),this.pairCode=null,this.deny=null,this.host=e.host,Oi.set(`host`,e.host),this.conn=e.conn,this.via=e.via===`usb`?`usb`:`wifi`,this.name=e.name,Oi.set(`name`,e.name),this.link=`ok`,this.everConnected=!0,this.held.clear(),this.startPing();break;case`denied`:this.deny=e.why,e.why===`forgotten`&&Oi.del(`token`),this.pairCode=null,this.link=`expired`,clearInterval(this.pingTimer);break;case`kicked`:this.link=`left`,this.showToast(`Disconnected in Nota`);break;case`pong`:{this.lastPong=Date.now();let t=Math.max(0,Math.round(performance.now()-e.c));this.rtts.push(t),this.rtts.length>5&&this.rtts.shift();let n=Math.round(this.rtts.reduce((e,t)=>e+t,0)/this.rtts.length);this.rtt=n,(this.link===`ok`||this.link===`weak`)&&(this.link=n>50?`weak`:`ok`);break}case`theme`:Ei.receive(e);break;case`proj`:{let t=!this.proj,n=this.proj?.you;delete e.t,this.proj=e,Ei.legacyDark=e.dark,Oi.set(`track`,String(e.you)),Oi.set(`follow`,e.follow?`1`:`0`),(t||n!==e.you)&&this.onTrackChanged(t);break}case`tp`:delete e.t,this.tp=e,this.posBase=e.pos,this.posAt=performance.now();break;case`lit`:this.lit=e.n;break;case`who`:this.who=e.p;break;case`mix`:delete e.t,this.mix=e;break;case`xy`:delete e.t,this.xy=e;break;case`mac`:delete e.t,this.mac=e;break;case`ses`:delete e.t,this.ses=e;break;case`learn`:this.learn={on:e.on,pend:e.pend},e.on||(this.learned=null);break;case`learned`:this.learned=`${e.src} → ${e.dst}`,clearTimeout(this.learnedTimer),this.learnedTimer=window.setTimeout(()=>this.learned=null,6e3);break;case`toast`:this.showToast(e.msg)}}onTrackChanged(e){let t=this.track;if(t){if(e&&this.screenChosen){this.sub();return}t.kind===`audio`&&(this.bigTransport=!0),(!e||!this.screenChosen)&&(t.kind===`drum`&&(this.screen===`Keys`||this.screen===`Pads`)?this.screen=`Pads`:t.kind===`inst`&&(this.screen===`Pads`||this.screen===`Keys`)&&(this.screen=`Keys`)),this.sub()}}setScreen(e){this.screen=e,this.screenChosen=!0,this.bigTransport=!1,this.sub()}sub(){this.raw({t:`sub`,s:this.screen,i:this.macroDevice})}macroDevice=0;selectTrack(e){this.sheet=null,this.proj&&this.proj.you!==e&&(this.proj={...this.proj,you:e,follow:!1},this.onTrackChanged(!1)),this.send({t:`track`,id:e})}stepTrack(e){let t=this.playable;if(t.length===0)return;let n=t[(t.findIndex(e=>e.id===this.proj?.you)+e+t.length)%t.length];this.selectTrack(n.id)}raw(e){return this.ws?.readyState===WebSocket.OPEN&&(this.ws.send(JSON.stringify(e)),!0)}send(e){return this.link===`ok`||this.link===`weak`?this.raw(e):!1}get live(){return this.link===`ok`||this.link===`weak`}noteOn(e,t){if(!(e<0||e>127)&&(this.send({t:`on`,p:e,v:Math.round(t*1e3)/1e3})&&this.held.set(e,(this.held.get(e)??0)+1),this.prefs.haptics&&navigator.vibrate))try{navigator.vibrate(8)}catch{}}noteExpr(e,t,n){this.held.has(e)&&(this.exprPending.set(e*4+t,Math.round(n*1e3)/1e3),this.exprFrame||=requestAnimationFrame(()=>this.flushExpr()))}exprPending=new Map;exprFrame=0;flushExpr(){this.exprFrame=0;for(let[e,t]of this.exprPending){let n=e>>2;this.held.has(n)&&this.send({t:`x`,p:n,d:e&3,v:t})}this.exprPending.clear()}noteOff(e){if(e<0||e>127)return;let t=this.held.get(e)??0;if(t>1){this.held.set(e,t-1);return}for(let t=0;t<3;t++)this.exprPending.delete(e*4+t);this.send({t:`off`,p:e})&&this.held.delete(e)}releaseHeld(){for(let e of[...this.held.keys()])this.send({t:`off`,p:e})&&this.held.delete(e)}position(e=performance.now()){return this.tp.play?this.posBase+(e-this.posAt)/6e4*this.tp.bpm:this.tp.pos}record(){if(this.tp.rec){this.send({t:`rec`,on:!1});return}!this.tp.play&&this.prefs.countIn?this.runCountIn():this.send({t:`rec`,on:!0})}countTimer=0;runCountIn(){if(this.countIn!==null){clearInterval(this.countTimer),this.countIn=null;return}let e=6e4/Math.max(20,this.tp.bpm);this.countIn=4,this.countTimer=window.setInterval(()=>{this.countIn!==null&&(this.countIn<=1?(clearInterval(this.countTimer),this.countIn=null,this.send({t:`rec`,on:!0})):--this.countIn)},e)}rename(e){e=e.trim(),e&&e!==this.name&&(this.name=e,Oi.set(`name`,e),this.send({t:`name`,s:e}))}setFollow(e){this.send({t:`follow`,on:e}),this.proj&&={...this.proj,follow:e}}showToast(e){this.toast=e,clearTimeout(this.toastTimer),this.toastTimer=window.setTimeout(()=>this.toast=null,2600)}},ji=new class{#e=P(I(window.innerWidth));get w(){return U(this.#e)}set w(e){F(this.#e,e,!0)}#t=P(I(window.innerHeight));get h(){return U(this.#t)}set h(e){F(this.#t,e,!0)}standalone=matchMedia(`(display-mode: standalone)`).matches||navigator.standalone===!0;#n=P(!!Mi());get fullscreen(){return U(this.#n)}set fullscreen(e){F(this.#n,e,!0)}constructor(){let e=()=>{this.w=window.innerWidth,this.h=window.innerHeight};window.addEventListener(`resize`,e),window.addEventListener(`orientationchange`,()=>setTimeout(e,120));let t=()=>this.fullscreen=!!Mi();document.addEventListener(`fullscreenchange`,t),document.addEventListener(`webkitfullscreenchange`,t)}get form(){return Math.min(this.w,this.h)>=600?`tablet`:this.w>this.h?`phoneLand`:`phone`}};function Mi(){let e=document;return e.fullscreenElement??e.webkitFullscreenElement??null}function Ni(){let e=document;return!!(e.fullscreenEnabled||e.webkitFullscreenEnabled)}async function Pi(){let e=document,t=document.documentElement;if(!Ni())return!1;try{return Mi()?await(e.exitFullscreen??e.webkitExitFullscreen).call(e):await(t.requestFullscreen??t.webkitRequestFullscreen).call(t,{navigationUI:`hide`}),!0}catch{return!1}}var Fi=null,Ii=null;async function Li(){let e=navigator.wakeLock;if(e&&window.isSecureContext)try{Fi||=await e.request(`screen`),Fi?.addEventListener?.(`release`,()=>Fi=null);return}catch{}Ii||(Ii=document.createElement(`video`),Ii.setAttribute(`playsinline`,``),Ii.setAttribute(`muted`,``),Ii.muted=!0,Ii.loop=!0,Ii.src=`./keepawake.mp4`,Ii.style.cssText=`position:fixed;width:1px;height:1px;opacity:0;pointer-events:none;left:-10px;top:-10px`,document.body.appendChild(Ii)),Ii.paused&&Ii.play().catch(()=>{})}function Ri(){return typeof DeviceOrientationEvent>`u`?`no`:window.isSecureContext?typeof DeviceOrientationEvent.requestPermission==`function`?`ask`:`yes`:`insecure`}async function zi(){let e=Ri();if(e===`yes`)return!0;if(e!==`ask`)return!1;try{return await DeviceOrientationEvent.requestPermission()===`granted`}catch{return!1}}function Bi(e){let t=null,n=e=>Math.min(1,Math.max(0,e)),r=r=>{if(r.beta==null||r.gamma==null)return;let i=Math.abs((screen.orientation?.angle??window.orientation??0)%180)===90,a=screen.orientation?.angle??window.orientation??0,o=i?a===90||a===-270?r.beta:-r.beta:r.gamma,s=i?a===90||a===-270?-r.gamma:r.gamma:r.beta;t||={b:s,g:o},e(n(.5+(o-t.g)/60),n(.5-(s-t.b)/50))};return window.addEventListener(`deviceorientation`,r),()=>window.removeEventListener(`deviceorientation`,r)}var Vi=[`Pads`,`Keys`,`XY`,`Mixer`,`Macros`,`Scenes`],Hi=wr(`<svg width="16" height="16" viewBox="0 0 16 16" class="svelte-oiwvqb"><path d="M6 2 V6 H2 M10 2 V6 H14 M6 14 V10 H2 M10 14 V10 H14" class="svelte-oiwvqb"></path></svg>`),Ui=wr(`<svg width="16" height="16" viewBox="0 0 16 16" class="svelte-oiwvqb"><path d="M2 6 V2 H6 M10 2 H14 V6 M2 10 V14 H6 M14 10 V14 H10" class="svelte-oiwvqb"></path></svg>`),Wi=G(`<button class="tbtn fs svelte-oiwvqb"><!></button>`),Gi=G(`<header><div class="picker svelte-oiwvqb"><button class="step svelte-oiwvqb" aria-label="Previous track"><svg width="10" height="14" viewBox="0 0 10 14" class="svelte-oiwvqb"><path d="M7 2 L2 7 L7 12" class="svelte-oiwvqb"></path></svg></button> <button class="track svelte-oiwvqb" aria-label="Choose the track to play"><span class="bar svelte-oiwvqb"></span> <span class="names svelte-oiwvqb"><span class="name svelte-oiwvqb"> </span> <span class="sub svelte-oiwvqb"> </span></span> <svg width="10" height="10" viewBox="0 0 10 10" class="svelte-oiwvqb"><path d="M2 3.5 L5 6.5 L8 3.5" class="svelte-oiwvqb"></path></svg></button> <button class="step svelte-oiwvqb" aria-label="Next track"><svg width="10" height="14" viewBox="0 0 10 14" class="svelte-oiwvqb"><path d="M3 2 L8 7 L3 12" class="svelte-oiwvqb"></path></svg></button></div> <div class="transport svelte-oiwvqb"><button class="tbtn svelte-oiwvqb" aria-label="Stop"><span class="sq svelte-oiwvqb"></span></button> <button><span class="tri svelte-oiwvqb"></span></button> <button aria-label="Record"><span class="dot svelte-oiwvqb"></span></button> <button aria-label="Big transport"><span class="mono p svelte-oiwvqb"> </span> <span class="mono bpm svelte-oiwvqb"> </span> <svg width="10" height="10" viewBox="0 0 10 10" class="svelte-oiwvqb"><path d="M2 3.5 L5 6.5 L8 3.5" class="svelte-oiwvqb"></path></svg></button> <!></div> <div class="status svelte-oiwvqb"><button class="link svelte-oiwvqb"><span></span> <span class="mono svelte-oiwvqb"> </span></button> <button aria-label="Menu"><span class="svelte-oiwvqb"></span><span class="svelte-oiwvqb"></span><span class="svelte-oiwvqb"></span></button></div></header>`);function Ki(e,t){ze(t,!0);let n=M(()=>$.track),r=M(()=>{if(!U(n))return $.proj?`No track to play`:`Connecting…`;let e=($.who[String(U(n).id)]??[]).join(`, `);return U(n).dev+($.proj?.follow?` · following Nota`:``)+(e?` · with ${e}`:``)}),i=P(`1.1`);un(()=>{let e=0,t=()=>{let n=Math.max(0,$.position());F(i,`${Math.floor(n/4)+1}.${Math.floor(n%4)+1}`),e=requestAnimationFrame(t)};return t(),()=>cancelAnimationFrame(e)});let a=M(()=>{let e=$.via===`usb`?`USB · `:``;switch($.link){case`ok`:return{dot:`var(--success)`,ink:`var(--text-muted)`,label:$.rtt>=0?`${e}${$.rtt}\u2009ms`:`Connected`};case`weak`:return{dot:`var(--warning)`,ink:`var(--warning)`,label:`Weak · ${$.rtt}\u2009ms`};case`lost`:case`connecting`:return{dot:`var(--text-tertiary)`,ink:`var(--text-secondary)`,label:$.link===`lost`?`Reconnecting`:`Connecting`,blink:!0};case`down`:return{dot:`var(--danger)`,ink:`var(--danger-bright)`,label:`No connection`,blink:!0};default:return{dot:`var(--danger)`,ink:`var(--danger-bright)`,label:`Not paired`}}});function o(){$.link===`weak`?$.showToast(`Latency is ${$.rtt}\u2009ms. Move closer to the router or put the phone on 5 GHz Wi-Fi.`):$.link===`ok`?$.showToast(`Connected to ${$.host} over ${$.via===`usb`?`USB`:`Wi-Fi`} · ${$.rtt}\u2009ms`):$.link===`lost`&&$.showToast(`Touches are not sent until the link is back.`)}async function s(){await Pi()||$.showToast(`This browser can’t hide its bars. Share → Add to Home Screen opens Nota Remote full-screen.`)}function c(){if(!$.canControl)return $.showToast(`Nota lets this phone play notes only.`);$.send({t:$.tp.play?`stop`:`play`})}function l(){if(!$.canControl)return $.showToast(`Nota lets this phone play notes only.`);$.send({t:`stop`})}function u(){if(!$.canControl)return $.showToast(`Nota lets this phone play notes only.`);$.record()}var d=Gi(),f=L(d),p=L(f),m=z(p,2),h=L(m);let g;var _=z(h,2),v=L(_),y=R(v,!0),b=R(z(v,2),!0);A(_),be(2),A(m);var x=z(m,2);A(f);var S=z(f,2),C=L(S),w=z(C,2);let ee;var T=z(w,2);let te;var E=z(T,2);let ne;var re=L(E),ie=R(re,!0),ae=R(z(re,2),!0);be(2),A(E);var oe=z(E,2),se=e=>{var t=Wi(),n=L(t),r=e=>{K(e,Hi())},i=e=>{K(e,Ui())};J(n,e=>{ji.fullscreen?e(r):e(i,-1)}),A(t),B(()=>{Q(t,`aria-label`,ji.fullscreen?`Exit full screen`:`Full screen`),Q(t,`aria-pressed`,ji.fullscreen)}),W(`click`,t,s),K(e,t)};J(oe,e=>{ji.standalone||e(se)}),A(S);var ce=z(S,2),le=L(ce),ue=L(le);let de,fe;var D=z(ue,2);let pe;var me=R(D,!0);A(le);var he=z(le,2);let ge;A(ce),A(d),B(e=>{X(d,1,qr(t.form),`svelte-oiwvqb`),g=Z(h,``,g,{background:U(n)?.color??`var(--rule)`}),q(y,U(n)?.name??`—`),q(b,U(r)),ee=X(w,1,`tbtn play svelte-oiwvqb`,null,ee,{on:$.tp.play}),Q(w,`aria-label`,$.tp.play?`Stop playback`:`Play`),Q(w,`aria-pressed`,$.tp.play),te=X(T,1,`tbtn rec svelte-oiwvqb`,null,te,{on:$.tp.rec,count:$.countIn!==null}),Q(T,`aria-pressed`,$.tp.rec),ne=X(E,1,`pos svelte-oiwvqb`,null,ne,{open:$.bigTransport}),q(ie,U(i)),q(ae,e),Q(le,`aria-label`,`Connection: ${U(a).label??``}`),de=X(ue,1,`ldot svelte-oiwvqb`,null,de,{blink:U(a).blink}),fe=Z(ue,``,fe,{background:U(a).dot}),pe=Z(D,``,pe,{color:U(a).ink}),q(me,U(a).label),ge=X(he,1,`menu svelte-oiwvqb`,null,ge,{open:$.sheet===`menu`})},[()=>$.tp.bpm.toFixed(2)]),W(`click`,p,()=>$.stepTrack(-1)),W(`click`,m,()=>$.sheet=`tracks`),W(`click`,x,()=>$.stepTrack(1)),W(`click`,C,l),W(`click`,w,c),W(`click`,T,u),W(`click`,E,()=>$.bigTransport=!$.bigTransport),W(`click`,le,o),W(`click`,he,()=>$.sheet=`menu`),K(e,d),Be()}hr([`click`]);var qi=G(`<div role="status"><span></span> <div class="svelte-4gizvm"><div class="t svelte-4gizvm"> </div> <div class="s svelte-4gizvm"> </div></div></div>`);function Ji(e,t){ze(t,!0);let n=M(()=>$.link===`lost`?{kind:`quiet`,title:`Reconnecting to ${$.host}…`,sub:`Touches are not sent until the link is back`}:$.learn.on&&$.live?$.learned?{kind:`learn`,title:`Mapped ${$.learned}`,sub:`Click another control in Nota to keep mapping`}:{kind:`learn`,title:$.learn.pend?`Nota is listening: ${$.learn.pend}`:`MIDI Learn is on in Nota`,sub:$.learn.pend?`Move a macro, an XY axis or tilt the phone. Pads, keys and the mixer can’t be mapped.`:`Click a control in Nota, then move a macro, an XY axis or tilt the phone.`}:null);var r=Er(),i=Zt(r),a=e=>{var t=qi(),r=L(t);let i;var a=z(r,2),o=L(a),s=R(o,!0),c=R(z(o,2),!0);A(a),A(t),B(()=>{X(t,1,`banner ${U(n).kind??``}`,`svelte-4gizvm`),i=X(r,1,`dot svelte-4gizvm`,null,i,{blink:U(n).kind===`quiet`}),q(s,U(n).title),q(c,U(n).sub)}),K(e,t)};J(i,e=>{U(n)&&e(a)}),K(e,r),Be()}var Yi=[`C`,`C#`,`D`,`D#`,`E`,`F`,`F#`,`G`,`G#`,`A`,`A#`,`B`],Xi=[`C`,`Db`,`D`,`Eb`,`E`,`F`,`F#`,`G`,`Ab`,`A`,`Bb`,`B`],Zi=[0,2,4,5,7,9,11],Qi=[0,2,3,5,7,8,10],$i=e=>Yi[(e%12+12)%12]+(Math.floor(e/12)-1),ea=e=>(e.minor?Yi:Xi)[e.root]+(e.minor?` minor`:` major`),ta=e=>e.minor?Qi:Zi;function na(e,t,n){let r=ta(e),i=Math.floor(n/7),a=(n%7+7)%7;return t+e.root+r[a]+12*i}var ra=[`i`,`ii`,`iii`,`iv`,`v`,`vi`,`vii`];function ia(e,t){let n=ta(e);return n.map((r,i)=>{let a=n[i],o=n[(i+2)%7]+(i+2>=7?12:0),s=n[(i+4)%7]+(i+4>=7?12:0),c=o-a,l=s-a,u=c===4?``:l===6?`°`:`m`,d=t+e.root+a;return{roman:(u===``?ra[i].toUpperCase():ra[i])+(u===`°`?`°`:``),name:(e.minor?Yi:Xi)[(e.root+a)%12]+u,notes:[d,t+e.root+o,t+e.root+s]}})}var aa=G(`<button class="scrim svelte-tyq0v8" aria-label="Close"></button>`),oa=G(`<span class="who svelte-tyq0v8">You</span>`),sa=G(`<span class="who svelte-tyq0v8"> </span>`),ca=G(`<button><span class="bar svelte-tyq0v8"></span> <span class="names svelte-tyq0v8"><span class="n svelte-tyq0v8"> </span><span class="d svelte-tyq0v8"> </span></span> <!> <!></button>`),la=G(`<div class="empty svelte-tyq0v8">The project has no tracks yet.</div>`),ua=G(`<div role="dialog" aria-label="Play on track"><div class="label head svelte-tyq0v8">Play on track</div> <div class="list svelte-tyq0v8"><!> <!></div> <button class="toggle svelte-tyq0v8"><span></span> <span><span class="n2 svelte-tyq0v8">Follow Nota’s selection</span><span class="d2 svelte-tyq0v8">Off: this phone keeps its own track</span></span></button></div>`),da=G(`<div class="sheet menu svelte-tyq0v8" role="dialog" aria-label="Menu"><div class="block svelte-tyq0v8"><label class="label" for="devname">Device name</label> <input id="devname" class="field svelte-tyq0v8" maxlength="40" enterkeyhint="done"/></div> <div class="block svelte-tyq0v8"><span class="label">Theme</span> <div class="seg"><button>Follow Nota</button> <button>Follow phone</button></div> <span class="d2 svelte-tyq0v8"> </span></div> <button class="toggle svelte-tyq0v8"><span></span><span class="n2 svelte-tyq0v8">Haptics on pads</span></button> <button class="toggle svelte-tyq0v8"><span></span><span class="n2 svelte-tyq0v8">Count-in before recording</span></button> <button class="disconnect svelte-tyq0v8">Disconnect</button></div>`),fa=G(`<button> </button>`),pa=G(`<div role="dialog" aria-label="Key"><div class="label head svelte-tyq0v8">Key on this phone</div> <div class="block svelte-tyq0v8"><button><span class="names svelte-tyq0v8"><span class="n svelte-tyq0v8">Project key</span><span class="d svelte-tyq0v8"> </span></span></button> <div class="seg"><button>Major</button> <button>Minor</button></div> <div class="tonics svelte-tyq0v8"></div></div></div>`),ma=G(`<button><span class="names svelte-tyq0v8"><span class="n svelte-tyq0v8"> </span></span></button>`),ha=G(`<div role="dialog" aria-label="Device"><div class="label head svelte-tyq0v8"> </div> <div class="list svelte-tyq0v8"></div></div>`),ga=G(`<!> <!>`,1);function _a(e,t){ze(t,!0);let n=M(()=>t.form===`phone`),r=P(``);un(()=>{$.sheet===`menu`&&F(r,$.name,!0)});function i(){$.sheet===`menu`&&$.rename(U(r)),$.sheet=null}let a=M(()=>$.proj?.key??null),o=M(()=>{let e=Ei.worn($.prefs.theme);return e?$.prefs.theme===`nota`?`${e.name} · as Nota wears it`:`${e.name} · Nota’s ${Ei.phoneDark?`dark`:`light`}-mode theme`:$.live?`Nota’s colours`:`Until Nota answers: Studio Dark`});var s=ga(),c=Zt(s),l=e=>{var t=aa();W(`click`,t,i),K(e,t)};J(c,e=>{$.sheet&&e(l)});var u=z(c,2),d=e=>{var t=ua();let r;var i=z(L(t),2),a=L(i);Y(a,17,()=>$.playable,e=>e.id,(e,t)=>{let n=M(()=>$.who[String(U(t).id)]??[]);var r=ca();let i;var a=L(r);let o;var s=z(a,2),c=L(s),l=R(c,!0),u=R(z(c),!0);A(s);var d=z(s,2),f=e=>{K(e,oa())};J(d,e=>{U(t).id===$.proj?.you&&e(f)}),Y(z(d,2),17,()=>U(n),Ir,(e,t)=>{var n=sa(),r=R(n,!0);B(()=>q(r,U(t))),K(e,n)}),A(r),B(()=>{i=X(r,1,`row svelte-tyq0v8`,null,i,{on:U(t).id===$.proj?.you}),o=Z(a,``,o,{background:U(t).color}),q(l,U(t).name),q(u,U(t).dev)}),W(`click`,r,()=>$.selectTrack(U(t).id)),K(e,r)});var o=z(a,2),s=e=>{K(e,la())};J(o,e=>{$.playable.length===0&&e(s)}),A(i);var c=z(i,2),l=L(c);let u;be(2),A(c),A(t),B(()=>{r=X(t,1,`sheet svelte-tyq0v8`,null,r,{bottom:U(n)}),u=X(l,1,`switch`,null,u,{on:$.proj?.follow})}),W(`click`,c,()=>$.setFollow(!$.proj?.follow)),K(e,t)},f=e=>{var t=da(),n=L(t),i=z(L(n),2);ri(i),A(n);var a=z(n,2),s=z(L(a),2),c=L(s);let l;var u=z(c,2);let d;A(s);var f=R(z(s,2),!0);A(a);var p=z(a,2),m=L(p);let h;be(),A(p);var g=z(p,2),_=L(g);let v;be(),A(g);var y=z(g,2);A(t),B(()=>{l=X(c,1,``,null,l,{on:$.prefs.theme===`nota`}),d=X(u,1,``,null,d,{on:$.prefs.theme===`phone`}),q(f,U(o)),h=X(m,1,`switch`,null,h,{on:$.prefs.haptics}),v=X(_,1,`switch`,null,v,{on:$.prefs.countIn})}),W(`keydown`,i,e=>{e.key===`Enter`&&e.target.blur()}),mr(`blur`,i,()=>$.rename(U(r))),si(i,()=>U(r),e=>F(r,e)),W(`click`,c,()=>$.prefs.theme=`nota`),W(`click`,u,()=>$.prefs.theme=`phone`),W(`click`,p,()=>$.prefs.haptics=!$.prefs.haptics),W(`click`,g,()=>$.prefs.countIn=!$.prefs.countIn),W(`click`,y,()=>$.leave()),K(e,t)},p=e=>{var t=pa();let r;var i=z(L(t),2),o=L(i);let s;var c=L(o),l=R(z(L(c)),!0);A(c),A(o);var u=z(o,2),d=L(u);let f;var p=z(d,2);let m;A(u);var h=z(u,2);Y(h,21,()=>Yi,Ir,(e,t,n)=>{var r=fa();let i;var o=R(r,!0);B(()=>{i=X(r,1,`btn svelte-tyq0v8`,null,i,{on:$.prefs.key?.root===n}),q(o,U(t))}),W(`click`,r,()=>$.prefs.key={root:n,minor:$.prefs.key?.minor??U(a)?.minor??!1}),K(e,r)}),A(h),A(i),A(t),B(()=>{r=X(t,1,`sheet svelte-tyq0v8`,null,r,{bottom:U(n)}),s=X(o,1,`row slim svelte-tyq0v8`,null,s,{on:!$.prefs.key}),q(l,U(a)?U(a).name:`Not set in Nota — C major`),f=X(d,1,``,null,f,{on:!($.prefs.key?.minor??U(a)?.minor??!1)}),m=X(p,1,``,null,m,{on:$.prefs.key?.minor??U(a)?.minor??!1})}),W(`click`,o,()=>{$.prefs.key=null,$.sheet=null}),W(`click`,d,()=>$.prefs.key={root:$.prefs.key?.root??U(a)?.root??0,minor:!1}),W(`click`,p,()=>$.prefs.key={root:$.prefs.key?.root??U(a)?.root??0,minor:!0}),K(e,t)},m=e=>{var t=ha();let r;var i=L(t),a=R(i),o=z(i,2);Y(o,21,()=>$.mac?.devs??[],Ir,(e,t,n)=>{var r=ma();let i;var a=L(r),o=R(L(a),!0);A(a),A(r),B(()=>{i=X(r,1,`row svelte-tyq0v8`,null,i,{on:n===($.mac?.di??0)}),q(o,U(t))}),W(`click`,r,()=>{$.macroDevice=n,$.sub(),$.sheet=null}),K(e,r)}),A(o),A(t),B(()=>{r=X(t,1,`sheet svelte-tyq0v8`,null,r,{bottom:U(n)}),q(a,`Device on ${$.track?.name??`this track`??``}`)}),K(e,t)};J(u,e=>{$.sheet===`tracks`?e(d):$.sheet===`menu`?e(f,1):$.sheet===`key`?e(p,2):$.sheet===`devices`&&e(m,3)}),K(e,s),Be()}hr([`click`,`keydown`]);var va=G(`<div class="cover svelte-17f2qxr" role="alert"><h1 class="svelte-17f2qxr">Nota isn’t responding</h1> <ol class="svelte-17f2qxr"><li class="svelte-17f2qxr"><span class="mono svelte-17f2qxr">1</span> </li> <li class="svelte-17f2qxr"><span class="mono svelte-17f2qxr">2</span>Remote is on: the Remote button in Nota’s top bar is lit</li> <li class="svelte-17f2qxr"><span class="mono svelte-17f2qxr">3</span>The phone is on the same Wi-Fi. Guest networks often keep devices apart; share the phone’s hotspot with the computer instead.</li></ol> <div class="retry svelte-17f2qxr"><span class="dot blink svelte-17f2qxr"></span>Retrying every few seconds</div></div>`),ya=G(`<span class="mono svelte-17f2qxr"> </span>`),ba=G(`<span class="caret svelte-17f2qxr"></span>`),xa=G(`<span><!></span>`),Sa=G(`<div class="cover svelte-17f2qxr" role="alert"><h1 class="svelte-17f2qxr"> </h1> <p class="svelte-17f2qxr"> </p> <label class="code svelte-17f2qxr" aria-label="Four-digit code"><input inputmode="numeric" pattern="[0-9]*" maxlength="4" autocomplete="one-time-code" class="svelte-17f2qxr"/> <!></label></div>`),Ca=G(`<div class="cover svelte-17f2qxr" role="alert"><h1 class="svelte-17f2qxr">Disconnected</h1> <p class="svelte-17f2qxr">This phone has left Nota. It is still trusted, so connecting again needs no code.</p> <button class="btn primary big svelte-17f2qxr">Connect again</button></div>`),wa=G(`<button class="count svelte-17f2qxr" aria-label="Cancel count-in"><span> </span> <span class="rec svelte-17f2qxr">Count-in · recording starts on 1</span></button>`),Ta=G(`<div role="status"> </div>`),Ea=G(`<!> <!> <!>`,1);function Da(e,t){ze(t,!0);let n=P(``),r=P(void 0);un(()=>{$.link===`expired`&&(F(n,``),setTimeout(()=>U(r)?.focus(),50))}),un(()=>{U(n).length===4&&$.link===`expired`&&$.pairWith(U(n))});let i=M(()=>$.deny===`code`?`That code didn’t match. Codes change every two minutes — check the one Nota shows now.`:$.deny===`locked`?`Too many wrong codes. Wait half a minute, then try the code Nota shows.`:$.deny===`version`?`This page is older than Nota. Reload it.`:$.deny===`new`?`In Nota, click Remote in the top bar and scan the QR code with the camera, or type its four digits here.`:`This phone was removed from trusted devices, or the code has expired. In Nota, click Remote to show a fresh QR, or type its four digits here.`);var a=Ea(),o=Zt(a),s=e=>{var t=va(),n=z(L(t),2),r=L(n),i=z(L(r));A(r),be(4),A(n),be(2),A(t),B(()=>q(i,`Nota is open on ${$.host??``}`)),K(e,t)},c=e=>{var t=Sa(),a=L(t),o=R(a,!0),s=z(a,2),c=R(s,!0),l=z(s,2),u=L(l);ri(u),di(u,e=>F(r,e),()=>U(r)),Y(z(u,2),16,()=>[0,1,2,3],Ir,(e,t)=>{var r=xa();let i;var a=L(r),o=e=>{var r=ya(),i=R(r,!0);B(()=>q(i,U(n)[t])),K(e,r)},s=e=>{K(e,ba())};J(a,e=>{U(n)[t]?e(o):U(n).length===t&&e(s,1)}),A(r),B(()=>i=X(r,1,`cell svelte-17f2qxr`,null,i,{cur:U(n).length===t})),K(e,r)}),A(l),A(t),B(()=>{q(o,$.deny===`new`?`Pair with Nota`:`Scan a new code in Nota`),q(c,U(i))}),W(`input`,u,()=>F(n,U(n).replace(/\D/g,``).slice(0,4),!0)),si(u,()=>U(n),e=>F(n,e)),K(e,t)},l=e=>{var t=Ca(),n=z(L(t),4);A(t),W(`click`,n,()=>$.rejoin()),K(e,t)};J(o,e=>{$.link===`down`?e(s):$.link===`expired`?e(c,1):$.link===`left`&&e(l,2)});var u=z(o,2),d=e=>{var n=wa(),r=L(n),i=R(r,!0);be(2),A(n),B(()=>{X(r,1,`mono num ${t.form??``}`,`svelte-17f2qxr`),q(i,$.countIn)}),W(`click`,n,()=>$.record()),K(e,n)};J(u,e=>{$.countIn!==null&&e(d)});var f=z(u,2),p=e=>{var n=Ta();let r;var i=R(n,!0);B(()=>{r=X(n,1,`toast svelte-17f2qxr`,null,r,{low:t.form===`phone`}),q(i,$.toast)}),K(e,n)};J(f,e=>{$.toast&&e(p)}),K(e,a),Be()}hr([`input`,`click`]);var Oa=G(`Bar <span class="mono svelte-1hrivqy"> </span>`,1),ka=G(`<button><span class="sn svelte-1hrivqy"> </span> <span class="si svelte-1hrivqy"><!></span></button>`),Aa=G(`<div class="secs svelte-1hrivqy"><span class="label">Sections · tap to jump, hold to loop</span> <div class="sgrid svelte-1hrivqy"></div></div>`),ja=G(`<div><div class="top svelte-1hrivqy"><div class="pblock svelte-1hrivqy"><span class="label">Position</span> <span> </span></div> <button class="tap svelte-1hrivqy"><span class="mono svelte-1hrivqy"> </span> <span class="tl svelte-1hrivqy">Tap tempo</span></button></div> <div class="btns svelte-1hrivqy"><button><span class="tri svelte-1hrivqy"></span>Play</button> <button class="b svelte-1hrivqy"><span class="sq svelte-1hrivqy"></span>Stop</button> <button><span class="dot svelte-1hrivqy"></span>Record</button> <button><svg width="30" height="26" viewBox="0 0 30 26" class="svelte-1hrivqy"><path d="M7 9 H21 A5 5 0 0 1 21 19 H9 M9 19 L12 16 M9 19 L12 22 M7 9 A5 5 0 0 0 5 14" class="svelte-1hrivqy"></path></svg>Loop</button> <button><svg width="26" height="28" viewBox="0 0 26 28" class="svelte-1hrivqy"><path d="M8 25 L11 3 H15 L18 25 Z M13 18 L21 8" class="svelte-1hrivqy"></path></svg>Click</button> <button><svg width="28" height="24" viewBox="0 0 28 24" class="svelte-1hrivqy"><path d="M9 5 L4 10 L9 15 M4 10 H17 A6 6 0 0 1 17 22 H12" class="svelte-1hrivqy"></path></svg>Undo</button></div> <!></div>`);function Ma(e,t){ze(t,!0);let n=P(`1.1.1`);un(()=>{let e=0,t=()=>{let r=Math.max(0,$.position());F(n,`${Math.floor(r/4)+1}.${Math.floor(r%4)+1}.${Math.floor(r*4%4)+1}`),e=requestAnimationFrame(t)};return t(),()=>cancelAnimationFrame(e)});let r=M(()=>$.proj?.sections??[]),i=M(()=>$.position()),a=M(()=>U(r).reduce((e,t,n)=>U(i)>=t[1]?n:e,-1)),o=M(()=>$.tp.loop?U(r).findIndex((e,t)=>Math.abs(e[1]-$.tp.ls)<.01&&Math.abs((U(r)[t+1]?.[1]??e[1]+16)-$.tp.le)<.01):-1);function s(e){if(!$.canControl)return $.showToast(`Nota lets this phone play notes only.`);$.send(e)}let c=[];function l(){let e=performance.now();if(c=[...c.filter(t=>e-t<2500),e],c.length>=3){let e=(c[c.length-1]-c[0])/(c.length-1);s({t:`bpm`,v:Math.round(Math.min(220,Math.max(50,6e4/e))*100)/100})}}let u=0,d=!1;function f(e){d=!1,u=window.setTimeout(()=>{d=!0;let t=U(r)[e],n=U(r)[e+1]?.[1]??t[1]+16;U(o)===e?s({t:`loop`,on:!1}):s({t:`loopRange`,v:t[1],v2:n,on:!0})},450)}function p(e){clearTimeout(u),d||s({t:`seek`,v:U(r)[e][1]})}let m=M(()=>$.tp.bpm.toFixed(2));var h=ja(),g=L(h),_=L(g),v=z(L(_),2);let y;var b=R(v,!0);A(_);var x=z(_,2),S=R(L(x),!0);be(2),A(x),A(g);var C=z(g,2);let w;var ee=L(C);let T;var te=z(ee,2),E=z(te,2);let ne;var re=z(E,2);let ie;var ae=z(re,2);let oe;var se=z(ae,2);let ce;A(C);var le=z(C,2),ue=e=>{var t=Aa(),n=z(L(t),2);Y(n,21,()=>U(r),Ir,(e,t,n)=>{var r=ka();let i;var s=L(r),c=R(s,!0),l=z(s,2),d=L(l),m=e=>{K(e,Tr(`Looping`))},h=e=>{var n=Oa(),r=R(z(Zt(n)),!0);B(e=>q(r,e),[()=>Math.floor(U(t)[1]/4)+1]),K(e,n)};J(d,e=>{U(o)===n?e(m):e(h,-1)}),A(l),A(r),B(()=>{i=X(r,1,`sec svelte-1hrivqy`,null,i,{cur:U(a)===n,looping:U(o)===n}),q(c,U(t)[0])}),W(`pointerdown`,r,()=>f(n)),W(`pointerup`,r,()=>p(n)),mr(`pointercancel`,r,()=>clearTimeout(u)),K(e,r)}),A(n),A(t),K(e,t)};J(le,e=>{U(r).length>0&&e(ue)}),A(h),B(()=>{X(h,1,`big ${t.form??``}`,`svelte-1hrivqy`),y=X(v,1,`mono pos svelte-1hrivqy`,null,y,{rec:$.tp.rec}),q(b,U(n)),q(S,U(m)),w=Z(C,``,w,{"grid-template-columns":`repeat(${t.form===`phone`?3:6}, minmax(0, 1fr))`}),T=X(ee,1,`b play svelte-1hrivqy`,null,T,{on:$.tp.play}),Q(ee,`aria-pressed`,$.tp.play),ne=X(E,1,`b recb svelte-1hrivqy`,null,ne,{on:$.tp.rec}),Q(E,`aria-pressed`,$.tp.rec),ie=X(re,1,`b svelte-1hrivqy`,null,ie,{on:$.tp.loop}),Q(re,`aria-pressed`,$.tp.loop),oe=X(ae,1,`b svelte-1hrivqy`,null,oe,{on:$.tp.met}),Q(ae,`aria-pressed`,$.tp.met),ce=X(se,1,`b svelte-1hrivqy`,null,ce,{dim:!$.tp.can})}),W(`click`,x,l),W(`click`,ee,()=>s({t:$.tp.play?`stop`:`play`})),W(`click`,te,()=>s({t:`stop`})),W(`click`,E,()=>$.canControl?$.record():s({})),W(`click`,re,()=>s({t:`loop`,on:!$.tp.loop})),W(`click`,ae,()=>s({t:`met`,on:!$.tp.met})),W(`click`,se,()=>s({t:`undo`})),K(e,h),Be()}hr([`click`,`pointerdown`,`pointerup`]);var Na=G(`<button> </button>`),Pa=G(`<button><span class="num mono svelte-1puq9zz"> </span> <span class="txt svelte-1puq9zz"><span class="name svelte-1puq9zz"> </span> <span class="note mono svelte-1puq9zz"> </span></span></button>`),Fa=G(`<div class="pads svelte-1puq9zz"><div class="bar svelte-1puq9zz"><div class="seg banks svelte-1puq9zz" role="group" aria-label="Bank"></div> <button>Full velocity</button> <button>Repeat <span class="rate mono svelte-1puq9zz" role="button" tabindex="0" aria-label="Repeat rate"> </span></button></div> <div class="grid svelte-1puq9zz"></div></div>`);function Ia(e,t){ze(t,!0);let n=[{n:`1/8`,div:2},{n:`1/16`,div:4},{n:`1/32`,div:8}],r=P(1),i=P(!1),a=I({}),o=new Map,s=new Map,c=M(()=>t.form===`phone`?4:8),l=M(()=>t.form===`tablet`?32:16),u=M(()=>36+Math.min($.prefs.bank,3)*12),d=M(()=>new Map(($.track?.pads??[]).map(([e,t])=>[e,t]))),f=M(()=>new Set($.lit)),p=M(()=>$.track?.color??`var(--accent)`),m=M(()=>$.track?Ei.inkOn($.track.color):`var(--ink-on-accent)`),h=M(()=>{let e=U(l)/U(c),t=[];for(let n=e-1;n>=0;n--)for(let e=0;e<U(c);e++)t.push(U(u)+n*U(c)+e);return t}),g=M(()=>Array.from({length:4},(e,t)=>({i:t,name:$i(36+t*12)})));function _(e,t){e.preventDefault();let c=e.currentTarget.getBoundingClientRect(),l=$.prefs.fullVel?1:Math.max(.2,Math.min(1,1-(e.clientY-c.top)/c.height+.15));if([...s.values()].includes(t)&&$.noteOff(t),s.set(e.pointerId,t),a[t]=!0,$.noteOn(t,l),U(i)&&!o.has(t)){let e=()=>6e4/Math.max(20,$.tp.bpm)/n[U(r)].div,i=()=>{$.noteOff(t),$.noteOn(t,l),o.set(t,window.setTimeout(i,e()))};o.set(t,window.setTimeout(i,e()))}}function v(e){let t=s.get(e.pointerId);t!==void 0&&(s.delete(e.pointerId),![...s.values()].includes(t)&&(clearTimeout(o.get(t)),o.delete(t),a[t]=!1,$.noteOff(t)))}un(()=>{let e=e=>v(e);return window.addEventListener(`pointerup`,e,!0),window.addEventListener(`pointercancel`,e,!0),()=>{window.removeEventListener(`pointerup`,e,!0),window.removeEventListener(`pointercancel`,e,!0)}}),un(()=>(U(u),()=>{for(let e of o.values())clearTimeout(e);o.clear();for(let e of new Set(s.values()))a[e]=!1,$.noteOff(e);s.clear()}));var y=Fa(),b=L(y),x=L(b);Y(x,21,()=>U(g),Ir,(e,t)=>{var n=Na();let r;var i=R(n,!0);B(()=>{r=X(n,1,`mono svelte-1puq9zz`,null,r,{on:$.prefs.bank===U(t).i}),q(i,U(t).name)}),W(`click`,n,()=>$.prefs.bank=U(t).i),K(e,n)}),A(x);var S=z(x,2);let C;var w=z(S,2);let ee;var T=z(L(w)),te=R(T,!0);A(w),A(b);var E=z(b,2);let ne;Y(E,20,()=>U(h),e=>e,(e,t)=>{let n=M(()=>a[t]),r=M(()=>!U(n)&&U(f).has(t));var i=Pa();let o,s;var c=L(i),l=R(c,!0),u=z(c,2),h=L(u),g=R(h,!0),y=R(z(h,2),!0);A(u),A(i),B((e,a,c)=>{o=X(i,1,`pad svelte-1puq9zz`,null,o,{on:U(n),playing:U(r)}),Q(i,`aria-label`,e),s=Z(i,``,s,{"--tc":U(p),"--tc-ink":U(m)}),q(l,t-35),q(g,a),q(y,c)},[()=>U(d).get(t)??$i(t),()=>U(d).get(t)??$i(t),()=>$i(t)]),W(`pointerdown`,i,e=>_(e,t)),W(`pointerup`,i,v),mr(`pointercancel`,i,v),mr(`pointerleave`,i,v),K(e,i)}),A(E),A(y),B(()=>{C=X(S,1,`btn`,null,C,{on:$.prefs.fullVel}),Q(S,`aria-pressed`,$.prefs.fullVel),ee=X(w,1,`btn rep svelte-1puq9zz`,null,ee,{on:U(i)}),Q(w,`aria-pressed`,U(i)),q(te,n[U(r)].n),ne=Z(E,``,ne,{"grid-template-columns":`repeat(${U(c)??``}, minmax(0, 1fr))`})}),W(`click`,S,()=>$.prefs.fullVel=!$.prefs.fullVel),W(`click`,w,()=>F(i,!U(i))),W(`click`,T,e=>{e.stopPropagation(),F(r,(U(r)+1)%n.length)}),W(`keydown`,T,()=>{}),K(e,y),Be()}hr([`click`,`keydown`,`pointerdown`,`pointerup`]);var La=G(`<button> </button>`),Ra=G(`<button>Expressive</button>`),za=G(`<span class="mono lbl svelte-12d1dcp"> </span>`),Ba=G(`<span class="band svelte-12d1dcp"></span>`),Va=G(`<div><!> <!></div>`),Ha=G(`<div><!></div>`),Ua=G(`<div class="kb svelte-12d1dcp"><!> <!></div>`),Wa=G(`<div><span class="mono svelte-12d1dcp"> </span></div>`),Ga=G(`<div class="grid svelte-12d1dcp"></div>`),Ka=G(`<div><span class="mono roman svelte-12d1dcp"> </span> <span class="cn svelte-12d1dcp"> </span></div>`),qa=G(`<div class="grid chords svelte-12d1dcp"></div>`),Ja=G(`<span class="hint svelte-12d1dcp">Slide sideways to bend, up and down for timbre.</span>`),Ya=G(`<span class="hint svelte-12d1dcp">Turn the phone sideways for 1.5 octaves.</span>`),Xa=G(`<div class="keys svelte-12d1dcp"><div class="bar svelte-12d1dcp"><div class="seg modes svelte-12d1dcp" role="group" aria-label="Mode"></div> <button class="btn keybtn svelte-12d1dcp"><span class="k svelte-12d1dcp">Key</span> <span class="kn svelte-12d1dcp"> </span> <span class="src svelte-12d1dcp"> </span></button> <!> <div class="oct svelte-12d1dcp"><button class="btn sq svelte-12d1dcp" aria-label="Octave down"><svg width="12" height="12" viewBox="0 0 12 12"><path d="M2 6 H10" class="svelte-12d1dcp"></path></svg></button> <span class="octn svelte-12d1dcp">Oct <span class="mono svelte-12d1dcp"> </span></span> <button class="btn sq svelte-12d1dcp" aria-label="Octave up"><svg width="12" height="12" viewBox="0 0 12 12"><path d="M2 6 H10 M6 2 V10" class="svelte-12d1dcp"></path></svg></button></div></div> <div class="surface svelte-12d1dcp" role="application" aria-label="Keys"><!></div> <!></div>`);function Za(e,t){ze(t,!0);let n=[`Keyboard`,`Scale`,`Chords`],r=[0,2,4,5,7,9,11],i=M(()=>$.prefs.key??($.proj?.key?{root:$.proj.key.root,minor:$.proj.key.minor}:{root:0,minor:!1})),a=M(()=>$.prefs.key?`Phone`:$.proj?.key?`Project`:`Default`),o=M(()=>12*($.prefs.octave+1)),s=M(()=>new Set($.lit)),c=M(()=>$.track?.color??`var(--accent)`),l=M(()=>$.prefs.keysMode),u=M(()=>!!$.track?.mpe&&U(l)!==`Chords`),d=M(()=>U(u)&&$.prefs.expressive),f=M(()=>t.form===`phone`?8:t.form===`phoneLand`?11:15),p=M(()=>Array.from({length:U(f)},(e,t)=>U(o)+r[t%7]+12*Math.floor(t/7))),m=M(()=>{let e=[];for(let t=0;t<U(f)-1;t++)[0,1,3,4,5].includes(t%7)&&e.push({note:U(o)+r[t%7]+12*Math.floor(t/7)+1,left:`calc(${(t+1)/U(f)*100}% - ${.62/U(f)*50}%)`,w:`${.62/U(f)*100}%`});return e}),h=M(()=>t.form===`phone`?5:8),g=M(()=>t.form===`phoneLand`?4:6),_=M(()=>{let e=[];for(let t=U(g)-1;t>=0;t--)for(let n=0;n<U(h);n++){let r=t*3+n;e.push({note:na(U(i),U(o),r),tonic:r%7==0})}return e}),v=M(()=>ia(U(i),U(o))),y=new Map,b=P(I({}));function x(e,t){return(document.elementFromPoint(e,t)?.closest(`[data-t]`))?.dataset.t??null}function S(e){return e[0]===`n`?[Number(e.slice(1))]:U(v)[Number(e.slice(1))]?.notes??[]}let C=new Map;function w(e,t=.85){if(C.has(e))return;U(b)[e]=!0;let n=S(e);C.set(e,n);for(let e of n)$.noteOn(e,t)}function ee(e){if(![...y.values()].includes(e)){U(b)[e]=!1;for(let t of C.get(e)??[])$.noteOff(t);C.delete(e)}}let T=new Set,te=new Map,E=.2;function ne(e,t){let n=(t-e.x0)/e.unit*e.semis,r=Math.max(0,Math.abs(n)-E)*(e.semis/(e.semis-E));return Math.max(-24,Math.min(24,Math.sign(n)*r))}let re=(e,t)=>Math.max(0,Math.min(1,1-(t-e.top)/e.h));function ie(e,t,n){let r=te.get(e);if(!r)return;n||$.noteExpr(r.note,0,ne(r,t.clientX)),$.noteExpr(r.note,2,re(r,t.clientY));let i=t.pressure;!r.force&&(n?i!==0&&i!==.5&&i!==1:i!==r.p0)&&(r.force=!0),r.force&&$.noteExpr(r.note,1,i)}function ae(e,t){let n=document.elementFromPoint(e.clientX,e.clientY)?.closest(`[data-t]`);if(!n||t[0]!==`n`)return;let r=n.getBoundingClientRect(),i=n.classList.contains(`black`)?n.parentElement?.querySelector(`.white`):n,a=U(l)===`Keyboard`?i?.getBoundingClientRect().width??r.width:r.width;te.set(e.pointerId,{note:Number(t.slice(1)),x0:e.clientX,unit:Math.max(8,a),semis:U(l)===`Keyboard`?12/7:2,top:r.top,h:Math.max(8,r.height),force:!1,p0:e.pressure}),ie(e.pointerId,e,!0)}function oe(e){e.currentTarget.setPointerCapture(e.pointerId),T.add(e.pointerId);let t=x(e.clientX,e.clientY);t&&(y.set(e.pointerId,t),w(t),U(d)&&ae(e,t))}function se(e){if(!T.has(e.pointerId))return;if(te.has(e.pointerId)){ie(e.pointerId,e,!1);return}let t=y.get(e.pointerId),n=x(e.clientX,e.clientY);n!==t&&(t!==void 0&&(y.delete(e.pointerId),ee(t)),n&&(y.set(e.pointerId,n),w(n)))}function ce(e){T.delete(e.pointerId),te.delete(e.pointerId);let t=y.get(e.pointerId);y.delete(e.pointerId),t!==void 0&&ee(t)}let le=M(()=>U(i).root*2+ +!!U(i).minor);un(()=>(U(o),U(l),U(le),U(d),()=>{te.clear();for(let e of C.values())for(let t of e)$.noteOff(t);C.clear(),y.clear(),T.clear(),F(b,{},!0)}));var ue=Xa(),de=L(ue),fe=L(de);Y(fe,21,()=>n,Ir,(e,t)=>{var n=La();let r;var i=R(n,!0);B(()=>{r=X(n,1,`svelte-12d1dcp`,null,r,{on:U(l)===U(t)}),q(i,U(t))}),W(`click`,n,()=>$.prefs.keysMode=U(t)),K(e,n)}),A(fe);var D=z(fe,2),pe=z(L(D),2),me=R(pe,!0),he=R(z(pe,2),!0);A(D);var ge=z(D,2),O=e=>{var t=Ra();let n;B(()=>{n=X(t,1,`btn expr svelte-12d1dcp`,null,n,{on:U(d)}),Q(t,`aria-pressed`,U(d))}),W(`click`,t,()=>$.prefs.expressive=!$.prefs.expressive),K(e,t)};J(ge,e=>{U(u)&&e(O)});var _e=z(ge,2),k=L(_e),ve=z(k,2),ye=R(z(L(ve)),!0);A(ve);var be=z(ve,2);A(_e),A(de);var xe=z(de,2);let Se;var Ce=L(xe),we=e=>{var t=Ua(),n=L(t);Y(n,16,()=>U(p),e=>e,(e,t)=>{var n=Va();let r;var i=L(n),a=e=>{var n=za(),r=R(n,!0);B(e=>q(r,e),[()=>$i(t)]),K(e,n)};J(i,e=>{t%12==0&&e(a)});var o=z(i,2),c=e=>{K(e,Ba())},l=M(()=>U(s).has(t));J(o,e=>{U(l)&&e(c)}),A(n),B(()=>{r=X(n,1,`white svelte-12d1dcp`,null,r,{on:U(b)[`n`+t]}),Q(n,`data-t`,`n`+t)}),K(e,n)}),Y(z(n,2),17,()=>U(m),e=>e.note,(e,t)=>{var n=Ha();let r,i;var a=L(n),o=e=>{K(e,Ba())},c=M(()=>U(s).has(U(t).note));J(a,e=>{U(c)&&e(o)}),A(n),B(()=>{r=X(n,1,`black svelte-12d1dcp`,null,r,{on:U(b)[`n`+U(t).note]}),Q(n,`data-t`,`n`+U(t).note),i=Z(n,``,i,{left:U(t).left,width:U(t).w})}),K(e,n)}),A(t),K(e,t)},Te=e=>{var t=Ga();let n;Y(t,21,()=>U(_),Ir,(e,t)=>{var n=Wa();let r;var i=R(L(n));A(n),B((e,a)=>{r=X(n,1,`cell svelte-12d1dcp`,null,r,{tonic:U(t).tonic,on:U(b)[`n`+U(t).note],lit:e}),Q(n,`data-t`,`n`+U(t).note),q(i,`${Yi[U(t).note%12]??``}${a??``}`)},[()=>U(s).has(U(t).note),()=>U(t).tonic?Math.floor(U(t).note/12)-1:``]),K(e,n)}),A(t),B(()=>n=Z(t,``,n,{"grid-template-columns":`repeat(${U(h)??``}, minmax(0, 1fr))`})),K(e,t)},Ee=e=>{var n=qa();let r;Y(n,21,()=>U(v),Ir,(e,t,n)=>{var r=Ka();let i;Q(r,`data-t`,`c`+n);var a=L(r),o=R(a,!0),c=R(z(a,2),!0);A(r),B(e=>{i=X(r,1,`chord svelte-12d1dcp`,null,i,{on:U(b)[`c`+n],lit:e}),q(o,U(t).roman),q(c,U(t).name)},[()=>U(t).notes.every(e=>U(s).has(e))]),K(e,r)}),A(n),B(()=>r=Z(n,``,r,{"grid-template-columns":`repeat(${t.form===`phone`?2:7}, minmax(0, 1fr))`})),K(e,n)};J(Ce,e=>{U(l)===`Keyboard`?e(we):U(l)===`Scale`?e(Te,1):e(Ee,-1)}),A(xe);var De=z(xe,2),Oe=e=>{K(e,Ja())},ke=e=>{K(e,Ya())};J(De,e=>{U(d)?e(Oe):t.form===`phone`&&U(l)===`Keyboard`&&e(ke,1)}),A(ue),B((e,t)=>{Q(D,`aria-label`,`Key: ${e??``}`),q(me,t),q(he,U(a)),q(ye,$.prefs.octave),Se=Z(xe,``,Se,{"--tc":U(c)})},[()=>ea(U(i)),()=>ea(U(i))]),W(`click`,D,()=>$.sheet=`key`),W(`click`,k,()=>$.prefs.octave=Math.max(0,$.prefs.octave-1)),W(`click`,be,()=>$.prefs.octave=Math.min(7,$.prefs.octave+1)),W(`pointerdown`,xe,oe),W(`pointermove`,xe,se),W(`pointerup`,xe,ce),mr(`pointercancel`,xe,ce),K(e,ue),Be()}hr([`click`,`pointerdown`,`pointermove`,`pointerup`]);var Qa=G(`<span class="pill svelte-19m1tsu">Tilt is moving the point</span>`),$a=G(`<div><span class="mono an svelte-19m1tsu"> </span> <span class="names svelte-19m1tsu"><span class="pn svelte-19m1tsu"> </span><span class="pd svelte-19m1tsu"> </span></span> <span class="mono av svelte-19m1tsu"> </span></div>`),eo=G(`<button><span class="ph svelte-19m1tsu"></span>Tilt</button>`),to=G(`<span class="note dim svelte-19m1tsu">Tilt needs a secure (HTTPS) page, which a local Nota can’t offer yet.</span>`),no=G(`<div class="auto svelte-19m1tsu"><span class="rd svelte-19m1tsu"></span>Writing automation · latch</div>`),ro=G(`<div><div role="slider" tabindex="0" aria-label="XY pad"><div class="gridlines svelte-19m1tsu"></div> <div></div> <div></div> <div><span class="svelte-19m1tsu"></span></div> <span class="ax ax-x svelte-19m1tsu"> </span> <span class="ax ax-y svelte-19m1tsu"> </span> <!></div> <div class="panel svelte-19m1tsu"><div class="axes svelte-19m1tsu"></div> <div class="row svelte-19m1tsu"><div class="seg svelte-19m1tsu"><button>Hold</button> <button>Return</button></div> <!></div> <span class="note svelte-19m1tsu"> </span> <!> <!></div></div>`);function io(e,t){ze(t,!0);let n=M(()=>t.form===`phone`),r=P(.5),i=P(.5),a=P(!1),o=P(!1),s=!1,c={x:.5,y:.5},l={x:0,y:0},u=0,d=0,f=null,p=Ri(),m=M(()=>U(a)||U(o));un(()=>{let e=$.xy;!e||U(a)||U(o)||s||(e.x.v!==void 0&&!e.x.map&&F(r,e.x.v,!0),e.y.v!==void 0&&!e.y.map&&F(i,e.y.v,!0))});function h(e,t=`xy`){let n=performance.now();e===0&&n-d<30||(d=n,$.send({t:`xy`,v:U(r),v2:U(i),ph:e,s:t,i:$.learn.on?u:0}))}function g(e,t){let n=t.getBoundingClientRect();F(r,Math.min(1,Math.max(0,(e.clientX-n.left)/n.width)),!0),F(i,Math.min(1,Math.max(0,1-(e.clientY-n.top)/n.height)),!0)}function _(e){if(U(o)||!$.canControl){$.canControl||$.showToast(`Nota lets this phone play notes only.`);return}let t=e.currentTarget;t.setPointerCapture(e.pointerId),s=!1,c={x:U(r),y:U(i)},l={x:e.clientX,y:e.clientY},u=0,F(a,!0),g(e,t),$.learn.on||h(1)}function v(e){if(U(a)){if($.learn.on&&u===0){let t=Math.abs(e.clientX-l.x),n=Math.abs(e.clientY-l.y);if(Math.max(t,n)<14)return;u=t>=n?1:2}g(e,e.currentTarget),h(0)}}function y(){U(a)&&(F(a,!1),h(2),$.prefs.xyHold||b())}function b(){s=!0;let e=()=>{if(s&&!U(a)){if(F(r,U(r)+(c.x-U(r))*.2),F(i,U(i)+(c.y-U(i))*.2),Math.abs(c.x-U(r))+Math.abs(c.y-U(i))<.003){F(r,c.x,!0),F(i,c.y,!0),s=!1,h(2);return}h(0),requestAnimationFrame(e)}};requestAnimationFrame(e)}async function x(){if(!$.canControl)return $.showToast(`Nota lets this phone play notes only.`);if(U(o)){F(o,!1),f?.(),f=null,h(2,`tilt`);return}if(!await zi()){$.showToast(`Motion access was refused. Allow it in Settings → Safari → Motion & Orientation Access, then reload.`);return}F(o,!0),f=Bi((e,t)=>{F(r,e,!0),F(i,t,!0),h(0,`tilt`)})}un(()=>()=>f?.());let S=e=>{let t=$.xy?.[e];return t?U(o)&&t.tilt?t.tilt:t.map??t.n??(e===`x`?`X`:`Y`):e===`x`?`X`:`Y`},C=e=>{let t=$.xy?.[e];return t?U(o)&&t.tilt||t.map?`Mapped in Nota`:t.d??`Not assigned`:``},w=e=>{let t=$.xy?.[e],n=U(e===`x`?r:i);return t&&!t.map&&!(U(o)&&t.tilt)&&t.txt&&!U(a)&&!U(o)?t.txt:Math.round(n*100)+` %`},ee=M(()=>U(o)?`Tilt the phone to move the point. Tap Tilt again to use your finger.`:!$.xy?.ok&&!$.xy?.x.map&&!$.xy?.y.map?`This track has no Auto Filter or Nota Flux. Add one in Nota, or map the axes with MIDI Learn.`:$.prefs.xyHold?`The point stays where you lift your finger.`:`On release the point glides back to where it started.`);var T=ro();let te;var E=L(T);let ne;var re=z(L(E),2);let ie,ae;var oe=z(re,2);let se,ce;var le=z(oe,2);let ue,de;var fe=z(le,2),D=R(fe),pe=z(fe,2),me=R(pe),he=z(pe,2),ge=e=>{K(e,Qa())};J(he,e=>{U(o)&&e(ge)}),A(E);var O=z(E,2),_e=L(O);Y(_e,20,()=>[`x`,`y`],Ir,(e,t)=>{var n=$a();let r;var i=L(n),a=R(i,!0),o=z(i,2),s=L(o),c=R(s,!0),l=R(z(s),!0);A(o);var u=R(z(o,2),!0);A(n),B((e,i,o)=>{r=X(n,1,`axis svelte-19m1tsu`,null,r,{learnable:$.learn.on}),q(a,t===`x`?`X`:`Y`),q(c,e),q(l,i),q(u,o)},[()=>S(t),()=>C(t),()=>w(t)]),K(e,n)}),A(_e);var k=z(_e,2),ve=L(k),ye=L(ve);let be;var xe=z(ye,2);let Se;A(ve);var Ce=z(ve,2),we=e=>{var t=eo();let n;B(()=>{n=X(t,1,`btn tilt svelte-19m1tsu`,null,n,{on:U(o),learnable:$.learn.on}),Q(t,`aria-pressed`,U(o))}),W(`click`,t,x),K(e,t)};J(Ce,e=>{(p===`yes`||p===`ask`)&&e(we)}),A(k);var Te=z(k,2),Ee=R(Te,!0),De=z(Te,2),Oe=e=>{K(e,to())};J(De,e=>{p===`insecure`&&e(Oe)});var ke=z(De,2),Ae=e=>{K(e,no())};J(ke,e=>{$.xy?.auto&&e(Ae)}),A(O),A(T),B((e,t,a)=>{te=X(T,1,`xy svelte-19m1tsu`,null,te,{col:U(n)}),ne=X(E,1,`field svelte-19m1tsu`,null,ne,{learnable:$.learn.on}),Q(E,`aria-valuenow`,e),ie=X(re,1,`vl svelte-19m1tsu`,null,ie,{live:U(m)}),ae=Z(re,``,ae,{left:`${U(r)*100}%`}),se=X(oe,1,`hl svelte-19m1tsu`,null,se,{live:U(m)}),ce=Z(oe,``,ce,{top:`${(1-U(i))*100}%`}),ue=X(le,1,`pt svelte-19m1tsu`,null,ue,{live:U(m)}),de=Z(le,``,de,{left:`${U(r)*100}%`,top:`${(1-U(i))*100}%`}),q(D,`${t??``} →`),q(me,`↑ ${a??``}`),be=X(ye,1,`svelte-19m1tsu`,null,be,{on:$.prefs.xyHold}),Se=X(xe,1,`svelte-19m1tsu`,null,Se,{on:!$.prefs.xyHold}),q(Ee,U(ee))},[()=>Math.round(U(r)*100),()=>S(`x`),()=>S(`y`)]),W(`pointerdown`,E,_),W(`pointermove`,E,v),W(`pointerup`,E,y),mr(`pointercancel`,E,y),W(`click`,ye,()=>$.prefs.xyHold=!0),W(`click`,xe,()=>$.prefs.xyHold=!1),K(e,T),Be()}hr([`pointerdown`,`pointermove`,`pointerup`,`click`]);var ao=G(`<span class="tag mono svelte-4q66aa"><svg width="8" height="8" viewBox="0 0 8 8"><path d="M2.5 1.5 L5.5 4 L2.5 6.5" class="svelte-4q66aa"></path></svg> </span>`),oo=G(`<span class="held svelte-4q66aa"> </span>`),so=G(`<button><span class="svelte-4q66aa"></span>Arm</button>`),co=G(`<div><button class="head svelte-4q66aa"><span class="cbar svelte-4q66aa"></span> <span class="nm svelte-4q66aa"> </span> <!></button> <div role="slider" tabindex="0"><div class="pbar svelte-4q66aa"><span class="svelte-4q66aa"></span></div> <span class="mono pv svelte-4q66aa"> </span></div> <div class="fz svelte-4q66aa"><!> <div class="meters svelte-4q66aa"><div class="svelte-4q66aa"><span class="svelte-4q66aa"></span></div><div class="svelte-4q66aa"><span class="svelte-4q66aa"></span></div></div> <div role="slider" tabindex="0"><div class="slot svelte-4q66aa"></div> <div class="travel svelte-4q66aa"><span><i class="svelte-4q66aa"></i></span></div></div></div> <span> </span> <div class="btns svelte-4q66aa"><button>M</button> <button>S</button> <!></div></div>`),lo=G(`<div role="group" aria-label="Mixer"><div class="strips svelte-4q66aa"></div> <div class="rule svelte-4q66aa"></div> <div class="strip masterstrip svelte-4q66aa"><div class="head mh svelte-4q66aa"><span class="nm svelte-4q66aa">Master</span></div> <div class="fz svelte-4q66aa"><!> <div class="meters wide svelte-4q66aa"><div class="svelte-4q66aa"><span class="svelte-4q66aa"></span></div><div class="svelte-4q66aa"><span class="svelte-4q66aa"></span></div></div> <div role="slider" tabindex="0" aria-label="Master volume"><div class="slot svelte-4q66aa"></div> <div class="travel svelte-4q66aa"><span class="cap svelte-4q66aa"><i class="svelte-4q66aa"></i></span></div></div></div> <span> </span></div></div>`);function uo(e,t){ze(t,!0);let n=1.5,r=M(()=>new Map(($.mix?.ch??[]).map(e=>[e[0],e]))),i=M(()=>$.proj?.tracks??[]),a=M(()=>new Set($.prefs.groupsOpen)),o=M(()=>{let e=new Map(U(i).map(e=>[e.id,e]));return U(i).filter(t=>{let n=t.grp,r=0;for(;n>0&&r++<16;){if(!U(a).has(n))return!1;n=e.get(n)?.grp??-1}return!0})}),s=e=>U(i).filter(t=>t.grp===e).length,c=I({}),l=P(null),u=new Map;function d(e,t,n,r,i){if(!$.canControl){$.showToast(`Nota lets this phone play notes only.`);return}let a=e.currentTarget;a.setPointerCapture(e.pointerId);let o=performance.now();if(o-(u.get(t)??0)<300){u.delete(t);let e=r===`pan`?0:1;c[t]=e,$.send({t:r,id:n,v:e,ph:2}),setTimeout(()=>delete c[t],400),F(l,null);return}u.set(t,o);let s=a.getBoundingClientRect();F(l,{key:t,id:n,kind:r,start:i,y:e.clientY,x:e.clientX,size:r===`pan`?s.width:s.height},!0),c[t]=i,$.send({t:r,id:n,v:i,ph:1})}let f=0;function p(e){if(!U(l))return;let t=U(l).kind===`pan`?Math.max(-1,Math.min(1,U(l).start+(e.clientX-U(l).x)/U(l).size*2)):Math.max(0,Math.min(n,U(l).start+(U(l).y-e.clientY)/U(l).size*n));c[U(l).key]=t;let r=performance.now();r-f>30&&(f=r,$.send({t:U(l).kind,id:U(l).id,v:t,ph:0}))}function m(){if(!U(l))return;let e=U(l);F(l,null),$.send({t:e.kind,id:e.id,v:c[e.key],ph:2}),setTimeout(()=>{U(l)?.key!==e.key&&delete c[e.key]},400)}function h(e,t,n){if(!$.canControl)return $.showToast(`Nota lets this phone play notes only.`);$.send({t:e,id:t.id,on:n})}function g(e){let t=new Set($.prefs.groupsOpen);t.has(e.id)?t.delete(e.id):t.add(e.id),$.prefs.groupsOpen=[...t]}let _=e=>{if(e<1e-4)return`−∞`;let t=20*Math.log10(e);return(t>=.05?`+`:t<=-.05?`−`:``)+Math.abs(t).toFixed(1)},v=e=>Math.abs(e)<.01?`C`:(e<0?`L`:`R`)+Math.round(Math.abs(e)*50),y=e=>e&&e[8]&&e[9]!==$.conn?e[8]:``,b=M(()=>$.mix?.m);var x=lo(),S=L(x);Y(S,21,()=>U(o),e=>e.id,(e,t)=>{let i=M(()=>U(r).get(U(t).id)),o=M(()=>c[`v`+U(t).id]??U(i)?.[1]??1),u=M(()=>c[`p`+U(t).id]??U(i)?.[2]??0),f=M(()=>y(U(i))),p=M(()=>U(t).kind===`group`);var m=co();let b;var x=L(m),S=L(x);let C;var w=z(S,2),ee=R(w,!0),T=z(w,2),te=e=>{var n=ao(),r=L(n);let i;var o=z(r,1,!0);A(n),B((e,t)=>{i=Z(r,``,i,{transform:e}),q(o,t)},[()=>U(a).has(U(t).id)?`rotate(90deg)`:`none`,()=>s(U(t).id)]),K(e,n)};J(T,e=>{U(p)&&e(te)}),A(x);var E=z(x,2);let ne;var re=L(E),ie=L(re);let ae;A(re);var oe=R(z(re,2),!0);A(E);var se=z(E,2),ce=L(se),le=e=>{var t=oo(),n=R(t);B(()=>q(n,`${U(f)??``} has it`)),K(e,t)};J(ce,e=>{U(f)&&e(le)});var ue=z(ce,2),de=L(ue),fe=L(de);let D;A(de);var pe=z(de),me=L(pe);let he;A(pe),A(ue);var ge=z(ue,2);let O;var _e=z(L(ge),2),k=L(_e);let ve,ye;A(_e),A(ge),A(se);var be=z(se,2);let xe;var Se=R(be,!0),Ce=z(be,2),we=L(Ce);let Te;var Ee=z(we,2);let De;var Oe=z(Ee,2),ke=e=>{var n=so();let r;B(()=>{r=X(n,1,`arm svelte-4q66aa`,null,r,{on:U(i)?.[5]}),Q(n,`aria-pressed`,!!U(i)?.[5]),Q(n,`aria-label`,`Arm ${U(t).name??``}`)}),W(`click`,n,()=>h(`arm`,U(t),!U(i)?.[5])),K(e,n)};J(Oe,e=>{U(t).kind!==`group`&&U(t).kind!==`return`&&e(ke)}),A(Ce),A(m),B((e,r,a,s,c)=>{b=X(m,1,`strip svelte-4q66aa`,null,b,{group:U(p)}),Q(x,`aria-label`,e),C=Z(S,``,C,{background:U(t).color}),q(ee,U(t).name),ne=X(E,1,`pan svelte-4q66aa`,null,ne,{act:U(l)?.key===`p`+U(t).id}),Q(E,`aria-label`,`${U(t).name??``} pan`),Q(E,`aria-valuetext`,r),Q(E,`aria-valuenow`,U(u)),ae=Z(ie,``,ae,{left:`${50+U(u)*50}%`}),q(oe,a),D=Z(fe,``,D,{"--lv":U(i)?.[6]??0}),he=Z(me,``,he,{"--lv":U(i)?.[7]??0}),O=X(ge,1,`fader svelte-4q66aa`,null,O,{act:U(l)?.key===`v`+U(t).id}),Q(ge,`aria-label`,`${U(t).name??``} volume`),Q(ge,`aria-valuetext`,`${s??``} dB`),Q(ge,`aria-valuenow`,U(o)),ve=X(k,1,`cap svelte-4q66aa`,null,ve,{held:!!U(f)}),ye=Z(k,``,ye,{bottom:`${U(o)/n*100}%`}),xe=X(be,1,`mono dbv svelte-4q66aa`,null,xe,{act:U(l)?.key===`v`+U(t).id}),q(Se,c),Te=X(we,1,`ms svelte-4q66aa`,null,Te,{mute:U(i)?.[3]}),Q(we,`aria-pressed`,!!U(i)?.[3]),Q(we,`aria-label`,`Mute ${U(t).name??``}`),De=X(Ee,1,`ms svelte-4q66aa`,null,De,{solo:U(i)?.[4]}),Q(Ee,`aria-pressed`,!!U(i)?.[4]),Q(Ee,`aria-label`,`Solo ${U(t).name??``}`)},[()=>U(p)?`${U(t).name}: ${U(a).has(U(t).id)?`fold`:`unfold`}`:U(t).name,()=>v(U(u)),()=>v(U(u)),()=>_(U(o)),()=>_(U(o))]),W(`click`,x,()=>U(p)&&g(U(t))),W(`pointerdown`,E,e=>d(e,`p`+U(t).id,U(t).id,`pan`,U(u))),W(`pointerdown`,ge,e=>d(e,`v`+U(t).id,U(t).id,`vol`,U(o))),W(`click`,we,()=>h(`mute`,U(t),!U(i)?.[3])),W(`click`,Ee,()=>h(`solo`,U(t),!U(i)?.[4])),K(e,m)}),A(S);var C=z(S,4),w=z(L(C),2),ee=L(w),T=e=>{var t=oo(),n=R(t);B(()=>q(n,`${U(b)?.[3]??``} has it`)),K(e,t)},te=M(()=>y(U(b)));J(ee,e=>{U(te)&&e(T)});var E=z(ee,2),ne=L(E),re=L(ne);let ie;A(ne);var ae=z(ne),oe=L(ae);let se;A(ae),A(E);var ce=z(E,2);let le;var ue=z(L(ce),2),de=L(ue);let fe;A(ue),A(ce),A(w);var D=z(w,2);let pe;var me=R(D,!0);A(C),A(x),B(e=>{X(x,1,`mixer ${t.form??``}`,`svelte-4q66aa`),ie=Z(re,``,ie,{"--lv":U(b)?.[1]??0}),se=Z(oe,``,se,{"--lv":U(b)?.[2]??0}),le=X(ce,1,`fader svelte-4q66aa`,null,le,{act:U(l)?.key===`m`}),Q(ce,`aria-valuenow`,c.m??U(b)?.[0]??1),fe=Z(de,``,fe,{bottom:`${(c.m??U(b)?.[0]??1)/n*100}%`}),pe=X(D,1,`mono dbv svelte-4q66aa`,null,pe,{act:U(l)?.key===`m`}),q(me,e)},[()=>_(c.m??U(b)?.[0]??1)]),W(`pointermove`,x,p),W(`pointerup`,x,m),mr(`pointercancel`,x,m),W(`pointerdown`,ce,e=>d(e,`m`,0,`mvol`,c.m??U(b)?.[0]??1)),K(e,x),Be()}hr([`pointermove`,`pointerup`,`click`,`pointerdown`]);var fo=G(`<span class="mono pos svelte-1x69070"> </span>`),po=G(`<div class="empty svelte-1x69070"> </div>`),mo=G(`<span class="auto svelte-1x69070"></span>`),ho=wr(`<circle cx="26" cy="26" r="21" class="arc svelte-1x69070" transform="rotate(135 26 26)"></circle>`),go=wr(`<line x1="26" y1="26" x2="26" y2="14" class="ptr svelte-1x69070"></line>`),_o=G(`<div role="slider" tabindex="0"><!> <svg viewBox="0 0 52 52"><circle cx="26" cy="26" r="21" class="trk svelte-1x69070" transform="rotate(135 26 26)"></circle><!><circle cx="26" cy="26" r="14" class="capc svelte-1x69070"></circle><!></svg> <span class="kn svelte-1x69070"> </span> <span class="mono kv svelte-1x69070"> </span></div>`),vo=G(`<div class="grid svelte-1x69070"></div>`),yo=G(`<div class="macros svelte-1x69070" role="group" aria-label="Macros"><button class="dev svelte-1x69070"><span class="k svelte-1x69070">Device</span> <span class="dn svelte-1x69070"> </span> <!> <svg width="10" height="10" viewBox="0 0 10 10"><path d="M2 3.5 L5 6.5 L8 3.5" class="svelte-1x69070"></path></svg></button> <!></div>`);function bo(e,t){ze(t,!0);let n=M(()=>t.form===`phone`?2:4),r=M(()=>t.form===`phone`?64:t.form===`phoneLand`?52:112),i=M(()=>$.mac?.id===$.proj?.you?$.mac:null),a=M(()=>U(i)?.devs[U(i).di]??`No devices`),o=I({}),s=I({}),c=null,l=P(-1),u=0;function d(e,t,n){if(!$.canControl)return $.showToast(`Nota lets this phone play notes only.`);U(i)&&(e.currentTarget.setPointerCapture(e.pointerId),c={i:t,y:e.clientY,v:n},F(l,t,!0),o[t]=n,$.send({t:`mac`,i:t,v:n,ph:1}))}function f(e){if(!c)return;let t=Math.min(1,Math.max(0,c.v+(c.y-e.clientY)/200));o[c.i]=t,U(i)?.k[c.i]?.map&&(s[c.i]=t);let n=performance.now();n-u>30&&(u=n,$.send({t:`mac`,i:c.i,v:t,ph:0}))}function p(){if(!c)return;let e=c.i;$.send({t:`mac`,i:e,v:o[e],ph:2}),c=null,F(l,-1),setTimeout(()=>{U(l)!==e&&delete o[e]},500)}var m=yo(),h=L(m),g=z(L(h),2),_=R(g,!0),v=z(g,2),y=e=>{var t=fo(),n=R(t);B(()=>q(n,`${U(i).di+1}/${U(i).devs.length??``}`)),K(e,t)};J(v,e=>{U(i)&&U(i).devs.length>1&&e(y)}),be(2),A(h);var b=z(h,2),x=e=>{var t=po(),n=R(t,!0);B(()=>q(n,U(i)?`This track has no instrument or effects to control.`:`Loading…`)),K(e,t)},S=e=>{var t=vo();let a;Y(t,21,()=>U(i).k,Ir,(e,t,n)=>{let i=M(()=>o[n]??(U(t).map?s[n]??.5:U(t).v??0)),a=M(()=>U(l)===n),c=M(()=>U(t).n===void 0&&!U(t).map);var u=_o();let f;var p=L(u),m=e=>{K(e,mo())};J(p,e=>{U(t).a&&!U(t).map&&e(m)});var h=z(p,2),g=L(h);Q(g,`stroke-dasharray`,`98.9 131.9`);var _=z(g),v=e=>{var t=ho();B(()=>Q(t,`stroke-dasharray`,`${U(i)*98.9} 131.9`)),K(e,t)};J(_,e=>{U(c)||e(v)});var y=z(_,2),b=e=>{var t=go();B(()=>Q(t,`transform`,`rotate(${-135+270*U(i)} 26 26)`)),K(e,t)};J(y,e=>{U(c)||e(b)}),A(h);var x=z(h,2),S=R(x,!0),C=R(z(x,2),!0);A(u),B((e,i,o)=>{f=X(u,1,`knob svelte-1x69070`,null,f,{on:U(a),empty:U(c),learnable:$.learn.on&&!U(c)}),Q(u,`aria-label`,U(t).map??U(t).n??`Macro ${n+1}`),Q(u,`aria-valuenow`,e),Q(u,`aria-valuetext`,i),Q(h,`width`,U(r)),Q(h,`height`,U(r)),q(S,U(t).map??U(t).n??`Macro ${n+1}`),q(C,o)},[()=>Math.round(U(i)*100),()=>U(t).map?`${Math.round(U(i)*100)}\u2009%`:U(t).txt,()=>U(c)?`—`:U(t).map||U(a)?`${Math.round(U(i)*100)}\u2009%`:U(t).txt]),W(`pointerdown`,u,e=>!U(c)&&d(e,n,U(i))),K(e,u)}),A(t),B(()=>a=Z(t,``,a,{"grid-template-columns":`repeat(${U(n)??``}, minmax(0, 1fr))`})),K(e,t)};J(b,e=>{!U(i)||U(i).devs.length===0?e(x):e(S,-1)}),A(m),B(()=>q(_,U(a))),W(`pointermove`,m,f),W(`pointerup`,m,p),mr(`pointercancel`,m,p),W(`click`,h,()=>U(i)&&U(i).devs.length>1&&($.sheet=`devices`)),K(e,m),Be()}hr([`pointermove`,`pointerup`,`click`,`pointerdown`]);var xo=G(`<div class="empty svelte-he2l50">Loading…</div>`),So=G(`<div class="th svelte-he2l50"><span class="svelte-he2l50"></span><b class="svelte-he2l50"> </b></div>`),Co=G(`<div class="clip empty svelte-he2l50"></div>`),wo=G(`<span class="ptri svelte-he2l50"></span>`),To=G(`<span class="prog svelte-he2l50"></span>`),Eo=G(`<button><span class="cn svelte-he2l50"><!><span class="svelte-he2l50"><span class="mono svelte-he2l50"> </span> </span></span> <span class="cs svelte-he2l50"> </span> <!></button>`),Do=G(`<button class="scene svelte-he2l50"><span class="tri svelte-he2l50"></span> </button> <!>`,1),Oo=G(`<button class="stop svelte-he2l50"><span class="sq svelte-he2l50"></span>Stop</button>`),ko=G(`<div class="grid svelte-he2l50"><div class="label corner svelte-he2l50">Scene</div> <!> <!> <button class="stopall svelte-he2l50"><span class="sq svelte-he2l50"></span>All</button> <!></div>`),Ao=G(`<div class="scroll svelte-he2l50"><!></div>`);function jo(e,t){ze(t,!0);let n=M(()=>$.ses),r=M(()=>new Map(($.proj?.tracks??[]).map(e=>[e.id,e]))),i=M(()=>U(n)?.tr??[]),a=M(()=>t.form===`phone`?96:t.form===`phoneLand`?104:132),o=M(()=>t.form===`phone`?58:t.form===`phoneLand`?50:84),s=e=>{let t=e/4;return t===Math.round(t)?[t,t===1?`bar`:`bars`]:[e,`beats`]};function c(){return $.canControl?!0:($.showToast(`Nota lets this phone play notes only.`),!1)}var l=Ao(),u=L(l),d=e=>{K(e,xo())},f=e=>{var l=ko();let u;var d=z(L(l),2);Y(d,17,()=>U(i),e=>e.id,(e,t)=>{let n=M(()=>U(r).get(U(t).id));var i=So(),a=L(i);let o;var s=R(z(a),!0);A(i),B(()=>{o=Z(a,``,o,{background:U(n)?.color}),q(s,U(n)?.name??``)}),K(e,i)});var f=z(d,2);Y(f,16,()=>Array.from({length:U(n).n},(e,t)=>t),e=>e,(e,t)=>{var n=Do(),a=Zt(n);let l;var u=z(L(a));A(a),Y(z(a,2),17,()=>U(i),e=>e.id,(e,n)=>{let i=M(()=>U(r).get(U(n).id)),a=M(()=>{let[e,r,i]=U(n).c[t]??[0,0,0];return{st:e,len:r,prog:i}});var l=Er(),u=Zt(l),d=e=>{var t=Co();let n;B(()=>n=Z(t,``,n,{height:`${U(o)??``}px`})),K(e,t)},f=e=>{var r=Eo();let l,u;var d=L(r),f=L(d),p=e=>{K(e,wo())};J(f,e=>{U(a).st===3&&e(p)});var m=z(f),h=L(m),g=R(h,!0),_=z(h);A(m),A(d);var v=z(d,2),y=R(v,!0),b=z(v,2),x=e=>{var t=To();let n;B(()=>n=Z(t,``,n,{width:`${U(a).prog*100}%`})),K(e,t)};J(b,e=>{U(a).st===3&&e(x)}),A(r),B((e,n,s)=>{l=X(r,1,`clip svelte-he2l50`,null,l,{playing:U(a).st===3,queued:U(a).st===2,rec:U(a).st===4}),Q(r,`aria-label`,`${U(i)?.name??``} scene ${t+1}: ${U(a).st===3?`playing`:U(a).st===2?`queued`:U(a).st===4?`recording`:`stopped`}`),u=Z(r,``,u,{height:`${U(o)??``}px`,"--tc":U(i)?.color,"--tc-ink":e}),q(g,n),q(_,` ${s??``}`),q(y,U(a).st===3?`Playing`:U(a).st===2?`Queued`:U(a).st===4?`Recording`:``)},[()=>U(i)?Ei.inkOn(U(i).color):void 0,()=>s(U(a).len)[0],()=>s(U(a).len)[1]]),W(`click`,r,()=>c()&&$.send({t:`launch`,id:U(n).id,i:t})),K(e,r)};J(u,e=>{U(a).st===0?e(d):e(f,-1)}),K(e,l)}),B(()=>{Q(a,`aria-label`,`Launch scene ${t+1}`),l=Z(a,``,l,{height:`${U(o)??``}px`}),q(u,`Scene ${t+1}`)}),W(`click`,a,()=>c()&&$.send({t:`scene`,i:t})),K(e,n)});var p=z(f,2);Y(z(p,2),17,()=>U(i),e=>e.id,(e,t)=>{var n=Oo();B(e=>Q(n,`aria-label`,`Stop ${e??``}`),[()=>U(r).get(U(t).id)?.name]),W(`click`,n,()=>c()&&$.send({t:`stopSlot`,id:U(t).id})),K(e,n)}),A(l),B(()=>u=Z(l,``,u,{"grid-template-columns":`${t.form===`phone`?92:110}px repeat(${U(i).length??``}, minmax(${U(a)??``}px, 1fr))`})),W(`click`,p,()=>c()&&$.send({t:`stopAll`})),K(e,l)};J(u,e=>{U(n)?e(f,-1):e(d)}),A(l),K(e,l),Be()}hr([`click`]),Le();var Mo=mi(()=>$),No=G(`<div class="empty svelte-i7n35i"><span class="t svelte-i7n35i"> </span> <span class="s svelte-i7n35i">There is no instrument to play. Pick an instrument track, or use the transport to record.</span> <button class="btn svelte-i7n35i">Choose another track</button></div>`);function Po(e,t){ze(t,!1),fi();var n=No(),r=L(n),i=R(r),a=z(r,4);A(n),B(()=>q(i,`${Mo().track?.name??`This track`??``} is an audio track`)),W(`click`,a,()=>Mo(Mo().sheet=`tracks`)),K(e,n),Be()}hr([`click`]);var Fo=G(`<button> </button>`),Io=G(`<nav class="rail svelte-1n46o8q" aria-label="Screens"></nav>`),Lo=G(`<nav class="tabs svelte-1n46o8q" aria-label="Screens"></nav>`),Ro=G(`<div><!> <!> <div class="body svelte-1n46o8q"><!> <main><!> <!></main></div> <!> <!> <!></div>`);function zo(e,t){ze(t,!0);let n=M(()=>ji.form),r=M(()=>U(n)!==`phone`),i=M(()=>$.track),a=M(()=>U(i)?.kind===`audio`&&($.screen===`Pads`||$.screen===`Keys`)),o=M(()=>$.link===`lost`||$.link===`connecting`);un(()=>Ei.apply($.prefs.theme));var s=Ro(),c=L(s);Ki(c,{get form(){return U(n)}});var l=z(c,2);Ji(l,{});var u=z(l,2),d=L(u),f=e=>{var t=Io();Y(t,21,()=>Vi,Ir,(e,t)=>{var n=Fo();let r;var i=R(n,!0);B(()=>{r=X(n,1,`svelte-1n46o8q`,null,r,{on:$.screen===U(t)&&!$.bigTransport}),q(i,U(t))}),W(`click`,n,()=>$.setScreen(U(t))),K(e,n)}),A(t),K(e,t)};J(d,e=>{U(r)&&e(f)});var p=z(d,2);let m;var h=L(p),g=e=>{Po(e,{})},_=e=>{Ia(e,{get form(){return U(n)}})},v=e=>{Za(e,{get form(){return U(n)}})},y=e=>{io(e,{get form(){return U(n)}})},b=e=>{uo(e,{get form(){return U(n)}})},x=e=>{bo(e,{get form(){return U(n)}})},S=e=>{jo(e,{get form(){return U(n)}})};J(h,e=>{U(a)?e(g):$.screen===`Pads`?e(_,1):$.screen===`Keys`?e(v,2):$.screen===`XY`?e(y,3):$.screen===`Mixer`?e(b,4):$.screen===`Macros`?e(x,5):e(S,-1)});var C=z(h,2),w=e=>{Ma(e,{get form(){return U(n)}})};J(C,e=>{$.bigTransport&&e(w)}),A(p),A(u);var ee=z(u,2),T=e=>{var t=Lo();Y(t,21,()=>Vi,Ir,(e,t)=>{var n=Fo();let r;var i=R(n,!0);B(()=>{Q(n,`aria-current`,$.screen===U(t)&&!$.bigTransport?`page`:void 0),r=X(n,1,`svelte-1n46o8q`,null,r,{on:$.screen===U(t)&&!$.bigTransport}),q(i,U(t))}),W(`click`,n,()=>$.setScreen(U(t))),K(e,n)}),A(t),K(e,t)};J(ee,e=>{U(r)||e(T)});var te=z(ee,2);_a(te,{get form(){return U(n)}}),Da(z(te,2),{get form(){return U(n)}}),A(s),B(()=>{X(s,1,`shell ${U(n)??``}`,`svelte-1n46o8q`),Q(p,`aria-busy`,U(o)),m=X(p,1,`svelte-1n46o8q`,null,m,{dim:U(o)})}),mr(`pointerdown`,s,function(...e){Li?.apply(this,e)},!0),K(e,s),Be()}hr([`click`]);for(let e of[`gesturestart`,`gesturechange`,`contextmenu`,`dblclick`])document.addEventListener(e,e=>e.preventDefault(),{passive:!1});document.addEventListener(`touchmove`,e=>{e.touches.length>1&&e.preventDefault()},{passive:!1}),document.addEventListener(`visibilitychange`,()=>{document.visibilityState===`visible`?$.wake():$.releaseHeld()}),window.addEventListener(`online`,()=>$.wake()),`serviceWorker`in navigator&&window.isSecureContext&&navigator.serviceWorker.register(`./sw.js`).catch(()=>{}),jr(zo,{target:document.getElementById(`app`)}),$.connect();\ No newline at end of filediff --git a/src/managed/Nota.Remote/wwwroot/assets/index-DhoOZbYt.js b/src/managed/Nota.Remote/wwwroot/assets/index-DhoOZbYt.jsdeleted file mode 100644index d15e2c2f..00000000--- a/src/managed/Nota.Remote/wwwroot/assets/index-DhoOZbYt.js+++ /dev/null@@ -1,2 +0,0 @@-(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),t.credentials=e.crossOrigin===`use-credentials`?`include`:e.crossOrigin===`anonymous`?`omit`:`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var e=Array.isArray,t=Array.prototype.indexOf,n=Array.prototype.includes,r=Array.from,i=Object.defineProperty,a=Object.getOwnPropertyDescriptor,o=Object.getOwnPropertyDescriptors,s=Object.prototype,c=Array.prototype,l=Object.getPrototypeOf,u=Object.isExtensible,d=()=>{};function f(e){return e()}function p(e){for(var t=0;t<e.length;t++)e[t]()}function m(){var e,t;return{promise:new Promise((n,r)=>{e=n,t=r}),resolve:e,reject:t}}var h=1024,g=2048,_=4096,v=8192,y=16384,b=32768,x=1<<25,S=65536,C=1<<19,w=1<<20,T=1<<25,ee=1<<21,E=1<<22,D=1<<23,te=Symbol(`$state`),ne=Symbol(`component`),re=Symbol(``),ie=Symbol(`attributes`),ae=Symbol(`class`),oe=Symbol(`style`),se=Symbol(`text`),ce=Symbol(`form reset`),le=new class extends Error{name=`StaleReactionError`;message="The reaction that called `getAbortSignal()` was re-run or destroyed"},ue=!!globalThis.document?.contentType&&globalThis.document.contentType.includes(`xml`),de={},O=Symbol(`uninitialized`),fe=`http://www.w3.org/1999/xhtml`;function pe(){console.warn(`https://svelte.dev/e/derived_inert`)}function me(e){console.warn(`https://svelte.dev/e/hydration_mismatch`)}function he(){console.warn(`https://svelte.dev/e/svelte_boundary_reset_noop`)}var k=!1;function ge(e){k=e}var A;function _e(e){if(e===null)throw me(),de;return A=e}function ve(){return _e(Xt(A))}function j(e){if(k){if(Xt(A)!==null)throw me(),de;A=e}}function ye(e=1){if(k){for(var t=e,n=A;t--;)n=Xt(n);A=n}}function be(e=!0){for(var t=0,n=A;;){if(n.nodeType===8){var r=n.data;if(r===`]`){if(t===0)return n;--t}else(r===`[`||r===`[!`||r[0]===`[`&&!isNaN(Number(r.slice(1))))&&(t+=1)}var i=Xt(n);e&&n.remove(),n=i}}function xe(e){if(!e||e.nodeType!==8)throw me(),de;return e.data}function Se(e){return e===this.v}function Ce(e,t){return e==e?e!==t||typeof e==`object`&&!!e||typeof e==`function`:t==t}function we(e){return!Ce(e,this.v)}function Te(){throw Error(`https://svelte.dev/e/async_derived_orphan`)}function Ee(e,t,n){throw Error(`https://svelte.dev/e/each_key_duplicate`)}function De(e){throw Error(`https://svelte.dev/e/effect_in_teardown`)}function Oe(){throw Error(`https://svelte.dev/e/effect_in_unowned_derived`)}function ke(e){throw Error(`https://svelte.dev/e/effect_orphan`)}function Ae(){throw Error(`https://svelte.dev/e/effect_update_depth_exceeded`)}function je(){throw Error(`https://svelte.dev/e/state_descriptors_fixed`)}function Me(){throw Error(`https://svelte.dev/e/state_prototype_fixed`)}function Ne(){throw Error(`https://svelte.dev/e/state_unsafe_mutation`)}function Pe(){throw Error(`https://svelte.dev/e/svelte_boundary_reset_onerror`)}var Fe=!1;function Ie(){Fe=!0}var M=null;function Le(e){M=e}function Re(e,t=!1,n){M={p:M,i:!1,c:null,e:null,s:e,x:null,r:H,l:Fe&&!t?{s:null,u:null,$:[]}:null}}function ze(e){var t=M,n=t.e;if(n!==null){t.e=null;for(var r of n)dn(r)}return e!==void 0&&(t.x=e),t.i=!0,M=t.p,Be(e)}function Be(e={}){return i(e,ne,{value:!0}),e}function Ve(){return!Fe||M!==null&&M.l===null}var He=[];function Ue(){var e=He;He=[],p(e)}function We(e){if(He.length===0&&!_t){var t=He;queueMicrotask(()=>{t===He&&Ue()})}He.push(e)}function Ge(){for(;He.length>0;)Ue()}var Ke=~(g|_|h);function qe(e,t){e.f=e.f&Ke|t}function Je(e){e.f&512||e.deps===null?qe(e,h):qe(e,_)}function Ye(e,t,n){e.f&2048?t.add(e):e.f&4096&&n.add(e),qe(e,h)}var Xe=!1;function Ze(){Xe||(Xe=!0,document.addEventListener(`reset`,e=>{Promise.resolve().then(()=>{if(!e.defaultPrevented)for(let t of e.target.elements)t[ce]?.()})},{capture:!0}))}function Qe(e){var t=V,n=H;In(null),Ln(null);try{return e()}finally{In(t),Ln(n)}}function $e(e,t,n,r=n){e.addEventListener(t,()=>Qe(n));let i=e[ce];e[ce]=i?()=>{i(),r(!0)}:()=>r(!0),Ze()}function et(e,t,n,r){let i=Ve()?it:st;var a=e.filter(e=>!e.settled),o=t.map(i);if(n.length===0&&a.length===0){r(o);return}var s=H,c=tt(),l=a.length===1?a[0].promise:a.length>1?Promise.all(a.map(e=>e.promise)):null;function u(e){if(!(s.f&16384)){c();try{r([...o,...e])}catch(e){rn(e,s)}nt()}}var d=rt();if(n.length===0){l.then(()=>u([])).finally(d);return}function f(){Promise.all(n.map(e=>ot(e))).then(u).catch(e=>rn(e,s)).finally(d)}l?l.then(()=>{c(),f(),nt()}):f()}function tt(){var e=H,t=V,n=M,r=P;return function(i=!0){Ln(e),In(t),Le(n),i&&!(e.f&16384)&&(r?.activate(),r?.apply())}}function nt(e=!0){Ln(null),In(null),Le(null),e&&P?.deactivate()}function rt(){var e=H,t=e.b,n=P,r=!!t?.is_rendered();return t?.update_pending_count(1,n),n.increment(r,e),()=>{t?.update_pending_count(-1,n),n.decrement(r,e)}}function it(e){var t=2|g;return H!==null&&(H.f|=C),{ctx:M,deps:null,effects:null,equals:Se,f:t,fn:e,reactions:null,rv:0,v:O,wv:0,parent:H,ac:null}}var at=Symbol(`obsolete`);function ot(e,t,n){let r=H;r===null&&Te();var i=void 0,a=Pt(O),o=!V,s=new Set;return gn(()=>{var t=H,n=m();i=n.promise;try{Promise.resolve(e()).then(n.resolve,e=>{e!==le&&n.reject(e)}).finally(nt)}catch(e){n.reject(e),nt()}var c=P;if(o){if(t.f&32768)var l=rt();if(r.b?.is_rendered())c.async_deriveds.get(t)?.reject(at);else for(let e of s.values())e.reject(at);s.add(n),c.async_deriveds.set(t,n)}let u=(e,t=void 0)=>{l?.(),s.delete(n),t!==at&&(c.activate(),t?(a.f|=D,Rt(a,t)):(a.f&8388608&&(a.f^=D),Rt(a,e)),c.deactivate())};n.promise.then(u,e=>u(null,e||`unknown`))}),ln(()=>{for(let e of s)e.reject(at)}),new Promise(e=>{function t(n){function r(){n===i?e(a):t(i)}n.then(r,r)}t(i)})}function N(e){let t=it(e);return zn(t),t}function st(e){let t=it(e);return t.equals=we,t}function ct(e){var t=e.effects;if(t!==null){e.effects=null;for(var n=0;n<t.length;n+=1)Cn(t[n])}}function lt(e){var t,n=H,r=e.parent;if(!Nn&&r!==null&&e.v!==O&&r.f&24576)return pe(),e.v;Ln(r);try{ct(e),t=Zn(e)}finally{Ln(n)}return t}function ut(e){var t=lt(e);if(!e.equals(t)&&(e.wv=Jn(),(!P?.is_fork||e.deps===null)&&(P===null?e.v=t:(P.capture(e,t,!0),mt?.capture(e,t,!0)),e.deps===null))){qe(e,h);return}Nn||(ht===null?Je(e):(cn()||P?.is_fork)&&ht.set(e,t))}function dt(e){if(e.effects!==null)for(let t of e.effects)(t.teardown||t.ac)&&(t.teardown?.(),t.ac!==null&&Qe(()=>{t.ac.abort(le),t.ac=null}),t.fn!==null&&(t.teardown=d),er(t,0),xn(t))}function ft(e){if(e.effects!==null)for(let t of e.effects)t.teardown&&t.fn!==null&&tr(t)}var pt=null,P=null,mt=null,ht=null,gt=null,_t=!1,vt=!1,yt=null,bt=null,xt=0,St=1,Ct=class e{id=St++;#e=!1;linked=!0;#t=null;#n=null;async_deriveds=new Map;current=new Map;previous=new Map;#r=new Set;#i=new Set;#a=0;#o=new Map;#s=null;#c=[];#l=[];#u=new Set;#d=new Set;#f=new Map;#p=new Set;is_fork=!1;#m=!1;constructor(){pt===null?pt=this:(pt.#n=this,this.#t=pt),pt=this}#h(){if(this.is_fork)return!0;for(let n of this.#o.keys()){for(var e=n,t=!1;e.parent!==null;){if(this.#f.has(e)){t=!0;break}e=e.parent}if(!t)return!0}return!1}skip_effect(e){this.#f.has(e)||this.#f.set(e,{d:[],m:[]}),this.#p.delete(e)}unskip_effect(e,t=e=>this.schedule(e)){var n=this.#f.get(e);if(n){this.#f.delete(e);for(var r of n.d)qe(r,g),t(r);for(r of n.m)qe(r,_),t(r)}this.#p.add(e)}#g(){var e=[];for(let i of this.#c)if(!(i.f&16384||!(i.f&6144))){for(var t=i,n=!1;t.parent!==null;){t=t.parent;var r=t.f;if(r&96){if(!(r&1024)){n=!0;break}t.f^=h}}n||e.push(t)}return this.#c=[],e}#_(){this.#e=!0;for(let e of this.#u)this.#d.delete(e),qe(e,g),this.schedule(e);for(let e of this.#d)qe(e,_),this.schedule(e);this.apply();for(var t=yt=[],n=[],r=bt=[];this.#c.length>0;){xt++>1e3&&(this.#S(),Tt());for(let e of this.#g())try{this.#v(e,t,n)}catch(t){throw At(e),this.#h()||this.discard(),t}}if(P=null,r.length>0){var i=e.ensure();for(let e of r)i.schedule(e)}if(yt=null,bt=null,this.#h()){this.#x(n),this.#x(t);for(let[e,t]of this.#f)kt(e,t);r.length>0&&P.#_();return}let a=this.#y();if(a){this.#x(n),this.#x(t),a.#b(this);return}this.#u.clear(),this.#d.clear();for(let e of this.#r)e(this);this.#r.clear(),mt=this,Dt(n),Dt(t),mt=null,this.#s?.resolve();var o=P;if(this.#a===0&&(this.#c.length===0||o!==null)&&this.#S(),this.#c.length>0){if(o!==null){for(let e of this.#c)o.#c.push(e);this.#c=[]}else o=this}o!==null&&(Mt.clear(),o.#_())}#v(e,t,n){e.f^=h;for(var r=e.first;r!==null;){var i=r.f,a=!!(i&96);if(!(a&&i&1024||i&8192||this.#f.has(r))&&r.fn!==null){a?r.f^=h:i&4?t.push(r):Yn(r)&&(i&16&&this.#d.add(r),tr(r));var o=r.first;if(o!==null){r=o;continue}}for(;r!==null;){var s=r.next;if(s!==null){r=s;break}r=r.parent}}}#y(){for(var e=this.#t;e!==null;){if(!e.is_fork){for(let[t,[,n]]of this.current)if(e.current.has(t)&&!n)return e}e=e.#t}return null}#b(e){for(let[t,n]of e.current)!this.previous.has(t)&&e.previous.has(t)&&this.previous.set(t,e.previous.get(t)),this.current.set(t,n);for(let[t,n]of e.async_deriveds){let e=this.async_deriveds.get(t);e&&n.promise.then(e.resolve).catch(e.reject)}e.async_deriveds.clear(),this.transfer_effects(e.#u,e.#d);let t=e=>{var n=e.reactions;if(n!==null&&!(e.f&2&&!(e.f&6144)))for(let e of n){var r=e.f;if(r&2)t(e);else{var i=e;r&4194320&&!this.async_deriveds.has(i)&&(this.#d.delete(i),qe(i,g),this.schedule(i))}}};for(let e of this.current.keys())t(e);this.oncommit(()=>e.discard()),e.#S(),P=this,this.#_()}#x(e){for(var t=0;t<e.length;t+=1)Ye(e[t],this.#u,this.#d)}capture(e,t,n=!1){e.v!==O&&!this.previous.has(e)&&this.previous.set(e,e.v),e.f&8388608||(this.current.set(e,[t,n]),ht?.set(e,t)),this.is_fork||(e.v=t)}activate(){P=this}deactivate(){P=null,ht=null}flush(){try{vt=!0,P=this,this.#_()}finally{xt=0,gt=null,yt=null,bt=null,vt=!1,P=null,ht=null,Mt.clear()}}discard(){for(let e of this.#i)e(this);this.#i.clear();for(let e of this.async_deriveds.values())e.reject(at);this.#S(),this.#s?.resolve()}register_created_effect(e){this.#l.push(e)}increment(e,t){if(this.#a+=1,e){let e=this.#o.get(t)??0;this.#o.set(t,e+1)}}decrement(e,t){if(--this.#a,e){let e=this.#o.get(t)??0;e===1?this.#o.delete(t):this.#o.set(t,e-1)}this.#m||(this.#m=!0,We(()=>{this.#m=!1,this.linked&&this.flush()}))}transfer_effects(e,t){for(let t of e)this.#u.add(t);for(let e of t)this.#d.add(e);e.clear(),t.clear()}oncommit(e){this.#r.add(e)}ondiscard(e){this.#i.add(e)}settled(){return(this.#s??=m()).promise}static ensure(){if(P===null){let t=P=new e;!vt&&!_t&&We(()=>{t.#e||t.flush()})}return P}apply(){ht=null}schedule(e){if(gt=e,e.b?.is_pending&&e.f&16777228&&!(e.f&32768)){e.b.defer_effect(e);return}this.#c.push(e)}#S(){if(this.linked){var e=this.#t,t=this.#n;e===null||(e.#n=t),t===null?pt=e:t.#t=e,this.linked=!1}}};function wt(e){var t=_t;_t=!0;try{var n;for(e&&(P!==null&&!P.is_fork&&P.flush(),n=e());;){if(Ge(),P===null)return n;P.flush()}}finally{_t=t}}function Tt(){try{Ae()}catch(e){rn(e,gt)}}var Et=null;function Dt(e){var t=e.length;if(t!==0){for(var n=0;n<t;){var r=e[n++];if(!(r.f&24576)&&Yn(r)&&(Et=new Set,tr(r),r.deps===null&&r.first===null&&r.nodes===null&&r.teardown===null&&r.ac===null&&Tn(r),Et?.size>0)){Mt.clear();for(let e of Et){if(e.f&24576)continue;let t=[e],n=e.parent;for(;n!==null;)Et.has(n)&&(Et.delete(n),t.push(n)),n=n.parent;for(let e=t.length-1;e>=0;e--){let n=t[e];n.f&24576||tr(n)}}Et.clear()}}Et=null}}function Ot(e){P.schedule(e)}function kt(e,t){if(!(e.f&32&&e.f&1024)){e.f&2048?t.d.push(e):e.f&4096&&t.m.push(e),qe(e,h);for(var n=e.first;n!==null;)kt(n,t),n=n.next}}function At(e){qe(e,h);for(var t=e.first;t!==null;)At(t),t=t.next}var jt=new Set,Mt=new Map,Nt=!1;function Pt(e,t){return{f:0,v:e,reactions:null,equals:Se,rv:0,wv:0}}function F(e,t){let n=Pt(e,t);return zn(n),n}function Ft(e,t=!1,n=!0){let r=Pt(e);return t||(r.equals=we),Fe&&n&&M!==null&&M.l!==null&&(M.l.s??=[]).push(r),r}function I(e,t,n=!1){return V!==null&&(!Fn||V.f&131072)&&Ve()&&V.f&4325394&&(Rn===null||!Rn.has(e))&&Ne(),Rt(e,n?Ht(t):t,bt)}var It=null,Lt=0;function Rt(e,t,n=null){if(!e.equals(t)){Nn?Mt.set(e,t):Mt.has(e)||Mt.set(e,e.v);var r=Ct.ensure();if(r.capture(e,t),e.f&2){let t=e;e.f&2048&<(t),ht===null&&Je(t)}e.wv=Jn(),It=null,Lt=0,Vt(e,g,n),It=null,Ve()&&H!==null&&H.f&1024&&!(H.f&96)&&(Hn===null?Un([e]):Hn.push(e)),!r.is_fork&&jt.size>0&&!Nt&&zt()}return t}function zt(){Nt=!1;for(let e of jt){e.f&1024&&qe(e,_);let t;try{t=Yn(e)}catch{t=!0}t&&tr(e)}jt.clear()}function Bt(e){I(e,e.v+1)}function Vt(e,t,n){var r=e.reactions;if(r!==null){var i=Ve(),a=r.length;if(Lt+=a,Lt>1e5&&It===null&&(It=new Set),It!==null){if(It.has(e))return;It.add(e)}for(var o=0;o<a;o++){var s=r[o],c=s.f;if(i||s!==H){var l=(c&g)===0;if(l&&qe(s,t),c&131072)jt.add(s);else if(c&2){var u=s;ht?.delete(u),Vt(u,_,n)}else if(l){var d=s;c&16&&Et!==null&&Et.add(d),n===null?Ot(d):n.push(d)}}}}}function Ht(t){if(typeof t!=`object`||!t||te in t||ne in t)return t;let n=l(t);if(n!==s&&n!==c)return t;var r=new Map,i=e(t),o=F(0),u=null,d=Kn,f=e=>{if(Kn===d)return e();var t=V,n=Kn;In(null),qn(d);var r=e();return In(t),qn(n),r};return i&&r.set(`length`,F(t.length,u)),new Proxy(t,{defineProperty(e,t,n){(!(`value`in n)||n.configurable===!1||n.enumerable===!1||n.writable===!1)&&je();var i=r.get(t);return i===void 0?f(()=>{var e=F(n.value,u);return r.set(t,e),e}):I(i,n.value,!0),!0},deleteProperty(e,t){var n=r.get(t);if(n===void 0){if(t in e){let e=f(()=>F(O,u));r.set(t,e),Bt(o)}}else I(n,O),Bt(o);return!0},get(e,n,i){if(n===te)return t;var o=r.get(n),s=n in e;if(o===void 0&&(!s||a(e,n)?.writable)&&(o=f(()=>F(Ht(s?e[n]:O),u)),r.set(n,o)),o!==void 0){var c=U(o);return c===O?void 0:c}return Reflect.get(e,n,i)},getOwnPropertyDescriptor(e,t){this.has?.(e,t);var n=Reflect.getOwnPropertyDescriptor(e,t),i=r.get(t);if(i!==void 0){var a=U(i);if(a===O)return;if(n&&`value`in n)n.value=a;else return{enumerable:!0,configurable:!0,value:a,writable:!0}}return n},has(e,t){if(t===te)return!0;var n=r.get(t),i=n!==void 0&&n.v!==O||Reflect.has(e,t);return(n!==void 0||H!==null&&(!i||a(e,t)?.writable))&&(n===void 0&&(n=f(()=>F(i?Ht(e[t]):O,u)),r.set(t,n)),U(n)===O)?!1:i},set(e,t,n,s){var c=r.get(t),l=t in e;if(i&&t===`length`)for(var d=n;d<c.v;d+=1){var p=r.get(d+``);p===void 0?d in e&&(p=f(()=>F(O,u)),r.set(d+``,p)):I(p,O)}if(c===void 0)(!l||a(e,t)?.writable)&&(c=f(()=>F(void 0,u)),I(c,Ht(n)),r.set(t,c));else{l=c.v!==O;var m=f(()=>Ht(n));I(c,m)}var h=Reflect.getOwnPropertyDescriptor(e,t);if(h?.set&&h.set.call(s,n),!l){if(i&&typeof t==`string`){var g=r.get(`length`),_=Number(t);Number.isInteger(_)&&_>=g.v&&I(g,_+1)}Bt(o)}return!0},ownKeys(e){U(o);var t=Reflect.ownKeys(e).filter(e=>{var t=r.get(e);return t===void 0||t.v!==O});for(var[n,i]of r)i.v!==O&&!(n in e)&&t.push(n);return t},setPrototypeOf(){Me()}})}var Ut,Wt,Gt,Kt;function qt(){if(Ut===void 0){Ut=window,Wt=/Firefox/.test(navigator.userAgent);var e=Element.prototype,t=Node.prototype,n=Text.prototype;Gt=a(t,`firstChild`).get,Kt=a(t,`nextSibling`).get,u(e)&&(e[ae]=void 0,e[ie]=null,e[oe]=void 0,e.__e=void 0),u(n)&&(n[se]=void 0)}}function Jt(e=``){return document.createTextNode(e)}function Yt(e){return Gt.call(e)}function Xt(e){return Kt.call(e)}function L(e,t){if(!k)return Yt(e);var n=Yt(A);if(n===null)n=A.appendChild(Jt());else if(t&&n.nodeType!==3){var r=Jt();return n?.before(r),_e(r),r}return t&&tn(n),_e(n),n}function Zt(e,t=!1){if(!k){var n=Yt(e);return n instanceof Comment&&n.data===``?Xt(n):n}if(t){if(A?.nodeType!==3){var r=Jt();return A?.before(r),_e(r),r}tn(A)}return A}function R(e,t=!1){if(!k)return Yt(e);var n=L(e,t);return j(e),n}function z(e,t=1,n=!1){let r=k?A:e;for(var i;t--;)i=r,r=Xt(r);if(!k)return r;if(n){if(r?.nodeType!==3){var a=Jt();return r===null?i?.after(a):r.before(a),_e(a),a}tn(r)}return _e(r),r}function Qt(e){e.textContent=``}function $t(){return!1}function en(e,t,n){return t==null||t===`http://www.w3.org/1999/xhtml`?n?document.createElement(e,{is:n}):document.createElement(e):n?document.createElementNS(t,e,{is:n}):document.createElementNS(t,e)}function tn(e){if(e.nodeValue.length<65536)return;let t=e.nextSibling;for(;t!==null&&t.nodeType===3;)t.remove(),e.nodeValue+=t.nodeValue,t=e.nextSibling}function nn(e){var t=H;if(t===null)return V.f|=D,e;if(!(t.f&32768)&&!(t.f&4))throw e;rn(e,t)}function rn(e,t){if(!(t!==null&&t.f&16384)){for(;t!==null;){if(t.f&128&&!(t.f&33570816)){if(!(t.f&32768))throw e;try{t.b.error(e);return}catch(t){e=t}}t=t.parent}throw e}}function an(e){H===null&&(V===null&&ke(e),Oe()),Nn&&De(e)}function on(e,t){var n=t.last;n===null?t.last=t.first=e:(n.next=e,e.prev=n,t.last=e)}function sn(e,t){var n=H;n!==null&&n.f&8192&&(e|=v);var r={ctx:M,deps:null,nodes:null,f:e|g|512,first:null,fn:t,last:null,next:null,parent:n,b:n&&n.b,prev:null,teardown:null,wv:0,ac:null};P?.register_created_effect(r);var i=r;if(e&4)yt===null?Ct.ensure().schedule(r):yt.push(r);else if(t!==null){try{tr(r)}catch(e){throw Cn(r),e}i.deps===null&&i.teardown===null&&i.nodes===null&&i.first===i.last&&!(i.f&524288)&&(i=i.first,e&16&&e&65536&&i!==null&&(i.f|=S))}if(i!==null&&(i.parent=n,n!==null&&on(i,n),V!==null&&V.f&2&&!(e&64))){var a=V;(a.effects??=[]).push(i)}return r}function cn(){return V!==null&&!Fn}function ln(e){let t=sn(8,null);return qe(t,h),t.teardown=e,t}function un(e){an(`$effect`);var t=H.f;if(!V&&t&32&&M!==null&&!M.i){var n=M;(n.e??=[]).push(e)}else return dn(e)}function dn(e){return sn(4|w,e)}function fn(e){return an(`$effect.pre`),sn(8|w,e)}function pn(e){Ct.ensure();let t=sn(64|C,e);return()=>{Cn(t)}}function mn(e){Ct.ensure();let t=sn(64|C,e);return(e={})=>new Promise(n=>{e.outro?En(t,()=>{Cn(t),n(void 0)}):(Cn(t),n(void 0))})}function hn(e){return sn(4,e)}function gn(e){return sn(E|C,e)}function _n(e,t=0){return sn(8|t,e)}function B(e,t=[],n=[],r=[]){et(r,t,n,t=>{sn(8,()=>{e(...t.map(U))})})}function vn(e,t=0){return sn(16|t,e)}function yn(e){return sn(32|C,e)}function bn(e){var t=e.teardown;if(t!==null){let n=Nn,r=V;Pn(!0),In(null);try{t.call(null)}catch(t){rn(t,e.parent)}finally{Pn(n),In(r)}}}function xn(e,t=!1){var n=e.first;for(e.first=e.last=null;n!==null;){let e=n.ac;e!==null&&Qe(()=>{e.abort(le)});var r=n.next;n.f&64?n.parent=null:Cn(n,t),n=r}}function Sn(e){for(var t=e.first;t!==null;){var n=t.next;t.f&32||Cn(t),t=n}}function Cn(e,t=!0){var n=!1;(t||e.f&262144)&&e.nodes!==null&&e.nodes.end!==null&&(wn(e.nodes.start,e.nodes.end),n=!0),e.f|=x,xn(e,t&&!n),er(e,0);var r=e.nodes&&e.nodes.t;if(r!==null)for(let e of r)e.stop();bn(e),e.f^=x,e.f|=y;var i=e.parent;i!==null&&i.first!==null&&Tn(e),e.next=e.prev=e.teardown=e.ctx=e.deps=e.fn=e.nodes=e.ac=e.b=null}function wn(e,t){for(;e!==null;){var n=e===t?null:Xt(e);e.remove(),e=n}}function Tn(e){var t=e.parent,n=e.prev,r=e.next;n!==null&&(n.next=r),r!==null&&(r.prev=n),t!==null&&(t.first===e&&(t.first=r),t.last===e&&(t.last=n))}function En(e,t,n=!0){var r=[];e.f|=256,Dn(e,r,!0);var i=()=>{n&&Cn(e),t&&t()},a=r.length;if(a>0){var o=()=>--a||i();for(var s of r)s.out(o)}else i()}function Dn(e,t,n){if(!(e.f&8192)){e.f^=v;var r=e.nodes&&e.nodes.t;if(r!==null)for(let e of r)(e.is_global||n)&&t.push(e);for(var i=e.first;i!==null;){var a=i.next;if(!(i.f&64)){var o=!!(i.f&65536)||!!(i.f&32)&&!!(e.f&16);Dn(i,t,o?n:!1)}i=a}}}function On(e){e.f&=-257,kn(e,!0)}function kn(e,t){if(!(e.f&256)&&e.f&8192){e.f^=v,e.f&1024||(qe(e,g),Ct.ensure().schedule(e));for(var n=e.first;n!==null;){var r=n.next,i=!!(n.f&65536)||!!(n.f&32);kn(n,i?t:!1),n=r}var a=e.nodes&&e.nodes.t;if(a!==null)for(let e of a)(e.is_global||t)&&e.in()}}function An(e,t){if(e.nodes)for(var n=e.nodes.start,r=e.nodes.end;n!==null;){var i=n===r?null:Xt(n);t.append(n),n=i}}var jn=null,Mn=!1,Nn=!1;function Pn(e){Nn=e}var V=null,Fn=!1;function In(e){V=e}var H=null;function Ln(e){H=e}var Rn=null;function zn(e){V!==null&&(V.f&2097152||V.f&2)&&(Rn??=new Set).add(e)}var Bn=null,Vn=0,Hn=null;function Un(e){Hn=e}var Wn=1,Gn=0,Kn=Gn;function qn(e){Kn=e}function Jn(){return++Wn}function Yn(e){var t=e.f;if(t&2048)return!0;if(t&4096){for(var n=e.deps,r=n.length,i=0;i<r;i++){var a=n[i];if(Yn(a)&&ut(a),a.wv>e.wv)return!0}t&512&&ht===null&&qe(e,h)}return!1}function Xn(e,t,n=!0){var r=e.reactions;if(r!==null&&!(Rn!==null&&Rn.has(e)))for(var i=0;i<r.length;i++){var a=r[i];a.f&2?Xn(a,t,!1):t===a&&(n?qe(a,g):a.f&1024&&qe(a,_),Ot(a))}}function Zn(e){var t=Bn,n=Vn,r=Hn,i=V,a=Rn,o=M,s=Fn,c=Kn,l=e.f;Bn=null,Vn=0,Hn=null,V=l&96?null:e,Rn=null,Le(e.ctx),Fn=!1,Kn=++Gn,e.ac!==null&&(Qe(()=>{e.ac.abort(le)}),e.ac=null);try{e.f|=ee;var u=e.fn,d=u();e.f|=b;var f=Qn(e);if(Ve()&&Hn!==null&&!Fn&&f!==null&&!(e.f&6146))for(var p=0;p<Hn.length;p++)Xn(Hn[p],e);if(i!==null&&i!==e){if(Gn++,i.deps!==null)for(let e=0;e<n;e+=1)i.deps[e].rv=Gn;if(t!==null)for(let e of t)e.rv=Gn;Hn!==null&&(r===null?r=Hn:r.push(...Hn))}return e.f&8388608&&(e.f^=D),d}catch(t){return Qn(e),nn(t)}finally{e.f^=ee,Bn=t,Vn=n,Hn=r,V=i,Rn=a,Le(o),Fn=s,Kn=c}}function Qn(e){var t=e.deps,n=P?.is_fork;if(Bn!==null){var r;if(n||er(e,Vn),t!==null&&Vn>0)for(t.length=Vn+Bn.length,r=0;r<Bn.length;r++)t[Vn+r]=Bn[r];else e.deps=t=Bn;if(cn()&&e.f&512)for(r=Vn;r<t.length;r++)(t[r].reactions??=[]).push(e)}else!n&&t!==null&&Vn<t.length&&(er(e,Vn),t.length=Vn);return t}function $n(e,r){let i=r.reactions;if(i!==null){var a=t.call(i,e);if(a!==-1){var o=i.length-1;o===0?i=r.reactions=null:(i[a]=i[o],i.pop())}}if(i===null&&r.f&2&&(Bn===null||!n.call(Bn,r))){var s=r;s.f&512&&(s.f^=512),s.v!==O&&Je(s),s.ac!==null&&Qe(()=>{s.ac.abort(le),s.ac=null,qe(s,g)}),dt(s),er(s,0)}}function er(e,t){var n=e.deps;if(n!==null)for(var r=t;r<n.length;r++)$n(e,n[r])}function tr(e){var t=e.f;if(!(t&16384)){qe(e,h);var n=H,r=Mn;H=e,Mn=!(t&96);try{t&16777232?Sn(e):xn(e),bn(e);var i=Zn(e);e.teardown=typeof i==`function`?i:null,e.wv=Wn}finally{Mn=r,H=n}}}async function nr(){await Promise.resolve(),wt()}function U(e){var t=!!(e.f&2);if(jn?.add(e),V!==null&&!Fn&&!(H!==null&&H.f&16384)&&(Rn===null||!Rn.has(e))){var r=V.deps;if(V.f&2097152)e.rv<Gn&&(e.rv=Gn,Bn===null&&r!==null&&r[Vn]===e?Vn++:Bn===null?Bn=[e]:Bn.push(e));else{V.deps??=[],n.call(V.deps,e)||V.deps.push(e);var i=e.reactions;i===null?e.reactions=[V]:n.call(i,V)||i.push(V)}}if(Nn&&Mt.has(e))return Mt.get(e);if(t){var a=e;if(Nn){var o=a.v;return(!(a.f&1024)&&a.reactions!==null||ir(a))&&(o=lt(a)),Mt.set(a,o),o}var s=!(a.f&512)&&!Fn&&V!==null&&(Mn||!!(V.f&512)),c=(a.f&b)===0;Yn(a)&&(s&&(a.f|=512),ut(a)),s&&!c&&(ft(a),rr(a))}if(ht?.has(e))return ht.get(e);if(e.f&8388608)throw e.v;return e.v}function rr(e){if(e.f|=512,e.deps!==null)for(let t of e.deps)(t.reactions??=[]).push(e),t.f&2&&!(t.f&512)&&(ft(t),rr(t))}function ir(e){if(e.v===O)return!0;if(e.deps===null)return!1;for(let t of e.deps)if(Mt.has(t)||t.f&2&&ir(t))return!0;return!1}function ar(e){var t=Fn;try{return Fn=!0,e()}finally{Fn=t}}function or(e){if(!(typeof e!=`object`||!e||e instanceof EventTarget)){if(te in e)sr(e);else if(!Array.isArray(e))for(let t in e){let n=e[t];typeof n==`object`&&n&&te in n&&sr(n)}}}function sr(e,t=new Set){if(typeof e==`object`&&e&&!(e instanceof EventTarget)&&!t.has(e)){t.add(e),e instanceof Date&&e.getTime();for(let n in e)try{sr(e[n],t)}catch{}let n=l(e);if(n!==Object.prototype&&n!==Array.prototype&&n!==Map.prototype&&n!==Set.prototype&&n!==Date.prototype){let t=o(n);for(let n in t){let r=t[n].get;if(r)try{r.call(e)}catch{}}}}}[...`allowfullscreen.async.autofocus.autoplay.checked.controls.default.disabled.formnovalidate.indeterminate.inert.ismap.loop.multiple.muted.nomodule.novalidate.open.playsinline.readonly.required.reversed.seamless.selected.webkitdirectory.defer.disablepictureinpicture.disableremoteplayback`.split(`.`)];var cr=[`touchstart`,`touchmove`];function lr(e){return cr.includes(e)}var ur=Symbol(`events`),dr=new Set,fr=new Set;function pr(e,t,n,r={}){function i(e){if(r.capture||vr.call(t,e),!e.cancelBubble)return Qe(()=>n?.call(this,e))}return e.startsWith(`pointer`)||e.startsWith(`touch`)||e===`wheel`?(i.__removed=!1,We(()=>{i.__removed||t.addEventListener(e,i,r)})):t.addEventListener(e,i,r),i}function mr(e,t,n,r,i){var a={capture:r,passive:i},o=pr(e,t,n,a);(t===document.body||t===window||t===document||t instanceof HTMLMediaElement)&&ln(()=>{o.__removed=!0,t.removeEventListener(e,o,a)})}function W(e,t,n){(t[ur]??={})[e]=n}function hr(e){for(var t=0;t<e.length;t++)dr.add(e[t]);for(var n of fr)n(e)}var gr=null,_r=!1;function vr(e){var t=this,n=t.ownerDocument,r=e.type,a=e.composedPath?.()||[],o=a[0]||e.target;gr=e,_r||(_r=!0,setTimeout(()=>{_r=!1,gr=null}));var s=0,c=gr===e&&e[ur];if(c){var l=a.indexOf(c);if(l!==-1&&(t===document||t===window)){e[ur]=t;return}var u=a.indexOf(t);if(u===-1)return;l<=u&&(s=l)}if(o=a[s]||e.target,o!==t){i(e,`currentTarget`,{configurable:!0,get(){return o||n}});var d=V,f=H;In(null),Ln(null);try{for(var p,m=[];o!==null&&o!==t;){try{var h=o[ur]?.[r];h!=null&&(!o.disabled||e.target===o)&&h.call(o,e)}catch(e){p?m.push(e):p=e}if(e.cancelBubble)break;s++,o=s<a.length?a[s]:null}if(p){for(let e of m)queueMicrotask(()=>{throw e});throw p}}finally{e[ur]=t,delete e.currentTarget,In(d),Ln(f)}}}var yr=globalThis?.window?.trustedTypes&&globalThis.window.trustedTypes.createPolicy(`svelte-trusted-html`,{createHTML:e=>e});function br(e){return yr?.createHTML(e)??e}function xr(e){var t=en(`template`);return t.innerHTML=br(e.replaceAll(`<!>`,`<!---->`)),t.content}function Sr(e,t){var n=H;n.nodes===null&&(n.nodes={start:e,end:t,a:null,t:null})}function G(e,t){var n=!!(t&1),r=!!(t&2),i,a=!e.startsWith(`<!>`);return()=>{if(k)return Sr(A,null),A;i===void 0&&(i=xr(a?e:`<!>`+e),n||(i=Yt(i)));var t=r||Wt?document.importNode(i,!0):i.cloneNode(!0);if(n){var o=Yt(t),s=t.lastChild;Sr(o,s)}else Sr(t,t);return t}}function Cr(e,t,n=`svg`){var r=!e.startsWith(`<!>`),i=!!(t&1),a=`<${n}>${r?e:`<!>`+e}</${n}>`,o;return()=>{if(k)return Sr(A,null),A;if(!o){var e=Yt(xr(a));if(i)for(o=document.createDocumentFragment();Yt(e);)o.appendChild(Yt(e));else o=Yt(e)}var t=o.cloneNode(!0);if(i){var n=Yt(t),r=t.lastChild;Sr(n,r)}else Sr(t,t);return t}}function wr(e,t){return Cr(e,t,`svg`)}function Tr(){if(k)return Sr(A,null),A;var e=document.createDocumentFragment(),t=document.createComment(``),n=Jt();return e.append(t,n),Sr(t,n),e}function K(e,t){if(k){var n=H;(!(n.f&32768)||n.nodes.end===null)&&(n.nodes.end=A),ve();return}e!==null&&e.before(t)}function Er(e){let t=0,n=Pt(0),r;return()=>{cn()&&(U(n),_n(()=>(t===0&&(r=ar(()=>e(()=>Bt(n)))),t+=1,()=>{We(()=>{--t,t===0&&(r?.(),r=void 0,Bt(n))})})))}}var Dr=S|C;function Or(e,t,n,r){new kr(e,t,n,r)}var kr=class{parent;is_pending=!1;transform_error;#e;#t=k?A:null;#n;#r;#i;#a=null;#o=null;#s=null;#c=null;#l=0;#u=0;#d=!1;#f=new Set;#p=new Set;#m=null;#h=Er(()=>(this.#m=Pt(this.#l),()=>{this.#m=null}));constructor(e,t,n,r){this.#e=e,this.#n=t,this.#r=e=>{var t=H;t.b=this,t.f|=128,n(e)},this.parent=H.b,this.transform_error=r??this.parent?.transform_error??(e=>e),this.#i=vn(()=>{if(k){let e=this.#t;ve();let t=e.data===`[!`;if(e.data.startsWith(`[?`)){let t=JSON.parse(e.data.slice(2));this.#_(t)}else t?this.#y():this.#g()}else this.#b()},Dr),k&&(this.#e=A)}#g(){try{this.#a=yn(()=>this.#r(this.#e))}catch(e){this.error(e)}}#_(e){let t=this.#n.failed,{reset:n,invoke_onerror:r}=this.#v(e);We(r),t&&(this.#s=yn(()=>{t(this.#e,()=>e,()=>n)}))}#v(e){var t=!1,n=!1;let r=()=>{if(t){he();return}t=!0,n&&Pe(),this.#s!==null&&En(this.#s,()=>{this.#s=null}),this.#S(()=>{this.#b()})};return{reset:r,invoke_onerror:()=>{try{n=!0,this.#n.onerror?.(e,r),n=!1}catch(e){rn(e,this.#i&&this.#i.parent)}}}}#y(){let e=this.#n.pending;e&&(this.is_pending=!0,this.#o=yn(()=>e(this.#e)),We(()=>{var e=this.#c=document.createDocumentFragment(),t=Jt(),n=!1;if(e.append(t),this.#a=this.#S(()=>{try{return yn(()=>this.#r(t))}catch(e){try{this.error(e),n=!0}catch(e){rn(e,this.#i.parent)}return null}}),this.#a===null){this.#c=null,n&&this.#x(P);return}this.#u===0&&(this.#e.before(e),this.#c=null,En(this.#o,()=>{this.#o=null}),this.#x(P))}))}#b(){try{if(this.is_pending=this.has_pending_snippet(),this.#u=0,this.#l=0,this.#a=yn(()=>{this.#r(this.#e)}),this.#u>0){var e=this.#c=document.createDocumentFragment();An(this.#a,e);let t=this.#n.pending;this.#o=yn(()=>t(this.#e))}else this.#x(P)}catch(e){this.error(e)}}#x(e){this.is_pending=!1,e.transfer_effects(this.#f,this.#p)}defer_effect(e){Ye(e,this.#f,this.#p)}is_rendered(){return!this.is_pending&&(!this.parent||this.parent.is_rendered())}has_pending_snippet(){return!!this.#n.pending}#S(e){var t=H,n=V,r=M;Ln(this.#i),In(this.#i),Le(this.#i.ctx);try{return Ct.ensure(),e()}finally{Ln(t),In(n),Le(r)}}#C(e,t){if(!this.has_pending_snippet()){this.parent&&this.parent.#C(e,t);return}this.#u+=e,this.#u===0&&(this.#x(t),this.#o&&En(this.#o,()=>{this.#o=null}),this.#c&&=(this.#e.before(this.#c),null))}update_pending_count(e,t){this.#C(e,t),this.#l+=e,!(!this.#m||this.#d)&&(this.#d=!0,We(()=>{this.#d=!1,this.#m&&Rt(this.#m,this.#l)}))}get_effect_pending(){return this.#h(),U(this.#m)}error(e){if(!this.#n.onerror&&!this.#n.failed)throw e;P?.is_fork?(this.#a&&P.skip_effect(this.#a),this.#o&&P.skip_effect(this.#o),this.#s&&P.skip_effect(this.#s),P.oncommit(()=>{this.#w(e)})):this.#w(e)}#w(e){this.#a&&=(Cn(this.#a),null),this.#o&&=(Cn(this.#o),null),this.#s&&=(Cn(this.#s),null),k&&(_e(this.#t),ye(),_e(be()));let t=this.#n.failed,n=e=>{let{reset:n,invoke_onerror:r}=this.#v(e);r(),t&&(this.#s=this.#S(()=>{try{return yn(()=>{var r=H;r.b=this,r.f|=128,t(this.#e,()=>e,()=>n)})}catch(e){return rn(e,this.#i.parent),null}}))};We(()=>{var t;try{t=this.transform_error(e)}catch(e){rn(e,this.#i&&this.#i.parent);return}typeof t==`object`&&t&&typeof t.then==`function`?t.then(n,e=>rn(e,this.#i&&this.#i.parent)):n(t)})}};function q(e,t){var n=t==null?``:typeof t==`object`?`${t}`:t;n!==(e[se]??=e.nodeValue)&&(e[se]=n,e.nodeValue=`${n}`)}function Ar(e,t){return Mr(e,t)}var jr=new Map;function Mr(e,{target:t,anchor:n,props:i={},events:a,context:o,intro:s=!0,transformError:c}){qt();var l=void 0,u=mn(()=>{var s=n??t.appendChild(Jt());Or(s,{pending:()=>{}},t=>{Re({});var n=M;if(o&&(n.c=o),a&&(i.$$events=a),k&&Sr(t,null),l=e(t,i)||Be(),k&&(H.nodes.end=A,A===null||A.nodeType!==8||A.data!==`]`))throw me(),de;ze()},c);var u=new Set,d=e=>{for(var n=0;n<e.length;n++){var r=e[n];if(!u.has(r)){u.add(r);var i=lr(r);for(let e of[t,document]){var a=jr.get(e);a===void 0&&(a=new Map,jr.set(e,a));var o=a.get(r);o===void 0?(e.addEventListener(r,vr,{passive:i}),a.set(r,1)):a.set(r,o+1)}}}};return d(r(dr)),fr.add(d),()=>{for(var e of u)for(let n of[t,document]){var r=jr.get(n),i=r.get(e);--i==0?(n.removeEventListener(e,vr),r.delete(e),r.size===0&&jr.delete(n)):r.set(e,i)}fr.delete(d),s!==n&&s.parentNode?.removeChild(s)}});return Nr.set(l,u),l}var Nr=new WeakMap,Pr=class{anchor;#e=new Map;#t=new Map;#n=new Map;#r=new Set;#i=!0;constructor(e,t=!0){this.anchor=e,this.#i=t}#a=e=>{if(this.#e.has(e)){var t=this.#e.get(e),n=this.#t.get(t);if(n)On(n),this.#r.delete(t);else{var r=this.#n.get(t);r&&(On(r.effect),this.#t.set(t,r.effect),this.#n.delete(t),r.fragment.lastChild.remove(),this.anchor.before(r.fragment),n=r.effect)}for(let[t,n]of this.#e){if(this.#e.delete(t),t===e)break;let r=this.#n.get(n);r&&(Cn(r.effect),this.#n.delete(n))}for(let[e,r]of this.#t){if(e===t||this.#r.has(e))continue;let i=()=>{if(Array.from(this.#e.values()).includes(e)){var t=document.createDocumentFragment();An(r,t),t.append(Jt()),this.#n.set(e,{effect:r,fragment:t})}else Cn(r);this.#r.delete(e),this.#t.delete(e)};this.#i||!n?(this.#r.add(e),En(r,i,!1)):i()}}};#o=e=>{this.#e.delete(e);let t=Array.from(this.#e.values());for(let[e,n]of this.#n)t.includes(e)||(Cn(n.effect),this.#n.delete(e))};ensure(e,t){var n=P,r=$t();if(t&&!this.#t.has(e)&&!this.#n.has(e)){if(r){var i=document.createDocumentFragment(),a=Jt();i.append(a),this.#n.set(e,{effect:yn(()=>t(a)),fragment:i})}else this.#t.set(e,yn(()=>t(this.anchor)))}if(this.#e.set(n,e),r){for(let[t,r]of this.#t)t===e?n.unskip_effect(r):n.skip_effect(r);for(let[t,r]of this.#n)t===e?n.unskip_effect(r.effect):n.skip_effect(r.effect);n.oncommit(this.#a),n.ondiscard(this.#o)}else k&&(this.anchor=A),this.#a(n)}};function J(e,t,n=!1){var r;k&&(r=A,ve());var i=new Pr(e),a=n?S:0;function o(e,t){if(k){var n=xe(r);if(e!==parseInt(n.substring(1))){var a=be();_e(a),i.anchor=a,ge(!1),i.ensure(e,t),ge(!0);return}}i.ensure(e,t)}vn(()=>{var e=!1;t((t,n=0)=>{e=!0,o(n,t)}),e||o(-1,null)},a)}function Fr(e,t){return t}function Ir(e,t,n){for(var i=[],a=t.length,o,s=t.length,c=0;c<a;c++){let n=t[c];En(n,()=>{if(o){if(o.pending.delete(n),o.done.add(n),o.pending.size===0){var t=e.outrogroups;Lr(e,r(o.done)),t.delete(o),t.size===0&&(e.outrogroups=null)}}else--s},!1)}if(s===0){var l=i.length===0&&n!==null&&e.pending.size===0;if(l){var u=n,d=u.parentNode;Qt(d),d.append(u),e.items.clear()}Lr(e,t,!l)}else o={pending:new Set(t),done:new Set},(e.outrogroups??=new Set).add(o)}function Lr(e,t,n=!0){var r;if(e.pending.size>0){r=new Set;for(let t of e.pending.values())for(let n of t)r.add(e.items.get(n).e)}for(var i=0;i<t.length;i++){var a=t[i];r?.has(a)?(a.f|=T,An(a,document.createDocumentFragment())):Cn(t[i],n)}}var Rr;function Y(t,n,i,a,o,s=null){var c=t,l=new Map;if(n&4){var u=t;c=k?_e(Yt(u)):u.appendChild(Jt())}k&&ve();var d=null,f=st(()=>{var t=i();return e(t)?t:t==null?[]:r(t)}),p,m=new Map,h=!0;function g(e){v.effect.f&16384||(v.pending.delete(e),v.fallback=d,Br(v,p,c,n,a),d!==null&&(p.length===0?d.f&33554432?(d.f^=T,Hr(d,null,c)):On(d):En(d,()=>{d=null})))}function _(e){v.pending.delete(e)}var v={effect:vn(()=>{p=U(f);var e=p.length;let t=!1;k&&xe(c)===`[!`!=(e===0)&&(c=be(),_e(c),ge(!1),t=!0);for(var r=new Set,u=P,v=$t(),y=0;y<e;y+=1){k&&A.nodeType===8&&A.data===`]`&&(c=A,t=!0,ge(!1));var b=p[y],x=a(b,y),S=h?null:l.get(x);S?(S.v&&Rt(S.v,b),S.i&&Rt(S.i,y),v&&u.unskip_effect(S.e)):(S=Vr(l,h?c:Rr??=Jt(),b,x,y,o,n,i),h||(S.e.f|=T),l.set(x,S)),r.add(x)}if(e===0&&s&&!d&&(h?d=yn(()=>s(c)):(d=yn(()=>s(Rr??=Jt())),d.f|=T)),e>r.size&&Ee(``,``,``),k&&e>0&&_e(be()),!h){if(m.set(u,r),v){for(let[e,t]of l)r.has(e)||u.skip_effect(t.e);u.oncommit(g),u.ondiscard(_)}else g(u)}t&&ge(!0),U(f)}),flags:n,items:l,pending:m,outrogroups:null,fallback:d};h=!1,k&&(c=A)}function zr(e){for(;e!==null&&!(e.f&32);)e=e.next;return e}function Br(e,t,n,i,a){var o=!!(i&8),s=t.length,c=e.items,l=zr(e.effect.first),u,d=null,f,p=[],m=[],h,g,_,v;if(o)for(v=0;v<s;v+=1)h=t[v],g=a(h,v),_=c.get(g).e,_.f&33554432||(_.nodes?.a?.measure(),(f??=new Set).add(_));for(v=0;v<s;v+=1){if(h=t[v],g=a(h,v),_=c.get(g).e,e.outrogroups!==null)for(let t of e.outrogroups)t.pending.delete(_),t.done.delete(_);if(_.f&8192&&(On(_),o&&(_.nodes?.a?.unfix(),(f??=new Set).delete(_))),_.f&33554432){if(_.f^=T,_===l)Hr(_,null,n);else{var y=d?d.next:l;_===e.effect.last&&(e.effect.last=_.prev),_.prev&&(_.prev.next=_.next),_.next&&(_.next.prev=_.prev),Ur(e,d,_),Ur(e,_,y),Hr(_,y,n),d=_,p=[],m=[],l=zr(d.next);continue}}if(_!==l){if(u!==void 0&&u.has(_)){if(p.length<m.length){var b=m[0],x;d=b.prev;var S=p[0],C=p[p.length-1];for(x=0;x<p.length;x+=1)Hr(p[x],b,n);for(x=0;x<m.length;x+=1)u.delete(m[x]);Ur(e,S.prev,C.next),Ur(e,d,S),Ur(e,C,b),l=b,d=C,--v,p=[],m=[]}else u.delete(_),Hr(_,l,n),Ur(e,_.prev,_.next),Ur(e,_,d===null?e.effect.first:d.next),Ur(e,d,_),d=_;continue}for(p=[],m=[];l!==null&&l!==_;)(u??=new Set).add(l),m.push(l),l=zr(l.next);if(l===null)continue}_.f&33554432||p.push(_),d=_,l=zr(_.next)}if(e.outrogroups!==null){for(let t of e.outrogroups)t.pending.size===0&&(Lr(e,r(t.done)),e.outrogroups?.delete(t));e.outrogroups.size===0&&(e.outrogroups=null)}if(l!==null||u!==void 0){var w=[];if(u!==void 0)for(_ of u)_.f&8192||w.push(_);for(;l!==null;)!(l.f&8192)&&l!==e.fallback&&w.push(l),l=zr(l.next);var ee=w.length;if(ee>0){var E=i&4&&s===0?n:null;if(o){for(v=0;v<ee;v+=1)w[v].nodes?.a?.measure();for(v=0;v<ee;v+=1)w[v].nodes?.a?.fix()}Ir(e,w,E)}}o&&We(()=>{if(f!==void 0)for(_ of f)_.nodes?.a?.apply()})}function Vr(e,t,n,r,i,a,o,s){var c=o&1?o&16?Pt(n):Ft(n,!1,!1):null,l=o&2?Pt(i):null;return{v:c,i:l,e:yn(()=>(a(t,c??n,l??i,s),()=>{e.delete(r)}))}}function Hr(e,t,n){if(e.nodes)for(var r=e.nodes.start,i=e.nodes.end,a=t&&!(t.f&33554432)?t.nodes.start:n;r!==null;){var o=Xt(r);if(a.before(r),r===i)return;r=o}}function Ur(e,t,n){t===null?e.effect.first=n:t.next=n,n===null?e.effect.last=t:n.prev=t}function Wr(e){var t,n,r=``;if(typeof e==`string`||typeof e==`number`)r+=e;else if(typeof e==`object`){if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(n=Wr(e[t]))&&(r&&(r+=` `),r+=n)}else for(n in e)e[n]&&(r&&(r+=` `),r+=n)}return r}function Gr(){for(var e,t,n=0,r=``,i=arguments.length;n<i;n++)(e=arguments[n])&&(t=Wr(e))&&(r&&(r+=` `),r+=t);return r}function Kr(e){return typeof e==`object`?Gr(e):e??``}var qr=[...`-\r\f\xA0\v`];function Jr(e,t,n){var r=e==null?``:``+e;if(t&&(r=r?r+` `+t:t),n){for(var i of Object.keys(n))if(n[i])r=r?r+` `+i:i;else if(r.length)for(var a=i.length,o=0;(o=r.indexOf(i,o))>=0;){var s=o+a;(o===0||qr.includes(r[o-1]))&&(s===r.length||qr.includes(r[s]))?r=(o===0?``:r.substring(0,o))+r.substring(s+1):o=s}}return r===``?null:r}function Yr(e,t=!1){var n=t?` !important;`:`;`,r=``;for(var i of Object.keys(e)){var a=e[i];a!=null&&a!==``&&(r+=` `+i+`: `+a+n)}return r}function Xr(e){return e[0]!==`-`||e[1]!==`-`?e.toLowerCase():e}function Zr(e,t){if(t){var n=``,r,i;if(Array.isArray(t)?(r=t[0],i=t[1]):r=t,e){e=String(e).replaceAll(/\/\*.*?\*\//g,``).trim();var a=!1,o=0,s=!1,c=[];r&&c.push(...Object.keys(r).map(Xr)),i&&c.push(...Object.keys(i).map(Xr));var l=0,u=-1;let t=e.length;for(var d=0;d<t;d++){var f=e[d];if(s?f===`/`&&e[d-1]===`*`&&(s=!1):a?a===f&&(a=!1):f===`/`&&e[d+1]===`*`?s=!0:f===`"`||f===`'`?a=f:f===`(`?o++:f===`)`&&o--,!s&&a===!1&&o===0){if(f===`:`&&u===-1)u=d;else if(f===`;`||d===t-1){if(u!==-1){var p=Xr(e.substring(l,u).trim());if(!c.includes(p)){f!==`;`&&d++;var m=e.substring(l,d).trim();n+=` `+m+`;`}}l=d+1,u=-1}}}}return r&&(n+=Yr(r)),i&&(n+=Yr(i,!0)),n=n.trim(),n===``?null:n}return e==null?null:String(e)}function X(e,t,n,r,i,a){var o=e[ae];if(k||o!==n||o===void 0){var s=Jr(n,r,a);(!k||s!==e.getAttribute(`class`))&&(s==null?e.removeAttribute(`class`):t?e.className=s:e.setAttribute(`class`,s)),e[ae]=n}else if(a&&i!==a)for(var c in a){var l=!!a[c];(i==null||l!==!!i[c])&&e.classList.toggle(c,l)}return a}function Qr(e,t={},n,r){for(var i in n){var a=n[i];t[i]!==a&&(n[i]==null?e.style.removeProperty(i):e.style.setProperty(i,a,r))}}function Z(e,t,n,r){var i=e[oe];if(k||i!==t){var a=Zr(t,r);(!k||a!==e.getAttribute(`style`))&&(a==null?e.removeAttribute(`style`):e.style.cssText=a),e[oe]=t}else r&&(Array.isArray(r)?(Qr(e,n?.[0],r[0]),Qr(e,n?.[1],r[1],`important`)):Qr(e,n,r));return r}var $r=Symbol(`is custom element`),ei=Symbol(`is html`),ti=ue?`link`:`LINK`;function ni(e){if(k){var t=!1,n=()=>{if(!t){if(t=!0,e.hasAttribute(`value`)){var n=e.value;Q(e,`value`,null),e.value=n}if(e.hasAttribute(`checked`)){var r=e.checked;Q(e,`checked`,null),e.checked=r}}};e[ce]=n,We(n),Ze()}}function Q(e,t,n,r){var i=ri(e);k&&(i[t]=e.getAttribute(t),t===`src`||t===`srcset`||t===`href`&&e.nodeName===ti)||i[t]!==(i[t]=n)&&(t===`loading`&&(e[re]=n),n==null?e.removeAttribute(t):typeof n!=`string`&&ai(e).has(t)?e[t]=n:e.setAttribute(t,n))}function ri(e){return e[ie]??={[$r]:e.nodeName.includes(`-`),[ei]:e.namespaceURI===fe}}var ii=new Map;function ai(e){var t=e.getAttribute(`is`)||e.nodeName,n=ii.get(t);if(n)return n;ii.set(t,n=new Set);for(var r,i=e,a=Element.prototype;a!==i;){for(var s in r=o(i),r)r[s].set&&s!==`innerHTML`&&s!==`textContent`&&s!==`innerText`&&n.add(s);i=l(i)}return n}function oi(e,t,n=t){var r=new WeakSet;$e(e,`input`,async i=>{var a=i?e.defaultValue:e.value;if(a=si(e)?ci(a):a,n(a),P!==null&&r.add(P),await nr(),a!==(a=t())){var o=e.selectionStart,s=e.selectionEnd,c=e.value.length;if(e.value=a??``,s!==null){var l=e.value.length;o===s&&s===c&&l>c?(e.selectionStart=l,e.selectionEnd=l):(e.selectionStart=o,e.selectionEnd=Math.min(s,l))}}}),(k&&e.defaultValue!==e.value||ar(t)==null&&e.value)&&(n(si(e)?ci(e.value):e.value),P!==null&&r.add(P)),_n(()=>{var n=t();if(e===document.activeElement){var i=P;if(r.has(i))return}si(e)&&n===ci(e.value)||(e.type!==`date`||n||e.value)&&n!==e.value&&(e.value=n??``)})}function si(e){var t=e.type;return t===`number`||t===`range`}function ci(e){return e===``?null:+e}function li(e,t){return e===t||e?.[te]===t}function ui(e=Be(),t,n,r){var i=M.r,a=H;return hn(()=>{var o,s;return _n(()=>{o=s,s=r?.()||[],ar(()=>{li(n(...s),e)||(t(e,...s),o&&li(n(...o),e)&&t(null,...o))})}),()=>{let r=a;for(;r!==i&&r.parent!==null&&r.parent.f&33554432;)r=r.parent;let o=()=>{s&&li(n(...s),e)&&t(null,...s)},c=r.teardown;r.teardown=()=>{o(),c?.()}}}),e}function di(e=!1){let t=M,n=t.l.u;if(!n)return;let r=()=>or(t.s);if(e){let e=0,n={},i=it(()=>{let r=!1,i=t.s;for(let e in i)i[e]!==n[e]&&(n[e]=i[e],r=!0);return r&&e++,e});r=()=>U(i)}n.b.length&&fn(()=>{fi(t,r),p(n.b)}),un(()=>{let e=ar(()=>n.m.map(f));return()=>{for(let t of e)typeof t==`function`&&t()}}),n.a.length&&un(()=>{fi(t,r),p(n.a)})}function fi(e,t){if(e.l.s)for(let t of e.l.s)U(t);t()}function pi(e){var t=Pt(0);return function(){return arguments.length===1?(I(t,U(t)+1),arguments[0]):(U(t),e())}}typeof window<`u`&&((window.__svelte??={}).v??=new Set).add(`5`);var mi=`nota-remote:`,hi={get(e,t=``){try{return localStorage.getItem(mi+e)??t}catch{return t}},set(e,t){try{localStorage.setItem(mi+e,t)}catch{}},del(e){try{localStorage.removeItem(mi+e)}catch{}}},gi={theme:`nota`,haptics:!0,countIn:!0,fullVel:!1,keysMode:`Scale`,expressive:!1,octave:3,key:null,xyHold:!0,bank:0,groupsOpen:[]};function _i(){let e=navigator.userAgent;return/iPad/.test(e)||/Macintosh/.test(e)&&navigator.maxTouchPoints>1?`iPad`:/iPhone/.test(e)?`iPhone`:/Android/.test(e)?/Mobile/.test(e)?`Android phone`:`Android tablet`:`Phone`}var $=new class{#e=F(null);get proj(){return U(this.#e)}set proj(e){I(this.#e,e,!0)}#t=F(Ht({play:!1,rec:!1,loop:!1,met:!1,pos:0,bpm:120,ls:0,le:16,can:!1}));get tp(){return U(this.#t)}set tp(e){I(this.#t,e,!0)}#n=F(Ht([]));get lit(){return U(this.#n)}set lit(e){I(this.#n,e,!0)}#r=F(Ht({}));get who(){return U(this.#r)}set who(e){I(this.#r,e,!0)}#i=F(null);get mix(){return U(this.#i)}set mix(e){I(this.#i,e,!0)}#a=F(null);get xy(){return U(this.#a)}set xy(e){I(this.#a,e,!0)}#o=F(null);get mac(){return U(this.#o)}set mac(e){I(this.#o,e,!0)}#s=F(null);get ses(){return U(this.#s)}set ses(e){I(this.#s,e,!0)}#c=F(Ht({on:!1,pend:null}));get learn(){return U(this.#c)}set learn(e){I(this.#c,e,!0)}#l=F(null);get learned(){return U(this.#l)}set learned(e){I(this.#l,e,!0)}#u=F(`connecting`);get link(){return U(this.#u)}set link(e){I(this.#u,e,!0)}#d=F(-1);get rtt(){return U(this.#d)}set rtt(e){I(this.#d,e,!0)}#f=F(`wifi`);get via(){return U(this.#f)}set via(e){I(this.#f,e,!0)}#p=F(0);get conn(){return U(this.#p)}set conn(e){I(this.#p,e,!0)}#m=F(Ht(hi.get(`host`,`Nota`)));get host(){return U(this.#m)}set host(e){I(this.#m,e,!0)}#h=F(null);get deny(){return U(this.#h)}set deny(e){I(this.#h,e,!0)}everConnected=!1;#g=F(Ht(hi.get(`screen`,``)||`Pads`));get screen(){return U(this.#g)}set screen(e){I(this.#g,e,!0)}#_=F(!1);get bigTransport(){return U(this.#_)}set bigTransport(e){I(this.#_,e,!0)}#v=F(null);get sheet(){return U(this.#v)}set sheet(e){I(this.#v,e,!0)}#y=F(null);get toast(){return U(this.#y)}set toast(e){I(this.#y,e,!0)}#b=F(null);get countIn(){return U(this.#b)}set countIn(e){I(this.#b,e,!0)}#x=F(Ht(hi.get(`name`,_i())));get name(){return U(this.#x)}set name(e){I(this.#x,e,!0)}#S=F(Ht({...gi,...JSON.parse(hi.get(`prefs`,`{}`)||`{}`)}));get prefs(){return U(this.#S)}set prefs(e){I(this.#S,e,!0)}posAt=0;posBase=0;ws=null;pingTimer=0;retryTimer=0;lostSince=0;lastPong=0;rtts=[];toastTimer=0;learnedTimer=0;pairCode=null;screenChosen=!!hi.get(`screen`,``);held=new Map;constructor(){let e=/[#&]p=(\d{4})/.exec(location.hash);e&&(this.pairCode=e[1],history.replaceState(null,``,location.pathname+location.search)),pn(()=>{un(()=>{hi.set(`prefs`,JSON.stringify(this.prefs))}),un(()=>{hi.set(`screen`,this.screen)})})}get token(){return hi.get(`token`)}get track(){let e=this.proj;return e?e.tracks.find(t=>t.id===e.you)??null:null}get playable(){return this.proj?.tracks.filter(e=>e.kind===`drum`||e.kind===`inst`||e.kind===`audio`)??[]}get canControl(){return this.proj?.access!==`play`}get dark(){return this.prefs.theme===`phone`?matchMedia(`(prefers-color-scheme: dark)`).matches:this.proj?.dark??!0}connect(){clearTimeout(this.retryTimer),this.ws&&(this.ws.onclose=null,this.ws.close());let e=location.protocol===`https:`?`wss:`:`ws:`,t;try{t=new WebSocket(`${e}//${location.host}/ws`)}catch{this.retry();return}this.ws=t;let n=Date.now();t.onopen=()=>{let e={v:1,name:this.name,model:_i(),track:Number(hi.get(`track`,`0`)),screen:this.screen,follow:hi.get(`follow`)===`1`};this.pairCode?this.raw({t:`pair`,code:this.pairCode,...e}):this.token?this.raw({t:`hello`,token:this.token,...e}):(this.link=`expired`,this.deny=`new`)},t.onmessage=e=>{try{this.onMessage(JSON.parse(e.data))}catch{}},t.onclose=()=>{this.ws=null,clearInterval(this.pingTimer),this.link!==`left`&&this.link!==`expired`&&(this.link===`ok`||this.link===`weak`?(this.link=`lost`,this.lostSince=Date.now()):(this.link===`connecting`&&Date.now()-n>0&&!this.everConnected&&Date.now()-this.firstTry>4e3||this.link===`lost`&&Date.now()-this.lostSince>1e4)&&(this.link=`down`),this.retry())}}firstTry=Date.now();retry(){clearTimeout(this.retryTimer);let e=this.link===`down`?3e3:this.link===`lost`?700:1200;this.retryTimer=window.setTimeout(()=>this.connect(),e)}wake(){this.link!==`left`&&(!this.ws||this.ws.readyState>1||Date.now()-this.lastPong>3e3)&&((this.link===`ok`||this.link===`weak`)&&(this.link=`lost`,this.lostSince=Date.now()),this.connect())}startPing(){clearInterval(this.pingTimer),this.lastPong=Date.now();let e=()=>{if(Date.now()-this.lastPong>3500&&(this.link===`ok`||this.link===`weak`)){this.link=`lost`,this.lostSince=Date.now(),this.connect();return}this.raw({t:`ping`,c:performance.now(),rtt:this.rtt,h:[...this.held.keys()]})};e(),this.pingTimer=window.setInterval(e,1e3)}pairWith(e){this.pairCode=e,this.deny=null,this.link=`connecting`,this.connect()}leave(){this.releaseHeld(),this.raw({t:`bye`}),this.link=`left`,this.sheet=null,clearInterval(this.pingTimer),this.ws?.close()}rejoin(){this.link=`connecting`,this.firstTry=Date.now(),this.connect()}onMessage(e){switch(e.t){case`welcome`:e.token&&hi.set(`token`,e.token),this.pairCode=null,this.deny=null,this.host=e.host,hi.set(`host`,e.host),this.conn=e.conn,this.via=e.via===`usb`?`usb`:`wifi`,this.name=e.name,hi.set(`name`,e.name),this.link=`ok`,this.everConnected=!0,this.held.clear(),this.startPing();break;case`denied`:this.deny=e.why,e.why===`forgotten`&&hi.del(`token`),this.pairCode=null,this.link=`expired`,clearInterval(this.pingTimer);break;case`kicked`:this.link=`left`,this.showToast(`Disconnected in Nota`);break;case`pong`:{this.lastPong=Date.now();let t=Math.max(0,Math.round(performance.now()-e.c));this.rtts.push(t),this.rtts.length>5&&this.rtts.shift();let n=Math.round(this.rtts.reduce((e,t)=>e+t,0)/this.rtts.length);this.rtt=n,(this.link===`ok`||this.link===`weak`)&&(this.link=n>50?`weak`:`ok`);break}case`proj`:{let t=!this.proj,n=this.proj?.you;delete e.t,this.proj=e,hi.set(`track`,String(e.you)),hi.set(`follow`,e.follow?`1`:`0`),(t||n!==e.you)&&this.onTrackChanged(t);break}case`tp`:delete e.t,this.tp=e,this.posBase=e.pos,this.posAt=performance.now();break;case`lit`:this.lit=e.n;break;case`who`:this.who=e.p;break;case`mix`:delete e.t,this.mix=e;break;case`xy`:delete e.t,this.xy=e;break;case`mac`:delete e.t,this.mac=e;break;case`ses`:delete e.t,this.ses=e;break;case`learn`:this.learn={on:e.on,pend:e.pend},e.on||(this.learned=null);break;case`learned`:this.learned=`${e.src} → ${e.dst}`,clearTimeout(this.learnedTimer),this.learnedTimer=window.setTimeout(()=>this.learned=null,6e3);break;case`toast`:this.showToast(e.msg)}}onTrackChanged(e){let t=this.track;if(t){if(e&&this.screenChosen){this.sub();return}t.kind===`audio`&&(this.bigTransport=!0),(!e||!this.screenChosen)&&(t.kind===`drum`&&(this.screen===`Keys`||this.screen===`Pads`)?this.screen=`Pads`:t.kind===`inst`&&(this.screen===`Pads`||this.screen===`Keys`)&&(this.screen=`Keys`)),this.sub()}}setScreen(e){this.screen=e,this.screenChosen=!0,this.bigTransport=!1,this.sub()}sub(){this.raw({t:`sub`,s:this.screen,i:this.macroDevice})}macroDevice=0;selectTrack(e){this.sheet=null,this.proj&&this.proj.you!==e&&(this.proj={...this.proj,you:e,follow:!1},this.onTrackChanged(!1)),this.send({t:`track`,id:e})}stepTrack(e){let t=this.playable;if(t.length===0)return;let n=t[(t.findIndex(e=>e.id===this.proj?.you)+e+t.length)%t.length];this.selectTrack(n.id)}raw(e){return this.ws?.readyState===WebSocket.OPEN&&(this.ws.send(JSON.stringify(e)),!0)}send(e){return this.link===`ok`||this.link===`weak`?this.raw(e):!1}get live(){return this.link===`ok`||this.link===`weak`}noteOn(e,t){if(!(e<0||e>127)&&(this.send({t:`on`,p:e,v:Math.round(t*1e3)/1e3})&&this.held.set(e,(this.held.get(e)??0)+1),this.prefs.haptics&&navigator.vibrate))try{navigator.vibrate(8)}catch{}}noteExpr(e,t,n){this.held.has(e)&&(this.exprPending.set(e*4+t,Math.round(n*1e3)/1e3),this.exprFrame||=requestAnimationFrame(()=>this.flushExpr()))}exprPending=new Map;exprFrame=0;flushExpr(){this.exprFrame=0;for(let[e,t]of this.exprPending){let n=e>>2;this.held.has(n)&&this.send({t:`x`,p:n,d:e&3,v:t})}this.exprPending.clear()}noteOff(e){if(e<0||e>127)return;let t=this.held.get(e)??0;if(t>1){this.held.set(e,t-1);return}for(let t=0;t<3;t++)this.exprPending.delete(e*4+t);this.send({t:`off`,p:e})&&this.held.delete(e)}releaseHeld(){for(let e of[...this.held.keys()])this.send({t:`off`,p:e})&&this.held.delete(e)}position(e=performance.now()){return this.tp.play?this.posBase+(e-this.posAt)/6e4*this.tp.bpm:this.tp.pos}record(){if(this.tp.rec){this.send({t:`rec`,on:!1});return}!this.tp.play&&this.prefs.countIn?this.runCountIn():this.send({t:`rec`,on:!0})}countTimer=0;runCountIn(){if(this.countIn!==null){clearInterval(this.countTimer),this.countIn=null;return}let e=6e4/Math.max(20,this.tp.bpm);this.countIn=4,this.countTimer=window.setInterval(()=>{this.countIn!==null&&(this.countIn<=1?(clearInterval(this.countTimer),this.countIn=null,this.send({t:`rec`,on:!0})):--this.countIn)},e)}rename(e){e=e.trim(),e&&e!==this.name&&(this.name=e,hi.set(`name`,e),this.send({t:`name`,s:e}))}setFollow(e){this.send({t:`follow`,on:e}),this.proj&&={...this.proj,follow:e}}showToast(e){this.toast=e,clearTimeout(this.toastTimer),this.toastTimer=window.setTimeout(()=>this.toast=null,2600)}},vi=new class{#e=F(Ht(window.innerWidth));get w(){return U(this.#e)}set w(e){I(this.#e,e,!0)}#t=F(Ht(window.innerHeight));get h(){return U(this.#t)}set h(e){I(this.#t,e,!0)}standalone=matchMedia(`(display-mode: standalone)`).matches||navigator.standalone===!0;#n=F(!!yi());get fullscreen(){return U(this.#n)}set fullscreen(e){I(this.#n,e,!0)}constructor(){let e=()=>{this.w=window.innerWidth,this.h=window.innerHeight};window.addEventListener(`resize`,e),window.addEventListener(`orientationchange`,()=>setTimeout(e,120));let t=()=>this.fullscreen=!!yi();document.addEventListener(`fullscreenchange`,t),document.addEventListener(`webkitfullscreenchange`,t)}get form(){return Math.min(this.w,this.h)>=600?`tablet`:this.w>this.h?`phoneLand`:`phone`}};function yi(){let e=document;return e.fullscreenElement??e.webkitFullscreenElement??null}function bi(){let e=document;return!!(e.fullscreenEnabled||e.webkitFullscreenEnabled)}async function xi(){let e=document,t=document.documentElement;if(!bi())return!1;try{return yi()?await(e.exitFullscreen??e.webkitExitFullscreen).call(e):await(t.requestFullscreen??t.webkitRequestFullscreen).call(t,{navigationUI:`hide`}),!0}catch{return!1}}var Si=null,Ci=null;async function wi(){let e=navigator.wakeLock;if(e&&window.isSecureContext)try{Si||=await e.request(`screen`),Si?.addEventListener?.(`release`,()=>Si=null);return}catch{}Ci||(Ci=document.createElement(`video`),Ci.setAttribute(`playsinline`,``),Ci.setAttribute(`muted`,``),Ci.muted=!0,Ci.loop=!0,Ci.src=`./keepawake.mp4`,Ci.style.cssText=`position:fixed;width:1px;height:1px;opacity:0;pointer-events:none;left:-10px;top:-10px`,document.body.appendChild(Ci)),Ci.paused&&Ci.play().catch(()=>{})}function Ti(){return typeof DeviceOrientationEvent>`u`?`no`:window.isSecureContext?typeof DeviceOrientationEvent.requestPermission==`function`?`ask`:`yes`:`insecure`}async function Ei(){let e=Ti();if(e===`yes`)return!0;if(e!==`ask`)return!1;try{return await DeviceOrientationEvent.requestPermission()===`granted`}catch{return!1}}function Di(e){let t=null,n=e=>Math.min(1,Math.max(0,e)),r=r=>{if(r.beta==null||r.gamma==null)return;let i=Math.abs((screen.orientation?.angle??window.orientation??0)%180)===90,a=screen.orientation?.angle??window.orientation??0,o=i?a===90||a===-270?r.beta:-r.beta:r.gamma,s=i?a===90||a===-270?-r.gamma:r.gamma:r.beta;t||={b:s,g:o},e(n(.5+(o-t.g)/60),n(.5-(s-t.b)/50))};return window.addEventListener(`deviceorientation`,r),()=>window.removeEventListener(`deviceorientation`,r)}var Oi=[`Pads`,`Keys`,`XY`,`Mixer`,`Macros`,`Scenes`],ki=wr(`<svg width="16" height="16" viewBox="0 0 16 16" class="svelte-oiwvqb"><path d="M6 2 V6 H2 M10 2 V6 H14 M6 14 V10 H2 M10 14 V10 H14" class="svelte-oiwvqb"></path></svg>`),Ai=wr(`<svg width="16" height="16" viewBox="0 0 16 16" class="svelte-oiwvqb"><path d="M2 6 V2 H6 M10 2 H14 V6 M2 10 V14 H6 M14 10 V14 H10" class="svelte-oiwvqb"></path></svg>`),ji=G(`<button class="tbtn fs svelte-oiwvqb"><!></button>`),Mi=G(`<header><div class="picker svelte-oiwvqb"><button class="step svelte-oiwvqb" aria-label="Previous track"><svg width="10" height="14" viewBox="0 0 10 14" class="svelte-oiwvqb"><path d="M7 2 L2 7 L7 12" class="svelte-oiwvqb"></path></svg></button> <button class="track svelte-oiwvqb" aria-label="Choose the track to play"><span class="bar svelte-oiwvqb"></span> <span class="names svelte-oiwvqb"><span class="name svelte-oiwvqb"> </span> <span class="sub mono svelte-oiwvqb"> </span></span> <svg width="10" height="10" viewBox="0 0 10 10" class="svelte-oiwvqb"><path d="M2 3.5 L5 6.5 L8 3.5" class="svelte-oiwvqb"></path></svg></button> <button class="step svelte-oiwvqb" aria-label="Next track"><svg width="10" height="14" viewBox="0 0 10 14" class="svelte-oiwvqb"><path d="M3 2 L8 7 L3 12" class="svelte-oiwvqb"></path></svg></button></div> <div class="transport svelte-oiwvqb"><button class="tbtn svelte-oiwvqb" aria-label="Stop"><span class="sq svelte-oiwvqb"></span></button> <button><span class="tri svelte-oiwvqb"></span></button> <button aria-label="Record"><span class="dot svelte-oiwvqb"></span></button> <button aria-label="Big transport"><span class="mono p svelte-oiwvqb"> </span> <span class="mono bpm svelte-oiwvqb"> </span> <svg width="10" height="10" viewBox="0 0 10 10" class="svelte-oiwvqb"><path d="M2 3.5 L5 6.5 L8 3.5" class="svelte-oiwvqb"></path></svg></button> <!></div> <div class="status svelte-oiwvqb"><button class="link svelte-oiwvqb"><span></span> <span class="mono svelte-oiwvqb"> </span></button> <button aria-label="Menu"><span class="svelte-oiwvqb"></span><span class="svelte-oiwvqb"></span><span class="svelte-oiwvqb"></span></button></div></header>`);function Ni(e,t){Re(t,!0);let n=N(()=>$.track),r=N(()=>{if(!U(n))return $.proj?`No track to play`:`Connecting…`;let e=($.who[String(U(n).id)]??[]).join(`, `);return U(n).dev+($.proj?.follow?` · following Nota`:``)+(e?` · with ${e}`:``)}),i=F(`1.1`);un(()=>{let e=0,t=()=>{let n=Math.max(0,$.position());I(i,`${Math.floor(n/4)+1}.${Math.floor(n%4)+1}`),e=requestAnimationFrame(t)};return t(),()=>cancelAnimationFrame(e)});let a=N(()=>{let e=$.via===`usb`?`USB · `:``;switch($.link){case`ok`:return{dot:`var(--success-dim)`,ink:`var(--ink4)`,label:$.rtt>=0?`${e}${$.rtt} ms`:`Connected`};case`weak`:return{dot:`var(--warning)`,ink:`var(--warning)`,label:`Weak · ${$.rtt} ms`};case`lost`:case`connecting`:return{dot:`var(--ink4)`,ink:`var(--ink3)`,label:$.link===`lost`?`Reconnecting`:`Connecting`,blink:!0};case`down`:return{dot:`var(--danger)`,ink:`var(--danger-bright)`,label:`No connection`,blink:!0};default:return{dot:`var(--danger)`,ink:`var(--danger-bright)`,label:`Not paired`}}});function o(){$.link===`weak`?$.showToast(`Latency is ${$.rtt} ms. Move closer to the router or put the phone on 5 GHz Wi-Fi.`):$.link===`ok`?$.showToast(`Connected to ${$.host} over ${$.via===`usb`?`USB`:`Wi-Fi`} · ${$.rtt} ms`):$.link===`lost`&&$.showToast(`Touches are not sent until the link is back.`)}async function s(){await xi()||$.showToast(`This browser can’t hide its bars. Share → Add to Home Screen opens Nota Remote full-screen.`)}function c(){if(!$.canControl)return $.showToast(`Nota lets this phone play notes only.`);$.send({t:$.tp.play?`stop`:`play`})}function l(){if(!$.canControl)return $.showToast(`Nota lets this phone play notes only.`);$.send({t:`stop`})}function u(){if(!$.canControl)return $.showToast(`Nota lets this phone play notes only.`);$.record()}var d=Mi(),f=L(d),p=L(f),m=z(p,2),h=L(m);let g;var _=z(h,2),v=L(_),y=R(v,!0),b=R(z(v,2),!0);j(_),ye(2),j(m);var x=z(m,2);j(f);var S=z(f,2),C=L(S),w=z(C,2);let T;var ee=z(w,2);let E;var D=z(ee,2);let te;var ne=L(D),re=R(ne,!0),ie=R(z(ne,2),!0);ye(2),j(D);var ae=z(D,2),oe=e=>{var t=ji(),n=L(t),r=e=>{K(e,ki())},i=e=>{K(e,Ai())};J(n,e=>{vi.fullscreen?e(r):e(i,-1)}),j(t),B(()=>{Q(t,`aria-label`,vi.fullscreen?`Exit full screen`:`Full screen`),Q(t,`aria-pressed`,vi.fullscreen)}),W(`click`,t,s),K(e,t)};J(ae,e=>{vi.standalone||e(oe)}),j(S);var se=z(S,2),ce=L(se),le=L(ce);let ue,de;var O=z(le,2);let fe;var pe=R(O,!0);j(ce);var me=z(ce,2);let he;j(se),j(d),B(e=>{X(d,1,Kr(t.form),`svelte-oiwvqb`),g=Z(h,``,g,{background:U(n)?.color??`var(--border-strong)`}),q(y,U(n)?.name??`—`),q(b,U(r)),T=X(w,1,`tbtn play svelte-oiwvqb`,null,T,{on:$.tp.play}),Q(w,`aria-label`,$.tp.play?`Stop playback`:`Play`),Q(w,`aria-pressed`,$.tp.play),E=X(ee,1,`tbtn rec svelte-oiwvqb`,null,E,{on:$.tp.rec,count:$.countIn!==null}),Q(ee,`aria-pressed`,$.tp.rec),te=X(D,1,`pos svelte-oiwvqb`,null,te,{open:$.bigTransport}),q(re,U(i)),q(ie,e),Q(ce,`aria-label`,`Connection: ${U(a).label??``}`),ue=X(le,1,`ldot svelte-oiwvqb`,null,ue,{blink:U(a).blink}),de=Z(le,``,de,{background:U(a).dot}),fe=Z(O,``,fe,{color:U(a).ink}),q(pe,U(a).label),he=X(me,1,`menu svelte-oiwvqb`,null,he,{open:$.sheet===`menu`})},[()=>$.tp.bpm.toFixed(0)]),W(`click`,p,()=>$.stepTrack(-1)),W(`click`,m,()=>$.sheet=`tracks`),W(`click`,x,()=>$.stepTrack(1)),W(`click`,C,l),W(`click`,w,c),W(`click`,ee,u),W(`click`,D,()=>$.bigTransport=!$.bigTransport),W(`click`,ce,o),W(`click`,me,()=>$.sheet=`menu`),K(e,d),ze()}hr([`click`]);var Pi=G(`<div role="status"><span></span> <div class="svelte-4gizvm"><div class="t svelte-4gizvm"> </div> <div class="s svelte-4gizvm"> </div></div></div>`);function Fi(e,t){Re(t,!0);let n=N(()=>$.link===`lost`?{kind:`quiet`,title:`Reconnecting to ${$.host}…`,sub:`Touches are not sent until the link is back`}:$.learn.on&&$.live?$.learned?{kind:`brass`,title:`Mapped ${$.learned}`,sub:`Click another control in Nota to keep mapping`}:{kind:`brass`,title:$.learn.pend?`Nota is listening: ${$.learn.pend}`:`MIDI Learn is on in Nota`,sub:$.learn.pend?`Move a macro, an XY axis or tilt the phone. Pads, keys and the mixer can’t be mapped.`:`Click a control in Nota, then move a macro, an XY axis or tilt the phone.`}:null);var r=Tr(),i=Zt(r),a=e=>{var t=Pi(),r=L(t);let i;var a=z(r,2),o=L(a),s=R(o,!0),c=R(z(o,2),!0);j(a),j(t),B(()=>{X(t,1,`banner ${U(n).kind??``}`,`svelte-4gizvm`),i=X(r,1,`dot svelte-4gizvm`,null,i,{blink:U(n).kind===`quiet`}),q(s,U(n).title),q(c,U(n).sub)}),K(e,t)};J(i,e=>{U(n)&&e(a)}),K(e,r),ze()}var Ii=[`C`,`C#`,`D`,`D#`,`E`,`F`,`F#`,`G`,`G#`,`A`,`A#`,`B`],Li=[`C`,`Db`,`D`,`Eb`,`E`,`F`,`F#`,`G`,`Ab`,`A`,`Bb`,`B`],Ri=[0,2,4,5,7,9,11],zi=[0,2,3,5,7,8,10],Bi=e=>Ii[(e%12+12)%12]+(Math.floor(e/12)-1),Vi=e=>(e.minor?Ii:Li)[e.root]+(e.minor?` minor`:` major`),Hi=e=>e.minor?zi:Ri;function Ui(e,t,n){let r=Hi(e),i=Math.floor(n/7),a=(n%7+7)%7;return t+e.root+r[a]+12*i}var Wi=[`i`,`ii`,`iii`,`iv`,`v`,`vi`,`vii`];function Gi(e,t){let n=Hi(e);return n.map((r,i)=>{let a=n[i],o=n[(i+2)%7]+(i+2>=7?12:0),s=n[(i+4)%7]+(i+4>=7?12:0),c=o-a,l=s-a,u=c===4?``:l===6?`°`:`m`,d=t+e.root+a;return{roman:(u===``?Wi[i].toUpperCase():Wi[i])+(u===`°`?`°`:``),name:(e.minor?Ii:Li)[(e.root+a)%12]+u,notes:[d,t+e.root+o,t+e.root+s]}})}var Ki=G(`<button class="scrim svelte-tyq0v8" aria-label="Close"></button>`),qi=G(`<span class="who svelte-tyq0v8">You</span>`),Ji=G(`<span class="who svelte-tyq0v8"> </span>`),Yi=G(`<button><span class="bar svelte-tyq0v8"></span> <span class="names svelte-tyq0v8"><span class="n svelte-tyq0v8"> </span><span class="d mono svelte-tyq0v8"> </span></span> <!> <!></button>`),Xi=G(`<div class="empty svelte-tyq0v8">The project has no tracks yet.</div>`),Zi=G(`<div role="dialog" aria-label="Play on track"><div class="caps head svelte-tyq0v8">Play on track</div> <div class="list svelte-tyq0v8"><!> <!></div> <button class="toggle svelte-tyq0v8"><span></span> <span><span class="n2 svelte-tyq0v8">Follow Nota’s selection</span><span class="d2 svelte-tyq0v8">Off: this phone keeps its own track</span></span></button></div>`),Qi=G(`<div class="sheet menu svelte-tyq0v8" role="dialog" aria-label="Menu"><div class="block svelte-tyq0v8"><label class="caps" for="devname">Device name</label> <input id="devname" class="field svelte-tyq0v8" maxlength="40" enterkeyhint="done"/></div> <div class="block svelte-tyq0v8"><span class="caps">Theme</span> <div class="seg"><button>Follow Nota</button> <button>Follow phone</button></div></div> <button class="toggle svelte-tyq0v8"><span></span><span class="n2 svelte-tyq0v8">Haptics on pads</span></button> <button class="toggle svelte-tyq0v8"><span></span><span class="n2 svelte-tyq0v8">Count-in before recording</span></button> <button class="disconnect svelte-tyq0v8">Disconnect</button></div>`),$i=G(`<button> </button>`),ea=G(`<div role="dialog" aria-label="Key"><div class="caps head svelte-tyq0v8">Key on this phone</div> <div class="block svelte-tyq0v8"><button><span class="names svelte-tyq0v8"><span class="n svelte-tyq0v8">Project key</span><span class="d mono svelte-tyq0v8"> </span></span></button> <div class="seg"><button>Major</button> <button>Minor</button></div> <div class="tonics svelte-tyq0v8"></div></div></div>`),ta=G(`<button><span class="names svelte-tyq0v8"><span class="n svelte-tyq0v8"> </span></span></button>`),na=G(`<div role="dialog" aria-label="Device"><div class="caps head svelte-tyq0v8"> </div> <div class="list svelte-tyq0v8"></div></div>`),ra=G(`<!> <!>`,1);function ia(e,t){Re(t,!0);let n=N(()=>t.form===`phone`),r=F(``);un(()=>{$.sheet===`menu`&&I(r,$.name,!0)});function i(){$.sheet===`menu`&&$.rename(U(r)),$.sheet=null}let a=N(()=>$.proj?.key??null);var o=ra(),s=Zt(o),c=e=>{var t=Ki();W(`click`,t,i),K(e,t)};J(s,e=>{$.sheet&&e(c)});var l=z(s,2),u=e=>{var t=Zi();let r;var i=z(L(t),2),a=L(i);Y(a,17,()=>$.playable,e=>e.id,(e,t)=>{let n=N(()=>$.who[String(U(t).id)]??[]);var r=Yi();let i;var a=L(r);let o;var s=z(a,2),c=L(s),l=R(c,!0),u=R(z(c),!0);j(s);var d=z(s,2),f=e=>{K(e,qi())};J(d,e=>{U(t).id===$.proj?.you&&e(f)}),Y(z(d,2),17,()=>U(n),Fr,(e,t)=>{var n=Ji(),r=R(n,!0);B(()=>q(r,U(t))),K(e,n)}),j(r),B(()=>{i=X(r,1,`row svelte-tyq0v8`,null,i,{on:U(t).id===$.proj?.you}),o=Z(a,``,o,{background:U(t).color}),q(l,U(t).name),q(u,U(t).dev)}),W(`click`,r,()=>$.selectTrack(U(t).id)),K(e,r)});var o=z(a,2),s=e=>{K(e,Xi())};J(o,e=>{$.playable.length===0&&e(s)}),j(i);var c=z(i,2),l=L(c);let u;ye(2),j(c),j(t),B(()=>{r=X(t,1,`sheet svelte-tyq0v8`,null,r,{bottom:U(n)}),u=X(l,1,`switch`,null,u,{on:$.proj?.follow})}),W(`click`,c,()=>$.setFollow(!$.proj?.follow)),K(e,t)},d=e=>{var t=Qi(),n=L(t),i=z(L(n),2);ni(i),j(n);var a=z(n,2),o=z(L(a),2),s=L(o);let c;var l=z(s,2);let u;j(o),j(a);var d=z(a,2),f=L(d);let p;ye(),j(d);var m=z(d,2),h=L(m);let g;ye(),j(m);var _=z(m,2);j(t),B(()=>{c=X(s,1,``,null,c,{on:$.prefs.theme===`nota`}),u=X(l,1,``,null,u,{on:$.prefs.theme===`phone`}),p=X(f,1,`switch`,null,p,{on:$.prefs.haptics}),g=X(h,1,`switch`,null,g,{on:$.prefs.countIn})}),W(`keydown`,i,e=>{e.key===`Enter`&&e.target.blur()}),mr(`blur`,i,()=>$.rename(U(r))),oi(i,()=>U(r),e=>I(r,e)),W(`click`,s,()=>$.prefs.theme=`nota`),W(`click`,l,()=>$.prefs.theme=`phone`),W(`click`,d,()=>$.prefs.haptics=!$.prefs.haptics),W(`click`,m,()=>$.prefs.countIn=!$.prefs.countIn),W(`click`,_,()=>$.leave()),K(e,t)},f=e=>{var t=ea();let r;var i=z(L(t),2),o=L(i);let s;var c=L(o),l=R(z(L(c)),!0);j(c),j(o);var u=z(o,2),d=L(u);let f;var p=z(d,2);let m;j(u);var h=z(u,2);Y(h,21,()=>Ii,Fr,(e,t,n)=>{var r=$i();let i;var o=R(r,!0);B(()=>{i=X(r,1,`btn svelte-tyq0v8`,null,i,{on:$.prefs.key?.root===n}),q(o,U(t))}),W(`click`,r,()=>$.prefs.key={root:n,minor:$.prefs.key?.minor??U(a)?.minor??!1}),K(e,r)}),j(h),j(i),j(t),B(()=>{r=X(t,1,`sheet svelte-tyq0v8`,null,r,{bottom:U(n)}),s=X(o,1,`row slim svelte-tyq0v8`,null,s,{on:!$.prefs.key}),q(l,U(a)?U(a).name:`Not set in Nota — C major`),f=X(d,1,``,null,f,{on:!($.prefs.key?.minor??U(a)?.minor??!1)}),m=X(p,1,``,null,m,{on:$.prefs.key?.minor??U(a)?.minor??!1})}),W(`click`,o,()=>{$.prefs.key=null,$.sheet=null}),W(`click`,d,()=>$.prefs.key={root:$.prefs.key?.root??U(a)?.root??0,minor:!1}),W(`click`,p,()=>$.prefs.key={root:$.prefs.key?.root??U(a)?.root??0,minor:!0}),K(e,t)},p=e=>{var t=na();let r;var i=L(t),a=R(i),o=z(i,2);Y(o,21,()=>$.mac?.devs??[],Fr,(e,t,n)=>{var r=ta();let i;var a=L(r),o=R(L(a),!0);j(a),j(r),B(()=>{i=X(r,1,`row svelte-tyq0v8`,null,i,{on:n===($.mac?.di??0)}),q(o,U(t))}),W(`click`,r,()=>{$.macroDevice=n,$.sub(),$.sheet=null}),K(e,r)}),j(o),j(t),B(()=>{r=X(t,1,`sheet svelte-tyq0v8`,null,r,{bottom:U(n)}),q(a,`Device on ${$.track?.name??`this track`??``}`)}),K(e,t)};J(l,e=>{$.sheet===`tracks`?e(u):$.sheet===`menu`?e(d,1):$.sheet===`key`?e(f,2):$.sheet===`devices`&&e(p,3)}),K(e,o),ze()}hr([`click`,`keydown`]);var aa=G(`<div class="cover svelte-17f2qxr" role="alert"><h1 class="svelte-17f2qxr">Nota isn’t responding</h1> <ol class="svelte-17f2qxr"><li class="svelte-17f2qxr"><span class="mono svelte-17f2qxr">1</span> </li> <li class="svelte-17f2qxr"><span class="mono svelte-17f2qxr">2</span>Remote is on: the Remote button in Nota’s top bar is lit</li> <li class="svelte-17f2qxr"><span class="mono svelte-17f2qxr">3</span>The phone is on the same Wi-Fi. Guest networks often keep devices apart; share the phone’s hotspot with the computer instead.</li></ol> <div class="retry svelte-17f2qxr"><span class="dot blink svelte-17f2qxr"></span>Retrying every few seconds</div></div>`),oa=G(`<span class="mono svelte-17f2qxr"> </span>`),sa=G(`<span class="caret svelte-17f2qxr"></span>`),ca=G(`<span><!></span>`),la=G(`<div class="cover svelte-17f2qxr" role="alert"><h1 class="svelte-17f2qxr"> </h1> <p class="svelte-17f2qxr"> </p> <label class="code svelte-17f2qxr" aria-label="Four-digit code"><input inputmode="numeric" pattern="[0-9]*" maxlength="4" autocomplete="one-time-code" class="svelte-17f2qxr"/> <!></label></div>`),ua=G(`<div class="cover svelte-17f2qxr" role="alert"><h1 class="svelte-17f2qxr">Disconnected</h1> <p class="svelte-17f2qxr">This phone has left Nota. It is still trusted, so connecting again needs no code.</p> <button class="btn on big svelte-17f2qxr">Connect again</button></div>`),da=G(`<button class="count svelte-17f2qxr" aria-label="Cancel count-in"><span> </span> <span class="caps rec svelte-17f2qxr">Count-in · recording starts on 1</span></button>`),fa=G(`<div role="status"> </div>`),pa=G(`<!> <!> <!>`,1);function ma(e,t){Re(t,!0);let n=F(``),r=F(void 0);un(()=>{$.link===`expired`&&(I(n,``),setTimeout(()=>U(r)?.focus(),50))}),un(()=>{U(n).length===4&&$.link===`expired`&&$.pairWith(U(n))});let i=N(()=>$.deny===`code`?`That code didn’t match. Codes change every two minutes — check the one Nota shows now.`:$.deny===`locked`?`Too many wrong codes. Wait half a minute, then try the code Nota shows.`:$.deny===`version`?`This page is older than Nota. Reload it.`:$.deny===`new`?`In Nota, click Remote in the top bar and scan the QR code with the camera, or type its four digits here.`:`This phone was removed from trusted devices, or the code has expired. In Nota, click Remote to show a fresh QR, or type its four digits here.`);var a=pa(),o=Zt(a),s=e=>{var t=aa(),n=z(L(t),2),r=L(n),i=z(L(r));j(r),ye(4),j(n),ye(2),j(t),B(()=>q(i,`Nota is open on ${$.host??``}`)),K(e,t)},c=e=>{var t=la(),a=L(t),o=R(a,!0),s=z(a,2),c=R(s,!0),l=z(s,2),u=L(l);ni(u),ui(u,e=>I(r,e),()=>U(r)),Y(z(u,2),16,()=>[0,1,2,3],Fr,(e,t)=>{var r=ca();let i;var a=L(r),o=e=>{var r=oa(),i=R(r,!0);B(()=>q(i,U(n)[t])),K(e,r)},s=e=>{K(e,sa())};J(a,e=>{U(n)[t]?e(o):U(n).length===t&&e(s,1)}),j(r),B(()=>i=X(r,1,`cell svelte-17f2qxr`,null,i,{cur:U(n).length===t})),K(e,r)}),j(l),j(t),B(()=>{q(o,$.deny===`new`?`Pair with Nota`:`Scan a new code in Nota`),q(c,U(i))}),W(`input`,u,()=>I(n,U(n).replace(/\D/g,``).slice(0,4),!0)),oi(u,()=>U(n),e=>I(n,e)),K(e,t)},l=e=>{var t=ua(),n=z(L(t),4);j(t),W(`click`,n,()=>$.rejoin()),K(e,t)};J(o,e=>{$.link===`down`?e(s):$.link===`expired`?e(c,1):$.link===`left`&&e(l,2)});var u=z(o,2),d=e=>{var n=da(),r=L(n),i=R(r,!0);ye(2),j(n),B(()=>{X(r,1,`mono num ${t.form??``}`,`svelte-17f2qxr`),q(i,$.countIn)}),W(`click`,n,()=>$.record()),K(e,n)};J(u,e=>{$.countIn!==null&&e(d)});var f=z(u,2),p=e=>{var n=fa();let r;var i=R(n,!0);B(()=>{r=X(n,1,`toast svelte-17f2qxr`,null,r,{low:t.form===`phone`}),q(i,$.toast)}),K(e,n)};J(f,e=>{$.toast&&e(p)}),K(e,a),ze()}hr([`input`,`click`]);var ha=G(`<button><span class="sn svelte-1hrivqy"> </span> <span class="mono si svelte-1hrivqy"> </span></button>`),ga=G(`<div class="secs svelte-1hrivqy"><span class="caps svelte-1hrivqy">Sections · tap to jump, hold to loop</span> <div class="sgrid svelte-1hrivqy"></div></div>`),_a=G(`<div><div class="top svelte-1hrivqy"><div class="pblock svelte-1hrivqy"><span class="caps svelte-1hrivqy">Position</span> <span> </span></div> <button class="tap svelte-1hrivqy"><span class="mono svelte-1hrivqy"> </span> <span class="caps svelte-1hrivqy">Tap tempo</span></button></div> <div class="btns svelte-1hrivqy"><button><span class="tri svelte-1hrivqy"></span>Play</button> <button class="b svelte-1hrivqy"><span class="sq svelte-1hrivqy"></span>Stop</button> <button><span class="dot svelte-1hrivqy"></span>Record</button> <button><svg width="30" height="26" viewBox="0 0 30 26" class="svelte-1hrivqy"><path d="M7 9 H21 A5 5 0 0 1 21 19 H9 M9 19 L12 16 M9 19 L12 22 M7 9 A5 5 0 0 0 5 14" class="svelte-1hrivqy"></path></svg>Loop</button> <button><svg width="26" height="28" viewBox="0 0 26 28" class="svelte-1hrivqy"><path d="M8 25 L11 3 H15 L18 25 Z M13 18 L21 8" class="svelte-1hrivqy"></path></svg>Click</button> <button><svg width="28" height="24" viewBox="0 0 28 24" class="svelte-1hrivqy"><path d="M9 5 L4 10 L9 15 M4 10 H17 A6 6 0 0 1 17 22 H12" class="svelte-1hrivqy"></path></svg>Undo</button></div> <!></div>`);function va(e,t){Re(t,!0);let n=F(`1.1.1`);un(()=>{let e=0,t=()=>{let r=Math.max(0,$.position());I(n,`${Math.floor(r/4)+1}.${Math.floor(r%4)+1}.${Math.floor(r*4%4)+1}`),e=requestAnimationFrame(t)};return t(),()=>cancelAnimationFrame(e)});let r=N(()=>$.proj?.sections??[]),i=N(()=>$.position()),a=N(()=>U(r).reduce((e,t,n)=>U(i)>=t[1]?n:e,-1)),o=N(()=>$.tp.loop?U(r).findIndex((e,t)=>Math.abs(e[1]-$.tp.ls)<.01&&Math.abs((U(r)[t+1]?.[1]??e[1]+16)-$.tp.le)<.01):-1);function s(e){if(!$.canControl)return $.showToast(`Nota lets this phone play notes only.`);$.send(e)}let c=[];function l(){let e=performance.now();if(c=[...c.filter(t=>e-t<2500),e],c.length>=3){let e=(c[c.length-1]-c[0])/(c.length-1);s({t:`bpm`,v:Math.round(Math.min(220,Math.max(50,6e4/e))*100)/100})}}let u=0,d=!1;function f(e){d=!1,u=window.setTimeout(()=>{d=!0;let t=U(r)[e],n=U(r)[e+1]?.[1]??t[1]+16;U(o)===e?s({t:`loop`,on:!1}):s({t:`loopRange`,v:t[1],v2:n,on:!0})},450)}function p(e){clearTimeout(u),d||s({t:`seek`,v:U(r)[e][1]})}let m=N(()=>$.tp.bpm.toFixed($.tp.bpm%1?2:0));var h=_a(),g=L(h),_=L(g),v=z(L(_),2);let y;var b=R(v,!0);j(_);var x=z(_,2),S=R(L(x),!0);ye(2),j(x),j(g);var C=z(g,2);let w;var T=L(C);let ee;var E=z(T,2),D=z(E,2);let te;var ne=z(D,2);let re;var ie=z(ne,2);let ae;var oe=z(ie,2);let se;j(C);var ce=z(C,2),le=e=>{var t=ga(),n=z(L(t),2);Y(n,21,()=>U(r),Fr,(e,t,n)=>{var r=ha();let i;var s=L(r),c=R(s,!0),l=R(z(s,2),!0);j(r),B(e=>{i=X(r,1,`sec svelte-1hrivqy`,null,i,{cur:U(a)===n,looping:U(o)===n}),q(c,U(t)[0]),q(l,e)},[()=>U(o)===n?`LOOPING`:`BAR ${Math.floor(U(t)[1]/4)+1}`]),W(`pointerdown`,r,()=>f(n)),W(`pointerup`,r,()=>p(n)),mr(`pointercancel`,r,()=>clearTimeout(u)),K(e,r)}),j(n),j(t),K(e,t)};J(ce,e=>{U(r).length>0&&e(le)}),j(h),B(()=>{X(h,1,`big ${t.form??``}`,`svelte-1hrivqy`),y=X(v,1,`mono pos svelte-1hrivqy`,null,y,{rec:$.tp.rec}),q(b,U(n)),q(S,U(m)),w=Z(C,``,w,{"grid-template-columns":`repeat(${t.form===`phone`?3:6}, minmax(0, 1fr))`}),ee=X(T,1,`b play svelte-1hrivqy`,null,ee,{on:$.tp.play}),Q(T,`aria-pressed`,$.tp.play),te=X(D,1,`b recb svelte-1hrivqy`,null,te,{on:$.tp.rec}),Q(D,`aria-pressed`,$.tp.rec),re=X(ne,1,`b svelte-1hrivqy`,null,re,{on:$.tp.loop}),Q(ne,`aria-pressed`,$.tp.loop),ae=X(ie,1,`b svelte-1hrivqy`,null,ae,{on:$.tp.met}),Q(ie,`aria-pressed`,$.tp.met),se=X(oe,1,`b svelte-1hrivqy`,null,se,{dim:!$.tp.can})}),W(`click`,x,l),W(`click`,T,()=>s({t:$.tp.play?`stop`:`play`})),W(`click`,E,()=>s({t:`stop`})),W(`click`,D,()=>$.canControl?$.record():s({})),W(`click`,ne,()=>s({t:`loop`,on:!$.tp.loop})),W(`click`,ie,()=>s({t:`met`,on:!$.tp.met})),W(`click`,oe,()=>s({t:`undo`})),K(e,h),ze()}hr([`click`,`pointerdown`,`pointerup`]);var ya=G(`<button> </button>`),ba=G(`<button><span class="num mono svelte-1puq9zz"> </span> <span class="label svelte-1puq9zz"><span class="name svelte-1puq9zz"> </span> <span class="note mono svelte-1puq9zz"> </span></span></button>`),xa=G(`<div class="pads svelte-1puq9zz"><div class="bar svelte-1puq9zz"><div class="seg banks svelte-1puq9zz" role="group" aria-label="Bank"></div> <button>Full vel.</button> <button>Repeat <span class="rate mono svelte-1puq9zz" role="button" tabindex="0" aria-label="Repeat rate"> </span></button></div> <div class="grid svelte-1puq9zz"></div></div>`);function Sa(e,t){Re(t,!0);let n=[{n:`1/8`,div:2},{n:`1/16`,div:4},{n:`1/32`,div:8}],r=F(1),i=F(!1),a=Ht({}),o=new Map,s=new Map,c=N(()=>t.form===`phone`?4:8),l=N(()=>t.form===`tablet`?32:16),u=N(()=>36+Math.min($.prefs.bank,3)*12),d=N(()=>new Map(($.track?.pads??[]).map(([e,t])=>[e,t]))),f=N(()=>new Set($.lit)),p=N(()=>$.track?.color??`var(--accent)`),m=N(()=>{let e=U(l)/U(c),t=[];for(let n=e-1;n>=0;n--)for(let e=0;e<U(c);e++)t.push(U(u)+n*U(c)+e);return t}),h=N(()=>Array.from({length:4},(e,t)=>({i:t,name:Bi(36+t*12)})));function g(e,t){e.preventDefault();let c=e.currentTarget.getBoundingClientRect(),l=$.prefs.fullVel?1:Math.max(.2,Math.min(1,1-(e.clientY-c.top)/c.height+.15));if([...s.values()].includes(t)&&$.noteOff(t),s.set(e.pointerId,t),a[t]=!0,$.noteOn(t,l),U(i)&&!o.has(t)){let e=()=>6e4/Math.max(20,$.tp.bpm)/n[U(r)].div,i=()=>{$.noteOff(t),$.noteOn(t,l),o.set(t,window.setTimeout(i,e()))};o.set(t,window.setTimeout(i,e()))}}function _(e){let t=s.get(e.pointerId);t!==void 0&&(s.delete(e.pointerId),![...s.values()].includes(t)&&(clearTimeout(o.get(t)),o.delete(t),a[t]=!1,$.noteOff(t)))}un(()=>{let e=e=>_(e);return window.addEventListener(`pointerup`,e,!0),window.addEventListener(`pointercancel`,e,!0),()=>{window.removeEventListener(`pointerup`,e,!0),window.removeEventListener(`pointercancel`,e,!0)}}),un(()=>(U(u),()=>{for(let e of o.values())clearTimeout(e);o.clear();for(let e of new Set(s.values()))a[e]=!1,$.noteOff(e);s.clear()}));var v=xa(),y=L(v),b=L(y);Y(b,21,()=>U(h),Fr,(e,t)=>{var n=ya();let r;var i=R(n,!0);B(()=>{r=X(n,1,`mono svelte-1puq9zz`,null,r,{on:$.prefs.bank===U(t).i}),q(i,U(t).name)}),W(`click`,n,()=>$.prefs.bank=U(t).i),K(e,n)}),j(b);var x=z(b,2);let S;var C=z(x,2);let w;var T=z(L(C)),ee=R(T,!0);j(C),j(y);var E=z(y,2);let D;Y(E,20,()=>U(m),e=>e,(e,t)=>{let n=N(()=>a[t]),r=N(()=>!U(n)&&U(f).has(t));var i=ba();let o,s;var c=L(i),l=R(c,!0),u=z(c,2),m=L(u),h=R(m,!0),v=R(z(m,2),!0);j(u),j(i),B((e,a,c)=>{o=X(i,1,`pad svelte-1puq9zz`,null,o,{on:U(n),playing:U(r)}),Q(i,`aria-label`,e),s=Z(i,``,s,{"--tc":U(p)}),q(l,t-35),q(h,a),q(v,c)},[()=>U(d).get(t)??Bi(t),()=>U(d).get(t)??Bi(t),()=>Bi(t)]),W(`pointerdown`,i,e=>g(e,t)),W(`pointerup`,i,_),mr(`pointercancel`,i,_),mr(`pointerleave`,i,_),K(e,i)}),j(E),j(v),B(()=>{S=X(x,1,`btn`,null,S,{on:$.prefs.fullVel}),Q(x,`aria-pressed`,$.prefs.fullVel),w=X(C,1,`btn rep svelte-1puq9zz`,null,w,{on:U(i)}),Q(C,`aria-pressed`,U(i)),q(ee,n[U(r)].n),D=Z(E,``,D,{"grid-template-columns":`repeat(${U(c)??``}, minmax(0, 1fr))`})}),W(`click`,x,()=>$.prefs.fullVel=!$.prefs.fullVel),W(`click`,C,()=>I(i,!U(i))),W(`click`,T,e=>{e.stopPropagation(),I(r,(U(r)+1)%n.length)}),W(`keydown`,T,()=>{}),K(e,v),ze()}hr([`click`,`keydown`,`pointerdown`,`pointerup`]);var Ca=G(`<button> </button>`),wa=G(`<button>Expressive</button>`),Ta=G(`<span class="mono lbl svelte-12d1dcp"> </span>`),Ea=G(`<span class="band svelte-12d1dcp"></span>`),Da=G(`<div><!> <!></div>`),Oa=G(`<div><!></div>`),ka=G(`<div class="kb svelte-12d1dcp"><!> <!></div>`),Aa=G(`<div><span class="mono svelte-12d1dcp"> </span></div>`),ja=G(`<div class="grid svelte-12d1dcp"></div>`),Ma=G(`<div><span class="mono roman svelte-12d1dcp"> </span> <span class="cn svelte-12d1dcp"> </span></div>`),Na=G(`<div class="grid chords svelte-12d1dcp"></div>`),Pa=G(`<span class="hint svelte-12d1dcp">Slide sideways to bend, up and down for timbre.</span>`),Fa=G(`<span class="hint svelte-12d1dcp">Turn the phone sideways for 1.5 octaves.</span>`),Ia=G(`<div class="keys svelte-12d1dcp"><div class="bar svelte-12d1dcp"><div class="seg modes svelte-12d1dcp" role="group" aria-label="Mode"></div> <button class="btn keybtn svelte-12d1dcp"><span class="caps k svelte-12d1dcp">Key</span> <span class="kn svelte-12d1dcp"> </span> <span class="mono src svelte-12d1dcp"> </span></button> <!> <div class="oct svelte-12d1dcp"><button class="btn sq svelte-12d1dcp" aria-label="Octave down"><svg width="12" height="12" viewBox="0 0 12 12"><path d="M2 6 H10" class="svelte-12d1dcp"></path></svg></button> <span class="mono svelte-12d1dcp"> </span> <button class="btn sq svelte-12d1dcp" aria-label="Octave up"><svg width="12" height="12" viewBox="0 0 12 12"><path d="M2 6 H10 M6 2 V10" class="svelte-12d1dcp"></path></svg></button></div></div> <div class="surface svelte-12d1dcp" role="application" aria-label="Keys"><!></div> <!></div>`);function La(e,t){Re(t,!0);let n=[`Keyboard`,`Scale`,`Chords`],r=[0,2,4,5,7,9,11],i=N(()=>$.prefs.key??($.proj?.key?{root:$.proj.key.root,minor:$.proj.key.minor}:{root:0,minor:!1})),a=N(()=>$.prefs.key?`PHONE`:$.proj?.key?`PROJECT`:`DEFAULT`),o=N(()=>12*($.prefs.octave+1)),s=N(()=>new Set($.lit)),c=N(()=>$.track?.color??`var(--accent)`),l=N(()=>$.prefs.keysMode),u=N(()=>!!$.track?.mpe&&U(l)!==`Chords`),d=N(()=>U(u)&&$.prefs.expressive),f=N(()=>t.form===`phone`?8:t.form===`phoneLand`?11:15),p=N(()=>Array.from({length:U(f)},(e,t)=>U(o)+r[t%7]+12*Math.floor(t/7))),m=N(()=>{let e=[];for(let t=0;t<U(f)-1;t++)[0,1,3,4,5].includes(t%7)&&e.push({note:U(o)+r[t%7]+12*Math.floor(t/7)+1,left:`calc(${(t+1)/U(f)*100}% - ${.62/U(f)*50}%)`,w:`${.62/U(f)*100}%`});return e}),h=N(()=>t.form===`phone`?5:8),g=N(()=>t.form===`phoneLand`?4:6),_=N(()=>{let e=[];for(let t=U(g)-1;t>=0;t--)for(let n=0;n<U(h);n++){let r=t*3+n;e.push({note:Ui(U(i),U(o),r),tonic:r%7==0})}return e}),v=N(()=>Gi(U(i),U(o))),y=new Map,b=F(Ht({}));function x(e,t){return(document.elementFromPoint(e,t)?.closest(`[data-t]`))?.dataset.t??null}function S(e){return e[0]===`n`?[Number(e.slice(1))]:U(v)[Number(e.slice(1))]?.notes??[]}let C=new Map;function w(e,t=.85){if(C.has(e))return;U(b)[e]=!0;let n=S(e);C.set(e,n);for(let e of n)$.noteOn(e,t)}function T(e){if(![...y.values()].includes(e)){U(b)[e]=!1;for(let t of C.get(e)??[])$.noteOff(t);C.delete(e)}}let ee=new Set,E=new Map,D=.2;function te(e,t){let n=(t-e.x0)/e.unit*e.semis,r=Math.max(0,Math.abs(n)-D)*(e.semis/(e.semis-D));return Math.max(-24,Math.min(24,Math.sign(n)*r))}let ne=(e,t)=>Math.max(0,Math.min(1,1-(t-e.top)/e.h));function re(e,t,n){let r=E.get(e);if(!r)return;n||$.noteExpr(r.note,0,te(r,t.clientX)),$.noteExpr(r.note,2,ne(r,t.clientY));let i=t.pressure;!r.force&&(n?i!==0&&i!==.5&&i!==1:i!==r.p0)&&(r.force=!0),r.force&&$.noteExpr(r.note,1,i)}function ie(e,t){let n=document.elementFromPoint(e.clientX,e.clientY)?.closest(`[data-t]`);if(!n||t[0]!==`n`)return;let r=n.getBoundingClientRect(),i=n.classList.contains(`black`)?n.parentElement?.querySelector(`.white`):n,a=U(l)===`Keyboard`?i?.getBoundingClientRect().width??r.width:r.width;E.set(e.pointerId,{note:Number(t.slice(1)),x0:e.clientX,unit:Math.max(8,a),semis:U(l)===`Keyboard`?12/7:2,top:r.top,h:Math.max(8,r.height),force:!1,p0:e.pressure}),re(e.pointerId,e,!0)}function ae(e){e.currentTarget.setPointerCapture(e.pointerId),ee.add(e.pointerId);let t=x(e.clientX,e.clientY);t&&(y.set(e.pointerId,t),w(t),U(d)&&ie(e,t))}function oe(e){if(!ee.has(e.pointerId))return;if(E.has(e.pointerId)){re(e.pointerId,e,!1);return}let t=y.get(e.pointerId),n=x(e.clientX,e.clientY);n!==t&&(t!==void 0&&(y.delete(e.pointerId),T(t)),n&&(y.set(e.pointerId,n),w(n)))}function se(e){ee.delete(e.pointerId),E.delete(e.pointerId);let t=y.get(e.pointerId);y.delete(e.pointerId),t!==void 0&&T(t)}let ce=N(()=>U(i).root*2+ +!!U(i).minor);un(()=>(U(o),U(l),U(ce),U(d),()=>{E.clear();for(let e of C.values())for(let t of e)$.noteOff(t);C.clear(),y.clear(),ee.clear(),I(b,{},!0)}));var le=Ia(),ue=L(le),de=L(ue);Y(de,21,()=>n,Fr,(e,t)=>{var n=Ca();let r;var i=R(n,!0);B(()=>{r=X(n,1,`svelte-12d1dcp`,null,r,{on:U(l)===U(t)}),q(i,U(t))}),W(`click`,n,()=>$.prefs.keysMode=U(t)),K(e,n)}),j(de);var O=z(de,2),fe=z(L(O),2),pe=R(fe,!0),me=R(z(fe,2),!0);j(O);var he=z(O,2),k=e=>{var t=wa();let n;B(()=>{n=X(t,1,`btn expr svelte-12d1dcp`,null,n,{on:U(d)}),Q(t,`aria-pressed`,U(d))}),W(`click`,t,()=>$.prefs.expressive=!$.prefs.expressive),K(e,t)};J(he,e=>{U(u)&&e(k)});var ge=z(he,2),A=L(ge),_e=z(A,2),ve=R(_e),ye=z(_e,2);j(ge),j(ue);var be=z(ue,2);let xe;var Se=L(be),Ce=e=>{var t=ka(),n=L(t);Y(n,16,()=>U(p),e=>e,(e,t)=>{var n=Da();let r;var i=L(n),a=e=>{var n=Ta(),r=R(n,!0);B(e=>q(r,e),[()=>Bi(t)]),K(e,n)};J(i,e=>{t%12==0&&e(a)});var o=z(i,2),c=e=>{K(e,Ea())},l=N(()=>U(s).has(t));J(o,e=>{U(l)&&e(c)}),j(n),B(()=>{r=X(n,1,`white svelte-12d1dcp`,null,r,{on:U(b)[`n`+t]}),Q(n,`data-t`,`n`+t)}),K(e,n)}),Y(z(n,2),17,()=>U(m),e=>e.note,(e,t)=>{var n=Oa();let r,i;var a=L(n),o=e=>{K(e,Ea())},c=N(()=>U(s).has(U(t).note));J(a,e=>{U(c)&&e(o)}),j(n),B(()=>{r=X(n,1,`black svelte-12d1dcp`,null,r,{on:U(b)[`n`+U(t).note]}),Q(n,`data-t`,`n`+U(t).note),i=Z(n,``,i,{left:U(t).left,width:U(t).w})}),K(e,n)}),j(t),K(e,t)},we=e=>{var t=ja();let n;Y(t,21,()=>U(_),Fr,(e,t)=>{var n=Aa();let r;var i=R(L(n));j(n),B((e,a)=>{r=X(n,1,`cell svelte-12d1dcp`,null,r,{tonic:U(t).tonic,on:U(b)[`n`+U(t).note],lit:e}),Q(n,`data-t`,`n`+U(t).note),q(i,`${Ii[U(t).note%12]??``}${a??``}`)},[()=>U(s).has(U(t).note),()=>U(t).tonic?Math.floor(U(t).note/12)-1:``]),K(e,n)}),j(t),B(()=>n=Z(t,``,n,{"grid-template-columns":`repeat(${U(h)??``}, minmax(0, 1fr))`})),K(e,t)},Te=e=>{var n=Na();let r;Y(n,21,()=>U(v),Fr,(e,t,n)=>{var r=Ma();let i;Q(r,`data-t`,`c`+n);var a=L(r),o=R(a,!0),c=R(z(a,2),!0);j(r),B(e=>{i=X(r,1,`chord svelte-12d1dcp`,null,i,{on:U(b)[`c`+n],lit:e}),q(o,U(t).roman),q(c,U(t).name)},[()=>U(t).notes.every(e=>U(s).has(e))]),K(e,r)}),j(n),B(()=>r=Z(n,``,r,{"grid-template-columns":`repeat(${t.form===`phone`?2:7}, minmax(0, 1fr))`})),K(e,n)};J(Se,e=>{U(l)===`Keyboard`?e(Ce):U(l)===`Scale`?e(we,1):e(Te,-1)}),j(be);var Ee=z(be,2),De=e=>{K(e,Pa())},Oe=e=>{K(e,Fa())};J(Ee,e=>{U(d)?e(De):t.form===`phone`&&U(l)===`Keyboard`&&e(Oe,1)}),j(le),B((e,t)=>{Q(O,`aria-label`,`Key: ${e??``}`),q(pe,t),q(me,U(a)),q(ve,`Oct ${$.prefs.octave??``}`),xe=Z(be,``,xe,{"--tc":U(c)})},[()=>Vi(U(i)),()=>Vi(U(i))]),W(`click`,O,()=>$.sheet=`key`),W(`click`,A,()=>$.prefs.octave=Math.max(0,$.prefs.octave-1)),W(`click`,ye,()=>$.prefs.octave=Math.min(7,$.prefs.octave+1)),W(`pointerdown`,be,ae),W(`pointermove`,be,oe),W(`pointerup`,be,se),mr(`pointercancel`,be,se),K(e,le),ze()}hr([`click`,`pointerdown`,`pointermove`,`pointerup`]);var Ra=G(`<span class="pill svelte-19m1tsu">Tilt is moving the point</span>`),za=G(`<div><span class="mono an svelte-19m1tsu"> </span> <span class="names svelte-19m1tsu"><span class="pn svelte-19m1tsu"> </span><span class="pd svelte-19m1tsu"> </span></span> <span class="mono av svelte-19m1tsu"> </span></div>`),Ba=G(`<button><span class="ph svelte-19m1tsu"></span>Tilt</button>`),Va=G(`<span class="note dim svelte-19m1tsu">Tilt needs a secure (HTTPS) page, which a local Nota can’t offer yet.</span>`),Ha=G(`<div class="auto svelte-19m1tsu"><span class="rd svelte-19m1tsu"></span>Writing automation · latch</div>`),Ua=G(`<div><div role="slider" tabindex="0" aria-label="XY pad"><div class="gridlines svelte-19m1tsu"></div> <div class="fill svelte-19m1tsu"></div> <div class="vl svelte-19m1tsu"></div> <div class="hl svelte-19m1tsu"></div> <div class="pt svelte-19m1tsu"><span class="svelte-19m1tsu"></span></div> <span class="ax ax-x mono svelte-19m1tsu"> </span> <span class="ax ax-y mono svelte-19m1tsu"> </span> <!></div> <div class="panel svelte-19m1tsu"><div class="axes svelte-19m1tsu"></div> <div class="row svelte-19m1tsu"><div class="seg svelte-19m1tsu"><button>Hold</button> <button>Return</button></div> <!></div> <span class="note svelte-19m1tsu"> </span> <!> <!></div></div>`);function Wa(e,t){Re(t,!0);let n=N(()=>t.form===`phone`),r=F(.5),i=F(.5),a=F(!1),o=F(!1),s=!1,c={x:.5,y:.5},l={x:0,y:0},u=0,d=0,f=null,p=Ti();un(()=>{let e=$.xy;!e||U(a)||U(o)||s||(e.x.v!==void 0&&!e.x.map&&I(r,e.x.v,!0),e.y.v!==void 0&&!e.y.map&&I(i,e.y.v,!0))});function m(e,t=`xy`){let n=performance.now();e===0&&n-d<30||(d=n,$.send({t:`xy`,v:U(r),v2:U(i),ph:e,s:t,i:$.learn.on?u:0}))}function h(e,t){let n=t.getBoundingClientRect();I(r,Math.min(1,Math.max(0,(e.clientX-n.left)/n.width)),!0),I(i,Math.min(1,Math.max(0,1-(e.clientY-n.top)/n.height)),!0)}function g(e){if(U(o)||!$.canControl){$.canControl||$.showToast(`Nota lets this phone play notes only.`);return}let t=e.currentTarget;t.setPointerCapture(e.pointerId),s=!1,c={x:U(r),y:U(i)},l={x:e.clientX,y:e.clientY},u=0,I(a,!0),h(e,t),$.learn.on||m(1)}function _(e){if(U(a)){if($.learn.on&&u===0){let t=Math.abs(e.clientX-l.x),n=Math.abs(e.clientY-l.y);if(Math.max(t,n)<14)return;u=t>=n?1:2}h(e,e.currentTarget),m(0)}}function v(){U(a)&&(I(a,!1),m(2),$.prefs.xyHold||y())}function y(){s=!0;let e=()=>{if(s&&!U(a)){if(I(r,U(r)+(c.x-U(r))*.2),I(i,U(i)+(c.y-U(i))*.2),Math.abs(c.x-U(r))+Math.abs(c.y-U(i))<.003){I(r,c.x,!0),I(i,c.y,!0),s=!1,m(2);return}m(0),requestAnimationFrame(e)}};requestAnimationFrame(e)}async function b(){if(!$.canControl)return $.showToast(`Nota lets this phone play notes only.`);if(U(o)){I(o,!1),f?.(),f=null,m(2,`tilt`);return}if(!await Ei()){$.showToast(`Motion access was refused. Allow it in Settings → Safari → Motion & Orientation Access, then reload.`);return}I(o,!0),f=Di((e,t)=>{I(r,e,!0),I(i,t,!0),m(0,`tilt`)})}un(()=>()=>f?.());let x=e=>{let t=$.xy?.[e];return t?U(o)&&t.tilt?t.tilt:t.map??t.n??(e===`x`?`X`:`Y`):e===`x`?`X`:`Y`},S=e=>{let t=$.xy?.[e];return t?U(o)&&t.tilt||t.map?`Mapped in Nota`:t.d??`Not assigned`:``},C=e=>{let t=$.xy?.[e],n=U(e===`x`?r:i);return t&&!t.map&&!(U(o)&&t.tilt)&&t.txt&&!U(a)&&!U(o)?t.txt:Math.round(n*100)+` %`},w=N(()=>U(o)?`Tilt the phone to move the point. Tap Tilt again to use your finger.`:!$.xy?.ok&&!$.xy?.x.map&&!$.xy?.y.map?`This track has no Auto Filter or Nota Flux. Add one in Nota, or map the axes with MIDI Learn.`:$.prefs.xyHold?`The point stays where you lift your finger.`:`On release the point glides back to where it started.`);var T=Ua();let ee;var E=L(T);let D;var te=z(L(E),2);let ne;var re=z(te,2);let ie;var ae=z(re,2);let oe;var se=z(ae,2);let ce;var le=z(se,2),ue=R(le),de=z(le,2),O=R(de),fe=z(de,2),pe=e=>{K(e,Ra())};J(fe,e=>{U(o)&&e(pe)}),j(E);var me=z(E,2),he=L(me);Y(he,20,()=>[`x`,`y`],Fr,(e,t)=>{var n=za();let r;var i=L(n),a=R(i,!0),o=z(i,2),s=L(o),c=R(s,!0),l=R(z(s),!0);j(o);var u=R(z(o,2),!0);j(n),B((e,t,i,o)=>{r=X(n,1,`axis svelte-19m1tsu`,null,r,{learnable:$.learn.on}),q(a,e),q(c,t),q(l,i),q(u,o)},[()=>t.toUpperCase(),()=>x(t),()=>S(t),()=>C(t)]),K(e,n)}),j(he);var k=z(he,2),ge=L(k),A=L(ge);let _e;var ve=z(A,2);let ye;j(ge);var be=z(ge,2),xe=e=>{var t=Ba();let n;B(()=>{n=X(t,1,`btn tilt svelte-19m1tsu`,null,n,{on:U(o),learnable:$.learn.on}),Q(t,`aria-pressed`,U(o))}),W(`click`,t,b),K(e,t)};J(be,e=>{(p===`yes`||p===`ask`)&&e(xe)}),j(k);var Se=z(k,2),Ce=R(Se,!0),we=z(Se,2),Te=e=>{K(e,Va())};J(we,e=>{p===`insecure`&&e(Te)});var Ee=z(we,2),De=e=>{K(e,Ha())};J(Ee,e=>{$.xy?.auto&&e(De)}),j(me),j(T),B((e,t,a)=>{ee=X(T,1,`xy svelte-19m1tsu`,null,ee,{col:U(n)}),D=X(E,1,`field svelte-19m1tsu`,null,D,{learnable:$.learn.on}),Q(E,`aria-valuenow`,e),ne=Z(te,``,ne,{width:`${U(r)*100}%`,height:`${U(i)*100}%`,background:$.track?.color??`var(--accent)`}),ie=Z(re,``,ie,{left:`${U(r)*100}%`}),oe=Z(ae,``,oe,{top:`${(1-U(i))*100}%`}),ce=Z(se,``,ce,{left:`${U(r)*100}%`,top:`${(1-U(i))*100}%`}),q(ue,`${t??``} →`),q(O,`↑ ${a??``}`),_e=X(A,1,`svelte-19m1tsu`,null,_e,{on:$.prefs.xyHold}),ye=X(ve,1,`svelte-19m1tsu`,null,ye,{on:!$.prefs.xyHold}),q(Ce,U(w))},[()=>Math.round(U(r)*100),()=>x(`x`),()=>x(`y`)]),W(`pointerdown`,E,g),W(`pointermove`,E,_),W(`pointerup`,E,v),mr(`pointercancel`,E,v),W(`click`,A,()=>$.prefs.xyHold=!0),W(`click`,ve,()=>$.prefs.xyHold=!1),K(e,T),ze()}hr([`pointerdown`,`pointermove`,`pointerup`,`click`]);var Ga=G(`<span class="tag mono svelte-4q66aa"><svg width="8" height="8" viewBox="0 0 8 8"><path d="M2.5 1.5 L5.5 4 L2.5 6.5" class="svelte-4q66aa"></path></svg> </span>`),Ka=G(`<span class="held svelte-4q66aa"> </span>`),qa=G(`<button><span class="svelte-4q66aa"></span>ARM</button>`),Ja=G(`<div><button class="head svelte-4q66aa"><span class="cbar svelte-4q66aa"></span> <span class="nm svelte-4q66aa"> </span> <!></button> <div class="pan svelte-4q66aa" role="slider" tabindex="0"><div class="pbar svelte-4q66aa"><span class="svelte-4q66aa"></span></div> <span class="mono pv svelte-4q66aa"> </span></div> <div class="fz svelte-4q66aa"><!> <div class="meters svelte-4q66aa"><div class="svelte-4q66aa"><span class="svelte-4q66aa"></span></div><div class="svelte-4q66aa"><span class="svelte-4q66aa"></span></div></div> <div class="fader svelte-4q66aa" role="slider" tabindex="0"><div class="slot svelte-4q66aa"></div> <div class="travel svelte-4q66aa"><span><i class="svelte-4q66aa"></i></span></div></div></div> <span> </span> <div class="btns svelte-4q66aa"><button>M</button> <button>S</button> <!></div></div>`),Ya=G(`<div role="group" aria-label="Mixer"><div class="strips svelte-4q66aa"></div> <div class="rule svelte-4q66aa"></div> <div class="strip masterstrip svelte-4q66aa"><div class="head mh svelte-4q66aa"><span class="caps svelte-4q66aa">Master</span></div> <div class="fz svelte-4q66aa"><!> <div class="meters wide svelte-4q66aa"><div class="svelte-4q66aa"><span class="svelte-4q66aa"></span></div><div class="svelte-4q66aa"><span class="svelte-4q66aa"></span></div></div> <div class="fader svelte-4q66aa" role="slider" tabindex="0" aria-label="Master volume"><div class="slot svelte-4q66aa"></div> <div class="travel svelte-4q66aa"><span class="cap svelte-4q66aa"><i class="svelte-4q66aa"></i></span></div></div></div> <span class="mono dbv svelte-4q66aa"> </span></div></div>`);function Xa(e,t){Re(t,!0);let n=1.5,r=N(()=>new Map(($.mix?.ch??[]).map(e=>[e[0],e]))),i=N(()=>$.proj?.tracks??[]),a=N(()=>new Set($.prefs.groupsOpen)),o=N(()=>{let e=new Map(U(i).map(e=>[e.id,e]));return U(i).filter(t=>{let n=t.grp,r=0;for(;n>0&&r++<16;){if(!U(a).has(n))return!1;n=e.get(n)?.grp??-1}return!0})}),s=e=>U(i).filter(t=>t.grp===e).length,c=Ht({}),l=F(null),u=new Map;function d(e,t,n,r,i){if(!$.canControl){$.showToast(`Nota lets this phone play notes only.`);return}let a=e.currentTarget;a.setPointerCapture(e.pointerId);let o=performance.now();if(o-(u.get(t)??0)<300){u.delete(t);let e=r===`pan`?0:1;c[t]=e,$.send({t:r,id:n,v:e,ph:2}),setTimeout(()=>delete c[t],400),I(l,null);return}u.set(t,o);let s=a.getBoundingClientRect();I(l,{key:t,id:n,kind:r,start:i,y:e.clientY,x:e.clientX,size:r===`pan`?s.width:s.height},!0),c[t]=i,$.send({t:r,id:n,v:i,ph:1})}let f=0;function p(e){if(!U(l))return;let t=U(l).kind===`pan`?Math.max(-1,Math.min(1,U(l).start+(e.clientX-U(l).x)/U(l).size*2)):Math.max(0,Math.min(n,U(l).start+(U(l).y-e.clientY)/U(l).size*n));c[U(l).key]=t;let r=performance.now();r-f>30&&(f=r,$.send({t:U(l).kind,id:U(l).id,v:t,ph:0}))}function m(){if(!U(l))return;let e=U(l);I(l,null),$.send({t:e.kind,id:e.id,v:c[e.key],ph:2}),setTimeout(()=>{U(l)?.key!==e.key&&delete c[e.key]},400)}function h(e,t,n){if(!$.canControl)return $.showToast(`Nota lets this phone play notes only.`);$.send({t:e,id:t.id,on:n})}function g(e){let t=new Set($.prefs.groupsOpen);t.has(e.id)?t.delete(e.id):t.add(e.id),$.prefs.groupsOpen=[...t]}let _=e=>{if(e<1e-4)return`−∞`;let t=20*Math.log10(e);return(t>=.05?`+`:t<=-.05?`−`:``)+Math.abs(t).toFixed(1)},v=e=>Math.abs(e)<.01?`C`:(e<0?`L`:`R`)+Math.round(Math.abs(e)*50),y=e=>e&&e[8]&&e[9]!==$.conn?e[8]:``,b=N(()=>$.mix?.m);var x=Ya(),S=L(x);Y(S,21,()=>U(o),e=>e.id,(e,t)=>{let i=N(()=>U(r).get(U(t).id)),o=N(()=>c[`v`+U(t).id]??U(i)?.[1]??1),u=N(()=>c[`p`+U(t).id]??U(i)?.[2]??0),f=N(()=>y(U(i))),p=N(()=>U(t).kind===`group`);var m=Ja();let b;var x=L(m),S=L(x);let C;var w=z(S,2),T=R(w,!0),ee=z(w,2),E=e=>{var n=Ga(),r=L(n);let i;var o=z(r,1,!0);j(n),B((e,t)=>{i=Z(r,``,i,{transform:e}),q(o,t)},[()=>U(a).has(U(t).id)?`rotate(90deg)`:`none`,()=>s(U(t).id)]),K(e,n)};J(ee,e=>{U(p)&&e(E)}),j(x);var D=z(x,2),te=L(D),ne=L(te);let re;j(te);var ie=R(z(te,2),!0);j(D);var ae=z(D,2),oe=L(ae),se=e=>{var t=Ka(),n=R(t);B(()=>q(n,`${U(f)??``} has it`)),K(e,t)};J(oe,e=>{U(f)&&e(se)});var ce=z(oe,2),le=L(ce),ue=L(le);let de;j(le);var O=z(le),fe=L(O);let pe;j(O),j(ce);var me=z(ce,2),he=z(L(me),2),k=L(he);let ge,A;j(he),j(me),j(ae);var _e=z(ae,2);let ve;var ye=R(_e,!0),be=z(_e,2),xe=L(be);let Se;var Ce=z(xe,2);let we;var Te=z(Ce,2),Ee=e=>{var n=qa();let r;B(()=>{r=X(n,1,`arm svelte-4q66aa`,null,r,{on:U(i)?.[5]}),Q(n,`aria-pressed`,!!U(i)?.[5]),Q(n,`aria-label`,`Arm ${U(t).name??``}`)}),W(`click`,n,()=>h(`arm`,U(t),!U(i)?.[5])),K(e,n)};J(Te,e=>{U(t).kind!==`group`&&U(t).kind!==`return`&&e(Ee)}),j(be),j(m),B((e,r,a,s,c)=>{b=X(m,1,`strip svelte-4q66aa`,null,b,{group:U(p),active:U(l)?.key===`v`+U(t).id}),Q(x,`aria-label`,e),C=Z(S,``,C,{background:U(t).color}),q(T,U(t).name),Q(D,`aria-label`,`${U(t).name??``} pan`),Q(D,`aria-valuetext`,r),Q(D,`aria-valuenow`,U(u)),re=Z(ne,``,re,{left:`${50+U(u)*50}%`}),q(ie,a),de=Z(ue,``,de,{height:`${(U(i)?.[6]??0)*100}%`}),pe=Z(fe,``,pe,{height:`${(U(i)?.[7]??0)*100}%`}),Q(me,`aria-label`,`${U(t).name??``} volume`),Q(me,`aria-valuetext`,`${s??``} dB`),Q(me,`aria-valuenow`,U(o)),ge=X(k,1,`cap svelte-4q66aa`,null,ge,{held:!!U(f)}),A=Z(k,``,A,{bottom:`${U(o)/n*100}%`}),ve=X(_e,1,`mono dbv svelte-4q66aa`,null,ve,{act:U(l)?.key===`v`+U(t).id}),q(ye,c),Se=X(xe,1,`ms svelte-4q66aa`,null,Se,{mute:U(i)?.[3]}),Q(xe,`aria-pressed`,!!U(i)?.[3]),Q(xe,`aria-label`,`Mute ${U(t).name??``}`),we=X(Ce,1,`ms svelte-4q66aa`,null,we,{solo:U(i)?.[4]}),Q(Ce,`aria-pressed`,!!U(i)?.[4]),Q(Ce,`aria-label`,`Solo ${U(t).name??``}`)},[()=>U(p)?`${U(t).name}: ${U(a).has(U(t).id)?`fold`:`unfold`}`:U(t).name,()=>v(U(u)),()=>v(U(u)),()=>_(U(o)),()=>_(U(o))]),W(`click`,x,()=>U(p)&&g(U(t))),W(`pointerdown`,D,e=>d(e,`p`+U(t).id,U(t).id,`pan`,U(u))),W(`pointerdown`,me,e=>d(e,`v`+U(t).id,U(t).id,`vol`,U(o))),W(`click`,xe,()=>h(`mute`,U(t),!U(i)?.[3])),W(`click`,Ce,()=>h(`solo`,U(t),!U(i)?.[4])),K(e,m)}),j(S);var C=z(S,4),w=z(L(C),2),T=L(w),ee=e=>{var t=Ka(),n=R(t);B(()=>q(n,`${U(b)?.[3]??``} has it`)),K(e,t)},E=N(()=>y(U(b)));J(T,e=>{U(E)&&e(ee)});var D=z(T,2),te=L(D),ne=L(te);let re;j(te);var ie=z(te),ae=L(ie);let oe;j(ie),j(D);var se=z(D,2),ce=z(L(se),2),le=L(ce);let ue;j(ce),j(se),j(w);var de=R(z(w,2),!0);j(C),j(x),B(e=>{X(x,1,`mixer ${t.form??``}`,`svelte-4q66aa`),re=Z(ne,``,re,{height:`${(U(b)?.[1]??0)*100}%`}),oe=Z(ae,``,oe,{height:`${(U(b)?.[2]??0)*100}%`}),Q(se,`aria-valuenow`,c.m??U(b)?.[0]??1),ue=Z(le,``,ue,{bottom:`${(c.m??U(b)?.[0]??1)/n*100}%`}),q(de,e)},[()=>_(c.m??U(b)?.[0]??1)]),W(`pointermove`,x,p),W(`pointerup`,x,m),mr(`pointercancel`,x,m),W(`pointerdown`,se,e=>d(e,`m`,0,`mvol`,c.m??U(b)?.[0]??1)),K(e,x),ze()}hr([`pointermove`,`pointerup`,`click`,`pointerdown`]);var Za=G(`<span class="mono pos svelte-1x69070"> </span>`),Qa=G(`<div class="empty svelte-1x69070"> </div>`),$a=G(`<span class="auto svelte-1x69070"></span>`),eo=wr(`<circle cx="26" cy="26" r="21" class="arc svelte-1x69070" transform="rotate(135 26 26)"></circle>`),to=wr(`<line x1="26" y1="26" x2="26" y2="14" class="ptr svelte-1x69070"></line>`),no=G(`<div role="slider" tabindex="0"><!> <svg viewBox="0 0 52 52"><circle cx="26" cy="26" r="21" class="trk svelte-1x69070" transform="rotate(135 26 26)"></circle><!><circle cx="26" cy="26" r="14" class="capc svelte-1x69070"></circle><!></svg> <span class="kn svelte-1x69070"> </span> <span class="mono kv svelte-1x69070"> </span></div>`),ro=G(`<div class="grid svelte-1x69070"></div>`),io=G(`<div class="macros svelte-1x69070" role="group" aria-label="Macros"><button class="dev svelte-1x69070"><span class="caps svelte-1x69070">Device</span> <span class="dn svelte-1x69070"> </span> <!> <svg width="10" height="10" viewBox="0 0 10 10"><path d="M2 3.5 L5 6.5 L8 3.5" class="svelte-1x69070"></path></svg></button> <!></div>`);function ao(e,t){Re(t,!0);let n=N(()=>t.form===`phone`?2:4),r=N(()=>t.form===`phone`?64:t.form===`phoneLand`?52:112),i=N(()=>$.mac?.id===$.proj?.you?$.mac:null),a=N(()=>U(i)?.devs[U(i).di]??`No devices`),o=Ht({}),s=Ht({}),c=null,l=F(-1),u=0;function d(e,t,n){if(!$.canControl)return $.showToast(`Nota lets this phone play notes only.`);U(i)&&(e.currentTarget.setPointerCapture(e.pointerId),c={i:t,y:e.clientY,v:n},I(l,t,!0),o[t]=n,$.send({t:`mac`,i:t,v:n,ph:1}))}function f(e){if(!c)return;let t=Math.min(1,Math.max(0,c.v+(c.y-e.clientY)/200));o[c.i]=t,U(i)?.k[c.i]?.map&&(s[c.i]=t);let n=performance.now();n-u>30&&(u=n,$.send({t:`mac`,i:c.i,v:t,ph:0}))}function p(){if(!c)return;let e=c.i;$.send({t:`mac`,i:e,v:o[e],ph:2}),c=null,I(l,-1),setTimeout(()=>{U(l)!==e&&delete o[e]},500)}var m=io(),h=L(m),g=z(L(h),2),_=R(g,!0),v=z(g,2),y=e=>{var t=Za(),n=R(t);B(()=>q(n,`${U(i).di+1}/${U(i).devs.length??``}`)),K(e,t)};J(v,e=>{U(i)&&U(i).devs.length>1&&e(y)}),ye(2),j(h);var b=z(h,2),x=e=>{var t=Qa(),n=R(t,!0);B(()=>q(n,U(i)?`This track has no instrument or effects to control.`:`Loading…`)),K(e,t)},S=e=>{var t=ro();let a;Y(t,21,()=>U(i).k,Fr,(e,t,n)=>{let i=N(()=>o[n]??(U(t).map?s[n]??.5:U(t).v??0)),a=N(()=>U(l)===n),c=N(()=>U(t).n===void 0&&!U(t).map);var u=no();let f;var p=L(u),m=e=>{K(e,$a())};J(p,e=>{U(t).a&&!U(t).map&&e(m)});var h=z(p,2),g=L(h);Q(g,`stroke-dasharray`,`98.9 131.9`);var _=z(g),v=e=>{var t=eo();B(()=>Q(t,`stroke-dasharray`,`${U(i)*98.9} 131.9`)),K(e,t)};J(_,e=>{U(c)||e(v)});var y=z(_,2),b=e=>{var t=to();B(()=>Q(t,`transform`,`rotate(${-135+270*U(i)} 26 26)`)),K(e,t)};J(y,e=>{U(c)||e(b)}),j(h);var x=z(h,2),S=R(x,!0),C=R(z(x,2),!0);j(u),B((e,i,o,s)=>{f=X(u,1,`knob svelte-1x69070`,null,f,{on:U(a),empty:U(c),learnable:$.learn.on&&!U(c)}),Q(u,`aria-label`,U(t).map??U(t).n??`Macro ${n+1}`),Q(u,`aria-valuenow`,e),Q(u,`aria-valuetext`,i),Q(h,`width`,U(r)),Q(h,`height`,U(r)),q(S,o),q(C,s)},[()=>Math.round(U(i)*100),()=>U(t).map?`${Math.round(U(i)*100)} %`:U(t).txt,()=>(U(t).map??U(t).n??`Macro ${n+1}`).toUpperCase(),()=>U(c)?`—`:U(t).map||U(a)?`${Math.round(U(i)*100)} %`:U(t).txt]),W(`pointerdown`,u,e=>!U(c)&&d(e,n,U(i))),K(e,u)}),j(t),B(()=>a=Z(t,``,a,{"grid-template-columns":`repeat(${U(n)??``}, minmax(0, 1fr))`})),K(e,t)};J(b,e=>{!U(i)||U(i).devs.length===0?e(x):e(S,-1)}),j(m),B(()=>q(_,U(a))),W(`pointermove`,m,f),W(`pointerup`,m,p),mr(`pointercancel`,m,p),W(`click`,h,()=>U(i)&&U(i).devs.length>1&&($.sheet=`devices`)),K(e,m),ze()}hr([`pointermove`,`pointerup`,`click`,`pointerdown`]);var oo=G(`<div class="empty svelte-he2l50">Loading…</div>`),so=G(`<div class="th svelte-he2l50"><span class="svelte-he2l50"></span><b class="svelte-he2l50"> </b></div>`),co=G(`<div class="clip empty svelte-he2l50"></div>`),lo=G(`<span class="ptri svelte-he2l50"></span>`),uo=G(`<span class="prog svelte-he2l50"></span>`),fo=G(`<button><span class="cn svelte-he2l50"><!> </span> <span class="mono cs svelte-he2l50"> </span> <!></button>`),po=G(`<button class="scene svelte-he2l50"><span class="tri svelte-he2l50"></span> </button> <!>`,1),mo=G(`<button class="stop svelte-he2l50"><span class="sq svelte-he2l50"></span>Stop</button>`),ho=G(`<div class="grid svelte-he2l50"><div class="caps corner svelte-he2l50">Scene</div> <!> <!> <button class="stopall svelte-he2l50"><span class="sq svelte-he2l50"></span>All</button> <!></div>`),go=G(`<div class="scroll svelte-he2l50"><!></div>`);function _o(e,t){Re(t,!0);let n=N(()=>$.ses),r=N(()=>new Map(($.proj?.tracks??[]).map(e=>[e.id,e]))),i=N(()=>U(n)?.tr??[]),a=N(()=>t.form===`phone`?96:t.form===`phoneLand`?104:132),o=N(()=>t.form===`phone`?58:t.form===`phoneLand`?50:84),s=e=>{let t=e/4;return t===Math.round(t)?`${t} bar${t===1?``:`s`}`:`${e} beats`};function c(){return $.canControl?!0:($.showToast(`Nota lets this phone play notes only.`),!1)}var l=go(),u=L(l),d=e=>{K(e,oo())},f=e=>{var l=ho();let u;var d=z(L(l),2);Y(d,17,()=>U(i),e=>e.id,(e,t)=>{let n=N(()=>U(r).get(U(t).id));var i=so(),a=L(i);let o;var s=R(z(a),!0);j(i),B(()=>{o=Z(a,``,o,{background:U(n)?.color}),q(s,U(n)?.name??``)}),K(e,i)});var f=z(d,2);Y(f,16,()=>Array.from({length:U(n).n},(e,t)=>t),e=>e,(e,t)=>{var n=po(),a=Zt(n);let l;var u=z(L(a));j(a),Y(z(a,2),17,()=>U(i),e=>e.id,(e,n)=>{let i=N(()=>U(r).get(U(n).id)),a=N(()=>{let[e,r,i]=U(n).c[t]??[0,0,0];return{st:e,len:r,prog:i}});var l=Tr(),u=Zt(l),d=e=>{var t=co();let n;B(()=>n=Z(t,``,n,{height:`${U(o)??``}px`})),K(e,t)},f=e=>{var r=fo();let l,u;var d=L(r),f=L(d),p=e=>{K(e,lo())};J(f,e=>{U(a).st===3&&e(p)});var m=z(f,1,!0);j(d);var h=z(d,2),g=R(h,!0),_=z(h,2),v=e=>{var t=uo();let n;B(()=>n=Z(t,``,n,{width:`${U(a).prog*100}%`})),K(e,t)};J(_,e=>{U(a).st===3&&e(v)}),j(r),B(e=>{l=X(r,1,`clip svelte-he2l50`,null,l,{playing:U(a).st===3,queued:U(a).st===2,rec:U(a).st===4}),Q(r,`aria-label`,`${U(i)?.name??``} scene ${t+1}: ${U(a).st===3?`playing`:U(a).st===2?`queued`:U(a).st===4?`recording`:`stopped`}`),u=Z(r,``,u,{height:`${U(o)??``}px`,"--tc":U(i)?.color}),q(m,e),q(g,U(a).st===3?`PLAYING`:U(a).st===2?`QUEUED`:U(a).st===4?`RECORDING`:``)},[()=>s(U(a).len)]),W(`click`,r,()=>c()&&$.send({t:`launch`,id:U(n).id,i:t})),K(e,r)};J(u,e=>{U(a).st===0?e(d):e(f,-1)}),K(e,l)}),B(()=>{Q(a,`aria-label`,`Launch scene ${t+1}`),l=Z(a,``,l,{height:`${U(o)??``}px`}),q(u,`Scene ${t+1}`)}),W(`click`,a,()=>c()&&$.send({t:`scene`,i:t})),K(e,n)});var p=z(f,2);Y(z(p,2),17,()=>U(i),e=>e.id,(e,t)=>{var n=mo();B(e=>Q(n,`aria-label`,`Stop ${e??``}`),[()=>U(r).get(U(t).id)?.name]),W(`click`,n,()=>c()&&$.send({t:`stopSlot`,id:U(t).id})),K(e,n)}),j(l),B(()=>u=Z(l,``,u,{"grid-template-columns":`${t.form===`phone`?92:110}px repeat(${U(i).length??``}, minmax(${U(a)??``}px, 1fr))`})),W(`click`,p,()=>c()&&$.send({t:`stopAll`})),K(e,l)};J(u,e=>{U(n)?e(f,-1):e(d)}),j(l),K(e,l),ze()}hr([`click`]),Ie();var vo=pi(()=>$),yo=G(`<div class="empty svelte-i7n35i"><span class="t svelte-i7n35i"> </span> <span class="s svelte-i7n35i">There is no instrument to play. Pick an instrument track, or use the transport to record.</span> <button class="btn svelte-i7n35i">Choose another track</button></div>`);function bo(e,t){Re(t,!1),di();var n=yo(),r=L(n),i=R(r),a=z(r,4);j(n),B(()=>q(i,`${vo().track?.name??`This track`??``} is an audio track`)),W(`click`,a,()=>vo(vo().sheet=`tracks`)),K(e,n),ze()}hr([`click`]);var xo=G(`<button> </button>`),So=G(`<nav class="rail svelte-1n46o8q" aria-label="Screens"></nav>`),Co=G(`<nav class="tabs svelte-1n46o8q" aria-label="Screens"><div class="seg svelte-1n46o8q"></div></nav>`),wo=G(`<div><!> <!> <div class="body svelte-1n46o8q"><!> <main><!> <!></main></div> <!> <!> <!></div>`);function To(e,t){Re(t,!0);let n=N(()=>vi.form),r=N(()=>U(n)!==`phone`),i=N(()=>$.track),a=N(()=>U(i)?.kind===`audio`&&($.screen===`Pads`||$.screen===`Keys`)),o=N(()=>$.link===`lost`||$.link===`connecting`);un(()=>{document.documentElement.dataset.theme=$.dark?`dark`:`light`,document.querySelector(`meta[name=theme-color]`)?.setAttribute(`content`,$.dark?`#0B0A09`:`#DCD6C5`)});var s=wo(),c=L(s);Ni(c,{get form(){return U(n)}});var l=z(c,2);Fi(l,{});var u=z(l,2),d=L(u),f=e=>{var t=So();Y(t,21,()=>Oi,Fr,(e,t)=>{var n=xo();let r;var i=R(n,!0);B(()=>{r=X(n,1,`svelte-1n46o8q`,null,r,{on:$.screen===U(t)&&!$.bigTransport}),q(i,U(t))}),W(`click`,n,()=>$.setScreen(U(t))),K(e,n)}),j(t),K(e,t)};J(d,e=>{U(r)&&e(f)});var p=z(d,2);let m;var h=L(p),g=e=>{bo(e,{})},_=e=>{Sa(e,{get form(){return U(n)}})},v=e=>{La(e,{get form(){return U(n)}})},y=e=>{Wa(e,{get form(){return U(n)}})},b=e=>{Xa(e,{get form(){return U(n)}})},x=e=>{ao(e,{get form(){return U(n)}})},S=e=>{_o(e,{get form(){return U(n)}})};J(h,e=>{U(a)?e(g):$.screen===`Pads`?e(_,1):$.screen===`Keys`?e(v,2):$.screen===`XY`?e(y,3):$.screen===`Mixer`?e(b,4):$.screen===`Macros`?e(x,5):e(S,-1)});var C=z(h,2),w=e=>{va(e,{get form(){return U(n)}})};J(C,e=>{$.bigTransport&&e(w)}),j(p),j(u);var T=z(u,2),ee=e=>{var t=Co(),n=L(t);Y(n,21,()=>Oi,Fr,(e,t)=>{var n=xo();let r;var i=R(n,!0);B(()=>{r=X(n,1,`svelte-1n46o8q`,null,r,{on:$.screen===U(t)&&!$.bigTransport}),q(i,U(t))}),W(`click`,n,()=>$.setScreen(U(t))),K(e,n)}),j(n),j(t),K(e,t)};J(T,e=>{U(r)||e(ee)});var E=z(T,2);ia(E,{get form(){return U(n)}}),ma(z(E,2),{get form(){return U(n)}}),j(s),B(()=>{X(s,1,`shell ${U(n)??``}`,`svelte-1n46o8q`),Q(p,`aria-busy`,U(o)),m=X(p,1,`svelte-1n46o8q`,null,m,{dim:U(o)})}),mr(`pointerdown`,s,function(...e){wi?.apply(this,e)},!0),K(e,s),ze()}hr([`click`]);for(let e of[`gesturestart`,`gesturechange`,`contextmenu`,`dblclick`])document.addEventListener(e,e=>e.preventDefault(),{passive:!1});document.addEventListener(`touchmove`,e=>{e.touches.length>1&&e.preventDefault()},{passive:!1}),document.addEventListener(`visibilitychange`,()=>{document.visibilityState===`visible`?$.wake():$.releaseHeld()}),window.addEventListener(`online`,()=>$.wake()),`serviceWorker`in navigator&&window.isSecureContext&&navigator.serviceWorker.register(`./sw.js`).catch(()=>{}),Ar(To,{target:document.getElementById(`app`)}),$.connect();\ No newline at end of filediff --git a/src/managed/Nota.Remote/wwwroot/assets/index-HyP_ksps.css b/src/managed/Nota.Remote/wwwroot/assets/index-HyP_ksps.cssdeleted file mode 100644index 6dad28e3..00000000--- a/src/managed/Nota.Remote/wwwroot/assets/index-HyP_ksps.css+++ /dev/null@@ -1 +0,0 @@-@font-face{font-family:Geist;font-weight:400;font-display:swap;src:url(../fonts/Geist-Regular.woff2)format("woff2")}@font-face{font-family:Geist;font-weight:500 700;font-display:swap;src:url(../fonts/Geist-SemiBold.woff2)format("woff2")}@font-face{font-family:Geist Mono;font-weight:400 700;font-display:swap;src:url(../fonts/GeistMono-Medium.woff2)format("woff2")}:root,[data-theme=dark]{--abyss:#0a0908;--app:#0b0a09;--gutter:#0c0b09;--well:#100f0d;--panel:#141310;--card:#171613;--raised:#1c1a16;--hover:#252219;--track-off:#26231e;--selected:#241f17;--hairline:#221f1a;--border:#2c2923;--border-strong:#3a362d;--border-brass:#6b5326;--grid:#1e1c18;--ink0:#f2ede1;--ink1:#e9e4d8;--ink2:#c7c0b0;--ink3:#a39d8f;--ink4:#8d8779;--ink5:#6e6a5e;--ink6:#55514a;--on-accent:#171613;--accent:#d8a03d;--accent-bright:#f0c060;--accent-dim:#8a6b2e;--accent-edge:#5e4a22;--accent-wash:#241f17;--record:#c25b44;--record-wash:#2a1a16;--record-ink:#e08a72;--danger:#c2554a;--danger-bright:#e08a72;--warning:#d9c34c;--success:#58b368;--success-dim:#7fb069;--steel:#6d8fb5;--white-key:#d9d3c5;--white-key-ink:#55514a;--scrim:#0a090899;--lightningcss-light: ;--lightningcss-dark:initial;color-scheme:dark}[data-theme=light]{--abyss:#d8d1be;--app:#dcd6c5;--gutter:#e0dac9;--well:#e4dfd1;--panel:#eae5d7;--card:#efeade;--raised:#f8f5ec;--hover:#e7e1d0;--track-off:#dbd4c0;--selected:#f2e4c4;--hairline:#d5cfbe;--border:#d5cebb;--border-strong:#bdb5a0;--border-brass:#c9a254;--grid:#ded8c8;--ink0:#1a150e;--ink1:#241f17;--ink2:#3e382c;--ink3:#5e5849;--ink4:#746d5c;--ink5:#8a8474;--ink6:#9e9786;--on-accent:#fffbf2;--accent:#a87415;--accent-bright:#744d07;--accent-dim:#9c8034;--accent-edge:#d3b173;--accent-wash:#f2e4c4;--record:#b54a32;--record-wash:#f3ddd4;--record-ink:#a3391b;--danger:#b13e33;--danger-bright:#a3391b;--warning:#837010;--success:#2c7a3e;--success-dim:#609548;--steel:#3e6288;--white-key:#fbf9f3;--white-key-ink:#8a8474;--scrim:#241f1759;--lightningcss-light:initial;--lightningcss-dark: ;color-scheme:light}*{box-sizing:border-box;margin:0;padding:0}html,body{background:var(--app);height:100%;color:var(--ink1);-webkit-text-size-adjust:100%;-webkit-tap-highlight-color:transparent;-webkit-user-select:none;user-select:none;-webkit-touch-callout:none;overscroll-behavior:none;touch-action:none;font-family:Geist,system-ui,-apple-system,sans-serif;font-size:13px;overflow:hidden}body,#app{position:fixed;inset:0}button{font:inherit;color:inherit;cursor:pointer;touch-action:manipulation;background:0 0;border:none}input{font:inherit;color:inherit;-webkit-user-select:text;user-select:text;touch-action:manipulation}.mono{font-variant-numeric:tabular-nums;font-family:Geist Mono,ui-monospace,monospace}.caps{letter-spacing:.14em;color:var(--ink5);text-transform:uppercase;font-size:10px;font-weight:700}.sr{clip:rect(0 0 0 0);width:1px;height:1px;position:absolute;overflow:hidden}.btn{background:var(--raised);border:1px solid var(--border);height:42px;color:var(--ink2);border-radius:5px;justify-content:center;align-items:center;gap:7px;padding:0 12px;font-size:12px;font-weight:600;transition:background-color .12s ease-out,border-color .12s ease-out,color .12s ease-out;display:inline-flex}.btn.on{background:var(--accent-wash);border-color:var(--border-brass);color:var(--accent-bright)}.seg{background:var(--well);border:1px solid var(--hairline);border-radius:6px;gap:2px;padding:3px;display:flex}.seg>button{height:36px;color:var(--ink4);border-radius:4px;flex:1;padding:0 11px;font-size:12px;font-weight:600;transition:background-color .12s ease-out,color .12s ease-out}.seg>button.on{background:var(--raised);color:var(--ink1)}.switch{background:var(--track-off);border-radius:5px;flex:none;width:18px;height:10px;display:block;position:relative}.switch:after{content:"";background:var(--ink5);border-radius:50%;width:7px;height:7px;transition:left .12s ease-out;position:absolute;top:1.5px;left:1.5px}.switch.on{background:var(--accent)}.switch.on:after{background:var(--on-accent);left:9.5px}.learnable{outline:1px dashed var(--accent-dim);outline-offset:2px}header.svelte-oiwvqb{border-bottom:1px solid var(--hairline);background:var(--app);z-index:6;flex-wrap:wrap;flex:none;align-items:center;gap:8px 10px;padding:6px 10px 10px;display:flex;position:relative}header.phoneLand.svelte-oiwvqb{flex-wrap:nowrap;padding:6px 10px}header.tablet.svelte-oiwvqb{flex-wrap:nowrap;padding:10px 16px}svg.svelte-oiwvqb path:where(.svelte-oiwvqb){fill:none;stroke:var(--ink4);stroke-width:1.6px;stroke-linecap:round;stroke-linejoin:round}.picker.svelte-oiwvqb{flex:1;order:1;align-items:center;gap:4px;min-width:0;display:flex}.step.svelte-oiwvqb{border-radius:5px;flex:none;justify-content:center;align-items:center;width:36px;height:44px;display:flex}.track.svelte-oiwvqb{background:var(--panel);border:1px solid var(--border);text-align:left;border-radius:6px;flex:1;align-items:center;gap:10px;min-width:0;height:44px;padding:0 10px;display:flex}.bar.svelte-oiwvqb{border-radius:2px;flex:none;width:4px;height:24px}.names.svelte-oiwvqb{flex-direction:column;flex:1;gap:1px;min-width:0;display:flex}.name.svelte-oiwvqb{color:var(--ink1);white-space:nowrap;text-overflow:ellipsis;font-size:14px;font-weight:600;overflow:hidden}.sub.svelte-oiwvqb{color:var(--ink5);white-space:nowrap;text-overflow:ellipsis;font-size:10px;overflow:hidden}.transport.svelte-oiwvqb{flex-basis:100%;order:3;align-items:center;gap:6px;display:flex}.phoneLand.svelte-oiwvqb .transport:where(.svelte-oiwvqb){flex:0 0 330px;order:2}.tablet.svelte-oiwvqb .transport:where(.svelte-oiwvqb){flex:0 0 460px;order:2}.tbtn.svelte-oiwvqb{background:var(--raised);border:1px solid var(--border);border-radius:5px;flex:none;justify-content:center;align-items:center;width:44px;height:40px;transition:background-color .12s ease-out,border-color .12s ease-out;display:flex}.tbtn.play.svelte-oiwvqb{width:54px}.fs.svelte-oiwvqb svg:where(.svelte-oiwvqb) path:where(.svelte-oiwvqb){stroke:var(--ink3)}.sq.svelte-oiwvqb{background:var(--ink2);border-radius:1px;width:11px;height:11px}.tri.svelte-oiwvqb{border-left:12px solid var(--ink2);border-top:7px solid #0000;border-bottom:7px solid #0000;width:0;height:0;margin-left:3px}.play.on.svelte-oiwvqb{background:var(--accent);border-color:var(--accent)}.play.on.svelte-oiwvqb .tri:where(.svelte-oiwvqb){border-left-color:var(--on-accent)}.dot.svelte-oiwvqb{background:var(--ink4);border-radius:50%;width:12px;height:12px}.rec.on.svelte-oiwvqb,.rec.count.svelte-oiwvqb{background:var(--record-wash);border-color:var(--record)}.rec.on.svelte-oiwvqb .dot:where(.svelte-oiwvqb),.rec.count.svelte-oiwvqb .dot:where(.svelte-oiwvqb){background:var(--record)}.pos.svelte-oiwvqb{background:var(--well);border:1px solid var(--border);border-radius:5px;flex:1;align-items:center;gap:10px;min-width:0;height:40px;padding:0 10px;display:flex;box-shadow:inset 0 1px #00000080}.pos.open.svelte-oiwvqb{border-color:var(--border-brass)}.pos.open.svelte-oiwvqb svg:where(.svelte-oiwvqb){transform:rotate(180deg)}.pos.svelte-oiwvqb svg:where(.svelte-oiwvqb){margin-left:auto}.p.svelte-oiwvqb{color:var(--ink1);font-size:16px;font-weight:500}.bpm.svelte-oiwvqb{color:var(--ink4);font-size:11px}.status.svelte-oiwvqb{order:2;align-items:center;gap:4px;display:flex}.phoneLand.svelte-oiwvqb .status:where(.svelte-oiwvqb),.tablet.svelte-oiwvqb .status:where(.svelte-oiwvqb){order:3}.link.svelte-oiwvqb{border-radius:5px;align-items:center;gap:6px;height:44px;padding:0 8px;display:flex}.link.svelte-oiwvqb .mono:where(.svelte-oiwvqb){white-space:nowrap;font-size:10px}.ldot.svelte-oiwvqb{border-radius:50%;width:7px;height:7px}.blink.svelte-oiwvqb{animation:.8s step-end infinite svelte-oiwvqb-blink}@keyframes svelte-oiwvqb-blink{50%{opacity:.35}}.menu.svelte-oiwvqb{border-radius:5px;justify-content:center;align-items:center;gap:3px;width:44px;height:44px;display:flex}.menu.open.svelte-oiwvqb{background:var(--raised)}.menu.svelte-oiwvqb span:where(.svelte-oiwvqb){background:var(--ink3);border-radius:50%;width:4px;height:4px}.banner.svelte-4gizvm{border-bottom:1px solid var(--border-brass);background:var(--accent-wash);flex:none;align-items:center;gap:10px;padding:9px 16px;display:flex}.banner.quiet.svelte-4gizvm{background:var(--panel);border-color:var(--border)}.dot.svelte-4gizvm{background:var(--accent);border-radius:50%;flex:none;width:8px;height:8px}.quiet.svelte-4gizvm .dot:where(.svelte-4gizvm){background:var(--ink4)}.blink.svelte-4gizvm{animation:.8s step-end infinite svelte-4gizvm-blink}@keyframes svelte-4gizvm-blink{50%{opacity:.35}}.t.svelte-4gizvm{color:var(--accent-bright);font-size:12px;font-weight:600}.quiet.svelte-4gizvm .t:where(.svelte-4gizvm){color:var(--ink1)}.s.svelte-4gizvm{color:var(--ink3);font-size:11px}.scrim.svelte-tyq0v8{z-index:20;background:var(--scrim);position:absolute;inset:0}.sheet.svelte-tyq0v8{z-index:21;left:12px;top:calc(env(safe-area-inset-top) + 64px);background:var(--panel);border:1px solid var(--border-strong);border-radius:8px;flex-direction:column;width:360px;max-width:calc(100% - 24px);max-height:calc(100% - 88px);display:flex;position:absolute;overflow:hidden}.sheet.bottom.svelte-tyq0v8{width:auto;top:auto;right:12px;bottom:max(24px, env(safe-area-inset-bottom));max-height:75%}.sheet.menu.svelte-tyq0v8{width:300px;left:auto;right:12px}.head.svelte-tyq0v8{padding:14px 16px 8px}.list.svelte-tyq0v8{touch-action:pan-y;overscroll-behavior:contain;overflow-y:auto}.row.svelte-tyq0v8{border-top:1px solid var(--hairline);text-align:left;align-items:center;gap:12px;width:100%;height:52px;padding:0 16px;display:flex;position:relative}.row.slim.svelte-tyq0v8{border:none;height:44px;padding:0}.row.on.svelte-tyq0v8{background:var(--accent-wash)}.row.on.svelte-tyq0v8:before{content:"";background:var(--accent);width:2px;position:absolute;top:10px;bottom:10px;left:0}.row.slim.on.svelte-tyq0v8:before{display:none}.bar.svelte-tyq0v8{border-radius:2px;flex:none;width:4px;height:22px}.names.svelte-tyq0v8{flex-direction:column;flex:1;gap:1px;min-width:0;display:flex}.n.svelte-tyq0v8{color:var(--ink1);white-space:nowrap;text-overflow:ellipsis;font-size:13px;font-weight:600;overflow:hidden}.d.svelte-tyq0v8{color:var(--ink5);font-size:10px}.who.svelte-tyq0v8{background:var(--track-off);height:20px;color:var(--ink2);border-radius:10px;align-items:center;padding:0 8px;font-size:10px;font-weight:600;display:flex}.empty.svelte-tyq0v8{color:var(--ink5);padding:16px;font-size:12px}.toggle.svelte-tyq0v8{border-top:1px solid var(--border);text-align:left;align-items:center;gap:10px;width:100%;min-height:52px;padding:0 16px;display:flex}.n2.svelte-tyq0v8{color:var(--ink1);font-size:12px;display:block}.d2.svelte-tyq0v8{color:var(--ink5);font-size:10px;display:block}.block.svelte-tyq0v8{flex-direction:column;gap:8px;padding:14px 16px;display:flex}.field.svelte-tyq0v8{background:var(--well);border:1px solid var(--border);border-radius:4px;outline:none;height:40px;padding:0 12px;font-size:13px;box-shadow:inset 0 1px #00000080}.field.svelte-tyq0v8:focus{border-color:var(--border-brass)}.tonics.svelte-tyq0v8{grid-template-columns:repeat(6,1fr);gap:6px;display:grid}.tonics.svelte-tyq0v8 .btn:where(.svelte-tyq0v8){height:44px;padding:0}.disconnect.svelte-tyq0v8{border-top:1px solid var(--border);height:52px;color:var(--danger-bright);text-align:left;padding:0 16px;font-size:13px;font-weight:600}.cover.svelte-17f2qxr{z-index:40;background:var(--app);padding:28px;padding-top:calc(env(safe-area-inset-top) + 28px);flex-direction:column;justify-content:center;gap:18px;display:flex;position:absolute;inset:0}h1.svelte-17f2qxr{color:var(--ink0);font-size:22px;font-weight:600}p.svelte-17f2qxr{color:var(--ink3);max-width:420px;font-size:13px;line-height:1.6}ol.svelte-17f2qxr{border:1px solid var(--border);border-radius:6px;max-width:420px;list-style:none;overflow:hidden}li.svelte-17f2qxr{background:var(--panel);color:var(--ink2);gap:12px;padding:12px 14px;font-size:12px;line-height:1.5;display:flex}li.svelte-17f2qxr+li:where(.svelte-17f2qxr){border-top:1px solid var(--hairline)}li.svelte-17f2qxr .mono:where(.svelte-17f2qxr){color:var(--accent-dim);font-size:11px}.retry.svelte-17f2qxr{color:var(--ink4);align-items:center;gap:10px;font-size:12px;display:flex}.dot.svelte-17f2qxr{background:var(--ink5);border-radius:50%;width:7px;height:7px}.blink.svelte-17f2qxr{animation:.8s step-end infinite svelte-17f2qxr-blink}@keyframes svelte-17f2qxr-blink{50%{opacity:.35}}.code.svelte-17f2qxr{grid-template-columns:repeat(4,64px);gap:10px;display:grid;position:relative}.code.svelte-17f2qxr input:where(.svelte-17f2qxr){opacity:0;font-size:16px;position:absolute;inset:0}.cell.svelte-17f2qxr{background:var(--well);border:1px solid var(--hairline);pointer-events:none;border-radius:6px;justify-content:center;align-items:center;height:68px;display:flex;box-shadow:inset 0 1px #00000080}.cell.cur.svelte-17f2qxr{border-color:var(--border-brass)}.cell.svelte-17f2qxr .mono:where(.svelte-17f2qxr){color:var(--ink0);font-size:28px}.caret.svelte-17f2qxr{background:var(--accent);width:2px;height:28px;animation:1s step-end infinite svelte-17f2qxr-blink}.big.svelte-17f2qxr{align-self:flex-start;height:48px;padding:0 20px;font-size:13px}.count.svelte-17f2qxr{z-index:35;background:var(--app);flex-direction:column;justify-content:center;align-items:center;gap:12px;display:flex;position:absolute;inset:0}.num.svelte-17f2qxr{color:var(--accent-bright);font-size:200px;font-weight:500;line-height:1}.num.phoneLand.svelte-17f2qxr{font-size:150px}.num.tablet.svelte-17f2qxr{font-size:260px}.rec.svelte-17f2qxr{color:var(--record);font-size:12px}.toast.svelte-17f2qxr{z-index:50;background:var(--raised);border:1px solid var(--border-strong);max-width:86%;color:var(--ink1);text-align:center;border-radius:6px;padding:10px 14px;font-size:12px;line-height:1.45;position:absolute;bottom:24px;left:50%;transform:translate(-50%)}.toast.low.svelte-17f2qxr{bottom:calc(env(safe-area-inset-bottom) + 84px)}.big.svelte-1hrivqy{z-index:4;background:var(--app);flex-direction:column;gap:14px;padding:12px;display:flex;position:absolute;inset:0}.phoneLand.big.svelte-1hrivqy{gap:10px;padding:8px 10px}.tablet.big.svelte-1hrivqy{padding:18px}.top.svelte-1hrivqy{justify-content:space-between;align-items:flex-end;gap:12px;display:flex}.pblock.svelte-1hrivqy{flex-direction:column;gap:4px;display:flex}.pos.svelte-1hrivqy{color:var(--ink1);font-size:52px;font-weight:500;line-height:1}.phoneLand.svelte-1hrivqy .pos:where(.svelte-1hrivqy){font-size:40px}.tablet.svelte-1hrivqy .pos:where(.svelte-1hrivqy){font-size:88px}.pos.rec.svelte-1hrivqy{color:var(--record-ink)}.tap.svelte-1hrivqy{background:var(--raised);border:1px solid var(--border);border-radius:6px;flex-direction:column;justify-content:center;align-items:center;gap:2px;height:56px;padding:0 16px;display:flex}.tap.svelte-1hrivqy .mono:where(.svelte-1hrivqy){color:var(--ink1);font-size:18px;font-weight:500}.tap.svelte-1hrivqy .caps:where(.svelte-1hrivqy){letter-spacing:.1em;font-size:9px}.btns.svelte-1hrivqy{flex:1;grid-auto-rows:minmax(0,1fr);gap:8px;min-height:0;display:grid}.b.svelte-1hrivqy{background:var(--raised);border:1px solid var(--border);min-height:0;color:var(--ink2);border-radius:8px;flex-direction:column;justify-content:center;align-items:center;gap:10px;font-size:14px;font-weight:600;display:flex}.b.svelte-1hrivqy svg:where(.svelte-1hrivqy) path:where(.svelte-1hrivqy){fill:none;stroke:currentColor;stroke-width:2.2px;stroke-linecap:round;stroke-linejoin:round}.b.on.svelte-1hrivqy{background:var(--accent-wash);border-color:var(--border-brass);color:var(--accent-bright)}.b.dim.svelte-1hrivqy{color:var(--ink6)}.tri.svelte-1hrivqy{border-top:16px solid #0000;border-bottom:16px solid #0000;border-left:26px solid;width:0;height:0;margin-left:6px}.sq.svelte-1hrivqy{background:currentColor;border-radius:3px;width:26px;height:26px}.dot.svelte-1hrivqy{background:var(--record);border-radius:50%;width:28px;height:28px}.play.on.svelte-1hrivqy{background:var(--accent);border-color:var(--accent);color:var(--on-accent)}.recb.on.svelte-1hrivqy{background:var(--record-wash);border-color:var(--record);color:var(--record-ink)}.secs.svelte-1hrivqy{flex-direction:column;gap:6px;display:flex}.sgrid.svelte-1hrivqy{grid-template-columns:repeat(4,minmax(0,1fr));gap:6px;display:grid}.sec.svelte-1hrivqy{background:var(--panel);border:1px solid var(--border);border-radius:5px;flex-direction:column;justify-content:center;align-items:center;gap:2px;height:52px;display:flex}.sec.cur.svelte-1hrivqy{background:var(--raised);border-color:var(--border-strong)}.sec.looping.svelte-1hrivqy{background:var(--accent-wash);border-color:var(--border-brass)}.sn.svelte-1hrivqy{color:var(--ink1);white-space:nowrap;text-overflow:ellipsis;max-width:92%;font-size:13px;font-weight:600;overflow:hidden}.looping.svelte-1hrivqy .sn:where(.svelte-1hrivqy){color:var(--accent-bright)}.si.svelte-1hrivqy{color:var(--ink5);font-size:9px}.looping.svelte-1hrivqy .si:where(.svelte-1hrivqy){color:var(--accent)}.pads.svelte-1puq9zz{flex-direction:column;flex:1;gap:10px;min-height:0;display:flex}.bar.svelte-1puq9zz{flex-wrap:wrap;align-items:center;gap:8px;display:flex}.banks.svelte-1puq9zz button:where(.svelte-1puq9zz){flex:none;min-width:42px;font-size:11px;font-weight:500}.rep.svelte-1puq9zz{gap:8px;padding:0 6px 0 10px}.rate.svelte-1puq9zz{background:var(--well);height:30px;color:var(--ink3);border-radius:3px;align-items:center;padding:0 7px;font-size:11px;display:flex}.rep.on.svelte-1puq9zz .rate:where(.svelte-1puq9zz){color:var(--accent-bright)}.grid.svelte-1puq9zz{flex:1;grid-auto-rows:minmax(0,1fr);gap:8px;min-height:0;display:grid}.pad.svelte-1puq9zz{background:var(--raised);border:1px solid var(--border);text-align:left;touch-action:none;border-radius:6px;flex-direction:column;justify-content:space-between;align-items:stretch;min-width:0;min-height:0;padding:8px;display:flex;overflow:hidden;box-shadow:inset 0 1px #ffffff08}.num.svelte-1puq9zz,.note.svelte-1puq9zz{color:var(--ink5);font-size:10px}.note.svelte-1puq9zz{font-size:9px}.label.svelte-1puq9zz{flex-direction:column;gap:1px;min-width:0;display:flex}.name.svelte-1puq9zz{color:var(--ink1);white-space:nowrap;text-overflow:ellipsis;font-size:12px;font-weight:600;overflow:hidden}.tablet .name.svelte-1puq9zz{font-size:14px}.pad.playing.svelte-1puq9zz{background:var(--tc);border-color:var(--tc)}.pad.on.svelte-1puq9zz{background:var(--accent);border-color:var(--accent)}.pad.on.svelte-1puq9zz :where(.svelte-1puq9zz),.pad.playing.svelte-1puq9zz :where(.svelte-1puq9zz){color:var(--on-accent)}.pad.playing.svelte-1puq9zz :where(.svelte-1puq9zz){color:#171613}.keys.svelte-12d1dcp{flex-direction:column;flex:1;gap:10px;min-height:0;display:flex}.bar.svelte-12d1dcp{flex-wrap:wrap;align-items:center;gap:8px;display:flex}.modes.svelte-12d1dcp button:where(.svelte-12d1dcp){flex:none}.keybtn.svelte-12d1dcp{gap:7px;padding:0 10px}.expr.svelte-12d1dcp{padding:0 10px;font-size:12px;font-weight:600}.k.svelte-12d1dcp{letter-spacing:.1em;font-size:9px}.kn.svelte-12d1dcp{color:var(--ink1);font-size:12px;font-weight:600}.src.svelte-12d1dcp{color:var(--accent-dim);font-size:9px}.oct.svelte-12d1dcp{align-items:center;gap:2px;margin-left:auto;display:flex}.oct.svelte-12d1dcp .mono:where(.svelte-12d1dcp){text-align:center;width:46px;color:var(--ink1);font-size:12px}.sq.svelte-12d1dcp{width:42px;padding:0}.sq.svelte-12d1dcp path:where(.svelte-12d1dcp){stroke:var(--ink2);stroke-width:1.6px;stroke-linecap:round;fill:none}.surface.svelte-12d1dcp{touch-action:none;flex:1;min-height:0;display:flex}.kb.svelte-12d1dcp{flex:1;gap:3px;min-width:0;display:flex;position:relative}.white.svelte-12d1dcp{background:var(--white-key);border-radius:0 0 6px 6px;flex-direction:column;flex:1;justify-content:flex-end;align-items:center;min-width:0;padding-bottom:12px;display:flex;position:relative;overflow:hidden}.white.on.svelte-12d1dcp{background:var(--accent)}.lbl.svelte-12d1dcp{color:var(--white-key-ink);font-size:10px}.white.on.svelte-12d1dcp .lbl:where(.svelte-12d1dcp){color:var(--on-accent)}.black.svelte-12d1dcp{background:var(--raised);border:1px solid var(--border-strong);z-index:1;border-top:none;border-radius:0 0 5px 5px;height:58%;position:absolute;top:0;overflow:hidden}.black.on.svelte-12d1dcp{background:var(--accent);border-color:var(--accent)}.band.svelte-12d1dcp{background:var(--tc);height:5px;position:absolute;bottom:0;left:0;right:0}.grid.svelte-12d1dcp{flex:1;grid-auto-rows:minmax(0,1fr);gap:6px;min-width:0;display:grid}.cell.svelte-12d1dcp{background:var(--raised);border:1px solid var(--border);border-radius:5px;justify-content:center;align-items:center;min-height:0;display:flex}.cell.svelte-12d1dcp .mono:where(.svelte-12d1dcp){color:var(--ink3);pointer-events:none;font-size:12px}.cell.tonic.svelte-12d1dcp{background:var(--track-off);border-color:var(--border-strong)}.cell.tonic.svelte-12d1dcp .mono:where(.svelte-12d1dcp){color:var(--ink0);font-weight:600}.cell.lit.svelte-12d1dcp{border-color:var(--tc)}.cell.on.svelte-12d1dcp{background:var(--accent);border-color:var(--accent)}.cell.on.svelte-12d1dcp .mono:where(.svelte-12d1dcp){color:var(--on-accent)}.chords.svelte-12d1dcp{gap:8px}.chord.svelte-12d1dcp{background:var(--raised);border:1px solid var(--border);border-radius:6px;flex-direction:column;justify-content:center;align-items:center;gap:4px;min-height:0;display:flex}.chord.svelte-12d1dcp :where(.svelte-12d1dcp){pointer-events:none}.roman.svelte-12d1dcp{color:var(--accent-dim);font-size:12px}.cn.svelte-12d1dcp{color:var(--ink1);font-size:20px;font-weight:600}.chord.lit.svelte-12d1dcp{border-color:var(--tc)}.chord.on.svelte-12d1dcp{background:var(--accent);border-color:var(--accent)}.chord.on.svelte-12d1dcp .cn:where(.svelte-12d1dcp),.chord.on.svelte-12d1dcp .roman:where(.svelte-12d1dcp){color:var(--on-accent)}.hint.svelte-12d1dcp{color:var(--ink5);font-size:11px}.white.svelte-12d1dcp :where(.svelte-12d1dcp),.black.svelte-12d1dcp :where(.svelte-12d1dcp){pointer-events:none}.xy.svelte-19m1tsu{flex:1;gap:12px;min-height:0;display:flex}.xy.col.svelte-19m1tsu{flex-direction:column}.field.svelte-19m1tsu{background:var(--well);border:1px solid var(--hairline);touch-action:none;border-radius:6px;flex:1;min-width:0;min-height:0;position:relative;overflow:hidden;box-shadow:inset 0 1px #00000080}.gridlines.svelte-19m1tsu{background-image:linear-gradient(var(--grid) 1px, transparent 1px), linear-gradient(90deg, var(--grid) 1px, transparent 1px);background-position:-1px -1px;background-size:25% 25%;position:absolute;inset:0}.fill.svelte-19m1tsu{opacity:.08;position:absolute;bottom:0;left:0}.vl.svelte-19m1tsu{background:var(--accent-edge);width:1px;position:absolute;top:0;bottom:0}.hl.svelte-19m1tsu{background:var(--accent-edge);height:1px;position:absolute;left:0;right:0}.pt.svelte-19m1tsu{border:2px solid var(--accent);background:var(--accent-wash);border-radius:50%;justify-content:center;align-items:center;width:40px;height:40px;margin:-20px 0 0 -20px;display:flex;position:absolute}.pt.svelte-19m1tsu span:where(.svelte-19m1tsu){background:var(--accent-bright);border-radius:50%;width:10px;height:10px}.ax.svelte-19m1tsu{color:var(--ink5);pointer-events:none;font-size:10px;position:absolute}.ax-x.svelte-19m1tsu{bottom:8px;right:10px}.ax-y.svelte-19m1tsu{top:8px;left:10px}.pill.svelte-19m1tsu{background:var(--accent-wash);border:1px solid var(--border-brass);height:24px;color:var(--accent-bright);white-space:nowrap;border-radius:12px;align-items:center;padding:0 10px;font-size:11px;font-weight:600;display:flex;position:absolute;top:12px;left:50%;transform:translate(-50%)}.panel.svelte-19m1tsu{flex-direction:column;flex:none;gap:10px;width:290px;display:flex}.tablet .panel.svelte-19m1tsu{width:340px}.col.svelte-19m1tsu .panel:where(.svelte-19m1tsu){width:auto}.axes.svelte-19m1tsu{border:1px solid var(--border);border-radius:6px;overflow:hidden}.axis.svelte-19m1tsu{background:var(--panel);outline-offset:-3px;align-items:center;gap:12px;height:50px;padding:0 12px;display:flex}.axis.svelte-19m1tsu+.axis:where(.svelte-19m1tsu){border-top:1px solid var(--hairline)}.an.svelte-19m1tsu{color:var(--accent-dim);width:12px;font-size:13px}.names.svelte-19m1tsu{flex-direction:column;flex:1;gap:2px;min-width:0;display:flex}.pn.svelte-19m1tsu{color:var(--ink1);white-space:nowrap;text-overflow:ellipsis;font-size:12px;font-weight:600;overflow:hidden}.pd.svelte-19m1tsu{color:var(--ink5);white-space:nowrap;text-overflow:ellipsis;font-size:10px;overflow:hidden}.av.svelte-19m1tsu{color:var(--ink1);white-space:nowrap;font-size:13px}.row.svelte-19m1tsu{gap:8px;display:flex}.row.svelte-19m1tsu .seg:where(.svelte-19m1tsu){flex:1}.row.svelte-19m1tsu .seg:where(.svelte-19m1tsu) button:where(.svelte-19m1tsu){height:38px}.tilt.svelte-19m1tsu{height:46px;padding:0 14px}.ph.svelte-19m1tsu{border:1.5px solid;border-radius:2px;width:10px;height:14px;transform:rotate(-18deg)}.note.svelte-19m1tsu{color:var(--ink4);font-size:11px;line-height:1.5}.note.dim.svelte-19m1tsu{color:var(--ink5)}.auto.svelte-19m1tsu{background:var(--raised);border:1px solid var(--border);height:30px;color:var(--ink1);border-radius:4px;align-self:flex-start;align-items:center;gap:8px;padding:0 10px;font-size:11px;font-weight:600;display:flex}.rd.svelte-19m1tsu{background:var(--record);border-radius:50%;width:7px;height:7px}.mixer.svelte-4q66aa{touch-action:none;flex:1;gap:8px;min-height:0;display:flex}.strips.svelte-4q66aa{touch-action:pan-x;overscroll-behavior:contain;flex:1;gap:6px;min-width:0;display:flex;overflow:auto hidden}.strip.svelte-4q66aa{background:var(--panel);border:1px solid var(--border);border-radius:6px;flex-direction:column;flex:0 0 88px;gap:6px;min-width:0;padding:8px 6px;display:flex}.phoneLand.svelte-4q66aa .strip:where(.svelte-4q66aa){flex-basis:84px}.tablet.svelte-4q66aa .strip:where(.svelte-4q66aa){flex:1 1 0;min-width:84px}.strip.group.svelte-4q66aa{background:var(--well);border-color:var(--hairline)}.strip.active.svelte-4q66aa{border-color:var(--border-brass)}.head.svelte-4q66aa{text-align:left;align-items:center;gap:6px;min-width:0;height:28px;display:flex}.cbar.svelte-4q66aa{border-radius:2px;flex:none;width:3px;height:16px}.nm.svelte-4q66aa{min-width:0;color:var(--ink1);white-space:nowrap;text-overflow:ellipsis;flex:1;font-size:12px;font-weight:600;overflow:hidden}.tag.svelte-4q66aa{color:var(--ink5);align-items:center;gap:2px;font-size:9px;display:flex}.tag.svelte-4q66aa path:where(.svelte-4q66aa){fill:none;stroke:var(--ink5);stroke-width:1.4px;stroke-linecap:round}.pan.svelte-4q66aa{touch-action:none;align-items:center;gap:4px;height:22px;display:flex}.pbar.svelte-4q66aa{background:var(--well);border-radius:2px;flex:1;height:4px;position:relative}.pbar.svelte-4q66aa span:where(.svelte-4q66aa){background:var(--ink2);border-radius:1px;width:3px;height:10px;margin-left:-1.5px;position:absolute;top:-3px}.pv.svelte-4q66aa{color:var(--ink4);text-align:right;width:22px;font-size:9px}.fz.svelte-4q66aa{flex:1;justify-content:center;gap:6px;min-height:0;display:flex;position:relative}.held.svelte-4q66aa{z-index:2;background:var(--track-off);border:1px solid var(--border-strong);height:18px;color:var(--ink1);white-space:nowrap;border-radius:9px;align-items:center;padding:0 6px;font-size:9px;font-weight:600;display:flex;position:absolute;top:0;left:50%;transform:translate(-50%)}.meters.svelte-4q66aa{gap:2px;padding:4px 0;display:flex}.meters.svelte-4q66aa div:where(.svelte-4q66aa){background:var(--well);border-radius:2px;width:4px;height:100%;position:relative;overflow:hidden}.meters.wide.svelte-4q66aa div:where(.svelte-4q66aa){width:5px}.meters.svelte-4q66aa span:where(.svelte-4q66aa){background:var(--success);position:absolute;bottom:0;left:0;right:0}.fader.svelte-4q66aa{touch-action:none;justify-content:center;width:40px;padding:10px 0;display:flex;position:relative}.slot.svelte-4q66aa{background:var(--well);border:1px solid var(--hairline);border-radius:2px;width:4px;height:100%}.travel.svelte-4q66aa{position:absolute;inset:10px 0}.cap.svelte-4q66aa{background:var(--raised);border:1px solid var(--border-strong);border-radius:4px;justify-content:center;align-items:center;height:20px;margin-bottom:-10px;display:flex;position:absolute;left:4px;right:4px}.cap.held.svelte-4q66aa{border-color:var(--steel)}.cap.svelte-4q66aa i:where(.svelte-4q66aa){background:var(--ink3);border-radius:1px;width:18px;height:2px}.active.svelte-4q66aa .cap:where(.svelte-4q66aa) i:where(.svelte-4q66aa){background:var(--accent-bright)}.dbv.svelte-4q66aa{color:var(--ink2);text-align:center;font-size:11px}.dbv.act.svelte-4q66aa{color:var(--accent-bright)}.btns.svelte-4q66aa{grid-template-columns:1fr 1fr;gap:4px;display:grid}.ms.svelte-4q66aa{background:var(--raised);border:1px solid var(--border);height:34px;color:var(--ink4);border-radius:4px;font-size:12px;font-weight:700}.ms.mute.svelte-4q66aa{background:var(--track-off);border-color:var(--ink5);color:var(--ink0)}.ms.solo.svelte-4q66aa{background:var(--accent);border-color:var(--accent);color:var(--on-accent)}.arm.svelte-4q66aa{background:var(--raised);border:1px solid var(--border);letter-spacing:.08em;height:30px;color:var(--ink4);border-radius:4px;grid-column:span 2;justify-content:center;align-items:center;gap:5px;font-size:10px;font-weight:700;display:flex}.arm.svelte-4q66aa span:where(.svelte-4q66aa){background:var(--ink6);border-radius:50%;width:8px;height:8px}.arm.on.svelte-4q66aa{background:var(--record-wash);border-color:var(--record);color:var(--record-ink)}.arm.on.svelte-4q66aa span:where(.svelte-4q66aa){background:var(--record)}.rule.svelte-4q66aa{background:var(--hairline);width:1px}.masterstrip.svelte-4q66aa{flex:0 0 84px}.tablet.svelte-4q66aa .masterstrip:where(.svelte-4q66aa){flex-basis:110px}.mh.svelte-4q66aa{justify-content:center}.macros.svelte-1x69070{touch-action:none;flex-direction:column;flex:1;gap:10px;min-height:0;display:flex}.dev.svelte-1x69070{background:var(--well);border:1px solid var(--border);text-align:left;border-radius:5px;align-items:center;gap:10px;height:44px;padding:0 12px;display:flex;box-shadow:inset 0 1px #00000080}.dev.svelte-1x69070 .caps:where(.svelte-1x69070){letter-spacing:.1em;font-size:9px}.dn.svelte-1x69070{min-width:0;color:var(--ink1);white-space:nowrap;text-overflow:ellipsis;flex:1;font-size:13px;font-weight:600;overflow:hidden}.pos.svelte-1x69070{color:var(--ink5);font-size:10px}.dev.svelte-1x69070 path:where(.svelte-1x69070){fill:none;stroke:var(--ink4);stroke-width:1.4px;stroke-linecap:round}.grid.svelte-1x69070{flex:1;grid-auto-rows:minmax(0,1fr);gap:8px;min-height:0;display:grid}.knob.svelte-1x69070{background:var(--card);border:1px solid var(--border);touch-action:none;border-radius:6px;flex-direction:column;justify-content:center;align-items:center;gap:4px;min-height:0;display:flex;position:relative}.knob.on.svelte-1x69070{border-color:var(--border-brass)}.auto.svelte-1x69070{background:var(--accent);border-radius:50%;width:6px;height:6px;position:absolute;top:8px;right:8px}.trk.svelte-1x69070{fill:none;stroke:var(--well);stroke-width:5px;stroke-linecap:round}.arc.svelte-1x69070{fill:none;stroke:var(--accent);stroke-width:5px;stroke-linecap:round}.on.svelte-1x69070 .arc:where(.svelte-1x69070){stroke:var(--accent-bright)}.capc.svelte-1x69070{fill:var(--panel);stroke:var(--border-strong)}.ptr.svelte-1x69070{stroke:var(--accent-bright);stroke-width:2.4px;stroke-linecap:round}.kn.svelte-1x69070{letter-spacing:.08em;color:var(--ink5);white-space:nowrap;text-overflow:ellipsis;max-width:92%;font-size:10px;font-weight:700;overflow:hidden}.kv.svelte-1x69070{color:var(--ink1);font-size:12px}.on.svelte-1x69070 .kn:where(.svelte-1x69070),.on.svelte-1x69070 .kv:where(.svelte-1x69070){color:var(--accent-bright)}.empty.svelte-1x69070 .kv:where(.svelte-1x69070){color:var(--ink6)}.empty.svelte-1x69070{color:var(--ink5);flex:1;justify-content:center;align-items:center;font-size:12px;display:flex}.knob.empty.svelte-1x69070{flex:initial;display:flex}.scroll.svelte-he2l50{touch-action:pan-x pan-y;overscroll-behavior:contain;flex:1;min-height:0;overflow:auto}.grid.svelte-he2l50{gap:6px;min-width:min-content;display:grid}.corner.svelte-he2l50{align-items:center;height:36px;padding-left:4px;font-size:9px;display:flex}.th.svelte-he2l50{align-items:center;gap:6px;min-width:0;height:36px;padding:0 6px;display:flex}.th.svelte-he2l50 span:where(.svelte-he2l50){border-radius:2px;flex:none;width:3px;height:14px}.th.svelte-he2l50 b:where(.svelte-he2l50){color:var(--ink2);white-space:nowrap;text-overflow:ellipsis;font-size:12px;font-weight:600;overflow:hidden}.scene.svelte-he2l50{background:var(--raised);border:1px solid var(--border);color:var(--ink1);border-radius:5px;align-items:center;gap:8px;padding:0 10px;font-size:12px;font-weight:600;display:flex}.tri.svelte-he2l50{border-left:9px solid var(--ink3);border-top:6px solid #0000;border-bottom:6px solid #0000;width:0;height:0}.clip.svelte-he2l50{background:var(--raised);border:1px solid var(--border);text-align:left;border-radius:5px;flex-direction:column;justify-content:center;align-items:flex-start;gap:3px;min-width:0;padding:0 10px;display:flex;position:relative;overflow:hidden}.clip.empty.svelte-he2l50{background:var(--well);border:1px dashed var(--hairline)}.cn.svelte-he2l50{color:var(--ink2);white-space:nowrap;align-items:center;gap:6px;font-size:12px;font-weight:600;display:flex}.cs.svelte-he2l50{opacity:.8;font-size:9px}.clip.playing.svelte-he2l50,.clip.queued.svelte-he2l50{background:var(--tc);border-color:var(--tc)}.clip.playing.svelte-he2l50{border-color:var(--ink0)}.clip.playing.svelte-he2l50 :where(.svelte-he2l50),.clip.queued.svelte-he2l50 :where(.svelte-he2l50){color:#171613}.clip.queued.svelte-he2l50{animation:.8s step-end infinite svelte-he2l50-blink}.clip.rec.svelte-he2l50{border-color:var(--record)}.clip.rec.svelte-he2l50 .cs:where(.svelte-he2l50){color:var(--record-ink)}@keyframes svelte-he2l50-blink{50%{opacity:.35}}.ptri.svelte-he2l50{border-top:5px solid #0000;border-bottom:5px solid #0000;border-left:8px solid #171613;width:0;height:0}.prog.svelte-he2l50{opacity:.75;background:#f2ede1;height:4px;position:absolute;bottom:0;left:0}.stop.svelte-he2l50,.stopall.svelte-he2l50{background:var(--raised);border:1px solid var(--border);height:44px;color:var(--ink3);border-radius:5px;justify-content:center;align-items:center;gap:6px;font-size:11px;font-weight:600;display:flex}.sq.svelte-he2l50{background:var(--ink3);border-radius:1px;width:9px;height:9px}.empty.svelte-he2l50{color:var(--ink5);padding:20px;font-size:12px}.empty.svelte-i7n35i{text-align:center;border:1px dashed var(--border);border-radius:6px;flex-direction:column;flex:1;justify-content:center;align-items:center;gap:12px;padding:24px;display:flex}.t.svelte-i7n35i{color:var(--ink1);font-size:15px;font-weight:600}.s.svelte-i7n35i{color:var(--ink4);max-width:280px;font-size:12px;line-height:1.6}.btn.svelte-i7n35i{height:44px;color:var(--ink1);padding:0 18px;font-size:13px}.shell.svelte-1n46o8q{background:var(--app);padding:env(safe-area-inset-top) env(safe-area-inset-right) 0 env(safe-area-inset-left);flex-direction:column;display:flex;position:absolute;inset:0}.body.svelte-1n46o8q{flex:1;min-height:0;display:flex}main.svelte-1n46o8q{flex-direction:column;flex:1;min-width:0;padding:12px;transition:opacity .2s ease-out;display:flex;position:relative}.phoneLand.svelte-1n46o8q main:where(.svelte-1n46o8q){padding:8px 10px max(10px, env(safe-area-inset-bottom)) 10px}.tablet.svelte-1n46o8q main:where(.svelte-1n46o8q){padding:18px 18px max(18px, env(safe-area-inset-bottom))}main.dim.svelte-1n46o8q{opacity:.35;pointer-events:none}.rail.svelte-1n46o8q{border-right:1px solid var(--hairline);flex-direction:column;flex:none;gap:4px;width:104px;padding:8px;display:flex}.tablet.svelte-1n46o8q .rail:where(.svelte-1n46o8q){padding:12px 10px}.rail.svelte-1n46o8q button:where(.svelte-1n46o8q){height:44px;color:var(--ink4);border-radius:5px;font-size:11px;font-weight:600;transition:background-color .12s ease-out,color .12s ease-out;position:relative}.tablet.svelte-1n46o8q .rail:where(.svelte-1n46o8q) button:where(.svelte-1n46o8q){height:56px;font-size:13px}.rail.svelte-1n46o8q button.on:where(.svelte-1n46o8q){background:var(--raised);color:var(--ink1)}.rail.svelte-1n46o8q button.on:where(.svelte-1n46o8q):before{content:"";background:var(--accent);border-radius:1px;width:2px;position:absolute;top:10px;bottom:10px;left:0}.tabs.svelte-1n46o8q{padding:8px 12px max(12px, env(safe-area-inset-bottom));border-top:1px solid var(--hairline);flex:none}.tabs.svelte-1n46o8q .seg:where(.svelte-1n46o8q){border-radius:8px}.tabs.svelte-1n46o8q .seg:where(.svelte-1n46o8q) button:where(.svelte-1n46o8q){border-radius:5px;min-width:0;height:44px;padding:0;font-size:11px}diff --git a/src/managed/Nota.Remote/wwwroot/assets/index-kPw-fb1K.css b/src/managed/Nota.Remote/wwwroot/assets/index-kPw-fb1K.cssnew file mode 100644index 00000000..78ed1a34--- /dev/null+++ b/src/managed/Nota.Remote/wwwroot/assets/index-kPw-fb1K.css@@ -0,0 +1 @@+:root,[data-theme=dark]{--surface-abyss:#17181a;--bg-app:#1e1f22;--gutter:#141517;--bg-sunken:#17181a;--canvas-bg:#1e1f22;--surface-deep:#1b1c1f;--lane-b:#222326;--panel:#2b2d31;--surface-card:#2b2d31;--surface-inset:#232427;--surface-raised:#34363b;--surface-hover:#393c41;--track-off:#17181a;--surface-active:#17181a;--grid-sub-beat:#242528;--grid-beat:#2a2c30;--grid-row:#1b1c1f;--grid-bar:#3a3c41;--graph-border:#45484e;--well-grid:#2e2f32;--pad-grid:#2a2c30;--text-heading:#f4f5f6;--text-primary:#e8e9eb;--text-strong:#d4d6da;--text-secondary:#c0c4c9;--text-muted:#a4a9b0;--text-tertiary:#92969d;--text-disabled:#82868c;--text-axis:#82868c;--text-on-accent:#17181a;--text-faint:#82868c;--viz-ink:#d7d8da;--viz-grid:#2e2f32;--border-default:#141517;--border-strong:#45484e;--border-brass:#bf7d22;--seam:#141517;--rule:#45484e;--accent:#ff9f1c;--accent-bright:#ffb547;--accent-hover:#ffb547;--accent-deep:#c77612;--accent-dim:#c77612;--accent-edge:#bf7d22;--accent-mute:#7a5f3d;--accent-pale:#ffd08a;--accent-subtle:#4d3f2e;--record:#f06a6e;--record-ink:#fff;--success:#6cc673;--success-dim:#3f8a45;--warning:#f2b53c;--mute:#f2b53c;--solo:#6a9fd8;--danger:#f06a6e;--danger-hover:#f48386;--danger-bright:#f58f92;--danger-deep:#c4474b;--danger-pale:#f7a5a7;--teal:#5fb3a8;--teal-bright:#86c9c0;--rose:#d77a8f;--rose-bright:#e49eae;--steel:#6a9fd8;--sage:#7fb08a;--threshold:#e0a84a;--marker:#7fc4e0;--marker-hot:#cdeef8;--frozen:#7fc7ec;--signal-in:#5a6170;--signal-in-fill:#3a3e46;--handle-sel:#fff;--sel-header-bg:#393c41;--frozen-header-bg:#24323b;--mute-tint:#3b3426;--veil:#1e1f22;--tooltip-bg:#34363b;--tooltip-text:#e8e9eb;--key-white:#2b2d31;--key-black:#17181a;--mini-key-white:#3a3c41;--mini-key-black:#17181a;--shade-up:#fff;--shade-down:#17181a;--master:#a4a9b0;--track1:#7fb87a;--track2:#5fb3a8;--track3:#5aa6c4;--track4:#6a9fd8;--track5:#e0a84a;--track6:#9d90c9;--track7:#d77a8f;--track8:#b3b45e;--track9:#8e9db0;--return-a:#8e9db0;--return-b:#7a889a;--system-accent:#ff9f1c;--system-accent-light1:#ffab37;--system-accent-light2:#ffb652;--system-accent-light3:#ffc26e;--system-accent-dark1:#e68f19;--system-accent-dark2:#cc7f16;--system-accent-dark3:#b26f14;--shadow-bevel:#ffffff12;--shadow-popover:#0000006b;--shadow-modal:#00000080;--ink-dark:#17181a;--ink-light:#fff;--ink-on-accent:#17181a;--ink-on-mute:#17181a;--ink-on-solo:#17181a;--ink-on-record:#17181a;--ink-on-success:#17181a}[data-theme=dark]{--lightningcss-light: ;--lightningcss-dark:initial;color-scheme:dark}[data-theme=light]{--surface-abyss:#d6d8db;--bg-app:#c9cbcf;--gutter:#9da0a6;--bg-sunken:#d6d8db;--canvas-bg:#c9cbcf;--surface-deep:#cfd1d4;--lane-b:#c4c6ca;--panel:#e4e5e7;--surface-card:#e4e5e7;--surface-inset:#dcdee0;--surface-raised:#eeeff1;--surface-hover:#f7f8f9;--track-off:#d6d8db;--surface-active:#d6d8db;--grid-sub-beat:#c3c5c9;--grid-beat:#bdc0c4;--grid-row:#c5c7cb;--grid-bar:#adb0b5;--graph-border:#b3b6bb;--well-grid:#c0c3c6;--pad-grid:#c8cacd;--text-heading:#0e0f11;--text-primary:#16171a;--text-strong:#282a2e;--text-secondary:#3a3d42;--text-muted:#4f535a;--text-tertiary:#65696f;--text-disabled:#797c81;--text-axis:#797c81;--text-on-accent:#17181a;--text-faint:#797c81;--viz-ink:#252629;--viz-grid:#c0c3c6;--border-default:#9da0a6;--border-strong:#b3b6bb;--border-brass:#eca54e;--seam:#9da0a6;--rule:#b3b6bb;--accent:#ef8a0c;--accent-bright:#c46a00;--accent-hover:#c46a00;--accent-deep:#d47800;--accent-dim:#f7c27a;--accent-edge:#eca54e;--accent-mute:#c9a77a;--accent-pale:#8a4a00;--accent-subtle:#e6d6c4;--record:#b3262c;--record-ink:#fff;--success:#22692b;--success-dim:#79b880;--warning:#7a4f00;--mute:#7a4f00;--solo:#3f78b8;--danger:#b3262c;--danger-hover:#c2343a;--danger-bright:#9c1f24;--danger-deep:#8e1c21;--danger-pale:#7f161b;--teal:#3a8a7f;--teal-bright:#2e7067;--rose:#b4566b;--rose-bright:#93404f;--steel:#3f78b8;--sage:#4a7f56;--threshold:#8a5f14;--marker:#1b6e8c;--marker-hot:#0e5470;--frozen:#1c6e96;--signal-in:#7a818c;--signal-in-fill:#c9cdd3;--handle-sel:#16171a;--sel-header-bg:#f7f8f9;--frozen-header-bg:#d3e2ea;--mute-tint:#bdb49f;--veil:#e4e5e7;--tooltip-bg:#eeeff1;--tooltip-text:#16171a;--key-white:#eeeff1;--key-black:#c9cbcf;--mini-key-white:#f7f8f9;--mini-key-black:#3a3d42;--shade-up:#fff;--shade-down:#16171a;--master:#4f535a;--track1:#4a7f46;--track2:#3a8a7f;--track3:#357c99;--track4:#3f78b8;--track5:#b8862f;--track6:#7363a8;--track7:#b4566b;--track8:#7e7f2f;--track9:#5d6c80;--return-a:#5d6c80;--return-b:#4e5b6d;--system-accent:#ef8a0c;--system-accent-light1:#f19829;--system-accent-light2:#f3a646;--system-accent-light3:#f5b463;--system-accent-dark1:#d77c0b;--system-accent-dark2:#bf6e0a;--system-accent-dark3:#a76108;--shadow-bevel:#ffffffb3;--shadow-popover:#1e202438;--shadow-modal:#1e202440;--ink-dark:#17181a;--ink-light:#fff;--ink-on-accent:#17181a;--ink-on-mute:#fff;--ink-on-solo:#fff;--ink-on-record:#fff;--ink-on-success:#fff;--lightningcss-light:initial;--lightningcss-dark: ;--lightningcss-light:initial;--lightningcss-dark: ;color-scheme:light}@font-face{font-family:Geist;font-weight:400;font-display:swap;src:url(../fonts/Geist-Regular.woff2)format("woff2")}@font-face{font-family:Geist;font-weight:500 700;font-display:swap;src:url(../fonts/Geist-SemiBold.woff2)format("woff2")}@font-face{font-family:Geist Mono;font-weight:400 700;font-display:swap;src:url(../fonts/GeistMono-Medium.woff2)format("woff2")}:root{--bevel:inset 0 1px 0 0 var(--shadow-bevel);--sunken:inset 0 0 0 1px var(--rule);--popover:0 0 0 1px var(--seam), 0 10px 28px 0 var(--shadow-popover);--scrim:var(--shadow-modal);--ease:.12s ease-out}*{box-sizing:border-box;margin:0;padding:0}html,body{background:var(--bg-app);height:100%;color:var(--text-primary);-webkit-text-size-adjust:100%;-webkit-tap-highlight-color:transparent;-webkit-user-select:none;user-select:none;-webkit-touch-callout:none;overscroll-behavior:none;touch-action:none;font-family:Geist,system-ui,-apple-system,sans-serif;font-size:13px;overflow:hidden}body,#app{position:fixed;inset:0}button{font:inherit;color:inherit;cursor:pointer;touch-action:manipulation;background:0 0;border:none}input{font:inherit;color:inherit;-webkit-user-select:text;user-select:text;touch-action:manipulation}svg path{stroke-linecap:round;stroke-linejoin:round}.mono{font-variant-numeric:tabular-nums;font-family:Geist Mono,ui-monospace,monospace}.label{color:var(--text-muted);font-size:11px;font-weight:600}.sr{clip:rect(0 0 0 0);width:1px;height:1px;position:absolute;overflow:hidden}.btn{background:var(--surface-raised);border:1px solid var(--seam);height:42px;box-shadow:var(--bevel);color:var(--text-strong);transition:background-color var(--ease), border-color var(--ease), color var(--ease);border-radius:3px;justify-content:center;align-items:center;gap:7px;padding:0 12px;font-size:12px;font-weight:500;display:inline-flex}.btn:active{background:var(--bg-sunken);box-shadow:none}.btn.on{background:var(--accent);border-color:var(--accent);color:var(--ink-on-accent);box-shadow:none}@media (hover:hover){.btn:not(.on):hover{background:var(--surface-hover)}}.seg{background:var(--seam);border:1px solid var(--seam);border-radius:3px;gap:1px;display:flex;overflow:hidden}.seg>button{background:var(--surface-raised);height:36px;box-shadow:var(--bevel);color:var(--text-secondary);transition:background-color var(--ease), color var(--ease);flex:1;padding:0 11px;font-size:12px;font-weight:500}.seg>button:active{background:var(--bg-sunken);box-shadow:none}.seg>button.on{background:var(--accent);color:var(--ink-on-accent);box-shadow:none}.switch{background:var(--bg-sunken);width:28px;height:16px;box-shadow:var(--sunken);transition:background-color var(--ease);border-radius:2px;flex:none;display:block;position:relative}.switch:after{content:"";background:var(--text-tertiary);width:12px;height:12px;transition:left var(--ease), background-color var(--ease);border-radius:1px;position:absolute;top:2px;left:2px}.switch.on{background:var(--accent);box-shadow:none}.switch.on:after{background:var(--panel);left:14px}.learnable{outline:1px dashed var(--accent);outline-offset:2px}header.svelte-oiwvqb{border-bottom:1px solid var(--seam);background:var(--panel);z-index:6;flex-wrap:wrap;flex:none;align-items:center;gap:8px 10px;padding:6px 10px 10px;display:flex;position:relative}header.phoneLand.svelte-oiwvqb{flex-wrap:nowrap;padding:6px 10px}header.tablet.svelte-oiwvqb{flex-wrap:nowrap;padding:10px 16px}svg.svelte-oiwvqb path:where(.svelte-oiwvqb){fill:none;stroke:var(--text-muted);stroke-width:1.5px}.picker.svelte-oiwvqb{flex:1;order:1;align-items:center;gap:4px;min-width:0;display:flex}.step.svelte-oiwvqb{border-radius:3px;flex:none;justify-content:center;align-items:center;width:36px;height:44px;display:flex}.step.svelte-oiwvqb:active{background:var(--bg-sunken)}.track.svelte-oiwvqb{background:var(--surface-raised);border:1px solid var(--seam);min-width:0;height:44px;box-shadow:var(--bevel);text-align:left;border-radius:3px;flex:1;align-items:center;gap:10px;padding:0 10px;display:flex}.bar.svelte-oiwvqb{border-radius:1px;flex:none;width:3px;height:24px}.names.svelte-oiwvqb{flex-direction:column;flex:1;gap:1px;min-width:0;display:flex}.name.svelte-oiwvqb{color:var(--text-primary);white-space:nowrap;text-overflow:ellipsis;font-size:14px;font-weight:600;overflow:hidden}.sub.svelte-oiwvqb{color:var(--text-tertiary);white-space:nowrap;text-overflow:ellipsis;font-size:11px;overflow:hidden}.transport.svelte-oiwvqb{flex-basis:100%;order:3;align-items:center;gap:6px;display:flex}.phoneLand.svelte-oiwvqb .transport:where(.svelte-oiwvqb){flex:0 0 330px;order:2}.tablet.svelte-oiwvqb .transport:where(.svelte-oiwvqb){flex:0 0 460px;order:2}.tbtn.svelte-oiwvqb{background:var(--surface-raised);border:1px solid var(--seam);width:44px;height:40px;box-shadow:var(--bevel);color:var(--text-strong);transition:background-color var(--ease), border-color var(--ease), color var(--ease);border-radius:3px;flex:none;justify-content:center;align-items:center;display:flex}.tbtn.svelte-oiwvqb:active{background:var(--bg-sunken);box-shadow:none}.tbtn.play.svelte-oiwvqb{width:54px}.fs.svelte-oiwvqb svg:where(.svelte-oiwvqb) path:where(.svelte-oiwvqb){stroke:var(--text-secondary)}.sq.svelte-oiwvqb{background:currentColor;border-radius:1px;width:11px;height:11px}.tri.svelte-oiwvqb{border-top:7px solid #0000;border-bottom:7px solid #0000;border-left:12px solid;width:0;height:0;margin-left:3px}.play.on.svelte-oiwvqb{background:var(--accent);border-color:var(--accent);box-shadow:none;color:var(--ink-on-accent)}.dot.svelte-oiwvqb{background:var(--record);border-radius:50%;width:12px;height:12px}.rec.on.svelte-oiwvqb,.rec.count.svelte-oiwvqb{background:var(--record);border-color:var(--record);box-shadow:none}.rec.on.svelte-oiwvqb .dot:where(.svelte-oiwvqb),.rec.count.svelte-oiwvqb .dot:where(.svelte-oiwvqb){background:var(--record-ink)}.pos.svelte-oiwvqb{background:var(--bg-sunken);min-width:0;height:40px;box-shadow:var(--sunken);border-radius:3px;flex:1;align-items:center;gap:10px;padding:0 10px;display:flex}.pos.open.svelte-oiwvqb{box-shadow:inset 0 0 0 1px var(--accent)}.pos.open.svelte-oiwvqb svg:where(.svelte-oiwvqb){transform:rotate(180deg)}.pos.svelte-oiwvqb svg:where(.svelte-oiwvqb){margin-left:auto}.p.svelte-oiwvqb{color:var(--text-primary);font-size:16px}.bpm.svelte-oiwvqb{color:var(--text-muted);font-size:11px}.status.svelte-oiwvqb{order:2;align-items:center;gap:4px;display:flex}.phoneLand.svelte-oiwvqb .status:where(.svelte-oiwvqb),.tablet.svelte-oiwvqb .status:where(.svelte-oiwvqb){order:3}.link.svelte-oiwvqb{border-radius:3px;align-items:center;gap:6px;height:44px;padding:0 8px;display:flex}.link.svelte-oiwvqb .mono:where(.svelte-oiwvqb){white-space:nowrap;font-size:11px}.ldot.svelte-oiwvqb{border-radius:50%;width:7px;height:7px}.blink.svelte-oiwvqb{animation:.8s step-end infinite svelte-oiwvqb-blink}@keyframes svelte-oiwvqb-blink{50%{opacity:.35}}.menu.svelte-oiwvqb{border-radius:3px;justify-content:center;align-items:center;gap:3px;width:44px;height:44px;display:flex}.menu.open.svelte-oiwvqb{background:var(--surface-hover)}.menu.svelte-oiwvqb span:where(.svelte-oiwvqb){background:var(--text-secondary);border-radius:50%;width:4px;height:4px}.banner.svelte-4gizvm{background:var(--panel);border-bottom:1px solid var(--seam);flex:none;align-items:center;gap:10px;padding:9px 16px;display:flex}.dot.svelte-4gizvm{background:var(--accent);border-radius:50%;flex:none;width:8px;height:8px}.quiet.svelte-4gizvm .dot:where(.svelte-4gizvm){background:var(--text-tertiary)}.blink.svelte-4gizvm{animation:.8s step-end infinite svelte-4gizvm-blink}@keyframes svelte-4gizvm-blink{50%{opacity:.35}}.t.svelte-4gizvm{color:var(--text-primary);font-size:12px;font-weight:600}.s.svelte-4gizvm{color:var(--text-secondary);font-size:11px}.scrim.svelte-tyq0v8{z-index:20;background:var(--scrim);position:absolute;inset:0}.sheet.svelte-tyq0v8{z-index:21;left:12px;top:calc(env(safe-area-inset-top) + 64px);background:var(--panel);width:360px;max-width:calc(100% - 24px);max-height:calc(100% - 88px);box-shadow:var(--popover);border-radius:3px;flex-direction:column;display:flex;position:absolute;overflow:hidden}.sheet.bottom.svelte-tyq0v8{width:auto;top:auto;right:12px;bottom:max(24px, env(safe-area-inset-bottom));max-height:75%}.sheet.menu.svelte-tyq0v8{width:300px;left:auto;right:12px}.head.svelte-tyq0v8{padding:14px 16px 8px}.list.svelte-tyq0v8{touch-action:pan-y;overscroll-behavior:contain;overflow-y:auto}.row.svelte-tyq0v8{border-top:1px solid var(--rule);text-align:left;width:100%;height:52px;transition:background-color var(--ease);align-items:center;gap:12px;padding:0 16px;display:flex;position:relative}.row.slim.svelte-tyq0v8{border:none;border-radius:2px;height:44px;padding:0 10px}.row.svelte-tyq0v8:active{background:var(--bg-sunken)}.row.on.svelte-tyq0v8{background:var(--surface-hover)}.row.on.svelte-tyq0v8:before{content:"";background:var(--accent);width:2px;position:absolute;top:10px;bottom:10px;left:0}.bar.svelte-tyq0v8{border-radius:1px;flex:none;width:3px;height:22px}.names.svelte-tyq0v8{flex-direction:column;flex:1;gap:1px;min-width:0;display:flex}.n.svelte-tyq0v8{color:var(--text-primary);white-space:nowrap;text-overflow:ellipsis;font-size:13px;font-weight:600;overflow:hidden}.d.svelte-tyq0v8{color:var(--text-tertiary);font-size:11px}.who.svelte-tyq0v8{background:var(--bg-sunken);height:20px;color:var(--text-secondary);border-radius:2px;align-items:center;padding:0 6px;font-size:10px;font-weight:600;display:flex}.empty.svelte-tyq0v8{color:var(--text-tertiary);padding:16px;font-size:12px}.toggle.svelte-tyq0v8{border-top:1px solid var(--rule);text-align:left;align-items:center;gap:12px;width:100%;min-height:52px;padding:0 16px;display:flex}.n2.svelte-tyq0v8{color:var(--text-primary);font-size:12px;display:block}.d2.svelte-tyq0v8{color:var(--text-tertiary);font-size:11px;display:block}.block.svelte-tyq0v8{flex-direction:column;gap:8px;padding:14px 16px;display:flex}.block.svelte-tyq0v8+.block:where(.svelte-tyq0v8){border-top:1px solid var(--rule)}.field.svelte-tyq0v8{background:var(--bg-sunken);height:40px;box-shadow:var(--sunken);border:none;border-radius:3px;outline:none;padding:0 12px;font-size:13px}.field.svelte-tyq0v8:focus{box-shadow:inset 0 0 0 1px var(--accent)}.tonics.svelte-tyq0v8{grid-template-columns:repeat(6,1fr);gap:6px;display:grid}.tonics.svelte-tyq0v8 .btn:where(.svelte-tyq0v8){height:44px;padding:0}.disconnect.svelte-tyq0v8{border-top:1px solid var(--rule);height:52px;color:var(--text-primary);text-align:left;padding:0 16px;font-size:13px;font-weight:500}.disconnect.svelte-tyq0v8:active{background:var(--bg-sunken)}.cover.svelte-17f2qxr{z-index:40;background:var(--bg-app);padding:28px;padding-top:calc(env(safe-area-inset-top) + 28px);flex-direction:column;justify-content:center;gap:18px;display:flex;position:absolute;inset:0}h1.svelte-17f2qxr{color:var(--text-heading);font-size:22px;font-weight:600}p.svelte-17f2qxr{color:var(--text-secondary);max-width:420px;font-size:13px;line-height:1.6}ol.svelte-17f2qxr{background:var(--panel);max-width:420px;box-shadow:0 0 0 1px var(--seam);border-radius:3px;list-style:none;overflow:hidden}li.svelte-17f2qxr{color:var(--text-strong);gap:12px;padding:12px 14px;font-size:12px;line-height:1.5;display:flex}li.svelte-17f2qxr+li:where(.svelte-17f2qxr){border-top:1px solid var(--rule)}li.svelte-17f2qxr .mono:where(.svelte-17f2qxr){color:var(--text-muted);font-size:11px}.retry.svelte-17f2qxr{color:var(--text-muted);align-items:center;gap:10px;font-size:12px;display:flex}.dot.svelte-17f2qxr{background:var(--text-tertiary);border-radius:50%;width:7px;height:7px}.blink.svelte-17f2qxr{animation:.8s step-end infinite svelte-17f2qxr-blink}@keyframes svelte-17f2qxr-blink{50%{opacity:.35}}.code.svelte-17f2qxr{grid-template-columns:repeat(4,64px);gap:10px;display:grid;position:relative}.code.svelte-17f2qxr input:where(.svelte-17f2qxr){opacity:0;font-size:16px;position:absolute;inset:0}.cell.svelte-17f2qxr{background:var(--bg-sunken);height:68px;box-shadow:var(--sunken);pointer-events:none;border-radius:3px;justify-content:center;align-items:center;display:flex}.cell.cur.svelte-17f2qxr{box-shadow:inset 0 0 0 1px var(--accent)}.cell.svelte-17f2qxr .mono:where(.svelte-17f2qxr){color:var(--text-heading);font-size:28px}.caret.svelte-17f2qxr{background:var(--accent);width:2px;height:28px;animation:1s step-end infinite svelte-17f2qxr-blink}.big.svelte-17f2qxr{align-self:flex-start;height:48px;padding:0 20px;font-size:13px}.primary.svelte-17f2qxr{background:var(--surface-hover);color:var(--text-primary);font-weight:600}.count.svelte-17f2qxr{z-index:35;background:var(--bg-app);flex-direction:column;justify-content:center;align-items:center;gap:12px;display:flex;position:absolute;inset:0}.num.svelte-17f2qxr{color:var(--accent-bright);font-size:200px;font-weight:500;line-height:1}.num.phoneLand.svelte-17f2qxr{font-size:150px}.num.tablet.svelte-17f2qxr{font-size:260px}.rec.svelte-17f2qxr{color:var(--record);font-size:13px;font-weight:600}.toast.svelte-17f2qxr{z-index:50;background:var(--surface-raised);max-width:86%;box-shadow:var(--popover);color:var(--text-primary);text-align:center;border-radius:3px;padding:10px 14px;font-size:12px;line-height:1.45;position:absolute;bottom:24px;left:50%;transform:translate(-50%)}.toast.low.svelte-17f2qxr{bottom:calc(env(safe-area-inset-bottom) + 84px)}.big.svelte-1hrivqy{z-index:4;background:var(--bg-app);flex-direction:column;gap:14px;padding:12px;display:flex;position:absolute;inset:0}.phoneLand.big.svelte-1hrivqy{gap:10px;padding:8px 10px}.tablet.big.svelte-1hrivqy{padding:18px}.top.svelte-1hrivqy{justify-content:space-between;align-items:flex-end;gap:12px;display:flex}.pblock.svelte-1hrivqy{flex-direction:column;gap:4px;display:flex}.pos.svelte-1hrivqy{color:var(--text-primary);font-size:52px;line-height:1}.phoneLand.svelte-1hrivqy .pos:where(.svelte-1hrivqy){font-size:40px}.tablet.svelte-1hrivqy .pos:where(.svelte-1hrivqy){font-size:88px}.pos.rec.svelte-1hrivqy{color:var(--record)}.tap.svelte-1hrivqy{background:var(--surface-raised);border:1px solid var(--seam);height:56px;box-shadow:var(--bevel);border-radius:3px;flex-direction:column;justify-content:center;align-items:center;gap:2px;padding:0 16px;display:flex}.tap.svelte-1hrivqy:active{background:var(--bg-sunken);box-shadow:none}.tap.svelte-1hrivqy .mono:where(.svelte-1hrivqy){color:var(--text-primary);font-size:18px}.tl.svelte-1hrivqy{color:var(--text-muted);font-size:11px;font-weight:500}.btns.svelte-1hrivqy{flex:1;grid-auto-rows:minmax(0,1fr);gap:6px;min-height:0;display:grid}.b.svelte-1hrivqy{background:var(--surface-raised);border:1px solid var(--seam);min-height:0;box-shadow:var(--bevel);color:var(--text-strong);transition:background-color var(--ease), color var(--ease);border-radius:3px;flex-direction:column;justify-content:center;align-items:center;gap:10px;font-size:14px;font-weight:600;display:flex}.b.svelte-1hrivqy:active{background:var(--bg-sunken);box-shadow:none}.b.svelte-1hrivqy svg:where(.svelte-1hrivqy) path:where(.svelte-1hrivqy){fill:none;stroke:currentColor;stroke-width:2px}.b.on.svelte-1hrivqy{background:var(--accent);border-color:var(--accent);box-shadow:none;color:var(--ink-on-accent)}.b.dim.svelte-1hrivqy{color:var(--text-faint)}.tri.svelte-1hrivqy{border-top:16px solid #0000;border-bottom:16px solid #0000;border-left:26px solid;width:0;height:0;margin-left:6px}.sq.svelte-1hrivqy{background:currentColor;border-radius:2px;width:26px;height:26px}.dot.svelte-1hrivqy{background:var(--record);border-radius:50%;width:28px;height:28px}.recb.on.svelte-1hrivqy{background:var(--record);border-color:var(--record);color:var(--ink-on-record)}.recb.on.svelte-1hrivqy .dot:where(.svelte-1hrivqy){background:var(--ink-on-record)}.secs.svelte-1hrivqy{flex-direction:column;gap:6px;display:flex}.sgrid.svelte-1hrivqy{grid-template-columns:repeat(4,minmax(0,1fr));gap:4px;display:grid}.sec.svelte-1hrivqy{background:var(--surface-raised);border:1px solid var(--seam);height:52px;box-shadow:var(--bevel);border-radius:2px;flex-direction:column;justify-content:center;align-items:center;gap:2px;display:flex;position:relative}.sec.cur.svelte-1hrivqy:before{content:"";background:var(--accent);height:2px;position:absolute;top:-1px;left:6px;right:6px}.sec.looping.svelte-1hrivqy{background:var(--accent);border-color:var(--accent);box-shadow:none}.sn.svelte-1hrivqy{color:var(--text-primary);white-space:nowrap;text-overflow:ellipsis;max-width:92%;font-size:13px;font-weight:600;overflow:hidden}.si.svelte-1hrivqy{color:var(--text-tertiary);font-size:11px}.looping.svelte-1hrivqy .sn:where(.svelte-1hrivqy),.looping.svelte-1hrivqy .si:where(.svelte-1hrivqy){color:var(--ink-on-accent)}.pads.svelte-1puq9zz{flex-direction:column;flex:1;gap:10px;min-height:0;display:flex}.bar.svelte-1puq9zz{flex-wrap:wrap;align-items:center;gap:8px;display:flex}.banks.svelte-1puq9zz button:where(.svelte-1puq9zz){flex:none;min-width:42px;font-size:12px}.rep.svelte-1puq9zz{gap:8px;padding:0 6px 0 10px}.rate.svelte-1puq9zz{background:var(--bg-sunken);height:30px;color:var(--text-secondary);border-radius:2px;align-items:center;padding:0 7px;font-size:11px;display:flex}.rep.on.svelte-1puq9zz .rate:where(.svelte-1puq9zz){color:var(--text-primary)}.grid.svelte-1puq9zz{flex:1;grid-auto-rows:minmax(0,1fr);gap:6px;min-height:0;display:grid}.pad.svelte-1puq9zz{background:var(--surface-raised);border:1px solid var(--seam);box-shadow:var(--bevel);text-align:left;touch-action:none;border-radius:3px;flex-direction:column;justify-content:space-between;align-items:stretch;min-width:0;min-height:0;padding:8px;display:flex;overflow:hidden}.num.svelte-1puq9zz,.note.svelte-1puq9zz{color:var(--text-tertiary);font-size:10px}.txt.svelte-1puq9zz{flex-direction:column;gap:1px;min-width:0;display:flex}.name.svelte-1puq9zz{color:var(--text-primary);white-space:nowrap;text-overflow:ellipsis;font-size:12px;font-weight:600;overflow:hidden}.tablet .name.svelte-1puq9zz{font-size:14px}.pad.playing.svelte-1puq9zz{background:var(--tc);border-color:var(--tc);box-shadow:none}.pad.playing.svelte-1puq9zz :where(.svelte-1puq9zz){color:var(--tc-ink)}.pad.on.svelte-1puq9zz{background:var(--accent);border-color:var(--accent);box-shadow:none}.pad.on.svelte-1puq9zz :where(.svelte-1puq9zz){color:var(--ink-on-accent)}.keys.svelte-12d1dcp{flex-direction:column;flex:1;gap:10px;min-height:0;display:flex}.bar.svelte-12d1dcp{flex-wrap:wrap;align-items:center;gap:8px;display:flex}.modes.svelte-12d1dcp button:where(.svelte-12d1dcp){flex:none}.keybtn.svelte-12d1dcp{gap:7px;padding:0 10px}.expr.svelte-12d1dcp{padding:0 10px}.k.svelte-12d1dcp{color:var(--text-muted);font-size:11px;font-weight:500}.kn.svelte-12d1dcp{color:var(--text-primary);font-size:12px;font-weight:600}.src.svelte-12d1dcp{color:var(--text-tertiary);font-size:11px}.oct.svelte-12d1dcp{align-items:center;gap:2px;margin-left:auto;display:flex}.octn.svelte-12d1dcp{text-align:center;width:52px;color:var(--text-secondary);font-size:12px}.octn.svelte-12d1dcp .mono:where(.svelte-12d1dcp){color:var(--text-primary)}.sq.svelte-12d1dcp{width:42px;padding:0}.sq.svelte-12d1dcp path:where(.svelte-12d1dcp){stroke:currentColor;stroke-width:1.5px;fill:none}.surface.svelte-12d1dcp{touch-action:none;flex:1;min-height:0;display:flex}.kb.svelte-12d1dcp{background:var(--seam);border:1px solid var(--seam);border-top:none;border-radius:0 0 3px 3px;flex:1;gap:1px;min-width:0;display:flex;position:relative;overflow:hidden}.white.svelte-12d1dcp{background:var(--mini-key-white);border-radius:0 0 2px 2px;flex-direction:column;flex:1;justify-content:flex-end;align-items:center;min-width:0;padding-bottom:12px;display:flex;position:relative;overflow:hidden}.white.on.svelte-12d1dcp{background:var(--accent)}.lbl.svelte-12d1dcp{color:var(--text-tertiary);font-size:10px}.white.on.svelte-12d1dcp .lbl:where(.svelte-12d1dcp){color:var(--ink-on-accent)}.black.svelte-12d1dcp{background:var(--mini-key-black);border:1px solid var(--seam);z-index:1;border-top:none;border-radius:0 0 2px 2px;height:58%;position:absolute;top:0;overflow:hidden}.black.on.svelte-12d1dcp{background:var(--accent);border-color:var(--accent)}.band.svelte-12d1dcp{background:var(--tc);height:5px;position:absolute;bottom:0;left:0;right:0}.grid.svelte-12d1dcp{flex:1;grid-auto-rows:minmax(0,1fr);gap:6px;min-width:0;display:grid}.cell.svelte-12d1dcp{background:var(--surface-raised);border:1px solid var(--seam);box-shadow:var(--bevel);border-radius:3px;justify-content:center;align-items:center;min-height:0;display:flex}.cell.svelte-12d1dcp .mono:where(.svelte-12d1dcp){color:var(--text-secondary);pointer-events:none;font-size:12px}.cell.tonic.svelte-12d1dcp{background:var(--surface-hover)}.cell.tonic.svelte-12d1dcp .mono:where(.svelte-12d1dcp){color:var(--text-primary);font-weight:600}.cell.lit.svelte-12d1dcp,.chord.lit.svelte-12d1dcp{border-color:var(--tc)}.cell.on.svelte-12d1dcp{background:var(--accent);border-color:var(--accent);box-shadow:none}.cell.on.svelte-12d1dcp .mono:where(.svelte-12d1dcp){color:var(--ink-on-accent)}.chord.svelte-12d1dcp{background:var(--surface-raised);border:1px solid var(--seam);box-shadow:var(--bevel);border-radius:3px;flex-direction:column;justify-content:center;align-items:center;gap:4px;min-height:0;display:flex}.chord.svelte-12d1dcp :where(.svelte-12d1dcp){pointer-events:none}.roman.svelte-12d1dcp{color:var(--text-muted);font-size:12px}.cn.svelte-12d1dcp{color:var(--text-primary);font-size:20px;font-weight:600}.chord.on.svelte-12d1dcp{background:var(--accent);border-color:var(--accent);box-shadow:none}.chord.on.svelte-12d1dcp .cn:where(.svelte-12d1dcp),.chord.on.svelte-12d1dcp .roman:where(.svelte-12d1dcp){color:var(--ink-on-accent)}.hint.svelte-12d1dcp{color:var(--text-tertiary);font-size:11px}.white.svelte-12d1dcp :where(.svelte-12d1dcp),.black.svelte-12d1dcp :where(.svelte-12d1dcp){pointer-events:none}.xy.svelte-19m1tsu{flex:1;gap:12px;min-height:0;display:flex}.xy.col.svelte-19m1tsu{flex-direction:column}.field.svelte-19m1tsu{background:var(--bg-sunken);min-width:0;min-height:0;box-shadow:var(--sunken);touch-action:none;border-radius:3px;flex:1;position:relative;overflow:hidden}.gridlines.svelte-19m1tsu{background-image:linear-gradient(var(--viz-grid) 1px, transparent 1px), linear-gradient(90deg, var(--viz-grid) 1px, transparent 1px);background-position:-1px -1px;background-size:25% 25%;position:absolute;inset:0}.vl.svelte-19m1tsu{background:var(--rule);width:1px;position:absolute;top:0;bottom:0}.hl.svelte-19m1tsu{background:var(--rule);height:1px;position:absolute;left:0;right:0}.vl.live.svelte-19m1tsu,.hl.live.svelte-19m1tsu{background:var(--accent)}.pt.svelte-19m1tsu{border:2px solid var(--viz-ink);border-radius:50%;justify-content:center;align-items:center;width:40px;height:40px;margin:-20px 0 0 -20px;display:flex;position:absolute}.pt.svelte-19m1tsu span:where(.svelte-19m1tsu){background:var(--viz-ink);border-radius:50%;width:10px;height:10px}.pt.live.svelte-19m1tsu{border-color:var(--accent)}.pt.live.svelte-19m1tsu span:where(.svelte-19m1tsu){background:var(--accent)}.ax.svelte-19m1tsu{color:var(--text-faint);pointer-events:none;font-size:11px;position:absolute}.ax-x.svelte-19m1tsu{bottom:8px;right:10px}.ax-y.svelte-19m1tsu{top:8px;left:10px}.pill.svelte-19m1tsu{background:var(--accent);height:24px;color:var(--ink-on-accent);white-space:nowrap;border-radius:3px;align-items:center;padding:0 9px;font-size:11px;font-weight:600;display:flex;position:absolute;top:12px;left:50%;transform:translate(-50%)}.panel.svelte-19m1tsu{flex-direction:column;flex:none;gap:10px;width:290px;display:flex}.tablet .panel.svelte-19m1tsu{width:340px}.col.svelte-19m1tsu .panel:where(.svelte-19m1tsu){width:auto}.axes.svelte-19m1tsu{background:var(--panel);box-shadow:0 0 0 1px var(--seam);border-radius:3px;overflow:hidden}.axis.svelte-19m1tsu{outline-offset:-3px;align-items:center;gap:12px;height:50px;padding:0 12px;display:flex}.axis.svelte-19m1tsu+.axis:where(.svelte-19m1tsu){border-top:1px solid var(--rule)}.an.svelte-19m1tsu{color:var(--text-muted);width:12px;font-size:13px}.names.svelte-19m1tsu{flex-direction:column;flex:1;gap:2px;min-width:0;display:flex}.pn.svelte-19m1tsu{color:var(--text-primary);white-space:nowrap;text-overflow:ellipsis;font-size:12px;font-weight:600;overflow:hidden}.pd.svelte-19m1tsu{color:var(--text-tertiary);white-space:nowrap;text-overflow:ellipsis;font-size:11px;overflow:hidden}.av.svelte-19m1tsu{color:var(--text-primary);white-space:nowrap;font-size:13px}.row.svelte-19m1tsu{gap:8px;display:flex}.row.svelte-19m1tsu .seg:where(.svelte-19m1tsu){flex:1}.row.svelte-19m1tsu .seg:where(.svelte-19m1tsu) button:where(.svelte-19m1tsu){height:44px}.tilt.svelte-19m1tsu{height:46px;padding:0 14px}.ph.svelte-19m1tsu{border:1.5px solid;border-radius:2px;width:10px;height:14px;transform:rotate(-18deg)}.note.svelte-19m1tsu{color:var(--text-muted);font-size:11px;line-height:1.5}.note.dim.svelte-19m1tsu{color:var(--text-tertiary)}.auto.svelte-19m1tsu{background:var(--surface-raised);border:1px solid var(--seam);height:30px;box-shadow:var(--bevel);color:var(--text-primary);border-radius:3px;align-self:flex-start;align-items:center;gap:8px;padding:0 10px;font-size:11px;font-weight:600;display:flex}.rd.svelte-19m1tsu{background:var(--record);border-radius:50%;width:7px;height:7px}.mixer.svelte-4q66aa{touch-action:none;flex:1;gap:0;min-height:0;margin:-12px;display:flex}.mixer.phoneLand.svelte-4q66aa{margin:-8px -10px calc(-1 * max(10px, env(safe-area-inset-bottom))) -10px}.mixer.tablet.svelte-4q66aa{margin:-18px -18px calc(-1 * max(18px, env(safe-area-inset-bottom)))}.strips.svelte-4q66aa{background:var(--seam);touch-action:pan-x;overscroll-behavior:contain;flex:1;gap:1px;min-width:0;display:flex;overflow:auto hidden}.strip.svelte-4q66aa{background:var(--panel);flex-direction:column;flex:0 0 88px;gap:6px;min-width:0;padding:10px 6px;display:flex}.phoneLand.svelte-4q66aa .strip:where(.svelte-4q66aa){flex-basis:84px}.tablet.svelte-4q66aa .strip:where(.svelte-4q66aa){flex:1 1 0;min-width:84px}.strip.group.svelte-4q66aa{background:var(--surface-inset)}.head.svelte-4q66aa{text-align:left;align-items:center;gap:6px;min-width:0;height:28px;display:flex}.cbar.svelte-4q66aa{border-radius:1px;flex:none;width:3px;height:16px}.nm.svelte-4q66aa{min-width:0;color:var(--text-primary);white-space:nowrap;text-overflow:ellipsis;flex:1;font-size:12px;font-weight:600;overflow:hidden}.mh.svelte-4q66aa .nm:where(.svelte-4q66aa){text-align:center;color:var(--text-secondary)}.tag.svelte-4q66aa{color:var(--text-tertiary);align-items:center;gap:2px;font-size:10px;display:flex}.tag.svelte-4q66aa path:where(.svelte-4q66aa){fill:none;stroke:currentColor;stroke-width:1.5px}.pan.svelte-4q66aa{touch-action:none;align-items:center;gap:4px;height:22px;display:flex}.pbar.svelte-4q66aa{background:var(--bg-sunken);height:3px;box-shadow:var(--sunken);border-radius:1px;flex:1;position:relative}.pbar.svelte-4q66aa span:where(.svelte-4q66aa){background:var(--viz-ink);border-radius:1px;width:3px;height:11px;margin-left:-1.5px;position:absolute;top:-4px}.pan.act.svelte-4q66aa .pbar:where(.svelte-4q66aa) span:where(.svelte-4q66aa){background:var(--accent)}.pv.svelte-4q66aa{color:var(--text-muted);text-align:right;width:24px;font-size:10px}.pan.act.svelte-4q66aa .pv:where(.svelte-4q66aa){color:var(--accent-bright)}.fz.svelte-4q66aa{flex:1;justify-content:center;gap:6px;min-height:0;display:flex;position:relative}.held.svelte-4q66aa{z-index:2;background:var(--surface-raised);height:18px;box-shadow:var(--popover);color:var(--text-primary);white-space:nowrap;border-radius:2px;align-items:center;padding:0 6px;font-size:10px;font-weight:600;display:flex;position:absolute;top:0;left:50%;transform:translate(-50%)}.meters.svelte-4q66aa{gap:2px;padding:4px 0;display:flex}.meters.svelte-4q66aa div:where(.svelte-4q66aa){background:var(--bg-sunken);border-radius:1px;width:4px;height:100%;position:relative;overflow:hidden}.meters.wide.svelte-4q66aa div:where(.svelte-4q66aa){width:5px}.meters.svelte-4q66aa span:where(.svelte-4q66aa){background:linear-gradient(to top, var(--success) 0 81.8%, var(--warning) 81.8% 90.9%, var(--danger) 90.9%);clip-path:inset(calc((1 - var(--lv,0)) * 100%) 0 0 0);position:absolute;inset:0}.fader.svelte-4q66aa{touch-action:none;justify-content:center;width:40px;padding:10px 0;display:flex;position:relative}.slot.svelte-4q66aa{background:var(--bg-sunken);width:3px;height:100%;box-shadow:var(--sunken);border-radius:1px}.travel.svelte-4q66aa{position:absolute;inset:10px 0}.cap.svelte-4q66aa{background:var(--surface-raised);border:1px solid var(--seam);height:20px;box-shadow:var(--bevel);border-radius:2px;justify-content:center;align-items:center;margin-bottom:-10px;display:flex;position:absolute;left:4px;right:4px}.cap.held.svelte-4q66aa{border-color:var(--accent)}.cap.svelte-4q66aa i:where(.svelte-4q66aa){background:var(--text-primary);border-radius:1px;width:18px;height:2px}.fader.act.svelte-4q66aa .cap:where(.svelte-4q66aa) i:where(.svelte-4q66aa){background:var(--accent)}.dbv.svelte-4q66aa{color:var(--text-strong);text-align:center;font-size:11px}.dbv.act.svelte-4q66aa{color:var(--accent-bright)}.btns.svelte-4q66aa{grid-template-columns:1fr 1fr;gap:4px;display:grid}.ms.svelte-4q66aa,.arm.svelte-4q66aa{background:var(--surface-raised);border:1px solid var(--seam);height:34px;box-shadow:var(--bevel);color:var(--text-secondary);transition:background-color var(--ease), color var(--ease);border-radius:2px;font-size:12px;font-weight:600}.ms.mute.svelte-4q66aa{background:var(--mute);border-color:var(--mute);box-shadow:none;color:var(--ink-on-mute)}.ms.solo.svelte-4q66aa{background:var(--solo);border-color:var(--solo);box-shadow:none;color:var(--ink-on-solo)}.arm.svelte-4q66aa{grid-column:span 2;justify-content:center;align-items:center;gap:5px;height:30px;font-size:11px;display:flex}.arm.svelte-4q66aa span:where(.svelte-4q66aa){background:var(--record);border-radius:50%;width:8px;height:8px}.arm.on.svelte-4q66aa{background:var(--record);border-color:var(--record);box-shadow:none;color:var(--ink-on-record)}.arm.on.svelte-4q66aa span:where(.svelte-4q66aa){background:var(--ink-on-record)}.rule.svelte-4q66aa{background:var(--seam);width:1px}.masterstrip.svelte-4q66aa{flex:0 0 84px}.tablet.svelte-4q66aa .masterstrip:where(.svelte-4q66aa){flex-basis:110px}.mh.svelte-4q66aa{justify-content:center}.macros.svelte-1x69070{touch-action:none;flex-direction:column;flex:1;gap:10px;min-height:0;display:flex}.dev.svelte-1x69070{background:var(--bg-sunken);height:44px;box-shadow:var(--sunken);text-align:left;border-radius:3px;align-items:center;gap:10px;padding:0 12px;display:flex}.k.svelte-1x69070{color:var(--text-muted);font-size:11px;font-weight:500}.dn.svelte-1x69070{min-width:0;color:var(--text-primary);white-space:nowrap;text-overflow:ellipsis;flex:1;font-size:13px;font-weight:600;overflow:hidden}.pos.svelte-1x69070{color:var(--text-tertiary);font-size:11px}.dev.svelte-1x69070 path:where(.svelte-1x69070){fill:none;stroke:var(--text-muted);stroke-width:1.5px}.grid.svelte-1x69070{background:var(--seam);border:1px solid var(--seam);border-radius:3px;flex:1;grid-auto-rows:minmax(0,1fr);gap:1px;min-height:0;display:grid;overflow:hidden}.knob.svelte-1x69070{background:var(--panel);touch-action:none;flex-direction:column;justify-content:center;align-items:center;gap:4px;min-height:0;display:flex;position:relative}.auto.svelte-1x69070{background:var(--text-muted);border-radius:50%;width:6px;height:6px;position:absolute;top:8px;right:8px}.trk.svelte-1x69070{fill:none;stroke:var(--bg-sunken);stroke-width:5px;stroke-linecap:round}.arc.svelte-1x69070{fill:none;stroke:var(--viz-ink);stroke-width:5px;stroke-linecap:round}.on.svelte-1x69070 .arc:where(.svelte-1x69070){stroke:var(--accent)}.capc.svelte-1x69070{fill:var(--surface-raised);stroke:var(--seam)}.ptr.svelte-1x69070{stroke:var(--text-primary);stroke-width:2.4px;stroke-linecap:round}.kn.svelte-1x69070{color:var(--text-secondary);white-space:nowrap;text-overflow:ellipsis;max-width:92%;font-size:11px;font-weight:500;overflow:hidden}.kv.svelte-1x69070{color:var(--text-primary);font-size:12px}.on.svelte-1x69070 .kn:where(.svelte-1x69070){color:var(--text-primary)}.on.svelte-1x69070 .kv:where(.svelte-1x69070){color:var(--accent-bright)}.knob.empty.svelte-1x69070 .kn:where(.svelte-1x69070),.knob.empty.svelte-1x69070 .kv:where(.svelte-1x69070){color:var(--text-faint)}.empty.svelte-1x69070{color:var(--text-tertiary);flex:1;justify-content:center;align-items:center;font-size:12px;display:flex}.knob.empty.svelte-1x69070{flex:initial;display:flex}.scroll.svelte-he2l50{touch-action:pan-x pan-y;overscroll-behavior:contain;flex:1;min-height:0;overflow:auto}.grid.svelte-he2l50{gap:4px;min-width:min-content;display:grid}.corner.svelte-he2l50{align-items:center;height:36px;padding-left:4px;display:flex}.th.svelte-he2l50{align-items:center;gap:6px;min-width:0;height:36px;padding:0 6px;display:flex}.th.svelte-he2l50 span:where(.svelte-he2l50){border-radius:1px;flex:none;width:3px;height:14px}.th.svelte-he2l50 b:where(.svelte-he2l50){color:var(--text-strong);white-space:nowrap;text-overflow:ellipsis;font-size:12px;font-weight:600;overflow:hidden}.scene.svelte-he2l50{background:var(--surface-raised);border:1px solid var(--seam);box-shadow:var(--bevel);color:var(--text-primary);border-radius:2px;align-items:center;gap:8px;padding:0 10px;font-size:12px;font-weight:600;display:flex}.tri.svelte-he2l50{border-left:9px solid var(--text-secondary);border-top:6px solid #0000;border-bottom:6px solid #0000;width:0;height:0}.clip.svelte-he2l50{background:var(--surface-raised);border:1px solid var(--seam);box-shadow:var(--bevel);text-align:left;border-radius:2px;flex-direction:column;justify-content:center;align-items:flex-start;gap:3px;min-width:0;padding:0 10px;display:flex;position:relative;overflow:hidden}.clip.empty.svelte-he2l50{background:var(--bg-sunken);box-shadow:none;border-color:#0000}.cn.svelte-he2l50{color:var(--text-strong);white-space:nowrap;align-items:center;gap:6px;font-size:12px;font-weight:600;display:flex}.cs.svelte-he2l50{color:var(--text-tertiary);font-size:11px}.clip.playing.svelte-he2l50,.clip.queued.svelte-he2l50{background:var(--tc);border-color:var(--tc);box-shadow:none}.clip.playing.svelte-he2l50 :where(.svelte-he2l50),.clip.queued.svelte-he2l50 :where(.svelte-he2l50){color:var(--tc-ink)}.clip.queued.svelte-he2l50{animation:.8s step-end infinite svelte-he2l50-blink}.clip.rec.svelte-he2l50{background:var(--record);border-color:var(--record);box-shadow:none}.clip.rec.svelte-he2l50 :where(.svelte-he2l50){color:var(--ink-on-record)}@keyframes svelte-he2l50-blink{50%{opacity:.35}}.ptri.svelte-he2l50{border-left:8px solid var(--tc-ink);border-top:5px solid #0000;border-bottom:5px solid #0000;width:0;height:0}.prog.svelte-he2l50{background:var(--tc-ink);height:3px;position:absolute;bottom:0;left:0}.stop.svelte-he2l50,.stopall.svelte-he2l50{background:var(--surface-raised);border:1px solid var(--seam);height:44px;box-shadow:var(--bevel);color:var(--text-secondary);border-radius:2px;justify-content:center;align-items:center;gap:6px;font-size:12px;font-weight:500;display:flex}.sq.svelte-he2l50{background:currentColor;border-radius:1px;width:9px;height:9px}.empty.svelte-he2l50{color:var(--text-tertiary);padding:20px;font-size:12px}.empty.svelte-i7n35i{text-align:center;background:var(--panel);box-shadow:0 0 0 1px var(--seam);border-radius:3px;flex-direction:column;flex:1;justify-content:center;align-items:center;gap:12px;padding:24px;display:flex}.t.svelte-i7n35i{color:var(--text-primary);font-size:14px;font-weight:600}.s.svelte-i7n35i{color:var(--text-tertiary);max-width:280px;font-size:12px;line-height:1.6}.btn.svelte-i7n35i{height:44px;padding:0 18px;font-size:13px}.shell.svelte-1n46o8q{background:var(--bg-app);padding:env(safe-area-inset-top) env(safe-area-inset-right) 0 env(safe-area-inset-left);flex-direction:column;display:flex;position:absolute;inset:0}.body.svelte-1n46o8q{flex:1;min-height:0;display:flex}main.svelte-1n46o8q{flex-direction:column;flex:1;min-width:0;padding:12px;transition:opacity .2s ease-out;display:flex;position:relative}.phoneLand.svelte-1n46o8q main:where(.svelte-1n46o8q){padding:8px 10px max(10px, env(safe-area-inset-bottom)) 10px}.tablet.svelte-1n46o8q main:where(.svelte-1n46o8q){padding:18px 18px max(18px, env(safe-area-inset-bottom))}main.dim.svelte-1n46o8q{opacity:.35;pointer-events:none}.rail.svelte-1n46o8q{background:var(--panel);border-right:1px solid var(--seam);flex-direction:column;flex:none;gap:2px;width:104px;padding:8px 6px;display:flex}.tablet.svelte-1n46o8q .rail:where(.svelte-1n46o8q){padding:12px 8px}.rail.svelte-1n46o8q button:where(.svelte-1n46o8q){height:44px;color:var(--text-muted);transition:background-color var(--ease), color var(--ease);border-radius:2px;font-size:12px;font-weight:500;position:relative}.tablet.svelte-1n46o8q .rail:where(.svelte-1n46o8q) button:where(.svelte-1n46o8q){height:56px;font-size:13px}.rail.svelte-1n46o8q button.on:where(.svelte-1n46o8q){background:var(--surface-hover);color:var(--text-primary)}.rail.svelte-1n46o8q button.on:where(.svelte-1n46o8q):before{content:"";background:var(--accent);width:2px;position:absolute;top:10px;bottom:10px;left:0}.tabs.svelte-1n46o8q{padding:0 6px max(8px, env(safe-area-inset-bottom));background:var(--panel);border-top:1px solid var(--seam);flex:none;display:flex}.tabs.svelte-1n46o8q button:where(.svelte-1n46o8q){min-width:0;height:48px;color:var(--text-muted);transition:color var(--ease);flex:1;font-size:12px;font-weight:500;position:relative}.tabs.svelte-1n46o8q button.on:where(.svelte-1n46o8q){color:var(--text-primary)}.tabs.svelte-1n46o8q button.on:where(.svelte-1n46o8q):before{content:"";background:var(--accent);height:2px;position:absolute;top:-1px;left:8px;right:8px}diff --git a/src/managed/Nota.Remote/wwwroot/icons/icon-180.png b/src/managed/Nota.Remote/wwwroot/icons/icon-180.pngindex d6c3a0d4..268faec0 100644Binary files a/src/managed/Nota.Remote/wwwroot/icons/icon-180.png and b/src/managed/Nota.Remote/wwwroot/icons/icon-180.png differdiff --git a/src/managed/Nota.Remote/wwwroot/icons/icon-192.png b/src/managed/Nota.Remote/wwwroot/icons/icon-192.pngindex 273c77ae..53ef897b 100644Binary files a/src/managed/Nota.Remote/wwwroot/icons/icon-192.png and b/src/managed/Nota.Remote/wwwroot/icons/icon-192.png differdiff --git a/src/managed/Nota.Remote/wwwroot/icons/icon-512.png b/src/managed/Nota.Remote/wwwroot/icons/icon-512.pngindex 7ba72c36..5c02eb5b 100644Binary files a/src/managed/Nota.Remote/wwwroot/icons/icon-512.png and b/src/managed/Nota.Remote/wwwroot/icons/icon-512.png differdiff --git a/src/managed/Nota.Remote/wwwroot/index.html b/src/managed/Nota.Remote/wwwroot/index.htmlindex 7367d2b5..12774b46 100644--- a/src/managed/Nota.Remote/wwwroot/index.html+++ b/src/managed/Nota.Remote/wwwroot/index.html@@ -3,7 +3,7 @@<head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no, viewport-fit=cover">- <meta name="theme-color" content="#0B0A09">+ <meta name="theme-color" content="#1E1F22"><meta name="apple-mobile-web-app-capable" content="yes"><meta name="mobile-web-app-capable" content="yes"><!-- No black-translucent: since iOS 26 it lays a Liquid Glass blur over the top of a Home@@ -16,8 +16,20 @@<link rel="apple-touch-icon" href="./icons/icon-180.png"><link rel="preload" href="./fonts/Geist-SemiBold.woff2" as="font" type="font/woff2" crossorigin><title>Nota Remote</title>- <script type="module" crossorigin src="./assets/index-DhoOZbYt.js"></script>- <link rel="stylesheet" crossorigin href="./assets/index-HyP_ksps.css">+ <!-- A returning phone paints in the theme it last wore, before the app loads (spec 014;+ src/lib/theme.svelte.ts stores it). A new one gets the built-in fallback. -->+ <script>+ try {+ var s = JSON.parse(localStorage.getItem('nota-remote:vars') || 'null'), r = document.documentElement;+ if (s && s.v) {+ r.dataset.theme = s.dark ? 'dark' : 'light';+ for (var k in s.v) r.style.setProperty(k, s.v[k]);+ if (s.v['--bg-app']) document.querySelector('meta[name=theme-color]').setAttribute('content', s.v['--bg-app']);+ }+ } catch (e) { /* private mode, or nothing stored */ }+ </script>+ <script type="module" crossorigin src="./assets/index-DT5MFtDx.js"></script>+ <link rel="stylesheet" crossorigin href="./assets/index-kPw-fb1K.css"></head><body><div id="app"></div>diff --git a/src/managed/Nota.Remote/wwwroot/manifest.webmanifest b/src/managed/Nota.Remote/wwwroot/manifest.webmanifestindex cfa49749..0c6f359b 100644--- a/src/managed/Nota.Remote/wwwroot/manifest.webmanifest+++ b/src/managed/Nota.Remote/wwwroot/manifest.webmanifest@@ -6,8 +6,8 @@"scope": "./","display": "standalone","orientation": "any",- "background_color": "#0B0A09",- "theme_color": "#0B0A09",+ "background_color": "#1E1F22",+ "theme_color": "#1E1F22","icons": [{ "src": "icons/icon-192.png", "sizes": "192x192", "type": "image/png" },{ "src": "icons/icon-512.png", "sizes": "512x512", "type": "image/png" },diff --git a/src/web/remote/index.html b/src/web/remote/index.htmlindex bc092ff2..625acdce 100644--- a/src/web/remote/index.html+++ b/src/web/remote/index.html@@ -3,7 +3,7 @@<head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no, viewport-fit=cover">- <meta name="theme-color" content="#0B0A09">+ <meta name="theme-color" content="%NOTA_BG_APP%"><meta name="apple-mobile-web-app-capable" content="yes"><meta name="mobile-web-app-capable" content="yes"><!-- No black-translucent: since iOS 26 it lays a Liquid Glass blur over the top of a Home@@ -16,6 +16,18 @@<link rel="apple-touch-icon" href="./icons/icon-180.png"><link rel="preload" href="./fonts/Geist-SemiBold.woff2" as="font" type="font/woff2" crossorigin><title>Nota Remote</title>+ <!-- A returning phone paints in the theme it last wore, before the app loads (spec 014;+ src/lib/theme.svelte.ts stores it). A new one gets the built-in fallback. -->+ <script>+ try {+ var s = JSON.parse(localStorage.getItem('nota-remote:vars') || 'null'), r = document.documentElement;+ if (s && s.v) {+ r.dataset.theme = s.dark ? 'dark' : 'light';+ for (var k in s.v) r.style.setProperty(k, s.v[k]);+ if (s.v['--bg-app']) document.querySelector('meta[name=theme-color]').setAttribute('content', s.v['--bg-app']);+ }+ } catch (e) { /* private mode, or nothing stored */ }+ </script></head><body><div id="app"></div>diff --git a/src/web/remote/mock/nota-mock.mjs b/src/web/remote/mock/nota-mock.mjsnew file mode 100644index 00000000..e3180fae--- /dev/null+++ b/src/web/remote/mock/nota-mock.mjs@@ -0,0 +1,237 @@+// SPDX-License-Identifier: AGPL-3.0-only+// A stand-in Nota for working on the phone page without the desktop app: it serves the built+// page (Nota.Remote/wwwroot) and speaks enough of the Remote protocol — pairing, a demo+// project, transport, mixer, XY, macros, Session and the theme message built from the real+// theme files — to show every screen. For screenshots and design review; Nota itself is the+// reference (Nota.Remote/RemoteHub*.cs). No dependencies: the WebSocket is hand-rolled.+//+// npm run mock then open http://127.0.0.1:7790/#p=1234 at phone width+// ?theme=<id> the theme the stand-in wears (any Theme/Themes/<id>.json)+// ?pick=<dark>,<light> its dark-mode and light-mode picks+// ?legacy=1 behave like an older Nota: no theme message, only proj.dark+// GET /mock?theme=<id> switch the worn theme live for the connected phones++import { createServer } from 'node:http';+import { createHash } from 'node:crypto';+import { readFileSync, existsSync, statSync, readdirSync } from 'node:fs';+import { join, extname, normalize, dirname } from 'node:path';+import { fileURLToPath } from 'node:url';++const here = dirname(fileURLToPath(import.meta.url));+const root = join(here, '../../../managed/Nota.Remote/wwwroot');+const themesDir = join(here, '../../../managed/Nota.App/Theme/Themes');+const port = Number(process.env.PORT ?? 7790);++// ---- themes -------------------------------------------------------------------------++const themes = Object.fromEntries(readdirSync(themesDir).filter((f) => f.endsWith('.json')).map((f) => {+ const t = JSON.parse(readFileSync(join(themesDir, f), 'utf8'));+ // Avalonia writes #AARRGGBB; CSS reads #RRGGBBAA.+ const c = Object.fromEntries(Object.entries(t.colors).map(([k, v]) => [k, v.length === 9 ? '#' + v.slice(3) + v.slice(1, 3) : v]));+ return [t.id, { name: t.name, dark: t.kind === 'dark', c }];+}));+const look = { on: 'studio-dark', dark: 'studio-dark', light: 'studio-light', legacy: false };++function themeMessage() {+ const ids = [...new Set([look.on, look.dark, look.light])];+ const ink = [themes['studio-dark'].c.TextOnAccent, themes['studio-dark'].c.ShadeUp];+ return { t: 'theme', on: look.on, dark: look.dark, light: look.light, ink, th: Object.fromEntries(ids.map((id) => [id, themes[id]])) };+}++function readLook(url) {+ const q = new URL(url, 'http://x').searchParams;+ if (themes[q.get('theme')]) look.on = q.get('theme');+ const pick = (q.get('pick') ?? '').split(',');+ if (themes[pick[0]]?.dark) look.dark = pick[0];+ if (themes[pick[1]] && !themes[pick[1]].dark) look.light = pick[1];+ if (q.has('legacy')) look.legacy = q.get('legacy') === '1';+}++// ---- the demo project -----------------------------------------------------------------++const colour = (slot) => themes[look.on].c[`Track${slot}`];+const trackDefs = [+ { id: 1, name: 'Drums', slot: 1, kind: 'drum', dev: 'Nota Rhythm', grp: 0 },+ { id: 2, name: 'Bass', slot: 3, kind: 'inst', dev: 'Nota Volt', grp: 0, mpe: true },+ { id: 3, name: 'Keys', slot: 4, kind: 'inst', dev: 'Nota Aurora', grp: 0 },+ { id: 4, name: 'Vocals', slot: 8, kind: 'audio', dev: 'Audio', grp: 0 },+ { id: 5, name: 'Pads', slot: 5, kind: 'group', dev: 'Group', grp: 0 },+ { id: 6, name: 'Strings', slot: 6, kind: 'inst', dev: 'Nota Chamber', grp: 5 },+ { id: 7, name: 'Reverb', slot: 9, kind: 'return', dev: 'Return', grp: 0 },+];+const pads = [[36, 'Kick'], [37, 'Rim'], [38, 'Snare'], [39, 'Clap'], [42, 'Closed hat'], [46, 'Open hat'], [45, 'Low tom'], [49, 'Crash']];++const state = {+ tp: { play: true, rec: false, loop: true, met: false, pos: 22.5, bpm: 122, ls: 16, le: 32, can: true },+ mix: new Map(trackDefs.map((t, i) => [t.id, { vol: [0.9, 0.75, 0.6, 1.1, 0.8, 0.7, 0.5][i], pan: [0, -0.2, 0.3, 0, 0, -0.4, 0][i], mute: t.id === 3, solo: t.id === 2, arm: t.id === 4 }])),+ master: 1,+ you: 1,+ follow: false,+ started: Date.now(),+};++function proj() {+ return {+ t: 'proj', host: 'Studio Mac', dark: themes[look.on].dark,+ tracks: trackDefs.map((t) => ({ id: t.id, name: t.name, color: colour(t.slot), kind: t.kind, dev: t.dev, grp: t.grp, ...(t.mpe ? { mpe: true } : {}), ...(t.kind === 'drum' ? { pads } : {}) })),+ key: { root: 9, minor: true, name: 'A minor' }, scenes: 4,+ sections: [['Intro', 0], ['Verse', 16], ['Chorus', 32], ['Bridge', 48], ['Outro', 64]],+ access: 'control', you: state.you, follow: state.follow,+ };+}++const level = (base, t, k) => Math.max(0, Math.min(0.95, base + 0.08 * Math.sin(t * (2.1 + k)) + 0.05 * Math.sin(t * 7.3 + k)));+function mix() {+ const t = (Date.now() - state.started) / 1000;+ return {+ t: 'mix',+ ch: trackDefs.map((d, i) => {+ const m = state.mix.get(d.id);+ const on = state.tp.play && !m.mute;+ return [d.id, m.vol, m.pan, m.mute ? 1 : 0, m.solo ? 1 : 0, m.arm ? 1 : 0, on ? level(0.62 + i * 0.03, t, i) : 0, on ? level(0.6 + i * 0.03, t, i + 0.5) : 0, d.id === 3 ? 'Anna' : '', d.id === 3 ? 99 : 0];+ }),+ m: [state.master, state.tp.play ? level(0.8, t, 9) : 0, state.tp.play ? level(0.79, t, 9.4) : 0, '', 0],+ };+}++const xy = () => ({ t: 'xy', id: state.you, ok: true, auto: false, x: { n: 'Cutoff', d: 'Auto Filter', v: 0.62, txt: '2.4 kHz', map: null, tilt: null }, y: { n: 'Resonance', d: 'Auto Filter', v: 0.35, txt: '35 %', map: null, tilt: null } });+const mac = () => ({+ t: 'mac', id: state.you, di: 0, devs: ['Nota Volt', 'Auto Filter', 'Reverb'],+ k: [+ { n: 'Cutoff', v: 0.64, txt: '3.1 kHz', a: true, map: null }, { n: 'Reso', v: 0.3, txt: '30 %', map: null },+ { n: 'Drive', v: 0.45, txt: '+4.5 dB', map: null }, { n: 'Env amount', v: 0.7, txt: '70 %', map: null },+ { n: 'Attack', v: 0.12, txt: '12 ms', map: null }, { n: 'Decay', v: 0.4, txt: '420 ms', map: null },+ { n: 'LFO rate', v: 0.55, txt: '2.20 Hz', map: null }, { map: null },+ ],+});+function ses() {+ const prog = (((Date.now() - state.started) / 1000) % 8) / 8;+ return {+ t: 'ses', n: 4,+ tr: [+ { id: 1, c: [[3, 16, prog], [1, 16, 0], [1, 8, 0], [0, 0, 0]] },+ { id: 2, c: [[1, 16, 0], [3, 16, prog], [2, 16, 0], [0, 0, 0]] },+ { id: 3, c: [[1, 32, 0], [0, 0, 0], [1, 16, 0], [1, 4, 0]] },+ { id: 4, c: [[0, 0, 0], [4, 16, 0], [0, 0, 0], [0, 0, 0]] },+ { id: 6, c: [[1, 16, 0], [1, 16, 0], [0, 0, 0], [3, 16, prog]] },+ ],+ };+}++// ---- WebSocket ----------------------------------------------------------------------++const clients = new Set();++function frame(text) {+ const data = Buffer.from(text);+ const n = data.length;+ const head = n < 126 ? Buffer.from([0x81, n]) : n < 65536 ? Buffer.from([0x81, 126, n >> 8, n & 255]) : Buffer.concat([Buffer.from([0x81, 127, 0, 0, 0, 0]), Buffer.from([(n >>> 24) & 255, (n >>> 16) & 255, (n >>> 8) & 255, n & 255])]);+ return Buffer.concat([head, data]);+}++function onSocket(sock) {+ const c = { sock, screen: 'Pads', buf: Buffer.alloc(0), paired: false };+ clients.add(c);+ const send = (m) => { if (!sock.destroyed) sock.write(frame(JSON.stringify(m))); };+ c.send = send;+ sock.on('data', (chunk) => {+ c.buf = Buffer.concat([c.buf, chunk]);+ while (c.buf.length >= 2) {+ const op = c.buf[0] & 15;+ let len = c.buf[1] & 127, off = 2;+ if (len === 126) { len = c.buf.readUInt16BE(2); off = 4; } else if (len === 127) { len = Number(c.buf.readBigUInt64BE(2)); off = 10; }+ if (c.buf.length < off + 4 + len) return;+ const mask = c.buf.subarray(off, off + 4);+ const body = Buffer.from(c.buf.subarray(off + 4, off + 4 + len));+ for (let i = 0; i < body.length; i++) body[i] ^= mask[i & 3];+ c.buf = c.buf.subarray(off + 4 + len);+ if (op === 8) { sock.end(); return; }+ if (op === 1) { try { onMessage(c, JSON.parse(body.toString())); } catch { /* ignore */ } }+ }+ });+ sock.on('close', () => clients.delete(c));+ sock.on('error', () => clients.delete(c));+}++function sendScreen(c) {+ const s = { Mixer: mix, XY: xy, Macros: mac, Scenes: ses }[c.screen];+ if (s) c.send(s());+}++function welcome(c, m) {+ c.paired = true;+ c.screen = m.screen ?? c.screen;+ if (trackDefs.some((t) => t.id === m.track && t.kind !== 'group' && t.kind !== 'return')) state.you = m.track;+ c.send({ t: 'welcome', token: 'mock-token-0123456789abcdef', host: 'Studio Mac', conn: 1, via: 'wifi', name: m.name ?? 'iPhone' });+ if (!look.legacy) c.send(themeMessage());+ c.send(proj());+ c.send({ t: 'tp', ...state.tp });+ c.send({ t: 'who', p: { 3: ['Anna'] } });+ c.send({ t: 'learn', on: false, pend: null });+ sendScreen(c);+}++function onMessage(c, m) {+ const tp = state.tp, ch = state.mix.get(m.id);+ switch (m.t) {+ case 'pair': case 'hello': welcome(c, m); break;+ case 'ping': c.send({ t: 'pong', c: m.c }); break;+ case 'sub': c.screen = m.s; sendScreen(c); break;+ case 'track': state.you = m.id; broadcast(proj()); break;+ case 'follow': state.follow = m.on; broadcast(proj()); break;+ case 'play': tp.play = true; broadcast({ t: 'tp', ...tp }); break;+ case 'stop': tp.play = false; tp.rec = false; broadcast({ t: 'tp', ...tp }); break;+ case 'rec': tp.rec = m.on; if (m.on) tp.play = true; broadcast({ t: 'tp', ...tp }); break;+ case 'loop': tp.loop = m.on; broadcast({ t: 'tp', ...tp }); break;+ case 'met': tp.met = m.on; broadcast({ t: 'tp', ...tp }); break;+ case 'bpm': tp.bpm = m.v; broadcast({ t: 'tp', ...tp }); break;+ case 'mute': case 'solo': case 'arm': if (ch) ch[m.t] = m.on; break;+ case 'vol': if (ch) ch.vol = m.v; break;+ case 'pan': if (ch) ch.pan = m.v; break;+ case 'mvol': state.master = m.v; break;+ case 'on': c.send({ t: 'lit', n: [m.p] }); break;+ case 'off': c.send({ t: 'lit', n: [] }); break;+ }+}++function broadcast(m) { for (const c of clients) if (c.paired) c.send(m); }++// Transport and screen state tick on, so meters move and clips progress.+setInterval(() => {+ if (state.tp.play) {+ state.tp.pos += (state.tp.bpm / 60) * 0.25;+ if (state.tp.loop && state.tp.pos >= state.tp.le) state.tp.pos = state.tp.ls;+ broadcast({ t: 'tp', ...state.tp });+ }+ for (const c of clients) if (c.paired && (c.screen === 'Mixer' || c.screen === 'Scenes')) sendScreen(c);+}, 250);++// ---- HTTP -----------------------------------------------------------------------------++const types = { '.html': 'text/html; charset=utf-8', '.js': 'text/javascript', '.css': 'text/css', '.json': 'application/json', '.webmanifest': 'application/manifest+json', '.png': 'image/png', '.woff2': 'font/woff2', '.mp4': 'video/mp4', '.svg': 'image/svg+xml' };++const server = createServer((req, res) => {+ const url = new URL(req.url, 'http://x');+ if (url.pathname === '/mock') {+ readLook(req.url);+ if (!look.legacy) broadcast(themeMessage());+ broadcast(proj());+ res.end(JSON.stringify(look));+ return;+ }+ if (url.pathname === '/' || url.pathname === '/index.html') readLook(req.url);+ let file = normalize(join(root, decodeURIComponent(url.pathname)));+ if (!file.startsWith(root) || !existsSync(file) || statSync(file).isDirectory()) file = join(root, 'index.html');+ res.writeHead(200, { 'Content-Type': types[extname(file)] ?? 'application/octet-stream', 'Cache-Control': 'no-store' });+ res.end(readFileSync(file));+});++server.on('upgrade', (req, sock) => {+ const key = req.headers['sec-websocket-key'];+ if (!key) { sock.destroy(); return; }+ const accept = createHash('sha1').update(key + '258EAFA5-E914-47DA-95CA-C5AB0DC85B11').digest('base64');+ sock.write(`HTTP/1.1 101 Switching Protocols\r\nUpgrade: websocket\r\nConnection: Upgrade\r\nSec-WebSocket-Accept: ${accept}\r\n\r\n`);+ onSocket(sock);+});++server.listen(port, '127.0.0.1', () => console.log(`Stand-in Nota on http://127.0.0.1:${port}/#p=1234`));diff --git a/src/web/remote/package.json b/src/web/remote/package.jsonindex c5b692d5..407a30e4 100644--- a/src/web/remote/package.json+++ b/src/web/remote/package.json@@ -9,7 +9,8 @@"dev": "vite","build": "vite build","check": "svelte-check --tsconfig ./tsconfig.json",- "preview": "vite preview"+ "preview": "vite preview",+ "mock": "node mock/nota-mock.mjs"},"devDependencies": {"@sveltejs/vite-plugin-svelte": "^7.3.1",diff --git a/src/web/remote/public/icons/icon-180.png b/src/web/remote/public/icons/icon-180.pngindex d6c3a0d4..268faec0 100644Binary files a/src/web/remote/public/icons/icon-180.png and b/src/web/remote/public/icons/icon-180.png differdiff --git a/src/web/remote/public/icons/icon-192.png b/src/web/remote/public/icons/icon-192.pngindex 273c77ae..53ef897b 100644Binary files a/src/web/remote/public/icons/icon-192.png and b/src/web/remote/public/icons/icon-192.png differdiff --git a/src/web/remote/public/icons/icon-512.png b/src/web/remote/public/icons/icon-512.pngindex 7ba72c36..5c02eb5b 100644Binary files a/src/web/remote/public/icons/icon-512.png and b/src/web/remote/public/icons/icon-512.png differdiff --git a/src/web/remote/public/manifest.webmanifest b/src/web/remote/public/manifest.webmanifestindex cfa49749..0c6f359b 100644--- a/src/web/remote/public/manifest.webmanifest+++ b/src/web/remote/public/manifest.webmanifest@@ -6,8 +6,8 @@"scope": "./","display": "standalone","orientation": "any",- "background_color": "#0B0A09",- "theme_color": "#0B0A09",+ "background_color": "#1E1F22",+ "theme_color": "#1E1F22","icons": [{ "src": "icons/icon-192.png", "sizes": "192x192", "type": "image/png" },{ "src": "icons/icon-512.png", "sizes": "512x512", "type": "image/png" },diff --git a/src/web/remote/src/App.svelte b/src/web/remote/src/App.svelteindex ef5edd0b..91281108 100644--- a/src/web/remote/src/App.svelte+++ b/src/web/remote/src/App.svelte@@ -1,6 +1,7 @@<!-- SPDX-License-Identifier: AGPL-3.0-only --><script lang="ts">import { app } from './lib/app.svelte';+ import { look } from './lib/theme.svelte';import { device, keepAwake } from './lib/device.svelte';import { SCREENS } from './lib/types';import Header from './components/Header.svelte';@@ -22,10 +23,8 @@const noInstrument = $derived(t?.kind === 'audio' && (app.screen === 'Pads' || app.screen === 'Keys'));const dim = $derived(app.link === 'lost' || app.link === 'connecting');- $effect(() => {- document.documentElement.dataset.theme = app.dark ? 'dark' : 'light';- document.querySelector('meta[name=theme-color]')?.setAttribute('content', app.dark ? '#0B0A09' : '#DCD6C5');- });+ // Wear the theme: Nota's, or under Follow phone the pick for the phone's scheme (spec 014).+ $effect(() => look.apply(app.prefs.theme));</script><!-- The first touch anywhere starts keep-awake (browsers want a gesture for it). -->@@ -63,11 +62,9 @@</div>{#if !rail}<nav class="tabs" aria-label="Screens">- <div class="seg">- {#each SCREENS as s}- <button class:on={app.screen === s && !app.bigTransport} onclick={() => app.setScreen(s)}>{s}</button>- {/each}- </div>+ {#each SCREENS as s}+ <button class:on={app.screen === s && !app.bigTransport} aria-current={app.screen === s && !app.bigTransport ? 'page' : undefined} onclick={() => app.setScreen(s)}>{s}</button>+ {/each}</nav>{/if}<Sheets {form} />@@ -76,21 +73,27 @@<style>.shell {- position: absolute; inset: 0; display: flex; flex-direction: column; background: var(--app);+ position: absolute; inset: 0; display: flex; flex-direction: column; background: var(--bg-app);padding: env(safe-area-inset-top) env(safe-area-inset-right) 0 env(safe-area-inset-left);}.body { flex: 1; min-height: 0; display: flex; }main { flex: 1; min-width: 0; position: relative; display: flex; flex-direction: column; padding: 12px; transition: opacity 200ms ease-out; }.phoneLand main { padding: 8px 10px max(10px, env(safe-area-inset-bottom)) 10px; }.tablet main { padding: 18px 18px max(18px, env(safe-area-inset-bottom)); }+ /* The link is down: touches are not sent, so the surface steps back until it returns. */main.dim { opacity: .35; pointer-events: none; }- .rail { width: 104px; flex: none; display: flex; flex-direction: column; gap: 4px; padding: 8px; border-right: 1px solid var(--hairline); }- .tablet .rail { padding: 12px 10px; }- .rail button { height: 44px; border-radius: 5px; font-size: 11px; font-weight: 600; color: var(--ink4); position: relative; transition: background-color 120ms ease-out, color 120ms ease-out; }++ /* Rail (landscape, tablet): a docked panel on a seam; the chosen screen is a row with an accent tick. */+ .rail { width: 104px; flex: none; display: flex; flex-direction: column; gap: 2px; padding: 8px 6px; background: var(--panel); border-right: 1px solid var(--seam); }+ .tablet .rail { padding: 12px 8px; }+ .rail button { height: 44px; border-radius: 2px; font-size: 12px; font-weight: 500; color: var(--text-muted); position: relative; transition: background-color var(--ease), color var(--ease); }.tablet .rail button { height: 56px; font-size: 13px; }- .rail button.on { background: var(--raised); color: var(--ink1); }- .rail button.on::before { content: ''; position: absolute; left: 0; top: 10px; bottom: 10px; width: 2px; border-radius: 1px; background: var(--accent); }- .tabs { flex: none; padding: 8px 12px max(12px, env(safe-area-inset-bottom)); border-top: 1px solid var(--hairline); }- .tabs .seg { border-radius: 8px; }- .tabs .seg button { height: 44px; padding: 0; font-size: 11px; min-width: 0; border-radius: 5px; }+ .rail button.on { background: var(--surface-hover); color: var(--text-primary); }+ .rail button.on::before { content: ''; position: absolute; left: 0; top: 10px; bottom: 10px; width: 2px; background: var(--accent); }++ /* Tabs (portrait): a docked bar; the chosen screen is primary ink with an accent line on the edge facing it. */+ .tabs { flex: none; display: flex; padding: 0 6px max(8px, env(safe-area-inset-bottom)); background: var(--panel); border-top: 1px solid var(--seam); }+ .tabs button { flex: 1; min-width: 0; height: 48px; font-size: 12px; font-weight: 500; color: var(--text-muted); position: relative; transition: color var(--ease); }+ .tabs button.on { color: var(--text-primary); }+ .tabs button.on::before { content: ''; position: absolute; left: 8px; right: 8px; top: -1px; height: 2px; background: var(--accent); }</style>diff --git a/src/web/remote/src/app.css b/src/web/remote/src/app.cssindex 4d69060a..4981ff55 100644--- a/src/web/remote/src/app.css+++ b/src/web/remote/src/app.css@@ -1,45 +1,27 @@/* SPDX-License-Identifier: AGPL-3.0-only */-/* Ember tokens, mirrored from src/managed/Nota.App/Theme/NotaTheme.axaml (Dark / Light).- The theme file is definitive: change a value there first, then here. */+/* Nota Remote in Studio (DESIGN.md, spec 014). No colour value lives here: every colour is a+ theme token as a custom property (BgApp → --bg-app), set from the theme Nota sends+ (lib/theme.svelte.ts) over the fallback built from the theme files (theme-plugin.ts).+ Structure follows the desktop: one accent for what is live or chosen, values neutral at+ rest, panels on 1 px seams, radii 2 / 3 / 4, sentence case, Geist and Geist Mono. Sizes+ stay phone-sized — touch targets 36–56 px. */@font-face { font-family: 'Geist'; font-weight: 400; font-display: swap; src: url('/fonts/Geist-Regular.woff2') format('woff2'); }@font-face { font-family: 'Geist'; font-weight: 500 700; font-display: swap; src: url('/fonts/Geist-SemiBold.woff2') format('woff2'); }@font-face { font-family: 'Geist Mono'; font-weight: 400 700; font-display: swap; src: url('/fonts/GeistMono-Medium.woff2') format('woff2'); }-:root, [data-theme='dark'] {- --abyss: #0A0908; --app: #0B0A09; --gutter: #0C0B09; --well: #100F0D; --panel: #141310;- --card: #171613; --raised: #1C1A16; --hover: #252219; --track-off: #26231E; --selected: #241F17;- --hairline: #221F1A; --border: #2C2923; --border-strong: #3A362D; --border-brass: #6B5326;- --grid: #1E1C18;- --ink0: #F2EDE1; --ink1: #E9E4D8; --ink2: #C7C0B0; --ink3: #A39D8F; --ink4: #8D8779; --ink5: #6E6A5E; --ink6: #55514A;- --on-accent: #171613;- --accent: #D8A03D; --accent-bright: #F0C060; --accent-dim: #8A6B2E; --accent-edge: #5E4A22; --accent-wash: #241F17;- --record: #C25B44; --record-wash: #2A1A16; --record-ink: #E08A72;- --danger: #C2554A; --danger-bright: #E08A72; --warning: #D9C34C; --success: #58B368; --success-dim: #7FB069;- --steel: #6D8FB5;- --white-key: #D9D3C5; --white-key-ink: #55514A;- --scrim: rgba(10, 9, 8, 0.6);- color-scheme: dark;-}-[data-theme='light'] {- --abyss: #D8D1BE; --app: #DCD6C5; --gutter: #E0DAC9; --well: #E4DFD1; --panel: #EAE5D7;- --card: #EFEADE; --raised: #F8F5EC; --hover: #E7E1D0; --track-off: #DBD4C0; --selected: #F2E4C4;- --hairline: #D5CFBE; --border: #D5CEBB; --border-strong: #BDB5A0; --border-brass: #C9A254;- --grid: #DED8C8;- --ink0: #1A150E; --ink1: #241F17; --ink2: #3E382C; --ink3: #5E5849; --ink4: #746D5C; --ink5: #8A8474; --ink6: #9E9786;- --on-accent: #FFFBF2;- --accent: #A87415; --accent-bright: #744D07; --accent-dim: #9C8034; --accent-edge: #D3B173; --accent-wash: #F2E4C4;- --record: #B54A32; --record-wash: #F3DDD4; --record-ink: #A3391B;- --danger: #B13E33; --danger-bright: #A3391B; --warning: #837010; --success: #2C7A3E; --success-dim: #609548;- --steel: #3E6288;- --white-key: #FBF9F3; --white-key-ink: #8A8474;- --scrim: rgba(36, 31, 23, 0.35);- color-scheme: light;+:root {+ /* Elevation, built from the theme's colours as on the desktop (NotaThemeService). */+ --bevel: inset 0 1px 0 0 var(--shadow-bevel);+ --sunken: inset 0 0 0 1px var(--rule);+ --popover: 0 0 0 1px var(--seam), 0 10px 28px 0 var(--shadow-popover);+ --scrim: var(--shadow-modal);+ --ease: 120ms ease-out;}* { box-sizing: border-box; margin: 0; padding: 0; }html, body {- height: 100%; overflow: hidden; background: var(--app); color: var(--ink1);+ height: 100%; overflow: hidden; background: var(--bg-app); color: var(--text-primary);font-family: Geist, system-ui, -apple-system, sans-serif; font-size: 13px;-webkit-text-size-adjust: 100%; -webkit-tap-highlight-color: transparent;user-select: none; -webkit-user-select: none; -webkit-touch-callout: none;@@ -49,22 +31,38 @@ body { position: fixed; inset: 0; }#app { position: fixed; inset: 0; }button { font: inherit; color: inherit; background: none; border: none; cursor: pointer; touch-action: manipulation; }input { font: inherit; color: inherit; user-select: text; -webkit-user-select: text; touch-action: manipulation; }+svg path { stroke-linecap: round; stroke-linejoin: round; }.mono { font-family: 'Geist Mono', ui-monospace, monospace; font-variant-numeric: tabular-nums; }-.caps { font-size: 10px; font-weight: 700; letter-spacing: .14em; color: var(--ink5); text-transform: uppercase; }+/* A section label: sentence case, never tracked (DESIGN.md § Labels). */+.label { font-size: 11px; font-weight: 600; color: var(--text-muted); }.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }-/* Shared controls */+/* A raised key: seam border, top bevel. On = solid accent with derived ink; pressed sinks into the well. */.btn {height: 42px; padding: 0 12px; display: inline-flex; align-items: center; justify-content: center; gap: 7px;- border-radius: 5px; background: var(--raised); border: 1px solid var(--border); color: var(--ink2);- font-size: 12px; font-weight: 600; transition: background-color 120ms ease-out, border-color 120ms ease-out, color 120ms ease-out;+ border-radius: 3px; background: var(--surface-raised); border: 1px solid var(--seam); box-shadow: var(--bevel);+ color: var(--text-strong); font-size: 12px; font-weight: 500;+ transition: background-color var(--ease), border-color var(--ease), color var(--ease);+}+.btn:active { background: var(--bg-sunken); box-shadow: none; }+.btn.on { background: var(--accent); border-color: var(--accent); color: var(--ink-on-accent); box-shadow: none; }+@media (hover: hover) { .btn:not(.on):hover { background: var(--surface-hover); } }++/* A segmented group: keys butted on 1 px seams, only the group's outer corners round. */+.seg { display: flex; gap: 1px; background: var(--seam); border: 1px solid var(--seam); border-radius: 3px; overflow: hidden; }+.seg > button {+ height: 36px; padding: 0 11px; flex: 1; background: var(--surface-raised); box-shadow: var(--bevel);+ color: var(--text-secondary); font-size: 12px; font-weight: 500;+ transition: background-color var(--ease), color var(--ease);}-.btn.on { background: var(--accent-wash); border-color: var(--border-brass); color: var(--accent-bright); }-.seg { display: flex; gap: 2px; background: var(--well); border: 1px solid var(--hairline); border-radius: 6px; padding: 3px; }-.seg > button { height: 36px; padding: 0 11px; border-radius: 4px; color: var(--ink4); font-size: 12px; font-weight: 600; flex: 1; transition: background-color 120ms ease-out, color 120ms ease-out; }-.seg > button.on { background: var(--raised); color: var(--ink1); }-.switch { width: 18px; height: 10px; border-radius: 5px; background: var(--track-off); position: relative; flex: none; display: block; }-.switch::after { content: ''; position: absolute; top: 1.5px; left: 1.5px; width: 7px; height: 7px; border-radius: 50%; background: var(--ink5); transition: left 120ms ease-out; }-.switch.on { background: var(--accent); }-.switch.on::after { left: 9.5px; background: var(--on-accent); }-.learnable { outline: 1px dashed var(--accent-dim); outline-offset: 2px; }+.seg > button:active { background: var(--bg-sunken); box-shadow: none; }+.seg > button.on { background: var(--accent); color: var(--ink-on-accent); box-shadow: none; }++/* The Settings-size switch: 28 × 16, squared knob 12, inset 2. */+.switch { width: 28px; height: 16px; border-radius: 2px; background: var(--bg-sunken); box-shadow: var(--sunken); position: relative; flex: none; display: block; transition: background-color var(--ease); }+.switch::after { content: ''; position: absolute; top: 2px; left: 2px; width: 12px; height: 12px; border-radius: 1px; background: var(--text-tertiary); transition: left var(--ease), background-color var(--ease); }+.switch.on { background: var(--accent); box-shadow: none; }+.switch.on::after { left: 14px; background: var(--panel); }++/* A control Nota's MIDI Learn can map, while Learn is on. */+.learnable { outline: 1px dashed var(--accent); outline-offset: 2px; }diff --git a/src/web/remote/src/components/Banner.svelte b/src/web/remote/src/components/Banner.svelteindex 7236bb22..148e3bdb 100644--- a/src/web/remote/src/components/Banner.svelte+++ b/src/web/remote/src/components/Banner.svelte@@ -7,9 +7,9 @@if (app.link === 'lost')return { kind: 'quiet', title: `Reconnecting to ${app.host}…`, sub: 'Touches are not sent until the link is back' };if (app.learn.on && app.live) {- if (app.learned) return { kind: 'brass', title: `Mapped ${app.learned}`, sub: 'Click another control in Nota to keep mapping' };+ if (app.learned) return { kind: 'learn', title: `Mapped ${app.learned}`, sub: 'Click another control in Nota to keep mapping' };return {- kind: 'brass',+ kind: 'learn',title: app.learn.pend ? `Nota is listening: ${app.learn.pend}` : 'MIDI Learn is on in Nota',sub: app.learn.pend? 'Move a macro, an XY axis or tilt the phone. Pads, keys and the mixer can’t be mapped.'@@ -31,13 +31,12 @@{/if}<style>- .banner { flex: none; display: flex; align-items: center; gap: 10px; padding: 9px 16px; border-bottom: 1px solid var(--border-brass); background: var(--accent-wash); }- .banner.quiet { background: var(--panel); border-color: var(--border); }+ /* A docked strip under the header. MIDI Learn listening is live, so its dot is the accent. */+ .banner { flex: none; display: flex; align-items: center; gap: 10px; padding: 9px 16px; background: var(--panel); border-bottom: 1px solid var(--seam); }.dot { width: 8px; height: 8px; border-radius: 50%; flex: none; background: var(--accent); }- .quiet .dot { background: var(--ink4); }+ .quiet .dot { background: var(--text-tertiary); }.blink { animation: blink 800ms steps(1) infinite; }@keyframes blink { 50% { opacity: .35; } }- .t { font-size: 12px; font-weight: 600; color: var(--accent-bright); }- .quiet .t { color: var(--ink1); }- .s { font-size: 11px; color: var(--ink3); }+ .t { font-size: 12px; font-weight: 600; color: var(--text-primary); }+ .s { font-size: 11px; color: var(--text-secondary); }</style>diff --git a/src/web/remote/src/components/Header.svelte b/src/web/remote/src/components/Header.svelteindex b2fcf955..5740be39 100644--- a/src/web/remote/src/components/Header.svelte+++ b/src/web/remote/src/components/Header.svelte@@ -31,17 +31,17 @@const link = $derived.by(() => {const usb = app.via === 'usb' ? 'USB · ' : '';switch (app.link) {- case 'ok': return { dot: 'var(--success-dim)', ink: 'var(--ink4)', label: app.rtt >= 0 ? `${usb}${app.rtt} ms` : 'Connected' };- case 'weak': return { dot: 'var(--warning)', ink: 'var(--warning)', label: `Weak · ${app.rtt} ms` };- case 'lost': case 'connecting': return { dot: 'var(--ink4)', ink: 'var(--ink3)', label: app.link === 'lost' ? 'Reconnecting' : 'Connecting', blink: true };+ case 'ok': return { dot: 'var(--success)', ink: 'var(--text-muted)', label: app.rtt >= 0 ? `${usb}${app.rtt}\u2009ms` : 'Connected' };+ case 'weak': return { dot: 'var(--warning)', ink: 'var(--warning)', label: `Weak · ${app.rtt}\u2009ms` };+ case 'lost': case 'connecting': return { dot: 'var(--text-tertiary)', ink: 'var(--text-secondary)', label: app.link === 'lost' ? 'Reconnecting' : 'Connecting', blink: true };case 'down': return { dot: 'var(--danger)', ink: 'var(--danger-bright)', label: 'No connection', blink: true };default: return { dot: 'var(--danger)', ink: 'var(--danger-bright)', label: 'Not paired' };}});function linkTip() {- if (app.link === 'weak') app.showToast(`Latency is ${app.rtt} ms. Move closer to the router or put the phone on 5 GHz Wi-Fi.`);- else if (app.link === 'ok') app.showToast(`Connected to ${app.host} over ${app.via === 'usb' ? 'USB' : 'Wi-Fi'} · ${app.rtt} ms`);+ if (app.link === 'weak') app.showToast(`Latency is ${app.rtt}\u2009ms. Move closer to the router or put the phone on 5 GHz Wi-Fi.`);+ else if (app.link === 'ok') app.showToast(`Connected to ${app.host} over ${app.via === 'usb' ? 'USB' : 'Wi-Fi'} · ${app.rtt}\u2009ms`);else if (app.link === 'lost') app.showToast('Touches are not sent until the link is back.');}@@ -70,10 +70,10 @@<svg width="10" height="14" viewBox="0 0 10 14"><path d="M7 2 L2 7 L7 12" /></svg></button><button class="track" onclick={() => (app.sheet = 'tracks')} aria-label="Choose the track to play">- <span class="bar" style:background={t?.color ?? 'var(--border-strong)'}></span>+ <span class="bar" style:background={t?.color ?? 'var(--rule)'}></span><span class="names"><span class="name">{t?.name ?? '—'}</span>- <span class="sub mono">{sub}</span>+ <span class="sub">{sub}</span></span><svg width="10" height="10" viewBox="0 0 10 10"><path d="M2 3.5 L5 6.5 L8 3.5" /></svg></button>@@ -88,7 +88,7 @@<button class="tbtn rec" class:on={app.tp.rec} class:count={app.countIn !== null} aria-label="Record" aria-pressed={app.tp.rec} onclick={rec}><span class="dot"></span></button><button class="pos" class:open={app.bigTransport} aria-label="Big transport" onclick={() => (app.bigTransport = !app.bigTransport)}><span class="mono p">{pos}</span>- <span class="mono bpm">{app.tp.bpm.toFixed(0)}</span>+ <span class="mono bpm">{app.tp.bpm.toFixed(2)}</span><svg width="10" height="10" viewBox="0 0 10 10"><path d="M2 3.5 L5 6.5 L8 3.5" /></svg></button>{#if !device.standalone}@@ -114,47 +114,51 @@</header><style>- header { flex: none; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; padding: 6px 10px 10px; border-bottom: 1px solid var(--hairline); background: var(--app); position: relative; z-index: 6; }+ /* A docked bar, like the desktop's transport row: panel, a seam below. */+ header { flex: none; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; padding: 6px 10px 10px; border-bottom: 1px solid var(--seam); background: var(--panel); position: relative; z-index: 6; }header.phoneLand { flex-wrap: nowrap; padding: 6px 10px; }header.tablet { flex-wrap: nowrap; padding: 10px 16px; }- svg path { fill: none; stroke: var(--ink4); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }+ svg path { fill: none; stroke: var(--text-muted); stroke-width: 1.5; }.picker { order: 1; flex: 1; min-width: 0; display: flex; align-items: center; gap: 4px; }- .step { width: 36px; height: 44px; flex: none; display: flex; align-items: center; justify-content: center; border-radius: 5px; }- .track { flex: 1; min-width: 0; height: 44px; display: flex; align-items: center; gap: 10px; padding: 0 10px; background: var(--panel); border: 1px solid var(--border); border-radius: 6px; text-align: left; }- .bar { width: 4px; height: 24px; border-radius: 2px; flex: none; }+ .step { width: 36px; height: 44px; flex: none; display: flex; align-items: center; justify-content: center; border-radius: 3px; }+ .step:active { background: var(--bg-sunken); }+ .track { flex: 1; min-width: 0; height: 44px; display: flex; align-items: center; gap: 10px; padding: 0 10px; background: var(--surface-raised); border: 1px solid var(--seam); box-shadow: var(--bevel); border-radius: 3px; text-align: left; }+ .bar { width: 3px; height: 24px; border-radius: 1px; flex: none; }.names { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }- .name { font-size: 14px; font-weight: 600; color: var(--ink1); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }- .sub { font-size: 10px; color: var(--ink5); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }+ .name { font-size: 14px; font-weight: 600; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }+ .sub { font-size: 11px; color: var(--text-tertiary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }.transport { order: 3; flex-basis: 100%; display: flex; align-items: center; gap: 6px; }.phoneLand .transport { order: 2; flex: 0 0 330px; }.tablet .transport { order: 2; flex: 0 0 460px; }- .tbtn { width: 44px; height: 40px; border-radius: 5px; background: var(--raised); border: 1px solid var(--border); display: flex; align-items: center; justify-content: center; flex: none; transition: background-color 120ms ease-out, border-color 120ms ease-out; }+ /* Transport keys: raised; Play on is solid accent, Record on solid record — each with derived ink. */+ .tbtn { width: 44px; height: 40px; border-radius: 3px; background: var(--surface-raised); border: 1px solid var(--seam); box-shadow: var(--bevel); display: flex; align-items: center; justify-content: center; flex: none; color: var(--text-strong); transition: background-color var(--ease), border-color var(--ease), color var(--ease); }+ .tbtn:active { background: var(--bg-sunken); box-shadow: none; }.tbtn.play { width: 54px; }- .fs svg path { stroke: var(--ink3); }- .sq { width: 11px; height: 11px; border-radius: 1px; background: var(--ink2); }- .tri { width: 0; height: 0; border-left: 12px solid var(--ink2); border-top: 7px solid transparent; border-bottom: 7px solid transparent; margin-left: 3px; }- .play.on { background: var(--accent); border-color: var(--accent); }- .play.on .tri { border-left-color: var(--on-accent); }- .dot { width: 12px; height: 12px; border-radius: 50%; background: var(--ink4); }- .rec.on, .rec.count { background: var(--record-wash); border-color: var(--record); }- .rec.on .dot, .rec.count .dot { background: var(--record); }- .pos { flex: 1; min-width: 0; height: 40px; display: flex; align-items: center; gap: 10px; padding: 0 10px; border-radius: 5px; background: var(--well); border: 1px solid var(--border); box-shadow: inset 0 1px 0 rgba(0,0,0,.5); }- .pos.open { border-color: var(--border-brass); }+ .fs svg path { stroke: var(--text-secondary); }+ .sq { width: 11px; height: 11px; border-radius: 1px; background: currentColor; }+ .tri { width: 0; height: 0; border-left: 12px solid currentColor; border-top: 7px solid transparent; border-bottom: 7px solid transparent; margin-left: 3px; }+ .play.on { background: var(--accent); border-color: var(--accent); box-shadow: none; color: var(--ink-on-accent); }+ .dot { width: 12px; height: 12px; border-radius: 50%; background: var(--record); }+ .rec.on, .rec.count { background: var(--record); border-color: var(--record); box-shadow: none; }+ .rec.on .dot, .rec.count .dot { background: var(--record-ink); }+ /* The position readout: a well with a rule edge; open (the big transport shows) = the edge turns accent. */+ .pos { flex: 1; min-width: 0; height: 40px; display: flex; align-items: center; gap: 10px; padding: 0 10px; border-radius: 3px; background: var(--bg-sunken); box-shadow: var(--sunken); }+ .pos.open { box-shadow: inset 0 0 0 1px var(--accent); }.pos.open svg { transform: rotate(180deg); }.pos svg { margin-left: auto; }- .p { font-size: 16px; font-weight: 500; color: var(--ink1); }- .bpm { font-size: 11px; color: var(--ink4); }+ .p { font-size: 16px; color: var(--text-primary); }+ .bpm { font-size: 11px; color: var(--text-muted); }.status { order: 2; display: flex; align-items: center; gap: 4px; }.phoneLand .status, .tablet .status { order: 3; }- .link { height: 44px; display: flex; align-items: center; gap: 6px; padding: 0 8px; border-radius: 5px; }- .link .mono { font-size: 10px; white-space: nowrap; }+ .link { height: 44px; display: flex; align-items: center; gap: 6px; padding: 0 8px; border-radius: 3px; }+ .link .mono { font-size: 11px; white-space: nowrap; }.ldot { width: 7px; height: 7px; border-radius: 50%; }.blink { animation: blink 800ms steps(1) infinite; }@keyframes blink { 50% { opacity: .35; } }- .menu { width: 44px; height: 44px; display: flex; align-items: center; justify-content: center; gap: 3px; border-radius: 5px; }- .menu.open { background: var(--raised); }- .menu span { width: 4px; height: 4px; border-radius: 50%; background: var(--ink3); }+ .menu { width: 44px; height: 44px; display: flex; align-items: center; justify-content: center; gap: 3px; border-radius: 3px; }+ .menu.open { background: var(--surface-hover); }+ .menu span { width: 4px; height: 4px; border-radius: 50%; background: var(--text-secondary); }</style>diff --git a/src/web/remote/src/components/Overlays.svelte b/src/web/remote/src/components/Overlays.svelteindex aa3590a5..d5624c30 100644--- a/src/web/remote/src/components/Overlays.svelte+++ b/src/web/remote/src/components/Overlays.svelte@@ -52,14 +52,14 @@<div class="cover" role="alert"><h1>Disconnected</h1><p>This phone has left Nota. It is still trusted, so connecting again needs no code.</p>- <button class="btn on big" onclick={() => app.rejoin()}>Connect again</button>+ <button class="btn primary big" onclick={() => app.rejoin()}>Connect again</button></div>{/if}{#if app.countIn !== null}<button class="count" onclick={() => app.record()} aria-label="Cancel count-in"><span class="mono num {form}">{app.countIn}</span>- <span class="caps rec">Count-in · recording starts on 1</span>+ <span class="rec">Count-in · recording starts on 1</span></button>{/if}@@ -68,29 +68,33 @@{/if}<style>- .cover { position: absolute; inset: 0; z-index: 40; background: var(--app); display: flex; flex-direction: column; justify-content: center; gap: 18px; padding: 28px; padding-top: calc(env(safe-area-inset-top) + 28px); }- h1 { font-size: 22px; font-weight: 600; color: var(--ink0); }- p { font-size: 13px; line-height: 1.6; color: var(--ink3); max-width: 420px; }- ol { list-style: none; border: 1px solid var(--border); border-radius: 6px; overflow: hidden; max-width: 420px; }- li { padding: 12px 14px; background: var(--panel); display: flex; gap: 12px; font-size: 12px; line-height: 1.5; color: var(--ink2); }- li + li { border-top: 1px solid var(--hairline); }- li .mono { font-size: 11px; color: var(--accent-dim); }- .retry { display: flex; align-items: center; gap: 10px; font-size: 12px; color: var(--ink4); }- .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--ink5); }+ .cover { position: absolute; inset: 0; z-index: 40; background: var(--bg-app); display: flex; flex-direction: column; justify-content: center; gap: 18px; padding: 28px; padding-top: calc(env(safe-area-inset-top) + 28px); }+ h1 { font-size: 22px; font-weight: 600; color: var(--text-heading); }+ p { font-size: 13px; line-height: 1.6; color: var(--text-secondary); max-width: 420px; }+ /* The checklist: panel rows on rules, one frame. */+ ol { list-style: none; border-radius: 3px; overflow: hidden; max-width: 420px; background: var(--panel); box-shadow: 0 0 0 1px var(--seam); }+ li { padding: 12px 14px; display: flex; gap: 12px; font-size: 12px; line-height: 1.5; color: var(--text-strong); }+ li + li { border-top: 1px solid var(--rule); }+ li .mono { font-size: 11px; color: var(--text-muted); }+ .retry { display: flex; align-items: center; gap: 10px; font-size: 12px; color: var(--text-muted); }+ .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--text-tertiary); }.blink { animation: blink 800ms steps(1) infinite; }@keyframes blink { 50% { opacity: .35; } }+ /* Code cells: wells with a rule edge; the one being typed into has an accent edge and caret. */.code { position: relative; display: grid; grid-template-columns: repeat(4, 64px); gap: 10px; }.code input { position: absolute; inset: 0; opacity: 0; font-size: 16px; }- .cell { height: 68px; border-radius: 6px; background: var(--well); border: 1px solid var(--hairline); box-shadow: inset 0 1px 0 rgba(0,0,0,.5); display: flex; align-items: center; justify-content: center; pointer-events: none; }- .cell.cur { border-color: var(--border-brass); }- .cell .mono { font-size: 28px; color: var(--ink0); }+ .cell { height: 68px; border-radius: 3px; background: var(--bg-sunken); box-shadow: var(--sunken); display: flex; align-items: center; justify-content: center; pointer-events: none; }+ .cell.cur { box-shadow: inset 0 0 0 1px var(--accent); }+ .cell .mono { font-size: 28px; color: var(--text-heading); }.caret { width: 2px; height: 28px; background: var(--accent); animation: blink 1s steps(1) infinite; }+ /* The cover's one action is set apart by weight and a tone step, not by colour. */.big { height: 48px; align-self: flex-start; padding: 0 20px; font-size: 13px; }- .count { position: absolute; inset: 0; z-index: 35; background: var(--app); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; }+ .primary { font-weight: 600; background: var(--surface-hover); color: var(--text-primary); }+ .count { position: absolute; inset: 0; z-index: 35; background: var(--bg-app); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; }.num { font-size: 200px; font-weight: 500; line-height: 1; color: var(--accent-bright); }.num.phoneLand { font-size: 150px; }.num.tablet { font-size: 260px; }- .rec { color: var(--record); font-size: 12px; }- .toast { position: absolute; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 50; max-width: 86%; padding: 10px 14px; border-radius: 6px; background: var(--raised); border: 1px solid var(--border-strong); font-size: 12px; line-height: 1.45; color: var(--ink1); text-align: center; }+ .rec { color: var(--record); font-size: 13px; font-weight: 600; }+ .toast { position: absolute; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 50; max-width: 86%; padding: 10px 14px; border-radius: 3px; background: var(--surface-raised); box-shadow: var(--popover); font-size: 12px; line-height: 1.45; color: var(--text-primary); text-align: center; }.toast.low { bottom: calc(env(safe-area-inset-bottom) + 84px); }</style>diff --git a/src/web/remote/src/components/Sheets.svelte b/src/web/remote/src/components/Sheets.svelteindex cefae672..6b71e306 100644--- a/src/web/remote/src/components/Sheets.svelte+++ b/src/web/remote/src/components/Sheets.svelte@@ -4,6 +4,7 @@import { app } from '../lib/app.svelte';import type { Form } from '../lib/device.svelte';import { NN } from '../lib/music';+ import { look } from '../lib/theme.svelte';let { form }: { form: Form } = $props();const portrait = $derived(form === 'phone');@@ -15,6 +16,13 @@app.sheet = null;}const projectKey = $derived(app.proj?.key ?? null);+ // What the Theme choice wears now, and where it comes from (spec 014).+ const wearing = $derived.by(() => {+ const t = look.worn(app.prefs.theme);+ if (!t) return app.live ? 'Nota’s colours' : 'Until Nota answers: Studio Dark';+ if (app.prefs.theme === 'nota') return `${t.name} · as Nota wears it`;+ return `${t.name} · Nota’s ${look.phoneDark ? 'dark' : 'light'}-mode theme`;+ });</script>{#if app.sheet}@@ -23,13 +31,13 @@{#if app.sheet === 'tracks'}<div class="sheet" class:bottom={portrait} role="dialog" aria-label="Play on track">- <div class="caps head">Play on track</div>+ <div class="label head">Play on track</div><div class="list">{#each app.playable as t (t.id)}{@const others = app.who[String(t.id)] ?? []}<button class="row" class:on={t.id === app.proj?.you} onclick={() => app.selectTrack(t.id)}><span class="bar" style:background={t.color}></span>- <span class="names"><span class="n">{t.name}</span><span class="d mono">{t.dev}</span></span>+ <span class="names"><span class="n">{t.name}</span><span class="d">{t.dev}</span></span>{#if t.id === app.proj?.you}<span class="who">You</span>{/if}{#each others as o}<span class="who">{o}</span>{/each}</button>@@ -44,17 +52,18 @@{:else if app.sheet === 'menu'}<div class="sheet menu" role="dialog" aria-label="Menu"><div class="block">- <label class="caps" for="devname">Device name</label>+ <label class="label" for="devname">Device name</label><input id="devname" class="field" bind:value={nameInput} maxlength="40" enterkeyhint="done"onkeydown={(e) => { if (e.key === 'Enter') (e.target as HTMLInputElement).blur(); }}onblur={() => app.rename(nameInput)} /></div><div class="block">- <span class="caps">Theme</span>+ <span class="label">Theme</span><div class="seg"><button class:on={app.prefs.theme === 'nota'} onclick={() => (app.prefs.theme = 'nota')}>Follow Nota</button><button class:on={app.prefs.theme === 'phone'} onclick={() => (app.prefs.theme = 'phone')}>Follow phone</button></div>+ <span class="d2">{wearing}</span></div><button class="toggle" onclick={() => (app.prefs.haptics = !app.prefs.haptics)}><span class="switch" class:on={app.prefs.haptics}></span><span class="n2">Haptics on pads</span>@@ -66,10 +75,10 @@</div>{:else if app.sheet === 'key'}<div class="sheet" class:bottom={portrait} role="dialog" aria-label="Key">- <div class="caps head">Key on this phone</div>+ <div class="label head">Key on this phone</div><div class="block"><button class="row slim" class:on={!app.prefs.key} onclick={() => { app.prefs.key = null; app.sheet = null; }}>- <span class="names"><span class="n">Project key</span><span class="d mono">{projectKey ? projectKey.name : 'Not set in Nota — C major'}</span></span>+ <span class="names"><span class="n">Project key</span><span class="d">{projectKey ? projectKey.name : 'Not set in Nota — C major'}</span></span></button><div class="seg"><button class:on={!(app.prefs.key?.minor ?? projectKey?.minor ?? false)} onclick={() => (app.prefs.key = { root: app.prefs.key?.root ?? projectKey?.root ?? 0, minor: false })}>Major</button>@@ -84,7 +93,7 @@</div>{:else if app.sheet === 'devices'}<div class="sheet" class:bottom={portrait} role="dialog" aria-label="Device">- <div class="caps head">Device on {app.track?.name ?? 'this track'}</div>+ <div class="label head">Device on {app.track?.name ?? 'this track'}</div><div class="list">{#each app.mac?.devs ?? [] as d, i}<button class="row" class:on={i === (app.mac?.di ?? 0)} onclick={() => { app.macroDevice = i; app.sub(); app.sheet = null; }}>@@ -97,29 +106,34 @@<style>.scrim { position: absolute; inset: 0; z-index: 20; background: var(--scrim); }- .sheet { position: absolute; z-index: 21; left: 12px; top: calc(env(safe-area-inset-top) + 64px); width: 360px; max-width: calc(100% - 24px); max-height: calc(100% - 88px); background: var(--panel); border: 1px solid var(--border-strong); border-radius: 8px; display: flex; flex-direction: column; overflow: hidden; }+ /* A floating sheet drawn in the page: raised, a seam ring and the popover drop. */+ .sheet { position: absolute; z-index: 21; left: 12px; top: calc(env(safe-area-inset-top) + 64px); width: 360px; max-width: calc(100% - 24px); max-height: calc(100% - 88px); background: var(--panel); border-radius: 3px; box-shadow: var(--popover); display: flex; flex-direction: column; overflow: hidden; }.sheet.bottom { top: auto; right: 12px; width: auto; bottom: max(24px, env(safe-area-inset-bottom)); max-height: 75%; }.sheet.menu { left: auto; right: 12px; width: 300px; }.head { padding: 14px 16px 8px; }.list { overflow-y: auto; touch-action: pan-y; overscroll-behavior: contain; }- .row { width: 100%; height: 52px; display: flex; align-items: center; gap: 12px; padding: 0 16px; border-top: 1px solid var(--hairline); position: relative; text-align: left; }- .row.slim { border: none; padding: 0; height: 44px; }- .row.on { background: var(--accent-wash); }+ /* Rows divide on rules; the chosen one is raised hover with an accent tick. */+ .row { width: 100%; height: 52px; display: flex; align-items: center; gap: 12px; padding: 0 16px; border-top: 1px solid var(--rule); position: relative; text-align: left; transition: background-color var(--ease); }+ .row.slim { border: none; padding: 0 10px; height: 44px; border-radius: 2px; }+ .row:active { background: var(--bg-sunken); }+ .row.on { background: var(--surface-hover); }.row.on::before { content: ''; position: absolute; left: 0; top: 10px; bottom: 10px; width: 2px; background: var(--accent); }- .row.slim.on::before { display: none; }- .bar { width: 4px; height: 22px; border-radius: 2px; flex: none; }+ .bar { width: 3px; height: 22px; border-radius: 1px; flex: none; }.names { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }- .n { font-size: 13px; font-weight: 600; color: var(--ink1); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }- .d { font-size: 10px; color: var(--ink5); }- .who { height: 20px; display: flex; align-items: center; padding: 0 8px; border-radius: 10px; background: var(--track-off); font-size: 10px; font-weight: 600; color: var(--ink2); }- .empty { padding: 16px; font-size: 12px; color: var(--ink5); }- .toggle { width: 100%; min-height: 52px; display: flex; align-items: center; gap: 10px; padding: 0 16px; border-top: 1px solid var(--border); text-align: left; }- .n2 { display: block; font-size: 12px; color: var(--ink1); }- .d2 { display: block; font-size: 10px; color: var(--ink5); }+ .n { font-size: 13px; font-weight: 600; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }+ .d { font-size: 11px; color: var(--text-tertiary); }+ .who { height: 20px; display: flex; align-items: center; padding: 0 6px; border-radius: 2px; background: var(--bg-sunken); font-size: 10px; font-weight: 600; color: var(--text-secondary); }+ .empty { padding: 16px; font-size: 12px; color: var(--text-tertiary); }+ .toggle { width: 100%; min-height: 52px; display: flex; align-items: center; gap: 12px; padding: 0 16px; border-top: 1px solid var(--rule); text-align: left; }+ .n2 { display: block; font-size: 12px; color: var(--text-primary); }+ .d2 { display: block; font-size: 11px; color: var(--text-tertiary); }.block { padding: 14px 16px; display: flex; flex-direction: column; gap: 8px; }- .field { height: 40px; padding: 0 12px; background: var(--well); border: 1px solid var(--border); border-radius: 4px; box-shadow: inset 0 1px 0 rgba(0,0,0,.5); font-size: 13px; outline: none; }- .field:focus { border-color: var(--border-brass); }+ .block + .block { border-top: 1px solid var(--rule); }+ /* A field: the well with a rule edge; focus turns the edge accent. */+ .field { height: 40px; padding: 0 12px; background: var(--bg-sunken); border: none; box-shadow: var(--sunken); border-radius: 3px; font-size: 13px; outline: none; }+ .field:focus { box-shadow: inset 0 0 0 1px var(--accent); }.tonics { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; }.tonics .btn { padding: 0; height: 44px; }- .disconnect { height: 52px; padding: 0 16px; border-top: 1px solid var(--border); font-size: 13px; font-weight: 600; color: var(--danger-bright); text-align: left; }+ .disconnect { height: 52px; padding: 0 16px; border-top: 1px solid var(--rule); font-size: 13px; font-weight: 500; color: var(--text-primary); text-align: left; }+ .disconnect:active { background: var(--bg-sunken); }</style>diff --git a/src/web/remote/src/lib/app.svelte.ts b/src/web/remote/src/lib/app.svelte.tsindex 351fd8a4..e4132e6c 100644--- a/src/web/remote/src/lib/app.svelte.ts+++ b/src/web/remote/src/lib/app.svelte.ts@@ -5,6 +5,7 @@// own — the only state that needs the person is a forgotten device or an expired code.import type { Project, Transport, Mixer, Xy, Macros, Session, Learn, LinkState, Screen, Track } from './types';+import { look } from './theme.svelte';const LS = 'nota-remote:';const store = {@@ -121,11 +122,6 @@ export class App {get canControl() { return this.proj?.access !== 'play'; }- get dark(): boolean {- if (this.prefs.theme === 'phone') return matchMedia('(prefers-color-scheme: dark)').matches;- return this.proj?.dark ?? true;- }-// ---- connection ---------------------------------------------------------------connect() {@@ -248,11 +244,13 @@ export class App {if (this.link === 'ok' || this.link === 'weak') this.link = avg > 50 ? 'weak' : 'ok';break;}+ case 'theme': look.receive(m); break;case 'proj': {const first = !this.proj;const prevTrack = this.proj?.you;delete m.t;this.proj = m;+ look.legacyDark = m.dark;store.set('track', String(m.you));store.set('follow', m.follow ? '1' : '0');if (first || prevTrack !== m.you) this.onTrackChanged(first);diff --git a/src/web/remote/src/lib/palette.ts b/src/web/remote/src/lib/palette.tsnew file mode 100644index 00000000..38981e39--- /dev/null+++ b/src/web/remote/src/lib/palette.ts@@ -0,0 +1,52 @@+// SPDX-License-Identifier: AGPL-3.0-only+// Theme colours as CSS (spec 014). Every token of a theme becomes a custom property named+// after it — BgApp → --bg-app — plus the derived inks for the solid fills the phone draws.+// Pure: the page uses it at run time and the build (theme-plugin.ts) for the first-paint+// fallback, so both name and derive colours the same way.++export type Colors = Record<string, string>;+/** The dark and light ink text on a solid fill is chosen from, as Nota chooses them. */+export type Ink = readonly [string, string];++/** `BgApp` → `--bg-app`, `SystemAccentLight1` → `--system-accent-light1`. */+export const cssName = (token: string) => '--' + token.replace(/([a-z0-9])([A-Z])/g, '$1-$2').toLowerCase();++function rgb(hex: string): [number, number, number] | null {+ const m = /^#([0-9a-f]{6})([0-9a-f]{2})?$/i.exec(hex.trim());+ if (!m) return null;+ const n = parseInt(m[1], 16);+ return [(n >> 16) & 255, (n >> 8) & 255, n & 255];+}++function luminance(c: [number, number, number]): number {+ const ch = (v: number) => { const x = v / 255; return x <= 0.03928 ? x / 12.92 : Math.pow((x + 0.055) / 1.055, 2.4); };+ return 0.2126 * ch(c[0]) + 0.7152 * ch(c[1]) + 0.0722 * ch(c[2]);+}++const contrast = (a: number, b: number) => (Math.max(a, b) + 0.05) / (Math.min(a, b) + 0.05);++/** The ink that reads better on <fill> (WCAG contrast; a tie goes to the dark one) —+ * NotaPalette.ReadableInkOn. An unreadable fill gets the dark ink. */+export function inkOn(fill: string, ink: Ink): string {+ const f = rgb(fill), d = rgb(ink[0]), l = rgb(ink[1]);+ if (!f || !d || !l) return ink[0];+ const lf = luminance(f);+ return contrast(luminance(d), lf) >= contrast(luminance(l), lf) ? ink[0] : ink[1];+}++/** The solid fills that carry text, by the token they fill with. */+const FILLS: [string, string][] = [+ ['--ink-on-accent', 'Accent'], ['--ink-on-mute', 'Mute'], ['--ink-on-solo', 'Solo'],+ ['--ink-on-record', 'Record'], ['--ink-on-success', 'Success'],+];++/** Every token as a custom property, the ink pair (--ink-dark / --ink-light) and the inks on+ * the solid fills. */+export function cssVars(colors: Colors, ink: Ink): Record<string, string> {+ const out: Record<string, string> = {};+ for (const [k, v] of Object.entries(colors)) out[cssName(k)] = v;+ out['--ink-dark'] = ink[0];+ out['--ink-light'] = ink[1];+ for (const [name, token] of FILLS) if (colors[token]) out[name] = inkOn(colors[token], ink);+ return out;+}diff --git a/src/web/remote/src/lib/theme.svelte.ts b/src/web/remote/src/lib/theme.svelte.tsnew file mode 100644index 00000000..45842d45--- /dev/null+++ b/src/web/remote/src/lib/theme.svelte.ts@@ -0,0 +1,78 @@+// SPDX-License-Identifier: AGPL-3.0-only+// What the phone wears (spec 014). Nota sends the theme it wears and the user's dark-mode and+// light-mode picks with all their colours; Follow Nota wears the first, Follow phone one of+// the picks by the phone's own scheme. The colours go onto the root as custom properties+// named after the tokens (palette.ts), so a theme change is one pass over ~110 properties and+// nothing re-renders. The last one worn is stored for the head script in index.html, which+// paints a returning phone in it before any of this loads; a new phone starts on the+// built-in fallback (theme-plugin.ts).++import { cssVars, inkOn, type Colors, type Ink } from './palette';+import type { ThemeMessage } from './types';++const MSG = 'nota-remote:theme', VARS = 'nota-remote:vars';+const scheme = matchMedia('(prefers-color-scheme: dark)');++function stored(): ThemeMessage | null {+ try {+ const m = JSON.parse(localStorage.getItem(MSG) ?? 'null');+ return m && m.t === 'theme' && m.th?.[m.on] ? m : null;+ } catch { return null; }+}++export type Pref = 'nota' | 'phone';+interface Worn { id: string; name: string; dark: boolean; c: Colors }++class Look {+ /** The last theme Nota sent (or the stored one, until Nota answers). */+ msg = $state<ThemeMessage | null>(stored());+ /** The phone's own colour scheme, live. */+ phoneDark = $state(scheme.matches);+ /** An older Nota says only dark or light: the fallback's two sides. */+ legacyDark = $state<boolean | null>(null);++ constructor() {+ scheme.addEventListener('change', (e) => (this.phoneDark = e.matches));+ }++ receive(m: ThemeMessage) {+ this.msg = m;+ try { localStorage.setItem(MSG, JSON.stringify(m)); } catch { /* private mode */ }+ }++ /** The theme a preference wears now, or null for the fallback. */+ worn(pref: Pref): Worn | null {+ const m = this.msg;+ if (!m) return null;+ const id = pref === 'phone' ? (this.phoneDark ? m.dark : m.light) : m.on;+ const t = m.th[id] ?? m.th[m.on];+ return t ? { id, ...t } : null;+ }++ /** The ink pair: Nota's, else the fallback's (theme-plugin.ts writes it as --ink-dark / --ink-light). */+ get ink(): Ink {+ if (this.msg) return this.msg.ink;+ const s = getComputedStyle(document.documentElement);+ return [s.getPropertyValue('--ink-dark').trim(), s.getPropertyValue('--ink-light').trim()];+ }++ /** Readable ink on a fill the page computes — a track's colour. */+ inkOn(fill: string): string { return inkOn(fill, this.ink); }++ /** Put the preference's theme on the page. */+ apply(pref: Pref) {+ const root = document.documentElement;+ const t = this.worn(pref);+ const dark = t ? t.dark : this.legacyDark !== false;+ root.dataset.theme = dark ? 'dark' : 'light';+ if (t && this.msg) {+ const vars = cssVars(t.c, this.msg.ink);+ for (const [k, v] of Object.entries(vars)) root.style.setProperty(k, v);+ try { localStorage.setItem(VARS, JSON.stringify({ dark, v: vars })); } catch { /* private mode */ }+ }+ const ground = getComputedStyle(root).getPropertyValue('--bg-app').trim();+ if (ground) document.querySelector('meta[name=theme-color]')?.setAttribute('content', ground);+ }+}++export const look = new Look();diff --git a/src/web/remote/src/lib/types.ts b/src/web/remote/src/lib/types.tsindex e6beba4b..28daad21 100644--- a/src/web/remote/src/lib/types.ts+++ b/src/web/remote/src/lib/types.ts@@ -16,8 +16,23 @@ export interface Track {pads?: [number, string][];}+/** What Nota tells the phone about colour (specs/014 contracts/theme-message.md). */+export interface ThemeMessage {+ t: 'theme';+ /** The theme Nota wears (Follow Nota). */+ on: string;+ /** The user's dark-mode and light-mode picks (Follow phone). */+ dark: string;+ light: string;+ /** The dark and light ink text on a solid fill is chosen from. */+ ink: [string, string];+ /** Each theme named above, once: token → CSS colour. */+ th: Record<string, { name: string; dark: boolean; c: Record<string, string> }>;+}+export interface Project {host: string;+ /** Whether Nota's theme is dark — only read when Nota sends no theme (an older Nota). */dark: boolean;tracks: Track[];key: { root: number; minor: boolean; name: string } | null;diff --git a/src/web/remote/src/main.ts b/src/web/remote/src/main.tsindex 740c0107..6dc66547 100644--- a/src/web/remote/src/main.ts+++ b/src/web/remote/src/main.ts@@ -1,5 +1,6 @@// SPDX-License-Identifier: AGPL-3.0-onlyimport { mount } from 'svelte';+import 'virtual:nota-theme.css'; // first-paint colours, from the theme filesimport './app.css';import App from './App.svelte';import { app } from './lib/app.svelte';diff --git a/src/web/remote/src/screens/BigTransport.svelte b/src/web/remote/src/screens/BigTransport.svelteindex 258881ce..d4fb230e 100644--- a/src/web/remote/src/screens/BigTransport.svelte+++ b/src/web/remote/src/screens/BigTransport.svelte@@ -54,18 +54,18 @@clearTimeout(holdTimer);if (!held) ctl({ t: 'seek', v: sections[i][1] });}- const bpmText = $derived(app.tp.bpm.toFixed(app.tp.bpm % 1 ? 2 : 0));+ const bpmText = $derived(app.tp.bpm.toFixed(2));</script><div class="big {form}"><div class="top"><div class="pblock">- <span class="caps">Position</span>+ <span class="label">Position</span><span class="mono pos" class:rec={app.tp.rec}>{pos}</span></div><button class="tap" onclick={tap}><span class="mono">{bpmText}</span>- <span class="caps">Tap tempo</span>+ <span class="tl">Tap tempo</span></button></div><div class="btns" style:grid-template-columns="repeat({form === 'phone' ? 3 : 6}, minmax(0, 1fr))">@@ -84,12 +84,12 @@</div>{#if sections.length > 0}<div class="secs">- <span class="caps">Sections · tap to jump, hold to loop</span>+ <span class="label">Sections · tap to jump, hold to loop</span><div class="sgrid">{#each sections as s, i}<button class="sec" class:cur={current === i} class:looping={loopSec === i} onpointerdown={() => secDown(i)} onpointerup={() => secUp(i)} onpointercancel={() => clearTimeout(holdTimer)}><span class="sn">{s[0]}</span>- <span class="mono si">{loopSec === i ? 'LOOPING' : `BAR ${Math.floor(s[1] / 4) + 1}`}</span>+ <span class="si">{#if loopSec === i}Looping{:else}Bar <span class="mono">{Math.floor(s[1] / 4) + 1}</span>{/if}</span></button>{/each}</div>@@ -98,35 +98,38 @@</div><style>- .big { position: absolute; inset: 0; z-index: 4; background: var(--app); display: flex; flex-direction: column; gap: 14px; padding: 12px; }+ .big { position: absolute; inset: 0; z-index: 4; background: var(--bg-app); display: flex; flex-direction: column; gap: 14px; padding: 12px; }.phoneLand.big { padding: 8px 10px; gap: 10px; }.tablet.big { padding: 18px; }.top { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; }.pblock { display: flex; flex-direction: column; gap: 4px; }- .pos { font-size: 52px; font-weight: 500; line-height: 1; color: var(--ink1); }+ .pos { font-size: 52px; line-height: 1; color: var(--text-primary); }.phoneLand .pos { font-size: 40px; }.tablet .pos { font-size: 88px; }- .pos.rec { color: var(--record-ink); }- .tap { height: 56px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; padding: 0 16px; border-radius: 6px; background: var(--raised); border: 1px solid var(--border); }- .tap .mono { font-size: 18px; font-weight: 500; color: var(--ink1); }- .tap .caps { font-size: 9px; letter-spacing: .1em; }- .btns { flex: 1; min-height: 0; display: grid; grid-auto-rows: minmax(0, 1fr); gap: 8px; }- .b { min-height: 0; border-radius: 8px; background: var(--raised); border: 1px solid var(--border); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; font-size: 14px; font-weight: 600; color: var(--ink2); }- .b svg path { fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }- .b.on { background: var(--accent-wash); border-color: var(--border-brass); color: var(--accent-bright); }- .b.dim { color: var(--ink6); }+ .pos.rec { color: var(--record); }+ .tap { height: 56px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; padding: 0 16px; border-radius: 3px; background: var(--surface-raised); border: 1px solid var(--seam); box-shadow: var(--bevel); }+ .tap:active { background: var(--bg-sunken); box-shadow: none; }+ .tap .mono { font-size: 18px; color: var(--text-primary); }+ .tl { font-size: 11px; font-weight: 500; color: var(--text-muted); }+ .btns { flex: 1; min-height: 0; display: grid; grid-auto-rows: minmax(0, 1fr); gap: 6px; }+ /* Keys sized for a hand on a guitar neck. On: solid accent; Record on: solid record — derived ink. */+ .b { min-height: 0; border-radius: 3px; background: var(--surface-raised); border: 1px solid var(--seam); box-shadow: var(--bevel); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; font-size: 14px; font-weight: 600; color: var(--text-strong); transition: background-color var(--ease), color var(--ease); }+ .b:active { background: var(--bg-sunken); box-shadow: none; }+ .b svg path { fill: none; stroke: currentColor; stroke-width: 2; }+ .b.on { background: var(--accent); border-color: var(--accent); box-shadow: none; color: var(--ink-on-accent); }+ .b.dim { color: var(--text-faint); }.tri { width: 0; height: 0; border-left: 26px solid currentColor; border-top: 16px solid transparent; border-bottom: 16px solid transparent; margin-left: 6px; }- .sq { width: 26px; height: 26px; border-radius: 3px; background: currentColor; }+ .sq { width: 26px; height: 26px; border-radius: 2px; background: currentColor; }.dot { width: 28px; height: 28px; border-radius: 50%; background: var(--record); }- .play.on { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }- .recb.on { background: var(--record-wash); border-color: var(--record); color: var(--record-ink); }+ .recb.on { background: var(--record); border-color: var(--record); color: var(--ink-on-record); }+ .recb.on .dot { background: var(--ink-on-record); }.secs { display: flex; flex-direction: column; gap: 6px; }- .sgrid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }- .sec { height: 52px; border-radius: 5px; background: var(--panel); border: 1px solid var(--border); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; }- .sec.cur { background: var(--raised); border-color: var(--border-strong); }- .sec.looping { background: var(--accent-wash); border-color: var(--border-brass); }- .sn { font-size: 13px; font-weight: 600; color: var(--ink1); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 92%; }- .looping .sn { color: var(--accent-bright); }- .si { font-size: 9px; color: var(--ink5); }- .looping .si { color: var(--accent); }+ .sgrid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px; }+ /* Sections: the playhead's one carries the accent tick; a looping one is the solid accent. */+ .sec { height: 52px; position: relative; border-radius: 2px; background: var(--surface-raised); border: 1px solid var(--seam); box-shadow: var(--bevel); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; }+ .sec.cur::before { content: ''; position: absolute; left: 6px; right: 6px; top: -1px; height: 2px; background: var(--accent); }+ .sec.looping { background: var(--accent); border-color: var(--accent); box-shadow: none; }+ .sn { font-size: 13px; font-weight: 600; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 92%; }+ .si { font-size: 11px; color: var(--text-tertiary); }+ .looping .sn, .looping .si { color: var(--ink-on-accent); }</style>diff --git a/src/web/remote/src/screens/Empty.svelte b/src/web/remote/src/screens/Empty.svelteindex e900c322..78746bb4 100644--- a/src/web/remote/src/screens/Empty.svelte+++ b/src/web/remote/src/screens/Empty.svelte@@ -10,8 +10,8 @@</div><style>- .empty { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; text-align: center; padding: 24px; border: 1px dashed var(--border); border-radius: 6px; }- .t { font-size: 15px; font-weight: 600; color: var(--ink1); }- .s { font-size: 12px; line-height: 1.6; color: var(--ink4); max-width: 280px; }- .btn { height: 44px; padding: 0 18px; font-size: 13px; color: var(--ink1); }+ .empty { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; text-align: center; padding: 24px; border-radius: 3px; background: var(--panel); box-shadow: 0 0 0 1px var(--seam); }+ .t { font-size: 14px; font-weight: 600; color: var(--text-primary); }+ .s { font-size: 12px; line-height: 1.6; color: var(--text-tertiary); max-width: 280px; }+ .btn { height: 44px; padding: 0 18px; font-size: 13px; }</style>diff --git a/src/web/remote/src/screens/Keys.svelte b/src/web/remote/src/screens/Keys.svelteindex d37f573e..d479370d 100644--- a/src/web/remote/src/screens/Keys.svelte+++ b/src/web/remote/src/screens/Keys.svelte@@ -1,7 +1,7 @@<!-- SPDX-License-Identifier: AGPL-3.0-only --><!-- Keys: a keyboard (one octave upright, 1.5 sideways, two on a tablet), a scale grid whereevery cell is a note of the key (rows a fourth apart, tonic cells raised — no wrong notes),- and Chords (one triad per degree). The key is the project's KEY unless overridden here.+ and Chords (one triad per degree). The key is the project's key unless overridden here.Fingers can slide across keys and cells: every pointer is tracked over the whole surface.Expressive (an instrument that takes MPE): a finger keeps the note it struck instead — slidingsideways bends it (a key's width ≈ its pitch step), the height on the key is its slide (CC74),@@ -16,7 +16,7 @@const WP = [0, 2, 4, 5, 7, 9, 11];const key = $derived<Key>(app.prefs.key ?? (app.proj?.key ? { root: app.proj.key.root, minor: app.proj.key.minor } : { root: 0, minor: false }));- const keySrc = $derived(app.prefs.key ? 'PHONE' : app.proj?.key ? 'PROJECT' : 'DEFAULT');+ const keySrc = $derived(app.prefs.key ? 'Phone' : app.proj?.key ? 'Project' : 'Default');const base = $derived(12 * (app.prefs.octave + 1));const lit = $derived(new Set(app.lit));const color = $derived(app.track?.color ?? 'var(--accent)');@@ -169,9 +169,9 @@{/each}</div><button class="btn keybtn" onclick={() => (app.sheet = 'key')} aria-label="Key: {keyName(key)}">- <span class="caps k">Key</span>+ <span class="k">Key</span><span class="kn">{keyName(key)}</span>- <span class="mono src">{keySrc}</span>+ <span class="src">{keySrc}</span></button>{#if canExpress}<button class="btn expr" class:on={expressive} aria-pressed={expressive}@@ -181,7 +181,7 @@<button class="btn sq" aria-label="Octave down" onclick={() => (app.prefs.octave = Math.max(0, app.prefs.octave - 1))}><svg width="12" height="12" viewBox="0 0 12 12"><path d="M2 6 H10" /></svg></button>- <span class="mono">Oct {app.prefs.octave}</span>+ <span class="octn">Oct <span class="mono">{app.prefs.octave}</span></span><button class="btn sq" aria-label="Octave up" onclick={() => (app.prefs.octave = Math.min(7, app.prefs.octave + 1))}><svg width="12" height="12" viewBox="0 0 12 12"><path d="M2 6 H10 M6 2 V10" /></svg></button>@@ -235,39 +235,40 @@.bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }.modes button { flex: none; }.keybtn { gap: 7px; padding: 0 10px; }- .expr { padding: 0 10px; font-size: 12px; font-weight: 600; }- .k { font-size: 9px; letter-spacing: .1em; }- .kn { font-size: 12px; font-weight: 600; color: var(--ink1); }- .src { font-size: 9px; color: var(--accent-dim); }+ .expr { padding: 0 10px; }+ .k { font-size: 11px; font-weight: 500; color: var(--text-muted); }+ .kn { font-size: 12px; font-weight: 600; color: var(--text-primary); }+ .src { font-size: 11px; color: var(--text-tertiary); }.oct { display: flex; align-items: center; gap: 2px; margin-left: auto; }- .oct .mono { width: 46px; text-align: center; font-size: 12px; color: var(--ink1); }+ .octn { width: 52px; text-align: center; font-size: 12px; color: var(--text-secondary); }+ .octn .mono { color: var(--text-primary); }.sq { width: 42px; padding: 0; }- .sq path { stroke: var(--ink2); stroke-width: 1.6; stroke-linecap: round; fill: none; }+ .sq path { stroke: currentColor; stroke-width: 1.5; fill: none; }.surface { flex: 1; min-height: 0; display: flex; touch-action: none; }- .kb { flex: 1; min-width: 0; position: relative; display: flex; gap: 3px; }- .white { flex: 1; min-width: 0; border-radius: 0 0 6px 6px; background: var(--white-key); position: relative; overflow: hidden; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; padding-bottom: 12px; }+ /* The keyboard: keys butted on seams; the key under a finger is the accent, a key the track plays carries its colour. */+ .kb { flex: 1; min-width: 0; position: relative; display: flex; gap: 1px; background: var(--seam); border: 1px solid var(--seam); border-top: none; border-radius: 0 0 3px 3px; overflow: hidden; }+ .white { flex: 1; min-width: 0; border-radius: 0 0 2px 2px; background: var(--mini-key-white); position: relative; overflow: hidden; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; padding-bottom: 12px; }.white.on { background: var(--accent); }- .lbl { font-size: 10px; color: var(--white-key-ink); }- .white.on .lbl { color: var(--on-accent); }- .black { position: absolute; top: 0; height: 58%; border-radius: 0 0 5px 5px; background: var(--raised); border: 1px solid var(--border-strong); border-top: none; overflow: hidden; z-index: 1; }+ .lbl { font-size: 10px; color: var(--text-tertiary); }+ .white.on .lbl { color: var(--ink-on-accent); }+ .black { position: absolute; top: 0; height: 58%; border-radius: 0 0 2px 2px; background: var(--mini-key-black); border: 1px solid var(--seam); border-top: none; overflow: hidden; z-index: 1; }.black.on { background: var(--accent); border-color: var(--accent); }.band { position: absolute; left: 0; right: 0; bottom: 0; height: 5px; background: var(--tc); }+ /* Scale cells and chords: tiles. Tonic cells sit a tone up. */.grid { flex: 1; min-width: 0; display: grid; grid-auto-rows: minmax(0, 1fr); gap: 6px; }- .cell { border-radius: 5px; background: var(--raised); border: 1px solid var(--border); display: flex; align-items: center; justify-content: center; min-height: 0; }- .cell .mono { font-size: 12px; color: var(--ink3); pointer-events: none; }- .cell.tonic { background: var(--track-off); border-color: var(--border-strong); }- .cell.tonic .mono { color: var(--ink0); font-weight: 600; }- .cell.lit { border-color: var(--tc); }- .cell.on { background: var(--accent); border-color: var(--accent); }- .cell.on .mono { color: var(--on-accent); }- .chords { gap: 8px; }- .chord { border-radius: 6px; background: var(--raised); border: 1px solid var(--border); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; min-height: 0; }+ .cell { border-radius: 3px; background: var(--surface-raised); border: 1px solid var(--seam); box-shadow: var(--bevel); display: flex; align-items: center; justify-content: center; min-height: 0; }+ .cell .mono { font-size: 12px; color: var(--text-secondary); pointer-events: none; }+ .cell.tonic { background: var(--surface-hover); }+ .cell.tonic .mono { color: var(--text-primary); font-weight: 600; }+ .cell.lit, .chord.lit { border-color: var(--tc); }+ .cell.on { background: var(--accent); border-color: var(--accent); box-shadow: none; }+ .cell.on .mono { color: var(--ink-on-accent); }+ .chord { border-radius: 3px; background: var(--surface-raised); border: 1px solid var(--seam); box-shadow: var(--bevel); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; min-height: 0; }.chord * { pointer-events: none; }- .roman { font-size: 12px; color: var(--accent-dim); }- .cn { font-size: 20px; font-weight: 600; color: var(--ink1); }- .chord.lit { border-color: var(--tc); }- .chord.on { background: var(--accent); border-color: var(--accent); }- .chord.on .cn, .chord.on .roman { color: var(--on-accent); }- .hint { font-size: 11px; color: var(--ink5); }+ .roman { font-size: 12px; color: var(--text-muted); }+ .cn { font-size: 20px; font-weight: 600; color: var(--text-primary); }+ .chord.on { background: var(--accent); border-color: var(--accent); box-shadow: none; }+ .chord.on .cn, .chord.on .roman { color: var(--ink-on-accent); }+ .hint { font-size: 11px; color: var(--text-tertiary); }.white *, .black * { pointer-events: none; }</style>diff --git a/src/web/remote/src/screens/Macros.svelte b/src/web/remote/src/screens/Macros.svelteindex 53344d9e..64b5c558 100644--- a/src/web/remote/src/screens/Macros.svelte+++ b/src/web/remote/src/screens/Macros.svelte@@ -1,7 +1,7 @@<!-- SPDX-License-Identifier: AGPL-3.0-only --><!-- Macros: eight big knobs for one device of the track's chain — a rack's macros, a built-ininstrument's or effect's parameters, a plug-in's first eight (paged). A vertical swipe turns- a knob, as in Nota; a brass dot marks an automated parameter. A knob mapped with MIDI Learn+ a knob, as in Nota; a dot marks an automated parameter. A knob mapped with MIDI Learnshows what it drives instead. --><script lang="ts">import { app } from '../lib/app.svelte';@@ -49,7 +49,7 @@<div class="macros" onpointermove={move} onpointerup={up} onpointercancel={up} role="group" aria-label="Macros"><button class="dev" onclick={() => m && m.devs.length > 1 && (app.sheet = 'devices')}>- <span class="caps">Device</span>+ <span class="k">Device</span><span class="dn">{devName}</span>{#if m && m.devs.length > 1}<span class="mono pos">{m.di + 1}/{m.devs.length}</span>{/if}<svg width="10" height="10" viewBox="0 0 10 10"><path d="M2 3.5 L5 6.5 L8 3.5" /></svg>@@ -64,7 +64,7 @@{@const empty = k.n === undefined && !k.map}<div class="knob" class:on class:empty class:learnable={app.learn.on && !empty}onpointerdown={(e) => !empty && down(e, i, v)} role="slider" tabindex="0"- aria-label={k.map ?? k.n ?? `Macro ${i + 1}`} aria-valuenow={Math.round(v * 100)} aria-valuetext={k.map ? `${Math.round(v * 100)} %` : k.txt}>+ aria-label={k.map ?? k.n ?? `Macro ${i + 1}`} aria-valuenow={Math.round(v * 100)} aria-valuetext={k.map ? `${Math.round(v * 100)}\u2009%` : k.txt}>{#if k.a && !k.map}<span class="auto"></span>{/if}<svg width={size} height={size} viewBox="0 0 52 52"><circle cx="26" cy="26" r="21" class="trk" stroke-dasharray="{ARC} {CIRC}" transform="rotate(135 26 26)" />@@ -72,8 +72,8 @@<circle cx="26" cy="26" r="14" class="capc" />{#if !empty}<line x1="26" y1="26" x2="26" y2="14" class="ptr" transform="rotate({-135 + 270 * v} 26 26)" />{/if}</svg>- <span class="kn">{(k.map ?? k.n ?? `Macro ${i + 1}`).toUpperCase()}</span>- <span class="mono kv">{empty ? '—' : k.map ? `${Math.round(v * 100)} %` : on ? `${Math.round(v * 100)} %` : k.txt}</span>+ <span class="kn">{k.map ?? k.n ?? `Macro ${i + 1}`}</span>+ <span class="mono kv">{empty ? '—' : k.map || on ? `${Math.round(v * 100)}\u2009%` : k.txt}</span></div>{/each}</div>@@ -82,24 +82,26 @@<style>.macros { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 10px; touch-action: none; }- .dev { height: 44px; display: flex; align-items: center; gap: 10px; padding: 0 12px; background: var(--well); border: 1px solid var(--border); border-radius: 5px; box-shadow: inset 0 1px 0 rgba(0,0,0,.5); text-align: left; }- .dev .caps { font-size: 9px; letter-spacing: .1em; }- .dn { flex: 1; min-width: 0; font-size: 13px; font-weight: 600; color: var(--ink1); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }- .pos { font-size: 10px; color: var(--ink5); }- .dev path { fill: none; stroke: var(--ink4); stroke-width: 1.4; stroke-linecap: round; }- .grid { flex: 1; min-height: 0; display: grid; grid-auto-rows: minmax(0, 1fr); gap: 8px; }- .knob { min-height: 0; position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; border-radius: 6px; background: var(--card); border: 1px solid var(--border); touch-action: none; }- .knob.on { border-color: var(--border-brass); }- .auto { position: absolute; top: 8px; right: 8px; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }- .trk { fill: none; stroke: var(--well); stroke-width: 5; stroke-linecap: round; }- .arc { fill: none; stroke: var(--accent); stroke-width: 5; stroke-linecap: round; }- .on .arc { stroke: var(--accent-bright); }- .capc { fill: var(--panel); stroke: var(--border-strong); }- .ptr { stroke: var(--accent-bright); stroke-width: 2.4; stroke-linecap: round; }- .kn { font-size: 10px; font-weight: 700; letter-spacing: .08em; color: var(--ink5); max-width: 92%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }- .kv { font-size: 12px; color: var(--ink1); }- .on .kn, .on .kv { color: var(--accent-bright); }- .empty .kv { color: var(--ink6); }- .empty { flex: 1; display: flex; align-items: center; justify-content: center; font-size: 12px; color: var(--ink5); }+ /* The device picker reads like a readout: the well, a rule edge. */+ .dev { height: 44px; display: flex; align-items: center; gap: 10px; padding: 0 12px; background: var(--bg-sunken); box-shadow: var(--sunken); border-radius: 3px; text-align: left; }+ .k { font-size: 11px; font-weight: 500; color: var(--text-muted); }+ .dn { flex: 1; min-width: 0; font-size: 13px; font-weight: 600; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }+ .pos { font-size: 11px; color: var(--text-tertiary); }+ .dev path { fill: none; stroke: var(--text-muted); stroke-width: 1.5; }+ .grid { flex: 1; min-height: 0; display: grid; grid-auto-rows: minmax(0, 1fr); gap: 1px; background: var(--seam); border: 1px solid var(--seam); border-radius: 3px; overflow: hidden; }+ .knob { min-height: 0; position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; background: var(--panel); touch-action: none; }+ .auto { position: absolute; top: 8px; right: 8px; width: 6px; height: 6px; border-radius: 50%; background: var(--text-muted); }+ /* Nota's knob: a well groove, the value in viz ink at rest and the accent while turned, a raised face with a seam edge. */+ .trk { fill: none; stroke: var(--bg-sunken); stroke-width: 5; stroke-linecap: round; }+ .arc { fill: none; stroke: var(--viz-ink); stroke-width: 5; stroke-linecap: round; }+ .on .arc { stroke: var(--accent); }+ .capc { fill: var(--surface-raised); stroke: var(--seam); }+ .ptr { stroke: var(--text-primary); stroke-width: 2.4; stroke-linecap: round; }+ .kn { font-size: 11px; font-weight: 500; color: var(--text-secondary); max-width: 92%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }+ .kv { font-size: 12px; color: var(--text-primary); }+ .on .kn { color: var(--text-primary); }+ .on .kv { color: var(--accent-bright); }+ .knob.empty .kn, .knob.empty .kv { color: var(--text-faint); }+ .empty { flex: 1; display: flex; align-items: center; justify-content: center; font-size: 12px; color: var(--text-tertiary); }.knob.empty { flex: initial; display: flex; }</style>diff --git a/src/web/remote/src/screens/Mixer.svelte b/src/web/remote/src/screens/Mixer.svelteindex 4f06f028..cb0ccc3c 100644--- a/src/web/remote/src/screens/Mixer.svelte+++ b/src/web/remote/src/screens/Mixer.svelte@@ -2,7 +2,8 @@<!-- Mixer: a channel per track, scrolling sideways, the master pinned right. Groups are foldeduntil tapped, as in the arrangement. A fader moves relative to the finger (no jump to thetouch), a double tap resets it to 0 dB; values follow Nota live, and a fader another phone- is holding carries their name. Mute and Solo read as letters, not colour alone. -->+ is holding carries their name. Mute and Solo read as letters, not colour alone. Meters run+ green, then amber from −6 dB and red from 0 dB, on the hub's −60…+6 dBFS scale. --><script lang="ts">import { app } from '../lib/app.svelte';import type { Form } from '../lib/device.svelte';@@ -100,7 +101,7 @@{@const pan = local['p' + t.id] ?? r?.[2] ?? 0}{@const held = heldBy(r)}{@const isGroup = t.kind === 'group'}- <div class="strip" class:group={isGroup} class:active={drag?.key === 'v' + t.id}>+ <div class="strip" class:group={isGroup}><button class="head" onclick={() => isGroup && fold(t)} aria-label={isGroup ? `${t.name}: ${open.has(t.id) ? 'fold' : 'unfold'}` : t.name}><span class="cbar" style:background={t.color}></span><span class="nm">{t.name}</span>@@ -110,14 +111,14 @@</span>{/if}</button>- <div class="pan" onpointerdown={(e) => begin(e, 'p' + t.id, t.id, 'pan', pan)} role="slider" tabindex="0" aria-label="{t.name} pan" aria-valuetext={panText(pan)} aria-valuenow={pan}>+ <div class="pan" class:act={drag?.key === 'p' + t.id} onpointerdown={(e) => begin(e, 'p' + t.id, t.id, 'pan', pan)} role="slider" tabindex="0" aria-label="{t.name} pan" aria-valuetext={panText(pan)} aria-valuenow={pan}><div class="pbar"><span style:left="{50 + pan * 50}%"></span></div><span class="mono pv">{panText(pan)}</span></div><div class="fz">{#if held}<span class="held">{held} has it</span>{/if}- <div class="meters"><div><span style:height="{(r?.[6] ?? 0) * 100}%"></span></div><div><span style:height="{(r?.[7] ?? 0) * 100}%"></span></div></div>- <div class="fader" onpointerdown={(e) => begin(e, 'v' + t.id, t.id, 'vol', vol)} role="slider" tabindex="0" aria-label="{t.name} volume" aria-valuetext="{db(vol)} dB" aria-valuenow={vol}>+ <div class="meters"><div><span style:--lv={r?.[6] ?? 0}></span></div><div><span style:--lv={r?.[7] ?? 0}></span></div></div>+ <div class="fader" class:act={drag?.key === 'v' + t.id} onpointerdown={(e) => begin(e, 'v' + t.id, t.id, 'vol', vol)} role="slider" tabindex="0" aria-label="{t.name} volume" aria-valuetext="{db(vol)} dB" aria-valuenow={vol}><div class="slot"></div><div class="travel"><span class="cap" class:held={!!held} style:bottom="{(vol / MAX) * 100}%"><i></i></span></div></div>@@ -127,7 +128,7 @@<button class="ms" class:mute={r?.[3]} aria-pressed={!!r?.[3]} aria-label="Mute {t.name}" onclick={() => toggle('mute', t, !r?.[3])}>M</button><button class="ms" class:solo={r?.[4]} aria-pressed={!!r?.[4]} aria-label="Solo {t.name}" onclick={() => toggle('solo', t, !r?.[4])}>S</button>{#if t.kind !== 'group' && t.kind !== 'return'}- <button class="arm" class:on={r?.[5]} aria-pressed={!!r?.[5]} aria-label="Arm {t.name}" onclick={() => toggle('arm', t, !r?.[5])}><span></span>ARM</button>+ <button class="arm" class:on={r?.[5]} aria-pressed={!!r?.[5]} aria-label="Arm {t.name}" onclick={() => toggle('arm', t, !r?.[5])}><span></span>Arm</button>{/if}</div></div>@@ -135,60 +136,70 @@</div><div class="rule"></div><div class="strip masterstrip">- <div class="head mh"><span class="caps">Master</span></div>+ <div class="head mh"><span class="nm">Master</span></div><div class="fz">{#if heldBy(master as any)}<span class="held">{master?.[3]} has it</span>{/if}- <div class="meters wide"><div><span style:height="{(master?.[1] ?? 0) * 100}%"></span></div><div><span style:height="{(master?.[2] ?? 0) * 100}%"></span></div></div>- <div class="fader" onpointerdown={(e) => begin(e, 'm', 0, 'mvol', local['m'] ?? master?.[0] ?? 1)} role="slider" tabindex="0" aria-label="Master volume" aria-valuenow={local['m'] ?? master?.[0] ?? 1}>+ <div class="meters wide"><div><span style:--lv={master?.[1] ?? 0}></span></div><div><span style:--lv={master?.[2] ?? 0}></span></div></div>+ <div class="fader" class:act={drag?.key === 'm'} onpointerdown={(e) => begin(e, 'm', 0, 'mvol', local['m'] ?? master?.[0] ?? 1)} role="slider" tabindex="0" aria-label="Master volume" aria-valuenow={local['m'] ?? master?.[0] ?? 1}><div class="slot"></div><div class="travel"><span class="cap" style:bottom="{((local['m'] ?? master?.[0] ?? 1) / MAX) * 100}%"><i></i></span></div></div></div>- <span class="mono dbv">{db(local['m'] ?? master?.[0] ?? 1)}</span>+ <span class="mono dbv" class:act={drag?.key === 'm'}>{db(local['m'] ?? master?.[0] ?? 1)}</span></div></div><style>- .mixer { flex: 1; min-height: 0; display: flex; gap: 8px; touch-action: none; }- .strips { flex: 1; min-width: 0; display: flex; gap: 6px; overflow-x: auto; overflow-y: hidden; touch-action: pan-x; overscroll-behavior: contain; }- .strip { flex: 0 0 88px; min-width: 0; display: flex; flex-direction: column; gap: 6px; padding: 8px 6px; border-radius: 6px; background: var(--panel); border: 1px solid var(--border); }+ .mixer { flex: 1; min-height: 0; display: flex; gap: 0; touch-action: none; margin: -12px; }+ /* Edge to edge: the strips dock against the header and tab bar like panels (main's padding undone). */+ .mixer.phoneLand { margin: -8px -10px calc(-1 * max(10px, env(safe-area-inset-bottom))) -10px; }+ .mixer.tablet { margin: -18px -18px calc(-1 * max(18px, env(safe-area-inset-bottom))); }+ /* Docked strips meeting on seams, as in Nota's Mixer. */+ .strips { flex: 1; min-width: 0; display: flex; gap: 1px; background: var(--seam); overflow-x: auto; overflow-y: hidden; touch-action: pan-x; overscroll-behavior: contain; }+ .strip { flex: 0 0 88px; min-width: 0; display: flex; flex-direction: column; gap: 6px; padding: 10px 6px; background: var(--panel); }.phoneLand .strip { flex-basis: 84px; }.tablet .strip { flex: 1 1 0; min-width: 84px; }- .strip.group { background: var(--well); border-color: var(--hairline); }- .strip.active { border-color: var(--border-brass); }+ .strip.group { background: var(--surface-inset); }.head { display: flex; align-items: center; gap: 6px; min-width: 0; height: 28px; text-align: left; }- .cbar { width: 3px; height: 16px; border-radius: 2px; flex: none; }- .nm { flex: 1; min-width: 0; font-size: 12px; font-weight: 600; color: var(--ink1); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }- .tag { display: flex; align-items: center; gap: 2px; font-size: 9px; color: var(--ink5); }- .tag path { fill: none; stroke: var(--ink5); stroke-width: 1.4; stroke-linecap: round; }+ .cbar { width: 3px; height: 16px; border-radius: 1px; flex: none; }+ .nm { flex: 1; min-width: 0; font-size: 12px; font-weight: 600; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }+ .mh .nm { text-align: center; color: var(--text-secondary); }+ .tag { display: flex; align-items: center; gap: 2px; font-size: 10px; color: var(--text-tertiary); }+ .tag path { fill: none; stroke: currentColor; stroke-width: 1.5; }+ /* Pan: a well track, the position in viz ink — the accent while a finger holds it. */.pan { height: 22px; display: flex; align-items: center; gap: 4px; touch-action: none; }- .pbar { flex: 1; height: 4px; border-radius: 2px; background: var(--well); position: relative; }- .pbar span { position: absolute; top: -3px; width: 3px; height: 10px; margin-left: -1.5px; border-radius: 1px; background: var(--ink2); }- .pv { font-size: 9px; color: var(--ink4); width: 22px; text-align: right; }+ .pbar { flex: 1; height: 3px; border-radius: 1px; background: var(--bg-sunken); box-shadow: var(--sunken); position: relative; }+ .pbar span { position: absolute; top: -4px; width: 3px; height: 11px; margin-left: -1.5px; border-radius: 1px; background: var(--viz-ink); }+ .pan.act .pbar span { background: var(--accent); }+ .pv { font-size: 10px; color: var(--text-muted); width: 24px; text-align: right; }+ .pan.act .pv { color: var(--accent-bright); }.fz { flex: 1; min-height: 0; display: flex; gap: 6px; justify-content: center; position: relative; }- .held { position: absolute; left: 50%; top: 0; transform: translateX(-50%); z-index: 2; height: 18px; display: flex; align-items: center; padding: 0 6px; border-radius: 9px; background: var(--track-off); border: 1px solid var(--border-strong); font-size: 9px; font-weight: 600; color: var(--ink1); white-space: nowrap; }+ .held { position: absolute; left: 50%; top: 0; transform: translateX(-50%); z-index: 2; height: 18px; display: flex; align-items: center; padding: 0 6px; border-radius: 2px; background: var(--surface-raised); box-shadow: var(--popover); font-size: 10px; font-weight: 600; color: var(--text-primary); white-space: nowrap; }+ /* Meters: a full-height bar in the three zones, clipped to the level (never animated). */.meters { display: flex; gap: 2px; padding: 4px 0; }- .meters div { width: 4px; height: 100%; border-radius: 2px; background: var(--well); position: relative; overflow: hidden; }+ .meters div { width: 4px; height: 100%; border-radius: 1px; background: var(--bg-sunken); position: relative; overflow: hidden; }.meters.wide div { width: 5px; }- .meters span { position: absolute; left: 0; right: 0; bottom: 0; background: var(--success); }+ .meters span { position: absolute; inset: 0; background: linear-gradient(to top, var(--success) 0 81.8%, var(--warning) 81.8% 90.9%, var(--danger) 90.9%); clip-path: inset(calc((1 - var(--lv, 0)) * 100%) 0 0 0); }.fader { width: 40px; position: relative; display: flex; justify-content: center; padding: 10px 0; touch-action: none; }- .slot { width: 4px; height: 100%; border-radius: 2px; background: var(--well); border: 1px solid var(--hairline); }+ .slot { width: 3px; height: 100%; border-radius: 1px; background: var(--bg-sunken); box-shadow: var(--sunken); }.travel { position: absolute; left: 0; right: 0; top: 10px; bottom: 10px; }- .cap { position: absolute; left: 4px; right: 4px; height: 20px; margin-bottom: -10px; border-radius: 4px; background: var(--raised); border: 1px solid var(--border-strong); display: flex; align-items: center; justify-content: center; }- .cap.held { border-color: var(--steel); }- .cap i { width: 18px; height: 2px; border-radius: 1px; background: var(--ink3); }- .active .cap i { background: var(--accent-bright); }- .dbv { font-size: 11px; color: var(--ink2); text-align: center; }+ /* The cap: a raised key; its line turns accent while a finger moves it, or while another phone holds it. */+ .cap { position: absolute; left: 4px; right: 4px; height: 20px; margin-bottom: -10px; border-radius: 2px; background: var(--surface-raised); border: 1px solid var(--seam); box-shadow: var(--bevel); display: flex; align-items: center; justify-content: center; }+ .cap.held { border-color: var(--accent); }+ .cap i { width: 18px; height: 2px; border-radius: 1px; background: var(--text-primary); }+ .fader.act .cap i { background: var(--accent); }+ .dbv { font-size: 11px; color: var(--text-strong); text-align: center; }.dbv.act { color: var(--accent-bright); }+ /* Track toggles: raised at rest; mute amber, solo blue, arm red when on — ink derived from the fill. */.btns { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; }- .ms { height: 34px; border-radius: 4px; background: var(--raised); border: 1px solid var(--border); font-size: 12px; font-weight: 700; color: var(--ink4); }- .ms.mute { background: var(--track-off); border-color: var(--ink5); color: var(--ink0); }- .ms.solo { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }- .arm { grid-column: span 2; height: 30px; border-radius: 4px; background: var(--raised); border: 1px solid var(--border); display: flex; align-items: center; justify-content: center; gap: 5px; font-size: 10px; font-weight: 700; letter-spacing: .08em; color: var(--ink4); }- .arm span { width: 8px; height: 8px; border-radius: 50%; background: var(--ink6); }- .arm.on { background: var(--record-wash); border-color: var(--record); color: var(--record-ink); }- .arm.on span { background: var(--record); }- .rule { width: 1px; background: var(--hairline); }+ .ms, .arm { height: 34px; border-radius: 2px; background: var(--surface-raised); border: 1px solid var(--seam); box-shadow: var(--bevel); font-size: 12px; font-weight: 600; color: var(--text-secondary); transition: background-color var(--ease), color var(--ease); }+ .ms.mute { background: var(--mute); border-color: var(--mute); box-shadow: none; color: var(--ink-on-mute); }+ .ms.solo { background: var(--solo); border-color: var(--solo); box-shadow: none; color: var(--ink-on-solo); }+ .arm { grid-column: span 2; height: 30px; display: flex; align-items: center; justify-content: center; gap: 5px; font-size: 11px; }+ .arm span { width: 8px; height: 8px; border-radius: 50%; background: var(--record); }+ .arm.on { background: var(--record); border-color: var(--record); box-shadow: none; color: var(--ink-on-record); }+ .arm.on span { background: var(--ink-on-record); }+ .rule { width: 1px; background: var(--seam); }.masterstrip { flex: 0 0 84px; }.tablet .masterstrip { flex-basis: 110px; }.mh { justify-content: center; }diff --git a/src/web/remote/src/screens/Pads.svelte b/src/web/remote/src/screens/Pads.svelteindex ea38e844..d44a9abb 100644--- a/src/web/remote/src/screens/Pads.svelte+++ b/src/web/remote/src/screens/Pads.svelte@@ -1,12 +1,13 @@<!-- SPDX-License-Identifier: AGPL-3.0-only --><!-- Pads: a 4×4 grid (8×2 in landscape, 8×4 on a tablet) of 16-note banks from C2, thebottom-left pad lowest, as on a hardware pad controller. A drum track names its pads. Velocity- comes from where the finger lands (higher is louder) unless Full vel. is on. A pad lights- brass under the finger at once, and in the track colour when the track plays it. -->+ comes from where the finger lands (higher is louder) unless Full velocity is on. A pad lights+ in the accent under the finger at once, and in the track colour when the track plays it. --><script lang="ts">import { app } from '../lib/app.svelte';import type { Form } from '../lib/device.svelte';import { noteName } from '../lib/music';+ import { look } from '../lib/theme.svelte';let { form }: { form: Form } = $props();const RATES = [{ n: '1/8', div: 2 }, { n: '1/16', div: 4 }, { n: '1/32', div: 8 }];@@ -23,6 +24,7 @@const names = $derived(new Map((app.track?.pads ?? []).map(([n, name]) => [n, name])));const lit = $derived(new Set(app.lit));const color = $derived(app.track?.color ?? 'var(--accent)');+ const colorInk = $derived(app.track ? look.inkOn(app.track.color) : 'var(--ink-on-accent)');// Rows run bottom-up: the first note of the bank sits bottom-left.const pads = $derived.by(() => {@@ -101,7 +103,7 @@<button class="mono" class:on={app.prefs.bank === b.i} onclick={() => (app.prefs.bank = b.i)}>{b.name}</button>{/each}</div>- <button class="btn" class:on={app.prefs.fullVel} aria-pressed={app.prefs.fullVel} onclick={() => (app.prefs.fullVel = !app.prefs.fullVel)}>Full vel.</button>+ <button class="btn" class:on={app.prefs.fullVel} aria-pressed={app.prefs.fullVel} onclick={() => (app.prefs.fullVel = !app.prefs.fullVel)}>Full velocity</button><button class="btn rep" class:on={repeat} aria-pressed={repeat} onclick={() => (repeat = !repeat)}>Repeat<span class="rate mono" role="button" tabindex="0" aria-label="Repeat rate"@@ -113,11 +115,11 @@{#each pads as note (note)}{@const on = down[note]}{@const playing = !on && lit.has(note)}- <button class="pad" class:on class:playing style:--tc={color}+ <button class="pad" class:on class:playing style:--tc={color} style:--tc-ink={colorInk}onpointerdown={(e) => press(e, note)} onpointerup={release} onpointercancel={release} onpointerleave={release}aria-label={names.get(note) ?? noteName(note)}><span class="num mono">{note - 35}</span>- <span class="label">+ <span class="txt"><span class="name">{names.get(note) ?? noteName(note)}</span><span class="note mono">{noteName(note)}</span></span>@@ -129,19 +131,19 @@<style>.pads { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 10px; }.bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }- .banks button { min-width: 42px; flex: none; font-size: 11px; font-weight: 500; }+ .banks button { min-width: 42px; flex: none; font-size: 12px; }.rep { padding: 0 6px 0 10px; gap: 8px; }- .rate { height: 30px; display: flex; align-items: center; padding: 0 7px; border-radius: 3px; background: var(--well); font-size: 11px; color: var(--ink3); }- .rep.on .rate { color: var(--accent-bright); }- .grid { flex: 1; min-height: 0; display: grid; grid-auto-rows: minmax(0, 1fr); gap: 8px; }- .pad { border-radius: 6px; background: var(--raised); border: 1px solid var(--border); box-shadow: inset 0 1px 0 rgba(255,255,255,.03); display: flex; flex-direction: column; justify-content: space-between; align-items: stretch; padding: 8px; min-height: 0; min-width: 0; overflow: hidden; text-align: left; touch-action: none; }- .num, .note { font-size: 10px; color: var(--ink5); }- .note { font-size: 9px; }- .label { display: flex; flex-direction: column; gap: 1px; min-width: 0; }- .name { font-size: 12px; font-weight: 600; color: var(--ink1); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }+ .rate { height: 30px; display: flex; align-items: center; padding: 0 7px; border-radius: 2px; background: var(--bg-sunken); font-size: 11px; color: var(--text-secondary); }+ .rep.on .rate { color: var(--text-primary); }+ .grid { flex: 1; min-height: 0; display: grid; grid-auto-rows: minmax(0, 1fr); gap: 6px; }+ /* Tiles: raised at rest; under the finger solid accent; played by the track solid in its colour — ink derived either way. */+ .pad { border-radius: 3px; background: var(--surface-raised); border: 1px solid var(--seam); box-shadow: var(--bevel); display: flex; flex-direction: column; justify-content: space-between; align-items: stretch; padding: 8px; min-height: 0; min-width: 0; overflow: hidden; text-align: left; touch-action: none; }+ .num, .note { font-size: 10px; color: var(--text-tertiary); }+ .txt { display: flex; flex-direction: column; gap: 1px; min-width: 0; }+ .name { font-size: 12px; font-weight: 600; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }:global(.tablet) .name { font-size: 14px; }- .pad.playing { background: var(--tc); border-color: var(--tc); }- .pad.on { background: var(--accent); border-color: var(--accent); }- .pad.on *, .pad.playing * { color: var(--on-accent); }- .pad.playing * { color: #171613; }+ .pad.playing { background: var(--tc); border-color: var(--tc); box-shadow: none; }+ .pad.playing * { color: var(--tc-ink); }+ .pad.on { background: var(--accent); border-color: var(--accent); box-shadow: none; }+ .pad.on * { color: var(--ink-on-accent); }</style>diff --git a/src/web/remote/src/screens/Scenes.svelte b/src/web/remote/src/screens/Scenes.svelteindex 26d20004..41f7672e 100644--- a/src/web/remote/src/screens/Scenes.svelte+++ b/src/web/remote/src/screens/Scenes.svelte@@ -6,6 +6,7 @@<script lang="ts">import { app } from '../lib/app.svelte';import type { Form } from '../lib/device.svelte';+ import { look } from '../lib/theme.svelte';let { form }: { form: Form } = $props();const s = $derived(app.ses);@@ -13,7 +14,8 @@const cols = $derived(s?.tr ?? []);const colMin = $derived(form === 'phone' ? 96 : form === 'phoneLand' ? 104 : 132);const rowH = $derived(form === 'phone' ? 58 : form === 'phoneLand' ? 50 : 84);- const bars = (beats: number) => { const b = beats / 4; return b === Math.round(b) ? `${b} bar${b === 1 ? '' : 's'}` : `${beats} beats`; };+ // A clip's length as [number, unit]: whole bars where it divides, else beats.+ const bars = (beats: number): [number, string] => { const b = beats / 4; return b === Math.round(b) ? [b, b === 1 ? 'bar' : 'bars'] : [beats, 'beats']; };function guard(): boolean {if (!app.canControl) { app.showToast('Nota lets this phone play notes only.'); return false; }@@ -26,7 +28,7 @@<div class="empty">Loading…</div>{:else}<div class="grid" style:grid-template-columns="{form === 'phone' ? 92 : 110}px repeat({cols.length}, minmax({colMin}px, 1fr))">- <div class="caps corner">Scene</div>+ <div class="label corner">Scene</div>{#each cols as c (c.id)}{@const t = tracks.get(c.id)}<div class="th"><span style:background={t?.color}></span><b>{t?.name ?? ''}</b></div>@@ -41,11 +43,11 @@{#if st === 0}<div class="clip empty" style:height="{rowH}px"></div>{:else}- <button class="clip" class:playing={st === 3} class:queued={st === 2} class:rec={st === 4} style:height="{rowH}px" style:--tc={t?.color}+ <button class="clip" class:playing={st === 3} class:queued={st === 2} class:rec={st === 4} style:height="{rowH}px" style:--tc={t?.color} style:--tc-ink={t ? look.inkOn(t.color) : undefined}onclick={() => guard() && app.send({ t: 'launch', id: c.id, i: si })}aria-label="{t?.name} scene {si + 1}: {st === 3 ? 'playing' : st === 2 ? 'queued' : st === 4 ? 'recording' : 'stopped'}">- <span class="cn">{#if st === 3}<span class="ptri"></span>{/if}{bars(len)}</span>- <span class="mono cs">{st === 3 ? 'PLAYING' : st === 2 ? 'QUEUED' : st === 4 ? 'RECORDING' : ''}</span>+ <span class="cn">{#if st === 3}<span class="ptri"></span>{/if}<span><span class="mono">{bars(len)[0]}</span> {bars(len)[1]}</span></span>+ <span class="cs">{st === 3 ? 'Playing' : st === 2 ? 'Queued' : st === 4 ? 'Recording' : ''}</span>{#if st === 3}<span class="prog" style:width="{prog * 100}%"></span>{/if}</button>{/if}@@ -61,27 +63,28 @@<style>.scroll { flex: 1; min-height: 0; overflow: auto; touch-action: pan-x pan-y; overscroll-behavior: contain; }- .grid { display: grid; gap: 6px; min-width: min-content; }- .corner { height: 36px; display: flex; align-items: center; padding-left: 4px; font-size: 9px; }+ .grid { display: grid; gap: 4px; min-width: min-content; }+ .corner { height: 36px; display: flex; align-items: center; padding-left: 4px; }.th { height: 36px; display: flex; align-items: center; gap: 6px; padding: 0 6px; min-width: 0; }- .th span { width: 3px; height: 14px; border-radius: 2px; flex: none; }- .th b { font-size: 12px; font-weight: 600; color: var(--ink2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }- .scene { display: flex; align-items: center; gap: 8px; padding: 0 10px; border-radius: 5px; background: var(--raised); border: 1px solid var(--border); font-size: 12px; font-weight: 600; color: var(--ink1); }- .tri { width: 0; height: 0; border-left: 9px solid var(--ink3); border-top: 6px solid transparent; border-bottom: 6px solid transparent; }- .clip { position: relative; display: flex; flex-direction: column; justify-content: center; align-items: flex-start; gap: 3px; padding: 0 10px; border-radius: 5px; background: var(--raised); border: 1px solid var(--border); overflow: hidden; min-width: 0; text-align: left; }- .clip.empty { background: var(--well); border: 1px dashed var(--hairline); }- .cn { display: flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; color: var(--ink2); white-space: nowrap; }- .cs { font-size: 9px; opacity: .8; }- .clip.playing, .clip.queued { background: var(--tc); border-color: var(--tc); }- .clip.playing { border-color: var(--ink0); }- .clip.playing *, .clip.queued * { color: #171613; }+ .th span { width: 3px; height: 14px; border-radius: 1px; flex: none; }+ .th b { font-size: 12px; font-weight: 600; color: var(--text-strong); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }+ .scene { display: flex; align-items: center; gap: 8px; padding: 0 10px; border-radius: 2px; background: var(--surface-raised); border: 1px solid var(--seam); box-shadow: var(--bevel); font-size: 12px; font-weight: 600; color: var(--text-primary); }+ .tri { width: 0; height: 0; border-left: 9px solid var(--text-secondary); border-top: 6px solid transparent; border-bottom: 6px solid transparent; }+ /* Clip slots: raised when filled; playing and queued in the track's colour, recording red — ink derived. */+ .clip { position: relative; display: flex; flex-direction: column; justify-content: center; align-items: flex-start; gap: 3px; padding: 0 10px; border-radius: 2px; background: var(--surface-raised); border: 1px solid var(--seam); box-shadow: var(--bevel); overflow: hidden; min-width: 0; text-align: left; }+ .clip.empty { background: var(--bg-sunken); border-color: transparent; box-shadow: none; }+ .cn { display: flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; color: var(--text-strong); white-space: nowrap; }+ .cs { font-size: 11px; color: var(--text-tertiary); }+ .clip.playing, .clip.queued { background: var(--tc); border-color: var(--tc); box-shadow: none; }+ .clip.playing *, .clip.queued * { color: var(--tc-ink); }+ /* Queued waits for the launch point: it blinks until then (a time state, not a colour one). */.clip.queued { animation: blink 800ms steps(1) infinite; }- .clip.rec { border-color: var(--record); }- .clip.rec .cs { color: var(--record-ink); }+ .clip.rec { background: var(--record); border-color: var(--record); box-shadow: none; }+ .clip.rec * { color: var(--ink-on-record); }@keyframes blink { 50% { opacity: .35; } }- .ptri { width: 0; height: 0; border-left: 8px solid #171613; border-top: 5px solid transparent; border-bottom: 5px solid transparent; }- .prog { position: absolute; left: 0; bottom: 0; height: 4px; background: #F2EDE1; opacity: .75; }- .stop, .stopall { height: 44px; border-radius: 5px; background: var(--raised); border: 1px solid var(--border); display: flex; align-items: center; justify-content: center; gap: 6px; font-size: 11px; font-weight: 600; color: var(--ink3); }- .sq { width: 9px; height: 9px; border-radius: 1px; background: var(--ink3); }- .empty { padding: 20px; font-size: 12px; color: var(--ink5); }+ .ptri { width: 0; height: 0; border-left: 8px solid var(--tc-ink); border-top: 5px solid transparent; border-bottom: 5px solid transparent; }+ .prog { position: absolute; left: 0; bottom: 0; height: 3px; background: var(--tc-ink); }+ .stop, .stopall { height: 44px; border-radius: 2px; background: var(--surface-raised); border: 1px solid var(--seam); box-shadow: var(--bevel); display: flex; align-items: center; justify-content: center; gap: 6px; font-size: 12px; font-weight: 500; color: var(--text-secondary); }+ .sq { width: 9px; height: 9px; border-radius: 1px; background: currentColor; }+ .empty { padding: 20px; font-size: 12px; color: var(--text-tertiary); }</style>diff --git a/src/web/remote/src/screens/XY.svelte b/src/web/remote/src/screens/XY.svelteindex 715ed121..4da6aff7 100644--- a/src/web/remote/src/screens/XY.svelte+++ b/src/web/remote/src/screens/XY.svelte@@ -20,6 +20,8 @@let lastSend = 0;let stopTilt: (() => void) | null = null;const support = tiltSupport();+ // The point is live while a finger or the phone's tilt moves it: then, and only then, the accent.+ const live = $derived(dragging || tilt);// Follow Nota's values while the finger is off (automation, the mouse, another phone).$effect(() => {@@ -113,7 +115,7 @@const s = app.xy?.[a];const v = a === 'x' ? x : y;if (s && !s.map && !(tilt && s.tilt) && s.txt && !dragging && !tilt) return s.txt;- return Math.round(v * 100) + ' %';+ return Math.round(v * 100) + '\u2009%';};const note = $derived(tilt ? 'Tilt the phone to move the point. Tap Tilt again to use your finger.'@@ -125,19 +127,18 @@<div class="field" class:learnable={app.learn.on} role="slider" tabindex="0" aria-label="XY pad" aria-valuenow={Math.round(x * 100)}onpointerdown={down} onpointermove={move} onpointerup={up} onpointercancel={up}><div class="gridlines"></div>- <div class="fill" style:width="{x * 100}%" style:height="{y * 100}%" style:background={app.track?.color ?? 'var(--accent)'}></div>- <div class="vl" style:left="{x * 100}%"></div>- <div class="hl" style:top="{(1 - y) * 100}%"></div>- <div class="pt" style:left="{x * 100}%" style:top="{(1 - y) * 100}%"><span></span></div>- <span class="ax ax-x mono">{label('x')} →</span>- <span class="ax ax-y mono">↑ {label('y')}</span>+ <div class="vl" class:live style:left="{x * 100}%"></div>+ <div class="hl" class:live style:top="{(1 - y) * 100}%"></div>+ <div class="pt" class:live style:left="{x * 100}%" style:top="{(1 - y) * 100}%"><span></span></div>+ <span class="ax ax-x">{label('x')} →</span>+ <span class="ax ax-y">↑ {label('y')}</span>{#if tilt}<span class="pill">Tilt is moving the point</span>{/if}</div><div class="panel"><div class="axes">{#each ['x', 'y'] as const as a}<div class="axis" class:learnable={app.learn.on}>- <span class="mono an">{a.toUpperCase()}</span>+ <span class="mono an">{a === 'x' ? 'X' : 'Y'}</span><span class="names"><span class="pn">{label(a)}</span><span class="pd">{sub(a)}</span></span><span class="mono av">{value(a)}</span></div>@@ -167,35 +168,38 @@<style>.xy { flex: 1; min-height: 0; display: flex; gap: 12px; }.xy.col { flex-direction: column; }- .field { flex: 1; min-height: 0; min-width: 0; position: relative; border-radius: 6px; background: var(--well); border: 1px solid var(--hairline); box-shadow: inset 0 1px 0 rgba(0,0,0,.5); overflow: hidden; touch-action: none; }- .gridlines { position: absolute; inset: 0; background-image: linear-gradient(var(--grid) 1px, transparent 1px), linear-gradient(90deg, var(--grid) 1px, transparent 1px); background-size: 25% 25%; background-position: -1px -1px; }- .fill { position: absolute; left: 0; bottom: 0; opacity: .08; }- .vl { position: absolute; top: 0; bottom: 0; width: 1px; background: var(--accent-edge); }- .hl { position: absolute; left: 0; right: 0; height: 1px; background: var(--accent-edge); }- .pt { position: absolute; width: 40px; height: 40px; margin: -20px 0 0 -20px; border-radius: 50%; border: 2px solid var(--accent); background: var(--accent-wash); display: flex; align-items: center; justify-content: center; }- .pt span { width: 10px; height: 10px; border-radius: 50%; background: var(--accent-bright); }- .ax { position: absolute; font-size: 10px; color: var(--ink5); pointer-events: none; }+ /* A graph window: the well, a rule frame, the viz grid. Crosshair and point neutral at rest. */+ .field { flex: 1; min-height: 0; min-width: 0; position: relative; border-radius: 3px; background: var(--bg-sunken); box-shadow: var(--sunken); overflow: hidden; touch-action: none; }+ .gridlines { position: absolute; inset: 0; background-image: linear-gradient(var(--viz-grid) 1px, transparent 1px), linear-gradient(90deg, var(--viz-grid) 1px, transparent 1px); background-size: 25% 25%; background-position: -1px -1px; }+ .vl { position: absolute; top: 0; bottom: 0; width: 1px; background: var(--rule); }+ .hl { position: absolute; left: 0; right: 0; height: 1px; background: var(--rule); }+ .vl.live, .hl.live { background: var(--accent); }+ .pt { position: absolute; width: 40px; height: 40px; margin: -20px 0 0 -20px; border-radius: 50%; border: 2px solid var(--viz-ink); display: flex; align-items: center; justify-content: center; }+ .pt span { width: 10px; height: 10px; border-radius: 50%; background: var(--viz-ink); }+ .pt.live { border-color: var(--accent); }+ .pt.live span { background: var(--accent); }+ .ax { position: absolute; font-size: 11px; color: var(--text-faint); pointer-events: none; }.ax-x { right: 10px; bottom: 8px; }.ax-y { left: 10px; top: 8px; }- .pill { position: absolute; left: 50%; top: 12px; transform: translateX(-50%); height: 24px; display: flex; align-items: center; padding: 0 10px; border-radius: 12px; background: var(--accent-wash); border: 1px solid var(--border-brass); font-size: 11px; font-weight: 600; color: var(--accent-bright); white-space: nowrap; }+ .pill { position: absolute; left: 50%; top: 12px; transform: translateX(-50%); height: 24px; display: flex; align-items: center; padding: 0 9px; border-radius: 3px; background: var(--accent); font-size: 11px; font-weight: 600; color: var(--ink-on-accent); white-space: nowrap; }.panel { width: 290px; flex: none; display: flex; flex-direction: column; gap: 10px; }:global(.tablet) .panel { width: 340px; }.col .panel { width: auto; }- .axes { border: 1px solid var(--border); border-radius: 6px; overflow: hidden; }- .axis { height: 50px; display: flex; align-items: center; gap: 12px; padding: 0 12px; background: var(--panel); outline-offset: -3px; }- .axis + .axis { border-top: 1px solid var(--hairline); }- .an { font-size: 13px; color: var(--accent-dim); width: 12px; }+ .axes { border-radius: 3px; overflow: hidden; background: var(--panel); box-shadow: 0 0 0 1px var(--seam); }+ .axis { height: 50px; display: flex; align-items: center; gap: 12px; padding: 0 12px; outline-offset: -3px; }+ .axis + .axis { border-top: 1px solid var(--rule); }+ .an { font-size: 13px; color: var(--text-muted); width: 12px; }.names { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }- .pn { font-size: 12px; font-weight: 600; color: var(--ink1); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }- .pd { font-size: 10px; color: var(--ink5); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }- .av { font-size: 13px; color: var(--ink1); white-space: nowrap; }+ .pn { font-size: 12px; font-weight: 600; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }+ .pd { font-size: 11px; color: var(--text-tertiary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }+ .av { font-size: 13px; color: var(--text-primary); white-space: nowrap; }.row { display: flex; gap: 8px; }.row .seg { flex: 1; }- .row .seg button { height: 38px; }+ .row .seg button { height: 44px; }.tilt { height: 46px; padding: 0 14px; }.ph { width: 10px; height: 14px; border-radius: 2px; border: 1.5px solid currentColor; transform: rotate(-18deg); }- .note { font-size: 11px; line-height: 1.5; color: var(--ink4); }- .note.dim { color: var(--ink5); }- .auto { height: 30px; align-self: flex-start; display: flex; align-items: center; gap: 8px; padding: 0 10px; border-radius: 4px; background: var(--raised); border: 1px solid var(--border); font-size: 11px; font-weight: 600; color: var(--ink1); }+ .note { font-size: 11px; line-height: 1.5; color: var(--text-muted); }+ .note.dim { color: var(--text-tertiary); }+ .auto { height: 30px; align-self: flex-start; display: flex; align-items: center; gap: 8px; padding: 0 10px; border-radius: 3px; background: var(--surface-raised); border: 1px solid var(--seam); box-shadow: var(--bevel); font-size: 11px; font-weight: 600; color: var(--text-primary); }.rd { width: 7px; height: 7px; border-radius: 50%; background: var(--record); }</style>diff --git a/src/web/remote/theme-plugin.ts b/src/web/remote/theme-plugin.tsnew file mode 100644index 00000000..43cf6a89--- /dev/null+++ b/src/web/remote/theme-plugin.ts@@ -0,0 +1,43 @@+// SPDX-License-Identifier: AGPL-3.0-only+// The phone's first-paint colours, built from the theme files (spec 014): what the page+// wears before Nota has told it a theme and before it has one stored — Studio Dark, Nota's+// default, with Studio Light under [data-theme='light'] for an older Nota that only says+// "light". The phone sources hold no colour value; `import 'virtual:nota-theme.css'` gets+// these. The derived inks come from Studio Dark's TextOnAccent and ShadeUp, the two inks+// NotaPalette.ReadableInkOn picks between; Nota sends the real pair once connected.++import { readFileSync } from 'node:fs';+import { fileURLToPath } from 'node:url';+import type { Plugin } from 'vite';+import { cssVars, type Colors, type Ink } from './src/lib/palette.ts';++const ID = 'virtual:nota-theme.css';+const themeFile = (id: string) => fileURLToPath(new URL(`../../managed/Nota.App/Theme/Themes/${id}.json`, import.meta.url));++// Avalonia writes a translucent colour #AARRGGBB; CSS reads #RRGGBBAA.+function colorsOf(id: string): Colors {+ const raw: Colors = JSON.parse(readFileSync(themeFile(id), 'utf8')).colors;+ return Object.fromEntries(Object.entries(raw).map(([k, v]) => [k, v.length === 9 ? '#' + v.slice(3) + v.slice(1, 3) : v]));+}++const block = (sel: string, vars: Record<string, string>) =>+ `${sel} {\n${Object.entries(vars).map(([k, v]) => ` ${k}: ${v};`).join('\n')}\n}\n`;++export function notaTheme(): Plugin {+ return {+ name: 'nota-theme',+ resolveId: (id) => (id === ID ? '\0' + ID : undefined),+ // The browser-chrome tint before any theme is stored: the fallback's ground.+ transformIndexHtml: (html) => html.replace('%NOTA_BG_APP%', colorsOf('studio-dark').BgApp),+ load(id) {+ if (id !== '\0' + ID) return;+ this.addWatchFile(themeFile('studio-dark'));+ this.addWatchFile(themeFile('studio-light'));+ const dark = colorsOf('studio-dark'), light = colorsOf('studio-light');+ const ink: Ink = [dark.TextOnAccent, dark.ShadeUp];+ return `/* Generated from Theme/Themes/studio-dark.json and studio-light.json by theme-plugin.ts. */\n`+ + block(":root, [data-theme='dark']", cssVars(dark, ink)) + "[data-theme='dark'] { color-scheme: dark; }\n"+ + block("[data-theme='light']", cssVars(light, ink)) + "[data-theme='light'] { color-scheme: light; }\n";+ },+ };+}diff --git a/src/web/remote/vite.config.ts b/src/web/remote/vite.config.tsindex d45f4e35..79928576 100644--- a/src/web/remote/vite.config.ts+++ b/src/web/remote/vite.config.ts@@ -3,11 +3,12 @@// proxies /ws to a running Nota (NOTA_REMOTE=http://192.168.1.5:7788 to pick another one).import { defineConfig } from 'vite';import { svelte } from '@sveltejs/vite-plugin-svelte';+import { notaTheme } from './theme-plugin.ts';const nota = process.env.NOTA_REMOTE ?? 'http://127.0.0.1:7788';export default defineConfig({- plugins: [svelte()],+ plugins: [svelte(), notaTheme()],base: './',build: {outDir: '../../managed/Nota.Remote/wwwroot',diff --git a/tests/Nota.SmokeTest/DesignTokenCheck.Remote.cs b/tests/Nota.SmokeTest/DesignTokenCheck.Remote.csnew file mode 100644index 00000000..62a70e7f--- /dev/null+++ b/tests/Nota.SmokeTest/DesignTokenCheck.Remote.cs@@ -0,0 +1,79 @@+// SPDX-License-Identifier: AGPL-3.0-only+// Copyright (c) 2026 Egor Khindikaynen (Nota). See LICENSES/ for license terms.+//+// Nota Remote's page (src/web/remote, spec 014) held as the desktop is: no colour value of+// its own — every colour is a theme token as a custom property, its first-paint fallback+// built from the theme files — and the Studio rules a source scan can see: sentence case+// with no tracking, radii 0–4, every custom property it reads defined. A failure names the+// file and what it found.++using System.Text.Json;+using System.Text.RegularExpressions;++namespace Nota.SmokeTest;++internal static partial class DesignTokenCheck+{+ private static readonly Regex HexColour = new(@"#(?:[0-9a-fA-F]{8}|[0-9a-fA-F]{6}|[0-9a-fA-F]{4}|[0-9a-fA-F]{3})(?![0-9a-zA-Z_-])");+ private static readonly Regex CssColourFn = new(@"\b(?:rgba?|hsla?)\(\s*[\d.]");+ private static readonly Regex Tracking = new(@"letter-spacing\s*:\s*(?<v>[^;}""]+)");+ private static readonly Regex Radius = new(@"border-radius\s*:\s*(?<v>[^;}""]+)");+ private static readonly Regex VarUse = new(@"var\(\s*(?<n>--[a-z0-9-]+)");+ private static readonly Regex VarDef = new(@"(?<![\w-])(?<n>--[a-z0-9-]+)\s*:|style:(?<n>--[a-z0-9-]+)|['""](?<n>--[a-z0-9-]+)['""]");+ private static readonly HashSet<string> RadiusOk = new() { "0", "1px", "2px", "3px", "4px", "50%" };++ public static IEnumerable<(bool Ok, string Label)> RunRemote()+ {+ var root = RepoRoot();+ if (root is null) { yield return (false, "repo root located"); yield break; }+ var web = Path.Combine(root, "src/web/remote");+ var src = Path.Combine(web, "src");+ var files = Files(src, "*.*", SearchOption.AllDirectories)+ .Where(f => f.EndsWith(".svelte") || f.EndsWith(".ts") || f.EndsWith(".css"))+ .OrderBy(f => f, StringComparer.Ordinal).ToList();+ yield return (files.Count > 10, $"phone sources found ({files.Count})");+ var text = files.ToDictionary(f => f, File.ReadAllText);++ // No colour value in the page: hex, rgb() or hsl() — index.html included.+ var withColour = text.Append(new(Path.Combine(web, "index.html").Replace('\\', '/'), File.ReadAllText(Path.Combine(web, "index.html"))))+ .SelectMany(kv => HexColour.Matches(kv.Value).Concat(CssColourFn.Matches(kv.Value)).Select(m => $"{Rel(web, kv.Key)}: {m.Value}"))+ .ToArray();+ yield return (withColour.Length == 0, withColour.Length == 0 ? "phone: no colour literal (every colour is a theme token)"+ : $"phone: colour literals — use a theme token: {string.Join(", ", withColour.Take(8))}");++ // The fallback comes from the theme files, not from values typed into the plugin.+ var plugin = File.ReadAllText(Path.Combine(web, "theme-plugin.ts"));+ var config = File.ReadAllText(Path.Combine(web, "vite.config.ts"));+ yield return (plugin.Contains("Theme/Themes/") && !HexColour.IsMatch(plugin) && config.Contains("notaTheme()"),+ "phone: the first-paint fallback is built from the theme files by the Vite plugin");++ // Sentence case, no tracking: no letter-spacing but 0, no forced capitals.+ var tracked = text.SelectMany(kv => Tracking.Matches(kv.Value).Where(m => m.Groups["v"].Value.Trim() is not ("0" or "normal"))+ .Select(m => $"{Rel(src, kv.Key)}: {m.Value.Trim()}")).ToArray();+ yield return (tracked.Length == 0, tracked.Length == 0 ? "phone: no tracked labels" : $"phone: letter-spacing — labels are not tracked: {string.Join(", ", tracked)}");+ var caps = text.Where(kv => kv.Value.Contains("text-transform: uppercase") || kv.Value.Contains("text-transform:uppercase")+ || (kv.Key.EndsWith(".svelte") && kv.Value.Contains(".toUpperCase()")) || Regex.IsMatch(kv.Value, @"class=""[^""]*\bcaps\b"))+ .Select(kv => Rel(src, kv.Key)).ToArray();+ yield return (caps.Length == 0, caps.Length == 0 ? "phone: no forced capitals" : $"phone: forced capitals (uppercase, toUpperCase, .caps): {string.Join(", ", caps)}");++ // Radii 2 / 3 / 4 (0 docked, 1 for bars, 50 % for round dots).+ var radii = text.SelectMany(kv => Radius.Matches(kv.Value)+ .Where(m => m.Groups["v"].Value.Split(' ', StringSplitOptions.RemoveEmptyEntries).Any(v => !RadiusOk.Contains(v.Trim())))+ .Select(m => $"{Rel(src, kv.Key)}: {m.Value.Trim()}"))+ .ToArray();+ yield return (radii.Length == 0, radii.Length == 0 ? "phone: radii are 0 / 1 / 2 / 3 / 4" : $"phone: off-scale radii: {string.Join(", ", radii.Take(8))}");++ // Every custom property read is a theme token or one the page defines — a renamed or+ // removed token fails here, not as a silently transparent fill on the phone.+ var themeFile = Path.Combine(root, "src/managed/Nota.App/Theme/Themes/studio-dark.json");+ using var doc = JsonDocument.Parse(File.ReadAllText(themeFile));+ var tokens = doc.RootElement.GetProperty("colors").EnumerateObject()+ .Select(p => "--" + Regex.Replace(p.Name, "([a-z0-9])([A-Z])", "$1-$2").ToLowerInvariant()).ToHashSet();+ var defined = text.Values.SelectMany(t => VarDef.Matches(t).Select(m => m.Groups["n"].Value)).ToHashSet();+ var unknown = text.SelectMany(kv => VarUse.Matches(kv.Value).Select(m => m.Groups["n"].Value)+ .Where(n => !tokens.Contains(n) && !defined.Contains(n)).Select(n => $"{Rel(src, kv.Key)}: {n}"))+ .Distinct().ToArray();+ yield return (unknown.Length == 0, unknown.Length == 0 ? $"phone: every custom property read is a theme token ({tokens.Count}) or defined"+ : $"phone: custom properties that are neither a theme token nor defined: {string.Join(", ", unknown.Take(8))}");+ }+}diff --git a/tests/Nota.SmokeTest/Program.cs b/tests/Nota.SmokeTest/Program.csindex ca62368a..d739b5ad 100644--- a/tests/Nota.SmokeTest/Program.cs+++ b/tests/Nota.SmokeTest/Program.cs@@ -87,6 +87,8 @@ Console.WriteLine($"engine v{NotaEngine.Version}");foreach (var (ok, label) in Nota.SmokeTest.DesignTokenCheck.RunIcons()) Check(ok, label);Console.WriteLine("-- design: browser --");foreach (var (ok, label) in Nota.SmokeTest.DesignTokenCheck.RunBrowser()) Check(ok, label);+ Console.WriteLine("-- design: remote --");+ foreach (var (ok, label) in Nota.SmokeTest.DesignTokenCheck.RunRemote()) Check(ok, label);}// Opt-in plugin-scan check (M3-1): `--scan <path-to-nota-scanworker>`. Kept outdiff --git a/tests/Nota.SmokeTest/RemoteTests.cs b/tests/Nota.SmokeTest/RemoteTests.csindex 97a60f76..399d05a3 100644--- a/tests/Nota.SmokeTest/RemoteTests.cs+++ b/tests/Nota.SmokeTest/RemoteTests.cs@@ -177,7 +177,14 @@ internal static class RemoteTestsprivate sealed class FakeHost : IRemoteHost{public string HostName => "Test Mac";- public bool DarkTheme => true;+ // Two appearances the test switches between: Nota in a dark theme with a separate+ // light-mode pick, then Nota in its light pick (so one id serves two roles).+ public static readonly RemoteTheme Dark = Theme("test-dark", true, "#1E1F22"), Light = Theme("test-light", false, "#C9CBCF");+ public static readonly RemoteAppearance DarkOn = new(Dark, Dark, Light, "#17181A", "#FFFFFF");+ public static readonly RemoteAppearance LightOn = new(Light, Dark, Light, "#17181A", "#FFFFFF");+ public RemoteAppearance Appearance { get; set; } = DarkOn;+ private static RemoteTheme Theme(string id, bool dark, string ground) =>+ new(id, id, dark, new Dictionary<string, string> { ["BgApp"] = ground, ["Accent"] = "#FF9F1C", ["ShadowBevel"] = "#FFFFFF12" });public string TrackColor(int trackId) => "#58B368";public int SelectedTrackId { get; set; }public int ProjectKeyCode => -1;@@ -328,6 +335,28 @@ internal static class RemoteTestsvar proj = Wait("proj");yield return (proj is { } pj && pj.GetProperty("tracks").GetArrayLength() == 1 && pj.GetProperty("you").GetInt32() == inst,"the phone gets the project and is put on the instrument track");++ // The theme (specs/014 contracts/theme-message.md): the worn theme and both picks,+ // each once with its tokens, and sent again only when it changes.+ var theme = Wait("theme");+ bool ThemeOk(JsonElement? m, string on) => m is { } tm+ && tm.GetProperty("on").GetString() == on+ && tm.GetProperty("dark").GetString() == "test-dark" && tm.GetProperty("light").GetString() == "test-light"+ && tm.GetProperty("ink").GetArrayLength() == 2+ && tm.GetProperty("th").EnumerateObject().Select(p => p.Name).OrderBy(n => n).SequenceEqual(new[] { "test-dark", "test-light" })+ && tm.GetProperty("th").EnumerateObject().All(p => p.Value.GetProperty("c").EnumerateObject().Count() == 3+ && p.Value.GetProperty("c").TryGetProperty("BgApp", out _));+ yield return (ThemeOk(theme, "test-dark") && theme!.Value.GetProperty("th").GetProperty("test-dark").GetProperty("c").GetProperty("ShadowBevel").GetString() == "#FFFFFF12",+ "the phone is told the theme Nota wears and both picks, each with its colours");+ yield return (proj is { } pd && pd.GetProperty("dark").GetBoolean(), "the project still says dark for an older page");+ yield return (Wait("theme", 200) is null, "an unchanged theme is not sent again");+ host.Appearance = FakeHost.LightOn;+ var theme2 = Wait("theme");+ yield return (ThemeOk(theme2, "test-light") && theme2!.Value.GetProperty("th").GetProperty("test-light").GetProperty("dark").GetBoolean() == false,+ "a theme change in Nota reaches the phone");+ yield return (Wait("theme", 200) is null, "and is sent once");+ yield return (Wait("proj", 1000, m => !m.GetProperty("dark").GetBoolean()) is not null, "the project's dark flag follows the theme");+ host.Appearance = FakeHost.DarkOn;yield return (hub.Devices.Count == 1 && hub.Devices[0].Name == "Anna's iPhone", "Nota lists the phone");Send(new { t = "ping", c = 1 });