couriercrow 0.0.0-stage → 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (46) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +19 -2
  3. package/bin/couriercrow.js +5 -0
  4. package/bin/crow.js +14 -0
  5. package/bundle/migrations/0001_initial.sql +463 -0
  6. package/bundle/version.json +3 -0
  7. package/bundle/web/_headers +6 -0
  8. package/bundle/web/assets/index-Bim8rHvG.css +2 -0
  9. package/bundle/web/assets/index-YpJn_3e5.js +13 -0
  10. package/bundle/web/index.html +14 -0
  11. package/bundle/worker/README.md +1 -0
  12. package/bundle/worker/worker.js +57841 -0
  13. package/bundle/wrangler.jsonc +64 -0
  14. package/package.json +61 -4
  15. package/src/app-credentials.ts +413 -0
  16. package/src/bin.ts +578 -0
  17. package/src/build-config.ts +264 -0
  18. package/src/build-id.ts +39 -0
  19. package/src/cloudflare/cloudflare-client.ts +361 -0
  20. package/src/cloudflare/cloudflare-live-access.ts +454 -0
  21. package/src/cloudflare/cloudflare-live-account.ts +95 -0
  22. package/src/cloudflare/cloudflare-live-api.ts +87 -0
  23. package/src/cloudflare/cloudflare-live-checks.ts +151 -0
  24. package/src/cloudflare/cloudflare-live-zone.ts +363 -0
  25. package/src/cloudflare/cloudflare-live.ts +270 -0
  26. package/src/cloudflare/cloudflare-state.ts +152 -0
  27. package/src/cloudflare/first-run.ts +322 -0
  28. package/src/credentials-show.ts +49 -0
  29. package/src/deploy.ts +807 -0
  30. package/src/doctor.ts +504 -0
  31. package/src/environment.ts +141 -0
  32. package/src/index.ts +4 -0
  33. package/src/init.ts +332 -0
  34. package/src/load-config.ts +47 -0
  35. package/src/mailbox-api.ts +345 -0
  36. package/src/permissions.ts +133 -0
  37. package/src/plan.ts +517 -0
  38. package/src/printable.ts +8 -0
  39. package/src/product.ts +63 -0
  40. package/src/purge.ts +93 -0
  41. package/src/render.ts +406 -0
  42. package/src/rotate-app-secret.ts +53 -0
  43. package/src/runtime.ts +33 -0
  44. package/src/set-secret.ts +63 -0
  45. package/src/terminal.ts +163 -0
  46. package/src/wrangler.ts +168 -0
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Christoffer Artmann
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,3 +1,20 @@
1
- # Temporary Holding Version
1
+ # couriercrow
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ The command line of Courier Crow: a self-hosted shared inbox for your side projects, defined in TypeScript and running in your own Cloudflare account. It holds the built app, deploys it to your account, and re-exports `defineMail` for your `mail.config.ts`.
4
+
5
+ It needs [Bun](https://bun.sh) 1.4.0 or later.
6
+
7
+ ```bash
8
+ mkdir my-mail && cd my-mail
9
+ bunx couriercrow init # writes package.json, mail.config.ts, .gitignore and .env.example
10
+ bun install
11
+ bun run doctor # checks the token, its permissions, the plan, Zero Trust and your domains
12
+ bun run plan # shows what deploy would change
13
+ bun run deploy
14
+ ```
15
+
16
+ The package installs two names for the same command, `crow` and `couriercrow`. Type `bunx couriercrow <command>` or use the package scripts: in a folder where Courier Crow is not installed, `bunx crow` would download and run an unrelated npm package named `crow`.
17
+
18
+ Commands: `init`, `doctor`, `plan`, `deploy`, `purge`, `rotate-app-secret`, `set-secret` and `credentials show`. `bunx couriercrow` with no command lists them.
19
+
20
+ Everything else, from the Cloudflare account and the API token to sending from your apps, is in the README of the repository: https://github.com/Artmann/courier-crow.
@@ -0,0 +1,5 @@
1
+ #!/usr/bin/env bun
2
+ // The couriercrow command: the same program as crow. It has a file of its
3
+ // own so the package lists every file once.
4
+
5
+ await import('./crow.js')
package/bin/crow.js ADDED
@@ -0,0 +1,14 @@
1
+ #!/usr/bin/env bun
2
+ // The crow and couriercrow commands. Plain JavaScript, so that Node can read
3
+ // it too and say that the command line needs Bun.
4
+
5
+ if (process.versions.bun === undefined) {
6
+ console.error(
7
+ "Courier Crow's command line needs Bun. Install it from https://bun.sh, then run bunx couriercrow."
8
+ )
9
+ process.exit(1)
10
+ }
11
+
12
+ const { main } = await import('../src/bin.ts')
13
+
14
+ await main()
@@ -0,0 +1,463 @@
1
+ -- Each statement ends with a "statement-breakpoint" comment so the test
2
+ -- database can run them one by one. D1 runs the whole file as it is.
3
+
4
+ CREATE TABLE domains (
5
+ name TEXT PRIMARY KEY,
6
+ state TEXT NOT NULL CHECK (state IN ('active'))
7
+ );
8
+ -- statement-breakpoint
9
+
10
+ CREATE TABLE mailboxes (
11
+ address TEXT PRIMARY KEY,
12
+ domain TEXT NOT NULL,
13
+ -- purging: `crow purge` started deleting it. It never becomes active
14
+ -- again; running purge again finishes the job.
15
+ state TEXT NOT NULL CHECK (state IN ('active', 'archived', 'purging'))
16
+ );
17
+ -- statement-breakpoint
18
+
19
+ CREATE TABLE people (
20
+ email TEXT PRIMARY KEY,
21
+ name TEXT NOT NULL
22
+ );
23
+ -- statement-breakpoint
24
+
25
+ CREATE TABLE mailbox_access (
26
+ mailbox_address TEXT NOT NULL,
27
+ person_email TEXT NOT NULL,
28
+ PRIMARY KEY (mailbox_address, person_email)
29
+ );
30
+ -- statement-breakpoint
31
+
32
+ CREATE INDEX mailbox_access_by_person ON mailbox_access (person_email);
33
+ -- statement-breakpoint
34
+
35
+ -- Apps that send transactional mail. client_id is the client id of the app's
36
+ -- Access service token; null until deploy has created it. series_from and
37
+ -- series_postal_address are both set when the app may enrol people in
38
+ -- series, and both null when it may not.
39
+ CREATE TABLE apps (
40
+ name TEXT PRIMARY KEY,
41
+ domain TEXT NOT NULL,
42
+ client_id TEXT UNIQUE,
43
+ series_from TEXT,
44
+ series_postal_address TEXT,
45
+ CHECK ((series_from IS NULL) = (series_postal_address IS NULL))
46
+ );
47
+ -- statement-breakpoint
48
+
49
+ -- Settings of the whole deployment, one row each. series_provider: the
50
+ -- provider series go through ('resend'); no row when none is set up.
51
+ -- series_blocked_reason and series_blocked_at: why and since when the
52
+ -- scheduler stopped because of the provider account (no key, a refused key
53
+ -- or domain, a used-up quota); no rows once the pause ends.
54
+ -- series_last_blocked_at and series_unblocked_at: when the last pause began
55
+ -- and ended; the time a pause took does not make a step too late.
56
+ -- series_sweep_after: the last stored key under series/ the daily sweep of
57
+ -- left-over bodies looked at.
58
+ CREATE TABLE deployment_settings (
59
+ name TEXT PRIMARY KEY CHECK (
60
+ name IN (
61
+ 'series_blocked_at',
62
+ 'series_blocked_reason',
63
+ 'series_last_blocked_at',
64
+ 'series_provider',
65
+ 'series_sweep_after',
66
+ 'series_unblocked_at'
67
+ )
68
+ ),
69
+ value TEXT NOT NULL
70
+ );
71
+ -- statement-breakpoint
72
+
73
+ CREATE TABLE app_senders (
74
+ app_name TEXT NOT NULL,
75
+ address TEXT NOT NULL,
76
+ PRIMARY KEY (app_name, address)
77
+ );
78
+ -- statement-breakpoint
79
+
80
+ CREATE TABLE app_viewers (
81
+ app_name TEXT NOT NULL,
82
+ person_email TEXT NOT NULL,
83
+ PRIMARY KEY (app_name, person_email)
84
+ );
85
+ -- statement-breakpoint
86
+
87
+ CREATE INDEX app_viewers_by_person ON app_viewers (person_email);
88
+ -- statement-breakpoint
89
+
90
+ -- One row per message an app sent. Rows outlive their app: removing an app
91
+ -- keeps them, and they are visible again if the app is added back under the
92
+ -- same name. The HTML and text are in R2 until body_expired is 1.
93
+ CREATE TABLE transactional_messages (
94
+ id TEXT PRIMARY KEY,
95
+ app_name TEXT NOT NULL,
96
+ idempotency_key TEXT NOT NULL,
97
+ -- SHA-256 of from, to, reply-to, subject, HTML, text and template name, so
98
+ -- a key used again for a different message is refused.
99
+ content_hash TEXT NOT NULL,
100
+ from_address TEXT NOT NULL,
101
+ to_address TEXT NOT NULL,
102
+ reply_to TEXT,
103
+ subject TEXT NOT NULL,
104
+ template_name TEXT NOT NULL,
105
+ state TEXT NOT NULL CHECK (state IN ('failed', 'queued', 'sent')),
106
+ -- 1 when a send failed in a way that does not show whether the provider
107
+ -- accepted the mail. A retry with the same key needs allowDuplicate.
108
+ outcome_uncertain INTEGER NOT NULL DEFAULT 0,
109
+ failure_reason TEXT,
110
+ provider_message_id TEXT,
111
+ body_expired INTEGER NOT NULL DEFAULT 0,
112
+ -- When the bodies were last written: the first send, or a retry after the
113
+ -- daily run expired them. They are kept 30 days from then. Null means
114
+ -- created_at.
115
+ body_written_at TEXT,
116
+ created_at TEXT NOT NULL,
117
+ -- When a send last claimed the row. A row that stays queued for more than
118
+ -- 5 minutes counts as failed and uncertain.
119
+ queued_at TEXT NOT NULL,
120
+ sent_at TEXT,
121
+ UNIQUE (app_name, idempotency_key)
122
+ );
123
+ -- statement-breakpoint
124
+
125
+ CREATE INDEX transactional_messages_by_app ON transactional_messages (app_name, created_at DESC, id);
126
+ -- statement-breakpoint
127
+
128
+ -- The rows whose bodies the daily sweep still has to expire, oldest first.
129
+ CREATE INDEX transactional_messages_by_age ON transactional_messages (created_at)
130
+ WHERE body_expired = 0;
131
+ -- statement-breakpoint
132
+
133
+ -- One row per person an app enrolled in a series. The row is written last,
134
+ -- after the bodies and the steps: it is what makes an enrolment exist.
135
+ -- Steps without their enrolment row are invisible and are cleaned up by the
136
+ -- request that wrote them. domain is the app's domain at enrolment; the bodies
137
+ -- are under series/<domain>/<id>/. ended_at is when the enrolment left
138
+ -- active; its bodies are deleted 30 days later.
139
+ CREATE TABLE enrollments (
140
+ id TEXT PRIMARY KEY,
141
+ app_name TEXT NOT NULL,
142
+ key TEXT NOT NULL,
143
+ series_name TEXT NOT NULL,
144
+ to_address TEXT NOT NULL,
145
+ domain TEXT NOT NULL,
146
+ -- SHA-256 of the series name, the recipient and every step, so a key used
147
+ -- again for a different enrolment is refused.
148
+ content_hash TEXT NOT NULL,
149
+ state TEXT NOT NULL CHECK (state IN ('active', 'cancelled', 'finished', 'unsubscribed')),
150
+ body_expired INTEGER NOT NULL DEFAULT 0,
151
+ created_at TEXT NOT NULL,
152
+ ended_at TEXT,
153
+ UNIQUE (app_name, key)
154
+ );
155
+ -- statement-breakpoint
156
+
157
+ CREATE INDEX enrollments_by_app ON enrollments (app_name, created_at DESC, id);
158
+ -- statement-breakpoint
159
+
160
+ CREATE INDEX enrollments_by_recipient ON enrollments (app_name, to_address);
161
+ -- statement-breakpoint
162
+
163
+ -- The enrolments whose bodies the daily run still has to delete.
164
+ CREATE INDEX enrollments_ended ON enrollments (ended_at)
165
+ WHERE body_expired = 0 AND ended_at IS NOT NULL;
166
+ -- statement-breakpoint
167
+
168
+ -- The mails of an enrolment. scheduled: waits for due_at. queued: the
169
+ -- scheduler claimed it and is sending it; a step queued for more than 5
170
+ -- minutes counts as failed and uncertain and is never sent again. skipped:
171
+ -- the enrolment was cancelled or the person unsubscribed before it went out.
172
+ CREATE TABLE enrollment_steps (
173
+ id TEXT PRIMARY KEY,
174
+ enrollment_id TEXT NOT NULL,
175
+ position INTEGER NOT NULL,
176
+ due_at TEXT NOT NULL,
177
+ subject TEXT NOT NULL,
178
+ state TEXT NOT NULL CHECK (state IN ('failed', 'queued', 'scheduled', 'sent', 'skipped')),
179
+ outcome_uncertain INTEGER NOT NULL DEFAULT 0,
180
+ failure_reason TEXT,
181
+ provider_message_id TEXT,
182
+ queued_at TEXT,
183
+ sent_at TEXT,
184
+ -- How often the step was put back for a reason that may pass (the
185
+ -- provider's 429, a step that could not be prepared), 15 minutes later each
186
+ -- time. After 5 it fails.
187
+ attempts INTEGER NOT NULL DEFAULT 0,
188
+ -- When the row was written. Rows of an enrolment that never got its row
189
+ -- are removed by the daily run after 24 hours.
190
+ created_at TEXT NOT NULL,
191
+ UNIQUE (enrollment_id, position)
192
+ );
193
+ -- statement-breakpoint
194
+
195
+ CREATE INDEX enrollment_steps_due ON enrollment_steps (due_at)
196
+ WHERE state = 'scheduled';
197
+ -- statement-breakpoint
198
+
199
+ CREATE INDEX enrollment_steps_queued ON enrollment_steps (queued_at)
200
+ WHERE state = 'queued';
201
+ -- statement-breakpoint
202
+
203
+ -- Addresses that unsubscribed from an app's series. Transactional mail still
204
+ -- goes to them.
205
+ CREATE TABLE suppressions (
206
+ app_name TEXT NOT NULL,
207
+ address TEXT NOT NULL,
208
+ reason TEXT NOT NULL CHECK (reason IN ('unsubscribed')),
209
+ created_at TEXT NOT NULL,
210
+ PRIMARY KEY (app_name, address)
211
+ );
212
+ -- statement-breakpoint
213
+
214
+ CREATE INDEX suppressions_by_age ON suppressions (app_name, created_at DESC, address);
215
+ -- statement-breakpoint
216
+
217
+ -- Who allowed an address to get an app's series again, and when. Written
218
+ -- before the suppression is deleted, so no removal goes unrecorded.
219
+ CREATE TABLE suppression_removals (
220
+ id TEXT PRIMARY KEY,
221
+ app_name TEXT NOT NULL,
222
+ address TEXT NOT NULL,
223
+ removed_by TEXT NOT NULL,
224
+ removed_at TEXT NOT NULL
225
+ );
226
+ -- statement-breakpoint
227
+
228
+ -- One token per app and address, made before the first series mail to it.
229
+ -- The token is 32 random bytes, base64url.
230
+ CREATE TABLE unsubscribe_tokens (
231
+ token TEXT PRIMARY KEY,
232
+ app_name TEXT NOT NULL,
233
+ address TEXT NOT NULL,
234
+ created_at TEXT NOT NULL,
235
+ UNIQUE (app_name, address)
236
+ );
237
+ -- statement-breakpoint
238
+
239
+ CREATE TABLE threads (
240
+ id TEXT PRIMARY KEY,
241
+ mailbox_address TEXT NOT NULL,
242
+ subject TEXT NOT NULL,
243
+ last_message_at TEXT NOT NULL,
244
+ is_read INTEGER NOT NULL DEFAULT 0,
245
+ is_archived INTEGER NOT NULL DEFAULT 0
246
+ );
247
+ -- statement-breakpoint
248
+
249
+ CREATE INDEX threads_by_mailbox ON threads (mailbox_address, last_message_at DESC, id);
250
+ -- statement-breakpoint
251
+
252
+ -- "sequence" is an explicit integer key, so the search rows (which use it as
253
+ -- their rowid) stay matched to their messages after an export and import.
254
+ -- "thread_updated" is 1 once the thread's flags and last_message_at include
255
+ -- this message.
256
+ CREATE TABLE messages (
257
+ sequence INTEGER PRIMARY KEY,
258
+ id TEXT NOT NULL UNIQUE,
259
+ thread_id TEXT NOT NULL,
260
+ mailbox_address TEXT NOT NULL,
261
+ state TEXT NOT NULL CHECK (state IN ('draft', 'failed', 'queued', 'received', 'sent')),
262
+ rfc_message_id TEXT,
263
+ in_reply_to TEXT,
264
+ references_json TEXT NOT NULL DEFAULT '[]',
265
+ from_address TEXT NOT NULL,
266
+ from_name TEXT,
267
+ to_json TEXT NOT NULL,
268
+ cc_json TEXT NOT NULL,
269
+ -- The Reply-To addresses of a received message, at most 20.
270
+ reply_to_json TEXT NOT NULL DEFAULT '[]',
271
+ subject TEXT NOT NULL,
272
+ text TEXT NOT NULL,
273
+ html TEXT,
274
+ raw_key TEXT,
275
+ is_parsed INTEGER NOT NULL DEFAULT 1,
276
+ is_truncated INTEGER NOT NULL DEFAULT 0,
277
+ -- Received mail a program sent. 'reply': an automatic reply, such as an
278
+ -- out-of-office reply (Auto-Submitted other than "no", or Precedence
279
+ -- auto_reply); it does not turn a contacted address into replied. 'list':
280
+ -- list or bulk mail (Precedence bulk, junk or list alone); a person
281
+ -- answering through a list still replies. Null: a person wrote it.
282
+ automatic_kind TEXT CHECK (automatic_kind IN ('list', 'reply')),
283
+ -- 1 for received mail whose From could not be read: from_address is the
284
+ -- envelope sender or unknown@unknown.invalid, which is never a contact.
285
+ is_fallback_sender INTEGER NOT NULL DEFAULT 0,
286
+ thread_updated INTEGER NOT NULL DEFAULT 0,
287
+ authentication_json TEXT,
288
+ provider_message_id TEXT,
289
+ failure_reason TEXT,
290
+ -- 1 when a send failed in a way that does not show whether the provider
291
+ -- accepted the mail (a timeout, a network error). Retry asks first.
292
+ outcome_uncertain INTEGER NOT NULL DEFAULT 0,
293
+ -- When a send last claimed the message (draft or failed to queued). A
294
+ -- message that stays queued for more than 5 minutes can be given up.
295
+ queued_at TEXT,
296
+ created_by TEXT,
297
+ created_at TEXT NOT NULL,
298
+ sent_at TEXT,
299
+ UNIQUE (mailbox_address, rfc_message_id)
300
+ );
301
+ -- statement-breakpoint
302
+
303
+ CREATE INDEX messages_by_thread ON messages (thread_id, created_at, id);
304
+ -- statement-breakpoint
305
+
306
+ -- The messages whose save stopped after the message row. The daily run
307
+ -- finishes them (maintenance/finish-interrupted-saves.ts).
308
+ CREATE INDEX messages_not_thread_updated ON messages (sequence) WHERE thread_updated = 0;
309
+ -- statement-breakpoint
310
+
311
+ CREATE TABLE attachments (
312
+ id TEXT PRIMARY KEY,
313
+ message_id TEXT NOT NULL,
314
+ mailbox_address TEXT NOT NULL,
315
+ filename TEXT NOT NULL,
316
+ content_type TEXT NOT NULL,
317
+ size_in_bytes INTEGER NOT NULL,
318
+ storage_key TEXT NOT NULL,
319
+ -- When an upload came in. Null for the attachments of received mail. An
320
+ -- upload that no message took (message_id = '') for 24 hours is deleted by
321
+ -- the daily sweep.
322
+ uploaded_at TEXT
323
+ );
324
+ -- statement-breakpoint
325
+
326
+ CREATE INDEX attachments_by_message ON attachments (message_id);
327
+ -- statement-breakpoint
328
+
329
+ CREATE INDEX attachments_by_mailbox ON attachments (mailbox_address);
330
+ -- statement-breakpoint
331
+
332
+ -- The search row has the same rowid as the message's "sequence", so the
333
+ -- triggers find it by rowid and never scan the index. An upsert keeps the
334
+ -- sequence. The update trigger runs only when an indexed column is written.
335
+ CREATE VIRTUAL TABLE messages_search USING fts5 (
336
+ subject,
337
+ from_address,
338
+ from_name,
339
+ text
340
+ );
341
+ -- statement-breakpoint
342
+
343
+ CREATE TRIGGER messages_search_insert AFTER INSERT ON messages
344
+ BEGIN
345
+ INSERT INTO messages_search (rowid, subject, from_address, from_name, text)
346
+ VALUES (new.sequence, new.subject, new.from_address, coalesce(new.from_name, ''), new.text);
347
+ END;
348
+ -- statement-breakpoint
349
+
350
+ CREATE TRIGGER messages_search_update
351
+ AFTER UPDATE OF subject, from_address, from_name, text ON messages
352
+ BEGIN
353
+ DELETE FROM messages_search WHERE rowid = old.sequence;
354
+ INSERT INTO messages_search (rowid, subject, from_address, from_name, text)
355
+ VALUES (new.sequence, new.subject, new.from_address, coalesce(new.from_name, ''), new.text);
356
+ END;
357
+ -- statement-breakpoint
358
+
359
+ CREATE TRIGGER messages_search_delete AFTER DELETE ON messages
360
+ BEGIN
361
+ DELETE FROM messages_search WHERE rowid = old.sequence;
362
+ END;
363
+ -- statement-breakpoint
364
+
365
+ -- The outside addresses of a message: the sender of a received message
366
+ -- ('from'), the To and Cc recipients of an outgoing one ('to'). An address
367
+ -- that is a mailbox of this deployment is not an outside address. saveMessage
368
+ -- writes these rows and replaces them when it saves the message again. The
369
+ -- contacts of a mailbox are worked out from these rows alone, so a list never
370
+ -- reads message bodies: "sent_or_received_at" is the message's time, and
371
+ -- "counts" is 1 only once the message row exists and is sent ('to') or
372
+ -- received ('from'). saveMessage sets both from the message row after it
373
+ -- wrote it (see thread-repository.ts). Rows of a message that was never saved
374
+ -- are removed by the daily run after a day.
375
+ CREATE TABLE message_parties (
376
+ message_id TEXT NOT NULL,
377
+ mailbox_address TEXT NOT NULL,
378
+ address TEXT NOT NULL,
379
+ -- The display name the message gave. Only received mail has one.
380
+ name TEXT,
381
+ direction TEXT NOT NULL CHECK (direction IN ('from', 'to')),
382
+ sent_or_received_at TEXT NOT NULL,
383
+ counts INTEGER NOT NULL DEFAULT 0 CHECK (counts IN (0, 1)),
384
+ -- 1 for the sender of an automatic reply (messages.automatic_kind =
385
+ -- 'reply'). Such a row is still received mail, but it is not the contact
386
+ -- writing back: the Wrote back filter and the end of Waiting for reply
387
+ -- leave it out.
388
+ is_automatic_reply INTEGER NOT NULL DEFAULT 0 CHECK (is_automatic_reply IN (0, 1)),
389
+ PRIMARY KEY (message_id, address)
390
+ );
391
+ -- statement-breakpoint
392
+
393
+ -- The contact list groups the counting rows of one mailbox by address, in
394
+ -- time order.
395
+ CREATE INDEX message_parties_by_contact
396
+ ON message_parties (mailbox_address, counts, address, sent_or_received_at);
397
+ -- statement-breakpoint
398
+
399
+ -- The parties of mail stored before this table existed. On a new database
400
+ -- there is no mail yet and this inserts nothing.
401
+ INSERT OR IGNORE INTO message_parties (
402
+ message_id, mailbox_address, address, name, direction, sent_or_received_at, counts,
403
+ is_automatic_reply
404
+ )
405
+ SELECT id, mailbox_address, from_address, from_name, 'from',
406
+ coalesce(sent_at, created_at), 1, automatic_kind IS 'reply'
407
+ FROM messages
408
+ WHERE state = 'received'
409
+ AND is_fallback_sender = 0
410
+ AND from_address NOT IN (SELECT address FROM mailboxes)
411
+ UNION
412
+ SELECT messages.id, messages.mailbox_address, recipient.value, NULL, 'to',
413
+ coalesce(messages.sent_at, messages.created_at), messages.state = 'sent', 0
414
+ FROM messages, json_each(messages.to_json) AS recipient
415
+ WHERE messages.state <> 'received'
416
+ AND recipient.value NOT IN (SELECT address FROM mailboxes)
417
+ UNION
418
+ SELECT messages.id, messages.mailbox_address, recipient.value, NULL, 'to',
419
+ coalesce(messages.sent_at, messages.created_at), messages.state = 'sent', 0
420
+ FROM messages, json_each(messages.cc_json) AS recipient
421
+ WHERE messages.state <> 'received'
422
+ AND recipient.value NOT IN (SELECT address FROM mailboxes);
423
+ -- statement-breakpoint
424
+
425
+ -- What the people of a mailbox noted about one outside address. No row means
426
+ -- status 'none' and an empty note. updated_by is null when the status was
427
+ -- changed automatically (contacted becomes replied when they write back).
428
+ CREATE TABLE contact_notes (
429
+ mailbox_address TEXT NOT NULL,
430
+ address TEXT NOT NULL,
431
+ status TEXT NOT NULL CHECK (
432
+ status IN ('contacted', 'customer', 'interested', 'none', 'not interested', 'replied')
433
+ ),
434
+ note TEXT NOT NULL DEFAULT '',
435
+ -- When the note was last written; null while it never was. A note is
436
+ -- written only over the version the writer saw.
437
+ note_updated_at TEXT,
438
+ updated_by TEXT,
439
+ updated_at TEXT NOT NULL,
440
+ PRIMARY KEY (mailbox_address, address)
441
+ );
442
+ -- statement-breakpoint
443
+
444
+ -- Saved pieces of text of a mailbox, shared by everyone with access to it.
445
+ -- Placeholders such as {{firstName}} are plain text here; the web app fills
446
+ -- them in when a snippet is inserted. A name is unique in its mailbox
447
+ -- without regard to case or Unicode form (name_key); the API makes each run
448
+ -- of spaces in it one space.
449
+ CREATE TABLE snippets (
450
+ id TEXT PRIMARY KEY,
451
+ mailbox_address TEXT NOT NULL,
452
+ name TEXT NOT NULL,
453
+ -- The name as it is compared: NFKC, lower case (non-ASCII letters too),
454
+ -- each run of whitespace one space (snippetNameKey in snippet-queries.ts).
455
+ -- Two names with the same key are the same name.
456
+ name_key TEXT NOT NULL,
457
+ text TEXT NOT NULL,
458
+ created_by TEXT NOT NULL,
459
+ updated_by TEXT NOT NULL,
460
+ created_at TEXT NOT NULL,
461
+ updated_at TEXT NOT NULL,
462
+ UNIQUE (mailbox_address, name_key)
463
+ );
@@ -0,0 +1,3 @@
1
+ {
2
+ "version": "0.1.0-26a8a8b0f57a"
3
+ }
@@ -0,0 +1,6 @@
1
+ /*
2
+ Content-Security-Policy: default-src 'self'; script-src 'self'; style-src 'self' 'unsafe-inline'; img-src 'self' data: https:; connect-src 'self'; frame-src 'self' about:; object-src 'none'; base-uri 'self'; form-action 'self'; frame-ancestors 'none'
3
+ Cross-Origin-Opener-Policy: same-origin
4
+ Referrer-Policy: no-referrer
5
+ X-Content-Type-Options: nosniff
6
+ X-Frame-Options: DENY
@@ -0,0 +1,2 @@
1
+ /*! tailwindcss v4.3.5 | MIT License | https://tailwindcss.com */
2
+ @layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:block))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-translate-x:0;--tw-translate-y:0;--tw-translate-z:0;--tw-divide-y-reverse:0;--tw-border-style:solid;--tw-leading:initial;--tw-font-weight:initial;--tw-tracking:initial;--tw-ordinal:initial;--tw-slashed-zero:initial;--tw-numeric-figure:initial;--tw-numeric-spacing:initial;--tw-numeric-fraction:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000;--tw-outline-style:solid;--tw-blur:initial;--tw-brightness:initial;--tw-contrast:initial;--tw-grayscale:initial;--tw-hue-rotate:initial;--tw-invert:initial;--tw-opacity:initial;--tw-saturate:initial;--tw-sepia:initial;--tw-drop-shadow:initial;--tw-drop-shadow-color:initial;--tw-drop-shadow-alpha:100%;--tw-drop-shadow-size:initial}}}@layer theme{:root,:host{--font-sans:ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;--font-mono:ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;--color-red-50:oklch(97.1% .013 17.38);--color-red-100:oklch(93.6% .032 17.717);--color-red-300:oklch(80.8% .114 19.571);--color-red-700:oklch(50.5% .213 27.518);--color-red-800:oklch(44.4% .177 26.899);--color-red-900:oklch(39.6% .141 25.723);--color-red-950:oklch(25.8% .092 26.042);--color-amber-50:oklch(98.7% .022 95.277);--color-amber-100:oklch(96.2% .059 95.617);--color-amber-200:oklch(92.4% .12 95.746);--color-amber-300:oklch(87.9% .169 91.605);--color-amber-500:oklch(76.9% .188 70.08);--color-amber-700:oklch(55.5% .163 48.998);--color-amber-800:oklch(47.3% .137 46.201);--color-amber-900:oklch(41.4% .112 45.904);--color-amber-950:oklch(27.9% .077 45.635);--color-green-100:oklch(96.2% .044 156.743);--color-green-900:oklch(39.3% .095 152.535);--color-green-950:oklch(26.6% .065 152.934);--color-white:#fff;--spacing:.25rem;--container-md:28rem;--container-3xl:48rem;--container-5xl:64rem;--text-xs:.75rem;--text-xs--line-height:calc(1 / .75);--text-sm:.875rem;--text-sm--line-height:calc(1.25 / .875);--text-base:1rem;--text-base--line-height:calc(1.5 / 1);--text-lg:1.125rem;--text-lg--line-height:calc(1.75 / 1.125);--text-xl:1.25rem;--text-xl--line-height:calc(1.75 / 1.25);--font-weight-normal:400;--font-weight-medium:500;--font-weight-semibold:600;--tracking-wide:.025em;--leading-relaxed:1.625;--radius-sm:.25rem;--radius-md:.375rem;--radius-lg:.5rem;--animate-pulse:pulse 2s cubic-bezier(.4, 0, .6, 1) infinite;--default-transition-duration:.15s;--default-transition-timing-function:cubic-bezier(.4, 0, .2, 1);--default-font-family:ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;--default-mono-font-family:var(--font-mono)}}@layer base{*,:after,:before,::backdrop{box-sizing:border-box;border:0 solid;margin:0;padding:0}::file-selector-button{box-sizing:border-box;border:0 solid;margin:0;padding:0}html,:host{-webkit-text-size-adjust:100%;tab-size:4;line-height:1.5;font-family:var(--default-font-family,-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", "Noto Sans", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji");font-feature-settings:var(--default-font-feature-settings,normal);font-variation-settings:var(--default-font-variation-settings,normal);-webkit-tap-highlight-color:transparent}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;-webkit-text-decoration:inherit;-webkit-text-decoration:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:var(--default-mono-font-family,ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace);font-feature-settings:var(--default-mono-font-feature-settings,normal);font-variation-settings:var(--default-mono-font-variation-settings,normal);font-size:1em}small{font-size:80%}sub,sup{vertical-align:baseline;font-size:75%;line-height:0;position:relative}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}:-moz-focusring:where(:not(iframe)){outline:auto}progress{vertical-align:baseline}summary{display:list-item}ol,ul,menu{list-style:none}img,svg,video,canvas,audio,iframe,embed,object{vertical-align:middle;display:block}img,video{max-width:100%;height:auto}button,input,select,optgroup,textarea{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}::file-selector-button{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}:where(select:is([multiple],[size])) optgroup{font-weight:bolder}:where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}::file-selector-button{margin-inline-end:4px}::placeholder{opacity:1}@supports (not ((-webkit-appearance:-apple-pay-button))) or (contain-intrinsic-size:1px){::placeholder{color:currentColor}@supports (color:color-mix(in lab, red, red)){::placeholder{color:color-mix(in oklab, currentcolor 50%, transparent)}}}textarea{resize:vertical}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}::-webkit-datetime-edit{display:inline-flex}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-datetime-edit{padding-block:0}::-webkit-datetime-edit-year-field{padding-block:0}::-webkit-datetime-edit-month-field{padding-block:0}::-webkit-datetime-edit-day-field{padding-block:0}::-webkit-datetime-edit-hour-field{padding-block:0}::-webkit-datetime-edit-minute-field{padding-block:0}::-webkit-datetime-edit-second-field{padding-block:0}::-webkit-datetime-edit-millisecond-field{padding-block:0}::-webkit-datetime-edit-meridiem-field{padding-block:0}::-webkit-calendar-picker-indicator{line-height:1}:-moz-ui-invalid{box-shadow:none}button,input:where([type=button],[type=reset],[type=submit]){appearance:button}::file-selector-button{appearance:button}::-webkit-inner-spin-button{height:auto}::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}}@layer components;@layer utilities{.pointer-events-none{pointer-events:none}.visible{visibility:visible}.sr-only{clip-path:inset(50%);white-space:nowrap;border-width:0;width:1px;height:1px;margin:-1px;padding:0;position:absolute;overflow:hidden}.absolute{position:absolute}.fixed{position:fixed}.relative{position:relative}.static{position:static}.inset-0{inset:0}.top-1\/2{top:50%}.left-3{left:calc(var(--spacing) * 3)}.z-50{z-index:50}.container{width:100%}@media (width>=40rem){.container{max-width:40rem}}@media (width>=48rem){.container{max-width:48rem}}@media (width>=64rem){.container{max-width:64rem}}@media (width>=80rem){.container{max-width:80rem}}@media (width>=96rem){.container{max-width:96rem}}.m-4{margin:calc(var(--spacing) * 4)}.mx-auto{margin-inline:auto}.line-clamp-4{-webkit-line-clamp:4;-webkit-box-orient:vertical;display:-webkit-box;overflow:hidden}.block{display:block}.flex{display:flex}.grid{display:grid}.hidden{display:none}.inline{display:inline}.inline-flex{display:inline-flex}.table{display:table}.size-2{width:calc(var(--spacing) * 2);height:calc(var(--spacing) * 2)}.size-3\.5{width:calc(var(--spacing) * 3.5);height:calc(var(--spacing) * 3.5)}.size-4{width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4)}.size-6{width:calc(var(--spacing) * 6);height:calc(var(--spacing) * 6)}.size-11{width:calc(var(--spacing) * 11);height:calc(var(--spacing) * 11)}.h-1\.5{height:calc(var(--spacing) * 1.5)}.h-3\.5{height:calc(var(--spacing) * 3.5)}.h-4{height:calc(var(--spacing) * 4)}.h-6{height:calc(var(--spacing) * 6)}.h-7{height:calc(var(--spacing) * 7)}.h-24{height:calc(var(--spacing) * 24)}.h-40{height:calc(var(--spacing) * 40)}.h-64{height:calc(var(--spacing) * 64)}.h-\[32rem\]{height:32rem}.h-dvh{height:100dvh}.max-h-64{max-height:calc(var(--spacing) * 64)}.max-h-\[60dvh\]{max-height:60dvh}.max-h-\[70dvh\]{max-height:70dvh}.min-h-0{min-height:0}.min-h-5{min-height:calc(var(--spacing) * 5)}.min-h-11{min-height:calc(var(--spacing) * 11)}.min-h-12{min-height:calc(var(--spacing) * 12)}.min-h-14{min-height:calc(var(--spacing) * 14)}.min-h-16{min-height:calc(var(--spacing) * 16)}.min-h-28{min-height:calc(var(--spacing) * 28)}.min-h-32{min-height:calc(var(--spacing) * 32)}.min-h-40{min-height:calc(var(--spacing) * 40)}.min-h-48{min-height:calc(var(--spacing) * 48)}.min-h-full{min-height:100%}.w-1\/2{width:50%}.w-1\/3{width:33.3333%}.w-2{width:calc(var(--spacing) * 2)}.w-2\/3{width:66.6667%}.w-2\/5{width:40%}.w-4\/5{width:80%}.w-16{width:calc(var(--spacing) * 16)}.w-fit{width:fit-content}.w-full{width:100%}.max-w-3xl{max-width:var(--container-3xl)}.max-w-5xl{max-width:var(--container-5xl)}.max-w-40{max-width:calc(var(--spacing) * 40)}.max-w-56{max-width:calc(var(--spacing) * 56)}.max-w-64{max-width:calc(var(--spacing) * 64)}.max-w-80{max-width:calc(var(--spacing) * 80)}.max-w-full{max-width:100%}.max-w-md{max-width:var(--container-md)}.min-w-0{min-width:0}.min-w-6{min-width:calc(var(--spacing) * 6)}.min-w-32{min-width:calc(var(--spacing) * 32)}.flex-1{flex:1}.shrink-0{flex-shrink:0}.border-collapse{border-collapse:collapse}.-translate-y-1\/2{--tw-translate-y:calc(calc(1 / 2 * 100%) * -1);translate:var(--tw-translate-x) var(--tw-translate-y)}.rotate-180{rotate:180deg}.animate-pulse{animation:var(--animate-pulse)}.cursor-pointer{cursor:pointer}.resize{resize:both}.resize-y{resize:vertical}.grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.flex-col{flex-direction:column}.flex-col-reverse{flex-direction:column-reverse}.flex-wrap{flex-wrap:wrap}.items-baseline{align-items:baseline}.items-center{align-items:center}.items-end{align-items:flex-end}.items-start{align-items:flex-start}.justify-between{justify-content:space-between}.justify-center{justify-content:center}.gap-0\.5{gap:calc(var(--spacing) * .5)}.gap-1{gap:var(--spacing)}.gap-1\.5{gap:calc(var(--spacing) * 1.5)}.gap-2{gap:calc(var(--spacing) * 2)}.gap-3{gap:calc(var(--spacing) * 3)}.gap-4{gap:calc(var(--spacing) * 4)}.gap-6{gap:calc(var(--spacing) * 6)}:where(.divide-y>:not(:last-child)){--tw-divide-y-reverse:0;border-bottom-style:var(--tw-border-style);border-top-style:var(--tw-border-style);border-top-width:calc(1px * var(--tw-divide-y-reverse));border-bottom-width:calc(1px * calc(1 - var(--tw-divide-y-reverse)))}:where(.divide-border>:not(:last-child)){border-color:var(--border)}.self-start{align-self:flex-start}.truncate{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.overflow-hidden{overflow:hidden}.overflow-x-auto{overflow-x:auto}.overflow-y-auto{overflow-y:auto}.rounded{border-radius:.25rem}.rounded-full{border-radius:2147483647px}.rounded-lg{border-radius:var(--radius-lg)}.rounded-md{border-radius:var(--radius-md)}.rounded-sm{border-radius:var(--radius-sm)}.border{border-style:var(--tw-border-style);border-width:1px}.border-t{border-top-style:var(--tw-border-style);border-top-width:1px}.border-b{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}.border-b-2{border-bottom-style:var(--tw-border-style);border-bottom-width:2px}.border-dashed{--tw-border-style:dashed;border-style:dashed}.border-accent{border-color:var(--accent)}.border-amber-300{border-color:var(--color-amber-300)}.border-border{border-color:var(--border)}.border-red-300{border-color:var(--color-red-300)}.border-transparent{border-color:#0000}.bg-accent{background-color:var(--accent)}.bg-accent-soft{background-color:var(--accent-soft)}.bg-amber-50{background-color:var(--color-amber-50)}.bg-amber-100{background-color:var(--color-amber-100)}.bg-amber-200{background-color:var(--color-amber-200)}.bg-background{background-color:var(--background)}.bg-foreground\/40{background-color:var(--foreground)}@supports (color:color-mix(in lab, red, red)){.bg-foreground\/40{background-color:color-mix(in oklab, var(--foreground) 40%, transparent)}}.bg-green-100{background-color:var(--color-green-100)}.bg-muted,.bg-muted\/40{background-color:var(--muted)}@supports (color:color-mix(in lab, red, red)){.bg-muted\/40{background-color:color-mix(in oklab, var(--muted) 40%, transparent)}}.bg-red-50{background-color:var(--color-red-50)}.bg-surface{background-color:var(--surface)}.bg-transparent{background-color:#0000}.bg-white{background-color:var(--color-white)}.p-2{padding:calc(var(--spacing) * 2)}.p-3{padding:calc(var(--spacing) * 3)}.p-4{padding:calc(var(--spacing) * 4)}.p-5{padding:calc(var(--spacing) * 5)}.p-6{padding:calc(var(--spacing) * 6)}.px-1\.5{padding-inline:calc(var(--spacing) * 1.5)}.px-2{padding-inline:calc(var(--spacing) * 2)}.px-3{padding-inline:calc(var(--spacing) * 3)}.px-4{padding-inline:calc(var(--spacing) * 4)}.px-6{padding-inline:calc(var(--spacing) * 6)}.py-0\.5{padding-block:calc(var(--spacing) * .5)}.py-1{padding-block:var(--spacing)}.py-1\.5{padding-block:calc(var(--spacing) * 1.5)}.py-2{padding-block:calc(var(--spacing) * 2)}.py-2\.5{padding-block:calc(var(--spacing) * 2.5)}.py-3{padding-block:calc(var(--spacing) * 3)}.py-3\.5{padding-block:calc(var(--spacing) * 3.5)}.py-4{padding-block:calc(var(--spacing) * 4)}.pt-2{padding-top:calc(var(--spacing) * 2)}.pt-3{padding-top:calc(var(--spacing) * 3)}.pt-4{padding-top:calc(var(--spacing) * 4)}.pr-0\.5{padding-right:calc(var(--spacing) * .5)}.pr-2{padding-right:calc(var(--spacing) * 2)}.pr-3{padding-right:calc(var(--spacing) * 3)}.pr-4{padding-right:calc(var(--spacing) * 4)}.pb-1{padding-bottom:var(--spacing)}.pb-2{padding-bottom:calc(var(--spacing) * 2)}.pl-2\.5{padding-left:calc(var(--spacing) * 2.5)}.pl-8{padding-left:calc(var(--spacing) * 8)}.pl-9{padding-left:calc(var(--spacing) * 9)}.pl-18{padding-left:calc(var(--spacing) * 18)}.text-center{text-align:center}.text-left{text-align:left}.text-right{text-align:right}.text-base{font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height))}.text-lg{font-size:var(--text-lg);line-height:var(--tw-leading,var(--text-lg--line-height))}.text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.text-xl{font-size:var(--text-xl);line-height:var(--tw-leading,var(--text-xl--line-height))}.text-xs{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.leading-relaxed{--tw-leading:var(--leading-relaxed);line-height:var(--leading-relaxed)}.font-medium{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.font-normal{--tw-font-weight:var(--font-weight-normal);font-weight:var(--font-weight-normal)}.font-semibold{--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold)}.tracking-wide{--tw-tracking:var(--tracking-wide);letter-spacing:var(--tracking-wide)}.break-words{overflow-wrap:break-word}.wrap-anywhere{overflow-wrap:anywhere}.whitespace-nowrap{white-space:nowrap}.whitespace-pre-wrap{white-space:pre-wrap}.text-accent-foreground{color:var(--accent-foreground)}.text-accent-text{color:var(--accent-text)}.text-amber-700{color:var(--color-amber-700)}.text-amber-800{color:var(--color-amber-800)}.text-amber-900{color:var(--color-amber-900)}.text-foreground{color:var(--foreground)}.text-green-900{color:var(--color-green-900)}.text-muted-foreground{color:var(--muted-foreground)}.text-red-700{color:var(--color-red-700)}.text-red-900{color:var(--color-red-900)}.text-transparent{color:#0000}.tabular-nums{--tw-numeric-spacing:tabular-nums;font-variant-numeric:var(--tw-ordinal, ) var(--tw-slashed-zero, ) var(--tw-numeric-figure, ) var(--tw-numeric-spacing, ) var(--tw-numeric-fraction, )}.underline{text-decoration-line:underline}.underline-offset-2{text-underline-offset:2px}.shadow{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a), 0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.shadow-lg{--tw-shadow:0 10px 15px -3px var(--tw-shadow-color,#0000001a), 0 4px 6px -4px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.shadow-sm{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a), 0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.outline{outline-style:var(--tw-outline-style);outline-width:1px}.filter{filter:var(--tw-blur, ) var(--tw-brightness, ) var(--tw-contrast, ) var(--tw-grayscale, ) var(--tw-hue-rotate, ) var(--tw-invert, ) var(--tw-saturate, ) var(--tw-sepia, ) var(--tw-drop-shadow, )}.transition-colors{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.outline-none{--tw-outline-style:none;outline-style:none}.select-text{-webkit-user-select:text;user-select:text}.placeholder\:text-muted-foreground::placeholder{color:var(--muted-foreground)}.focus-within\:ring-2:focus-within{--tw-ring-shadow:var(--tw-ring-inset, ) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.focus-within\:ring-accent:focus-within{--tw-ring-color:var(--accent)}@media (hover:hover){.hover\:bg-accent\/15:hover{background-color:var(--accent)}@supports (color:color-mix(in lab, red, red)){.hover\:bg-accent\/15:hover{background-color:color-mix(in oklab, var(--accent) 15%, transparent)}}.hover\:bg-accent\/90:hover{background-color:var(--accent)}@supports (color:color-mix(in lab, red, red)){.hover\:bg-accent\/90:hover{background-color:color-mix(in oklab, var(--accent) 90%, transparent)}}.hover\:bg-border:hover{background-color:var(--border)}.hover\:bg-muted:hover{background-color:var(--muted)}.hover\:text-foreground:hover{color:var(--foreground)}.hover\:underline:hover{text-decoration-line:underline}}.focus-visible\:bg-muted:focus-visible{background-color:var(--muted)}.focus-visible\:underline:focus-visible{text-decoration-line:underline}.focus-visible\:ring-2:focus-visible{--tw-ring-shadow:var(--tw-ring-inset, ) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.focus-visible\:ring-accent:focus-visible{--tw-ring-color:var(--accent)}.focus-visible\:ring-offset-2:focus-visible{--tw-ring-offset-width:2px;--tw-ring-offset-shadow:var(--tw-ring-inset, ) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color)}.focus-visible\:ring-offset-surface:focus-visible{--tw-ring-offset-color:var(--surface)}.focus-visible\:ring-inset:focus-visible{--tw-ring-inset:inset}.disabled\:pointer-events-none:disabled{pointer-events:none}.disabled\:opacity-50:disabled{opacity:.5}.disabled\:opacity-70:disabled{opacity:.7}.has-\[\:focus-visible\]\:ring-2:has(:focus-visible){--tw-ring-shadow:var(--tw-ring-inset, ) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.has-\[\:focus-visible\]\:ring-accent:has(:focus-visible){--tw-ring-color:var(--accent)}@media (width>=40rem){.sm\:w-32{width:calc(var(--spacing) * 32)}.sm\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.sm\:flex-row{flex-direction:row}.sm\:items-baseline{align-items:baseline}.sm\:items-center{align-items:center}.sm\:items-end{align-items:flex-end}.sm\:justify-end{justify-content:flex-end}.sm\:gap-1{gap:var(--spacing)}.sm\:gap-3{gap:calc(var(--spacing) * 3)}.sm\:gap-4{gap:calc(var(--spacing) * 4)}.sm\:self-auto{align-self:auto}}@media (width>=48rem){.md\:mx-6{margin-inline:calc(var(--spacing) * 6)}.md\:ml-auto{margin-left:auto}.md\:block{display:block}.md\:flex{display:flex}.md\:hidden{display:none}.md\:table{display:table}.md\:size-8{width:calc(var(--spacing) * 8);height:calc(var(--spacing) * 8)}.md\:max-h-none{max-height:none}.md\:min-h-0{min-height:0}.md\:min-h-8{min-height:calc(var(--spacing) * 8)}.md\:min-h-9{min-height:calc(var(--spacing) * 9)}.md\:min-h-10{min-height:calc(var(--spacing) * 10)}.md\:w-60{width:calc(var(--spacing) * 60)}.md\:w-72{width:calc(var(--spacing) * 72)}.md\:w-96{width:calc(var(--spacing) * 96)}.md\:flex-1{flex:1}.md\:flex-none{flex:none}.md\:shrink-0{flex-shrink:0}.md\:flex-row{flex-direction:row}.md\:items-center{align-items:center}.md\:items-end{align-items:flex-end}.md\:border-r{border-right-style:var(--tw-border-style);border-right-width:1px}.md\:border-b-0{border-bottom-style:var(--tw-border-style);border-bottom-width:0}.md\:p-4{padding:calc(var(--spacing) * 4)}.md\:p-6{padding:calc(var(--spacing) * 6)}.md\:px-5{padding-inline:calc(var(--spacing) * 5)}.md\:px-6{padding-inline:calc(var(--spacing) * 6)}.md\:py-4{padding-block:calc(var(--spacing) * 4)}.md\:pt-2{padding-top:calc(var(--spacing) * 2)}.md\:text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}}@media (prefers-color-scheme:dark){.dark\:border-amber-800{border-color:var(--color-amber-800)}.dark\:border-red-800{border-color:var(--color-red-800)}.dark\:bg-amber-500\/40{background-color:#f99c0066}@supports (color:color-mix(in lab, red, red)){.dark\:bg-amber-500\/40{background-color:color-mix(in oklab, var(--color-amber-500) 40%, transparent)}}.dark\:bg-amber-950{background-color:var(--color-amber-950)}.dark\:bg-green-950{background-color:var(--color-green-950)}.dark\:bg-red-950{background-color:var(--color-red-950)}.dark\:text-amber-100{color:var(--color-amber-100)}.dark\:text-amber-300{color:var(--color-amber-300)}.dark\:text-green-100{color:var(--color-green-100)}.dark\:text-red-100{color:var(--color-red-100)}.dark\:text-red-300{color:var(--color-red-300)}}}:root{--accent:oklch(52% .15 255);--accent-foreground:oklch(99% .005 255);--accent-soft:var(--accent-soft-light,oklch(94% .03 255));--accent-text:var(--accent-text-light,var(--accent));--background:oklch(97.5% .004 255);--border:oklch(90% .006 255);--foreground:oklch(24% .02 255);--muted:oklch(94.5% .006 255);--muted-foreground:oklch(50% .02 255);--surface:oklch(99.5% .002 255);--lightningcss-light:initial;--lightningcss-dark: ;color-scheme:light dark}@media (prefers-color-scheme:dark){:root{--lightningcss-light: ;--lightningcss-dark:initial;--accent:oklch(72% .12 255);--accent-foreground:oklch(20% .03 255);--accent-soft:var(--accent-soft-dark,oklch(30% .05 255));--accent-text:var(--accent-text-dark,var(--accent));--background:oklch(19% .012 255);--border:oklch(32% .014 255);--foreground:oklch(93% .008 255);--muted:oklch(26% .014 255);--muted-foreground:oklch(70% .02 255);--surface:oklch(22% .014 255)}}body{background:var(--background);color:var(--foreground);font-family:var(--font-sans);-webkit-font-smoothing:antialiased}@media (forced-colors:active){:focus-visible{outline-offset:2px;outline:2px solid highlight}}@media (prefers-reduced-motion:reduce){*{transition-duration:.01ms!important;animation-duration:.01ms!important}}@property --tw-translate-x{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-y{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-z{syntax:"*";inherits:false;initial-value:0}@property --tw-divide-y-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-leading{syntax:"*";inherits:false}@property --tw-font-weight{syntax:"*";inherits:false}@property --tw-tracking{syntax:"*";inherits:false}@property --tw-ordinal{syntax:"*";inherits:false}@property --tw-slashed-zero{syntax:"*";inherits:false}@property --tw-numeric-figure{syntax:"*";inherits:false}@property --tw-numeric-spacing{syntax:"*";inherits:false}@property --tw-numeric-fraction{syntax:"*";inherits:false}@property --tw-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:"*";inherits:false}@property --tw-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:"*";inherits:false}@property --tw-inset-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:"*";inherits:false}@property --tw-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:"*";inherits:false}@property --tw-inset-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:"*";inherits:false}@property --tw-ring-offset-width{syntax:"<length>";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:"*";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-outline-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-blur{syntax:"*";inherits:false}@property --tw-brightness{syntax:"*";inherits:false}@property --tw-contrast{syntax:"*";inherits:false}@property --tw-grayscale{syntax:"*";inherits:false}@property --tw-hue-rotate{syntax:"*";inherits:false}@property --tw-invert{syntax:"*";inherits:false}@property --tw-opacity{syntax:"*";inherits:false}@property --tw-saturate{syntax:"*";inherits:false}@property --tw-sepia{syntax:"*";inherits:false}@property --tw-drop-shadow{syntax:"*";inherits:false}@property --tw-drop-shadow-color{syntax:"*";inherits:false}@property --tw-drop-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-drop-shadow-size{syntax:"*";inherits:false}@keyframes pulse{50%{opacity:.5}}