calmlens 0.25.0 → 0.26.1

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 (84) hide show
  1. package/README.md +14 -14
  2. package/bin/calmlens.js +2202 -521
  3. package/cjs/{BrowserUpload-AO2-2U5Z.js → BrowserUpload-DdkcoZLH.js} +1 -1
  4. package/{esm/BrowserUpload-D2lemMIU.d.ts → cjs/BrowserUpload-zYWKtFSs.d.ts} +2 -2
  5. package/cjs/{CalmLensAppClient-nv6qwja0.js → CalmLensAppClient-Gu9mU_66.js} +22 -15
  6. package/{esm/CalmLensAppClient-Dt0t9Bk6.d.ts → cjs/CalmLensAppClient-mTTjqpRc.d.ts} +5 -11
  7. package/cjs/{CalmLensOptionKeys-BvCac9NO.js → CalmLensOptionKeys-BCITGsr9.js} +138 -90
  8. package/cjs/CalmLensServerClient-D5-njsNk.d.ts +357 -0
  9. package/cjs/{CalmLensServerClient-B60kCBCR.js → CalmLensServerClient-DHmAPT1u.js} +283 -303
  10. package/cjs/{CalmLensTypes-BhR7LFDu.d.ts → CalmLensTypes-Df8eBgWB.d.ts} +127 -59
  11. package/cjs/{Core-DSMxC2GL.d.ts → Core-CREGGR0L.d.ts} +10 -3
  12. package/cjs/{Core-Cw4IxFUq.js → Core-DAf9lqe2.js} +30 -12
  13. package/{esm/ModerationContextLimits-Bqr0duav.js → cjs/ModerationContextLimits-D4iwqoN_.js} +858 -28
  14. package/cjs/{ReactUpload--oDFltw2.js → ReactUpload-BNIbpxIH.js} +38 -2
  15. package/cjs/ReactUpload-D4htIz8X.d.ts +27 -0
  16. package/cjs/{UploadController-ObdgTaBl.js → UploadController-B_lKxvpM.js} +16 -3
  17. package/cjs/{WebhookPayload-DLGGOGW6.d.ts → WebhookPayload-DMa6ihHr.d.ts} +152 -3
  18. package/cjs/app.d.ts +5 -5
  19. package/cjs/app.js +20 -2
  20. package/cjs/elements.d.ts +5 -5
  21. package/cjs/elements.js +102 -67
  22. package/cjs/{index-AAWuerkU.d.ts → index-CtpQldn_.d.ts} +2 -2
  23. package/cjs/index.d.ts +4 -4
  24. package/cjs/index.js +19 -1
  25. package/cjs/react-native.d.ts +3 -3
  26. package/cjs/react-native.js +6 -4
  27. package/cjs/react.d.ts +5 -4
  28. package/cjs/react.js +10 -14
  29. package/cjs/server.d.ts +5 -5
  30. package/cjs/server.js +20 -2
  31. package/cjs/testing.d.ts +11 -9
  32. package/cjs/testing.js +72 -41
  33. package/cjs/{ui-CcuGKTcL.d.ts → ui-BwFPFrno.d.ts} +2 -2
  34. package/cjs/{ui-CA16jyfZ.js → ui-CvlJmRYM.js} +6 -4
  35. package/cjs/ui.d.ts +3 -3
  36. package/cjs/ui.js +4 -3
  37. package/cjs/vue.d.ts +15 -8
  38. package/cjs/vue.js +29 -16
  39. package/esm/{BrowserUpload-Co4T6uGk.js → BrowserUpload-BAWYEBd7.js} +1 -1
  40. package/{cjs/BrowserUpload-D2lemMIU.d.ts → esm/BrowserUpload-zYWKtFSs.d.ts} +2 -2
  41. package/esm/{CalmLensAppClient-BRzy4dwn.js → CalmLensAppClient-DNkIZb6x.js} +22 -15
  42. package/{cjs/CalmLensAppClient-Dt0t9Bk6.d.ts → esm/CalmLensAppClient-mTTjqpRc.d.ts} +5 -11
  43. package/esm/{CalmLensOptionKeys-bE3rb5PN.js → CalmLensOptionKeys-CYHJo3nV.js} +133 -91
  44. package/esm/{CalmLensServerClient-_PRi90wI.js → CalmLensServerClient-B1AiR4nv.js} +283 -303
  45. package/esm/CalmLensServerClient-D5-njsNk.d.ts +357 -0
  46. package/esm/{CalmLensTypes-BhR7LFDu.d.ts → CalmLensTypes-Df8eBgWB.d.ts} +127 -59
  47. package/esm/{Core-DSMxC2GL.d.ts → Core-CREGGR0L.d.ts} +10 -3
  48. package/esm/{Core-CtbYmeXG.js → Core-xNBQxZWH.js} +30 -12
  49. package/{cjs/ModerationContextLimits-Cn9RvnZH.js → esm/ModerationContextLimits-DxuPP4uM.js} +475 -285
  50. package/esm/{ReactUpload-B5itHBSF.js → ReactUpload-BWifQdLv.js} +34 -4
  51. package/esm/ReactUpload-D4htIz8X.d.ts +27 -0
  52. package/esm/{UploadController-C7fL3Iz9.js → UploadController-jlJdddyI.js} +11 -4
  53. package/esm/{WebhookPayload-DLGGOGW6.d.ts → WebhookPayload-DMa6ihHr.d.ts} +152 -3
  54. package/esm/app.d.ts +5 -5
  55. package/esm/app.js +3 -3
  56. package/esm/elements.d.ts +5 -5
  57. package/esm/elements.js +102 -68
  58. package/esm/{index-AAWuerkU.d.ts → index-CtpQldn_.d.ts} +2 -2
  59. package/esm/index.d.ts +4 -4
  60. package/esm/index.js +1 -1
  61. package/esm/react-native.d.ts +3 -3
  62. package/esm/react-native.js +5 -5
  63. package/esm/react.d.ts +5 -4
  64. package/esm/react.js +9 -15
  65. package/esm/server.d.ts +5 -5
  66. package/esm/server.js +3 -3
  67. package/esm/styles.css +28 -10
  68. package/esm/svelte/CalmLensUploader.svelte +17 -17
  69. package/esm/svelte/context.js +21 -0
  70. package/esm/svelte/index.d.ts +12 -0
  71. package/esm/svelte/index.js +1 -0
  72. package/esm/testing.d.ts +11 -9
  73. package/esm/testing.js +72 -41
  74. package/esm/{ui-B98AucZA.js → ui-BXzzqh7M.js} +6 -4
  75. package/esm/{ui-CcuGKTcL.d.ts → ui-BwFPFrno.d.ts} +2 -2
  76. package/esm/ui.d.ts +3 -3
  77. package/esm/ui.js +4 -4
  78. package/esm/vue.d.ts +15 -8
  79. package/esm/vue.js +29 -18
  80. package/package.json +16 -6
  81. package/cjs/CalmLensServerClient-7XjQaeKu.d.ts +0 -353
  82. package/cjs/ReactUpload-CW4NzAsh.d.ts +0 -17
  83. package/esm/CalmLensServerClient-7XjQaeKu.d.ts +0 -353
  84. package/esm/ReactUpload-CW4NzAsh.d.ts +0 -17
