Skip to content

Open source CapCut alternative.

TypeScript

refactor(site): remove su, now an internal app in the private repo

David Le5b579999d0fe
diff --git a/docs/README.md b/docs/README.md
index dd72b42d..1a57a50c 100644
--- a/docs/README.md
+++ b/docs/README.md
@@ -26,7 +26,7 @@ Supported product and engineering guides live in `docs/guides/`. This list is th
- [Backend API Guide](guides/backend-apis.md) — the hosted routes the app and site call for model-backed work.
- [Configuration and Experiments](guides/config-and-experiments.md) — the settings registry with its runtime override, and experiments with audiences, per-account overrides and computed verdicts.
- [Frontend and Next.js Guidelines](guides/frontend-nextjs-guidelines.md) — route structure, server/client boundaries, styling, and data access in the site app.
-- [The Blog](guides/blog.md) — the posts on donkeycut.com/blog: where a post lives, how it reaches the page through the cache, and the CMS on the super-user host.
+- [The Blog](guides/blog.md) — the posts on donkeycut.com/blog: where a post lives, and how it reaches the page through the cache.
- [Backlit Icon](guides/backlit-icon.md) — the dark treatment that lights the donkey mark from behind: the layer stack, the tokens, and the rules that keep the mark clean.
**Operations**
diff --git a/docs/guides/backend-apis.md b/docs/guides/backend-apis.md
index 57305b03..d2b4a0e1 100644
--- a/docs/guides/backend-apis.md
+++ b/docs/guides/backend-apis.md
@@ -156,9 +156,7 @@ balance short of one flat-priced generation also returns the price it could not
cover, and that account can still run chat and the other metered calls, so a
client knows to keep the rest of the surface working.
-Credit given by hand is an offer. The caller must be signed in with
-`user.superUser` set, and the target user is addressed by internal id or by
-email. The route records the offer and emails a claim link; the grant and its
+Credit given by hand is an offer su emails as a claim link; the grant and its
ledger entry are written when the person claims, with the credit's lifetime
counted from that moment.
diff --git a/docs/guides/blog.md b/docs/guides/blog.md
index 7220118b..e269e945 100644
--- a/docs/guides/blog.md
+++ b/docs/guides/blog.md
@@ -3,21 +3,21 @@
donkeycut.com/blog is the site's writing surface for search: an index of posts,
one page per post, and a sitemap that lists them. The words and images of a
post live outside the repository. A post's row is in Postgres, its article is
-an MDX file in the private bucket, its images sit beside that file, and the
-Blog tab on the super-user host is where all of it is written.
+an MDX file in the private bucket, and its images sit beside that file. Posts
+are written in su, an internal app in a private repo.
**The one rule:** the repository holds the layout and the machinery; the
content lives in the database and the bucket. A post reaches the site through
-the CMS and the cache.
+the cache.
## How a post reaches the page
```text
-su Blog tab: write, upload, save, publish
+su: write, save, publish
│
▼
row in Postgres · blog/<id>/article.mdx and blog/<id>/<sha>.avif in the bucket
- │ every write clears the `blog` tag and the post's own `blog:<slug>` tag
+ │ su calls the revalidate route, which clears the `blog` and `blog:<slug>` tags
▼
/blog and /blog/<slug> read through `use cache` and compile the MDX inside it
│
@@ -26,7 +26,7 @@ the static shell serves; the article streams in from the cache
```
The public pages are ordinary Cache Components pages: the shell is static,
-the reads are cached and tagged, and a save in the CMS expires the tags so the
+the reads are cached and tagged, and a save expires the tags so the
next visitor gets the new page. Nothing renders per request. The MDX compile
happens inside the cache too, so a page costs one compile per publish.
@@ -44,36 +44,19 @@ a YouTube, Vimeo or direct file address, and two calls to action. Images in the
article are plain markdown images pointing at the media host. A `## FAQs`
section with `###` questions becomes FAQ structured data on its own.
-A button at the foot of the details fills them from the article: the text
-model writes the search copy, the tags, the keywords and the alt text, and
-describes one picture, which the image model paints and the route stores as
-the header and the thumbnail; the copy waits in the form to be looked over
-and saved.
-
-Publishing holds a post to a short contract: a title within the length a
-result shows, a meta description in range, both images, a body, and no publish
-date in the future. The editor shows the same checklist the route enforces.
-
-## Images
-
-Image bytes go straight to the bucket. The browser asks for a signed upload
-address under the post, puts the bytes there, then names that key to the
-encode route. The route reads it, encodes it as AVIF under the width its role
-needs, writes it under its content hash, and deletes the upload. The picture
-keeps its shape: the pages crop the header and the thumbnail to their boxes
-around the focus set by dragging the picture in the editor. The media Worker
-serves those hashed keys under `blog/` without a token and with an immutable
-cache; the article source and the upload scratch keys stay private.
+Images are AVIF files named by their content hash. The media Worker serves
+them under `blog/` without a token and with an immutable cache; the article
+source stays private.
## Previewing a draft
-Preview is Draft Mode. The editor's Preview button opens a route on the apex
-host that turns Draft Mode on for that browser and lands on the post's real
-address. With the cookie set, the blog's cached reads run fresh and include
-drafts for that browser alone; every other visitor keeps the cache. A banner on
-the previewed page leaves Draft Mode.
+Preview is Draft Mode. su's Preview button opens a route on donkeycut.com that
+turns Draft Mode on for that browser and lands on the post's real address. With
+the cookie set, the blog's cached reads run fresh and include drafts for that
+browser alone; every other visitor keeps the cache. A banner on the previewed
+page leaves Draft Mode.
## Where to look
-Server reads and the publish contract live in `site/src/lib/blog/`; the public
-pages in `site/src/app/cut/blog/`; the CMS in `site/src/app/su/blog/`.
+Server reads and cache tags live in `site/src/lib/blog/`; the public pages in
+`site/src/app/cut/blog/`.
diff --git a/docs/guides/config-and-experiments.md b/docs/guides/config-and-experiments.md
index 6d35a82f..a0027e61 100644
--- a/docs/guides/config-and-experiments.md
+++ b/docs/guides/config-and-experiments.md
@@ -32,9 +32,8 @@ variant (the experiment the account is assigned to)
The registry parses every default against its schema when the module loads,
so a wrong default fails the process at boot. A stored override that no longer
parses after a schema change is skipped, logged, and shown on su as invalid so
-it can be reset. The su settings tab draws its form from the schema, so a new
-setting needs no form code. The Product tab on su shows the settings that shape
-what an account gets, such as the signup credit grant, with the same cards.
+it can be reset. su is an internal app in a private repo; the overrides it
+writes live in the database.
**Every tunable is a setting.** A threshold, a switch, a mode: if an operator
might want it different, it is a registry entry, and a feature that people
@@ -164,5 +163,4 @@ shape and resolution, audience, assignment, the experiment schema, and the
statistics and verdict, with no host code inside. The site binds it in its
config library, which holds the product's registry, collects the audience
facts, and stores assignments; the results job sits with the other background
-jobs; the su surface is the experiments section with its list and settings
-tabs.
+jobs.
diff --git a/site/package-lock.json b/site/package-lock.json
index 080bdc6c..b330aa30 100644
--- a/site/package-lock.json
+++ b/site/package-lock.json
@@ -49,7 +49,6 @@
"@google/genai": "2.21.0",
"@mdx-js/loader": "^3.1.1",
"@mdx-js/react": "^3.1.1",
- "@mdxeditor/editor": "^4.2.4",
"@mediabunny/prores": "^1.55.1",
"@mediabunny/server": "^1.55.1",
"@mediapipe/tasks-vision": "^1.0.1",
@@ -74,10 +73,8 @@
"class-variance-authority": "^0.7.1",
"clsx": "^2.1.1",
"cn": "^0.2.6",
- "date-fns": "^4.4.0",
"defuddle": "^0.18.1",
"geist": "^1.7.2",
- "lexical": "^0.48.0",
"linkedom": "^0.18.12",
"lucide-react": "^1.23.0",
"mediabunny": "^1.55.5",
@@ -90,11 +87,9 @@
"pg": "^8.20.0",
"posthog-js": "^1.428.5",
"react": "19.2.4",
- "react-day-picker": "^10.0.1",
"react-dom": "19.2.4",
"react-email": "^6.9.1",
"react-markdown": "^10.1.0",
- "recharts": "^3.8.0",
"remark-gfm": "^4.0.1",
"resend": "^6.18.1",
"shadcn": "^4.7.0",
@@ -1476,426 +1471,6 @@
"dev": true,
"license": "MIT OR Apache-2.0"
},
- "node_modules/@codemirror/autocomplete": {
- "version": "6.20.3",
- "resolved": "https://registry.npmjs.org/@codemirror/autocomplete/-/autocomplete-6.20.3.tgz",
- "integrity": "sha512-tlosUqb+3BbxCxZdu4tKeRghPFC+QM7q4X5YhKV2eCmPG+1r2F3f4AaSz5sCrFqUtX4Jh20VFTKecl16MgiV9g==",
- "license": "MIT",
- "dependencies": {
- "@codemirror/language": "^6.0.0",
- "@codemirror/state": "^6.0.0",
- "@codemirror/view": "^6.17.0",
- "@lezer/common": "^1.0.0"
- }
- },
- "node_modules/@codemirror/commands": {
- "version": "6.11.0",
- "resolved": "https://registry.npmjs.org/@codemirror/commands/-/commands-6.11.0.tgz",
- "integrity": "sha512-/K4Rl5BN0OtTiPWmJCdqODu38XnDMsDxKY5rgrPnCkutPTJf2wVbkoixLfealF5Kwse/s8P8M5jAiURiwSwnFA==",
- "license": "MIT",
- "dependencies": {
- "@codemirror/language": "^6.0.0",
- "@codemirror/state": "^6.7.0",
- "@codemirror/view": "^6.27.0",
- "@lezer/common": "^1.1.0"
- }
- },
- "node_modules/@codemirror/lang-angular": {
- "version": "0.1.4",
- "resolved": "https://registry.npmjs.org/@codemirror/lang-angular/-/lang-angular-0.1.4.tgz",
- "integrity": "sha512-oap+gsltb/fzdlTQWD6BFF4bSLKcDnlxDsLdePiJpCVNKWXSTAbiiQeYI3UmES+BLAdkmIC1WjyztC1pi/bX4g==",
- "license": "MIT",
- "dependencies": {
- "@codemirror/lang-html": "^6.0.0",
- "@codemirror/lang-javascript": "^6.1.2",
- "@codemirror/language": "^6.0.0",
- "@lezer/common": "^1.2.0",
- "@lezer/highlight": "^1.0.0",
- "@lezer/lr": "^1.3.3"
- }
- },
- "node_modules/@codemirror/lang-cpp": {
- "version": "6.0.3",
- "resolved": "https://registry.npmjs.org/@codemirror/lang-cpp/-/lang-cpp-6.0.3.tgz",
- "integrity": "sha512-URM26M3vunFFn9/sm6rzqrBzDgfWuDixp85uTY49wKudToc2jTHUrKIGGKs+QWND+YLofNNZpxcNGRynFJfvgA==",
- "license": "MIT",
- "dependencies": {
- "@codemirror/language": "^6.0.0",
- "@lezer/cpp": "^1.0.0"
- }
- },
- "node_modules/@codemirror/lang-css": {
- "version": "6.3.1",
- "resolved": "https://registry.npmjs.org/@codemirror/lang-css/-/lang-css-6.3.1.tgz",
- "integrity": "sha512-kr5fwBGiGtmz6l0LSJIbno9QrifNMUusivHbnA1H6Dmqy4HZFte3UAICix1VuKo0lMPKQr2rqB+0BkKi/S3Ejg==",
- "license": "MIT",
- "dependencies": {
- "@codemirror/autocomplete": "^6.0.0",
- "@codemirror/language": "^6.0.0",
- "@codemirror/state": "^6.0.0",
- "@lezer/common": "^1.0.2",
- "@lezer/css": "^1.1.7"
- }
- },
- "node_modules/@codemirror/lang-go": {
- "version": "6.0.1",
- "resolved": "https://registry.npmjs.org/@codemirror/lang-go/-/lang-go-6.0.1.tgz",
- "integrity": "sha512-7fNvbyNylvqCphW9HD6WFnRpcDjr+KXX/FgqXy5H5ZS0eC5edDljukm/yNgYkwTsgp2busdod50AOTIy6Jikfg==",
- "license": "MIT",
- "dependencies": {
- "@codemirror/autocomplete": "^6.0.0",
- "@codemirror/language": "^6.6.0",
- "@codemirror/state": "^6.0.0",
- "@lezer/common": "^1.0.0",
- "@lezer/go": "^1.0.0"
- }
- },
- "node_modules/@codemirror/lang-html": {
- "version": "6.4.12",
- "resolved": "https://registry.npmjs.org/@codemirror/lang-html/-/lang-html-6.4.12.tgz",
- "integrity": "sha512-pw2ReWKUqSkbvh76RAT4NYxiogRu+PWkR2ukAwO9uOgrm8uipkzjtKKtNpyeAQwHOqxEeSvAXZ6vr3AfyB9y/w==",
- "license": "MIT",
- "dependencies": {
- "@codemirror/autocomplete": "^6.0.0",
- "@codemirror/lang-css": "^6.0.0",
- "@codemirror/lang-javascript": "^6.0.0",
- "@codemirror/language": "^6.4.0",
- "@codemirror/state": "^6.0.0",
- "@codemirror/view": "^6.17.0",
- "@lezer/common": "^1.0.0",
- "@lezer/css": "^1.1.0",
- "@lezer/html": "^1.3.12"
- }
- },
- "node_modules/@codemirror/lang-java": {
- "version": "6.0.2",
- "resolved": "https://registry.npmjs.org/@codemirror/lang-java/-/lang-java-6.0.2.tgz",
- "integrity": "sha512-m5Nt1mQ/cznJY7tMfQTJchmrjdjQ71IDs+55d1GAa8DGaB8JXWsVCkVT284C3RTASaY43YknrK2X3hPO/J3MOQ==",
- "license": "MIT",
- "dependencies": {
- "@codemirror/language": "^6.0.0",
- "@lezer/java": "^1.0.0"
- }
- },
- "node_modules/@codemirror/lang-javascript": {
- "version": "6.2.5",
- "resolved": "https://registry.npmjs.org/@codemirror/lang-javascript/-/lang-javascript-6.2.5.tgz",
- "integrity": "sha512-zD4e5mS+50htS7F+TYjBPsiIFGanfVqg4HyUz6WNFikgOPf2BgKlx+TQedI1w6n/IqRBVBbBWmGFdLB/7uxO4A==",
- "license": "MIT",
- "dependencies": {
- "@codemirror/autocomplete": "^6.0.0",
- "@codemirror/language": "^6.6.0",
- "@codemirror/lint": "^6.0.0",
- "@codemirror/state": "^6.0.0",
- "@codemirror/view": "^6.17.0",
- "@lezer/common": "^1.0.0",
- "@lezer/javascript": "^1.0.0"
- }
- },
- "node_modules/@codemirror/lang-jinja": {
- "version": "6.0.1",
- "resolved": "https://registry.npmjs.org/@codemirror/lang-jinja/-/lang-jinja-6.0.1.tgz",
- "integrity": "sha512-P5kyHLObzjtbGj16h+hyvZTxJhSjBEeSx4wMjbnAf3b0uwTy2+F0zGjMZL4PQOm/mh2eGZ5xUDVZXgwP783Nsw==",
- "license": "MIT",
- "dependencies": {
- "@codemirror/autocomplete": "^6.0.0",
- "@codemirror/lang-html": "^6.0.0",
- "@codemirror/language": "^6.0.0",
- "@codemirror/state": "^6.0.0",
- "@codemirror/view": "^6.0.0",
- "@lezer/common": "^1.2.0",
- "@lezer/highlight": "^1.2.0",
- "@lezer/lr": "^1.4.0"
- }
- },
- "node_modules/@codemirror/lang-json": {
- "version": "6.0.2",
- "resolved": "https://registry.npmjs.org/@codemirror/lang-json/-/lang-json-6.0.2.tgz",
- "integrity": "sha512-x2OtO+AvwEHrEwR0FyyPtfDUiloG3rnVTSZV1W8UteaLL8/MajQd8DpvUb2YVzC+/T18aSDv0H9mu+xw0EStoQ==",
- "license": "MIT",
- "dependencies": {
- "@codemirror/language": "^6.0.0",
- "@lezer/json": "^1.0.0"
- }
- },
- "node_modules/@codemirror/lang-less": {
- "version": "6.0.2",
- "resolved": "https://registry.npmjs.org/@codemirror/lang-less/-/lang-less-6.0.2.tgz",
- "integrity": "sha512-EYdQTG22V+KUUk8Qq582g7FMnCZeEHsyuOJisHRft/mQ+ZSZ2w51NupvDUHiqtsOy7It5cHLPGfHQLpMh9bqpQ==",
- "license": "MIT",
- "dependencies": {
- "@codemirror/lang-css": "^6.2.0",
- "@codemirror/language": "^6.0.0",
- "@lezer/common": "^1.2.0",
- "@lezer/highlight": "^1.0.0",
- "@lezer/lr": "^1.0.0"
- }
- },
- "node_modules/@codemirror/lang-liquid": {
- "version": "6.3.2",
- "resolved": "https://registry.npmjs.org/@codemirror/lang-liquid/-/lang-liquid-6.3.2.tgz",
- "integrity": "sha512-6PDVU3ZnfeYyz1at1E/ttorErZvZFXXt1OPhtfe1EZJ2V2iDFa0CwPqPgG5F7NXN0yONGoBogKmFAafKTqlwIw==",
- "license": "MIT",
- "dependencies": {
- "@codemirror/autocomplete": "^6.0.0",
- "@codemirror/lang-html": "^6.0.0",
- "@codemirror/language": "^6.0.0",
- "@codemirror/state": "^6.0.0",
- "@codemirror/view": "^6.0.0",
- "@lezer/common": "^1.0.0",
- "@lezer/highlight": "^1.0.0",
- "@lezer/lr": "^1.3.1"
- }
- },
- "node_modules/@codemirror/lang-markdown": {
- "version": "6.5.2",
- "resolved": "https://registry.npmjs.org/@codemirror/lang-markdown/-/lang-markdown-6.5.2.tgz",
- "integrity": "sha512-AwBOdkWYuA//WcM0xO5PfHPUcmz/O2i5o0Nsg1U69SII/loCJlFI1Romd9xp2HYb1kYJRGZotyqRghuHH5n8Kw==",
- "license": "MIT",
- "dependencies": {
- "@codemirror/autocomplete": "^6.7.1",
- "@codemirror/lang-html": "^6.0.0",
- "@codemirror/language": "^6.3.0",
- "@codemirror/state": "^6.0.0",
- "@codemirror/view": "^6.0.0",
- "@lezer/common": "^1.2.1",
- "@lezer/markdown": "^1.0.0"
- }
- },
- "node_modules/@codemirror/lang-php": {
- "version": "6.0.2",
- "resolved": "https://registry.npmjs.org/@codemirror/lang-php/-/lang-php-6.0.2.tgz",
- "integrity": "sha512-ZKy2v1n8Fc8oEXj0Th0PUMXzQJ0AIR6TaZU+PbDHExFwdu+guzOA4jmCHS1Nz4vbFezwD7LyBdDnddSJeScMCA==",
- "license": "MIT",
- "dependencies": {
- "@codemirror/lang-html": "^6.0.0",
- "@codemirror/language": "^6.0.0",
- "@codemirror/state": "^6.0.0",
- "@lezer/common": "^1.0.0",
- "@lezer/php": "^1.0.0"
- }
- },
- "node_modules/@codemirror/lang-python": {
- "version": "6.2.1",
- "resolved": "https://registry.npmjs.org/@codemirror/lang-python/-/lang-python-6.2.1.tgz",
- "integrity": "sha512-IRjC8RUBhn9mGR9ywecNhB51yePWCGgvHfY1lWN/Mrp3cKuHr0isDKia+9HnvhiWNnMpbGhWrkhuWOc09exRyw==",
- "license": "MIT",
- "dependencies": {
- "@codemirror/autocomplete": "^6.3.2",
- "@codemirror/language": "^6.8.0",
- "@codemirror/state": "^6.0.0",
- "@lezer/common": "^1.2.1",
- "@lezer/python": "^1.1.4"
- }
- },
- "node_modules/@codemirror/lang-rust": {
- "version": "6.0.2",
- "resolved": "https://registry.npmjs.org/@codemirror/lang-rust/-/lang-rust-6.0.2.tgz",
- "integrity": "sha512-EZaGjCUegtiU7kSMvOfEZpaCReowEf3yNidYu7+vfuGTm9ow4mthAparY5hisJqOHmJowVH3Upu+eJlUji6qqA==",
- "license": "MIT",
- "dependencies": {
- "@codemirror/language": "^6.0.0",
- "@lezer/rust": "^1.0.0"
- }
- },
- "node_modules/@codemirror/lang-sass": {
- "version": "6.0.2",
- "resolved": "https://registry.npmjs.org/@codemirror/lang-sass/-/lang-sass-6.0.2.tgz",
- "integrity": "sha512-l/bdzIABvnTo1nzdY6U+kPAC51czYQcOErfzQ9zSm9D8GmNPD0WTW8st/CJwBTPLO8jlrbyvlSEcN20dc4iL0Q==",
- "license": "MIT",
- "dependencies": {
- "@codemirror/lang-css": "^6.2.0",
- "@codemirror/language": "^6.0.0",
- "@codemirror/state": "^6.0.0",
- "@lezer/common": "^1.0.2",
- "@lezer/sass": "^1.0.0"
- }
- },
- "node_modules/@codemirror/lang-sql": {
- "version": "6.10.0",
- "resolved": "https://registry.npmjs.org/@codemirror/lang-sql/-/lang-sql-6.10.0.tgz",
- "integrity": "sha512-6ayPkEd/yRw0XKBx5uAiToSgGECo/GY2NoJIHXIIQh1EVwLuKoU8BP/qK0qH5NLXAbtJRLuT73hx7P9X34iO4w==",
- "license": "MIT",
- "dependencies": {
- "@codemirror/autocomplete": "^6.0.0",
- "@codemirror/language": "^6.0.0",
- "@codemirror/state": "^6.0.0",
- "@lezer/common": "^1.2.0",
- "@lezer/highlight": "^1.0.0",
- "@lezer/lr": "^1.0.0"
- }
- },
- "node_modules/@codemirror/lang-vue": {
- "version": "0.1.3",
- "resolved": "https://registry.npmjs.org/@codemirror/lang-vue/-/lang-vue-0.1.3.tgz",
- "integrity": "sha512-QSKdtYTDRhEHCfo5zOShzxCmqKJvgGrZwDQSdbvCRJ5pRLWBS7pD/8e/tH44aVQT6FKm0t6RVNoSUWHOI5vNug==",
- "license": "MIT",
- "dependencies": {
- "@codemirror/lang-html": "^6.0.0",
- "@codemirror/lang-javascript": "^6.1.2",
- "@codemirror/language": "^6.0.0",
- "@lezer/common": "^1.2.0",
- "@lezer/highlight": "^1.0.0",
- "@lezer/lr": "^1.3.1"
- }
- },
- "node_modules/@codemirror/lang-wast": {
- "version": "6.0.2",
- "resolved": "https://registry.npmjs.org/@codemirror/lang-wast/-/lang-wast-6.0.2.tgz",
- "integrity": "sha512-Imi2KTpVGm7TKuUkqyJ5NRmeFWF7aMpNiwHnLQe0x9kmrxElndyH0K6H/gXtWwY6UshMRAhpENsgfpSwsgmC6Q==",
- "license": "MIT",
- "dependencies": {
- "@codemirror/language": "^6.0.0",
- "@lezer/common": "^1.2.0",
- "@lezer/highlight": "^1.0.0",
- "@lezer/lr": "^1.0.0"
- }
- },
- "node_modules/@codemirror/lang-xml": {
- "version": "6.1.0",
- "resolved": "https://registry.npmjs.org/@codemirror/lang-xml/-/lang-xml-6.1.0.tgz",
- "integrity": "sha512-3z0blhicHLfwi2UgkZYRPioSgVTo9PV5GP5ducFH6FaHy0IAJRg+ixj5gTR1gnT/glAIC8xv4w2VL1LoZfs+Jg==",
- "license": "MIT",
- "dependencies": {
- "@codemirror/autocomplete": "^6.0.0",
- "@codemirror/language": "^6.4.0",
- "@codemirror/state": "^6.0.0",
- "@codemirror/view": "^6.0.0",
- "@lezer/common": "^1.0.0",
- "@lezer/xml": "^1.0.0"
- }
- },
- "node_modules/@codemirror/lang-yaml": {
- "version": "6.1.3",
- "resolved": "https://registry.npmjs.org/@codemirror/lang-yaml/-/lang-yaml-6.1.3.tgz",
- "integrity": "sha512-AZ8DJBuXGVHybpBQhmZtgew5//4hv3tdkXnr3vDmOUMJRuB6vn/uuwtmTOTlqEaQFg3hQSVeA90NmvIQyUV6FQ==",
- "license": "MIT",
- "dependencies": {
- "@codemirror/autocomplete": "^6.0.0",
- "@codemirror/language": "^6.0.0",
- "@codemirror/state": "^6.0.0",
- "@lezer/common": "^1.2.0",
- "@lezer/highlight": "^1.2.0",
- "@lezer/lr": "^1.0.0",
- "@lezer/yaml": "^1.0.0"
- }
- },
- "node_modules/@codemirror/language": {
- "version": "6.12.4",
- "resolved": "https://registry.npmjs.org/@codemirror/language/-/language-6.12.4.tgz",
- "integrity": "sha512-1q4PaT+o6PbgpkJt4Q8Fv5XJxTy4FUZ4MWETtyiDw3J0Pyr9E2vqcKL+k9wcvjNTIsauxvE7OfmWj3FRPHQ76A==",
- "license": "MIT",
- "dependencies": {
- "@codemirror/state": "^6.0.0",
- "@codemirror/view": "^6.23.0",
- "@lezer/common": "^1.5.0",
- "@lezer/highlight": "^1.0.0",
- "@lezer/lr": "^1.0.0",
- "style-mod": "^4.0.0"
- }
- },
- "node_modules/@codemirror/language-data": {
- "version": "6.5.2",
- "resolved": "https://registry.npmjs.org/@codemirror/language-data/-/language-data-6.5.2.tgz",
- "integrity": "sha512-CPkWBKrNS8stYbEU5kwBwTf3JB1kghlbh4FSAwzGW2TEscdeHHH4FGysREW86Mqnj3Qn09s0/6Ea/TutmoTobg==",
- "license": "MIT",
- "dependencies": {
- "@codemirror/lang-angular": "^0.1.0",
- "@codemirror/lang-cpp": "^6.0.0",
- "@codemirror/lang-css": "^6.0.0",
- "@codemirror/lang-go": "^6.0.0",
- "@codemirror/lang-html": "^6.0.0",
- "@codemirror/lang-java": "^6.0.0",
- "@codemirror/lang-javascript": "^6.0.0",
- "@codemirror/lang-jinja": "^6.0.0",
- "@codemirror/lang-json": "^6.0.0",
- "@codemirror/lang-less": "^6.0.0",
- "@codemirror/lang-liquid": "^6.0.0",
- "@codemirror/lang-markdown": "^6.0.0",
- "@codemirror/lang-php": "^6.0.0",
- "@codemirror/lang-python": "^6.0.0",
- "@codemirror/lang-rust": "^6.0.0",
- "@codemirror/lang-sass": "^6.0.0",
- "@codemirror/lang-sql": "^6.0.0",
- "@codemirror/lang-vue": "^0.1.1",
- "@codemirror/lang-wast": "^6.0.0",
- "@codemirror/lang-xml": "^6.0.0",
- "@codemirror/lang-yaml": "^6.0.0",
- "@codemirror/language": "^6.0.0",
- "@codemirror/legacy-modes": "^6.4.0"
- }
- },
- "node_modules/@codemirror/legacy-modes": {
- "version": "6.5.4",
- "resolved": "https://registry.npmjs.org/@codemirror/legacy-modes/-/legacy-modes-6.5.4.tgz",
- "integrity": "sha512-/cZr6qZyl08iYNLGsJ862CXXNI51LryRFRE40ejgoIjXZz0C1rGkD3/Ek5jM/8w1ceRjqtt4qx/KLMh4zBTgew==",
- "license": "MIT",
- "dependencies": {
- "@codemirror/language": "^6.0.0"
- }
- },
- "node_modules/@codemirror/lint": {
- "version": "6.9.7",
- "resolved": "https://registry.npmjs.org/@codemirror/lint/-/lint-6.9.7.tgz",
- "integrity": "sha512-28/+iWLYxKxsvGYhSYL7zaCZqLz5+FFFDq9tVsvGv9kv8RY4fFAchJ5WX9M3YrrRlTIsECjsXPqeNgnSmNP2dg==",
- "license": "MIT",
- "dependencies": {
- "@codemirror/state": "^6.0.0",
- "@codemirror/view": "^6.42.0",
- "crelt": "^1.0.5"
- }
- },
- "node_modules/@codemirror/merge": {
- "version": "6.12.2",
- "resolved": "https://registry.npmjs.org/@codemirror/merge/-/merge-6.12.2.tgz",
- "integrity": "sha512-V8JvyAPjHbPupqP7BeMcsdsYCbyPij74jxIbaIJDORI+VZzW44zFmon8bF+oxGWvOKhcRmkiUMXd8MxHr3YA2w==",
- "license": "MIT",
- "dependencies": {
- "@codemirror/language": "^6.0.0",
- "@codemirror/state": "^6.0.0",
- "@codemirror/view": "^6.17.0",
- "@lezer/highlight": "^1.0.0",
- "style-mod": "^4.1.0"
- }
- },
- "node_modules/@codemirror/search": {
- "version": "6.7.2",
- "resolved": "https://registry.npmjs.org/@codemirror/search/-/search-6.7.2.tgz",
- "integrity": "sha512-gUYkYhT2+n/+VGZ+8EzE5WFkYZUZYm1VOKDudIsNqh42uRVQJ0a6Yss9sdKT3MeOYfuL1N6AZA57oza0Oyr0LA==",
- "license": "MIT",
- "dependencies": {
- "@codemirror/state": "^6.0.0",
- "@codemirror/view": "^6.37.0",
- "crelt": "^1.0.5"
- }
- },
- "node_modules/@codemirror/state": {
- "version": "6.7.4",
- "resolved": "https://registry.npmjs.org/@codemirror/state/-/state-6.7.4.tgz",
- "integrity": "sha512-QhQIVRY+xHZDxwOSFrJ1eUMapJBUID3IdeAjf7dHO7zBUzSkyooHiodnalz5MG3iHzwixKMlAAyn7244y537EA==",
- "license": "MIT",
- "dependencies": {
- "@marijn/find-cluster-break": "^1.0.0"
- }
- },
- "node_modules/@codemirror/view": {
- "version": "6.43.11",
- "resolved": "https://registry.npmjs.org/@codemirror/view/-/view-6.43.11.tgz",
- "integrity": "sha512-2+esucbQX6wB2JYi1eDvdCPFTA31BN8oSy6xCmk3G6CloV11yOvEjYk+gH7kLrP0MuHG94E8WDhjs5oMiu3+Wg==",
- "license": "MIT",
- "dependencies": {
- "@codemirror/state": "^6.7.0",
- "crelt": "^1.0.6",
- "style-mod": "^4.1.0",
- "w3c-keyname": "^2.2.4"
- }
- },
- "node_modules/@date-fns/tz": {
- "version": "1.5.0",
- "resolved": "https://registry.npmjs.org/@date-fns/tz/-/tz-1.5.0.tgz",
- "integrity": "sha512-lwYN/vDPeNRULcepoE/LO2Pgx+7/RV+S9ARfbc9lr2DtGkOD7pAiruHvbR1RX3Qyf6ja47EWJDMsNK5vK08DJg==",
- "license": "MIT"
- },
"node_modules/@donkeycut/abexp": {
"resolved": "packages/abexp",
"link": true
@@ -2946,21 +2521,6 @@
"@floating-ui/utils": "^0.2.12"
}
},
- "node_modules/@floating-ui/react": {
- "version": "0.27.20",
- "resolved": "https://registry.npmjs.org/@floating-ui/react/-/react-0.27.20.tgz",
- "integrity": "sha512-CMqMy7OaXl9W0eq1Uy7L7i2Y/anPvHmFmESd2CEw0t5YvZhcVCeo4MBevAmswRllX7Y2dEidA4ozGPunLSTQpw==",
- "license": "MIT",
- "dependencies": {
- "@floating-ui/react-dom": "^2.1.9",
- "@floating-ui/utils": "^0.2.12",
- "tabbable": "^6.0.0"
- },
- "peerDependencies": {
- "react": ">=17.0.0",
- "react-dom": ">=17.0.0"
- }
- },
"node_modules/@floating-ui/react-dom": {
"version": "2.1.9",
"resolved": "https://registry.npmjs.org/@floating-ui/react-dom/-/react-dom-2.1.9.tgz",
@@ -3942,3948 +3502,1411 @@
"license": "MIT",
"optional": true
},
- "node_modules/@lexical/a11y": {
- "version": "0.48.0",
- "resolved": "https://registry.npmjs.org/@lexical/a11y/-/a11y-0.48.0.tgz",
- "integrity": "sha512-18W4ehyipkUim4YVoDZitoH63Om3j6iCN4c84zdqE9RgkWf/PE4rvI/8BHTm6Ni7NkVE14nimXgkpaP5ok15zA==",
+ "node_modules/@mdx-js/loader": {
+ "version": "3.1.1",
+ "resolved": "https://registry.npmjs.org/@mdx-js/loader/-/loader-3.1.1.tgz",
+ "integrity": "sha512-0TTacJyZ9mDmY+VefuthVshaNIyCGZHJG2fMnGaDttCt8HmjUF7SizlHJpaCDoGnN635nK1wpzfpx/Xx5S4WnQ==",
"license": "MIT",
"dependencies": {
- "@lexical/extension": "0.48.0",
- "@lexical/utils": "0.48.0",
- "lexical": "0.48.0"
+ "@mdx-js/mdx": "^3.0.0",
+ "source-map": "^0.7.0"
+ },
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/unified"
},
"peerDependencies": {
- "typescript": ">=5.2"
+ "webpack": ">=5"
},
"peerDependenciesMeta": {
- "typescript": {
+ "webpack": {
"optional": true
}
}
},
- "node_modules/@lexical/clipboard": {
- "version": "0.48.0",
- "resolved": "https://registry.npmjs.org/@lexical/clipboard/-/clipboard-0.48.0.tgz",
- "integrity": "sha512-xO2trk6+yBl8XXa/VNe20kXczmPxFoWtUHjidbBLEtlGBj+mo63pJj6H5o/WlZsoMKmIOJxwxsn2ejrS8G0/7A==",
- "license": "MIT",
- "dependencies": {
- "@lexical/extension": "0.48.0",
- "@lexical/html": "0.48.0",
- "@lexical/internal": "0.48.0",
- "@lexical/list": "0.48.0",
- "@lexical/selection": "0.48.0",
- "@lexical/utils": "0.48.0",
- "@types/trusted-types": "^2.0.7",
- "lexical": "0.48.0"
- },
- "peerDependencies": {
- "typescript": ">=5.2"
- },
- "peerDependenciesMeta": {
- "typescript": {
- "optional": true
- }
+ "node_modules/@mdx-js/loader/node_modules/source-map": {
+ "version": "0.7.6",
+ "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.7.6.tgz",
+ "integrity": "sha512-i5uvt8C3ikiWeNZSVZNWcfZPItFQOsYTUAOkcUPGd8DqDy1uOUikjt5dG+uRlwyvR108Fb9DOd4GvXfT0N2/uQ==",
+ "license": "BSD-3-Clause",
+ "engines": {
+ "node": ">= 12"
}
},
- "node_modules/@lexical/code-core": {
- "version": "0.48.0",
- "resolved": "https://registry.npmjs.org/@lexical/code-core/-/code-core-0.48.0.tgz",
- "integrity": "sha512-+O1Ge06AuSo6+r8R2Xk6SkWG07H5/e4K/Scw9aqCM/BRjITxgvFTHTNvgQbaobCsP0uBJiwW1+ZGeWAWcBCY4w==",
+ "node_modules/@mdx-js/mdx": {
+ "version": "3.1.1",
+ "resolved": "https://registry.npmjs.org/@mdx-js/mdx/-/mdx-3.1.1.tgz",
+ "integrity": "sha512-f6ZO2ifpwAQIpzGWaBQT2TXxPv6z3RBzQKpVftEWN78Vl/YweF1uwussDx8ECAXVtr3Rs89fKyG9YlzUs9DyGQ==",
"license": "MIT",
"dependencies": {
- "@lexical/extension": "0.48.0",
- "@lexical/html": "0.48.0",
- "@lexical/internal": "0.48.0",
- "@lexical/utils": "0.48.0",
- "lexical": "0.48.0"
- },
- "peerDependencies": {
- "typescript": ">=5.2"
+ "@types/estree": "^1.0.0",
+ "@types/estree-jsx": "^1.0.0",
+ "@types/hast": "^3.0.0",
+ "@types/mdx": "^2.0.0",
+ "acorn": "^8.0.0",
+ "collapse-white-space": "^2.0.0",
+ "devlop": "^1.0.0",
+ "estree-util-is-identifier-name": "^3.0.0",
+ "estree-util-scope": "^1.0.0",
+ "estree-walker": "^3.0.0",
+ "hast-util-to-jsx-runtime": "^2.0.0",
+ "markdown-extensions": "^2.0.0",
+ "recma-build-jsx": "^1.0.0",
+ "recma-jsx": "^1.0.0",
+ "recma-stringify": "^1.0.0",
+ "rehype-recma": "^1.0.0",
+ "remark-mdx": "^3.0.0",
+ "remark-parse": "^11.0.0",
+ "remark-rehype": "^11.0.0",
+ "source-map": "^0.7.0",
+ "unified": "^11.0.0",
+ "unist-util-position-from-estree": "^2.0.0",
+ "unist-util-stringify-position": "^4.0.0",
+ "unist-util-visit": "^5.0.0",
+ "vfile": "^6.0.0"
},
- "peerDependenciesMeta": {
- "typescript": {
- "optional": true
- }
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/unified"
+ }
+ },
+ "node_modules/@mdx-js/mdx/node_modules/source-map": {
+ "version": "0.7.6",
+ "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.7.6.tgz",
+ "integrity": "sha512-i5uvt8C3ikiWeNZSVZNWcfZPItFQOsYTUAOkcUPGd8DqDy1uOUikjt5dG+uRlwyvR108Fb9DOd4GvXfT0N2/uQ==",
+ "license": "BSD-3-Clause",
+ "engines": {
+ "node": ">= 12"
}
},
- "node_modules/@lexical/devtools-core": {
- "version": "0.48.0",
- "resolved": "https://registry.npmjs.org/@lexical/devtools-core/-/devtools-core-0.48.0.tgz",
- "integrity": "sha512-4kvKWW6ebgQnJNLXPLmw7dqgSChvzYIBNYtfuR6c48Sw+V/QXQTWqfIUbCIe5X4uG8EEXd5O/udXaJx7GBuP+w==",
+ "node_modules/@mdx-js/react": {
+ "version": "3.1.1",
+ "resolved": "https://registry.npmjs.org/@mdx-js/react/-/react-3.1.1.tgz",
+ "integrity": "sha512-f++rKLQgUVYDAtECQ6fn/is15GkEH9+nZPM3MS0RcxVqoTfawHvDlSCH7JbMhAM6uJ32v3eXLvLmLvjGu7PTQw==",
"license": "MIT",
"dependencies": {
- "@lexical/html": "0.48.0",
- "@lexical/link": "0.48.0",
- "@lexical/mark": "0.48.0",
- "@lexical/table": "0.48.0",
- "@lexical/utils": "0.48.0",
- "lexical": "0.48.0"
+ "@types/mdx": "^2.0.0"
},
- "peerDependencies": {
- "react": ">=18.x",
- "react-dom": ">=18.x",
- "typescript": ">=5.2"
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/unified"
},
- "peerDependenciesMeta": {
- "typescript": {
- "optional": true
- }
+ "peerDependencies": {
+ "@types/react": ">=16",
+ "react": ">=16"
}
},
- "node_modules/@lexical/dragon": {
- "version": "0.48.0",
- "resolved": "https://registry.npmjs.org/@lexical/dragon/-/dragon-0.48.0.tgz",
- "integrity": "sha512-uPuu7fVca9vmL/Oz30CRZ7FIPIodwMrTgNsRmV8jE6Qd6a7RNiTW7r3+EhbhIdkLb/sjcWsYyOMyUR1TJAB0wQ==",
- "license": "MIT",
+ "node_modules/@mediabunny/prores": {
+ "version": "1.55.1",
+ "resolved": "https://registry.npmjs.org/@mediabunny/prores/-/prores-1.55.1.tgz",
+ "integrity": "sha512-0/nmBgGHLr8uDvWvhcVGygQEN75MM18BpdJCZv9jDmw0xE+dWxDcgth8Gw/xxEsMs0xrtKrQhQU4U6ZV5rxx+w==",
+ "license": "MPL-2.0",
"dependencies": {
- "@lexical/extension": "0.48.0",
- "lexical": "0.48.0"
+ "turbores": "^1.2.2"
},
- "peerDependencies": {
- "typescript": ">=5.2"
+ "funding": {
+ "type": "individual",
+ "url": "https://github.com/sponsors/Vanilagy"
},
- "peerDependenciesMeta": {
- "typescript": {
- "optional": true
- }
+ "peerDependencies": {
+ "mediabunny": "^1.49.0"
}
},
- "node_modules/@lexical/extension": {
- "version": "0.48.0",
- "resolved": "https://registry.npmjs.org/@lexical/extension/-/extension-0.48.0.tgz",
- "integrity": "sha512-4uBObgz84mVbQWiumndmIhkuJL0ojHiMwFSvSUM/FCo1YMVIZvpI56blI0y+2Vix/oLui9EgVQSJjjWV4NAszw==",
- "license": "MIT",
+ "node_modules/@mediabunny/server": {
+ "version": "1.55.1",
+ "resolved": "https://registry.npmjs.org/@mediabunny/server/-/server-1.55.1.tgz",
+ "integrity": "sha512-S296TDzp2RaMu8o9I1v5TSbLCkbXj76RhTsNRWTClVOQkmkzj2QYTpddFbGb61jvB7JwfK1jyZ9DFBK+3cTRAA==",
+ "license": "MPL-2.0",
"dependencies": {
- "@lexical/internal": "0.48.0",
- "@lexical/utils": "0.48.0",
- "@preact/signals-core": "^1.14.1",
- "lexical": "0.48.0"
+ "@mediabunny/prores": "^1.55.1",
+ "node-av": "^6.0.0"
},
- "peerDependencies": {
- "typescript": ">=5.2"
+ "funding": {
+ "type": "individual",
+ "url": "https://github.com/sponsors/Vanilagy"
},
- "peerDependenciesMeta": {
- "typescript": {
- "optional": true
- }
+ "peerDependencies": {
+ "mediabunny": "^1.45.0"
}
},
- "node_modules/@lexical/hashtag": {
- "version": "0.48.0",
- "resolved": "https://registry.npmjs.org/@lexical/hashtag/-/hashtag-0.48.0.tgz",
- "integrity": "sha512-hPQtdnbVoNAFsmfnCGfgY7mDbvk6mIznlCRmIR7tLeQKXqz/0Tb6eH3W24EESk9hAF8wFUYNKWE1/Kb3Hl2vEQ==",
+ "node_modules/@mediapipe/tasks-vision": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/@mediapipe/tasks-vision/-/tasks-vision-1.0.1.tgz",
+ "integrity": "sha512-rvRE2FmAZ6ZxKSw7wq+e+jQDpN3t1B/tD2mJz9SmAzb1msoDkd4dMoE4wAh8Z30Um0PQwLiHr9QtomhmXk3aUQ==",
+ "license": "Apache-2.0"
+ },
+ "node_modules/@minhducsun2002/leb128": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/@minhducsun2002/leb128/-/leb128-1.0.0.tgz",
+ "integrity": "sha512-eFrYUPDVHeuwWHluTG1kwNQUEUcFjVKYwPkU8z9DR1JH3AW7JtJsG9cRVGmwz809kKtGfwGJj58juCZxEvnI/g==",
"license": "MIT",
+ "optional": true
+ },
+ "node_modules/@mistralai/mistralai": {
+ "version": "2.2.6",
+ "resolved": "https://registry.npmjs.org/@mistralai/mistralai/-/mistralai-2.2.6.tgz",
+ "integrity": "sha512-W8pX7zHxjJvMIpw8JMxeJEleapXX0Q9NPszdNzqkM3MIEoIGPObdodujj+WHteXEvGfaP/AMwlNyRfEzSY6dQQ==",
+ "license": "Apache-2.0",
"dependencies": {
- "@lexical/text": "0.48.0",
- "@lexical/utils": "0.48.0",
- "lexical": "0.48.0"
+ "@opentelemetry/semantic-conventions": "^1.40.0",
+ "ws": "^8.18.0",
+ "zod": "^3.25.0 || ^4.0.0",
+ "zod-to-json-schema": "^3.25.0"
},
"peerDependencies": {
- "typescript": ">=5.2"
+ "@opentelemetry/api": "^1.9.0"
},
"peerDependenciesMeta": {
- "typescript": {
+ "@opentelemetry/api": {
"optional": true
}
}
},
- "node_modules/@lexical/history": {
- "version": "0.48.0",
- "resolved": "https://registry.npmjs.org/@lexical/history/-/history-0.48.0.tgz",
- "integrity": "sha512-NllvUfO+u3mfi5uC8k2CodwdzeeopFFVtMZ/NMifzFbZFysdWi9m9mqfO46NrEA1rSFOydyefv6oMzC8ULXInA==",
+ "node_modules/@mixmark-io/domino": {
+ "version": "2.2.0",
+ "resolved": "https://registry.npmjs.org/@mixmark-io/domino/-/domino-2.2.0.tgz",
+ "integrity": "sha512-Y28PR25bHXUg88kCV7nivXrP2Nj2RueZ3/l/jdx6J9f8J4nsEGcgX0Qe6lt7Pa+J79+kPiJU3LguR6O/6zrLOw==",
+ "license": "BSD-2-Clause",
+ "optional": true
+ },
+ "node_modules/@modelcontextprotocol/client": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/@modelcontextprotocol/client/-/client-2.0.0.tgz",
+ "integrity": "sha512-8f1OghQ2rjzIOfqgUCP+8GiUWqRs89njoWLNqAe8kWmDePv3s1fZXseej+QXemssEuuOvLLmLO/kqM3IQHtISw==",
"license": "MIT",
"dependencies": {
- "@lexical/extension": "0.48.0",
- "@lexical/utils": "0.48.0",
- "lexical": "0.48.0"
- },
- "peerDependencies": {
- "typescript": ">=5.2"
+ "@modelcontextprotocol/core": "2.0.0",
+ "cross-spawn": "^7.0.5",
+ "eventsource": "^3.0.2",
+ "eventsource-parser": "^3.0.0",
+ "jose": "^6.1.3",
+ "pkce-challenge": "^5.0.0",
+ "zod": "^4.2.0"
},
- "peerDependenciesMeta": {
- "typescript": {
- "optional": true
- }
+ "engines": {
+ "node": ">=20"
}
},
- "node_modules/@lexical/html": {
- "version": "0.48.0",
- "resolved": "https://registry.npmjs.org/@lexical/html/-/html-0.48.0.tgz",
- "integrity": "sha512-uBxlgKl4YgSNEgHJSshdBqtGDzruWdx1ewop+u6faT67qHUdP3P0cUXIrG6NToDWvsL6fzCstAbN76PMER1Pnw==",
+ "node_modules/@modelcontextprotocol/core": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/@modelcontextprotocol/core/-/core-2.0.0.tgz",
+ "integrity": "sha512-pJCEwGG7Lfr/+PQp9ZTwKXNeO5wzbfKL7H3MYpCorM4oFBoQrdjnBgEoqG+RjhsvS1FKrDbKux+M1HhlnGWqcA==",
"license": "MIT",
"dependencies": {
- "@lexical/extension": "0.48.0",
- "@lexical/internal": "0.48.0",
- "@lexical/selection": "0.48.0",
- "@lexical/utils": "0.48.0",
- "lexical": "0.48.0"
- },
- "peerDependencies": {
- "typescript": ">=5.2"
+ "zod": "^4.2.0"
},
- "peerDependenciesMeta": {
- "typescript": {
- "optional": true
- }
+ "engines": {
+ "node": ">=20"
}
},
- "node_modules/@lexical/internal": {
- "version": "0.48.0",
- "resolved": "https://registry.npmjs.org/@lexical/internal/-/internal-0.48.0.tgz",
- "integrity": "sha512-sRwg53K7N0ZQ7KNAvcCY38LSwGizbXP1zlR1lIojZp0GoqHWNvR+vL49t1wYXu1nXx3Osf4ilHHm+aGcwq5hTw==",
+ "node_modules/@modelcontextprotocol/ext-apps": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/@modelcontextprotocol/ext-apps/-/ext-apps-2.0.0.tgz",
+ "integrity": "sha512-a6tXzFcIbIIdnqumQ7W8Oxd8W/KAPkAKYpoxpD9nDgxZ24ywgxG5pK/8G9W5pOFUygS7gWHQhPv8cwRB44/8yg==",
"license": "MIT",
+ "workspaces": [
+ "examples/*"
+ ],
+ "dependencies": {
+ "@standard-schema/spec": "^1.1.0"
+ },
+ "engines": {
+ "node": ">=20"
+ },
"peerDependencies": {
- "typescript": ">=5.2"
+ "@modelcontextprotocol/client": "^2.0.0",
+ "@modelcontextprotocol/core": "^2.0.0",
+ "@modelcontextprotocol/server": "^2.0.0",
+ "react": "^17.0.0 || ^18.0.0 || ^19.0.0",
+ "react-dom": "^17.0.0 || ^18.0.0 || ^19.0.0",
+ "zod": "^4.2.0"
},
"peerDependenciesMeta": {
- "typescript": {
+ "@modelcontextprotocol/server": {
+ "optional": true
+ },
+ "react": {
+ "optional": true
+ },
+ "react-dom": {
"optional": true
}
}
},
- "node_modules/@lexical/link": {
- "version": "0.48.0",
- "resolved": "https://registry.npmjs.org/@lexical/link/-/link-0.48.0.tgz",
- "integrity": "sha512-E0UDmNLUXs/yMCnnE7hbFO0CvhWghmqa+qqPksFfzLkpMHdPpdS1yg59YEbYoNHLi/DXIu4cFRvpHIEuooxwNg==",
+ "node_modules/@modelcontextprotocol/sdk": {
+ "version": "1.30.0",
+ "resolved": "https://registry.npmjs.org/@modelcontextprotocol/sdk/-/sdk-1.30.0.tgz",
+ "integrity": "sha512-xKd8OIzlqNzcqcNumGAa6g+PW2kjD5vrpcKOnfldAUPP3j7lnqMPwlTXQm8gF+UwH72z0lqaRbjr9hqGz0eITA==",
"license": "MIT",
"dependencies": {
- "@lexical/extension": "0.48.0",
- "@lexical/html": "0.48.0",
- "@lexical/internal": "0.48.0",
- "@lexical/utils": "0.48.0",
- "lexical": "0.48.0"
+ "@hono/node-server": "^1.19.9 || ^2.0.5",
+ "ajv": "^8.17.1",
+ "ajv-formats": "^3.0.1",
+ "content-type": "^1.0.5",
+ "cors": "^2.8.5",
+ "cross-spawn": "^7.0.5",
+ "eventsource": "^3.0.2",
+ "eventsource-parser": "^3.0.0",
+ "express": "^5.2.1",
+ "express-rate-limit": "^8.2.1",
+ "hono": "^4.11.4",
+ "jose": "^6.1.3",
+ "json-schema-typed": "^8.0.2",
+ "pkce-challenge": "^5.0.0",
+ "raw-body": "^3.0.0",
+ "zod": "^3.25 || ^4.0",
+ "zod-to-json-schema": "^3.25.1"
+ },
+ "engines": {
+ "node": ">=18"
},
"peerDependencies": {
- "typescript": ">=5.2"
+ "@cfworker/json-schema": "^4.1.1",
+ "zod": "^3.25 || ^4.0"
},
"peerDependenciesMeta": {
- "typescript": {
+ "@cfworker/json-schema": {
"optional": true
+ },
+ "zod": {
+ "optional": false
}
}
},
- "node_modules/@lexical/list": {
- "version": "0.48.0",
- "resolved": "https://registry.npmjs.org/@lexical/list/-/list-0.48.0.tgz",
- "integrity": "sha512-9Qe/Vur44v9F9enj55SUzf79FVsijcGOQug7SpiIU8ekLr7JNzcilKYBYcZ6etGEo7bqQHsYMHXeJcSBbCI2zA==",
+ "node_modules/@modelcontextprotocol/sdk/node_modules/ajv": {
+ "version": "8.20.0",
+ "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.20.0.tgz",
+ "integrity": "sha512-Thbli+OlOj+iMPYFBVBfJ3OmCAnaSyNn4M1vz9T6Gka5Jt9ba/HIR56joy65tY6kx/FCF5VXNB819Y7/GUrBGA==",
"license": "MIT",
"dependencies": {
- "@lexical/extension": "0.48.0",
- "@lexical/html": "0.48.0",
- "@lexical/internal": "0.48.0",
- "@lexical/utils": "0.48.0",
- "lexical": "0.48.0"
- },
- "peerDependencies": {
- "typescript": ">=5.2"
+ "fast-deep-equal": "^3.1.3",
+ "fast-uri": "^3.0.1",
+ "json-schema-traverse": "^1.0.0",
+ "require-from-string": "^2.0.2"
},
- "peerDependenciesMeta": {
- "typescript": {
- "optional": true
- }
+ "funding": {
+ "type": "github",
+ "url": "https://github.com/sponsors/epoberezkin"
}
},
- "node_modules/@lexical/mark": {
- "version": "0.48.0",
- "resolved": "https://registry.npmjs.org/@lexical/mark/-/mark-0.48.0.tgz",
- "integrity": "sha512-DTtypWvnYSXyNUxEmsUnh4y0xXkmdk8Y72EZl8WDHcCwjqaLJlUakH7p/TuSJczs3uVSaoJzu0yh7oGkP1Vsvw==",
+ "node_modules/@modelcontextprotocol/sdk/node_modules/json-schema-traverse": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz",
+ "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==",
+ "license": "MIT"
+ },
+ "node_modules/@modelcontextprotocol/server": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/@modelcontextprotocol/server/-/server-2.0.0.tgz",
+ "integrity": "sha512-YhHWdHfpFMQfd0prsEnxKeS3Qz3ytIGmsS0sth4KDjnacIT7hxk6hXHkJ9KysxlkvTM+WZAtQbbcUhdoP4Hvtw==",
"license": "MIT",
"dependencies": {
- "@lexical/utils": "0.48.0",
- "lexical": "0.48.0"
- },
- "peerDependencies": {
- "typescript": ">=5.2"
+ "@modelcontextprotocol/core": "2.0.0",
+ "zod": "^4.2.0"
},
- "peerDependenciesMeta": {
- "typescript": {
- "optional": true
- }
+ "engines": {
+ "node": ">=20"
}
},
- "node_modules/@lexical/markdown": {
- "version": "0.48.0",
- "resolved": "https://registry.npmjs.org/@lexical/markdown/-/markdown-0.48.0.tgz",
- "integrity": "sha512-1WasBenW4bEsa5xtnycVo8G2hcxIqyYLn3/r98yD2Y+54ZyeFuIQfOeJYhIgCh4YkKpfqyrFwkMQwAOsQDqZjA==",
+ "node_modules/@mswjs/interceptors": {
+ "version": "0.41.9",
+ "resolved": "https://registry.npmjs.org/@mswjs/interceptors/-/interceptors-0.41.9.tgz",
+ "integrity": "sha512-VVPPgHyQ6ShqnrmDWuxjmUIsO9gWyOZFmuOfLd9LfBGQJwZfy0gvv9pbHSJuoFNIYC7ZDX9aoFwowjcdSC4E8w==",
"license": "MIT",
"dependencies": {
- "@lexical/code-core": "0.48.0",
- "@lexical/internal": "0.48.0",
- "@lexical/link": "0.48.0",
- "@lexical/list": "0.48.0",
- "@lexical/rich-text": "0.48.0",
- "@lexical/selection": "0.48.0",
- "@lexical/text": "0.48.0",
- "@lexical/utils": "0.48.0",
- "lexical": "0.48.0"
- },
- "peerDependencies": {
- "typescript": ">=5.2"
+ "@open-draft/deferred-promise": "^2.2.0",
+ "@open-draft/logger": "^0.3.0",
+ "@open-draft/until": "^2.0.0",
+ "is-node-process": "^1.2.0",
+ "outvariant": "^1.4.3",
+ "strict-event-emitter": "^0.5.1"
},
- "peerDependenciesMeta": {
- "typescript": {
- "optional": true
- }
+ "engines": {
+ "node": ">=18"
}
},
- "node_modules/@lexical/overflow": {
- "version": "0.48.0",
- "resolved": "https://registry.npmjs.org/@lexical/overflow/-/overflow-0.48.0.tgz",
- "integrity": "sha512-1YEvMz2tW3EbwrON9mjrkjMVl/vdTcPYSn9P1j6mf5gj0LOoLDNI4TbvSD4SViy+TDghxNdG8YdCISyU2b4YKA==",
+ "node_modules/@mswjs/interceptors/node_modules/@open-draft/deferred-promise": {
+ "version": "2.2.0",
+ "resolved": "https://registry.npmjs.org/@open-draft/deferred-promise/-/deferred-promise-2.2.0.tgz",
+ "integrity": "sha512-CecwLWx3rhxVQF6V4bAgPS5t+So2sTbPgAzafKkVizyi7tlwpcFpdFqq+wqF2OwNBmqFuu6tOyouTuxgpMfzmA==",
+ "license": "MIT"
+ },
+ "node_modules/@napi-rs/wasm-runtime": {
+ "version": "0.2.12",
+ "resolved": "https://registry.npmjs.org/@napi-rs/wasm-runtime/-/wasm-runtime-0.2.12.tgz",
+ "integrity": "sha512-ZVWUcfwY4E/yPitQJl481FjFo3K22D6qF0DuFH6Y/nbnE11GY5uguDxZMGXPQ8WQ0128MXQD7TnfHyK4oWoIJQ==",
+ "dev": true,
"license": "MIT",
+ "optional": true,
"dependencies": {
- "lexical": "0.48.0"
- },
- "peerDependencies": {
- "typescript": ">=5.2"
- },
- "peerDependenciesMeta": {
- "typescript": {
- "optional": true
- }
+ "@emnapi/core": "^1.4.3",
+ "@emnapi/runtime": "^1.4.3",
+ "@tybys/wasm-util": "^0.10.0"
}
},
- "node_modules/@lexical/plain-text": {
- "version": "0.48.0",
- "resolved": "https://registry.npmjs.org/@lexical/plain-text/-/plain-text-0.48.0.tgz",
- "integrity": "sha512-q4f/4VZKVgCrIW2FhDFR2RII1BU0ljedPgEmJ8XQn1zc+JOFPom8Lp0lV5nyEvZaAJYwM/TfoJ9g2V7ESFKznA==",
+ "node_modules/@next/env": {
+ "version": "16.3.4",
+ "resolved": "https://registry.npmjs.org/@next/env/-/env-16.3.4.tgz",
+ "integrity": "sha512-cjWZnUUa6jZq2kFaNe/ZyJdZonOZ/QoN0Zka2nz/FLOrfx14pQuM9c5RaSVkWMqgdt4ksgPAMWPyHSs/CyV48Q==",
+ "license": "MIT"
+ },
+ "node_modules/@next/eslint-plugin-next": {
+ "version": "16.3.4",
+ "resolved": "https://registry.npmjs.org/@next/eslint-plugin-next/-/eslint-plugin-next-16.3.4.tgz",
+ "integrity": "sha512-szW9y2Aumu4z88YXfTzcFsgUAg2k64uzbtcO5L9f1AKS4w/GUKJcbFllRflROVyNPgJtGOnvNxiyp3v6b+prIA==",
+ "dev": true,
"license": "MIT",
"dependencies": {
- "@lexical/clipboard": "0.48.0",
- "@lexical/dragon": "0.48.0",
- "@lexical/extension": "0.48.0",
- "@lexical/selection": "0.48.0",
- "@lexical/utils": "0.48.0",
- "lexical": "0.48.0"
- },
- "peerDependencies": {
- "typescript": ">=5.2"
- },
- "peerDependenciesMeta": {
- "typescript": {
- "optional": true
- }
+ "@eslint-community/eslint-utils": "4.9.1",
+ "fast-glob": "3.3.1"
}
},
- "node_modules/@lexical/react": {
- "version": "0.48.0",
- "resolved": "https://registry.npmjs.org/@lexical/react/-/react-0.48.0.tgz",
- "integrity": "sha512-uVh9/QSrbtjLjVbxfJ+sfiMyhUq/rv7H6uBEVDDIw1rkZJSDY1fvf/CX+dyKgwcDFjKQZ8/9i5f9UCVPeQ01hA==",
- "license": "MIT",
- "dependencies": {
- "@floating-ui/react": "^0.27.19",
- "@lexical/a11y": "0.48.0",
- "@lexical/devtools-core": "0.48.0",
- "@lexical/dragon": "0.48.0",
- "@lexical/extension": "0.48.0",
- "@lexical/hashtag": "0.48.0",
- "@lexical/history": "0.48.0",
- "@lexical/internal": "0.48.0",
- "@lexical/link": "0.48.0",
- "@lexical/list": "0.48.0",
- "@lexical/mark": "0.48.0",
- "@lexical/markdown": "0.48.0",
- "@lexical/overflow": "0.48.0",
- "@lexical/plain-text": "0.48.0",
- "@lexical/rich-text": "0.48.0",
- "@lexical/table": "0.48.0",
- "@lexical/text": "0.48.0",
- "@lexical/utils": "0.48.0",
- "@lexical/yjs": "0.48.0",
- "lexical": "0.48.0"
+ "node_modules/@next/mdx": {
+ "version": "16.3.4",
+ "resolved": "https://registry.npmjs.org/@next/mdx/-/mdx-16.3.4.tgz",
+ "integrity": "sha512-XEmW3ccWWNybofVOmgIEVhXtmNXM0u423iqkVXwPf29fht/tdpUiMDuMHQ4hMerE1477nOJrv5kM/F6qMcEMwA==",
+ "license": "MIT",
+ "dependencies": {
+ "source-map": "^0.7.0"
},
"peerDependencies": {
- "react": ">=18.x",
- "react-dom": ">=18.x",
- "typescript": ">=5.2",
- "yjs": ">=13.5.22"
+ "@mdx-js/loader": ">=0.15.0",
+ "@mdx-js/react": ">=0.15.0"
},
"peerDependenciesMeta": {
- "typescript": {
+ "@mdx-js/loader": {
"optional": true
},
- "yjs": {
+ "@mdx-js/react": {
"optional": true
}
}
},
- "node_modules/@lexical/rich-text": {
- "version": "0.48.0",
- "resolved": "https://registry.npmjs.org/@lexical/rich-text/-/rich-text-0.48.0.tgz",
- "integrity": "sha512-QMXFnwCKAQ4yzxvx5FwmANcx3K+NaBkGTxAVD8s8pOKDD/U5rzDS1iIvhH6TLWaFp7VzvLmLB+Sl1Ie/RnkaDQ==",
- "license": "MIT",
- "dependencies": {
- "@lexical/clipboard": "0.48.0",
- "@lexical/dragon": "0.48.0",
- "@lexical/extension": "0.48.0",
- "@lexical/html": "0.48.0",
- "@lexical/selection": "0.48.0",
- "@lexical/utils": "0.48.0",
- "lexical": "0.48.0"
- },
- "peerDependencies": {
- "typescript": ">=5.2"
- },
- "peerDependenciesMeta": {
- "typescript": {
- "optional": true
- }
+ "node_modules/@next/mdx/node_modules/source-map": {
+ "version": "0.7.6",
+ "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.7.6.tgz",
+ "integrity": "sha512-i5uvt8C3ikiWeNZSVZNWcfZPItFQOsYTUAOkcUPGd8DqDy1uOUikjt5dG+uRlwyvR108Fb9DOd4GvXfT0N2/uQ==",
+ "license": "BSD-3-Clause",
+ "engines": {
+ "node": ">= 12"
}
},
- "node_modules/@lexical/selection": {
- "version": "0.48.0",
- "resolved": "https://registry.npmjs.org/@lexical/selection/-/selection-0.48.0.tgz",
- "integrity": "sha512-Uc0wTrEtHcYK6z/aHHjkgH3vX/R4Bf8mO+qH3VbxfSAKYzNYktM0j+ZGdq5kIEL4frnw/9SulNCXlH7xpjuDgA==",
+ "node_modules/@next/swc-darwin-arm64": {
+ "version": "16.3.4",
+ "resolved": "https://registry.npmjs.org/@next/swc-darwin-arm64/-/swc-darwin-arm64-16.3.4.tgz",
+ "integrity": "sha512-iBr3I5LZNk5/bgl5//iTgD2tcym14MX0Xo7fD//u9dYAEgGzza1y9oywluPtf74YnOswVdH1908aK9xVz7zQTw==",
+ "cpu": [
+ "arm64"
+ ],
"license": "MIT",
- "dependencies": {
- "@lexical/internal": "0.48.0",
- "lexical": "0.48.0"
- },
- "peerDependencies": {
- "typescript": ">=5.2"
- },
- "peerDependenciesMeta": {
- "typescript": {
- "optional": true
- }
+ "optional": true,
+ "os": [
+ "darwin"
+ ],
+ "engines": {
+ "node": ">= 10"
}
},
- "node_modules/@lexical/table": {
- "version": "0.48.0",
- "resolved": "https://registry.npmjs.org/@lexical/table/-/table-0.48.0.tgz",
- "integrity": "sha512-t9Mz7q6ODLUz0lG5Xn9EY/5YiVpTHCqlPQP4EtFXlnBQT3DuKeDS3cC0Cn8sGSZc11YY5OLDfWpB64Frs9BL3g==",
+ "node_modules/@next/swc-darwin-x64": {
+ "version": "16.3.4",
+ "resolved": "https://registry.npmjs.org/@next/swc-darwin-x64/-/swc-darwin-x64-16.3.4.tgz",
+ "integrity": "sha512-2dpiSyl2Jw/NrBPaU2MAKGSa+2MR82pJIn4Sm5Rjr+gxAeuh0z158Su3Z2O8zn7UNNq+ej4bToed6RcRN/Lydg==",
+ "cpu": [
+ "x64"
+ ],
"license": "MIT",
- "dependencies": {
- "@lexical/clipboard": "0.48.0",
- "@lexical/extension": "0.48.0",
- "@lexical/html": "0.48.0",
- "@lexical/internal": "0.48.0",
- "@lexical/utils": "0.48.0",
- "lexical": "0.48.0"
- },
- "peerDependencies": {
- "typescript": ">=5.2"
- },
- "peerDependenciesMeta": {
- "typescript": {
- "optional": true
- }
+ "optional": true,
+ "os": [
+ "darwin"
+ ],
+ "engines": {
+ "node": ">= 10"
}
},
- "node_modules/@lexical/text": {
- "version": "0.48.0",
- "resolved": "https://registry.npmjs.org/@lexical/text/-/text-0.48.0.tgz",
- "integrity": "sha512-ktTMRbsX4wKxdG2OpZCkrqtt8k9Vg/ZpWdukOQ0r1xPRtCuL1T+q91l7cy2ywIuCfMGYS0aoZGB4LdpUMe/H1g==",
+ "node_modules/@next/swc-linux-arm64-gnu": {
+ "version": "16.3.4",
+ "resolved": "https://registry.npmjs.org/@next/swc-linux-arm64-gnu/-/swc-linux-arm64-gnu-16.3.4.tgz",
+ "integrity": "sha512-+t+U8HZT+fApePCS5h89CSH3datz29MkzyfCn+6fpsZBG/oiEOhINcb9rtkv6sdpToLGFn2e6146NzaKCXkqrA==",
+ "cpu": [
+ "arm64"
+ ],
+ "libc": [
+ "glibc"
+ ],
"license": "MIT",
- "dependencies": {
- "@lexical/internal": "0.48.0",
- "lexical": "0.48.0"
- },
- "peerDependencies": {
- "typescript": ">=5.2"
- },
- "peerDependenciesMeta": {
- "typescript": {
- "optional": true
- }
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "engines": {
+ "node": ">= 10"
}
},
- "node_modules/@lexical/utils": {
- "version": "0.48.0",
- "resolved": "https://registry.npmjs.org/@lexical/utils/-/utils-0.48.0.tgz",
- "integrity": "sha512-W4k4P+y6jmRfna8+ad4X+iMd5h8es5PC3bUw5tbi7MRApxaaFG/0w+uJiZVSwbT2Q6JnA2xhBaqzPgt/Gn6djg==",
+ "node_modules/@next/swc-linux-arm64-musl": {
+ "version": "16.3.4",
+ "resolved": "https://registry.npmjs.org/@next/swc-linux-arm64-musl/-/swc-linux-arm64-musl-16.3.4.tgz",
+ "integrity": "sha512-mx03GNs1ocQA5JQ4FxDMmIsNkdrZh8cuezKCrId28e5/gIPU/l7Kcy2+vmCCzdjnnmXJy+iOAu+7K0QppO6Urg==",
+ "cpu": [
+ "arm64"
+ ],
+ "libc": [
+ "musl"
+ ],
"license": "MIT",
- "dependencies": {
- "@lexical/internal": "0.48.0",
- "@lexical/selection": "0.48.0",
- "lexical": "0.48.0"
- },
- "peerDependencies": {
- "typescript": ">=5.2"
- },
- "peerDependenciesMeta": {
- "typescript": {
- "optional": true
- }
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "engines": {
+ "node": ">= 10"
}
},
- "node_modules/@lexical/yjs": {
- "version": "0.48.0",
- "resolved": "https://registry.npmjs.org/@lexical/yjs/-/yjs-0.48.0.tgz",
- "integrity": "sha512-fFsE8EnPM/2KK9rMJ0z6T+Da5UW5V4P+XiAA03LoHTY5YQ/Oy8Q0i7Wcmocv/B/SpsY2o8g07euZEfudl9MVKA==",
+ "node_modules/@next/swc-linux-x64-gnu": {
+ "version": "16.3.4",
+ "resolved": "https://registry.npmjs.org/@next/swc-linux-x64-gnu/-/swc-linux-x64-gnu-16.3.4.tgz",
+ "integrity": "sha512-YIhGY6fSMfha52bnVxnzc9zaVBzJg+cqQTOD8tXIBSx4fuv0pVMxQTE0PaS59YhnMOiYiG09IMwxJAf/CFm/Dw==",
+ "cpu": [
+ "x64"
+ ],
+ "libc": [
+ "glibc"
+ ],
"license": "MIT",
- "dependencies": {
- "@lexical/internal": "0.48.0",
- "@lexical/selection": "0.48.0",
- "lexical": "0.48.0"
- },
- "peerDependencies": {
- "typescript": ">=5.2",
- "yjs": ">=13.5.22"
- },
- "peerDependenciesMeta": {
- "typescript": {
- "optional": true
- }
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "engines": {
+ "node": ">= 10"
}
},
- "node_modules/@lezer/common": {
- "version": "1.5.2",
- "resolved": "https://registry.npmjs.org/@lezer/common/-/common-1.5.2.tgz",
- "integrity": "sha512-sxQE460fPZyU3sdc8lafxiPwJHBzZRy/udNFynGQky1SePYBdhkBl1kOagA9uT3pxR8K09bOrmTUqA9wb/PjSQ==",
- "license": "MIT"
- },
- "node_modules/@lezer/cpp": {
- "version": "1.1.6",
- "resolved": "https://registry.npmjs.org/@lezer/cpp/-/cpp-1.1.6.tgz",
- "integrity": "sha512-vh9gWWJOXFVY8HBHK3Twzq8MgwG2iN4GSyzBP9sCGTe37P15x2R14VaBQk0VA0ezTRN1KHYBBsHhvpGZ2Xy/pA==",
+ "node_modules/@next/swc-linux-x64-musl": {
+ "version": "16.3.4",
+ "resolved": "https://registry.npmjs.org/@next/swc-linux-x64-musl/-/swc-linux-x64-musl-16.3.4.tgz",
+ "integrity": "sha512-+eaaX6axpDb0yF1GCpiERe6njplvdC+nks/fKfcHu3XPGRrald8P3/X7yv7QLdjA51knnxwl9pxdIJsg+w1L+Q==",
+ "cpu": [
+ "x64"
+ ],
+ "libc": [
+ "musl"
+ ],
"license": "MIT",
- "dependencies": {
- "@lezer/common": "^1.2.0",
- "@lezer/highlight": "^1.0.0",
- "@lezer/lr": "^1.0.0"
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "engines": {
+ "node": ">= 10"
}
},
- "node_modules/@lezer/css": {
- "version": "1.3.6",
- "resolved": "https://registry.npmjs.org/@lezer/css/-/css-1.3.6.tgz",
- "integrity": "sha512-YJE78Wcg+zX8f10hiHWQ4Az48Qr/c13eId0VtRQYLBpxHDmDeSrXIlkbl+fJGW42rWC/uoUco9mhBZeVWP/A1g==",
+ "node_modules/@next/swc-win32-arm64-msvc": {
+ "version": "16.3.4",
+ "resolved": "https://registry.npmjs.org/@next/swc-win32-arm64-msvc/-/swc-win32-arm64-msvc-16.3.4.tgz",
+ "integrity": "sha512-0jcXW7Xs/uzICrmgV3MhDYDeRy++1CqnpDIerlPIqYO4bhzB4WNbX/aRnQclustsAyTkFKB0z6rbcjmNg5tR8A==",
+ "cpu": [
+ "arm64"
+ ],
"license": "MIT",
- "dependencies": {
- "@lezer/common": "^1.2.0",
- "@lezer/highlight": "^1.0.0",
- "@lezer/lr": "^1.3.0"
+ "optional": true,
+ "os": [
+ "win32"
+ ],
+ "engines": {
+ "node": ">= 10"
}
},
- "node_modules/@lezer/go": {
- "version": "1.0.1",
- "resolved": "https://registry.npmjs.org/@lezer/go/-/go-1.0.1.tgz",
- "integrity": "sha512-xToRsYxwsgJNHTgNdStpcvmbVuKxTapV0dM0wey1geMMRc9aggoVyKgzYp41D2/vVOx+Ii4hmE206kvxIXBVXQ==",
+ "node_modules/@next/swc-win32-x64-msvc": {
+ "version": "16.3.4",
+ "resolved": "https://registry.npmjs.org/@next/swc-win32-x64-msvc/-/swc-win32-x64-msvc-16.3.4.tgz",
+ "integrity": "sha512-vvBzwu1pYQCp92maZCFCIw/XgOTMR5tur9GjakwIo2cmwRTMKajRZZDS9+e4KsUZWKu1E007WUeAFXRRjZeuzw==",
+ "cpu": [
+ "x64"
+ ],
"license": "MIT",
- "dependencies": {
- "@lezer/common": "^1.2.0",
- "@lezer/highlight": "^1.0.0",
- "@lezer/lr": "^1.3.0"
+ "optional": true,
+ "os": [
+ "win32"
+ ],
+ "engines": {
+ "node": ">= 10"
}
},
- "node_modules/@lezer/highlight": {
- "version": "1.2.3",
- "resolved": "https://registry.npmjs.org/@lezer/highlight/-/highlight-1.2.3.tgz",
- "integrity": "sha512-qXdH7UqTvGfdVBINrgKhDsVTJTxactNNxLk7+UMwZhU13lMHaOBlJe9Vqp907ya56Y3+ed2tlqzys7jDkTmW0g==",
+ "node_modules/@noble/ciphers": {
+ "version": "1.3.0",
+ "resolved": "https://registry.npmjs.org/@noble/ciphers/-/ciphers-1.3.0.tgz",
+ "integrity": "sha512-2I0gnIVPtfnMw9ee9h1dJG7tp81+8Ob3OJb3Mv37rx5L40/b0i7djjCVvGOVqc9AEIQyvyu1i6ypKdFw8R8gQw==",
"license": "MIT",
- "dependencies": {
- "@lezer/common": "^1.3.0"
+ "engines": {
+ "node": "^14.21.3 || >=16"
+ },
+ "funding": {
+ "url": "https://paulmillr.com/funding/"
}
},
- "node_modules/@lezer/html": {
- "version": "1.3.13",
- "resolved": "https://registry.npmjs.org/@lezer/html/-/html-1.3.13.tgz",
- "integrity": "sha512-oI7n6NJml729m7pjm9lvLvmXbdoMoi2f+1pwSDJkl9d68zGr7a9Btz8NdHTGQZtW2DA25ybeuv/SyDb9D5tseg==",
+ "node_modules/@noble/curves": {
+ "version": "1.9.7",
+ "resolved": "https://registry.npmjs.org/@noble/curves/-/curves-1.9.7.tgz",
+ "integrity": "sha512-gbKGcRUYIjA3/zCCNaWDciTMFI0dCkvou3TL8Zmy5Nc7sJ47a0jtOeZoTaMxkuqRo9cRhjOdZJXegxYE5FN/xw==",
"license": "MIT",
"dependencies": {
- "@lezer/common": "^1.2.0",
- "@lezer/highlight": "^1.0.0",
- "@lezer/lr": "^1.0.0"
+ "@noble/hashes": "1.8.0"
+ },
+ "engines": {
+ "node": "^14.21.3 || >=16"
+ },
+ "funding": {
+ "url": "https://paulmillr.com/funding/"
}
},
- "node_modules/@lezer/java": {
- "version": "1.1.4",
- "resolved": "https://registry.npmjs.org/@lezer/java/-/java-1.1.4.tgz",
- "integrity": "sha512-gQylJ2xHV2xXsVqtnAcJrcROvLZJaQiC0tR//+q0k961BxqvyYttusPkJ8d9T1fPDJKHJW2etUH8XbIn9jhVUg==",
+ "node_modules/@noble/hashes": {
+ "version": "1.8.0",
+ "resolved": "https://registry.npmjs.org/@noble/hashes/-/hashes-1.8.0.tgz",
+ "integrity": "sha512-jCs9ldd7NwzpgXDIf6P3+NrHh9/sD6CQdxHyjQI+h/6rDNo88ypBxxz45UDuZHz9r3tNz7N/VInSVoVdtXEI4A==",
"license": "MIT",
- "dependencies": {
- "@lezer/common": "^1.2.0",
- "@lezer/highlight": "^1.0.0",
- "@lezer/lr": "^1.0.0"
+ "engines": {
+ "node": "^14.21.3 || >=16"
+ },
+ "funding": {
+ "url": "https://paulmillr.com/funding/"
}
},
- "node_modules/@lezer/javascript": {
- "version": "1.5.4",
- "resolved": "https://registry.npmjs.org/@lezer/javascript/-/javascript-1.5.4.tgz",
- "integrity": "sha512-vvYx3MhWqeZtGPwDStM2dwgljd5smolYD2lR2UyFcHfxbBQebqx8yjmFmxtJ/E6nN6u1D9srOiVWm3Rb4tmcUA==",
+ "node_modules/@nodelib/fs.scandir": {
+ "version": "2.1.5",
+ "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz",
+ "integrity": "sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==",
"license": "MIT",
"dependencies": {
- "@lezer/common": "^1.2.0",
- "@lezer/highlight": "^1.1.3",
- "@lezer/lr": "^1.3.0"
+ "@nodelib/fs.stat": "2.0.5",
+ "run-parallel": "^1.1.9"
+ },
+ "engines": {
+ "node": ">= 8"
}
},
- "node_modules/@lezer/json": {
- "version": "1.0.3",
- "resolved": "https://registry.npmjs.org/@lezer/json/-/json-1.0.3.tgz",
- "integrity": "sha512-BP9KzdF9Y35PDpv04r0VeSTKDeox5vVr3efE7eBbx3r4s3oNLfunchejZhjArmeieBH+nVOpgIiBJpEAv8ilqQ==",
+ "node_modules/@nodelib/fs.stat": {
+ "version": "2.0.5",
+ "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz",
+ "integrity": "sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==",
"license": "MIT",
- "dependencies": {
- "@lezer/common": "^1.2.0",
- "@lezer/highlight": "^1.0.0",
- "@lezer/lr": "^1.0.0"
+ "engines": {
+ "node": ">= 8"
}
},
- "node_modules/@lezer/lr": {
- "version": "1.4.10",
- "resolved": "https://registry.npmjs.org/@lezer/lr/-/lr-1.4.10.tgz",
- "integrity": "sha512-rnCpTIBafOx4mRp43xOxDJbFipJm/c0cia/V5TiGlhmMa+wsSdoGmUN3w5Bqrks/09Q/D4tNAmWaT8p6NRi77A==",
+ "node_modules/@nodelib/fs.walk": {
+ "version": "1.2.8",
+ "resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz",
+ "integrity": "sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==",
"license": "MIT",
"dependencies": {
- "@lezer/common": "^1.0.0"
+ "@nodelib/fs.scandir": "2.1.5",
+ "fastq": "^1.6.0"
+ },
+ "engines": {
+ "node": ">= 8"
}
},
- "node_modules/@lezer/markdown": {
- "version": "1.7.2",
- "resolved": "https://registry.npmjs.org/@lezer/markdown/-/markdown-1.7.2.tgz",
- "integrity": "sha512-iTkYvoVcKt3WkeL7qUDyXHONZEwLio4wj8KTNi2dnjQEXBZKMV63BpQrPqfsM+OkvuRbiSTAcycYAsQzLhRNoQ==",
+ "node_modules/@nolyfill/is-core-module": {
+ "version": "1.0.39",
+ "resolved": "https://registry.npmjs.org/@nolyfill/is-core-module/-/is-core-module-1.0.39.tgz",
+ "integrity": "sha512-nn5ozdjYQpUCZlWGuxcJY/KpxkWQs4DcbMCmKojjyrYDEAGy4Ce19NN4v5MduafTwJlbKc99UA8YhSVqq9yPZA==",
+ "dev": true,
"license": "MIT",
- "dependencies": {
- "@lezer/common": "^1.5.0",
- "@lezer/highlight": "^1.0.0"
+ "engines": {
+ "node": ">=12.4.0"
}
},
- "node_modules/@lezer/php": {
- "version": "1.0.6",
- "resolved": "https://registry.npmjs.org/@lezer/php/-/php-1.0.6.tgz",
- "integrity": "sha512-QJ2xNXPmsm/Z3IpThq8fnJrEIVpxhsIoj6GZBW0JYEd/l9zxpJZW216X4fzqQY4vgpdGIumypvI4uQjd4tnYtw==",
- "license": "MIT",
- "dependencies": {
- "@lezer/common": "^1.2.0",
- "@lezer/highlight": "^1.0.0",
- "@lezer/lr": "^1.1.0"
- }
+ "node_modules/@open-draft/deferred-promise": {
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/@open-draft/deferred-promise/-/deferred-promise-3.0.0.tgz",
+ "integrity": "sha512-XW375UK8/9SqUVNVa6M0yEy8+iTi4QN5VZ7aZuRFQmy76LRwI9wy5F4YIBU6T+eTe2/DNDo8tqu8RHlwLHM6RA==",
+ "license": "MIT"
},
- "node_modules/@lezer/python": {
- "version": "1.1.19",
- "resolved": "https://registry.npmjs.org/@lezer/python/-/python-1.1.19.tgz",
- "integrity": "sha512-MhQIURHRytsNzP/YXnqpYKW6la6voAH3kyplTOOiCdjyFY6cWWGFVmYVdHIPrElqSDf4iCDktQCockB9FxuhzQ==",
+ "node_modules/@open-draft/logger": {
+ "version": "0.3.0",
+ "resolved": "https://registry.npmjs.org/@open-draft/logger/-/logger-0.3.0.tgz",
+ "integrity": "sha512-X2g45fzhxH238HKO4xbSr7+wBS8Fvw6ixhTDuvLd5mqh6bJJCFAPwU9mPDxbcrRtfxv4u5IHCEH77BmxvXmmxQ==",
"license": "MIT",
"dependencies": {
- "@lezer/common": "^1.2.0",
- "@lezer/highlight": "^1.0.0",
- "@lezer/lr": "^1.0.0"
+ "is-node-process": "^1.2.0",
+ "outvariant": "^1.4.0"
}
},
- "node_modules/@lezer/rust": {
- "version": "1.0.2",
- "resolved": "https://registry.npmjs.org/@lezer/rust/-/rust-1.0.2.tgz",
- "integrity": "sha512-Lz5sIPBdF2FUXcWeCu1//ojFAZqzTQNRga0aYv6dYXqJqPfMdCAI0NzajWUd4Xijj1IKJLtjoXRPMvTKWBcqKg==",
- "license": "MIT",
- "dependencies": {
- "@lezer/common": "^1.2.0",
- "@lezer/highlight": "^1.0.0",
- "@lezer/lr": "^1.0.0"
- }
- },
- "node_modules/@lezer/sass": {
- "version": "1.1.0",
- "resolved": "https://registry.npmjs.org/@lezer/sass/-/sass-1.1.0.tgz",
- "integrity": "sha512-3mMGdCTUZ/84ArHOuXWQr37pnf7f+Nw9ycPUeKX+wu19b7pSMcZGLbaXwvD2APMBDOGxPmpK/O6S1v1EvLoqgQ==",
- "license": "MIT",
- "dependencies": {
- "@lezer/common": "^1.2.0",
- "@lezer/highlight": "^1.0.0",
- "@lezer/lr": "^1.0.0"
- }
- },
- "node_modules/@lezer/xml": {
- "version": "1.0.6",
- "resolved": "https://registry.npmjs.org/@lezer/xml/-/xml-1.0.6.tgz",
- "integrity": "sha512-CdDwirL0OEaStFue/66ZmFSeppuL6Dwjlk8qk153mSQwiSH/Dlri4GNymrNWnUmPl2Um7QfV1FO9KFUyX3Twww==",
- "license": "MIT",
- "dependencies": {
- "@lezer/common": "^1.2.0",
- "@lezer/highlight": "^1.0.0",
- "@lezer/lr": "^1.0.0"
- }
- },
- "node_modules/@lezer/yaml": {
- "version": "1.0.4",
- "resolved": "https://registry.npmjs.org/@lezer/yaml/-/yaml-1.0.4.tgz",
- "integrity": "sha512-2lrrHqxalACEbxIbsjhqGpSW8kWpUKuY6RHgnSAFZa6qK62wvnPxA8hGOwOoDbwHcOFs5M4o27mjGu+P7TvBmw==",
- "license": "MIT",
- "dependencies": {
- "@lezer/common": "^1.2.0",
- "@lezer/highlight": "^1.0.0",
- "@lezer/lr": "^1.4.0"
- }
- },
- "node_modules/@marijn/find-cluster-break": {
- "version": "1.0.4",
- "resolved": "https://registry.npmjs.org/@marijn/find-cluster-break/-/find-cluster-break-1.0.4.tgz",
- "integrity": "sha512-Wy0V7+SGUjnF9/TkiM1hKVDPj7jKXduPNboMVtHTA8dySMURWqfg/JZ9E2Sq8JgSJmkl7k7Qe9FLeMSrSraWmQ==",
+ "node_modules/@open-draft/until": {
+ "version": "2.1.0",
+ "resolved": "https://registry.npmjs.org/@open-draft/until/-/until-2.1.0.tgz",
+ "integrity": "sha512-U69T3ItWHvLwGg5eJ0n3I62nWuE6ilHlmz7zM0npLBRvPRd7e6NYmg54vvRtP5mZG7kZqZCFVdsTWo7BPtBujg==",
"license": "MIT"
},
- "node_modules/@mdx-js/loader": {
- "version": "3.1.1",
- "resolved": "https://registry.npmjs.org/@mdx-js/loader/-/loader-3.1.1.tgz",
- "integrity": "sha512-0TTacJyZ9mDmY+VefuthVshaNIyCGZHJG2fMnGaDttCt8HmjUF7SizlHJpaCDoGnN635nK1wpzfpx/Xx5S4WnQ==",
- "license": "MIT",
- "dependencies": {
- "@mdx-js/mdx": "^3.0.0",
- "source-map": "^0.7.0"
- },
- "funding": {
- "type": "opencollective",
- "url": "https://opencollective.com/unified"
- },
- "peerDependencies": {
- "webpack": ">=5"
- },
- "peerDependenciesMeta": {
- "webpack": {
- "optional": true
- }
- }
- },
- "node_modules/@mdx-js/loader/node_modules/source-map": {
- "version": "0.7.6",
- "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.7.6.tgz",
- "integrity": "sha512-i5uvt8C3ikiWeNZSVZNWcfZPItFQOsYTUAOkcUPGd8DqDy1uOUikjt5dG+uRlwyvR108Fb9DOd4GvXfT0N2/uQ==",
- "license": "BSD-3-Clause",
+ "node_modules/@opentelemetry/api": {
+ "version": "1.9.0",
+ "resolved": "https://registry.npmjs.org/@opentelemetry/api/-/api-1.9.0.tgz",
+ "integrity": "sha512-3giAOQvZiH5F9bMlMiv8+GSPMeqg0dbaeo58/0SlA9sxSqZhnUtxzX9/2FzyhS9sWQf5S0GJE0AKBrFqjpeYcg==",
+ "license": "Apache-2.0",
"engines": {
- "node": ">= 12"
- }
- },
- "node_modules/@mdx-js/mdx": {
- "version": "3.1.1",
- "resolved": "https://registry.npmjs.org/@mdx-js/mdx/-/mdx-3.1.1.tgz",
- "integrity": "sha512-f6ZO2ifpwAQIpzGWaBQT2TXxPv6z3RBzQKpVftEWN78Vl/YweF1uwussDx8ECAXVtr3Rs89fKyG9YlzUs9DyGQ==",
- "license": "MIT",
- "dependencies": {
- "@types/estree": "^1.0.0",
- "@types/estree-jsx": "^1.0.0",
- "@types/hast": "^3.0.0",
- "@types/mdx": "^2.0.0",
- "acorn": "^8.0.0",
- "collapse-white-space": "^2.0.0",
- "devlop": "^1.0.0",
- "estree-util-is-identifier-name": "^3.0.0",
- "estree-util-scope": "^1.0.0",
- "estree-walker": "^3.0.0",
- "hast-util-to-jsx-runtime": "^2.0.0",
- "markdown-extensions": "^2.0.0",
- "recma-build-jsx": "^1.0.0",
- "recma-jsx": "^1.0.0",
- "recma-stringify": "^1.0.0",
- "rehype-recma": "^1.0.0",
- "remark-mdx": "^3.0.0",
- "remark-parse": "^11.0.0",
- "remark-rehype": "^11.0.0",
- "source-map": "^0.7.0",
- "unified": "^11.0.0",
- "unist-util-position-from-estree": "^2.0.0",
- "unist-util-stringify-position": "^4.0.0",
- "unist-util-visit": "^5.0.0",
- "vfile": "^6.0.0"
- },
- "funding": {
- "type": "opencollective",
- "url": "https://opencollective.com/unified"
+ "node": ">=8.0.0"
}
},
- "node_modules/@mdx-js/mdx/node_modules/source-map": {
- "version": "0.7.6",
- "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.7.6.tgz",
- "integrity": "sha512-i5uvt8C3ikiWeNZSVZNWcfZPItFQOsYTUAOkcUPGd8DqDy1uOUikjt5dG+uRlwyvR108Fb9DOd4GvXfT0N2/uQ==",
- "license": "BSD-3-Clause",
+ "node_modules/@opentelemetry/semantic-conventions": {
+ "version": "1.41.1",
+ "resolved": "https://registry.npmjs.org/@opentelemetry/semantic-conventions/-/semantic-conventions-1.41.1.tgz",
+ "integrity": "sha512-/UhIkaZgPutTFmQ7RnIJGgDXZmtEJ7Dvi86xNTFWcnRxVRNk/aotsqDJYeEvDP+FSMB2SdW+pQzNMcWP0rwuNA==",
+ "license": "Apache-2.0",
"engines": {
- "node": ">= 12"
+ "node": ">=14"
}
},
- "node_modules/@mdx-js/react": {
- "version": "3.1.1",
- "resolved": "https://registry.npmjs.org/@mdx-js/react/-/react-3.1.1.tgz",
- "integrity": "sha512-f++rKLQgUVYDAtECQ6fn/is15GkEH9+nZPM3MS0RcxVqoTfawHvDlSCH7JbMhAM6uJ32v3eXLvLmLvjGu7PTQw==",
+ "node_modules/@oven/bun-darwin-aarch64": {
+ "version": "1.3.14",
+ "resolved": "https://registry.npmjs.org/@oven/bun-darwin-aarch64/-/bun-darwin-aarch64-1.3.14.tgz",
+ "integrity": "sha512-Omj20SuiHBOUjUBIyqtkNjSUIjOtEOJwmbix/ZyFH4BaQ6OZTaaRWIR4TjHVz0yadHgli6lLTiAh1uarnvD49A==",
+ "cpu": [
+ "arm64"
+ ],
+ "dev": true,
"license": "MIT",
- "dependencies": {
- "@types/mdx": "^2.0.0"
- },
- "funding": {
- "type": "opencollective",
- "url": "https://opencollective.com/unified"
- },
- "peerDependencies": {
- "@types/react": ">=16",
- "react": ">=16"
- }
- },
- "node_modules/@mdxeditor/editor": {
- "version": "4.2.4",
- "resolved": "https://registry.npmjs.org/@mdxeditor/editor/-/editor-4.2.4.tgz",
- "integrity": "sha512-qKcpICeT4eTsHp1sRU8lU4YL7vXFi2xADhMz3IaMMjThl0lzzFoQhuUSIXWS98jB/XWRj/5+ObVX/PlqxjRX7A==",
- "license": "MIT",
- "dependencies": {
- "@codemirror/commands": "^6.2.4",
- "@codemirror/lang-markdown": "^6.2.3",
- "@codemirror/language-data": "^6.5.1",
- "@codemirror/merge": "^6.4.0",
- "@codemirror/state": "^6.4.0",
- "@codemirror/view": "^6.23.0",
- "@lexical/clipboard": "^0.48.0",
- "@lexical/extension": "^0.48.0",
- "@lexical/history": "^0.48.0",
- "@lexical/link": "^0.48.0",
- "@lexical/list": "^0.48.0",
- "@lexical/markdown": "^0.48.0",
- "@lexical/plain-text": "^0.48.0",
- "@lexical/react": "^0.48.0",
- "@lexical/rich-text": "^0.48.0",
- "@lexical/selection": "^0.48.0",
- "@lexical/utils": "^0.48.0",
- "@mdxeditor/gurx": "^1.2.4",
- "@radix-ui/colors": "^3.0.0",
- "@radix-ui/react-dialog": "^1.1.11",
- "@radix-ui/react-icons": "^1.3.2",
- "@radix-ui/react-popover": "^1.1.11",
- "@radix-ui/react-popper": "^1.2.4",
- "@radix-ui/react-select": "^2.2.2",
- "@radix-ui/react-toggle-group": "^1.1.7",
- "@radix-ui/react-toolbar": "^1.1.7",
- "@radix-ui/react-tooltip": "^1.2.4",
- "classnames": "^2.3.2",
- "cm6-theme-basic-light": "^0.2.0",
- "codemirror": "^6.0.1",
- "downshift": "^7.6.0",
- "js-yaml": "4.3.1",
- "lexical": "^0.48.0",
- "mdast-util-directive": "^3.0.0",
- "mdast-util-from-markdown": "^2.0.0",
- "mdast-util-frontmatter": "^2.0.1",
- "mdast-util-gfm-strikethrough": "^2.0.0",
- "mdast-util-gfm-table": "^2.0.0",
- "mdast-util-gfm-task-list-item": "^2.0.0",
- "mdast-util-highlight-mark": "^1.2.2",
- "mdast-util-mdx": "^3.0.0",
- "mdast-util-mdx-jsx": "^3.0.0",
- "mdast-util-to-markdown": "^2.1.0",
- "micromark-extension-directive": "^3.0.0",
- "micromark-extension-frontmatter": "^2.0.0",
- "micromark-extension-gfm-strikethrough": "^2.0.0",
- "micromark-extension-gfm-table": "^2.0.0",
- "micromark-extension-gfm-task-list-item": "^2.0.1",
- "micromark-extension-highlight-mark": "^1.2.0",
- "micromark-extension-mdx-jsx": "^3.0.0",
- "micromark-extension-mdx-md": "^2.0.0",
- "micromark-extension-mdxjs": "^3.0.0",
- "micromark-factory-space": "^2.0.0",
- "micromark-util-character": "^2.0.1",
- "micromark-util-symbol": "^2.0.0",
- "react-hook-form": "^7.56.1",
- "unidiff": "^1.0.2"
- },
- "engines": {
- "node": ">=16"
- },
- "peerDependencies": {
- "react": ">= 18 || >= 19",
- "react-dom": ">= 18 || >= 19"
- }
+ "optional": true,
+ "os": [
+ "darwin"
+ ]
},
- "node_modules/@mdxeditor/gurx": {
- "version": "1.2.4",
- "resolved": "https://registry.npmjs.org/@mdxeditor/gurx/-/gurx-1.2.4.tgz",
- "integrity": "sha512-9ZykIFYhKaXaaSPCs1cuI+FvYDegJjbKwmA4ASE/zY+hJY6EYqvoye4esiO85CjhOw9aoD/izD/CU78/egVqmg==",
+ "node_modules/@oven/bun-darwin-x64": {
+ "version": "1.3.14",
+ "resolved": "https://registry.npmjs.org/@oven/bun-darwin-x64/-/bun-darwin-x64-1.3.14.tgz",
+ "integrity": "sha512-FFj3QdU/OhlDyZOJ8CWfN5eWLpRlT4qjZg7lMQi7jA6GuoY5ajlO1zWLP/MuHYRSbXQUvV52RejNi8DVnAp13w==",
+ "cpu": [
+ "x64"
+ ],
+ "dev": true,
"license": "MIT",
- "engines": {
- "node": ">=16"
- },
- "peerDependencies": {
- "react": ">= 18 || >= 19",
- "react-dom": ">= 18 || >= 19"
- }
- },
- "node_modules/@mediabunny/prores": {
- "version": "1.55.1",
- "resolved": "https://registry.npmjs.org/@mediabunny/prores/-/prores-1.55.1.tgz",
- "integrity": "sha512-0/nmBgGHLr8uDvWvhcVGygQEN75MM18BpdJCZv9jDmw0xE+dWxDcgth8Gw/xxEsMs0xrtKrQhQU4U6ZV5rxx+w==",
- "license": "MPL-2.0",
- "dependencies": {
- "turbores": "^1.2.2"
- },
- "funding": {
- "type": "individual",
- "url": "https://github.com/sponsors/Vanilagy"
- },
- "peerDependencies": {
- "mediabunny": "^1.49.0"
- }
- },
- "node_modules/@mediabunny/server": {
- "version": "1.55.1",
- "resolved": "https://registry.npmjs.org/@mediabunny/server/-/server-1.55.1.tgz",
- "integrity": "sha512-S296TDzp2RaMu8o9I1v5TSbLCkbXj76RhTsNRWTClVOQkmkzj2QYTpddFbGb61jvB7JwfK1jyZ9DFBK+3cTRAA==",
- "license": "MPL-2.0",
- "dependencies": {
- "@mediabunny/prores": "^1.55.1",
- "node-av": "^6.0.0"
- },
- "funding": {
- "type": "individual",
- "url": "https://github.com/sponsors/Vanilagy"
- },
- "peerDependencies": {
- "mediabunny": "^1.45.0"
- }
- },
- "node_modules/@mediapipe/tasks-vision": {
- "version": "1.0.1",
- "resolved": "https://registry.npmjs.org/@mediapipe/tasks-vision/-/tasks-vision-1.0.1.tgz",
- "integrity": "sha512-rvRE2FmAZ6ZxKSw7wq+e+jQDpN3t1B/tD2mJz9SmAzb1msoDkd4dMoE4wAh8Z30Um0PQwLiHr9QtomhmXk3aUQ==",
- "license": "Apache-2.0"
+ "optional": true,
+ "os": [
+ "darwin"
+ ]
},
- "node_modules/@minhducsun2002/leb128": {
- "version": "1.0.0",
- "resolved": "https://registry.npmjs.org/@minhducsun2002/leb128/-/leb128-1.0.0.tgz",
- "integrity": "sha512-eFrYUPDVHeuwWHluTG1kwNQUEUcFjVKYwPkU8z9DR1JH3AW7JtJsG9cRVGmwz809kKtGfwGJj58juCZxEvnI/g==",
+ "node_modules/@oven/bun-darwin-x64-baseline": {
+ "version": "1.3.14",
+ "resolved": "https://registry.npmjs.org/@oven/bun-darwin-x64-baseline/-/bun-darwin-x64-baseline-1.3.14.tgz",
+ "integrity": "sha512-OSfsTZstc898HHElhU4NccaBGOSSDn5VfahiVTnidZ9B/+wb7WTyfZJaBeJcfjwJ9H2W9uTh2TGtl3UfcXgV9g==",
+ "cpu": [
+ "x64"
+ ],
+ "dev": true,
"license": "MIT",
- "optional": true
- },
- "node_modules/@mistralai/mistralai": {
- "version": "2.2.6",
- "resolved": "https://registry.npmjs.org/@mistralai/mistralai/-/mistralai-2.2.6.tgz",
- "integrity": "sha512-W8pX7zHxjJvMIpw8JMxeJEleapXX0Q9NPszdNzqkM3MIEoIGPObdodujj+WHteXEvGfaP/AMwlNyRfEzSY6dQQ==",
- "license": "Apache-2.0",
- "dependencies": {
- "@opentelemetry/semantic-conventions": "^1.40.0",
- "ws": "^8.18.0",
- "zod": "^3.25.0 || ^4.0.0",
- "zod-to-json-schema": "^3.25.0"
- },
- "peerDependencies": {
- "@opentelemetry/api": "^1.9.0"
- },
- "peerDependenciesMeta": {
- "@opentelemetry/api": {
- "optional": true
- }
- }
- },
- "node_modules/@mixmark-io/domino": {
- "version": "2.2.0",
- "resolved": "https://registry.npmjs.org/@mixmark-io/domino/-/domino-2.2.0.tgz",
- "integrity": "sha512-Y28PR25bHXUg88kCV7nivXrP2Nj2RueZ3/l/jdx6J9f8J4nsEGcgX0Qe6lt7Pa+J79+kPiJU3LguR6O/6zrLOw==",
- "license": "BSD-2-Clause",
- "optional": true
+ "optional": true,
+ "os": [
+ "darwin"
+ ]
},
- "node_modules/@modelcontextprotocol/client": {
- "version": "2.0.0",
- "resolved": "https://registry.npmjs.org/@modelcontextprotocol/client/-/client-2.0.0.tgz",
- "integrity": "sha512-8f1OghQ2rjzIOfqgUCP+8GiUWqRs89njoWLNqAe8kWmDePv3s1fZXseej+QXemssEuuOvLLmLO/kqM3IQHtISw==",
- "license": "MIT",
- "dependencies": {
- "@modelcontextprotocol/core": "2.0.0",
- "cross-spawn": "^7.0.5",
- "eventsource": "^3.0.2",
- "eventsource-parser": "^3.0.0",
- "jose": "^6.1.3",
- "pkce-challenge": "^5.0.0",
- "zod": "^4.2.0"
- },
- "engines": {
- "node": ">=20"
- }
- },
- "node_modules/@modelcontextprotocol/core": {
- "version": "2.0.0",
- "resolved": "https://registry.npmjs.org/@modelcontextprotocol/core/-/core-2.0.0.tgz",
- "integrity": "sha512-pJCEwGG7Lfr/+PQp9ZTwKXNeO5wzbfKL7H3MYpCorM4oFBoQrdjnBgEoqG+RjhsvS1FKrDbKux+M1HhlnGWqcA==",
- "license": "MIT",
- "dependencies": {
- "zod": "^4.2.0"
- },
- "engines": {
- "node": ">=20"
- }
- },
- "node_modules/@modelcontextprotocol/ext-apps": {
- "version": "2.0.0",
- "resolved": "https://registry.npmjs.org/@modelcontextprotocol/ext-apps/-/ext-apps-2.0.0.tgz",
- "integrity": "sha512-a6tXzFcIbIIdnqumQ7W8Oxd8W/KAPkAKYpoxpD9nDgxZ24ywgxG5pK/8G9W5pOFUygS7gWHQhPv8cwRB44/8yg==",
- "license": "MIT",
- "workspaces": [
- "examples/*"
- ],
- "dependencies": {
- "@standard-schema/spec": "^1.1.0"
- },
- "engines": {
- "node": ">=20"
- },
- "peerDependencies": {
- "@modelcontextprotocol/client": "^2.0.0",
- "@modelcontextprotocol/core": "^2.0.0",
- "@modelcontextprotocol/server": "^2.0.0",
- "react": "^17.0.0 || ^18.0.0 || ^19.0.0",
- "react-dom": "^17.0.0 || ^18.0.0 || ^19.0.0",
- "zod": "^4.2.0"
- },
- "peerDependenciesMeta": {
- "@modelcontextprotocol/server": {
- "optional": true
- },
- "react": {
- "optional": true
- },
- "react-dom": {
- "optional": true
- }
- }
- },
- "node_modules/@modelcontextprotocol/sdk": {
- "version": "1.30.0",
- "resolved": "https://registry.npmjs.org/@modelcontextprotocol/sdk/-/sdk-1.30.0.tgz",
- "integrity": "sha512-xKd8OIzlqNzcqcNumGAa6g+PW2kjD5vrpcKOnfldAUPP3j7lnqMPwlTXQm8gF+UwH72z0lqaRbjr9hqGz0eITA==",
- "license": "MIT",
- "dependencies": {
- "@hono/node-server": "^1.19.9 || ^2.0.5",
- "ajv": "^8.17.1",
- "ajv-formats": "^3.0.1",
- "content-type": "^1.0.5",
- "cors": "^2.8.5",
- "cross-spawn": "^7.0.5",
- "eventsource": "^3.0.2",
- "eventsource-parser": "^3.0.0",
- "express": "^5.2.1",
- "express-rate-limit": "^8.2.1",
- "hono": "^4.11.4",
- "jose": "^6.1.3",
- "json-schema-typed": "^8.0.2",
- "pkce-challenge": "^5.0.0",
- "raw-body": "^3.0.0",
- "zod": "^3.25 || ^4.0",
- "zod-to-json-schema": "^3.25.1"
- },
- "engines": {
- "node": ">=18"
- },
- "peerDependencies": {
- "@cfworker/json-schema": "^4.1.1",
- "zod": "^3.25 || ^4.0"
- },
- "peerDependenciesMeta": {
- "@cfworker/json-schema": {
- "optional": true
- },
- "zod": {
- "optional": false
- }
- }
- },
- "node_modules/@modelcontextprotocol/sdk/node_modules/ajv": {
- "version": "8.20.0",
- "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.20.0.tgz",
- "integrity": "sha512-Thbli+OlOj+iMPYFBVBfJ3OmCAnaSyNn4M1vz9T6Gka5Jt9ba/HIR56joy65tY6kx/FCF5VXNB819Y7/GUrBGA==",
- "license": "MIT",
- "dependencies": {
- "fast-deep-equal": "^3.1.3",
- "fast-uri": "^3.0.1",
- "json-schema-traverse": "^1.0.0",
- "require-from-string": "^2.0.2"
- },
- "funding": {
- "type": "github",
- "url": "https://github.com/sponsors/epoberezkin"
- }
- },
- "node_modules/@modelcontextprotocol/sdk/node_modules/json-schema-traverse": {
- "version": "1.0.0",
- "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz",
- "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==",
- "license": "MIT"
- },
- "node_modules/@modelcontextprotocol/server": {
- "version": "2.0.0",
- "resolved": "https://registry.npmjs.org/@modelcontextprotocol/server/-/server-2.0.0.tgz",
- "integrity": "sha512-YhHWdHfpFMQfd0prsEnxKeS3Qz3ytIGmsS0sth4KDjnacIT7hxk6hXHkJ9KysxlkvTM+WZAtQbbcUhdoP4Hvtw==",
- "license": "MIT",
- "dependencies": {
- "@modelcontextprotocol/core": "2.0.0",
- "zod": "^4.2.0"
- },
- "engines": {
- "node": ">=20"
- }
- },
- "node_modules/@mswjs/interceptors": {
- "version": "0.41.9",
- "resolved": "https://registry.npmjs.org/@mswjs/interceptors/-/interceptors-0.41.9.tgz",
- "integrity": "sha512-VVPPgHyQ6ShqnrmDWuxjmUIsO9gWyOZFmuOfLd9LfBGQJwZfy0gvv9pbHSJuoFNIYC7ZDX9aoFwowjcdSC4E8w==",
- "license": "MIT",
- "dependencies": {
- "@open-draft/deferred-promise": "^2.2.0",
- "@open-draft/logger": "^0.3.0",
- "@open-draft/until": "^2.0.0",
- "is-node-process": "^1.2.0",
- "outvariant": "^1.4.3",
- "strict-event-emitter": "^0.5.1"
- },
- "engines": {
- "node": ">=18"
- }
- },
- "node_modules/@mswjs/interceptors/node_modules/@open-draft/deferred-promise": {
- "version": "2.2.0",
- "resolved": "https://registry.npmjs.org/@open-draft/deferred-promise/-/deferred-promise-2.2.0.tgz",
- "integrity": "sha512-CecwLWx3rhxVQF6V4bAgPS5t+So2sTbPgAzafKkVizyi7tlwpcFpdFqq+wqF2OwNBmqFuu6tOyouTuxgpMfzmA==",
- "license": "MIT"
- },
- "node_modules/@napi-rs/wasm-runtime": {
- "version": "0.2.12",
- "resolved": "https://registry.npmjs.org/@napi-rs/wasm-runtime/-/wasm-runtime-0.2.12.tgz",
- "integrity": "sha512-ZVWUcfwY4E/yPitQJl481FjFo3K22D6qF0DuFH6Y/nbnE11GY5uguDxZMGXPQ8WQ0128MXQD7TnfHyK4oWoIJQ==",
- "dev": true,
- "license": "MIT",
- "optional": true,
- "dependencies": {
- "@emnapi/core": "^1.4.3",
- "@emnapi/runtime": "^1.4.3",
- "@tybys/wasm-util": "^0.10.0"
- }
- },
- "node_modules/@next/env": {
- "version": "16.3.4",
- "resolved": "https://registry.npmjs.org/@next/env/-/env-16.3.4.tgz",
- "integrity": "sha512-cjWZnUUa6jZq2kFaNe/ZyJdZonOZ/QoN0Zka2nz/FLOrfx14pQuM9c5RaSVkWMqgdt4ksgPAMWPyHSs/CyV48Q==",
- "license": "MIT"
- },
- "node_modules/@next/eslint-plugin-next": {
- "version": "16.3.4",
- "resolved": "https://registry.npmjs.org/@next/eslint-plugin-next/-/eslint-plugin-next-16.3.4.tgz",
- "integrity": "sha512-szW9y2Aumu4z88YXfTzcFsgUAg2k64uzbtcO5L9f1AKS4w/GUKJcbFllRflROVyNPgJtGOnvNxiyp3v6b+prIA==",
- "dev": true,
- "license": "MIT",
- "dependencies": {
- "@eslint-community/eslint-utils": "4.9.1",
- "fast-glob": "3.3.1"
- }
- },
- "node_modules/@next/mdx": {
- "version": "16.3.4",
- "resolved": "https://registry.npmjs.org/@next/mdx/-/mdx-16.3.4.tgz",
- "integrity": "sha512-XEmW3ccWWNybofVOmgIEVhXtmNXM0u423iqkVXwPf29fht/tdpUiMDuMHQ4hMerE1477nOJrv5kM/F6qMcEMwA==",
- "license": "MIT",
- "dependencies": {
- "source-map": "^0.7.0"
- },
- "peerDependencies": {
- "@mdx-js/loader": ">=0.15.0",
- "@mdx-js/react": ">=0.15.0"
- },
- "peerDependenciesMeta": {
- "@mdx-js/loader": {
- "optional": true
- },
- "@mdx-js/react": {
- "optional": true
- }
- }
- },
- "node_modules/@next/mdx/node_modules/source-map": {
- "version": "0.7.6",
- "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.7.6.tgz",
- "integrity": "sha512-i5uvt8C3ikiWeNZSVZNWcfZPItFQOsYTUAOkcUPGd8DqDy1uOUikjt5dG+uRlwyvR108Fb9DOd4GvXfT0N2/uQ==",
- "license": "BSD-3-Clause",
- "engines": {
- "node": ">= 12"
- }
- },
- "node_modules/@next/swc-darwin-arm64": {
- "version": "16.3.4",
- "resolved": "https://registry.npmjs.org/@next/swc-darwin-arm64/-/swc-darwin-arm64-16.3.4.tgz",
- "integrity": "sha512-iBr3I5LZNk5/bgl5//iTgD2tcym14MX0Xo7fD//u9dYAEgGzza1y9oywluPtf74YnOswVdH1908aK9xVz7zQTw==",
+ "node_modules/@oven/bun-freebsd-aarch64": {
+ "version": "1.3.14",
+ "resolved": "https://registry.npmjs.org/@oven/bun-freebsd-aarch64/-/bun-freebsd-aarch64-1.3.14.tgz",
+ "integrity": "sha512-LIKrXaFxAHybVO5Pf+9XP2FHUj/5APvXTUKk9dqHm5iFz4oH+W24cmhjkJirNujh9hKeTyrpWSe3no9JZKowIw==",
"cpu": [
"arm64"
],
- "license": "MIT",
- "optional": true,
- "os": [
- "darwin"
- ],
- "engines": {
- "node": ">= 10"
- }
- },
- "node_modules/@next/swc-darwin-x64": {
- "version": "16.3.4",
- "resolved": "https://registry.npmjs.org/@next/swc-darwin-x64/-/swc-darwin-x64-16.3.4.tgz",
- "integrity": "sha512-2dpiSyl2Jw/NrBPaU2MAKGSa+2MR82pJIn4Sm5Rjr+gxAeuh0z158Su3Z2O8zn7UNNq+ej4bToed6RcRN/Lydg==",
- "cpu": [
- "x64"
- ],
- "license": "MIT",
- "optional": true,
- "os": [
- "darwin"
- ],
- "engines": {
- "node": ">= 10"
- }
- },
- "node_modules/@next/swc-linux-arm64-gnu": {
- "version": "16.3.4",
- "resolved": "https://registry.npmjs.org/@next/swc-linux-arm64-gnu/-/swc-linux-arm64-gnu-16.3.4.tgz",
- "integrity": "sha512-+t+U8HZT+fApePCS5h89CSH3datz29MkzyfCn+6fpsZBG/oiEOhINcb9rtkv6sdpToLGFn2e6146NzaKCXkqrA==",
- "cpu": [
- "arm64"
- ],
- "libc": [
- "glibc"
- ],
- "license": "MIT",
- "optional": true,
- "os": [
- "linux"
- ],
- "engines": {
- "node": ">= 10"
- }
- },
- "node_modules/@next/swc-linux-arm64-musl": {
- "version": "16.3.4",
- "resolved": "https://registry.npmjs.org/@next/swc-linux-arm64-musl/-/swc-linux-arm64-musl-16.3.4.tgz",
- "integrity": "sha512-mx03GNs1ocQA5JQ4FxDMmIsNkdrZh8cuezKCrId28e5/gIPU/l7Kcy2+vmCCzdjnnmXJy+iOAu+7K0QppO6Urg==",
- "cpu": [
- "arm64"
- ],
- "libc": [
- "musl"
- ],
- "license": "MIT",
- "optional": true,
- "os": [
- "linux"
- ],
- "engines": {
- "node": ">= 10"
- }
- },
- "node_modules/@next/swc-linux-x64-gnu": {
- "version": "16.3.4",
- "resolved": "https://registry.npmjs.org/@next/swc-linux-x64-gnu/-/swc-linux-x64-gnu-16.3.4.tgz",
- "integrity": "sha512-YIhGY6fSMfha52bnVxnzc9zaVBzJg+cqQTOD8tXIBSx4fuv0pVMxQTE0PaS59YhnMOiYiG09IMwxJAf/CFm/Dw==",
- "cpu": [
- "x64"
- ],
- "libc": [
- "glibc"
- ],
- "license": "MIT",
- "optional": true,
- "os": [
- "linux"
- ],
- "engines": {
- "node": ">= 10"
- }
- },
- "node_modules/@next/swc-linux-x64-musl": {
- "version": "16.3.4",
- "resolved": "https://registry.npmjs.org/@next/swc-linux-x64-musl/-/swc-linux-x64-musl-16.3.4.tgz",
- "integrity": "sha512-+eaaX6axpDb0yF1GCpiERe6njplvdC+nks/fKfcHu3XPGRrald8P3/X7yv7QLdjA51knnxwl9pxdIJsg+w1L+Q==",
- "cpu": [
- "x64"
- ],
- "libc": [
- "musl"
- ],
- "license": "MIT",
- "optional": true,
- "os": [
- "linux"
- ],
- "engines": {
- "node": ">= 10"
- }
- },
- "node_modules/@next/swc-win32-arm64-msvc": {
- "version": "16.3.4",
- "resolved": "https://registry.npmjs.org/@next/swc-win32-arm64-msvc/-/swc-win32-arm64-msvc-16.3.4.tgz",
- "integrity": "sha512-0jcXW7Xs/uzICrmgV3MhDYDeRy++1CqnpDIerlPIqYO4bhzB4WNbX/aRnQclustsAyTkFKB0z6rbcjmNg5tR8A==",
- "cpu": [
- "arm64"
- ],
- "license": "MIT",
- "optional": true,
- "os": [
- "win32"
- ],
- "engines": {
- "node": ">= 10"
- }
- },
- "node_modules/@next/swc-win32-x64-msvc": {
- "version": "16.3.4",
- "resolved": "https://registry.npmjs.org/@next/swc-win32-x64-msvc/-/swc-win32-x64-msvc-16.3.4.tgz",
- "integrity": "sha512-vvBzwu1pYQCp92maZCFCIw/XgOTMR5tur9GjakwIo2cmwRTMKajRZZDS9+e4KsUZWKu1E007WUeAFXRRjZeuzw==",
- "cpu": [
- "x64"
- ],
- "license": "MIT",
- "optional": true,
- "os": [
- "win32"
- ],
- "engines": {
- "node": ">= 10"
- }
- },
- "node_modules/@noble/ciphers": {
- "version": "1.3.0",
- "resolved": "https://registry.npmjs.org/@noble/ciphers/-/ciphers-1.3.0.tgz",
- "integrity": "sha512-2I0gnIVPtfnMw9ee9h1dJG7tp81+8Ob3OJb3Mv37rx5L40/b0i7djjCVvGOVqc9AEIQyvyu1i6ypKdFw8R8gQw==",
- "license": "MIT",
- "engines": {
- "node": "^14.21.3 || >=16"
- },
- "funding": {
- "url": "https://paulmillr.com/funding/"
- }
- },
- "node_modules/@noble/curves": {
- "version": "1.9.7",
- "resolved": "https://registry.npmjs.org/@noble/curves/-/curves-1.9.7.tgz",
- "integrity": "sha512-gbKGcRUYIjA3/zCCNaWDciTMFI0dCkvou3TL8Zmy5Nc7sJ47a0jtOeZoTaMxkuqRo9cRhjOdZJXegxYE5FN/xw==",
- "license": "MIT",
- "dependencies": {
- "@noble/hashes": "1.8.0"
- },
- "engines": {
- "node": "^14.21.3 || >=16"
- },
- "funding": {
- "url": "https://paulmillr.com/funding/"
- }
- },
- "node_modules/@noble/hashes": {
- "version": "1.8.0",
- "resolved": "https://registry.npmjs.org/@noble/hashes/-/hashes-1.8.0.tgz",
- "integrity": "sha512-jCs9ldd7NwzpgXDIf6P3+NrHh9/sD6CQdxHyjQI+h/6rDNo88ypBxxz45UDuZHz9r3tNz7N/VInSVoVdtXEI4A==",
- "license": "MIT",
- "engines": {
- "node": "^14.21.3 || >=16"
- },
- "funding": {
- "url": "https://paulmillr.com/funding/"
- }
- },
- "node_modules/@nodelib/fs.scandir": {
- "version": "2.1.5",
- "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz",
- "integrity": "sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==",
- "license": "MIT",
- "dependencies": {
- "@nodelib/fs.stat": "2.0.5",
- "run-parallel": "^1.1.9"
- },
- "engines": {
- "node": ">= 8"
- }
- },
- "node_modules/@nodelib/fs.stat": {
- "version": "2.0.5",
- "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz",
- "integrity": "sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==",
- "license": "MIT",
- "engines": {
- "node": ">= 8"
- }
- },
- "node_modules/@nodelib/fs.walk": {
- "version": "1.2.8",
- "resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz",
- "integrity": "sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==",
- "license": "MIT",
- "dependencies": {
- "@nodelib/fs.scandir": "2.1.5",
- "fastq": "^1.6.0"
- },
- "engines": {
- "node": ">= 8"
- }
- },
- "node_modules/@nolyfill/is-core-module": {
- "version": "1.0.39",
- "resolved": "https://registry.npmjs.org/@nolyfill/is-core-module/-/is-core-module-1.0.39.tgz",
- "integrity": "sha512-nn5ozdjYQpUCZlWGuxcJY/KpxkWQs4DcbMCmKojjyrYDEAGy4Ce19NN4v5MduafTwJlbKc99UA8YhSVqq9yPZA==",
- "dev": true,
- "license": "MIT",
- "engines": {
- "node": ">=12.4.0"
- }
- },
- "node_modules/@open-draft/deferred-promise": {
- "version": "3.0.0",
- "resolved": "https://registry.npmjs.org/@open-draft/deferred-promise/-/deferred-promise-3.0.0.tgz",
- "integrity": "sha512-XW375UK8/9SqUVNVa6M0yEy8+iTi4QN5VZ7aZuRFQmy76LRwI9wy5F4YIBU6T+eTe2/DNDo8tqu8RHlwLHM6RA==",
- "license": "MIT"
- },
- "node_modules/@open-draft/logger": {
- "version": "0.3.0",
- "resolved": "https://registry.npmjs.org/@open-draft/logger/-/logger-0.3.0.tgz",
- "integrity": "sha512-X2g45fzhxH238HKO4xbSr7+wBS8Fvw6ixhTDuvLd5mqh6bJJCFAPwU9mPDxbcrRtfxv4u5IHCEH77BmxvXmmxQ==",
- "license": "MIT",
- "dependencies": {
- "is-node-process": "^1.2.0",
- "outvariant": "^1.4.0"
- }
- },
- "node_modules/@open-draft/until": {
- "version": "2.1.0",
- "resolved": "https://registry.npmjs.org/@open-draft/until/-/until-2.1.0.tgz",
- "integrity": "sha512-U69T3ItWHvLwGg5eJ0n3I62nWuE6ilHlmz7zM0npLBRvPRd7e6NYmg54vvRtP5mZG7kZqZCFVdsTWo7BPtBujg==",
- "license": "MIT"
- },
- "node_modules/@opentelemetry/api": {
- "version": "1.9.0",
- "resolved": "https://registry.npmjs.org/@opentelemetry/api/-/api-1.9.0.tgz",
- "integrity": "sha512-3giAOQvZiH5F9bMlMiv8+GSPMeqg0dbaeo58/0SlA9sxSqZhnUtxzX9/2FzyhS9sWQf5S0GJE0AKBrFqjpeYcg==",
- "license": "Apache-2.0",
- "engines": {
- "node": ">=8.0.0"
- }
- },
- "node_modules/@opentelemetry/semantic-conventions": {
- "version": "1.41.1",
- "resolved": "https://registry.npmjs.org/@opentelemetry/semantic-conventions/-/semantic-conventions-1.41.1.tgz",
- "integrity": "sha512-/UhIkaZgPutTFmQ7RnIJGgDXZmtEJ7Dvi86xNTFWcnRxVRNk/aotsqDJYeEvDP+FSMB2SdW+pQzNMcWP0rwuNA==",
- "license": "Apache-2.0",
- "engines": {
- "node": ">=14"
- }
- },
- "node_modules/@oven/bun-darwin-aarch64": {
- "version": "1.3.14",
- "resolved": "https://registry.npmjs.org/@oven/bun-darwin-aarch64/-/bun-darwin-aarch64-1.3.14.tgz",
- "integrity": "sha512-Omj20SuiHBOUjUBIyqtkNjSUIjOtEOJwmbix/ZyFH4BaQ6OZTaaRWIR4TjHVz0yadHgli6lLTiAh1uarnvD49A==",
- "cpu": [
- "arm64"
- ],
- "dev": true,
- "license": "MIT",
- "optional": true,
- "os": [
- "darwin"
- ]
- },
- "node_modules/@oven/bun-darwin-x64": {
- "version": "1.3.14",
- "resolved": "https://registry.npmjs.org/@oven/bun-darwin-x64/-/bun-darwin-x64-1.3.14.tgz",
- "integrity": "sha512-FFj3QdU/OhlDyZOJ8CWfN5eWLpRlT4qjZg7lMQi7jA6GuoY5ajlO1zWLP/MuHYRSbXQUvV52RejNi8DVnAp13w==",
- "cpu": [
- "x64"
- ],
- "dev": true,
- "license": "MIT",
- "optional": true,
- "os": [
- "darwin"
- ]
- },
- "node_modules/@oven/bun-darwin-x64-baseline": {
- "version": "1.3.14",
- "resolved": "https://registry.npmjs.org/@oven/bun-darwin-x64-baseline/-/bun-darwin-x64-baseline-1.3.14.tgz",
- "integrity": "sha512-OSfsTZstc898HHElhU4NccaBGOSSDn5VfahiVTnidZ9B/+wb7WTyfZJaBeJcfjwJ9H2W9uTh2TGtl3UfcXgV9g==",
- "cpu": [
- "x64"
- ],
- "dev": true,
- "license": "MIT",
- "optional": true,
- "os": [
- "darwin"
- ]
- },
- "node_modules/@oven/bun-freebsd-aarch64": {
- "version": "1.3.14",
- "resolved": "https://registry.npmjs.org/@oven/bun-freebsd-aarch64/-/bun-freebsd-aarch64-1.3.14.tgz",
- "integrity": "sha512-LIKrXaFxAHybVO5Pf+9XP2FHUj/5APvXTUKk9dqHm5iFz4oH+W24cmhjkJirNujh9hKeTyrpWSe3no9JZKowIw==",
- "cpu": [
- "arm64"
- ],
- "dev": true,
- "license": "MIT",
- "optional": true,
- "os": [
- "freebsd"
- ]
- },
- "node_modules/@oven/bun-freebsd-x64": {
- "version": "1.3.14",
- "resolved": "https://registry.npmjs.org/@oven/bun-freebsd-x64/-/bun-freebsd-x64-1.3.14.tgz",
- "integrity": "sha512-uwD+fGUH1ADpIF3B1U2jWzzb20QwRLZfj5QZ28GUCGrAJ/nTmWrD6YYGsblCY1wuhldRez3lU40AyuvSCyLYmw==",
- "cpu": [
- "x64"
- ],
- "dev": true,
- "license": "MIT",
- "optional": true,
- "os": [
- "freebsd"
- ]
- },
- "node_modules/@oven/bun-linux-aarch64": {
- "version": "1.3.14",
- "resolved": "https://registry.npmjs.org/@oven/bun-linux-aarch64/-/bun-linux-aarch64-1.3.14.tgz",
- "integrity": "sha512-X5SsPZHs+iYO8R/efIcRtc7gT2Q2DgPfliCxEkx4cXBumwkw0c/EsHMNwH3EgGpCDaZ7IYVPhpCG/xBOQHEwZw==",
- "cpu": [
- "arm64"
- ],
- "dev": true,
- "license": "MIT",
- "optional": true,
- "os": [
- "linux"
- ]
- },
- "node_modules/@oven/bun-linux-aarch64-android": {
- "version": "1.3.14",
- "resolved": "https://registry.npmjs.org/@oven/bun-linux-aarch64-android/-/bun-linux-aarch64-android-1.3.14.tgz",
- "integrity": "sha512-y4kq5b85lsrmFb9Xvi4w9mA5IEFJkLMrSmYn06q24KjL9rUWDWO3VFZEtteZxUN5+ec3Zm5S8OnJw1umaCbVjA==",
- "cpu": [
- "arm64"
- ],
- "dev": true,
- "license": "MIT",
- "optional": true,
- "os": [
- "android"
- ]
- },
- "node_modules/@oven/bun-linux-aarch64-musl": {
- "version": "1.3.14",
- "resolved": "https://registry.npmjs.org/@oven/bun-linux-aarch64-musl/-/bun-linux-aarch64-musl-1.3.14.tgz",
- "integrity": "sha512-jmqOA92Cd1NL/1XBd4bFkJLxQ86K0RW7ohxS2qzzAvuitO4JiIxjjTeCspoU44zCozH72HpfZfUE2On31OjnWA==",
- "cpu": [
- "arm64"
- ],
- "dev": true,
- "license": "MIT",
- "optional": true,
- "os": [
- "linux"
- ]
- },
- "node_modules/@oven/bun-linux-x64": {
- "version": "1.3.14",
- "resolved": "https://registry.npmjs.org/@oven/bun-linux-x64/-/bun-linux-x64-1.3.14.tgz",
- "integrity": "sha512-7OVTAKvwfPmSbIV1HpdOoVVx5VRc427GuPPne93N6vk4eQBPId9nXmZDh9/zGaKPdbVjVtQSZafWQoUjx38Utw==",
- "cpu": [
- "x64"
- ],
- "dev": true,
- "license": "MIT",
- "optional": true,
- "os": [
- "linux"
- ]
- },
- "node_modules/@oven/bun-linux-x64-android": {
- "version": "1.3.14",
- "resolved": "https://registry.npmjs.org/@oven/bun-linux-x64-android/-/bun-linux-x64-android-1.3.14.tgz",
- "integrity": "sha512-qe9e1d+3VAEU7nAA2ol9Jvmy/o99PVMSgZhHn7Q/9O3YcDrfEqyQ8zm4zoe5qTEo8HZH0dN03Le0Ys2eQPs7eg==",
- "cpu": [
- "x64"
- ],
- "dev": true,
- "license": "MIT",
- "optional": true,
- "os": [
- "android"
- ]
- },
- "node_modules/@oven/bun-linux-x64-baseline": {
- "version": "1.3.14",
- "resolved": "https://registry.npmjs.org/@oven/bun-linux-x64-baseline/-/bun-linux-x64-baseline-1.3.14.tgz",
- "integrity": "sha512-q/8EdOC0yUE8FPeoOVq8/Pw5I9/tJaYmUfO/uDUAREx8IUnOJH1RJ5A3BjFqre8pvJoiZA9AovPJq5FnNNjSxA==",
- "cpu": [
- "x64"
- ],
- "dev": true,
- "license": "MIT",
- "optional": true,
- "os": [
- "linux"
- ]
- },
- "node_modules/@oven/bun-linux-x64-musl": {
- "version": "1.3.14",
- "resolved": "https://registry.npmjs.org/@oven/bun-linux-x64-musl/-/bun-linux-x64-musl-1.3.14.tgz",
- "integrity": "sha512-GBCB/k/sIqcr06eTNgg7g46qiUv35Jasx4XiccJ/n7RGqrE4RWUD/XJBbWFprVPjvqd59+QtSnS99XGqvftHfg==",
- "cpu": [
- "x64"
- ],
- "dev": true,
- "license": "MIT",
- "optional": true,
- "os": [
- "linux"
- ]
- },
- "node_modules/@oven/bun-linux-x64-musl-baseline": {
- "version": "1.3.14",
- "resolved": "https://registry.npmjs.org/@oven/bun-linux-x64-musl-baseline/-/bun-linux-x64-musl-baseline-1.3.14.tgz",
- "integrity": "sha512-n6iE71G4lQE4XkrZhQQcL5YUlxDbnq6nqV7zeQi33PMsLT/0kYE+RvHOtBWZ3w0wMdXZfINmp63hIb9ijUBGtw==",
- "cpu": [
- "x64"
- ],
- "dev": true,
- "license": "MIT",
- "optional": true,
- "os": [
- "linux"
- ]
- },
- "node_modules/@oven/bun-windows-aarch64": {
- "version": "1.3.14",
- "resolved": "https://registry.npmjs.org/@oven/bun-windows-aarch64/-/bun-windows-aarch64-1.3.14.tgz",
- "integrity": "sha512-T7s3x/BsVKQObGU6QDkZeI6wKynzqGbBH1yI77jrrj5siElclxr3DQrDIk8CV4G5/SJq2HHq4kpLyYY2DKCSmA==",
- "cpu": [
- "arm64"
- ],
- "dev": true,
- "license": "MIT",
- "optional": true,
- "os": [
- "win32"
- ]
- },
- "node_modules/@oven/bun-windows-x64": {
- "version": "1.3.14",
- "resolved": "https://registry.npmjs.org/@oven/bun-windows-x64/-/bun-windows-x64-1.3.14.tgz",
- "integrity": "sha512-mUFWL3BoYkNpjd8e9PqROiFF/1Xeotq20mABJsiQH62jM1g5zqWh4khw1RZ6bX8Q8fWvlPaxG1PjofkmjUi3vg==",
- "cpu": [
- "x64"
- ],
- "dev": true,
- "license": "MIT",
- "optional": true,
- "os": [
- "win32"
- ]
- },
- "node_modules/@oven/bun-windows-x64-baseline": {
- "version": "1.3.14",
- "resolved": "https://registry.npmjs.org/@oven/bun-windows-x64-baseline/-/bun-windows-x64-baseline-1.3.14.tgz",
- "integrity": "sha512-uIjLUC1S9DWgICzuoMba7vurBJnBruE4S5CxnvmZkdqWVXRzx1Rgu636HoH+k0qeaQCFh3jeG3JQ1y6fRHv0sw==",
- "cpu": [
- "x64"
- ],
- "dev": true,
- "license": "MIT",
- "optional": true,
- "os": [
- "win32"
- ]
- },
- "node_modules/@peculiar/asn1-cms": {
- "version": "2.9.0",
- "resolved": "https://registry.npmjs.org/@peculiar/asn1-cms/-/asn1-cms-2.9.0.tgz",
- "integrity": "sha512-VKQz6sJYgSxtGaK6UdnNBUx7hmSdg0K331qrEWh5qxpQsyZGWBjxbq05AJ2bTWWjd7d+nJIxFzwvsR5T7DWC/A==",
- "license": "MIT",
- "optional": true,
- "dependencies": {
- "@peculiar/asn1-schema": "^2.9.0",
- "@peculiar/asn1-x509": "^2.9.0",
- "@peculiar/asn1-x509-attr": "^2.9.0",
- "asn1js": "^3.0.10",
- "tslib": "^2.8.1"
- }
- },
- "node_modules/@peculiar/asn1-csr": {
- "version": "2.9.0",
- "resolved": "https://registry.npmjs.org/@peculiar/asn1-csr/-/asn1-csr-2.9.0.tgz",
- "integrity": "sha512-SbxRzHiWnRdiDuiiji/RLsJxu2au4hmSZSKK7GQOgNr2BVvheAlFQST9qqzRchUcZ6wvcyRuPXIfYXVzLoZ/5g==",
- "license": "MIT",
- "optional": true,
- "dependencies": {
- "@peculiar/asn1-schema": "^2.9.0",
- "@peculiar/asn1-x509": "^2.9.0",
- "asn1js": "^3.0.10",
- "tslib": "^2.8.1"
- }
- },
- "node_modules/@peculiar/asn1-ecc": {
- "version": "2.9.0",
- "resolved": "https://registry.npmjs.org/@peculiar/asn1-ecc/-/asn1-ecc-2.9.0.tgz",
- "integrity": "sha512-vNspHtTd9h6e8c2lMW+B/VHEUD+HRFV0fj/Gvz7SaJbwiecA8dxd96UTFPYI1PR8k7qwjjW9AFEyI+LuyVi4Kw==",
- "license": "MIT",
- "optional": true,
- "dependencies": {
- "@peculiar/asn1-schema": "^2.9.0",
- "@peculiar/asn1-x509": "^2.9.0",
- "asn1js": "^3.0.10",
- "tslib": "^2.8.1"
- }
- },
- "node_modules/@peculiar/asn1-pfx": {
- "version": "2.9.0",
- "resolved": "https://registry.npmjs.org/@peculiar/asn1-pfx/-/asn1-pfx-2.9.0.tgz",
- "integrity": "sha512-A6bX+gZr69U38Pg1mWvPrM1eRba6L6kLR8iVG+bJtKj3qSv2rSNmlXLtej7ZOkEWt6xL6PiJD73uFEdQI3BXCg==",
- "license": "MIT",
- "optional": true,
- "dependencies": {
- "@peculiar/asn1-cms": "^2.9.0",
- "@peculiar/asn1-pkcs8": "^2.9.0",
- "@peculiar/asn1-rsa": "^2.9.0",
- "@peculiar/asn1-schema": "^2.9.0",
- "asn1js": "^3.0.10",
- "tslib": "^2.8.1"
- }
- },
- "node_modules/@peculiar/asn1-pkcs8": {
- "version": "2.9.0",
- "resolved": "https://registry.npmjs.org/@peculiar/asn1-pkcs8/-/asn1-pkcs8-2.9.0.tgz",
- "integrity": "sha512-1JH4FliKQ3trkMD17X+bKGsph5TsiM+AiiqnVKr1wxA/GoUSDHiWG/zROzLAbDIA7eclBCjQsp8hrBEJk7LRUQ==",
- "license": "MIT",
- "optional": true,
- "dependencies": {
- "@peculiar/asn1-schema": "^2.9.0",
- "@peculiar/asn1-x509": "^2.9.0",
- "asn1js": "^3.0.10",
- "tslib": "^2.8.1"
- }
- },
- "node_modules/@peculiar/asn1-pkcs9": {
- "version": "2.9.0",
- "resolved": "https://registry.npmjs.org/@peculiar/asn1-pkcs9/-/asn1-pkcs9-2.9.0.tgz",
- "integrity": "sha512-igArY6bpCI6tOPm2EU9QPrXuKq2s1iraLCTym4UlooYdzcRDIPCRUN9TAEcqZ5rZhA+HiPdFKTbDP9vneN/tsg==",
- "license": "MIT",
- "optional": true,
- "dependencies": {
- "@peculiar/asn1-cms": "^2.9.0",
- "@peculiar/asn1-pfx": "^2.9.0",
- "@peculiar/asn1-pkcs8": "^2.9.0",
- "@peculiar/asn1-schema": "^2.9.0",
- "@peculiar/asn1-x509": "^2.9.0",
- "@peculiar/asn1-x509-attr": "^2.9.0",
- "asn1js": "^3.0.10",
- "tslib": "^2.8.1"
- }
- },
- "node_modules/@peculiar/asn1-rsa": {
- "version": "2.9.0",
- "resolved": "https://registry.npmjs.org/@peculiar/asn1-rsa/-/asn1-rsa-2.9.0.tgz",
- "integrity": "sha512-vOD7Q4UmQWhlMYuWJawS2sD+/JcPKJNtyQuFZx09r+KFhm5/HxfGak63y/m56cpBjmb5k6PeRlQf1fvLQAieUA==",
- "license": "MIT",
- "optional": true,
- "dependencies": {
- "@peculiar/asn1-schema": "^2.9.0",
- "@peculiar/asn1-x509": "^2.9.0",
- "asn1js": "^3.0.10",
- "tslib": "^2.8.1"
- }
- },
- "node_modules/@peculiar/asn1-schema": {
- "version": "2.9.0",
- "resolved": "https://registry.npmjs.org/@peculiar/asn1-schema/-/asn1-schema-2.9.0.tgz",
- "integrity": "sha512-AKvPMOM7LfK0uFe1m7o7+veOa8xQGPqsqOrKi3QKgCElzwjGp39mbhr2g7mt/v/mXQHiIvJmDj5cJS173x8Q9Q==",
- "license": "MIT",
- "optional": true,
- "dependencies": {
- "@peculiar/utils": "^2.0.2",
- "asn1js": "^3.0.10",
- "tslib": "^2.8.1"
- }
- },
- "node_modules/@peculiar/asn1-x509": {
- "version": "2.9.0",
- "resolved": "https://registry.npmjs.org/@peculiar/asn1-x509/-/asn1-x509-2.9.0.tgz",
- "integrity": "sha512-b9Na83rhRFQBd5CuMmuEqokYhmyWUbG7mNZl/thGhBwLpCdiZ85TZ3WFhF7OVgOekC5uKhLk4C3HKtdiScCMdQ==",
- "license": "MIT",
- "optional": true,
- "dependencies": {
- "@peculiar/asn1-schema": "^2.9.0",
- "@peculiar/utils": "^2.0.2",
- "asn1js": "^3.0.10",
- "tslib": "^2.8.1"
- }
- },
- "node_modules/@peculiar/asn1-x509-attr": {
- "version": "2.9.0",
- "resolved": "https://registry.npmjs.org/@peculiar/asn1-x509-attr/-/asn1-x509-attr-2.9.0.tgz",
- "integrity": "sha512-f+u+EyGjfPvPzvr0+rlh/TFEO7LWt84mEwQynCUYr4F6urf/8s6+ESJ23qfSn1aamkZR6AuBNaC62iEsGvp0+w==",
- "license": "MIT",
- "optional": true,
- "dependencies": {
- "@peculiar/asn1-schema": "^2.9.0",
- "@peculiar/asn1-x509": "^2.9.0",
- "asn1js": "^3.0.10",
- "tslib": "^2.8.1"
- }
- },
- "node_modules/@peculiar/utils": {
- "version": "2.0.3",
- "resolved": "https://registry.npmjs.org/@peculiar/utils/-/utils-2.0.3.tgz",
- "integrity": "sha512-+oL3HPFRIZ1St2K50lWCXiioIgSoxzz7R1J3uF6neO2yl1sgmpgY6XXJH4BdpoDkMWznQTeYF6oWNDZLCdQ4eQ==",
- "license": "MIT",
- "optional": true,
- "dependencies": {
- "tslib": "^2.8.1"
- }
- },
- "node_modules/@peculiar/x509": {
- "version": "1.14.3",
- "resolved": "https://registry.npmjs.org/@peculiar/x509/-/x509-1.14.3.tgz",
- "integrity": "sha512-C2Xj8FZ0uHWeCXXqX5B4/gVFQmtSkiuOolzAgutjTfseNOHT3pUjljDZsTSxXFGgio54bCzVFqmEOUrIVk8RDA==",
- "license": "MIT",
- "optional": true,
- "dependencies": {
- "@peculiar/asn1-cms": "^2.6.0",
- "@peculiar/asn1-csr": "^2.6.0",
- "@peculiar/asn1-ecc": "^2.6.0",
- "@peculiar/asn1-pkcs9": "^2.6.0",
- "@peculiar/asn1-rsa": "^2.6.0",
- "@peculiar/asn1-schema": "^2.6.0",
- "@peculiar/asn1-x509": "^2.6.0",
- "pvtsutils": "^1.3.6",
- "reflect-metadata": "^0.2.2",
- "tslib": "^2.8.1",
- "tsyringe": "^4.10.0"
- },
- "engines": {
- "node": ">=20.0.0"
- }
- },
- "node_modules/@posthog/browser-common": {
- "version": "0.8.2",
- "resolved": "https://registry.npmjs.org/@posthog/browser-common/-/browser-common-0.8.2.tgz",
- "integrity": "sha512-8g7+ijrx8bfWmpDjmP07e0ZmdRnJoFqZ6PCcMQvfBTUrr422GRXvQWpQn7yD028zIJHIIn/rUTipKgUC5UkWpw==",
- "license": "MIT",
- "dependencies": {
- "@posthog/core": "^1.51.0",
- "@posthog/types": "^1.409.1"
- }
- },
- "node_modules/@posthog/core": {
- "version": "1.51.0",
- "resolved": "https://registry.npmjs.org/@posthog/core/-/core-1.51.0.tgz",
- "integrity": "sha512-LilmmtjcrjV1LgaVNQXrAUt4IXcWIYMrwEtx6VJUUFDeBBdmeI99jshKGtAWugYeB3Wkcp9xQIVCrxIYRpNiRA==",
- "license": "MIT",
- "dependencies": {
- "@posthog/types": "^1.409.1"
- }
- },
- "node_modules/@posthog/react": {
- "version": "1.10.3",
- "resolved": "https://registry.npmjs.org/@posthog/react/-/react-1.10.3.tgz",
- "integrity": "sha512-Qu//fGQmVlX0B9kTA3LLg67e7AYLEmeuA0Bf1qSyUM0uUILcRQGjQezhNQPLYSTakOqvXEnl6fM2iQBF6Toxrw==",
- "license": "MIT",
- "peerDependencies": {
- "@types/react": ">=16.8.0",
- "posthog-js": ">=1.257.2",
- "react": ">=16.8.0"
- },
- "peerDependenciesMeta": {
- "@types/react": {
- "optional": true
- }
- }
- },
- "node_modules/@posthog/types": {
- "version": "1.409.1",
- "resolved": "https://registry.npmjs.org/@posthog/types/-/types-1.409.1.tgz",
- "integrity": "sha512-lA2sSGQUdVknSQl93uN9eUXDwkCMjAuthq24GONGHzMWwVygsKNHlWCnlJsVv2giDokj2p1NopO4zsE2S7gYjA==",
- "license": "MIT"
- },
- "node_modules/@preact/signals-core": {
- "version": "1.14.4",
- "resolved": "https://registry.npmjs.org/@preact/signals-core/-/signals-core-1.14.4.tgz",
- "integrity": "sha512-HNB6HYeYKhQbJ1aKl+YRjrS4+QWHLKX6qKoUsfS/m0vqzsVaEBiZiaKbG/e+NKk2ch5ALQr/ihWaMHxiCuuWHA==",
- "license": "MIT",
- "funding": {
- "type": "opencollective",
- "url": "https://opencollective.com/preact"
- }
- },
- "node_modules/@prisma/adapter-pg": {
- "version": "7.8.0",
- "resolved": "https://registry.npmjs.org/@prisma/adapter-pg/-/adapter-pg-7.8.0.tgz",
- "integrity": "sha512-ygb3UkerK3v8MDpXVgCISdRNDozpxh6+JVJgiIGbSr5KBgz10LLf5ejUskPGoXlsIjxsOu6nuy1JVQr2EKGSlg==",
- "license": "Apache-2.0",
- "dependencies": {
- "@prisma/driver-adapter-utils": "7.8.0",
- "@types/pg": "^8.16.0",
- "pg": "^8.16.3",
- "postgres-array": "3.0.4"
- }
- },
- "node_modules/@prisma/adapter-pg/node_modules/postgres-array": {
- "version": "3.0.4",
- "resolved": "https://registry.npmjs.org/postgres-array/-/postgres-array-3.0.4.tgz",
- "integrity": "sha512-nAUSGfSDGOaOAEGwqsRY27GPOea7CNipJPOA7lPbdEpx5Kg3qzdP0AaWC5MlhTWV9s4hFX39nomVZ+C4tnGOJQ==",
- "license": "MIT",
- "engines": {
- "node": ">=12"
- }
- },
- "node_modules/@prisma/client": {
- "version": "7.8.0",
- "resolved": "https://registry.npmjs.org/@prisma/client/-/client-7.8.0.tgz",
- "integrity": "sha512-HFp3Dawv/3sU3JtlPha90IB+48lS7zHiH4LKZPjmcE8YH5P9DOXGPvo8dqOtO7MqLDd1p2hOWMcFlRT1DMblHw==",
- "license": "Apache-2.0",
- "dependencies": {
- "@prisma/client-runtime-utils": "7.8.0"
- },
- "engines": {
- "node": "^20.19 || ^22.12 || >=24.0"
- },
- "peerDependencies": {
- "prisma": "*",
- "typescript": ">=5.4.0"
- },
- "peerDependenciesMeta": {
- "prisma": {
- "optional": true
- },
- "typescript": {
- "optional": true
- }
- }
- },
- "node_modules/@prisma/client-runtime-utils": {
- "version": "7.8.0",
- "resolved": "https://registry.npmjs.org/@prisma/client-runtime-utils/-/client-runtime-utils-7.8.0.tgz",
- "integrity": "sha512-5NQZztQ0oY/ADFkmd9gPuweH5A1/CCY8YQPorLLO0Mu6a87mY5gsnDkzmFmIHs9NFaLnZojzgddFVN4RpKYrdw==",
- "license": "Apache-2.0"
- },
- "node_modules/@prisma/config": {
- "version": "7.8.0",
- "resolved": "https://registry.npmjs.org/@prisma/config/-/config-7.8.0.tgz",
- "integrity": "sha512-HFESzd9rx2ZQxlK+TL7tu1HPvCqrHiL6LCxYykI2c34mvaUuIVVl3lYuicJD/MNnzgPnyeBEMlK4WTomJCV5jw==",
- "devOptional": true,
- "license": "Apache-2.0",
- "dependencies": {
- "c12": "3.3.4",
- "deepmerge-ts": "7.1.5",
- "effect": "3.20.0",
- "empathic": "2.0.0"
- }
- },
- "node_modules/@prisma/debug": {
- "version": "7.8.0",
- "resolved": "https://registry.npmjs.org/@prisma/debug/-/debug-7.8.0.tgz",
- "integrity": "sha512-p+QZReysDUqXC+mk17q9a+Y/qzh4c2KYliDK30buYUyfrGeTGSyfmc0AIrJRhZJrLHhRiJa9Au/J72h3C+szvA==",
- "license": "Apache-2.0"
- },
- "node_modules/@prisma/dev": {
- "version": "0.24.3",
- "resolved": "https://registry.npmjs.org/@prisma/dev/-/dev-0.24.3.tgz",
- "integrity": "sha512-ffHlQuKXZiaDt9Go0OnCTdJZrHxK0k7omJKNV86/VjpsXu5EIHZLK0T7JSWgvNlJwh56kW9JFu9v0qJciFzepg==",
- "devOptional": true,
- "license": "ISC",
- "dependencies": {
- "@electric-sql/pglite": "0.4.1",
- "@electric-sql/pglite-socket": "0.1.1",
- "@electric-sql/pglite-tools": "0.3.1",
- "@hono/node-server": "1.19.11",
- "@prisma/get-platform": "7.2.0",
- "@prisma/query-plan-executor": "7.2.0",
- "@prisma/streams-local": "0.1.2",
- "foreground-child": "3.3.1",
- "get-port-please": "3.2.0",
- "hono": "^4.12.8",
- "http-status-codes": "2.3.0",
- "pathe": "2.0.3",
- "proper-lockfile": "4.1.2",
- "remeda": "2.33.4",
- "std-env": "3.10.0",
- "valibot": "1.2.0",
- "zeptomatch": "2.1.0"
- }
- },
- "node_modules/@prisma/driver-adapter-utils": {
- "version": "7.8.0",
- "resolved": "https://registry.npmjs.org/@prisma/driver-adapter-utils/-/driver-adapter-utils-7.8.0.tgz",
- "integrity": "sha512-/Q13o0ZT0rjc1Xk0Q9KhZYwuq2EW/vSbWUBKfgEKkaCuB/Sg6bqnjmTZqC5cD4d6y1vfFAEwBRzfzoSMIVJ55A==",
- "license": "Apache-2.0",
- "dependencies": {
- "@prisma/debug": "7.8.0"
- }
- },
- "node_modules/@prisma/engines": {
- "version": "7.8.0",
- "resolved": "https://registry.npmjs.org/@prisma/engines/-/engines-7.8.0.tgz",
- "integrity": "sha512-jx3rCnNNrt5uzbkKlegtQ2GZHxSlihMCzutgT/BP6UIDF1r9tDI39hV/0T/cHZgzJ3ELbuQPXlVZy+Y1n0pcgw==",
- "devOptional": true,
- "hasInstallScript": true,
- "license": "Apache-2.0",
- "dependencies": {
- "@prisma/debug": "7.8.0",
- "@prisma/engines-version": "7.8.0-6.3c6e192761c0362d496ed980de936e2f3cebcd3a",
- "@prisma/fetch-engine": "7.8.0",
- "@prisma/get-platform": "7.8.0"
- }
- },
- "node_modules/@prisma/engines-version": {
- "version": "7.8.0-6.3c6e192761c0362d496ed980de936e2f3cebcd3a",
- "resolved": "https://registry.npmjs.org/@prisma/engines-version/-/engines-version-7.8.0-6.3c6e192761c0362d496ed980de936e2f3cebcd3a.tgz",
- "integrity": "sha512-fJPQxCkLgA5EayWaW8eArgCvjJ+N+Kz3VyeNKMEeYiQC4alNkxRKFVAGxv/ZUzuJISKqdw+zGeDbS6mn6RCPOA==",
- "devOptional": true,
- "license": "Apache-2.0"
- },
- "node_modules/@prisma/engines/node_modules/@prisma/get-platform": {
- "version": "7.8.0",
- "resolved": "https://registry.npmjs.org/@prisma/get-platform/-/get-platform-7.8.0.tgz",
- "integrity": "sha512-WlxgRGnolL8VH2EmkH1R/DkKNr/mVdS3G2h42IZFFZ3eUrH9OT6t73kIOSlkkrv50wG123Iq8d96ufv5LlZktw==",
- "devOptional": true,
- "license": "Apache-2.0",
- "dependencies": {
- "@prisma/debug": "7.8.0"
- }
- },
- "node_modules/@prisma/fetch-engine": {
- "version": "7.8.0",
- "resolved": "https://registry.npmjs.org/@prisma/fetch-engine/-/fetch-engine-7.8.0.tgz",
- "integrity": "sha512-gwB0Euiz/DDRyxFRpLXYlK3RfaZUj1c5dAYMuhZYfApg7arknJlcb9bIsOHDppJmbqYaVA+yBIiFMDBfprsNPQ==",
- "devOptional": true,
- "license": "Apache-2.0",
- "dependencies": {
- "@prisma/debug": "7.8.0",
- "@prisma/engines-version": "7.8.0-6.3c6e192761c0362d496ed980de936e2f3cebcd3a",
- "@prisma/get-platform": "7.8.0"
- }
- },
- "node_modules/@prisma/fetch-engine/node_modules/@prisma/get-platform": {
- "version": "7.8.0",
- "resolved": "https://registry.npmjs.org/@prisma/get-platform/-/get-platform-7.8.0.tgz",
- "integrity": "sha512-WlxgRGnolL8VH2EmkH1R/DkKNr/mVdS3G2h42IZFFZ3eUrH9OT6t73kIOSlkkrv50wG123Iq8d96ufv5LlZktw==",
- "devOptional": true,
- "license": "Apache-2.0",
- "dependencies": {
- "@prisma/debug": "7.8.0"
- }
- },
- "node_modules/@prisma/get-platform": {
- "version": "7.2.0",
- "resolved": "https://registry.npmjs.org/@prisma/get-platform/-/get-platform-7.2.0.tgz",
- "integrity": "sha512-k1V0l0Td1732EHpAfi2eySTezyllok9dXb6UQanajkJQzPUGi3vO2z7jdkz67SypFTdmbnyGYxvEvYZdZsMAVA==",
- "devOptional": true,
- "license": "Apache-2.0",
- "dependencies": {
- "@prisma/debug": "7.2.0"
- }
- },
- "node_modules/@prisma/get-platform/node_modules/@prisma/debug": {
- "version": "7.2.0",
- "resolved": "https://registry.npmjs.org/@prisma/debug/-/debug-7.2.0.tgz",
- "integrity": "sha512-YSGTiSlBAVJPzX4ONZmMotL+ozJwQjRmZweQNIq/ER0tQJKJynNkRB3kyvt37eOfsbMCXk3gnLF6J9OJ4QWftw==",
- "devOptional": true,
- "license": "Apache-2.0"
- },
- "node_modules/@prisma/query-plan-executor": {
- "version": "7.2.0",
- "resolved": "https://registry.npmjs.org/@prisma/query-plan-executor/-/query-plan-executor-7.2.0.tgz",
- "integrity": "sha512-EOZmNzcV8uJ0mae3DhTsiHgoNCuu1J9mULQpGCh62zN3PxPTd+qI9tJvk5jOst8WHKQNwJWR3b39t0XvfBB0WQ==",
- "devOptional": true,
- "license": "Apache-2.0"
- },
- "node_modules/@prisma/streams-local": {
- "version": "0.1.2",
- "resolved": "https://registry.npmjs.org/@prisma/streams-local/-/streams-local-0.1.2.tgz",
- "integrity": "sha512-l49yTxKKF2odFxaAXTmwmkBKL3+bVQ1tFOooGifu4xkdb9NMNLxHj27XAhTylWZod8I+ISGM5erU1xcl/oBCtg==",
- "devOptional": true,
- "license": "Apache-2.0",
- "dependencies": {
- "ajv": "^8.12.0",
- "better-result": "^2.7.0",
- "env-paths": "^3.0.0",
- "proper-lockfile": "^4.1.2"
- },
- "engines": {
- "bun": ">=1.3.6",
- "node": ">=22.0.0"
- }
- },
- "node_modules/@prisma/streams-local/node_modules/ajv": {
- "version": "8.20.0",
- "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.20.0.tgz",
- "integrity": "sha512-Thbli+OlOj+iMPYFBVBfJ3OmCAnaSyNn4M1vz9T6Gka5Jt9ba/HIR56joy65tY6kx/FCF5VXNB819Y7/GUrBGA==",
- "devOptional": true,
- "license": "MIT",
- "dependencies": {
- "fast-deep-equal": "^3.1.3",
- "fast-uri": "^3.0.1",
- "json-schema-traverse": "^1.0.0",
- "require-from-string": "^2.0.2"
- },
- "funding": {
- "type": "github",
- "url": "https://github.com/sponsors/epoberezkin"
- }
- },
- "node_modules/@prisma/streams-local/node_modules/json-schema-traverse": {
- "version": "1.0.0",
- "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz",
- "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==",
- "devOptional": true,
- "license": "MIT"
- },
- "node_modules/@prisma/studio-core": {
- "version": "0.27.3",
- "resolved": "https://registry.npmjs.org/@prisma/studio-core/-/studio-core-0.27.3.tgz",
- "integrity": "sha512-AADjNFPdsrglxHQVTmHFqv6DuKQZ5WY4p5/gVFY017twvNrSwpLJ9lqUbYYxEu2W7nbvVxTZA8deJ8LseNALsw==",
- "devOptional": true,
- "license": "Apache-2.0",
- "dependencies": {
- "@radix-ui/react-toggle": "1.1.10",
- "chart.js": "4.5.1"
- },
- "engines": {
- "node": "^20.19 || ^22.12 || >=24.0",
- "pnpm": "8"
- },
- "peerDependencies": {
- "@types/react": "^18.0.0 || ^19.0.0",
- "react": "^18.0.0 || ^19.0.0",
- "react-dom": "^18.0.0 || ^19.0.0"
- }
- },
- "node_modules/@protobufjs/aspromise": {
- "version": "1.1.2",
- "resolved": "https://registry.npmjs.org/@protobufjs/aspromise/-/aspromise-1.1.2.tgz",
- "integrity": "sha512-j+gKExEuLmKwvz3OgROXtrJ2UG2x8Ch2YZUxahh+s1F2HZ+wAceUNLkvy6zKCPVRkU++ZWQrdxsUeQXmcg4uoQ==",
- "license": "BSD-3-Clause"
- },
- "node_modules/@protobufjs/base64": {
- "version": "1.1.2",
- "resolved": "https://registry.npmjs.org/@protobufjs/base64/-/base64-1.1.2.tgz",
- "integrity": "sha512-AZkcAA5vnN/v4PDqKyMR5lx7hZttPDgClv83E//FMNhR2TMcLUhfRUBHCmSl0oi9zMgDDqRUJkSxO3wm85+XLg==",
- "license": "BSD-3-Clause"
- },
- "node_modules/@protobufjs/codegen": {
- "version": "2.0.5",
- "resolved": "https://registry.npmjs.org/@protobufjs/codegen/-/codegen-2.0.5.tgz",
- "integrity": "sha512-zgXFLzW3Ap33e6d0Wlj4MGIm6Ce8O89n/apUaGNB/jx+hw+ruWEp7EwGUshdLKVRCxZW12fp9r40E1mQrf/34g==",
- "license": "BSD-3-Clause"
- },
- "node_modules/@protobufjs/eventemitter": {
- "version": "1.1.1",
- "resolved": "https://registry.npmjs.org/@protobufjs/eventemitter/-/eventemitter-1.1.1.tgz",
- "integrity": "sha512-vW1GmwMZNnL+gMRaovlh9yZX74kc+TTU3FObkkurpMaRtBfLP3ldjS9KQWlwZgraRE0+dheEEoAxdzcJQ8eXZg==",
- "license": "BSD-3-Clause"
- },
- "node_modules/@protobufjs/fetch": {
- "version": "1.1.1",
- "resolved": "https://registry.npmjs.org/@protobufjs/fetch/-/fetch-1.1.1.tgz",
- "integrity": "sha512-GpptLrs57adMSuHi3VNj0mAF8dwh36LMaYF6XyJ6JMWlVsc+t42tm1HSEDmOs3A8fC9yyeisgLhsTVQokOZ0zw==",
- "license": "BSD-3-Clause",
- "dependencies": {
- "@protobufjs/aspromise": "^1.1.1"
- }
- },
- "node_modules/@protobufjs/float": {
- "version": "1.0.2",
- "resolved": "https://registry.npmjs.org/@protobufjs/float/-/float-1.0.2.tgz",
- "integrity": "sha512-Ddb+kVXlXst9d+R9PfTIxh1EdNkgoRe5tOX6t01f1lYWOvJnSPDBlG241QLzcyPdoNTsblLUdujGSE4RzrTZGQ==",
- "license": "BSD-3-Clause"
- },
- "node_modules/@protobufjs/inquire": {
- "version": "1.1.2",
- "resolved": "https://registry.npmjs.org/@protobufjs/inquire/-/inquire-1.1.2.tgz",
- "integrity": "sha512-pa0vFRuws4wkvaXKK1uXZMAwAX4/t8ANaJo45iw/oQHNQ9q5xUzwgFmVJGXiga2BeN+zpX7Vf9vmsiIa2J+MUw==",
- "license": "BSD-3-Clause"
- },
- "node_modules/@protobufjs/path": {
- "version": "1.1.2",
- "resolved": "https://registry.npmjs.org/@protobufjs/path/-/path-1.1.2.tgz",
- "integrity": "sha512-6JOcJ5Tm08dOHAbdR3GrvP+yUUfkjG5ePsHYczMFLq3ZmMkAD98cDgcT2iA1lJ9NVwFd4tH/iSSoe44YWkltEA==",
- "license": "BSD-3-Clause"
- },
- "node_modules/@protobufjs/pool": {
- "version": "1.1.0",
- "resolved": "https://registry.npmjs.org/@protobufjs/pool/-/pool-1.1.0.tgz",
- "integrity": "sha512-0kELaGSIDBKvcgS4zkjz1PeddatrjYcmMWOlAuAPwAeccUrPHdUqo/J6LiymHHEiJT5NrF1UVwxY14f+fy4WQw==",
- "license": "BSD-3-Clause"
- },
- "node_modules/@protobufjs/utf8": {
- "version": "1.1.1",
- "resolved": "https://registry.npmjs.org/@protobufjs/utf8/-/utf8-1.1.1.tgz",
- "integrity": "sha512-oOAWABowe8EAbMyWKM0tYDKi8Yaox52D+HWZhAIJqQXbqe0xI/GV7FhLWqlEKreMkfDjshR5FKgi3mnle0h6Eg==",
- "license": "BSD-3-Clause"
- },
- "node_modules/@radix-ui/colors": {
- "version": "3.0.0",
- "resolved": "https://registry.npmjs.org/@radix-ui/colors/-/colors-3.0.0.tgz",
- "integrity": "sha512-FUOsGBkHrYJwCSEtWRCIfQbZG7q1e6DgxCIOe1SUQzDe/7rXXeA47s8yCn6fuTNQAj1Zq4oTFi9Yjp3wzElcxg==",
- "license": "MIT"
- },
- "node_modules/@radix-ui/number": {
- "version": "1.1.3",
- "resolved": "https://registry.npmjs.org/@radix-ui/number/-/number-1.1.3.tgz",
- "integrity": "sha512-Road2bidD0uu/1BGDOWNdPI06g0lIRy6IF9GZcIrDK2KGItfor8IQwQa+yM2ERgHM1MmHxaxpTzk0/Jp42lNfA==",
- "license": "MIT"
- },
- "node_modules/@radix-ui/primitive": {
- "version": "1.1.3",
- "resolved": "https://registry.npmjs.org/@radix-ui/primitive/-/primitive-1.1.3.tgz",
- "integrity": "sha512-JTF99U/6XIjCBo0wqkU5sK10glYe27MRRsfwoiq5zzOEZLHU3A3KCMa5X/azekYRCJ0HlwI0crAXS/5dEHTzDg==",
- "devOptional": true,
- "license": "MIT"
- },
- "node_modules/@radix-ui/react-arrow": {
- "version": "1.1.15",
- "resolved": "https://registry.npmjs.org/@radix-ui/react-arrow/-/react-arrow-1.1.15.tgz",
- "integrity": "sha512-v4zggRcjadnI+ClKDuijlQEW4tw3NoaeHc/PwpKnLoLLKNUG4InLegkstooLcRIUWCs+8L22dGURCVuFfOKfnA==",
- "license": "MIT",
- "dependencies": {
- "@radix-ui/react-primitive": "2.1.10"
- },
- "peerDependencies": {
- "@types/react": "*",
- "@types/react-dom": "*",
- "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc",
- "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc"
- },
- "peerDependenciesMeta": {
- "@types/react": {
- "optional": true
- },
- "@types/react-dom": {
- "optional": true
- }
- }
- },
- "node_modules/@radix-ui/react-arrow/node_modules/@radix-ui/react-compose-refs": {
- "version": "1.1.5",
- "resolved": "https://registry.npmjs.org/@radix-ui/react-compose-refs/-/react-compose-refs-1.1.5.tgz",
- "integrity": "sha512-+48PbAAbq3didjJxa+OaWY2ZwgAKsNiRGyeHKszblZMQ+kcpd9pAaT11cMkGEie0vsOi3QdeTE6d5Fe3Gn61kA==",
- "license": "MIT",
- "peerDependencies": {
- "@types/react": "*",
- "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc"
- },
- "peerDependenciesMeta": {
- "@types/react": {
- "optional": true
- }
- }
- },
- "node_modules/@radix-ui/react-arrow/node_modules/@radix-ui/react-primitive": {
- "version": "2.1.10",
- "resolved": "https://registry.npmjs.org/@radix-ui/react-primitive/-/react-primitive-2.1.10.tgz",
- "integrity": "sha512-MucOnzh6hR5mid6VpkbglRAMYMjKLqRnGBbjXkzjK52fuQDd1qbkx78a5P40mkcnVXJdEVxm26E9OPAiUq7nBg==",
- "license": "MIT",
- "dependencies": {
- "@radix-ui/react-slot": "1.3.3"
- },
- "peerDependencies": {
- "@types/react": "*",
- "@types/react-dom": "*",
- "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc",
- "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc"
- },
- "peerDependenciesMeta": {
- "@types/react": {
- "optional": true
- },
- "@types/react-dom": {
- "optional": true
- }
- }
- },
- "node_modules/@radix-ui/react-arrow/node_modules/@radix-ui/react-slot": {
- "version": "1.3.3",
- "resolved": "https://registry.npmjs.org/@radix-ui/react-slot/-/react-slot-1.3.3.tgz",
- "integrity": "sha512-qx7oqnYbxnK9kYI9m317qmFmEgo6ywqWvbTogdj7cL9p3/yx4M48p7Rnw5z3H890cL/ow/EeWJsuTykeZVXP5Q==",
- "license": "MIT",
- "dependencies": {
- "@radix-ui/react-compose-refs": "1.1.5"
- },
- "peerDependencies": {
- "@types/react": "*",
- "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc"
- },
- "peerDependenciesMeta": {
- "@types/react": {
- "optional": true
- }
- }
- },
- "node_modules/@radix-ui/react-collection": {
- "version": "1.1.15",
- "resolved": "https://registry.npmjs.org/@radix-ui/react-collection/-/react-collection-1.1.15.tgz",
- "integrity": "sha512-9W+B9NPF0NaaPh/1NJd3+KqsnlLqU9H7T2rvww+fp+T/evVXdNAyYcnfRQZFOjkR1ajQp3yORlqnI8soawLvNA==",
- "license": "MIT",
- "dependencies": {
- "@radix-ui/react-compose-refs": "1.1.5",
- "@radix-ui/react-context": "1.2.2",
- "@radix-ui/react-primitive": "2.1.10",
- "@radix-ui/react-slot": "1.3.3"
- },
- "peerDependencies": {
- "@types/react": "*",
- "@types/react-dom": "*",
- "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc",
- "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc"
- },
- "peerDependenciesMeta": {
- "@types/react": {
- "optional": true
- },
- "@types/react-dom": {
- "optional": true
- }
- }
- },
- "node_modules/@radix-ui/react-collection/node_modules/@radix-ui/react-compose-refs": {
- "version": "1.1.5",
- "resolved": "https://registry.npmjs.org/@radix-ui/react-compose-refs/-/react-compose-refs-1.1.5.tgz",
- "integrity": "sha512-+48PbAAbq3didjJxa+OaWY2ZwgAKsNiRGyeHKszblZMQ+kcpd9pAaT11cMkGEie0vsOi3QdeTE6d5Fe3Gn61kA==",
- "license": "MIT",
- "peerDependencies": {
- "@types/react": "*",
- "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc"
- },
- "peerDependenciesMeta": {
- "@types/react": {
- "optional": true
- }
- }
- },
- "node_modules/@radix-ui/react-collection/node_modules/@radix-ui/react-primitive": {
- "version": "2.1.10",
- "resolved": "https://registry.npmjs.org/@radix-ui/react-primitive/-/react-primitive-2.1.10.tgz",
- "integrity": "sha512-MucOnzh6hR5mid6VpkbglRAMYMjKLqRnGBbjXkzjK52fuQDd1qbkx78a5P40mkcnVXJdEVxm26E9OPAiUq7nBg==",
- "license": "MIT",
- "dependencies": {
- "@radix-ui/react-slot": "1.3.3"
- },
- "peerDependencies": {
- "@types/react": "*",
- "@types/react-dom": "*",
- "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc",
- "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc"
- },
- "peerDependenciesMeta": {
- "@types/react": {
- "optional": true
- },
- "@types/react-dom": {
- "optional": true
- }
- }
- },
- "node_modules/@radix-ui/react-collection/node_modules/@radix-ui/react-slot": {
- "version": "1.3.3",
- "resolved": "https://registry.npmjs.org/@radix-ui/react-slot/-/react-slot-1.3.3.tgz",
- "integrity": "sha512-qx7oqnYbxnK9kYI9m317qmFmEgo6ywqWvbTogdj7cL9p3/yx4M48p7Rnw5z3H890cL/ow/EeWJsuTykeZVXP5Q==",
- "license": "MIT",
- "dependencies": {
- "@radix-ui/react-compose-refs": "1.1.5"
- },
- "peerDependencies": {
- "@types/react": "*",
- "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc"
- },
- "peerDependenciesMeta": {
- "@types/react": {
- "optional": true
- }
- }
- },
- "node_modules/@radix-ui/react-compose-refs": {
- "version": "1.1.2",
- "resolved": "https://registry.npmjs.org/@radix-ui/react-compose-refs/-/react-compose-refs-1.1.2.tgz",
- "integrity": "sha512-z4eqJvfiNnFMHIIvXP3CY57y2WJs5g2v3X0zm9mEJkrkNv4rDxu+sg9Jh8EkXyeqBkB7SOcboo9dMVqhyrACIg==",
- "devOptional": true,
- "license": "MIT",
- "peerDependencies": {
- "@types/react": "*",
- "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc"
- },
- "peerDependenciesMeta": {
- "@types/react": {
- "optional": true
- }
- }
- },
- "node_modules/@radix-ui/react-context": {
- "version": "1.2.2",
- "resolved": "https://registry.npmjs.org/@radix-ui/react-context/-/react-context-1.2.2.tgz",
- "integrity": "sha512-RHCUGwKHDr0hDGg4X7ma4JG4/+12qxw8rkh5QKdDldlCvtja6nUx1Ef/8HVrJze81lEsgLQlqjzjGNHantgnQA==",
- "license": "MIT",
- "peerDependencies": {
- "@types/react": "*",
- "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc"
- },
- "peerDependenciesMeta": {
- "@types/react": {
- "optional": true
- }
- }
- },
- "node_modules/@radix-ui/react-dialog": {
- "version": "1.1.23",
- "resolved": "https://registry.npmjs.org/@radix-ui/react-dialog/-/react-dialog-1.1.23.tgz",
- "integrity": "sha512-Ksw4WeROkO4rC9k/onilX/Ao2Cr1ku1unMNH+XSCcP4jSXYu7HDsg9n4ojMjVb22XpYjAQ9qfrFlVbru1vXDUA==",
- "license": "MIT",
- "dependencies": {
- "@radix-ui/primitive": "1.1.7",
- "@radix-ui/react-compose-refs": "1.1.5",
- "@radix-ui/react-context": "1.2.2",
- "@radix-ui/react-dismissable-layer": "1.1.19",
- "@radix-ui/react-focus-guards": "1.1.6",
- "@radix-ui/react-focus-scope": "1.1.16",
- "@radix-ui/react-id": "1.1.4",
- "@radix-ui/react-portal": "1.1.17",
- "@radix-ui/react-presence": "1.1.10",
- "@radix-ui/react-primitive": "2.1.10",
- "@radix-ui/react-slot": "1.3.3",
- "@radix-ui/react-use-controllable-state": "1.2.6",
- "@radix-ui/react-use-layout-effect": "1.1.4",
- "aria-hidden": "^1.2.4",
- "react-remove-scroll": "^2.7.2"
- },
- "peerDependencies": {
- "@types/react": "*",
- "@types/react-dom": "*",
- "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc",
- "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc"
- },
- "peerDependenciesMeta": {
- "@types/react": {
- "optional": true
- },
- "@types/react-dom": {
- "optional": true
- }
- }
- },
- "node_modules/@radix-ui/react-dialog/node_modules/@radix-ui/primitive": {
- "version": "1.1.7",
- "resolved": "https://registry.npmjs.org/@radix-ui/primitive/-/primitive-1.1.7.tgz",
- "integrity": "sha512-rqWnm76nYT8HoNNqEjpgJ7Pw/DrBj5iBTrmEPo6HTX5+VJyBNOqTdv4g89G63HuR5g0AaENoAcH7Is5fF2kZ8Q==",
- "license": "MIT"
- },
- "node_modules/@radix-ui/react-dialog/node_modules/@radix-ui/react-compose-refs": {
- "version": "1.1.5",
- "resolved": "https://registry.npmjs.org/@radix-ui/react-compose-refs/-/react-compose-refs-1.1.5.tgz",
- "integrity": "sha512-+48PbAAbq3didjJxa+OaWY2ZwgAKsNiRGyeHKszblZMQ+kcpd9pAaT11cMkGEie0vsOi3QdeTE6d5Fe3Gn61kA==",
- "license": "MIT",
- "peerDependencies": {
- "@types/react": "*",
- "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc"
- },
- "peerDependenciesMeta": {
- "@types/react": {
- "optional": true
- }
- }
- },
- "node_modules/@radix-ui/react-dialog/node_modules/@radix-ui/react-primitive": {
- "version": "2.1.10",
- "resolved": "https://registry.npmjs.org/@radix-ui/react-primitive/-/react-primitive-2.1.10.tgz",
- "integrity": "sha512-MucOnzh6hR5mid6VpkbglRAMYMjKLqRnGBbjXkzjK52fuQDd1qbkx78a5P40mkcnVXJdEVxm26E9OPAiUq7nBg==",
- "license": "MIT",
- "dependencies": {
- "@radix-ui/react-slot": "1.3.3"
- },
- "peerDependencies": {
- "@types/react": "*",
- "@types/react-dom": "*",
- "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc",
- "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc"
- },
- "peerDependenciesMeta": {
- "@types/react": {
- "optional": true
- },
- "@types/react-dom": {
- "optional": true
- }
- }
- },
- "node_modules/@radix-ui/react-dialog/node_modules/@radix-ui/react-slot": {
- "version": "1.3.3",
- "resolved": "https://registry.npmjs.org/@radix-ui/react-slot/-/react-slot-1.3.3.tgz",
- "integrity": "sha512-qx7oqnYbxnK9kYI9m317qmFmEgo6ywqWvbTogdj7cL9p3/yx4M48p7Rnw5z3H890cL/ow/EeWJsuTykeZVXP5Q==",
- "license": "MIT",
- "dependencies": {
- "@radix-ui/react-compose-refs": "1.1.5"
- },
- "peerDependencies": {
- "@types/react": "*",
- "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc"
- },
- "peerDependenciesMeta": {
- "@types/react": {
- "optional": true
- }
- }
- },
- "node_modules/@radix-ui/react-dialog/node_modules/@radix-ui/react-use-controllable-state": {
- "version": "1.2.6",
- "resolved": "https://registry.npmjs.org/@radix-ui/react-use-controllable-state/-/react-use-controllable-state-1.2.6.tgz",
- "integrity": "sha512-uEQJGT97ZA/TgP/Hydw47lHu+/vQj6z/0jA+WeTbK1o9Rx45GImjpD0tc3W5ad3D6XTSR6e1yEO0FvGq6WQfVQ==",
- "license": "MIT",
- "dependencies": {
- "@radix-ui/primitive": "1.1.7",
- "@radix-ui/react-use-effect-event": "0.0.5",
- "@radix-ui/react-use-layout-effect": "1.1.4"
- },
- "peerDependencies": {
- "@types/react": "*",
- "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc"
- },
- "peerDependenciesMeta": {
- "@types/react": {
- "optional": true
- }
- }
- },
- "node_modules/@radix-ui/react-dialog/node_modules/@radix-ui/react-use-effect-event": {
- "version": "0.0.5",
- "resolved": "https://registry.npmjs.org/@radix-ui/react-use-effect-event/-/react-use-effect-event-0.0.5.tgz",
- "integrity": "sha512-7cshFL8HGS/7HEiHH+9kL9HBwp2sa9yX18Knwek6KYWmXwM7pegMgta2AXMQKI+rq3JnfSj9x8wYqFMTdG1Jgg==",
- "license": "MIT",
- "dependencies": {
- "@radix-ui/react-use-layout-effect": "1.1.4"
- },
- "peerDependencies": {
- "@types/react": "*",
- "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc"
- },
- "peerDependenciesMeta": {
- "@types/react": {
- "optional": true
- }
- }
- },
- "node_modules/@radix-ui/react-dialog/node_modules/@radix-ui/react-use-layout-effect": {
- "version": "1.1.4",
- "resolved": "https://registry.npmjs.org/@radix-ui/react-use-layout-effect/-/react-use-layout-effect-1.1.4.tgz",
- "integrity": "sha512-K20DkRkUwDnxEYMBPcg3Y6voLkEy5p5QQmszZgLngKKiC7dzBR/aEuK3w1qlx2JWDUNH6FluahYdgR3BP+QbYw==",
- "license": "MIT",
- "peerDependencies": {
- "@types/react": "*",
- "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc"
- },
- "peerDependenciesMeta": {
- "@types/react": {
- "optional": true
- }
- }
- },
- "node_modules/@radix-ui/react-direction": {
- "version": "1.1.4",
- "resolved": "https://registry.npmjs.org/@radix-ui/react-direction/-/react-direction-1.1.4.tgz",
- "integrity": "sha512-5pzg4FGQNpExhnhT2zlrP1wZFaYCd1K0nYWoFAdcYoYK868IEigqMX3B3f8yIoRlAhAeDWciLI6ZdCKHF9P4Vg==",
- "license": "MIT",
- "peerDependencies": {
- "@types/react": "*",
- "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc"
- },
- "peerDependenciesMeta": {
- "@types/react": {
- "optional": true
- }
- }
- },
- "node_modules/@radix-ui/react-dismissable-layer": {
- "version": "1.1.19",
- "resolved": "https://registry.npmjs.org/@radix-ui/react-dismissable-layer/-/react-dismissable-layer-1.1.19.tgz",
- "integrity": "sha512-8g4pfOL9HoKKLWGiypT+dphVqjFfmcXO5GBnhsG6zI+lxAx/8feQpr+1LSN8Re3hiZ+XkLNS4O9ztK11/LzQ6w==",
- "license": "MIT",
- "dependencies": {
- "@radix-ui/primitive": "1.1.7",
- "@radix-ui/react-compose-refs": "1.1.5",
- "@radix-ui/react-primitive": "2.1.10",
- "@radix-ui/react-use-callback-ref": "1.1.4",
- "@radix-ui/react-use-effect-event": "0.0.5"
- },
- "peerDependencies": {
- "@types/react": "*",
- "@types/react-dom": "*",
- "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc",
- "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc"
- },
- "peerDependenciesMeta": {
- "@types/react": {
- "optional": true
- },
- "@types/react-dom": {
- "optional": true
- }
- }
- },
- "node_modules/@radix-ui/react-dismissable-layer/node_modules/@radix-ui/primitive": {
- "version": "1.1.7",
- "resolved": "https://registry.npmjs.org/@radix-ui/primitive/-/primitive-1.1.7.tgz",
- "integrity": "sha512-rqWnm76nYT8HoNNqEjpgJ7Pw/DrBj5iBTrmEPo6HTX5+VJyBNOqTdv4g89G63HuR5g0AaENoAcH7Is5fF2kZ8Q==",
- "license": "MIT"
- },
- "node_modules/@radix-ui/react-dismissable-layer/node_modules/@radix-ui/react-compose-refs": {
- "version": "1.1.5",
- "resolved": "https://registry.npmjs.org/@radix-ui/react-compose-refs/-/react-compose-refs-1.1.5.tgz",
- "integrity": "sha512-+48PbAAbq3didjJxa+OaWY2ZwgAKsNiRGyeHKszblZMQ+kcpd9pAaT11cMkGEie0vsOi3QdeTE6d5Fe3Gn61kA==",
- "license": "MIT",
- "peerDependencies": {
- "@types/react": "*",
- "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc"
- },
- "peerDependenciesMeta": {
- "@types/react": {
- "optional": true
- }
- }
- },
- "node_modules/@radix-ui/react-dismissable-layer/node_modules/@radix-ui/react-primitive": {
- "version": "2.1.10",
- "resolved": "https://registry.npmjs.org/@radix-ui/react-primitive/-/react-primitive-2.1.10.tgz",
- "integrity": "sha512-MucOnzh6hR5mid6VpkbglRAMYMjKLqRnGBbjXkzjK52fuQDd1qbkx78a5P40mkcnVXJdEVxm26E9OPAiUq7nBg==",
- "license": "MIT",
- "dependencies": {
- "@radix-ui/react-slot": "1.3.3"
- },
- "peerDependencies": {
- "@types/react": "*",
- "@types/react-dom": "*",
- "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc",
- "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc"
- },
- "peerDependenciesMeta": {
- "@types/react": {
- "optional": true
- },
- "@types/react-dom": {
- "optional": true
- }
- }
- },
- "node_modules/@radix-ui/react-dismissable-layer/node_modules/@radix-ui/react-slot": {
- "version": "1.3.3",
- "resolved": "https://registry.npmjs.org/@radix-ui/react-slot/-/react-slot-1.3.3.tgz",
- "integrity": "sha512-qx7oqnYbxnK9kYI9m317qmFmEgo6ywqWvbTogdj7cL9p3/yx4M48p7Rnw5z3H890cL/ow/EeWJsuTykeZVXP5Q==",
- "license": "MIT",
- "dependencies": {
- "@radix-ui/react-compose-refs": "1.1.5"
- },
- "peerDependencies": {
- "@types/react": "*",
- "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc"
- },
- "peerDependenciesMeta": {
- "@types/react": {
- "optional": true
- }
- }
- },
- "node_modules/@radix-ui/react-dismissable-layer/node_modules/@radix-ui/react-use-effect-event": {
- "version": "0.0.5",
- "resolved": "https://registry.npmjs.org/@radix-ui/react-use-effect-event/-/react-use-effect-event-0.0.5.tgz",
- "integrity": "sha512-7cshFL8HGS/7HEiHH+9kL9HBwp2sa9yX18Knwek6KYWmXwM7pegMgta2AXMQKI+rq3JnfSj9x8wYqFMTdG1Jgg==",
- "license": "MIT",
- "dependencies": {
- "@radix-ui/react-use-layout-effect": "1.1.4"
- },
- "peerDependencies": {
- "@types/react": "*",
- "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc"
- },
- "peerDependenciesMeta": {
- "@types/react": {
- "optional": true
- }
- }
- },
- "node_modules/@radix-ui/react-dismissable-layer/node_modules/@radix-ui/react-use-layout-effect": {
- "version": "1.1.4",
- "resolved": "https://registry.npmjs.org/@radix-ui/react-use-layout-effect/-/react-use-layout-effect-1.1.4.tgz",
- "integrity": "sha512-K20DkRkUwDnxEYMBPcg3Y6voLkEy5p5QQmszZgLngKKiC7dzBR/aEuK3w1qlx2JWDUNH6FluahYdgR3BP+QbYw==",
- "license": "MIT",
- "peerDependencies": {
- "@types/react": "*",
- "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc"
- },
- "peerDependenciesMeta": {
- "@types/react": {
- "optional": true
- }
- }
- },
- "node_modules/@radix-ui/react-focus-guards": {
- "version": "1.1.6",
- "resolved": "https://registry.npmjs.org/@radix-ui/react-focus-guards/-/react-focus-guards-1.1.6.tgz",
- "integrity": "sha512-RNOJjfZMTyBM6xYmV3IVGXkPjIhcBAuv48POevAXwrGJhkWZ9p1rFoIS1JFooPuT193AZmRsCPhpoVJxx6OPoQ==",
- "license": "MIT",
- "peerDependencies": {
- "@types/react": "*",
- "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc"
- },
- "peerDependenciesMeta": {
- "@types/react": {
- "optional": true
- }
- }
- },
- "node_modules/@radix-ui/react-focus-scope": {
- "version": "1.1.16",
- "resolved": "https://registry.npmjs.org/@radix-ui/react-focus-scope/-/react-focus-scope-1.1.16.tgz",
- "integrity": "sha512-wmRZ2WWLvmt6KHy2rNPOdPUjwq5xOHY02+m+udwJTn0aNIox/rkskAvJTyTLGhPK6KgrUjlJUJpgmx/+wFiFIQ==",
- "license": "MIT",
- "dependencies": {
- "@radix-ui/react-compose-refs": "1.1.5",
- "@radix-ui/react-primitive": "2.1.10",
- "@radix-ui/react-use-callback-ref": "1.1.4"
- },
- "peerDependencies": {
- "@types/react": "*",
- "@types/react-dom": "*",
- "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc",
- "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc"
- },
- "peerDependenciesMeta": {
- "@types/react": {
- "optional": true
- },
- "@types/react-dom": {
- "optional": true
- }
- }
- },
- "node_modules/@radix-ui/react-focus-scope/node_modules/@radix-ui/react-compose-refs": {
- "version": "1.1.5",
- "resolved": "https://registry.npmjs.org/@radix-ui/react-compose-refs/-/react-compose-refs-1.1.5.tgz",
- "integrity": "sha512-+48PbAAbq3didjJxa+OaWY2ZwgAKsNiRGyeHKszblZMQ+kcpd9pAaT11cMkGEie0vsOi3QdeTE6d5Fe3Gn61kA==",
- "license": "MIT",
- "peerDependencies": {
- "@types/react": "*",
- "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc"
- },
- "peerDependenciesMeta": {
- "@types/react": {
- "optional": true
- }
- }
- },
- "node_modules/@radix-ui/react-focus-scope/node_modules/@radix-ui/react-primitive": {
- "version": "2.1.10",
- "resolved": "https://registry.npmjs.org/@radix-ui/react-primitive/-/react-primitive-2.1.10.tgz",
- "integrity": "sha512-MucOnzh6hR5mid6VpkbglRAMYMjKLqRnGBbjXkzjK52fuQDd1qbkx78a5P40mkcnVXJdEVxm26E9OPAiUq7nBg==",
- "license": "MIT",
- "dependencies": {
- "@radix-ui/react-slot": "1.3.3"
- },
- "peerDependencies": {
- "@types/react": "*",
- "@types/react-dom": "*",
- "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc",
- "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc"
- },
- "peerDependenciesMeta": {
- "@types/react": {
- "optional": true
- },
- "@types/react-dom": {
- "optional": true
- }
- }
- },
- "node_modules/@radix-ui/react-focus-scope/node_modules/@radix-ui/react-slot": {
- "version": "1.3.3",
- "resolved": "https://registry.npmjs.org/@radix-ui/react-slot/-/react-slot-1.3.3.tgz",
- "integrity": "sha512-qx7oqnYbxnK9kYI9m317qmFmEgo6ywqWvbTogdj7cL9p3/yx4M48p7Rnw5z3H890cL/ow/EeWJsuTykeZVXP5Q==",
- "license": "MIT",
- "dependencies": {
- "@radix-ui/react-compose-refs": "1.1.5"
- },
- "peerDependencies": {
- "@types/react": "*",
- "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc"
- },
- "peerDependenciesMeta": {
- "@types/react": {
- "optional": true
- }
- }
- },
- "node_modules/@radix-ui/react-icons": {
- "version": "1.3.2",
- "resolved": "https://registry.npmjs.org/@radix-ui/react-icons/-/react-icons-1.3.2.tgz",
- "integrity": "sha512-fyQIhGDhzfc9pK2kH6Pl9c4BDJGfMkPqkyIgYDthyNYoNg3wVhoJMMh19WS4Up/1KMPFVpNsT2q3WmXn2N1m6g==",
- "license": "MIT",
- "peerDependencies": {
- "react": "^16.x || ^17.x || ^18.x || ^19.0.0 || ^19.0.0-rc"
- }
- },
- "node_modules/@radix-ui/react-id": {
- "version": "1.1.4",
- "resolved": "https://registry.npmjs.org/@radix-ui/react-id/-/react-id-1.1.4.tgz",
- "integrity": "sha512-TMQp2llA+RYn7JcjnrMnz7wN4pcVttPZnRZo52PLQsoLVKzNlVwUeHmfePgTgRluXFvlD3GD5g5MOVVTJCO0qA==",
- "license": "MIT",
- "dependencies": {
- "@radix-ui/react-use-layout-effect": "1.1.4"
- },
- "peerDependencies": {
- "@types/react": "*",
- "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc"
- },
- "peerDependenciesMeta": {
- "@types/react": {
- "optional": true
- }
- }
- },
- "node_modules/@radix-ui/react-id/node_modules/@radix-ui/react-use-layout-effect": {
- "version": "1.1.4",
- "resolved": "https://registry.npmjs.org/@radix-ui/react-use-layout-effect/-/react-use-layout-effect-1.1.4.tgz",
- "integrity": "sha512-K20DkRkUwDnxEYMBPcg3Y6voLkEy5p5QQmszZgLngKKiC7dzBR/aEuK3w1qlx2JWDUNH6FluahYdgR3BP+QbYw==",
- "license": "MIT",
- "peerDependencies": {
- "@types/react": "*",
- "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc"
- },
- "peerDependenciesMeta": {
- "@types/react": {
- "optional": true
- }
- }
- },
- "node_modules/@radix-ui/react-popover": {
- "version": "1.1.23",
- "resolved": "https://registry.npmjs.org/@radix-ui/react-popover/-/react-popover-1.1.23.tgz",
- "integrity": "sha512-mw58MrBlyHWFisTOYignD0vf/3gdcgAR+9of1s9G/38CbFiUwH1nCDkc0AUM9IrXFgN5Ue8n45j9WCgyM1sbiQ==",
- "license": "MIT",
- "dependencies": {
- "@radix-ui/primitive": "1.1.7",
- "@radix-ui/react-compose-refs": "1.1.5",
- "@radix-ui/react-context": "1.2.2",
- "@radix-ui/react-dismissable-layer": "1.1.19",
- "@radix-ui/react-focus-guards": "1.1.6",
- "@radix-ui/react-focus-scope": "1.1.16",
- "@radix-ui/react-id": "1.1.4",
- "@radix-ui/react-popper": "1.3.7",
- "@radix-ui/react-portal": "1.1.17",
- "@radix-ui/react-presence": "1.1.10",
- "@radix-ui/react-primitive": "2.1.10",
- "@radix-ui/react-slot": "1.3.3",
- "@radix-ui/react-use-controllable-state": "1.2.6",
- "aria-hidden": "^1.2.4",
- "react-remove-scroll": "^2.7.2"
- },
- "peerDependencies": {
- "@types/react": "*",
- "@types/react-dom": "*",
- "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc",
- "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc"
- },
- "peerDependenciesMeta": {
- "@types/react": {
- "optional": true
- },
- "@types/react-dom": {
- "optional": true
- }
- }
- },
- "node_modules/@radix-ui/react-popover/node_modules/@radix-ui/primitive": {
- "version": "1.1.7",
- "resolved": "https://registry.npmjs.org/@radix-ui/primitive/-/primitive-1.1.7.tgz",
- "integrity": "sha512-rqWnm76nYT8HoNNqEjpgJ7Pw/DrBj5iBTrmEPo6HTX5+VJyBNOqTdv4g89G63HuR5g0AaENoAcH7Is5fF2kZ8Q==",
- "license": "MIT"
- },
- "node_modules/@radix-ui/react-popover/node_modules/@radix-ui/react-compose-refs": {
- "version": "1.1.5",
- "resolved": "https://registry.npmjs.org/@radix-ui/react-compose-refs/-/react-compose-refs-1.1.5.tgz",
- "integrity": "sha512-+48PbAAbq3didjJxa+OaWY2ZwgAKsNiRGyeHKszblZMQ+kcpd9pAaT11cMkGEie0vsOi3QdeTE6d5Fe3Gn61kA==",
- "license": "MIT",
- "peerDependencies": {
- "@types/react": "*",
- "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc"
- },
- "peerDependenciesMeta": {
- "@types/react": {
- "optional": true
- }
- }
- },
- "node_modules/@radix-ui/react-popover/node_modules/@radix-ui/react-primitive": {
- "version": "2.1.10",
- "resolved": "https://registry.npmjs.org/@radix-ui/react-primitive/-/react-primitive-2.1.10.tgz",
- "integrity": "sha512-MucOnzh6hR5mid6VpkbglRAMYMjKLqRnGBbjXkzjK52fuQDd1qbkx78a5P40mkcnVXJdEVxm26E9OPAiUq7nBg==",
- "license": "MIT",
- "dependencies": {
- "@radix-ui/react-slot": "1.3.3"
- },
- "peerDependencies": {
- "@types/react": "*",
- "@types/react-dom": "*",
- "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc",
- "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc"
- },
- "peerDependenciesMeta": {
- "@types/react": {
- "optional": true
- },
- "@types/react-dom": {
- "optional": true
- }
- }
- },
- "node_modules/@radix-ui/react-popover/node_modules/@radix-ui/react-slot": {
- "version": "1.3.3",
- "resolved": "https://registry.npmjs.org/@radix-ui/react-slot/-/react-slot-1.3.3.tgz",
- "integrity": "sha512-qx7oqnYbxnK9kYI9m317qmFmEgo6ywqWvbTogdj7cL9p3/yx4M48p7Rnw5z3H890cL/ow/EeWJsuTykeZVXP5Q==",
- "license": "MIT",
- "dependencies": {
- "@radix-ui/react-compose-refs": "1.1.5"
- },
- "peerDependencies": {
- "@types/react": "*",
- "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc"
- },
- "peerDependenciesMeta": {
- "@types/react": {
- "optional": true
- }
- }
- },
- "node_modules/@radix-ui/react-popover/node_modules/@radix-ui/react-use-controllable-state": {
- "version": "1.2.6",
- "resolved": "https://registry.npmjs.org/@radix-ui/react-use-controllable-state/-/react-use-controllable-state-1.2.6.tgz",
- "integrity": "sha512-uEQJGT97ZA/TgP/Hydw47lHu+/vQj6z/0jA+WeTbK1o9Rx45GImjpD0tc3W5ad3D6XTSR6e1yEO0FvGq6WQfVQ==",
- "license": "MIT",
- "dependencies": {
- "@radix-ui/primitive": "1.1.7",
- "@radix-ui/react-use-effect-event": "0.0.5",
- "@radix-ui/react-use-layout-effect": "1.1.4"
- },
- "peerDependencies": {
- "@types/react": "*",
- "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc"
- },
- "peerDependenciesMeta": {
- "@types/react": {
- "optional": true
- }
- }
- },
- "node_modules/@radix-ui/react-popover/node_modules/@radix-ui/react-use-effect-event": {
- "version": "0.0.5",
- "resolved": "https://registry.npmjs.org/@radix-ui/react-use-effect-event/-/react-use-effect-event-0.0.5.tgz",
- "integrity": "sha512-7cshFL8HGS/7HEiHH+9kL9HBwp2sa9yX18Knwek6KYWmXwM7pegMgta2AXMQKI+rq3JnfSj9x8wYqFMTdG1Jgg==",
- "license": "MIT",
- "dependencies": {
- "@radix-ui/react-use-layout-effect": "1.1.4"
- },
- "peerDependencies": {
- "@types/react": "*",
- "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc"
- },
- "peerDependenciesMeta": {
- "@types/react": {
- "optional": true
- }
- }
- },
- "node_modules/@radix-ui/react-popover/node_modules/@radix-ui/react-use-layout-effect": {
- "version": "1.1.4",
- "resolved": "https://registry.npmjs.org/@radix-ui/react-use-layout-effect/-/react-use-layout-effect-1.1.4.tgz",
- "integrity": "sha512-K20DkRkUwDnxEYMBPcg3Y6voLkEy5p5QQmszZgLngKKiC7dzBR/aEuK3w1qlx2JWDUNH6FluahYdgR3BP+QbYw==",
- "license": "MIT",
- "peerDependencies": {
- "@types/react": "*",
- "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc"
- },
- "peerDependenciesMeta": {
- "@types/react": {
- "optional": true
- }
- }
- },
- "node_modules/@radix-ui/react-popper": {
- "version": "1.3.7",
- "resolved": "https://registry.npmjs.org/@radix-ui/react-popper/-/react-popper-1.3.7.tgz",
- "integrity": "sha512-UsJrrd7w4wuKKTdvd/DNERVlwSlUcyXzjhyDwBk+3aPOsCjOY6ZSbxuw8E6lZTjjfP8Cpd0J8VVkrYUWyGYXyg==",
- "license": "MIT",
- "dependencies": {
- "@floating-ui/react-dom": "^2.0.0",
- "@radix-ui/react-arrow": "1.1.15",
- "@radix-ui/react-compose-refs": "1.1.5",
- "@radix-ui/react-context": "1.2.2",
- "@radix-ui/react-primitive": "2.1.10",
- "@radix-ui/react-use-callback-ref": "1.1.4",
- "@radix-ui/react-use-layout-effect": "1.1.4",
- "@radix-ui/react-use-rect": "1.1.4",
- "@radix-ui/react-use-size": "1.1.4",
- "@radix-ui/rect": "1.1.3"
- },
- "peerDependencies": {
- "@types/react": "*",
- "@types/react-dom": "*",
- "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc",
- "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc"
- },
- "peerDependenciesMeta": {
- "@types/react": {
- "optional": true
- },
- "@types/react-dom": {
- "optional": true
- }
- }
- },
- "node_modules/@radix-ui/react-popper/node_modules/@radix-ui/react-compose-refs": {
- "version": "1.1.5",
- "resolved": "https://registry.npmjs.org/@radix-ui/react-compose-refs/-/react-compose-refs-1.1.5.tgz",
- "integrity": "sha512-+48PbAAbq3didjJxa+OaWY2ZwgAKsNiRGyeHKszblZMQ+kcpd9pAaT11cMkGEie0vsOi3QdeTE6d5Fe3Gn61kA==",
- "license": "MIT",
- "peerDependencies": {
- "@types/react": "*",
- "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc"
- },
- "peerDependenciesMeta": {
- "@types/react": {
- "optional": true
- }
- }
- },
- "node_modules/@radix-ui/react-popper/node_modules/@radix-ui/react-primitive": {
- "version": "2.1.10",
- "resolved": "https://registry.npmjs.org/@radix-ui/react-primitive/-/react-primitive-2.1.10.tgz",
- "integrity": "sha512-MucOnzh6hR5mid6VpkbglRAMYMjKLqRnGBbjXkzjK52fuQDd1qbkx78a5P40mkcnVXJdEVxm26E9OPAiUq7nBg==",
- "license": "MIT",
- "dependencies": {
- "@radix-ui/react-slot": "1.3.3"
- },
- "peerDependencies": {
- "@types/react": "*",
- "@types/react-dom": "*",
- "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc",
- "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc"
- },
- "peerDependenciesMeta": {
- "@types/react": {
- "optional": true
- },
- "@types/react-dom": {
- "optional": true
- }
- }
- },
- "node_modules/@radix-ui/react-popper/node_modules/@radix-ui/react-slot": {
- "version": "1.3.3",
- "resolved": "https://registry.npmjs.org/@radix-ui/react-slot/-/react-slot-1.3.3.tgz",
- "integrity": "sha512-qx7oqnYbxnK9kYI9m317qmFmEgo6ywqWvbTogdj7cL9p3/yx4M48p7Rnw5z3H890cL/ow/EeWJsuTykeZVXP5Q==",
- "license": "MIT",
- "dependencies": {
- "@radix-ui/react-compose-refs": "1.1.5"
- },
- "peerDependencies": {
- "@types/react": "*",
- "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc"
- },
- "peerDependenciesMeta": {
- "@types/react": {
- "optional": true
- }
- }
- },
- "node_modules/@radix-ui/react-popper/node_modules/@radix-ui/react-use-layout-effect": {
- "version": "1.1.4",
- "resolved": "https://registry.npmjs.org/@radix-ui/react-use-layout-effect/-/react-use-layout-effect-1.1.4.tgz",
- "integrity": "sha512-K20DkRkUwDnxEYMBPcg3Y6voLkEy5p5QQmszZgLngKKiC7dzBR/aEuK3w1qlx2JWDUNH6FluahYdgR3BP+QbYw==",
- "license": "MIT",
- "peerDependencies": {
- "@types/react": "*",
- "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc"
- },
- "peerDependenciesMeta": {
- "@types/react": {
- "optional": true
- }
- }
- },
- "node_modules/@radix-ui/react-portal": {
- "version": "1.1.17",
- "resolved": "https://registry.npmjs.org/@radix-ui/react-portal/-/react-portal-1.1.17.tgz",
- "integrity": "sha512-vKQLcWypUnwZVvfV7UkGahH2g6ySe8M8R+zYBwPrv5byZ9QAW6cQVvNKo7GgmD+p8aYb6D9JBuvy8/WhOno2wQ==",
- "license": "MIT",
- "dependencies": {
- "@radix-ui/react-primitive": "2.1.10",
- "@radix-ui/react-use-layout-effect": "1.1.4"
- },
- "peerDependencies": {
- "@types/react": "*",
- "@types/react-dom": "*",
- "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc",
- "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc"
- },
- "peerDependenciesMeta": {
- "@types/react": {
- "optional": true
- },
- "@types/react-dom": {
- "optional": true
- }
- }
- },
- "node_modules/@radix-ui/react-portal/node_modules/@radix-ui/react-compose-refs": {
- "version": "1.1.5",
- "resolved": "https://registry.npmjs.org/@radix-ui/react-compose-refs/-/react-compose-refs-1.1.5.tgz",
- "integrity": "sha512-+48PbAAbq3didjJxa+OaWY2ZwgAKsNiRGyeHKszblZMQ+kcpd9pAaT11cMkGEie0vsOi3QdeTE6d5Fe3Gn61kA==",
- "license": "MIT",
- "peerDependencies": {
- "@types/react": "*",
- "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc"
- },
- "peerDependenciesMeta": {
- "@types/react": {
- "optional": true
- }
- }
- },
- "node_modules/@radix-ui/react-portal/node_modules/@radix-ui/react-primitive": {
- "version": "2.1.10",
- "resolved": "https://registry.npmjs.org/@radix-ui/react-primitive/-/react-primitive-2.1.10.tgz",
- "integrity": "sha512-MucOnzh6hR5mid6VpkbglRAMYMjKLqRnGBbjXkzjK52fuQDd1qbkx78a5P40mkcnVXJdEVxm26E9OPAiUq7nBg==",
- "license": "MIT",
- "dependencies": {
- "@radix-ui/react-slot": "1.3.3"
- },
- "peerDependencies": {
- "@types/react": "*",
- "@types/react-dom": "*",
- "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc",
- "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc"
- },
- "peerDependenciesMeta": {
- "@types/react": {
- "optional": true
- },
- "@types/react-dom": {
- "optional": true
- }
- }
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "freebsd"
+ ]
},
- "node_modules/@radix-ui/react-portal/node_modules/@radix-ui/react-slot": {
- "version": "1.3.3",
- "resolved": "https://registry.npmjs.org/@radix-ui/react-slot/-/react-slot-1.3.3.tgz",
- "integrity": "sha512-qx7oqnYbxnK9kYI9m317qmFmEgo6ywqWvbTogdj7cL9p3/yx4M48p7Rnw5z3H890cL/ow/EeWJsuTykeZVXP5Q==",
+ "node_modules/@oven/bun-freebsd-x64": {
+ "version": "1.3.14",
+ "resolved": "https://registry.npmjs.org/@oven/bun-freebsd-x64/-/bun-freebsd-x64-1.3.14.tgz",
+ "integrity": "sha512-uwD+fGUH1ADpIF3B1U2jWzzb20QwRLZfj5QZ28GUCGrAJ/nTmWrD6YYGsblCY1wuhldRez3lU40AyuvSCyLYmw==",
+ "cpu": [
+ "x64"
+ ],
+ "dev": true,
"license": "MIT",
- "dependencies": {
- "@radix-ui/react-compose-refs": "1.1.5"
- },
- "peerDependencies": {
- "@types/react": "*",
- "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc"
- },
- "peerDependenciesMeta": {
- "@types/react": {
- "optional": true
- }
- }
+ "optional": true,
+ "os": [
+ "freebsd"
+ ]
},
- "node_modules/@radix-ui/react-portal/node_modules/@radix-ui/react-use-layout-effect": {
- "version": "1.1.4",
- "resolved": "https://registry.npmjs.org/@radix-ui/react-use-layout-effect/-/react-use-layout-effect-1.1.4.tgz",
- "integrity": "sha512-K20DkRkUwDnxEYMBPcg3Y6voLkEy5p5QQmszZgLngKKiC7dzBR/aEuK3w1qlx2JWDUNH6FluahYdgR3BP+QbYw==",
+ "node_modules/@oven/bun-linux-aarch64": {
+ "version": "1.3.14",
+ "resolved": "https://registry.npmjs.org/@oven/bun-linux-aarch64/-/bun-linux-aarch64-1.3.14.tgz",
+ "integrity": "sha512-X5SsPZHs+iYO8R/efIcRtc7gT2Q2DgPfliCxEkx4cXBumwkw0c/EsHMNwH3EgGpCDaZ7IYVPhpCG/xBOQHEwZw==",
+ "cpu": [
+ "arm64"
+ ],
+ "dev": true,
"license": "MIT",
- "peerDependencies": {
- "@types/react": "*",
- "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc"
- },
- "peerDependenciesMeta": {
- "@types/react": {
- "optional": true
- }
- }
+ "optional": true,
+ "os": [
+ "linux"
+ ]
},
- "node_modules/@radix-ui/react-presence": {
- "version": "1.1.10",
- "resolved": "https://registry.npmjs.org/@radix-ui/react-presence/-/react-presence-1.1.10.tgz",
- "integrity": "sha512-3wyzCQ6+ubRA+D4uv9m95JYLXxmOHp05qjrkjeA7uKHHtjpPggQzc6DAb0URl7j67oR0K2foO4ip27TiX037Bw==",
+ "node_modules/@oven/bun-linux-aarch64-android": {
+ "version": "1.3.14",
+ "resolved": "https://registry.npmjs.org/@oven/bun-linux-aarch64-android/-/bun-linux-aarch64-android-1.3.14.tgz",
+ "integrity": "sha512-y4kq5b85lsrmFb9Xvi4w9mA5IEFJkLMrSmYn06q24KjL9rUWDWO3VFZEtteZxUN5+ec3Zm5S8OnJw1umaCbVjA==",
+ "cpu": [
+ "arm64"
+ ],
+ "dev": true,
"license": "MIT",
- "dependencies": {
- "@radix-ui/react-use-layout-effect": "1.1.4"
- },
- "peerDependencies": {
- "@types/react": "*",
- "@types/react-dom": "*",
- "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc",
- "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc"
- },
- "peerDependenciesMeta": {
- "@types/react": {
- "optional": true
- },
- "@types/react-dom": {
- "optional": true
- }
- }
+ "optional": true,
+ "os": [
+ "android"
+ ]
},
- "node_modules/@radix-ui/react-presence/node_modules/@radix-ui/react-use-layout-effect": {
- "version": "1.1.4",
- "resolved": "https://registry.npmjs.org/@radix-ui/react-use-layout-effect/-/react-use-layout-effect-1.1.4.tgz",
- "integrity": "sha512-K20DkRkUwDnxEYMBPcg3Y6voLkEy5p5QQmszZgLngKKiC7dzBR/aEuK3w1qlx2JWDUNH6FluahYdgR3BP+QbYw==",
+ "node_modules/@oven/bun-linux-aarch64-musl": {
+ "version": "1.3.14",
+ "resolved": "https://registry.npmjs.org/@oven/bun-linux-aarch64-musl/-/bun-linux-aarch64-musl-1.3.14.tgz",
+ "integrity": "sha512-jmqOA92Cd1NL/1XBd4bFkJLxQ86K0RW7ohxS2qzzAvuitO4JiIxjjTeCspoU44zCozH72HpfZfUE2On31OjnWA==",
+ "cpu": [
+ "arm64"
+ ],
+ "dev": true,
"license": "MIT",
- "peerDependencies": {
- "@types/react": "*",
- "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc"
- },
- "peerDependenciesMeta": {
- "@types/react": {
- "optional": true
- }
- }
+ "optional": true,
+ "os": [
+ "linux"
+ ]
},
- "node_modules/@radix-ui/react-primitive": {
- "version": "2.1.3",
- "resolved": "https://registry.npmjs.org/@radix-ui/react-primitive/-/react-primitive-2.1.3.tgz",
- "integrity": "sha512-m9gTwRkhy2lvCPe6QJp4d3G1TYEUHn/FzJUtq9MjH46an1wJU+GdoGC5VLof8RX8Ft/DlpshApkhswDLZzHIcQ==",
- "devOptional": true,
+ "node_modules/@oven/bun-linux-x64": {
+ "version": "1.3.14",
+ "resolved": "https://registry.npmjs.org/@oven/bun-linux-x64/-/bun-linux-x64-1.3.14.tgz",
+ "integrity": "sha512-7OVTAKvwfPmSbIV1HpdOoVVx5VRc427GuPPne93N6vk4eQBPId9nXmZDh9/zGaKPdbVjVtQSZafWQoUjx38Utw==",
+ "cpu": [
+ "x64"
+ ],
+ "dev": true,
"license": "MIT",
- "dependencies": {
- "@radix-ui/react-slot": "1.2.3"
- },
- "peerDependencies": {
- "@types/react": "*",
- "@types/react-dom": "*",
- "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc",
- "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc"
- },
- "peerDependenciesMeta": {
- "@types/react": {
- "optional": true
- },
- "@types/react-dom": {
- "optional": true
- }
- }
+ "optional": true,
+ "os": [
+ "linux"
+ ]
},
- "node_modules/@radix-ui/react-roving-focus": {
- "version": "1.1.19",
- "resolved": "https://registry.npmjs.org/@radix-ui/react-roving-focus/-/react-roving-focus-1.1.19.tgz",
- "integrity": "sha512-V9jI6hDjT7l3jsCQD9bLNvDLM3tH/gdbOTp7Tefp3hbbgCGQoK7tUvrWiRlcoBHIZ809ElXwNQwVo0B98LuTXQ==",
+ "node_modules/@oven/bun-linux-x64-android": {
+ "version": "1.3.14",
+ "resolved": "https://registry.npmjs.org/@oven/bun-linux-x64-android/-/bun-linux-x64-android-1.3.14.tgz",
+ "integrity": "sha512-qe9e1d+3VAEU7nAA2ol9Jvmy/o99PVMSgZhHn7Q/9O3YcDrfEqyQ8zm4zoe5qTEo8HZH0dN03Le0Ys2eQPs7eg==",
+ "cpu": [
+ "x64"
+ ],
+ "dev": true,
"license": "MIT",
- "dependencies": {
- "@radix-ui/primitive": "1.1.7",
- "@radix-ui/react-collection": "1.1.15",
- "@radix-ui/react-compose-refs": "1.1.5",
- "@radix-ui/react-context": "1.2.2",
- "@radix-ui/react-direction": "1.1.4",
- "@radix-ui/react-id": "1.1.4",
- "@radix-ui/react-primitive": "2.1.10",
- "@radix-ui/react-use-callback-ref": "1.1.4",
- "@radix-ui/react-use-controllable-state": "1.2.6",
- "@radix-ui/react-use-is-hydrated": "0.1.3",
- "@radix-ui/react-use-layout-effect": "1.1.4"
- },
- "peerDependencies": {
- "@types/react": "*",
- "@types/react-dom": "*",
- "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc",
- "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc"
- },
- "peerDependenciesMeta": {
- "@types/react": {
- "optional": true
- },
- "@types/react-dom": {
- "optional": true
- }
- }
+ "optional": true,
+ "os": [
+ "android"
+ ]
},
- "node_modules/@radix-ui/react-roving-focus/node_modules/@radix-ui/primitive": {
- "version": "1.1.7",
- "resolved": "https://registry.npmjs.org/@radix-ui/primitive/-/primitive-1.1.7.tgz",
- "integrity": "sha512-rqWnm76nYT8HoNNqEjpgJ7Pw/DrBj5iBTrmEPo6HTX5+VJyBNOqTdv4g89G63HuR5g0AaENoAcH7Is5fF2kZ8Q==",
- "license": "MIT"
+ "node_modules/@oven/bun-linux-x64-baseline": {
+ "version": "1.3.14",
+ "resolved": "https://registry.npmjs.org/@oven/bun-linux-x64-baseline/-/bun-linux-x64-baseline-1.3.14.tgz",
+ "integrity": "sha512-q/8EdOC0yUE8FPeoOVq8/Pw5I9/tJaYmUfO/uDUAREx8IUnOJH1RJ5A3BjFqre8pvJoiZA9AovPJq5FnNNjSxA==",
+ "cpu": [
+ "x64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "linux"
+ ]
},
- "node_modules/@radix-ui/react-roving-focus/node_modules/@radix-ui/react-compose-refs": {
- "version": "1.1.5",
- "resolved": "https://registry.npmjs.org/@radix-ui/react-compose-refs/-/react-compose-refs-1.1.5.tgz",
- "integrity": "sha512-+48PbAAbq3didjJxa+OaWY2ZwgAKsNiRGyeHKszblZMQ+kcpd9pAaT11cMkGEie0vsOi3QdeTE6d5Fe3Gn61kA==",
+ "node_modules/@oven/bun-linux-x64-musl": {
+ "version": "1.3.14",
+ "resolved": "https://registry.npmjs.org/@oven/bun-linux-x64-musl/-/bun-linux-x64-musl-1.3.14.tgz",
+ "integrity": "sha512-GBCB/k/sIqcr06eTNgg7g46qiUv35Jasx4XiccJ/n7RGqrE4RWUD/XJBbWFprVPjvqd59+QtSnS99XGqvftHfg==",
+ "cpu": [
+ "x64"
+ ],
+ "dev": true,
"license": "MIT",
- "peerDependencies": {
- "@types/react": "*",
- "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc"
- },
- "peerDependenciesMeta": {
- "@types/react": {
- "optional": true
- }
- }
+ "optional": true,
+ "os": [
+ "linux"
+ ]
},
- "node_modules/@radix-ui/react-roving-focus/node_modules/@radix-ui/react-primitive": {
- "version": "2.1.10",
- "resolved": "https://registry.npmjs.org/@radix-ui/react-primitive/-/react-primitive-2.1.10.tgz",
- "integrity": "sha512-MucOnzh6hR5mid6VpkbglRAMYMjKLqRnGBbjXkzjK52fuQDd1qbkx78a5P40mkcnVXJdEVxm26E9OPAiUq7nBg==",
+ "node_modules/@oven/bun-linux-x64-musl-baseline": {
+ "version": "1.3.14",
+ "resolved": "https://registry.npmjs.org/@oven/bun-linux-x64-musl-baseline/-/bun-linux-x64-musl-baseline-1.3.14.tgz",
+ "integrity": "sha512-n6iE71G4lQE4XkrZhQQcL5YUlxDbnq6nqV7zeQi33PMsLT/0kYE+RvHOtBWZ3w0wMdXZfINmp63hIb9ijUBGtw==",
+ "cpu": [
+ "x64"
+ ],
+ "dev": true,
"license": "MIT",
- "dependencies": {
- "@radix-ui/react-slot": "1.3.3"
- },
- "peerDependencies": {
- "@types/react": "*",
- "@types/react-dom": "*",
- "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc",
- "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc"
- },
- "peerDependenciesMeta": {
- "@types/react": {
- "optional": true
- },
- "@types/react-dom": {
- "optional": true
- }
- }
+ "optional": true,
+ "os": [
+ "linux"
+ ]
},
- "node_modules/@radix-ui/react-roving-focus/node_modules/@radix-ui/react-slot": {
- "version": "1.3.3",
- "resolved": "https://registry.npmjs.org/@radix-ui/react-slot/-/react-slot-1.3.3.tgz",
- "integrity": "sha512-qx7oqnYbxnK9kYI9m317qmFmEgo6ywqWvbTogdj7cL9p3/yx4M48p7Rnw5z3H890cL/ow/EeWJsuTykeZVXP5Q==",
+ "node_modules/@oven/bun-windows-aarch64": {
+ "version": "1.3.14",
+ "resolved": "https://registry.npmjs.org/@oven/bun-windows-aarch64/-/bun-windows-aarch64-1.3.14.tgz",
+ "integrity": "sha512-T7s3x/BsVKQObGU6QDkZeI6wKynzqGbBH1yI77jrrj5siElclxr3DQrDIk8CV4G5/SJq2HHq4kpLyYY2DKCSmA==",
+ "cpu": [
+ "arm64"
+ ],
+ "dev": true,
"license": "MIT",
- "dependencies": {
- "@radix-ui/react-compose-refs": "1.1.5"
- },
- "peerDependencies": {
- "@types/react": "*",
- "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc"
- },
- "peerDependenciesMeta": {
- "@types/react": {
- "optional": true
- }
- }
+ "optional": true,
+ "os": [
+ "win32"
+ ]
+ },
+ "node_modules/@oven/bun-windows-x64": {
+ "version": "1.3.14",
+ "resolved": "https://registry.npmjs.org/@oven/bun-windows-x64/-/bun-windows-x64-1.3.14.tgz",
+ "integrity": "sha512-mUFWL3BoYkNpjd8e9PqROiFF/1Xeotq20mABJsiQH62jM1g5zqWh4khw1RZ6bX8Q8fWvlPaxG1PjofkmjUi3vg==",
+ "cpu": [
+ "x64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "win32"
+ ]
},
- "node_modules/@radix-ui/react-roving-focus/node_modules/@radix-ui/react-use-controllable-state": {
- "version": "1.2.6",
- "resolved": "https://registry.npmjs.org/@radix-ui/react-use-controllable-state/-/react-use-controllable-state-1.2.6.tgz",
- "integrity": "sha512-uEQJGT97ZA/TgP/Hydw47lHu+/vQj6z/0jA+WeTbK1o9Rx45GImjpD0tc3W5ad3D6XTSR6e1yEO0FvGq6WQfVQ==",
+ "node_modules/@oven/bun-windows-x64-baseline": {
+ "version": "1.3.14",
+ "resolved": "https://registry.npmjs.org/@oven/bun-windows-x64-baseline/-/bun-windows-x64-baseline-1.3.14.tgz",
+ "integrity": "sha512-uIjLUC1S9DWgICzuoMba7vurBJnBruE4S5CxnvmZkdqWVXRzx1Rgu636HoH+k0qeaQCFh3jeG3JQ1y6fRHv0sw==",
+ "cpu": [
+ "x64"
+ ],
+ "dev": true,
"license": "MIT",
- "dependencies": {
- "@radix-ui/primitive": "1.1.7",
- "@radix-ui/react-use-effect-event": "0.0.5",
- "@radix-ui/react-use-layout-effect": "1.1.4"
- },
- "peerDependencies": {
- "@types/react": "*",
- "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc"
- },
- "peerDependenciesMeta": {
- "@types/react": {
- "optional": true
- }
- }
+ "optional": true,
+ "os": [
+ "win32"
+ ]
},
- "node_modules/@radix-ui/react-roving-focus/node_modules/@radix-ui/react-use-effect-event": {
- "version": "0.0.5",
- "resolved": "https://registry.npmjs.org/@radix-ui/react-use-effect-event/-/react-use-effect-event-0.0.5.tgz",
- "integrity": "sha512-7cshFL8HGS/7HEiHH+9kL9HBwp2sa9yX18Knwek6KYWmXwM7pegMgta2AXMQKI+rq3JnfSj9x8wYqFMTdG1Jgg==",
+ "node_modules/@peculiar/asn1-cms": {
+ "version": "2.9.0",
+ "resolved": "https://registry.npmjs.org/@peculiar/asn1-cms/-/asn1-cms-2.9.0.tgz",
+ "integrity": "sha512-VKQz6sJYgSxtGaK6UdnNBUx7hmSdg0K331qrEWh5qxpQsyZGWBjxbq05AJ2bTWWjd7d+nJIxFzwvsR5T7DWC/A==",
"license": "MIT",
+ "optional": true,
"dependencies": {
- "@radix-ui/react-use-layout-effect": "1.1.4"
- },
- "peerDependencies": {
- "@types/react": "*",
- "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc"
- },
- "peerDependenciesMeta": {
- "@types/react": {
- "optional": true
- }
+ "@peculiar/asn1-schema": "^2.9.0",
+ "@peculiar/asn1-x509": "^2.9.0",
+ "@peculiar/asn1-x509-attr": "^2.9.0",
+ "asn1js": "^3.0.10",
+ "tslib": "^2.8.1"
}
},
- "node_modules/@radix-ui/react-roving-focus/node_modules/@radix-ui/react-use-layout-effect": {
- "version": "1.1.4",
- "resolved": "https://registry.npmjs.org/@radix-ui/react-use-layout-effect/-/react-use-layout-effect-1.1.4.tgz",
- "integrity": "sha512-K20DkRkUwDnxEYMBPcg3Y6voLkEy5p5QQmszZgLngKKiC7dzBR/aEuK3w1qlx2JWDUNH6FluahYdgR3BP+QbYw==",
+ "node_modules/@peculiar/asn1-csr": {
+ "version": "2.9.0",
+ "resolved": "https://registry.npmjs.org/@peculiar/asn1-csr/-/asn1-csr-2.9.0.tgz",
+ "integrity": "sha512-SbxRzHiWnRdiDuiiji/RLsJxu2au4hmSZSKK7GQOgNr2BVvheAlFQST9qqzRchUcZ6wvcyRuPXIfYXVzLoZ/5g==",
"license": "MIT",
- "peerDependencies": {
- "@types/react": "*",
- "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc"
- },
- "peerDependenciesMeta": {
- "@types/react": {
- "optional": true
- }
- }
- },
- "node_modules/@radix-ui/react-select": {
- "version": "2.3.7",
- "resolved": "https://registry.npmjs.org/@radix-ui/react-select/-/react-select-2.3.7.tgz",
- "integrity": "sha512-WFGImkmbzcfxeIwq/+4HvRN0pizBwbwQUED4I13ezQsDdfl38ZntN6TmR8XaSzPBqoCToe8rF75j6NPNDSzhbg==",
- "license": "MIT",
- "dependencies": {
- "@radix-ui/number": "1.1.3",
- "@radix-ui/primitive": "1.1.7",
- "@radix-ui/react-collection": "1.1.15",
- "@radix-ui/react-compose-refs": "1.1.5",
- "@radix-ui/react-context": "1.2.2",
- "@radix-ui/react-direction": "1.1.4",
- "@radix-ui/react-dismissable-layer": "1.1.19",
- "@radix-ui/react-focus-guards": "1.1.6",
- "@radix-ui/react-focus-scope": "1.1.16",
- "@radix-ui/react-id": "1.1.4",
- "@radix-ui/react-popper": "1.3.7",
- "@radix-ui/react-portal": "1.1.17",
- "@radix-ui/react-presence": "1.1.10",
- "@radix-ui/react-primitive": "2.1.10",
- "@radix-ui/react-slot": "1.3.3",
- "@radix-ui/react-use-callback-ref": "1.1.4",
- "@radix-ui/react-use-controllable-state": "1.2.6",
- "@radix-ui/react-use-layout-effect": "1.1.4",
- "@radix-ui/react-use-previous": "1.1.4",
- "@radix-ui/react-visually-hidden": "1.2.11",
- "aria-hidden": "^1.2.4",
- "react-remove-scroll": "^2.7.2"
- },
- "peerDependencies": {
- "@types/react": "*",
- "@types/react-dom": "*",
- "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc",
- "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc"
- },
- "peerDependenciesMeta": {
- "@types/react": {
- "optional": true
- },
- "@types/react-dom": {
- "optional": true
- }
+ "optional": true,
+ "dependencies": {
+ "@peculiar/asn1-schema": "^2.9.0",
+ "@peculiar/asn1-x509": "^2.9.0",
+ "asn1js": "^3.0.10",
+ "tslib": "^2.8.1"
}
},
- "node_modules/@radix-ui/react-select/node_modules/@radix-ui/primitive": {
- "version": "1.1.7",
- "resolved": "https://registry.npmjs.org/@radix-ui/primitive/-/primitive-1.1.7.tgz",
- "integrity": "sha512-rqWnm76nYT8HoNNqEjpgJ7Pw/DrBj5iBTrmEPo6HTX5+VJyBNOqTdv4g89G63HuR5g0AaENoAcH7Is5fF2kZ8Q==",
- "license": "MIT"
- },
- "node_modules/@radix-ui/react-select/node_modules/@radix-ui/react-compose-refs": {
- "version": "1.1.5",
- "resolved": "https://registry.npmjs.org/@radix-ui/react-compose-refs/-/react-compose-refs-1.1.5.tgz",
- "integrity": "sha512-+48PbAAbq3didjJxa+OaWY2ZwgAKsNiRGyeHKszblZMQ+kcpd9pAaT11cMkGEie0vsOi3QdeTE6d5Fe3Gn61kA==",
+ "node_modules/@peculiar/asn1-ecc": {
+ "version": "2.9.0",
+ "resolved": "https://registry.npmjs.org/@peculiar/asn1-ecc/-/asn1-ecc-2.9.0.tgz",
+ "integrity": "sha512-vNspHtTd9h6e8c2lMW+B/VHEUD+HRFV0fj/Gvz7SaJbwiecA8dxd96UTFPYI1PR8k7qwjjW9AFEyI+LuyVi4Kw==",
"license": "MIT",
- "peerDependencies": {
- "@types/react": "*",
- "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc"
- },
- "peerDependenciesMeta": {
- "@types/react": {
- "optional": true
- }
+ "optional": true,
+ "dependencies": {
+ "@peculiar/asn1-schema": "^2.9.0",
+ "@peculiar/asn1-x509": "^2.9.0",
+ "asn1js": "^3.0.10",
+ "tslib": "^2.8.1"
}
},
- "node_modules/@radix-ui/react-select/node_modules/@radix-ui/react-primitive": {
- "version": "2.1.10",
- "resolved": "https://registry.npmjs.org/@radix-ui/react-primitive/-/react-primitive-2.1.10.tgz",
- "integrity": "sha512-MucOnzh6hR5mid6VpkbglRAMYMjKLqRnGBbjXkzjK52fuQDd1qbkx78a5P40mkcnVXJdEVxm26E9OPAiUq7nBg==",
+ "node_modules/@peculiar/asn1-pfx": {
+ "version": "2.9.0",
+ "resolved": "https://registry.npmjs.org/@peculiar/asn1-pfx/-/asn1-pfx-2.9.0.tgz",
+ "integrity": "sha512-A6bX+gZr69U38Pg1mWvPrM1eRba6L6kLR8iVG+bJtKj3qSv2rSNmlXLtej7ZOkEWt6xL6PiJD73uFEdQI3BXCg==",
"license": "MIT",
+ "optional": true,
"dependencies": {
- "@radix-ui/react-slot": "1.3.3"
- },
- "peerDependencies": {
- "@types/react": "*",
- "@types/react-dom": "*",
- "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc",
- "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc"
- },
- "peerDependenciesMeta": {
- "@types/react": {
- "optional": true
- },
- "@types/react-dom": {
- "optional": true
- }
+ "@peculiar/asn1-cms": "^2.9.0",
+ "@peculiar/asn1-pkcs8": "^2.9.0",
+ "@peculiar/asn1-rsa": "^2.9.0",
+ "@peculiar/asn1-schema": "^2.9.0",
+ "asn1js": "^3.0.10",
+ "tslib": "^2.8.1"
}
},
- "node_modules/@radix-ui/react-select/node_modules/@radix-ui/react-slot": {
- "version": "1.3.3",
- "resolved": "https://registry.npmjs.org/@radix-ui/react-slot/-/react-slot-1.3.3.tgz",
- "integrity": "sha512-qx7oqnYbxnK9kYI9m317qmFmEgo6ywqWvbTogdj7cL9p3/yx4M48p7Rnw5z3H890cL/ow/EeWJsuTykeZVXP5Q==",
+ "node_modules/@peculiar/asn1-pkcs8": {
+ "version": "2.9.0",
+ "resolved": "https://registry.npmjs.org/@peculiar/asn1-pkcs8/-/asn1-pkcs8-2.9.0.tgz",
+ "integrity": "sha512-1JH4FliKQ3trkMD17X+bKGsph5TsiM+AiiqnVKr1wxA/GoUSDHiWG/zROzLAbDIA7eclBCjQsp8hrBEJk7LRUQ==",
"license": "MIT",
+ "optional": true,
"dependencies": {
- "@radix-ui/react-compose-refs": "1.1.5"
- },
- "peerDependencies": {
- "@types/react": "*",
- "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc"
- },
- "peerDependenciesMeta": {
- "@types/react": {
- "optional": true
- }
+ "@peculiar/asn1-schema": "^2.9.0",
+ "@peculiar/asn1-x509": "^2.9.0",
+ "asn1js": "^3.0.10",
+ "tslib": "^2.8.1"
}
},
- "node_modules/@radix-ui/react-select/node_modules/@radix-ui/react-use-controllable-state": {
- "version": "1.2.6",
- "resolved": "https://registry.npmjs.org/@radix-ui/react-use-controllable-state/-/react-use-controllable-state-1.2.6.tgz",
- "integrity": "sha512-uEQJGT97ZA/TgP/Hydw47lHu+/vQj6z/0jA+WeTbK1o9Rx45GImjpD0tc3W5ad3D6XTSR6e1yEO0FvGq6WQfVQ==",
+ "node_modules/@peculiar/asn1-pkcs9": {
+ "version": "2.9.0",
+ "resolved": "https://registry.npmjs.org/@peculiar/asn1-pkcs9/-/asn1-pkcs9-2.9.0.tgz",
+ "integrity": "sha512-igArY6bpCI6tOPm2EU9QPrXuKq2s1iraLCTym4UlooYdzcRDIPCRUN9TAEcqZ5rZhA+HiPdFKTbDP9vneN/tsg==",
"license": "MIT",
+ "optional": true,
"dependencies": {
- "@radix-ui/primitive": "1.1.7",
- "@radix-ui/react-use-effect-event": "0.0.5",
- "@radix-ui/react-use-layout-effect": "1.1.4"
- },
- "peerDependencies": {
- "@types/react": "*",
- "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc"
- },
- "peerDependenciesMeta": {
- "@types/react": {
- "optional": true
- }
+ "@peculiar/asn1-cms": "^2.9.0",
+ "@peculiar/asn1-pfx": "^2.9.0",
+ "@peculiar/asn1-pkcs8": "^2.9.0",
+ "@peculiar/asn1-schema": "^2.9.0",
+ "@peculiar/asn1-x509": "^2.9.0",
+ "@peculiar/asn1-x509-attr": "^2.9.0",
+ "asn1js": "^3.0.10",
+ "tslib": "^2.8.1"
}
},
- "node_modules/@radix-ui/react-select/node_modules/@radix-ui/react-use-effect-event": {
- "version": "0.0.5",
- "resolved": "https://registry.npmjs.org/@radix-ui/react-use-effect-event/-/react-use-effect-event-0.0.5.tgz",
- "integrity": "sha512-7cshFL8HGS/7HEiHH+9kL9HBwp2sa9yX18Knwek6KYWmXwM7pegMgta2AXMQKI+rq3JnfSj9x8wYqFMTdG1Jgg==",
+ "node_modules/@peculiar/asn1-rsa": {
+ "version": "2.9.0",
+ "resolved": "https://registry.npmjs.org/@peculiar/asn1-rsa/-/asn1-rsa-2.9.0.tgz",
+ "integrity": "sha512-vOD7Q4UmQWhlMYuWJawS2sD+/JcPKJNtyQuFZx09r+KFhm5/HxfGak63y/m56cpBjmb5k6PeRlQf1fvLQAieUA==",
"license": "MIT",
+ "optional": true,
"dependencies": {
- "@radix-ui/react-use-layout-effect": "1.1.4"
- },
- "peerDependencies": {
- "@types/react": "*",
- "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc"
- },
- "peerDependenciesMeta": {
- "@types/react": {
- "optional": true
- }
+ "@peculiar/asn1-schema": "^2.9.0",
+ "@peculiar/asn1-x509": "^2.9.0",
+ "asn1js": "^3.0.10",
+ "tslib": "^2.8.1"
}
},
- "node_modules/@radix-ui/react-select/node_modules/@radix-ui/react-use-layout-effect": {
- "version": "1.1.4",
- "resolved": "https://registry.npmjs.org/@radix-ui/react-use-layout-effect/-/react-use-layout-effect-1.1.4.tgz",
- "integrity": "sha512-K20DkRkUwDnxEYMBPcg3Y6voLkEy5p5QQmszZgLngKKiC7dzBR/aEuK3w1qlx2JWDUNH6FluahYdgR3BP+QbYw==",
+ "node_modules/@peculiar/asn1-schema": {
+ "version": "2.9.0",
+ "resolved": "https://registry.npmjs.org/@peculiar/asn1-schema/-/asn1-schema-2.9.0.tgz",
+ "integrity": "sha512-AKvPMOM7LfK0uFe1m7o7+veOa8xQGPqsqOrKi3QKgCElzwjGp39mbhr2g7mt/v/mXQHiIvJmDj5cJS173x8Q9Q==",
"license": "MIT",
- "peerDependencies": {
- "@types/react": "*",
- "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc"
- },
- "peerDependenciesMeta": {
- "@types/react": {
- "optional": true
- }
+ "optional": true,
+ "dependencies": {
+ "@peculiar/utils": "^2.0.2",
+ "asn1js": "^3.0.10",
+ "tslib": "^2.8.1"
}
},
- "node_modules/@radix-ui/react-separator": {
- "version": "1.1.15",
- "resolved": "https://registry.npmjs.org/@radix-ui/react-separator/-/react-separator-1.1.15.tgz",
- "integrity": "sha512-jOLO4lssEzWpoDu7G+Ze4VjwMRUBt291pnZD0gmalREZipnTX3wadQo7Fy48GCTfe14/YRN6rw/rOJqrE85Wxw==",
+ "node_modules/@peculiar/asn1-x509": {
+ "version": "2.9.0",
+ "resolved": "https://registry.npmjs.org/@peculiar/asn1-x509/-/asn1-x509-2.9.0.tgz",
+ "integrity": "sha512-b9Na83rhRFQBd5CuMmuEqokYhmyWUbG7mNZl/thGhBwLpCdiZ85TZ3WFhF7OVgOekC5uKhLk4C3HKtdiScCMdQ==",
"license": "MIT",
+ "optional": true,
"dependencies": {
- "@radix-ui/react-primitive": "2.1.10"
- },
- "peerDependencies": {
- "@types/react": "*",
- "@types/react-dom": "*",
- "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc",
- "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc"
- },
- "peerDependenciesMeta": {
- "@types/react": {
- "optional": true
- },
- "@types/react-dom": {
- "optional": true
- }
+ "@peculiar/asn1-schema": "^2.9.0",
+ "@peculiar/utils": "^2.0.2",
+ "asn1js": "^3.0.10",
+ "tslib": "^2.8.1"
}
},
- "node_modules/@radix-ui/react-separator/node_modules/@radix-ui/react-compose-refs": {
- "version": "1.1.5",
- "resolved": "https://registry.npmjs.org/@radix-ui/react-compose-refs/-/react-compose-refs-1.1.5.tgz",
- "integrity": "sha512-+48PbAAbq3didjJxa+OaWY2ZwgAKsNiRGyeHKszblZMQ+kcpd9pAaT11cMkGEie0vsOi3QdeTE6d5Fe3Gn61kA==",
+ "node_modules/@peculiar/asn1-x509-attr": {
+ "version": "2.9.0",
+ "resolved": "https://registry.npmjs.org/@peculiar/asn1-x509-attr/-/asn1-x509-attr-2.9.0.tgz",
+ "integrity": "sha512-f+u+EyGjfPvPzvr0+rlh/TFEO7LWt84mEwQynCUYr4F6urf/8s6+ESJ23qfSn1aamkZR6AuBNaC62iEsGvp0+w==",
"license": "MIT",
- "peerDependencies": {
- "@types/react": "*",
- "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc"
- },
- "peerDependenciesMeta": {
- "@types/react": {
- "optional": true
- }
+ "optional": true,
+ "dependencies": {
+ "@peculiar/asn1-schema": "^2.9.0",
+ "@peculiar/asn1-x509": "^2.9.0",
+ "asn1js": "^3.0.10",
+ "tslib": "^2.8.1"
}
},
- "node_modules/@radix-ui/react-separator/node_modules/@radix-ui/react-primitive": {
- "version": "2.1.10",
- "resolved": "https://registry.npmjs.org/@radix-ui/react-primitive/-/react-primitive-2.1.10.tgz",
- "integrity": "sha512-MucOnzh6hR5mid6VpkbglRAMYMjKLqRnGBbjXkzjK52fuQDd1qbkx78a5P40mkcnVXJdEVxm26E9OPAiUq7nBg==",
+ "node_modules/@peculiar/utils": {
+ "version": "2.0.3",
+ "resolved": "https://registry.npmjs.org/@peculiar/utils/-/utils-2.0.3.tgz",
+ "integrity": "sha512-+oL3HPFRIZ1St2K50lWCXiioIgSoxzz7R1J3uF6neO2yl1sgmpgY6XXJH4BdpoDkMWznQTeYF6oWNDZLCdQ4eQ==",
"license": "MIT",
+ "optional": true,
"dependencies": {
- "@radix-ui/react-slot": "1.3.3"
- },
- "peerDependencies": {
- "@types/react": "*",
- "@types/react-dom": "*",
- "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc",
- "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc"
- },
- "peerDependenciesMeta": {
- "@types/react": {
- "optional": true
- },
- "@types/react-dom": {
- "optional": true
- }
+ "tslib": "^2.8.1"
}
},
- "node_modules/@radix-ui/react-separator/node_modules/@radix-ui/react-slot": {
- "version": "1.3.3",
- "resolved": "https://registry.npmjs.org/@radix-ui/react-slot/-/react-slot-1.3.3.tgz",
- "integrity": "sha512-qx7oqnYbxnK9kYI9m317qmFmEgo6ywqWvbTogdj7cL9p3/yx4M48p7Rnw5z3H890cL/ow/EeWJsuTykeZVXP5Q==",
+ "node_modules/@peculiar/x509": {
+ "version": "1.14.3",
+ "resolved": "https://registry.npmjs.org/@peculiar/x509/-/x509-1.14.3.tgz",
+ "integrity": "sha512-C2Xj8FZ0uHWeCXXqX5B4/gVFQmtSkiuOolzAgutjTfseNOHT3pUjljDZsTSxXFGgio54bCzVFqmEOUrIVk8RDA==",
"license": "MIT",
+ "optional": true,
"dependencies": {
- "@radix-ui/react-compose-refs": "1.1.5"
- },
- "peerDependencies": {
- "@types/react": "*",
- "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc"
+ "@peculiar/asn1-cms": "^2.6.0",
+ "@peculiar/asn1-csr": "^2.6.0",
+ "@peculiar/asn1-ecc": "^2.6.0",
+ "@peculiar/asn1-pkcs9": "^2.6.0",
+ "@peculiar/asn1-rsa": "^2.6.0",
+ "@peculiar/asn1-schema": "^2.6.0",
+ "@peculiar/asn1-x509": "^2.6.0",
+ "pvtsutils": "^1.3.6",
+ "reflect-metadata": "^0.2.2",
+ "tslib": "^2.8.1",
+ "tsyringe": "^4.10.0"
},
- "peerDependenciesMeta": {
- "@types/react": {
- "optional": true
- }
+ "engines": {
+ "node": ">=20.0.0"
}
},
- "node_modules/@radix-ui/react-slot": {
- "version": "1.2.3",
- "resolved": "https://registry.npmjs.org/@radix-ui/react-slot/-/react-slot-1.2.3.tgz",
- "integrity": "sha512-aeNmHnBxbi2St0au6VBVC7JXFlhLlOnvIIlePNniyUNAClzmtAUEY8/pBiK3iHjufOlwA+c20/8jngo7xcrg8A==",
- "devOptional": true,
+ "node_modules/@posthog/browser-common": {
+ "version": "0.8.2",
+ "resolved": "https://registry.npmjs.org/@posthog/browser-common/-/browser-common-0.8.2.tgz",
+ "integrity": "sha512-8g7+ijrx8bfWmpDjmP07e0ZmdRnJoFqZ6PCcMQvfBTUrr422GRXvQWpQn7yD028zIJHIIn/rUTipKgUC5UkWpw==",
"license": "MIT",
"dependencies": {
- "@radix-ui/react-compose-refs": "1.1.2"
- },
- "peerDependencies": {
- "@types/react": "*",
- "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc"
- },
- "peerDependenciesMeta": {
- "@types/react": {
- "optional": true
- }
+ "@posthog/core": "^1.51.0",
+ "@posthog/types": "^1.409.1"
}
},
- "node_modules/@radix-ui/react-toggle": {
- "version": "1.1.10",
- "resolved": "https://registry.npmjs.org/@radix-ui/react-toggle/-/react-toggle-1.1.10.tgz",
- "integrity": "sha512-lS1odchhFTeZv3xwHH31YPObmJn8gOg7Lq12inrr0+BH/l3Tsq32VfjqH1oh80ARM3mlkfMic15n0kg4sD1poQ==",
- "devOptional": true,
+ "node_modules/@posthog/core": {
+ "version": "1.51.0",
+ "resolved": "https://registry.npmjs.org/@posthog/core/-/core-1.51.0.tgz",
+ "integrity": "sha512-LilmmtjcrjV1LgaVNQXrAUt4IXcWIYMrwEtx6VJUUFDeBBdmeI99jshKGtAWugYeB3Wkcp9xQIVCrxIYRpNiRA==",
"license": "MIT",
"dependencies": {
- "@radix-ui/primitive": "1.1.3",
- "@radix-ui/react-primitive": "2.1.3",
- "@radix-ui/react-use-controllable-state": "1.2.2"
- },
- "peerDependencies": {
- "@types/react": "*",
- "@types/react-dom": "*",
- "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc",
- "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc"
- },
- "peerDependenciesMeta": {
- "@types/react": {
- "optional": true
- },
- "@types/react-dom": {
- "optional": true
- }
+ "@posthog/types": "^1.409.1"
}
},
- "node_modules/@radix-ui/react-toggle-group": {
- "version": "1.1.19",
- "resolved": "https://registry.npmjs.org/@radix-ui/react-toggle-group/-/react-toggle-group-1.1.19.tgz",
- "integrity": "sha512-OtnwuSVjd1Ofi+AdnvhsjQdyuhCDwYs1w9RyB5BN/OavXOVQo42SYqQjwUnbPnaiPFBpQ9aX70dWeee+v2oBLA==",
+ "node_modules/@posthog/react": {
+ "version": "1.10.3",
+ "resolved": "https://registry.npmjs.org/@posthog/react/-/react-1.10.3.tgz",
+ "integrity": "sha512-Qu//fGQmVlX0B9kTA3LLg67e7AYLEmeuA0Bf1qSyUM0uUILcRQGjQezhNQPLYSTakOqvXEnl6fM2iQBF6Toxrw==",
"license": "MIT",
- "dependencies": {
- "@radix-ui/primitive": "1.1.7",
- "@radix-ui/react-context": "1.2.2",
- "@radix-ui/react-direction": "1.1.4",
- "@radix-ui/react-primitive": "2.1.10",
- "@radix-ui/react-roving-focus": "1.1.19",
- "@radix-ui/react-toggle": "1.1.18",
- "@radix-ui/react-use-controllable-state": "1.2.6"
- },
"peerDependencies": {
- "@types/react": "*",
- "@types/react-dom": "*",
- "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc",
- "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc"
+ "@types/react": ">=16.8.0",
+ "posthog-js": ">=1.257.2",
+ "react": ">=16.8.0"
},
"peerDependenciesMeta": {
"@types/react": {
"optional": true
- },
- "@types/react-dom": {
- "optional": true
}
}
},
- "node_modules/@radix-ui/react-toggle-group/node_modules/@radix-ui/primitive": {
- "version": "1.1.7",
- "resolved": "https://registry.npmjs.org/@radix-ui/primitive/-/primitive-1.1.7.tgz",
- "integrity": "sha512-rqWnm76nYT8HoNNqEjpgJ7Pw/DrBj5iBTrmEPo6HTX5+VJyBNOqTdv4g89G63HuR5g0AaENoAcH7Is5fF2kZ8Q==",
+ "node_modules/@posthog/types": {
+ "version": "1.409.1",
+ "resolved": "https://registry.npmjs.org/@posthog/types/-/types-1.409.1.tgz",
+ "integrity": "sha512-lA2sSGQUdVknSQl93uN9eUXDwkCMjAuthq24GONGHzMWwVygsKNHlWCnlJsVv2giDokj2p1NopO4zsE2S7gYjA==",
"license": "MIT"
},
- "node_modules/@radix-ui/react-toggle-group/node_modules/@radix-ui/react-compose-refs": {
- "version": "1.1.5",
- "resolved": "https://registry.npmjs.org/@radix-ui/react-compose-refs/-/react-compose-refs-1.1.5.tgz",
- "integrity": "sha512-+48PbAAbq3didjJxa+OaWY2ZwgAKsNiRGyeHKszblZMQ+kcpd9pAaT11cMkGEie0vsOi3QdeTE6d5Fe3Gn61kA==",
- "license": "MIT",
- "peerDependencies": {
- "@types/react": "*",
- "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc"
- },
- "peerDependenciesMeta": {
- "@types/react": {
- "optional": true
- }
+ "node_modules/@prisma/adapter-pg": {
+ "version": "7.8.0",
+ "resolved": "https://registry.npmjs.org/@prisma/adapter-pg/-/adapter-pg-7.8.0.tgz",
+ "integrity": "sha512-ygb3UkerK3v8MDpXVgCISdRNDozpxh6+JVJgiIGbSr5KBgz10LLf5ejUskPGoXlsIjxsOu6nuy1JVQr2EKGSlg==",
+ "license": "Apache-2.0",
+ "dependencies": {
+ "@prisma/driver-adapter-utils": "7.8.0",
+ "@types/pg": "^8.16.0",
+ "pg": "^8.16.3",
+ "postgres-array": "3.0.4"
}
},
- "node_modules/@radix-ui/react-toggle-group/node_modules/@radix-ui/react-primitive": {
- "version": "2.1.10",
- "resolved": "https://registry.npmjs.org/@radix-ui/react-primitive/-/react-primitive-2.1.10.tgz",
- "integrity": "sha512-MucOnzh6hR5mid6VpkbglRAMYMjKLqRnGBbjXkzjK52fuQDd1qbkx78a5P40mkcnVXJdEVxm26E9OPAiUq7nBg==",
+ "node_modules/@prisma/adapter-pg/node_modules/postgres-array": {
+ "version": "3.0.4",
+ "resolved": "https://registry.npmjs.org/postgres-array/-/postgres-array-3.0.4.tgz",
+ "integrity": "sha512-nAUSGfSDGOaOAEGwqsRY27GPOea7CNipJPOA7lPbdEpx5Kg3qzdP0AaWC5MlhTWV9s4hFX39nomVZ+C4tnGOJQ==",
"license": "MIT",
+ "engines": {
+ "node": ">=12"
+ }
+ },
+ "node_modules/@prisma/client": {
+ "version": "7.8.0",
+ "resolved": "https://registry.npmjs.org/@prisma/client/-/client-7.8.0.tgz",
+ "integrity": "sha512-HFp3Dawv/3sU3JtlPha90IB+48lS7zHiH4LKZPjmcE8YH5P9DOXGPvo8dqOtO7MqLDd1p2hOWMcFlRT1DMblHw==",
+ "license": "Apache-2.0",
"dependencies": {
- "@radix-ui/react-slot": "1.3.3"
+ "@prisma/client-runtime-utils": "7.8.0"
+ },
+ "engines": {
+ "node": "^20.19 || ^22.12 || >=24.0"
},
"peerDependencies": {
- "@types/react": "*",
- "@types/react-dom": "*",
- "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc",
- "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc"
+ "prisma": "*",
+ "typescript": ">=5.4.0"
},
"peerDependenciesMeta": {
- "@types/react": {
+ "prisma": {
"optional": true
},
- "@types/react-dom": {
+ "typescript": {
"optional": true
}
}
},
- "node_modules/@radix-ui/react-toggle-group/node_modules/@radix-ui/react-slot": {
- "version": "1.3.3",
- "resolved": "https://registry.npmjs.org/@radix-ui/react-slot/-/react-slot-1.3.3.tgz",
- "integrity": "sha512-qx7oqnYbxnK9kYI9m317qmFmEgo6ywqWvbTogdj7cL9p3/yx4M48p7Rnw5z3H890cL/ow/EeWJsuTykeZVXP5Q==",
- "license": "MIT",
+ "node_modules/@prisma/client-runtime-utils": {
+ "version": "7.8.0",
+ "resolved": "https://registry.npmjs.org/@prisma/client-runtime-utils/-/client-runtime-utils-7.8.0.tgz",
+ "integrity": "sha512-5NQZztQ0oY/ADFkmd9gPuweH5A1/CCY8YQPorLLO0Mu6a87mY5gsnDkzmFmIHs9NFaLnZojzgddFVN4RpKYrdw==",
+ "license": "Apache-2.0"
+ },
+ "node_modules/@prisma/config": {
+ "version": "7.8.0",
+ "resolved": "https://registry.npmjs.org/@prisma/config/-/config-7.8.0.tgz",
+ "integrity": "sha512-HFESzd9rx2ZQxlK+TL7tu1HPvCqrHiL6LCxYykI2c34mvaUuIVVl3lYuicJD/MNnzgPnyeBEMlK4WTomJCV5jw==",
+ "devOptional": true,
+ "license": "Apache-2.0",
"dependencies": {
- "@radix-ui/react-compose-refs": "1.1.5"
- },
- "peerDependencies": {
- "@types/react": "*",
- "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc"
- },
- "peerDependenciesMeta": {
- "@types/react": {
- "optional": true
- }
+ "c12": "3.3.4",
+ "deepmerge-ts": "7.1.5",
+ "effect": "3.20.0",
+ "empathic": "2.0.0"
}
},
- "node_modules/@radix-ui/react-toggle-group/node_modules/@radix-ui/react-toggle": {
- "version": "1.1.18",
- "resolved": "https://registry.npmjs.org/@radix-ui/react-toggle/-/react-toggle-1.1.18.tgz",
- "integrity": "sha512-7lonPlKfSacd20GlOBx2ltuVKz9oqWYZz+oMQyOltw6t1y2nyftj2ZmwwUHYn49kqfDWcp8dNZm5NgV+5Z+mug==",
- "license": "MIT",
+ "node_modules/@prisma/debug": {
+ "version": "7.8.0",
+ "resolved": "https://registry.npmjs.org/@prisma/debug/-/debug-7.8.0.tgz",
+ "integrity": "sha512-p+QZReysDUqXC+mk17q9a+Y/qzh4c2KYliDK30buYUyfrGeTGSyfmc0AIrJRhZJrLHhRiJa9Au/J72h3C+szvA==",
+ "license": "Apache-2.0"
+ },
+ "node_modules/@prisma/dev": {
+ "version": "0.24.3",
+ "resolved": "https://registry.npmjs.org/@prisma/dev/-/dev-0.24.3.tgz",
+ "integrity": "sha512-ffHlQuKXZiaDt9Go0OnCTdJZrHxK0k7omJKNV86/VjpsXu5EIHZLK0T7JSWgvNlJwh56kW9JFu9v0qJciFzepg==",
+ "devOptional": true,
+ "license": "ISC",
"dependencies": {
- "@radix-ui/primitive": "1.1.7",
- "@radix-ui/react-primitive": "2.1.10",
- "@radix-ui/react-use-controllable-state": "1.2.6"
- },
- "peerDependencies": {
- "@types/react": "*",
- "@types/react-dom": "*",
- "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc",
- "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc"
- },
- "peerDependenciesMeta": {
- "@types/react": {
- "optional": true
- },
- "@types/react-dom": {
- "optional": true
- }
+ "@electric-sql/pglite": "0.4.1",
+ "@electric-sql/pglite-socket": "0.1.1",
+ "@electric-sql/pglite-tools": "0.3.1",
+ "@hono/node-server": "1.19.11",
+ "@prisma/get-platform": "7.2.0",
+ "@prisma/query-plan-executor": "7.2.0",
+ "@prisma/streams-local": "0.1.2",
+ "foreground-child": "3.3.1",
+ "get-port-please": "3.2.0",
+ "hono": "^4.12.8",
+ "http-status-codes": "2.3.0",
+ "pathe": "2.0.3",
+ "proper-lockfile": "4.1.2",
+ "remeda": "2.33.4",
+ "std-env": "3.10.0",
+ "valibot": "1.2.0",
+ "zeptomatch": "2.1.0"
+ }
+ },
+ "node_modules/@prisma/driver-adapter-utils": {
+ "version": "7.8.0",
+ "resolved": "https://registry.npmjs.org/@prisma/driver-adapter-utils/-/driver-adapter-utils-7.8.0.tgz",
+ "integrity": "sha512-/Q13o0ZT0rjc1Xk0Q9KhZYwuq2EW/vSbWUBKfgEKkaCuB/Sg6bqnjmTZqC5cD4d6y1vfFAEwBRzfzoSMIVJ55A==",
+ "license": "Apache-2.0",
+ "dependencies": {
+ "@prisma/debug": "7.8.0"
+ }
+ },
+ "node_modules/@prisma/engines": {
+ "version": "7.8.0",
+ "resolved": "https://registry.npmjs.org/@prisma/engines/-/engines-7.8.0.tgz",
+ "integrity": "sha512-jx3rCnNNrt5uzbkKlegtQ2GZHxSlihMCzutgT/BP6UIDF1r9tDI39hV/0T/cHZgzJ3ELbuQPXlVZy+Y1n0pcgw==",
+ "devOptional": true,
+ "hasInstallScript": true,
+ "license": "Apache-2.0",
+ "dependencies": {
+ "@prisma/debug": "7.8.0",
+ "@prisma/engines-version": "7.8.0-6.3c6e192761c0362d496ed980de936e2f3cebcd3a",
+ "@prisma/fetch-engine": "7.8.0",
+ "@prisma/get-platform": "7.8.0"
}
},
- "node_modules/@radix-ui/react-toggle-group/node_modules/@radix-ui/react-use-controllable-state": {
- "version": "1.2.6",
- "resolved": "https://registry.npmjs.org/@radix-ui/react-use-controllable-state/-/react-use-controllable-state-1.2.6.tgz",
- "integrity": "sha512-uEQJGT97ZA/TgP/Hydw47lHu+/vQj6z/0jA+WeTbK1o9Rx45GImjpD0tc3W5ad3D6XTSR6e1yEO0FvGq6WQfVQ==",
- "license": "MIT",
+ "node_modules/@prisma/engines-version": {
+ "version": "7.8.0-6.3c6e192761c0362d496ed980de936e2f3cebcd3a",
+ "resolved": "https://registry.npmjs.org/@prisma/engines-version/-/engines-version-7.8.0-6.3c6e192761c0362d496ed980de936e2f3cebcd3a.tgz",
+ "integrity": "sha512-fJPQxCkLgA5EayWaW8eArgCvjJ+N+Kz3VyeNKMEeYiQC4alNkxRKFVAGxv/ZUzuJISKqdw+zGeDbS6mn6RCPOA==",
+ "devOptional": true,
+ "license": "Apache-2.0"
+ },
+ "node_modules/@prisma/engines/node_modules/@prisma/get-platform": {
+ "version": "7.8.0",
+ "resolved": "https://registry.npmjs.org/@prisma/get-platform/-/get-platform-7.8.0.tgz",
+ "integrity": "sha512-WlxgRGnolL8VH2EmkH1R/DkKNr/mVdS3G2h42IZFFZ3eUrH9OT6t73kIOSlkkrv50wG123Iq8d96ufv5LlZktw==",
+ "devOptional": true,
+ "license": "Apache-2.0",
"dependencies": {
- "@radix-ui/primitive": "1.1.7",
- "@radix-ui/react-use-effect-event": "0.0.5",
- "@radix-ui/react-use-layout-effect": "1.1.4"
- },
- "peerDependencies": {
- "@types/react": "*",
- "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc"
- },
- "peerDependenciesMeta": {
- "@types/react": {
- "optional": true
- }
+ "@prisma/debug": "7.8.0"
}
},
- "node_modules/@radix-ui/react-toggle-group/node_modules/@radix-ui/react-use-effect-event": {
- "version": "0.0.5",
- "resolved": "https://registry.npmjs.org/@radix-ui/react-use-effect-event/-/react-use-effect-event-0.0.5.tgz",
- "integrity": "sha512-7cshFL8HGS/7HEiHH+9kL9HBwp2sa9yX18Knwek6KYWmXwM7pegMgta2AXMQKI+rq3JnfSj9x8wYqFMTdG1Jgg==",
- "license": "MIT",
+ "node_modules/@prisma/fetch-engine": {
+ "version": "7.8.0",
+ "resolved": "https://registry.npmjs.org/@prisma/fetch-engine/-/fetch-engine-7.8.0.tgz",
+ "integrity": "sha512-gwB0Euiz/DDRyxFRpLXYlK3RfaZUj1c5dAYMuhZYfApg7arknJlcb9bIsOHDppJmbqYaVA+yBIiFMDBfprsNPQ==",
+ "devOptional": true,
+ "license": "Apache-2.0",
"dependencies": {
- "@radix-ui/react-use-layout-effect": "1.1.4"
- },
- "peerDependencies": {
- "@types/react": "*",
- "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc"
- },
- "peerDependenciesMeta": {
- "@types/react": {
- "optional": true
- }
+ "@prisma/debug": "7.8.0",
+ "@prisma/engines-version": "7.8.0-6.3c6e192761c0362d496ed980de936e2f3cebcd3a",
+ "@prisma/get-platform": "7.8.0"
}
},
- "node_modules/@radix-ui/react-toggle-group/node_modules/@radix-ui/react-use-layout-effect": {
- "version": "1.1.4",
- "resolved": "https://registry.npmjs.org/@radix-ui/react-use-layout-effect/-/react-use-layout-effect-1.1.4.tgz",
- "integrity": "sha512-K20DkRkUwDnxEYMBPcg3Y6voLkEy5p5QQmszZgLngKKiC7dzBR/aEuK3w1qlx2JWDUNH6FluahYdgR3BP+QbYw==",
- "license": "MIT",
- "peerDependencies": {
- "@types/react": "*",
- "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc"
- },
- "peerDependenciesMeta": {
- "@types/react": {
- "optional": true
- }
+ "node_modules/@prisma/fetch-engine/node_modules/@prisma/get-platform": {
+ "version": "7.8.0",
+ "resolved": "https://registry.npmjs.org/@prisma/get-platform/-/get-platform-7.8.0.tgz",
+ "integrity": "sha512-WlxgRGnolL8VH2EmkH1R/DkKNr/mVdS3G2h42IZFFZ3eUrH9OT6t73kIOSlkkrv50wG123Iq8d96ufv5LlZktw==",
+ "devOptional": true,
+ "license": "Apache-2.0",
+ "dependencies": {
+ "@prisma/debug": "7.8.0"
}
},
- "node_modules/@radix-ui/react-toolbar": {
- "version": "1.1.19",
- "resolved": "https://registry.npmjs.org/@radix-ui/react-toolbar/-/react-toolbar-1.1.19.tgz",
- "integrity": "sha512-Ph0IvtYw4VB12ZnZg+YtrGs8yJQsnizwo/zu0R4Y/nWugtJzA7Pg1eWeuDR9+LSqn+xjamss+UOSOJJJ4gx8jw==",
- "license": "MIT",
+ "node_modules/@prisma/get-platform": {
+ "version": "7.2.0",
+ "resolved": "https://registry.npmjs.org/@prisma/get-platform/-/get-platform-7.2.0.tgz",
+ "integrity": "sha512-k1V0l0Td1732EHpAfi2eySTezyllok9dXb6UQanajkJQzPUGi3vO2z7jdkz67SypFTdmbnyGYxvEvYZdZsMAVA==",
+ "devOptional": true,
+ "license": "Apache-2.0",
"dependencies": {
- "@radix-ui/primitive": "1.1.7",
- "@radix-ui/react-context": "1.2.2",
- "@radix-ui/react-direction": "1.1.4",
- "@radix-ui/react-primitive": "2.1.10",
- "@radix-ui/react-roving-focus": "1.1.19",
- "@radix-ui/react-separator": "1.1.15",
- "@radix-ui/react-toggle-group": "1.1.19"
- },
- "peerDependencies": {
- "@types/react": "*",
- "@types/react-dom": "*",
- "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc",
- "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc"
- },
- "peerDependenciesMeta": {
- "@types/react": {
- "optional": true
- },
- "@types/react-dom": {
- "optional": true
- }
+ "@prisma/debug": "7.2.0"
}
},
- "node_modules/@radix-ui/react-toolbar/node_modules/@radix-ui/primitive": {
- "version": "1.1.7",
- "resolved": "https://registry.npmjs.org/@radix-ui/primitive/-/primitive-1.1.7.tgz",
- "integrity": "sha512-rqWnm76nYT8HoNNqEjpgJ7Pw/DrBj5iBTrmEPo6HTX5+VJyBNOqTdv4g89G63HuR5g0AaENoAcH7Is5fF2kZ8Q==",
- "license": "MIT"
+ "node_modules/@prisma/get-platform/node_modules/@prisma/debug": {
+ "version": "7.2.0",
+ "resolved": "https://registry.npmjs.org/@prisma/debug/-/debug-7.2.0.tgz",
+ "integrity": "sha512-YSGTiSlBAVJPzX4ONZmMotL+ozJwQjRmZweQNIq/ER0tQJKJynNkRB3kyvt37eOfsbMCXk3gnLF6J9OJ4QWftw==",
+ "devOptional": true,
+ "license": "Apache-2.0"
},
- "node_modules/@radix-ui/react-toolbar/node_modules/@radix-ui/react-compose-refs": {
- "version": "1.1.5",
- "resolved": "https://registry.npmjs.org/@radix-ui/react-compose-refs/-/react-compose-refs-1.1.5.tgz",
- "integrity": "sha512-+48PbAAbq3didjJxa+OaWY2ZwgAKsNiRGyeHKszblZMQ+kcpd9pAaT11cMkGEie0vsOi3QdeTE6d5Fe3Gn61kA==",
- "license": "MIT",
- "peerDependencies": {
- "@types/react": "*",
- "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc"
+ "node_modules/@prisma/query-plan-executor": {
+ "version": "7.2.0",
+ "resolved": "https://registry.npmjs.org/@prisma/query-plan-executor/-/query-plan-executor-7.2.0.tgz",
+ "integrity": "sha512-EOZmNzcV8uJ0mae3DhTsiHgoNCuu1J9mULQpGCh62zN3PxPTd+qI9tJvk5jOst8WHKQNwJWR3b39t0XvfBB0WQ==",
+ "devOptional": true,
+ "license": "Apache-2.0"
+ },
+ "node_modules/@prisma/streams-local": {
+ "version": "0.1.2",
+ "resolved": "https://registry.npmjs.org/@prisma/streams-local/-/streams-local-0.1.2.tgz",
+ "integrity": "sha512-l49yTxKKF2odFxaAXTmwmkBKL3+bVQ1tFOooGifu4xkdb9NMNLxHj27XAhTylWZod8I+ISGM5erU1xcl/oBCtg==",
+ "devOptional": true,
+ "license": "Apache-2.0",
+ "dependencies": {
+ "ajv": "^8.12.0",
+ "better-result": "^2.7.0",
+ "env-paths": "^3.0.0",
+ "proper-lockfile": "^4.1.2"
},
- "peerDependenciesMeta": {
- "@types/react": {
- "optional": true
- }
+ "engines": {
+ "bun": ">=1.3.6",
+ "node": ">=22.0.0"
}
},
- "node_modules/@radix-ui/react-toolbar/node_modules/@radix-ui/react-primitive": {
- "version": "2.1.10",
- "resolved": "https://registry.npmjs.org/@radix-ui/react-primitive/-/react-primitive-2.1.10.tgz",
- "integrity": "sha512-MucOnzh6hR5mid6VpkbglRAMYMjKLqRnGBbjXkzjK52fuQDd1qbkx78a5P40mkcnVXJdEVxm26E9OPAiUq7nBg==",
+ "node_modules/@prisma/streams-local/node_modules/ajv": {
+ "version": "8.20.0",
+ "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.20.0.tgz",
+ "integrity": "sha512-Thbli+OlOj+iMPYFBVBfJ3OmCAnaSyNn4M1vz9T6Gka5Jt9ba/HIR56joy65tY6kx/FCF5VXNB819Y7/GUrBGA==",
+ "devOptional": true,
"license": "MIT",
"dependencies": {
- "@radix-ui/react-slot": "1.3.3"
- },
- "peerDependencies": {
- "@types/react": "*",
- "@types/react-dom": "*",
- "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc",
- "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc"
+ "fast-deep-equal": "^3.1.3",
+ "fast-uri": "^3.0.1",
+ "json-schema-traverse": "^1.0.0",
+ "require-from-string": "^2.0.2"
},
- "peerDependenciesMeta": {
- "@types/react": {
- "optional": true
- },
- "@types/react-dom": {
- "optional": true
- }
+ "funding": {
+ "type": "github",
+ "url": "https://github.com/sponsors/epoberezkin"
}
},
- "node_modules/@radix-ui/react-toolbar/node_modules/@radix-ui/react-slot": {
- "version": "1.3.3",
- "resolved": "https://registry.npmjs.org/@radix-ui/react-slot/-/react-slot-1.3.3.tgz",
- "integrity": "sha512-qx7oqnYbxnK9kYI9m317qmFmEgo6ywqWvbTogdj7cL9p3/yx4M48p7Rnw5z3H890cL/ow/EeWJsuTykeZVXP5Q==",
- "license": "MIT",
+ "node_modules/@prisma/streams-local/node_modules/json-schema-traverse": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz",
+ "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==",
+ "devOptional": true,
+ "license": "MIT"
+ },
+ "node_modules/@prisma/studio-core": {
+ "version": "0.27.3",
+ "resolved": "https://registry.npmjs.org/@prisma/studio-core/-/studio-core-0.27.3.tgz",
+ "integrity": "sha512-AADjNFPdsrglxHQVTmHFqv6DuKQZ5WY4p5/gVFY017twvNrSwpLJ9lqUbYYxEu2W7nbvVxTZA8deJ8LseNALsw==",
+ "devOptional": true,
+ "license": "Apache-2.0",
"dependencies": {
- "@radix-ui/react-compose-refs": "1.1.5"
+ "@radix-ui/react-toggle": "1.1.10",
+ "chart.js": "4.5.1"
},
- "peerDependencies": {
- "@types/react": "*",
- "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc"
+ "engines": {
+ "node": "^20.19 || ^22.12 || >=24.0",
+ "pnpm": "8"
},
- "peerDependenciesMeta": {
- "@types/react": {
- "optional": true
- }
+ "peerDependencies": {
+ "@types/react": "^18.0.0 || ^19.0.0",
+ "react": "^18.0.0 || ^19.0.0",
+ "react-dom": "^18.0.0 || ^19.0.0"
}
},
- "node_modules/@radix-ui/react-tooltip": {
- "version": "1.2.16",
- "resolved": "https://registry.npmjs.org/@radix-ui/react-tooltip/-/react-tooltip-1.2.16.tgz",
- "integrity": "sha512-6EamKFRRnlpdadndbZ6LMwycfwkwPte1B42hs6QA0gYhjaOKqW4PZ4pjaW9UrlDX5eVt/OjncE7BFTPL5nmZhg==",
- "license": "MIT",
+ "node_modules/@protobufjs/aspromise": {
+ "version": "1.1.2",
+ "resolved": "https://registry.npmjs.org/@protobufjs/aspromise/-/aspromise-1.1.2.tgz",
+ "integrity": "sha512-j+gKExEuLmKwvz3OgROXtrJ2UG2x8Ch2YZUxahh+s1F2HZ+wAceUNLkvy6zKCPVRkU++ZWQrdxsUeQXmcg4uoQ==",
+ "license": "BSD-3-Clause"
+ },
+ "node_modules/@protobufjs/base64": {
+ "version": "1.1.2",
+ "resolved": "https://registry.npmjs.org/@protobufjs/base64/-/base64-1.1.2.tgz",
+ "integrity": "sha512-AZkcAA5vnN/v4PDqKyMR5lx7hZttPDgClv83E//FMNhR2TMcLUhfRUBHCmSl0oi9zMgDDqRUJkSxO3wm85+XLg==",
+ "license": "BSD-3-Clause"
+ },
+ "node_modules/@protobufjs/codegen": {
+ "version": "2.0.5",
+ "resolved": "https://registry.npmjs.org/@protobufjs/codegen/-/codegen-2.0.5.tgz",
+ "integrity": "sha512-zgXFLzW3Ap33e6d0Wlj4MGIm6Ce8O89n/apUaGNB/jx+hw+ruWEp7EwGUshdLKVRCxZW12fp9r40E1mQrf/34g==",
+ "license": "BSD-3-Clause"
+ },
+ "node_modules/@protobufjs/eventemitter": {
+ "version": "1.1.1",
+ "resolved": "https://registry.npmjs.org/@protobufjs/eventemitter/-/eventemitter-1.1.1.tgz",
+ "integrity": "sha512-vW1GmwMZNnL+gMRaovlh9yZX74kc+TTU3FObkkurpMaRtBfLP3ldjS9KQWlwZgraRE0+dheEEoAxdzcJQ8eXZg==",
+ "license": "BSD-3-Clause"
+ },
+ "node_modules/@protobufjs/fetch": {
+ "version": "1.1.1",
+ "resolved": "https://registry.npmjs.org/@protobufjs/fetch/-/fetch-1.1.1.tgz",
+ "integrity": "sha512-GpptLrs57adMSuHi3VNj0mAF8dwh36LMaYF6XyJ6JMWlVsc+t42tm1HSEDmOs3A8fC9yyeisgLhsTVQokOZ0zw==",
+ "license": "BSD-3-Clause",
"dependencies": {
- "@radix-ui/primitive": "1.1.7",
- "@radix-ui/react-compose-refs": "1.1.5",
- "@radix-ui/react-context": "1.2.2",
- "@radix-ui/react-dismissable-layer": "1.1.19",
- "@radix-ui/react-id": "1.1.4",
- "@radix-ui/react-popper": "1.3.7",
- "@radix-ui/react-portal": "1.1.17",
- "@radix-ui/react-presence": "1.1.10",
- "@radix-ui/react-primitive": "2.1.10",
- "@radix-ui/react-slot": "1.3.3",
- "@radix-ui/react-use-controllable-state": "1.2.6",
- "@radix-ui/react-use-layout-effect": "1.1.4",
- "@radix-ui/react-visually-hidden": "1.2.11"
- },
- "peerDependencies": {
- "@types/react": "*",
- "@types/react-dom": "*",
- "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc",
- "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc"
- },
- "peerDependenciesMeta": {
- "@types/react": {
- "optional": true
- },
- "@types/react-dom": {
- "optional": true
- }
+ "@protobufjs/aspromise": "^1.1.1"
}
},
- "node_modules/@radix-ui/react-tooltip/node_modules/@radix-ui/primitive": {
- "version": "1.1.7",
- "resolved": "https://registry.npmjs.org/@radix-ui/primitive/-/primitive-1.1.7.tgz",
- "integrity": "sha512-rqWnm76nYT8HoNNqEjpgJ7Pw/DrBj5iBTrmEPo6HTX5+VJyBNOqTdv4g89G63HuR5g0AaENoAcH7Is5fF2kZ8Q==",
+ "node_modules/@protobufjs/float": {
+ "version": "1.0.2",
+ "resolved": "https://registry.npmjs.org/@protobufjs/float/-/float-1.0.2.tgz",
+ "integrity": "sha512-Ddb+kVXlXst9d+R9PfTIxh1EdNkgoRe5tOX6t01f1lYWOvJnSPDBlG241QLzcyPdoNTsblLUdujGSE4RzrTZGQ==",
+ "license": "BSD-3-Clause"
+ },
+ "node_modules/@protobufjs/inquire": {
+ "version": "1.1.2",
+ "resolved": "https://registry.npmjs.org/@protobufjs/inquire/-/inquire-1.1.2.tgz",
+ "integrity": "sha512-pa0vFRuws4wkvaXKK1uXZMAwAX4/t8ANaJo45iw/oQHNQ9q5xUzwgFmVJGXiga2BeN+zpX7Vf9vmsiIa2J+MUw==",
+ "license": "BSD-3-Clause"
+ },
+ "node_modules/@protobufjs/path": {
+ "version": "1.1.2",
+ "resolved": "https://registry.npmjs.org/@protobufjs/path/-/path-1.1.2.tgz",
+ "integrity": "sha512-6JOcJ5Tm08dOHAbdR3GrvP+yUUfkjG5ePsHYczMFLq3ZmMkAD98cDgcT2iA1lJ9NVwFd4tH/iSSoe44YWkltEA==",
+ "license": "BSD-3-Clause"
+ },
+ "node_modules/@protobufjs/pool": {
+ "version": "1.1.0",
+ "resolved": "https://registry.npmjs.org/@protobufjs/pool/-/pool-1.1.0.tgz",
+ "integrity": "sha512-0kELaGSIDBKvcgS4zkjz1PeddatrjYcmMWOlAuAPwAeccUrPHdUqo/J6LiymHHEiJT5NrF1UVwxY14f+fy4WQw==",
+ "license": "BSD-3-Clause"
+ },
+ "node_modules/@protobufjs/utf8": {
+ "version": "1.1.1",
+ "resolved": "https://registry.npmjs.org/@protobufjs/utf8/-/utf8-1.1.1.tgz",
+ "integrity": "sha512-oOAWABowe8EAbMyWKM0tYDKi8Yaox52D+HWZhAIJqQXbqe0xI/GV7FhLWqlEKreMkfDjshR5FKgi3mnle0h6Eg==",
+ "license": "BSD-3-Clause"
+ },
+ "node_modules/@radix-ui/primitive": {
+ "version": "1.1.3",
+ "resolved": "https://registry.npmjs.org/@radix-ui/primitive/-/primitive-1.1.3.tgz",
+ "integrity": "sha512-JTF99U/6XIjCBo0wqkU5sK10glYe27MRRsfwoiq5zzOEZLHU3A3KCMa5X/azekYRCJ0HlwI0crAXS/5dEHTzDg==",
+ "devOptional": true,
"license": "MIT"
},
- "node_modules/@radix-ui/react-tooltip/node_modules/@radix-ui/react-compose-refs": {
- "version": "1.1.5",
- "resolved": "https://registry.npmjs.org/@radix-ui/react-compose-refs/-/react-compose-refs-1.1.5.tgz",
- "integrity": "sha512-+48PbAAbq3didjJxa+OaWY2ZwgAKsNiRGyeHKszblZMQ+kcpd9pAaT11cMkGEie0vsOi3QdeTE6d5Fe3Gn61kA==",
+ "node_modules/@radix-ui/react-compose-refs": {
+ "version": "1.1.2",
+ "resolved": "https://registry.npmjs.org/@radix-ui/react-compose-refs/-/react-compose-refs-1.1.2.tgz",
+ "integrity": "sha512-z4eqJvfiNnFMHIIvXP3CY57y2WJs5g2v3X0zm9mEJkrkNv4rDxu+sg9Jh8EkXyeqBkB7SOcboo9dMVqhyrACIg==",
+ "devOptional": true,
"license": "MIT",
"peerDependencies": {
"@types/react": "*",
@@ -7895,13 +4918,14 @@
}
}
},
- "node_modules/@radix-ui/react-tooltip/node_modules/@radix-ui/react-primitive": {
- "version": "2.1.10",
- "resolved": "https://registry.npmjs.org/@radix-ui/react-primitive/-/react-primitive-2.1.10.tgz",
- "integrity": "sha512-MucOnzh6hR5mid6VpkbglRAMYMjKLqRnGBbjXkzjK52fuQDd1qbkx78a5P40mkcnVXJdEVxm26E9OPAiUq7nBg==",
+ "node_modules/@radix-ui/react-primitive": {
+ "version": "2.1.3",
+ "resolved": "https://registry.npmjs.org/@radix-ui/react-primitive/-/react-primitive-2.1.3.tgz",
+ "integrity": "sha512-m9gTwRkhy2lvCPe6QJp4d3G1TYEUHn/FzJUtq9MjH46an1wJU+GdoGC5VLof8RX8Ft/DlpshApkhswDLZzHIcQ==",
+ "devOptional": true,
"license": "MIT",
"dependencies": {
- "@radix-ui/react-slot": "1.3.3"
+ "@radix-ui/react-slot": "1.2.3"
},
"peerDependencies": {
"@types/react": "*",
@@ -7918,33 +4942,14 @@
}
}
},
- "node_modules/@radix-ui/react-tooltip/node_modules/@radix-ui/react-slot": {
- "version": "1.3.3",
- "resolved": "https://registry.npmjs.org/@radix-ui/react-slot/-/react-slot-1.3.3.tgz",
- "integrity": "sha512-qx7oqnYbxnK9kYI9m317qmFmEgo6ywqWvbTogdj7cL9p3/yx4M48p7Rnw5z3H890cL/ow/EeWJsuTykeZVXP5Q==",
- "license": "MIT",
- "dependencies": {
- "@radix-ui/react-compose-refs": "1.1.5"
- },
- "peerDependencies": {
- "@types/react": "*",
- "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc"
- },
- "peerDependenciesMeta": {
- "@types/react": {
- "optional": true
- }
- }
- },
- "node_modules/@radix-ui/react-tooltip/node_modules/@radix-ui/react-use-controllable-state": {
- "version": "1.2.6",
- "resolved": "https://registry.npmjs.org/@radix-ui/react-use-controllable-state/-/react-use-controllable-state-1.2.6.tgz",
- "integrity": "sha512-uEQJGT97ZA/TgP/Hydw47lHu+/vQj6z/0jA+WeTbK1o9Rx45GImjpD0tc3W5ad3D6XTSR6e1yEO0FvGq6WQfVQ==",
+ "node_modules/@radix-ui/react-slot": {
+ "version": "1.2.3",
+ "resolved": "https://registry.npmjs.org/@radix-ui/react-slot/-/react-slot-1.2.3.tgz",
+ "integrity": "sha512-aeNmHnBxbi2St0au6VBVC7JXFlhLlOnvIIlePNniyUNAClzmtAUEY8/pBiK3iHjufOlwA+c20/8jngo7xcrg8A==",
+ "devOptional": true,
"license": "MIT",
"dependencies": {
- "@radix-ui/primitive": "1.1.7",
- "@radix-ui/react-use-effect-event": "0.0.5",
- "@radix-ui/react-use-layout-effect": "1.1.4"
+ "@radix-ui/react-compose-refs": "1.1.2"
},
"peerDependencies": {
"@types/react": "*",
@@ -7956,50 +4961,28 @@
}
}
},
- "node_modules/@radix-ui/react-tooltip/node_modules/@radix-ui/react-use-effect-event": {
- "version": "0.0.5",
- "resolved": "https://registry.npmjs.org/@radix-ui/react-use-effect-event/-/react-use-effect-event-0.0.5.tgz",
- "integrity": "sha512-7cshFL8HGS/7HEiHH+9kL9HBwp2sa9yX18Knwek6KYWmXwM7pegMgta2AXMQKI+rq3JnfSj9x8wYqFMTdG1Jgg==",
+ "node_modules/@radix-ui/react-toggle": {
+ "version": "1.1.10",
+ "resolved": "https://registry.npmjs.org/@radix-ui/react-toggle/-/react-toggle-1.1.10.tgz",
+ "integrity": "sha512-lS1odchhFTeZv3xwHH31YPObmJn8gOg7Lq12inrr0+BH/l3Tsq32VfjqH1oh80ARM3mlkfMic15n0kg4sD1poQ==",
+ "devOptional": true,
"license": "MIT",
"dependencies": {
- "@radix-ui/react-use-layout-effect": "1.1.4"
- },
- "peerDependencies": {
- "@types/react": "*",
- "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc"
+ "@radix-ui/primitive": "1.1.3",
+ "@radix-ui/react-primitive": "2.1.3",
+ "@radix-ui/react-use-controllable-state": "1.2.2"
},
- "peerDependenciesMeta": {
- "@types/react": {
- "optional": true
- }
- }
- },
- "node_modules/@radix-ui/react-tooltip/node_modules/@radix-ui/react-use-layout-effect": {
- "version": "1.1.4",
- "resolved": "https://registry.npmjs.org/@radix-ui/react-use-layout-effect/-/react-use-layout-effect-1.1.4.tgz",
- "integrity": "sha512-K20DkRkUwDnxEYMBPcg3Y6voLkEy5p5QQmszZgLngKKiC7dzBR/aEuK3w1qlx2JWDUNH6FluahYdgR3BP+QbYw==",
- "license": "MIT",
"peerDependencies": {
"@types/react": "*",
- "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc"
+ "@types/react-dom": "*",
+ "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc",
+ "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc"
},
"peerDependenciesMeta": {
"@types/react": {
"optional": true
- }
- }
- },
- "node_modules/@radix-ui/react-use-callback-ref": {
- "version": "1.1.4",
- "resolved": "https://registry.npmjs.org/@radix-ui/react-use-callback-ref/-/react-use-callback-ref-1.1.4.tgz",
- "integrity": "sha512-R6OUY2e2fA6Yn6s+VSx5KBV6Nx8LQEhu+cz7LCej18rQ1HLyg9PSC9jP/ZNx0o6FAIK9c0F1kHylzSxKsdlkrQ==",
- "license": "MIT",
- "peerDependencies": {
- "@types/react": "*",
- "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc"
- },
- "peerDependenciesMeta": {
- "@types/react": {
+ },
+ "@types/react-dom": {
"optional": true
}
}
@@ -8043,21 +5026,6 @@
}
}
},
- "node_modules/@radix-ui/react-use-is-hydrated": {
- "version": "0.1.3",
- "resolved": "https://registry.npmjs.org/@radix-ui/react-use-is-hydrated/-/react-use-is-hydrated-0.1.3.tgz",
- "integrity": "sha512-umO/aJ+82CpOnhDZUTbILCQf7kU/g0iv+oGs/Q8jw7IkhWBzaEP4sA268PhFAJTFetbwp3ICc6ktpI4TqtxcIw==",
- "license": "MIT",
- "peerDependencies": {
- "@types/react": "*",
- "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc"
- },
- "peerDependenciesMeta": {
- "@types/react": {
- "optional": true
- }
- }
- },
"node_modules/@radix-ui/react-use-layout-effect": {
"version": "1.1.1",
"resolved": "https://registry.npmjs.org/@radix-ui/react-use-layout-effect/-/react-use-layout-effect-1.1.1.tgz",
@@ -8074,157 +5042,6 @@
}
}
},
- "node_modules/@radix-ui/react-use-previous": {
- "version": "1.1.4",
- "resolved": "https://registry.npmjs.org/@radix-ui/react-use-previous/-/react-use-previous-1.1.4.tgz",
- "integrity": "sha512-XoSLhbRbqxFtgJoi2fNHA3C6pDlY34x508vUpUGoFZfvePfHXHbE1lC4FYFMnJWgiCRroSTw6fOsXQoVS9RwZg==",
- "license": "MIT",
- "peerDependencies": {
- "@types/react": "*",
- "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc"
- },
- "peerDependenciesMeta": {
- "@types/react": {
- "optional": true
- }
- }
- },
- "node_modules/@radix-ui/react-use-rect": {
- "version": "1.1.4",
- "resolved": "https://registry.npmjs.org/@radix-ui/react-use-rect/-/react-use-rect-1.1.4.tgz",
- "integrity": "sha512-cSOCh6JlkmfjLyNcLiu2nB4v+nm+dkZ+Q5KHWk/soo4U7ZLiEQFKHK9/YmtBHjfCEaU43IBKQOc4/uJmCaiCTQ==",
- "license": "MIT",
- "dependencies": {
- "@radix-ui/rect": "1.1.3"
- },
- "peerDependencies": {
- "@types/react": "*",
- "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc"
- },
- "peerDependenciesMeta": {
- "@types/react": {
- "optional": true
- }
- }
- },
- "node_modules/@radix-ui/react-use-size": {
- "version": "1.1.4",
- "resolved": "https://registry.npmjs.org/@radix-ui/react-use-size/-/react-use-size-1.1.4.tgz",
- "integrity": "sha512-D3anSY15EJoxrihpsXI6SMrmmonnQtR2ni7arO+Lfdg3O95b9hNXxONk8jA5C8ANdF/h5HMAxejgs8PWJ6rlhw==",
- "license": "MIT",
- "dependencies": {
- "@radix-ui/react-use-layout-effect": "1.1.4"
- },
- "peerDependencies": {
- "@types/react": "*",
- "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc"
- },
- "peerDependenciesMeta": {
- "@types/react": {
- "optional": true
- }
- }
- },
- "node_modules/@radix-ui/react-use-size/node_modules/@radix-ui/react-use-layout-effect": {
- "version": "1.1.4",
- "resolved": "https://registry.npmjs.org/@radix-ui/react-use-layout-effect/-/react-use-layout-effect-1.1.4.tgz",
- "integrity": "sha512-K20DkRkUwDnxEYMBPcg3Y6voLkEy5p5QQmszZgLngKKiC7dzBR/aEuK3w1qlx2JWDUNH6FluahYdgR3BP+QbYw==",
- "license": "MIT",
- "peerDependencies": {
- "@types/react": "*",
- "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc"
- },
- "peerDependenciesMeta": {
- "@types/react": {
- "optional": true
- }
- }
- },
- "node_modules/@radix-ui/react-visually-hidden": {
- "version": "1.2.11",
- "resolved": "https://registry.npmjs.org/@radix-ui/react-visually-hidden/-/react-visually-hidden-1.2.11.tgz",
- "integrity": "sha512-NFS86RYYZb4/exihaESBGOpMJFz8MGLAfu3mOBSGByVnVPC9JPASfYubxd/8KbkQK0sYAv8lVQDEQukDX/qXvQ==",
- "license": "MIT",
- "dependencies": {
- "@radix-ui/react-primitive": "2.1.10"
- },
- "peerDependencies": {
- "@types/react": "*",
- "@types/react-dom": "*",
- "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc",
- "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc"
- },
- "peerDependenciesMeta": {
- "@types/react": {
- "optional": true
- },
- "@types/react-dom": {
- "optional": true
- }
- }
- },
- "node_modules/@radix-ui/react-visually-hidden/node_modules/@radix-ui/react-compose-refs": {
- "version": "1.1.5",
- "resolved": "https://registry.npmjs.org/@radix-ui/react-compose-refs/-/react-compose-refs-1.1.5.tgz",
- "integrity": "sha512-+48PbAAbq3didjJxa+OaWY2ZwgAKsNiRGyeHKszblZMQ+kcpd9pAaT11cMkGEie0vsOi3QdeTE6d5Fe3Gn61kA==",
- "license": "MIT",
- "peerDependencies": {
- "@types/react": "*",
- "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc"
- },
- "peerDependenciesMeta": {
- "@types/react": {
- "optional": true
- }
- }
- },
- "node_modules/@radix-ui/react-visually-hidden/node_modules/@radix-ui/react-primitive": {
- "version": "2.1.10",
- "resolved": "https://registry.npmjs.org/@radix-ui/react-primitive/-/react-primitive-2.1.10.tgz",
- "integrity": "sha512-MucOnzh6hR5mid6VpkbglRAMYMjKLqRnGBbjXkzjK52fuQDd1qbkx78a5P40mkcnVXJdEVxm26E9OPAiUq7nBg==",
- "license": "MIT",
- "dependencies": {
- "@radix-ui/react-slot": "1.3.3"
- },
- "peerDependencies": {
- "@types/react": "*",
- "@types/react-dom": "*",
- "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc",
- "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc"
- },
- "peerDependenciesMeta": {
- "@types/react": {
- "optional": true
- },
- "@types/react-dom": {
- "optional": true
- }
- }
- },
- "node_modules/@radix-ui/react-visually-hidden/node_modules/@radix-ui/react-slot": {
- "version": "1.3.3",
- "resolved": "https://registry.npmjs.org/@radix-ui/react-slot/-/react-slot-1.3.3.tgz",
- "integrity": "sha512-qx7oqnYbxnK9kYI9m317qmFmEgo6ywqWvbTogdj7cL9p3/yx4M48p7Rnw5z3H890cL/ow/EeWJsuTykeZVXP5Q==",
- "license": "MIT",
- "dependencies": {
- "@radix-ui/react-compose-refs": "1.1.5"
- },
- "peerDependencies": {
- "@types/react": "*",
- "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc"
- },
- "peerDependenciesMeta": {
- "@types/react": {
- "optional": true
- }
- }
- },
- "node_modules/@radix-ui/rect": {
- "version": "1.1.3",
- "resolved": "https://registry.npmjs.org/@radix-ui/rect/-/rect-1.1.3.tgz",
- "integrity": "sha512-JtyZR+mqgBibTo8xea3B6ZRmzZiM/YeVBtUkas6zMuXjAlfIFIW2FgqeM9eLyvEaYX66vr6DJMK+4U6LV0KhNw==",
- "license": "MIT"
- },
"node_modules/@react-email/render": {
"version": "2.1.0",
"resolved": "https://registry.npmjs.org/@react-email/render/-/render-2.1.0.tgz",
@@ -9091,42 +5908,6 @@
"@img/sharp-win32-x64": "0.34.5"
}
},
- "node_modules/@reduxjs/toolkit": {
- "version": "2.12.0",
- "resolved": "https://registry.npmjs.org/@reduxjs/toolkit/-/toolkit-2.12.0.tgz",
- "integrity": "sha512-KiT+RzZbp6mQET+Mg+h2c97+9j1sNflUxQkIHI7Yuzf6Peu+OYpmkn6nbHWmLLWj+1ZODUJFwGZ7gx3L9R9EOw==",
- "license": "MIT",
- "dependencies": {
- "@standard-schema/spec": "^1.0.0",
- "@standard-schema/utils": "^0.3.0",
- "immer": "^11.0.0",
- "redux": "^5.0.1",
- "redux-thunk": "^3.1.0",
- "reselect": "^5.1.0"
- },
- "peerDependencies": {
- "react": "^16.9.0 || ^17.0.0 || ^18 || ^19",
- "react-redux": "^7.2.1 || ^8.1.3 || ^9.0.0"
- },
- "peerDependenciesMeta": {
- "react": {
- "optional": true
- },
- "react-redux": {
- "optional": true
- }
- }
- },
- "node_modules/@reduxjs/toolkit/node_modules/immer": {
- "version": "11.1.15",
- "resolved": "https://registry.npmjs.org/immer/-/immer-11.1.15.tgz",
- "integrity": "sha512-VrNANlmnWQnh5COXIIOQXM9oOJw7naGKlBT74ZOOR6lpVXc3gFEu9FJLDFcpCJ2j+NWr8TIwtWD//T6ZX6TKiQ==",
- "license": "MIT",
- "funding": {
- "type": "opencollective",
- "url": "https://opencollective.com/immer"
- }
- },
"node_modules/@rollup/rollup-linux-x64-gnu": {
"version": "4.62.1",
"resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.62.1.tgz",
@@ -9463,12 +6244,6 @@
"integrity": "sha512-l2aFy5jALhniG5HgqrD6jXLi/rUWrKvqN/qJx6yoJsgKhblVd+iqqU4RCXavm/jPityDo5TCvKMnpjKnOriy0w==",
"license": "MIT"
},
- "node_modules/@standard-schema/utils": {
- "version": "0.3.0",
- "resolved": "https://registry.npmjs.org/@standard-schema/utils/-/utils-0.3.0.tgz",
- "integrity": "sha512-e7Mew686owMaPJVNNLs55PUvgz371nKgwsc4vxE49zsODpJEnxgxRo2y/OKrqueavXgZNMDVj3DdHFlaSAeU8g==",
- "license": "MIT"
- },
"node_modules/@supabase/auth-js": {
"version": "2.105.4",
"resolved": "https://registry.npmjs.org/@supabase/auth-js/-/auth-js-2.105.4.tgz",
@@ -10036,78 +6811,15 @@
"tslib": "^2.4.0"
}
},
- "node_modules/@types/cors": {
- "version": "2.8.19",
- "resolved": "https://registry.npmjs.org/@types/cors/-/cors-2.8.19.tgz",
- "integrity": "sha512-mFNylyeyqN93lfe/9CSxOGREz8cpzAhH+E93xJ4xWQf62V8sQ/24reV2nyzUWM6H6Xji+GGHpkbLe7pVoUEskg==",
- "license": "MIT",
- "dependencies": {
- "@types/node": "*"
- }
- },
- "node_modules/@types/d3-array": {
- "version": "3.2.2",
- "resolved": "https://registry.npmjs.org/@types/d3-array/-/d3-array-3.2.2.tgz",
- "integrity": "sha512-hOLWVbm7uRza0BYXpIIW5pxfrKe0W+D5lrFiAEYR+pb6w3N2SwSMaJbXdUfSEv+dT4MfHBLtn5js0LAWaO6otw==",
- "license": "MIT"
- },
- "node_modules/@types/d3-color": {
- "version": "3.1.3",
- "resolved": "https://registry.npmjs.org/@types/d3-color/-/d3-color-3.1.3.tgz",
- "integrity": "sha512-iO90scth9WAbmgv7ogoq57O9YpKmFBbmoEoCHDB2xMBY0+/KVrqAaCDyCE16dUspeOvIxFFRI+0sEtqDqy2b4A==",
- "license": "MIT"
- },
- "node_modules/@types/d3-ease": {
- "version": "3.0.2",
- "resolved": "https://registry.npmjs.org/@types/d3-ease/-/d3-ease-3.0.2.tgz",
- "integrity": "sha512-NcV1JjO5oDzoK26oMzbILE6HW7uVXOHLQvHshBUW4UMdZGfiY6v5BeQwh9a9tCzv+CeefZQHJt5SRgK154RtiA==",
- "license": "MIT"
- },
- "node_modules/@types/d3-interpolate": {
- "version": "3.0.4",
- "resolved": "https://registry.npmjs.org/@types/d3-interpolate/-/d3-interpolate-3.0.4.tgz",
- "integrity": "sha512-mgLPETlrpVV1YRJIglr4Ez47g7Yxjl1lj7YKsiMCb27VJH9W8NVM6Bb9d8kkpG/uAQS5AmbA48q2IAolKKo1MA==",
- "license": "MIT",
- "dependencies": {
- "@types/d3-color": "*"
- }
- },
- "node_modules/@types/d3-path": {
- "version": "3.1.1",
- "resolved": "https://registry.npmjs.org/@types/d3-path/-/d3-path-3.1.1.tgz",
- "integrity": "sha512-VMZBYyQvbGmWyWVea0EHs/BwLgxc+MKi1zLDCONksozI4YJMcTt8ZEuIR4Sb1MMTE8MMW49v0IwI5+b7RmfWlg==",
- "license": "MIT"
- },
- "node_modules/@types/d3-scale": {
- "version": "4.0.9",
- "resolved": "https://registry.npmjs.org/@types/d3-scale/-/d3-scale-4.0.9.tgz",
- "integrity": "sha512-dLmtwB8zkAeO/juAMfnV+sItKjlsw2lKdZVVy6LRr0cBmegxSABiLEpGVmSJJ8O08i4+sGR6qQtb6WtuwJdvVw==",
- "license": "MIT",
- "dependencies": {
- "@types/d3-time": "*"
- }
- },
- "node_modules/@types/d3-shape": {
- "version": "3.1.8",
- "resolved": "https://registry.npmjs.org/@types/d3-shape/-/d3-shape-3.1.8.tgz",
- "integrity": "sha512-lae0iWfcDeR7qt7rA88BNiqdvPS5pFVPpo5OfjElwNaT2yyekbM0C9vK+yqBqEmHr6lDkRnYNoTBYlAgJa7a4w==",
+ "node_modules/@types/cors": {
+ "version": "2.8.19",
+ "resolved": "https://registry.npmjs.org/@types/cors/-/cors-2.8.19.tgz",
+ "integrity": "sha512-mFNylyeyqN93lfe/9CSxOGREz8cpzAhH+E93xJ4xWQf62V8sQ/24reV2nyzUWM6H6Xji+GGHpkbLe7pVoUEskg==",
"license": "MIT",
"dependencies": {
- "@types/d3-path": "*"
+ "@types/node": "*"
}
},
- "node_modules/@types/d3-time": {
- "version": "3.0.4",
- "resolved": "https://registry.npmjs.org/@types/d3-time/-/d3-time-3.0.4.tgz",
- "integrity": "sha512-yuzZug1nkAAaBlBBikKZTgzCeA+k1uy4ZFwWANOfKw5z5LRhV0gNA7gNkKm7HoK+HRN0wX3EkxGk0fpbWhmB7g==",
- "license": "MIT"
- },
- "node_modules/@types/d3-timer": {
- "version": "3.0.2",
- "resolved": "https://registry.npmjs.org/@types/d3-timer/-/d3-timer-3.0.2.tgz",
- "integrity": "sha512-Ps3T8E8dZDam6fUyNiMkekK3XUsaUEik+idO9/YjPtfj2qruF8tFBXS7XhtE4iIXBLxhmLjP3SXpLhVf21I9Lw==",
- "license": "MIT"
- },
"node_modules/@types/debug": {
"version": "4.1.13",
"resolved": "https://registry.npmjs.org/@types/debug/-/debug-4.1.13.tgz",
@@ -10255,7 +6967,8 @@
"version": "2.0.7",
"resolved": "https://registry.npmjs.org/@types/trusted-types/-/trusted-types-2.0.7.tgz",
"integrity": "sha512-ScaPdn1dQczgbl0QFTeTOmVHFULt394XJgOQNoyVhZ6r2vLnMLJfBPd53SB52T/3G36VI1/g2MZaX0cwDuXsfw==",
- "license": "MIT"
+ "license": "MIT",
+ "optional": true
},
"node_modules/@types/unist": {
"version": "3.0.3",
@@ -10263,12 +6976,6 @@
"integrity": "sha512-ko/gIFJRv177XgZsZcBwnqJN5x/Gien8qNOn0D5bQU/zAzVf9Zt3BlcUiLqhV9y4ARk0GbT3tnUiPNgnTXzc/Q==",
"license": "MIT"
},
- "node_modules/@types/use-sync-external-store": {
- "version": "0.0.6",
- "resolved": "https://registry.npmjs.org/@types/use-sync-external-store/-/use-sync-external-store-0.0.6.tgz",
- "integrity": "sha512-zFDAD+tlpf2r4asuHEj0XH6pY6i0g5NeAHPn+15wk3BV6JA69eERFXC1gyGThDkVa1zCyKr5jox1+2LbV/AMLg==",
- "license": "MIT"
- },
"node_modules/@types/validate-npm-package-name": {
"version": "4.0.2",
"resolved": "https://registry.npmjs.org/@types/validate-npm-package-name/-/validate-npm-package-name-4.0.2.tgz",
@@ -11243,18 +7950,6 @@
"integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==",
"license": "Python-2.0"
},
- "node_modules/aria-hidden": {
- "version": "1.2.6",
- "resolved": "https://registry.npmjs.org/aria-hidden/-/aria-hidden-1.2.6.tgz",
- "integrity": "sha512-ik3ZgC9dY/lYVVM++OISsaYDeg1tb0VtP5uL3ouh1koGOaUMDPpbFIei4JkFimWUFPn90sbMNMXQAIVOlnYKJA==",
- "license": "MIT",
- "dependencies": {
- "tslib": "^2.0.0"
- },
- "engines": {
- "node": ">=10"
- }
- },
"node_modules/aria-query": {
"version": "5.3.2",
"resolved": "https://registry.npmjs.org/aria-query/-/aria-query-5.3.2.tgz",
@@ -12219,12 +8914,6 @@
"url": "https://polar.sh/cva"
}
},
- "node_modules/classnames": {
- "version": "2.5.1",
- "resolved": "https://registry.npmjs.org/classnames/-/classnames-2.5.1.tgz",
- "integrity": "sha512-saHYOzhIQs6wy2sVxTM6bUDsQO4F50V9RQ22qBpEdCW+I+/Wmke2HOl6lS6dTpdxVhb88/I6+Hs+438c3lfUow==",
- "license": "MIT"
- },
"node_modules/cli-cursor": {
"version": "5.0.0",
"resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-5.0.0.tgz",
@@ -12331,18 +9020,6 @@
"node": ">=6"
}
},
- "node_modules/cm6-theme-basic-light": {
- "version": "0.2.0",
- "resolved": "https://registry.npmjs.org/cm6-theme-basic-light/-/cm6-theme-basic-light-0.2.0.tgz",
- "integrity": "sha512-1prg2gv44sYfpHscP26uLT/ePrh0mlmVwMSoSd3zYKQ92Ab3jPRLzyCnpyOCQLJbK+YdNs4HvMRqMNYdy4pMhA==",
- "license": "MIT",
- "peerDependencies": {
- "@codemirror/language": "^6.0.0",
- "@codemirror/state": "^6.0.0",
- "@codemirror/view": "^6.0.0",
- "@lezer/highlight": "^1.0.0"
- }
- },
"node_modules/cn": {
"version": "0.2.6",
"resolved": "https://registry.npmjs.org/cn/-/cn-0.2.6.tgz",
@@ -12361,21 +9038,6 @@
"integrity": "sha512-Oofo0pq3IKnsFtuHqSF7TqBfr71aeyZDVJ0HpmqB7FBM2qEigL0iPONSCZSO9pE9dZTAxANe5XHG9Uy0YMv8cg==",
"license": "MIT"
},
- "node_modules/codemirror": {
- "version": "6.0.2",
- "resolved": "https://registry.npmjs.org/codemirror/-/codemirror-6.0.2.tgz",
- "integrity": "sha512-VhydHotNW5w1UGK0Qj96BwSk/Zqbp9WbnyK2W/eVMv4QyF41INRGpjUhFJY7/uDNuudSc33a/PKr4iDqRduvHw==",
- "license": "MIT",
- "dependencies": {
- "@codemirror/autocomplete": "^6.0.0",
- "@codemirror/commands": "^6.0.0",
- "@codemirror/language": "^6.0.0",
- "@codemirror/lint": "^6.0.0",
- "@codemirror/search": "^6.0.0",
- "@codemirror/state": "^6.0.0",
- "@codemirror/view": "^6.0.0"
- }
- },
"node_modules/collapse-white-space": {
"version": "2.1.0",
"resolved": "https://registry.npmjs.org/collapse-white-space/-/collapse-white-space-2.1.0.tgz",
@@ -12429,12 +9091,6 @@
"node": ">=20"
}
},
- "node_modules/compute-scroll-into-view": {
- "version": "2.0.4",
- "resolved": "https://registry.npmjs.org/compute-scroll-into-view/-/compute-scroll-into-view-2.0.4.tgz",
- "integrity": "sha512-y/ZA3BGnxoM/QHHQ2Uy49CLtnWPbt4tTPpEEZiEmmiWBFKjej7nEyH8Ryz54jH0MLXflUYA3Er2zUxPSJu5R+g==",
- "license": "MIT"
- },
"node_modules/concat-map": {
"version": "0.0.1",
"resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz",
@@ -12621,12 +9277,6 @@
"node": ">=6"
}
},
- "node_modules/crelt": {
- "version": "1.0.7",
- "resolved": "https://registry.npmjs.org/crelt/-/crelt-1.0.7.tgz",
- "integrity": "sha512-aK6BbWfhf4U/wCcLHKPJl/xa6VkVstRaPywWtMKGwuOLc/wZTyQYuoxgvZnNsBvv7Kg3YTBQYYBCggcviQczuA==",
- "license": "MIT"
- },
"node_modules/cross-spawn": {
"version": "7.0.6",
"resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.6.tgz",
@@ -12706,127 +9356,6 @@
"integrity": "sha512-z1HGKcYy2xA8AGQfwrn0PAy+PB7X/GSj3UVJW9qKyn43xWa+gl5nXmU4qqLMRzWVLFC8KusUX8T/0kCiOYpAIQ==",
"license": "MIT"
},
- "node_modules/d3-array": {
- "version": "3.2.4",
- "resolved": "https://registry.npmjs.org/d3-array/-/d3-array-3.2.4.tgz",
- "integrity": "sha512-tdQAmyA18i4J7wprpYq8ClcxZy3SC31QMeByyCFyRt7BVHdREQZ5lpzoe5mFEYZUWe+oq8HBvk9JjpibyEV4Jg==",
- "license": "ISC",
- "dependencies": {
- "internmap": "1 - 2"
- },
- "engines": {
- "node": ">=12"
- }
- },
- "node_modules/d3-color": {
- "version": "3.1.0",
- "resolved": "https://registry.npmjs.org/d3-color/-/d3-color-3.1.0.tgz",
- "integrity": "sha512-zg/chbXyeBtMQ1LbD/WSoW2DpC3I0mpmPdW+ynRTj/x2DAWYrIY7qeZIHidozwV24m4iavr15lNwIwLxRmOxhA==",
- "license": "ISC",
- "engines": {
- "node": ">=12"
- }
- },
- "node_modules/d3-ease": {
- "version": "3.0.1",
- "resolved": "https://registry.npmjs.org/d3-ease/-/d3-ease-3.0.1.tgz",
- "integrity": "sha512-wR/XK3D3XcLIZwpbvQwQ5fK+8Ykds1ip7A2Txe0yxncXSdq1L9skcG7blcedkOX+ZcgxGAmLX1FrRGbADwzi0w==",
- "license": "BSD-3-Clause",
- "engines": {
- "node": ">=12"
- }
- },
- "node_modules/d3-format": {
- "version": "3.1.2",
- "resolved": "https://registry.npmjs.org/d3-format/-/d3-format-3.1.2.tgz",
- "integrity": "sha512-AJDdYOdnyRDV5b6ArilzCPPwc1ejkHcoyFarqlPqT7zRYjhavcT3uSrqcMvsgh2CgoPbK3RCwyHaVyxYcP2Arg==",
- "license": "ISC",
- "engines": {
- "node": ">=12"
- }
- },
- "node_modules/d3-interpolate": {
- "version": "3.0.1",
- "resolved": "https://registry.npmjs.org/d3-interpolate/-/d3-interpolate-3.0.1.tgz",
- "integrity": "sha512-3bYs1rOD33uo8aqJfKP3JWPAibgw8Zm2+L9vBKEHJ2Rg+viTR7o5Mmv5mZcieN+FRYaAOWX5SJATX6k1PWz72g==",
- "license": "ISC",
- "dependencies": {
- "d3-color": "1 - 3"
- },
- "engines": {
- "node": ">=12"
- }
- },
- "node_modules/d3-path": {
- "version": "3.1.0",
- "resolved": "https://registry.npmjs.org/d3-path/-/d3-path-3.1.0.tgz",
- "integrity": "sha512-p3KP5HCf/bvjBSSKuXid6Zqijx7wIfNW+J/maPs+iwR35at5JCbLUT0LzF1cnjbCHWhqzQTIN2Jpe8pRebIEFQ==",
- "license": "ISC",
- "engines": {
- "node": ">=12"
- }
- },
- "node_modules/d3-scale": {
- "version": "4.0.2",
- "resolved": "https://registry.npmjs.org/d3-scale/-/d3-scale-4.0.2.tgz",
- "integrity": "sha512-GZW464g1SH7ag3Y7hXjf8RoUuAFIqklOAq3MRl4OaWabTFJY9PN/E1YklhXLh+OQ3fM9yS2nOkCoS+WLZ6kvxQ==",
- "license": "ISC",
- "dependencies": {
- "d3-array": "2.10.0 - 3",
- "d3-format": "1 - 3",
- "d3-interpolate": "1.2.0 - 3",
- "d3-time": "2.1.1 - 3",
- "d3-time-format": "2 - 4"
- },
- "engines": {
- "node": ">=12"
- }
- },
- "node_modules/d3-shape": {
- "version": "3.2.0",
- "resolved": "https://registry.npmjs.org/d3-shape/-/d3-shape-3.2.0.tgz",
- "integrity": "sha512-SaLBuwGm3MOViRq2ABk3eLoxwZELpH6zhl3FbAoJ7Vm1gofKx6El1Ib5z23NUEhF9AsGl7y+dzLe5Cw2AArGTA==",
- "license": "ISC",
- "dependencies": {
- "d3-path": "^3.1.0"
- },
- "engines": {
- "node": ">=12"
- }
- },
- "node_modules/d3-time": {
- "version": "3.1.0",
- "resolved": "https://registry.npmjs.org/d3-time/-/d3-time-3.1.0.tgz",
- "integrity": "sha512-VqKjzBLejbSMT4IgbmVgDjpkYrNWUYJnbCGo874u7MMKIWsILRX+OpX/gTk8MqjpT1A/c6HY2dCA77ZN0lkQ2Q==",
- "license": "ISC",
- "dependencies": {
- "d3-array": "2 - 3"
- },
- "engines": {
- "node": ">=12"
- }
- },
- "node_modules/d3-time-format": {
- "version": "4.1.0",
- "resolved": "https://registry.npmjs.org/d3-time-format/-/d3-time-format-4.1.0.tgz",
- "integrity": "sha512-dJxPBlzC7NugB2PDLwo9Q8JiTR3M3e4/XANkreKSUxF8vvXKqm1Yfq4Q5dl8budlunRVlUUaDUgFt7eA8D6NLg==",
- "license": "ISC",
- "dependencies": {
- "d3-time": "1 - 3"
- },
- "engines": {
- "node": ">=12"
- }
- },
- "node_modules/d3-timer": {
- "version": "3.0.1",
- "resolved": "https://registry.npmjs.org/d3-timer/-/d3-timer-3.0.1.tgz",
- "integrity": "sha512-ndfJ/JxxMd3nw31uyKoY2naivF+r29V+Lc0svZxe1JvvIRmi8hUsrMvdOwgS1o6uBHmiz91geQ0ylPP0aj1VUA==",
- "license": "ISC",
- "engines": {
- "node": ">=12"
- }
- },
"node_modules/damerau-levenshtein": {
"version": "1.0.8",
"resolved": "https://registry.npmjs.org/damerau-levenshtein/-/damerau-levenshtein-1.0.8.tgz",
@@ -12897,16 +9426,6 @@
"url": "https://github.com/sponsors/ljharb"
}
},
- "node_modules/date-fns": {
- "version": "4.4.0",
- "resolved": "https://registry.npmjs.org/date-fns/-/date-fns-4.4.0.tgz",
- "integrity": "sha512-+1UMbeh68lH1SegH83CGWwpb6OHHbpSgr3+s5Eww5M4CAgswBpoWS0AjTOfEJ33HiYKz1hdj/KTFprzXHmq/6w==",
- "license": "MIT",
- "funding": {
- "type": "github",
- "url": "https://github.com/sponsors/kossnocorp"
- }
- },
"node_modules/debounce": {
"version": "2.2.0",
"resolved": "https://registry.npmjs.org/debounce/-/debounce-2.2.0.tgz",
@@ -12951,12 +9470,6 @@
}
}
},
- "node_modules/decimal.js-light": {
- "version": "2.5.1",
- "resolved": "https://registry.npmjs.org/decimal.js-light/-/decimal.js-light-2.5.1.tgz",
- "integrity": "sha512-qIMFpTMZmny+MMIitAB6D7iVPEorVw6YQRWkvarTkT4tBeSLLiHzcwj6q0MmYSFCiVpiqPJTJEYIrpcPzVEIvg==",
- "license": "MIT"
- },
"node_modules/decode-named-character-reference": {
"version": "1.3.0",
"resolved": "https://registry.npmjs.org/decode-named-character-reference/-/decode-named-character-reference-1.3.0.tgz",
@@ -13163,12 +9676,6 @@
"node": ">=8"
}
},
- "node_modules/detect-node-es": {
- "version": "1.1.0",
- "resolved": "https://registry.npmjs.org/detect-node-es/-/detect-node-es-1.1.0.tgz",
- "integrity": "sha512-ypdmJU/TbBby2Dxibuv7ZLW3Bs1QEmM7nHjEANfohJLvE0XVujisn1qPJcZxg+qDucsr+bP6fLD1rPS3AhJ7EQ==",
- "license": "MIT"
- },
"node_modules/devlop": {
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/devlop/-/devlop-1.1.0.tgz",
@@ -13353,28 +9860,6 @@
"url": "https://dotenvx.com"
}
},
- "node_modules/downshift": {
- "version": "7.6.2",
- "resolved": "https://registry.npmjs.org/downshift/-/downshift-7.6.2.tgz",
- "integrity": "sha512-iOv+E1Hyt3JDdL9yYcOgW7nZ7GQ2Uz6YbggwXvKUSleetYhU2nXD482Rz6CzvM4lvI1At34BYruKAL4swRGxaA==",
- "license": "MIT",
- "dependencies": {
- "@babel/runtime": "^7.14.8",
- "compute-scroll-into-view": "^2.0.4",
- "prop-types": "^15.7.2",
- "react-is": "^17.0.2",
- "tslib": "^2.3.0"
- },
- "peerDependencies": {
- "react": ">=16.12.0"
- }
- },
- "node_modules/downshift/node_modules/react-is": {
- "version": "17.0.2",
- "resolved": "https://registry.npmjs.org/react-is/-/react-is-17.0.2.tgz",
- "integrity": "sha512-w2GsyukL62IJnlaff/nRegPQR94C/XXamvMWmSHRJ4y7Ts/4ocGRmTHvOs8PSE6pB3dWOrD/nueuU5sduBsQ4w==",
- "license": "MIT"
- },
"node_modules/dunder-proto": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/dunder-proto/-/dunder-proto-1.0.1.tgz",
@@ -13767,17 +10252,6 @@
"url": "https://github.com/sponsors/ljharb"
}
},
- "node_modules/es-toolkit": {
- "version": "1.50.0",
- "resolved": "https://registry.npmjs.org/es-toolkit/-/es-toolkit-1.50.0.tgz",
- "integrity": "sha512-OyZKhUVvEep9ITEiwHn8GKnMRQIVqoSIX7WnRbkWgJkllCujilqP2rD0u979tkl8wqyc8ICwlc1UBVv/Sl1G6w==",
- "license": "MIT",
- "workspaces": [
- "docs",
- "benchmarks",
- "tests/types"
- ]
- },
"node_modules/esast-util-from-estree": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/esast-util-from-estree/-/esast-util-from-estree-2.0.0.tgz",
@@ -14407,12 +10881,6 @@
"node": ">= 0.6"
}
},
- "node_modules/eventemitter3": {
- "version": "5.0.4",
- "resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-5.0.4.tgz",
- "integrity": "sha512-mlsTRyGaPBjPedk6Bvw+aqbsXDtoAyAzm5MO7JgU+yVRyMQ5O8bD4Kcci7BS85f93veegeCPkL8R4GLClnjLFw==",
- "license": "MIT"
- },
"node_modules/eventsource": {
"version": "3.0.7",
"resolved": "https://registry.npmjs.org/eventsource/-/eventsource-3.0.7.tgz",
@@ -14662,19 +11130,6 @@
"reusify": "^1.0.4"
}
},
- "node_modules/fault": {
- "version": "2.0.1",
- "resolved": "https://registry.npmjs.org/fault/-/fault-2.0.1.tgz",
- "integrity": "sha512-WtySTkS4OKev5JtpHXnib4Gxiurzh5NCGvWrFaZ34m6JehfTUhKZvn9njTfw48t6JumVQOmrKqpmGcdwxnhqBQ==",
- "license": "MIT",
- "dependencies": {
- "format": "^0.2.0"
- },
- "funding": {
- "type": "github",
- "url": "https://github.com/sponsors/wooorm"
- }
- },
"node_modules/fetch-blob": {
"version": "3.2.0",
"resolved": "https://registry.npmjs.org/fetch-blob/-/fetch-blob-3.2.0.tgz",
@@ -14872,14 +11327,6 @@
"url": "https://github.com/sponsors/isaacs"
}
},
- "node_modules/format": {
- "version": "0.2.2",
- "resolved": "https://registry.npmjs.org/format/-/format-0.2.2.tgz",
- "integrity": "sha512-wzsgA6WOq+09wrU1tsJ09udeR/YZRaeArL9e1wPbFg3GG2yDnC2ldKpxs4xunpFF9DgqCqOIra3bc1HWrJ37Ww==",
- "engines": {
- "node": ">=0.4.x"
- }
- },
"node_modules/formdata-polyfill": {
"version": "4.0.10",
"resolved": "https://registry.npmjs.org/formdata-polyfill/-/formdata-polyfill-4.0.10.tgz",
@@ -15096,15 +11543,6 @@
"url": "https://github.com/sponsors/ljharb"
}
},
- "node_modules/get-nonce": {
- "version": "1.0.1",
- "resolved": "https://registry.npmjs.org/get-nonce/-/get-nonce-1.0.1.tgz",
- "integrity": "sha512-FJhYRoDaiatfEkUK8HKlicmu/3SGFD51q3itKDGoSTysQJBnfOcxU5GxnhE1E6soB76MbT0MBtnKJuXyAx+96Q==",
- "license": "MIT",
- "engines": {
- "node": ">=6"
- }
- },
"node_modules/get-own-enumerable-keys": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/get-own-enumerable-keys/-/get-own-enumerable-keys-1.0.0.tgz",
@@ -15770,16 +12208,6 @@
"node": ">= 4"
}
},
- "node_modules/immer": {
- "version": "10.2.0",
- "resolved": "https://registry.npmjs.org/immer/-/immer-10.2.0.tgz",
- "integrity": "sha512-d/+XTN3zfODyjr89gM3mPq1WNX2B8pYsu7eORitdwyA2sBubnTl3laYlBk4sXY5FUa5qTZGBDPJICVbvqzjlbw==",
- "license": "MIT",
- "funding": {
- "type": "opencollective",
- "url": "https://opencollective.com/immer"
- }
- },
"node_modules/import-fresh": {
"version": "3.3.1",
"resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.3.1.tgz",
@@ -15840,15 +12268,6 @@
"node": ">= 0.4"
}
},
- "node_modules/internmap": {
- "version": "2.0.3",
- "resolved": "https://registry.npmjs.org/internmap/-/internmap-2.0.3.tgz",
- "integrity": "sha512-5Hh7Y1wQbvY5ooGgPbDaL5iYLAPzMTUrjMulskHLH6wnv/A+1q5rgEaiuqEjB+oxGXIVZs1FF+R/KPN3ZSQYYg==",
- "license": "ISC",
- "engines": {
- "node": ">=12"
- }
- },
"node_modules/ip": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/ip/-/ip-2.0.1.tgz",
@@ -16532,17 +12951,6 @@
"node": ">=0.10.0"
}
},
- "node_modules/isomorphic.js": {
- "version": "0.2.5",
- "resolved": "https://registry.npmjs.org/isomorphic.js/-/isomorphic.js-0.2.5.tgz",
- "integrity": "sha512-PIeMbHqMt4DnUP3MA/Flc0HElYjMXArsw1qwJZcm9sqR8mq3l8NYizFMty0pWwE/tzIGH3EKK5+jes5mAr85yw==",
- "license": "MIT",
- "peer": true,
- "funding": {
- "type": "GitHub Sponsors ❤",
- "url": "https://github.com/sponsors/dmonad"
- }
- },
"node_modules/iterator.prototype": {
"version": "1.1.5",
"resolved": "https://registry.npmjs.org/iterator.prototype/-/iterator.prototype-1.1.5.tgz",
@@ -16853,45 +13261,6 @@
"node": ">= 0.8.0"
}
},
- "node_modules/lexical": {
- "version": "0.48.0",
- "resolved": "https://registry.npmjs.org/lexical/-/lexical-0.48.0.tgz",
- "integrity": "sha512-KK4Tyr/cPsleoZ7XvhGRiRmcrZidSmoFUdIXK9nPubIifoC+80Dc5THyc4xtGKtsW24S1TsHzk5gmfBU+TxmEg==",
- "license": "MIT",
- "dependencies": {
- "@lexical/internal": "0.48.0"
- },
- "peerDependencies": {
- "typescript": ">=5.2"
- },
- "peerDependenciesMeta": {
- "typescript": {
- "optional": true
- }
- }
- },
- "node_modules/lib0": {
- "version": "0.2.117",
- "resolved": "https://registry.npmjs.org/lib0/-/lib0-0.2.117.tgz",
- "integrity": "sha512-DeXj9X5xDCjgKLU/7RR+/HQEVzuuEUiwldwOGsHK/sfAfELGWEyTcf0x+uOvCvK3O2zPmZePXWL85vtia6GyZw==",
- "license": "MIT",
- "peer": true,
- "dependencies": {
- "isomorphic.js": "^0.2.4"
- },
- "bin": {
- "0ecdsa-generate-keypair": "bin/0ecdsa-generate-keypair.js",
- "0gentesthtml": "bin/gentesthtml.js",
- "0serve": "bin/0serve.js"
- },
- "engines": {
- "node": ">=16"
- },
- "funding": {
- "type": "GitHub Sponsors ❤",
- "url": "https://github.com/sponsors/dmonad"
- }
- },
"node_modules/lightningcss": {
"version": "1.32.0",
"resolved": "https://registry.npmjs.org/lightningcss/-/lightningcss-1.32.0.tgz",
@@ -17266,6 +13635,7 @@
"version": "1.4.0",
"resolved": "https://registry.npmjs.org/loose-envify/-/loose-envify-1.4.0.tgz",
"integrity": "sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==",
+ "dev": true,
"license": "MIT",
"dependencies": {
"js-tokens": "^3.0.0 || ^4.0.0"
@@ -17377,27 +13747,6 @@
"@xmldom/xmldom": "^0.9.10"
}
},
- "node_modules/mdast-util-directive": {
- "version": "3.1.0",
- "resolved": "https://registry.npmjs.org/mdast-util-directive/-/mdast-util-directive-3.1.0.tgz",
- "integrity": "sha512-I3fNFt+DHmpWCYAT7quoM6lHf9wuqtI+oCOfvILnoicNIqjh5E3dEJWiXuYME2gNe8vl1iMQwyUHa7bgFmak6Q==",
- "license": "MIT",
- "dependencies": {
- "@types/mdast": "^4.0.0",
- "@types/unist": "^3.0.0",
- "ccount": "^2.0.0",
- "devlop": "^1.0.0",
- "mdast-util-from-markdown": "^2.0.0",
- "mdast-util-to-markdown": "^2.0.0",
- "parse-entities": "^4.0.0",
- "stringify-entities": "^4.0.0",
- "unist-util-visit-parents": "^6.0.0"
- },
- "funding": {
- "type": "opencollective",
- "url": "https://opencollective.com/unified"
- }
- },
"node_modules/mdast-util-find-and-replace": {
"version": "3.0.2",
"resolved": "https://registry.npmjs.org/mdast-util-find-and-replace/-/mdast-util-find-and-replace-3.0.2.tgz",
@@ -17438,46 +13787,16 @@
"devlop": "^1.0.0",
"mdast-util-to-string": "^4.0.0",
"micromark": "^4.0.0",
- "micromark-util-decode-numeric-character-reference": "^2.0.0",
- "micromark-util-decode-string": "^2.0.0",
- "micromark-util-normalize-identifier": "^2.0.0",
- "micromark-util-symbol": "^2.0.0",
- "micromark-util-types": "^2.0.0",
- "unist-util-stringify-position": "^4.0.0"
- },
- "funding": {
- "type": "opencollective",
- "url": "https://opencollective.com/unified"
- }
- },
- "node_modules/mdast-util-frontmatter": {
- "version": "2.0.1",
- "resolved": "https://registry.npmjs.org/mdast-util-frontmatter/-/mdast-util-frontmatter-2.0.1.tgz",
- "integrity": "sha512-LRqI9+wdgC25P0URIJY9vwocIzCcksduHQ9OF2joxQoyTNVduwLAFUzjoopuRJbJAReaKrNQKAZKL3uCMugWJA==",
- "license": "MIT",
- "dependencies": {
- "@types/mdast": "^4.0.0",
- "devlop": "^1.0.0",
- "escape-string-regexp": "^5.0.0",
- "mdast-util-from-markdown": "^2.0.0",
- "mdast-util-to-markdown": "^2.0.0",
- "micromark-extension-frontmatter": "^2.0.0"
- },
- "funding": {
- "type": "opencollective",
- "url": "https://opencollective.com/unified"
- }
- },
- "node_modules/mdast-util-frontmatter/node_modules/escape-string-regexp": {
- "version": "5.0.0",
- "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-5.0.0.tgz",
- "integrity": "sha512-/veY75JbMK4j1yjvuUxuVsiS/hr/4iHs9FTT6cgTexxdE0Ly/glccBAkloH/DofkjRbZU3bnoj38mOmhkZ0lHw==",
- "license": "MIT",
- "engines": {
- "node": ">=12"
+ "micromark-util-decode-numeric-character-reference": "^2.0.0",
+ "micromark-util-decode-string": "^2.0.0",
+ "micromark-util-normalize-identifier": "^2.0.0",
+ "micromark-util-symbol": "^2.0.0",
+ "micromark-util-types": "^2.0.0",
+ "unist-util-stringify-position": "^4.0.0"
},
"funding": {
- "url": "https://github.com/sponsors/sindresorhus"
+ "type": "opencollective",
+ "url": "https://opencollective.com/unified"
}
},
"node_modules/mdast-util-gfm": {
@@ -17581,15 +13900,6 @@
"url": "https://opencollective.com/unified"
}
},
- "node_modules/mdast-util-highlight-mark": {
- "version": "1.2.2",
- "resolved": "https://registry.npmjs.org/mdast-util-highlight-mark/-/mdast-util-highlight-mark-1.2.2.tgz",
- "integrity": "sha512-OYumVoytj+B9YgwzBhBcYUCLYHIPvJtAvwnMyKhUXbfUFuER5S+FDZyu9fadUxm2TCT5fRYK3jQXh2ioWAxrMw==",
- "license": "MIT",
- "dependencies": {
- "micromark-extension-highlight-mark": "1.2.0"
- }
- },
"node_modules/mdast-util-mdx": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/mdast-util-mdx/-/mdast-util-mdx-3.0.0.tgz",
@@ -17865,41 +14175,6 @@
"micromark-util-types": "^2.0.0"
}
},
- "node_modules/micromark-extension-directive": {
- "version": "3.0.2",
- "resolved": "https://registry.npmjs.org/micromark-extension-directive/-/micromark-extension-directive-3.0.2.tgz",
- "integrity": "sha512-wjcXHgk+PPdmvR58Le9d7zQYWy+vKEU9Se44p2CrCDPiLr2FMyiT4Fyb5UFKFC66wGB3kPlgD7q3TnoqPS7SZA==",
- "license": "MIT",
- "dependencies": {
- "devlop": "^1.0.0",
- "micromark-factory-space": "^2.0.0",
- "micromark-factory-whitespace": "^2.0.0",
- "micromark-util-character": "^2.0.0",
- "micromark-util-symbol": "^2.0.0",
- "micromark-util-types": "^2.0.0",
- "parse-entities": "^4.0.0"
- },
- "funding": {
- "type": "opencollective",
- "url": "https://opencollective.com/unified"
- }
- },
- "node_modules/micromark-extension-frontmatter": {
- "version": "2.0.0",
- "resolved": "https://registry.npmjs.org/micromark-extension-frontmatter/-/micromark-extension-frontmatter-2.0.0.tgz",
- "integrity": "sha512-C4AkuM3dA58cgZha7zVnuVxBhDsbttIMiytjgsM2XbHAB2faRVaHRle40558FBN+DJcrLNCoqG5mlrpdU4cRtg==",
- "license": "MIT",
- "dependencies": {
- "fault": "^2.0.0",
- "micromark-util-character": "^2.0.0",
- "micromark-util-symbol": "^2.0.0",
- "micromark-util-types": "^2.0.0"
- },
- "funding": {
- "type": "opencollective",
- "url": "https://opencollective.com/unified"
- }
- },
"node_modules/micromark-extension-gfm": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/micromark-extension-gfm/-/micromark-extension-gfm-3.0.0.tgz",
@@ -18021,20 +14296,6 @@
"url": "https://opencollective.com/unified"
}
},
- "node_modules/micromark-extension-highlight-mark": {
- "version": "1.2.0",
- "resolved": "https://registry.npmjs.org/micromark-extension-highlight-mark/-/micromark-extension-highlight-mark-1.2.0.tgz",
- "integrity": "sha512-huGtbd/9kQsMk8u7nrVMaS5qH/47yDG6ZADggo5Owz5JoY8wdfQjfuy118/QiYNCvdFuFDbzT0A7K7Hp2cBsXA==",
- "license": "MIT",
- "dependencies": {
- "micromark-util-chunked": "^2.0.0",
- "micromark-util-classify-character": "^2.0.0",
- "micromark-util-resolve-all": "^2.0.0",
- "micromark-util-symbol": "^2.0.0",
- "micromark-util-types": "^2.0.0",
- "uvu": "^0.5.6"
- }
- },
"node_modules/micromark-extension-mdx-expression": {
"version": "3.0.1",
"resolved": "https://registry.npmjs.org/micromark-extension-mdx-expression/-/micromark-extension-mdx-expression-3.0.1.tgz",
@@ -18659,15 +14920,6 @@
"license": "BSD-3-Clause",
"optional": true
},
- "node_modules/mri": {
- "version": "1.2.0",
- "resolved": "https://registry.npmjs.org/mri/-/mri-1.2.0.tgz",
- "integrity": "sha512-tzzskb3bG8LvYGFF/mDTpq3jpI6Q9wc3LEmBaghu+DdCssd1FakN7Bc0hVNmEyGq1bq3RgfkCb3cmQLpNPOroA==",
- "license": "MIT",
- "engines": {
- "node": ">=4"
- }
- },
"node_modules/ms": {
"version": "2.1.3",
"resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz",
@@ -20259,6 +16511,7 @@
"version": "15.8.1",
"resolved": "https://registry.npmjs.org/prop-types/-/prop-types-15.8.1.tgz",
"integrity": "sha512-oj87CgZICdulUohogVAR7AjlC0327U4el4L6eAvOqCeudMDVU0NThNaV+b9Df4dXgSP1gXMTnPdhfe/2qDH5cg==",
+ "dev": true,
"license": "MIT",
"dependencies": {
"loose-envify": "^1.4.0",
@@ -20464,32 +16717,6 @@
"node": ">=0.10.0"
}
},
- "node_modules/react-day-picker": {
- "version": "10.0.1",
- "resolved": "https://registry.npmjs.org/react-day-picker/-/react-day-picker-10.0.1.tgz",
- "integrity": "sha512-eNh6BlwcYInWaJtRv18mXQ06Ys/H6rdTZAnTaSdOYJuTpwP1JMCHNd1FDRadA+gbeinq+psdULN5Xnowy9mV8w==",
- "license": "MIT",
- "dependencies": {
- "@date-fns/tz": "^1.4.1",
- "date-fns": "^4.1.0"
- },
- "engines": {
- "node": ">=18"
- },
- "funding": {
- "type": "individual",
- "url": "https://github.com/sponsors/gpbl"
- },
- "peerDependencies": {
- "@types/react": ">=16.8.0",
- "react": ">=16.8.0"
- },
- "peerDependenciesMeta": {
- "@types/react": {
- "optional": true
- }
- }
- },
"node_modules/react-dom": {
"version": "19.2.4",
"resolved": "https://registry.npmjs.org/react-dom/-/react-dom-19.2.4.tgz",
@@ -20633,26 +16860,11 @@
"node": ">=6"
}
},
- "node_modules/react-hook-form": {
- "version": "7.87.0",
- "resolved": "https://registry.npmjs.org/react-hook-form/-/react-hook-form-7.87.0.tgz",
- "integrity": "sha512-zhFzWvLxNHH+8839OnZcUxgMZw88ah2jZWDWvKWgF3Tpbnd0vKL+dlcuU3nZVWESZQjd81EW8K+wU+cYfYAc0w==",
- "license": "MIT",
- "engines": {
- "node": ">=18.0.0"
- },
- "funding": {
- "type": "opencollective",
- "url": "https://opencollective.com/react-hook-form"
- },
- "peerDependencies": {
- "react": "^16.8.0 || ^17 || ^18 || ^19"
- }
- },
"node_modules/react-is": {
"version": "16.13.1",
"resolved": "https://registry.npmjs.org/react-is/-/react-is-16.13.1.tgz",
"integrity": "sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ==",
+ "dev": true,
"license": "MIT"
},
"node_modules/react-markdown": {
@@ -20682,98 +16894,6 @@
"react": ">=18"
}
},
- "node_modules/react-redux": {
- "version": "9.3.0",
- "resolved": "https://registry.npmjs.org/react-redux/-/react-redux-9.3.0.tgz",
- "integrity": "sha512-KQopgqFo/p/fgmAs5qz6p5RWaNAzq40WAu7fJIXnQpYxFPbJYtsJPWvGeF2rOBaY/kEuV77AVsX8TsQzKm+A/g==",
- "license": "MIT",
- "dependencies": {
- "@types/use-sync-external-store": "^0.0.6",
- "use-sync-external-store": "^1.4.0"
- },
- "peerDependencies": {
- "@types/react": "^18.2.25 || ^19",
- "react": "^18.0 || ^19",
- "redux": "^5.0.0"
- },
- "peerDependenciesMeta": {
- "@types/react": {
- "optional": true
- },
- "redux": {
- "optional": true
- }
- }
- },
- "node_modules/react-remove-scroll": {
- "version": "2.7.2",
- "resolved": "https://registry.npmjs.org/react-remove-scroll/-/react-remove-scroll-2.7.2.tgz",
- "integrity": "sha512-Iqb9NjCCTt6Hf+vOdNIZGdTiH1QSqr27H/Ek9sv/a97gfueI/5h1s3yRi1nngzMUaOOToin5dI1dXKdXiF+u0Q==",
- "license": "MIT",
- "dependencies": {
- "react-remove-scroll-bar": "^2.3.7",
- "react-style-singleton": "^2.2.3",
- "tslib": "^2.1.0",
- "use-callback-ref": "^1.3.3",
- "use-sidecar": "^1.1.3"
- },
- "engines": {
- "node": ">=10"
- },
- "peerDependencies": {
- "@types/react": "*",
- "react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0 || ^19.0.0-rc"
- },
- "peerDependenciesMeta": {
- "@types/react": {
- "optional": true
- }
- }
- },
- "node_modules/react-remove-scroll-bar": {
- "version": "2.3.8",
- "resolved": "https://registry.npmjs.org/react-remove-scroll-bar/-/react-remove-scroll-bar-2.3.8.tgz",
- "integrity": "sha512-9r+yi9+mgU33AKcj6IbT9oRCO78WriSj6t/cF8DWBZJ9aOGPOTEDvdUDz1FwKim7QXWwmHqtdHnRJfhAxEG46Q==",
- "license": "MIT",
- "dependencies": {
- "react-style-singleton": "^2.2.2",
- "tslib": "^2.0.0"
- },
- "engines": {
- "node": ">=10"
- },
- "peerDependencies": {
- "@types/react": "*",
- "react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0"
- },
- "peerDependenciesMeta": {
- "@types/react": {
- "optional": true
- }
- }
- },
- "node_modules/react-style-singleton": {
- "version": "2.2.3",
- "resolved": "https://registry.npmjs.org/react-style-singleton/-/react-style-singleton-2.2.3.tgz",
- "integrity": "sha512-b6jSvxvVnyptAiLjbkWLE/lOnR4lfTtDAl+eUC7RZy+QQWc6wRzIV2CE6xBuMmDxc2qIihtDCZD5NPOFl7fRBQ==",
- "license": "MIT",
- "dependencies": {
- "get-nonce": "^1.0.0",
- "tslib": "^2.0.0"
- },
- "engines": {
- "node": ">=10"
- },
- "peerDependencies": {
- "@types/react": "*",
- "react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0 || ^19.0.0-rc"
- },
- "peerDependenciesMeta": {
- "@types/react": {
- "optional": true
- }
- }
- },
"node_modules/readable-stream": {
"version": "2.3.8",
"resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.8.tgz",
@@ -20841,42 +16961,6 @@
"node": ">= 4"
}
},
- "node_modules/recharts": {
- "version": "3.8.0",
- "resolved": "https://registry.npmjs.org/recharts/-/recharts-3.8.0.tgz",
- "integrity": "sha512-Z/m38DX3L73ExO4Tpc9/iZWHmHnlzWG4njQbxsF5aSjwqmHNDDIm0rdEBArkwsBvR8U6EirlEHiQNYWCVh9sGQ==",
- "license": "MIT",
- "workspaces": [
- "www"
- ],
- "dependencies": {
- "@reduxjs/toolkit": "^1.9.0 || 2.x.x",
- "clsx": "^2.1.1",
- "decimal.js-light": "^2.5.1",
- "es-toolkit": "^1.39.3",
- "eventemitter3": "^5.0.1",
- "immer": "^10.1.1",
- "react-redux": "8.x.x || 9.x.x",
- "reselect": "5.1.1",
- "tiny-invariant": "^1.3.3",
- "use-sync-external-store": "^1.2.2",
- "victory-vendor": "^37.0.2"
- },
- "engines": {
- "node": ">=18"
- },
- "peerDependencies": {
- "react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0",
- "react-dom": "^16.0.0 || ^17.0.0 || ^18.0.0 || ^19.0.0",
- "react-is": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0"
- }
- },
- "node_modules/recharts/node_modules/reselect": {
- "version": "5.1.1",
- "resolved": "https://registry.npmjs.org/reselect/-/reselect-5.1.1.tgz",
- "integrity": "sha512-K/BG6eIky/SBpzfHZv/dd+9JBFiS4SWV7FIujVyJRux6e45+73RaUHXLmIR1f7WOMaQ0U1km6qwklRQxpJJY0w==",
- "license": "MIT"
- },
"node_modules/recma-build-jsx": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/recma-build-jsx/-/recma-build-jsx-1.0.0.tgz",
@@ -20944,21 +17028,6 @@
"url": "https://opencollective.com/unified"
}
},
- "node_modules/redux": {
- "version": "5.0.1",
- "resolved": "https://registry.npmjs.org/redux/-/redux-5.0.1.tgz",
- "integrity": "sha512-M9/ELqF6fy8FwmkpnF0S3YKOqMyoWJ4+CS5Efg2ct3oY9daQvd/Pc71FpGZsVsbl3Cpb+IIcjBDUnnyBdQbq4w==",
- "license": "MIT"
- },
- "node_modules/redux-thunk": {
- "version": "3.1.0",
- "resolved": "https://registry.npmjs.org/redux-thunk/-/redux-thunk-3.1.0.tgz",
- "integrity": "sha512-NW2r5T6ksUKXCabzhL9z+h206HQw/NJkcLm1GPImRQ8IzfXwRGqjVhKJGauHirT0DAuyy6hjdnMZaRoAcy0Klw==",
- "license": "MIT",
- "peerDependencies": {
- "redux": "^5.0.0"
- }
- },
"node_modules/reflect-metadata": {
"version": "0.2.2",
"resolved": "https://registry.npmjs.org/reflect-metadata/-/reflect-metadata-0.2.2.tgz",
@@ -21312,18 +17381,6 @@
"queue-microtask": "^1.2.2"
}
},
- "node_modules/sade": {
- "version": "1.8.1",
- "resolved": "https://registry.npmjs.org/sade/-/sade-1.8.1.tgz",
- "integrity": "sha512-xal3CZX1Xlo/k4ApwCFrHVACi9fBqJ7V+mwhBsuf/1IOKbBy098Fex+Wa/5QMubw09pSZ/u8EY8PWgevJsXp1A==",
- "license": "MIT",
- "dependencies": {
- "mri": "^1.1.0"
- },
- "engines": {
- "node": ">=6"
- }
- },
"node_modules/safe-array-concat": {
"version": "1.1.4",
"resolved": "https://registry.npmjs.org/safe-array-concat/-/safe-array-concat-1.1.4.tgz",
@@ -22303,12 +18360,6 @@
"integrity": "sha512-zOh9jPYI+xrNOyisSelgym4tolKTJCQd5GBhK0+0xJvcYDcwlOoxF/rnFKQ2KRZknXSG9jWAp66fwP6AxN9STg==",
"license": "MIT"
},
- "node_modules/style-mod": {
- "version": "4.1.3",
- "resolved": "https://registry.npmjs.org/style-mod/-/style-mod-4.1.3.tgz",
- "integrity": "sha512-i/n8VsZydrugj3Iuzll8+x/00GH2vnYsk1eomD8QiRrSAeW6ItbCQDtfXCeJHd0iwiNagqjQkvpvREEPtW3IoQ==",
- "license": "MIT"
- },
"node_modules/style-to-js": {
"version": "1.1.21",
"resolved": "https://registry.npmjs.org/style-to-js/-/style-to-js-1.1.21.tgz",
@@ -22398,12 +18449,6 @@
"react": "^16.11.0 || ^17.0.0 || ^18.0.0 || ^19.0.0"
}
},
- "node_modules/tabbable": {
- "version": "6.5.0",
- "resolved": "https://registry.npmjs.org/tabbable/-/tabbable-6.5.0.tgz",
- "integrity": "sha512-wieBHXygIm7OyQOu5hQlkk62/WyCFYGlWg7L6/ZCUZwx0o398Zkn4pVmMyfYhfMG8kGrj/Krt8eIk6UKC6VzwA==",
- "license": "MIT"
- },
"node_modules/tagged-tag": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/tagged-tag/-/tagged-tag-1.0.0.tgz",
@@ -22985,24 +19030,6 @@
"url": "https://github.com/sponsors/sindresorhus"
}
},
- "node_modules/unidiff": {
- "version": "1.0.4",
- "resolved": "https://registry.npmjs.org/unidiff/-/unidiff-1.0.4.tgz",
- "integrity": "sha512-ynU0vsAXw0ir8roa+xPCUHmnJ5goc5BTM2Kuc3IJd8UwgaeRs7VSD5+eeaQL+xp1JtB92hu/Zy/Lgy7RZcr1pQ==",
- "license": "MIT",
- "dependencies": {
- "diff": "^5.1.0"
- }
- },
- "node_modules/unidiff/node_modules/diff": {
- "version": "5.2.2",
- "resolved": "https://registry.npmjs.org/diff/-/diff-5.2.2.tgz",
- "integrity": "sha512-vtcDfH3TOjP8UekytvnHH1o1P4FcUdt4eQ1Y+Abap1tk/OB2MWQvcwS2ClCd1zuIhc3JKOx6p3kod8Vfys3E+A==",
- "license": "BSD-3-Clause",
- "engines": {
- "node": ">=0.3.1"
- }
- },
"node_modules/unified": {
"version": "11.0.5",
"resolved": "https://registry.npmjs.org/unified/-/unified-11.0.5.tgz",
@@ -23247,49 +19274,6 @@
"punycode": "^2.1.0"
}
},
- "node_modules/use-callback-ref": {
- "version": "1.3.3",
- "resolved": "https://registry.npmjs.org/use-callback-ref/-/use-callback-ref-1.3.3.tgz",
- "integrity": "sha512-jQL3lRnocaFtu3V00JToYz/4QkNWswxijDaCVNZRiRTO3HQDLsdu1ZtmIUvV4yPp+rvWm5j0y0TG/S61cuijTg==",
- "license": "MIT",
- "dependencies": {
- "tslib": "^2.0.0"
- },
- "engines": {
- "node": ">=10"
- },
- "peerDependencies": {
- "@types/react": "*",
- "react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0 || ^19.0.0-rc"
- },
- "peerDependenciesMeta": {
- "@types/react": {
- "optional": true
- }
- }
- },
- "node_modules/use-sidecar": {
- "version": "1.1.3",
- "resolved": "https://registry.npmjs.org/use-sidecar/-/use-sidecar-1.1.3.tgz",
- "integrity": "sha512-Fedw0aZvkhynoPYlA5WXrMCAMm+nSWdZt6lzJQ7Ok8S6Q+VsHmHpRWndVRJ8Be0ZbkfPc5LRYH+5XrzXcEeLRQ==",
- "license": "MIT",
- "dependencies": {
- "detect-node-es": "^1.1.0",
- "tslib": "^2.0.0"
- },
- "engines": {
- "node": ">=10"
- },
- "peerDependencies": {
- "@types/react": "*",
- "react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0 || ^19.0.0-rc"
- },
- "peerDependenciesMeta": {
- "@types/react": {
- "optional": true
- }
- }
- },
"node_modules/use-sync-external-store": {
"version": "1.6.0",
"resolved": "https://registry.npmjs.org/use-sync-external-store/-/use-sync-external-store-1.6.0.tgz",
@@ -23305,33 +19289,6 @@
"integrity": "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==",
"license": "MIT"
},
- "node_modules/uvu": {
- "version": "0.5.6",
- "resolved": "https://registry.npmjs.org/uvu/-/uvu-0.5.6.tgz",
- "integrity": "sha512-+g8ENReyr8YsOc6fv/NVJs2vFdHBnBNdfE49rshrTzDWOlUx4Gq7KOS2GD8eqhy2j+Ejq29+SbKH8yjkAqXqoA==",
- "license": "MIT",
- "dependencies": {
- "dequal": "^2.0.0",
- "diff": "^5.0.0",
- "kleur": "^4.0.3",
- "sade": "^1.7.3"
- },
- "bin": {
- "uvu": "bin.js"
- },
- "engines": {
- "node": ">=8"
- }
- },
- "node_modules/uvu/node_modules/diff": {
- "version": "5.2.2",
- "resolved": "https://registry.npmjs.org/diff/-/diff-5.2.2.tgz",
- "integrity": "sha512-vtcDfH3TOjP8UekytvnHH1o1P4FcUdt4eQ1Y+Abap1tk/OB2MWQvcwS2ClCd1zuIhc3JKOx6p3kod8Vfys3E+A==",
- "license": "BSD-3-Clause",
- "engines": {
- "node": ">=0.3.1"
- }
- },
"node_modules/valibot": {
"version": "1.2.0",
"resolved": "https://registry.npmjs.org/valibot/-/valibot-1.2.0.tgz",
@@ -23407,34 +19364,6 @@
"url": "https://opencollective.com/unified"
}
},
- "node_modules/victory-vendor": {
- "version": "37.3.6",
- "resolved": "https://registry.npmjs.org/victory-vendor/-/victory-vendor-37.3.6.tgz",
- "integrity": "sha512-SbPDPdDBYp+5MJHhBCAyI7wKM3d5ivekigc2Dk2s7pgbZ9wIgIBYGVw4zGHBml/qTFbexrofXW6Gu4noGxrOwQ==",
- "license": "MIT AND ISC",
- "dependencies": {
- "@types/d3-array": "^3.0.3",
- "@types/d3-ease": "^3.0.0",
- "@types/d3-interpolate": "^3.0.1",
- "@types/d3-scale": "^4.0.2",
- "@types/d3-shape": "^3.1.0",
- "@types/d3-time": "^3.0.0",
- "@types/d3-timer": "^3.0.0",
- "d3-array": "^3.1.6",
- "d3-ease": "^3.0.1",
- "d3-interpolate": "^3.0.1",
- "d3-scale": "^4.0.2",
- "d3-shape": "^3.1.0",
- "d3-time": "^3.0.0",
- "d3-timer": "^3.0.1"
- }
- },
- "node_modules/w3c-keyname": {
- "version": "2.2.8",
- "resolved": "https://registry.npmjs.org/w3c-keyname/-/w3c-keyname-2.2.8.tgz",
- "integrity": "sha512-dpojBhNsCNN7T82Tm7k26A6G9ML3NkhDsnw9n/eoxSRlVBB4CEtIQ/KTCLI2Fwf3ataSXRhYFkQi3SlnFwPvPQ==",
- "license": "MIT"
- },
"node_modules/web-streams-polyfill": {
"version": "3.3.3",
"resolved": "https://registry.npmjs.org/web-streams-polyfill/-/web-streams-polyfill-3.3.3.tgz",
@@ -24001,24 +19930,6 @@
"node": ">=8"
}
},
- "node_modules/yjs": {
- "version": "13.6.32",
- "resolved": "https://registry.npmjs.org/yjs/-/yjs-13.6.32.tgz",
- "integrity": "sha512-lfiJIIC4Xayt5ItynE407ehlE03pCjeOc4hkR4yxxvvNJ4kuiN25B0g+Qp8XagYz361LLL7DCzR5bvFJ81QKtQ==",
- "license": "MIT",
- "peer": true,
- "dependencies": {
- "lib0": "^0.2.99"
- },
- "engines": {
- "node": ">=16.0.0",
- "npm": ">=8.0.0"
- },
- "funding": {
- "type": "GitHub Sponsors ❤",
- "url": "https://github.com/sponsors/dmonad"
- }
- },
"node_modules/yocto-queue": {
"version": "0.1.0",
"resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz",
diff --git a/site/package.json b/site/package.json
index 1e45cc38..0fcba3f4 100644
--- a/site/package.json
+++ b/site/package.json
@@ -90,7 +90,6 @@
"@google/genai": "2.21.0",
"@mdx-js/loader": "^3.1.1",
"@mdx-js/react": "^3.1.1",
- "@mdxeditor/editor": "^4.2.4",
"@mediabunny/prores": "^1.55.1",
"@mediabunny/server": "^1.55.1",
"@mediapipe/tasks-vision": "^1.0.1",
@@ -115,10 +114,8 @@
"class-variance-authority": "^0.7.1",
"clsx": "^2.1.1",
"cn": "^0.2.6",
- "date-fns": "^4.4.0",
"defuddle": "^0.18.1",
"geist": "^1.7.2",
- "lexical": "^0.48.0",
"linkedom": "^0.18.12",
"lucide-react": "^1.23.0",
"mediabunny": "^1.55.5",
@@ -131,11 +128,9 @@
"pg": "^8.20.0",
"posthog-js": "^1.428.5",
"react": "19.2.4",
- "react-day-picker": "^10.0.1",
"react-dom": "19.2.4",
"react-email": "^6.9.1",
"react-markdown": "^10.1.0",
- "recharts": "^3.8.0",
"remark-gfm": "^4.0.1",
"resend": "^6.18.1",
"shadcn": "^4.7.0",
diff --git a/site/src/app/api/analytics/run/route.ts b/site/src/app/api/analytics/run/route.ts
index 2812f1f7..77cadfe7 100644
--- a/site/src/app/api/analytics/run/route.ts
+++ b/site/src/app/api/analytics/run/route.ts
@@ -8,8 +8,7 @@ import { enqueueJob } from "@/lib/jobs/queue";
export const maxDuration = 300;
// The nightly analytics run. Vercel's cron authenticates with the CRON_SECRET
-// bearer token; manual runs — the dashboard's Run button and per-day
-// {day, force} retriggers — go through POST /api/jobs.
+// bearer token; manual runs start from su.
export const GET = async (request: NextRequest) => {
if (!(await isVercelCron(request))) return notFoundResponse();
return NextResponse.json(await enqueueJob("analytics-daily", {}, "vercel-cron"));
diff --git a/site/src/app/api/credits/expire/route.ts b/site/src/app/api/credits/expire/route.ts
index eeab36ae..6efe084c 100644
--- a/site/src/app/api/credits/expire/route.ts
+++ b/site/src/app/api/credits/expire/route.ts
@@ -8,7 +8,7 @@ import { enqueueJob } from "@/lib/jobs/queue";
export const maxDuration = 300;
// The nightly credit-expiry sweep. Vercel's cron authenticates with the
-// CRON_SECRET bearer token; a manual run goes through POST /api/jobs.
+// CRON_SECRET bearer token; a manual run starts from su.
export const GET = async (request: NextRequest) => {
if (!(await isVercelCron(request))) return notFoundResponse();
return NextResponse.json(await enqueueJob("credit-expiry", {}, "vercel-cron"));
diff --git a/site/src/app/api/credits/expiry-notices/route.ts b/site/src/app/api/credits/expiry-notices/route.ts
index 4897e32b..844144d9 100644
--- a/site/src/app/api/credits/expiry-notices/route.ts
+++ b/site/src/app/api/credits/expiry-notices/route.ts
@@ -8,7 +8,7 @@ import { enqueueJob } from "@/lib/jobs/queue";
export const maxDuration = 300;
// The daily credit-expiry notice. Vercel's cron authenticates with the
-// CRON_SECRET bearer token; a manual run goes through POST /api/jobs.
+// CRON_SECRET bearer token; a manual run starts from su.
export const GET = async (request: NextRequest) => {
if (!(await isVercelCron(request))) return notFoundResponse();
return NextResponse.json(await enqueueJob("credit-expiry-notice", {}, "vercel-cron"));
diff --git a/site/src/app/api/credits/offers/route.ts b/site/src/app/api/credits/offers/route.ts
deleted file mode 100644
index 6cbea9f7..00000000
--- a/site/src/app/api/credits/offers/route.ts
+++ /dev/null
@@ -1,70 +0,0 @@
-import { NextResponse } from "next/server";
-import { z } from "zod";
-
-import { creditStringToMicros } from "@/lib/credits/amounts";
-import { createCreditOffer } from "@/lib/credits/offers";
-import { maxCreditGrantDollars, maxCreditGrantExpiryDays } from "@/lib/credits/top-up";
-import { notFoundResponse, withSuperUser } from "@/lib/donkey-api-auth";
-import { prisma } from "@/lib/prisma";
-
-// Offers credit to an account: the amount waits until the person claims it
-// from the email this sends. The target is identified by userId (offer to
-// self) or by email. A single offer is capped to guard against typos. The
-// caller states how long the credit lives once claimed; null keeps it forever.
-const creditOfferRequestSchema = z
- .object({
- amountDollars: z.coerce.number().int().positive().max(maxCreditGrantDollars),
- description: z.string().trim().min(1).max(500).optional(),
- email: z.string().trim().email().optional(),
- expiresAfterDays: z.number().int().min(1).max(maxCreditGrantExpiryDays).nullable(),
- userId: z.string().trim().min(1).optional(),
- })
- .strict()
- .refine((data) => Boolean(data.userId || data.email), {
- message: "Provide a userId or an email.",
- });
-
-export const POST = withSuperUser(async (request) => {
- const parsed = creditOfferRequestSchema.safeParse(await request.json());
- if (!parsed.success) {
- return NextResponse.json(
- {
- error: "Invalid request",
- issues: parsed.error.issues.map((issue) => ({
- path: issue.path.join("."),
- message: issue.message,
- })),
- },
- { status: 400 },
- );
- }
-
- const targetUser = await prisma.user.findUnique({
- select: { email: true, id: true, name: true },
- where: parsed.data.userId ? { id: parsed.data.userId } : { email: parsed.data.email },
- });
- if (!targetUser) return notFoundResponse();
-
- const { delivery, offer } = await createCreditOffer({
- amountMicros: creditStringToMicros(String(parsed.data.amountDollars)),
- description: parsed.data.description,
- expiresAfterDays: parsed.data.expiresAfterDays,
- offeredByUserId: request.donkey.userId,
- user: targetUser,
- });
- if (delivery.state === "failed") {
- return NextResponse.json({ error: "not_sendable", message: delivery.error }, { status: 409 });
- }
-
- return NextResponse.json({
- amountDollars: parsed.data.amountDollars,
- delivery: delivery.state,
- offer: {
- closesAt: offer.closesAt?.toISOString() ?? null,
- emailSentAt: offer.emailSentAt?.toISOString() ?? null,
- expiresAfterDays: offer.expiresAfterDays,
- id: offer.id,
- },
- targetUser: { email: targetUser.email, id: targetUser.id },
- });
-});
diff --git a/site/src/app/api/experiments/[id]/assignments/route.ts b/site/src/app/api/experiments/[id]/assignments/route.ts
deleted file mode 100644
index a23e21cb..00000000
--- a/site/src/app/api/experiments/[id]/assignments/route.ts
+++ /dev/null
@@ -1,52 +0,0 @@
-import { NextResponse } from "next/server";
-import { z } from "zod";
-
-import { findExperiment, invalidResponse, listExperiments } from "@/lib/config/experimentList";
-import { parseVariants } from "@/lib/config/effective";
-import { notFoundResponse, withSuperUser } from "@/lib/donkey-api-auth";
-import { prisma } from "@/lib/prisma";
-
-type Params = { params: Promise<{ id: string }> };
-
-// An assignment written by hand: the account reads this variant from now on,
-// whatever the audience and the hash say; a null variant holds the account
-// out of this experiment. Manual rows are never counted in the results.
-const putSchema = z
- .object({
- email: z.email(),
- variant: z.string().min(1).nullable(),
- })
- .strict();
-
-export const PUT = withSuperUser(async (request, { params }: Params) => {
- const { id } = await params;
- const current = await findExperiment(id);
- if (!current) return notFoundResponse();
- const parsed = putSchema.safeParse(await request.json());
- if (!parsed.success) return invalidResponse(parsed.error.issues);
- const { email, variant } = parsed.data;
- if (variant !== null && !parseVariants(current.variants).some((v) => v.key === variant)) {
- return invalidResponse([{ path: ["variant"], message: `No variant "${variant}".` }]);
- }
- const user = await prisma.user.findUnique({ where: { email }, select: { id: true } });
- if (!user) return invalidResponse([{ path: ["email"], message: "No account has this email." }]);
- await prisma.experimentAssignment.upsert({
- where: { experimentId_userId: { experimentId: id, userId: user.id } },
- create: { experimentId: id, userId: user.id, variant, manual: true },
- update: { variant, manual: true },
- });
- return NextResponse.json({ experiments: await listExperiments() });
-});
-
-const deleteSchema = z.object({ userId: z.string().min(1) }).strict();
-
-// Drops the row; the next read assigns the account afresh, if it is eligible.
-export const DELETE = withSuperUser(async (request, { params }: Params) => {
- const { id } = await params;
- const current = await findExperiment(id);
- if (!current) return notFoundResponse();
- const parsed = deleteSchema.safeParse(await request.json());
- if (!parsed.success) return invalidResponse(parsed.error.issues);
- await prisma.experimentAssignment.deleteMany({ where: { experimentId: id, userId: parsed.data.userId } });
- return NextResponse.json({ experiments: await listExperiments() });
-});
diff --git a/site/src/app/api/experiments/[id]/route.ts b/site/src/app/api/experiments/[id]/route.ts
deleted file mode 100644
index f2d16a67..00000000
--- a/site/src/app/api/experiments/[id]/route.ts
+++ /dev/null
@@ -1,98 +0,0 @@
-import { NextResponse } from "next/server";
-import { z } from "zod";
-
-import { findExperiment, invalidResponse, listExperiments } from "@/lib/config/experimentList";
-import type { Prisma } from "@/generated/prisma/client";
-import {
- canTransition,
- experimentSchema,
- removedAssignedVariants,
- statusSchema,
- type ExperimentStatus,
-} from "@/lib/config/experiment";
-import { notFoundResponse, withSuperUser } from "@/lib/donkey-api-auth";
-import { prisma } from "@/lib/prisma";
-
-type Params = { params: Promise<{ id: string }> };
-
-// The whole definition, replaced. Once accounts hold a variant its key stays;
-// new variants may join.
-export const PUT = withSuperUser(async (request, { params }: Params) => {
- const { id } = await params;
- const current = await findExperiment(id);
- if (!current) return notFoundResponse();
- const parsed = experimentSchema.safeParse(await request.json());
- if (!parsed.success) return invalidResponse(parsed.error.issues);
- const input = parsed.data;
-
- if (input.key !== current.key) {
- const taken = await prisma.experiment.findUnique({ where: { key: input.key }, select: { id: true } });
- if (taken) return invalidResponse([{ path: ["key"], message: "An experiment with this key exists." }]);
- }
- const assigned = await prisma.experimentAssignment.groupBy({
- by: ["variant"],
- where: { experimentId: id },
- });
- const removed = removedAssignedVariants(
- input,
- assigned.flatMap((a) => (a.variant === null ? [] : [a.variant])),
- );
- if (removed.length > 0) {
- return invalidResponse([
- { path: ["variants"], message: `Accounts hold ${removed.join(", ")}; those variants must stay.` },
- ]);
- }
-
- await prisma.experiment.update({
- where: { id },
- data: {
- key: input.key,
- name: input.name,
- description: input.description,
- variants: input.variants as Prisma.InputJsonValue,
- audience: input.audience as Prisma.InputJsonValue,
- percent: input.percent,
- metrics: input.metrics as Prisma.InputJsonValue,
- actorUserId: request.donkey.userId,
- },
- });
- return NextResponse.json({ experiments: await listExperiments() });
-});
-
-const patchSchema = z.object({ status: statusSchema }).strict();
-
-export const PATCH = withSuperUser(async (request, { params }: Params) => {
- const { id } = await params;
- const current = await findExperiment(id);
- if (!current) return notFoundResponse();
- const parsed = patchSchema.safeParse(await request.json());
- if (!parsed.success) return invalidResponse(parsed.error.issues);
- const from = current.status as ExperimentStatus;
- const to = parsed.data.status;
- if (!canTransition(from, to)) {
- return invalidResponse([{ path: ["status"], message: `Cannot go from ${from} to ${to}.` }]);
- }
- const now = new Date();
- await prisma.experiment.update({
- where: { id },
- data: {
- status: to,
- actorUserId: request.donkey.userId,
- ...(to === "running" && !current.startedAt ? { startedAt: now } : {}),
- ...(to === "ended" ? { endedAt: now } : {}),
- },
- });
- return NextResponse.json({ experiments: await listExperiments() });
-});
-
-// A draft nobody was assigned to can go; anything that ran keeps its record.
-export const DELETE = withSuperUser(async (_request, { params }: Params) => {
- const { id } = await params;
- const current = await findExperiment(id);
- if (!current) return notFoundResponse();
- if (current.status !== "draft") {
- return invalidResponse([{ path: ["status"], message: "Only a draft can be deleted." }]);
- }
- await prisma.experiment.delete({ where: { id } });
- return NextResponse.json({ experiments: await listExperiments() });
-});
diff --git a/site/src/app/api/experiments/holdout/route.ts b/site/src/app/api/experiments/holdout/route.ts
deleted file mode 100644
index 1e5c718b..00000000
--- a/site/src/app/api/experiments/holdout/route.ts
+++ /dev/null
@@ -1,43 +0,0 @@
-import { NextResponse } from "next/server";
-import { z } from "zod";
-
-import { invalidResponse, listHoldout } from "@/lib/config/experimentList";
-import { withSuperUser } from "@/lib/donkey-api-auth";
-import { prisma } from "@/lib/prisma";
-
-// The accounts kept out of every experiment. A held-out account is never
-// assigned, reads the plain configuration even where it holds a row, and is
-// left out of every result.
-
-export const GET = withSuperUser(async () => {
- return NextResponse.json({ holdout: await listHoldout() });
-});
-
-const postSchema = z
- .object({
- email: z.email(),
- note: z.string().trim().max(200).nullable(),
- })
- .strict();
-
-export const POST = withSuperUser(async (request) => {
- const parsed = postSchema.safeParse(await request.json());
- if (!parsed.success) return invalidResponse(parsed.error.issues);
- const user = await prisma.user.findUnique({ where: { email: parsed.data.email }, select: { id: true } });
- if (!user) return invalidResponse([{ path: ["email"], message: "No account has this email." }]);
- await prisma.experimentHoldout.upsert({
- where: { userId: user.id },
- create: { userId: user.id, note: parsed.data.note, actorUserId: request.donkey.userId },
- update: { note: parsed.data.note, actorUserId: request.donkey.userId },
- });
- return NextResponse.json({ holdout: await listHoldout() });
-});
-
-const deleteSchema = z.object({ userId: z.string().min(1) }).strict();
-
-export const DELETE = withSuperUser(async (request) => {
- const parsed = deleteSchema.safeParse(await request.json());
- if (!parsed.success) return invalidResponse(parsed.error.issues);
- await prisma.experimentHoldout.deleteMany({ where: { userId: parsed.data.userId } });
- return NextResponse.json({ holdout: await listHoldout() });
-});
diff --git a/site/src/app/api/experiments/results/route.ts b/site/src/app/api/experiments/results/route.ts
index 68268513..4061a8ae 100644
--- a/site/src/app/api/experiments/results/route.ts
+++ b/site/src/app/api/experiments/results/route.ts
@@ -9,7 +9,7 @@ export const maxDuration = 300;
// The nightly results run for every live experiment. Vercel's cron
// authenticates with the CRON_SECRET bearer token; a run for one experiment
-// starts from su through POST /api/jobs.
+// starts from su.
export const GET = async (request: NextRequest) => {
if (!(await isVercelCron(request))) return notFoundResponse();
return NextResponse.json(await enqueueJob("experiment-results", {}, "vercel-cron"));
diff --git a/site/src/app/api/experiments/route.ts b/site/src/app/api/experiments/route.ts
deleted file mode 100644
index ceaa6b8a..00000000
--- a/site/src/app/api/experiments/route.ts
+++ /dev/null
@@ -1,35 +0,0 @@
-import { NextResponse } from "next/server";
-
-import { invalidResponse, listExperiments } from "@/lib/config/experimentList";
-import { experimentSchema } from "@/lib/config/experiment";
-import { withSuperUser } from "@/lib/donkey-api-auth";
-import { prisma } from "@/lib/prisma";
-import type { Prisma } from "@/generated/prisma/client";
-
-export const GET = withSuperUser(async () => {
- return NextResponse.json({ experiments: await listExperiments() });
-});
-
-// A new experiment starts as a draft; starting it is a status change.
-export const POST = withSuperUser(async (request) => {
- const parsed = experimentSchema.safeParse(await request.json());
- if (!parsed.success) return invalidResponse(parsed.error.issues);
- const input = parsed.data;
- const taken = await prisma.experiment.findUnique({ where: { key: input.key }, select: { id: true } });
- if (taken) {
- return invalidResponse([{ path: ["key"], message: "An experiment with this key exists." }]);
- }
- await prisma.experiment.create({
- data: {
- key: input.key,
- name: input.name,
- description: input.description,
- variants: input.variants as Prisma.InputJsonValue,
- audience: input.audience as Prisma.InputJsonValue,
- percent: input.percent,
- metrics: input.metrics as Prisma.InputJsonValue,
- actorUserId: request.donkey.userId,
- },
- });
- return NextResponse.json({ experiments: await listExperiments() });
-});
diff --git a/site/src/app/api/jobs/[jobId]/route.ts b/site/src/app/api/jobs/[jobId]/route.ts
deleted file mode 100644
index 67fdb814..00000000
--- a/site/src/app/api/jobs/[jobId]/route.ts
+++ /dev/null
@@ -1,13 +0,0 @@
-import { notFoundResponse, withSuperUser } from "@/lib/donkey-api-auth";
-import { jobStatusResponse } from "@/lib/jobs/queue";
-import { prisma } from "@/lib/prisma";
-
-type RouteContext = { params: Promise<{ jobId: string }> };
-
-// Poll one background job for its outcome.
-export const GET = withSuperUser(async (request, context: RouteContext) => {
- const { jobId } = await context.params;
- const job = await prisma.asyncJob.findUnique({ where: { id: jobId } });
- if (!job) return notFoundResponse();
- return jobStatusResponse(job);
-});
diff --git a/site/src/app/api/jobs/route.ts b/site/src/app/api/jobs/route.ts
deleted file mode 100644
index 37a1f35a..00000000
--- a/site/src/app/api/jobs/route.ts
+++ /dev/null
@@ -1,92 +0,0 @@
-import { NextResponse } from "next/server";
-import { z } from "zod";
-
-import type { Prisma } from "@/generated/prisma/client";
-import { withSuperUser } from "@/lib/donkey-api-auth";
-import { enqueueJob, healJob } from "@/lib/jobs/queue";
-import { jobKinds } from "@/lib/jobs/registry";
-import { prisma } from "@/lib/prisma";
-
-// Without a queue configured (local dev) the job runs inline before the
-// response; give it room.
-export const maxDuration = 300;
-
-// The most recent jobs, newest first, each self-healed on the way out so a
-// lost message republishes and a crashed execution reads as an error rather
-// than running forever.
-export const GET = withSuperUser(async () => {
- const rows = await prisma.asyncJob.findMany({
- orderBy: { createdAt: "desc" },
- take: 10,
- });
- const jobs = await Promise.all(rows.map(healJob));
- return NextResponse.json({
- jobs: jobs.map((job) => ({
- id: job.id,
- kind: job.kind,
- state: job.state,
- payload: job.payload,
- result: job.result ?? undefined,
- error: job.error ?? undefined,
- createdAt: job.createdAt.toISOString(),
- notBefore: job.notBefore?.toISOString(),
- })),
- });
-});
-
-const jobRequestSchema = z
- .object({
- kind: z.string().min(1),
- payload: z.unknown(),
- })
- .strict();
-
-// Start a background job. The kind names an executor in the registry, and the
-// payload must match that kind's schema. The caller polls /api/jobs/[jobId]
-// for the outcome.
-export const POST = withSuperUser(async (request) => {
- const parsed = jobRequestSchema.safeParse(await request.json());
- if (!parsed.success) {
- return NextResponse.json(
- {
- error: "Invalid request",
- issues: parsed.error.issues.map((issue) => ({
- path: issue.path.join("."),
- message: issue.message,
- })),
- },
- { status: 400 },
- );
- }
-
- const kind = jobKinds[parsed.data.kind];
- if (!kind) {
- return NextResponse.json(
- {
- error: "Invalid request",
- message: `Unknown job kind "${parsed.data.kind}".`,
- },
- { status: 400 },
- );
- }
- const payload = kind.payload.safeParse(parsed.data.payload);
- if (!payload.success) {
- return NextResponse.json(
- {
- error: "Invalid request",
- issues: payload.error.issues.map((issue) => ({
- path: issue.path.join("."),
- message: issue.message,
- })),
- },
- { status: 400 },
- );
- }
-
- const { jobId } = await enqueueJob(
- parsed.data.kind,
- payload.data as Prisma.InputJsonValue,
- request.donkey.userId,
- );
- return NextResponse.json({ jobId });
-});
diff --git a/site/src/app/api/marketing/outreach/counts/route.ts b/site/src/app/api/marketing/outreach/counts/route.ts
deleted file mode 100644
index e6002b99..00000000
--- a/site/src/app/api/marketing/outreach/counts/route.ts
+++ /dev/null
@@ -1,46 +0,0 @@
-import { NextResponse } from "next/server";
-
-import { withSuperUser } from "@/lib/donkey-api-auth";
-import {
- CREDIT_SPENDERS_CAMPAIGN,
- OUTREACH_REASONS,
- OUTREACH_STATUSES,
- type OutreachReason,
- type OutreachStatus,
-} from "@/lib/marketing/campaigns";
-import { prisma } from "@/lib/prisma";
-
-// How many rows each list holds, so the filters can say it. It is its own read
-// because the number belongs to every list at once: the totals stay put while a
-// list is being fetched, and one action refreshes all four.
-export const GET = withSuperUser(async () => {
- const [grouped, ...byReason] = await Promise.all([
- prisma.userOutreach.groupBy({
- _count: { _all: true },
- by: ["status"],
- where: { campaign: CREDIT_SPENDERS_CAMPAIGN },
- }),
- // How many of the accounts still to email carry each reason; one account
- // can count under several.
- ...OUTREACH_REASONS.map((reason) =>
- prisma.userOutreach.count({
- where: { campaign: CREDIT_SPENDERS_CAMPAIGN, reasons: { has: reason }, status: "todo" },
- }),
- ),
- ]);
-
- const counts = Object.fromEntries(
- OUTREACH_STATUSES.map((status) => [status, 0]),
- ) as Record<OutreachStatus, number>;
- for (const entry of grouped) {
- if ((OUTREACH_STATUSES as readonly string[]).includes(entry.status)) {
- counts[entry.status as OutreachStatus] = entry._count._all;
- }
- }
-
- const reasons = Object.fromEntries(
- OUTREACH_REASONS.map((reason, i) => [reason, byReason[i]]),
- ) as Record<OutreachReason, number>;
-
- return NextResponse.json({ counts, reasons });
-});
diff --git a/site/src/app/api/marketing/outreach/route.ts b/site/src/app/api/marketing/outreach/route.ts
deleted file mode 100644
index 5aa8b83f..00000000
--- a/site/src/app/api/marketing/outreach/route.ts
+++ /dev/null
@@ -1,394 +0,0 @@
-import { NextResponse } from "next/server";
-import { z } from "zod";
-
-import { formatBytes } from "@/lib/bytes";
-import { creditMicrosToString, zeroCreditMicros } from "@/lib/credits/amounts";
-import { creditOfferTermsSchema, type CreditOfferTerms } from "@/lib/credits/offerTerms";
-import { notFoundResponse, withSuperUser } from "@/lib/donkey-api-auth";
-import {
- CREDIT_SPENDERS_CAMPAIGN,
- OUTREACH_REASONS,
- OUTREACH_STATUSES,
- PICKED_REASON,
-} from "@/lib/marketing/campaigns";
-import { deliverEmail } from "@/lib/email/outbox";
-import { lastActiveByUser } from "@/lib/marketing/lastActive";
-import {
- firstNameOf,
- isOfferPlaceholder,
- UnknownPlaceholderError,
- type OutreachVars,
-} from "@/lib/marketing/placeholders";
-import { promotionIdempotencyKey } from "@/lib/marketing/promotions";
-import { sendIssue } from "@/lib/marketing/promotionSave";
-import { outreachIdempotencyKey } from "@/lib/marketing/send-outreach";
-import { OutreachCopyError, renderOutreachCopy } from "@/lib/marketing/outreachCopy";
-import { prisma } from "@/lib/prisma";
-
-const listQuerySchema = z.object({
- q: z.string().trim().min(1).max(200).optional(),
- reason: z.enum(OUTREACH_REASONS).optional(),
- status: z.enum(OUTREACH_STATUSES).optional(),
-});
-
-const noteSchema = z.object({
- body: z.string().trim().min(1).max(5000),
- outreachId: z.string().trim().min(1),
- subject: z.string().trim().min(1).max(200),
- unsubscribeLink: z.boolean(),
- creditOffer: creditOfferTermsSchema.nullable().default(null),
-});
-
-// Five shapes: start a conversation with a user who is on the list, mail
-// the note to yourself first, send them a promotion as it stands, file a row
-// that is already on it, or put an account on the list by its address.
-const actionSchema = z.union([
- z
- .object({
- action: z.literal("promote"),
- outreachId: z.string().trim().min(1),
- promotionId: z.string().trim().min(1),
- })
- .strict(),
- noteSchema.extend({ action: z.literal("send"), trackReplies: z.boolean() }).strict(),
- noteSchema.extend({ action: z.literal("test") }).strict(),
- z.object({ action: z.literal("add"), email: z.string().trim().min(1).max(320) }).strict(),
- z
- .object({
- action: z.enum(["ignore", "unignore", "replied"]),
- outreachId: z.string().trim().min(1),
- })
- .strict(),
-]);
-
-const rowSelect = {
- balanceMicros: true,
- firstSentAt: true,
- id: true,
- lastActiveAt: true,
- lastSentAt: true,
- paymentFailedAt: true,
- ranOutAt: true,
- reasons: true,
- repliedAt: true,
- sentCount: true,
- spentMicros: true,
- status: true,
- storageBytes: true,
- user: { select: { createdAt: true, email: true, id: true, name: true } },
-} as const;
-
-type OutreachRow = {
- balanceMicros: bigint;
- firstSentAt: Date | null;
- id: string;
- lastActiveAt: Date | null;
- lastSentAt: Date | null;
- paymentFailedAt: Date | null;
- ranOutAt: Date | null;
- reasons: string[];
- repliedAt: Date | null;
- sentCount: number;
- spentMicros: bigint;
- status: string;
- storageBytes: bigint;
- user: { createdAt: Date; email: string; id: string; name: string };
-};
-
-// Micros and byte counts are BigInt and dates are Date; the client wants
-// neither.
-function serialize(row: OutreachRow) {
- return {
- balance: creditMicrosToString(row.balanceMicros),
- email: row.user.email,
- firstSentAt: row.firstSentAt?.toISOString() ?? null,
- id: row.id,
- lastActiveAt: row.lastActiveAt?.toISOString() ?? null,
- lastSentAt: row.lastSentAt?.toISOString() ?? null,
- name: row.user.name,
- paymentFailedAt: row.paymentFailedAt?.toISOString() ?? null,
- ranOutAt: row.ranOutAt?.toISOString() ?? null,
- reasons: row.reasons,
- repliedAt: row.repliedAt?.toISOString() ?? null,
- sentCount: row.sentCount,
- signedUpAt: row.user.createdAt.toISOString(),
- spent: creditMicrosToString(row.spentMicros),
- status: row.status,
- storageBytes: row.storageBytes.toString(),
- userId: row.user.id,
- };
-}
-
-// The list is whatever the nightly outreach-scan job wrote, so this reads one
-// table and touches no credit data.
-export const GET = withSuperUser(async (request) => {
- const params = new URL(request.url).searchParams;
- const parsed = listQuerySchema.safeParse({
- q: params.get("q") ?? undefined,
- reason: params.get("reason") ?? undefined,
- status: params.get("status") ?? undefined,
- });
- if (!parsed.success) {
- return NextResponse.json({ error: "Invalid query" }, { status: 400 });
- }
-
- // A search matches name and email in the database, so an account buried
- // past the page cap is still found. The counts say how many matches every
- // status holds; the rows are the first page of them, one status when the
- // client pins a tab.
- if (parsed.data.q !== undefined) {
- const matching = {
- campaign: CREDIT_SPENDERS_CAMPAIGN,
- user: {
- OR: [
- { email: { contains: parsed.data.q, mode: "insensitive" as const } },
- { name: { contains: parsed.data.q, mode: "insensitive" as const } },
- ],
- },
- };
- const [rows, grouped] = await Promise.all([
- prisma.userOutreach.findMany({
- orderBy: { lastActiveAt: { nulls: "last", sort: "desc" } },
- select: rowSelect,
- take: 200,
- where: parsed.data.status
- ? { ...matching, status: parsed.data.status }
- : matching,
- }),
- prisma.userOutreach.groupBy({
- _count: true,
- by: ["status"],
- where: matching,
- }),
- ]);
- const counts = Object.fromEntries(
- OUTREACH_STATUSES.map((status) => [status, 0]),
- ) as Record<(typeof OUTREACH_STATUSES)[number], number>;
- for (const group of grouped) {
- if (group.status in counts) {
- counts[group.status as keyof typeof counts] = group._count;
- }
- }
- return NextResponse.json({ counts, rows: rows.map(serialize) });
- }
-
- // Each list is about a different moment: when they last used the product,
- // when the note went out, when they answered, when it was filed away.
- const orderBy = {
- ignored: { ignoredAt: "desc" },
- replied: { repliedAt: "desc" },
- sent: { lastSentAt: "desc" },
- todo: { lastActiveAt: "desc" },
- } as const;
- const status = parsed.data.status ?? "todo";
-
- // A reason narrows the list to the accounts the scan listed for it.
- const rows = await prisma.userOutreach.findMany({
- orderBy: orderBy[status],
- select: rowSelect,
- take: 200,
- where: {
- campaign: CREDIT_SPENDERS_CAMPAIGN,
- status,
- ...(parsed.data.reason ? { reasons: { has: parsed.data.reason } } : {}),
- },
- });
-
- return NextResponse.json({ rows: rows.map(serialize) });
-});
-
-// The words are filled once here with the row's own values, so a typo in a
-// placeholder, or an offer placeholder in a note that carries no offer, is
-// refused before anything is queued; so is an offer the words never link to,
-// since the link is the only way the person reaches it.
-function wordsIssue(subject: string, body: string, vars: OutreachVars, offer: CreditOfferTerms | null): string | null {
- try {
- renderOutreachCopy(subject, body, vars, offer);
- return null;
- } catch (error) {
- if (error instanceof OutreachCopyError) return error.message;
- if (!(error instanceof UnknownPlaceholderError)) throw error;
- return isOfferPlaceholder(error.placeholder)
- ? `Turn on the credit offer to use {{${error.placeholder}}}.`
- : error.message;
- }
-}
-
-/** Puts an account on the list by hand, with the numbers the list shows read
- * now. An account already on it comes back as it is, whatever its status. */
-async function addByEmail(email: string) {
- const user = await prisma.user.findFirst({
- select: { id: true },
- where: { email: { equals: email, mode: "insensitive" } },
- });
- if (!user) return null;
- const [account, storage, lastActiveBy] = await Promise.all([
- prisma.userCreditAccount.findUnique({
- select: { balanceMicros: true, lifetimeChargedMicros: true },
- where: { userId: user.id },
- }),
- prisma.cutStorageUsage.findUnique({ select: { bytes: true }, where: { userId: user.id } }),
- lastActiveByUser([user.id]),
- ]);
- return prisma.userOutreach.upsert({
- create: {
- balanceMicros: account?.balanceMicros ?? zeroCreditMicros,
- campaign: CREDIT_SPENDERS_CAMPAIGN,
- lastActiveAt: lastActiveBy.get(user.id) ?? null,
- reasons: [PICKED_REASON],
- spentMicros: account?.lifetimeChargedMicros ?? zeroCreditMicros,
- status: "todo",
- storageBytes: storage?.bytes ?? BigInt(0),
- userId: user.id,
- },
- select: rowSelect,
- update: {},
- where: { userId_campaign: { campaign: CREDIT_SPENDERS_CAMPAIGN, userId: user.id } },
- });
-}
-
-export const POST = withSuperUser(async (request) => {
- const parsed = actionSchema.safeParse(await request.json());
- if (!parsed.success) {
- return NextResponse.json(
- {
- error: "Invalid request",
- issues: parsed.error.issues.map((issue) => ({
- message: issue.message,
- path: issue.path.join("."),
- })),
- },
- { status: 400 },
- );
- }
-
- if (parsed.data.action === "add") {
- const row = await addByEmail(parsed.data.email);
- if (!row) return notFoundResponse();
- return NextResponse.json({ row: serialize(row) });
- }
-
- const outreach = await prisma.userOutreach.findUnique({
- select: rowSelect,
- where: { id: parsed.data.outreachId },
- });
- if (!outreach) {
- return notFoundResponse();
- }
-
- const now = new Date();
- const actorUserId = request.donkey.userId;
-
- if (parsed.data.action === "send" || parsed.data.action === "test") {
- const attempt = outreach.sentCount + 1;
- const vars = {
- balance: creditMicrosToString(outreach.balanceMicros),
- email: outreach.user.email,
- firstName: firstNameOf(outreach.user.name),
- name: outreach.user.name,
- spent: creditMicrosToString(outreach.spentMicros),
- storage: formatBytes(Number(outreach.storageBytes)),
- };
- const issue = wordsIssue(
- parsed.data.subject,
- parsed.data.body,
- parsed.data.creditOffer ? { ...vars, claimUrl: "", claimBy: "" } : vars,
- parsed.data.creditOffer,
- );
- if (issue) {
- return NextResponse.json({ error: "Invalid request", issues: [{ message: issue, path: "body" }] }, { status: 400 });
- }
- // A test goes to the operator with the row's values filled in, so the
- // note reads as the person would read it; the row is left as it is.
- if (parsed.data.action === "test") {
- const operator = await prisma.user.findUnique({ select: { email: true }, where: { id: actorUserId } });
- if (!operator) return notFoundResponse();
- const delivery = await deliverEmail({
- idempotencyKey: `outreach-test:${outreach.id}:${Date.now()}`,
- kind: "outreach-test",
- payload: {
- actorUserId,
- attempt,
- body: parsed.data.body,
- creditOffer: parsed.data.creditOffer,
- outreachId: outreach.id,
- subject: parsed.data.subject,
- trackReplies: false,
- unsubscribeLink: parsed.data.unsubscribeLink,
- vars,
- },
- userId: actorUserId,
- });
- if (delivery.state === "failed") {
- return NextResponse.json({ error: "not_sendable", message: delivery.error }, { status: 409 });
- }
- return NextResponse.json({ delivery: delivery.state, row: serialize(outreach), sentTo: operator.email });
- }
- const delivery = await deliverEmail({
- idempotencyKey: outreachIdempotencyKey(outreach.id, attempt),
- kind: "outreach",
- payload: {
- actorUserId,
- attempt,
- body: parsed.data.body,
- creditOffer: parsed.data.creditOffer,
- outreachId: outreach.id,
- subject: parsed.data.subject,
- trackReplies: parsed.data.trackReplies,
- unsubscribeLink: parsed.data.unsubscribeLink,
- vars,
- },
- userId: outreach.user.id,
- });
- if (delivery.state === "failed") {
- return NextResponse.json({ error: "not_sendable", message: delivery.error }, { status: 409 });
- }
- const row = await prisma.userOutreach.findUniqueOrThrow({ select: rowSelect, where: { id: outreach.id } });
- return NextResponse.json({ delivery: delivery.state, row: serialize(row) });
- }
-
- // The promotion goes out as the segment send would send it, under the same
- // per-person key, so it counts in the promotion and a later segment send
- // skips this person. Someone it already reached is refused, since the key
- // stands for the mail that went.
- if (parsed.data.action === "promote") {
- const promotion = await prisma.promotion.findUnique({ where: { id: parsed.data.promotionId } });
- if (!promotion) return notFoundResponse();
- const refused = sendIssue(promotion);
- if (refused) return refused;
- const idempotencyKey = promotionIdempotencyKey(promotion.id, outreach.user.id);
- const earlier = await prisma.emailSend.findUnique({ select: { state: true }, where: { idempotencyKey } });
- if (earlier && earlier.state !== "failed") {
- const message =
- earlier.state === "sent" ? "They already received this promotion." : "This promotion is already on its way to them.";
- return NextResponse.json({ error: "Invalid request", issues: [{ message, path: "promotion" }] }, { status: 400 });
- }
- if (earlier) await prisma.emailSend.delete({ where: { idempotencyKey } });
- const delivery = await deliverEmail({
- idempotencyKey,
- kind: "promotion-hand",
- payload: { actorUserId, outreachId: outreach.id, promotionId: promotion.id },
- promotionId: promotion.id,
- userId: outreach.user.id,
- });
- if (delivery.state === "failed") {
- return NextResponse.json({ error: "not_sendable", message: delivery.error }, { status: 409 });
- }
- const row = await prisma.userOutreach.findUniqueOrThrow({ select: rowSelect, where: { id: outreach.id } });
- return NextResponse.json({ delivery: delivery.state, row: serialize(row) });
- }
-
- const data =
- parsed.data.action === "ignore"
- ? { actorUserId, ignoredAt: now, status: "ignored" }
- : parsed.data.action === "unignore"
- ? { actorUserId, ignoredAt: null, status: "todo" }
- : { actorUserId, repliedAt: outreach.repliedAt ?? now, status: "replied" };
-
- const row = await prisma.userOutreach.update({
- data,
- select: rowSelect,
- where: { id: outreach.id },
- });
- return NextResponse.json({ row: serialize(row) });
-});
diff --git a/site/src/app/api/marketing/outreach/scan/route.ts b/site/src/app/api/marketing/outreach/scan/route.ts
index b89e33c1..6cba4c2a 100644
--- a/site/src/app/api/marketing/outreach/scan/route.ts
+++ b/site/src/app/api/marketing/outreach/scan/route.ts
@@ -8,8 +8,7 @@ import { enqueueJob } from "@/lib/jobs/queue";
export const maxDuration = 300;
// The nightly outreach scan. Vercel's cron authenticates with the CRON_SECRET
-// bearer token; the Outreach tab's Scan now button goes through the super-user
-// POST /api/jobs instead.
+// bearer token; a manual scan starts from su.
export const GET = async (request: NextRequest) => {
if (!(await isVercelCron(request))) return notFoundResponse();
return NextResponse.json(await enqueueJob("outreach-scan", {}, "vercel-cron"));
diff --git a/site/src/app/api/marketing/templates/route.ts b/site/src/app/api/marketing/templates/route.ts
deleted file mode 100644
index 8fd8532a..00000000
--- a/site/src/app/api/marketing/templates/route.ts
+++ /dev/null
@@ -1,120 +0,0 @@
-import { NextResponse } from "next/server";
-import { z } from "zod";
-
-import { Prisma } from "@/generated/prisma/client";
-import { creditOfferTermsSchema } from "@/lib/credits/offerTerms";
-import { notFoundResponse, withSuperUser } from "@/lib/donkey-api-auth";
-import { prisma } from "@/lib/prisma";
-
-// A template is written outside the repo and saved here, so adding one never
-// needs a deploy. Same length limits as a send, since a template is only ever
-// the starting text of one.
-const saveSchema = z
- .object({
- body: z.string().trim().min(1).max(5000),
- name: z.string().trim().min(1).max(80),
- subject: z.string().trim().min(1).max(200),
- trackReplies: z.boolean(),
- unsubscribeLink: z.boolean(),
- // The credit offer the template starts a note with, if any.
- promotion: creditOfferTermsSchema.nullable().optional(),
- })
- .strict();
-
-const templateSelect = {
- body: true,
- id: true,
- name: true,
- subject: true,
- trackReplies: true,
- unsubscribeLink: true,
- updatedAt: true,
- promotion: true,
-} as const;
-
-type TemplateRow = {
- body: string;
- id: string;
- name: string;
- subject: string;
- trackReplies: boolean;
- unsubscribeLink: boolean;
- updatedAt: Date;
- promotion: unknown;
-};
-
-function serialize(row: TemplateRow) {
- return {
- body: row.body,
- id: row.id,
- name: row.name,
- subject: row.subject,
- trackReplies: row.trackReplies,
- unsubscribeLink: row.unsubscribeLink,
- updatedAt: row.updatedAt.toISOString(),
- promotion: row.promotion,
- };
-}
-
-export const GET = withSuperUser(async () => {
- const templates = await prisma.outreachTemplate.findMany({
- orderBy: { name: "asc" },
- select: templateSelect,
- });
- return NextResponse.json({ templates: templates.map(serialize) });
-});
-
-// Saving under a name that already exists rewrites it, so editing a template is
-// the same action as writing one.
-export const POST = withSuperUser(async (request) => {
- const parsed = saveSchema.safeParse(await request.json());
- if (!parsed.success) {
- return NextResponse.json(
- {
- error: "Invalid request",
- issues: parsed.error.issues.map((issue) => ({
- message: issue.message,
- path: issue.path.join("."),
- })),
- },
- { status: 400 },
- );
- }
-
- const { body, name, subject, trackReplies, unsubscribeLink } = parsed.data;
- const promotion = parsed.data.promotion ? (parsed.data.promotion as Prisma.InputJsonValue) : Prisma.DbNull;
- const template = await prisma.outreachTemplate.upsert({
- create: {
- actorUserId: request.donkey.userId,
- body,
- name,
- subject,
- trackReplies,
- unsubscribeLink,
- promotion,
- },
- select: templateSelect,
- update: {
- actorUserId: request.donkey.userId,
- body,
- subject,
- trackReplies,
- unsubscribeLink,
- promotion,
- },
- where: { name },
- });
- return NextResponse.json({ template: serialize(template) });
-});
-
-export const DELETE = withSuperUser(async (request) => {
- const id = new URL(request.url).searchParams.get("id");
- if (!id) {
- return NextResponse.json({ error: "Missing id" }, { status: 400 });
- }
- const { count } = await prisma.outreachTemplate.deleteMany({ where: { id } });
- if (count === 0) {
- return notFoundResponse();
- }
- return NextResponse.json({ ok: true });
-});
diff --git a/site/src/app/api/settings/route.ts b/site/src/app/api/settings/route.ts
deleted file mode 100644
index 9114a0f4..00000000
--- a/site/src/app/api/settings/route.ts
+++ /dev/null
@@ -1,80 +0,0 @@
-import { NextResponse } from "next/server";
-import { z } from "zod";
-
-import type { Prisma } from "@/generated/prisma/client";
-import { SETTINGS, SETTING_KEYS, isSettingKey } from "@/lib/config/registry";
-import { notFoundResponse, withSuperUser } from "@/lib/donkey-api-auth";
-import { prisma } from "@/lib/prisma";
-
-// The settings registry as su sees it: every declared key with its default,
-// its override when one exists, and its schema for the form. Writes parse
-// against the key's own schema, so a stored override always reads back.
-
-const putSchema = z.object({ key: z.string(), value: z.unknown() }).strict();
-
-async function listSettings() {
- const rows = await prisma.settingOverride.findMany();
- const overrides = new Map(rows.map((row) => [row.key, row]));
- return SETTING_KEYS.map((key) => {
- const def = SETTINGS[key];
- const row = overrides.get(key);
- const parsed = row ? def.schema.safeParse(row.value) : null;
- return {
- key,
- title: def.title,
- description: def.description,
- public: def.public,
- default: def.default,
- value: parsed?.success ? parsed.data : def.default,
- overridden: row !== undefined,
- invalid: parsed !== null && !parsed.success,
- updatedAt: row?.updatedAt.toISOString() ?? null,
- schema: z.toJSONSchema(def.schema),
- };
- });
-}
-
-export const GET = withSuperUser(async () => {
- return NextResponse.json({ settings: await listSettings() });
-});
-
-export const PUT = withSuperUser(async (request) => {
- const parsed = putSchema.safeParse(await request.json());
- if (!parsed.success || !isSettingKey(parsed.data.key)) {
- return NextResponse.json(
- { error: "Invalid request", issues: [{ path: "key", message: "Unknown setting." }] },
- { status: 400 },
- );
- }
- const { key } = parsed.data;
- const value = SETTINGS[key].schema.safeParse(parsed.data.value);
- if (!value.success) {
- return NextResponse.json(
- {
- error: "Invalid request",
- issues: value.error.issues.map((issue) => ({
- message: issue.message,
- path: ["value", ...issue.path].join("."),
- })),
- },
- { status: 400 },
- );
- }
- const json = value.data as Prisma.InputJsonValue;
- await prisma.settingOverride.upsert({
- where: { key },
- create: { key, value: json, actorUserId: request.donkey.userId },
- update: { value: json, actorUserId: request.donkey.userId },
- });
- return NextResponse.json({ settings: await listSettings() });
-});
-
-export const DELETE = withSuperUser(async (request) => {
- const key = new URL(request.url).searchParams.get("key");
- if (!key || !isSettingKey(key)) {
- return NextResponse.json({ error: "Missing key" }, { status: 400 });
- }
- const { count } = await prisma.settingOverride.deleteMany({ where: { key } });
- if (count === 0) return notFoundResponse();
- return NextResponse.json({ settings: await listSettings() });
-});
diff --git a/site/src/app/api/su/blog/posts/[id]/generate/route.ts b/site/src/app/api/su/blog/posts/[id]/generate/route.ts
deleted file mode 100644
index b48b873f..00000000
--- a/site/src/app/api/su/blog/posts/[id]/generate/route.ts
+++ /dev/null
@@ -1,101 +0,0 @@
-import { NextResponse } from "next/server";
-import { z } from "zod";
-
-import { recordFailedInferenceUsage, recordInferenceUsage } from "@/lib/credits/inference";
-import { adminPost } from "@/lib/blog/admin";
-import {
- generateBlogDetails,
- generateBlogPicture,
- IMAGE_MODEL,
- TEXT_MODEL,
- type BlogDetails,
-} from "@/lib/blog/generate";
-import { storeBlogImage } from "@/lib/blog/images";
-import { revalidateBlogLater } from "@/lib/blog/revalidate";
-import { invalidResponse } from "@/lib/config/experimentList";
-import { InferenceProviderError, type JsonValue } from "@/lib/inference/providers";
-import { notFoundResponse, shouldBypassDonkeyInferenceCredits, withSuperUser } from "@/lib/donkey-api-auth";
-import { prisma } from "@/lib/prisma";
-
-type Params = { params: Promise<{ id: string }> };
-const idSchema = z.string().trim().min(1);
-
-const ROUTE = "/api/su/blog/posts/[id]/generate";
-const PROVIDER = "gemini";
-
-// The editor sends the article as it stands in the form, saved or not.
-const bodySchema = z
- .object({
- title: z.string().trim().max(200),
- body: z.string().trim().min(1, "Write the article first.").max(2_000_000),
- })
- .strict();
-
-// Fills the details from the article: the copy comes back for the form, the
-// picture is stored as the header and the thumbnail. Every model call is
-// recorded against the editor's account as included usage.
-export const POST = withSuperUser(async (request, { params }: Params) => {
- const id = idSchema.safeParse((await params).id);
- if (!id.success) return notFoundResponse();
- const parsed = bodySchema.safeParse(await request.json());
- if (!parsed.success) return invalidResponse(parsed.error.issues);
- const existing = await prisma.blogPost.findUnique({ select: { id: true }, where: { id: id.data } });
- if (!existing) return notFoundResponse();
- // A dev-bypass caller has no account row to record against.
- const recorded = !shouldBypassDonkeyInferenceCredits(request.donkey);
- const usageOf = (requestKind: string, model: string) => ({
- billingMode: "included" as const,
- clientId: null,
- model,
- provider: PROVIDER,
- requestKind,
- route: ROUTE,
- userId: request.donkey.userId,
- });
- const succeeded = async (requestKind: string, model: string, usage: JsonValue) => {
- if (recorded) await recordInferenceUsage({ ...usageOf(requestKind, model), status: "succeeded", usage });
- };
- const failed = async (requestKind: string, model: string) => {
- if (recorded) await recordFailedInferenceUsage({ ...usageOf(requestKind, model), errorCode: "provider_error" });
- };
-
- let details: BlogDetails;
- try {
- const generated = await generateBlogDetails(parsed.data.title, parsed.data.body);
- details = generated.value;
- await succeeded("blog_details", TEXT_MODEL, generated.usage);
- } catch (error) {
- await failed("blog_details", TEXT_MODEL);
- return failure(error);
- }
-
- let picture: Buffer;
- try {
- const generated = await generateBlogPicture(details.imagePrompt);
- picture = generated.value;
- await succeeded("blog_picture", IMAGE_MODEL, generated.usage);
- } catch (error) {
- await failed("blog_picture", IMAGE_MODEL);
- return failure(error);
- }
-
- const [header, thumbnail] = await Promise.all([
- storeBlogImage(existing.id, picture, "header"),
- storeBlogImage(existing.id, picture, "thumbnail"),
- ]);
- const row = await prisma.blogPost.update({
- where: { id: existing.id },
- data: { headerKey: header.key, headerFocus: null, thumbnailKey: thumbnail.key, thumbnailFocus: null },
- });
- revalidateBlogLater([row.slug]);
-
- const { seoTitle, excerpt, summary, tags, keywords, headerAlt } = details;
- return NextResponse.json({ post: adminPost(row), details: { seoTitle, excerpt, summary, tags, keywords, headerAlt } });
-});
-
-function failure(error: unknown) {
- if (error instanceof InferenceProviderError) {
- return NextResponse.json({ error: error.message }, { status: error.statusCode ?? 502 });
- }
- throw error;
-}
diff --git a/site/src/app/api/su/blog/posts/[id]/images/remove/route.ts b/site/src/app/api/su/blog/posts/[id]/images/remove/route.ts
deleted file mode 100644
index 665ba830..00000000
--- a/site/src/app/api/su/blog/posts/[id]/images/remove/route.ts
+++ /dev/null
@@ -1,29 +0,0 @@
-import { NextResponse } from "next/server";
-import { z } from "zod";
-
-import { adminPost } from "@/lib/blog/admin";
-import { revalidateBlogLater } from "@/lib/blog/revalidate";
-import { invalidResponse } from "@/lib/config/experimentList";
-import { notFoundResponse, withSuperUser } from "@/lib/donkey-api-auth";
-import { prisma } from "@/lib/prisma";
-
-type Params = { params: Promise<{ id: string }> };
-const idSchema = z.string().trim().min(1);
-const bodySchema = z.object({ kind: z.enum(["header", "thumbnail"]) }).strict();
-
-// Clears the header or thumbnail from the row. The object stays under the
-// post's prefix, content-addressed, and goes when the post does.
-export const POST = withSuperUser(async (request, { params }: Params) => {
- const id = idSchema.safeParse((await params).id);
- if (!id.success) return notFoundResponse();
- const parsed = bodySchema.safeParse(await request.json());
- if (!parsed.success) return invalidResponse(parsed.error.issues);
- const existing = await prisma.blogPost.findUnique({ select: { id: true }, where: { id: id.data } });
- if (!existing) return notFoundResponse();
- const row = await prisma.blogPost.update({
- where: { id: existing.id },
- data: parsed.data.kind === "header" ? { headerKey: null, headerAlt: null, headerFocus: null } : { thumbnailKey: null, thumbnailFocus: null },
- });
- revalidateBlogLater([row.slug]);
- return NextResponse.json({ post: adminPost(row) });
-});
diff --git a/site/src/app/api/su/blog/posts/[id]/images/route.ts b/site/src/app/api/su/blog/posts/[id]/images/route.ts
deleted file mode 100644
index 274c59a9..00000000
--- a/site/src/app/api/su/blog/posts/[id]/images/route.ts
+++ /dev/null
@@ -1,57 +0,0 @@
-import { NextResponse } from "next/server";
-import { z } from "zod";
-
-import { del, getObject } from "@/cut/server/cloud/r2";
-import { adminPost } from "@/lib/blog/admin";
-import { storeBlogImage } from "@/lib/blog/images";
-import { blogPrefix } from "@/lib/blog/keys";
-import { revalidateBlogLater } from "@/lib/blog/revalidate";
-import { invalidResponse } from "@/lib/config/experimentList";
-import { notFoundResponse, withSuperUser } from "@/lib/donkey-api-auth";
-import { prisma } from "@/lib/prisma";
-
-type Params = { params: Promise<{ id: string }> };
-const idSchema = z.string().trim().min(1);
-
-const bodySchema = z
- .object({
- uploadKey: z.string().min(1),
- kind: z.enum(["header", "thumbnail", "inline"]),
- })
- .strict();
-
-// Turns an upload into the image the pages serve: read from the scratch key,
-// encoded to the kind's size, written under its own hash, and the scratch
-// deleted. A header or thumbnail is also set on the row.
-export const POST = withSuperUser(async (request, { params }: Params) => {
- const id = idSchema.safeParse((await params).id);
- if (!id.success) return notFoundResponse();
- const parsed = bodySchema.safeParse(await request.json());
- if (!parsed.success) return invalidResponse(parsed.error.issues);
- const existing = await prisma.blogPost.findUnique({ select: { id: true, slug: true }, where: { id: id.data } });
- if (!existing) return notFoundResponse();
- const { uploadKey, kind } = parsed.data;
- // A route reads only under its own prefix, so a key from the body cannot
- // reach into another post or another user's media.
- if (!uploadKey.startsWith(`${blogPrefix(existing.id)}uploads/`)) {
- return invalidResponse([{ path: ["uploadKey"], message: "Not an upload for this post." }]);
- }
- const upload = await getObject(uploadKey);
- if (!upload) return invalidResponse([{ path: ["uploadKey"], message: "The upload was not found." }]);
-
- const image = await storeBlogImage(existing.id, upload.bytes, kind);
- await del([uploadKey]);
-
- if (kind === "inline") return NextResponse.json({ image });
-
- const row = await prisma.blogPost.update({
- where: { id: existing.id },
- // A new picture starts centred; the old focus named a point in the old one.
- data:
- kind === "header"
- ? { headerKey: image.key, headerFocus: null }
- : { thumbnailKey: image.key, thumbnailFocus: null },
- });
- revalidateBlogLater([row.slug]);
- return NextResponse.json({ image, post: adminPost(row) });
-});
diff --git a/site/src/app/api/su/blog/posts/[id]/publish/route.ts b/site/src/app/api/su/blog/posts/[id]/publish/route.ts
deleted file mode 100644
index d9ccb2a4..00000000
--- a/site/src/app/api/su/blog/posts/[id]/publish/route.ts
+++ /dev/null
@@ -1,39 +0,0 @@
-import { NextResponse } from "next/server";
-import { z } from "zod";
-
-import { adminPost } from "@/lib/blog/admin";
-import { readBody } from "@/lib/blog/read";
-import { revalidateBlogNow } from "@/lib/blog/revalidate";
-import { notFoundResponse, withSuperUser } from "@/lib/donkey-api-auth";
-import { prisma } from "@/lib/prisma";
-
-type Params = { params: Promise<{ id: string }> };
-const idSchema = z.string().trim().min(1);
-
-// Publishing puts the post on the site as it is, dated now if the editor
-// left the date empty; a date in the future is the one thing it refuses. One
-// featured post at a time: featuring this one clears the others.
-export const POST = withSuperUser(async (_request, { params }: Params) => {
- const id = idSchema.safeParse((await params).id);
- if (!id.success) return notFoundResponse();
- const existing = await prisma.blogPost.findUnique({ where: { id: id.data } });
- if (!existing) return notFoundResponse();
- if (existing.publishedAt && existing.publishedAt.getTime() > Date.now()) {
- return NextResponse.json(
- { error: "Not ready to publish", issues: [{ path: "publishedAt", message: "The publish date cannot be in the future." }] },
- { status: 400 },
- );
- }
- const body = await readBody(existing.id);
- const [row] = await prisma.$transaction([
- prisma.blogPost.update({
- where: { id: id.data },
- data: { status: "PUBLISHED", publishedAt: existing.publishedAt ?? new Date() },
- }),
- ...(existing.featured
- ? [prisma.blogPost.updateMany({ where: { featured: true, id: { not: id.data } }, data: { featured: false } })]
- : []),
- ]);
- await revalidateBlogNow([row.slug]);
- return NextResponse.json({ post: { ...adminPost(row), body } });
-});
diff --git a/site/src/app/api/su/blog/posts/[id]/route.ts b/site/src/app/api/su/blog/posts/[id]/route.ts
deleted file mode 100644
index e7edc5aa..00000000
--- a/site/src/app/api/su/blog/posts/[id]/route.ts
+++ /dev/null
@@ -1,87 +0,0 @@
-import { NextResponse } from "next/server";
-import { z } from "zod";
-
-import { deletePrefix, putObject } from "@/cut/server/cloud/r2";
-import { Prisma } from "@/generated/prisma/client";
-import { adminPost } from "@/lib/blog/admin";
-import { blogBodyKey, blogPrefix } from "@/lib/blog/keys";
-import { readBody } from "@/lib/blog/read";
-import { revalidateBlogLater } from "@/lib/blog/revalidate";
-import { blogPostInputSchema } from "@/lib/blog/schema";
-import { invalidResponse } from "@/lib/config/experimentList";
-import { notFoundResponse, withSuperUser } from "@/lib/donkey-api-auth";
-import { prisma } from "@/lib/prisma";
-
-type Params = { params: Promise<{ id: string }> };
-const idSchema = z.string().trim().min(1);
-
-export const GET = withSuperUser(async (_request, { params }: Params) => {
- const id = idSchema.safeParse((await params).id);
- if (!id.success) return notFoundResponse();
- const row = await prisma.blogPost.findUnique({ where: { id: id.data } });
- if (!row) return notFoundResponse();
- return NextResponse.json({ post: { ...adminPost(row), body: await readBody(row.id) } });
-});
-
-// A save: the fields onto the row, the body into R2 when it changed. Both the
-// old and the new slug are cleared from the cache, so a renamed post stops
-// answering at its old address.
-export const PUT = withSuperUser(async (request, { params }: Params) => {
- const id = idSchema.safeParse((await params).id);
- if (!id.success) return notFoundResponse();
- const parsed = blogPostInputSchema.safeParse(await request.json());
- if (!parsed.success) return invalidResponse(parsed.error.issues);
- const existing = await prisma.blogPost.findUnique({ where: { id: id.data } });
- if (!existing) return notFoundResponse();
- const input = parsed.data;
-
- const bodyChanged = input.body !== (await readBody(existing.id));
- if (bodyChanged) await putObject(blogBodyKey(existing.id), Buffer.from(input.body, "utf8"), "text/markdown");
-
- let row;
- try {
- row = await prisma.blogPost.update({
- where: { id: id.data },
- data: {
- slug: input.slug,
- title: input.title,
- excerpt: input.excerpt,
- summary: input.summary || null,
- tags: input.tags,
- keywords: input.keywords,
- featured: input.featured,
- publishedAt: input.publishedAt ? new Date(input.publishedAt) : null,
- revisedAt: input.revisedAt ? new Date(input.revisedAt) : null,
- headerAlt: input.headerAlt || null,
- headerFocus: input.headerFocus,
- thumbnailFocus: input.thumbnailFocus,
- seoTitle: input.seoTitle || null,
- canonicalUrl: input.canonicalUrl || null,
- noIndex: input.noIndex,
- ...(bodyChanged ? { bodyVersion: { increment: 1 } } : {}),
- },
- });
- } catch (error) {
- if (error instanceof Prisma.PrismaClientKnownRequestError && error.code === "P2002") {
- return NextResponse.json(
- { error: "Invalid request", issues: [{ path: "slug", message: "Another post has that slug." }] },
- { status: 409 },
- );
- }
- throw error;
- }
- revalidateBlogLater([existing.slug, row.slug]);
- return NextResponse.json({ post: { ...adminPost(row), body: input.body } });
-});
-
-// Deleting a post removes its row and sweeps everything it owned in R2.
-export const DELETE = withSuperUser(async (_request, { params }: Params) => {
- const id = idSchema.safeParse((await params).id);
- if (!id.success) return notFoundResponse();
- const existing = await prisma.blogPost.findUnique({ where: { id: id.data } });
- if (!existing) return notFoundResponse();
- await prisma.blogPost.delete({ where: { id: id.data } });
- await deletePrefix(blogPrefix(existing.id));
- revalidateBlogLater([existing.slug]);
- return NextResponse.json({ ok: true });
-});
diff --git a/site/src/app/api/su/blog/posts/[id]/unpublish/route.ts b/site/src/app/api/su/blog/posts/[id]/unpublish/route.ts
deleted file mode 100644
index 2df91d5a..00000000
--- a/site/src/app/api/su/blog/posts/[id]/unpublish/route.ts
+++ /dev/null
@@ -1,23 +0,0 @@
-import { NextResponse } from "next/server";
-import { z } from "zod";
-
-import { adminPost } from "@/lib/blog/admin";
-import { readBody } from "@/lib/blog/read";
-import { revalidateBlogLater } from "@/lib/blog/revalidate";
-import { notFoundResponse, withSuperUser } from "@/lib/donkey-api-auth";
-import { prisma } from "@/lib/prisma";
-
-type Params = { params: Promise<{ id: string }> };
-const idSchema = z.string().trim().min(1);
-
-// Back to a draft. The page answers 404 from the next request on; the date is
-// kept so republishing lands the post where it was.
-export const POST = withSuperUser(async (_request, { params }: Params) => {
- const id = idSchema.safeParse((await params).id);
- if (!id.success) return notFoundResponse();
- const existing = await prisma.blogPost.findUnique({ select: { id: true }, where: { id: id.data } });
- if (!existing) return notFoundResponse();
- const row = await prisma.blogPost.update({ where: { id: id.data }, data: { status: "DRAFT" } });
- revalidateBlogLater([row.slug]);
- return NextResponse.json({ post: { ...adminPost(row), body: await readBody(row.id) } });
-});
diff --git a/site/src/app/api/su/blog/posts/[id]/uploads/route.ts b/site/src/app/api/su/blog/posts/[id]/uploads/route.ts
deleted file mode 100644
index 888e32c0..00000000
--- a/site/src/app/api/su/blog/posts/[id]/uploads/route.ts
+++ /dev/null
@@ -1,37 +0,0 @@
-import { randomUUID } from "node:crypto";
-import { NextResponse } from "next/server";
-import { z } from "zod";
-
-import { presignPut } from "@/cut/server/cloud/r2";
-import { blogUploadKey } from "@/lib/blog/keys";
-import { invalidResponse } from "@/lib/config/experimentList";
-import { notFoundResponse, withSuperUser } from "@/lib/donkey-api-auth";
-import { prisma } from "@/lib/prisma";
-
-type Params = { params: Promise<{ id: string }> };
-const idSchema = z.string().trim().min(1);
-
-// What the encoder can read. HEIC needs a decoder the bundled sharp lacks.
-const BLOG_UPLOAD_MIMES = new Set(["image/png", "image/jpeg", "image/webp", "image/gif", "image/avif"]);
-const BLOG_UPLOAD_MAX_BYTES = 25 * 1024 * 1024;
-
-const bodySchema = z
- .object({
- mime: z.string().refine((mime) => BLOG_UPLOAD_MIMES.has(mime), "Not an image the blog can take."),
- bytes: z.number().int().positive().max(BLOG_UPLOAD_MAX_BYTES, "Keep images under 25 MB."),
- })
- .strict();
-
-// Image bytes never ride a request body here (the platform caps it at the
-// edge). The browser gets a one-hour PUT to a scratch key under the post, then
-// names that key to the images route, which encodes and deletes it.
-export const POST = withSuperUser(async (request, { params }: Params) => {
- const id = idSchema.safeParse((await params).id);
- if (!id.success) return notFoundResponse();
- const parsed = bodySchema.safeParse(await request.json());
- if (!parsed.success) return invalidResponse(parsed.error.issues);
- const existing = await prisma.blogPost.findUnique({ select: { id: true }, where: { id: id.data } });
- if (!existing) return notFoundResponse();
- const key = blogUploadKey(existing.id, randomUUID());
- return NextResponse.json({ key, putUrl: await presignPut(key, parsed.data.mime, parsed.data.bytes) });
-});
diff --git a/site/src/app/api/su/blog/posts/route.ts b/site/src/app/api/su/blog/posts/route.ts
deleted file mode 100644
index a8f4c0a2..00000000
--- a/site/src/app/api/su/blog/posts/route.ts
+++ /dev/null
@@ -1,24 +0,0 @@
-import { randomBytes } from "node:crypto";
-import { NextResponse } from "next/server";
-
-import { adminPost, listAdminPosts } from "@/lib/blog/admin";
-import { withSuperUser } from "@/lib/donkey-api-auth";
-import { prisma } from "@/lib/prisma";
-
-// Every post, newest change first.
-export const GET = withSuperUser(async () => {
- return NextResponse.json({ posts: await listAdminPosts() });
-});
-
-// A new draft. It exists before anything is typed so images can upload under
-// its id; the editor opens on it.
-export const POST = withSuperUser(async (request) => {
- const row = await prisma.blogPost.create({
- data: {
- slug: `untitled-${randomBytes(3).toString("hex")}`,
- title: "",
- authorUserId: request.donkey.userId,
- },
- });
- return NextResponse.json({ post: adminPost(row) });
-});
diff --git a/site/src/app/api/su/email/route.ts b/site/src/app/api/su/email/route.ts
deleted file mode 100644
index f9a853f2..00000000
--- a/site/src/app/api/su/email/route.ts
+++ /dev/null
@@ -1,30 +0,0 @@
-import { NextResponse } from "next/server";
-import { z } from "zod";
-
-import { invalidResponse } from "@/lib/config/experimentList";
-import { notFoundResponse, withSuperUser } from "@/lib/donkey-api-auth";
-import { EMAIL_KIND_IDS } from "@/lib/email/kindIds";
-import { drainKindNow, outboxOverview, retryEmail } from "@/lib/email/outbox";
-
-// Without a queue configured (local dev) a drain runs inline before the
-// response; give it room.
-export const maxDuration = 300;
-
-export const GET = withSuperUser(async () => NextResponse.json(await outboxOverview()));
-
-const actionSchema = z.union([
- z.object({ action: z.literal("drain"), kind: z.enum(EMAIL_KIND_IDS) }).strict(),
- z.object({ action: z.literal("retry"), id: z.string().min(1) }).strict(),
-]);
-
-// Drain one kind now, or put one failed row back in the queue.
-export const POST = withSuperUser(async (request) => {
- const parsed = actionSchema.safeParse(await request.json());
- if (!parsed.success) return invalidResponse(parsed.error.issues);
- if (parsed.data.action === "drain") {
- await drainKindNow(parsed.data.kind, request.donkey.userId);
- } else if (!(await retryEmail(parsed.data.id))) {
- return notFoundResponse();
- }
- return NextResponse.json(await outboxOverview());
-});
diff --git a/site/src/app/api/su/promotions/[id]/cancel/route.ts b/site/src/app/api/su/promotions/[id]/cancel/route.ts
deleted file mode 100644
index 4c9979a7..00000000
--- a/site/src/app/api/su/promotions/[id]/cancel/route.ts
+++ /dev/null
@@ -1,22 +0,0 @@
-import { NextResponse } from "next/server";
-import { z } from "zod";
-
-import { notFoundResponse, withSuperUser } from "@/lib/donkey-api-auth";
-import { invalidResponse } from "@/lib/config/experimentList";
-import { listPromotions } from "@/lib/marketing/promotions";
-import { prisma } from "@/lib/prisma";
-
-type Params = { params: Promise<{ id: string }> };
-const idSchema = z.string().trim().min(1);
-
-export const POST = withSuperUser(async (_request, { params }: Params) => {
- const parsed = idSchema.safeParse((await params).id);
- if (!parsed.success) return notFoundResponse();
- const promotion = await prisma.promotion.findUnique({ where: { id: parsed.data } });
- if (!promotion) return notFoundResponse();
- if (promotion.status !== "queuing" && promotion.status !== "sending") {
- return invalidResponse([{ path: ["status"], message: "This promotion is not running." }]);
- }
- await prisma.promotion.update({ data: { status: "paused" }, where: { id: promotion.id } });
- return NextResponse.json({ promotions: await listPromotions() });
-});
diff --git a/site/src/app/api/su/promotions/[id]/route.ts b/site/src/app/api/su/promotions/[id]/route.ts
deleted file mode 100644
index 883802e0..00000000
--- a/site/src/app/api/su/promotions/[id]/route.ts
+++ /dev/null
@@ -1,43 +0,0 @@
-import { NextResponse } from "next/server";
-import { z } from "zod";
-
-import { invalidResponse } from "@/lib/config/experimentList";
-import { notFoundResponse, withSuperUser } from "@/lib/donkey-api-auth";
-import { promotionDraftSchema } from "@/lib/marketing/promotionInput";
-import { listPromotions } from "@/lib/marketing/promotions";
-import { promotionData } from "@/lib/marketing/promotionSave";
-import { prisma } from "@/lib/prisma";
-
-type Params = { params: Promise<{ id: string }> };
-const idSchema = z.string().trim().min(1);
-
-// A draft is edited in place and saves as it stands, blanks and all;
-// anything that has started sending is history and stays as it went out.
-export const PUT = withSuperUser(async (request, { params }: Params) => {
- const id = idSchema.safeParse((await params).id);
- if (!id.success) return notFoundResponse();
- const parsed = promotionDraftSchema.safeParse(await request.json());
- if (!parsed.success) return invalidResponse(parsed.error.issues);
-
- const existing = await prisma.promotion.findUnique({ select: { status: true }, where: { id: id.data } });
- if (!existing) return notFoundResponse();
- if (existing.status !== "draft") {
- return invalidResponse([{ path: ["status"], message: "A promotion that has been sent cannot change." }]);
- }
- await prisma.promotion.update({ data: promotionData(parsed.data, request.donkey.userId), where: { id: id.data } });
- return NextResponse.json({ id: id.data, promotions: await listPromotions() });
-});
-
-// Deleting a sent promotion drops its recipient rows too, so a later
-// promotion can no longer skip the people it reached.
-export const DELETE = withSuperUser(async (_request, { params }: Params) => {
- const id = idSchema.safeParse((await params).id);
- if (!id.success) return notFoundResponse();
- const existing = await prisma.promotion.findUnique({ select: { status: true }, where: { id: id.data } });
- if (!existing) return notFoundResponse();
- if (existing.status === "queuing" || existing.status === "sending") {
- return invalidResponse([{ path: ["status"], message: "A promotion that is sending cannot be deleted." }]);
- }
- await prisma.promotion.delete({ where: { id: id.data } });
- return NextResponse.json({ promotions: await listPromotions() });
-});
diff --git a/site/src/app/api/su/promotions/[id]/send/route.ts b/site/src/app/api/su/promotions/[id]/send/route.ts
deleted file mode 100644
index 555b099e..00000000
--- a/site/src/app/api/su/promotions/[id]/send/route.ts
+++ /dev/null
@@ -1,41 +0,0 @@
-import { NextResponse } from "next/server";
-import { z } from "zod";
-
-import { invalidResponse } from "@/lib/config/experimentList";
-import { notFoundResponse, withSuperUser } from "@/lib/donkey-api-auth";
-import { enqueueJob } from "@/lib/jobs/queue";
-import { listPromotions } from "@/lib/marketing/promotions";
-import { sendIssue } from "@/lib/marketing/promotionSave";
-import { prisma } from "@/lib/prisma";
-
-// Without a queue (local dev) the job's first run happens inside this
-// request, so the budget matches the worker's.
-export const maxDuration = 300;
-
-type Params = { params: Promise<{ id: string }> };
-const idSchema = z.string().trim().min(1);
-
-// Starts a send, once the draft reads as a complete promotion: a job reads the segment a page at a time into outbox rows
-// while the promotion is queuing, moves it to sending once every recipient
-// is a row, and the outbox drainer mails the rows under the budget. The rows
-// are the send's memory — a later promotion that excludes this one reads
-// them, and a resumed send adds only the accounts not already queued.
-export const POST = withSuperUser(async (request, { params }: Params) => {
- const id = idSchema.safeParse((await params).id);
- if (!id.success) return notFoundResponse();
- const promotion = await prisma.promotion.findUnique({ where: { id: id.data } });
- if (!promotion) return notFoundResponse();
- if (promotion.status !== "draft" && promotion.status !== "paused") {
- return invalidResponse([{ path: ["status"], message: "This promotion has already been sent." }]);
- }
- const refused = sendIssue(promotion);
- if (refused) return refused;
-
- await prisma.promotion.update({
- data: { startedAt: promotion.startedAt ?? new Date(), status: "queuing" },
- where: { id: promotion.id },
- });
- await enqueueJob("promotion-queue", { promotionId: promotion.id }, request.donkey.userId);
-
- return NextResponse.json({ promotions: await listPromotions() });
-});
diff --git a/site/src/app/api/su/promotions/[id]/test/route.ts b/site/src/app/api/su/promotions/[id]/test/route.ts
deleted file mode 100644
index 6e6a8df0..00000000
--- a/site/src/app/api/su/promotions/[id]/test/route.ts
+++ /dev/null
@@ -1,35 +0,0 @@
-import { NextResponse } from "next/server";
-import { z } from "zod";
-
-import { invalidResponse } from "@/lib/config/experimentList";
-import { notFoundResponse, withSuperUser } from "@/lib/donkey-api-auth";
-import { deliverEmail } from "@/lib/email/outbox";
-import { sendIssue } from "@/lib/marketing/promotionSave";
-import { prisma } from "@/lib/prisma";
-
-type Params = { params: Promise<{ id: string }> };
-const idSchema = z.string().trim().min(1);
-
-// Mails the saved copy to the operator, placeholders filled with their own
-// account, once the draft reads as a complete promotion. A copy error comes
-// back on the body field.
-export const POST = withSuperUser(async (request, { params }: Params) => {
- const id = idSchema.safeParse((await params).id);
- if (!id.success) return notFoundResponse();
- const [promotion, operator] = await Promise.all([
- prisma.promotion.findUnique({ where: { id: id.data } }),
- prisma.user.findUnique({ select: { email: true, id: true }, where: { id: request.donkey.userId } }),
- ]);
- if (!promotion || !operator) return notFoundResponse();
- const refused = sendIssue(promotion);
- if (refused) return refused;
-
- const delivery = await deliverEmail({
- idempotencyKey: `promotion-test:${promotion.id}:${Date.now()}`,
- kind: "promotion-test",
- payload: { promotionId: promotion.id },
- userId: operator.id,
- });
- if (delivery.state === "failed") return invalidResponse([{ path: ["body"], message: delivery.error ?? "The send failed." }]);
- return NextResponse.json({ delivery: delivery.state, sentTo: operator.email });
-});
diff --git a/site/src/app/api/su/promotions/route.ts b/site/src/app/api/su/promotions/route.ts
deleted file mode 100644
index 20c50801..00000000
--- a/site/src/app/api/su/promotions/route.ts
+++ /dev/null
@@ -1,25 +0,0 @@
-import { NextResponse } from "next/server";
-
-import { invalidResponse } from "@/lib/config/experimentList";
-import { withSuperUser } from "@/lib/donkey-api-auth";
-import { promotionDraftSchema } from "@/lib/marketing/promotionInput";
-import { listPromotions, promotionSenders } from "@/lib/marketing/promotions";
-import { promotionData } from "@/lib/marketing/promotionSave";
-import { prisma } from "@/lib/prisma";
-
-// Promotions: the list with the addresses the senders stand for, and a new
-// draft.
-
-export const GET = withSuperUser(async () => {
- return NextResponse.json({ promotions: await listPromotions(), senders: promotionSenders() });
-});
-
-export const POST = withSuperUser(async (request) => {
- const parsed = promotionDraftSchema.safeParse(await request.json());
- if (!parsed.success) return invalidResponse(parsed.error.issues);
- const promotion = await prisma.promotion.create({
- data: promotionData(parsed.data, request.donkey.userId),
- select: { id: true },
- });
- return NextResponse.json({ id: promotion.id, promotions: await listPromotions() });
-});
diff --git a/site/src/app/api/su/promotions/segment/route.ts b/site/src/app/api/su/promotions/segment/route.ts
deleted file mode 100644
index c41d175a..00000000
--- a/site/src/app/api/su/promotions/segment/route.ts
+++ /dev/null
@@ -1,25 +0,0 @@
-import { NextResponse } from "next/server";
-import { audienceSchema } from "@donkeycut/abexp";
-import { z } from "zod";
-
-import { invalidResponse } from "@/lib/config/experimentList";
-import { withSuperUser } from "@/lib/donkey-api-auth";
-import { resolvePromotionSegment } from "@/lib/marketing/promotions";
-
-export const maxDuration = 120;
-
-const segmentSchema = z
- .object({
- audience: audienceSchema,
- excludePromotionIds: z.array(z.string().min(1)).max(100),
- })
- .strict();
-
-// How many accounts a segment reaches right now, and where the rest went.
-// The dialog asks before a send; the send resolves again on its own.
-export const POST = withSuperUser(async (request) => {
- const parsed = segmentSchema.safeParse(await request.json());
- if (!parsed.success) return invalidResponse(parsed.error.issues);
- const { recipients, unsubscribed, alreadyReceived, outsideAudience } = await resolvePromotionSegment(parsed.data);
- return NextResponse.json({ alreadyReceived, outsideAudience, recipients, unsubscribed });
-});
diff --git a/site/src/app/api/su/users/[id]/history/route.ts b/site/src/app/api/su/users/[id]/history/route.ts
deleted file mode 100644
index 9902c6b3..00000000
--- a/site/src/app/api/su/users/[id]/history/route.ts
+++ /dev/null
@@ -1,19 +0,0 @@
-import { NextResponse } from "next/server";
-import { z } from "zod";
-
-import { notFoundResponse, withSuperUser } from "@/lib/donkey-api-auth";
-import { readUserHistory } from "@/lib/marketing/userHistory";
-import { prisma } from "@/lib/prisma";
-
-type Params = { params: Promise<{ id: string }> };
-const idSchema = z.string().trim().min(1);
-
-// One account's offers, grants, mail and storage, for the operator writing
-// to the person.
-export const GET = withSuperUser(async (_request, { params }: Params) => {
- const id = idSchema.safeParse((await params).id);
- if (!id.success) return notFoundResponse();
- const user = await prisma.user.findUnique({ select: { id: true }, where: { id: id.data } });
- if (!user) return notFoundResponse();
- return NextResponse.json(await readUserHistory(user.id));
-});
diff --git a/site/src/app/globals.css b/site/src/app/globals.css
index 07622860..fab435cb 100644
--- a/site/src/app/globals.css
+++ b/site/src/app/globals.css
@@ -17,22 +17,6 @@
--font-sans: var(--font-geist-sans);
--font-mono: var(--font-geist-mono);
--font-heading: var(--font-sans);
- --color-sidebar-ring: var(--sidebar-ring);
- --color-sidebar-border: var(--sidebar-border);
- --color-sidebar-accent-foreground: var(--sidebar-accent-foreground);
- --color-sidebar-accent: var(--sidebar-accent);
- --color-sidebar-primary-foreground: var(--sidebar-primary-foreground);
- --color-sidebar-primary: var(--sidebar-primary);
- --color-sidebar-foreground: var(--sidebar-foreground);
- --color-sidebar: var(--sidebar);
- --color-chart-8: var(--chart-8);
- --color-chart-7: var(--chart-7);
- --color-chart-6: var(--chart-6);
- --color-chart-5: var(--chart-5);
- --color-chart-4: var(--chart-4);
- --color-chart-3: var(--chart-3);
- --color-chart-2: var(--chart-2);
- --color-chart-1: var(--chart-1);
--color-ring: var(--ring);
--color-input: var(--input);
--color-border: var(--border);
@@ -82,27 +66,7 @@
--border: oklch(0.922 0 0);
--input: oklch(0.922 0 0);
--ring: oklch(0.708 0 0);
- /* Categorical series palette, validated (CVD + contrast) against the white
- card surface; keep the slot order — it is the colorblind-safety mechanism.
- Slots 3-5 sit below 3:1 on white, so charts using them need direct labels
- or a table view. */
- --chart-1: #2a78d6;
- --chart-2: #eb6834;
- --chart-3: #1baf7a;
- --chart-4: #eda100;
- --chart-5: #e87ba4;
- --chart-6: #008300;
- --chart-7: #4a3aa7;
- --chart-8: #e34948;
--radius: 0.625rem;
- --sidebar: oklch(0.985 0 0);
- --sidebar-foreground: oklch(0.145 0 0);
- --sidebar-primary: oklch(0.205 0 0);
- --sidebar-primary-foreground: oklch(0.985 0 0);
- --sidebar-accent: oklch(0.97 0 0);
- --sidebar-accent-foreground: oklch(0.205 0 0);
- --sidebar-border: oklch(0.922 0 0);
- --sidebar-ring: oklch(0.708 0 0);
}
.dark {
@@ -127,24 +91,6 @@
--border: oklch(1 0 0 / 10%);
--input: oklch(1 0 0 / 15%);
--ring: oklch(0.556 0 0);
- /* The same five hues re-stepped for the dark card surface — a selected dark
- ramp, not an automatic flip; all clear 3:1 there. */
- --chart-1: #3987e5;
- --chart-2: #d95926;
- --chart-3: #199e70;
- --chart-4: #c98500;
- --chart-5: #d55181;
- --chart-6: #008300;
- --chart-7: #9085e9;
- --chart-8: #e66767;
- --sidebar: oklch(0.205 0 0);
- --sidebar-foreground: oklch(0.985 0 0);
- --sidebar-primary: oklch(0.488 0.243 264.376);
- --sidebar-primary-foreground: oklch(0.985 0 0);
- --sidebar-accent: oklch(0.269 0 0);
- --sidebar-accent-foreground: oklch(0.985 0 0);
- --sidebar-border: oklch(1 0 0 / 10%);
- --sidebar-ring: oklch(0.556 0 0);
}
/* App theme: the signed-in /app surface renders on white; the cream is the
diff --git a/site/src/app/robots.ts b/site/src/app/robots.ts
index f27ffe6b..3236a745 100644
--- a/site/src/app/robots.ts
+++ b/site/src/app/robots.ts
@@ -11,7 +11,7 @@ export default function robots(): MetadataRoute.Robots {
rules: {
userAgent: "*",
allow: "/",
- disallow: ["/api/", "/app/", "/su/", "/sign-in", "/sign-up", "/unsubscribe"],
+ disallow: ["/api/", "/app/", "/sign-in", "/sign-up", "/unsubscribe"],
},
sitemap: `${DONKEYCUT_CANONICAL}/sitemap.xml`,
};
diff --git a/site/src/app/su/CreditOfferFields.tsx b/site/src/app/su/CreditOfferFields.tsx
deleted file mode 100644
index 333522ff..00000000
--- a/site/src/app/su/CreditOfferFields.tsx
+++ /dev/null
@@ -1,140 +0,0 @@
-"use client";
-
-import { useState } from "react";
-
-import { Field } from "@/app/su/Field";
-import { Input } from "@/components/ui/input";
-import { Label } from "@/components/ui/label";
-import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from "@/components/ui/select";
-import { Switch } from "@/components/ui/switch";
-import type { Settings } from "@/lib/config/registry";
-import {
- CLAIM_URL_PLACEHOLDER,
- OFFER_CLAIM_NAMES,
- OFFER_CLAIMS,
- type CreditOfferTerms,
- type OfferClaim,
-} from "@/lib/credits/offerTerms";
-import { useSettings } from "@/queries/settings";
-
-// The credit offer an email carries, as one form: a switch that turns the
-// offer on with the default terms, and the terms themselves. A promotion and
-// an outreach note edit the same fields.
-
-const NUMBERS = [
- ["dollars", "Dollars"],
- ["claimWindowDays", "Days to claim"],
- ["expiresAfterDays", "Days the credit lives"],
-] as const;
-
-/** The terms a new offer starts with: the Promotion credit offer setting,
- * or nothing until the settings have loaded. */
-export function useCreditOfferDefaults(): CreditOfferTerms | undefined {
- const settings = useSettings();
- const value = settings.data?.settings.find((row) => row.key === "promotionCreditOffer")?.value as
- | Settings["promotionCreditOffer"]
- | undefined;
- if (!value) return undefined;
- const { dollars, claimWindowDays, expiresAfterDays, claim } = value;
- return { dollars, claimWindowDays, expiresAfterDays, claim };
-}
-
-export function CreditOfferFields({
- value,
- defaults,
- onChange,
- disabled = false,
- idPrefix = "offer",
- hint = `Each recipient gets their own link for AI credits; ${CLAIM_URL_PLACEHOLDER} is the link and {{claimBy}} their last day to claim.`,
-}: {
- value: CreditOfferTerms | null;
- defaults: CreditOfferTerms | undefined;
- onChange: (next: CreditOfferTerms | null) => void;
- disabled?: boolean;
- idPrefix?: string;
- hint?: string;
-}) {
- return (
- <div className="space-y-3">
- <div className="flex items-center justify-between gap-3">
- <div>
- <Label htmlFor={`${idPrefix}-on`}>Credit offer</Label>
- <p className="text-xs text-muted-foreground">{hint}</p>
- </div>
- <Switch
- id={`${idPrefix}-on`}
- checked={value !== null}
- disabled={disabled || (value === null && !defaults)}
- onCheckedChange={(on) => onChange(on ? (defaults ?? null) : null)}
- />
- </div>
- {value ? (
- <div className="grid grid-cols-2 gap-3 sm:grid-cols-[auto_repeat(3,minmax(0,1fr))]">
- <Field label="Landed by" htmlFor={`${idPrefix}-claim`}>
- <Select
- disabled={disabled}
- value={value.claim}
- items={OFFER_CLAIM_NAMES}
- onValueChange={(v) => onChange({ ...value, claim: v as OfferClaim })}
- >
- <SelectTrigger id={`${idPrefix}-claim`} className="w-full">
- <SelectValue />
- </SelectTrigger>
- <SelectContent>
- {OFFER_CLAIMS.map((claim) => (
- <SelectItem key={claim} value={claim}>
- {OFFER_CLAIM_NAMES[claim]}
- </SelectItem>
- ))}
- </SelectContent>
- </Select>
- </Field>
- {NUMBERS.map(([key, label]) => (
- <Field key={key} label={label} htmlFor={`${idPrefix}-${key}`}>
- <NumberInput
- id={`${idPrefix}-${key}`}
- disabled={disabled}
- value={value[key]}
- onChange={(n) => onChange({ ...value, [key]: n })}
- />
- </Field>
- ))}
- </div>
- ) : null}
- </div>
- );
-}
-
-// The field holds what is typed as text, so it can be cleared and retyped;
-// the number goes up once the text is a whole number, and an empty field
-// reports 0 so the form's schema refuses it. A value set from outside (a
-// template load, the offer switched on) replaces the text.
-function NumberInput({
- id,
- value,
- disabled,
- onChange,
-}: {
- id: string;
- value: number;
- disabled: boolean;
- onChange: (n: number) => void;
-}) {
- const [draft, setDraft] = useState({ text: String(value), value });
- const text = draft.value === value ? draft.text : String(value);
- return (
- <Input
- id={id}
- type="number"
- min={1}
- disabled={disabled}
- value={text}
- onChange={(e) => {
- const next = e.target.value;
- const n = next === "" ? 0 : Number(next);
- setDraft({ text: next, value: n });
- onChange(n);
- }}
- />
- );
-}
diff --git a/site/src/app/su/Field.tsx b/site/src/app/su/Field.tsx
deleted file mode 100644
index e06929f3..00000000
--- a/site/src/app/su/Field.tsx
+++ /dev/null
@@ -1,14 +0,0 @@
-import { Label } from "@/components/ui/label";
-
-// A labelled control in an su form. The control sits at the bottom, so in a
-// row of fields the inputs stay level when one label wraps.
-export function Field({ label, htmlFor, children }: { label: string; htmlFor: string; children: React.ReactNode }) {
- return (
- <div className="flex flex-col gap-1.5 *:last:mt-auto">
- <Label htmlFor={htmlFor} className="text-xs text-muted-foreground">
- {label}
- </Label>
- {children}
- </div>
- );
-}
diff --git a/site/src/app/su/SuCrumb.tsx b/site/src/app/su/SuCrumb.tsx
deleted file mode 100644
index 6344f09b..00000000
--- a/site/src/app/su/SuCrumb.tsx
+++ /dev/null
@@ -1,28 +0,0 @@
-"use client";
-
-import { createContext, useContext, useEffect, useState, type ReactNode } from "react";
-
-// A page inside a surface (an open post under Blog) names itself to the
-// header, which draws the surface as a link and the page after it.
-const CrumbContext = createContext<{ crumb: string | null; setCrumb: (crumb: string | null) => void }>({
- crumb: null,
- setCrumb: () => {},
-});
-
-export function SuCrumbProvider({ children }: { children: ReactNode }) {
- const [crumb, setCrumb] = useState<string | null>(null);
- return <CrumbContext.Provider value={{ crumb, setCrumb }}>{children}</CrumbContext.Provider>;
-}
-
-export function useSuCrumbValue() {
- return useContext(CrumbContext).crumb;
-}
-
-// Names the page while the caller is mounted.
-export function useSuCrumb(label: string) {
- const { setCrumb } = useContext(CrumbContext);
- useEffect(() => {
- setCrumb(label);
- return () => setCrumb(null);
- }, [label, setCrumb]);
-}
diff --git a/site/src/app/su/SuHeader.tsx b/site/src/app/su/SuHeader.tsx
deleted file mode 100644
index 4983ddc3..00000000
--- a/site/src/app/su/SuHeader.tsx
+++ /dev/null
@@ -1,66 +0,0 @@
-"use client";
-
-import Link from "next/link";
-import { usePathname } from "next/navigation";
-import type { ComponentType } from "react";
-
-import { RunAnalyticsButton } from "@/app/su/analytics/RunAnalyticsButton";
-import { NewPostButton } from "@/app/su/blog/NewPostButton";
-import { suSurfaceAt, type SuPage } from "@/app/su/nav";
-import { useSuCrumbValue } from "@/app/su/SuCrumb";
-import {
- Breadcrumb,
- BreadcrumbItem,
- BreadcrumbLink,
- BreadcrumbList,
- BreadcrumbPage,
- BreadcrumbSeparator,
-} from "@/components/ui/breadcrumb";
-import { ScanOutreachButton } from "@/app/su/outreach/ScanOutreachButton";
-import { SidebarTrigger } from "@/components/ui/sidebar";
-
-// The action a page carries in its header, keyed by the page's address. The
-// rail's list (nav.ts) stays free of React so the proxy can read it, so the
-// components live here.
-const PAGE_ACTIONS: Partial<Record<SuPage["href"], ComponentType>> = {
- "/analytics/product": RunAnalyticsButton,
- "/blog": NewPostButton,
- "/outreach": ScanOutreachButton,
-};
-
-// The title is the surface's; the action belongs to whichever page is
-// showing, since a section's tabs each drive their own work. The
-// header carries the button that shows and hides the rail (also ⌘B).
-export function SuHeader() {
- const pathname = usePathname();
- const { surface, page } = suSurfaceAt(pathname);
- const Action = PAGE_ACTIONS[page.href];
- const crumb = useSuCrumbValue();
- return (
- <div className="sticky top-0 z-20 mx-auto flex w-full max-w-6xl shrink-0 items-start justify-between gap-4 bg-background px-4 pt-4 pb-4 md:px-10 md:pt-9">
- <div className="flex min-w-0 items-start gap-2">
- <SidebarTrigger className="-ml-1.5 shrink-0" />
- <div className="min-w-0">
- {crumb ? (
- <Breadcrumb>
- <BreadcrumbList className="text-lg font-semibold tracking-tight">
- <BreadcrumbItem>
- <BreadcrumbLink render={<Link href={surface.href} />}>{surface.title}</BreadcrumbLink>
- </BreadcrumbItem>
- <BreadcrumbSeparator />
- <BreadcrumbItem>
- <BreadcrumbPage className="truncate">{crumb}</BreadcrumbPage>
- </BreadcrumbItem>
- </BreadcrumbList>
- </Breadcrumb>
- ) : (
- <h1 className="text-lg font-semibold tracking-tight">
- {surface.title}
- </h1>
- )}
- </div>
- </div>
- {Action ? <Action /> : null}
- </div>
- );
-}
diff --git a/site/src/app/su/SuShell.tsx b/site/src/app/su/SuShell.tsx
deleted file mode 100644
index 1e1e0efa..00000000
--- a/site/src/app/su/SuShell.tsx
+++ /dev/null
@@ -1,65 +0,0 @@
-"use client";
-
-import { useEffect, type CSSProperties, type ReactNode } from "react";
-
-import { NoSessionReplay } from "@/app/_components/NoSessionReplay";
-import { SuCrumbProvider } from "@/app/su/SuCrumb";
-import { SuHeader } from "@/app/su/SuHeader";
-import { SuSidebar } from "@/app/su/SuSidebar";
-import { SidebarProvider, useSidebar } from "@/components/ui/sidebar";
-import { useWarmAnalyticsSummary } from "@/queries/analytics";
-
-// The section's two-pane shell. It mounts only for a super user: the proxy
-// (src/proxy.ts) has already checked the session and the role before the
-// route runs.
-//
-// The sidebar provider is the outermost element so the header's menu button
-// and the rail share one open state: on a phone the rail is a sheet the
-// header opens, on a wider screen it is the fixed left column.
-export function SuShell({ children }: { children: ReactNode }) {
- useWarmAnalyticsSummary();
- // The section paints the white product surface. `app-surface` is what
- // repoints the --background token for the whole document (see globals.css),
- // so it belongs on the outermost element here.
- //
- // translate="no" covers the subtree: a browser's built-in translator rewrites
- // text nodes under a running React tree, the rewrite lands mid-hydration as a
- // text mismatch, and a later commit that moves one of those nodes throws
- // NotFoundError out of insertBefore and takes the page down. These surfaces
- // are dense text tables, which is exactly what a translator reaches for.
- return (
- <SidebarProvider
- translate="no"
- style={{ "--sidebar-width": "15rem" } as CSSProperties}
- className="app-surface h-screen min-h-0 bg-background font-system text-foreground antialiased"
- >
- <NoSessionReplay />
- <RailState />
- <SuSidebar />
- <SuCrumbProvider>
- <main className="flex min-w-0 flex-1 flex-col overflow-y-auto">
- <SuHeader />
- <div className="min-h-0 flex-1">
- <div className="mx-auto h-full w-full max-w-6xl px-4 md:px-10">
- {/* The header is sticky and opaque, so the top of the gap below
- it lives here: a focus ring on the first control needs room
- that the header cannot paint over. */}
- <div className="h-full px-px pt-1 pb-px">{children}</div>
- </div>
- </div>
- </main>
- </SuCrumbProvider>
- </SidebarProvider>
- );
-}
-
-// The rail opens by default so the shell prerenders one way; a rail the
-// super user hid stays hidden across loads through the cookie the provider
-// writes on every toggle.
-function RailState() {
- const { setOpen } = useSidebar();
- useEffect(() => {
- if (/(?:^|;\s*)sidebar_state=false(?:;|$)/.test(document.cookie)) setOpen(false);
- }, [setOpen]);
- return null;
-}
diff --git a/site/src/app/su/SuSidebar.tsx b/site/src/app/su/SuSidebar.tsx
deleted file mode 100644
index 5b4f01ae..00000000
--- a/site/src/app/su/SuSidebar.tsx
+++ /dev/null
@@ -1,195 +0,0 @@
-"use client";
-
-import Link, { useLinkStatus } from "next/link";
-import { usePathname, useRouter } from "next/navigation";
-import {
- ArrowLeft,
- ChartColumn,
- ChevronRight,
- CreditCard,
- FlaskConical,
- ListChecks,
- Mail,
- Megaphone,
- Newspaper,
- Package,
- UserRound,
-} from "lucide-react";
-import { useEffect } from "react";
-
-import { SU_NAV, suSurfaceAt, suTabs, type SuSurface } from "@/app/su/nav";
-import {
- Collapsible,
- CollapsibleContent,
- CollapsibleTrigger,
-} from "@/components/ui/collapsible";
-import {
- Sidebar,
- SidebarContent,
- SidebarFooter,
- SidebarGroup,
- SidebarHeader,
- SidebarMenu,
- SidebarMenuButton,
- SidebarMenuItem,
- SidebarMenuSub,
- SidebarMenuSubButton,
- SidebarMenuSubItem,
- useSidebar,
-} from "@/components/ui/sidebar";
-import { SU_APP_ORIGIN } from "@/cut/lib/hosts";
-
-// Each surface's icon, keyed by address. The rail's list (nav.ts) stays free
-// of React so the proxy can read it, so the icons live here.
-const SURFACE_ICONS: Record<SuSurface["href"], typeof UserRound> = {
- "/analytics": ChartColumn,
- "/blog": Newspaper,
- "/credits": CreditCard,
- "/experiments": FlaskConical,
- "/jobs": ListChecks,
- "/outreach": Mail,
- "/product": Package,
- "/promotions": Megaphone,
- "/users": UserRound,
-};
-
-// Every page the rail can open. A section's own address opens its first tab,
-// so the tabs are the pages.
-const RAIL_PAGES = SU_NAV.flatMap((surface) => suTabs(surface)?.map((tab) => tab.href) ?? [surface.href]);
-
-/** The clicked row's answer while its page is on the way: the accent fill,
- * breathing. A link only shows its pending state when the page was not
- * prefetched, so a warmed click skips straight to the page. Rendered inside
- * the link, which is where the status is read from. */
-function PendingFill() {
- const { pending } = useLinkStatus();
- return (
- <span
- aria-hidden
- data-pending={pending || undefined}
- className="pointer-events-none absolute inset-0 -z-10 rounded-md bg-sidebar-accent opacity-0 transition-opacity data-pending:animate-pulse data-pending:opacity-100"
- />
- );
-}
-
-// The super-user section's left rail, the shadcn sidebar with the admin
-// surfaces as its menu and a way back to the app pinned to the bottom. A
-// section with tabs is a collapsible item that opens onto its tabs; it starts
-// open while one of them is showing, and lands on its first tab when clicked.
-//
-// On a wide screen the rail is a fixed column that never collapses. Under the
-// sidebar's mobile breakpoint it becomes a sheet, opened from the header and
-// closed by the navigation it triggers.
-//
-// Every page is prefetched when the rail mounts. A link prefetches itself
-// once it is on screen, which leaves the tabs of a closed section cold until
-// the section opens — and a click right after opening it beat the prefetch,
-// so the page arrived from the server with nothing on screen in between.
-export function SuSidebar() {
- const pathname = usePathname();
- const router = useRouter();
- const here = suSurfaceAt(pathname);
- const { setOpenMobile } = useSidebar();
-
- useEffect(() => {
- for (const href of RAIL_PAGES) router.prefetch(href);
- }, [router]);
-
- useEffect(() => {
- setOpenMobile(false);
- }, [pathname, setOpenMobile]);
-
- return (
- <Sidebar collapsible="offcanvas" className="border-sidebar-border">
- <SidebarHeader className="mb-3 flex-row items-center gap-2.5 px-4 pt-4">
- <span className="grid size-9 shrink-0 place-items-center p-0.5">
- <img
- src="/donkey-logo.svg"
- alt="Donkey Cut"
- width={36}
- height={36}
- className="block h-full w-full object-contain"
- />
- </span>
- <span className="text-[17px] font-semibold tracking-tight">
- Super User
- </span>
- </SidebarHeader>
-
- <SidebarContent>
- <SidebarGroup>
- <SidebarMenu className="gap-0.5">
- {SU_NAV.map((surface) => {
- const { href, label } = surface;
- const Icon = SURFACE_ICONS[href];
- const tabs = suTabs(surface);
- const active = here.surface === surface;
- if (!tabs) {
- return (
- <SidebarMenuItem key={label}>
- <SidebarMenuButton
- isActive={active}
- render={<Link href={href} />}
- className="relative isolate h-9 px-2.5"
- >
- <PendingFill />
- <Icon />
- <span>{label}</span>
- </SidebarMenuButton>
- </SidebarMenuItem>
- );
- }
- return (
- <Collapsible
- key={label}
- defaultOpen={active}
- className="group/collapsible"
- render={<SidebarMenuItem />}
- >
- <CollapsibleTrigger
- render={<SidebarMenuButton className="h-9 px-2.5" />}
- >
- <Icon />
- <span>{label}</span>
- <ChevronRight className="ml-auto transition-transform duration-200 group-data-open/collapsible:rotate-90" />
- </CollapsibleTrigger>
- <CollapsibleContent>
- <SidebarMenuSub>
- {tabs.map((tab) => (
- <SidebarMenuSubItem key={tab.href}>
- <SidebarMenuSubButton
- isActive={active && here.page === tab}
- render={<Link href={tab.href} />}
- className="relative isolate"
- >
- <PendingFill />
- <span>{tab.label}</span>
- </SidebarMenuSubButton>
- </SidebarMenuSubItem>
- ))}
- </SidebarMenuSub>
- </CollapsibleContent>
- </Collapsible>
- );
- })}
- </SidebarMenu>
- </SidebarGroup>
- </SidebarContent>
-
- {/* The app is a different host, so this is a document load. */}
- <SidebarFooter>
- <SidebarMenu>
- <SidebarMenuItem>
- <SidebarMenuButton
- render={<a href={`${SU_APP_ORIGIN}/app`} />}
- className="h-9 px-2.5"
- >
- <ArrowLeft />
- <span>Back to app</span>
- </SidebarMenuButton>
- </SidebarMenuItem>
- </SidebarMenu>
- </SidebarFooter>
- </Sidebar>
- );
-}
diff --git a/site/src/app/su/SuStandIn.tsx b/site/src/app/su/SuStandIn.tsx
deleted file mode 100644
index 04dc65bd..00000000
--- a/site/src/app/su/SuStandIn.tsx
+++ /dev/null
@@ -1,16 +0,0 @@
-import { Skeleton } from "@/components/ui/skeleton";
-
-// What a page's slot shows until its data is on screen. The route fallback
-// (loading.tsx) and every page's pending branch draw this same stand-in, so
-// the handoff from one to the other paints the same pixels: a page arriving
-// before its query resolves is invisible.
-export function SuStandIn() {
- return (
- <div className="grid gap-4 sm:grid-cols-2 lg:grid-cols-3">
- {Array.from({ length: 3 }, (_, i) => (
- <Skeleton key={i} className="h-[104px] rounded-xl" />
- ))}
- <Skeleton className="h-96 rounded-xl sm:col-span-2 lg:col-span-3" />
- </div>
- );
-}
diff --git a/site/src/app/su/analytics/Reorder.tsx b/site/src/app/su/analytics/Reorder.tsx
deleted file mode 100644
index d6c59aac..00000000
--- a/site/src/app/su/analytics/Reorder.tsx
+++ /dev/null
@@ -1,35 +0,0 @@
-"use client";
-
-import { useMemo } from "react";
-
-import { useDragSort } from "@/components/Sortable";
-import { useLocalPref } from "@/cut/lib/uiState";
-
-export { SortCard as DragBlock } from "@/components/Sortable";
-
-/**
- * Drag-to-reorder for a grid of dashboard blocks. localStorage keeps a list of
- * block ids; ids the page no longer renders drop out of it and blocks the page
- * gained land in their default position, so the saved order survives the
- * dashboard growing new cards.
- */
-export function useReorder<T extends string>(key: string, ids: readonly T[]) {
- const [saved, setSaved] = useLocalPref<string[]>(
- key,
- [],
- (v) => Array.isArray(v) && v.every((x) => typeof x === "string"),
- );
-
- const stored = useMemo(() => {
- const kept = saved.filter((id): id is T => (ids as readonly string[]).includes(id));
- return [...kept, ...ids.filter((id) => !kept.includes(id))];
- }, [saved, ids]);
-
- const sort = useDragSort(stored, setSaved);
-
- return {
- blockProps: sort.itemProps,
- containerProps: sort.containerProps,
- order: sort.order,
- };
-}
diff --git a/site/src/app/su/analytics/RunAnalyticsButton.tsx b/site/src/app/su/analytics/RunAnalyticsButton.tsx
deleted file mode 100644
index c5b5a09e..00000000
--- a/site/src/app/su/analytics/RunAnalyticsButton.tsx
+++ /dev/null
@@ -1,23 +0,0 @@
-"use client";
-
-import { Button } from "@/components/ui/button";
-import { useRunAnalytics } from "@/queries/analytics";
-
-export function RunAnalyticsButton() {
- const run = useRunAnalytics();
- return (
- <div className="flex items-center gap-3">
- {run.isError ? (
- <span className="text-sm text-destructive">Run failed.</span>
- ) : null}
- <Button
- disabled={run.isPending}
- onClick={() => run.mutate()}
- size="sm"
- variant="outline"
- >
- {run.isPending ? "Running…" : "Run now"}
- </Button>
- </div>
- );
-}
diff --git a/site/src/app/su/analytics/product/page.tsx b/site/src/app/su/analytics/product/page.tsx
deleted file mode 100644
index 169883ba..00000000
--- a/site/src/app/su/analytics/product/page.tsx
+++ /dev/null
@@ -1,1427 +0,0 @@
-"use client";
-
-import { ArrowUpRight, Check, Mail } from "lucide-react";
-import { useEffect, useMemo, useRef, useState } from "react";
-import {
- Area,
- AreaChart,
- Bar,
- BarChart,
- CartesianGrid,
- Line,
- LineChart,
- ReferenceLine,
- XAxis,
- YAxis,
-} from "recharts";
-
-import {
- ChartContainer,
- ChartLegend,
- ChartLegendContent,
- ChartTooltip,
- ChartTooltipContent,
- type ChartConfig,
-} from "@/components/ui/chart";
-import type { AnalyticsBilling, AnalyticsReferrals } from "@/lib/analytics/schema";
-import { USER_SORTS, type RankedUser, type UserSort } from "@/lib/analytics/rank";
-import { workBitsOf, type AnalyticsSummary } from "@/lib/analytics/summarize";
-import { REFERRAL_SOURCES } from "@/lib/onboarding/sequence";
-import { useLocalPref } from "@/cut/lib/uiState";
-import { cn } from "@/lib/utils";
-import { DragBlock, useReorder } from "@/app/su/analytics/Reorder";
-import { OutreachComposeDialog } from "@/app/su/outreach/ComposeDialog";
-import { Button } from "@/components/ui/button";
-import { SuStandIn } from "@/app/su/SuStandIn";
-import { useRowWindow } from "@/app/su/analytics/rowWindow";
-import { useAnalyticsSummary, useAnalyticsUsers } from "@/queries/analytics";
-import { ApiError } from "@/queries/apiClient";
-import { useOutreachAction, type OutreachRow } from "@/queries/outreach";
-
-// Everything here renders the nightly rollup — stale until the next job run by
-// design. The charts read the folded numbers (/api/analytics/summary) and the
-// grid pages through the accounts (/api/analytics/users), so the page never
-// holds the whole account table. "Active" is any source bit for the day;
-// "working" narrows to the DB event sources, i.e. the user did something
-// beyond opening the app.
-
-// Formatting a day goes through the locale machinery, which is slow enough
-// that a label per grid cell held the page for over a second. The rollup
-// names a few hundred distinct days, so each is formatted once.
-const dayLabels = new Map<string, string>();
-function formatDay(iso: string): string {
- let label = dayLabels.get(iso);
- if (label === undefined) {
- label = new Date(`${iso}T00:00:00Z`).toLocaleDateString("en-US", {
- month: "short",
- day: "numeric",
- timeZone: "UTC",
- });
- dayLabels.set(iso, label);
- }
- return label;
-}
-
-const dollars = (micros: bigint | string) => Number(micros) / 1e6;
-const formatDollars = (value: number) =>
- `${value < 0 ? "-" : ""}$${Math.abs(value).toLocaleString("en-US", { maximumFractionDigits: 2 })}`;
-const formatMicros = (micros: bigint | string) => formatDollars(dollars(micros));
-
-// A processed row reads as picked by a wash of the accent color behind the
-// whole row; the sticky name cell paints the same color so it matches across
-// the freeze line.
-const PROCESSED_ROW = "bg-[color-mix(in_oklab,var(--chart-1)_10%,var(--card))]";
-
-function formatGb(bytes: number): string {
- return `${(bytes / 1024 ** 3).toFixed(2)} GB`;
-}
-
-// Storage colored by how close the account sits to its quota: orange from
-// 80% up, red at or past the ceiling. Unlimited accounts stay neutral.
-function storageTone(bytes: number, quotaBytes: number | null | undefined): string {
- if (quotaBytes === null || quotaBytes === undefined || quotaBytes <= 0) return "";
- const ratio = bytes / quotaBytes;
- if (ratio >= 1) return "text-red-600 dark:text-red-500";
- if (ratio >= 0.8) return "text-orange-600 dark:text-orange-400";
- return "";
-}
-
-// One chart point per day, twice over: `series` holds the per-source answer
-// counts of that day (the stacked bars), `cumulative` the running totals per
-// source plus the running total of users who answered (the trend lines).
-type ReferralView = {
- config: ChartConfig;
- trendConfig: ChartConfig;
- series: Record<string, number | string | string[]>[];
- cumulative: Record<string, number | string>[];
- respondents: number;
-};
-
-function deriveReferrals(referrals: AnalyticsReferrals): ReferralView {
- const labels = new Map<string, string>(REFERRAL_SOURCES.map((s) => [s.id, s.label]));
- // Sources render in the survey's own order (the rollup stores its own);
- // anything the survey no longer asks about trails the list.
- const surveyIds = REFERRAL_SOURCES.map((s) => s.id as string);
- const ordered = [
- ...surveyIds.filter((id) => referrals.sources.includes(id)),
- ...referrals.sources.filter((id) => !surveyIds.includes(id)),
- ];
- const config: ChartConfig = {};
- ordered.forEach((id, i) => {
- config[id] = {
- color: `var(--chart-${Math.min(i + 1, 8)})`,
- label: labels.get(id) ?? id,
- };
- });
- // The total rides with the source lines but is an aggregate, so it wears
- // neutral ink where every source keeps its own hue.
- const trendConfig: ChartConfig = {
- totalResponses: { color: "var(--muted-foreground)", label: "Total" },
- ...config,
- };
- let respondents = 0;
- const running = new Map<string, number>();
- const series: Record<string, number | string | string[]>[] = [];
- const cumulative: Record<string, number | string>[] = [];
- for (const entry of referrals.days) {
- respondents += entry.respondents;
- const daily: Record<string, number | string | string[]> = {
- day: entry.day,
- otherAnswers: entry.others,
- };
- const total: Record<string, number | string> = { day: entry.day, totalResponses: respondents };
- referrals.sources.forEach((id, i) => {
- daily[id] = entry.counts[i] ?? 0;
- running.set(id, (running.get(id) ?? 0) + (entry.counts[i] ?? 0));
- total[id] = running.get(id) ?? 0;
- });
- series.push(daily);
- cumulative.push(total);
- }
- return { config, cumulative, respondents, series, trendConfig };
-}
-
-type TooltipPayload = NonNullable<React.ComponentProps<typeof ChartTooltipContent>["payload"]>;
-
-const sumOf = (payload: TooltipPayload) =>
- payload.reduce((sum, item) => sum + (typeof item.value === "number" ? item.value : 0), 0);
-
-/** The shared tooltip with the day's total on the date row. On a chart with
- * several series a zero row says nothing, so those drop out; `total` picks
- * the headline number (the sum of what shows, unless told otherwise). */
-function TotalTooltipContent({
- format = (n) => n.toLocaleString("en-US"),
- total = sumOf,
- ...props
-}: React.ComponentProps<typeof ChartTooltipContent> & {
- format?: (total: number) => string;
- total?: (payload: TooltipPayload) => number;
-}) {
- const shown =
- props.payload && props.payload.length > 1
- ? props.payload.filter((item) => item.value !== 0)
- : props.payload;
- return (
- <ChartTooltipContent
- {...props}
- payload={shown?.length ? shown : props.payload}
- labelFormatter={(label, payload) => (
- <div className="flex items-center justify-between gap-4">
- <span>{formatDay(String(label))}</span>
- <span className="font-mono tabular-nums">{format(total(payload))}</span>
- </div>
- )}
- />
- );
-}
-
-// A day's "other" answers run to dozens, and the same place is typed over and
-// over. The list is grouped by what was written and bounded to the rows that
-// fit inside the chart's own box; the rest is counted.
-const OTHER_ANSWERS_SHOWN = 6;
-
-function groupOtherAnswers(answers: string[]): { label: string; count: number }[] {
- const groups = new Map<string, { label: string; count: number }>();
- for (const answer of answers) {
- const label = answer.trim();
- if (!label) continue;
- const key = label.toLowerCase();
- const group = groups.get(key);
- if (group) group.count++;
- else groups.set(key, { count: 1, label });
- }
- return [...groups.values()].sort((a, b) => b.count - a.count);
-}
-
-/** One tooltip row: swatch, label, value. */
-function TooltipRow({
- color,
- label,
- value,
-}: {
- color: string | undefined;
- label: React.ReactNode;
- value: string;
-}) {
- return (
- <>
- <div className="size-2.5 shrink-0 rounded-[2px]" style={{ background: color }} />
- <div className="flex flex-1 items-center justify-between gap-3 leading-none">
- <span className="text-muted-foreground">{label}</span>
- <span className="font-mono font-medium text-foreground tabular-nums">{value}</span>
- </div>
- </>
- );
-}
-
-/** The sources tooltip, which carries what "Other" meant: the day's free-text
- * answers hang under that row as an indented bulleted list. */
-function SourcesTooltipContent({
- config,
- ...props
-}: React.ComponentProps<typeof ChartTooltipContent> & { config: ChartConfig }) {
- return (
- <TotalTooltipContent
- {...props}
- formatter={(value, name, item) => {
- const id = String(name);
- const answers = groupOtherAnswers(
- (item.payload as { otherAnswers?: string[] } | undefined)?.otherAnswers ?? [],
- );
- return (
- <>
- <TooltipRow
- color={item.color}
- label={config[id]?.label ?? id}
- value={typeof value === "number" ? value.toLocaleString() : String(value)}
- />
- {id === "other" && answers.length ? (
- <ul className="-mt-1 ml-[1.125rem] w-full list-disc space-y-0.5 pl-3 text-muted-foreground marker:text-muted-foreground/60">
- {answers.slice(0, OTHER_ANSWERS_SHOWN).map((answer) => (
- <li key={answer.label} className="break-words">
- {answer.label}
- {answer.count > 1 ? (
- <span className="text-muted-foreground/70"> ×{answer.count}</span>
- ) : null}
- </li>
- ))}
- {answers.length > OTHER_ANSWERS_SHOWN ? (
- <li className="list-none text-muted-foreground/70">
- +{answers.length - OTHER_ANSWERS_SHOWN} more
- </li>
- ) : null}
- </ul>
- ) : null}
- </>
- );
- }}
- />
- );
-}
-
-const activesConfig = {
- active: { label: "Active", color: "var(--chart-1)" },
- working: { label: "Working", color: "var(--chart-2)" },
-} satisfies ChartConfig;
-
-const signupsConfig = {
- signups: { label: "Signups", color: "var(--chart-1)" },
-} satisfies ChartConfig;
-
-const totalRegisteredConfig = {
- totalRegistered: { label: "Total registered", color: "var(--chart-1)" },
-} satisfies ChartConfig;
-
-// Paid money in the series hues; refunds in their own hue below the
-// baseline; declined attempts in faded neutral ink, since they are a state
-// and never revenue. Cancel requests are the status red, which no bar uses.
-const revenueConfig = {
- pro: { label: "Pro", color: "var(--chart-1)" },
- topups: { label: "Top-ups", color: "var(--chart-2)" },
- other: { label: "Other", color: "var(--chart-3)" },
- refunds: { label: "Refunded", color: "var(--chart-5)" },
- declined: { label: "Declined", color: "color-mix(in oklab, var(--muted-foreground) 45%, transparent)" },
-} satisfies ChartConfig;
-
-type RevenuePoint = {
- day: string;
- pro: number;
- topups: number;
- // Paid charges the pull could tie to neither Pro nor a credit purchase.
- other: number;
- // Negative, so the bar hangs under the baseline.
- refunds: number;
- declined: number;
- cancels: number;
-};
-
-// Per-day dollars from the billing section's micro strings, on its own
-// window (it ends today; the activity window ends yesterday).
-function deriveRevenue(billing: AnalyticsBilling): RevenuePoint[] {
- return billing.days.map((day, i) => {
- const entry = billing.revenue[i];
- return {
- cancels: entry?.cancels ?? 0,
- day,
- declined: dollars(entry?.declinedMicros ?? "0"),
- other: dollars(entry?.otherMicros ?? "0"),
- pro: dollars(entry?.proMicros ?? "0"),
- refunds: -dollars(entry?.refundedMicros ?? "0"),
- topups: dollars(entry?.topupMicros ?? "0"),
- };
- });
-}
-
-const netOf = (point: Pick<RevenuePoint, "pro" | "topups" | "other" | "refunds">) =>
- point.pro + point.topups + point.other + point.refunds;
-
-type BillingEvent = AnalyticsBilling["events"][number];
-
-// What a paid charge bought, from the event's detail.
-const PAID_LABELS: Record<string, string> = { other: "Other", pro: "Pro", topup: "Top-up" };
-const paidLabel = (event: BillingEvent) => PAID_LABELS[event.detail ?? ""] ?? "Paid";
-
-/** Where a canceled subscription stands now: still running until its end
- * date, or already stopped. */
-function cancelStatus(event: BillingEvent): string {
- const day = event.endsAt ? formatDay(event.endsAt.slice(0, 10)) : null;
- if (event.ended) return day ? `ended ${day}` : "ended";
- return day ? `ends ${day}` : "ending";
-}
-
-/** An × on a day with cancel requests, centered in the plot's height. Drawn
- * as the label of an invisible reference line, whose box is the plot's full
- * height at that day's x. It sits inside the plot, so hovering it raises the
- * day's tooltip like any bar, and it takes no pointer events or selection of
- * its own. A halo in the card color keeps it legible over a bar. */
-function CancelMarker({ viewBox }: { viewBox?: { x: number; y: number; height: number } }) {
- if (!viewBox) return null;
- const cx = viewBox.x;
- const cy = viewBox.y + viewBox.height / 2;
- const r = 3.5;
- const d = `M${cx - r} ${cy - r}L${cx + r} ${cy + r}M${cx + r} ${cy - r}L${cx - r} ${cy + r}`;
- return (
- <g pointerEvents="none" style={{ userSelect: "none" }} aria-hidden>
- <path d={d} fill="none" stroke="var(--card)" strokeLinecap="round" strokeWidth={4.5} />
- <path d={d} fill="none" stroke="var(--destructive)" strokeLinecap="round" strokeWidth={2} />
- </g>
- );
-}
-
-/** The revenue tooltip: net on the date row, the day's money rows, then the
- * people behind them: who paid what, whose card was declined and why, and
- * who asked to cancel, with where each subscription stands now. A day with
- * nothing at all shows no tooltip. */
-function RevenueTooltipContent({
- events,
- ...props
-}: React.ComponentProps<typeof ChartTooltipContent> & { events: AnalyticsBilling["events"] }) {
- const point = props.payload?.[0]?.payload as RevenuePoint | undefined;
- const people = point ? events.filter((e) => e.day === point.day) : [];
- const hasMoney = props.payload?.some((item) => item.value !== 0) ?? false;
- if (!hasMoney && people.length === 0) return null;
- return (
- <div className="grid gap-1.5">
- {hasMoney && (
- <TotalTooltipContent
- {...props}
- className="max-w-80"
- format={formatDollars}
- total={() => (point ? netOf(point) : 0)}
- formatter={(value, name, item) => (
- <TooltipRow
- color={item.color}
- label={revenueConfig[name as keyof typeof revenueConfig]?.label ?? String(name)}
- value={formatDollars(typeof value === "number" ? value : 0)}
- />
- )}
- />
- )}
- {people.length > 0 && (
- <div className="max-w-80 space-y-1.5 rounded-lg border border-border/50 bg-background px-2.5 py-1.5 text-xs shadow-xl">
- {people.map((event) => (
- <div key={`${event.kind}-${event.objectId ?? event.email ?? event.day}`}>
- <p className="flex items-center justify-between gap-3">
- {event.kind === "canceled" ? (
- <>
- <span className="font-medium text-destructive">canceled</span>
- <span className="font-medium text-foreground">{cancelStatus(event)}</span>
- </>
- ) : (
- <>
- <span className={cn("font-medium", event.kind === "declined" ? "text-muted-foreground" : "text-foreground")}>
- {event.kind === "declined" ? "declined" : paidLabel(event)}
- </span>
- <span className="font-medium text-foreground tabular-nums">{formatMicros(event.amountMicros ?? "0")}</span>
- </>
- )}
- </p>
- <p className="text-muted-foreground">{event.email ?? "unknown customer"}</p>
- {event.kind === "declined" && event.detail && <p className="text-muted-foreground">{event.detail}</p>}
- </div>
- ))}
- </div>
- )}
- </div>
- );
-}
-
-// Stripe dashboard destinations for the billing figures.
-const stripeLinks = (base: string) => ({
- canceled: `${base}/subscriptions?status=canceled`,
- declined: `${base}/payments?status%5B%5D=failed`,
- paid: `${base}/payments?status%5B%5D=successful`,
- payment: (id: string) => `${base}/payments/${id}`,
- payments: `${base}/payments`,
- refunded: `${base}/payments?status%5B%5D=refunded`,
- subscribers: `${base}/subscriptions?status=active`,
- subscription: (id: string) => `${base}/subscriptions/${id}`,
-});
-
-function StripeLink({
- href,
- children,
- className,
-}: {
- href: string;
- children: React.ReactNode;
- className?: string;
-}) {
- return (
- <a
- href={href}
- target="_blank"
- rel="noreferrer"
- className={cn(
- "inline-flex items-center gap-0.5 underline-offset-4 hover:text-foreground hover:underline",
- className,
- )}
- >
- {children}
- <ArrowUpRight className="size-3 shrink-0" aria-hidden />
- </a>
- );
-}
-
-// The most recent declines and cancel requests shown under the chart; the
-// rest sit behind the Stripe link.
-const BILLING_EVENTS_SHOWN = 10;
-
-// The dashboard blocks in their default order. The ids are the saved-layout
-// contract: renaming one drops that block back to its default position.
-const TILE_IDS = [
- "registered",
- "activeYesterday",
- "active7d",
- "balance",
- "pro",
- "funded",
- "churn",
- "declined",
-] as const;
-const CARD_IDS = [
- "actives",
- "signups",
- "referralSources",
- "referralResponses",
- "revenue",
- "totalRegistered",
-] as const;
-type TileId = (typeof TILE_IDS)[number];
-type CardId = (typeof CARD_IDS)[number];
-
-function StatTile({
- label,
- value,
- sub,
- href,
-}: {
- label: string;
- value: string;
- sub: React.ReactNode;
- // Where the figure lives in Stripe; the label becomes the link.
- href?: string;
-}) {
- return (
- <div className="rounded-xl border bg-card p-5">
- <p className="text-sm text-muted-foreground">
- {href ? <StripeLink href={href}>{label}</StripeLink> : label}
- </p>
- <p className="mt-1 text-2xl font-semibold">{value}</p>
- <p className="mt-1 text-xs text-muted-foreground">{sub}</p>
- </div>
- );
-}
-
-function ChartCard({
- title,
- subtitle,
- className,
- children,
-}: {
- title: string;
- subtitle: React.ReactNode;
- className?: string;
- children: React.ReactNode;
-}) {
- return (
- <div className={cn("min-w-0 overflow-hidden rounded-xl border bg-card p-5", className)}>
- <p className="font-medium">{title}</p>
- <p className="text-sm text-muted-foreground">{subtitle}</p>
- <div className="mt-4">{children}</div>
- </div>
- );
-}
-
-function ActivityDot({
- mask,
- workBits,
- unknown,
-}: {
- mask: number;
- workBits: number;
- unknown: boolean;
-}) {
- const worked = (mask & workBits) !== 0;
- const visited = mask !== 0;
- return (
- <span
- className={cn(
- "block size-2 rounded-full",
- unknown
- ? "border border-dashed border-muted-foreground/50"
- : worked
- ? "bg-[var(--chart-1)]"
- : visited
- ? "bg-[var(--chart-1)] opacity-40"
- : "bg-muted",
- )}
- />
- );
-}
-
-// How close to the end of the loaded rows the window may come before the next
-// page is asked for, so scrolling meets rows that are already there.
-const LOAD_AHEAD_ROWS = 20;
-
-function ActivityGrid({
- summary,
- workBits,
- missingDays,
-}: {
- summary: AnalyticsSummary;
- workBits: number;
- missingDays: Set<string>;
-}) {
- const [sort, setSort] = useLocalPref<UserSort>(
- "su-analytics-user-sort",
- "active",
- (v) => USER_SORTS.some((option) => option.id === v),
- );
- // Ranked on the server, a page at a time: the browser holds the rows it has
- // scrolled to, never every account.
- const paged = useAnalyticsUsers(sort, summary.generatedAt);
- const users: RankedUser[] = useMemo(
- () => paged.data?.pages.flatMap((page) => page.users) ?? [],
- [paged.data],
- );
- const total = paged.data?.pages[0]?.total ?? 0;
- // A row marks itself processed on click and stays marked across visits, so
- // a pass through the list can pick up where it left off.
- const [processedIds, setProcessedIds] = useLocalPref<string[]>(
- "su-analytics-processed-users",
- [],
- (v) => Array.isArray(v) && v.every((x) => typeof x === "string"),
- );
- const processed = useMemo(() => new Set(processedIds), [processedIds]);
- const toggleProcessed = (id: string) =>
- setProcessedIds((prev) => (prev.includes(id) ? prev.filter((x) => x !== id) : [...prev, id]));
- const markProcessed = (id: string) =>
- setProcessedIds((prev) => (prev.includes(id) ? prev : [...prev, id]));
- const processedCount = processedIds.length;
- const body = useRef<HTMLTableSectionElement>(null);
- const rows = useRowWindow(users.length, body);
- // Scrolling near the end of what is loaded pulls the next page.
- const { fetchNextPage, hasNextPage, isFetchingNextPage } = paged;
- useEffect(() => {
- if (hasNextPage && !isFetchingNextPage && rows.end >= users.length - LOAD_AHEAD_ROWS) {
- void fetchNextPage();
- }
- }, [fetchNextPage, hasNextPage, isFetchingNextPage, rows.end, users.length]);
- // A row's email button puts the account on the outreach list and opens the
- // same note the Outreach tab writes, so a busy user gets a word or a deal
- // from here.
- // The dialog opens on the click and fills in when the row lands.
- const outreach = useOutreachAction();
- const [sendTarget, setSendTarget] = useState<OutreachRow | null>(null);
- const [opening, setOpening] = useState<{ name: string; email: string } | null>(null);
- // Emailing an account is processing it, so the row highlights on the click
- // and stays highlighted once the note is out.
- const emailUser = (user: { id: string; name: string; email: string }) => {
- markProcessed(user.id);
- setOpening({ name: user.name, email: user.email });
- outreach.mutate(
- { action: "add", email: user.email },
- {
- onError: () => setOpening(null),
- onSuccess: (result) => {
- setSendTarget(result.row);
- setOpening(null);
- },
- },
- );
- };
-
- // Newest day sits in the leftmost column so the current dots are in view
- // before any horizontal scroll; each column keeps its index into the
- // activity masks.
- const columns = useMemo(
- () => summary.days.map((day, i) => ({ day, i, unknown: missingDays.has(day) })).reverse(),
- [summary.days, missingDays],
- );
- const columnCount = columns.length + 1;
-
- // A dot's tooltip is built when the pointer reaches it. Building one per
- // cell up front was the bulk of the page's arrival cost.
- const describeDot = (event: React.PointerEvent<HTMLTableSectionElement>) => {
- const cell = (event.target as HTMLElement).closest<HTMLElement>("[data-dot]");
- if (!cell || cell.title) return;
- const user = users[Number(cell.dataset.user)];
- const column = columns[Number(cell.dataset.col)];
- if (!user || !column) return;
- const mask = user.activity[column.i] ?? 0;
- const when = formatDay(column.day);
- cell.title = column.unknown
- ? `${user.email} — ${when}: no data`
- : mask === 0
- ? `${user.email} — ${when}: inactive`
- : `${user.email} — ${when}: ${summary.sources.filter((_, i) => (mask & (1 << i)) !== 0).join(", ")}`;
- };
-
- return (
- <div className="rounded-xl border bg-card p-5">
- <div className="flex flex-wrap items-start justify-between gap-3">
- <div>
- <p className="font-medium">User activity</p>
- <p className="text-sm text-muted-foreground">
- One dot per user per day, last {summary.days.length} days
- {missingDays.size > 0 && ` · ${missingDays.size} without data`}
- {total > 0 && ` · ${users.length.toLocaleString("en-US")} of ${total.toLocaleString("en-US")} accounts loaded`}
- {processedCount > 0 && (
- <>
- {" "}
- · {processedCount} processed{" "}
- <button
- type="button"
- className="underline underline-offset-2 hover:text-foreground"
- onClick={() => setProcessedIds([])}
- >
- clear
- </button>
- </>
- )}
- </p>
- </div>
- <div className="flex flex-wrap items-center gap-1.5">
- {USER_SORTS.map((option) => (
- <button
- key={option.id}
- type="button"
- aria-pressed={sort === option.id}
- onClick={() => setSort(option.id)}
- className={cn(
- "rounded-full border px-2.5 py-1 text-xs transition-colors",
- sort === option.id
- ? "border-border bg-muted"
- : "border-transparent text-muted-foreground hover:bg-muted/60",
- )}
- >
- {option.label}
- </button>
- ))}
- </div>
- </div>
- <div className="mt-4 overflow-x-auto">
- <table className="border-separate border-spacing-0">
- <thead>
- <tr>
- <th className="sticky left-0 z-10 bg-card" />
- {columns.map(({ day }, col) => (
- <th
- key={day}
- className="pb-2 text-left text-[10px] font-normal whitespace-nowrap text-muted-foreground"
- >
- {col === 0 || day.endsWith("-01") ? formatDay(day) : ""}
- </th>
- ))}
- </tr>
- </thead>
- <tbody ref={body} onPointerOver={describeDot}>
- {rows.above > 0 && (
- <tr aria-hidden>
- <td colSpan={columnCount} className="p-0" style={{ height: rows.above }} />
- </tr>
- )}
- {users.slice(rows.start, rows.end).map((user, offset) => {
- const index = rows.start + offset;
- const isProcessed = processed.has(user.id);
- return (
- <tr
- key={user.id}
- data-row=""
- aria-selected={isProcessed}
- className={cn(
- "group cursor-pointer transition-colors",
- isProcessed
- ? PROCESSED_ROW
- : "hover:bg-[color-mix(in_oklab,var(--muted)_50%,var(--card))]",
- )}
- onClick={() => toggleProcessed(user.id)}
- >
- <td
- className={cn(
- "sticky left-0 z-10 py-1 pr-12 pl-6 whitespace-nowrap transition-colors",
- isProcessed
- ? PROCESSED_ROW
- : "bg-card group-hover:bg-[color-mix(in_oklab,var(--muted)_50%,var(--card))]",
- )}
- >
- <span
- aria-hidden
- className={cn(
- "absolute inset-y-0 left-0 my-auto flex size-4 items-center justify-center rounded-full border transition-colors",
- isProcessed
- ? "border-[var(--chart-1)] bg-[var(--chart-1)] text-white"
- : "border-border opacity-0 group-hover:opacity-100",
- )}
- >
- {isProcessed && <Check className="size-3" strokeWidth={3} />}
- </span>
- {/* Pinned in the cell's right padding, so showing it moves
- nothing. */}
- <Button
- aria-label={`Email ${user.name}`}
- className="absolute inset-y-0 right-2 my-auto opacity-0 group-hover:opacity-100 focus-visible:opacity-100"
- onClick={(event) => {
- event.stopPropagation();
- emailUser(user);
- }}
- size="icon-sm"
- variant="ghost"
- >
- <Mail />
- </Button>
- <span className="flex items-center gap-1.5">
- <span className="block max-w-56 truncate text-sm" title={user.name}>
- {user.email}
- </span>
- {user.superUser === true && (
- <span className="rounded-sm bg-muted px-1 text-[10px] text-muted-foreground">
- su
- </span>
- )}
- </span>
- <span className="block text-xs text-muted-foreground">
- {user.activeDays === 0
- ? "no activity"
- : `${user.activeDays} active ${user.activeDays === 1 ? "day" : "days"} · last ${formatDay(summary.days[user.lastActive])}`}{" "}
- · joined {formatDay(user.registeredAt.slice(0, 10))} ·{" "}
- {formatMicros(user.balanceMicros)}
- {user.fundedMicros !== undefined && (
- <span className="text-emerald-700 dark:text-emerald-500">
- {" "}
- · paid {formatMicros(user.fundedMicros)}
- </span>
- )}
- {user.storageBytes !== undefined && (
- <span
- className={storageTone(Number(user.storageBytes), user.storageQuotaBytes)}
- title={
- user.storageQuotaBytes == null
- ? "unlimited storage"
- : `of ${formatGb(user.storageQuotaBytes)}`
- }
- >
- {" "}
- · {formatGb(Number(user.storageBytes))}
- </span>
- )}
- </span>
- </td>
- {columns.map(({ day, i, unknown }, col) => (
- <td key={day} className="p-0.5" data-dot data-user={index} data-col={col}>
- <ActivityDot
- mask={user.activity[i] ?? 0}
- unknown={unknown}
- workBits={workBits}
- />
- </td>
- ))}
- </tr>
- );
- })}
- {rows.below > 0 && (
- <tr aria-hidden>
- <td colSpan={columnCount} className="p-0" style={{ height: rows.below }} />
- </tr>
- )}
- {(paged.isPending || paged.isFetchingNextPage || paged.isError) && (
- <tr>
- <td
- className="sticky left-0 z-10 bg-card py-2 pl-6 text-sm text-muted-foreground"
- colSpan={columnCount}
- >
- {paged.isError ? "Couldn\u2019t load accounts." : "Loading accounts\u2026"}
- </td>
- </tr>
- )}
- </tbody>
- </table>
- </div>
- <p className="mt-3 flex items-center gap-4 text-xs text-muted-foreground">
- <span className="flex items-center gap-1.5">
- <span className="size-2 rounded-full bg-[var(--chart-1)]" /> worked
- </span>
- <span className="flex items-center gap-1.5">
- <span className="size-2 rounded-full bg-[var(--chart-1)] opacity-40" /> visited only
- </span>
- <span className="flex items-center gap-1.5">
- <span className="size-2 rounded-full bg-muted" /> inactive
- </span>
- <span className="flex items-center gap-1.5">
- <span className="size-2 rounded-full border border-dashed border-muted-foreground/50" /> no
- data
- </span>
- </p>
- {outreach.isError ? (
- <p className="mt-2 text-sm text-destructive">Couldn&apos;t put that account on the outreach list.</p>
- ) : null}
- <OutreachComposeDialog
- onClose={() => {
- setSendTarget(null);
- setOpening(null);
- }}
- opening={opening}
- target={sendTarget}
- />
- </div>
- );
-}
-
-export default function SuAnalyticsPage() {
- const summaryQuery = useAnalyticsSummary();
- const referrals = useMemo(
- () => (summaryQuery.data?.referrals ? deriveReferrals(summaryQuery.data.referrals) : null),
- [summaryQuery.data],
- );
- const billingSection = summaryQuery.data?.billing;
- const revenue = useMemo(
- () => (billingSection && "days" in billingSection ? deriveRevenue(billingSection) : null),
- [billingSection],
- );
- // Trend lines toggled off stay off across visits.
- const [hiddenTrends, setHiddenTrends] = useLocalPref<string[]>(
- "su-referral-hidden-trends",
- [],
- (v) => Array.isArray(v) && v.every((x) => typeof x === "string"),
- );
- // The layout is the reader's: every tile and card drags into any order, and
- // the arrangement sticks per browser. The user grid stays pinned last.
- const tiles = useReorder("su-analytics-tile-order", TILE_IDS);
- const cards = useReorder("su-analytics-card-order", CARD_IDS);
-
- if (summaryQuery.isPending) return <SuStandIn />;
-
- if (summaryQuery.error || !summaryQuery.data) {
- const noData = summaryQuery.error instanceof ApiError && summaryQuery.error.status === 404;
- return (
- <div className="rounded-xl border bg-card p-5 text-sm text-muted-foreground">
- {noData
- ? "No data yet — the nightly analytics job hasn't produced a rollup. Run the analytics-daily job and refresh."
- : "Couldn't load analytics."}
- </div>
- );
- }
-
- const summary = summaryQuery.data;
- const missingDays = new Set(summary.missing);
- const workBits = workBitsOf(summary.sources);
- const deltaPct =
- summary.active7d !== null && summary.activePrior7d !== null && summary.activePrior7d > 0
- ? `${(((summary.active7d - summary.activePrior7d) / summary.activePrior7d) * 100).toFixed(1)}%`
- : null;
- const count = (n: number | null) => (n === null ? "—" : n.toLocaleString("en-US"));
- const lastDay = summary.days[summary.days.length - 1];
- // Billing is absent from rollups written before it shipped (or before it
- // took this shape); the next run fills it in.
- const billing = summary.billing && "days" in summary.billing ? summary.billing : undefined;
- const churnBase = billing ? billing.subscribers + billing.churned : 0;
- const staleBilling = "not in this rollup yet — run analytics";
- const links = billing ? stripeLinks(billing.dashboardUrl) : undefined;
- const nextCancel = billing?.canceling[0];
-
- const tileNodes: Record<TileId, React.ReactNode> = {
- registered: (
- <StatTile
- label="Registered users"
- value={summary.registered.toLocaleString("en-US")}
- sub={`+${summary.signups7d} in the last 7 days`}
- />
- ),
- activeYesterday: (
- <StatTile
- label="Active yesterday"
- value={count(summary.activeYesterday)}
- sub={
- summary.activeYesterday === null
- ? `no extract for ${formatDay(lastDay)} yet`
- : `of ${summary.registered.toLocaleString("en-US")} registered`
- }
- />
- ),
- active7d: (
- <StatTile
- label="Active last 7 days"
- value={count(summary.active7d)}
- sub={
- summary.active7d === null ? (
- "no extracts for the last 7 days"
- ) : deltaPct === null ? (
- "no prior-week baseline"
- ) : (
- <>
- <span
- className={cn(
- deltaPct.startsWith("-")
- ? "text-destructive"
- : "text-emerald-700 dark:text-emerald-500",
- )}
- >
- {deltaPct.startsWith("-") ? deltaPct : `+${deltaPct}`}
- </span>{" "}
- vs prior 7 days
- </>
- )
- }
- />
- ),
- balance: (
- <StatTile
- label="Outstanding balance"
- value={formatMicros(summary.balanceMicros)}
- sub="credits across all accounts"
- />
- ),
- pro: (
- <StatTile
- label="Pro subscribers"
- value={billing ? billing.subscribers.toLocaleString("en-US") : "—"}
- href={links?.subscribers}
- sub={
- !billing ? (
- staleBilling
- ) : billing.canceling.length === 0 ? (
- "none canceling"
- ) : (
- <StripeLink
- href={
- nextCancel && billing.canceling.length === 1
- ? `${billing.dashboardUrl}/subscriptions/${nextCancel.subscriptionId}`
- : `${billing.dashboardUrl}/subscriptions?status=active`
- }
- >
- {billing.canceling.length} canceling
- {nextCancel?.endsAt ? ` · ends ${formatDay(nextCancel.endsAt.slice(0, 10))}` : ""}
- </StripeLink>
- )
- }
- />
- ),
- funded: (
- <StatTile
- label="People funded"
- value={billing ? billing.funded.toLocaleString("en-US") : "—"}
- href={links?.paid}
- sub={
- billing ? `${formatMicros(billing.fundedMicros)} paid all time` : staleBilling
- }
- />
- ),
- churn: (
- <StatTile
- label="Churn rate"
- value={
- billing && churnBase > 0
- ? `${((billing.churned / churnBase) * 100).toFixed(1)}%`
- : "—"
- }
- href={links?.canceled}
- sub={
- !billing
- ? staleBilling
- : churnBase === 0
- ? "no subscriptions yet"
- : `${billing.churned} of ${churnBase} subscriptions ended`
- }
- />
- ),
- declined: (
- <StatTile
- label="Tried to pay"
- value={billing ? billing.window.declinedCustomers.toLocaleString("en-US") : "—"}
- href={links?.declined}
- sub={
- billing
- ? `${formatMicros(billing.window.declinedMicros)} declined · ${billing.window.abandonedCheckouts} checkouts abandoned, last 60 days`
- : staleBilling
- }
- />
- ),
- };
-
- // Column spans belong to the grid's own children — the drag blocks — so a
- // card that should fill the row says so here rather than on the card inside
- // it, where `col-span` would have nothing to act on.
- const cardSpan: Partial<Record<CardId, string>> = {
- ...(revenue ? {} : { totalRegistered: "xl:col-span-2" }),
- };
-
- // A card the rollup can't fill stays out of the record; the saved order
- // skips it.
- const cardNodes: Partial<Record<CardId, React.ReactNode>> = {
- actives: (
- <ChartCard
- title="Active users"
- subtitle={
- missingDays.size > 0
- ? `Daily actives, last 60 days · ${missingDays.size} days without data are left blank`
- : "Daily actives, last 60 days"
- }
- >
- <ChartContainer className="w-full" config={activesConfig}>
- <AreaChart accessibilityLayer data={summary.series} margin={{ left: -16 }}>
- <CartesianGrid vertical={false} />
- <XAxis
- axisLine={false}
- dataKey="day"
- minTickGap={32}
- tickFormatter={formatDay}
- tickLine={false}
- tickMargin={8}
- />
- <YAxis allowDecimals={false} axisLine={false} tickLine={false} width={48} />
- <ChartTooltip
- content={
- <TotalTooltipContent
- total={(payload) => {
- const active = payload.find((item) => item.dataKey === "active");
- return typeof active?.value === "number" ? active.value : 0;
- }}
- />
- }
- />
- <Area
- dataKey="active"
- dot={false}
- fill="var(--color-active)"
- fillOpacity={0.1}
- stroke="var(--color-active)"
- strokeWidth={2}
- type="monotone"
- />
- <Area
- dataKey="working"
- dot={false}
- fill="var(--color-working)"
- fillOpacity={0.1}
- stroke="var(--color-working)"
- strokeWidth={2}
- type="monotone"
- />
- <ChartLegend content={<ChartLegendContent />} />
- </AreaChart>
- </ChartContainer>
- </ChartCard>
- ),
- signups: (
- <ChartCard
- title="Signups"
- subtitle={`New registrations per day · ${summary.signupsWindow.toLocaleString("en-US")} in the last 60 days`}
- >
- <ChartContainer className="w-full" config={signupsConfig}>
- <BarChart accessibilityLayer data={summary.series} margin={{ left: -16 }}>
- <CartesianGrid vertical={false} />
- <XAxis
- axisLine={false}
- dataKey="day"
- minTickGap={32}
- tickFormatter={formatDay}
- tickLine={false}
- tickMargin={8}
- />
- <YAxis allowDecimals={false} axisLine={false} tickLine={false} width={48} />
- <ChartTooltip content={<TotalTooltipContent />} />
- <Bar
- dataKey="signups"
- fill="var(--color-signups)"
- maxBarSize={24}
- radius={[4, 4, 0, 0]}
- />
- </BarChart>
- </ChartContainer>
- </ChartCard>
- ),
- totalRegistered: (
- <ChartCard title="Total registered" subtitle="Cumulative registrations, last 60 days">
- <ChartContainer className="max-h-56 w-full" config={totalRegisteredConfig}>
- <AreaChart accessibilityLayer data={summary.series} margin={{ left: -16 }}>
- <CartesianGrid vertical={false} />
- <XAxis
- axisLine={false}
- dataKey="day"
- minTickGap={32}
- tickFormatter={formatDay}
- tickLine={false}
- tickMargin={8}
- />
- <YAxis
- allowDecimals={false}
- axisLine={false}
- domain={["auto", "auto"]}
- tickLine={false}
- width={48}
- />
- <ChartTooltip content={<TotalTooltipContent />} />
- <Area
- dataKey="totalRegistered"
- dot={false}
- fill="var(--color-totalRegistered)"
- fillOpacity={0.1}
- stroke="var(--color-totalRegistered)"
- strokeWidth={2}
- type="monotone"
- />
- </AreaChart>
- </ChartContainer>
- </ChartCard>
- ),
- ...(referrals
- ? {
- referralResponses: (
- <ChartCard
- title="Referral responses"
- subtitle={`Running totals by source · ${referrals.respondents.toLocaleString("en-US")} users answered all time`}
- >
- <ChartContainer className="w-full" config={referrals.trendConfig}>
- <LineChart accessibilityLayer data={referrals.cumulative} margin={{ left: -16 }}>
- <CartesianGrid vertical={false} />
- <XAxis
- axisLine={false}
- dataKey="day"
- minTickGap={32}
- tickFormatter={formatDay}
- tickLine={false}
- tickMargin={8}
- />
- <YAxis allowDecimals={false} axisLine={false} tickLine={false} width={48} />
- <ChartTooltip
- content={
- <TotalTooltipContent
- total={(payload) => {
- const all = payload.find((item) => item.dataKey === "totalResponses");
- return typeof all?.value === "number" ? all.value : 0;
- }}
- />
- }
- />
- {Object.keys(referrals.trendConfig)
- .filter((id) => !hiddenTrends.includes(id))
- .map((id) => (
- <Line
- key={id}
- dataKey={id}
- dot={false}
- stroke={`var(--color-${id})`}
- strokeWidth={2}
- type="monotone"
- />
- ))}
- </LineChart>
- </ChartContainer>
- {/* The legend doubles as the filter: a chip toggles its line, and
- the choice sticks (localStorage). */}
- <div className="mt-3 flex flex-wrap items-center gap-1.5">
- {Object.entries(referrals.trendConfig).map(([id, entry]) => {
- const off = hiddenTrends.includes(id);
- return (
- <button
- key={id}
- type="button"
- aria-pressed={!off}
- title={off ? "Show" : "Hide"}
- onClick={() =>
- setHiddenTrends(
- off ? hiddenTrends.filter((h) => h !== id) : [...hiddenTrends, id],
- )
- }
- className={cn(
- "flex items-center gap-1.5 rounded-full border px-2.5 py-1 text-xs transition-colors",
- off
- ? "border-transparent bg-muted text-muted-foreground"
- : "border-border hover:bg-muted/60",
- )}
- >
- <span
- className={cn("size-2 rounded-full", off && "opacity-30")}
- style={{ background: "color" in entry ? entry.color : undefined }}
- />
- {entry.label}
- </button>
- );
- })}
- </div>
- </ChartCard>
- ),
- referralSources: (
- <ChartCard
- title="Referral sources"
- subtitle="Onboarding answers per day, by source · one user can pick several"
- >
- <ChartContainer className="w-full" config={referrals.config}>
- <BarChart accessibilityLayer data={referrals.series} margin={{ left: -16 }}>
- <CartesianGrid vertical={false} />
- <XAxis
- axisLine={false}
- dataKey="day"
- minTickGap={32}
- tickFormatter={formatDay}
- tickLine={false}
- tickMargin={8}
- />
- <YAxis allowDecimals={false} axisLine={false} tickLine={false} width={48} />
- <ChartTooltip
- content={
- <SourcesTooltipContent config={referrals.config} />
- }
- />
- {Object.keys(referrals.config).map((id) => (
- <Bar
- key={id}
- dataKey={id}
- fill={`var(--color-${id})`}
- maxBarSize={24}
- stackId="sources"
- />
- ))}
- </BarChart>
- </ChartContainer>
- {/* The legend renders as its own row below the plot, in the
- survey's order, so it wraps freely at narrow widths. */}
- <div className="mt-3 flex flex-wrap items-center gap-x-4 gap-y-1.5 text-xs text-muted-foreground">
- {Object.entries(referrals.config).map(([id, entry]) => (
- <span key={id} className="flex items-center gap-1.5 whitespace-nowrap">
- <span
- className="size-2 shrink-0 rounded-full"
- style={{ background: "color" in entry ? entry.color : undefined }}
- />
- {entry.label}
- </span>
- ))}
- </div>
- </ChartCard>
- ),
- }
- : {}),
- ...(revenue && billing && links
- ? {
- revenue: (
- <ChartCard
- title="Revenue"
- subtitle={
- <span className="flex flex-wrap gap-x-3 gap-y-1">
- <StripeLink href={links.paid}>
- {formatMicros(billing.window.netMicros)} net
- </StripeLink>
- <StripeLink href={links.refunded}>
- {formatMicros(billing.window.refundedMicros)} refunded
- </StripeLink>
- <StripeLink href={links.declined}>
- {formatMicros(billing.window.declinedMicros)} declined
- </StripeLink>
- <StripeLink href={links.canceled}>
- {billing.window.cancels} canceled
- </StripeLink>
- <span>· last 60 days</span>
- </span>
- }
- >
- <ChartContainer className="max-h-56 w-full" config={revenueConfig}>
- {/* The money and the declined bars are two stacks, which the
- chart would set side by side in each day's band; a gap
- equal to a slot lays them over each other, so the bar
- sits on the band's center with the hover band and the
- cancel dot. */}
- <BarChart
- accessibilityLayer
- barGap="-80%"
- data={revenue}
- margin={{ left: -16 }}
- >
- <CartesianGrid vertical={false} />
- <XAxis
- axisLine={false}
- dataKey="day"
- minTickGap={32}
- tickFormatter={formatDay}
- tickLine={false}
- tickMargin={8}
- />
- <YAxis
- axisLine={false}
- tickFormatter={(value) => formatDollars(Number(value))}
- tickLine={false}
- width={48}
- />
- <ChartTooltip content={<RevenueTooltipContent events={billing.events} />} />
- {revenue
- .filter((point) => point.cancels > 0)
- .map((point) => (
- <ReferenceLine
- key={point.day}
- x={point.day}
- stroke="none"
- label={<CancelMarker />}
- />
- ))}
- <Bar dataKey="pro" fill="var(--color-pro)" maxBarSize={24} stackId="money" />
- <Bar dataKey="topups" fill="var(--color-topups)" maxBarSize={24} stackId="money" />
- {revenue.some((point) => point.other > 0) && (
- <Bar dataKey="other" fill="var(--color-other)" maxBarSize={24} stackId="money" />
- )}
- <Bar dataKey="refunds" fill="var(--color-refunds)" maxBarSize={24} stackId="money" />
- <Bar dataKey="declined" fill="var(--color-declined)" maxBarSize={24} stackId="declined" />
- <ChartLegend content={<ChartLegendContent />} />
- </BarChart>
- </ChartContainer>
- {billing.events.length > 0 && (
- <ul className="mt-3 space-y-1 text-xs text-muted-foreground">
- {billing.events.slice(0, BILLING_EVENTS_SHOWN).map((event) => {
- const href =
- event.kind === "canceled"
- ? event.objectId
- ? links.subscription(event.objectId)
- : links.canceled
- : event.objectId
- ? links.payment(event.objectId)
- : event.kind === "paid"
- ? links.paid
- : links.declined;
- return (
- <li
- key={`${event.kind}-${event.objectId ?? event.day}`}
- className="flex flex-wrap items-baseline gap-x-2"
- >
- <span className="w-12 shrink-0 tabular-nums">{formatDay(event.day)}</span>
- <StripeLink href={href} className="text-foreground">
- {event.kind === "canceled"
- ? "canceled"
- : event.kind === "paid"
- ? `${formatMicros(event.amountMicros ?? "0")} ${paidLabel(event)}`
- : `${formatMicros(event.amountMicros ?? "0")} declined`}
- </StripeLink>
- {event.kind === "canceled" && (
- <span className="shrink-0 text-foreground">{cancelStatus(event)}</span>
- )}
- <span className="truncate">{event.email ?? "unknown customer"}</span>
- {event.kind === "declined" && event.detail && (
- <span className="min-w-0 flex-1 truncate" title={event.detail}>
- {event.detail}
- </span>
- )}
- </li>
- );
- })}
- {billing.events.length > BILLING_EVENTS_SHOWN && (
- <li>
- <StripeLink href={links.payments}>
- +{billing.events.length - BILLING_EVENTS_SHOWN} more in Stripe
- </StripeLink>
- </li>
- )}
- </ul>
- )}
- </ChartCard>
- ),
- }
- : {}),
- };
-
- return (
- <div className="space-y-6 pb-9">
- <div className="grid gap-4 sm:grid-cols-2 xl:grid-cols-4" {...tiles.containerProps}>
- {tiles.order.map((id) => (
- <DragBlock key={id} {...tiles.blockProps(id)}>
- {tileNodes[id]}
- </DragBlock>
- ))}
- </div>
-
- <div className="grid gap-6 xl:grid-cols-2" {...cards.containerProps}>
- {cards.order
- .filter((id) => cardNodes[id] !== undefined)
- .map((id) => (
- <DragBlock key={id} {...cards.blockProps(id)} className={cardSpan[id]}>
- {cardNodes[id]}
- </DragBlock>
- ))}
- </div>
-
- <ActivityGrid missingDays={missingDays} summary={summary} workBits={workBits} />
-
- <p className="text-xs text-muted-foreground">
- From the nightly rollup generated{" "}
- {new Date(summary.generatedAt).toLocaleString("en-US", { timeZoneName: "short" })}.
- </p>
- </div>
- );
-}
diff --git a/site/src/app/su/analytics/rowWindow.ts b/site/src/app/su/analytics/rowWindow.ts
deleted file mode 100644
index 92f885fc..00000000
--- a/site/src/app/su/analytics/rowWindow.ts
+++ /dev/null
@@ -1,90 +0,0 @@
-"use client";
-
-import { useEffect, useState, type RefObject } from "react";
-
-/**
- * Which rows of a long table are on screen.
- *
- * A table of every account, sixty cells a row, is tens of thousands of nodes;
- * React builds all of them on arrival and again on every sort, and the page
- * holds the thread for seconds each time. This keeps the rows to the ones in
- * view plus a margin: a spacer above and below stands in for the rest, so the
- * scrollbar and the sticky column read as if the table were whole.
- *
- * Rows are one height, measured from the first data row rendered (marked
- * data-row, so the spacer above it is skipped). The scroll
- * handler books one animation frame and reads layout once inside it.
- */
-export interface RowWindow {
- start: number;
- end: number;
- /** Pixels standing in for the rows left out above and below. */
- above: number;
- below: number;
-}
-
-const ROW_HEIGHT_GUESS = 44;
-const OVERSCAN = 16;
-
-// The nearest ancestor that scrolls vertically. Overflow set on one axis
-// computes to auto on the other, so the table's own sideways wrapper reads
-// as a vertical scroller too; asking for real vertical overflow skips it.
-function scrollParentOf(el: HTMLElement): HTMLElement | null {
- for (let node = el.parentElement; node; node = node.parentElement) {
- const overflow = getComputedStyle(node).overflowY;
- if ((overflow === "auto" || overflow === "scroll") && node.scrollHeight > node.clientHeight) {
- return node;
- }
- }
- return null;
-}
-
-export function useRowWindow(
- count: number,
- body: RefObject<HTMLTableSectionElement | null>,
-): RowWindow {
- const [rowHeight, setRowHeight] = useState(ROW_HEIGHT_GUESS);
- const [range, setRange] = useState(() => ({ start: 0, end: Math.min(count, 40) }));
-
- useEffect(() => {
- const el = body.current;
- if (!el) return;
- const scroller = scrollParentOf(el);
- let frame = 0;
- const measure = () => {
- frame = 0;
- const probe = el.querySelector<HTMLTableRowElement>("tr[data-row]");
- const h = probe?.offsetHeight;
- if (h && h !== rowHeight) {
- setRowHeight(h);
- return;
- }
- const viewTop = scroller
- ? scroller.getBoundingClientRect().top - el.getBoundingClientRect().top
- : -el.getBoundingClientRect().top;
- const viewHeight = scroller ? scroller.clientHeight : window.innerHeight;
- const start = Math.min(count, Math.max(0, Math.floor(viewTop / rowHeight) - OVERSCAN));
- const end = Math.min(
- count,
- Math.max(start, Math.ceil((viewTop + viewHeight) / rowHeight) + OVERSCAN),
- );
- setRange((r) => (r.start === start && r.end === end ? r : { start, end }));
- };
- const schedule = () => {
- if (!frame) frame = requestAnimationFrame(measure);
- };
- measure();
- const target: EventTarget = scroller ?? window;
- target.addEventListener("scroll", schedule, { passive: true });
- window.addEventListener("resize", schedule);
- return () => {
- if (frame) cancelAnimationFrame(frame);
- target.removeEventListener("scroll", schedule);
- window.removeEventListener("resize", schedule);
- };
- }, [body, count, rowHeight]);
-
- const start = Math.min(range.start, count);
- const end = Math.min(range.end, count);
- return { above: start * rowHeight, below: (count - end) * rowHeight, end, start };
-}
diff --git a/site/src/app/su/analytics/social/page.tsx b/site/src/app/su/analytics/social/page.tsx
deleted file mode 100644
index 8eb788bc..00000000
--- a/site/src/app/su/analytics/social/page.tsx
+++ /dev/null
@@ -1,9 +0,0 @@
-"use client";
-
-export default function SuSocialAnalyticsPage() {
- return (
- <div className="flex h-full items-center justify-center pb-9">
- <p className="text-sm text-muted-foreground">No social data yet.</p>
- </div>
- );
-}
diff --git a/site/src/app/su/blog/NewPostButton.tsx b/site/src/app/su/blog/NewPostButton.tsx
deleted file mode 100644
index fbb1e8f4..00000000
--- a/site/src/app/su/blog/NewPostButton.tsx
+++ /dev/null
@@ -1,29 +0,0 @@
-"use client";
-
-import { usePathname, useRouter } from "next/navigation";
-import { suPublicPath } from "@/app/su/nav";
-
-import { Button } from "@/components/ui/button";
-import { useCreateBlogPost } from "@/queries/blog";
-
-// Makes a draft and opens it. The draft exists before a word is typed so the
-// editor has a post id to upload images under. The button belongs to the
-// list; an open post carries its own actions.
-export function NewPostButton() {
- const pathname = suPublicPath(usePathname());
- const router = useRouter();
- const create = useCreateBlogPost();
- if (pathname !== "/blog") return null;
- return (
- <div className="flex items-center gap-3">
- {create.isError ? <span className="text-sm text-destructive">Couldn’t create the post.</span> : null}
- <Button
- size="sm"
- disabled={create.isPending}
- onClick={() => create.mutate(undefined, { onSuccess: ({ post }) => router.push(`/blog/${post.id}`) })}
- >
- {create.isPending ? "Creating…" : "New post"}
- </Button>
- </div>
- );
-}
diff --git a/site/src/app/su/blog/[id]/BlogEditor.tsx b/site/src/app/su/blog/[id]/BlogEditor.tsx
deleted file mode 100644
index d4e70c0c..00000000
--- a/site/src/app/su/blog/[id]/BlogEditor.tsx
+++ /dev/null
@@ -1,24 +0,0 @@
-"use client";
-
-import dynamic from "next/dynamic";
-
-import { Skeleton } from "@/components/ui/skeleton";
-
-export type BlogEditorProps = {
- markdown: string;
- // What the post last saved as, shown beside the draft in diff mode.
- diffMarkdown: string;
- onChange: (markdown: string) => void;
- uploadImage: (file: File) => Promise<string>;
-};
-
-// The editor reaches into the DOM (contentEditable, CodeMirror), so it loads
-// in the browser only; the page keeps its shape with a stand-in until then.
-const Inner = dynamic(() => import("./BlogEditorInner"), {
- ssr: false,
- loading: () => <Skeleton className="h-[60vh] rounded-xl" />,
-});
-
-export function BlogEditor(props: BlogEditorProps) {
- return <Inner {...props} />;
-}
diff --git a/site/src/app/su/blog/[id]/BlogEditorInner.tsx b/site/src/app/su/blog/[id]/BlogEditorInner.tsx
deleted file mode 100644
index c89d5588..00000000
--- a/site/src/app/su/blog/[id]/BlogEditorInner.tsx
+++ /dev/null
@@ -1,285 +0,0 @@
-"use client";
-
-import "@mdxeditor/editor/style.css";
-
-import {
- BlockTypeSelect,
- BoldItalicUnderlineToggles,
- ButtonWithTooltip,
- CodeToggle,
- CreateLink,
- DialogButton,
- DiffSourceToggleWrapper,
- GenericJsxEditor,
- InsertCodeBlock,
- InsertImage,
- InsertTable,
- InsertThematicBreak,
- ListsToggle,
- MDXEditor,
- Separator,
- UndoRedo,
- codeBlockPlugin,
- codeMirrorPlugin,
- diffSourcePlugin,
- headingsPlugin,
- imagePlugin,
- insertJsx$,
- jsxPlugin,
- linkDialogPlugin,
- linkPlugin,
- listsPlugin,
- markdownShortcutPlugin,
- quotePlugin,
- rootEditor$,
- tablePlugin,
- thematicBreakPlugin,
- toolbarPlugin,
- useCellValue,
- useLexicalNodeRemove,
- useMdastNodeUpdater,
- usePublisher,
- type JsxComponentDescriptor,
- type JsxEditorProps,
-} from "@mdxeditor/editor";
-import { COMMAND_PRIORITY_HIGH, PASTE_COMMAND } from "lexical";
-import { Megaphone, MessageSquareQuote, Video } from "lucide-react";
-import { useEffect, useMemo, useState } from "react";
-
-import { BlogVideo } from "@/app/cut/blog/_components/BlogVideo";
-import { BLOG_ARTICLE_CLASS } from "@/app/cut/blog/_components/mdxComponents";
-import type { BlogEditorProps } from "@/app/su/blog/[id]/BlogEditor";
-import { EDITOR_ICON_CLASS, editorIcon } from "@/app/su/blog/[id]/editorIcons";
-import { parseVideoUrl } from "@/lib/blog/video";
-
-// The article editor. The body is MDX: markdown with three named blocks the
-// public page knows (Video, BlogCTA, InlineCTA). Images land at the cursor
-// from a drop, a paste, or the toolbar, and each upload comes back as the
-// public address, so the saved markdown is a plain image line.
-
-const CODE_LANGUAGES = {
- "": "Plain text",
- bash: "Shell",
- css: "CSS",
- html: "HTML",
- js: "JavaScript",
- json: "JSON",
- ts: "TypeScript",
- tsx: "TSX",
-};
-
-const stringAttr = (node: JsxEditorProps["mdastNode"], name: string): string => {
- const found = node.attributes.find((attr) => attr.type === "mdxJsxAttribute" && attr.name === name);
- return found && typeof found.value === "string" ? found.value : "";
-};
-
-// <Video src="…" /> in the editor: the same player the article shows, with
-// the address editable underneath.
-function VideoJsxEditor({ mdastNode }: JsxEditorProps) {
- const update = useMdastNodeUpdater();
- const remove = useLexicalNodeRemove();
- const src = stringAttr(mdastNode, "src");
- const title = stringAttr(mdastNode, "title");
- const known = parseVideoUrl(src) !== null;
- const set = (name: string, value: string) => {
- const rest = mdastNode.attributes.filter((attr) => !(attr.type === "mdxJsxAttribute" && attr.name === name));
- update({
- attributes: value ? [...rest, { type: "mdxJsxAttribute", name, value }] : rest,
- });
- };
- return (
- <div contentEditable={false} className="my-4 space-y-2">
- {src ? <BlogVideo src={src} title={title || undefined} /> : null}
- <div className="flex flex-wrap items-center gap-2 text-xs">
- <label className="flex min-w-0 flex-1 items-center gap-2">
- <span className="shrink-0 text-muted-foreground">Video</span>
- <input
- value={src}
- placeholder="YouTube, Vimeo or .mp4 address"
- className="min-w-0 flex-1 rounded-md border px-2 py-1"
- onChange={(event) => set("src", event.target.value.trim())}
- />
- </label>
- <label className="flex items-center gap-2">
- <span className="text-muted-foreground">Title</span>
- <input
- value={title}
- className="w-40 rounded-md border px-2 py-1"
- onChange={(event) => set("title", event.target.value)}
- />
- </label>
- <button type="button" className="text-muted-foreground hover:text-destructive" onClick={remove}>
- Remove
- </button>
- </div>
- {src && !known ? (
- <p className="text-xs text-destructive">Not a video address the page can play; it renders as a link.</p>
- ) : null}
- </div>
- );
-}
-
-const JSX_DESCRIPTORS: JsxComponentDescriptor[] = [
- {
- name: "Video",
- kind: "flow",
- props: [
- { name: "src", type: "string" },
- { name: "title", type: "string" },
- ],
- hasChildren: false,
- Editor: VideoJsxEditor,
- },
- {
- name: "BlogCTA",
- kind: "flow",
- props: [
- { name: "variant", type: "string" },
- { name: "title", type: "string" },
- { name: "description", type: "string" },
- { name: "buttonText", type: "string" },
- { name: "buttonHref", type: "string" },
- ],
- hasChildren: false,
- Editor: GenericJsxEditor,
- },
- {
- name: "InlineCTA",
- kind: "flow",
- props: [],
- hasChildren: false,
- Editor: GenericJsxEditor,
- },
-];
-
-// A bare video address pasted on its own becomes a Video block where the
-// cursor is. The check is the address's host or file extension, nothing more.
-function VideoPaste() {
- const editor = useCellValue(rootEditor$);
- const insertJsx = usePublisher(insertJsx$);
- useEffect(() => {
- if (!editor) return;
- return editor.registerCommand(
- PASTE_COMMAND,
- (event) => {
- if (!(event instanceof ClipboardEvent) || !event.clipboardData) return false;
- if (event.clipboardData.files.length > 0) return false;
- const text = event.clipboardData.getData("text/plain").trim();
- if (!text || /\s/.test(text) || !parseVideoUrl(text)) return false;
- event.preventDefault();
- insertJsx({ name: "Video", kind: "flow", props: { src: text } });
- return true;
- },
- COMMAND_PRIORITY_HIGH,
- );
- }, [editor, insertJsx]);
- return null;
-}
-
-function InsertVideo() {
- const insertJsx = usePublisher(insertJsx$);
- return (
- <DialogButton
- tooltipTitle="Insert video"
- submitButtonTitle="Insert"
- dialogInputPlaceholder="YouTube, Vimeo or .mp4 address"
- buttonContent={<Video className={EDITOR_ICON_CLASS} />}
- onSubmit={(value) => {
- const src = value.trim();
- if (src) insertJsx({ name: "Video", kind: "flow", props: { src } });
- }}
- />
- );
-}
-
-function InsertCtas() {
- const insertJsx = usePublisher(insertJsx$);
- return (
- <>
- <ButtonWithTooltip
- title="Insert call to action banner"
- onClick={() => insertJsx({ name: "BlogCTA", kind: "flow", props: { variant: "banner" } })}
- >
- <Megaphone className={EDITOR_ICON_CLASS} />
- </ButtonWithTooltip>
- <ButtonWithTooltip
- title="Insert inline call to action"
- onClick={() => insertJsx({ name: "InlineCTA", kind: "flow", props: {} })}
- >
- <MessageSquareQuote className={EDITOR_ICON_CLASS} />
- </ButtonWithTooltip>
- </>
- );
-}
-
-export default function BlogEditorInner({ markdown, diffMarkdown, onChange, uploadImage }: BlogEditorProps) {
- const [parseError, setParseError] = useState<string | null>(null);
-
- const plugins = useMemo(
- () => [
- headingsPlugin({ allowedHeadingLevels: [2, 3, 4] }),
- listsPlugin(),
- quotePlugin(),
- thematicBreakPlugin(),
- linkPlugin(),
- linkDialogPlugin(),
- tablePlugin(),
- imagePlugin({ imageUploadHandler: uploadImage }),
- codeBlockPlugin({ defaultCodeBlockLanguage: "" }),
- codeMirrorPlugin({ codeBlockLanguages: CODE_LANGUAGES }),
- jsxPlugin({ jsxComponentDescriptors: JSX_DESCRIPTORS }),
- markdownShortcutPlugin(),
- diffSourcePlugin({ viewMode: "rich-text", diffMarkdown }),
- toolbarPlugin({
- toolbarContents: () => (
- <DiffSourceToggleWrapper>
- <VideoPaste />
- <UndoRedo />
- <Separator />
- <BoldItalicUnderlineToggles />
- <CodeToggle />
- <Separator />
- <BlockTypeSelect />
- <Separator />
- <ListsToggle />
- <Separator />
- <CreateLink />
- <InsertImage />
- <InsertVideo />
- <Separator />
- <InsertTable />
- <InsertThematicBreak />
- <InsertCodeBlock />
- <Separator />
- <InsertCtas />
- </DiffSourceToggleWrapper>
- ),
- }),
- ],
- // The diff baseline is read when the plugin mounts; a later save updates
- // it through the editor's own state.
- // eslint-disable-next-line react-hooks/exhaustive-deps
- [uploadImage],
- );
-
- return (
- <div className="overflow-hidden rounded-xl border bg-white">
- {parseError ? (
- <p role="alert" className="border-b bg-destructive/10 px-4 py-2 text-xs text-destructive">
- The body has markup the editor cannot show. Source mode still edits it. {parseError}
- </p>
- ) : null}
- <MDXEditor
- markdown={markdown}
- onChange={(next, initialNormalize) => {
- if (!initialNormalize) onChange(next);
- }}
- onError={({ error }) => setParseError(error)}
- iconComponentFor={editorIcon}
- plugins={plugins}
- contentEditableClassName={`${BLOG_ARTICLE_CLASS} min-h-[60vh] px-6 py-5`}
- placeholder="Write the article…"
- />
- </div>
- );
-}
diff --git a/site/src/app/su/blog/[id]/DateTimeField.tsx b/site/src/app/su/blog/[id]/DateTimeField.tsx
deleted file mode 100644
index ac6102e2..00000000
--- a/site/src/app/su/blog/[id]/DateTimeField.tsx
+++ /dev/null
@@ -1,94 +0,0 @@
-"use client";
-
-import { CalendarIcon } from "lucide-react";
-import { useState } from "react";
-
-import { Button, buttonVariants } from "@/components/ui/button";
-import { Calendar } from "@/components/ui/calendar";
-import { Input } from "@/components/ui/input";
-import { Popover, PopoverContent, PopoverTrigger } from "@/components/ui/popover";
-import { cn } from "@/lib/utils";
-
-const pad = (n: number) => String(n).padStart(2, "0");
-const timeOf = (date: Date | null) => (date ? `${pad(date.getHours())}:${pad(date.getMinutes())}` : "");
-
-// The chosen day at the time already set, or at the current time when none was.
-function dayAt(day: Date, current: Date | null): string {
- const base = current ?? new Date();
- const next = new Date(day);
- next.setHours(base.getHours(), base.getMinutes(), 0, 0);
- return next.toISOString();
-}
-
-// The day already set (today when none was) at the typed time.
-function timeAt(time: string, current: Date | null): string | null {
- const [hours, minutes] = time.split(":").map(Number);
- if (!Number.isFinite(hours) || !Number.isFinite(minutes)) return null;
- const next = current ? new Date(current) : new Date();
- next.setHours(hours, minutes, 0, 0);
- return next.toISOString();
-}
-
-// A day and a time, kept as one instant. The calendar picks the day, the time
-// box the wall-clock time in the editor's zone; either alone starts from now.
-export function DateTimeField({
- id,
- value,
- onChange,
-}: {
- id: string;
- value: string | null;
- onChange: (iso: string | null) => void;
-}) {
- const [open, setOpen] = useState(false);
- const date = value ? new Date(value) : null;
-
- return (
- <Popover open={open} onOpenChange={setOpen}>
- <PopoverTrigger
- id={id}
- className={cn(
- buttonVariants({ variant: "outline" }),
- "w-full justify-start gap-2 font-normal",
- !date && "text-muted-foreground",
- )}
- >
- <CalendarIcon className="size-4" />
- {date ? date.toLocaleString(undefined, { dateStyle: "medium", timeStyle: "short" }) : "Pick a date"}
- </PopoverTrigger>
- <PopoverContent align="start" className="w-auto p-0">
- <Calendar
- mode="single"
- selected={date ?? undefined}
- onSelect={(day) => onChange(day ? dayAt(day, date) : null)}
- captionLayout="dropdown"
- />
- <div className="flex items-center gap-2 border-t p-2">
- <Input
- type="time"
- aria-label="Time"
- value={timeOf(date)}
- onChange={(event) => {
- const next = timeAt(event.target.value, date);
- if (next) onChange(next);
- }}
- className="w-auto"
- />
- <Button
- type="button"
- size="sm"
- variant="ghost"
- className="ml-auto"
- disabled={!date}
- onClick={() => {
- onChange(null);
- setOpen(false);
- }}
- >
- Clear
- </Button>
- </div>
- </PopoverContent>
- </Popover>
- );
-}
diff --git a/site/src/app/su/blog/[id]/FocusPicker.tsx b/site/src/app/su/blog/[id]/FocusPicker.tsx
deleted file mode 100644
index 19c5a57c..00000000
--- a/site/src/app/su/blog/[id]/FocusPicker.tsx
+++ /dev/null
@@ -1,82 +0,0 @@
-"use client";
-
-import { useRef, useState } from "react";
-
-import { blogFocusSchema } from "@/lib/blog/schema";
-import { cn } from "@/lib/utils";
-
-// The picture in the box the page crops it to. Dragging moves the picture
-// under the box, so whatever matters in it can be brought into frame; the
-// result is kept as an object-position pair and the public page positions
-// the same way. The picture only moves along an axis it overflows.
-export function FocusPicker({
- src,
- alt,
- focus,
- className,
- onChange,
-}: {
- src: string;
- alt: string;
- focus: string | null;
- className?: string;
- onChange: (focus: string) => void;
-}) {
- const box = useRef<HTMLDivElement>(null);
- const [natural, setNatural] = useState<{ width: number; height: number } | null>(null);
- const drag = useRef<{ x: number; y: number; fx: number; fy: number } | null>(null);
- const position = focus && blogFocusSchema.safeParse(focus).success ? focus : "50% 50%";
-
- const moveTo = (event: React.PointerEvent) => {
- const start = drag.current;
- const rect = box.current?.getBoundingClientRect();
- if (!start || !rect || !natural) return;
- // object-fit: cover scales the picture until it fills the box; what hangs
- // over the box is the room there is to move it.
- const scale = Math.max(rect.width / natural.width, rect.height / natural.height);
- const overX = natural.width * scale - rect.width;
- const overY = natural.height * scale - rect.height;
- const fx = overX > 0 ? start.fx - ((event.clientX - start.x) / overX) * 100 : start.fx;
- const fy = overY > 0 ? start.fy - ((event.clientY - start.y) / overY) * 100 : start.fy;
- const clamp = (value: number) => Math.min(100, Math.max(0, value));
- onChange(`${clamp(fx).toFixed(1)}% ${clamp(fy).toFixed(1)}%`);
- };
-
- return (
- <div
- ref={box}
- className={cn(
- "relative w-full cursor-grab touch-none overflow-hidden rounded-2xl bg-muted select-none active:cursor-grabbing",
- className,
- )}
- onPointerDown={(event) => {
- const [fx, fy] = position.split(" ").map(parseFloat);
- drag.current = { x: event.clientX, y: event.clientY, fx, fy };
- event.currentTarget.setPointerCapture(event.pointerId);
- }}
- onPointerMove={(event) => {
- if (drag.current) moveTo(event);
- }}
- onPointerUp={(event) => {
- drag.current = null;
- event.currentTarget.releasePointerCapture(event.pointerId);
- }}
- onPointerCancel={() => {
- drag.current = null;
- }}
- >
- {/* eslint-disable-next-line @next/next/no-img-element -- pre-encoded AVIF from the media host, not Next-optimizable */}
- <img
- src={src}
- alt={alt}
- draggable={false}
- className="size-full object-cover"
- style={{ objectPosition: position }}
- onLoad={(event) => {
- const img = event.currentTarget;
- setNatural({ width: img.naturalWidth, height: img.naturalHeight });
- }}
- />
- </div>
- );
-}
diff --git a/site/src/app/su/blog/[id]/ImageUpload.tsx b/site/src/app/su/blog/[id]/ImageUpload.tsx
deleted file mode 100644
index 608b8eeb..00000000
--- a/site/src/app/su/blog/[id]/ImageUpload.tsx
+++ /dev/null
@@ -1,114 +0,0 @@
-"use client";
-
-import { ImagePlus, Trash2, Upload } from "lucide-react";
-import { useRef, useState, type ReactNode } from "react";
-
-import { Button } from "@/components/ui/button";
-import type { BlogImageKind } from "@/lib/blog/images";
-import { cn } from "@/lib/utils";
-import { useRemoveBlogImage, useUploadBlogImage } from "@/queries/blog";
-
-export const BLOG_IMAGE_ACCEPT = "image/png,image/jpeg,image/webp,image/gif,image/avif";
-
-// The image box is the upload: empty, it takes a click or a dropped file;
-// filled, it draws the image (or whatever the caller puts there, such as the
-// focus picker) with replace and remove on hover. The bytes go straight to
-// storage and come back encoded; the route updates the row, so the caller's
-// image follows the query.
-export function ImageUpload({
- postId,
- kind,
- url,
- label,
- className,
- children,
- onChanged,
-}: {
- postId: string;
- kind: Exclude<BlogImageKind, "inline">;
- url: string | null;
- label: string;
- className?: string;
- children?: ReactNode;
- // Fires once a new picture is on the row, or the old one is gone.
- onChanged?: () => void;
-}) {
- const upload = useUploadBlogImage(postId);
- const remove = useRemoveBlogImage(postId);
- const input = useRef<HTMLInputElement>(null);
- const [over, setOver] = useState(false);
- const busy = upload.isPending || remove.isPending;
-
- const take = (file: File | undefined) => {
- if (file && file.type.startsWith("image/")) upload.mutate({ file, kind }, { onSuccess: () => onChanged?.() });
- };
-
- return (
- <div className="space-y-1.5">
- <div
- className={cn("group relative overflow-hidden rounded-2xl", className)}
- onDragOver={(event) => {
- event.preventDefault();
- setOver(true);
- }}
- onDragLeave={() => setOver(false)}
- onDrop={(event) => {
- event.preventDefault();
- setOver(false);
- take(event.dataTransfer.files[0]);
- }}
- >
- <input
- ref={input}
- type="file"
- accept={BLOG_IMAGE_ACCEPT}
- className="hidden"
- onChange={(event) => {
- take(event.target.files?.[0]);
- event.target.value = "";
- }}
- />
- {url ? (
- <>
- {children ?? <img src={url} alt="" className="size-full object-cover" />}
- <div className="absolute top-2 right-2 flex gap-1.5 opacity-0 transition-opacity group-hover:opacity-100 focus-within:opacity-100">
- <Button type="button" size="sm" variant="secondary" disabled={busy} onClick={() => input.current?.click()}>
- <Upload />
- Replace
- </Button>
- <Button type="button" size="sm" variant="secondary" disabled={busy} onClick={() => remove.mutate(kind, { onSuccess: () => onChanged?.() })}>
- <Trash2 />
- Remove
- </Button>
- </div>
- </>
- ) : (
- <button
- type="button"
- disabled={busy}
- onClick={() => input.current?.click()}
- className={cn(
- "flex size-full flex-col items-center justify-center gap-2 rounded-2xl border-2 border-dashed text-sm text-muted-foreground transition-colors hover:border-foreground/40 hover:text-foreground",
- over && "border-foreground/60 bg-muted text-foreground",
- )}
- >
- <ImagePlus className="size-5" />
- <span>{label}</span>
- <span className="text-xs">Click or drop an image</span>
- </button>
- )}
- {busy ? (
- <div className="absolute inset-0 flex items-center justify-center bg-background/70 text-sm">
- {upload.isPending ? "Uploading…" : "Removing…"}
- </div>
- ) : over && url ? (
- <div className="pointer-events-none absolute inset-0 flex items-center justify-center bg-background/70 text-sm">
- Drop to replace
- </div>
- ) : null}
- </div>
- {upload.isError ? <p className="text-xs text-destructive">{upload.error.message}</p> : null}
- {remove.isError ? <p className="text-xs text-destructive">{remove.error.message}</p> : null}
- </div>
- );
-}
diff --git a/site/src/app/su/blog/[id]/PostEditorPage.tsx b/site/src/app/su/blog/[id]/PostEditorPage.tsx
deleted file mode 100644
index fbd67b20..00000000
--- a/site/src/app/su/blog/[id]/PostEditorPage.tsx
+++ /dev/null
@@ -1,521 +0,0 @@
-"use client";
-
-import { Ellipsis, ExternalLink, Eye, EyeOff, Save, Send, Sparkles } from "lucide-react";
-import Link from "next/link";
-import { useCallback, useEffect, useMemo, useRef, useState } from "react";
-
-import { BlogEditor } from "@/app/su/blog/[id]/BlogEditor";
-import { DateTimeField } from "@/app/su/blog/[id]/DateTimeField";
-import { FocusPicker } from "@/app/su/blog/[id]/FocusPicker";
-import { ImageUpload } from "@/app/su/blog/[id]/ImageUpload";
-import { TagInput } from "@/app/su/blog/[id]/TagInput";
-import { Field } from "@/app/su/Field";
-import { useSuCrumb } from "@/app/su/SuCrumb";
-import { SuStandIn } from "@/app/su/SuStandIn";
-import { Badge } from "@/components/ui/badge";
-import { Button } from "@/components/ui/button";
-import {
- DropdownMenu,
- DropdownMenuContent,
- DropdownMenuItem,
- DropdownMenuSeparator,
- DropdownMenuTrigger,
-} from "@/components/ui/dropdown-menu";
-import { Input } from "@/components/ui/input";
-import { Label } from "@/components/ui/label";
-import { Switch } from "@/components/ui/switch";
-import { Tabs, TabsContent, TabsList, TabsTrigger } from "@/components/ui/tabs";
-import { Textarea } from "@/components/ui/textarea";
-import { SU_APP_ORIGIN } from "@/cut/lib/hosts";
-import {
- BLOG_DESCRIPTION_MAX,
- BLOG_DESCRIPTION_MIN,
- BLOG_SEO_TITLE_MAX,
- BLOG_TITLE_MAX,
- publishIssues,
- slugFromTitle,
- type BlogPostInput,
-} from "@/lib/blog/schema";
-import { ApiError } from "@/queries/apiClient";
-import {
- uploadBlogImage,
- useBlogPost,
- useBlogPosts,
- useGenerateBlogDetails,
- usePublishBlogPost,
- useSaveBlogPost,
- useUnpublishBlogPost,
- type BlogPostAdminWithBody,
-} from "@/queries/blog";
-
-// One post in two tabs: the writing (title and article) and the details the
-// page and the search result are built from. Save writes the whole draft;
-// Publish saves first, then puts the post on the site.
-
-export function PostEditorPage({ id }: { id: string }) {
- const post = useBlogPost(id);
- if (!post.data) {
- if (post.isPending) return <SuStandIn />;
- return (
- <div role="alert" className="space-y-3 rounded-lg border border-destructive/30 p-4">
- <p className="text-sm text-destructive">Couldn’t load the post. {post.error?.message}</p>
- <Button variant="outline" nativeButton={false} render={<Link href="/blog" />}>
- Back to posts
- </Button>
- </div>
- );
- }
- return <PostEditor key={post.data.post.id} post={post.data.post} />;
-}
-
-const inputOf = (post: BlogPostAdminWithBody): BlogPostInput => ({
- slug: post.slug,
- title: post.title,
- excerpt: post.excerpt,
- summary: post.summary,
- tags: post.tags,
- keywords: post.keywords,
- featured: post.featured,
- publishedAt: post.publishedAt,
- revisedAt: post.revisedAt,
- headerAlt: post.headerAlt,
- headerFocus: post.headerFocus,
- thumbnailFocus: post.thumbnailFocus,
- seoTitle: post.seoTitle,
- canonicalUrl: post.canonicalUrl,
- noIndex: post.noIndex,
- body: post.body,
-});
-
-const issuesByPath = (error: unknown): Record<string, string> => {
- const map: Record<string, string> = {};
- if (error instanceof ApiError) {
- for (const issue of error.issues) map[issue.path.split(".")[0] || "form"] = issue.message;
- }
- return map;
-};
-
-function Count({ value, max, min = 0 }: { value: string; max: number; min?: number }) {
- const n = value.trim().length;
- const off = n > max || (min > 0 && n > 0 && n < min);
- return (
- <span className={`text-xs tabular-nums ${off ? "text-destructive" : "text-muted-foreground"}`}>
- {n}/{max}
- </span>
- );
-}
-
-function CountedLabel({ htmlFor, children, value, max, min }: { htmlFor: string; children: string; value: string; max: number; min?: number }) {
- return (
- <div className="flex items-baseline justify-between">
- <Label htmlFor={htmlFor} className="text-xs text-muted-foreground">
- {children}
- </Label>
- <Count value={value} max={max} min={min} />
- </div>
- );
-}
-
-function PostEditor({ post }: { post: BlogPostAdminWithBody }) {
- const posts = useBlogPosts();
- const save = useSaveBlogPost(post.id);
- const publish = usePublishBlogPost(post.id);
- const unpublish = useUnpublishBlogPost(post.id);
- const generate = useGenerateBlogDetails(post.id);
-
- const [draft, setDraft] = useState<BlogPostInput>(() => inputOf(post));
- const [saved, setSaved] = useState<BlogPostInput>(() => inputOf(post));
- // The slug follows the title until it is edited by hand, or the post is
- // live and its address is spoken for.
- const [slugTouched, setSlugTouched] = useState(
- () => post.status === "PUBLISHED" || (post.title.trim().length > 0 && post.slug !== slugFromTitle(post.title)),
- );
- const [issues, setIssues] = useState<Record<string, string>>({});
- const [notice, setNotice] = useState<string | null>(null);
- // The keyboard shortcut and the title handler read the draft at the moment
- // they fire, outside a render.
- const draftRef = useRef(draft);
- useEffect(() => {
- draftRef.current = draft;
- }, [draft]);
-
- useSuCrumb(draft.title.trim() || "Untitled post");
-
- const dirty = useMemo(() => JSON.stringify(draft) !== JSON.stringify(saved), [draft, saved]);
- const busy = save.isPending || publish.isPending || unpublish.isPending || generate.isPending;
- const published = post.status === "PUBLISHED";
-
- const patch = (next: Partial<BlogPostInput>) => setDraft((current) => ({ ...current, ...next }));
-
- const fail = (error: Error) => {
- setIssues(issuesByPath(error));
- setNotice(error.message);
- };
-
- // Writes the draft; resolves true when it landed.
- const doSave = useCallback(async () => {
- const submitted = draftRef.current;
- setIssues({});
- setNotice(null);
- try {
- const { post: row } = await save.mutateAsync(submitted);
- const next = inputOf(row);
- setSaved(next);
- // Keep what was typed during the save; otherwise take the row's
- // normalized values so the form shows exactly what is stored.
- setDraft((current) => (current === submitted ? next : current));
- return true;
- } catch (error) {
- fail(error as Error);
- return false;
- }
- }, [save]);
-
- useEffect(() => {
- const onKey = (event: KeyboardEvent) => {
- if ((event.metaKey || event.ctrlKey) && event.key.toLowerCase() === "s") {
- event.preventDefault();
- if (!save.isPending) void doSave();
- }
- };
- window.addEventListener("keydown", onKey);
- return () => window.removeEventListener("keydown", onKey);
- }, [doSave, save.isPending]);
-
- useEffect(() => {
- if (!dirty) return;
- const warn = (event: BeforeUnloadEvent) => {
- event.preventDefault();
- };
- window.addEventListener("beforeunload", warn);
- return () => window.removeEventListener("beforeunload", warn);
- }, [dirty]);
-
- const doPublish = async () => {
- if (dirty && !(await doSave())) return;
- setIssues({});
- setNotice(null);
- publish.mutate(undefined, {
- onSuccess: ({ post: row }) => {
- const next = inputOf(row);
- setSaved(next);
- setDraft((current) => ({ ...current, publishedAt: next.publishedAt }));
- setSlugTouched(true);
- },
- onError: fail,
- });
- };
-
- const doUnpublish = () => {
- setNotice(null);
- unpublish.mutate(undefined, { onError: (error) => setNotice(error.message) });
- };
-
- // The copy lands in the form for a look before it is saved; the pictures
- // are on the row already and show through the query.
- const doGenerate = () => {
- setNotice(null);
- generate.mutate(
- { title: draft.title, body: draft.body },
- { onSuccess: ({ details }) => patch(details), onError: (error) => setNotice(error.message) },
- );
- };
-
- const openPreview = async () => {
- if (dirty && !(await doSave())) return;
- window.open(`${SU_APP_ORIGIN}/api/blog/preview?id=${encodeURIComponent(post.id)}`, "_blank", "noopener");
- };
-
- const uploadInline = useCallback(
- async (file: File) => (await uploadBlogImage(post.id, file, "inline")).image.url,
- [post.id],
- );
-
- const suggestions = publishIssues({
- title: draft.title,
- excerpt: draft.excerpt,
- summary: draft.summary,
- headerKey: post.headerKey,
- thumbnailKey: post.thumbnailKey,
- publishedAt: draft.publishedAt,
- body: draft.body,
- });
- const allTags = useMemo(
- () => Array.from(new Set((posts.data?.posts ?? []).flatMap((row) => row.tags))).sort(),
- [posts.data],
- );
- const allKeywords = useMemo(
- () => Array.from(new Set((posts.data?.posts ?? []).flatMap((row) => row.keywords))).sort(),
- [posts.data],
- );
- const error = (path: string) =>
- issues[path] ? (
- <p role="alert" className="text-xs text-destructive">
- {issues[path]}
- </p>
- ) : null;
-
- return (
- <Tabs defaultValue="write" className="gap-6 pb-9">
- <div className="flex flex-wrap items-center gap-2">
- <TabsList variant="line">
- <TabsTrigger value="write">Write</TabsTrigger>
- <TabsTrigger value="details">Details</TabsTrigger>
- </TabsList>
- {dirty ? <span className="text-xs text-muted-foreground">Unsaved changes</span> : null}
- {notice ? (
- <span role="alert" className="text-xs text-destructive">
- {notice}
- </span>
- ) : null}
- <div className="ml-auto flex flex-wrap items-center gap-2">
- <Badge variant={published ? "default" : "outline"}>{published ? "Published" : "Draft"}</Badge>
- <DropdownMenu>
- <DropdownMenuTrigger
- render={<Button size="icon-sm" variant="outline" aria-label="Actions" disabled={busy} />}
- >
- <Ellipsis />
- </DropdownMenuTrigger>
- <DropdownMenuContent align="end">
- <DropdownMenuItem disabled={!dirty} onClick={() => void doSave()}>
- <Save />
- {save.isPending ? "Saving…" : "Save"}
- </DropdownMenuItem>
- {published ? null : (
- <DropdownMenuItem onClick={() => void doPublish()}>
- <Send />
- {publish.isPending ? "Publishing…" : "Publish"}
- </DropdownMenuItem>
- )}
- <DropdownMenuSeparator />
- <DropdownMenuItem onClick={() => void openPreview()}>
- <Eye />
- Preview
- </DropdownMenuItem>
- {published ? (
- <DropdownMenuItem
- nativeButton={false}
- render={<a href={`${SU_APP_ORIGIN}/blog/${post.slug}`} target="_blank" rel="noreferrer" />}
- >
- <ExternalLink />
- View on the site
- </DropdownMenuItem>
- ) : null}
- {published ? (
- <>
- <DropdownMenuSeparator />
- <DropdownMenuItem variant="destructive" onClick={doUnpublish}>
- <EyeOff />
- {unpublish.isPending ? "Unpublishing…" : "Unpublish"}
- </DropdownMenuItem>
- </>
- ) : null}
- </DropdownMenuContent>
- </DropdownMenu>
- </div>
- </div>
-
- <TabsContent value="write" className="space-y-4">
- <div className="space-y-1.5">
- <CountedLabel htmlFor="title" value={draft.title} max={BLOG_TITLE_MAX}>
- Title
- </CountedLabel>
- <Input
- id="title"
- value={draft.title}
- placeholder="Post title"
- className="h-12 text-xl font-semibold md:text-xl"
- onChange={(e) => {
- const title = e.target.value;
- patch(slugTouched ? { title } : { title, slug: slugFromTitle(title) || draftRef.current.slug });
- }}
- />
- {error("title")}
- </div>
- <BlogEditor markdown={saved.body} diffMarkdown={saved.body} onChange={(body) => patch({ body })} uploadImage={uploadInline} />
- {error("body")}
- </TabsContent>
-
- <TabsContent value="details" className="space-y-8">
- <section className="space-y-4">
- <h2 className="text-sm font-semibold">Images</h2>
- <div className="space-y-2">
- <h3 className="text-xs font-medium text-muted-foreground">Header, 1080×240 on the page</h3>
- <ImageUpload
- postId={post.id}
- kind="header"
- url={post.headerUrl}
- label="Header image"
- className="aspect-[9/2] w-full"
- onChanged={() => patch({ headerFocus: null })}
- >
- {post.headerUrl ? (
- <FocusPicker
- src={post.headerUrl}
- alt={draft.headerAlt}
- focus={draft.headerFocus}
- className="aspect-[9/2]"
- onChange={(focus) => patch({ headerFocus: focus })}
- />
- ) : null}
- </ImageUpload>
- {post.headerUrl ? <p className="text-xs text-muted-foreground">Drag the picture to place it.</p> : null}
- {error("header")}
- </div>
- <div className="grid gap-6 md:grid-cols-2">
- <div className="space-y-2">
- <h3 className="text-xs font-medium text-muted-foreground">Thumbnail, 800×500 on the index</h3>
- <ImageUpload
- postId={post.id}
- kind="thumbnail"
- url={post.thumbnailUrl}
- label="Thumbnail"
- className="aspect-[8/5] w-full"
- onChanged={() => patch({ thumbnailFocus: null })}
- >
- {post.thumbnailUrl ? (
- <FocusPicker
- src={post.thumbnailUrl}
- alt=""
- focus={draft.thumbnailFocus}
- className="aspect-[8/5]"
- onChange={(focus) => patch({ thumbnailFocus: focus })}
- />
- ) : null}
- </ImageUpload>
- {post.thumbnailUrl ? <p className="text-xs text-muted-foreground">Drag the picture to place it.</p> : null}
- {error("thumbnail")}
- </div>
- {post.headerUrl ? (
- <Field label="Header alt text" htmlFor="headerAlt">
- <Input id="headerAlt" value={draft.headerAlt} onChange={(e) => patch({ headerAlt: e.target.value })} />
- {error("headerAlt")}
- </Field>
- ) : null}
- </div>
- </section>
-
- <div className="grid gap-8 md:grid-cols-2">
- <section className="space-y-4">
- <h2 className="text-sm font-semibold">Page</h2>
- <Field label="Address" htmlFor="slug">
- <div className="flex items-center gap-1">
- <span className="shrink-0 text-sm text-muted-foreground">donkeycut.com/blog/</span>
- <Input
- id="slug"
- value={draft.slug}
- onChange={(e) => {
- setSlugTouched(true);
- patch({ slug: e.target.value.toLowerCase() });
- }}
- />
- </div>
- {error("slug")}
- </Field>
- <div className="space-y-1.5">
- <CountedLabel htmlFor="summary" value={draft.summary} max={BLOG_DESCRIPTION_MAX} min={BLOG_DESCRIPTION_MIN}>
- Summary, the answer-first line under the title
- </CountedLabel>
- <Textarea id="summary" rows={3} value={draft.summary} onChange={(e) => patch({ summary: e.target.value })} />
- {error("summary")}
- </div>
- <Field label="Tags" htmlFor="tags">
- <TagInput
- id="tags"
- value={draft.tags}
- suggestions={allTags}
- normalize={(word) => word.trim().toLowerCase()}
- placeholder="Add a tag"
- onChange={(tags) => patch({ tags })}
- />
- {error("tags")}
- </Field>
- <div className="flex items-center justify-between gap-3">
- <Label htmlFor="featured" className="text-xs text-muted-foreground">
- Featured on the index
- </Label>
- <Switch id="featured" checked={draft.featured} onCheckedChange={(featured) => patch({ featured })} />
- </div>
- <Field label="Publish date" htmlFor="publishedAt">
- <DateTimeField id="publishedAt" value={draft.publishedAt} onChange={(publishedAt) => patch({ publishedAt })} />
- {error("publishedAt")}
- </Field>
- <Field label="Revised date" htmlFor="revisedAt">
- <DateTimeField id="revisedAt" value={draft.revisedAt} onChange={(revisedAt) => patch({ revisedAt })} />
- {error("revisedAt")}
- </Field>
- </section>
-
- <section className="space-y-4">
- <h2 className="text-sm font-semibold">Search</h2>
- <div className="space-y-1.5">
- <CountedLabel htmlFor="seoTitle" value={draft.seoTitle} max={BLOG_SEO_TITLE_MAX}>
- Meta title
- </CountedLabel>
- <Input
- id="seoTitle"
- value={draft.seoTitle}
- placeholder={draft.title ? `${draft.title} | Donkey Cut` : "Falls back to the title"}
- onChange={(e) => patch({ seoTitle: e.target.value })}
- />
- {error("seoTitle")}
- </div>
- <div className="space-y-1.5">
- <CountedLabel htmlFor="excerpt" value={draft.excerpt} max={BLOG_DESCRIPTION_MAX} min={BLOG_DESCRIPTION_MIN}>
- Meta description
- </CountedLabel>
- <Textarea id="excerpt" rows={3} value={draft.excerpt} onChange={(e) => patch({ excerpt: e.target.value })} />
- {error("excerpt")}
- </div>
- <Field label="Keywords" htmlFor="keywords">
- <TagInput
- id="keywords"
- value={draft.keywords}
- suggestions={allKeywords}
- placeholder="Add a keyword"
- onChange={(keywords) => patch({ keywords })}
- />
- {error("keywords")}
- </Field>
- <Field label="Canonical address" htmlFor="canonicalUrl">
- <Input
- id="canonicalUrl"
- type="url"
- value={draft.canonicalUrl}
- placeholder={`https://donkeycut.com/blog/${draft.slug}`}
- onChange={(e) => patch({ canonicalUrl: e.target.value })}
- />
- {error("canonicalUrl")}
- </Field>
- <div className="flex items-center justify-between gap-3">
- <Label htmlFor="noIndex" className="text-xs text-muted-foreground">
- Keep out of search results
- </Label>
- <Switch id="noIndex" checked={draft.noIndex} onCheckedChange={(noIndex) => patch({ noIndex })} />
- </div>
- {suggestions.length > 0 ? (
- <div className="space-y-1">
- <h3 className="text-xs font-medium text-muted-foreground">Suggested before publishing</h3>
- <ul className="space-y-1 text-xs text-muted-foreground">
- {suggestions.map((issue) => (
- <li key={issue.path}>· {issue.message}</li>
- ))}
- </ul>
- </div>
- ) : null}
- </section>
- </div>
-
- <div className="flex flex-wrap items-center justify-between gap-3 border-t pt-6">
- <p className="text-xs text-muted-foreground">
- {draft.body.trim() ? "Writes every detail and both pictures from the article. Change anything after." : "Write the article first."}
- </p>
- <Button variant="outline" disabled={busy || !draft.body.trim()} onClick={doGenerate}>
- <Sparkles />
- {generate.isPending ? "Generating…" : "Generate details"}
- </Button>
- </div>
- </TabsContent>
- </Tabs>
- );
-}
diff --git a/site/src/app/su/blog/[id]/TagInput.tsx b/site/src/app/su/blog/[id]/TagInput.tsx
deleted file mode 100644
index 7a1e507f..00000000
--- a/site/src/app/su/blog/[id]/TagInput.tsx
+++ /dev/null
@@ -1,86 +0,0 @@
-"use client";
-
-import { X } from "lucide-react";
-import { useId, useState } from "react";
-
-import { Badge } from "@/components/ui/badge";
-import { Input } from "@/components/ui/input";
-
-// A list of words as chips. Enter or a comma adds what is typed, Backspace on
-// an empty box removes the last chip, and the browser offers the words other
-// posts already use.
-export function TagInput({
- id,
- value,
- onChange,
- suggestions = [],
- placeholder,
- normalize = (word) => word.trim(),
-}: {
- id: string;
- value: string[];
- onChange: (next: string[]) => void;
- suggestions?: string[];
- placeholder?: string;
- normalize?: (word: string) => string;
-}) {
- const [typed, setTyped] = useState("");
- const listId = useId();
-
- const add = (raw: string) => {
- const words = raw
- .split(",")
- .map(normalize)
- .filter((word) => word.length > 0 && !value.includes(word));
- if (words.length > 0) onChange([...value, ...words]);
- setTyped("");
- };
-
- return (
- <div className="space-y-2">
- {value.length > 0 ? (
- <div className="flex flex-wrap gap-1.5">
- {value.map((word) => (
- <Badge key={word} variant="secondary" className="gap-1 pr-1">
- {word}
- <button
- type="button"
- aria-label={`Remove ${word}`}
- className="rounded-full p-0.5 text-muted-foreground hover:text-foreground"
- onClick={() => onChange(value.filter((other) => other !== word))}
- >
- <X className="size-3" />
- </button>
- </Badge>
- ))}
- </div>
- ) : null}
- <Input
- id={id}
- list={listId}
- value={typed}
- placeholder={placeholder}
- autoComplete="off"
- onChange={(event) => setTyped(event.target.value)}
- onBlur={() => {
- if (typed.trim()) add(typed);
- }}
- onKeyDown={(event) => {
- if (event.key === "Enter" || event.key === ",") {
- event.preventDefault();
- add(typed);
- } else if (event.key === "Backspace" && typed === "" && value.length > 0) {
- onChange(value.slice(0, -1));
- }
- }}
- />
- <datalist id={listId}>
- {suggestions
- .filter((word) => !value.includes(word))
- .map((word) => (
- <option key={word} value={word} />
- ))}
- </datalist>
- </div>
- );
-}
diff --git a/site/src/app/su/blog/[id]/editorIcons.tsx b/site/src/app/su/blog/[id]/editorIcons.tsx
deleted file mode 100644
index 041d4c78..00000000
--- a/site/src/app/su/blog/[id]/editorIcons.tsx
+++ /dev/null
@@ -1,103 +0,0 @@
-import type { IconKey } from "@mdxeditor/editor";
-import {
- ArrowDownToLine,
- ArrowLeftToLine,
- ArrowRightToLine,
- ArrowUpToLine,
- Bold,
- Check,
- ChevronDown,
- Code,
- Columns3,
- Copy,
- Ellipsis,
- EllipsisVertical,
- ExternalLink,
- FileCode,
- FileText,
- GitCompare,
- Highlighter,
- ImagePlus,
- Info,
- Italic,
- Link2,
- List,
- ListChecks,
- ListOrdered,
- Minus,
- PenLine,
- Pencil,
- Redo2,
- Rows3,
- Settings2,
- SquareCode,
- Strikethrough,
- Subscript,
- Superscript,
- Table,
- TextAlignCenter,
- TextAlignEnd,
- TextAlignStart,
- Trash,
- Trash2,
- Underline,
- Undo2,
- Unlink,
- X,
- type LucideIcon,
-} from "lucide-react";
-
-// The editor's toolbar and popups draw the app's icon set.
-const ICONS: Record<IconKey, LucideIcon> = {
- undo: Undo2,
- redo: Redo2,
- format_bold: Bold,
- format_italic: Italic,
- format_underlined: Underline,
- code: Code,
- strikeThrough: Strikethrough,
- superscript: Superscript,
- subscript: Subscript,
- format_list_bulleted: List,
- format_list_numbered: ListOrdered,
- format_list_checked: ListChecks,
- format_highlight: Highlighter,
- link: Link2,
- add_photo: ImagePlus,
- table: Table,
- horizontal_rule: Minus,
- frontmatter: FileText,
- frame_source: SquareCode,
- arrow_drop_down: ChevronDown,
- admonition: Info,
- rich_text: PenLine,
- difference: GitCompare,
- markdown: FileCode,
- open_in_new: ExternalLink,
- link_off: Unlink,
- edit: Pencil,
- content_copy: Copy,
- more_horiz: Ellipsis,
- more_vert: EllipsisVertical,
- close: X,
- settings: Settings2,
- delete_big: Trash2,
- delete_small: Trash,
- format_align_center: TextAlignCenter,
- format_align_left: TextAlignStart,
- format_align_right: TextAlignEnd,
- add_row: Rows3,
- add_column: Columns3,
- insert_col_left: ArrowLeftToLine,
- insert_row_above: ArrowUpToLine,
- insert_row_below: ArrowDownToLine,
- insert_col_right: ArrowRightToLine,
- check: Check,
-};
-
-export const EDITOR_ICON_CLASS = "size-4";
-
-export function editorIcon(name: IconKey) {
- const Icon = ICONS[name];
- return <Icon className={EDITOR_ICON_CLASS} />;
-}
diff --git a/site/src/app/su/blog/[id]/page.tsx b/site/src/app/su/blog/[id]/page.tsx
deleted file mode 100644
index d5b55eec..00000000
--- a/site/src/app/su/blog/[id]/page.tsx
+++ /dev/null
@@ -1,19 +0,0 @@
-import { Suspense } from "react";
-
-import { PostEditorPage } from "@/app/su/blog/[id]/PostEditorPage";
-import { SuStandIn } from "@/app/su/SuStandIn";
-
-// The post id is in the URL, so it is request data: it resolves inside this
-// boundary and the editor mounts with it. The section shell (rail, header)
-// reads the URL too, so this segment is allowed to block on the server.
-export const instant = false;
-
-export default function SuBlogPostPage({ params }: { params: Promise<{ id: string }> }) {
- return (
- <Suspense fallback={<SuStandIn />}>
- {params.then(({ id }) => (
- <PostEditorPage id={id} />
- ))}
- </Suspense>
- );
-}
diff --git a/site/src/app/su/blog/page.tsx b/site/src/app/su/blog/page.tsx
deleted file mode 100644
index 908692a1..00000000
--- a/site/src/app/su/blog/page.tsx
+++ /dev/null
@@ -1,136 +0,0 @@
-"use client";
-
-import Link from "next/link";
-import { useState } from "react";
-
-import { SuStandIn } from "@/app/su/SuStandIn";
-import {
- AlertDialog,
- AlertDialogAction,
- AlertDialogCancel,
- AlertDialogContent,
- AlertDialogDescription,
- AlertDialogFooter,
- AlertDialogHeader,
- AlertDialogTitle,
-} from "@/components/ui/alert-dialog";
-import { Badge } from "@/components/ui/badge";
-import { Button } from "@/components/ui/button";
-import { useBlogPosts, useDeleteBlogPost, type BlogPostAdmin } from "@/queries/blog";
-
-const when = (iso: string) =>
- new Date(iso).toLocaleDateString(undefined, { year: "numeric", month: "short", day: "numeric" });
-
-// Every post in one list, the most recently touched first. A row opens the
-// editor; delete sits behind a confirmation because it also sweeps the post's
-// images out of storage.
-export default function SuBlogPage() {
- const posts = useBlogPosts();
-
- const loadError = posts.isError ? (
- <div role="alert" className="space-y-3 rounded-lg border border-destructive/30 p-4">
- <p className="text-sm text-destructive">Couldn’t load posts. {posts.error.message}</p>
- <Button variant="outline" disabled={posts.isFetching} onClick={() => void posts.refetch()}>
- {posts.isFetching ? "Retrying…" : "Retry"}
- </Button>
- </div>
- ) : null;
-
- if (!posts.data) return posts.isPending ? <SuStandIn /> : loadError;
- const rows = posts.data.posts;
-
- return (
- <div className="space-y-3 pb-9">
- {loadError}
- {rows.length === 0 ? <p className="text-sm text-muted-foreground">No posts yet.</p> : null}
- {rows.map((post) => (
- <PostRow key={post.id} post={post} />
- ))}
- </div>
- );
-}
-
-function PostRow({ post }: { post: BlogPostAdmin }) {
- const remove = useDeleteBlogPost();
- const [confirmDelete, setConfirmDelete] = useState(false);
- const title = post.title.trim() || "Untitled post";
- return (
- <div className="flex items-start gap-4 rounded-lg border p-4">
- {post.thumbnailUrl ? (
- // eslint-disable-next-line @next/next/no-img-element -- pre-encoded AVIF from the media host, not Next-optimizable
- <img
- src={post.thumbnailUrl}
- alt=""
- className="hidden h-16 w-[102px] shrink-0 rounded-md border object-cover sm:block"
- />
- ) : (
- <div className="hidden h-16 w-[102px] shrink-0 rounded-md border bg-muted sm:block" />
- )}
- <div className="min-w-0 flex-1">
- <div className="flex flex-wrap items-center gap-2">
- <Link href={`/blog/${post.id}`} className="font-medium hover:underline">
- {title}
- </Link>
- <Badge variant={post.status === "PUBLISHED" ? "default" : "outline"}>
- {post.status === "PUBLISHED" ? "Published" : "Draft"}
- </Badge>
- {post.featured ? <Badge variant="secondary">Featured</Badge> : null}
- {post.noIndex ? <Badge variant="outline">noindex</Badge> : null}
- </div>
- <p className="mt-1 truncate text-sm text-muted-foreground">/blog/{post.slug}</p>
- <p className="mt-1 text-xs text-muted-foreground">
- {post.publishedAt ? `Published ${when(post.publishedAt)} · ` : ""}
- Edited {when(post.updatedAt)}
- {post.tags.length > 0 ? ` · ${post.tags.join(", ")}` : ""}
- </p>
- </div>
- <div className="flex shrink-0 items-center gap-2">
- <Button size="sm" variant="outline" nativeButton={false} render={<Link href={`/blog/${post.id}`} />}>
- Edit
- </Button>
- <Button
- size="sm"
- variant="ghost"
- disabled={remove.isPending}
- onClick={() => {
- remove.reset();
- setConfirmDelete(true);
- }}
- >
- Delete
- </Button>
- </div>
- <AlertDialog
- open={confirmDelete}
- onOpenChange={(isOpen) => {
- if (!remove.isPending) setConfirmDelete(isOpen);
- }}
- >
- <AlertDialogContent>
- <AlertDialogHeader>
- <AlertDialogTitle>Delete “{title}”?</AlertDialogTitle>
- <AlertDialogDescription>
- {post.status === "PUBLISHED"
- ? "The page comes down and its images are removed from storage."
- : "The draft and its images are removed from storage."}
- </AlertDialogDescription>
- </AlertDialogHeader>
- {remove.isError ? (
- <p role="alert" className="text-sm text-destructive">
- Couldn’t delete the post. {remove.error.message}
- </p>
- ) : null}
- <AlertDialogFooter>
- <AlertDialogCancel disabled={remove.isPending}>Keep</AlertDialogCancel>
- <AlertDialogAction
- disabled={remove.isPending}
- onClick={() => remove.mutate(post.id, { onSuccess: () => setConfirmDelete(false) })}
- >
- {remove.isPending ? "Deleting…" : "Delete"}
- </AlertDialogAction>
- </AlertDialogFooter>
- </AlertDialogContent>
- </AlertDialog>
- </div>
- );
-}
diff --git a/site/src/app/su/credits/page.tsx b/site/src/app/su/credits/page.tsx
deleted file mode 100644
index dab13f0f..00000000
--- a/site/src/app/su/credits/page.tsx
+++ /dev/null
@@ -1,244 +0,0 @@
-"use client";
-
-import { useState } from "react";
-
-import { Button } from "@/components/ui/button";
-import {
- Card,
- CardContent,
- CardDescription,
- CardHeader,
- CardTitle,
-} from "@/components/ui/card";
-import {
- Dialog,
- DialogClose,
- DialogContent,
- DialogDescription,
- DialogFooter,
- DialogHeader,
- DialogTitle,
-} from "@/components/ui/dialog";
-import { Input } from "@/components/ui/input";
-import { Label } from "@/components/ui/label";
-import { SETTINGS } from "@/lib/config/registry";
-import {
- creditGrantExpiryPresets,
- creditTopUpDefaultDollars,
- creditTopUpPresetsDollars,
- formatCreditExpiry,
- maxCreditGrantDollars,
- maxCreditGrantExpiryDays,
-} from "@/lib/credits/top-up";
-import { useAccount, useOfferCredits } from "@/queries/credits";
-
-// Quick-pick amounts mirror the pay-as-you-go presets; super users can also type
-// a custom dollar value. The grant route caps a single grant at
-// maxCreditGrantDollars to guard against typos.
-const presetDollars = creditTopUpPresetsDollars;
-
-// How long the grant lives: a preset, a custom day count, or never. The pick
-// starts on the lifetime the signup grant defaults to. An empty custom field
-// stands for never.
-const defaultExpiryDays = SETTINGS.signupCredits.default.expiresAfterDays;
-
-function describeExpiry(days: number | null): string {
- if (days === null) return "never expires";
- const preset = creditGrantExpiryPresets.find((p) => p.days === days);
- return `expires in ${preset ? preset.label : `${days} days`}`;
-}
-
-export default function SuCreditsPage() {
- const account = useAccount();
- const grant = useOfferCredits();
- // null means "use the current user's email as the default recipient"; once the
- // super user edits the field we track their override here.
- const [emailOverride, setEmailOverride] = useState<string | null>(null);
- const [amount, setAmount] = useState(String(creditTopUpDefaultDollars));
- const [expiry, setExpiry] = useState(defaultExpiryDays === null ? "" : String(defaultExpiryDays));
- const [confirmOpen, setConfirmOpen] = useState(false);
- const [lastResult, setLastResult] = useState<string | null>(null);
-
- // The layout gates this route to super users; this only bridges the beat
- // before the cached account data lands.
- if (!account.data) {
- return null;
- }
-
- // The field shows the user's own email by default; only treat it as a target
- // when the super user actually overrides it. An unedited (or cleared) field
- // grants to self by the authoritative userId, not by re-resolving the email.
- const email = emailOverride ?? account.data.email ?? "";
- const overrideEmail = emailOverride?.trim() ?? "";
- const grantingToSelf = overrideEmail === "";
- const recipientLabel = grantingToSelf ? "your account" : overrideEmail;
-
- const amountDollars = Number(amount);
- const amountValid =
- Number.isInteger(amountDollars) &&
- amountDollars > 0 &&
- amountDollars <= maxCreditGrantDollars;
-
- const expiresAfterDays = expiry.trim() === "" ? null : Number(expiry);
- const expiryValid =
- expiresAfterDays === null ||
- (Number.isInteger(expiresAfterDays) &&
- expiresAfterDays >= 1 &&
- expiresAfterDays <= maxCreditGrantExpiryDays);
- const expiryLabel = describeExpiry(expiresAfterDays);
-
- const submit = () => {
- if (!amountValid || !expiryValid) {
- return;
- }
- setLastResult(null);
- grant.mutate(
- {
- amountDollars,
- expiresAfterDays,
- ...(grantingToSelf
- ? { userId: account.data.userId }
- : { email: overrideEmail }),
- },
- {
- onSuccess: (result) => {
- setLastResult(
- `Offered $${amountDollars} to ${result.targetUser.email}. The credit lands when they claim it from the email${
- result.offer.closesAt ? ` by ${formatCreditExpiry(new Date(result.offer.closesAt))}` : ""
- }${
- result.offer.expiresAfterDays === null
- ? " and never expires."
- : `, and ${describeExpiry(result.offer.expiresAfterDays)} from then.`
- }`,
- );
- // Reset back to the default recipient (the current user).
- setEmailOverride(null);
- setConfirmOpen(false);
- },
- },
- );
- };
-
- return (
- <div className="max-w-2xl space-y-6 pb-9">
- <Card>
- <CardHeader>
- <CardTitle>Offer credits</CardTitle>
- <CardDescription>
- The recipient gets an email with a claim button; the credit lands
- when they click it. Defaults to your account.
- </CardDescription>
- </CardHeader>
- <CardContent className="space-y-5">
- <div className="space-y-2">
- <Label htmlFor="grant-email">Recipient</Label>
- <Input
- className="max-w-xs"
- id="grant-email"
- onChange={(event) => setEmailOverride(event.target.value)}
- placeholder="[email protected]"
- type="email"
- value={email}
- />
- </div>
-
- <div className="space-y-2">
- <Label htmlFor="grant-amount">Amount (USD)</Label>
- <div className="flex flex-wrap items-center gap-2">
- {presetDollars.map((preset) => (
- <Button
- key={preset}
- onClick={() => setAmount(String(preset))}
- type="button"
- variant={amount === String(preset) ? "default" : "outline"}
- >
- ${preset}
- </Button>
- ))}
- <Input
- className="max-w-[7rem]"
- id="grant-amount"
- max={maxCreditGrantDollars}
- min={1}
- onChange={(event) => setAmount(event.target.value)}
- placeholder="Custom"
- type="number"
- value={amount}
- />
- </div>
- </div>
-
- <div className="space-y-2">
- <Label htmlFor="grant-expiry">Expires</Label>
- <div className="flex flex-wrap items-center gap-2">
- {creditGrantExpiryPresets.map((preset) => (
- <Button
- key={preset.days}
- onClick={() => setExpiry(String(preset.days))}
- type="button"
- variant={expiry === String(preset.days) ? "default" : "outline"}
- >
- {preset.label}
- </Button>
- ))}
- <Button
- onClick={() => setExpiry("")}
- type="button"
- variant={expiry.trim() === "" ? "default" : "outline"}
- >
- Never
- </Button>
- <Input
- className="max-w-[7rem]"
- id="grant-expiry"
- max={maxCreditGrantExpiryDays}
- min={1}
- onChange={(event) => setExpiry(event.target.value)}
- placeholder="Days"
- type="number"
- value={expiry}
- />
- </div>
- </div>
-
- <Button
- disabled={grant.isPending || !amountValid || !expiryValid}
- onClick={() => setConfirmOpen(true)}
- >
- {grant.isPending ? "Sending…" : `Offer $${amountDollars}`}
- </Button>
-
- <Dialog onOpenChange={setConfirmOpen} open={confirmOpen}>
- <DialogContent>
- <DialogHeader>
- <DialogTitle>Confirm credit offer</DialogTitle>
- <DialogDescription>
- Email <span className="font-medium">{recipientLabel}</span> an
- offer of <span className="font-medium">${amountDollars}</span> in
- credits? Once claimed, the credit {expiryLabel}.
- </DialogDescription>
- </DialogHeader>
- <DialogFooter>
- <DialogClose render={<Button variant="outline" />}>
- Cancel
- </DialogClose>
- <Button disabled={grant.isPending} onClick={submit}>
- {grant.isPending ? "Sending…" : `Offer $${amountDollars}`}
- </Button>
- </DialogFooter>
- </DialogContent>
- </Dialog>
-
- {lastResult ? (
- <p className="text-sm text-muted-foreground">{lastResult}</p>
- ) : null}
- {grant.isError ? (
- <p className="text-sm text-destructive">
- Offer failed. Check the email and amount, then try again.
- </p>
- ) : null}
- </CardContent>
- </Card>
- </div>
- );
-}
diff --git a/site/src/app/su/experiments/AudienceFields.tsx b/site/src/app/su/experiments/AudienceFields.tsx
deleted file mode 100644
index 741b1acc..00000000
--- a/site/src/app/su/experiments/AudienceFields.tsx
+++ /dev/null
@@ -1,206 +0,0 @@
-"use client";
-
-import type { Audience, AudienceInput } from "@donkeycut/abexp";
-
-import { Field } from "@/app/su/Field";
-import { Input } from "@/components/ui/input";
-import { Label } from "@/components/ui/label";
-import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from "@/components/ui/select";
-
-// The audience rules as a form: an experiment enrols by them, a promotion
-// mails by them. The draft holds strings, the way the fields do; the two
-// conversions below move between it and the audience schema.
-
-export type AudienceDraft = {
- minimumAccountAgeDays: string;
- countries: string;
- createdAfter: string;
- createdBefore: string;
- plan: "any" | "free" | "pro";
- paid: "any" | "yes" | "no";
- activeWithinDays: string;
- storageUsedPercentAtLeast: string;
- creditsUsedPercentAtLeast: string;
-};
-
-export const blankAudienceDraft = (): AudienceDraft => ({
- countries: "",
- createdAfter: "",
- createdBefore: "",
- minimumAccountAgeDays: "",
- plan: "any",
- paid: "any",
- activeWithinDays: "",
- storageUsedPercentAtLeast: "",
- creditsUsedPercentAtLeast: "",
-});
-
-// Each select's label per value; the root reads them so the trigger shows
-// the label the menu shows.
-const PLAN_LABELS: Record<AudienceDraft["plan"], string> = { any: "Any", free: "No Pro", pro: "Pro" };
-const PAID_LABELS: Record<AudienceDraft["paid"], string> = { any: "Any", yes: "Yes", no: "No" };
-const entries = <K extends string>(labels: Record<K, string>) => Object.entries(labels) as [K, string][];
-
-const day = (iso: string | null) => (iso ? iso.slice(0, 10) : "");
-const numberOrBlank = (n: number | null) => (n === null ? "" : String(n));
-const dayStart = (d: string) => (d ? new Date(`${d}T00:00:00Z`).toISOString() : null);
-const numberOrNull = (s: string) => (s.trim() === "" ? null : Number(s));
-
-export const audienceDraftFrom = (a: Audience): AudienceDraft => ({
- minimumAccountAgeDays: numberOrBlank(a.minimumAccountAgeDays),
- countries: a.countries.join(", "),
- createdAfter: day(a.createdAfter),
- createdBefore: day(a.createdBefore),
- plan: a.plan,
- paid: a.paid,
- activeWithinDays: numberOrBlank(a.activeWithinDays),
- storageUsedPercentAtLeast: numberOrBlank(a.storageUsedPercentAtLeast),
- creditsUsedPercentAtLeast: numberOrBlank(a.creditsUsedPercentAtLeast),
-});
-
-export const audienceInputFrom = (draft: AudienceDraft): AudienceInput => ({
- minimumAccountAgeDays: draft.minimumAccountAgeDays.trim() ? Number(draft.minimumAccountAgeDays) : null,
- countries: draft.countries
- .split(",")
- .map((s) => s.trim().toUpperCase())
- .filter(Boolean),
- createdAfter: dayStart(draft.createdAfter),
- createdBefore: dayStart(draft.createdBefore),
- plan: draft.plan,
- paid: draft.paid,
- activeWithinDays: numberOrNull(draft.activeWithinDays),
- storageUsedPercentAtLeast: numberOrNull(draft.storageUsedPercentAtLeast),
- creditsUsedPercentAtLeast: numberOrNull(draft.creditsUsedPercentAtLeast),
-});
-
-export function AudienceFields({
- value,
- onChange,
- countries = true,
- disabled = false,
- children,
-}: {
- value: AudienceDraft;
- onChange: (patch: Partial<AudienceDraft>) => void;
- // Country is read from the request that assigns an experiment; a send has
- // no request, so a promotion's form leaves it out.
- countries?: boolean;
- disabled?: boolean;
- children?: React.ReactNode;
-}) {
- return (
- <div className="space-y-3">
- <Label>Audience</Label>
- <div className="grid grid-cols-3 gap-3">
- {countries ? (
- <Field label="Countries (empty = any)" htmlFor="aud-countries">
- <Input
- id="aud-countries"
- placeholder="US, GB, CA"
- disabled={disabled}
- value={value.countries}
- onChange={(e) => onChange({ countries: e.target.value })}
- />
- </Field>
- ) : null}
- <Field label="Created on or after" htmlFor="aud-after">
- <Input
- id="aud-after"
- type="date"
- disabled={disabled}
- value={value.createdAfter}
- onChange={(e) => onChange({ createdAfter: e.target.value })}
- />
- </Field>
- <Field label="Created before" htmlFor="aud-before">
- <Input
- id="aud-before"
- type="date"
- disabled={disabled}
- value={value.createdBefore}
- onChange={(e) => onChange({ createdBefore: e.target.value })}
- />
- </Field>
- <Field label="Signed up at least (days)" htmlFor="aud-min-age">
- <Input
- id="aud-min-age"
- type="number"
- min={1}
- max={36500}
- disabled={disabled}
- value={value.minimumAccountAgeDays}
- onChange={(e) => onChange({ minimumAccountAgeDays: e.target.value })}
- />
- </Field>
- <Field label="Plan" htmlFor="aud-plan">
- <Select
- disabled={disabled}
- value={value.plan}
- items={PLAN_LABELS}
- onValueChange={(v) => onChange({ plan: v as AudienceDraft["plan"] })}
- >
- <SelectTrigger id="aud-plan">
- <SelectValue />
- </SelectTrigger>
- <SelectContent>
- {entries(PLAN_LABELS).map(([v, label]) => (
- <SelectItem key={v} value={v}>{label}</SelectItem>
- ))}
- </SelectContent>
- </Select>
- </Field>
- <Field label="Has paid" htmlFor="aud-paid">
- <Select
- disabled={disabled}
- value={value.paid}
- items={PAID_LABELS}
- onValueChange={(v) => onChange({ paid: v as AudienceDraft["paid"] })}
- >
- <SelectTrigger id="aud-paid">
- <SelectValue />
- </SelectTrigger>
- <SelectContent>
- {entries(PAID_LABELS).map(([v, label]) => (
- <SelectItem key={v} value={v}>{label}</SelectItem>
- ))}
- </SelectContent>
- </Select>
- </Field>
- <Field label="Active within days" htmlFor="aud-active">
- <Input
- id="aud-active"
- type="number"
- min={1}
- max={365}
- disabled={disabled}
- value={value.activeWithinDays}
- onChange={(e) => onChange({ activeWithinDays: e.target.value })}
- />
- </Field>
- <Field label="Storage used ≥ %" htmlFor="aud-storage">
- <Input
- id="aud-storage"
- type="number"
- min={0}
- max={100}
- disabled={disabled}
- value={value.storageUsedPercentAtLeast}
- onChange={(e) => onChange({ storageUsedPercentAtLeast: e.target.value })}
- />
- </Field>
- <Field label="Credits spent ≥ %" htmlFor="aud-credits">
- <Input
- id="aud-credits"
- type="number"
- min={0}
- max={100}
- disabled={disabled}
- value={value.creditsUsedPercentAtLeast}
- onChange={(e) => onChange({ creditsUsedPercentAtLeast: e.target.value })}
- />
- </Field>
- {children}
- </div>
- </div>
- );
-}
diff --git a/site/src/app/su/experiments/ExperimentDialog.tsx b/site/src/app/su/experiments/ExperimentDialog.tsx
deleted file mode 100644
index 55ba1484..00000000
--- a/site/src/app/su/experiments/ExperimentDialog.tsx
+++ /dev/null
@@ -1,380 +0,0 @@
-"use client";
-
-import { useState } from "react";
-import { Plus, X } from "lucide-react";
-
-import {
- AudienceFields,
- audienceDraftFrom,
- audienceInputFrom,
- blankAudienceDraft,
- type AudienceDraft,
-} from "@/app/su/experiments/AudienceFields";
-import { SchemaField, type JsonSchema } from "@/app/su/experiments/SchemaField";
-import { Field } from "@/app/su/Field";
-import { Button } from "@/components/ui/button";
-import {
- Dialog,
- DialogBody,
- DialogContent,
- DialogDescription,
- DialogFooter,
- DialogHeader,
- DialogTitle,
-} from "@/components/ui/dialog";
-import { Input } from "@/components/ui/input";
-import { Label } from "@/components/ui/label";
-import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from "@/components/ui/select";
-import { Switch } from "@/components/ui/switch";
-import { Textarea } from "@/components/ui/textarea";
-import { METRIC_SOURCES, experimentSchema, type ExperimentInput } from "@/lib/config/experiment";
-import { PUBLIC_SETTING_KEYS, SETTINGS, type SettingKey } from "@/lib/config/registry";
-import { useSettings } from "@/queries/settings";
-import {
- useCreateExperiment,
- useUpdateExperiment,
- type ExperimentSummary,
-} from "@/queries/experiments";
-
-// One form for a new experiment and for editing one: who it enrols, the
-// variants they draw (the first is the control), and the metrics that read
-// it. A variant's settings are drawn with the same fields the settings tab
-// uses.
-
-type MetricSource = (typeof METRIC_SOURCES)[number];
-// The label per source; the select's root reads it so the trigger shows the
-// label the menu shows.
-const SOURCE_LABELS: Record<MetricSource, string> = { event: "PostHog event", purchase: "Purchase" };
-
-type Draft = {
- key: string;
- name: string;
- description: string;
- percent: string;
- audience: AudienceDraft;
- variants: { key: string; name: string; weight: string; config: Record<string, unknown> }[];
- metrics: { key: string; name: string; source: (typeof METRIC_SOURCES)[number]; event: string }[];
-};
-
-const blank = (): Draft => ({
- key: "",
- name: "",
- description: "",
- percent: "100",
- audience: blankAudienceDraft(),
- variants: [
- { key: "control", name: "Control", weight: "50", config: {} },
- { key: "treatment", name: "Treatment", weight: "50", config: {} },
- ],
- metrics: [{ key: "purchase", name: "Purchase", source: "purchase", event: "" }],
-});
-
-const fromSummary = (e: ExperimentSummary): Draft => ({
- key: e.key,
- name: e.name,
- description: e.description ?? "",
- percent: String(e.percent),
- audience: audienceDraftFrom(e.audience),
- variants: e.variants.map((v) => ({ ...v, weight: String(v.weight) })),
- metrics: e.metrics.map((m) => ({ ...m, event: m.event ?? "" })),
-});
-
-function toInput(draft: Draft): unknown {
- const audience = audienceInputFrom(draft.audience);
- return {
- key: draft.key.trim(),
- name: draft.name.trim(),
- description: draft.description.trim() || null,
- audience,
- percent: Number(draft.percent),
- variants: draft.variants.map((v) => ({
- key: v.key.trim(),
- name: v.name.trim(),
- weight: Number(v.weight),
- config: v.config,
- })),
- metrics: draft.metrics.map((m) => ({
- key: m.key.trim(),
- name: m.name.trim(),
- source: m.source,
- event: m.source === "event" ? m.event.trim() || null : null,
- })),
- };
-}
-
-export function ExperimentDialog({
- existing,
- open,
- onOpenChange,
-}: {
- existing: ExperimentSummary | null;
- open: boolean;
- onOpenChange: (open: boolean) => void;
-}) {
- const [draft, setDraft] = useState<Draft>(() => (existing ? fromSummary(existing) : blank()));
- const [issues, setIssues] = useState<string[]>([]);
- const create = useCreateExperiment();
- const update = useUpdateExperiment();
- const settings = useSettings();
- const schemas = new Map(settings.data?.settings.map((s) => [s.key, s.schema as JsonSchema]));
- // Anything an account holds, drawn or written by hand: the route rejects a
- // save that drops either.
- const assignedKeys = new Set([
- ...(existing?.stats.filter((s) => s.assigned > 0).map((s) => s.key) ?? []),
- ...(existing?.overrides.flatMap((o) => (o.variant === null ? [] : [o.variant])) ?? []),
- ]);
- const pending = create.isPending || update.isPending;
-
- const submit = () => {
- const parsed = experimentSchema.safeParse(toInput(draft));
- if (!parsed.success) {
- setIssues(parsed.error.issues.map((i) => `${i.path.join(".") || "form"}: ${i.message}`));
- return;
- }
- setIssues([]);
- const input: ExperimentInput = parsed.data;
- const done = { onSuccess: () => onOpenChange(false), onError: (e: Error) => setIssues([e.message]) };
- if (existing) update.mutate({ id: existing.id, ...input }, done);
- else create.mutate(input, done);
- };
-
- const setAudience = (patch: Partial<AudienceDraft>) =>
- setDraft((d) => ({ ...d, audience: { ...d.audience, ...patch } }));
- const setVariant = (i: number, patch: Partial<Draft["variants"][number]>) =>
- setDraft((d) => ({ ...d, variants: d.variants.map((v, j) => (j === i ? { ...v, ...patch } : v)) }));
- const setMetric = (i: number, patch: Partial<Draft["metrics"][number]>) =>
- setDraft((d) => ({ ...d, metrics: d.metrics.map((m, j) => (j === i ? { ...m, ...patch } : m)) }));
-
- return (
- <Dialog open={open} onOpenChange={onOpenChange}>
- <DialogContent className="sm:max-w-3xl">
- <DialogHeader>
- <DialogTitle>{existing ? "Edit experiment" : "New experiment"}</DialogTitle>
- <DialogDescription>
- Accounts in the audience draw a variant by weight the first time they load
- the app, and keep it. The first variant is the control.
- </DialogDescription>
- </DialogHeader>
-
- <DialogBody className="grid gap-5">
- <div className="grid grid-cols-2 gap-3">
- <Field label="Key" htmlFor="exp-key">
- <Input
- id="exp-key"
- placeholder="welcome_copy_v1"
- value={draft.key}
- onChange={(e) => setDraft({ ...draft, key: e.target.value })}
- />
- </Field>
- <Field label="Name" htmlFor="exp-name">
- <Input id="exp-name" value={draft.name} onChange={(e) => setDraft({ ...draft, name: e.target.value })} />
- </Field>
- </div>
- <Field label="Description" htmlFor="exp-desc">
- <Textarea
- id="exp-desc"
- rows={2}
- value={draft.description}
- onChange={(e) => setDraft({ ...draft, description: e.target.value })}
- />
- </Field>
-
- <AudienceFields value={draft.audience} onChange={setAudience}>
- <Field label="Percent enrolled" htmlFor="exp-percent">
- <Input
- id="exp-percent"
- type="number"
- min={0}
- max={100}
- value={draft.percent}
- onChange={(e) => setDraft({ ...draft, percent: e.target.value })}
- />
- </Field>
- </AudienceFields>
-
- <div className="space-y-3">
- <div className="flex items-center justify-between">
- <Label>Variants</Label>
- <Button
- type="button"
- variant="outline"
- size="sm"
- onClick={() =>
- setDraft({
- ...draft,
- variants: [...draft.variants, { key: "", name: "", weight: "50", config: {} }],
- })
- }
- >
- <Plus /> Add variant
- </Button>
- </div>
- {draft.variants.map((variant, i) => (
- <div key={i} className="space-y-3 rounded-lg border p-3">
- <div className="grid grid-cols-[1fr_1fr_100px_auto] items-end gap-2">
- <Field label={i === 0 ? "Key (control)" : "Key"} htmlFor={`v-${i}-key`}>
- <Input
- id={`v-${i}-key`}
- disabled={assignedKeys.has(variant.key)}
- value={variant.key}
- onChange={(e) => setVariant(i, { key: e.target.value })}
- />
- </Field>
- <Field label="Name" htmlFor={`v-${i}-name`}>
- <Input id={`v-${i}-name`} value={variant.name} onChange={(e) => setVariant(i, { name: e.target.value })} />
- </Field>
- <Field label="Weight" htmlFor={`v-${i}-weight`}>
- <Input
- id={`v-${i}-weight`}
- type="number"
- min={0}
- value={variant.weight}
- onChange={(e) => setVariant(i, { weight: e.target.value })}
- />
- </Field>
- <Button
- type="button"
- variant="ghost"
- size="icon"
- aria-label="Remove variant"
- disabled={assignedKeys.has(variant.key) || draft.variants.length <= 1}
- onClick={() =>
- setDraft({ ...draft, variants: draft.variants.filter((_, j) => j !== i) })
- }
- >
- <X />
- </Button>
- </div>
- {PUBLIC_SETTING_KEYS.length === 0 ? (
- <p className="text-xs text-muted-foreground">
- No public setting is registered yet; the app reads the variant key itself.
- </p>
- ) : null}
- <div className="grid gap-2">
- {PUBLIC_SETTING_KEYS.map((key: SettingKey) => {
- const carries = key in variant.config;
- return (
- <div key={key} className="space-y-2">
- <div className="flex items-center gap-2">
- <Switch
- checked={carries}
- onCheckedChange={(on) => {
- const config = { ...variant.config };
- if (on) config[key] = structuredClone(SETTINGS[key].default);
- else delete config[key];
- setVariant(i, { config });
- }}
- />
- <span className="text-sm">{SETTINGS[key].title}</span>
- <span className="text-xs text-muted-foreground">{key}</span>
- </div>
- {carries && schemas.get(key) ? (
- <div className="pl-10">
- <SchemaField
- id={`v-${i}-${key}`}
- schema={schemas.get(key)!}
- value={variant.config[key]}
- onChange={(next) =>
- setVariant(i, { config: { ...variant.config, [key]: next } })
- }
- />
- </div>
- ) : null}
- </div>
- );
- })}
- </div>
- </div>
- ))}
- </div>
-
- <div className="space-y-3">
- <div className="flex items-center justify-between">
- <div>
- <Label>Metrics</Label>
- <p className="text-xs text-muted-foreground">
- Counted per exposed account, after its exposure. The first decides the verdict.
- </p>
- </div>
- <Button
- type="button"
- variant="outline"
- size="sm"
- onClick={() =>
- setDraft({
- ...draft,
- metrics: [...draft.metrics, { key: "", name: "", source: "event", event: "" }],
- })
- }
- >
- <Plus /> Add metric
- </Button>
- </div>
- {draft.metrics.map((metric, i) => (
- <div key={i} className="grid grid-cols-[1fr_1fr_140px_1fr_auto] items-end gap-2">
- <Field label={i === 0 ? "Key (primary)" : "Key"} htmlFor={`m-${i}-key`}>
- <Input id={`m-${i}-key`} value={metric.key} onChange={(e) => setMetric(i, { key: e.target.value })} />
- </Field>
- <Field label="Name" htmlFor={`m-${i}-name`}>
- <Input id={`m-${i}-name`} value={metric.name} onChange={(e) => setMetric(i, { name: e.target.value })} />
- </Field>
- <Field label="Source" htmlFor={`m-${i}-source`}>
- <Select
- value={metric.source}
- items={SOURCE_LABELS}
- onValueChange={(v) => setMetric(i, { source: v as Draft["metrics"][number]["source"] })}
- >
- <SelectTrigger id={`m-${i}-source`}>
- <SelectValue />
- </SelectTrigger>
- <SelectContent>
- {(Object.keys(SOURCE_LABELS) as MetricSource[]).map((s) => (
- <SelectItem key={s} value={s}>{SOURCE_LABELS[s]}</SelectItem>
- ))}
- </SelectContent>
- </Select>
- </Field>
- <Field label="Event" htmlFor={`m-${i}-event`}>
- <Input
- id={`m-${i}-event`}
- disabled={metric.source !== "event"}
- placeholder="export_completed"
- value={metric.event}
- onChange={(e) => setMetric(i, { event: e.target.value })}
- />
- </Field>
- <Button
- type="button"
- variant="ghost"
- size="icon"
- aria-label="Remove metric"
- onClick={() => setDraft({ ...draft, metrics: draft.metrics.filter((_, j) => j !== i) })}
- >
- <X />
- </Button>
- </div>
- ))}
- </div>
-
- {issues.length > 0 ? (
- <ul className="space-y-1 text-sm text-destructive">
- {issues.map((issue) => (
- <li key={issue}>{issue}</li>
- ))}
- </ul>
- ) : null}
- </DialogBody>
-
- <DialogFooter>
- <Button variant="outline" onClick={() => onOpenChange(false)}>
- Cancel
- </Button>
- <Button disabled={pending} onClick={submit}>
- {pending ? "Saving…" : existing ? "Save" : "Create draft"}
- </Button>
- </DialogFooter>
- </DialogContent>
- </Dialog>
- );
-}
-
diff --git a/site/src/app/su/experiments/SchemaField.tsx b/site/src/app/su/experiments/SchemaField.tsx
deleted file mode 100644
index c94c6068..00000000
--- a/site/src/app/su/experiments/SchemaField.tsx
+++ /dev/null
@@ -1,187 +0,0 @@
-"use client";
-
-import { useState } from "react";
-
-import { Input } from "@/components/ui/input";
-import { Label } from "@/components/ui/label";
-import {
- Select,
- SelectContent,
- SelectItem,
- SelectTrigger,
- SelectValue,
-} from "@/components/ui/select";
-import { Switch } from "@/components/ui/switch";
-import { Textarea } from "@/components/ui/textarea";
-
-// A value editor drawn from a setting's JSON schema (the registry's zod schema,
-// converted on the server). One level of object nests as a fieldset; anything
-// deeper or stranger falls back to JSON text, which the route still validates.
-
-export type JsonSchema = {
- type?: string | string[];
- enum?: unknown[];
- anyOf?: JsonSchema[];
- properties?: Record<string, JsonSchema>;
- required?: string[];
- items?: JsonSchema;
- minimum?: number;
- maximum?: number;
- description?: string;
-};
-
-type Props = {
- id: string;
- schema: JsonSchema;
- value: unknown;
- onChange: (value: unknown) => void;
- depth?: number;
-};
-
-// A nullable scalar arrives as anyOf [scalar, null]; the form shows the
-// scalar's control with "off" standing for null.
-function nullable(schema: JsonSchema): { inner: JsonSchema; nullable: boolean } {
- if (!schema.anyOf) return { inner: schema, nullable: false };
- const inner = schema.anyOf.find((s) => s.type !== "null");
- const hasNull = schema.anyOf.some((s) => s.type === "null");
- return inner && hasNull && schema.anyOf.length === 2
- ? { inner, nullable: true }
- : { inner: schema, nullable: false };
-}
-
-export function SchemaField({ id, schema: raw, value, onChange, depth = 0 }: Props) {
- const { inner, nullable: isNullable } = nullable(raw);
- const type = Array.isArray(inner.type) ? inner.type[0] : inner.type;
-
- if (inner.enum) {
- return (
- <Select value={String(value)} onValueChange={(v) => onChange(v)}>
- <SelectTrigger id={id} className="w-48">
- <SelectValue />
- </SelectTrigger>
- <SelectContent>
- {inner.enum.map((option) => (
- <SelectItem key={String(option)} value={String(option)}>
- {String(option)}
- </SelectItem>
- ))}
- </SelectContent>
- </Select>
- );
- }
-
- if (type === "boolean") {
- return <Switch id={id} checked={value === true} onCheckedChange={(checked) => onChange(checked)} />;
- }
-
- if (type === "number" || type === "integer") {
- return (
- <div className="flex items-center gap-2">
- {isNullable ? (
- <Switch
- aria-label="Rule on"
- checked={value !== null}
- onCheckedChange={(on) => onChange(on ? (inner.minimum ?? 0) : null)}
- />
- ) : null}
- <Input
- id={id}
- className="w-28"
- type="number"
- disabled={isNullable && value === null}
- min={inner.minimum}
- max={inner.maximum}
- step={type === "integer" ? 1 : "any"}
- value={value === null || value === undefined ? "" : String(value)}
- onChange={(event) => {
- const next = event.target.value;
- onChange(next === "" ? (isNullable ? null : 0) : Number(next));
- }}
- />
- {isNullable && value === null ? (
- <span className="text-xs text-muted-foreground">off</span>
- ) : null}
- </div>
- );
- }
-
- if (type === "string") {
- return (
- <Input
- id={id}
- className="max-w-md"
- value={typeof value === "string" ? value : ""}
- onChange={(event) => onChange(event.target.value)}
- />
- );
- }
-
- if (type === "array" && inner.items && inner.items.type === "string") {
- const list = Array.isArray(value) ? (value as string[]) : [];
- return (
- <Input
- id={id}
- className="max-w-md"
- placeholder="comma separated"
- value={list.join(", ")}
- onChange={(event) =>
- onChange(
- event.target.value
- .split(",")
- .map((s) => s.trim())
- .filter(Boolean),
- )
- }
- />
- );
- }
-
- if (type === "object" && inner.properties && depth === 0) {
- const record = (value && typeof value === "object" ? value : {}) as Record<string, unknown>;
- return (
- <div className="grid gap-3">
- {Object.entries(inner.properties).map(([name, property]) => (
- <div key={name} className="grid grid-cols-[180px_1fr] items-center gap-3">
- <Label htmlFor={`${id}-${name}`} className="text-muted-foreground">
- {name}
- </Label>
- <SchemaField
- id={`${id}-${name}`}
- schema={property}
- value={record[name]}
- onChange={(next) => onChange({ ...record, [name]: next })}
- depth={depth + 1}
- />
- </div>
- ))}
- </div>
- );
- }
-
- return <JsonField id={id} value={value} onChange={onChange} />;
-}
-
-function JsonField({ id, value, onChange }: { id: string; value: unknown; onChange: (v: unknown) => void }) {
- const [text, setText] = useState(() => JSON.stringify(value, null, 2));
- const [bad, setBad] = useState(false);
- return (
- <div className="space-y-1">
- <Textarea
- id={id}
- className="font-mono text-xs"
- rows={6}
- value={text}
- onChange={(event) => {
- setText(event.target.value);
- try {
- onChange(JSON.parse(event.target.value));
- setBad(false);
- } catch {
- setBad(true);
- }
- }}
- />
- {bad ? <p className="text-xs text-destructive">Not valid JSON.</p> : null}
- </div>
- );
-}
diff --git a/site/src/app/su/experiments/SettingCard.tsx b/site/src/app/su/experiments/SettingCard.tsx
deleted file mode 100644
index a394dbf8..00000000
--- a/site/src/app/su/experiments/SettingCard.tsx
+++ /dev/null
@@ -1,79 +0,0 @@
-"use client";
-
-import { useState } from "react";
-
-import { SchemaField, type JsonSchema } from "@/app/su/experiments/SchemaField";
-import { Badge } from "@/components/ui/badge";
-import { Button } from "@/components/ui/button";
-import {
- Card,
- CardContent,
- CardDescription,
- CardHeader,
- CardTitle,
-} from "@/components/ui/card";
-import { useResetSetting, useSaveSetting, type SettingRow } from "@/queries/settings";
-
-// One registered setting, editable. The value on screen is what the product
-// reads for everyone outside an experiment; Reset returns it to the default
-// declared in code. Every su page that shows settings draws them with this.
-export function SettingCard({ row }: { row: SettingRow }) {
- const save = useSaveSetting();
- const reset = useResetSetting();
- const [draft, setDraft] = useState<unknown>(row.value);
- const [savedFrom, setSavedFrom] = useState(() => JSON.stringify(row.value));
- // A save or reset that lands replaces the row; the draft follows it. The
- // comparison is by content: a refetch hands back an equal object under a
- // new reference, and that must not throw away what is being typed.
- const incoming = JSON.stringify(row.value);
- if (savedFrom !== incoming) {
- setSavedFrom(incoming);
- setDraft(row.value);
- }
- const dirty = JSON.stringify(draft) !== JSON.stringify(row.value);
-
- return (
- <Card>
- <CardHeader>
- <CardTitle className="flex items-center gap-2">
- {row.title}
- <Badge variant="outline">{row.public ? "public" : "server"}</Badge>
- {row.overridden ? <Badge variant="secondary">overridden</Badge> : null}
- {row.invalid ? <Badge variant="destructive">invalid, reset</Badge> : null}
- </CardTitle>
- <CardDescription>{row.description}</CardDescription>
- </CardHeader>
- <CardContent className="space-y-4">
- <SchemaField
- id={`setting-${row.key}`}
- schema={row.schema as JsonSchema}
- value={draft}
- onChange={setDraft}
- />
- <div className="flex items-center gap-2">
- <Button
- disabled={!dirty || save.isPending}
- onClick={() => save.mutate({ key: row.key, value: draft })}
- >
- {save.isPending ? "Saving…" : "Save"}
- </Button>
- <Button
- variant="outline"
- disabled={!row.overridden || reset.isPending}
- onClick={() => reset.mutate(row.key)}
- >
- Reset to default
- </Button>
- {row.updatedAt ? (
- <span className="text-xs text-muted-foreground">
- changed {new Date(row.updatedAt).toLocaleString()}
- </span>
- ) : null}
- </div>
- {save.isError ? (
- <p className="text-sm text-destructive">The value was rejected. Check each field.</p>
- ) : null}
- </CardContent>
- </Card>
- );
-}
diff --git a/site/src/app/su/experiments/list/page.tsx b/site/src/app/su/experiments/list/page.tsx
deleted file mode 100644
index 04d7ba74..00000000
--- a/site/src/app/su/experiments/list/page.tsx
+++ /dev/null
@@ -1,406 +0,0 @@
-"use client";
-
-import { useState } from "react";
-
-import { ExperimentDialog } from "@/app/su/experiments/ExperimentDialog";
-import { Badge } from "@/components/ui/badge";
-import { Button } from "@/components/ui/button";
-import { Input } from "@/components/ui/input";
-import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from "@/components/ui/select";
-import { SuStandIn } from "@/app/su/SuStandIn";
-import { describeAudience } from "@donkeycut/abexp";
-import type { ExperimentStatus } from "@/lib/config/experiment";
-import type { MetricResult, VerdictState } from "@donkeycut/abexp";
-import {
- useAddHoldout,
- useComputeResults,
- useDeleteExperiment,
- useExperiments,
- useHoldout,
- useRemoveAssignment,
- useRemoveHoldout,
- useSetAssignment,
- useSetExperimentStatus,
- type ExperimentSummary,
-} from "@/queries/experiments";
-
-type BadgeVariant = "default" | "secondary" | "outline" | "destructive";
-
-const STATUS_VARIANT: Record<ExperimentStatus, BadgeVariant> = {
- draft: "outline",
- running: "default",
- paused: "secondary",
- ended: "destructive",
-};
-
-const VERDICT: Record<VerdictState, { label: string; variant: BadgeVariant }> = {
- insufficient: { label: "Too early", variant: "outline" },
- keep_running: { label: "Keep running", variant: "secondary" },
- ship: { label: "Ship it", variant: "default" },
- stop: { label: "Stop it", variant: "destructive" },
-};
-
-
-const HOLD_OUT_KEY = "__hold_out__";
-
-const pct = (x: number) => `${(100 * x).toFixed(1)}%`;
-const when = (iso: string) => new Date(iso).toLocaleString();
-
-export default function SuExperimentsListPage() {
- const experiments = useExperiments();
- const [editing, setEditing] = useState<ExperimentSummary | null>(null);
- const [dialogOpen, setDialogOpen] = useState(false);
- // The dialog mounts fresh per open so its draft starts from the row.
- const [dialogKey, setDialogKey] = useState(0);
- const open = (e: ExperimentSummary | null) => {
- setEditing(e);
- setDialogKey((k) => k + 1);
- setDialogOpen(true);
- };
-
- if (!experiments.data) return <SuStandIn />;
-
- return (
- <div className="space-y-6 pb-9">
- <div className="flex justify-end">
- <Button onClick={() => open(null)}>New experiment</Button>
- </div>
- {experiments.data.experiments.length === 0 ? (
- <p className="text-sm text-muted-foreground">No experiments yet.</p>
- ) : null}
- {experiments.data.experiments.map((e) => (
- <ExperimentRow key={e.id} experiment={e} onEdit={() => open(e)} />
- ))}
- <Holdout />
- {dialogOpen ? (
- <ExperimentDialog key={dialogKey} existing={editing} open={dialogOpen} onOpenChange={setDialogOpen} />
- ) : null}
- </div>
- );
-}
-
-function ExperimentRow({ experiment: e, onEdit }: { experiment: ExperimentSummary; onEdit: () => void }) {
- const setStatus = useSetExperimentStatus();
- const remove = useDeleteExperiment();
- const compute = useComputeResults();
- const status = e.status as ExperimentStatus;
- const go = (next: ExperimentStatus) => setStatus.mutate({ id: e.id, status: next });
- const busy = setStatus.isPending || remove.isPending;
-
- return (
- <div className="rounded-lg border p-4">
- <div className="flex items-start justify-between gap-4">
- <div className="min-w-0">
- <div className="flex items-center gap-2">
- <span className="font-medium">{e.name}</span>
- <span className="font-mono text-xs text-muted-foreground">{e.key}</span>
- <Badge variant={STATUS_VARIANT[status]}>{status}</Badge>
- </div>
- {e.description ? <p className="mt-1 text-sm text-muted-foreground">{e.description}</p> : null}
- <p className="mt-1 text-xs text-muted-foreground">
- {describeAudience(e.audience)} · {e.percent}% enrolled
- </p>
- </div>
- <div className="flex shrink-0 items-center gap-2">
- {status === "draft" ? (
- <Button size="sm" disabled={busy} onClick={() => go("running")}>
- Start
- </Button>
- ) : null}
- {status === "running" ? (
- <Button size="sm" variant="outline" disabled={busy} onClick={() => go("paused")}>
- Pause
- </Button>
- ) : null}
- {status === "paused" ? (
- <Button size="sm" disabled={busy} onClick={() => go("running")}>
- Resume
- </Button>
- ) : null}
- {status === "running" || status === "paused" ? (
- <Button size="sm" variant="destructive" disabled={busy} onClick={() => go("ended")}>
- End
- </Button>
- ) : null}
- {status !== "ended" ? (
- <Button size="sm" variant="ghost" onClick={onEdit}>
- Edit
- </Button>
- ) : null}
- {status === "draft" ? (
- <Button size="sm" variant="ghost" disabled={busy} onClick={() => remove.mutate(e.id)}>
- Delete
- </Button>
- ) : null}
- </div>
- </div>
-
- <table className="mt-3 w-full text-sm">
- <thead className="text-left text-xs text-muted-foreground">
- <tr>
- <th className="py-1 font-normal">Variant</th>
- <th className="py-1 font-normal">Weight</th>
- <th className="py-1 font-normal">Changes</th>
- <th className="py-1 text-right font-normal">Assigned</th>
- <th className="py-1 text-right font-normal">Exposed</th>
- </tr>
- </thead>
- <tbody>
- {e.variants.map((v, i) => {
- const stat = e.stats.find((s) => s.key === v.key);
- return (
- <tr key={v.key} className="border-t">
- <td className="py-1.5">
- {v.name} <span className="font-mono text-xs text-muted-foreground">{v.key}</span>
- {i === 0 ? <span className="ml-1 text-xs text-muted-foreground">control</span> : null}
- </td>
- <td className="py-1.5 tabular-nums">{v.weight}</td>
- <td className="py-1.5 text-xs text-muted-foreground">
- {Object.keys(v.config).join(", ") || "nothing"}
- </td>
- <td className="py-1.5 text-right tabular-nums">{stat?.assigned ?? 0}</td>
- <td className="py-1.5 text-right tabular-nums">{stat?.exposed ?? 0}</td>
- </tr>
- );
- })}
- </tbody>
- </table>
-
- {status !== "draft" ? (
- <div className="mt-4 space-y-2">
- <div className="flex items-center justify-between">
- <div className="flex items-center gap-2">
- <span className="text-sm font-medium">Results</span>
- {e.results ? (
- <Badge variant={VERDICT[e.results.verdict.state].variant}>
- {VERDICT[e.results.verdict.state].label}
- </Badge>
- ) : null}
- <span className="text-xs text-muted-foreground">
- {e.resultsAt ? `computed ${when(e.resultsAt)}` : "not computed yet; the nightly run will"}
- </span>
- </div>
- <Button size="sm" variant="outline" disabled={compute.isPending} onClick={() => compute.mutate(e.id)}>
- {compute.isPending ? "Computing…" : "Compute now"}
- </Button>
- </div>
- {compute.isError ? <p className="text-sm text-destructive">{compute.error.message}</p> : null}
- {e.results ? (
- <>
- <p className="text-sm">
- {e.results.verdict.reason}
- {e.results.verdict.neededPerArm !== null && e.results.verdict.state !== "ship" ? (
- <span className="text-muted-foreground">
- {" "}
- About {e.results.verdict.neededPerArm.toLocaleString()} exposed per arm reads a{" "}
- {Math.round(100 * plannedLift(e.results.metrics[0]))}% lift.
- </span>
- ) : null}
- </p>
- {e.results.metrics.map((m) => (
- <MetricTable key={m.key} metric={m} control={e.results!.control} />
- ))}
- {e.results.notes.map((note) => (
- <p key={note} className="text-xs text-muted-foreground">
- {note}
- </p>
- ))}
- </>
- ) : null}
- </div>
- ) : null}
-
- <Overrides experiment={e} />
- </div>
- );
-}
-
-// The lift the sample-size estimate planned for: the larger of the standard
-// one and what the arms have shown so far.
-function plannedLift(metric: MetricResult | undefined): number {
- const observed = metric?.comparisons.map((c) => Math.abs(c.relativeLift ?? 0)) ?? [];
- return Math.max(0.2, ...observed);
-}
-
-function MetricTable({ metric, control }: { metric: MetricResult; control: string }) {
- return (
- <table className="w-full text-sm">
- <thead className="text-left text-xs text-muted-foreground">
- <tr>
- <th className="py-1 font-normal">
- {metric.name}
- {metric.event ? <span className="ml-1 font-mono">{metric.event}</span> : null}
- </th>
- <th className="py-1 text-right font-normal">Exposed</th>
- <th className="py-1 text-right font-normal">Converted</th>
- <th className="py-1 text-right font-normal">Rate</th>
- <th className="py-1 text-right font-normal">Lift</th>
- <th className="py-1 text-right font-normal">p</th>
- <th className="py-1 text-right font-normal">Beats control</th>
- </tr>
- </thead>
- <tbody>
- {metric.variants.map((v) => {
- const cmp = metric.comparisons.find((c) => c.variant === v.key);
- return (
- <tr key={v.key} className="border-t">
- <td className="py-1 font-mono text-xs">{v.key}</td>
- <td className="py-1 text-right tabular-nums">{v.exposed}</td>
- <td className="py-1 text-right tabular-nums">{v.converted}</td>
- <td className="py-1 text-right tabular-nums">{pct(v.rate)}</td>
- <td className="py-1 text-right tabular-nums">
- {v.key === control ? "—" : cmp?.relativeLift === null || cmp === undefined ? "n/a" : pct(cmp.relativeLift)}
- </td>
- <td className="py-1 text-right tabular-nums">
- {v.key === control ? "—" : cmp?.pValue == null ? "n/a" : cmp.pValue.toFixed(3)}
- </td>
- <td className="py-1 text-right tabular-nums">
- {v.key === control || !cmp ? "—" : pct(cmp.probabilityBeatsControl)}
- </td>
- </tr>
- );
- })}
- </tbody>
- </table>
- );
-}
-
-// Assignments written by hand: an account put into a variant, or held out of
-// this one experiment.
-function Overrides({ experiment: e }: { experiment: ExperimentSummary }) {
- const set = useSetAssignment();
- const remove = useRemoveAssignment();
- const [email, setEmail] = useState("");
- const [variant, setVariant] = useState<string>(e.variants[0]?.key ?? HOLD_OUT_KEY);
- const submit = () => {
- if (!email.trim()) return;
- set.mutate(
- { id: e.id, email: email.trim(), variant: variant === HOLD_OUT_KEY ? null : variant },
- { onSuccess: () => setEmail("") },
- );
- };
- return (
- <div className="mt-4 space-y-2">
- <span className="text-sm font-medium">Overrides</span>
- {e.overrides.length > 0 ? (
- <ul className="space-y-1 text-sm">
- {e.overrides.map((o) => (
- <li key={o.userId} className="flex items-center gap-2">
- <span>{o.email}</span>
- <span className="font-mono text-xs text-muted-foreground">{o.variant ?? "held out"}</span>
- <Button
- size="sm"
- variant="ghost"
- disabled={remove.isPending}
- onClick={() => remove.mutate({ id: e.id, userId: o.userId })}
- >
- Remove
- </Button>
- </li>
- ))}
- </ul>
- ) : null}
- <div className="flex items-center gap-2">
- <Input
- className="max-w-xs"
- placeholder="account email"
- value={email}
- onChange={(ev) => setEmail(ev.target.value)}
- onKeyDown={(ev) => {
- if (ev.key === "Enter") submit();
- }}
- />
- <Select
- value={variant}
- items={{
- ...Object.fromEntries(e.variants.map((v) => [v.key, v.name])),
- [HOLD_OUT_KEY]: "Hold out",
- }}
- onValueChange={(v) => setVariant(v ?? HOLD_OUT_KEY)}
- >
- <SelectTrigger className="w-44">
- <SelectValue />
- </SelectTrigger>
- <SelectContent>
- {e.variants.map((v) => (
- <SelectItem key={v.key} value={v.key}>
- {v.name}
- </SelectItem>
- ))}
- <SelectItem value={HOLD_OUT_KEY}>Hold out</SelectItem>
- </SelectContent>
- </Select>
- <Button size="sm" variant="outline" disabled={set.isPending || !email.trim()} onClick={submit}>
- Set
- </Button>
- </div>
- {set.isError ? <p className="text-sm text-destructive">{set.error.message}</p> : null}
- </div>
- );
-}
-
-// Accounts kept out of every experiment.
-function Holdout() {
- const holdout = useHoldout();
- const add = useAddHoldout();
- const remove = useRemoveHoldout();
- const [email, setEmail] = useState("");
- const [note, setNote] = useState("");
- const submit = () => {
- if (!email.trim()) return;
- add.mutate(
- { email: email.trim(), note: note.trim() || null },
- {
- onSuccess: () => {
- setEmail("");
- setNote("");
- },
- },
- );
- };
- return (
- <div className="rounded-lg border p-4">
- <div className="space-y-1">
- <span className="font-medium">Holdout</span>
- <p className="text-sm text-muted-foreground">
- Accounts kept out of every experiment: they are never assigned, read the plain
- configuration, and never count in a result.
- </p>
- </div>
- {holdout.data && holdout.data.holdout.length > 0 ? (
- <ul className="mt-3 space-y-1 text-sm">
- {holdout.data.holdout.map((h) => (
- <li key={h.userId} className="flex items-center gap-2">
- <span>{h.email}</span>
- {h.note ? <span className="text-xs text-muted-foreground">{h.note}</span> : null}
- <Button size="sm" variant="ghost" disabled={remove.isPending} onClick={() => remove.mutate(h.userId)}>
- Remove
- </Button>
- </li>
- ))}
- </ul>
- ) : null}
- <div className="mt-3 flex items-center gap-2">
- <Input
- className="max-w-xs"
- placeholder="account email"
- value={email}
- onChange={(ev) => setEmail(ev.target.value)}
- />
- <Input
- className="max-w-xs"
- placeholder="note"
- value={note}
- onChange={(ev) => setNote(ev.target.value)}
- onKeyDown={(ev) => {
- if (ev.key === "Enter") submit();
- }}
- />
- <Button size="sm" variant="outline" disabled={add.isPending || !email.trim()} onClick={submit}>
- Hold out
- </Button>
- </div>
- {add.isError ? <p className="mt-2 text-sm text-destructive">{add.error.message}</p> : null}
- </div>
- );
-}
diff --git a/site/src/app/su/experiments/settings/page.tsx b/site/src/app/su/experiments/settings/page.tsx
deleted file mode 100644
index acc21bcb..00000000
--- a/site/src/app/su/experiments/settings/page.tsx
+++ /dev/null
@@ -1,28 +0,0 @@
-"use client";
-
-import { SettingCard } from "@/app/su/experiments/SettingCard";
-import { SuStandIn } from "@/app/su/SuStandIn";
-import { useSettings } from "@/queries/settings";
-
-// Every registered setting, editable.
-export default function SuSettingsPage() {
- const settings = useSettings();
- if (!settings.data) {
- return <SuStandIn />;
- }
- if (settings.data.settings.length === 0) {
- return (
- <p className="max-w-2xl text-sm text-muted-foreground">
- No setting is registered yet. A feature declares one in the settings registry and it
- appears here, with a form drawn from its schema.
- </p>
- );
- }
- return (
- <div className="max-w-2xl space-y-6 pb-9">
- {settings.data.settings.map((row) => (
- <SettingCard key={row.key} row={row} />
- ))}
- </div>
- );
-}
diff --git a/site/src/app/su/jobs/email/page.tsx b/site/src/app/su/jobs/email/page.tsx
deleted file mode 100644
index ea397a44..00000000
--- a/site/src/app/su/jobs/email/page.tsx
+++ /dev/null
@@ -1,351 +0,0 @@
-"use client";
-
-import { ChevronRight } from "lucide-react";
-import { useState } from "react";
-
-import { Button } from "@/components/ui/button";
-import { useLocalPref } from "@/cut/lib/uiState";
-import { cn } from "@/lib/utils";
-import {
- useEmailOutbox,
- useOutboxAction,
- type OutboxCampaign,
- type OutboxItem,
- type OutboxOverview,
-} from "@/queries/emailOutbox";
-
-function formatWhen(iso: string): string {
- const then = new Date(iso);
- const mins = Math.round((then.getTime() - Date.now()) / 60000);
- const abs = Math.abs(mins);
- if (abs < 1) return "now";
- const span =
- abs < 60
- ? `${abs}m`
- : abs < 60 * 24
- ? `${Math.floor(abs / 60)}h`
- : then.toLocaleDateString(undefined, { month: "short", day: "numeric" });
- return mins < 0 ? `${span} ago` : `in ${span}`;
-}
-
-function formatDuration(seconds: number): string {
- const d = Math.floor(seconds / 86400);
- const h = Math.floor((seconds % 86400) / 3600);
- const m = Math.floor((seconds % 3600) / 60);
- if (d > 0) return `${d}d ${h}h`;
- return h > 0 ? `${h}h ${m}m` : `${m}m`;
-}
-
-function formatDay(iso: string): string {
- return new Date(iso).toLocaleDateString(undefined, { month: "short", day: "numeric", timeZone: "UTC" });
-}
-
-const stateDot: Record<string, string> = {
- queued: "bg-muted-foreground/40",
- sending: "bg-blue-500 animate-pulse",
- sent: "bg-emerald-500",
- skipped: "bg-muted-foreground/40",
- failed: "bg-destructive",
-};
-
-// The cycle's budget as three stop lines on one counter. Each bar is how far
-// that class of send may go before the plan renews; the fill is what has
-// gone out so far this cycle.
-function QuotaSection({ quota }: { quota: OutboxOverview["quota"] }) {
- const { forecast } = quota;
- const classes = [
- {
- label: "Manual",
- ceiling: quota.ceilings.manual,
- note:
- quota.manualReserve > 0
- ? `${quota.manualReserve} held below this for hand-sent mail on the work days left`
- : "no work days left; the hand-sent reserve is released",
- },
- { label: "Transactional", ceiling: quota.ceilings.transactional, note: "welcome and credit emails" },
- {
- label: "Bulk",
- ceiling: quota.ceilings.bulk,
- note: `holds back ${forecast.total} for the rest of the cycle: ${forecast.signups} signups expected, ${forecast.expiry} expiry notices owed, ${forecast.headroom} headroom`,
- },
- ];
- return (
- <section className="space-y-3">
- <div className="flex flex-wrap items-baseline gap-x-3 text-sm">
- <span className="font-medium">
- Cycle {formatDay(quota.cycle.start)} – {formatDay(quota.cycle.end)}
- </span>
- <span className="text-muted-foreground">
- {quota.sent} of {quota.allowance} sent · {quota.sentToday} today · renews in {formatDuration(quota.renewsInSeconds)}
- </span>
- </div>
- <ul className="space-y-3">
- {classes.map((c) => {
- const ceiling = Math.max(0, c.ceiling);
- const width = Math.min(100, (100 * ceiling) / quota.allowance);
- const fill = Math.min(100, (100 * Math.min(quota.sent, ceiling)) / quota.allowance);
- const left = Math.max(0, ceiling - quota.sent);
- return (
- <li key={c.label} className="grid grid-cols-[120px_1fr_72px] items-center gap-x-3 gap-y-0.5 text-sm">
- <span>{c.label}</span>
- <div className="relative h-2 rounded-full bg-muted">
- <div className="absolute inset-y-0 left-0 rounded-full bg-muted-foreground/25" style={{ width: `${width}%` }} />
- <div className="absolute inset-y-0 left-0 rounded-full bg-foreground" style={{ width: `${fill}%` }} />
- </div>
- <span className={cn("text-right tabular-nums", left === 0 ? "text-destructive" : "text-muted-foreground")}>
- {left} left
- </span>
- <span className="col-span-3 text-xs text-muted-foreground">{c.note}</span>
- </li>
- );
- })}
- </ul>
- </section>
- );
-}
-
-function KindsSection({ kinds }: { kinds: OutboxOverview["kinds"] }) {
- const action = useOutboxAction();
- // The fold sticks across visits.
- const [open, setOpen] = useLocalPref<boolean>("su-email-kinds-open", true, (v) => typeof v === "boolean");
- const cell = "py-1.5 pr-3";
- return (
- <section className="space-y-2">
- <button
- type="button"
- className="-mx-2 flex items-center gap-1.5 rounded-md px-2 py-1 text-left text-sm font-medium hover:bg-muted/50"
- aria-expanded={open}
- onClick={() => setOpen((v) => !v)}
- >
- <ChevronRight className={cn("size-4 shrink-0 transition-transform duration-200", open && "rotate-90")} />
- Kinds, in send order
- </button>
- {open ? (
- <div className="overflow-x-auto">
- <table className="w-full text-sm">
- <thead className="text-left text-xs text-muted-foreground">
- <tr>
- <th className="py-1 pr-3 font-normal">Kind</th>
- <th className="py-1 pr-3 font-normal">Priority</th>
- <th className="py-1 pr-3 font-normal">Quota</th>
- <th className="py-1 pr-3 text-right font-normal">Queued</th>
- <th className="py-1 pr-3 text-right font-normal">Sent today</th>
- <th className="py-1 pr-3 text-right font-normal">Failed</th>
- <th className="py-1" />
- </tr>
- </thead>
- <tbody>
- {[...kinds]
- .sort((a, b) => b.priority - a.priority)
- .map((k) => (
- <tr key={k.kind} className="border-t hover:bg-muted/50">
- <td className={cn(cell, "font-medium")}>{k.kind}</td>
- <td className={cn(cell, "tabular-nums text-muted-foreground")}>{k.priority}</td>
- <td className={cn(cell, "text-muted-foreground")}>{k.quota}</td>
- <td className={cn(cell, "text-right tabular-nums")}>{k.queued}</td>
- <td className={cn(cell, "text-right tabular-nums")}>{k.sentToday}</td>
- <td className={cn(cell, "text-right tabular-nums", k.failed > 0 && "text-destructive")}>{k.failed}</td>
- <td className="py-1 text-right">
- <span className="inline-flex items-center gap-2">
- {action.isError && action.variables?.action === "drain" && action.variables.kind === k.kind ? (
- <span className="text-xs text-destructive">Failed.</span>
- ) : k.drainer?.state === "held" ? (
- <span className="text-xs text-muted-foreground">held · resumes {formatWhen(k.drainer.resumesAt)}</span>
- ) : null}
- <Button
- disabled={k.queued === 0 || k.drainer?.state === "running" || action.isPending}
- onClick={() => action.mutate({ action: "drain", kind: k.kind })}
- size="sm"
- variant="outline"
- >
- {k.drainer?.state === "running" ? "Draining…" : "Drain"}
- </Button>
- </span>
- </td>
- </tr>
- ))}
- </tbody>
- </table>
- </div>
- ) : null}
- </section>
- );
-}
-
-function ItemRow({ item, onRetry, retrying }: { item: OutboxItem; onRetry: () => void; retrying: boolean }) {
- const when = item.sentAt
- ? formatWhen(item.sentAt)
- : item.backingOff
- ? `retries ${formatWhen(item.notBefore)}`
- : `queued ${formatWhen(item.createdAt)}`;
- return (
- <li className="-mx-2 flex items-start gap-2.5 rounded-md px-2 py-1 hover:bg-muted/50">
- <span className={cn("mt-1.5 size-2 shrink-0 rounded-full", stateDot[item.state] ?? stateDot.queued)} />
- <div className="min-w-0 flex-1 text-sm">
- <div className="flex flex-wrap items-baseline gap-x-2">
- <span className="font-medium">{item.kind}</span>
- {item.promotionName ? <span className="text-muted-foreground">{item.promotionName}</span> : null}
- <span className="text-muted-foreground">{item.email ?? "inbox"}</span>
- <span className="text-muted-foreground">{item.state}</span>
- <span className="text-muted-foreground">{when}</span>
- {item.attempts > 0 && item.state !== "sent" ? (
- <span className="text-muted-foreground">{item.attempts} tries</span>
- ) : null}
- </div>
- {item.error ? <p className="text-destructive">{item.error}</p> : null}
- </div>
- {item.state === "failed" ? (
- <Button disabled={retrying} onClick={onRetry} size="sm" variant="outline">
- Retry
- </Button>
- ) : null}
- </li>
- );
-}
-
-function ItemList({ items }: { items: OutboxItem[] }) {
- const action = useOutboxAction();
- return (
- <ul className="space-y-1">
- {items.map((item) => (
- <ItemRow
- key={item.id}
- item={item}
- onRetry={() => action.mutate({ action: "retry", id: item.id })}
- retrying={action.isPending}
- />
- ))}
- </ul>
- );
-}
-
-// A campaign's rows fold under one line carrying the whole count from the
-// server; the rows beneath are the section's page of it.
-function CampaignGroup({ campaign, count, items }: { campaign: OutboxCampaign; count: number; items: OutboxItem[] }) {
- const [open, setOpen] = useState(false);
- const dot = stateDot[items[0].state] ?? stateDot.queued;
- return (
- <li className="space-y-2">
- <button
- type="button"
- className="-mx-2 flex w-[calc(100%+1rem)] items-start gap-2.5 rounded-md px-2 py-1 text-left text-sm hover:bg-muted/50"
- aria-expanded={open}
- onClick={() => setOpen((v) => !v)}
- >
- <span className={cn("mt-1.5 size-2 shrink-0 rounded-full", dot)} />
- <span className="flex min-w-0 flex-1 flex-wrap items-baseline gap-x-2">
- <span className="font-medium">promotion</span>
- <span className="text-muted-foreground">{campaign.name}</span>
- <span className="tabular-nums">{count}</span>
- {items.length < count ? <span className="text-muted-foreground">showing {items.length}</span> : null}
- </span>
- <ChevronRight className={cn("mt-0.5 size-4 shrink-0 transition-transform duration-200", open && "rotate-90")} />
- </button>
- {open ? (
- <div className="border-l pl-4">
- <ItemList items={items} />
- </div>
- ) : null}
- </li>
- );
-}
-
-function ItemsSection({
- title,
- items,
- empty,
- campaigns,
- countOf,
-}: {
- title: string;
- items: OutboxItem[];
- empty: string;
- campaigns: OutboxCampaign[];
- countOf: (campaign: OutboxCampaign) => number;
-}) {
- // Rows keep their order; a campaign's rows collapse into one entry at the
- // place its first row sits.
- const entries: ({ kind: "item"; item: OutboxItem } | { kind: "campaign"; campaign: OutboxCampaign; items: OutboxItem[] })[] =
- [];
- const grouped = new Map<string, OutboxItem[]>();
- for (const item of items) {
- const campaign = item.promotionId ? campaigns.find((c) => c.id === item.promotionId) : undefined;
- if (!campaign) {
- entries.push({ kind: "item", item });
- continue;
- }
- const rows = grouped.get(campaign.id);
- if (rows) rows.push(item);
- else {
- const fresh = [item];
- grouped.set(campaign.id, fresh);
- entries.push({ kind: "campaign", campaign, items: fresh });
- }
- }
- return (
- <section className="space-y-2">
- <h2 className="text-sm font-medium">{title}</h2>
- {entries.length === 0 ? (
- <p className="text-sm text-muted-foreground">{empty}</p>
- ) : (
- <ul className="space-y-1">
- {entries.map((entry) =>
- entry.kind === "item" ? (
- <ItemList key={entry.item.id} items={[entry.item]} />
- ) : (
- <CampaignGroup
- key={entry.campaign.id}
- campaign={entry.campaign}
- count={countOf(entry.campaign)}
- items={entry.items}
- />
- ),
- )}
- </ul>
- )}
- </section>
- );
-}
-
-// The outbox: where the cycle's budget stands, what each kind has queued and
-// sent, and the rows waiting, failed, and lately sent. The layout gates this
-// route to super users, so the hook runs unconditionally.
-export default function SuEmailPage() {
- const outbox = useEmailOutbox();
- if (!outbox.data) {
- return (
- <p className="pb-9 text-sm text-muted-foreground">
- {outbox.isPending ? "Loading…" : "Could not load the outbox."}
- </p>
- );
- }
- const { items, campaigns } = outbox.data;
- const byState = (states: string[]) => items.filter((i) => states.includes(i.state));
- return (
- <div className="max-w-3xl space-y-8 pb-9">
- <QuotaSection quota={outbox.data.quota} />
- <KindsSection kinds={outbox.data.kinds} />
- <ItemsSection
- title="Waiting"
- items={byState(["queued", "sending"])}
- empty="Nothing waiting."
- campaigns={campaigns}
- countOf={(c) => c.queued}
- />
- <ItemsSection
- title="Failed"
- items={byState(["failed"])}
- empty="Nothing failed."
- campaigns={campaigns}
- countOf={(c) => c.failed}
- />
- <ItemsSection
- title="Recently sent"
- items={byState(["sent", "skipped"])}
- empty="Nothing sent yet."
- campaigns={campaigns}
- countOf={(c) => c.sent + c.skipped}
- />
- </div>
- );
-}
diff --git a/site/src/app/su/jobs/list/page.tsx b/site/src/app/su/jobs/list/page.tsx
deleted file mode 100644
index d010f3e9..00000000
--- a/site/src/app/su/jobs/list/page.tsx
+++ /dev/null
@@ -1,124 +0,0 @@
-"use client";
-
-import { cn } from "@/lib/utils";
-import { useRecentJobs, type AsyncJobListItem } from "@/queries/jobs";
-
-// The list shows each job's stored payload and result as-is, so it stays
-// honest for job kinds this page doesn't know about: flatten the primitive
-// fields into "email: [email protected] · projects: 3".
-function describeFields(value: unknown): string {
- if (typeof value !== "object" || value === null) return "";
- return Object.entries(value)
- .filter(([, v]) => ["string", "number", "boolean"].includes(typeof v))
- .map(([k, v]) => `${k}: ${String(v)}`)
- .join(" · ");
-}
-
-// A finished delete-user job reads as one sentence; other kinds (and
-// unfinished jobs) keep the flattened raw fields.
-function doneSummary(item: AsyncJobListItem): string | null {
- if (item.kind !== "delete-user" || item.state !== "done") return null;
- const payload = item.payload as { email?: unknown } | null;
- const email = typeof payload?.email === "string" ? payload.email : "";
- const result = item.result;
- return (
- `Deleted ${email} — ${String(result?.projects ?? 0)} project(s), ` +
- `${String(result?.libraryAssets ?? 0)} library asset(s), ` +
- `${String(result?.r2Objects ?? 0)} stored object(s).`
- );
-}
-
-function formatWhen(iso: string): string {
- const then = new Date(iso);
- const mins = Math.floor((Date.now() - then.getTime()) / 60000);
- if (mins < 1) return "just now";
- if (mins < 60) return `${mins}m ago`;
- if (mins < 60 * 24) return `${Math.floor(mins / 60)}h ago`;
- return then.toLocaleDateString(undefined, { month: "short", day: "numeric" });
-}
-
-function formatIn(iso: string): string {
- const mins = Math.ceil((new Date(iso).getTime() - Date.now()) / 60000);
- if (mins < 1) return "now";
- if (mins < 60) return `in ${mins}m`;
- return `in ${Math.floor(mins / 60)}h ${mins % 60}m`;
-}
-
-// A queued job held back until later: deferred by its own run, or queued
-// for a later time.
-function heldUntil(item: AsyncJobListItem): string | null {
- if (item.state !== "queued" || !item.notBefore) return null;
- return new Date(item.notBefore).getTime() > Date.now() ? item.notBefore : null;
-}
-
-const stateDot: Record<AsyncJobListItem["state"], string> = {
- queued: "bg-muted-foreground/40",
- running: "bg-blue-500 animate-pulse",
- done: "bg-emerald-500",
- error: "bg-destructive",
-};
-
-// Background jobs across the super-user surfaces — deletes started on Users,
-// the analytics rollup, the outreach scan — newest first. The query polls
-// while anything is queued or running, so states settle here without a
-// refresh. The layout gates this route to super users, so the hook runs
-// unconditionally.
-export default function SuJobsPage() {
- const recent = useRecentJobs(true);
-
- if (!recent.data?.jobs.length) {
- return (
- <p className="pb-9 text-sm text-muted-foreground">
- {recent.isPending ? "Loading…" : "No jobs yet."}
- </p>
- );
- }
-
- return (
- <ul className="max-w-3xl space-y-3 pb-9">
- {recent.data.jobs.map((item) => (
- <li key={item.id} className="flex items-start gap-2.5">
- <span
- className={cn(
- "mt-1.5 size-2 shrink-0 rounded-full",
- stateDot[item.state],
- )}
- />
- <div className="min-w-0 text-sm">
- <div className="flex flex-wrap items-baseline gap-x-2">
- <span className="font-medium">{item.kind}</span>
- <span className="text-muted-foreground">{item.state}</span>
- <span className="text-muted-foreground">
- {formatWhen(item.createdAt)}
- </span>
- {heldUntil(item) ? (
- <span className="text-muted-foreground">
- held · resumes {formatIn(heldUntil(item)!)}
- </span>
- ) : null}
- </div>
- {doneSummary(item) ? (
- <p className="text-muted-foreground">{doneSummary(item)}</p>
- ) : (
- <>
- {describeFields(item.payload) ? (
- <p className="truncate text-muted-foreground">
- {describeFields(item.payload)}
- </p>
- ) : null}
- {item.state === "done" && describeFields(item.result) ? (
- <p className="truncate text-muted-foreground">
- {describeFields(item.result)}
- </p>
- ) : null}
- </>
- )}
- {item.state === "error" && item.error ? (
- <p className="text-destructive">{item.error}</p>
- ) : null}
- </div>
- </li>
- ))}
- </ul>
- );
-}
diff --git a/site/src/app/su/layout.tsx b/site/src/app/su/layout.tsx
deleted file mode 100644
index 63878243..00000000
--- a/site/src/app/su/layout.tsx
+++ /dev/null
@@ -1,19 +0,0 @@
-import type { Metadata } from "next";
-import type { ReactNode } from "react";
-
-import { SuShell } from "@/app/su/SuShell";
-
-// The super-user section, served on its own host (src/proxy.ts maps
-// su.donkeycut.com onto this tree, and only for a super user: the proxy checks
-// the session and the role before the route runs, so nothing here renders —
-// or ships its client code — to anyone else). It sits outside the Cut app's
-// layout so none of the product shell — the engine connection gate, the
-// exports dock, the welcome sequence — mounts on an admin page.
-export const metadata: Metadata = {
- robots: { follow: false, index: false },
- title: "Super User",
-};
-
-export default function SuLayout({ children }: { children: ReactNode }) {
- return <SuShell>{children}</SuShell>;
-}
diff --git a/site/src/app/su/loading.tsx b/site/src/app/su/loading.tsx
deleted file mode 100644
index 73a7946d..00000000
--- a/site/src/app/su/loading.tsx
+++ /dev/null
@@ -1,6 +0,0 @@
-import { SuStandIn } from "@/app/su/SuStandIn";
-
-// Shown from the moment a rail link is clicked until the page arrives.
-export default function SuLoading() {
- return <SuStandIn />;
-}
diff --git a/site/src/app/su/nav.test.ts b/site/src/app/su/nav.test.ts
deleted file mode 100644
index 387cdb4c..00000000
--- a/site/src/app/su/nav.test.ts
+++ /dev/null
@@ -1,21 +0,0 @@
-import { expect, test } from "bun:test";
-import { SU_NAV, suPublicPath, suSurfaceAt, suTabs } from "./nav";
-
-test("server and browser paths render the same super-user navigation", () => {
- for (const surface of SU_NAV) {
- for (const page of suTabs(surface) ?? [surface]) {
- expect(suSurfaceAt(`/su${page.href}`)).toEqual(suSurfaceAt(page.href));
- expect(suSurfaceAt(page.href).surface).toBe(surface);
- expect(suSurfaceAt(page.href).page).toBe(page);
- }
- }
-});
-
-test("nested blog pages keep their surface and normalize only the route prefix", () => {
- expect(suSurfaceAt("/su/blog/post-id").surface.title).toBe("Blog");
- expect(suPublicPath("/su/blog")).toBe("/blog");
- expect(suPublicPath("/su/blog/post-id")).toBe("/blog/post-id");
- expect(suPublicPath("/su")).toBe("/");
- expect(suPublicPath("/support")).toBe("/support");
- expect(suPublicPath("/blog/su/post-id")).toBe("/blog/su/post-id");
-});
diff --git a/site/src/app/su/nav.ts b/site/src/app/su/nav.ts
deleted file mode 100644
index be85faac..00000000
--- a/site/src/app/su/nav.ts
+++ /dev/null
@@ -1,131 +0,0 @@
-// The super-user surfaces in rail order, addressed from the root of their own
-// host. One entry carries what a surface is drawn from — the rail's tab and
-// the header's title — so adding a surface is one edit here and a page.tsx;
-// the rail keeps the icons and the header keeps the actions, keyed by
-// address, because the proxy imports this file and it has to stay free of
-// React. The host opens on the first entry, so reordering this list moves
-// where it opens.
-//
-// A surface with tabs is a section: its href is a folder and each tab is a
-// page under it. A section address opens its first tab, answered by the proxy
-// before any route runs (suSectionHome). The rail opens the tabs beneath the
-// section while any of them is showing.
-type SuTabShape = {
- href: string;
- label: string;
-};
-
-type SuSurfaceShape = SuTabShape & {
- title: string;
- tabs?: readonly SuTabShape[];
-};
-
-export const SU_NAV = [
- {
- href: "/analytics",
- label: "Analytics",
- title: "Analytics",
- tabs: [
- { href: "/analytics/product", label: "Product" },
- { href: "/analytics/social", label: "Social" },
- ],
- },
- {
- href: "/users",
- label: "Users",
- title: "Users",
- },
- {
- href: "/credits",
- label: "Credits",
- title: "Credits",
- },
- {
- href: "/product",
- label: "Product",
- title: "Product",
- },
- {
- href: "/outreach",
- label: "Outreach",
- title: "Outreach",
- },
- {
- href: "/promotions",
- label: "Promotions",
- title: "Promotions",
- },
- {
- href: "/blog",
- label: "Blog",
- title: "Blog",
- },
- {
- href: "/experiments",
- label: "Experiments",
- title: "Experiments",
- tabs: [
- {
- href: "/experiments/list",
- label: "Tests",
- },
- {
- href: "/experiments/settings",
- label: "Settings",
- },
- ],
- },
- {
- href: "/jobs",
- label: "Jobs",
- title: "Jobs",
- tabs: [
- {
- href: "/jobs/email",
- label: "Email",
- },
- {
- href: "/jobs/list",
- label: "Background",
- },
- ],
- },
-] as const satisfies readonly SuSurfaceShape[];
-
-export type SuSurface = (typeof SU_NAV)[number];
-export type SuTab = Extract<SuSurface, { tabs: unknown }>["tabs"][number];
-/** Every address the rail can open: a tab, or a surface without tabs. */
-export type SuPage = SuTab | SuSurface;
-
-export const suTabs = (surface: SuSurface): readonly SuTab[] | undefined =>
- "tabs" in surface ? surface.tabs : undefined;
-
-/** The public address of a route rendered under the proxy's /su prefix. */
-export function suPublicPath(pathname: string): string {
- if (pathname === "/su") return "/";
- return pathname.startsWith("/su/") ? pathname.slice(3) : pathname;
-}
-
-// The surface an address belongs to, and the page within it: the tab showing,
-// or the surface itself when it has none. A section address resolves to its
-// first tab, the one the proxy opens it on; an address outside the rail falls
-// back to the entry the host opens on.
-export function suSurfaceAt(pathname: string): { surface: SuSurface; page: SuPage } {
- pathname = suPublicPath(pathname);
- const surface =
- SU_NAV.find((s) => pathname === s.href || pathname.startsWith(`${s.href}/`)) ??
- SU_NAV[0];
- const tabs = suTabs(surface);
- const page = tabs?.find((t) => t.href === pathname) ?? tabs?.[0] ?? surface;
- return { surface, page };
-}
-
-// Where an address that is not itself a page opens: the host root lands on
-// the first entry, and a section on its first tab. Null for a page address.
-export function suSectionHome(pathname: string): string | null {
- const surface = pathname === "/" ? SU_NAV[0] : SU_NAV.find((s) => s.href === pathname);
- if (!surface) return null;
- const tabs = suTabs(surface);
- if (tabs) return tabs[0].href;
- return pathname === "/" ? surface.href : null;
-}
diff --git a/site/src/app/su/outreach/ComposeDialog.tsx b/site/src/app/su/outreach/ComposeDialog.tsx
deleted file mode 100644
index de659b49..00000000
--- a/site/src/app/su/outreach/ComposeDialog.tsx
+++ /dev/null
@@ -1,681 +0,0 @@
-"use client";
-
-import { XIcon } from "lucide-react";
-import { useEffect, useRef, useState } from "react";
-
-import {
- CreditOfferFields,
- useCreditOfferDefaults,
-} from "@/app/su/CreditOfferFields";
-import {
- useLastOutreachStart,
- useOutreachDrafts,
-} from "@/app/su/outreach/drafts";
-import { UserHistoryPanel } from "@/app/su/outreach/UserHistory";
-import { Button } from "@/components/ui/button";
-import {
- Dialog,
- DialogClose,
- DialogContent,
- DialogDescription,
- DialogFooter,
- DialogHeader,
- DialogTitle,
-} from "@/components/ui/dialog";
-import { Input } from "@/components/ui/input";
-import { Label } from "@/components/ui/label";
-import { Switch } from "@/components/ui/switch";
-import { Tabs, TabsContent, TabsList, TabsTrigger } from "@/components/ui/tabs";
-import { Textarea } from "@/components/ui/textarea";
-import {
- creditOfferTermsIfValid,
- OFFER_CLAIM_NAMES,
- type CreditOfferTerms,
-} from "@/lib/credits/offerTerms";
-import {
- isOfferPlaceholder,
- OUTREACH_PLACEHOLDERS,
-} from "@/lib/marketing/placeholders";
-import { cn } from "@/lib/utils";
-import { BUTTON_MARK } from "@/lib/marketing/promotionCopy";
-import { ApiError } from "@/queries/apiClient";
-import {
- useBusyOutreachIds,
- useOutreachAction,
- type OutreachRow,
-} from "@/queries/outreach";
-import {
- useDeleteOutreachTemplate,
- useOutreachTemplates,
- useSaveOutreachTemplate,
-} from "@/queries/outreachTemplates";
-import { usePromotions, type PromotionSummary } from "@/queries/promotions";
-
-// The note to one person on the outreach list: the words, the send toggles
-// and the credit offer, started from a template, a recent send or a
-// promotion. The Outreach tab opens it from its rows and Analytics from a
-// user's row; both hand it the row to write to and hear when it is done.
-
-const BLANK = "blank";
-
-// A place a note can start from: a saved template, something this browser
-// already sent, or a promotion. The first two are starting points; whatever
-// ends up in the dialog — words, send toggles and the credit offer alike —
-// is what goes out. A promotion goes out as it is saved, the same email its
-// segment send mails, so it is read here and not edited.
-type StartPoint = {
- id: string;
- title: string;
- meta: string;
- subject: string;
- body: string;
- unsubscribeLink: boolean;
- trackReplies: boolean;
- creditOffer: CreditOfferTerms | null;
- at: number;
- remove?: () => void;
- busy?: boolean;
- promotion?: PromotionSummary;
-};
-
-const promotionStartId = (id: string) => `promo:${id}`;
-
-export function ago(iso: string | null): string {
- if (!iso) return "—";
- const mins = Math.floor((Date.now() - new Date(iso).getTime()) / 60000);
- if (mins < 60) return `${Math.max(mins, 0)}m ago`;
- if (mins < 60 * 24) return `${Math.floor(mins / 60)}h ago`;
- return `${Math.floor(mins / (60 * 24))}d ago`;
-}
-
-export function OutreachComposeDialog({
- target,
- opening = null,
- onClose,
-}: {
- /** The row the note goes to; null keeps the dialog closed. */
- target: OutreachRow | null;
- /** Who the note is for while their row is still being fetched: the dialog
- * opens on them at once and fills in when the row lands. */
- opening?: { name: string; email: string } | null;
- onClose: () => void;
-}) {
- const [source, setSource] = useState(BLANK);
- const [subject, setSubject] = useState("");
- const [body, setBody] = useState("");
- const [templateName, setTemplateName] = useState("");
- const [naming, setNaming] = useState(false);
- const bodyField = useRef<HTMLTextAreaElement>(null);
- const act = useOutreachAction();
- const busy = useBusyOutreachIds();
- const templates = useOutreachTemplates();
- const promotions = usePromotions();
- const saveTemplate = useSaveOutreachTemplate();
- const deleteTemplate = useDeleteOutreachTemplate();
- const { drafts, forget, remember } = useOutreachDrafts();
- const [lastStart, setLastStart] = useLastOutreachStart();
- const [unsubscribeLink, setUnsubscribeLink] = useState(true);
- const [trackReplies, setTrackReplies] = useState(true);
- const [creditOffer, setCreditOffer] = useState<CreditOfferTerms | null>(null);
- const [testNotice, setTestNotice] = useState<string | null>(null);
- const offerDefaults = useCreditOfferDefaults();
- // The row on screen, read at the end of a send that may have outlived it.
- const shown = useRef(target);
- useEffect(() => {
- shown.current = target;
- }, [target]);
-
- const saved = templates.data?.templates ?? [];
-
- const dropSource = (id: string) => {
- if (source === id) setSource(BLANK);
- };
-
- // Templates are shared and outlive the browser; recent sends are this
- // browser's own. One list, newest first, each entry saying which it is.
- const starts: StartPoint[] = [
- ...saved.map((template) => ({
- at: new Date(template.updatedAt).getTime(),
- body: template.body,
- busy: deleteTemplate.isPending,
- id: `tpl:${template.id}`,
- meta: "Template",
- remove: () =>
- deleteTemplate.mutate(template.id, {
- onSuccess: () => dropSource(`tpl:${template.id}`),
- }),
- subject: template.subject,
- title: template.name,
- trackReplies: template.trackReplies,
- unsubscribeLink: template.unsubscribeLink,
- creditOffer: creditOfferTermsIfValid(template.promotion),
- })),
- ...drafts.map((draft) => ({
- at: new Date(draft.savedAt).getTime(),
- body: draft.body,
- creditOffer: draft.creditOffer,
- id: `draft:${draft.id}`,
- meta: `Sent ${ago(draft.savedAt)}`,
- remove: () => {
- forget(draft.id);
- dropSource(`draft:${draft.id}`);
- },
- subject: draft.subject,
- title: draft.subject,
- trackReplies: draft.trackReplies,
- unsubscribeLink: draft.unsubscribeLink,
- })),
- ...(promotions.data?.promotions ?? []).map((promotion) => ({
- at: new Date(promotion.updatedAt).getTime(),
- body: promotion.body,
- creditOffer: promotion.creditOffer,
- id: promotionStartId(promotion.id),
- meta: `Promotion · ${promotion.counts.sent} sent`,
- promotion,
- subject: promotion.subject,
- title: promotion.name || "Untitled",
- trackReplies: false,
- unsubscribeLink: true,
- })),
- ].sort((a, b) => b.at - a.at);
-
- const sources: StartPoint[] = [
- {
- at: 0,
- body: "",
- id: BLANK,
- meta: "",
- subject: "",
- title: "Blank",
- trackReplies: true,
- unsubscribeLink: true,
- creditOffer: null,
- },
- ...starts,
- ];
-
- const pickSource = (id: string) => {
- const picked = sources.find((s) => s.id === id);
- if (!picked) return;
- setSource(id);
- setSubject(picked.subject);
- setBody(picked.body);
- setUnsubscribeLink(picked.unsubscribeLink);
- setTrackReplies(picked.trackReplies);
- setCreditOffer(picked.creditOffer);
- setNaming(false);
- };
-
- // Each opening starts from whatever the last note went out from, so a run
- // through a list is one click from ready; with nothing sent yet, the newest
- // starting point, and with nothing saved at all, a blank note. The seed
- // lands in the render that first sees the person, whose row may still be
- // on its way, and clears with them, so the same person opened again starts
- // fresh.
- const person = target?.email ?? opening?.email ?? null;
- const [seededFor, setSeededFor] = useState<string | null>(null);
- if (person && seededFor !== person) {
- setSeededFor(person);
- const start =
- sources.find((option) => option.id === lastStart) ??
- starts[0] ??
- sources[0];
- setSource(start.id);
- setSubject(start.subject);
- setBody(start.body);
- setUnsubscribeLink(start.unsubscribeLink);
- setTrackReplies(start.trackReplies);
- setCreditOffer(start.creditOffer);
- setNaming(false);
- setTestNotice(null);
- } else if (!person && seededFor !== null) {
- setSeededFor(null);
- }
-
- // A promotion is checked whole by the server when it is sent, so the
- // button is live and a blank field comes back as the reason.
- const selectedPromotion = sources.find((s) => s.id === source)?.promotion;
- const sendable =
- selectedPromotion !== undefined ||
- (subject.trim() !== "" && body.trim() !== "");
- const selectedTemplate = source.startsWith("tpl:")
- ? saved.find((template) => `tpl:${template.id}` === source)
- : undefined;
-
- const submitTemplate = () => {
- const name = templateName.trim();
- if (name === "" || !sendable) return;
- saveTemplate.mutate(
- {
- body,
- name,
- subject,
- trackReplies,
- unsubscribeLink,
- promotion: creditOffer,
- },
- {
- onSuccess: (result) => {
- // The note now lives in a template, so the sent copy of the same
- // words stops being a second entry saying the same thing.
- const same = drafts.find(
- (draft) => draft.subject === subject && draft.body === body,
- );
- if (same) {
- forget(same.id);
- if (lastStart === `draft:${same.id}`) {
- setLastStart(`tpl:${result.template.id}`);
- }
- }
- setSource(`tpl:${result.template.id}`);
- setNaming(false);
- },
- },
- );
- };
-
- // A placeholder is easier to click than to spell, and it lands where the
- // cursor already is.
- const insertPlaceholder = (name: string) => {
- const token = `{{${name}}}`;
- const field = bodyField.current;
- const start = field?.selectionStart ?? body.length;
- const end = field?.selectionEnd ?? start;
- setBody(`${body.slice(0, start)}${token}${body.slice(end)}`);
- requestAnimationFrame(() => {
- field?.focus();
- field?.setSelectionRange(start + token.length, start + token.length);
- });
- };
-
- // The note as it stands goes to the operator's own inbox, filled with the
- // row's values, so the words can be read as mail before they are sent.
- const submitTest = () => {
- if (!target || !sendable || selectedPromotion) return;
- setTestNotice(null);
- act.mutate(
- {
- action: "test",
- body,
- creditOffer,
- outreachId: target.id,
- subject,
- unsubscribeLink,
- },
- {
- onSuccess: (result) => setTestNotice(`Test sent to ${result.sentTo}.`),
- },
- );
- };
-
- // A send in flight leaves the dialog free for the next row, so it closes
- // only if that row is still the one on screen.
- const closeIfShown = (id: string) => {
- if (shown.current?.id === id) onClose();
- };
-
- const submitSend = () => {
- if (!target || !sendable) return;
- const id = target.id;
- setTestNotice(null);
- if (selectedPromotion) {
- act.mutate(
- {
- action: "promote",
- outreachId: id,
- promotionId: selectedPromotion.id,
- },
- {
- onSuccess: () => {
- setLastStart(source);
- closeIfShown(id);
- },
- },
- );
- return;
- }
- // Sending a start point exactly as it is stays that start point; a change
- // to its words or its toggles becomes an entry of its own.
- const from = sources.find((option) => option.id === source);
- const edited =
- from?.subject !== subject ||
- from.body !== body ||
- from.unsubscribeLink !== unsubscribeLink ||
- from.trackReplies !== trackReplies ||
- JSON.stringify(from.creditOffer) !== JSON.stringify(creditOffer);
- act.mutate(
- {
- action: "send",
- body,
- creditOffer,
- outreachId: id,
- subject,
- trackReplies,
- unsubscribeLink,
- },
- {
- onSuccess: () => {
- setLastStart(
- edited
- ? `draft:${remember({ body, creditOffer, subject, trackReplies, unsubscribeLink })}`
- : source,
- );
- closeIfShown(id);
- },
- },
- );
- };
-
- const sending = target !== null && busy.has(target.id);
- // A failed send keeps its dialog open, so the reason belongs in there with
- // the words that still need fixing; the server names a bad placeholder.
- const sendFailed =
- act.isError &&
- (act.variables?.action === "send" ||
- act.variables?.action === "test" ||
- act.variables?.action === "promote");
- const sendIssue =
- sendFailed && act.error instanceof ApiError
- ? act.error.issues[0]?.message
- : undefined;
- // The offer's placeholders are offered only while the note carries one.
- const placeholders = OUTREACH_PLACEHOLDERS.filter(
- (name) => creditOffer !== null || !isOfferPlaceholder(name),
- );
-
- return (
- <Dialog
- onOpenChange={(open) => {
- if (!open) onClose();
- }}
- open={person !== null}
- >
- <DialogContent className="grid h-[85dvh] grid-rows-[auto_minmax(0,1fr)_auto] sm:max-w-5xl">
- <DialogHeader>
- <DialogTitle>Email {target?.name ?? opening?.name}</DialogTitle>
- <DialogDescription>{target?.email ?? opening?.email}</DialogDescription>
- </DialogHeader>
-
- {/* The note and the person's past share the dialog; the tabs reset
- with each person so a new one opens on the note. */}
- <Tabs className="min-h-0 gap-3" defaultValue="note" key={person ?? "none"}>
- <TabsList variant="line">
- <TabsTrigger value="note">Note</TabsTrigger>
- <TabsTrigger value="history">History</TabsTrigger>
- </TabsList>
- <TabsContent className="min-h-0" value="history">
- {target ? (
- <UserHistoryPanel target={target} />
- ) : (
- <p className="text-sm text-muted-foreground">Loading…</p>
- )}
- </TabsContent>
- <TabsContent
- className="grid min-h-0 min-w-0 gap-4 md:grid-cols-[18rem_minmax(0,1fr)]"
- value="note"
- >
- <div className="flex min-h-0 flex-col gap-2 md:border-r md:pr-4">
- <span className="text-xs font-medium text-muted-foreground">
- Start from
- </span>
- <div className="min-h-0 flex-1 space-y-0.5 overflow-y-auto max-md:max-h-40">
- {sources.map((option) => (
- <div className="group/start relative" key={option.id}>
- <button
- className={cn(
- "w-full rounded-lg px-2 py-1.5 pr-8 text-left transition-colors",
- source === option.id
- ? "bg-accent text-accent-foreground"
- : "hover:bg-accent/50",
- )}
- onClick={() => pickSource(option.id)}
- type="button"
- >
- <span className="block truncate text-sm">
- {option.title}
- </span>
- {option.meta ? (
- <span className="block truncate text-xs text-muted-foreground">
- {option.meta}
- </span>
- ) : null}
- </button>
- {option.remove ? (
- <Button
- aria-label={`Delete ${option.title}`}
- className="absolute top-1.5 right-1 opacity-0 group-hover/start:opacity-100 focus-visible:opacity-100"
- disabled={option.busy}
- onClick={option.remove}
- size="icon-xs"
- variant="ghost"
- >
- <XIcon />
- </Button>
- ) : null}
- </div>
- ))}
- </div>
- {naming ? (
- <div className="space-y-2">
- <Input
- aria-label="Template name"
- autoFocus
- maxLength={80}
- onChange={(event) => setTemplateName(event.target.value)}
- onKeyDown={(event) => {
- if (event.key === "Enter") submitTemplate();
- }}
- placeholder="Template name"
- value={templateName}
- />
- <div className="flex items-center gap-2">
- <Button
- className="flex-1"
- disabled={
- saveTemplate.isPending || templateName.trim() === ""
- }
- onClick={submitTemplate}
- size="sm"
- >
- {saveTemplate.isPending ? "Saving…" : "Save"}
- </Button>
- <Button
- onClick={() => setNaming(false)}
- size="sm"
- variant="ghost"
- >
- Cancel
- </Button>
- </div>
- </div>
- ) : (
- <Button
- disabled={!sendable || selectedPromotion !== undefined}
- onClick={() => {
- setTemplateName(selectedTemplate?.name ?? "");
- setNaming(true);
- }}
- size="sm"
- variant="outline"
- >
- Save as template
- </Button>
- )}
- {saveTemplate.isError ? (
- <p className="text-xs text-destructive">
- Couldn&apos;t save that template. Try a different name.
- </p>
- ) : null}
- {deleteTemplate.isError ? (
- <p className="text-xs text-destructive">
- Couldn&apos;t delete that template.
- </p>
- ) : null}
- </div>
-
- {selectedPromotion ? (
- <PromotionPreview
- promotion={selectedPromotion}
- issue={sendFailed ? sendIssue : undefined}
- />
- ) : (
- <div className="flex min-h-0 min-w-0 flex-col gap-2">
- <Label htmlFor="outreach-subject">Subject</Label>
- <Input
- id="outreach-subject"
- maxLength={200}
- onChange={(event) => setSubject(event.target.value)}
- value={subject}
- />
- <Label className="mt-1" htmlFor="outreach-body">
- Message
- </Label>
- <Textarea
- className="min-h-40 flex-1 resize-none field-sizing-fixed"
- id="outreach-body"
- maxLength={5000}
- onChange={(event) => setBody(event.target.value)}
- ref={bodyField}
- value={body}
- />
- <div className="flex flex-wrap items-center gap-1.5">
- <span className="text-xs text-muted-foreground">
- Blank line starts a paragraph. Insert:
- </span>
- {placeholders.map((name) => (
- <Button
- key={name}
- onClick={() => insertPlaceholder(name)}
- size="xs"
- variant="outline"
- >
- {`{{${name}}}`}
- </Button>
- ))}
- {creditOffer ? (
- <Button
- onClick={() => {
- const field = bodyField.current;
- const start = field?.selectionStart ?? body.length;
- const end = field?.selectionEnd ?? start;
- const before = body.slice(0, start).trimEnd();
- const after = body.slice(end).trimStart();
- setBody(`${before ? `${before}\n\n` : ""}${BUTTON_MARK}${after ? `\n\n${after}` : ""}`);
- }}
- size="xs"
- variant="outline"
- >
- {BUTTON_MARK}
- </Button>
- ) : null}
- </div>
- <CreditOfferFields
- idPrefix="outreach-offer"
- value={creditOffer}
- defaults={offerDefaults}
- onChange={setCreditOffer}
- hint="Put {{button}} in its own paragraph for a claim button. {{claimUrl}} inserts the URL; {{claimBy}} is the last day to claim."
- />
- {sendFailed ? (
- <p className="text-sm text-destructive">
- {sendIssue ??
- "That didn’t go through. The account may have unsubscribed since the last scan, or the text may name a placeholder that doesn’t exist."}
- </p>
- ) : testNotice ? (
- <p className="text-sm text-muted-foreground">{testNotice}</p>
- ) : null}
- </div>
- )}
- </TabsContent>
- </Tabs>
-
- <DialogFooter>
- {/* The footer column is reversed below sm, so ordering the toggles
- last keeps them painted above the send buttons there. */}
- {selectedPromotion ? null : (
- <div className="flex flex-wrap items-center gap-x-4 gap-y-2 max-sm:order-last sm:mr-auto">
- <Button
- disabled={target === null || sending || !sendable}
- onClick={submitTest}
- variant="outline"
- >
- Send test to me
- </Button>
- <Label className="gap-2 font-normal text-muted-foreground">
- <Switch
- checked={unsubscribeLink}
- onCheckedChange={setUnsubscribeLink}
- />
- Add unsubscribe link
- </Label>
- <Label className="gap-2 font-normal text-muted-foreground">
- <Switch
- checked={trackReplies}
- onCheckedChange={setTrackReplies}
- />
- Track replies
- </Label>
- </div>
- )}
- <DialogClose render={<Button variant="outline" />}>
- Cancel
- </DialogClose>
- <Button disabled={target === null || sending || !sendable} onClick={submitSend}>
- {sending
- ? "Sending…"
- : selectedPromotion
- ? "Send promotion"
- : "Send"}
- </Button>
- </DialogFooter>
- </DialogContent>
- </Dialog>
- );
-}
-
-// A promotion as it will go: the subject, the words, the button and the
-// offer, read from the saved row. Its words change on the Promotions tab.
-function PromotionPreview({
- promotion,
- issue,
-}: {
- promotion: PromotionSummary;
- issue: string | undefined;
-}) {
- const offer = promotion.creditOffer;
- return (
- <div className="flex min-h-0 min-w-0 flex-col gap-2">
- <span className="text-xs font-medium text-muted-foreground">Subject</span>
- <p className="text-sm">
- {promotion.subject || (
- <span className="text-muted-foreground">No subject yet</span>
- )}
- </p>
- <span className="mt-1 text-xs font-medium text-muted-foreground">
- Message
- </span>
- <div className="min-h-0 flex-1 overflow-y-auto rounded-lg border px-3 py-2 text-sm whitespace-pre-wrap">
- {promotion.body || (
- <span className="text-muted-foreground">No message yet</span>
- )}
- </div>
- {promotion.ctaLabel ? (
- <p className="text-xs text-muted-foreground">
- Button: {promotion.ctaLabel} → {promotion.ctaUrl}
- </p>
- ) : null}
- {offer ? (
- <p className="text-xs text-muted-foreground">
- Credit offer: ${offer.dollars}, landed by{" "}
- {OFFER_CLAIM_NAMES[offer.claim].toLowerCase()},{" "}
- {offer.claimWindowDays} days to claim, lives {offer.expiresAfterDays}{" "}
- days.
- </p>
- ) : null}
- <p className="text-xs text-muted-foreground">
- Edit the words on the Promotions tab.
- </p>
- {issue ? <p className="text-sm text-destructive">{issue}</p> : null}
- </div>
- );
-}
diff --git a/site/src/app/su/outreach/ScanOutreachButton.tsx b/site/src/app/su/outreach/ScanOutreachButton.tsx
deleted file mode 100644
index c559696b..00000000
--- a/site/src/app/su/outreach/ScanOutreachButton.tsx
+++ /dev/null
@@ -1,23 +0,0 @@
-"use client";
-
-import { Button } from "@/components/ui/button";
-import { useRunOutreachScan } from "@/queries/outreach";
-
-export function ScanOutreachButton() {
- const scan = useRunOutreachScan();
- return (
- <div className="flex items-center gap-3">
- {scan.isError ? (
- <span className="text-sm text-destructive">Scan failed.</span>
- ) : null}
- <Button
- disabled={scan.isPending}
- onClick={() => scan.mutate()}
- size="sm"
- variant="outline"
- >
- {scan.isPending ? "Scanning…" : "Scan now"}
- </Button>
- </div>
- );
-}
diff --git a/site/src/app/su/outreach/UserHistory.tsx b/site/src/app/su/outreach/UserHistory.tsx
deleted file mode 100644
index 4bb4c066..00000000
--- a/site/src/app/su/outreach/UserHistory.tsx
+++ /dev/null
@@ -1,219 +0,0 @@
-"use client";
-
-import { useState } from "react";
-
-import { formatBytes } from "@/lib/bytes";
-import { formatUsdPlain } from "@/lib/credits/format-usd";
-import { useAnalyticsSummary, useAnalyticsUser } from "@/queries/analytics";
-import { type OutreachRow } from "@/queries/outreach";
-import { useUserHistory, type UserHistory, type UserHistoryEmail } from "@/queries/userHistory";
-
-// What the site has already given and sent one person: paid money, storage
-// held, and one timeline of the offers that reached them, the credit that
-// landed, and the mail that went out. Money comes from the analytics rollup
-// every su page already holds; the rest is one read of the account's rows.
-
-const GRANT_LABELS: Record<string, string> = {
- signup: "Signup bonus",
- manual_dollar: "Credit offer claimed",
- subscribe_bonus: "Subscribe bonus landed",
- stripe_topup: "Top-up",
- stripe_autoreload: "Auto reload",
- pro_subscription: "Pro allowance",
-};
-
-const OFFER_LABELS: Record<string, string> = {
- manual: "Credit offer",
- promotion_email: "Promotion offer",
- promotion_subscribe: "Promotion offer for subscribing",
- subscribe_bonus: "Subscribe bonus offered",
-};
-
-const EMAIL_LABELS: Record<string, string> = {
- promotion: "Promotion",
- "promotion-hand": "Promotion, sent by hand",
- outreach: "Note",
- "credit-offer": "Credit offer email",
- "credit-expiry": "Credit expiry notice",
- welcome: "Welcome",
-};
-
-const day = (iso: string) =>
- new Date(iso).toLocaleDateString("en-US", { day: "numeric", month: "short", year: "numeric" });
-
-const dollars = (micros: string) => formatUsdPlain((Number(micros) / 1_000_000).toFixed(2));
-
-type Event = {
- at: string;
- key: string;
- title: string;
- amount: string | null;
- notes: string[];
- tone: "landed" | "open" | "missed" | "plain";
-};
-
-// The three lists as one story, newest first. An offer says where it stands
-// — claimed, still open, or missed — and a grant what is left of it. The
-// email that carried an offer is part of the offer's row: when it went out,
-// whether by hand, and whether the person clicked.
-function timeline(history: UserHistory, now: number): Event[] {
- const events: Event[] = [];
- const emailsByOffer = new Map<string, UserHistoryEmail[]>();
- for (const email of history.emails) {
- if (!email.offerId) continue;
- emailsByOffer.set(email.offerId, [...(emailsByOffer.get(email.offerId) ?? []), email]);
- }
- for (const offer of history.offers) {
- const notes: string[] = [];
- const carriers = emailsByOffer.get(offer.id) ?? [];
- const sentAt = carriers[0]?.sentAt ?? offer.emailSentAt;
- if (sentAt) {
- notes.push(`emailed ${day(sentAt)}${carriers.some((email) => email.kind === "promotion-hand") ? " by hand" : ""}`);
- }
- const clickedAt = carriers.find((email) => email.clickedAt)?.clickedAt;
- if (clickedAt) notes.push(`clicked ${day(clickedAt)}`);
- let tone: Event["tone"] = "open";
- if (offer.claimedAt) {
- notes.push(`claimed ${day(offer.claimedAt)}`);
- tone = "landed";
- } else if (offer.closesAt && Date.parse(offer.closesAt) < now) {
- notes.push(`closed ${day(offer.closesAt)} unclaimed`);
- tone = "missed";
- } else if (offer.closesAt) {
- notes.push(`open until ${day(offer.closesAt)}`);
- } else {
- notes.push("open");
- }
- events.push({
- at: offer.createdAt,
- key: `offer:${offer.id}`,
- title: offer.promotion ? `${OFFER_LABELS[offer.kind] ?? offer.kind} · ${offer.promotion.name}` : (OFFER_LABELS[offer.kind] ?? offer.description ?? offer.kind),
- amount: formatUsdPlain(offer.dollars),
- notes,
- tone,
- });
- }
- for (const grant of history.grants) {
- const notes: string[] = [];
- const left = Number(grant.remainingDollars);
- const expired = grant.expiresAt !== null && Date.parse(grant.expiresAt) < now;
- if (left > 0 && !expired) notes.push(`${formatUsdPlain(grant.remainingDollars)} left`);
- if (grant.expiresAt) notes.push(`${expired ? "expired" : "expires"} ${day(grant.expiresAt)}`);
- if (grant.status !== "active") notes.push(grant.status);
- events.push({
- at: grant.createdAt,
- key: `grant:${grant.id}`,
- title: GRANT_LABELS[grant.source] ?? grant.description ?? grant.source,
- amount: formatUsdPlain(grant.dollars),
- notes,
- tone: "landed",
- });
- }
- for (const email of history.emails) {
- if (email.offerId && history.offers.some((offer) => offer.id === email.offerId)) continue;
- const subject = email.promotion?.subject ?? email.subject;
- events.push({
- at: email.sentAt,
- key: `email:${email.id}`,
- title: email.promotion
- ? `${EMAIL_LABELS[email.kind] ?? email.kind} · ${email.promotion.name}`
- : subject
- ? `${EMAIL_LABELS[email.kind] ?? email.kind} · ${subject}`
- : (EMAIL_LABELS[email.kind] ?? email.kind),
- amount: null,
- notes: email.clickedAt ? [`clicked ${day(email.clickedAt)}`] : [],
- tone: "plain",
- });
- }
- return events.sort((a, b) => Date.parse(b.at) - Date.parse(a.at));
-}
-
-const TONE: Record<Event["tone"], string> = {
- landed: "bg-emerald-500",
- open: "bg-sky-500",
- missed: "bg-muted-foreground/40",
- plain: "bg-muted-foreground/40",
-};
-
-export function UserHistoryPanel({ target }: { target: OutreachRow }) {
- const history = useUserHistory(target.userId);
- // This one account's row out of the nightly rollup, and the billing events
- // the summary carries. The rollup's events name the payer by email; the
- // window's charges for this person are the ones with theirs.
- const rolled = useAnalyticsUser(target.userId).data;
- const summary = useAnalyticsSummary();
- const charges = (summary.data?.billing?.events ?? []).filter(
- (event) => event.email === target.email && event.kind !== "canceled" && event.amountMicros !== null,
- );
- // The moment the panel opened; offers and grants are read against it.
- const [now] = useState(() => Date.now());
- const events = history.data ? timeline(history.data, now) : [];
-
- return (
- <div className="flex h-full min-h-0 flex-col gap-4 overflow-y-auto pr-1">
- <dl className="grid grid-cols-2 gap-x-6 gap-y-2 text-sm sm:grid-cols-4">
- <Fact label="Paid all-time" value={rolled?.fundedMicros ? dollars(rolled.fundedMicros) : "$0"} />
- <Fact label="Balance" value={formatUsdPlain(target.balance)} />
- <Fact
- label="Storage"
- value={history.data ? formatBytes(Number(history.data.storageBytes)) : formatBytes(Number(target.storageBytes))}
- />
- <Fact label="Joined" value={day(target.signedUpAt)} />
- </dl>
-
- {charges.length > 0 ? (
- <section className="space-y-1.5">
- <h3 className="text-xs font-medium text-muted-foreground">Payments in the analytics window</h3>
- <ul className="divide-y rounded-lg border">
- {charges.map((charge, i) => (
- <li className="flex items-center gap-3 px-3 py-1.5 text-sm" key={`${charge.objectId ?? i}`}>
- <span className="w-24 shrink-0 tabular-nums text-muted-foreground">{day(charge.day)}</span>
- <span className="min-w-0 flex-1 truncate">
- {charge.kind === "paid" ? "Paid" : "Declined"}
- {charge.detail ? ` · ${charge.detail}` : ""}
- </span>
- <span className="tabular-nums">{dollars(charge.amountMicros!)}</span>
- </li>
- ))}
- </ul>
- </section>
- ) : null}
-
- <section className="space-y-1.5">
- <h3 className="text-xs font-medium text-muted-foreground">Offers, credit and mail</h3>
- {history.isPending ? (
- <p className="text-sm text-muted-foreground">Loading…</p>
- ) : history.isError ? (
- <p className="text-sm text-destructive">Couldn&apos;t read this account&apos;s history.</p>
- ) : events.length === 0 ? (
- <p className="text-sm text-muted-foreground">Nothing sent or granted yet.</p>
- ) : (
- <ul className="divide-y rounded-lg border">
- {events.map((event) => (
- <li className="flex items-start gap-3 px-3 py-1.5 text-sm" key={event.key}>
- <span className="w-24 shrink-0 tabular-nums text-muted-foreground">{day(event.at)}</span>
- <span className={`mt-1.5 size-2 shrink-0 rounded-full ${TONE[event.tone]}`} />
- <span className="min-w-0 flex-1">
- <span className="block truncate">{event.title}</span>
- {event.notes.length > 0 ? (
- <span className="block text-xs text-muted-foreground">{event.notes.join(" · ")}</span>
- ) : null}
- </span>
- {event.amount ? <span className="tabular-nums">{event.amount}</span> : null}
- </li>
- ))}
- </ul>
- )}
- </section>
- </div>
- );
-}
-
-function Fact({ label, value }: { label: string; value: string }) {
- return (
- <div>
- <dt className="text-xs text-muted-foreground">{label}</dt>
- <dd className="tabular-nums">{value}</dd>
- </div>
- );
-}
diff --git a/site/src/app/su/outreach/drafts.ts b/site/src/app/su/outreach/drafts.ts
deleted file mode 100644
index 250f2dd4..00000000
--- a/site/src/app/su/outreach/drafts.ts
+++ /dev/null
@@ -1,123 +0,0 @@
-"use client";
-
-import { useCallback } from "react";
-
-import { useLocalPref } from "@/cut/lib/uiState";
-import { creditOfferTermsIfValid, type CreditOfferTerms } from "@/lib/credits/offerTerms";
-
-// What was sent last, kept in this browser so the next note can start from it
-// and be edited. It stays here on purpose: the server keeps status and
-// timestamps for a conversation, never the words. The two send toggles ride
-// along, so a start point recalls how it went out as well as what it said.
-export type OutreachDraft = {
- id: string;
- subject: string;
- body: string;
- unsubscribeLink: boolean;
- trackReplies: boolean;
- creditOffer: CreditOfferTerms | null;
- savedAt: string;
-};
-
-// The toggles and the id are optional on disk. Entries written before the
-// toggles existed read as on: every note back then carried the opt-out footer
-// and the tracked reply alias. An entry without an id is identified by its
-// timestamp.
-type StoredDraft = {
- id?: string;
- subject: string;
- body: string;
- unsubscribeLink?: boolean;
- trackReplies?: boolean;
- // Terms as stored; read through the schema, so an entry from before a
- // field existed loads as no offer.
- creditOffer?: unknown;
- savedAt: string;
-};
-
-const KEY = "donkey.outreach.drafts";
-const START_KEY = "donkey.outreach.lastStart";
-const LIMIT = 20;
-
-function isDraft(value: unknown): value is StoredDraft {
- if (typeof value !== "object" || value === null) return false;
- const draft = value as Record<string, unknown>;
- return (
- typeof draft.subject === "string" &&
- typeof draft.body === "string" &&
- typeof draft.savedAt === "string" &&
- (draft.id === undefined || typeof draft.id === "string") &&
- (draft.unsubscribeLink === undefined ||
- typeof draft.unsubscribeLink === "boolean") &&
- (draft.trackReplies === undefined || typeof draft.trackReplies === "boolean")
- );
-}
-
-// Which start point the last note went out from, so the next row opens on it.
-export function useLastOutreachStart(): [string | null, (id: string) => void] {
- return useLocalPref<string | null>(
- START_KEY,
- null,
- (value) => value === null || typeof value === "string",
- );
-}
-
-export function useOutreachDrafts(): {
- drafts: OutreachDraft[];
- remember: (draft: Omit<OutreachDraft, "id" | "savedAt">) => string;
- forget: (id: string) => void;
-} {
- const [stored, setStored] = useLocalPref<StoredDraft[]>(KEY, [], (value) =>
- Array.isArray(value) && value.every(isDraft),
- );
-
- const drafts: OutreachDraft[] = stored.map((draft) => ({
- ...draft,
- id: draft.id ?? draft.savedAt,
- trackReplies: draft.trackReplies ?? true,
- unsubscribeLink: draft.unsubscribeLink ?? true,
- creditOffer: creditOfferTermsIfValid(draft.creditOffer),
- }));
-
- const remember = useCallback(
- ({
- body,
- creditOffer,
- subject,
- trackReplies,
- unsubscribeLink,
- }: Omit<OutreachDraft, "id" | "savedAt">) => {
- const id = crypto.randomUUID();
- const savedAt = new Date().toISOString();
- const offerKey = JSON.stringify(creditOffer);
- setStored((current) => {
- // Sending the same note twice moves the entry up rather than doubling it.
- const rest = current.filter(
- (draft) =>
- draft.subject !== subject ||
- draft.body !== body ||
- (draft.unsubscribeLink ?? true) !== unsubscribeLink ||
- (draft.trackReplies ?? true) !== trackReplies ||
- JSON.stringify(creditOfferTermsIfValid(draft.creditOffer)) !== offerKey,
- );
- return [
- { body, creditOffer, id, savedAt, subject, trackReplies, unsubscribeLink },
- ...rest,
- ].slice(0, LIMIT);
- });
- return id;
- },
- [setStored],
- );
-
- const forget = useCallback(
- (id: string) => {
- setStored((current) =>
- current.filter((draft) => (draft.id ?? draft.savedAt) !== id),
- );
- },
- [setStored],
- );
-
- return { drafts, forget, remember };
-}
diff --git a/site/src/app/su/outreach/page.tsx b/site/src/app/su/outreach/page.tsx
deleted file mode 100644
index 1c71ed65..00000000
--- a/site/src/app/su/outreach/page.tsx
+++ /dev/null
@@ -1,301 +0,0 @@
-"use client";
-
-import { useEffect, useState } from "react";
-
-import { ago, OutreachComposeDialog } from "@/app/su/outreach/ComposeDialog";
-import { Badge } from "@/components/ui/badge";
-import { Button } from "@/components/ui/button";
-import { Input } from "@/components/ui/input";
-import { formatBytes } from "@/lib/bytes";
-import { cn } from "@/lib/utils";
-import {
- OUTREACH_REASON_LABELS,
- OUTREACH_REASONS,
- OUTREACH_WALL_REASONS,
- type OutreachReason,
- type OutreachStatus,
-} from "@/lib/marketing/campaigns";
-import {
- useBusyOutreachIds,
- useOutreach,
- useOutreachAction,
- useOutreachCounts,
- useOutreachSearch,
- type OutreachRow,
-} from "@/queries/outreach";
-
-const FILTERS: { status: OutreachStatus; label: string }[] = [
- { status: "todo", label: "To email" },
- { status: "sent", label: "Sent" },
- { status: "replied", label: "Replied" },
- { status: "ignored", label: "Ignored" },
-];
-
-// The walls the scan found lead the row in the warning tone, so a person
-// who was declined or is leaving Pro stands out at a glance. Out of credits
-// is carried by the balance badge that follows, and the two use reasons by
-// the spent and stored badges, so those never repeat here.
-const REASON_BADGES: readonly OutreachReason[] = OUTREACH_WALL_REASONS.filter(
- (reason) => reason !== "no_credits",
-);
-
-// The list carries the numbers the scan wrote; the badges say what they mean
-// without a second read. Storage shows only when there is any, so a row with
-// the badge is someone with media parked in the cloud.
-function RowBadges({ row, group }: { row: OutreachRow; group?: string }) {
- const broke = Number(row.balance) <= 0;
- const stored = Number(row.storageBytes);
- return (
- <div className="mt-1 flex flex-wrap items-center gap-1.5">
- {group ? <Badge>{group}</Badge> : null}
- {REASON_BADGES.filter((reason) => row.reasons.includes(reason)).map((reason) => (
- <Badge key={reason} variant="destructive">
- {OUTREACH_REASON_LABELS[reason]}
- {reason === "payment_failed" && row.paymentFailedAt
- ? ` · ${ago(row.paymentFailedAt)}`
- : ""}
- </Badge>
- ))}
- <Badge variant="secondary">${row.spent} spent</Badge>
- <Badge variant={broke ? "destructive" : "outline"}>
- {broke ? `$0 left · ${ago(row.ranOutAt)}` : `$${row.balance} left`}
- </Badge>
- {stored > 0 ? (
- <Badge variant="secondary">{formatBytes(stored)} stored</Badge>
- ) : null}
- <Badge variant="outline">active {ago(row.lastActiveAt)}</Badge>
- <Badge variant="outline">joined {ago(row.signedUpAt)}</Badge>
- {row.sentCount > 0 ? (
- <Badge variant="outline">
- emailed {ago(row.lastSentAt)}
- {row.sentCount > 1 ? ` · ${row.sentCount}×` : ""}
- </Badge>
- ) : null}
- </div>
- );
-}
-
-export default function SuOutreachPage() {
- const [status, setStatus] = useState<OutreachStatus>("todo");
- // The to-email list narrows to one reason; the other lists show all.
- const [reason, setReason] = useState<OutreachReason | undefined>();
- const [query, setQuery] = useState("");
- // A search starts wide — matches from every tab in one list — and clicking
- // a tab pins it to that group until the next search begins.
- const [scoped, setScoped] = useState(false);
- const [sendTarget, setSendTarget] = useState<OutreachRow | null>(null);
- // The needle trails the field by a beat, so a search fires once per pause
- // in typing; clearing the field (handled in the input's onChange) brings
- // the plain list back at once.
- const [needle, setNeedle] = useState("");
- useEffect(() => {
- const trimmed = query.trim();
- if (trimmed === "") return;
- const timer = setTimeout(() => setNeedle(trimmed), 300);
- return () => clearTimeout(timer);
- }, [query]);
- const list = useOutreach(status, status === "todo" ? reason : undefined);
- // Search matches in the database across every tab, so a hit past the page
- // cap is still found and every tab reports its true match count.
- const search = useOutreachSearch(needle, scoped ? status : undefined);
- const countsData = useOutreachCounts().data;
- const counts = countsData?.counts;
- const act = useOutreachAction();
- const busy = useBusyOutreachIds();
-
- // An address that is not on the list is put there, then opened for a note.
- const addByEmail = () =>
- act.mutate({ action: "add", email: needle }, { onSuccess: (result) => setSendTarget(result.row) });
-
- const searching = needle !== "";
- const allTabs = searching && !scoped;
- const rows = searching ? (search.data?.rows ?? []) : (list.data?.rows ?? []);
- const loading = searching ? search.isPending : list.isPending;
- // Badges show the server's numbers: match counts while searching, list
- // totals otherwise; while either is still loading they show nothing.
- const tabCounts = searching ? search.data?.counts : counts;
- // The rows are one page of the matches; when there are more, the list says
- // so instead of passing a page off as the whole answer.
- const matchTotal = search.data
- ? scoped
- ? search.data.counts[status]
- : FILTERS.reduce((sum, filter) => sum + search.data.counts[filter.status], 0)
- : 0;
- const truncated = searching && matchTotal > rows.length;
- const addFailed = act.isError && act.variables?.action === "add";
- const adding = act.isPending && act.variables?.action === "add";
-
- return (
- <div className="space-y-4 pb-9">
- <Input
- aria-label="Search name or email"
- className="max-w-sm"
- onChange={(event) => {
- if (query.trim() === "" || event.target.value.trim() === "") {
- setScoped(false);
- }
- if (event.target.value.trim() === "") setNeedle("");
- setQuery(event.target.value);
- }}
- placeholder="Search name or email"
- type="search"
- value={query}
- />
-
- <div className="flex flex-wrap items-center gap-2">
- {FILTERS.map((filter) => (
- <Button
- key={filter.status}
- onClick={() => {
- setStatus(filter.status);
- setScoped(true);
- }}
- size="sm"
- variant={
- !allTabs && status === filter.status ? "default" : "outline"
- }
- >
- {filter.label}
- {tabCounts ? (
- <span className="tabular-nums opacity-60">
- {tabCounts[filter.status]}
- </span>
- ) : null}
- </Button>
- ))}
- </div>
-
- {status === "todo" && !allTabs ? (
- <div className="flex flex-wrap items-center gap-1.5">
- {[undefined, ...OUTREACH_REASONS].map((id) => {
- const on = reason === id;
- const count = id ? countsData?.reasons?.[id] : counts?.todo;
- return (
- <button
- key={id ?? "all"}
- type="button"
- aria-pressed={on}
- onClick={() => setReason(id)}
- className={cn(
- "flex items-center gap-1.5 rounded-full border px-2.5 py-1 text-xs transition-colors",
- on ? "border-foreground" : "border-border text-muted-foreground hover:bg-muted/60",
- )}
- >
- {id ? OUTREACH_REASON_LABELS[id] : "All"}
- {count !== undefined ? (
- <span className="tabular-nums opacity-60">{count}</span>
- ) : null}
- </button>
- );
- })}
- </div>
- ) : null}
-
- <div className="rounded-xl border bg-card">
- {rows.length > 0 ? (
- <ul className="divide-y">
- {rows.map((row) => (
- <li
- key={`${row.status}-${row.id}`}
- className="flex flex-wrap items-start justify-between gap-3 p-5"
- >
- <div className="min-w-0">
- <div className="flex flex-wrap items-baseline gap-x-2">
- <span className="text-sm font-medium">{row.name}</span>
- <span className="truncate text-sm text-muted-foreground">
- {row.email}
- </span>
- </div>
- <RowBadges
- group={
- allTabs
- ? FILTERS.find((f) => f.status === row.status)?.label
- : undefined
- }
- row={row}
- />
- </div>
- <div className="flex shrink-0 items-center gap-2">
- {row.status === "sent" ? (
- <Button
- disabled={busy.has(row.id)}
- onClick={() =>
- act.mutate({ action: "replied", outreachId: row.id })
- }
- size="sm"
- variant="outline"
- >
- Mark replied
- </Button>
- ) : null}
- {row.status === "ignored" ? (
- <Button
- disabled={busy.has(row.id)}
- onClick={() =>
- act.mutate({ action: "unignore", outreachId: row.id })
- }
- size="sm"
- variant="outline"
- >
- Restore
- </Button>
- ) : (
- <Button
- disabled={busy.has(row.id)}
- onClick={() =>
- act.mutate({ action: "ignore", outreachId: row.id })
- }
- size="sm"
- variant="ghost"
- >
- Ignore
- </Button>
- )}
- <Button
- disabled={busy.has(row.id)}
- onClick={() => setSendTarget(row)}
- size="sm"
- >
- {row.sentCount > 0 ? "Email again" : "Email"}
- </Button>
- </div>
- </li>
- ))}
- </ul>
- ) : (
- <div className="flex flex-wrap items-center justify-between gap-3 p-5">
- <p className="text-sm text-muted-foreground">
- {loading
- ? "Loading…"
- : searching
- ? addFailed
- ? `No account has the address ${needle}.`
- : "No matches."
- : "Nothing here. Run a scan to refresh."}
- </p>
- {searching && !loading ? (
- <Button disabled={adding} onClick={addByEmail} size="sm" variant="outline">
- {adding ? "Adding…" : `Add ${needle} to the list`}
- </Button>
- ) : null}
- </div>
- )}
- </div>
-
- {truncated ? (
- <p className="text-sm text-muted-foreground">
- Showing the first {rows.length} of {matchTotal} matches. Narrow the
- search to see the rest.
- </p>
- ) : null}
-
- {act.isError && !addFailed ? (
- <p className="text-sm text-destructive">
- That didn&apos;t go through. Run a scan and try again.
- </p>
- ) : null}
-
- <OutreachComposeDialog onClose={() => setSendTarget(null)} target={sendTarget} />
- </div>
- );
-}
diff --git a/site/src/app/su/product/page.tsx b/site/src/app/su/product/page.tsx
deleted file mode 100644
index 4db1987c..00000000
--- a/site/src/app/su/product/page.tsx
+++ /dev/null
@@ -1,26 +0,0 @@
-"use client";
-
-import { SettingCard } from "@/app/su/experiments/SettingCard";
-import { SuStandIn } from "@/app/su/SuStandIn";
-import { PRODUCT_SETTING_KEYS } from "@/lib/config/registry";
-import { useSettings } from "@/queries/settings";
-
-// The settings that shape what an account gets, drawn with the same cards as
-// the settings tab under Experiments.
-const productKeys: ReadonlySet<string> = new Set(PRODUCT_SETTING_KEYS);
-
-export default function SuProductPage() {
- const settings = useSettings();
- if (!settings.data) {
- return <SuStandIn />;
- }
- return (
- <div className="max-w-2xl space-y-6 pb-9">
- {settings.data.settings
- .filter((row) => productKeys.has(row.key))
- .map((row) => (
- <SettingCard key={row.key} row={row} />
- ))}
- </div>
- );
-}
diff --git a/site/src/app/su/promotions/PromotionDialog.tsx b/site/src/app/su/promotions/PromotionDialog.tsx
deleted file mode 100644
index ab8e7db6..00000000
--- a/site/src/app/su/promotions/PromotionDialog.tsx
+++ /dev/null
@@ -1,521 +0,0 @@
-"use client";
-
-import { ChevronRight } from "lucide-react";
-import { useState } from "react";
-import type { z } from "zod";
-
-import { CreditOfferFields } from "@/app/su/CreditOfferFields";
-import {
- AudienceFields,
- audienceDraftFrom,
- audienceInputFrom,
- blankAudienceDraft,
- type AudienceDraft,
-} from "@/app/su/experiments/AudienceFields";
-import { Field } from "@/app/su/Field";
-import { Button } from "@/components/ui/button";
-import {
- Dialog,
- DialogBody,
- DialogContent,
- DialogDescription,
- DialogFooter,
- DialogHeader,
- DialogTitle,
-} from "@/components/ui/dialog";
-import { Input } from "@/components/ui/input";
-import { Label } from "@/components/ui/label";
-import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from "@/components/ui/select";
-import { Switch } from "@/components/ui/switch";
-import { Textarea } from "@/components/ui/textarea";
-import type { Settings } from "@/lib/config/registry";
-import { cn } from "@/lib/utils";
-import { isOfferPlaceholder, PROMOTION_PLACEHOLDERS } from "@/lib/marketing/placeholders";
-import { BUTTON_MARK } from "@/lib/marketing/promotionCopy";
-import {
- promotionDraftSchema,
- promotionInputSchema,
- type PromotionDraftInput,
- type PromotionInput,
- type PromotionSender,
- type SegmentCount,
-} from "@/lib/marketing/promotionInput";
-import {
- CLAIM_URL_PLACEHOLDER,
- creditOfferTermsIfValid,
- OFFER_BUTTON_LABELS,
- type CreditOfferTerms,
-} from "@/lib/credits/offerTerms";
-import {
- useCountSegment,
- useSavePromotion,
- useSendPromotion,
- useTestPromotion,
- type PromotionSummary,
-} from "@/queries/promotions";
-import { useOutreachTemplates, useSaveOutreachTemplate } from "@/queries/outreachTemplates";
-
-// One form writes a promotion and sends it: the words, the button, which
-// address it comes from, who gets it, and which earlier promotions' readers
-// are left out. A draft saves however it stands; a test or a send checks the
-// whole form first. A sent promotion opens read-only.
-
-type OfferDefaults = Settings["promotionCreditOffer"];
-
-type Draft = {
- creditOffer: CreditOfferTerms | null;
- name: string;
- subject: string;
- body: string;
- ctaLabel: string;
- ctaUrl: string;
- sender: PromotionSender;
- audience: AudienceDraft;
- excludePromotionIds: string[];
-};
-
-const CLAIM_LABEL_SET = new Set(Object.values(OFFER_BUTTON_LABELS));
-
-const offerOf = (d: OfferDefaults): CreditOfferTerms => ({
- dollars: d.dollars,
- claimWindowDays: d.claimWindowDays,
- expiresAfterDays: d.expiresAfterDays,
- claim: d.claim,
-});
-
-// A new draft starts as a credit promotion on the setting's terms, reaching
-// accounts at least the setting's age.
-const blank = (defaults: OfferDefaults): Draft => ({
- name: "",
- subject: "",
- body: "",
- ctaLabel: OFFER_BUTTON_LABELS[defaults.claim],
- ctaUrl: CLAIM_URL_PLACEHOLDER,
- creditOffer: offerOf(defaults),
- sender: "bulk",
- audience: { ...blankAudienceDraft(), minimumAccountAgeDays: String(defaults.minimumAccountAgeDays) },
- excludePromotionIds: [],
-});
-
-const fromSummary = (p: PromotionSummary): Draft => ({
- name: p.name,
- subject: p.subject,
- body: p.body,
- ctaLabel: p.ctaLabel ?? "",
- ctaUrl: p.ctaUrl ?? "",
- creditOffer: p.creditOffer,
- sender: p.sender,
- audience: audienceDraftFrom(p.audience),
- excludePromotionIds: p.excludePromotionIds,
-});
-
-// Turning the offer on makes the button the claim link; turning it off takes
-// that button away, since it pointed at nothing else. A label the form wrote
-// for one claim follows a change of claim; one the operator typed stays.
-const withOffer = (d: Draft, offer: CreditOfferTerms | null): Draft => {
- if (offer) {
- const label = d.ctaLabel.trim();
- const written = !label || CLAIM_LABEL_SET.has(label);
- return {
- ...d,
- creditOffer: offer,
- ctaUrl: CLAIM_URL_PLACEHOLDER,
- ctaLabel: written ? OFFER_BUTTON_LABELS[offer.claim] : label,
- };
- }
- const wasClaim = d.ctaUrl === CLAIM_URL_PLACEHOLDER;
- return { ...d, creditOffer: null, ctaUrl: wasClaim ? "" : d.ctaUrl, ctaLabel: wasClaim ? "" : d.ctaLabel };
-};
-
-function toInput(draft: Draft): unknown {
- return {
- name: draft.name.trim(),
- subject: draft.subject.trim(),
- body: draft.body.trim(),
- ctaLabel: draft.ctaLabel.trim() || null,
- ctaUrl: draft.ctaUrl.trim() || null,
- creditOffer: draft.creditOffer,
- sender: draft.sender,
- audience: audienceInputFrom(draft.audience),
- excludePromotionIds: draft.excludePromotionIds,
- };
-}
-
-/** The placeholders the words may use: the offer's only while there is one. */
-const placeholdersFor = (offered: boolean) =>
- PROMOTION_PLACEHOLDERS.filter((k) => offered || !isOfferPlaceholder(k))
- .map((k) => `{{${k}}}`)
- .join(", ");
-
-export function PromotionDialog({
- existing,
- seed,
- offerDefaults,
- promotions,
- senders,
- open,
- onOpenChange,
-}: {
- existing: PromotionSummary | null;
- // A copy to start from, when the promotion is new.
- seed: PromotionSummary | null;
- offerDefaults: OfferDefaults;
- promotions: PromotionSummary[];
- senders: Record<PromotionSender, string>;
- open: boolean;
- onOpenChange: (open: boolean) => void;
-}) {
- const [draft, setDraft] = useState<Draft>(() =>
- existing ? fromSummary(existing) : seed ? { ...fromSummary(seed), name: `${seed.name} (copy)` } : blank(offerDefaults),
- );
- const [savedId, setSavedId] = useState<string | null>(existing?.id ?? null);
- // The draft as it was last stored; a new promotion has unsaved edits from
- // the start.
- const [savedDraft, setSavedDraft] = useState<string | null>(() =>
- existing ? JSON.stringify(fromSummary(existing)) : null,
- );
- const [issues, setIssues] = useState<string[]>([]);
- const [notice, setNotice] = useState<string | null>(null);
- const [confirm, setConfirm] = useState<{ id: string; count: SegmentCount } | null>(null);
- // Narrow screens stack the columns and fold the offer, audience and
- // exclusions under a disclosure; wide ones show them beside the email.
- const [showTargeting, setShowTargeting] = useState(false);
- const save = useSavePromotion();
- const send = useSendPromotion();
- const test = useTestPromotion();
- const count = useCountSegment();
- const saveTemplate = useSaveOutreachTemplate();
- const templates = useOutreachTemplates();
-
- const readOnly = existing !== null && existing.status !== "draft";
- const dirty = !readOnly && JSON.stringify(draft) !== savedDraft;
- const busy = save.isPending || send.isPending || test.isPending || count.isPending || saveTemplate.isPending;
- // Earlier promotions that reached anyone, by segment or by hand; the one
- // being edited is not a choice against itself.
- const earlier = promotions.filter((p) => p.id !== existing?.id && p.counts.recipients > 0);
-
- const setAudience = (patch: Partial<AudienceDraft>) =>
- setDraft((d) => ({ ...d, audience: { ...d.audience, ...patch } }));
- const toggleExclude = (id: string, on: boolean) =>
- setDraft((d) => ({
- ...d,
- excludePromotionIds: on
- ? Array.from(new Set([...d.excludePromotionIds, id]))
- : d.excludePromotionIds.filter((x) => x !== id),
- }));
- const loadTemplate = (id: string) => {
- const template = templates.data?.templates.find((item) => item.id === id);
- if (!template) return;
- setDraft((current) => {
- const next = { ...current, subject: template.subject, body: template.body };
- const offer = creditOfferTermsIfValid(template.promotion);
- return offer ? withOffer(next, offer) : next;
- });
- };
-
- const parseWith = <T,>(schema: { safeParse: (v: unknown) => z.ZodSafeParseResult<T> }): T | null => {
- const parsed = schema.safeParse(toInput(draft));
- if (!parsed.success) {
- setIssues(parsed.error.issues.map((i) => `${i.path.join(".") || "form"}: ${i.message}`));
- return null;
- }
- setIssues([]);
- return parsed.data;
- };
- const parseDraft = (): PromotionDraftInput | null => parseWith(promotionDraftSchema);
- const parse = (): PromotionInput | null => parseWith(promotionInputSchema);
-
- const fail = (e: Error) => setIssues([e.message]);
-
- // Every action past a plain save goes through the saved row, so the test
- // and the send read exactly what is stored.
- const ensureSaved = async (): Promise<string | null> => {
- const input = parseDraft();
- if (!input) return null;
- try {
- const result = await save.mutateAsync({ id: savedId, ...input });
- setSavedId(result.id);
- setSavedDraft(JSON.stringify(draft));
- return result.id;
- } catch (e) {
- fail(e as Error);
- return null;
- }
- };
-
- // The dialog stays open on a save, so the draft can go on being edited.
- const onSave = async () => {
- setNotice(null);
- const id = await ensureSaved();
- if (id) setNotice("Draft saved.");
- };
-
- // The template takes the promotion's name; saving again under that name
- // replaces it.
- const onSaveTemplate = () => {
- const name = draft.name.trim();
- if (!name) {
- setIssues(["Name the promotion first."]);
- return;
- }
- saveTemplate.mutate({
- name,
- subject: draft.subject.trim(),
- body: draft.body.trim(),
- unsubscribeLink: true,
- trackReplies: false,
- promotion: draft.creditOffer,
- }, {
- onSuccess: () => setNotice(`Template ${name} saved.`),
- onError: fail,
- });
- };
-
- const onTest = async () => {
- setNotice(null);
- setIssues([]);
- if (!readOnly && !parse()) return;
- const id = readOnly ? existing.id : await ensureSaved();
- if (!id) return;
- test.mutate(id, {
- onSuccess: (r) => setNotice(`Test sent to ${r.sentTo}.`),
- onError: fail,
- });
- };
-
- const onSend = async () => {
- setNotice(null);
- const input = parse();
- if (!input) return;
- const id = await ensureSaved();
- if (!id) return;
- count.mutate(
- { audience: input.audience, excludePromotionIds: input.excludePromotionIds },
- { onSuccess: (c) => setConfirm({ id, count: c }), onError: fail },
- );
- };
-
- const onConfirmSend = () => {
- if (!confirm) return;
- send.mutate(confirm.id, {
- onSuccess: () => onOpenChange(false),
- onError: (e) => {
- setConfirm(null);
- fail(e);
- },
- });
- };
-
- const senderLabel = (s: PromotionSender) =>
- `${s === "bulk" ? "Bulk" : "Personal"} · ${senders[s] || "not configured"}`;
-
- return (
- <Dialog open={open} onOpenChange={onOpenChange}>
- <DialogContent className="sm:max-w-6xl">
- <DialogHeader>
- <DialogTitle>{readOnly ? draft.name || "Untitled" : existing ? "Edit promotion" : "New promotion"}</DialogTitle>
- <DialogDescription>
- {readOnly
- ? "Sent as it reads here."
- : "One email to everyone in the segment. Unsubscribed accounts are always left out."}
- </DialogDescription>
- {!readOnly && templates.data?.templates.length ? (
- <Select
- items={Object.fromEntries(templates.data.templates.map((t) => [t.id, t.name]))}
- onValueChange={(id: string | null) => id && loadTemplate(id)}
- >
- <SelectTrigger><SelectValue placeholder="Load saved template" /></SelectTrigger>
- <SelectContent>
- {templates.data.templates.map((template) => (
- <SelectItem key={template.id} value={template.id}>{template.name}</SelectItem>
- ))}
- </SelectContent>
- </Select>
- ) : null}
- </DialogHeader>
-
- <DialogBody className="grid gap-5 lg:grid-cols-2 lg:gap-8">
- <div className="grid content-start gap-5">
- <Field label="Name" htmlFor="promo-name">
- <Input
- id="promo-name"
- placeholder="Founding Pro, October"
- disabled={readOnly}
- value={draft.name}
- onChange={(e) => setDraft({ ...draft, name: e.target.value })}
- />
- </Field>
- <Field label="From" htmlFor="promo-sender">
- <Select
- disabled={readOnly}
- value={draft.sender}
- items={{ bulk: senderLabel("bulk"), personal: senderLabel("personal") }}
- onValueChange={(v) => setDraft({ ...draft, sender: v as PromotionSender })}
- >
- <SelectTrigger id="promo-sender">
- <SelectValue />
- </SelectTrigger>
- <SelectContent>
- <SelectItem value="bulk">{senderLabel("bulk")}</SelectItem>
- <SelectItem value="personal">{senderLabel("personal")}</SelectItem>
- </SelectContent>
- </Select>
- </Field>
- <Field label="Subject" htmlFor="promo-subject">
- <Input
- id="promo-subject"
- disabled={readOnly}
- value={draft.subject}
- onChange={(e) => setDraft({ ...draft, subject: e.target.value })}
- />
- </Field>
- <Field label="Body" htmlFor="promo-body">
- <Textarea
- id="promo-body"
- rows={12}
- disabled={readOnly}
- value={draft.body}
- onChange={(e) => setDraft({ ...draft, body: e.target.value })}
- />
- <p className="text-xs text-muted-foreground">
- A blank line starts a new paragraph. {placeholdersFor(draft.creditOffer !== null)} fill in per person. A line that is only{" "}
- {BUTTON_MARK} places the button; without it the button comes last.
- </p>
- </Field>
- <div className="grid grid-cols-2 gap-3">
- <Field label="Button label (optional)" htmlFor="promo-cta-label">
- <Input
- id="promo-cta-label"
- placeholder="Get Pro"
- disabled={readOnly}
- value={draft.ctaLabel}
- onChange={(e) => setDraft({ ...draft, ctaLabel: e.target.value })}
- />
- </Field>
- <Field label="Button link" htmlFor="promo-cta-url">
- <Input
- id="promo-cta-url"
- placeholder="https://donkeycut.com/app/settings"
- disabled={readOnly}
- value={draft.ctaUrl}
- onChange={(e) => setDraft({ ...draft, ctaUrl: e.target.value })}
- />
- </Field>
- </div>
-
- </div>
-
- <button
- type="button"
- className="flex items-center gap-1 text-sm font-medium lg:hidden"
- aria-expanded={showTargeting}
- aria-controls="promo-targeting"
- onClick={() => setShowTargeting((v) => !v)}
- >
- <ChevronRight className={cn("size-4 transition-transform duration-200", showTargeting && "rotate-90")} />
- Offer and audience
- </button>
-
- <div id="promo-targeting" className={cn("content-start gap-5", showTargeting ? "grid" : "hidden lg:grid")}>
- <CreditOfferFields
- idPrefix="promo-offer"
- value={draft.creditOffer}
- defaults={offerOf(offerDefaults)}
- disabled={readOnly}
- onChange={(offer) => setDraft(withOffer(draft, offer))}
- />
-
- <AudienceFields value={draft.audience} onChange={setAudience} countries={false} disabled={readOnly} />
-
- <div className="space-y-3">
- <Label>Skip anyone who received</Label>
- {earlier.length === 0 ? (
- <p className="text-sm text-muted-foreground">No earlier promotions.</p>
- ) : (
- <div className="grid gap-2">
- {earlier.map((p) => (
- <label key={p.id} className="flex items-center justify-between gap-3 text-sm">
- <span className="min-w-0 truncate">
- {p.name}
- <span className="text-muted-foreground"> · {p.counts.sent} sent</span>
- </span>
- <Switch
- disabled={readOnly}
- checked={draft.excludePromotionIds.includes(p.id)}
- onCheckedChange={(on) => toggleExclude(p.id, on)}
- />
- </label>
- ))}
- </div>
- )}
- </div>
-
- </div>
-
- <div className="grid gap-3 lg:col-span-2">
- {issues.length > 0 ? (
- <ul role="alert" className="list-disc space-y-1 pl-5 text-sm text-destructive">
- {issues.map((issue) => (
- <li key={issue}>{issue}</li>
- ))}
- </ul>
- ) : null}
- {notice ? <p className="text-sm text-muted-foreground">{notice}</p> : null}
- </div>
- </DialogBody>
-
- <DialogFooter className="gap-2 sm:justify-between">
- <Button type="button" variant="outline" disabled={busy} onClick={onTest}>
- {test.isPending ? "Sending test…" : "Send test to me"}
- </Button>
- <div className="flex gap-2">
- {readOnly ? (
- <Button type="button" variant="secondary" onClick={() => onOpenChange(false)}>
- Close
- </Button>
- ) : (
- <>
- <Button type="button" variant="outline" disabled={busy} onClick={onSaveTemplate}>
- {saveTemplate.isPending ? "Saving…" : "Save template"}
- </Button>
- <Button type="button" variant={dirty ? "default" : "secondary"} disabled={busy} onClick={onSave}>
- {save.isPending ? "Saving…" : "Save draft"}
- </Button>
- <Button type="button" variant={dirty ? "secondary" : "default"} disabled={busy} onClick={onSend}>
- {count.isPending ? "Counting…" : "Send"}
- </Button>
- </>
- )}
- </div>
- </DialogFooter>
-
- {confirm ? (
- <Dialog open onOpenChange={(isOpen) => !isOpen && setConfirm(null)}>
- <DialogContent>
- <DialogHeader>
- <DialogTitle>Send to {confirm.count.recipients} people?</DialogTitle>
- <DialogDescription>
- From {senders[draft.sender]}. Left out: {confirm.count.unsubscribed} unsubscribed,{" "}
- {confirm.count.alreadyReceived} already received an excluded promotion,{" "}
- {confirm.count.outsideAudience} outside the audience.
- </DialogDescription>
- </DialogHeader>
- <DialogFooter>
- <Button type="button" variant="secondary" disabled={send.isPending} onClick={() => setConfirm(null)}>
- Not yet
- </Button>
- <Button
- type="button"
- disabled={send.isPending || confirm.count.recipients === 0}
- onClick={onConfirmSend}
- >
- {send.isPending ? "Starting…" : "Send now"}
- </Button>
- </DialogFooter>
- </DialogContent>
- </Dialog>
- ) : null}
- </DialogContent>
- </Dialog>
- );
-}
diff --git a/site/src/app/su/promotions/page.tsx b/site/src/app/su/promotions/page.tsx
deleted file mode 100644
index a810a630..00000000
--- a/site/src/app/su/promotions/page.tsx
+++ /dev/null
@@ -1,241 +0,0 @@
-"use client";
-
-import { useState } from "react";
-import { describeAudience } from "@donkeycut/abexp";
-
-import { PromotionDialog } from "@/app/su/promotions/PromotionDialog";
-import { SuStandIn } from "@/app/su/SuStandIn";
-import {
- AlertDialog,
- AlertDialogAction,
- AlertDialogCancel,
- AlertDialogContent,
- AlertDialogDescription,
- AlertDialogFooter,
- AlertDialogHeader,
- AlertDialogTitle,
-} from "@/components/ui/alert-dialog";
-import { Badge } from "@/components/ui/badge";
-import { Button } from "@/components/ui/button";
-import type { PromotionSender, PromotionStatus } from "@/lib/marketing/promotionInput";
-import {
- useCancelPromotion,
- useDeletePromotion,
- usePromotions,
- useSendPromotion,
- type PromotionSummary,
-} from "@/queries/promotions";
-import type { Settings } from "@/lib/config/registry";
-import { useSettings } from "@/queries/settings";
-
-type BadgeVariant = "default" | "secondary" | "outline" | "destructive";
-
-const STATUS_VARIANT: Record<PromotionStatus, BadgeVariant> = {
- draft: "outline",
- queuing: "default",
- sending: "default",
- paused: "outline",
- sent: "secondary",
-};
-
-const when = (iso: string) => new Date(iso).toLocaleString();
-
-// A dialog opens on a row to edit it, or on a copy of one (its exclusions
-// pre-set to the original) to write the next promotion to everyone else.
-type Opened = { key: number; existing: PromotionSummary | null; seed: PromotionSummary | null };
-
-export default function SuPromotionsPage() {
- const promotions = usePromotions();
- const [opened, setOpened] = useState<Opened | null>(null);
- // New drafts start from the Promotion credit offer setting.
- const settings = useSettings();
- const offerDefaults = settings.data?.settings.find((row) => row.key === "promotionCreditOffer")?.value as
- | Settings["promotionCreditOffer"]
- | undefined;
- const [counter, setCounter] = useState(0);
- const open = (existing: PromotionSummary | null, seed: PromotionSummary | null) => {
- setCounter((k) => k + 1);
- setOpened({ key: counter + 1, existing, seed });
- };
-
- const loadError = promotions.isError ? (
- <div role="alert" className="space-y-3 rounded-lg border border-destructive/30 p-4">
- <p className="text-sm text-destructive">Couldn’t load promotions. {promotions.error.message}</p>
- <Button variant="outline" disabled={promotions.isFetching} onClick={() => void promotions.refetch()}>
- {promotions.isFetching ? "Retrying…" : "Retry"}
- </Button>
- </div>
- ) : null;
-
- if (!promotions.data) return promotions.isPending ? <SuStandIn /> : loadError;
- const { promotions: rows, senders } = promotions.data;
-
- return (
- <div className="space-y-6 pb-9">
- {loadError}
- <div className="flex justify-end">
- <Button onClick={() => open(null, null)}>New promotion</Button>
- </div>
- {rows.length === 0 ? <p className="text-sm text-muted-foreground">No promotions yet.</p> : null}
- {rows.map((p) => (
- <PromotionRow
- key={p.id}
- promotion={p}
- all={rows}
- senders={senders}
- onOpen={() => open(p, null)}
- onDuplicate={() =>
- open(null, {
- ...p,
- excludePromotionIds: Array.from(new Set([p.id, ...p.excludePromotionIds])),
- })
- }
- />
- ))}
- {opened && offerDefaults ? (
- <PromotionDialog
- key={opened.key}
- existing={opened.existing}
- seed={opened.seed}
- offerDefaults={offerDefaults}
- promotions={rows}
- senders={senders}
- open
- onOpenChange={(isOpen) => {
- if (!isOpen) setOpened(null);
- }}
- />
- ) : null}
- </div>
- );
-}
-
-function PromotionRow({
- promotion: p,
- all,
- senders,
- onOpen,
- onDuplicate,
-}: {
- promotion: PromotionSummary;
- all: PromotionSummary[];
- senders: Record<PromotionSender, string>;
- onOpen: () => void;
- onDuplicate: () => void;
-}) {
- const remove = useDeletePromotion();
- const cancel = useCancelPromotion();
- const resume = useSendPromotion();
- const [confirmDelete, setConfirmDelete] = useState(false);
- const skipped = p.excludePromotionIds
- .map((id) => all.find((other) => other.id === id)?.name ?? "a deleted promotion")
- .join(", ");
- const { recipients, sent, failed, clicked, claimed } = p.counts;
-
- return (
- <div className="rounded-lg border p-4">
- <div className="flex items-start justify-between gap-4">
- <div className="min-w-0">
- <div className="flex items-center gap-2">
- <span className="font-medium">{p.name || "Untitled"}</span>
- <Badge variant={STATUS_VARIANT[p.status]}>{p.status}</Badge>
- </div>
- <p className="mt-1 truncate text-sm text-muted-foreground">{p.subject}</p>
- <p className="mt-1 text-xs text-muted-foreground">
- From {senders[p.sender] || `${p.sender} (not configured)`} · {describeAudience(p.audience)}
- {skipped ? ` · skips recipients of ${skipped}` : ""}
- </p>
- <p className="mt-1 text-xs text-muted-foreground">
- {p.status === "draft"
- ? `Draft · saved ${when(p.updatedAt)}`
- : `${p.startedAt ? `Started ${when(p.startedAt)}` : ""}${
- p.finishedAt ? ` · finished ${when(p.finishedAt)}` : ""
- }`}
- </p>
- {p.status !== "draft" || recipients > 0 ? (
- <dl className="mt-4 flex flex-wrap gap-x-8 gap-y-2">
- {[
- ["Sent", `${sent} of ${recipients}`],
- ...(failed ? [["Failed", String(failed)]] : []),
- ["Clicked", String(clicked)],
- ...(p.creditOffer ? [["Claimed", String(claimed)]] : []),
- ].map(([label, value]) => (
- <div key={label}>
- <dt className="text-xs text-muted-foreground">{label}</dt>
- <dd className="text-lg font-medium tabular-nums">{value}</dd>
- </div>
- ))}
- </dl>
- ) : null}
- </div>
- <div className="flex shrink-0 items-center gap-2">
- <Button size="sm" variant={p.status === "draft" ? "default" : "outline"} onClick={onOpen}>
- {p.status === "draft" ? "Edit" : "View"}
- </Button>
- <Button size="sm" variant="outline" onClick={onDuplicate}>
- Duplicate
- </Button>
- {p.status === "queuing" || p.status === "sending" ? (
- <Button
- size="sm"
- variant="outline"
- disabled={cancel.isPending}
- onClick={() => cancel.mutate(p.id)}
- >
- {cancel.isPending ? "Pausing…" : "Pause"}
- </Button>
- ) : p.status === "paused" ? (
- <Button
- size="sm"
- variant="outline"
- disabled={resume.isPending}
- onClick={() => resume.mutate(p.id)}
- >
- {resume.isPending ? "Resuming…" : "Resume"}
- </Button>
- ) : (
- <Button
- size="sm"
- variant="ghost"
- disabled={remove.isPending}
- onClick={() => {
- remove.reset();
- setConfirmDelete(true);
- }}
- >
- Delete
- </Button>
- )}
- </div>
- </div>
- <AlertDialog open={confirmDelete} onOpenChange={(isOpen) => {
- if (!remove.isPending) setConfirmDelete(isOpen);
- }}>
- <AlertDialogContent>
- <AlertDialogHeader>
- <AlertDialogTitle>Delete “{p.name}”?</AlertDialogTitle>
- <AlertDialogDescription>
- {recipients > 0
- ? "Its recipient list goes with it, so a later promotion can no longer skip the people it reached."
- : "The draft is removed."}
- </AlertDialogDescription>
- </AlertDialogHeader>
- {remove.isError ? (
- <p role="alert" className="text-sm text-destructive">
- Couldn’t delete promotion. {remove.error.message}
- </p>
- ) : null}
- <AlertDialogFooter>
- <AlertDialogCancel disabled={remove.isPending}>Keep</AlertDialogCancel>
- <AlertDialogAction
- disabled={remove.isPending}
- onClick={() => remove.mutate(p.id, { onSuccess: () => setConfirmDelete(false) })}
- >
- {remove.isPending ? "Deleting…" : "Delete"}
- </AlertDialogAction>
- </AlertDialogFooter>
- </AlertDialogContent>
- </AlertDialog>
- </div>
- );
-}
diff --git a/site/src/app/su/users/page.tsx b/site/src/app/su/users/page.tsx
deleted file mode 100644
index 7d2abd11..00000000
--- a/site/src/app/su/users/page.tsx
+++ /dev/null
@@ -1,134 +0,0 @@
-"use client";
-
-import { useState } from "react";
-import { useQueryClient } from "@tanstack/react-query";
-
-import { Button } from "@/components/ui/button";
-import {
- Dialog,
- DialogClose,
- DialogContent,
- DialogDescription,
- DialogFooter,
- DialogHeader,
- DialogTitle,
-} from "@/components/ui/dialog";
-import { Input } from "@/components/ui/input";
-import { Label } from "@/components/ui/label";
-import { recentJobsQueryKey, useStartJob } from "@/queries/jobs";
-
-// User actions. Today: delete a user and everything they own, for cleaning
-// production test accounts out of the data. The delete runs as a background
-// job on the hosted API; this page starts it, and the Jobs surface tracks it
-// to completion. The confirm dialog makes the super user retype the email so
-// a paste-slip can't take out the wrong account. The layout gates this route
-// to super users, so the job hooks run unconditionally here.
-export default function SuUsersPage() {
- const queryClient = useQueryClient();
- const start = useStartJob();
- const [email, setEmail] = useState("");
- const [confirmOpen, setConfirmOpen] = useState(false);
- const [confirmEmail, setConfirmEmail] = useState("");
-
- const target = email.trim();
- const confirmed = target !== "" && confirmEmail.trim() === target;
-
- const openConfirm = () => {
- setConfirmEmail("");
- setConfirmOpen(true);
- };
-
- const submit = () => {
- if (!confirmed) return;
- start.mutate(
- { kind: "delete-user", payload: { email: target } },
- {
- onSuccess: () => {
- setEmail("");
- setConfirmOpen(false);
- queryClient.invalidateQueries({ queryKey: recentJobsQueryKey });
- },
- },
- );
- };
-
- return (
- <div className="max-w-2xl space-y-6 pb-9">
- <div className="rounded-xl border bg-card p-5">
- <div className="space-y-3">
- <div>
- <div className="text-sm font-medium">Delete user</div>
- <p className="mt-0.5 text-sm text-muted-foreground">
- Permanently deletes the account and everything it owns — projects,
- media, credits, and billing.
- </p>
- </div>
- <div className="flex items-center gap-2">
- <Input
- aria-label="User email"
- className="max-w-xs"
- id="delete-user-email"
- onChange={(event) => setEmail(event.target.value)}
- placeholder="[email protected]"
- type="email"
- value={email}
- />
- <Button
- disabled={target === "" || start.isPending}
- onClick={openConfirm}
- variant="destructive"
- >
- Delete User
- </Button>
- </div>
-
- {start.isError ? (
- <p className="text-sm text-destructive">
- Couldn&apos;t start the delete — check the email and try again.
- </p>
- ) : null}
- {start.isSuccess ? (
- <p className="text-sm text-muted-foreground">
- Delete started — it runs in the background and finishes under Jobs.
- </p>
- ) : null}
- </div>
- </div>
-
- <Dialog onOpenChange={setConfirmOpen} open={confirmOpen}>
- <DialogContent>
- <DialogHeader>
- <DialogTitle>Delete {target}?</DialogTitle>
- <DialogDescription>
- This permanently deletes the account and all of its data. Type
- to confirm.
- </DialogDescription>
- </DialogHeader>
- <div className="space-y-2">
- <Label htmlFor="delete-user-confirm">Email</Label>
- <Input
- autoComplete="off"
- id="delete-user-confirm"
- onChange={(event) => setConfirmEmail(event.target.value)}
- placeholder={target}
- type="email"
- value={confirmEmail}
- />
- </div>
- <DialogFooter>
- <DialogClose render={<Button variant="outline" />}>
- Cancel
- </DialogClose>
- <Button
- disabled={!confirmed || start.isPending}
- onClick={submit}
- variant="destructive"
- >
- {start.isPending ? "Starting…" : "Delete everything"}
- </Button>
- </DialogFooter>
- </DialogContent>
- </Dialog>
- </div>
- );
-}
diff --git a/site/src/components/Sortable.tsx b/site/src/components/Sortable.tsx
index 1c72eed4..9ad1abd0 100644
--- a/site/src/components/Sortable.tsx
+++ b/site/src/components/Sortable.tsx
@@ -1,9 +1,6 @@
"use client";
-import { useLayoutEffect, useRef, useState, type ReactNode, type RefObject } from "react";
-import { GripVertical } from "lucide-react";
-
-import { cn } from "@/lib/utils";
+import { useLayoutEffect, useRef, useState, type RefObject } from "react";
/** How long a displaced item takes to slide into its new slot. */
const SLIDE_MS = 180;
@@ -225,96 +222,3 @@ function useSlide(
return cb;
};
}
-
-/** Longest side of a drag ghost, px. */
-const GHOST_MAX = 260;
-
-/**
- * The item itself as the drag ghost, snapshotted before it turns into a hole.
- * A large card shrinks so the thing in hand does not blanket the list it is
- * carried across.
- */
-export function setSortDragImage(e: React.DragEvent, el: HTMLElement) {
- const rect = el.getBoundingClientRect();
- const scale = Math.min(1, GHOST_MAX / Math.max(rect.width, rect.height));
- const clone = el.cloneNode(true) as HTMLElement;
- clone.style.width = `${rect.width}px`;
- clone.style.height = `${rect.height}px`;
- clone.style.margin = "0";
- clone.style.opacity = "0.9";
- clone.style.transform = `scale(${scale})`;
- clone.style.transformOrigin = "top left";
- const wrap = document.createElement("div");
- wrap.style.cssText =
- "position:absolute;top:-1000px;left:-1000px;pointer-events:none;" +
- `width:${rect.width * scale}px;height:${rect.height * scale}px;`;
- wrap.appendChild(clone);
- document.body.appendChild(wrap);
- e.dataTransfer.setDragImage(
- wrap,
- Math.min(Math.max(e.clientX - rect.left, 0), rect.width) * scale,
- Math.min(Math.max(e.clientY - rect.top, 0), rect.height) * scale,
- );
- setTimeout(() => wrap.remove(), 0);
-}
-
-/**
- * One card in a sorted grid. The card becomes draggable only while its grip is
- * held, so charts keep their own pointer handling, and it empties to a dashed
- * outline for the length of the drag — the hole travels with the pointer and
- * shows where the card lands.
- */
-export function SortCard({
- children,
- className,
- dragging,
- onDragEnd,
- onDragStart,
- ref,
- ...handlers
-}: {
- children: ReactNode;
- className?: string;
- dragging: boolean;
- ref: (el: HTMLElement | null) => void;
-} & ItemHandlers) {
- const host = useRef<HTMLDivElement | null>(null);
- const [armed, setArmed] = useState(false);
- return (
- <div
- {...handlers}
- draggable={armed}
- ref={(el) => {
- host.current = el;
- ref(el);
- }}
- onDragEnd={() => {
- setArmed(false);
- onDragEnd();
- }}
- onDragStart={(e) => {
- if (host.current) setSortDragImage(e, host.current);
- onDragStart(e);
- }}
- className={cn(
- "group relative h-full min-w-0 rounded-xl [&>div]:h-full",
- dragging &&
- "bg-muted/40 outline-2 outline-dashed -outline-offset-2 outline-muted-foreground/30 [&>*]:invisible",
- className,
- )}
- >
- <button
- type="button"
- aria-label="Drag to reorder"
- title="Drag to reorder"
- onPointerDown={() => setArmed(true)}
- onPointerUp={() => setArmed(false)}
- onPointerCancel={() => setArmed(false)}
- className="absolute top-2 right-2 z-20 cursor-grab rounded-md p-1 text-muted-foreground/60 opacity-0 transition-opacity hover:bg-muted focus-visible:opacity-100 active:cursor-grabbing group-hover:opacity-100"
- >
- <GripVertical className="size-4" />
- </button>
- {children}
- </div>
- );
-}
diff --git a/site/src/components/ui/breadcrumb.tsx b/site/src/components/ui/breadcrumb.tsx
deleted file mode 100644
index b2880783..00000000
--- a/site/src/components/ui/breadcrumb.tsx
+++ /dev/null
@@ -1,124 +0,0 @@
-import * as React from "react"
-import { mergeProps } from "@base-ui/react/merge-props"
-import { useRender } from "@base-ui/react/use-render"
-import { cn } from "@/lib/utils"
-import { ChevronRightIcon, MoreHorizontalIcon } from "lucide-react"
-
-function Breadcrumb({ className, ...props }: React.ComponentProps<"nav">) {
- return (
- <nav
- aria-label="breadcrumb"
- data-slot="breadcrumb"
- className={cn(className)}
- {...props}
- />
- )
-}
-
-function BreadcrumbList({ className, ...props }: React.ComponentProps<"ol">) {
- return (
- <ol
- data-slot="breadcrumb-list"
- className={cn(
- "flex flex-wrap items-center gap-1.5 text-sm wrap-break-word text-muted-foreground",
- className
- )}
- {...props}
- />
- )
-}
-
-function BreadcrumbItem({ className, ...props }: React.ComponentProps<"li">) {
- return (
- <li
- data-slot="breadcrumb-item"
- className={cn("inline-flex items-center gap-1", className)}
- {...props}
- />
- )
-}
-
-function BreadcrumbLink({
- className,
- render,
- ...props
-}: useRender.ComponentProps<"a">) {
- return useRender({
- defaultTagName: "a",
- props: mergeProps<"a">(
- {
- className: cn("transition-colors hover:text-foreground", className),
- },
- props
- ),
- render,
- state: {
- slot: "breadcrumb-link",
- },
- })
-}
-
-function BreadcrumbPage({ className, ...props }: React.ComponentProps<"span">) {
- return (
- <span
- data-slot="breadcrumb-page"
- role="link"
- aria-disabled="true"
- aria-current="page"
- className={cn("font-normal text-foreground", className)}
- {...props}
- />
- )
-}
-
-function BreadcrumbSeparator({
- children,
- className,
- ...props
-}: React.ComponentProps<"li">) {
- return (
- <li
- data-slot="breadcrumb-separator"
- role="presentation"
- aria-hidden="true"
- className={cn("[&>svg]:size-3.5", className)}
- {...props}
- >
- {children ?? (
- <ChevronRightIcon />
- )}
- </li>
- )
-}
-
-function BreadcrumbEllipsis({
- className,
- ...props
-}: React.ComponentProps<"span">) {
- return (
- <span
- data-slot="breadcrumb-ellipsis"
- role="presentation"
- aria-hidden="true"
- className={cn(
- "flex size-5 items-center justify-center [&>svg]:size-4",
- className
- )}
- {...props}
- >
- <MoreHorizontalIcon
- />
- <span className="sr-only">More</span>
- </span>
- )
-}
-
-export {
- Breadcrumb,
- BreadcrumbList,
- BreadcrumbItem,
- BreadcrumbLink,
- BreadcrumbPage,
- BreadcrumbSeparator,
- BreadcrumbEllipsis,
-}
diff --git a/site/src/components/ui/calendar.tsx b/site/src/components/ui/calendar.tsx
deleted file mode 100644
index f42ade05..00000000
--- a/site/src/components/ui/calendar.tsx
+++ /dev/null
@@ -1,221 +0,0 @@
-"use client"
-
-import * as React from "react"
-import { cn } from "@/lib/utils"
-import {
- DayPicker,
- getDefaultClassNames,
- type DayButton,
- type Locale,
-} from "react-day-picker"
-
-import { Button, buttonVariants } from "@/components/ui/button"
-import { ChevronLeftIcon, ChevronRightIcon, ChevronDownIcon } from "lucide-react"
-
-function Calendar({
- className,
- classNames,
- showOutsideDays = true,
- captionLayout = "label",
- buttonVariant = "ghost",
- locale,
- formatters,
- components,
- ...props
-}: React.ComponentProps<typeof DayPicker> & {
- buttonVariant?: React.ComponentProps<typeof Button>["variant"]
-}) {
- const defaultClassNames = getDefaultClassNames()
-
- return (
- <DayPicker
- showOutsideDays={showOutsideDays}
- className={cn(
- "group/calendar bg-background p-2 [--cell-radius:var(--radius-md)] [--cell-size:--spacing(7)] in-data-[slot=card-content]:bg-transparent in-data-[slot=popover-content]:bg-transparent",
- String.raw`rtl:**:[.rdp-button\_next>svg]:rotate-180`,
- String.raw`rtl:**:[.rdp-button\_previous>svg]:rotate-180`,
- className
- )}
- captionLayout={captionLayout}
- locale={locale}
- formatters={{
- formatMonthDropdown: (date) =>
- date.toLocaleString(locale?.code, { month: "short" }),
- ...formatters,
- }}
- classNames={{
- root: cn("w-fit", defaultClassNames.root),
- months: cn(
- "relative flex flex-col gap-4 md:flex-row",
- defaultClassNames.months
- ),
- month: cn("flex w-full flex-col gap-4", defaultClassNames.month),
- nav: cn(
- "absolute inset-x-0 top-0 flex w-full items-center justify-between gap-1",
- defaultClassNames.nav
- ),
- button_previous: cn(
- buttonVariants({ variant: buttonVariant }),
- "size-(--cell-size) p-0 select-none aria-disabled:opacity-50",
- defaultClassNames.button_previous
- ),
- button_next: cn(
- buttonVariants({ variant: buttonVariant }),
- "size-(--cell-size) p-0 select-none aria-disabled:opacity-50",
- defaultClassNames.button_next
- ),
- month_caption: cn(
- "flex h-(--cell-size) w-full items-center justify-center px-(--cell-size)",
- defaultClassNames.month_caption
- ),
- dropdowns: cn(
- "flex h-(--cell-size) w-full items-center justify-center gap-1.5 text-sm font-medium",
- defaultClassNames.dropdowns
- ),
- dropdown_root: cn(
- "relative rounded-(--cell-radius)",
- defaultClassNames.dropdown_root
- ),
- dropdown: cn(
- "absolute inset-0 bg-popover opacity-0",
- defaultClassNames.dropdown
- ),
- caption_label: cn(
- "font-medium select-none",
- captionLayout === "label"
- ? "text-sm"
- : "flex items-center gap-1 rounded-(--cell-radius) text-sm [&>svg]:size-3.5 [&>svg]:text-muted-foreground",
- defaultClassNames.caption_label
- ),
- month_grid: cn("w-full border-collapse", defaultClassNames.month_grid),
- weekdays: cn("flex", defaultClassNames.weekdays),
- weekday: cn(
- "flex-1 rounded-(--cell-radius) text-[0.8rem] font-normal text-muted-foreground select-none",
- defaultClassNames.weekday
- ),
- week: cn("mt-2 flex w-full", defaultClassNames.week),
- week_number_header: cn(
- "w-(--cell-size) select-none",
- defaultClassNames.week_number_header
- ),
- week_number: cn(
- "text-[0.8rem] text-muted-foreground select-none",
- defaultClassNames.week_number
- ),
- day: cn(
- "group/day relative aspect-square h-full w-full rounded-(--cell-radius) p-0 text-center select-none [&:last-child[data-selected=true]_button]:rounded-r-(--cell-radius)",
- props.showWeekNumber
- ? "[&:nth-child(2)[data-selected=true]_button]:rounded-l-(--cell-radius)"
- : "[&:first-child[data-selected=true]_button]:rounded-l-(--cell-radius)",
- defaultClassNames.day
- ),
- range_start: cn(
- "relative isolate z-0 rounded-l-(--cell-radius) bg-muted after:absolute after:inset-y-0 after:right-0 after:w-4 after:bg-muted",
- defaultClassNames.range_start
- ),
- range_middle: cn("rounded-none", defaultClassNames.range_middle),
- range_end: cn(
- "relative isolate z-0 rounded-r-(--cell-radius) bg-muted after:absolute after:inset-y-0 after:left-0 after:w-4 after:bg-muted",
- defaultClassNames.range_end
- ),
- today: cn(
- "rounded-(--cell-radius) bg-muted text-foreground data-[selected=true]:rounded-none",
- defaultClassNames.today
- ),
- outside: cn(
- "text-muted-foreground aria-selected:text-muted-foreground",
- defaultClassNames.outside
- ),
- disabled: cn(
- "text-muted-foreground opacity-50",
- defaultClassNames.disabled
- ),
- hidden: cn("invisible", defaultClassNames.hidden),
- ...classNames,
- }}
- components={{
- Root: ({ className, rootRef, ...props }) => {
- return (
- <div
- data-slot="calendar"
- ref={rootRef}
- className={cn(className)}
- {...props}
- />
- )
- },
- Chevron: ({ className, orientation, ...props }) => {
- if (orientation === "left") {
- return (
- <ChevronLeftIcon className={cn("size-4", className)} {...props} />
- )
- }
-
- if (orientation === "right") {
- return (
- <ChevronRightIcon className={cn("size-4", className)} {...props} />
- )
- }
-
- return (
- <ChevronDownIcon className={cn("size-4", className)} {...props} />
- )
- },
- DayButton: ({ ...props }) => (
- <CalendarDayButton locale={locale} {...props} />
- ),
- WeekNumber: ({ children, ...props }) => {
- return (
- <td {...props}>
- <div className="flex size-(--cell-size) items-center justify-center text-center">
- {children}
- </div>
- </td>
- )
- },
- ...components,
- }}
- {...props}
- />
- )
-}
-
-function CalendarDayButton({
- className,
- day,
- modifiers,
- locale,
- ...props
-}: React.ComponentProps<typeof DayButton> & { locale?: Partial<Locale> }) {
- const defaultClassNames = getDefaultClassNames()
-
- const ref = React.useRef<HTMLButtonElement>(null)
- React.useEffect(() => {
- if (modifiers.focused) ref.current?.focus()
- }, [modifiers.focused])
-
- return (
- <Button
- variant="ghost"
- size="icon"
- data-day={day.date.toLocaleDateString(locale?.code)}
- data-selected-single={
- modifiers.selected &&
- !modifiers.range_start &&
- !modifiers.range_end &&
- !modifiers.range_middle
- }
- data-range-start={modifiers.range_start}
- data-range-end={modifiers.range_end}
- data-range-middle={modifiers.range_middle}
- className={cn(
- "relative isolate z-10 flex aspect-square size-auto w-full min-w-(--cell-size) flex-col gap-1 border-0 leading-none font-normal group-data-[focused=true]/day:relative group-data-[focused=true]/day:z-10 group-data-[focused=true]/day:border-ring group-data-[focused=true]/day:ring-[3px] group-data-[focused=true]/day:ring-ring/50 data-[range-end=true]:rounded-(--cell-radius) data-[range-end=true]:rounded-r-(--cell-radius) data-[range-end=true]:bg-primary data-[range-end=true]:text-primary-foreground data-[range-middle=true]:rounded-none data-[range-middle=true]:bg-muted data-[range-middle=true]:text-foreground data-[range-start=true]:rounded-(--cell-radius) data-[range-start=true]:rounded-l-(--cell-radius) data-[range-start=true]:bg-primary data-[range-start=true]:text-primary-foreground data-[selected-single=true]:bg-primary data-[selected-single=true]:text-primary-foreground dark:hover:text-foreground [&>span]:text-xs [&>span]:opacity-70",
- defaultClassNames.day,
- className
- )}
- {...props}
- />
- )
-}
-
-export { Calendar, CalendarDayButton }
diff --git a/site/src/components/ui/chart.tsx b/site/src/components/ui/chart.tsx
deleted file mode 100644
index 2c024091..00000000
--- a/site/src/components/ui/chart.tsx
+++ /dev/null
@@ -1,373 +0,0 @@
-"use client"
-
-import * as React from "react"
-import * as RechartsPrimitive from "recharts"
-import type { TooltipValueType } from "recharts"
-
-import { cn } from "@/lib/utils"
-
-// Format: { THEME_NAME: CSS_SELECTOR }
-const THEMES = { light: "", dark: ".dark" } as const
-
-const INITIAL_DIMENSION = { width: 320, height: 200 } as const
-type TooltipNameType = number | string
-
-export type ChartConfig = Record<
- string,
- {
- label?: React.ReactNode
- icon?: React.ComponentType
- } & (
- | { color?: string; theme?: never }
- | { color?: never; theme: Record<keyof typeof THEMES, string> }
- )
->
-
-type ChartContextProps = {
- config: ChartConfig
-}
-
-const ChartContext = React.createContext<ChartContextProps | null>(null)
-
-function useChart() {
- const context = React.useContext(ChartContext)
-
- if (!context) {
- throw new Error("useChart must be used within a <ChartContainer />")
- }
-
- return context
-}
-
-function ChartContainer({
- id,
- className,
- children,
- config,
- initialDimension = INITIAL_DIMENSION,
- ...props
-}: React.ComponentProps<"div"> & {
- config: ChartConfig
- children: React.ComponentProps<
- typeof RechartsPrimitive.ResponsiveContainer
- >["children"]
- initialDimension?: {
- width: number
- height: number
- }
-}) {
- const uniqueId = React.useId()
- const chartId = `chart-${id ?? uniqueId.replace(/:/g, "")}`
-
- return (
- <ChartContext.Provider value={{ config }}>
- <div
- data-slot="chart"
- data-chart={chartId}
- className={cn(
- "flex aspect-video min-w-0 select-none justify-center text-xs [&_.recharts-cartesian-axis-tick_text]:fill-muted-foreground [&_.recharts-cartesian-grid_line[stroke='#ccc']]:stroke-border/50 [&_.recharts-curve.recharts-tooltip-cursor]:stroke-border [&_.recharts-dot[stroke='#fff']]:stroke-transparent [&_.recharts-layer]:outline-hidden [&_.recharts-polar-grid_[stroke='#ccc']]:stroke-border [&_.recharts-radial-bar-background-sector]:fill-muted [&_.recharts-rectangle.recharts-tooltip-cursor]:fill-muted [&_.recharts-reference-line_[stroke='#ccc']]:stroke-border [&_.recharts-sector]:outline-hidden [&_.recharts-sector[stroke='#fff']]:stroke-transparent [&_.recharts-surface]:outline-hidden [&_.recharts-tooltip-wrapper]:z-10",
- className
- )}
- {...props}
- >
- <ChartStyle id={chartId} config={config} />
- <RechartsPrimitive.ResponsiveContainer
- initialDimension={initialDimension}
- >
- {children}
- </RechartsPrimitive.ResponsiveContainer>
- </div>
- </ChartContext.Provider>
- )
-}
-
-const ChartStyle = ({ id, config }: { id: string; config: ChartConfig }) => {
- const colorConfig = Object.entries(config).filter(
- ([, config]) => config.theme ?? config.color
- )
-
- if (!colorConfig.length) {
- return null
- }
-
- return (
- <style
- dangerouslySetInnerHTML={{
- __html: Object.entries(THEMES)
- .map(
- ([theme, prefix]) => `
-${prefix} [data-chart=${id}] {
-${colorConfig
- .map(([key, itemConfig]) => {
- const color =
- itemConfig.theme?.[theme as keyof typeof itemConfig.theme] ??
- itemConfig.color
- return color ? ` --color-${key}: ${color};` : null
- })
- .join("\n")}
-}
-`
- )
- .join("\n"),
- }}
- />
- )
-}
-
-const ChartTooltip = RechartsPrimitive.Tooltip
-
-function ChartTooltipContent({
- active,
- payload,
- className,
- indicator = "dot",
- hideLabel = false,
- hideIndicator = false,
- label,
- labelFormatter,
- labelClassName,
- formatter,
- color,
- nameKey,
- labelKey,
-}: React.ComponentProps<typeof RechartsPrimitive.Tooltip> &
- React.ComponentProps<"div"> & {
- hideLabel?: boolean
- hideIndicator?: boolean
- indicator?: "line" | "dot" | "dashed"
- nameKey?: string
- labelKey?: string
- } & Omit<
- RechartsPrimitive.DefaultTooltipContentProps<
- TooltipValueType,
- TooltipNameType
- >,
- "accessibilityLayer"
- >) {
- const { config } = useChart()
-
- const tooltipLabel = React.useMemo(() => {
- if (hideLabel || !payload?.length) {
- return null
- }
-
- const [item] = payload
- const key = `${labelKey ?? item?.dataKey ?? item?.name ?? "value"}`
- const itemConfig = getPayloadConfigFromPayload(config, item, key)
- const value =
- !labelKey && typeof label === "string"
- ? (config[label]?.label ?? label)
- : itemConfig?.label
-
- if (labelFormatter) {
- return (
- <div className={cn("font-medium", labelClassName)}>
- {labelFormatter(value, payload)}
- </div>
- )
- }
-
- if (!value) {
- return null
- }
-
- return <div className={cn("font-medium", labelClassName)}>{value}</div>
- }, [
- label,
- labelFormatter,
- payload,
- hideLabel,
- labelClassName,
- config,
- labelKey,
- ])
-
- if (!active || !payload?.length) {
- return null
- }
-
- const nestLabel = payload.length === 1 && indicator !== "dot"
-
- return (
- <div
- className={cn(
- "grid min-w-32 max-w-72 items-start gap-1.5 rounded-lg border border-border/50 bg-background px-2.5 py-1.5 text-xs shadow-xl",
- className
- )}
- >
- {!nestLabel ? tooltipLabel : null}
- <div className="grid gap-1.5">
- {payload
- .filter((item) => item.type !== "none")
- .map((item, index) => {
- const key = `${nameKey ?? item.name ?? item.dataKey ?? "value"}`
- const itemConfig = getPayloadConfigFromPayload(config, item, key)
- const indicatorColor = color ?? item.payload?.fill ?? item.color
-
- return (
- <div
- key={index}
- className={cn(
- "flex w-full flex-wrap items-stretch gap-2 [&>svg]:h-2.5 [&>svg]:w-2.5 [&>svg]:text-muted-foreground",
- indicator === "dot" && "items-center"
- )}
- >
- {formatter && item?.value !== undefined && item.name ? (
- formatter(item.value, item.name, item, index, item.payload)
- ) : (
- <>
- {itemConfig?.icon ? (
- <itemConfig.icon />
- ) : (
- !hideIndicator && (
- <div
- className={cn(
- "shrink-0 rounded-[2px] border-(--color-border) bg-(--color-bg)",
- {
- "h-2.5 w-2.5": indicator === "dot",
- "w-1": indicator === "line",
- "w-0 border-[1.5px] border-dashed bg-transparent":
- indicator === "dashed",
- "my-0.5": nestLabel && indicator === "dashed",
- }
- )}
- style={
- {
- "--color-bg": indicatorColor,
- "--color-border": indicatorColor,
- } as React.CSSProperties
- }
- />
- )
- )}
- <div
- className={cn(
- "flex flex-1 justify-between gap-3 leading-none",
- nestLabel ? "items-end" : "items-center"
- )}
- >
- <div className="grid gap-1.5">
- {nestLabel ? tooltipLabel : null}
- <span className="text-muted-foreground">
- {itemConfig?.label ?? item.name}
- </span>
- </div>
- {item.value != null && (
- <span className="font-mono font-medium text-foreground tabular-nums">
- {typeof item.value === "number"
- ? item.value.toLocaleString()
- : String(item.value)}
- </span>
- )}
- </div>
- </>
- )}
- </div>
- )
- })}
- </div>
- </div>
- )
-}
-
-const ChartLegend = RechartsPrimitive.Legend
-
-function ChartLegendContent({
- className,
- hideIcon = false,
- payload,
- verticalAlign = "bottom",
- nameKey,
-}: React.ComponentProps<"div"> & {
- hideIcon?: boolean
- nameKey?: string
-} & RechartsPrimitive.DefaultLegendContentProps) {
- const { config } = useChart()
-
- if (!payload?.length) {
- return null
- }
-
- return (
- <div
- className={cn(
- "flex flex-wrap items-center justify-center gap-x-4 gap-y-1.5",
- verticalAlign === "top" ? "pb-3" : "pt-3",
- className
- )}
- >
- {payload
- .filter((item) => item.type !== "none")
- .map((item, index) => {
- const key = `${nameKey ?? item.dataKey ?? "value"}`
- const itemConfig = getPayloadConfigFromPayload(config, item, key)
-
- return (
- <div
- key={index}
- className={cn(
- "flex items-center gap-1.5 whitespace-nowrap [&>svg]:h-3 [&>svg]:w-3 [&>svg]:text-muted-foreground"
- )}
- >
- {itemConfig?.icon && !hideIcon ? (
- <itemConfig.icon />
- ) : (
- <div
- className="h-2 w-2 shrink-0 rounded-[2px]"
- style={{
- backgroundColor: item.color,
- }}
- />
- )}
- {itemConfig?.label}
- </div>
- )
- })}
- </div>
- )
-}
-
-function getPayloadConfigFromPayload(
- config: ChartConfig,
- payload: unknown,
- key: string
-) {
- if (typeof payload !== "object" || payload === null) {
- return undefined
- }
-
- const payloadPayload =
- "payload" in payload &&
- typeof payload.payload === "object" &&
- payload.payload !== null
- ? payload.payload
- : undefined
-
- let configLabelKey: string = key
-
- if (
- key in payload &&
- typeof payload[key as keyof typeof payload] === "string"
- ) {
- configLabelKey = payload[key as keyof typeof payload] as string
- } else if (
- payloadPayload &&
- key in payloadPayload &&
- typeof payloadPayload[key as keyof typeof payloadPayload] === "string"
- ) {
- configLabelKey = payloadPayload[
- key as keyof typeof payloadPayload
- ] as string
- }
-
- return configLabelKey in config ? config[configLabelKey] : config[key]
-}
-
-export {
- ChartContainer,
- ChartTooltip,
- ChartTooltipContent,
- ChartLegend,
- ChartLegendContent,
- ChartStyle,
-}
diff --git a/site/src/components/ui/separator.tsx b/site/src/components/ui/separator.tsx
deleted file mode 100644
index 6e1369e4..00000000
--- a/site/src/components/ui/separator.tsx
+++ /dev/null
@@ -1,25 +0,0 @@
-"use client"
-
-import { Separator as SeparatorPrimitive } from "@base-ui/react/separator"
-
-import { cn } from "@/lib/utils"
-
-function Separator({
- className,
- orientation = "horizontal",
- ...props
-}: SeparatorPrimitive.Props) {
- return (
- <SeparatorPrimitive
- data-slot="separator"
- orientation={orientation}
- className={cn(
- "shrink-0 bg-border data-horizontal:h-px data-horizontal:w-full data-vertical:w-px data-vertical:self-stretch",
- className
- )}
- {...props}
- />
- )
-}
-
-export { Separator }
diff --git a/site/src/components/ui/sheet.tsx b/site/src/components/ui/sheet.tsx
deleted file mode 100644
index d16a0b6e..00000000
--- a/site/src/components/ui/sheet.tsx
+++ /dev/null
@@ -1,138 +0,0 @@
-"use client"
-
-import * as React from "react"
-import { Dialog as SheetPrimitive } from "@base-ui/react/dialog"
-
-import { cn } from "@/lib/utils"
-import { Button } from "@/components/ui/button"
-import { XIcon } from "lucide-react"
-
-function Sheet({ ...props }: SheetPrimitive.Root.Props) {
- return <SheetPrimitive.Root data-slot="sheet" {...props} />
-}
-
-function SheetTrigger({ ...props }: SheetPrimitive.Trigger.Props) {
- return <SheetPrimitive.Trigger data-slot="sheet-trigger" {...props} />
-}
-
-function SheetClose({ ...props }: SheetPrimitive.Close.Props) {
- return <SheetPrimitive.Close data-slot="sheet-close" {...props} />
-}
-
-function SheetPortal({ ...props }: SheetPrimitive.Portal.Props) {
- return <SheetPrimitive.Portal data-slot="sheet-portal" {...props} />
-}
-
-function SheetOverlay({ className, ...props }: SheetPrimitive.Backdrop.Props) {
- return (
- <SheetPrimitive.Backdrop
- data-slot="sheet-overlay"
- className={cn(
- "fixed inset-0 z-50 bg-black/10 transition-opacity duration-150 data-ending-style:opacity-0 data-starting-style:opacity-0 supports-backdrop-filter:backdrop-blur-xs",
- className
- )}
- {...props}
- />
- )
-}
-
-function SheetContent({
- className,
- children,
- side = "right",
- showCloseButton = true,
- ...props
-}: SheetPrimitive.Popup.Props & {
- side?: "top" | "right" | "bottom" | "left"
- showCloseButton?: boolean
-}) {
- return (
- <SheetPortal>
- <SheetOverlay />
- <SheetPrimitive.Popup
- data-slot="sheet-content"
- data-side={side}
- className={cn(
- "fixed z-50 flex flex-col gap-4 bg-popover bg-clip-padding text-sm text-popover-foreground shadow-lg transition duration-200 ease-in-out data-ending-style:opacity-0 data-starting-style:opacity-0 data-[side=bottom]:inset-x-0 data-[side=bottom]:bottom-0 data-[side=bottom]:h-auto data-[side=bottom]:max-h-[85dvh] data-[side=bottom]:overflow-y-auto data-[side=bottom]:border-t data-[side=bottom]:data-ending-style:translate-y-[2.5rem] data-[side=bottom]:data-starting-style:translate-y-[2.5rem] data-[side=left]:inset-y-0 data-[side=left]:left-0 data-[side=left]:h-full data-[side=left]:w-3/4 data-[side=left]:border-r data-[side=left]:data-ending-style:translate-x-[-2.5rem] data-[side=left]:data-starting-style:translate-x-[-2.5rem] data-[side=right]:inset-y-0 data-[side=right]:right-0 data-[side=right]:h-full data-[side=right]:w-3/4 data-[side=right]:border-l data-[side=right]:data-ending-style:translate-x-[2.5rem] data-[side=right]:data-starting-style:translate-x-[2.5rem] data-[side=top]:inset-x-0 data-[side=top]:top-0 data-[side=top]:h-auto data-[side=top]:max-h-[85dvh] data-[side=top]:overflow-y-auto data-[side=top]:border-b data-[side=top]:data-ending-style:translate-y-[-2.5rem] data-[side=top]:data-starting-style:translate-y-[-2.5rem] data-[side=left]:sm:max-w-sm data-[side=right]:sm:max-w-sm",
- className
- )}
- {...props}
- >
- {children}
- {showCloseButton && (
- <SheetPrimitive.Close
- data-slot="sheet-close"
- render={
- <Button
- variant="ghost"
- className="absolute top-3 right-3"
- size="icon-sm"
- />
- }
- >
- <XIcon
- />
- <span className="sr-only">Close</span>
- </SheetPrimitive.Close>
- )}
- </SheetPrimitive.Popup>
- </SheetPortal>
- )
-}
-
-function SheetHeader({ className, ...props }: React.ComponentProps<"div">) {
- return (
- <div
- data-slot="sheet-header"
- className={cn("flex flex-col gap-0.5 p-4", className)}
- {...props}
- />
- )
-}
-
-function SheetFooter({ className, ...props }: React.ComponentProps<"div">) {
- return (
- <div
- data-slot="sheet-footer"
- className={cn("mt-auto flex flex-col gap-2 p-4", className)}
- {...props}
- />
- )
-}
-
-function SheetTitle({ className, ...props }: SheetPrimitive.Title.Props) {
- return (
- <SheetPrimitive.Title
- data-slot="sheet-title"
- className={cn(
- "font-heading text-base font-medium text-foreground",
- className
- )}
- {...props}
- />
- )
-}
-
-function SheetDescription({
- className,
- ...props
-}: SheetPrimitive.Description.Props) {
- return (
- <SheetPrimitive.Description
- data-slot="sheet-description"
- className={cn("text-sm text-muted-foreground", className)}
- {...props}
- />
- )
-}
-
-export {
- Sheet,
- SheetTrigger,
- SheetClose,
- SheetContent,
- SheetHeader,
- SheetFooter,
- SheetTitle,
- SheetDescription,
-}
diff --git a/site/src/components/ui/sidebar.tsx b/site/src/components/ui/sidebar.tsx
deleted file mode 100644
index aca53fca..00000000
--- a/site/src/components/ui/sidebar.tsx
+++ /dev/null
@@ -1,723 +0,0 @@
-"use client"
-
-import * as React from "react"
-import { mergeProps } from "@base-ui/react/merge-props"
-import { useRender } from "@base-ui/react/use-render"
-import { cva, type VariantProps } from "class-variance-authority"
-
-import { useIsMobile } from "@/hooks/use-mobile"
-import { cn } from "@/lib/utils"
-import { Button } from "@/components/ui/button"
-import { Input } from "@/components/ui/input"
-import { Separator } from "@/components/ui/separator"
-import {
- Sheet,
- SheetContent,
- SheetDescription,
- SheetHeader,
- SheetTitle,
-} from "@/components/ui/sheet"
-import { Skeleton } from "@/components/ui/skeleton"
-import {
- Tooltip,
- TooltipContent,
- TooltipTrigger,
-} from "@/components/ui/tooltip"
-import { PanelLeftIcon } from "lucide-react"
-
-const SIDEBAR_COOKIE_NAME = "sidebar_state"
-const SIDEBAR_COOKIE_MAX_AGE = 60 * 60 * 24 * 7
-const SIDEBAR_WIDTH = "16rem"
-const SIDEBAR_WIDTH_MOBILE = "18rem"
-const SIDEBAR_WIDTH_ICON = "3rem"
-const SIDEBAR_KEYBOARD_SHORTCUT = "b"
-
-type SidebarContextProps = {
- state: "expanded" | "collapsed"
- open: boolean
- setOpen: (open: boolean) => void
- openMobile: boolean
- setOpenMobile: (open: boolean) => void
- isMobile: boolean
- toggleSidebar: () => void
-}
-
-const SidebarContext = React.createContext<SidebarContextProps | null>(null)
-
-function useSidebar() {
- const context = React.useContext(SidebarContext)
- if (!context) {
- throw new Error("useSidebar must be used within a SidebarProvider.")
- }
-
- return context
-}
-
-function SidebarProvider({
- defaultOpen = true,
- open: openProp,
- onOpenChange: setOpenProp,
- className,
- style,
- children,
- ...props
-}: React.ComponentProps<"div"> & {
- defaultOpen?: boolean
- open?: boolean
- onOpenChange?: (open: boolean) => void
-}) {
- const isMobile = useIsMobile()
- const [openMobile, setOpenMobile] = React.useState(false)
-
- // This is the internal state of the sidebar.
- // We use openProp and setOpenProp for control from outside the component.
- const [_open, _setOpen] = React.useState(defaultOpen)
- const open = openProp ?? _open
- const setOpen = React.useCallback(
- (value: boolean | ((value: boolean) => boolean)) => {
- const openState = typeof value === "function" ? value(open) : value
- if (setOpenProp) {
- setOpenProp(openState)
- } else {
- _setOpen(openState)
- }
-
- // This sets the cookie to keep the sidebar state.
- document.cookie = `${SIDEBAR_COOKIE_NAME}=${openState}; path=/; max-age=${SIDEBAR_COOKIE_MAX_AGE}`
- },
- [setOpenProp, open]
- )
-
- // Helper to toggle the sidebar.
- const toggleSidebar = React.useCallback(() => {
- return isMobile ? setOpenMobile((open) => !open) : setOpen((open) => !open)
- }, [isMobile, setOpen, setOpenMobile])
-
- // Adds a keyboard shortcut to toggle the sidebar.
- React.useEffect(() => {
- const handleKeyDown = (event: KeyboardEvent) => {
- if (
- event.key === SIDEBAR_KEYBOARD_SHORTCUT &&
- (event.metaKey || event.ctrlKey)
- ) {
- event.preventDefault()
- toggleSidebar()
- }
- }
-
- window.addEventListener("keydown", handleKeyDown)
- return () => window.removeEventListener("keydown", handleKeyDown)
- }, [toggleSidebar])
-
- // We add a state so that we can do data-state="expanded" or "collapsed".
- // This makes it easier to style the sidebar with Tailwind classes.
- const state = open ? "expanded" : "collapsed"
-
- const contextValue = React.useMemo<SidebarContextProps>(
- () => ({
- state,
- open,
- setOpen,
- isMobile,
- openMobile,
- setOpenMobile,
- toggleSidebar,
- }),
- [state, open, setOpen, isMobile, openMobile, setOpenMobile, toggleSidebar]
- )
-
- return (
- <SidebarContext.Provider value={contextValue}>
- <div
- data-slot="sidebar-wrapper"
- style={
- {
- "--sidebar-width": SIDEBAR_WIDTH,
- "--sidebar-width-icon": SIDEBAR_WIDTH_ICON,
- ...style,
- } as React.CSSProperties
- }
- className={cn(
- "group/sidebar-wrapper flex min-h-svh w-full has-data-[variant=inset]:bg-sidebar",
- className
- )}
- {...props}
- >
- {children}
- </div>
- </SidebarContext.Provider>
- )
-}
-
-function Sidebar({
- side = "left",
- variant = "sidebar",
- collapsible = "offcanvas",
- className,
- children,
- dir,
- ...props
-}: React.ComponentProps<"div"> & {
- side?: "left" | "right"
- variant?: "sidebar" | "floating" | "inset"
- collapsible?: "offcanvas" | "icon" | "none"
-}) {
- const { isMobile, state, openMobile, setOpenMobile } = useSidebar()
-
- if (collapsible === "none") {
- return (
- <div
- data-slot="sidebar"
- className={cn(
- "flex h-full w-(--sidebar-width) flex-col bg-sidebar text-sidebar-foreground",
- className
- )}
- {...props}
- >
- {children}
- </div>
- )
- }
-
- if (isMobile) {
- return (
- <Sheet open={openMobile} onOpenChange={setOpenMobile} {...props}>
- <SheetContent
- dir={dir}
- data-sidebar="sidebar"
- data-slot="sidebar"
- data-mobile="true"
- className="w-(--sidebar-width) bg-sidebar p-0 text-sidebar-foreground [&>button]:hidden"
- style={
- {
- "--sidebar-width": SIDEBAR_WIDTH_MOBILE,
- } as React.CSSProperties
- }
- side={side}
- >
- <SheetHeader className="sr-only">
- <SheetTitle>Sidebar</SheetTitle>
- <SheetDescription>Displays the mobile sidebar.</SheetDescription>
- </SheetHeader>
- <div className="flex h-full w-full flex-col">{children}</div>
- </SheetContent>
- </Sheet>
- )
- }
-
- return (
- <div
- className="group peer hidden text-sidebar-foreground md:block"
- data-state={state}
- data-collapsible={state === "collapsed" ? collapsible : ""}
- data-variant={variant}
- data-side={side}
- data-slot="sidebar"
- >
- {/* This is what handles the sidebar gap on desktop */}
- <div
- data-slot="sidebar-gap"
- className={cn(
- "relative w-(--sidebar-width) bg-transparent transition-[width] duration-200 ease-linear",
- "group-data-[collapsible=offcanvas]:w-0",
- "group-data-[side=right]:rotate-180",
- variant === "floating" || variant === "inset"
- ? "group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4)))]"
- : "group-data-[collapsible=icon]:w-(--sidebar-width-icon)"
- )}
- />
- <div
- data-slot="sidebar-container"
- data-side={side}
- className={cn(
- "fixed inset-y-0 z-10 hidden h-svh w-(--sidebar-width) transition-[left,right,width] duration-200 ease-linear data-[side=left]:left-0 data-[side=left]:group-data-[collapsible=offcanvas]:left-[calc(var(--sidebar-width)*-1)] data-[side=right]:right-0 data-[side=right]:group-data-[collapsible=offcanvas]:right-[calc(var(--sidebar-width)*-1)] md:flex",
- // Adjust the padding for floating and inset variants.
- variant === "floating" || variant === "inset"
- ? "p-2 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4))+2px)]"
- : "group-data-[collapsible=icon]:w-(--sidebar-width-icon) group-data-[side=left]:border-r group-data-[side=right]:border-l",
- className
- )}
- {...props}
- >
- <div
- data-sidebar="sidebar"
- data-slot="sidebar-inner"
- className="flex size-full flex-col bg-sidebar group-data-[variant=floating]:rounded-lg group-data-[variant=floating]:shadow-sm group-data-[variant=floating]:ring-1 group-data-[variant=floating]:ring-sidebar-border"
- >
- {children}
- </div>
- </div>
- </div>
- )
-}
-
-function SidebarTrigger({
- className,
- onClick,
- ...props
-}: React.ComponentProps<typeof Button>) {
- const { toggleSidebar } = useSidebar()
-
- return (
- <Button
- data-sidebar="trigger"
- data-slot="sidebar-trigger"
- variant="ghost"
- size="icon-sm"
- className={cn(className)}
- onClick={(event) => {
- onClick?.(event)
- toggleSidebar()
- }}
- {...props}
- >
- <PanelLeftIcon />
- <span className="sr-only">Toggle Sidebar</span>
- </Button>
- )
-}
-
-function SidebarRail({ className, ...props }: React.ComponentProps<"button">) {
- const { toggleSidebar } = useSidebar()
-
- return (
- <button
- data-sidebar="rail"
- data-slot="sidebar-rail"
- aria-label="Toggle Sidebar"
- tabIndex={-1}
- onClick={toggleSidebar}
- title="Toggle Sidebar"
- className={cn(
- "absolute inset-y-0 z-20 hidden w-4 transition-all ease-linear group-data-[side=left]:-right-4 group-data-[side=right]:left-0 after:absolute after:inset-y-0 after:start-1/2 after:w-[2px] hover:after:bg-sidebar-border sm:flex ltr:-translate-x-1/2 rtl:-translate-x-1/2",
- "in-data-[side=left]:cursor-w-resize in-data-[side=right]:cursor-e-resize",
- "[[data-side=left][data-state=collapsed]_&]:cursor-e-resize [[data-side=right][data-state=collapsed]_&]:cursor-w-resize",
- "group-data-[collapsible=offcanvas]:translate-x-0 group-data-[collapsible=offcanvas]:after:left-full hover:group-data-[collapsible=offcanvas]:bg-sidebar",
- "[[data-side=left][data-collapsible=offcanvas]_&]:-right-2",
- "[[data-side=right][data-collapsible=offcanvas]_&]:-left-2",
- className
- )}
- {...props}
- />
- )
-}
-
-function SidebarInset({ className, ...props }: React.ComponentProps<"main">) {
- return (
- <main
- data-slot="sidebar-inset"
- className={cn(
- "relative flex w-full flex-1 flex-col bg-background md:peer-data-[variant=inset]:m-2 md:peer-data-[variant=inset]:ml-0 md:peer-data-[variant=inset]:rounded-xl md:peer-data-[variant=inset]:shadow-sm md:peer-data-[variant=inset]:peer-data-[state=collapsed]:ml-2",
- className
- )}
- {...props}
- />
- )
-}
-
-function SidebarInput({
- className,
- ...props
-}: React.ComponentProps<typeof Input>) {
- return (
- <Input
- data-slot="sidebar-input"
- data-sidebar="input"
- className={cn("h-8 w-full bg-background shadow-none", className)}
- {...props}
- />
- )
-}
-
-function SidebarHeader({ className, ...props }: React.ComponentProps<"div">) {
- return (
- <div
- data-slot="sidebar-header"
- data-sidebar="header"
- className={cn("flex flex-col gap-2 p-2", className)}
- {...props}
- />
- )
-}
-
-function SidebarFooter({ className, ...props }: React.ComponentProps<"div">) {
- return (
- <div
- data-slot="sidebar-footer"
- data-sidebar="footer"
- className={cn("flex flex-col gap-2 p-2", className)}
- {...props}
- />
- )
-}
-
-function SidebarSeparator({
- className,
- ...props
-}: React.ComponentProps<typeof Separator>) {
- return (
- <Separator
- data-slot="sidebar-separator"
- data-sidebar="separator"
- className={cn("mx-2 w-auto bg-sidebar-border", className)}
- {...props}
- />
- )
-}
-
-function SidebarContent({ className, ...props }: React.ComponentProps<"div">) {
- return (
- <div
- data-slot="sidebar-content"
- data-sidebar="content"
- className={cn(
- "no-scrollbar flex min-h-0 flex-1 flex-col gap-0 overflow-auto group-data-[collapsible=icon]:overflow-hidden",
- className
- )}
- {...props}
- />
- )
-}
-
-function SidebarGroup({ className, ...props }: React.ComponentProps<"div">) {
- return (
- <div
- data-slot="sidebar-group"
- data-sidebar="group"
- className={cn("relative flex w-full min-w-0 flex-col p-2", className)}
- {...props}
- />
- )
-}
-
-function SidebarGroupLabel({
- className,
- render,
- ...props
-}: useRender.ComponentProps<"div"> & React.ComponentProps<"div">) {
- return useRender({
- defaultTagName: "div",
- props: mergeProps<"div">(
- {
- className: cn(
- "flex h-8 shrink-0 items-center rounded-md px-2 text-xs font-medium text-sidebar-foreground/70 ring-sidebar-ring outline-hidden transition-[margin,opacity] duration-200 ease-linear group-data-[collapsible=icon]:-mt-8 group-data-[collapsible=icon]:opacity-0 focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0",
- className
- ),
- },
- props
- ),
- render,
- state: {
- slot: "sidebar-group-label",
- sidebar: "group-label",
- },
- })
-}
-
-function SidebarGroupAction({
- className,
- render,
- ...props
-}: useRender.ComponentProps<"button"> & React.ComponentProps<"button">) {
- return useRender({
- defaultTagName: "button",
- props: mergeProps<"button">(
- {
- className: cn(
- "absolute top-3.5 right-3 flex aspect-square w-5 items-center justify-center rounded-md p-0 text-sidebar-foreground ring-sidebar-ring outline-hidden transition-transform group-data-[collapsible=icon]:hidden after:absolute after:-inset-2 hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 md:after:hidden [&>svg]:size-4 [&>svg]:shrink-0",
- className
- ),
- },
- props
- ),
- render,
- state: {
- slot: "sidebar-group-action",
- sidebar: "group-action",
- },
- })
-}
-
-function SidebarGroupContent({
- className,
- ...props
-}: React.ComponentProps<"div">) {
- return (
- <div
- data-slot="sidebar-group-content"
- data-sidebar="group-content"
- className={cn("w-full text-sm", className)}
- {...props}
- />
- )
-}
-
-function SidebarMenu({ className, ...props }: React.ComponentProps<"ul">) {
- return (
- <ul
- data-slot="sidebar-menu"
- data-sidebar="menu"
- className={cn("flex w-full min-w-0 flex-col gap-0", className)}
- {...props}
- />
- )
-}
-
-function SidebarMenuItem({ className, ...props }: React.ComponentProps<"li">) {
- return (
- <li
- data-slot="sidebar-menu-item"
- data-sidebar="menu-item"
- className={cn("group/menu-item relative", className)}
- {...props}
- />
- )
-}
-
-const sidebarMenuButtonVariants = cva(
- "peer/menu-button group/menu-button flex w-full items-center gap-2 overflow-hidden rounded-md p-2 text-left text-sm ring-sidebar-ring outline-hidden transition-[width,height,padding] group-has-data-[sidebar=menu-action]/menu-item:pr-8 group-data-[collapsible=icon]:size-8! group-data-[collapsible=icon]:p-2! hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-open:hover:bg-sidebar-accent data-open:hover:text-sidebar-accent-foreground data-active:bg-sidebar-accent data-active:font-medium data-active:text-sidebar-accent-foreground [&_svg]:size-4 [&_svg]:shrink-0 [&>span:last-child]:truncate",
- {
- variants: {
- variant: {
- default: "hover:bg-sidebar-accent hover:text-sidebar-accent-foreground",
- outline:
- "bg-background shadow-[0_0_0_1px_var(--sidebar-border)] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground hover:shadow-[0_0_0_1px_var(--sidebar-accent)]",
- },
- size: {
- default: "h-8 text-sm",
- sm: "h-7 text-xs",
- lg: "h-12 text-sm group-data-[collapsible=icon]:p-0!",
- },
- },
- defaultVariants: {
- variant: "default",
- size: "default",
- },
- }
-)
-
-function SidebarMenuButton({
- render,
- isActive = false,
- variant = "default",
- size = "default",
- tooltip,
- className,
- ...props
-}: useRender.ComponentProps<"button"> &
- React.ComponentProps<"button"> & {
- isActive?: boolean
- tooltip?: string | React.ComponentProps<typeof TooltipContent>
- } & VariantProps<typeof sidebarMenuButtonVariants>) {
- const { isMobile, state } = useSidebar()
- const comp = useRender({
- defaultTagName: "button",
- props: mergeProps<"button">(
- {
- className: cn(sidebarMenuButtonVariants({ variant, size }), className),
- },
- props
- ),
- render: !tooltip ? render : <TooltipTrigger render={render} />,
- state: {
- slot: "sidebar-menu-button",
- sidebar: "menu-button",
- size,
- active: isActive,
- },
- })
-
- if (!tooltip) {
- return comp
- }
-
- if (typeof tooltip === "string") {
- tooltip = {
- children: tooltip,
- }
- }
-
- return (
- <Tooltip>
- {comp}
- <TooltipContent
- side="right"
- align="center"
- hidden={state !== "collapsed" || isMobile}
- {...tooltip}
- />
- </Tooltip>
- )
-}
-
-function SidebarMenuAction({
- className,
- render,
- showOnHover = false,
- ...props
-}: useRender.ComponentProps<"button"> &
- React.ComponentProps<"button"> & {
- showOnHover?: boolean
- }) {
- return useRender({
- defaultTagName: "button",
- props: mergeProps<"button">(
- {
- className: cn(
- "absolute top-1.5 right-1 flex aspect-square w-5 items-center justify-center rounded-md p-0 text-sidebar-foreground ring-sidebar-ring outline-hidden transition-transform group-data-[collapsible=icon]:hidden peer-hover/menu-button:text-sidebar-accent-foreground peer-data-[size=default]/menu-button:top-1.5 peer-data-[size=lg]/menu-button:top-2.5 peer-data-[size=sm]/menu-button:top-1 after:absolute after:-inset-2 hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 md:after:hidden [&>svg]:size-4 [&>svg]:shrink-0",
- showOnHover &&
- "group-focus-within/menu-item:opacity-100 group-hover/menu-item:opacity-100 peer-data-active/menu-button:text-sidebar-accent-foreground aria-expanded:opacity-100 md:opacity-0",
- className
- ),
- },
- props
- ),
- render,
- state: {
- slot: "sidebar-menu-action",
- sidebar: "menu-action",
- },
- })
-}
-
-function SidebarMenuBadge({
- className,
- ...props
-}: React.ComponentProps<"div">) {
- return (
- <div
- data-slot="sidebar-menu-badge"
- data-sidebar="menu-badge"
- className={cn(
- "pointer-events-none absolute right-1 flex h-5 min-w-5 items-center justify-center rounded-md px-1 text-xs font-medium text-sidebar-foreground tabular-nums select-none group-data-[collapsible=icon]:hidden peer-hover/menu-button:text-sidebar-accent-foreground peer-data-[size=default]/menu-button:top-1.5 peer-data-[size=lg]/menu-button:top-2.5 peer-data-[size=sm]/menu-button:top-1 peer-data-active/menu-button:text-sidebar-accent-foreground",
- className
- )}
- {...props}
- />
- )
-}
-
-function SidebarMenuSkeleton({
- className,
- showIcon = false,
- ...props
-}: React.ComponentProps<"div"> & {
- showIcon?: boolean
-}) {
- // Random width between 50 to 90%.
- const [width] = React.useState(() => {
- return `${Math.floor(Math.random() * 40) + 50}%`
- })
-
- return (
- <div
- data-slot="sidebar-menu-skeleton"
- data-sidebar="menu-skeleton"
- className={cn("flex h-8 items-center gap-2 rounded-md px-2", className)}
- {...props}
- >
- {showIcon && (
- <Skeleton
- className="size-4 rounded-md"
- data-sidebar="menu-skeleton-icon"
- />
- )}
- <Skeleton
- className="h-4 max-w-(--skeleton-width) flex-1"
- data-sidebar="menu-skeleton-text"
- style={
- {
- "--skeleton-width": width,
- } as React.CSSProperties
- }
- />
- </div>
- )
-}
-
-function SidebarMenuSub({ className, ...props }: React.ComponentProps<"ul">) {
- return (
- <ul
- data-slot="sidebar-menu-sub"
- data-sidebar="menu-sub"
- className={cn(
- "mx-3.5 flex min-w-0 translate-x-px flex-col gap-1 border-l border-sidebar-border px-2.5 py-0.5 group-data-[collapsible=icon]:hidden",
- className
- )}
- {...props}
- />
- )
-}
-
-function SidebarMenuSubItem({
- className,
- ...props
-}: React.ComponentProps<"li">) {
- return (
- <li
- data-slot="sidebar-menu-sub-item"
- data-sidebar="menu-sub-item"
- className={cn("group/menu-sub-item relative", className)}
- {...props}
- />
- )
-}
-
-function SidebarMenuSubButton({
- render,
- size = "md",
- isActive = false,
- className,
- ...props
-}: useRender.ComponentProps<"a"> &
- React.ComponentProps<"a"> & {
- size?: "sm" | "md"
- isActive?: boolean
- }) {
- return useRender({
- defaultTagName: "a",
- props: mergeProps<"a">(
- {
- className: cn(
- "flex h-7 min-w-0 -translate-x-px items-center gap-2 overflow-hidden rounded-md px-2 text-sidebar-foreground ring-sidebar-ring outline-hidden group-data-[collapsible=icon]:hidden hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-[size=md]:text-sm data-[size=sm]:text-xs data-active:bg-sidebar-accent data-active:text-sidebar-accent-foreground [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0 [&>svg]:text-sidebar-accent-foreground",
- className
- ),
- },
- props
- ),
- render,
- state: {
- slot: "sidebar-menu-sub-button",
- sidebar: "menu-sub-button",
- size,
- active: isActive,
- },
- })
-}
-
-export {
- Sidebar,
- SidebarContent,
- SidebarFooter,
- SidebarGroup,
- SidebarGroupAction,
- SidebarGroupContent,
- SidebarGroupLabel,
- SidebarHeader,
- SidebarInput,
- SidebarInset,
- SidebarMenu,
- SidebarMenuAction,
- SidebarMenuBadge,
- SidebarMenuButton,
- SidebarMenuItem,
- SidebarMenuSkeleton,
- SidebarMenuSub,
- SidebarMenuSubButton,
- SidebarMenuSubItem,
- SidebarProvider,
- SidebarRail,
- SidebarSeparator,
- SidebarTrigger,
- useSidebar,
-}
diff --git a/site/src/components/ui/tabs.tsx b/site/src/components/ui/tabs.tsx
deleted file mode 100644
index 8e384957..00000000
--- a/site/src/components/ui/tabs.tsx
+++ /dev/null
@@ -1,81 +0,0 @@
-"use client"
-
-import { Tabs as TabsPrimitive } from "@base-ui/react/tabs"
-import { cva, type VariantProps } from "class-variance-authority"
-import { cn } from "@/lib/utils"
-
-function Tabs({
- className,
- orientation = "horizontal",
- ...props
-}: TabsPrimitive.Root.Props) {
- return (
- <TabsPrimitive.Root
- data-slot="tabs"
- data-orientation={orientation}
- className={cn(
- "group/tabs flex gap-2 data-horizontal:flex-col",
- className
- )}
- {...props}
- />
- )
-}
-
-const tabsListVariants = cva(
- "group/tabs-list inline-flex w-fit items-center justify-center rounded-lg p-[3px] text-muted-foreground group-data-horizontal/tabs:h-8 group-data-vertical/tabs:h-fit group-data-vertical/tabs:flex-col data-[variant=line]:rounded-none",
- {
- variants: {
- variant: {
- default: "bg-muted",
- line: "gap-1 bg-transparent",
- },
- },
- defaultVariants: {
- variant: "default",
- },
- }
-)
-
-function TabsList({
- className,
- variant = "default",
- ...props
-}: TabsPrimitive.List.Props & VariantProps<typeof tabsListVariants>) {
- return (
- <TabsPrimitive.List
- data-slot="tabs-list"
- data-variant={variant}
- className={cn(tabsListVariants({ variant }), className)}
- {...props}
- />
- )
-}
-
-function TabsTrigger({ className, ...props }: TabsPrimitive.Tab.Props) {
- return (
- <TabsPrimitive.Tab
- data-slot="tabs-trigger"
- className={cn(
- "relative inline-flex h-[calc(100%-1px)] flex-1 items-center justify-center gap-1.5 rounded-md border border-transparent px-1.5 py-0.5 text-sm font-medium whitespace-nowrap text-foreground/60 transition-all group-data-vertical/tabs:w-full group-data-vertical/tabs:justify-start hover:text-foreground focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 focus-visible:outline-1 focus-visible:outline-ring disabled:pointer-events-none disabled:opacity-50 has-data-[icon=inline-end]:pr-1 has-data-[icon=inline-start]:pl-1 aria-disabled:pointer-events-none aria-disabled:opacity-50 dark:text-muted-foreground dark:hover:text-foreground group-data-[variant=default]/tabs-list:data-active:shadow-sm group-data-[variant=line]/tabs-list:data-active:shadow-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
- "group-data-[variant=line]/tabs-list:bg-transparent group-data-[variant=line]/tabs-list:data-active:bg-transparent dark:group-data-[variant=line]/tabs-list:data-active:border-transparent dark:group-data-[variant=line]/tabs-list:data-active:bg-transparent",
- "data-active:bg-background data-active:text-foreground dark:data-active:border-input dark:data-active:bg-input/30 dark:data-active:text-foreground",
- "after:absolute after:bg-foreground after:opacity-0 after:transition-opacity group-data-horizontal/tabs:after:inset-x-0 group-data-horizontal/tabs:after:bottom-[-5px] group-data-horizontal/tabs:after:h-0.5 group-data-vertical/tabs:after:inset-y-0 group-data-vertical/tabs:after:-right-1 group-data-vertical/tabs:after:w-0.5 group-data-[variant=line]/tabs-list:data-active:after:opacity-100",
- className
- )}
- {...props}
- />
- )
-}
-
-function TabsContent({ className, ...props }: TabsPrimitive.Panel.Props) {
- return (
- <TabsPrimitive.Panel
- data-slot="tabs-content"
- className={cn("flex-1 text-sm outline-none", className)}
- {...props}
- />
- )
-}
-
-export { Tabs, TabsList, TabsTrigger, TabsContent, tabsListVariants }
diff --git a/site/src/cut/lib/hosts.ts b/site/src/cut/lib/hosts.ts
index beedb9d8..b8c3600b 100644
--- a/site/src/cut/lib/hosts.ts
+++ b/site/src/cut/lib/hosts.ts
@@ -40,19 +40,10 @@ export const OUTREACH_REPLY_HOST = "reply.donkeycut.com";
export const CUT_WORKER_HOST = "worker.donkeycut.com";
export const CUT_WORKER_WAKE_URL = `https://${CUT_WORKER_HOST}/wake`;
-// The super-user surface has its own host: src/proxy.ts maps it onto the
-// routes under /su, so the section's addresses are bare ("/analytics"). It
-// shares the apex's session — auth cookies carry Domain=donkeycut.com (see
-// src/lib/auth.ts) — while sign-in itself stays on the apex.
-//
-// su.localhost is the dev twin, and browsers resolve it to the loopback
-// address without a hosts-file entry. Dev gets the same host split and the
-// same bare addresses as production, so a link that works in one works in the
-// other; serving the section under a /su prefix locally would make every href
-// and every active-tab match host-dependent.
+// The super-user app lives in a private repo on its own host and signs in
+// through donkeycut.com, which trusts it as a callback origin (src/lib/auth.ts).
export const SU_HOST = "su.donkeycut.com";
export const SU_ORIGIN = `https://${SU_HOST}`;
-const SU_HOSTS = new Set([SU_HOST, "su.localhost"]);
// The registrable host the auth cookies are scoped to, so a session started on
// the apex reaches its subdomains.
@@ -72,17 +63,6 @@ export function isDonkeycutHost(host: string | null | undefined): boolean {
return DONKEYCUT_HOSTS.has(hostname(host));
}
-export function isSuHost(host: string | null | undefined): boolean {
- return SU_HOSTS.has(hostname(host));
-}
-
-// The app origin as the super-user surface addresses it. The two always sit on
-// different hosts, so the link back is always absolute. NODE_ENV inlines the
-// same value on the server and in the client bundle, so an href built from it
-// survives hydration.
-export const SU_APP_ORIGIN =
- process.env.NODE_ENV === "production" ? DONKEYCUT_CANONICAL : "http://localhost:3000";
-
// Local dev serves Donkey Cut by default: the proxy gives localhost the same
// "/…" → "/cut/…" mapping as donkeycut.com (see src/proxy.ts).
export function isLocalHost(host: string | null | undefined): boolean {
diff --git a/site/src/hooks/use-mobile.ts b/site/src/hooks/use-mobile.ts
deleted file mode 100644
index cfec8448..00000000
--- a/site/src/hooks/use-mobile.ts
+++ /dev/null
@@ -1,18 +0,0 @@
-import * as React from "react";
-
-const MOBILE_BREAKPOINT = 768;
-const QUERY = `(max-width: ${MOBILE_BREAKPOINT - 1}px)`;
-
-function subscribe(onChange: () => void) {
- const mql = window.matchMedia(QUERY);
- mql.addEventListener("change", onChange);
- return () => mql.removeEventListener("change", onChange);
-}
-
-export function useIsMobile() {
- return React.useSyncExternalStore(
- subscribe,
- () => window.matchMedia(QUERY).matches,
- () => false,
- );
-}
diff --git a/site/src/instrumentation-client.ts b/site/src/instrumentation-client.ts
index 43f5b106..36b7de67 100644
--- a/site/src/instrumentation-client.ts
+++ b/site/src/instrumentation-client.ts
@@ -1,7 +1,5 @@
import posthog from "posthog-js";
-import { isSuHost } from "@/cut/lib/hosts";
-
// Surfaces that composite video onto a canvas every frame never record session
// replay (see app/_components/NoSessionReplay.tsx): the Cut app and the shared
// player, at their public paths and at the /cut/… routes the proxy serves them
@@ -10,12 +8,7 @@ import { isSuHost } from "@/cut/lib/hosts";
// navigation.
const REPLAY_FREE = /^\/(?:cut\/)?(?:app|s)(?:\/|$)/;
-// The super-user host is off for a second reason: every one of its surfaces
-// draws other people's email addresses, credit balances, and outreach state,
-// and a replay would carry all of it to a third party. Its addresses are bare
-// ("/analytics"), so the host is what identifies it.
-const replayFree = () =>
- isSuHost(window.location.host) || REPLAY_FREE.test(window.location.pathname);
+const replayFree = () => REPLAY_FREE.test(window.location.pathname);
// Signed media URLs carry user-id paths and signatures; error messages that
// embed one get it masked before the event leaves the browser.
diff --git a/site/src/lib/analytics/read.ts b/site/src/lib/analytics/read.ts
index 156ef45e..cf887820 100644
--- a/site/src/lib/analytics/read.ts
+++ b/site/src/lib/analytics/read.ts
@@ -1,4 +1,4 @@
-// Server-side access to the stored rollup. The su routes fold it into what a
+// Server-side access to the stored rollup. The analytics routes fold it into what a
// caller asked for — a summary, or one page of people — so the file itself
// never goes over the wire.
import { NextResponse } from "next/server";
diff --git a/site/src/lib/auth.ts b/site/src/lib/auth.ts
index 737ad539..45c2adfb 100644
--- a/site/src/lib/auth.ts
+++ b/site/src/lib/auth.ts
@@ -16,12 +16,12 @@ import { sendVerificationEmail } from "@/lib/email/send-verification";
// it from the localhost request.
const baseURL = process.env.VERCEL ? DONKEYCUT_CANONICAL : undefined;
-// The session is shared with the apex's subdomains: the super-user surface is
-// its own host, and a host-only cookie would never reach it. Scoping the auth
-// cookies to the registrable host lets the session ride across, and listing the
-// subdomain as a trusted origin lets a sign-in started there name its own
-// address as the post-auth callback. Hosted only — localhost can't carry a
-// Domain attribute, and dev serves both surfaces from one origin anyway.
+// The session is shared with the apex's subdomains: the super-user app (a
+// private repo) is its own host, and a host-only cookie would never reach it.
+// Scoping the auth cookies to the registrable host lets the session ride
+// across, and listing the subdomain as a trusted origin lets a sign-in started
+// there name its own address as the post-auth callback. Hosted only —
+// localhost can't carry a Domain attribute.
const crossSubDomain = process.env.VERCEL
? {
advanced: {
diff --git a/site/src/lib/blog/admin.ts b/site/src/lib/blog/admin.ts
deleted file mode 100644
index ff5d7200..00000000
--- a/site/src/lib/blog/admin.ts
+++ /dev/null
@@ -1,69 +0,0 @@
-// The post as the su editor sees it: every column, image URLs resolved, dates
-// as ISO strings. The body rides along only when one post is read.
-import type { BlogPost } from "@/generated/prisma/client";
-
-import { blogImageUrl } from "@/lib/blog/keys";
-import { prisma } from "@/lib/prisma";
-
-export type BlogPostAdmin = {
- id: string;
- slug: string;
- status: "DRAFT" | "PUBLISHED";
- title: string;
- excerpt: string;
- summary: string;
- tags: string[];
- keywords: string[];
- featured: boolean;
- publishedAt: string | null;
- revisedAt: string | null;
- headerKey: string | null;
- headerUrl: string | null;
- headerAlt: string;
- headerFocus: string | null;
- thumbnailKey: string | null;
- thumbnailUrl: string | null;
- thumbnailFocus: string | null;
- seoTitle: string;
- canonicalUrl: string;
- noIndex: boolean;
- bodyVersion: number;
- createdAt: string;
- updatedAt: string;
-};
-
-export type BlogPostAdminWithBody = BlogPostAdmin & { body: string };
-
-export function adminPost(row: BlogPost): BlogPostAdmin {
- return {
- id: row.id,
- slug: row.slug,
- status: row.status,
- title: row.title,
- excerpt: row.excerpt,
- summary: row.summary ?? "",
- tags: row.tags,
- keywords: row.keywords,
- featured: row.featured,
- publishedAt: row.publishedAt?.toISOString() ?? null,
- revisedAt: row.revisedAt?.toISOString() ?? null,
- headerKey: row.headerKey,
- headerUrl: row.headerKey ? blogImageUrl(row.headerKey) : null,
- headerAlt: row.headerAlt ?? "",
- headerFocus: row.headerFocus,
- thumbnailKey: row.thumbnailKey,
- thumbnailUrl: row.thumbnailKey ? blogImageUrl(row.thumbnailKey) : null,
- thumbnailFocus: row.thumbnailFocus,
- seoTitle: row.seoTitle ?? "",
- canonicalUrl: row.canonicalUrl ?? "",
- noIndex: row.noIndex,
- bodyVersion: row.bodyVersion,
- createdAt: row.createdAt.toISOString(),
- updatedAt: row.updatedAt.toISOString(),
- };
-}
-
-export async function listAdminPosts(): Promise<BlogPostAdmin[]> {
- const rows = await prisma.blogPost.findMany({ orderBy: { updatedAt: "desc" } });
- return rows.map(adminPost);
-}
diff --git a/site/src/lib/blog/generate.ts b/site/src/lib/blog/generate.ts
deleted file mode 100644
index 060b57a8..00000000
--- a/site/src/lib/blog/generate.ts
+++ /dev/null
@@ -1,151 +0,0 @@
-// One call fills the details of a post from its article: the search copy, the
-// tags and keywords, the alt text, and a picture for the header and the
-// thumbnail. The text model reads the article and answers with the copy and
-// with a description of the picture; the image model paints that description.
-// The copy comes back for the editor to look over; the picture is stored the
-// way an upload is, so the boxes show it at once.
-import { Modality, type GenerateContentParameters } from "@google/genai";
-import { z } from "zod";
-
-import {
- defaultGeminiClientFactory,
- geminiApiError,
- geminiCandidateParts,
- geminiCandidates,
- geminiClientConfig,
- stringValue,
-} from "@/lib/inference/adapters/gemini-client";
-import { geminiModelRoles } from "@/lib/inference/gemini-models";
-import { isJsonObject, toJsonValue } from "@/lib/inference/json";
-import { InferenceProviderError, type JsonValue } from "@/lib/inference/providers";
-import { BLOG_DESCRIPTION_MAX, BLOG_DESCRIPTION_MIN, BLOG_SEO_TITLE_MAX } from "@/lib/blog/schema";
-
-export const TEXT_MODEL = geminiModelRoles.chat;
-export const IMAGE_MODEL = geminiModelRoles.imageGeneration;
-
-const SITE_SUFFIX = " | Donkey Cut";
-
-export const blogDetailsSchema = z
- .object({
- seoTitle: z.string().trim().max(200),
- excerpt: z.string().trim().max(400),
- summary: z.string().trim().max(400),
- tags: z.array(z.string().trim().min(1).max(80)).max(30),
- keywords: z.array(z.string().trim().min(1).max(80)).max(30),
- headerAlt: z.string().trim().max(400),
- imagePrompt: z.string().trim().min(1).max(4000),
- })
- .strict();
-
-export type BlogDetails = z.infer<typeof blogDetailsSchema>;
-
-const detailsPrompt = (title: string, article: string) =>
- [
- "You write the details of a post on the Donkey Cut blog. Donkey Cut is a video editor that runs in the browser; its readers edit video and want to do it well.",
- "Read the article and answer with JSON of this exact shape, nothing else:",
- JSON.stringify({
- seoTitle: "string",
- excerpt: "string",
- summary: "string",
- tags: ["string"],
- keywords: ["string"],
- headerAlt: "string",
- imagePrompt: "string",
- }),
- `seoTitle: the title as it appears in a search result, at most ${BLOG_SEO_TITLE_MAX - SITE_SUFFIX.length} characters, leading with the words a reader searches for. The site name is added after it.`,
- `excerpt: the meta description under the search result, ${BLOG_DESCRIPTION_MIN} to ${BLOG_DESCRIPTION_MAX} characters, one or two plain sentences saying what the reader gets.`,
- `summary: the answer-first line shown under the title on the page, ${BLOG_DESCRIPTION_MIN} to ${BLOG_DESCRIPTION_MAX} characters, stating the article's point outright.`,
- "tags: three to five lowercase topic words or short phrases the post files under.",
- "keywords: five to ten search phrases the article answers, most specific first.",
- "headerAlt: one sentence describing the header picture for a reader who cannot see it.",
- "imagePrompt: a description of one picture that stands for the article, for an image model: the subject, the scene, the framing. No text, letters, logos or user interface in the picture.",
- "Write plainly. No marketing words, no exclamation marks, no claims the article does not make.",
- `Title: ${title.trim() || "(untitled)"}`,
- "Article:",
- article,
- ].join("\n\n");
-
-const IMAGE_STYLE =
- "Editorial illustration for a blog post, flat shapes, bold ink outlines, a warm cream background, two or three accent colours, generous negative space. No text, letters, logos or user interface.";
-
-function readJson(text: string): unknown {
- const cleaned = text
- .trim()
- .replace(/^```(?:json)?\s*/i, "")
- .replace(/```\s*$/, "")
- .trim();
- try {
- return JSON.parse(cleaned);
- } catch {
- const start = cleaned.indexOf("{");
- const end = cleaned.lastIndexOf("}");
- if (start < 0 || end <= start) return null;
- try {
- return JSON.parse(cleaned.slice(start, end + 1));
- } catch {
- return null;
- }
- }
-}
-
-function client() {
- const config = geminiClientConfig(process.env);
- if (!config.configured) {
- throw new InferenceProviderError("Generation is not configured on this deployment.", { statusCode: 500 });
- }
- return defaultGeminiClientFactory(config.options);
-}
-
-export type Generated<T> = { value: T; usage: JsonValue };
-
-// The copy and the picture description, read off the article.
-export async function generateBlogDetails(title: string, article: string): Promise<Generated<BlogDetails>> {
- let raw: unknown;
- try {
- raw = await client().models.generateContent({
- model: TEXT_MODEL,
- contents: [{ role: "user", parts: [{ text: detailsPrompt(title, article) }] }],
- // JSON mode without a schema; constrained decoding degrades the copy.
- config: { responseMimeType: "application/json" },
- });
- } catch (error) {
- throw geminiApiError("The writing model is unavailable.", error);
- }
- const json = toJsonValue(raw);
- const text = geminiCandidateParts(geminiCandidates(json)[0])
- .map((part) => stringValue(part.text) ?? "")
- .join("");
- const parsed = blogDetailsSchema.safeParse(readJson(text));
- if (!parsed.success) {
- throw new InferenceProviderError("The writing model returned an unreadable answer.", { statusCode: 502 });
- }
- const usage = isJsonObject(json) ? (json.usageMetadata ?? null) : null;
- return { value: parsed.data, usage };
-}
-
-// One picture, wide enough for the header; the thumbnail is a crop of it.
-export async function generateBlogPicture(imagePrompt: string): Promise<Generated<Buffer>> {
- const params: GenerateContentParameters = {
- model: IMAGE_MODEL,
- contents: [{ role: "user", parts: [{ text: `${imagePrompt}\n\n${IMAGE_STYLE}` }] }],
- config: {
- responseModalities: [Modality.IMAGE, Modality.TEXT],
- imageConfig: { aspectRatio: "16:9", imageSize: "2K" },
- },
- };
- let raw: unknown;
- try {
- raw = await client().models.generateContent(params);
- } catch (error) {
- throw geminiApiError("The image model is unavailable.", error);
- }
- const json = toJsonValue(raw);
- for (const candidate of geminiCandidates(json)) {
- for (const part of geminiCandidateParts(candidate)) {
- const inline = part.inlineData ?? part.inline_data;
- const data = isJsonObject(inline) ? stringValue(inline.data) : undefined;
- if (data) return { value: Buffer.from(data, "base64"), usage: { generationCount: 1 } };
- }
- }
- throw new InferenceProviderError("The image model returned no picture.", { statusCode: 502 });
-}
diff --git a/site/src/lib/blog/images.ts b/site/src/lib/blog/images.ts
deleted file mode 100644
index c2ba245f..00000000
--- a/site/src/lib/blog/images.ts
+++ /dev/null
@@ -1,48 +0,0 @@
-// Every image on the blog is encoded here, once, to a fixed format under a
-// width cap, and named by its bytes. The picture keeps its shape: the pages
-// crop the header and the thumbnail to their boxes with the focus the editor
-// set, so anything in the picture can be brought into frame later.
-import { createHash } from "node:crypto";
-import sharp from "sharp";
-
-import { putObject } from "@/cut/server/cloud/r2";
-import { blogImageKey, blogImageUrl } from "@/lib/blog/keys";
-
-export type BlogImageKind = "header" | "thumbnail" | "inline";
-
-export const BLOG_IMAGE_WIDTHS: Record<BlogImageKind, number> = {
- header: 1600,
- thumbnail: 1000,
- inline: 1600,
-};
-
-// AVIF at a quality that keeps a photographic header around 100 KB. The effort
-// stays low because this runs inside a request.
-const AVIF_QUALITY = 55;
-const AVIF_EFFORT = 4;
-
-export type EncodedBlogImage = { bytes: Buffer; width: number; height: number; sha256: string };
-
-export async function encodeBlogImage(source: Buffer, kind: BlogImageKind): Promise<EncodedBlogImage> {
- const { data, info } = await sharp(source, { failOn: "none" })
- .rotate()
- .resize({ width: BLOG_IMAGE_WIDTHS[kind], withoutEnlargement: true })
- .avif({ quality: AVIF_QUALITY, effort: AVIF_EFFORT })
- .toBuffer({ resolveWithObject: true });
- return {
- bytes: data,
- width: info.width,
- height: info.height,
- sha256: createHash("sha256").update(data).digest("hex"),
- };
-}
-
-export type StoredBlogImage = { key: string; url: string; width: number; height: number };
-
-// Encodes and writes the image under its own hash; the caller sets it on the row.
-export async function storeBlogImage(postId: string, source: Buffer, kind: BlogImageKind): Promise<StoredBlogImage> {
- const encoded = await encodeBlogImage(source, kind);
- const key = blogImageKey(postId, encoded.sha256);
- await putObject(key, encoded.bytes, "image/avif");
- return { key, url: blogImageUrl(key), width: encoded.width, height: encoded.height };
-}
diff --git a/site/src/lib/blog/schema.test.ts b/site/src/lib/blog/schema.test.ts
deleted file mode 100644
index 414c0c62..00000000
--- a/site/src/lib/blog/schema.test.ts
+++ /dev/null
@@ -1,50 +0,0 @@
-import { describe, expect, test } from "bun:test";
-
-import { blogSlugSchema, publishIssues, slugFromTitle } from "./schema";
-
-describe("blogSlugSchema", () => {
- test("accepts lowercase hyphenated words", () => {
- expect(blogSlugSchema.safeParse("smooth-slow-motion-2026").success).toBe(true);
- });
-
- test("refuses dots, capitals, doubled hyphens and reserved words", () => {
- for (const slug of ["next.js-tips", "Hello", "a--b", "-lead", "page", ""]) {
- expect(blogSlugSchema.safeParse(slug).success).toBe(false);
- }
- });
-});
-
-describe("slugFromTitle", () => {
- test("hyphenates the words of a title", () => {
- expect(slugFromTitle("Smooth Slow-Mo & RIFE: what changed?")).toBe("smooth-slow-mo-and-rife-what-changed");
- });
-});
-
-describe("publishIssues", () => {
- const ready = {
- title: "A title",
- excerpt: "x".repeat(120),
- summary: null,
- headerKey: "blog/a/b.avif",
- thumbnailKey: "blog/a/c.avif",
- publishedAt: null,
- body: "Hello",
- };
-
- test("a complete post has no issues", () => {
- expect(publishIssues(ready)).toEqual([]);
- });
-
- test("each missing piece is named", () => {
- const paths = publishIssues({
- ...ready,
- title: "",
- excerpt: "short",
- headerKey: null,
- thumbnailKey: null,
- publishedAt: new Date(Date.now() + 86_400_000).toISOString(),
- body: " ",
- }).map((issue) => issue.path);
- expect(paths).toEqual(["title", "excerpt", "header", "thumbnail", "publishedAt", "body"]);
- });
-});
diff --git a/site/src/lib/blog/schema.ts b/site/src/lib/blog/schema.ts
deleted file mode 100644
index 8e686a37..00000000
--- a/site/src/lib/blog/schema.ts
+++ /dev/null
@@ -1,110 +0,0 @@
-// The editor's contract for a post, shared by the su form and the routes.
-// Saving a draft is lenient so a half-written post can be kept; publishing
-// holds the post to the full contract (publishIssues).
-import { z } from "zod";
-
-export const BLOG_TITLE_MAX = 60;
-export const BLOG_DESCRIPTION_MIN = 70;
-export const BLOG_DESCRIPTION_MAX = 155;
-export const BLOG_SEO_TITLE_MAX = 70;
-
-// Words the router owns under /blog.
-const RESERVED_SLUGS = new Set(["page"]);
-
-// Lowercase words joined by single hyphens. No dots: the proxy matcher treats
-// a path with a dot as a file and never rewrites it to the page.
-export const blogSlugSchema = z
- .string()
- .trim()
- .min(1, "A slug is required.")
- .max(200, "Keep the slug under 200 characters.")
- .regex(/^[a-z0-9]+(-[a-z0-9]+)*$/, "Use lowercase letters, digits and single hyphens.")
- .refine((slug) => !RESERVED_SLUGS.has(slug), "That word is reserved.");
-
-const words = z
- .array(z.string().trim().min(1).max(80))
- .max(30)
- .transform((items) => Array.from(new Set(items)));
-
-const isoDate = z
- .string()
- .refine((value) => !Number.isNaN(new Date(value).getTime()), "Not a date.")
- .nullable();
-
-export const blogFocusSchema = z.string().regex(/^\d{1,3}(\.\d+)?% \d{1,3}(\.\d+)?%$/, "Use the form \"50% 50%\".");
-
-export const blogPostInputSchema = z
- .object({
- slug: blogSlugSchema,
- title: z.string().trim().max(200),
- excerpt: z.string().trim().max(400),
- summary: z.string().trim().max(400),
- tags: words,
- keywords: words,
- featured: z.boolean(),
- publishedAt: isoDate,
- revisedAt: isoDate,
- headerAlt: z.string().trim().max(400),
- headerFocus: blogFocusSchema.nullable(),
- thumbnailFocus: blogFocusSchema.nullable(),
- seoTitle: z.string().trim().max(200),
- canonicalUrl: z.union([z.literal(""), z.string().trim().url()]),
- noIndex: z.boolean(),
- body: z.string().max(2_000_000),
- })
- .strict();
-
-export type BlogPostInput = z.infer<typeof blogPostInputSchema>;
-
-export type BlogPublishIssue = { path: string; message: string };
-
-// What a finished post has. The editor lists what is still missing as
-// suggestions; publishing does not wait for them.
-export function publishIssues(post: {
- title: string;
- excerpt: string;
- summary: string | null;
- headerKey: string | null;
- thumbnailKey: string | null;
- publishedAt: string | null;
- body: string;
-}): BlogPublishIssue[] {
- const issues: BlogPublishIssue[] = [];
- const title = post.title.trim();
- if (title.length === 0) issues.push({ path: "title", message: "Give the post a title." });
- else if (title.length > BLOG_TITLE_MAX) {
- issues.push({ path: "title", message: `Keep the title to ${BLOG_TITLE_MAX} characters.` });
- }
- const excerpt = post.excerpt.trim();
- if (excerpt.length < BLOG_DESCRIPTION_MIN || excerpt.length > BLOG_DESCRIPTION_MAX) {
- issues.push({
- path: "excerpt",
- message: `The meta description is ${BLOG_DESCRIPTION_MIN} to ${BLOG_DESCRIPTION_MAX} characters.`,
- });
- }
- const summary = post.summary?.trim() ?? "";
- if (summary.length > 0 && (summary.length < BLOG_DESCRIPTION_MIN || summary.length > BLOG_DESCRIPTION_MAX)) {
- issues.push({
- path: "summary",
- message: `A summary is ${BLOG_DESCRIPTION_MIN} to ${BLOG_DESCRIPTION_MAX} characters, or empty.`,
- });
- }
- if (!post.headerKey) issues.push({ path: "header", message: "Upload a header image." });
- if (!post.thumbnailKey) issues.push({ path: "thumbnail", message: "Upload a thumbnail." });
- if (post.publishedAt && new Date(post.publishedAt).getTime() > Date.now()) {
- issues.push({ path: "publishedAt", message: "The publish date cannot be in the future." });
- }
- if (post.body.trim().length === 0) issues.push({ path: "body", message: "Write the article." });
- return issues;
-}
-
-// The slug a title suggests: the words, lowercased and hyphenated.
-export function slugFromTitle(title: string): string {
- return title
- .toLowerCase()
- .replace(/&/g, " and ")
- .replace(/[^a-z0-9]+/g, "-")
- .replace(/^-+|-+$/g, "")
- .slice(0, 200)
- .replace(/-+$/, "");
-}
diff --git a/site/src/lib/config/experimentList.ts b/site/src/lib/config/experimentList.ts
deleted file mode 100644
index 6958e4ee..00000000
--- a/site/src/lib/config/experimentList.ts
+++ /dev/null
@@ -1,131 +0,0 @@
-import type { Prisma } from "@/generated/prisma/client";
-import { audienceSchema, EVERYONE, type Audience } from "@donkeycut/abexp";
-import { metricSchema, variantSchema, type ExperimentMetric } from "@/lib/config/experiment";
-import type { ExperimentResults } from "@donkeycut/abexp";
-import { prisma } from "@/lib/prisma";
-
-// The experiments list as su draws it: the definition, how many accounts each
-// variant holds and how many were shown it, the rows written by hand, and
-// the last computed results.
-
-const summarySelect = {
- id: true,
- key: true,
- name: true,
- description: true,
- status: true,
- variants: true,
- audience: true,
- percent: true,
- metrics: true,
- results: true,
- resultsAt: true,
- startedAt: true,
- endedAt: true,
- createdAt: true,
- updatedAt: true,
-} satisfies Prisma.ExperimentSelect;
-
-type ExperimentRow = Prisma.ExperimentGetPayload<{ select: typeof summarySelect }>;
-
-export type VariantStats = { key: string; assigned: number; exposed: number };
-
-export type ManualAssignment = { userId: string; email: string; variant: string | null };
-
-export async function experimentSummary(row: ExperimentRow) {
- // Counts come from the database, so an experiment with a hundred thousand
- // accounts costs the same as one with ten; only the rows written by hand
- // are listed, and there are never many.
- const [assigned, exposed, manual] = await Promise.all([
- prisma.experimentAssignment.groupBy({
- by: ["variant"],
- where: { experimentId: row.id, manual: false },
- _count: { _all: true },
- }),
- prisma.experimentAssignment.groupBy({
- by: ["variant"],
- where: { experimentId: row.id, manual: false, exposedAt: { not: null } },
- _count: { _all: true },
- }),
- prisma.experimentAssignment.findMany({
- where: { experimentId: row.id, manual: true },
- select: { userId: true, variant: true, user: { select: { email: true } } },
- }),
- ]);
- const countBy = (rows: { variant: string | null; _count: { _all: number } }[]) =>
- new Map(rows.map((r) => [r.variant, r._count._all]));
- const assignedBy = countBy(assigned);
- const exposedBy = countBy(exposed);
- const variants = variantSchema.array().safeParse(row.variants);
- const stats: VariantStats[] = (variants.success ? variants.data : []).map((variant) => ({
- key: variant.key,
- assigned: assignedBy.get(variant.key) ?? 0,
- exposed: exposedBy.get(variant.key) ?? 0,
- }));
- const overrides: ManualAssignment[] = manual.map((a) => ({
- userId: a.userId,
- email: a.user.email,
- variant: a.variant,
- }));
- const audience = audienceSchema.safeParse(row.audience);
- const metrics = metricSchema.array().safeParse(row.metrics);
- return {
- id: row.id,
- key: row.key,
- name: row.name,
- description: row.description,
- status: row.status,
- variants: variants.success ? variants.data : [],
- audience: (audience.success ? audience.data : EVERYONE) as Audience,
- percent: row.percent,
- metrics: (metrics.success ? metrics.data : []) as ExperimentMetric[],
- results: (row.results as ExperimentResults | null) ?? null,
- resultsAt: row.resultsAt?.toISOString() ?? null,
- startedAt: row.startedAt?.toISOString() ?? null,
- endedAt: row.endedAt?.toISOString() ?? null,
- createdAt: row.createdAt.toISOString(),
- updatedAt: row.updatedAt.toISOString(),
- stats,
- overrides,
- };
-}
-
-
-export type ExperimentSummary = Awaited<ReturnType<typeof experimentSummary>>;
-
-export async function listExperiments() {
- const rows = await prisma.experiment.findMany({
- orderBy: [{ createdAt: "desc" }],
- select: summarySelect,
- });
- return Promise.all(rows.map(experimentSummary));
-}
-
-export async function findExperiment(id: string) {
- return prisma.experiment.findUnique({ where: { id }, select: summarySelect });
-}
-
-export type HoldoutRow = { userId: string; email: string; note: string | null; createdAt: string };
-
-export async function listHoldout(): Promise<HoldoutRow[]> {
- const rows = await prisma.experimentHoldout.findMany({
- orderBy: { createdAt: "desc" },
- select: { userId: true, note: true, createdAt: true, user: { select: { email: true } } },
- });
- return rows.map((r) => ({
- userId: r.userId,
- email: r.user.email,
- note: r.note,
- createdAt: r.createdAt.toISOString(),
- }));
-}
-
-export function invalidResponse(issues: { path: PropertyKey[]; message: string }[]) {
- return Response.json(
- {
- error: "Invalid request",
- issues: issues.map((issue) => ({ message: issue.message, path: issue.path.join(".") })),
- },
- { status: 400 },
- );
-}
diff --git a/site/src/lib/credits/offerKinds.ts b/site/src/lib/credits/offerKinds.ts
index 9a3e97d7..4123dd6c 100644
--- a/site/src/lib/credits/offerKinds.ts
+++ b/site/src/lib/credits/offerKinds.ts
@@ -10,7 +10,6 @@ export const MANUAL_OFFER_KIND = "manual";
// email's scope and the account.
export const PROMOTION_OFFER_KIND = "promotion_email";
export const PROMOTION_SUBSCRIBE_OFFER_KIND = "promotion_subscribe";
-export const PROMOTION_OFFER_KINDS = [PROMOTION_OFFER_KIND, PROMOTION_SUBSCRIBE_OFFER_KIND] as const;
// The subscribe bonus the app opens on its own; landed by subscribing.
export const SUBSCRIBE_BONUS_KIND = "subscribe_bonus";
diff --git a/site/src/lib/credits/offerTerms.ts b/site/src/lib/credits/offerTerms.ts
index f87ffa36..79eb0e1d 100644
--- a/site/src/lib/credits/offerTerms.ts
+++ b/site/src/lib/credits/offerTerms.ts
@@ -3,19 +3,14 @@ import { z } from "zod";
// The terms of a credit offer an email carries, as su writes them: how much,
// what lands it, how long the person has to take it up, and how long the
// credit lives once it lands. A promotion to a segment and an outreach note
-// to one person share these terms, the placeholders that name the offer in
-// the words, and the form that edits them. Client-safe: zod only.
+// to one person share these terms and the placeholders that name the offer in
+// the words. Client-safe: zod only.
// What lands the credit: the claim link in the email, or a Pro subscription
// started inside the claim window.
export const OFFER_CLAIMS = ["link", "subscribe"] as const;
export type OfferClaim = (typeof OFFER_CLAIMS)[number];
-export const OFFER_CLAIM_NAMES: Record<OfferClaim, string> = {
- link: "The claim link",
- subscribe: "Subscribing to Pro",
-};
-
// The button label an email starts with for each claim.
export const OFFER_BUTTON_LABELS: Record<OfferClaim, string> = {
link: "Claim my AI credits",
@@ -33,38 +28,13 @@ export const creditOfferTermsSchema = z
export type CreditOfferTerms = z.infer<typeof creditOfferTermsSchema>;
-// The terms as a draft holds them: the same fields, with a number still to be
-// typed allowed at 0. A send parses the strict terms.
-export const creditOfferDraftSchema = z
- .object({
- dollars: z.number().int().min(0).max(10000),
- claimWindowDays: z.number().int().min(0).max(365),
- expiresAfterDays: z.number().int().min(0).max(3650),
- claim: z.enum(OFFER_CLAIMS).default("link"),
- })
- .strict();
-
/** Stored terms, or null for none. Throws on a row that no longer parses. */
export function creditOfferTermsOf(value: unknown): CreditOfferTerms | null {
return value == null ? null : creditOfferTermsSchema.parse(value);
}
-/** Stored draft terms, or null for none: what a saved draft reads back as. */
-export function creditOfferDraftOf(value: unknown): CreditOfferTerms | null {
- return value == null ? null : creditOfferDraftSchema.parse(value);
-}
-
-/** Stored terms when they parse, else null: what a form loads from a template. */
-export function creditOfferTermsIfValid(value: unknown): CreditOfferTerms | null {
- if (value == null) return null;
- const parsed = creditOfferTermsSchema.safeParse(value);
- return parsed.success ? parsed.data : null;
-}
-
/** What the words of an email with an offer may name: the recipient's own
* claim link, and their last day to claim as people read it. */
export type OfferVars = { claimUrl: string; claimBy: string };
export const OFFER_PLACEHOLDERS = ["claimUrl", "claimBy"] as const satisfies readonly (keyof OfferVars)[];
-
-export const CLAIM_URL_PLACEHOLDER = "{{claimUrl}}";
diff --git a/site/src/lib/credits/offers.test.ts b/site/src/lib/credits/offers.test.ts
index b2d26ca2..c56d02da 100644
--- a/site/src/lib/credits/offers.test.ts
+++ b/site/src/lib/credits/offers.test.ts
@@ -1,12 +1,10 @@
import { describe, expect, test } from "bun:test";
-import { creditOfferOpen, manualOfferClosesAt } from "./offers";
+import { creditOfferOpen } from "./offers";
-describe("a manual credit offer", () => {
- test("closes the claim window a set number of days after the send", () => {
- const sent = new Date("2026-09-07T10:00:00Z");
- const closesAt = manualOfferClosesAt(3, sent);
- expect(closesAt.toISOString()).toBe("2026-09-10T10:00:00.000Z");
+describe("a credit offer", () => {
+ test("stays open until its claim window closes", () => {
+ const closesAt = new Date("2026-09-10T10:00:00Z");
expect(creditOfferOpen({ claimedAt: null, closesAt }, new Date("2026-09-10T09:59:59Z"))).toBe(true);
expect(creditOfferOpen({ claimedAt: null, closesAt }, new Date("2026-09-10T10:00:01Z"))).toBe(false);
});
diff --git a/site/src/lib/credits/offers.ts b/site/src/lib/credits/offers.ts
index 8cd2c74d..d6af2226 100644
--- a/site/src/lib/credits/offers.ts
+++ b/site/src/lib/credits/offers.ts
@@ -2,14 +2,11 @@ import { createHmac, timingSafeEqual } from "node:crypto";
import type { CreditOffer } from "@/generated/prisma/client";
import { CUT_APP_BASE } from "@/cut/lib/appBase";
-import { getGlobalSetting } from "@/lib/config/effective";
import { DONKEYCUT_CANONICAL } from "@/cut/lib/hosts";
import { grantCredits } from "@/lib/credits/inference";
-import { isLinkClaimedKind, MANUAL_OFFER_KIND, promotionOfferKind } from "@/lib/credits/offerKinds";
+import { isLinkClaimedKind, promotionOfferKind } from "@/lib/credits/offerKinds";
import type { CreditOfferTerms, OfferVars } from "@/lib/credits/offerTerms";
import { creditGrantExpiry, formatCreditExpiry } from "@/lib/credits/top-up";
-import { deliverEmail } from "@/lib/email/outbox";
-import { creditsOfferedIdempotencyKey } from "@/lib/email/send-credits-offered";
import { prisma } from "@/lib/prisma";
// Claim links authenticate with an HMAC over the offer id, keyed by a
@@ -45,57 +42,6 @@ export function creditOfferClaimUrl(offerId: string): string {
return `${DONKEYCUT_CANONICAL}${CUT_APP_BASE}?claim=${encodeURIComponent(creditOfferToken(offerId))}`;
}
-/** The last moment a claim link sent now can be used. */
-export function manualOfferClosesAt(claimWindowDays: number, now = new Date()): Date {
- return new Date(now.getTime() + claimWindowDays * 24 * 60 * 60 * 1000);
-}
-
-// Records the offer and emails the claim link. The row comes first so the
-// link can name it, and stays if the send fails: the next attempt with the
-// same recipient, amount and lifetime picks the unsent offer up again, and
-// the send keys on the offer id, so the person gets one link however many
-// times the operator retries. The claim window runs from the send.
-export async function createCreditOffer(input: {
- amountMicros: bigint;
- description?: string;
- expiresAfterDays: number | null;
- offeredByUserId: string;
- user: { email: string; id: string; name: string };
-}) {
- const { claimWindowDays } = await getGlobalSetting("manualCreditOffer");
- const closesAt = manualOfferClosesAt(claimWindowDays);
- const offer =
- (await prisma.creditOffer.findFirst({
- where: {
- amountMicros: input.amountMicros,
- claimedAt: null,
- emailSentAt: null,
- expiresAfterDays: input.expiresAfterDays,
- kind: MANUAL_OFFER_KIND,
- userId: input.user.id,
- },
- })) ??
- (await prisma.creditOffer.create({
- data: {
- amountMicros: input.amountMicros,
- closesAt,
- description: input.description,
- expiresAfterDays: input.expiresAfterDays,
- kind: MANUAL_OFFER_KIND,
- offeredByUserId: input.offeredByUserId,
- userId: input.user.id,
- },
- }));
- await prisma.creditOffer.update({ data: { closesAt }, where: { id: offer.id } });
- const delivery = await deliverEmail({
- idempotencyKey: creditsOfferedIdempotencyKey(offer.id),
- kind: "credit-offer",
- payload: { offerId: offer.id },
- userId: input.user.id,
- });
- return { delivery, offer: await prisma.creditOffer.findUniqueOrThrow({ where: { id: offer.id } }) };
-}
-
export class CreditOfferNotYoursError extends Error {}
// The claim window closed before the link was used.
diff --git a/site/src/lib/credits/top-up.ts b/site/src/lib/credits/top-up.ts
index d63236bf..4b8f5ab1 100644
--- a/site/src/lib/credits/top-up.ts
+++ b/site/src/lib/credits/top-up.ts
@@ -28,15 +28,8 @@ export function dollarsToStripeCents(amountDollars: number): number {
return Math.round(amountDollars * 100);
}
-// How long a grant lives. The su grant form offers these picks beside a custom
-// day count; the grant API and the signup-credits setting cap the count at the
-// same ceiling. null stands for a grant that never expires.
-export const creditGrantExpiryPresets = [
- { label: "1 day", days: 1 },
- { label: "1 week", days: 7 },
- { label: "1 month", days: 30 },
- { label: "1 year", days: 365 },
-] as const;
+// How long a grant lives, capped at the same ceiling everywhere. null stands
+// for a grant that never expires.
export const maxCreditGrantExpiryDays = 3650;
/** The moment a grant made now stops being spendable, or undefined for never. */
diff --git a/site/src/lib/email/outbox.ts b/site/src/lib/email/outbox.ts
index 823d788f..c775985b 100644
--- a/site/src/lib/email/outbox.ts
+++ b/site/src/lib/email/outbox.ts
@@ -125,14 +125,6 @@ export async function scheduleDrain(delaySeconds: number): Promise<void> {
await ensureJob("email-drain", {}, "system", { delaySeconds });
}
-/** Starts a drainer for one kind now, on an operator's say-so. Its own job,
- * so a drainer held back by another kind's budget wait does not stand in
- * for it. */
-export async function drainKindNow(kind: EmailKindId, createdBy: string): Promise<void> {
- const { enqueueJob } = await import("@/lib/jobs/queue");
- await enqueueJob("email-drain", { kind }, createdBy);
-}
-
type DrainableRow = Awaited<ReturnType<typeof prisma.emailSend.findMany>>[number];
async function sendRow(row: DrainableRow, now: Date): Promise<Outcome> {
diff --git a/site/src/lib/email/send-credits-offered.ts b/site/src/lib/email/send-credits-offered.ts
index 5a8ab478..81cbd42e 100644
--- a/site/src/lib/email/send-credits-offered.ts
+++ b/site/src/lib/email/send-credits-offered.ts
@@ -15,10 +15,6 @@ export function describeCreditLifetime(days: number | null): string | null {
return days === 1 ? "a day" : `${days} days`;
}
-export function creditsOfferedIdempotencyKey(offerId: string): string {
- return `credits-offered:${offerId}`;
-}
-
// Tells the account credit is waiting and hands it the claim link. Credit
// given by hand is account mail, so it goes whatever the marketing choice;
// the footer still offers the opt-out.
diff --git a/site/src/lib/jobs/queue.ts b/site/src/lib/jobs/queue.ts
index 75226a2f..6d752a90 100644
--- a/site/src/lib/jobs/queue.ts
+++ b/site/src/lib/jobs/queue.ts
@@ -11,19 +11,12 @@ import { JobDeferred, JobFailure, jobKinds } from "@/lib/jobs/registry";
import { prisma } from "@/lib/prisma";
const JOBS_QUEUE_NAME = "donkey-jobs";
-// A queued job untouched this long has likely lost its message (a failed
-// publish, a dropped delivery) — the status poll re-publishes. Double delivery
-// is safe: execution claims the row atomically.
-const STALE_QUEUED_MS = 30_000;
// A running job untouched this long is a crashed or killed execution. The
-// claim treats such a row as reclaimable so a queue retry can run it again,
-// and the status poll surfaces it as an error instead of spinning forever.
+// claim treats such a row as reclaimable so a queue retry can run it again.
const STALE_RUNNING_MS = 15 * 60_000;
// The longest the queue will hold a message before delivery.
const MAX_QUEUE_DELAY_S = 12 * 60 * 60;
-type JobRow = NonNullable<Awaited<ReturnType<typeof prisma.asyncJob.findUnique>>>;
-
// --- Queue publish (Cloudflare Queues REST API; producers outside Workers
// publish over HTTP). The queue id is looked up from the name once per
// process. Missing credentials mean no queue (local dev): the request then
@@ -121,36 +114,6 @@ export async function ensureJob(
return { jobId: pending.id };
}
-/** Self-heal one polled row: a stale queued job re-publishes its message, and
- * a stale running job (crashed execution) becomes an error instead of spinning
- * the poller forever. A job held back until later is left to its delayed
- * message. Returns the row, refreshed when it changed. */
-export async function healJob(job: JobRow): Promise<JobRow> {
- const idleMs = Date.now() - job.updatedAt.getTime();
- const held = job.notBefore !== null && job.notBefore.getTime() > Date.now();
- if (job.state === "queued" && idleMs > STALE_QUEUED_MS && !held) {
- await publishJob(job.id);
- } else if (job.state === "running" && idleMs > STALE_RUNNING_MS) {
- await prisma.asyncJob.updateMany({
- where: { id: job.id, state: "running" },
- data: { state: "error", error: "The job stalled — try again." },
- });
- return (await prisma.asyncJob.findUnique({ where: { id: job.id } })) ?? job;
- }
- return job;
-}
-
-/** Report a job's state (healed first — see healJob). */
-export async function jobStatusResponse(job: JobRow): Promise<Response> {
- job = await healJob(job);
- return NextResponse.json({
- kind: job.kind,
- state: job.state,
- result: job.result ?? undefined,
- error: job.error ?? undefined,
- });
-}
-
/** Execute one job (called by the queue consumer through /api/jobs/worker).
* A 200 consumes the message (including permanent failures, which land on the
* job row); a 500 releases the claim and lets the queue retry. A deferral
diff --git a/site/src/lib/marketing/campaigns.ts b/site/src/lib/marketing/campaigns.ts
index c0d0dbbc..f9f6af32 100644
--- a/site/src/lib/marketing/campaigns.ts
+++ b/site/src/lib/marketing/campaigns.ts
@@ -54,28 +54,3 @@ export const OUTREACH_REASONS = [
export type OutreachReason = (typeof OUTREACH_REASONS)[number];
-export const OUTREACH_REASON_LABELS: Record<OutreachReason, string> = {
- canceled: "Canceled Pro",
- canceling: "Canceling Pro",
- no_credits: "Out of credits",
- past_due: "Payment past due",
- payment_failed: "Payment declined",
- picked: "Added by hand",
- spent: "Spending credits",
- storage: "Holding media",
- storage_full: "Storage full",
-};
-
-/** The reasons that are a wall the person ran into, shown in the warning tone. */
-export const OUTREACH_WALL_REASONS: readonly OutreachReason[] = [
- "no_credits",
- "storage_full",
- "payment_failed",
- "past_due",
- "canceling",
- "canceled",
-];
-
-export const OUTREACH_STATUSES = ["todo", "sent", "replied", "ignored"] as const;
-
-export type OutreachStatus = (typeof OUTREACH_STATUSES)[number];
diff --git a/site/src/lib/marketing/placeholders.ts b/site/src/lib/marketing/placeholders.ts
index 5badd6ce..62e56e1b 100644
--- a/site/src/lib/marketing/placeholders.ts
+++ b/site/src/lib/marketing/placeholders.ts
@@ -4,11 +4,6 @@ import { OFFER_PLACEHOLDERS, type OfferVars } from "@/lib/credits/offerTerms";
// templates and hand-typed notes go through the same fill, so a placeholder
// means the same thing either way.
-/** Whether a placeholder names the offer, so a note without one can say so. */
-export function isOfferPlaceholder(name: string): boolean {
- return (OFFER_PLACEHOLDERS as readonly string[]).includes(name);
-}
-
/** The values a placeholder resolves to, for one recipient. */
export type OutreachVars = {
/** First word of the account name. */
diff --git a/site/src/lib/marketing/promotionInput.ts b/site/src/lib/marketing/promotionInput.ts
index d4346423..17ac6ad6 100644
--- a/site/src/lib/marketing/promotionInput.ts
+++ b/site/src/lib/marketing/promotionInput.ts
@@ -1,93 +1,8 @@
-import { audienceSchema, type Audience } from "@donkeycut/abexp";
-import { z } from "zod";
-import {
- CLAIM_URL_PLACEHOLDER,
- creditOfferDraftSchema,
- creditOfferTermsSchema,
- type CreditOfferTerms,
-} from "@/lib/credits/offerTerms";
-
-// The shape of a promotion as su writes it and the routes validate it. A
-// draft saves whatever the row can hold, so work in progress is never lost;
-// a test or a send parses the strict shape first. Client-safe: zod only, so
-// the dialog parses the same schemas the server does.
+// The names a promotion row holds.
export const PROMOTION_SENDERS = ["bulk", "personal"] as const;
export type PromotionSender = (typeof PROMOTION_SENDERS)[number];
-// "queuing" while a job reads the segment into outbox rows; "sending" once
-// every recipient is queued, so the drainer can finish it.
-export const PROMOTION_STATUSES = ["draft", "queuing", "sending", "paused", "sent"] as const;
-
-export type PromotionStatus = (typeof PROMOTION_STATUSES)[number];
-
-export const promotionDraftSchema = z
- .object({
- name: z.string().trim().max(80),
- subject: z.string().trim().max(200),
- body: z.string().trim().max(10_000),
- ctaLabel: z.string().trim().max(80).nullable(),
- ctaUrl: z.string().trim().max(2000).nullable(),
- creditOffer: creditOfferDraftSchema.nullable().default(null),
- sender: z.enum(PROMOTION_SENDERS),
- audience: audienceSchema,
- excludePromotionIds: z.array(z.string().min(1)).max(100),
- })
- .strict();
-
-export type PromotionDraftInput = z.output<typeof promotionDraftSchema>;
-
-export const promotionInputSchema = z
- .object({
- name: z.string().trim().min(1).max(80),
- subject: z.string().trim().min(1).max(200),
- body: z.string().trim().min(1).max(10_000),
- ctaLabel: z.string().trim().min(1).max(80).nullable(),
- ctaUrl: z
- .union([
- z.literal(CLAIM_URL_PLACEHOLDER),
- z.url({ protocol: /^https?$/, error: "Use an HTTP or HTTPS link." }).max(2000),
- ])
- .nullable(),
- creditOffer: creditOfferTermsSchema.nullable().default(null),
- sender: z.enum(PROMOTION_SENDERS),
- audience: audienceSchema,
- // Earlier promotions whose recipients are left out.
- excludePromotionIds: z.array(z.string().min(1)).max(100),
- })
- .strict()
- .refine((d) => (d.creditOffer !== null) === (d.ctaUrl === CLAIM_URL_PLACEHOLDER), {
- message: "A credit offer needs a claim button. Set its link to {{claimUrl}}.",
- path: ["ctaUrl"],
- })
- .refine((d) => (d.ctaLabel === null) === (d.ctaUrl === null), {
- message: "A button needs both a label and a link.",
- path: ["ctaLabel"],
- });
-
-export type PromotionInput = z.output<typeof promotionInputSchema>;
-
-export type PromotionSummary = {
- creditOffer: CreditOfferTerms | null;
- id: string;
- name: string;
- subject: string;
- body: string;
- ctaLabel: string | null;
- ctaUrl: string | null;
- sender: PromotionSender;
- audience: Audience;
- excludePromotionIds: string[];
- status: PromotionStatus;
- startedAt: string | null;
- finishedAt: string | null;
- createdAt: string;
- updatedAt: string;
- // Recipients queued, sent, failed, and what came of it: buttons followed,
- // credit offers claimed.
- counts: { recipients: number; sent: number; failed: number; clicked: number; claimed: number };
-};
-
// What a segment resolves to before anything is sent.
export type SegmentCount = {
recipients: number;
diff --git a/site/src/lib/marketing/promotionSave.ts b/site/src/lib/marketing/promotionSave.ts
deleted file mode 100644
index 78dfb9cc..00000000
--- a/site/src/lib/marketing/promotionSave.ts
+++ /dev/null
@@ -1,69 +0,0 @@
-import { Prisma } from "@/generated/prisma/client";
-import { invalidResponse } from "@/lib/config/experimentList";
-import { UnknownPlaceholderError } from "@/lib/marketing/placeholders";
-import { renderPromotion, SAMPLE_RECIPIENT } from "@/lib/marketing/promotionCopy";
-import {
- promotionInputSchema,
- type PromotionDraftInput,
- type PromotionInput,
-} from "@/lib/marketing/promotionInput";
-
-// What a save of a promotion shares between create and edit: the row data a
-// draft maps to. What a test or a send checks first: the stored row parsed as
-// a complete promotion, and its copy rendered for a stand-in recipient, so a
-// blank field or a placeholder typo comes back to the form and never reaches
-// a mailbox. The claim link and its last day are minted per person at the
-// send, so the check fills them blank.
-
-export function copyIssue(input: PromotionInput): Response | null {
- try {
- renderPromotion(input, SAMPLE_RECIPIENT, input.creditOffer ? { claimUrl: "", claimBy: "" } : undefined);
- return null;
- } catch (error) {
- if (error instanceof UnknownPlaceholderError) {
- return invalidResponse([{ path: ["body"], message: error.message }]);
- }
- throw error;
- }
-}
-
-export function sendIssue(row: {
- name: string;
- subject: string;
- body: string;
- ctaLabel: string | null;
- ctaUrl: string | null;
- creditOffer: Prisma.JsonValue;
- sender: string;
- audience: Prisma.JsonValue;
- excludePromotionIds: string[];
-}): Response | null {
- const parsed = promotionInputSchema.safeParse({
- name: row.name,
- subject: row.subject,
- body: row.body,
- ctaLabel: row.ctaLabel,
- ctaUrl: row.ctaUrl,
- creditOffer: row.creditOffer,
- sender: row.sender,
- audience: row.audience,
- excludePromotionIds: row.excludePromotionIds,
- });
- if (!parsed.success) return invalidResponse(parsed.error.issues);
- return copyIssue(parsed.data);
-}
-
-export function promotionData(input: PromotionDraftInput, actorUserId: string) {
- return {
- actorUserId,
- creditOffer: input.creditOffer ? (input.creditOffer as Prisma.InputJsonValue) : Prisma.DbNull,
- audience: input.audience as Prisma.InputJsonValue,
- body: input.body,
- ctaLabel: input.ctaLabel,
- ctaUrl: input.ctaUrl,
- excludePromotionIds: input.excludePromotionIds,
- name: input.name,
- sender: input.sender,
- subject: input.subject,
- };
-}
diff --git a/site/src/lib/marketing/promotions.ts b/site/src/lib/marketing/promotions.ts
index e43bda05..12c1fc3f 100644
--- a/site/src/lib/marketing/promotions.ts
+++ b/site/src/lib/marketing/promotions.ts
@@ -10,19 +10,14 @@ import { unsubscribeActionUrl, unsubscribePageUrl } from "@/lib/email/unsubscrib
import { renderPromotion, type PromotionCopy } from "@/lib/marketing/promotionCopy";
import {
PROMOTION_SENDERS,
- PROMOTION_STATUSES,
type PromotionSender,
- type PromotionStatus,
- type PromotionSummary,
type SegmentCount,
} from "@/lib/marketing/promotionInput";
import { prisma } from "@/lib/prisma";
-import { PROMOTION_OFFER_KINDS } from "@/lib/credits/offerKinds";
import type { OfferVars } from "@/lib/credits/offerTerms";
-import { creditOfferDraftOf } from "@/lib/credits/offerTerms";
// Promotions on the server: which address each sender is, who a segment
-// resolves to, one send, and the list su reads.
+// resolves to, and one send.
/** The address each sender name stands for. Empty when unconfigured. */
export function promotionSenders(): Record<PromotionSender, string> {
@@ -30,18 +25,12 @@ export function promotionSenders(): Record<PromotionSender, string> {
}
const isSender = (s: string): s is PromotionSender => (PROMOTION_SENDERS as readonly string[]).includes(s);
-const isStatus = (s: string): s is PromotionStatus => (PROMOTION_STATUSES as readonly string[]).includes(s);
function senderOf(value: string): PromotionSender {
if (!isSender(value)) throw new Error(`Unknown promotion sender "${value}".`);
return value;
}
-function statusOf(value: string): PromotionStatus {
- if (!isStatus(value)) throw new Error(`Unknown promotion status "${value}".`);
- return value;
-}
-
export function promotionCopyOf(row: {
subject: string;
body: string;
@@ -185,71 +174,3 @@ export async function resolvePromotionSegment(
}
return result;
}
-
-type PromotionRow = NonNullable<Awaited<ReturnType<typeof prisma.promotion.findUnique>>>;
-
-function summarize(row: PromotionRow, counts: PromotionSummary["counts"]): PromotionSummary {
- return {
- id: row.id,
- creditOffer: creditOfferDraftOf(row.creditOffer),
- name: row.name,
- subject: row.subject,
- body: row.body,
- ctaLabel: row.ctaLabel,
- ctaUrl: row.ctaUrl,
- sender: senderOf(row.sender),
- audience: promotionAudienceOf(row.audience),
- excludePromotionIds: row.excludePromotionIds,
- status: statusOf(row.status),
- startedAt: row.startedAt?.toISOString() ?? null,
- finishedAt: row.finishedAt?.toISOString() ?? null,
- createdAt: row.createdAt.toISOString(),
- updatedAt: row.updatedAt.toISOString(),
- counts,
- };
-}
-
-/** Every promotion, newest first, with how far its send got and what came
- * of it: buttons followed, and credit offers claimed. */
-export async function listPromotions(): Promise<PromotionSummary[]> {
- const [rows, all, sent, failed, clicked, claimedOffers] = await Promise.all([
- prisma.promotion.findMany({ orderBy: { createdAt: "desc" } }),
- prisma.emailSend.groupBy({ _count: true, by: ["promotionId"], where: { promotionId: { not: null } } }),
- prisma.emailSend.groupBy({ _count: true, by: ["promotionId"], where: { promotionId: { not: null }, state: "sent" } }),
- prisma.emailSend.groupBy({
- _count: true,
- by: ["promotionId"],
- where: { promotionId: { not: null }, state: { in: ["failed", "skipped"] } },
- }),
- prisma.emailSend.groupBy({
- _count: true,
- by: ["promotionId"],
- where: { clickedAt: { not: null }, promotionId: { not: null } },
- }),
- // A promotion's offers are keyed `${promotionId}:${userId}`.
- prisma.creditOffer.findMany({
- select: { id: true },
- where: { claimedAt: { not: null }, kind: { in: [...PROMOTION_OFFER_KINDS] } },
- }),
- ]);
- const countOf = (groups: { promotionId: string | null; _count: number }[]) =>
- new Map(groups.flatMap((g) => (g.promotionId ? [[g.promotionId, g._count] as const] : [])));
- const recipients = countOf(all);
- const sentBy = countOf(sent);
- const failedBy = countOf(failed);
- const clickedBy = countOf(clicked);
- const claimedBy = new Map<string, number>();
- for (const offer of claimedOffers) {
- const promotionId = offer.id.slice(0, offer.id.indexOf(":"));
- claimedBy.set(promotionId, (claimedBy.get(promotionId) ?? 0) + 1);
- }
- return rows.map((row) =>
- summarize(row, {
- recipients: recipients.get(row.id) ?? 0,
- sent: sentBy.get(row.id) ?? 0,
- failed: failedBy.get(row.id) ?? 0,
- clicked: clickedBy.get(row.id) ?? 0,
- claimed: claimedBy.get(row.id) ?? 0,
- }),
- );
-}
diff --git a/site/src/lib/marketing/send-outreach.ts b/site/src/lib/marketing/send-outreach.ts
index 6363ebd0..55a51427 100644
--- a/site/src/lib/marketing/send-outreach.ts
+++ b/site/src/lib/marketing/send-outreach.ts
@@ -42,10 +42,6 @@ export const outreachPayloadSchema = z
export type OutreachPayload = z.output<typeof outreachPayloadSchema>;
-export function outreachIdempotencyKey(outreachId: string, attempt: number): string {
- return `outreach:${outreachId}:${attempt}`;
-}
-
// Every note carries a plain-text version, including its optional opt-out footer.
function outreachText(body: string, unsubscribeUrl: string | null): string {
const trimmed = body.trim();
diff --git a/site/src/lib/marketing/userHistory.ts b/site/src/lib/marketing/userHistory.ts
deleted file mode 100644
index 313b7f60..00000000
--- a/site/src/lib/marketing/userHistory.ts
+++ /dev/null
@@ -1,161 +0,0 @@
-import { creditMicrosToString } from "@/lib/credits/amounts";
-import { PROMOTION_OFFER_KINDS } from "@/lib/credits/offerKinds";
-import { prisma } from "@/lib/prisma";
-
-// One account's money and mail, as an operator reads it before writing to
-// the person: every credit offer with when it reached them and when it was
-// claimed, every grant that landed (the signup bonus among them), every
-// email the site sent them, and the storage they hold. Each list is one
-// indexed read bounded by the account, so the whole answer is a handful of
-// small queries however large the tables grow.
-
-export type UserHistoryPromotion = { id: string; name: string; subject: string };
-
-export type UserHistoryOffer = {
- id: string;
- kind: string;
- promotion: UserHistoryPromotion | null;
- dollars: string;
- description: string | null;
- createdAt: string;
- emailSentAt: string | null;
- closesAt: string | null;
- claimedAt: string | null;
-};
-
-export type UserHistoryGrant = {
- id: string;
- source: string;
- dollars: string;
- remainingDollars: string;
- status: string;
- description: string | null;
- createdAt: string;
- expiresAt: string | null;
-};
-
-export type UserHistoryEmail = {
- id: string;
- kind: string;
- promotion: UserHistoryPromotion | null;
- // The credit offer this email carried, when it carried one.
- offerId: string | null;
- subject: string | null;
- sentAt: string;
- clickedAt: string | null;
-};
-
-export type UserHistory = {
- storageBytes: string;
- offers: UserHistoryOffer[];
- grants: UserHistoryGrant[];
- emails: UserHistoryEmail[];
-};
-
-// The mail a person can be said to have received: tests go to the operator
-// and a forwarded reply is the person's own words coming back.
-const RECEIVED_EMAIL_KINDS = ["promotion", "promotion-hand", "outreach", "credit-offer", "credit-expiry", "welcome"];
-
-const EMAIL_CAP = 100;
-
-// A promotion's offer is keyed on the promotion and the account, so the
-// promotion is the id's first half.
-function promotionIdOfOffer(offer: { id: string; kind: string }): string | null {
- if (!(PROMOTION_OFFER_KINDS as readonly string[]).includes(offer.kind)) return null;
- const at = offer.id.indexOf(":");
- return at > 0 ? offer.id.slice(0, at) : null;
-}
-
-const iso = (d: Date | null) => (d ? d.toISOString() : null);
-
-export async function readUserHistory(userId: string): Promise<UserHistory> {
- const [offers, grants, emails, storage] = await Promise.all([
- prisma.creditOffer.findMany({
- orderBy: { createdAt: "desc" },
- where: { userId },
- }),
- prisma.userCreditGrant.findMany({
- orderBy: { createdAt: "desc" },
- where: { userId },
- }),
- prisma.emailSend.findMany({
- orderBy: { sentAt: "desc" },
- select: {
- clickedAt: true,
- id: true,
- kind: true,
- payload: true,
- promotionId: true,
- sentAt: true,
- },
- take: EMAIL_CAP,
- where: { kind: { in: RECEIVED_EMAIL_KINDS }, state: "sent", userId },
- }),
- prisma.cutStorageUsage.findUnique({ select: { bytes: true }, where: { userId } }),
- ]);
-
- // The promotions behind offers and emails, read once for all of them.
- const promotionIds = new Set<string>();
- for (const offer of offers) {
- const id = promotionIdOfOffer(offer);
- if (id) promotionIds.add(id);
- }
- for (const email of emails) if (email.promotionId) promotionIds.add(email.promotionId);
- const promotions = new Map<string, UserHistoryPromotion>();
- if (promotionIds.size > 0) {
- const rows = await prisma.promotion.findMany({
- select: { id: true, name: true, subject: true },
- where: { id: { in: [...promotionIds] } },
- });
- for (const row of rows) promotions.set(row.id, row);
- }
- const promotionOf = (id: string | null) => (id ? (promotions.get(id) ?? null) : null);
-
- return {
- storageBytes: (storage?.bytes ?? BigInt(0)).toString(),
- offers: offers.map((offer) => ({
- id: offer.id,
- kind: offer.kind,
- promotion: promotionOf(promotionIdOfOffer(offer)),
- dollars: creditMicrosToString(offer.amountMicros),
- description: offer.description,
- createdAt: offer.createdAt.toISOString(),
- emailSentAt: iso(offer.emailSentAt),
- closesAt: iso(offer.closesAt),
- claimedAt: iso(offer.claimedAt),
- })),
- grants: grants.map((grant) => ({
- id: grant.id,
- source: grant.source,
- dollars: creditMicrosToString(grant.originalAmountMicros),
- remainingDollars: creditMicrosToString(grant.remainingAmountMicros),
- status: grant.status,
- description: grant.description,
- createdAt: grant.createdAt.toISOString(),
- expiresAt: iso(grant.expiresAt),
- })),
- emails: emails.flatMap((email) => {
- if (!email.sentAt) return [];
- const payload = email.payload as { offerId?: unknown; subject?: unknown } | null;
- const subject = typeof payload?.subject === "string" ? payload.subject : null;
- // A promotion's email and its offer share the promotion; a credit
- // offer's email names the offer.
- const offerId = email.promotionId
- ? (offers.find((offer) => promotionIdOfOffer(offer) === email.promotionId)?.id ?? null)
- : typeof payload?.offerId === "string"
- ? payload.offerId
- : null;
- return [
- {
- id: email.id,
- kind: email.kind,
- promotion: promotionOf(email.promotionId),
- offerId,
- subject,
- sentAt: email.sentAt.toISOString(),
- clickedAt: iso(email.clickedAt),
- },
- ];
- }),
- };
-}
diff --git a/site/src/proxy.ts b/site/src/proxy.ts
index 3e03ecc6..7b262282 100644
--- a/site/src/proxy.ts
+++ b/site/src/proxy.ts
@@ -1,14 +1,7 @@
import { NextResponse, type NextRequest } from "next/server";
import { allowedOrigin, corsHeaders, preflightHeaders } from "@/cut/server/cors";
-import {
- DONKEYCUT_CANONICAL,
- SU_APP_ORIGIN,
- SU_ORIGIN,
- isDonkeycutHost,
- isSuHost,
-} from "@/cut/lib/hosts";
-import { suSectionHome } from "@/app/su/nav";
+import { DONKEYCUT_CANONICAL, isDonkeycutHost } from "@/cut/lib/hosts";
// Cut (the video editor, publicly "Donkey Cut") lives under /cut in this single
// site app: the marketing landing at /cut and the app under /cut/app. The
@@ -17,10 +10,6 @@ import { suSectionHome } from "@/app/su/nav";
// host. The auth pages (/sign-in, /sign-up), "/install", and the legal pages
// are real root-level routes and pass through the rewrite.
//
-// su.donkeycut.com is the second surface this file routes: the super-user
-// section under /su, served at bare addresses ("/analytics") on that host
-// alone. It shares the deployment and its /api handlers, and it shares the
-// session, because auth cookies are scoped to donkeycut.com (src/lib/auth.ts).
// www. 308s to the apex; retired domains redirect to donkeycut.com at the
// edge (Cloudflare) and never reach this app.
//
@@ -81,97 +70,12 @@ const underPath = (pathname: string, prefix: string) =>
const passesThrough = (pathname: string) =>
PASSTHROUGH.some((p) => underPath(pathname, p));
-// The super-user host serves one section and nothing else: /su/… for pages,
-// the shared /api handlers for their data.
-//
-// The role gate lives here, ahead of the route. A page's document preloads
-// the client code of every segment on its path whether or not that segment
-// renders, so a gate inside the route tree would still hand the section's
-// bundle — the charts, the tables, the shell — to whoever asked for the
-// address. Here the proxy asks the account route who is calling (the session
-// cookie is scoped to the apex, so it reads the same on this host) and only a
-// super user reaches a page; everyone else gets a redirect and no document.
-// Sign-in lives on the app's host, so a signed-out visitor leaves for it with
-// this address as the post-auth callback, and a signed-in visitor without the
-// role is sent to the app. The routes the pages call are withSuperUser and
-// enforce the role again on every request.
-//
-// Nothing here belongs in a search index, so every page response carries the
-// header that says so.
-const SU_ROOT = "/su";
-
-// The gate's answer is held per cookie for a short while. A page visit is
-// several requests — the document, then the router's prefetch of every page
-// on the rail, each a handful of segment fetches — and every one of them
-// passed through the gate, so a visit cost dozens of session lookups and
-// each prefetch waited on one. The hold is short because the answer decides
-// who is served the section's code; the data routes check the role on every
-// request regardless.
-const GATE_HOLD_MS = 30_000;
-const GATE_HOLD_MAX = 256;
-const gateHeld = new Map<string, { superUser: boolean; until: number }>();
-
-async function gateAnswer(cookie: string): Promise<{ status: number; superUser: boolean }> {
- const held = gateHeld.get(cookie);
- if (held && held.until > Date.now()) return { status: 200, superUser: held.superUser };
- const account = await fetch(`${SU_APP_ORIGIN}/api/account/me`, {
- cache: "no-store",
- headers: { cookie },
- });
- if (!account.ok) return { status: account.status, superUser: false };
- const { superUser } = (await account.json()) as { superUser: boolean };
- if (cookie) {
- if (gateHeld.size >= GATE_HOLD_MAX) gateHeld.delete(gateHeld.keys().next().value!);
- gateHeld.set(cookie, { superUser: superUser === true, until: Date.now() + GATE_HOLD_MS });
- }
- return { status: 200, superUser: superUser === true };
-}
-
-async function suHost(req: NextRequest, pathname: string): Promise<NextResponse> {
- if (underPath(pathname, "/api")) return NextResponse.next();
-
- // The host root and a section address open a page, answered here so no
- // page ever renders a redirect. One thrown from a page reaches the browser
- // as a meta tag behind the streamed shell, and the page's slot paints empty
- // until the router follows it.
- const home = suSectionHome(pathname);
- if (home) {
- const url = new URL(req.url);
- url.pathname = home;
- return NextResponse.redirect(url, 307);
- }
-
- const account = await gateAnswer(req.headers.get("cookie") ?? "");
- if (account.status === 401) {
- // The callback has to carry the exact origin sign-in trusts (src/lib/auth.ts),
- // so hosted names it from the constant; dev's su.localhost is plain http on
- // whatever host the browser asked for.
- const origin = HOSTED ? SU_ORIGIN : `http://${req.headers.get("host")}`;
- const here = `${origin}${pathname}${req.nextUrl.search}`;
- return NextResponse.redirect(
- `${SU_APP_ORIGIN}/sign-in?callbackURL=${encodeURIComponent(here)}`,
- );
- }
- if (account.status !== 200) {
- return new NextResponse("The super-user gate is unavailable.", { status: 503 });
- }
- if (!account.superUser) return NextResponse.redirect(`${SU_APP_ORIGIN}/app`);
-
- const url = new URL(req.url);
- url.pathname = `${SU_ROOT}${pathname === "/" ? "" : pathname}`;
- const res = NextResponse.rewrite(url);
- res.headers.set("X-Robots-Tag", "noindex, nofollow");
- return res;
-}
-
export function proxy(req: NextRequest) {
const { pathname } = req.nextUrl;
if (isCutApi(pathname)) return cutApi(req);
const host = req.headers.get("host");
- if (isSuHost(host)) return suHost(req, pathname);
-
// Aliases (www.) canonicalize to the apex.
if (isDonkeycutHost(host) && host?.split(":")[0] !== "donkeycut.com") {
const url = new URL(req.url);
diff --git a/site/src/queries/analytics.ts b/site/src/queries/analytics.ts
deleted file mode 100644
index 10ccb447..00000000
--- a/site/src/queries/analytics.ts
+++ /dev/null
@@ -1,97 +0,0 @@
-"use client";
-
-import {
- infiniteQueryOptions,
- queryOptions,
- useInfiniteQuery,
- useMutation,
- useQuery,
- useQueryClient,
-} from "@tanstack/react-query";
-import { useEffect } from "react";
-
-import type { AnalyticsUsersPage, UserSort } from "@/lib/analytics/rank";
-import type { AnalyticsSummary } from "@/lib/analytics/summarize";
-import { apiFetch } from "@/queries/apiClient";
-import type { AsyncJobStatus } from "@/queries/jobs";
-
-export const analyticsQueryKey = ["analytics"] as const;
-export const analyticsSummaryQueryKey = [...analyticsQueryKey, "summary"] as const;
-
-// Super-user only: the nightly job's numbers, without the account table. It
-// changes once a night, and a manual run invalidates it, so a copy in memory
-// stays good for the session.
-const analyticsSummaryQuery = queryOptions({
- queryFn: () => apiFetch<AnalyticsSummary>("/api/analytics/summary"),
- queryKey: analyticsSummaryQueryKey,
- staleTime: 60 * 60_000,
-});
-
-export function useAnalyticsSummary() {
- return useQuery(analyticsSummaryQuery);
-}
-
-// Pulls the summary as soon as the super-user shell mounts, so the Product tab
-// paints from memory when it opens.
-export function useWarmAnalyticsSummary() {
- const queryClient = useQueryClient();
- useEffect(() => {
- void queryClient.prefetchQuery(analyticsSummaryQuery);
- }, [queryClient]);
-}
-
-// Accounts in rank order, a page at a time: ask for the first page, then
-// follow the cursor the server hands back — the phone reads the same endpoint
-// the same way, and the page size stays the server's to set. Ranks hold only
-// within one rollup, so the rollup's stamp is part of the key: a fresh rollup
-// is a fresh list rather than pages from two different orders stitched
-// together.
-function analyticsUsersQuery(sort: UserSort, generatedAt: string) {
- return infiniteQueryOptions({
- getNextPageParam: (page: AnalyticsUsersPage) => page.nextCursor,
- initialPageParam: 0,
- queryFn: ({ pageParam }) =>
- apiFetch<AnalyticsUsersPage>(`/api/analytics/users?sort=${sort}&cursor=${pageParam}`),
- queryKey: [...analyticsQueryKey, "users", generatedAt, sort] as const,
- staleTime: 60 * 60_000,
- });
-}
-
-export function useAnalyticsUsers(sort: UserSort, generatedAt: string) {
- return useInfiniteQuery(analyticsUsersQuery(sort, generatedAt));
-}
-
-/** One account's row, for a panel that opens on a single person. */
-export function useAnalyticsUser(userId: string) {
- return useQuery({
- queryFn: async () => {
- const page = await apiFetch<AnalyticsUsersPage>(
- `/api/analytics/users?id=${encodeURIComponent(userId)}`,
- );
- return page.users[0] ?? null;
- },
- queryKey: [...analyticsQueryKey, "user", userId] as const,
- staleTime: 60 * 60_000,
- });
-}
-
-// Super-user only: run the analytics-daily job now and follow it to
-// completion, then refetch what the dashboard shows.
-export function useRunAnalytics() {
- const queryClient = useQueryClient();
- return useMutation({
- mutationFn: async () => {
- const { jobId } = await apiFetch<{ jobId: string }>("/api/jobs", {
- body: JSON.stringify({ kind: "analytics-daily", payload: {} }),
- method: "POST",
- });
- for (;;) {
- await new Promise((resolve) => setTimeout(resolve, 2000));
- const job = await apiFetch<AsyncJobStatus>(`/api/jobs/${jobId}`);
- if (job.state === "done") return job;
- if (job.state === "error") throw new Error(job.error ?? "The run failed.");
- }
- },
- onSuccess: () => queryClient.invalidateQueries({ queryKey: analyticsQueryKey }),
- });
-}
diff --git a/site/src/queries/blog.ts b/site/src/queries/blog.ts
deleted file mode 100644
index e936b1d0..00000000
--- a/site/src/queries/blog.ts
+++ /dev/null
@@ -1,141 +0,0 @@
-"use client";
-
-import { useMutation, useQuery, useQueryClient } from "@tanstack/react-query";
-
-import type { BlogPostAdmin, BlogPostAdminWithBody } from "@/lib/blog/admin";
-import type { BlogImageKind } from "@/lib/blog/images";
-import type { BlogPostInput } from "@/lib/blog/schema";
-import { apiFetch } from "@/queries/apiClient";
-
-export type { BlogPostAdmin, BlogPostAdminWithBody };
-
-export const blogPostsQueryKey = ["su", "blog", "posts"] as const;
-export const blogPostQueryKey = (id: string) => ["su", "blog", "post", id] as const;
-
-export type BlogImageResult = { key: string; url: string; width: number; height: number };
-
-const base = "/api/su/blog/posts";
-const postUrl = (id: string, tail = "") => `${base}/${encodeURIComponent(id)}${tail}`;
-
-// A write answers with the saved post; it lands in that post's cache and the
-// list refetches.
-function useTakePost() {
- const queryClient = useQueryClient();
- return (post: BlogPostAdmin | BlogPostAdminWithBody) => {
- queryClient.setQueryData<{ post: BlogPostAdminWithBody }>(blogPostQueryKey(post.id), (current) =>
- current ? { post: { ...current.post, ...post } } : "body" in post ? { post } : current,
- );
- void queryClient.invalidateQueries({ queryKey: blogPostsQueryKey });
- };
-}
-
-export function useBlogPosts() {
- return useQuery({
- queryFn: () => apiFetch<{ posts: BlogPostAdmin[] }>(base),
- queryKey: blogPostsQueryKey,
- });
-}
-
-export function useBlogPost(id: string) {
- return useQuery({
- queryFn: () => apiFetch<{ post: BlogPostAdminWithBody }>(postUrl(id)),
- queryKey: blogPostQueryKey(id),
- });
-}
-
-export function useCreateBlogPost() {
- const takePost = useTakePost();
- return useMutation({
- mutationFn: () => apiFetch<{ post: BlogPostAdmin }>(base, { method: "POST" }),
- onSuccess: ({ post }) => takePost(post),
- });
-}
-
-export function useSaveBlogPost(id: string) {
- const takePost = useTakePost();
- return useMutation({
- mutationFn: (input: BlogPostInput) =>
- apiFetch<{ post: BlogPostAdminWithBody }>(postUrl(id), { body: JSON.stringify(input), method: "PUT" }),
- onSuccess: ({ post }) => takePost(post),
- });
-}
-
-export function usePublishBlogPost(id: string) {
- const takePost = useTakePost();
- return useMutation({
- mutationFn: () => apiFetch<{ post: BlogPostAdminWithBody }>(postUrl(id, "/publish"), { method: "POST" }),
- onSuccess: ({ post }) => takePost(post),
- });
-}
-
-export function useUnpublishBlogPost(id: string) {
- const takePost = useTakePost();
- return useMutation({
- mutationFn: () => apiFetch<{ post: BlogPostAdminWithBody }>(postUrl(id, "/unpublish"), { method: "POST" }),
- onSuccess: ({ post }) => takePost(post),
- });
-}
-
-export type BlogGeneratedDetails = Pick<
- BlogPostInput,
- "seoTitle" | "excerpt" | "summary" | "tags" | "keywords" | "headerAlt"
->;
-
-// Details written off the article. The pictures land on the row at once; the
-// copy is the caller's to put in the form.
-export function useGenerateBlogDetails(id: string) {
- const takePost = useTakePost();
- return useMutation({
- mutationFn: (input: { title: string; body: string }) =>
- apiFetch<{ post: BlogPostAdmin; details: BlogGeneratedDetails }>(postUrl(id, "/generate"), {
- body: JSON.stringify(input),
- method: "POST",
- }),
- onSuccess: ({ post }) => takePost(post),
- });
-}
-
-export function useDeleteBlogPost() {
- const queryClient = useQueryClient();
- return useMutation({
- mutationFn: (id: string) => apiFetch<{ ok: true }>(postUrl(id), { method: "DELETE" }),
- onSuccess: (_result, id) => {
- queryClient.removeQueries({ queryKey: blogPostQueryKey(id) });
- void queryClient.invalidateQueries({ queryKey: blogPostsQueryKey });
- },
- });
-}
-
-// The whole upload: a presigned scratch key, the bytes PUT straight to
-// storage, then the encode that turns them into the image the pages serve.
-export async function uploadBlogImage(id: string, file: File, kind: BlogImageKind) {
- const { key, putUrl } = await apiFetch<{ key: string; putUrl: string }>(postUrl(id, "/uploads"), {
- body: JSON.stringify({ mime: file.type, bytes: file.size }),
- method: "POST",
- });
- const put = await fetch(putUrl, { method: "PUT", body: file, headers: { "Content-Type": file.type } });
- if (!put.ok) throw new Error(`The upload was refused (${put.status}).`);
- return apiFetch<{ image: BlogImageResult; post?: BlogPostAdmin }>(postUrl(id, "/images"), {
- body: JSON.stringify({ uploadKey: key, kind }),
- method: "POST",
- });
-}
-
-export function useUploadBlogImage(id: string) {
- const takePost = useTakePost();
- return useMutation({
- mutationFn: ({ file, kind }: { file: File; kind: BlogImageKind }) => uploadBlogImage(id, file, kind),
- onSuccess: ({ post }) => {
- if (post) takePost(post);
- },
- });
-}
-
-export function useRemoveBlogImage(id: string) {
- const takePost = useTakePost();
- return useMutation({
- mutationFn: (kind: "header" | "thumbnail") =>
- apiFetch<{ post: BlogPostAdmin }>(postUrl(id, "/images/remove"), { body: JSON.stringify({ kind }), method: "POST" }),
- onSuccess: ({ post }) => takePost(post),
- });
-}
diff --git a/site/src/queries/credits.ts b/site/src/queries/credits.ts
index 7017713a..cca90ac9 100644
--- a/site/src/queries/credits.ts
+++ b/site/src/queries/credits.ts
@@ -119,27 +119,6 @@ export function useUpdateCreditAutoReload() {
});
}
-// Super-user only: offer credits to a user (by email) or to self (by userId).
-// The credit lands when the person claims it from the email.
-export function useOfferCredits() {
- return useMutation({
- mutationFn: (input: {
- amountDollars: number;
- email?: string;
- // Days the credit lives once claimed; null keeps it forever.
- expiresAfterDays: number | null;
- userId?: string;
- }) =>
- apiFetch<{
- offer: { closesAt: string | null; expiresAfterDays: number | null; id: string };
- targetUser: { email: string };
- }>(
- "/api/credits/offers",
- { body: JSON.stringify(input), method: "POST" },
- ),
- });
-}
-
export const creditOfferQueryKey = (token: string) => ["credits", "offer", token] as const;
export type CreditOffer = {
diff --git a/site/src/queries/emailOutbox.ts b/site/src/queries/emailOutbox.ts
deleted file mode 100644
index 0740695c..00000000
--- a/site/src/queries/emailOutbox.ts
+++ /dev/null
@@ -1,32 +0,0 @@
-"use client";
-
-import { useMutation, useQuery, useQueryClient } from "@tanstack/react-query";
-
-import type { EmailKindId } from "@/lib/email/kindIds";
-import type { OutboxOverview } from "@/lib/email/outbox";
-import { apiFetch } from "@/queries/apiClient";
-
-export type { OutboxCampaign, OutboxItem, OutboxKindRow, OutboxOverview } from "@/lib/email/outbox";
-
-export const emailOutboxQueryKey = ["su", "email", "outbox"] as const;
-
-// Super-user only: the outbox and the cycle's budget. Polls while anything is
-// queued so sends settle on screen without a refresh.
-export function useEmailOutbox() {
- return useQuery({
- queryFn: () => apiFetch<OutboxOverview>("/api/su/email"),
- queryKey: emailOutboxQueryKey,
- refetchInterval: (query) => (query.state.data?.kinds.some((k) => k.queued > 0) ? 5000 : 60000),
- });
-}
-
-// Drain one kind now, or put one failed row back in the queue; the response
-// is the refreshed overview.
-export function useOutboxAction() {
- const queryClient = useQueryClient();
- return useMutation({
- mutationFn: (body: { action: "drain"; kind: EmailKindId } | { action: "retry"; id: string }) =>
- apiFetch<OutboxOverview>("/api/su/email", { body: JSON.stringify(body), method: "POST" }),
- onSuccess: (data) => queryClient.setQueryData(emailOutboxQueryKey, data),
- });
-}
diff --git a/site/src/queries/experiments.ts b/site/src/queries/experiments.ts
deleted file mode 100644
index 3818b8a4..00000000
--- a/site/src/queries/experiments.ts
+++ /dev/null
@@ -1,138 +0,0 @@
-"use client";
-
-import { useMutation, useQuery, useQueryClient } from "@tanstack/react-query";
-
-import type { ExperimentSummary, HoldoutRow } from "@/lib/config/experimentList";
-import type { ExperimentInput, ExperimentStatus } from "@/lib/config/experiment";
-import { apiFetch } from "@/queries/apiClient";
-
-export type { ExperimentSummary, HoldoutRow };
-
-export const experimentsQueryKey = ["su", "experiments"] as const;
-
-type Body = { experiments: ExperimentSummary[] };
-
-// Super-user only: every experiment with per-variant counts.
-export function useExperiments() {
- return useQuery({
- queryFn: () => apiFetch<Body>("/api/experiments"),
- queryKey: experimentsQueryKey,
- });
-}
-
-export function useCreateExperiment() {
- const queryClient = useQueryClient();
- return useMutation({
- mutationFn: (input: ExperimentInput) =>
- apiFetch<Body>("/api/experiments", { body: JSON.stringify(input), method: "POST" }),
- onSuccess: (body) => queryClient.setQueryData(experimentsQueryKey, body),
- });
-}
-
-export function useUpdateExperiment() {
- const queryClient = useQueryClient();
- return useMutation({
- mutationFn: ({ id, ...input }: ExperimentInput & { id: string }) =>
- apiFetch<Body>(`/api/experiments/${encodeURIComponent(id)}`, {
- body: JSON.stringify(input),
- method: "PUT",
- }),
- onSuccess: (body) => queryClient.setQueryData(experimentsQueryKey, body),
- });
-}
-
-export function useSetExperimentStatus() {
- const queryClient = useQueryClient();
- return useMutation({
- mutationFn: ({ id, status }: { id: string; status: ExperimentStatus }) =>
- apiFetch<Body>(`/api/experiments/${encodeURIComponent(id)}`, {
- body: JSON.stringify({ status }),
- method: "PATCH",
- }),
- onSuccess: (body) => queryClient.setQueryData(experimentsQueryKey, body),
- });
-}
-
-export function useDeleteExperiment() {
- const queryClient = useQueryClient();
- return useMutation({
- mutationFn: (id: string) =>
- apiFetch<Body>(`/api/experiments/${encodeURIComponent(id)}`, { method: "DELETE" }),
- onSuccess: (body) => queryClient.setQueryData(experimentsQueryKey, body),
- });
-}
-
-// A row written by hand: the account reads this variant (null holds it out).
-export function useSetAssignment() {
- const queryClient = useQueryClient();
- return useMutation({
- mutationFn: ({ id, email, variant }: { id: string; email: string; variant: string | null }) =>
- apiFetch<Body>(`/api/experiments/${encodeURIComponent(id)}/assignments`, {
- body: JSON.stringify({ email, variant }),
- method: "PUT",
- }),
- onSuccess: (body) => queryClient.setQueryData(experimentsQueryKey, body),
- });
-}
-
-export function useRemoveAssignment() {
- const queryClient = useQueryClient();
- return useMutation({
- mutationFn: ({ id, userId }: { id: string; userId: string }) =>
- apiFetch<Body>(`/api/experiments/${encodeURIComponent(id)}/assignments`, {
- body: JSON.stringify({ userId }),
- method: "DELETE",
- }),
- onSuccess: (body) => queryClient.setQueryData(experimentsQueryKey, body),
- });
-}
-
-// Runs the results job for one experiment and follows it to completion, then
-// refetches the list so the new read shows.
-export function useComputeResults() {
- const queryClient = useQueryClient();
- return useMutation({
- mutationFn: async (experimentId: string) => {
- const { jobId } = await apiFetch<{ jobId: string }>("/api/jobs", {
- body: JSON.stringify({ kind: "experiment-results", payload: { experimentId } }),
- method: "POST",
- });
- for (;;) {
- await new Promise((resolve) => setTimeout(resolve, 2000));
- const job = await apiFetch<{ state: string; error?: string }>(`/api/jobs/${jobId}`);
- if (job.state === "done") return job;
- if (job.state === "error") throw new Error(job.error ?? "The run failed.");
- }
- },
- onSettled: () => queryClient.invalidateQueries({ queryKey: experimentsQueryKey }),
- });
-}
-
-export const holdoutQueryKey = ["su", "holdout"] as const;
-
-type HoldoutBody = { holdout: HoldoutRow[] };
-
-export function useHoldout() {
- return useQuery({
- queryFn: () => apiFetch<HoldoutBody>("/api/experiments/holdout"),
- queryKey: holdoutQueryKey,
- });
-}
-
-export function useAddHoldout() {
- const queryClient = useQueryClient();
- return useMutation({
- mutationFn: (input: { email: string; note: string | null }) =>
- apiFetch<HoldoutBody>("/api/experiments/holdout", { body: JSON.stringify(input), method: "POST" }),
- onSuccess: (body) => queryClient.setQueryData(holdoutQueryKey, body),
- });
-}
-
-export function useRemoveHoldout() {
- const queryClient = useQueryClient();
- return useMutation({
- mutationFn: (userId: string) =>
- apiFetch<HoldoutBody>("/api/experiments/holdout", { body: JSON.stringify({ userId }), method: "DELETE" }),
- onSuccess: (body) => queryClient.setQueryData(holdoutQueryKey, body),
- });
-}
diff --git a/site/src/queries/jobs.ts b/site/src/queries/jobs.ts
deleted file mode 100644
index 1317f994..00000000
--- a/site/src/queries/jobs.ts
+++ /dev/null
@@ -1,55 +0,0 @@
-"use client";
-
-import { useMutation, useQuery } from "@tanstack/react-query";
-
-import { apiFetch } from "@/queries/apiClient";
-
-export type AsyncJobStatus = {
- kind: string;
- state: "queued" | "running" | "done" | "error";
- result?: Record<string, unknown>;
- error?: string;
-};
-
-export type AsyncJobListItem = {
- id: string;
- kind: string;
- state: AsyncJobStatus["state"];
- payload: unknown;
- result?: Record<string, unknown>;
- error?: string;
- createdAt: string;
- // When a held-back job is due: one deferred by its own run (a drainer
- // waiting on the email quota) or queued for later.
- notBefore?: string;
-};
-
-export const recentJobsQueryKey = ["jobs", "recent"] as const;
-
-// Super-user only: start a background job on the hosted API. The recent-jobs
-// list tracks it to completion.
-export function useStartJob() {
- return useMutation({
- mutationFn: (input: { kind: string; payload: unknown }) =>
- apiFetch<{ jobId: string }>("/api/jobs", {
- body: JSON.stringify(input),
- method: "POST",
- }),
- });
-}
-
-// Super-user only: the last few jobs, newest first. Polls while any listed
-// job is still in flight so states settle on screen without a refresh.
-export function useRecentJobs(enabled: boolean) {
- return useQuery({
- enabled,
- queryFn: () => apiFetch<{ jobs: AsyncJobListItem[] }>("/api/jobs"),
- queryKey: recentJobsQueryKey,
- refetchInterval: (query) =>
- query.state.data?.jobs.some(
- (job) => job.state === "queued" || job.state === "running",
- )
- ? 2000
- : false,
- });
-}
diff --git a/site/src/queries/outreach.ts b/site/src/queries/outreach.ts
deleted file mode 100644
index 6911c708..00000000
--- a/site/src/queries/outreach.ts
+++ /dev/null
@@ -1,170 +0,0 @@
-"use client";
-
-import {
- keepPreviousData,
- useMutation,
- useMutationState,
- useQuery,
- useQueryClient,
-} from "@tanstack/react-query";
-
-import type { CreditOfferTerms } from "@/lib/credits/offerTerms";
-import type { OutreachReason, OutreachStatus } from "@/lib/marketing/campaigns";
-import { apiFetch } from "@/queries/apiClient";
-import type { AsyncJobStatus } from "@/queries/jobs";
-
-export type OutreachRow = {
- id: string;
- userId: string;
- name: string;
- email: string;
- status: OutreachStatus;
- // USD strings, as the credits API returns them everywhere else.
- spent: string;
- balance: string;
- // Cloud media the account held when the scan ran, in bytes. A BigInt on the
- // server, so it travels as a decimal string.
- storageBytes: string;
- lastActiveAt: string | null;
- ranOutAt: string | null;
- // Why the scan listed the account; a wall reason is the moment to write.
- reasons: OutreachReason[];
- paymentFailedAt: string | null;
- signedUpAt: string;
- sentCount: number;
- firstSentAt: string | null;
- lastSentAt: string | null;
- repliedAt: string | null;
-};
-
-export const outreachQueryKey = (status: OutreachStatus, reason?: OutreachReason) =>
- ["outreach", status, reason ?? "all"] as const;
-
-// Super-user only: one page of the outreach list for a status, narrowed to
-// one reason when asked.
-export function useOutreach(status: OutreachStatus, reason?: OutreachReason) {
- return useQuery({
- queryFn: () =>
- apiFetch<{ rows: OutreachRow[] }>(
- `/api/marketing/outreach?status=${status}${reason ? `&reason=${reason}` : ""}`,
- ),
- queryKey: outreachQueryKey(status, reason),
- });
-}
-
-export const outreachSearchQueryKey = (q: string, status?: OutreachStatus) =>
- ["outreach", "search", q, status ?? "all"] as const;
-
-// Super-user only: the rows matching a search, across every status or pinned
-// to one, with per-status match counts. Matching runs in the database, so a
-// hit past any list's page cap is still found. The previous result stays on
-// screen while the next needle loads, so the badges never blink to zero.
-export function useOutreachSearch(q: string, status?: OutreachStatus) {
- return useQuery({
- enabled: q !== "",
- placeholderData: keepPreviousData,
- queryFn: () =>
- apiFetch<{ counts: Record<OutreachStatus, number>; rows: OutreachRow[] }>(
- `/api/marketing/outreach?q=${encodeURIComponent(q)}${
- status ? `&status=${status}` : ""
- }`,
- ),
- queryKey: outreachSearchQueryKey(q, status),
- });
-}
-
-export const outreachCountsQueryKey = ["outreach", "counts"] as const;
-
-// How many rows every status holds, and how many of the to-email rows carry
-// each reason. One key for all of them, so switching lists never blanks the
-// totals.
-export function useOutreachCounts() {
- return useQuery({
- queryFn: () =>
- apiFetch<{
- counts: Record<OutreachStatus, number>;
- reasons: Record<OutreachReason, number>;
- }>("/api/marketing/outreach/counts"),
- queryKey: outreachCountsQueryKey,
- });
-}
-
-type OutreachAction =
- | {
- action: "send";
- outreachId: string;
- subject: string;
- body: string;
- unsubscribeLink: boolean;
- trackReplies: boolean;
- creditOffer: CreditOfferTerms | null;
- }
- // Mails the note to the operator with the row's values filled in.
- | {
- action: "test";
- outreachId: string;
- subject: string;
- body: string;
- unsubscribeLink: boolean;
- creditOffer: CreditOfferTerms | null;
- }
- // Sends a saved promotion to the row's account as it stands.
- | { action: "promote"; outreachId: string; promotionId: string }
- | { action: "ignore" | "unignore" | "replied"; outreachId: string }
- // Puts the account with this address on the list, and answers with its row.
- | { action: "add"; email: string };
-
-const outreachActionKey = ["outreach", "action"] as const;
-
-// Any action moves a row between lists, so every list is invalidated. Actions
-// run one per row and in parallel: the key lets the list ask which rows are in
-// flight instead of freezing on any one of them.
-export function useOutreachAction() {
- const queryClient = useQueryClient();
- return useMutation({
- mutationFn: (input: OutreachAction) =>
- apiFetch<{ row: OutreachRow; sentTo?: string }>("/api/marketing/outreach", {
- body: JSON.stringify(input),
- method: "POST",
- }),
- mutationKey: outreachActionKey,
- // A send lands in the person's history too.
- onSuccess: () => {
- void queryClient.invalidateQueries({ queryKey: ["outreach"] });
- void queryClient.invalidateQueries({ queryKey: ["su", "users"] });
- },
- });
-}
-
-// The rows with an action still running.
-export function useBusyOutreachIds(): Set<string> {
- const running = useMutationState({
- filters: { mutationKey: outreachActionKey, status: "pending" },
- select: (mutation) => {
- const variables = mutation.state.variables as OutreachAction | undefined;
- return variables && "outreachId" in variables ? variables.outreachId : undefined;
- },
- });
- return new Set(running.filter((id): id is string => typeof id === "string"));
-}
-
-// Super-user only: roll credit usage into the list now and follow the job to
-// completion, then refetch so the list updates in place.
-export function useRunOutreachScan() {
- const queryClient = useQueryClient();
- return useMutation({
- mutationFn: async () => {
- const { jobId } = await apiFetch<{ jobId: string }>("/api/jobs", {
- body: JSON.stringify({ kind: "outreach-scan", payload: {} }),
- method: "POST",
- });
- for (;;) {
- await new Promise((resolve) => setTimeout(resolve, 2000));
- const job = await apiFetch<AsyncJobStatus>(`/api/jobs/${jobId}`);
- if (job.state === "done") return job;
- if (job.state === "error") throw new Error(job.error ?? "The scan failed.");
- }
- },
- onSuccess: () => queryClient.invalidateQueries({ queryKey: ["outreach"] }),
- });
-}
diff --git a/site/src/queries/outreachTemplates.ts b/site/src/queries/outreachTemplates.ts
deleted file mode 100644
index 14d7e7f6..00000000
--- a/site/src/queries/outreachTemplates.ts
+++ /dev/null
@@ -1,64 +0,0 @@
-"use client";
-
-import { useMutation, useQuery, useQueryClient } from "@tanstack/react-query";
-
-import type { CreditOfferTerms } from "@/lib/credits/offerTerms";
-import { apiFetch } from "@/queries/apiClient";
-
-export type SavedTemplate = {
- id: string;
- name: string;
- subject: string;
- body: string;
- unsubscribeLink: boolean;
- trackReplies: boolean;
- updatedAt: string;
- // The credit offer the template starts a note with, as stored; a form
- // parses it before use.
- promotion: unknown;
-};
-
-export const outreachTemplatesQueryKey = ["outreach", "templates"] as const;
-
-// Super-user only: every saved template, by name.
-export function useOutreachTemplates() {
- return useQuery({
- queryFn: () =>
- apiFetch<{ templates: SavedTemplate[] }>("/api/marketing/templates"),
- queryKey: outreachTemplatesQueryKey,
- });
-}
-
-// Saving under an existing name rewrites that template.
-export function useSaveOutreachTemplate() {
- const queryClient = useQueryClient();
- return useMutation({
- mutationFn: (input: {
- name: string;
- subject: string;
- body: string;
- unsubscribeLink: boolean;
- trackReplies: boolean;
- promotion?: CreditOfferTerms | null;
- }) =>
- apiFetch<{ template: SavedTemplate }>("/api/marketing/templates", {
- body: JSON.stringify(input),
- method: "POST",
- }),
- onSuccess: () =>
- queryClient.invalidateQueries({ queryKey: outreachTemplatesQueryKey }),
- });
-}
-
-export function useDeleteOutreachTemplate() {
- const queryClient = useQueryClient();
- return useMutation({
- mutationFn: (id: string) =>
- apiFetch<{ ok: true }>(
- `/api/marketing/templates?id=${encodeURIComponent(id)}`,
- { method: "DELETE" },
- ),
- onSuccess: () =>
- queryClient.invalidateQueries({ queryKey: outreachTemplatesQueryKey }),
- });
-}
diff --git a/site/src/queries/promotions.ts b/site/src/queries/promotions.ts
deleted file mode 100644
index 90ff48c2..00000000
--- a/site/src/queries/promotions.ts
+++ /dev/null
@@ -1,110 +0,0 @@
-"use client";
-
-import { useMutation, useQuery, useQueryClient } from "@tanstack/react-query";
-import type { Audience } from "@donkeycut/abexp";
-
-import type {
- PromotionDraftInput,
- PromotionSender,
- PromotionSummary,
- SegmentCount,
-} from "@/lib/marketing/promotionInput";
-import { apiFetch } from "@/queries/apiClient";
-
-export type { PromotionSummary };
-
-export const promotionsQueryKey = ["su", "promotions"] as const;
-
-type Body = { promotions: PromotionSummary[]; senders: Record<PromotionSender, string> };
-
-// A write answers with the whole list, and it lands in the cache as the
-// answer arrives, so a row reopened right after a save reads what was saved.
-function useTakeList() {
- const queryClient = useQueryClient();
- return (result: { promotions: PromotionSummary[] }) => {
- queryClient.setQueryData<Body>(promotionsQueryKey, (body) =>
- body ? { ...body, promotions: result.promotions } : body,
- );
- void queryClient.invalidateQueries({ queryKey: promotionsQueryKey });
- };
-}
-
-// Super-user only: every promotion with how far its send got, and the address
-// each sender stands for. Polls while a send is running.
-export function usePromotions() {
- return useQuery({
- queryFn: () => apiFetch<Body>("/api/su/promotions"),
- queryKey: promotionsQueryKey,
- refetchInterval: (query) =>
- query.state.data?.promotions.some((p) => p.status === "queuing" || p.status === "sending") ? 3000 : false,
- });
-}
-
-// A new draft, or an edit of one. Answers with the saved id.
-export function useSavePromotion() {
- const takeList = useTakeList();
- return useMutation({
- mutationFn: ({ id, ...input }: PromotionDraftInput & { id: string | null }) =>
- apiFetch<{ id: string; promotions: PromotionSummary[] }>(
- id ? `/api/su/promotions/${encodeURIComponent(id)}` : "/api/su/promotions",
- { body: JSON.stringify(input), method: id ? "PUT" : "POST" },
- ),
- onSuccess: takeList,
- });
-}
-
-export function useDeletePromotion() {
- const takeList = useTakeList();
- return useMutation({
- mutationFn: (id: string) =>
- apiFetch<{ promotions: PromotionSummary[] }>(`/api/su/promotions/${encodeURIComponent(id)}`, {
- method: "DELETE",
- }),
- onSuccess: takeList,
- });
-}
-
-// Starts the send; the list's polling follows it to sent.
-export function useSendPromotion() {
- const queryClient = useQueryClient();
- return useMutation({
- mutationFn: (id: string) =>
- apiFetch<{ promotions: PromotionSummary[] }>(`/api/su/promotions/${encodeURIComponent(id)}/send`, {
- method: "POST",
- }),
- onSuccess: () => queryClient.invalidateQueries({ queryKey: promotionsQueryKey }),
- });
-}
-
-export function useCancelPromotion() {
- const takeList = useTakeList();
- return useMutation({
- mutationFn: (id: string) =>
- apiFetch<{ promotions: PromotionSummary[] }>(
- `/api/su/promotions/${encodeURIComponent(id)}/cancel`,
- { method: "POST" },
- ),
- onSuccess: takeList,
- });
-}
-
-// Mails the saved copy to the operator.
-export function useTestPromotion() {
- return useMutation({
- mutationFn: (id: string) =>
- apiFetch<{ sentTo: string }>(`/api/su/promotions/${encodeURIComponent(id)}/test`, {
- method: "POST",
- }),
- });
-}
-
-// How many accounts a segment reaches right now.
-export function useCountSegment() {
- return useMutation({
- mutationFn: (segment: { audience: Audience; excludePromotionIds: string[] }) =>
- apiFetch<SegmentCount>("/api/su/promotions/segment", {
- body: JSON.stringify(segment),
- method: "POST",
- }),
- });
-}
diff --git a/site/src/queries/settings.ts b/site/src/queries/settings.ts
deleted file mode 100644
index 98d1c5b0..00000000
--- a/site/src/queries/settings.ts
+++ /dev/null
@@ -1,49 +0,0 @@
-"use client";
-
-import { useMutation, useQuery, useQueryClient } from "@tanstack/react-query";
-
-import type { SettingKey } from "@/lib/config/registry";
-import { apiFetch } from "@/queries/apiClient";
-
-export type SettingRow = {
- key: SettingKey;
- title: string;
- description: string;
- public: boolean;
- default: unknown;
- value: unknown;
- overridden: boolean;
- invalid: boolean;
- updatedAt: string | null;
- schema: Record<string, unknown>;
-};
-
-export const settingsQueryKey = ["su", "settings"] as const;
-
-type Body = { settings: SettingRow[] };
-
-// Super-user only: every registered setting with its current override.
-export function useSettings() {
- return useQuery({
- queryFn: () => apiFetch<Body>("/api/settings"),
- queryKey: settingsQueryKey,
- });
-}
-
-export function useSaveSetting() {
- const queryClient = useQueryClient();
- return useMutation({
- mutationFn: (input: { key: SettingKey; value: unknown }) =>
- apiFetch<Body>("/api/settings", { body: JSON.stringify(input), method: "PUT" }),
- onSuccess: (body) => queryClient.setQueryData(settingsQueryKey, body),
- });
-}
-
-export function useResetSetting() {
- const queryClient = useQueryClient();
- return useMutation({
- mutationFn: (key: SettingKey) =>
- apiFetch<Body>(`/api/settings?key=${encodeURIComponent(key)}`, { method: "DELETE" }),
- onSuccess: (body) => queryClient.setQueryData(settingsQueryKey, body),
- });
-}
diff --git a/site/src/queries/userHistory.ts b/site/src/queries/userHistory.ts
deleted file mode 100644
index 26794d3a..00000000
--- a/site/src/queries/userHistory.ts
+++ /dev/null
@@ -1,20 +0,0 @@
-"use client";
-
-import { useQuery } from "@tanstack/react-query";
-
-import type { UserHistory } from "@/lib/marketing/userHistory";
-import { apiFetch } from "@/queries/apiClient";
-
-export type { UserHistory, UserHistoryEmail, UserHistoryGrant, UserHistoryOffer } from "@/lib/marketing/userHistory";
-
-// Super-user only: one account's offers, grants, mail and storage. Read when
-// the operator opens the history, and held for the session — a note sent
-// from the same dialog invalidates it.
-export function useUserHistory(userId: string | null) {
- return useQuery({
- enabled: userId !== null,
- queryFn: () => apiFetch<UserHistory>(`/api/su/users/${encodeURIComponent(userId!)}/history`),
- queryKey: ["su", "users", userId, "history"] as const,
- staleTime: 5 * 60_000,
- });
-}