@@ -206,14 +206,13 @@ declare const ASSET_UPLOAD_SCHEMA: zod.ZodObject<{
206
206
  type AssetUpload$1 = zod.infer<typeof ASSET_UPLOAD_SCHEMA>;
207
207
  /** Findings and the policy/reviewer decision for the moderation capability. */
208
208
  declare const ASSET_MODERATION_SCHEMA: zod.ZodObject<{
209
- status: zod.ZodEnum<{
209
+ decision: zod.ZodNullable<zod.ZodEnum<{
210
210
  "age-restricted": "age-restricted";
211
211
  allowed: "allowed";
212
212
  blocked: "blocked";
213
213
  limited: "limited";
214
- pending: "pending";
215
214
  purged: "purged";
216
- }>;
215
+ }>>;
217
216
  manualReviews: zod.ZodArray<zod.ZodObject<{
218
217
  id: zod.ZodString;
219
218
  decision: zod.ZodEnum<{
@@ -5031,14 +5030,13 @@ declare const ASSET_CLASSIFICATION_SCHEMA: zod.ZodObject<{
5031
5030
  }, zod.core.$strip>>;
5032
5031
  testInput: zod.ZodBoolean;
5033
5032
  moderation: zod.ZodObject<{
5034
- status: zod.ZodEnum<{
5033
+ decision: zod.ZodNullable<zod.ZodEnum<{
5035
5034
  "age-restricted": "age-restricted";
5036
5035
  allowed: "allowed";
5037
5036
  blocked: "blocked";
5038
5037
  limited: "limited";
5039
- pending: "pending";
5040
5038
  purged: "purged";
5041
- }>;
5039
+ }>>;
5042
5040
  manualReviews: zod.ZodArray<zod.ZodObject<{
5043
5041
  id: zod.ZodString;
5044
5042
  decision: zod.ZodEnum<{
@@ -10154,14 +10152,13 @@ declare const ASSET_SCHEMA: zod.ZodObject<{
10154
10152
  }, zod.core.$strip>>;
10155
10153
  testInput: zod.ZodBoolean;
10156
10154
  moderation: zod.ZodObject<{
10157
- status: zod.ZodEnum<{
10155
+ decision: zod.ZodNullable<zod.ZodEnum<{
10158
10156
  "age-restricted": "age-restricted";
10159
10157
  allowed: "allowed";
10160
10158
  blocked: "blocked";
10161
10159
  limited: "limited";
10162
- pending: "pending";
10163
10160
  purged: "purged";
10164
- }>;
10161
+ }>>;
10165
10162
  manualReviews: zod.ZodArray<zod.ZodObject<{
10166
10163
  id: zod.ZodString;
10167
10164
  decision: zod.ZodEnum<{
@@ -15313,7 +15310,7 @@ type AssetBinaryPayloadInput = {
15313
15310
  buffer?: never;
15314
15311
  };
15315
15312
  declare const ASSET_SEARCH_MATCH_FIELD_SCHEMA: zod.ZodEnum<{
15316
- "classification.moderation.status": "classification.moderation.status";
15313
+ "classification.moderation.decision": "classification.moderation.decision";
15317
15314
  "content.extension": "content.extension";
15318
15315
  "content.format": "content.format";
15319
15316
  description: "description";
@@ -15410,14 +15407,13 @@ declare const ASSET_SEARCH_RESULT_SCHEMA: zod.ZodObject<{
15410
15407
  }, zod.core.$strip>>;
15411
15408
  testInput: zod.ZodBoolean;
15412
15409
  moderation: zod.ZodObject<{
15413
- status: zod.ZodEnum<{
15410
+ decision: zod.ZodNullable<zod.ZodEnum<{
15414
15411
  "age-restricted": "age-restricted";
15415
15412
  allowed: "allowed";
15416
15413
  blocked: "blocked";
15417
15414
  limited: "limited";
15418
- pending: "pending";
15419
15415
  purged: "purged";
15420
- }>;
15416
+ }>>;
15421
15417
  manualReviews: zod.ZodArray<zod.ZodObject<{
15422
15418
  id: zod.ZodString;
15423
15419
  decision: zod.ZodEnum<{
@@ -20459,7 +20455,7 @@ declare const ASSET_SEARCH_RESULT_SCHEMA: zod.ZodObject<{
20459
20455
  }, zod.core.$strip>;
20460
20456
  score: zod.ZodNumber;
20461
20457
  matchedFields: zod.ZodArray<zod.ZodEnum<{
20462
- "classification.moderation.status": "classification.moderation.status";
20458
+ "classification.moderation.decision": "classification.moderation.decision";
20463
20459
  "content.extension": "content.extension";
20464
20460
  "content.format": "content.format";
20465
20461
  description: "description";
@@ -37385,6 +37381,7 @@ declare const EVENT_TYPE_INFO: {
37385
37381
  configurator: "configurator";
37386
37382
  custom: "custom";
37387
37383
  editor: "editor";
37384
+ reviewer: "reviewer";
37388
37385
  viewer: "viewer";
37389
37386
  }>>;
37390
37387
  };
@@ -37392,7 +37389,7 @@ declare const EVENT_TYPE_INFO: {
37392
37389
  example: NoInfer<{
37393
37390
  memberUserId: string;
37394
37391
  memberName?: string | null | undefined;
37395
- role: "admin" | "configurator" | "custom" | "editor" | "viewer";
37392
+ role: "admin" | "configurator" | "custom" | "editor" | "reviewer" | "viewer";
37396
37393
  }>;
37397
37394
  factInfo: {
37398
37395
  label: string;
@@ -37423,6 +37420,7 @@ declare const EVENT_TYPE_INFO: {
37423
37420
  configurator: "configurator";
37424
37421
  custom: "custom";
37425
37422
  editor: "editor";
37423
+ reviewer: "reviewer";
37426
37424
  viewer: "viewer";
37427
37425
  }>;
37428
37426
  }, zod.core.$strip>;
@@ -37450,6 +37448,7 @@ declare const EVENT_TYPE_INFO: {
37450
37448
  configurator: "configurator";
37451
37449
  custom: "custom";
37452
37450
  editor: "editor";
37451
+ reviewer: "reviewer";
37453
37452
  viewer: "viewer";
37454
37453
  }>>;
37455
37454
  };
@@ -37457,7 +37456,7 @@ declare const EVENT_TYPE_INFO: {
37457
37456
  example: NoInfer<{
37458
37457
  memberUserId: string;
37459
37458
  memberName?: string | null | undefined;
37460
- role: "admin" | "configurator" | "custom" | "editor" | "viewer";
37459
+ role: "admin" | "configurator" | "custom" | "editor" | "reviewer" | "viewer";
37461
37460
  }>;
37462
37461
  factInfo: {
37463
37462
  label: string;
@@ -37488,6 +37487,7 @@ declare const EVENT_TYPE_INFO: {
37488
37487
  configurator: "configurator";
37489
37488
  custom: "custom";
37490
37489
  editor: "editor";
37490
+ reviewer: "reviewer";
37491
37491
  viewer: "viewer";
37492
37492
  }>;
37493
37493
  }, zod.core.$strip>;
@@ -37515,6 +37515,7 @@ declare const EVENT_TYPE_INFO: {
37515
37515
  configurator: "configurator";
37516
37516
  custom: "custom";
37517
37517
  editor: "editor";
37518
+ reviewer: "reviewer";
37518
37519
  viewer: "viewer";
37519
37520
  }>>;
37520
37521
  };
@@ -37522,7 +37523,7 @@ declare const EVENT_TYPE_INFO: {
37522
37523
  example: NoInfer<{
37523
37524
  memberUserId: string;
37524
37525
  memberName?: string | null | undefined;
37525
- role: "admin" | "configurator" | "custom" | "editor" | "viewer";
37526
+ role: "admin" | "configurator" | "custom" | "editor" | "reviewer" | "viewer";
37526
37527
  }>;
37527
37528
  factInfo: {
37528
37529
  label: string;
@@ -37553,6 +37554,7 @@ declare const EVENT_TYPE_INFO: {
37553
37554
  configurator: "configurator";
37554
37555
  custom: "custom";
37555
37556
  editor: "editor";
37557
+ reviewer: "reviewer";
37556
37558
  viewer: "viewer";
37557
37559
  }>;
37558
37560
  }, zod.core.$strip>;
@@ -37580,6 +37582,7 @@ declare const EVENT_TYPE_INFO: {
37580
37582
  configurator: "configurator";
37581
37583
  custom: "custom";
37582
37584
  editor: "editor";
37585
+ reviewer: "reviewer";
37583
37586
  viewer: "viewer";
37584
37587
  }>>;
37585
37588
  role: EventFieldDefinition<zod.ZodEnum<{
@@ -37587,6 +37590,7 @@ declare const EVENT_TYPE_INFO: {
37587
37590
  configurator: "configurator";
37588
37591
  custom: "custom";
37589
37592
  editor: "editor";
37593
+ reviewer: "reviewer";
37590
37594
  viewer: "viewer";
37591
37595
  }>>;
37592
37596
  };
@@ -37594,8 +37598,8 @@ declare const EVENT_TYPE_INFO: {
37594
37598
  example: NoInfer<{
37595
37599
  memberUserId: string;
37596
37600
  memberName?: string | null | undefined;
37597
- previousRole: "admin" | "configurator" | "custom" | "editor" | "viewer";
37598
- role: "admin" | "configurator" | "custom" | "editor" | "viewer";
37601
+ previousRole: "admin" | "configurator" | "custom" | "editor" | "reviewer" | "viewer";
37602
+ role: "admin" | "configurator" | "custom" | "editor" | "reviewer" | "viewer";
37599
37603
  }>;
37600
37604
  factInfo: {
37601
37605
  label: string;
@@ -37626,6 +37630,7 @@ declare const EVENT_TYPE_INFO: {
37626
37630
  configurator: "configurator";
37627
37631
  custom: "custom";
37628
37632
  editor: "editor";
37633
+ reviewer: "reviewer";
37629
37634
  viewer: "viewer";
37630
37635
  }>;
37631
37636
  role: zod.ZodEnum<{
@@ -37633,6 +37638,7 @@ declare const EVENT_TYPE_INFO: {
37633
37638
  configurator: "configurator";
37634
37639
  custom: "custom";
37635
37640
  editor: "editor";
37641
+ reviewer: "reviewer";
37636
37642
  viewer: "viewer";
37637
37643
  }>;
37638
37644
  }, zod.core.$strip>;
@@ -37659,13 +37665,14 @@ declare const EVENT_TYPE_INFO: {
37659
37665
  configurator: "configurator";
37660
37666
  custom: "custom";
37661
37667
  editor: "editor";
37668
+ reviewer: "reviewer";
37662
37669
  viewer: "viewer";
37663
37670
  }>>;
37664
37671
  };
37665
37672
  /** Example data, used for synthetic test sends (`createSampleEvent`). */
37666
37673
  example: NoInfer<{
37667
37674
  inviteeEmail: string;
37668
- role: "admin" | "configurator" | "custom" | "editor" | "viewer";
37675
+ role: "admin" | "configurator" | "custom" | "editor" | "reviewer" | "viewer";
37669
37676
  }>;
37670
37677
  factInfo: {
37671
37678
  label: string;
@@ -37695,6 +37702,7 @@ declare const EVENT_TYPE_INFO: {
37695
37702
  configurator: "configurator";
37696
37703
  custom: "custom";
37697
37704
  editor: "editor";
37705
+ reviewer: "reviewer";
37698
37706
  viewer: "viewer";
37699
37707
  }>;
37700
37708
  }, zod.core.$strip>;
@@ -38200,14 +38208,13 @@ declare const EVENT_ASSET_SCHEMA: zod.ZodObject<{
38200
38208
  }>;
38201
38209
  testInput: zod.ZodBoolean;
38202
38210
  moderation: zod.ZodObject<{
38203
- status: zod.ZodEnum<{
38211
+ decision: zod.ZodNullable<zod.ZodEnum<{
38204
38212
  "age-restricted": "age-restricted";
38205
38213
  allowed: "allowed";
38206
38214
  blocked: "blocked";
38207
38215
  limited: "limited";
38208
- pending: "pending";
38209
38216
  purged: "purged";
38210
- }>;
38217
+ }>>;
38211
38218
  }, zod.core.$strip>;
38212
38219
  }, zod.core.$strip>;
38213
38220
  content: zod.ZodObject<{
@@ -38294,14 +38301,13 @@ declare const PUBLIC_EVENT_SCHEMA: zod.ZodObject<{
38294
38301
  }>;
38295
38302
  testInput: zod.ZodBoolean;
38296
38303
  moderation: zod.ZodObject<{
38297
- status: zod.ZodEnum<{
38304
+ decision: zod.ZodNullable<zod.ZodEnum<{
38298
38305
  "age-restricted": "age-restricted";
38299
38306
  allowed: "allowed";
38300
38307
  blocked: "blocked";
38301
38308
  limited: "limited";
38302
- pending: "pending";
38303
38309
  purged: "purged";
38304
- }>;
38310
+ }>>;
38305
38311
  }, zod.core.$strip>;
38306
38312
  }, zod.core.$strip>;
38307
38313
  content: zod.ZodObject<{
@@ -42570,8 +42576,8 @@ type AssetClassification = Omit<AssetClassification$1, "status" | "failureReason
42570
42576
  moderation: AssetModeration;
42571
42577
  };
42572
42578
  /** An asset's moderation state. */
42573
- type AssetModeration = Omit<AssetModeration$1, "status" | "manualReviews"> & {
42574
- status: AssetModerationStatus;
42579
+ type AssetModeration = Omit<AssetModeration$1, "decision" | "manualReviews"> & {
42580
+ decision: AssetModerationDecision | null;
42575
42581
  manualReviews: Array<Omit<AssetModeration$1["manualReviews"][number], "decision"> & {
42576
42582
  decision: AssetModerationDecision;
42577
42583
  }>;
@@ -42586,7 +42592,7 @@ type AssetUploadStatus = AssetUpload$1["status"];
42586
42592
  /** An asset as the API returns it. Fields the API adds later are present at runtime too. */
42587
42593
  type Asset = Omit<Asset$1, "type" | "visibility" | "upload" | "classification" | "content"> & {
42588
42594
  type: AssetType;
42589
- visibility?: AssetVisibility | null;
42595
+ visibility: AssetVisibility;
42590
42596
  upload: AssetUpload;
42591
42597
  classification: AssetClassification;
42592
42598
  content: AssetContent;
@@ -42708,8 +42714,9 @@ type CdnTransform = string | ImageTransformOptions;
42708
42714
  type Lens = Omit<zod.infer<typeof PUBLIC_LENS_SCHEMA>, "transform"> & {
42709
42715
  transform?: ImageTransformOptions | null;
42710
42716
  };
42711
- interface RequestOptions {
42712
- /** Cancels every request made with these options. */
42717
+ /** How a client's requests are sent: its defaults for every call. */
42718
+ interface ClientRequestDefaults {
42719
+ /** Cancels every request the client makes. */
42713
42720
  signal?: AbortSignal;
42714
42721
  /**
42715
42722
  * Deadline in milliseconds for each API request attempt, including reading the response
@@ -42730,9 +42737,70 @@ interface RequestOptions {
42730
42737
  */
42731
42738
  maxRetries?: number;
42732
42739
  }
42740
+ /**
42741
+ * Options for one call, the optional last argument of every method that sends a request. They
42742
+ * override the client's for that call only, and apply to every request it sends: each page a
42743
+ * list's iteration fetches, each check `waitForDecision` makes, each part of an upload.
42744
+ */
42745
+ interface RequestOptions {
42746
+ /** Cancels this call, as well as the client's `signal`. */
42747
+ signal?: AbortSignal;
42748
+ /** Deadline in milliseconds for each attempt of this call's requests. */
42749
+ timeoutMs?: number;
42750
+ /** How many times to retry this call's requests; 0 turns retries off. */
42751
+ maxRetries?: number;
42752
+ /**
42753
+ * Sent as `Idempotency-Key`, which also makes a create, upload or other POST safe to retry.
42754
+ * Uploads generate one when you pass none.
42755
+ */
42756
+ idempotencyKey?: string;
42757
+ /** Extra headers. The SDK's own (`X-Api-Key`, `User-Agent`, `Idempotency-Key`) win. */
42758
+ headers?: Record<string, string>;
42759
+ /**
42760
+ * Query parameters to add, sent as they are without the SDK's option check, for API fields
42761
+ * this SDK version doesn't know yet.
42762
+ */
42763
+ extraQuery?: Record<string, unknown>;
42764
+ /**
42765
+ * Fields to add to a JSON body (or an upload's options), sent without the SDK's option check,
42766
+ * for API fields this SDK version doesn't know yet.
42767
+ */
42768
+ extraBody?: Record<string, unknown>;
42769
+ }
42770
+ /** The app a client is part of, which the SDK appends to its user agent as `name/version (url)`. */
42771
+ interface AppInfo {
42772
+ name: string;
42773
+ version?: string;
42774
+ url?: string;
42775
+ }
42776
+ /**
42777
+ * One attempt of a request, as the `onAttempt` hook receives it. It never holds the API key, an
42778
+ * upload token, the query (which can hold viewer claims) or a body.
42779
+ */
42780
+ interface RequestAttempt {
42781
+ /** The client method that sent it, such as `assets.retrieve`; `null` for `client.request`. */
42782
+ operation: string | null;
42783
+ method: string;
42784
+ /** The URL path, without the query. */
42785
+ path: string;
42786
+ /** 1 for the first attempt, 2 for the first retry, and so on. */
42787
+ attempt: number;
42788
+ /** How long the client waits before retrying, or `null` when this attempt is the last. */
42789
+ delayMs: number | null;
42790
+ /** The HTTP status, or `null` when no response arrived. */
42791
+ status: number | null;
42792
+ /** The `X-Request-Id` header, or `null`. */
42793
+ requestId: string | null;
42794
+ durationMs: number;
42795
+ /** The error's code when the attempt failed, such as `sdk/timeout` or `asset/not-found`. */
42796
+ errorCode: string | null;
42797
+ }
42733
42798
  /** Where a client sends requests and how. */
42734
- interface ConnectionOptions extends RequestOptions {
42735
- /** Defaults to `https://api.calmlens.com/v1`. */
42799
+ interface ConnectionOptions extends ClientRequestDefaults {
42800
+ /**
42801
+ * Defaults to `https://api.calmlens.com/v1`. The server client reads `CALMLENS_BASE_URL` from
42802
+ * the environment when you leave it out.
42803
+ */
42736
42804
  baseUrl?: string;
42737
42805
  /** The `fetch` used for every request. Defaults to the global `fetch`. */
42738
42806
  fetch?: typeof fetch;
@@ -42747,12 +42815,30 @@ interface ConnectionOptions extends RequestOptions {
42747
42815
  * defaults to 8 MiB.
42748
42816
  */
42749
42817
  partSizeBytes?: number;
42818
+ /** Your app, appended to the user agent as `name/version (url)`. Server runtimes only. */
42819
+ appInfo?: AppInfo;
42820
+ /**
42821
+ * `info` logs retries and failed requests, `debug` every attempt. The server client reads
42822
+ * `CALMLENS_LOG` from the environment when you leave it out; otherwise it is `off`.
42823
+ */
42824
+ logLevel?: "off" | "info" | "debug";
42825
+ /** Where the client logs. Defaults to `console`. */
42826
+ logger?: {
42827
+ debug(message: string): void;
42828
+ info(message: string): void;
42829
+ };
42830
+ /**
42831
+ * Called after every request attempt, with its operation, path, status, request ID, duration
42832
+ * and the delay before a retry. Errors it throws are ignored.
42833
+ */
42834
+ onAttempt?: (attempt: RequestAttempt) => void;
42750
42835
  }
42751
42836
  /** Options for `CalmLensServerClient`, which runs on your server with a project API key. */
42752
42837
  interface CalmLensServerClientOptions extends ConnectionOptions {
42753
- /** A project API key. Keep it on your server. */
42754
- apiKey: string;
42755
- projectId: string;
42838
+ /** A project API key. Keep it on your server. Defaults to `CALMLENS_API_KEY`. */
42839
+ apiKey?: string;
42840
+ /** Defaults to `CALMLENS_PROJECT_ID`. */
42841
+ projectId?: string;
42756
42842
  /** Defaults to `https://cdn.calmlens.com/v1`. */
42757
42843
  cdnBaseUrl?: string;
42758
42844
  /** Overrides `fetch` for `cdn.serve`. */
@@ -42824,7 +42910,7 @@ interface UploadedAsset {
42824
42910
  failureReason: AssetClassificationFailureReason | null;
42825
42911
  /** The moderation decision, present only when the preset shows decisions to uploaders. */
42826
42912
  moderation?: {
42827
- status: AssetModerationStatus;
42913
+ decision: AssetModerationDecision | null;
42828
42914
  };
42829
42915
  };
42830
42916
  }
@@ -42922,8 +43008,6 @@ interface EnsureLensesOptions {
42922
43008
  }
42923
43009
  /** `lenses.list` options: a page of the project's lenses, newest first unless `sort` says otherwise. */
42924
43010
  type ListLensesOptions = Partial<GetLensesQuery>;
42925
- /** `lenses.iterate` options: the sort and page size; pages are fetched as needed. */
42926
- type IterateLensesOptions = Omit<ListLensesOptions, "cursor">;
42927
43011
  type LensPage = CursorPage<Lens>;
42928
43012
  /** A new lens: its identifier must be new to the project. */
42929
43013
  type CreateLensOptions = EnsureLensOptions;
@@ -42937,8 +43021,6 @@ type UpdateLensOptions = PatchLensBody & LensIdOptions;
42937
43021
  * `folderId==fldr_…`.
42938
43022
  */
42939
43023
  type ListAssetsOptions = Partial<GetAssetsPageQuery>;
42940
- /** `assets.iterate` options: list filters and page size; pages are fetched as needed. */
42941
- type IterateAssetsOptions = Omit<ListAssetsOptions, "cursor">;
42942
43024
  type ListEventsOptions = GetEventsQuery;
42943
43025
  interface RetrieveAssetOptions {
42944
43026
  assetId: string;
@@ -42994,8 +43076,6 @@ interface MoveFolderOptions extends FolderIdOptions {
42994
43076
  }
42995
43077
  /** `hashLists.list` options: a page of the project's hash lists, newest first unless `sort` says otherwise. */
42996
43078
  type ListHashListsOptions = Partial<GetHashListsQuery>;
42997
- /** `hashLists.iterate` options. */
42998
- type IterateHashListsOptions = Omit<ListHashListsOptions, "cursor">;
42999
43079
  type HashListPage = GetHashListsResponse;
43000
43080
  type CreateHashListOptions = PostHashListBody;
43001
43081
  type UpdateHashListOptions = PatchHashListBody & {
@@ -43005,8 +43085,6 @@ interface HashListIdOptions {
43005
43085
  hashListId: string;
43006
43086
  }
43007
43087
  type ListHashListEntriesOptions = Partial<GetHashListEntriesQuery> & HashListIdOptions;
43008
- /** `hashLists.iterateEntries` options. */
43009
- type IterateHashListEntriesOptions = Omit<ListHashListEntriesOptions, "cursor">;
43010
43088
  type HashListEntryPage = GetHashListEntriesResponse;
43011
43089
  /** Send `hash` (and `quality` when you know it) or `assetId`, an image asset in the project. */
43012
43090
  type AddHashListEntryOptions = PostHashListEntryBody & HashListIdOptions;
@@ -43015,8 +43093,6 @@ interface HashListEntryIdOptions {
43015
43093
  }
43016
43094
  /** `policies.list` options: a page of the organisation's policies, oldest first unless `sort` says otherwise. */
43017
43095
  type ListPoliciesOptions = Partial<GetPoliciesQuery>;
43018
- /** `policies.iterate` options. */
43019
- type IteratePoliciesOptions = Omit<ListPoliciesOptions, "cursor">;
43020
43096
  type PolicyPage = GetPoliciesResponse;
43021
43097
  /** Send `settings` and a `name`, or `presetId` to copy the latest release of a built-in preset. */
43022
43098
  type CreatePolicyOptions = PostPolicyBody;
@@ -43033,8 +43109,6 @@ type SetPolicyAutomaticUpdatesOptions = PutPolicyAutomaticUpdatesBody & PolicyId
43033
43109
  type AssignPolicyOptions = PutProjectPolicyBody;
43034
43110
  /** `uploadPresets.list` options: a page of the project's upload presets, oldest first unless `sort` says otherwise. */
43035
43111
  type ListUploadPresetsOptions = Partial<GetUploadPresetsQuery>;
43036
- /** `uploadPresets.iterate` options. */
43037
- type IterateUploadPresetsOptions = Omit<ListUploadPresetsOptions, "cursor">;
43038
43112
  type UploadPresetPage = GetUploadPresetsResponse;
43039
43113
  /**
43040
43114
  * One preset's whole definition, by `key`; fields left out take their defaults. Send the
@@ -43067,14 +43141,10 @@ interface MoveAssetOptions {
43067
43141
  type ListAssetChildrenOptions = Partial<GetAssetChildrenQuery> & {
43068
43142
  assetId: string;
43069
43143
  };
43070
- /** `assets.iterateChildren` options. */
43071
- type IterateAssetChildrenOptions = Omit<ListAssetChildrenOptions, "cursor">;
43072
43144
  /** `assets.listTimeline` options. */
43073
43145
  type ListAssetTimelineOptions = Partial<GetAssetTimelineQuery> & {
43074
43146
  assetId: string;
43075
43147
  };
43076
- /** `assets.iterateTimeline` options. */
43077
- type IterateAssetTimelineOptions = Omit<ListAssetTimelineOptions, "cursor">;
43078
43148
  type AssetContentOptions = AssetBinaryPayloadInput & {
43079
43149
  type: string;
43080
43150
  sizeInBytes?: number;
@@ -43111,14 +43181,14 @@ interface SubmitAssetCommonOptions extends IdempotencyOptions {
43111
43181
  * Your identifier for who wrote the content. CalmLens only compares it with the author IDs in
43112
43182
  * `context`, to tell which posts share a speaker.
43113
43183
  */
43114
- authorId?: string;
43184
+ authorId?: string | null;
43115
43185
  /**
43116
43186
  * Earlier posts in the conversation, oldest first. CalmLens moderates only the content and uses
43117
43187
  * these to read who it addresses, what it refers to and whether it quotes, reports, counters
43118
43188
  * or mocks something. The SDK sends only the posts CalmLens uses: the most recent 5 that fit
43119
43189
  * in 2,000 characters.
43120
43190
  */
43121
- context?: ModerationContext;
43191
+ context?: ModerationContext | null;
43122
43192
  externalId?: string;
43123
43193
  externalUrl?: string;
43124
43194
  folderId?: string | null;
@@ -43174,13 +43244,11 @@ interface VerifyWebhookSignatureOptions {
43174
43244
  /** The current time, as a `Date` or milliseconds since the epoch. Defaults to `Date.now()`. */
43175
43245
  now?: Date | number;
43176
43246
  }
43177
- interface ClassifyTextOptions extends Omit<SubmitAssetCommonOptions, "name" | "visibility" | "isFinal"> {
43247
+ interface ClassifyTextOptions extends Omit<SubmitAssetCommonOptions, "name" | "isFinal"> {
43178
43248
  text: string;
43179
43249
  name?: string;
43180
43250
  }
43181
43251
  /** `folders.list` options. `sort` is `name` (the default) or `createdAt`, descending when prefixed with `-`. */
43182
43252
  type ListFoldersOptions = GetFoldersQuery;
43183
- /** `folders.iterate` options. */
43184
- type IterateFoldersOptions = Omit<ListFoldersOptions, "cursor">;
43185
43253
  type FolderPage = GetFoldersResponse;
43186
- export { GetAssetInfoOptions as $, MetadataItem as $n, UpgradePolicyOptions as $t, CdnAssetReference as A, BoundingBox as An, MultipartUploadOptions as At, CreateMultipartUploadPartOptions as B, AssetSearchMatchField as Bn, SetPolicyAutomaticUpdatesOptions as Bt, AssetVisibility as C, PermissionGrant as Cn, ListHashListEntriesOptions as Ct, CalmLensAppClientOptions as D, PublicProjectSettings as Dn, ListUploadPresetsOptions as Dt, BatchAssetsResponse as E, ProjectSettingsResource as En, ListPoliciesOptions as Et, ClassifyTextOptions as F, ProcessingFeatureStage as Fn, RequestOptions as Ft, EnsureLensOptions as G, AssetHlsRendition as Gn, StreamingFeatureOptions as Gt, DecideAssetOptions as H, AssetBinaryPayloadInput as Hn, SignUploadTokenOptions as Ht, ConnectionOptions as I, ProcessingFeatures as In, ResetPolicyOptions as It, EnsureUploadPresetsOptions as J, AssetRenderedKind as Jn, UpdateFolderOptions as Jt, EnsureLensesOptions as K, AssetPreview as Kn, SubmitAssetOptions as Kt, CreateFolderOptions as L, Policy as Ln, RetrieveAssetOptions as Lt, CdnResource as M, DetectedPerson as Mn, PolicyIdOptions as Mt, CdnServeOptions as N, ProcessingFeatureId as Nn, PolicyPage as Nt, CalmLensServerClientOptions as O, UploadPreset as On, MoveAssetOptions as Ot, CdnTransform as P, ProcessingFeatureResults as Pn, RemoveAssetContentOptions as Pt, FolderPage as Q, FileMetadata as Qn, UpdateProjectSettingsOptions as Qt, CreateHashListOptions as R, CursorPage as Rn, RetryAssetOptions as Rt, AssetUploadStatus as S, EventType as Sn, ListFoldersOptions as St, BatchAssetsOptions as T, MetadataFieldsResource as Tn, ListLensesOptions as Tt, DeleteAssetOptions as U, AssetInfo as Un, SignedAssetUrl as Ut, CreatePolicyOptions as V, AssetSearchQuery as Vn, SignAssetUrlOptions as Vt, DeleteMetadataFieldOptions as W, AssetHls as Wn, SignedUploadToken as Wt, ExplainAssetOptions as X, AssetSafetyHoldReason as Xn, UpdateLensOptions as Xt, EnsureUploadPresetsResponse as Y, AssetSafetyHold as Yn, UpdateHashListOptions as Yt, FolderIdOptions as Z, ExtractedText as Zn, UpdatePolicyOptions as Zt, AssetSearchResponse as _, EventCategory as _n, LensPage as _t, AssetChildrenPage as a, UploadedAsset as an, ImageTransformOptions as at, AssetType as b, EventFacts as bn, ListAssetsOptions as bt, AssetClassificationStatus as c, WaitForAssetDecisionOptions as cn, IterateAssetsOptions as ct, AssetContentRemovalReason as d, AssetBatchOperation as dn, IterateHashListsOptions as dt, UploadAssetPartOptions as en, ProcessingOptions as er, HashListEntryIdOptions as et, AssetContentStatus as f, AssetTimelineSegment as fn, IterateLensesOptions as ft, AssetPage as g, TypedEvent as gn, LensIdOptions as gt, AssetModerationStatus as h, EventAsset as hn, Lens as ht, AssetChecksums as i, UploadPresetSubmitAssetOptions as in, IdempotencyOptions as it, CdnAssetUrlOptions as j, DetectedFace as jn, MultipartUploadPartOptions as jt, CdnAssetLocation as k, AgeRange as kn, MoveFolderOptions as kt, AssetContent as l, WebhookHeadersInput as ln, IterateFoldersOptions as lt, AssetModerationDecision as m, Actor as mn, IterateUploadPresetsOptions as mt, Asset as n, UploadPresetIdOptions as nn, HashListIdOptions as nt, AssetClassification as o, VerifyWebhookSignatureOptions as on, IterateAssetChildrenOptions as ot, AssetModeration as p, GetEventsResponse as pn, IteratePoliciesOptions as pt, EnsureMetadataFieldsOptions as q, AssetRendered as qn, UpdateAssetOptions as qt, AssetAvailability as r, UploadPresetPage as rn, HashListPage as rt, AssetClassificationFailureReason as s, ViewerClaims as sn, IterateAssetTimelineOptions as st, AddHashListEntryOptions as t, UploadPresetDefinition as tn, HashListEntryPage as tt, AssetContentOptions as u, WebhookPayloadInput as un, IterateHashListEntriesOptions as ut, AssetSearchResult as v, EventFact as vn, ListAssetChildrenOptions as vt, AssignPolicyOptions as w, Folder as wn, ListHashListsOptions as wt, AssetUpload as x, EventSeverity as xn, ListEventsOptions as xt, AssetTimelinePage as y, EventFactValues as yn, ListAssetTimelineOptions as yt, CreateLensOptions as z, LensType as zn, SearchAssetsOptions as zt };
43254
+ export { FolderIdOptions as $, UploadedAsset as $t, CdnAssetLocation as A, ProcessingFeatures as An, ResetPolicyOptions as At, CreateHashListOptions as B, AssetPreview as Bn, SubmitAssetOptions as Bt, AssetUploadStatus as C, AgeRange as Cn, MultipartUploadOptions as Ct, BatchAssetsResponse as D, ProcessingFeatureId as Dn, RemoveAssetContentOptions as Dt, BatchAssetsOptions as E, DetectedPerson as En, PolicyPage as Et, CdnTransform as F, AssetSearchQuery as Fn, SignAssetUrlOptions as Ft, DeleteAssetOptions as G, ExtractedText as Gn, UpdatePolicyOptions as Gt, CreateMultipartUploadPartOptions as H, AssetRenderedKind as Hn, UpdateFolderOptions as Ht, ClassifyTextOptions as I, AssetBinaryPayloadInput as In, SignUploadTokenOptions as It, EnsureLensesOptions as J, ProcessingOptions as Jn, UploadAssetPartOptions as Jt, DeleteMetadataFieldOptions as K, FileMetadata as Kn, UpdateProjectSettingsOptions as Kt, ClientRequestDefaults as L, AssetInfo as Ln, SignedAssetUrl as Lt, CdnAssetUrlOptions as M, CursorPage as Mn, RetryAssetOptions as Mt, CdnResource as N, LensType as Nn, SearchAssetsOptions as Nt, CalmLensAppClientOptions as O, ProcessingFeatureResults as On, RequestAttempt as Ot, CdnServeOptions as P, AssetSearchMatchField as Pn, SetPolicyAutomaticUpdatesOptions as Pt, ExplainAssetOptions as Q, UploadPresetSubmitAssetOptions as Qt, ConnectionOptions as R, AssetHls as Rn, SignedUploadToken as Rt, AssetUpload as S, UploadPreset as Sn, MoveFolderOptions as St, AssignPolicyOptions as T, DetectedFace as Tn, PolicyIdOptions as Tt, CreatePolicyOptions as U, AssetSafetyHold as Un, UpdateHashListOptions as Ut, CreateLensOptions as V, AssetRendered as Vn, UpdateAssetOptions as Vt, DecideAssetOptions as W, AssetSafetyHoldReason as Wn, UpdateLensOptions as Wt, EnsureUploadPresetsOptions as X, UploadPresetIdOptions as Xt, EnsureMetadataFieldsOptions as Y, UploadPresetDefinition as Yt, EnsureUploadPresetsResponse as Z, UploadPresetPage as Zt, AssetPage as _, PermissionGrant as _n, ListHashListsOptions as _t, AssetChecksums as a, AssetBatchOperation as an, HashListPage as at, AssetTimelinePage as b, ProjectSettingsResource as bn, ListUploadPresetsOptions as bt, AssetClassificationFailureReason as c, Actor as cn, Lens as ct, AssetContentOptions as d, EventCategory as dn, ListAssetChildrenOptions as dt, VerifyWebhookSignatureOptions as en, FolderPage as et, AssetContentRemovalReason as f, EventFact as fn, ListAssetTimelineOptions as ft, AssetModerationStatus as g, EventType as gn, ListHashListEntriesOptions as gt, AssetModerationDecision as h, EventSeverity as hn, ListFoldersOptions as ht, AssetAvailability as i, WebhookPayloadInput as in, HashListIdOptions as it, CdnAssetReference as j, Policy as jn, RetrieveAssetOptions as jt, CalmLensServerClientOptions as k, ProcessingFeatureStage as kn, RequestOptions as kt, AssetClassificationStatus as l, EventAsset as ln, LensIdOptions as lt, AssetModeration as m, EventFacts as mn, ListEventsOptions as mt, AppInfo as n, WaitForAssetDecisionOptions as nn, HashListEntryIdOptions as nt, AssetChildrenPage as o, AssetTimelineSegment as on, IdempotencyOptions as ot, AssetContentStatus as p, EventFactValues as pn, ListAssetsOptions as pt, EnsureLensOptions as q, MetadataItem as qn, UpgradePolicyOptions as qt, Asset as r, WebhookHeadersInput as rn, HashListEntryPage as rt, AssetClassification as s, GetEventsResponse as sn, ImageTransformOptions as st, AddHashListEntryOptions as t, ViewerClaims as tn, GetAssetInfoOptions as tt, AssetContent as u, TypedEvent as un, LensPage as ut, AssetSearchResponse as v, Folder as vn, ListLensesOptions as vt, AssetVisibility as w, BoundingBox as wn, MultipartUploadPartOptions as wt, AssetType as x, PublicProjectSettings as xn, MoveAssetOptions as xt, AssetSearchResult as y, MetadataFieldsResource as yn, ListPoliciesOptions as yt, CreateFolderOptions as z, AssetHlsRendition as zn, StreamingFeatureOptions as zt };
@@ -1,5 +1,5 @@
1
- import { D as CalmLensAppClientOptions, P as CdnTransform, h as AssetModerationStatus, r as AssetAvailability, sn as ViewerClaims } from "./CalmLensTypes-BhR7LFDu.js";
2
- import { t as CalmLensAppClient } from "./CalmLensAppClient-Dt0t9Bk6.js";
1
+ import { F as CdnTransform, O as CalmLensAppClientOptions, g as AssetModerationStatus, i as AssetAvailability, tn as ViewerClaims } from "./CalmLensTypes-Df8eBgWB.js";
2
+ import { t as CalmLensAppClient } from "./CalmLensAppClient-mTTjqpRc.js";
3
3
  import { o as UploadFileIconFamily } from "./FileIcons-4qSX7DW2.js";
4
4
  /**
5
5
  * The text the asset viewers show, keyed by name. `{name}` placeholders are filled in when shown.
@@ -592,6 +592,13 @@ declare class UploadController<F extends UploadFile = UploadFile> {
592
592
  clear(): void;
593
593
  }
594
594
  declare const createUploadController: <F extends UploadFile = UploadFile>(options: UploadControllerOptions<F>) => UploadController<F>;
595
+ /**
596
+ * The upload options a provider (`CalmLensProvider`, `provideCalmLens`, `setCalmLensContext`)
597
+ * gives every uploader and upload hook beneath it.
598
+ */
599
+ type CalmLensProvidedOptions<F extends UploadFile = UploadFile> = Pick<UploadControllerOptions<F>, "uploadPresetId" | "token" | "tokenUrl" | "baseUrl" | "createClient" | "upload" | "checkStatus">;
600
+ /** `options` over what a provider gives: an option an uploader sets (not `undefined`) wins. */
601
+ declare const withProvidedOptions: <O extends object>(provided: CalmLensProvidedOptions<any> | undefined, options: O) => O;
595
602
  /**
596
603
  * The text the components show. Pass `messages` to any component to replace some or all of it,
597
604
  * for example to translate it. Keys other than the named ones are error codes, so you can give
@@ -824,4 +831,4 @@ declare const CALMLENS_THEME: {
824
831
  * as the stylesheet mixes them from the page's text colour.
825
832
  */
826
833
  declare const resolveTheme: (overrides?: Partial<CalmLensTheme>) => CalmLensTheme;
827
- export { getAssetViewKey as $, CustomUploadResult as A, AssetDisplay as B, formatMessage as C, resolveMessages as D, getUploadItemOutcome as E, UploadItem as F, AssetSession as G, AssetImageOptions as H, UploadSnapshot as I, AssetVideoOptions as J, AssetSessionState as K, UploadStage as L, UploadController as M, UploadControllerOptions as N, CalmLensUpload as O, UploadFile as P, getAssetView as Q, createUploadController as R, formatBytes as S, getUploadItemMessage as T, AssetImageSource as U, AssetDocumentOptions as V, AssetOptions as W, MediaPlayback as X, AssetView as Y, getAssetAspectRatio as Z, DEFAULT_MESSAGES as _, formatViewerMessage as _t, ProgressFetchOptions as a, ImageViewerOptions as at, describeUploadItem as b, ICON_ATTRIBUTES as c, TextViewerOptions as ct, AssetDisplayOptions as d, ViewerTextOptions as dt, getPeakHeights as et, AssetEventHandlers as f, WebsiteViewerOptions as ft, CalmLensMessages as g, ViewerMessages as gt, UploaderProps as h, DEFAULT_VIEWER_MESSAGES as ht, CALMLENS_STYLES as i, DocumentViewerOptions as it, UploadClient as j, CustomUploadContext as k, IconName as l, ViewerAsset as lt, UploaderDisplayOptions as m, isSpreadsheetFormat as mt, CalmLensTheme as n, pickAssetSource as nt, createProgressFetch as o, PdfAssetOptions as ot, AssetProps as p, getAssetViewerKind as pt, AssetSpreadsheetOptions as q, resolveTheme as r, AssetViewerKind as rt, ICONS as s, SpreadsheetViewerOptions as st, CALMLENS_THEME as t, getPlayedPercent as tt, ASSET_FILE_ICON_SIZE as u, ViewerOptions as ut, UploadItemView as v, resolveViewerMessages as vt, getDropzoneHint as w, describeUploader as x, UploaderView as y, isFileAccepted as z };
834
+ export { getAssetAspectRatio as $, CustomUploadContext as A, isFileAccepted as B, formatMessage as C, resolveMessages as D, getUploadItemOutcome as E, UploadFile as F, AssetImageSource as G, AssetDisplay as H, UploadItem as I, AssetSessionState as J, AssetOptions as K, UploadSnapshot as L, UploadClient as M, UploadController as N, CalmLensProvidedOptions as O, UploadControllerOptions as P, MediaPlayback as Q, UploadStage as R, formatBytes as S, getUploadItemMessage as T, AssetDocumentOptions as U, withProvidedOptions as V, AssetImageOptions as W, AssetVideoOptions as X, AssetSpreadsheetOptions as Y, AssetView as Z, DEFAULT_MESSAGES as _, DEFAULT_VIEWER_MESSAGES as _t, ProgressFetchOptions as a, AssetViewerKind as at, describeUploadItem as b, resolveViewerMessages as bt, ICON_ATTRIBUTES as c, PdfAssetOptions as ct, AssetDisplayOptions as d, ViewerAsset as dt, getAssetView as et, AssetEventHandlers as f, ViewerOptions as ft, CalmLensMessages as g, isSpreadsheetFormat as gt, UploaderProps as h, getAssetViewerKind as ht, CALMLENS_STYLES as i, pickAssetSource as it, CustomUploadResult as j, CalmLensUpload as k, IconName as l, SpreadsheetViewerOptions as lt, UploaderDisplayOptions as m, WebsiteViewerOptions as mt, CalmLensTheme as n, getPeakHeights as nt, createProgressFetch as o, DocumentViewerOptions as ot, AssetProps as p, ViewerTextOptions as pt, AssetSession as q, resolveTheme as r, getPlayedPercent as rt, ICONS as s, ImageViewerOptions as st, CALMLENS_THEME as t, getAssetViewKey as tt, ASSET_FILE_ICON_SIZE as u, TextViewerOptions as ut, UploadItemView as v, ViewerMessages as vt, getDropzoneHint as w, describeUploader as x, UploaderView as y, formatViewerMessage as yt, createUploadController as z };
@@ -1,5 +1,5 @@
1
- import { R as CalmLensError, a as appendAssetLocation, c as toUrlViewerClaims, s as getAssetInfo, v as serializeTransform, x as transformSelector } from "./ModerationContextLimits-Bqr0duav.js";
2
- import { a as placeholderHashToDataURL } from "./UploadController-C7fL3Iz9.js";
1
+ import { Y as CalmLensError, a as appendAssetLocation, c as toUrlViewerClaims, s as getAssetInfo, v as serializeTransform, x as transformSelector } from "./ModerationContextLimits-DxuPP4uM.js";
2
+ import { o as placeholderHashToDataURL } from "./UploadController-jlJdddyI.js";
3
3
  import { a as getFileIcon, c as renderFileIconSvg } from "./FileIcons-M6dzjFxd.js";
4
4
  // src/ui/viewers/ViewerAsset.ts
5
5
  /** Spreadsheet MIME types, as `content.format` reports them (compared lower-cased). */
@@ -687,7 +687,8 @@ const CALMLENS_STYLES = `
687
687
  }
688
688
  .calmlens-uploader *, .calmlens-asset * { box-sizing: border-box; }
689
689
  .calmlens-uploader { display: grid; gap: 12px; }
690
- .calmlens-uploader > [hidden] { display: none; }
690
+ .calmlens-uploader > [hidden],
691
+ .calmlens-uploader .calmlens-upload [hidden] { display: none; }
691
692
  .calmlens-dropzone {
692
693
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px;
693
694
  padding: 40px 24px; text-align: center;
@@ -759,16 +760,31 @@ const CALMLENS_STYLES = `
759
760
  .calmlens-upload__size { font-size: 0.875em; color: var(--calmlens-muted); }
760
761
  .calmlens-upload__message { font-size: 0.875em; margin: 0; }
761
762
  .calmlens-progress {
762
- height: 4px; border-radius: 2px; overflow: hidden; background: var(--calmlens-border); position: relative;
763
+ appearance: none; display: block; inline-size: 100%; block-size: 4px;
764
+ border: 0; border-radius: 2px; overflow: clip; background: var(--calmlens-border);
765
+ container-type: inline-size;
763
766
  }
764
- .calmlens-progress__bar {
765
- position: absolute; inset: 0 auto 0 0; background: var(--calmlens-accent); border-radius: inherit;
766
- transition: width 150ms;
767
+ .calmlens-progress::-webkit-progress-bar { background: transparent; }
768
+ .calmlens-progress::-webkit-progress-value {
769
+ background: var(--calmlens-accent); border-radius: 2px; animation: var(--calmlens-progress-animation, none);
767
770
  }
768
- .calmlens-progress:not([aria-valuenow]) .calmlens-progress__bar {
769
- width: 35%; animation: calmlens-indeterminate 1.1s ease-in-out infinite;
771
+ .calmlens-progress::-moz-progress-bar {
772
+ background: var(--calmlens-accent); border-radius: 2px; animation: var(--calmlens-progress-animation, none);
773
+ }
774
+ .calmlens-progress:indeterminate {
775
+ --calmlens-progress-animation: calmlens-indeterminate 1.1s ease-in-out infinite;
776
+ }
777
+ .calmlens-progress:indeterminate:where(:dir(rtl)) {
778
+ --calmlens-progress-animation: calmlens-indeterminate 1.1s ease-in-out infinite reverse;
779
+ }
780
+ @keyframes calmlens-indeterminate {
781
+ from, to { inline-size: 35%; margin-right: auto; }
782
+ from { translate: -100%; }
783
+ to { translate: 100cqi; }
784
+ }
785
+ @keyframes calmlens-indeterminate-still {
786
+ from, to { inline-size: 35%; margin-inline: auto; }
770
787
  }
771
- @keyframes calmlens-indeterminate { from { left: -35%; } to { left: 100%; } }
772
788
  .calmlens-upload__actions { display: flex; gap: 8px; align-items: center; }
773
789
  .calmlens-icon-button {
774
790
  display: grid; place-items: center; width: 30px; height: 30px; padding: 0; border-radius: 8px; cursor: pointer;
@@ -776,8 +792,10 @@ const CALMLENS_STYLES = `
776
792
  }
777
793
  .calmlens-icon-button:hover { background: color-mix(in srgb, var(--calmlens-accent) 8%, transparent); border-color: var(--calmlens-border); }
778
794
  @media (prefers-reduced-motion: reduce) {
779
- .calmlens-progress__bar, .calmlens-dropzone, .calmlens-dropzone__icon, .calmlens-asset__content { transition: none; }
780
- .calmlens-progress:not([aria-valuenow]) .calmlens-progress__bar { animation: none; left: 0; width: 100%; }
795
+ .calmlens-dropzone, .calmlens-dropzone__icon, .calmlens-asset__content { transition: none; }
796
+ .calmlens-progress:indeterminate {
797
+ --calmlens-progress-animation: calmlens-indeterminate-still 1s both;
798
+ }
781
799
  }
782
800
 
783
801
  .calmlens-asset {