calmlens 0.26.1 → 0.27.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 (87) hide show
  1. package/README.md +1 -1
  2. package/bin/calmlens.js +117 -92
  3. package/cjs/{BrowserUpload-DdkcoZLH.js → BrowserUpload-CTqIjCV5.js} +1 -1
  4. package/{esm/BrowserUpload-zYWKtFSs.d.ts → cjs/BrowserUpload-D4sEmd0X.d.ts} +2 -2
  5. package/{esm/CalmLensAppClient-mTTjqpRc.d.ts → cjs/CalmLensAppClient-CCeFnKX8.d.ts} +1 -1
  6. package/cjs/{CalmLensAppClient-Gu9mU_66.js → CalmLensAppClient-CZm-9g22.js} +6 -6
  7. package/cjs/{CalmLensOptionKeys-BCITGsr9.js → CalmLensOptionKeys-C1w3SqmL.js} +28 -6
  8. package/cjs/{CalmLensServerClient-D5-njsNk.d.ts → CalmLensServerClient-B7PfocET.d.ts} +3 -14
  9. package/cjs/{CalmLensServerClient-DHmAPT1u.js → CalmLensServerClient-ucq3ITjd.js} +2 -16
  10. package/cjs/{CalmLensTypes-Df8eBgWB.d.ts → CalmLensTypes-HUERg5hI.d.ts} +16 -97
  11. package/cjs/{Classification-CxRedzgH-C9qlYW_J.d.ts → Classification-CMM2tZpJ-IdIh63n0.d.ts} +6 -7
  12. package/cjs/{Core-DAf9lqe2.js → Core-D-1KCqT7.js} +11 -6
  13. package/{esm/Core-CREGGR0L.d.ts → cjs/Core-DXAs8mcx.d.ts} +2 -2
  14. package/cjs/{ModerationContextLimits-D4iwqoN_.js → ModerationContextLimits-BcYKgU2X.js} +2 -17
  15. package/{esm/ReactUpload-D4htIz8X.d.ts → cjs/ReactUpload-BTciTpwB.d.ts} +1 -1
  16. package/cjs/{ReactUpload-BNIbpxIH.js → ReactUpload-BymgWiC8.js} +1 -1
  17. package/cjs/{TestTriggers-CiFcTHX3-BmfH4J3f.js → TestTriggers-Cvi7e2KA-DcT1pc_W.js} +91 -22
  18. package/{esm/TestTriggers-BJ4B-MXR-D1tGifPU.d.ts → cjs/TestTriggers-Dnukm-jm-DoEB7jJc.d.ts} +1 -1
  19. package/cjs/{UploadController-B_lKxvpM.js → UploadController-C8GPbDKI.js} +2 -2
  20. package/cjs/{WebhookPayload-DMa6ihHr.d.ts → WebhookPayload-mUmOFH55.d.ts} +1 -7
  21. package/cjs/app.d.ts +6 -6
  22. package/cjs/app.js +2 -2
  23. package/cjs/elements.d.ts +4 -4
  24. package/cjs/elements.js +7 -5
  25. package/cjs/{index-CtpQldn_.d.ts → index-Ck7x1YjM.d.ts} +3 -3
  26. package/cjs/index.d.ts +5 -5
  27. package/cjs/index.js +1 -1
  28. package/cjs/react-native.d.ts +2 -2
  29. package/cjs/react-native.js +5 -5
  30. package/cjs/react.d.ts +4 -4
  31. package/cjs/react.js +6 -6
  32. package/cjs/server.d.ts +6 -6
  33. package/cjs/server.js +2 -2
  34. package/cjs/test-inputs.d.ts +1 -1
  35. package/cjs/test-inputs.js +13 -13
  36. package/cjs/testing.d.ts +12 -17
  37. package/cjs/testing.js +35 -114
  38. package/cjs/{ui-BwFPFrno.d.ts → ui-BfJNO3c6.d.ts} +2 -2
  39. package/cjs/{ui-CvlJmRYM.js → ui-CW8BqtZk.js} +4 -4
  40. package/cjs/ui.d.ts +2 -2
  41. package/cjs/ui.js +3 -3
  42. package/cjs/vue.d.ts +5 -5
  43. package/cjs/vue.js +5 -5
  44. package/esm/{BrowserUpload-BAWYEBd7.js → BrowserUpload-C01iLeOs.js} +1 -1
  45. package/{cjs/BrowserUpload-zYWKtFSs.d.ts → esm/BrowserUpload-D4sEmd0X.d.ts} +2 -2
  46. package/{cjs/CalmLensAppClient-mTTjqpRc.d.ts → esm/CalmLensAppClient-CCeFnKX8.d.ts} +1 -1
  47. package/esm/{CalmLensAppClient-DNkIZb6x.js → CalmLensAppClient-CgDogQQC.js} +6 -6
  48. package/esm/{CalmLensOptionKeys-CYHJo3nV.js → CalmLensOptionKeys-CEwNbpEz.js} +28 -6
  49. package/esm/{CalmLensServerClient-D5-njsNk.d.ts → CalmLensServerClient-B7PfocET.d.ts} +3 -14
  50. package/esm/{CalmLensServerClient-B1AiR4nv.js → CalmLensServerClient-TT6zrAG5.js} +2 -16
  51. package/esm/{CalmLensTypes-Df8eBgWB.d.ts → CalmLensTypes-HUERg5hI.d.ts} +16 -97
  52. package/esm/{Classification-CxRedzgH-C9qlYW_J.d.ts → Classification-CMM2tZpJ-IdIh63n0.d.ts} +6 -7
  53. package/esm/{Core-xNBQxZWH.js → Core-CP6NaqJz.js} +11 -6
  54. package/{cjs/Core-CREGGR0L.d.ts → esm/Core-DXAs8mcx.d.ts} +2 -2
  55. package/esm/{ModerationContextLimits-DxuPP4uM.js → ModerationContextLimits-BmV8QD32.js} +2 -17
  56. package/esm/{ReactUpload-BWifQdLv.js → ReactUpload-B72Oq3qE.js} +1 -1
  57. package/{cjs/ReactUpload-D4htIz8X.d.ts → esm/ReactUpload-BTciTpwB.d.ts} +1 -1
  58. package/esm/{TestTriggers-CiFcTHX3-BK2-sgOC.js → TestTriggers-Cvi7e2KA-BA83CRJb.js} +87 -23
  59. package/{cjs/TestTriggers-BJ4B-MXR-D1tGifPU.d.ts → esm/TestTriggers-Dnukm-jm-DoEB7jJc.d.ts} +1 -1
  60. package/esm/{UploadController-jlJdddyI.js → UploadController-Q7xTqh5w.js} +2 -2
  61. package/esm/{WebhookPayload-DMa6ihHr.d.ts → WebhookPayload-mUmOFH55.d.ts} +1 -7
  62. package/esm/app.d.ts +6 -6
  63. package/esm/app.js +2 -2
  64. package/esm/elements.d.ts +4 -4
  65. package/esm/elements.js +7 -5
  66. package/esm/{index-CtpQldn_.d.ts → index-Ck7x1YjM.d.ts} +3 -3
  67. package/esm/index.d.ts +5 -5
  68. package/esm/index.js +1 -1
  69. package/esm/react-native.d.ts +2 -2
  70. package/esm/react-native.js +5 -5
  71. package/esm/react.d.ts +4 -4
  72. package/esm/react.js +6 -6
  73. package/esm/server.d.ts +6 -6
  74. package/esm/server.js +2 -2
  75. package/esm/styles.css +9 -4
  76. package/esm/svelte/CalmLensAsset.svelte +1 -1
  77. package/esm/test-inputs.d.ts +1 -1
  78. package/esm/test-inputs.js +1 -1
  79. package/esm/testing.d.ts +12 -17
  80. package/esm/testing.js +29 -108
  81. package/esm/{ui-BXzzqh7M.js → ui-BBDJJkFL.js} +4 -4
  82. package/esm/{ui-BwFPFrno.d.ts → ui-BfJNO3c6.d.ts} +2 -2
  83. package/esm/ui.d.ts +2 -2
  84. package/esm/ui.js +3 -3
  85. package/esm/vue.d.ts +5 -5
  86. package/esm/vue.js +5 -5
  87. package/package.json +1 -1
@@ -1,5 +1,5 @@
1
- import { C as validateBatchAssetsOptions, F as isReactNativeRuntime, L as copyLastResponse, P as isBrowserRuntime, R as listPages, Y as CalmLensError, a as appendAssetLocation, b as toTextAssetOptions, ct as invalidConfig, d as checkOptionKeys, g as pollForDecision, l as validateSignAssetUrlOptions, o as buildAssetUrl, ot as SDK_ERROR_CODES, p as encodePathSegment, s as getAssetInfo, st as invalidArgument, u as DEFAULT_CDN_BASE_URL, w as validateServerClientOptions, y as stringifyQuery, z as readEnv } from "./ModerationContextLimits-DxuPP4uM.js";
2
- import { c as getMockHooks, d as prepareSubmitAssetOptions, f as resolveConnectionOptions, i as CalmLensConnection, l as invalidPayload, m as validateCallOptions, n as NULLABLE_OPTION_KEYS, o as expectAsset, p as splitsIntoParts, r as SERVER_OPTION_KEYS, u as newIdempotencyKey } from "./CalmLensOptionKeys-CYHJo3nV.js";
1
+ import { C as validateBatchAssetsOptions, F as isReactNativeRuntime, L as copyLastResponse, P as isBrowserRuntime, R as listPages, Y as CalmLensError, a as appendAssetLocation, b as toTextAssetOptions, ct as invalidConfig, d as checkOptionKeys, g as pollForDecision, l as validateSignAssetUrlOptions, o as buildAssetUrl, ot as SDK_ERROR_CODES, p as encodePathSegment, s as getAssetInfo, st as invalidArgument, u as DEFAULT_CDN_BASE_URL, w as validateServerClientOptions, y as stringifyQuery, z as readEnv } from "./ModerationContextLimits-BmV8QD32.js";
2
+ import { c as getMockHooks, d as prepareSubmitAssetOptions, f as resolveConnectionOptions, i as CalmLensConnection, l as invalidPayload, m as validateCallOptions, n as NULLABLE_OPTION_KEYS, o as expectAsset, p as splitsIntoParts, r as SERVER_OPTION_KEYS, u as newIdempotencyKey } from "./CalmLensOptionKeys-CEwNbpEz.js";
3
3
  import { n as sha256Hex, r as timingSafeEqual, t as hmacSha256Hex } from "./CryptoUtils-B_x8lMIx-DhuWGzqn.js";
4
4
  // src/contract/JsonUtils.js
5
5
  const stringifyJsonCanonical = (value) => JSON.stringify(value, (_key, nestedValue) => {
@@ -591,20 +591,6 @@ sign: async (options) => {
591
591
  return this.#send("assets.decide", requestOptions, "POST", `/assets/${requireId(assetId, "Asset ID")}/decision`, { body });
592
592
  },
593
593
  /**
594
- * Completes the policy evidence behind a decided asset's moderation decision: its
595
- * `classification.moderation.explanationComplete` becomes `true` and every action stays as
596
- * decided. With `rerun: true` the asset is moderated again with the project's current policy
597
- * and an `asset.rerun-requested` event is recorded; use it when the policy has changed since
598
- * the decision (`asset/policy-changed`). The asset returns unchanged: it keeps its decision
599
- * until the re-run's is stored, reported by `asset.classified` and `asset.<status>` events,
600
- * and a failed re-run keeps it. A reviewed asset fails with `asset/reviewed`, and one whose
601
- * content is gone with `asset/content-unavailable`.
602
- */
603
- explain: async (options, requestOptions) => {
604
- const { assetId, rerun } = checked("assets.explain", options);
605
- return this.#send("assets.explain", requestOptions, "POST", `/assets/${requireId(assetId, "Asset ID")}/explain`, { body: rerun ? { rerun } : {} });
606
- },
607
- /**
608
594
  * Waits until an asset is settled, its `classification.status` `completed` (with its
609
595
  * decision in `classification.moderation.decision`) or `failed`, and returns that asset,
610
596
  * checking every few seconds. A `queued` or `processing` asset is still waiting, even when a
@@ -1,4 +1,4 @@
1
- import { d as HashListEntry, f as ModerationContext, t as AssetModerationDecision$1, u as HashList } from "./Classification-CxRedzgH-C9qlYW_J.js";
1
+ import { d as HashListEntry, f as ModerationContext, t as AssetModerationDecision$1, u as HashList } from "./Classification-CMM2tZpJ-IdIh63n0.js";
2
2
  import * as zod from "zod";
3
3
  /**
4
4
  * Where the asset is in the pipeline: waiting for its content or its turn (`queued`), being
@@ -36713,87 +36713,6 @@ declare const EVENT_TYPE_INFO: {
36713
36713
  }>>>;
36714
36714
  }, zod.core.$strip>;
36715
36715
  };
36716
- readonly "asset.rerun-requested": {
36717
- id: "asset.rerun-requested";
36718
- name: string;
36719
- description: string;
36720
- category: EventCategory;
36721
- severity: EventSeverity;
36722
- /** Whether the in-app connector (notification bell) subscribes to the type by default. */
36723
- notify: boolean;
36724
- /**
36725
- * The project-wide permission needed to see events of this type (portal feed, public events
36726
- * feed) and to subscribe a connector to it.
36727
- */
36728
- permission: PermissionAction;
36729
- /** Types of unreleased features are left out of the published contract until enabled. */
36730
- enabled?: boolean;
36731
- fields: {
36732
- assetName: EventFieldDefinition<zod.ZodOptional<zod.ZodNullable<zod.ZodString>>>;
36733
- assetType: EventFieldDefinition<zod.ZodOptional<zod.ZodNullable<zod.ZodEnum<{
36734
- audio: "audio";
36735
- file: "file";
36736
- image: "image";
36737
- "multimedia-document": "multimedia-document";
36738
- "plaintext-document": "plaintext-document";
36739
- video: "video";
36740
- website: "website";
36741
- }>>>>;
36742
- moderationStatus: EventFieldDefinition<zod.ZodEnum<{
36743
- "age-restricted": "age-restricted";
36744
- allowed: "allowed";
36745
- blocked: "blocked";
36746
- limited: "limited";
36747
- purged: "purged";
36748
- }>>;
36749
- };
36750
- /** Example data, used for synthetic test sends (`createSampleEvent`). */
36751
- example: NoInfer<{
36752
- assetName?: string | null | undefined;
36753
- assetType?: "audio" | "file" | "image" | "multimedia-document" | "plaintext-document" | "video" | "website" | null | undefined;
36754
- moderationStatus: "age-restricted" | "allowed" | "blocked" | "limited" | "purged";
36755
- }>;
36756
- factInfo: {
36757
- label: string;
36758
- description: string;
36759
- display: EventFieldDisplay;
36760
- /** Kept in the data but left out of rendered messages (usually an ID shown by another field). */
36761
- hidden?: boolean;
36762
- /**
36763
- * Personal or account-level data that stays in the portal. Webhook, Slack and email deliveries,
36764
- * and the public events feed, leave the fact out and word the title and description without it.
36765
- */
36766
- inAppOnly?: boolean;
36767
- /**
36768
- * A person's name: `actor` names the event's `actor`, `member` the member in the `member-user-id`
36769
- * fact. Deleting their account removes it from the events that name them.
36770
- */
36771
- names?: "actor" | "member";
36772
- /** Display names for `enum` and `list` values that don't read well humanized. */
36773
- valueLabels?: Readonly<Record<string, string>>;
36774
- schema: zod.ZodType<unknown, unknown, zod.core.$ZodTypeInternals<unknown, unknown>>;
36775
- key: string;
36776
- }[];
36777
- values: zod.ZodObject<{
36778
- assetName: zod.ZodOptional<zod.ZodNullable<zod.ZodString>>;
36779
- assetType: zod.ZodOptional<zod.ZodNullable<zod.ZodEnum<{
36780
- audio: "audio";
36781
- file: "file";
36782
- image: "image";
36783
- "multimedia-document": "multimedia-document";
36784
- "plaintext-document": "plaintext-document";
36785
- video: "video";
36786
- website: "website";
36787
- }>>>;
36788
- moderationStatus: zod.ZodEnum<{
36789
- "age-restricted": "age-restricted";
36790
- allowed: "allowed";
36791
- blocked: "blocked";
36792
- limited: "limited";
36793
- purged: "purged";
36794
- }>;
36795
- }, zod.core.$strip>;
36796
- };
36797
36716
  readonly "asset.review-requested": {
36798
36717
  id: "asset.review-requested";
36799
36718
  name: string;
@@ -38258,7 +38177,6 @@ declare const PUBLIC_EVENT_SCHEMA: zod.ZodObject<{
38258
38177
  "asset.progress-updated": "asset.progress-updated";
38259
38178
  "asset.purged": "asset.purged";
38260
38179
  "asset.region-restricted": "asset.region-restricted";
38261
- "asset.rerun-requested": "asset.rerun-requested";
38262
38180
  "asset.retried": "asset.retried";
38263
38181
  "asset.review-completed": "asset.review-completed";
38264
38182
  "asset.review-requested": "asset.review-requested";
@@ -42459,7 +42377,6 @@ declare const GET_EVENTS_QUERY_SCHEMA: zod.ZodObject<{
42459
42377
  "asset.progress-updated": "asset.progress-updated";
42460
42378
  "asset.purged": "asset.purged";
42461
42379
  "asset.region-restricted": "asset.region-restricted";
42462
- "asset.rerun-requested": "asset.rerun-requested";
42463
42380
  "asset.retried": "asset.retried";
42464
42381
  "asset.review-completed": "asset.review-completed";
42465
42382
  "asset.review-requested": "asset.review-requested";
@@ -42884,10 +42801,11 @@ interface SignedUploadToken {
42884
42801
  }
42885
42802
  /** What an upload through a preset can set: everything else comes from the preset or token. */
42886
42803
  type UploadPresetSubmitAssetOptions = IdempotencyOptions & {
42887
- name: string;
42804
+ /** Required, except with a `File`, whose name it defaults to. */
42805
+ name?: string;
42888
42806
  description?: string;
42889
42807
  } & ({
42890
- content: AssetContentOptions;
42808
+ content: AssetContentInput;
42891
42809
  } | {
42892
42810
  part: CreateMultipartUploadPartOptions;
42893
42811
  /** The size of the whole file, when known. */
@@ -43032,15 +42950,6 @@ interface RetryAssetOptions {
43032
42950
  type DecideAssetOptions = {
43033
42951
  assetId: string;
43034
42952
  } & PostAssetDecisionBody;
43035
- interface ExplainAssetOptions {
43036
- assetId: string;
43037
- /**
43038
- * Moderates the asset again with the project's current policy, answering every question,
43039
- * instead of explaining the decision as made. The asset returns to `processing` and gets a new
43040
- * decision, which can differ from the old one.
43041
- */
43042
- rerun?: boolean;
43043
- }
43044
42953
  interface WaitForAssetDecisionOptions {
43045
42954
  assetId: string;
43046
42955
  /** How long to wait for a decision, in milliseconds. Defaults to 60000. */
@@ -43199,7 +43108,13 @@ interface SubmitAssetCommonOptions extends IdempotencyOptions {
43199
43108
  uploadPresetId?: string;
43200
43109
  isFinal?: never;
43201
43110
  }
43202
- type SubmitAssetOptions = (SubmitAssetCommonOptions & {
43111
+ /**
43112
+ * An asset's content: a `Blob` or `File`, whose own type is the content type (and a `File`'s
43113
+ * name the asset's name when you give none), or bytes, base64 or plain text with their `type`.
43114
+ */
43115
+ type AssetContentInput = AssetContentOptions | Blob;
43116
+ /** Options as the client sends them, once a `Blob` or `File` is read as `{ data, type }`. */
43117
+ type PreparedSubmitAssetOptions = (SubmitAssetCommonOptions & {
43203
43118
  content: AssetContentOptions;
43204
43119
  }) | (SubmitAssetCommonOptions & {
43205
43120
  url: string;
@@ -43213,6 +43128,10 @@ type SubmitAssetOptions = (SubmitAssetCommonOptions & {
43213
43128
  */
43214
43129
  totalSizeInBytes?: number;
43215
43130
  });
43131
+ /** What `assets.create` and `assets.classify` take: content, a URL or a multipart part. */
43132
+ type SubmitAssetOptions = PreparedSubmitAssetOptions | (SubmitAssetCommonOptions & {
43133
+ content: Blob;
43134
+ });
43216
43135
  interface MultipartUploadOptions extends SubmitAssetCommonOptions {
43217
43136
  part: CreateMultipartUploadPartOptions;
43218
43137
  totalSizeInBytes?: number;
@@ -43251,4 +43170,4 @@ interface ClassifyTextOptions extends Omit<SubmitAssetCommonOptions, "name" | "i
43251
43170
  /** `folders.list` options. `sort` is `name` (the default) or `createdAt`, descending when prefixed with `-`. */
43252
43171
  type ListFoldersOptions = GetFoldersQuery;
43253
43172
  type FolderPage = GetFoldersResponse;
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 };
43173
+ export { FolderPage as $, VerifyWebhookSignatureOptions as $t, CdnAssetLocation as A, Policy as An, RetrieveAssetOptions as At, CreateHashListOptions as B, AssetRendered as Bn, UpdateAssetOptions as Bt, AssetUploadStatus as C, BoundingBox as Cn, MultipartUploadPartOptions as Ct, BatchAssetsResponse as D, ProcessingFeatureResults as Dn, RequestAttempt as Dt, BatchAssetsOptions as E, ProcessingFeatureId as En, RemoveAssetContentOptions as Et, CdnTransform as F, AssetBinaryPayloadInput as Fn, SignUploadTokenOptions as Ft, DeleteAssetOptions as G, FileMetadata as Gn, UpdateProjectSettingsOptions as Gt, CreateMultipartUploadPartOptions as H, AssetSafetyHold as Hn, UpdateHashListOptions as Ht, ClassifyTextOptions as I, AssetInfo as In, SignedAssetUrl as It, EnsureLensesOptions as J, UploadPresetDefinition as Jt, DeleteMetadataFieldOptions as K, MetadataItem as Kn, UpgradePolicyOptions as Kt, ClientRequestDefaults as L, AssetHls as Ln, SignedUploadToken as Lt, CdnAssetUrlOptions as M, LensType as Mn, SearchAssetsOptions as Mt, CdnResource as N, AssetSearchMatchField as Nn, SetPolicyAutomaticUpdatesOptions as Nt, CalmLensAppClientOptions as O, ProcessingFeatureStage as On, RequestOptions as Ot, CdnServeOptions as P, AssetSearchQuery as Pn, SignAssetUrlOptions as Pt, FolderIdOptions as Q, UploadedAsset as Qt, ConnectionOptions as R, AssetHlsRendition as Rn, StreamingFeatureOptions as Rt, AssetUpload as S, AgeRange as Sn, MultipartUploadOptions as St, AssignPolicyOptions as T, DetectedPerson as Tn, PolicyPage as Tt, CreatePolicyOptions as U, AssetSafetyHoldReason as Un, UpdateLensOptions as Ut, CreateLensOptions as V, AssetRenderedKind as Vn, UpdateFolderOptions as Vt, DecideAssetOptions as W, ExtractedText as Wn, UpdatePolicyOptions as Wt, EnsureUploadPresetsOptions as X, UploadPresetPage as Xt, EnsureMetadataFieldsOptions as Y, UploadPresetIdOptions as Yt, EnsureUploadPresetsResponse as Z, UploadPresetSubmitAssetOptions as Zt, AssetPage as _, Folder as _n, ListLensesOptions as _t, AssetChecksums as a, AssetTimelineSegment as an, IdempotencyOptions as at, AssetTimelinePage as b, PublicProjectSettings as bn, MoveAssetOptions as bt, AssetClassificationFailureReason as c, EventAsset as cn, LensIdOptions as ct, AssetContentOptions as d, EventFact as dn, ListAssetTimelineOptions as dt, ViewerClaims as en, GetAssetInfoOptions as et, AssetContentRemovalReason as f, EventFactValues as fn, ListAssetsOptions as ft, AssetModerationStatus as g, PermissionGrant as gn, ListHashListsOptions as gt, AssetModerationDecision as h, EventType as hn, ListHashListEntriesOptions as ht, AssetAvailability as i, AssetBatchOperation as in, HashListPage as it, CdnAssetReference as j, CursorPage as jn, RetryAssetOptions as jt, CalmLensServerClientOptions as k, ProcessingFeatures as kn, ResetPolicyOptions as kt, AssetClassificationStatus as l, TypedEvent as ln, LensPage as lt, AssetModeration as m, EventSeverity as mn, ListFoldersOptions as mt, AppInfo as n, WebhookHeadersInput as nn, HashListEntryPage as nt, AssetChildrenPage as o, GetEventsResponse as on, ImageTransformOptions as ot, AssetContentStatus as p, EventFacts as pn, ListEventsOptions as pt, EnsureLensOptions as q, ProcessingOptions as qn, UploadAssetPartOptions as qt, Asset as r, WebhookPayloadInput as rn, HashListIdOptions as rt, AssetClassification as s, Actor as sn, Lens as st, AddHashListEntryOptions as t, WaitForAssetDecisionOptions as tn, HashListEntryIdOptions as tt, AssetContent as u, EventCategory as un, ListAssetChildrenOptions as ut, AssetSearchResponse as v, MetadataFieldsResource as vn, ListPoliciesOptions as vt, AssetVisibility as w, DetectedFace as wn, PolicyIdOptions as wt, AssetType as x, UploadPreset as xn, MoveFolderOptions as xt, AssetSearchResult as y, ProjectSettingsResource as yn, ListUploadPresetsOptions as yt, CreateFolderOptions as z, AssetPreview as zn, SubmitAssetOptions as zt };
@@ -1109,7 +1109,12 @@ declare const CLASSIFICATION_NOT_EVALUATED_REASON_SCHEMA: zod.ZodEnum<{
1109
1109
  unavailable: "unavailable";
1110
1110
  }>;
1111
1111
  type ClassificationNotEvaluatedReason = zod.infer<typeof CLASSIFICATION_NOT_EVALUATED_REASON_SCHEMA>;
1112
- declare const STRICT_QUALIFIER_RESULTS_SCHEMA: zod.ZodRecord<zod.ZodEnum<{
1112
+ /**
1113
+ * Qualifier results keyed by qualifier. Keys from removed or renamed qualifiers are dropped rather
1114
+ * than failing the report; known keys are still validated. Typed as the strict schema: the filter
1115
+ * changes neither the accepted shape of known keys nor the JSON schema.
1116
+ */
1117
+ declare const CLASSIFICATION_QUALIFIER_RESULTS_SCHEMA: zod.ZodRecord<zod.ZodEnum<{
1113
1118
  "criminal-activity-alcohol": "criminal-activity-alcohol";
1114
1119
  "criminal-activity-coded-incitement": "criminal-activity-coded-incitement";
1115
1120
  "criminal-activity-csam": "criminal-activity-csam";
@@ -1266,12 +1271,6 @@ declare const STRICT_QUALIFIER_RESULTS_SCHEMA: zod.ZodRecord<zod.ZodEnum<{
1266
1271
  unavailable: "unavailable";
1267
1272
  }>;
1268
1273
  }, zod.core.$strict>], "status">>;
1269
- /**
1270
- * Qualifier results keyed by qualifier. Keys from removed or renamed qualifiers are dropped rather
1271
- * than failing the report; known keys are still validated. Typed as the strict schema: the filter
1272
- * changes neither the accepted shape of known keys nor the JSON schema.
1273
- */
1274
- declare const CLASSIFICATION_QUALIFIER_RESULTS_SCHEMA: typeof STRICT_QUALIFIER_RESULTS_SCHEMA;
1275
1274
  type ClassificationQualifierResults = zod.infer<typeof CLASSIFICATION_QUALIFIER_RESULTS_SCHEMA>;
1276
1275
  declare const CLASSIFICATION_CATEGORY_REPORT_SCHEMA: zod.ZodDiscriminatedUnion<[zod.ZodObject<{
1277
1276
  status: zod.ZodLiteral<"evaluated">;
@@ -1,5 +1,5 @@
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";
1
+ import { Y as CalmLensError, a as appendAssetLocation, c as toUrlViewerClaims, s as getAssetInfo, v as serializeTransform, x as transformSelector } from "./ModerationContextLimits-BmV8QD32.js";
2
+ import { o as placeholderHashToDataURL } from "./UploadController-Q7xTqh5w.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). */
@@ -126,7 +126,8 @@ const VIEWER_STYLES = `
126
126
  margin: 0 auto; padding: 20px 24px; max-width: 75ch; white-space: pre-wrap; overflow-wrap: anywhere;
127
127
  font-family: inherit; font-size: 1rem; line-height: 1.6;
128
128
  }
129
- .calmlens-viewer__pages { flex: 1; min-height: 0; overflow: auto; padding: 16px; text-align: center; }
129
+ /* Fit to width, the page fills the viewer edge to edge; zoomed out, it sits centred. */
130
+ .calmlens-viewer__pages { flex: 1; min-height: 0; overflow: auto; text-align: center; }
130
131
  .calmlens-viewer__page { display: inline-block; position: relative; vertical-align: top; }
131
132
  .calmlens-viewer__page canvas { display: block; background: #fff; box-shadow: 0 1px 4px rgb(0 0 0 / 0.2); }
132
133
  .calmlens-viewer__page-field { width: 4.5em; min-height: 36px; padding: 4px 6px; font: inherit; border: 1px solid var(--calmlens-border); border-radius: calc(var(--calmlens-radius) / 2); background: transparent; color: inherit; }
@@ -802,6 +803,8 @@ const CALMLENS_STYLES = `
802
803
  position: relative; display: block; overflow: hidden; margin: 0; border-radius: var(--calmlens-media-radius, 0);
803
804
  background: var(--calmlens-surface);
804
805
  }
806
+ /* The average colour stands in while the content loads; transparent content and notices show the surface. */
807
+ .calmlens-asset:not([data-state="loaded"], [data-state="error"], [data-kind="unavailable"]) { background-color: var(--calmlens-average-color, var(--calmlens-surface)); }
805
808
  .calmlens-asset__placeholder, .calmlens-asset__content {
806
809
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: var(--calmlens-fit, contain);
807
810
  object-position: var(--calmlens-position, center);
@@ -816,8 +819,8 @@ const CALMLENS_STYLES = `
816
819
  /* Documents, text and spreadsheets fill the box with their viewer; a document shows its first
817
820
  page's still and an open link until the viewer loads. */
818
821
  .calmlens-asset__viewer { position: absolute; inset: 0; }
819
- .calmlens-asset:not([data-sized])[data-kind="document"], .calmlens-asset:not([data-sized])[data-kind="text"],
820
- .calmlens-asset:not([data-sized])[data-kind="spreadsheet"] { height: 480px; }
822
+ /* A default height only: any height the page gives the element (a class, a style) wins. */
823
+ :where(.calmlens-asset:not([data-sized]):is([data-kind="document"], [data-kind="text"], [data-kind="spreadsheet"])) { height: 480px; }
821
824
  .calmlens-asset[data-kind="document"] .calmlens-asset__content { opacity: 1; }
822
825
  .calmlens-asset__open { position: absolute; right: 8px; bottom: 8px; text-decoration: none; }
823
826
  /* A website's screenshot scrolls beneath the link to its page. */
@@ -847,7 +850,9 @@ const CALMLENS_STYLES = `
847
850
  }
848
851
  .calmlens-asset__notice p { margin: 0; display: flex; gap: 6px; align-items: center; }
849
852
  /* Thumbnails keep the notice's icon and leave its text to screen readers. */
850
- .calmlens-asset[data-sized] { container-type: inline-size; }
853
+ /* A notice has no content of its own to size the box, so it can always measure its width. */
854
+ .calmlens-asset[data-sized], .calmlens-asset[data-kind="unavailable"], .calmlens-asset[data-kind="age-restricted"],
855
+ .calmlens-asset[data-state="error"] { container-type: inline-size; }
851
856
  @container (max-width: 119px) {
852
857
  .calmlens-asset__label, .calmlens-asset__notice > strong, .calmlens-asset__notice > p:not(:has(svg)) {
853
858
  position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap;
@@ -1,5 +1,5 @@
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";
1
+ import { F as CdnTransform, O as CalmLensAppClientOptions, en as ViewerClaims, g as AssetModerationStatus, i as AssetAvailability } from "./CalmLensTypes-HUERg5hI.js";
2
+ import { t as CalmLensAppClient } from "./CalmLensAppClient-CCeFnKX8.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.
@@ -66,9 +66,6 @@ const API_ERROR_CODES = {
66
66
  ASSET_NOT_RETRYABLE: "asset/not-retryable",
67
67
  ASSET_CONTENT_UNAVAILABLE: "asset/content-unavailable",
68
68
  ASSET_CONTENT_PURGED: "asset/content-purged",
69
- ASSET_NOT_DECIDED: "asset/not-decided",
70
- ASSET_POLICY_CHANGED: "asset/policy-changed",
71
- ASSET_REVIEWED: "asset/reviewed",
72
69
  SUPPORT_TICKET_NOT_FOUND: "support-ticket/not-found",
73
70
  DUPLICATE_EXTERNAL_ID: "asset/duplicate-external-id",
74
71
  FOLDER_NOT_FOUND: "folder/not-found",
@@ -384,18 +381,6 @@ const API_ERROR_DEFINITIONS = {
384
381
  status: 409,
385
382
  message: "This asset's content was purged, so it can only be blocked. Upload it again to have it moderated afresh."
386
383
  },
387
- "asset/not-decided": {
388
- status: 409,
389
- message: "This asset has no automatic moderation decision to explain yet."
390
- },
391
- "asset/policy-changed": {
392
- status: 409,
393
- message: "The project's moderation policy has changed since this decision, so it can't be explained as made. Re-run moderation with the current policy instead."
394
- },
395
- "asset/reviewed": {
396
- status: 409,
397
- message: "A reviewer has decided this asset, so its moderation can't be re-run."
398
- },
399
384
  "support-ticket/not-found": {
400
385
  status: 404,
401
386
  message: "Support ticket not found."
@@ -1067,7 +1052,7 @@ const listPages = (fetchPage, { cursor, feed = false } = {}) => {
1067
1052
  };
1068
1053
  // src/client/CalmLensVersion.ts
1069
1054
  /** This SDK's version, from its package.json. */
1070
- const SDK_VERSION = "0.26.1";
1055
+ const SDK_VERSION = "0.27.1";
1071
1056
  const runtimeName = () => {
1072
1057
  const runtime = globalThis;
1073
1058
  if (isReactNativeRuntime()) return "react-native";
@@ -2364,7 +2349,7 @@ const getAssetInfo = async (url, options = {}) => {
2364
2349
  });
2365
2350
  return data;
2366
2351
  };
2367
- // src/contract/ModerationContextLimits-BIMUlk2e.js
2352
+ // src/contract/ModerationContextLimits-k930WU8i.js
2368
2353
  /** The most recent earlier posts CalmLens uses. */
2369
2354
  const MODERATION_CONTEXT_USED_ITEMS = 5;
2370
2355
  /**
@@ -1,4 +1,4 @@
1
- import { i as withProvidedOptions, n as createUploadController } from "./UploadController-jlJdddyI.js";
1
+ import { i as withProvidedOptions, n as createUploadController } from "./UploadController-Q7xTqh5w.js";
2
2
  import { createContext, createElement, useContext, useEffect, useMemo, useRef, useState, useSyncExternalStore } from "react";
3
3
  // src/ui/ReactUpload.ts
4
4
  const CalmLensContext = createContext(void 0);
@@ -1,4 +1,4 @@
1
- import { F as UploadFile, L as UploadSnapshot, N as UploadController, O as CalmLensProvidedOptions, P as UploadControllerOptions } from "./Core-CREGGR0L.js";
1
+ import { F as UploadFile, L as UploadSnapshot, N as UploadController, O as CalmLensProvidedOptions, P as UploadControllerOptions } from "./Core-DXAs8mcx.js";
2
2
  import { ReactNode } from "react";
3
3
  type CalmLensProviderProps<F extends UploadFile = File> = CalmLensProvidedOptions<F> & {
4
4
  children?: ReactNode;
@@ -1,5 +1,6 @@
1
1
  import { r as timingSafeEqual, t as hmacSha256Hex } from "./CryptoUtils-B_x8lMIx-DhuWGzqn.js";
2
2
  import * as z from "zod";
3
+ import { globalRegistry } from "zod";
3
4
  // src/contract/ModerationCategories-CHFRoeWV.js
4
5
  const CLASSIFICATION_CATEGORIES = [
5
6
  "sexual",
@@ -11,7 +12,77 @@ const CLASSIFICATION_CATEGORIES = [
11
12
  "personal-information",
12
13
  "profanity"
13
14
  ];
14
- // src/contract/Jurisdiction-CtB_d_2M.js
15
+ // src/contract/LazySchema-D_3-dV1e.js
16
+ const registryMap = globalRegistry._map;
17
+ /**
18
+ * A schema built the first time anything reads it, rather than when its module loads. Building
19
+ * Zod schemas costs a new isolate CPU before its first request, so a module whose schemas most
20
+ * requests never use (support tickets, compliance cases, appeals…) builds them only when one does.
21
+ *
22
+ * The returned proxy stands for the schema: reading, calling or composing it (`.parse`, `.extend`,
23
+ * embedding it in another schema) builds the schema and forwards to it, with the schema as the
24
+ * receiver, so its methods see the real instance. Its metadata (`.meta()`, `.describe()`, zod-meta's
25
+ * stores) is registered under the proxy too, for the code that looks schemas up by identity (JSON
26
+ * Schema generation, where the proxy is embedded in another schema).
27
+ *
28
+ * Calling it has no side effects (the annotation tells bundlers), so a bundle drops the lazy
29
+ * schemas it never uses, as it drops plain Zod schemas.
30
+ */
31
+ const lazySchema = /* @__NO_SIDE_EFFECTS__ */ (build) => {
32
+ let schema;
33
+ const real = () => {
34
+ if (!schema) {
35
+ const built = build();
36
+ schema = built;
37
+ const meta = registryMap.get(built);
38
+ if (meta !== void 0) registryMap.set(proxy, meta);
39
+ const internals = built._zod;
40
+ const process = internals.processJSONSchema;
41
+ if (process) internals.processJSONSchema = (context, json, params) => {
42
+ const record = context.seen.get(proxy);
43
+ if (!record || context.seen.has(built)) return process(context, json, params);
44
+ context.seen.set(built, record);
45
+ try {
46
+ return process(context, json, params);
47
+ } finally {
48
+ if (context.seen.get(built) === record) context.seen.delete(built);
49
+ }
50
+ };
51
+ }
52
+ return schema;
53
+ };
54
+ const proxy = new Proxy({}, {
55
+ get(_, key) {
56
+ const target = real();
57
+ return Reflect.get(target, key, target);
58
+ },
59
+ set(_, key, value) {
60
+ const target = real();
61
+ return Reflect.set(target, key, value, target);
62
+ },
63
+ has(_, key) {
64
+ return Reflect.has(real(), key);
65
+ },
66
+ ownKeys() {
67
+ return Reflect.ownKeys(real());
68
+ },
69
+ getOwnPropertyDescriptor(_, key) {
70
+ const descriptor = Reflect.getOwnPropertyDescriptor(real(), key);
71
+ return descriptor && {
72
+ ...descriptor,
73
+ configurable: true
74
+ };
75
+ },
76
+ getPrototypeOf() {
77
+ return Reflect.getPrototypeOf(real());
78
+ },
79
+ defineProperty(_, key, descriptor) {
80
+ return Reflect.defineProperty(real(), key, descriptor);
81
+ }
82
+ });
83
+ return proxy;
84
+ };
85
+ // src/contract/Jurisdiction-CQN8qnzX.js
15
86
  /**
16
87
  * Jurisdictions with legal rules always apply to every project. An optional jurisdiction is a
17
88
  * product standard rather than a legal floor: every project serves it unless it opts out.
@@ -58,19 +129,12 @@ const JURISDICTIONS = {
58
129
  optional: false
59
130
  }
60
131
  };
61
- const JURISDICTION_SCHEMA = z.enum(Object.keys(JURISDICTIONS));
132
+ const JURISDICTION_SCHEMA = /* @__PURE__ */ lazySchema(() => z.enum(Object.keys(JURISDICTIONS)));
62
133
  Object.keys(JURISDICTIONS).filter((code) => !JURISDICTIONS[code].optional);
63
- const OPTIONAL_JURISDICTIONS = Object.keys(JURISDICTIONS).filter((code) => JURISDICTIONS[code].optional);
64
- z.enum(OPTIONAL_JURISDICTIONS).array().refine((codes) => new Set(codes).size === codes.length, { message: "jurisdiction/duplicate" });
65
- JURISDICTION_SCHEMA.array().min(1).refine((regions) => regions.includes("global") && new Set(regions).size === regions.length, { message: "jurisdiction/global-required-or-duplicate" });
66
- const COUNTRIES = new Set("AD AE AF AG AI AL AM AO AQ AR AS AT AU AW AX AZ BA BB BD BE BF BG BH BI BJ BL BM BN BO BQ BR BS BT BV BW BY BZ CA CC CD CF CG CH CI CK CL CM CN CO CR CU CV CW CX CY CZ DE DJ DK DM DO DZ EC EE EG EH ER ES ET FI FJ FK FM FO FR GA GB GD GE GF GG GH GI GL GM GN GP GQ GR GS GT GU GW GY HK HM HN HR HT HU ID IE IL IM IN IO IQ IR IS IT JE JM JO JP KE KG KH KI KM KN KP KR KW KY KZ LA LB LC LI LK LR LS LT LU LV LY MA MC MD ME MF MG MH MK ML MM MN MO MP MQ MR MS MT MU MV MW MX MY MZ NA NC NE NF NG NI NL NO NP NR NU NZ OM PA PE PF PG PH PK PL PM PN PR PS PT PW PY QA RE RO RS RU RW SA SB SC SD SE SG SH SI SJ SK SL SM SN SO SR SS ST SV SX SY SZ TC TD TF TG TH TJ TK TL TM TN TO TR TT TV TW TZ UA UG UM US UY UZ VA VC VE VG VI VN VU WF WS YE YT ZA ZM ZW".split(" "));
67
- const VIEWER_REGION_SCHEMA = z.enum([...COUNTRIES]).describe("Viewer's ISO 3166-1 alpha-2 country, supplied by your integration; not the proxy server's country. EU is not a viewer country.");
134
+ Object.keys(JURISDICTIONS).filter((code) => JURISDICTIONS[code].optional);
135
+ new Set("AD AE AF AG AI AL AM AO AQ AR AS AT AU AW AX AZ BA BB BD BE BF BG BH BI BJ BL BM BN BO BQ BR BS BT BV BW BY BZ CA CC CD CF CG CH CI CK CL CM CN CO CR CU CV CW CX CY CZ DE DJ DK DM DO DZ EC EE EG EH ER ES ET FI FJ FK FM FO FR GA GB GD GE GF GG GH GI GL GM GN GP GQ GR GS GT GU GW GY HK HM HN HR HT HU ID IE IL IM IN IO IQ IR IS IT JE JM JO JP KE KG KH KI KM KN KP KR KW KY KZ LA LB LC LI LK LR LS LT LU LV LY MA MC MD ME MF MG MH MK ML MM MN MO MP MQ MR MS MT MU MV MW MX MY MZ NA NC NE NF NG NI NL NO NP NR NU NZ OM PA PE PF PG PH PK PL PM PN PR PS PT PW PY QA RE RO RS RU RW SA SB SC SD SE SG SH SI SJ SK SL SM SN SO SR SS ST SV SX SY SZ TC TD TF TG TH TJ TK TL TM TN TO TR TT TV TW TZ UA UG UM US UY UZ VA VC VE VG VI VN VU WF WS YE YT ZA ZM ZW".split(" "));
68
136
  new Set("AT BE BG HR CY CZ DK EE FI FR DE GR HU IE IT LV LT LU MT NL PL PT RO SK SI ES SE".split(" "));
69
- z.object({
70
- region: VIEWER_REGION_SCHEMA.optional().describe("Viewer country. Defaults to the country of the connection reaching CalmLens; proxies should forward the viewer country explicitly."),
71
- ageConfirmed: z.boolean().optional().describe("Your platform's confirmation that the viewer passed its age check, so age-restricted content may be delivered. Defaults to false. Your platform confirms the viewer's age. Viewer claims are assertions from your application; CalmLens doesn't verify them. To restrict who can load an age-restricted asset, make it private and issue signed URLs only to viewers who passed your age check.")
72
- }).strict();
73
- // src/contract/TestRegionalActions-DUzwPr1a.js
137
+ // src/contract/TestRegionalActions-BhyWuU49.js
74
138
  /**
75
139
  * Marks English text in shared, backend and data modules that the portal shows, so the app's
76
140
  * message catalog (packages/app/vite/messageCatalog.ts) extracts it and the portal can translate it
@@ -1093,15 +1157,15 @@ function getModerationQualifierInfo(qualifier) {
1093
1157
  return MODERATION_QUALIFIER_INFO[qualifier];
1094
1158
  }
1095
1159
  /** Authenticated test inputs can add regional delivery restrictions without inventing evidence. */
1096
- const TEST_REGIONAL_ACTIONS_SCHEMA = z.array(z.object({
1160
+ const TEST_REGIONAL_ACTIONS_SCHEMA = /* @__PURE__ */ lazySchema(() => z.array(z.object({
1097
1161
  region: JURISDICTION_SCHEMA.exclude(["global"]),
1098
1162
  action: z.enum([
1099
1163
  "limit",
1100
1164
  "age-restrict",
1101
1165
  "block"
1102
1166
  ])
1103
- }).strict()).max(7).refine((entries) => new Set(entries.map((entry) => entry.region)).size === entries.length, "Choose each region once");
1104
- // src/contract/TestTriggers-CiFcTHX3.js
1167
+ }).strict()).max(7).refine((entries) => new Set(entries.map((entry) => entry.region)).size === entries.length, "Choose each region once"));
1168
+ // src/contract/TestTriggers-Cvi7e2KA.js
1105
1169
  /**
1106
1170
  * The visual encoding of test images (shared by images and video frames), independent of what the
1107
1171
  * bytes mean. An odd N×N grid of square cells fills the image. Its outer ring alternates black and
@@ -1574,21 +1638,21 @@ const detectionShape = {
1574
1638
  const fitsImage = ({ box: [left, top, width, height] }) => left + width <= 1e4 && top + height <= 1e4;
1575
1639
  const BOX_MESSAGE = msg("A box must lie inside the image: left + width and top + height are at most 10000.");
1576
1640
  const ageYears = z.number().int().min(0).max(120);
1577
- const TEST_DETECTED_PERSON_SCHEMA = z.object(detectionShape).strict().refine(fitsImage, BOX_MESSAGE);
1578
- const TEST_DETECTED_FACE_SCHEMA = z.object({
1641
+ const TEST_DETECTED_PERSON_SCHEMA = /* @__PURE__ */ lazySchema(() => z.object(detectionShape).strict().refine(fitsImage, BOX_MESSAGE));
1642
+ const TEST_DETECTED_FACE_SCHEMA = /* @__PURE__ */ lazySchema(() => z.object({
1579
1643
  ...detectionShape,
1580
1644
  age: z.union([z.enum(["adult", "minor"]), z.object({
1581
1645
  low: ageYears,
1582
1646
  high: ageYears
1583
1647
  }).strict().refine(({ low, high }) => low <= high, msg("An age range's low must not be above its high."))]).optional()
1584
- }).strict().refine(fitsImage, BOX_MESSAGE);
1648
+ }).strict().refine(fitsImage, BOX_MESSAGE));
1585
1649
  /** Person and face detection results a test image reports instead of running detection. */
1586
- const TEST_DETECTIONS_SCHEMA = z.object({
1650
+ const TEST_DETECTIONS_SCHEMA = /* @__PURE__ */ lazySchema(() => z.object({
1587
1651
  people: z.union([z.array(TEST_DETECTED_PERSON_SCHEMA).max(32), z.literal("unavailable")]).optional(),
1588
1652
  faces: z.union([z.array(TEST_DETECTED_FACE_SCHEMA).max(32), z.literal("unavailable")]).optional()
1589
- }).strict();
1653
+ }).strict());
1590
1654
  /** Each row is one qualifying instance. Unselected qualifiers are explicitly absent. */
1591
- const TEST_INPUT_SCHEMA = z.object({
1655
+ const TEST_INPUT_SCHEMA = /* @__PURE__ */ lazySchema(() => z.object({
1592
1656
  regionalActions: TEST_REGIONAL_ACTIONS_SCHEMA.optional(),
1593
1657
  unassessedCategories: z.array(z.enum(CLASSIFICATION_CATEGORIES)).max(CLASSIFICATION_CATEGORIES.length).optional(),
1594
1658
  instances: z.array(z.object({
@@ -1618,7 +1682,7 @@ const TEST_INPUT_SCHEMA = z.object({
1618
1682
  code: "custom",
1619
1683
  message: msg("An unassessed category cannot also have assessed instances.")
1620
1684
  });
1621
- });
1685
+ }));
1622
1686
  const TEST_INPUT_PRESETS = {
1623
1687
  clean: { instances: [] },
1624
1688
  limited: { instances: [{
@@ -1894,4 +1958,4 @@ async function detectTestImage(image, key, { whole = true } = {}) {
1894
1958
  if (!scenario || !whole) return scenario;
1895
1959
  return matchesTestImageGrid(image, grid, paintTestImageGrid(data.subarray(0, 18 + length), testImagePalette(scenario))) ? scenario : void 0;
1896
1960
  }
1897
- export { TEST_INPUT_KEY_PATTERN as a, detectTestTrigger as c, getTestInputTag as d, paintTestImage as f, TEST_FACE_AGE_PRESETS as i, generateTestTextCode as l, CLASSIFICATION_CATEGORIES as m, TEST_DETECTION_BOX_MAX as n, TEST_INPUT_PRESETS as o, testInputForSignal as p, TEST_FACE_AGE_MAX as r, detectTestImage as s, TEST_DETECTIONS_MAX as t, getImageTestCategories as u };
1961
+ export { TEST_INPUT_KEY_PATTERN as a, detectTestTrigger as c, getTestInputTag as d, paintTestImage as f, CLASSIFICATION_CATEGORIES as h, TEST_FACE_AGE_PRESETS as i, generateTestTextCode as l, lazySchema as m, TEST_DETECTION_BOX_MAX as n, TEST_INPUT_PRESETS as o, testInputForSignal as p, TEST_FACE_AGE_MAX as r, detectTestImage as s, TEST_DETECTIONS_MAX as t, getImageTestCategories as u };
@@ -1,4 +1,4 @@
1
- import { r as ClassificationCategory } from "./Classification-CxRedzgH-C9qlYW_J.js";
1
+ import { r as ClassificationCategory } from "./Classification-CMM2tZpJ-IdIh63n0.js";
2
2
  import * as z from "zod";
3
3
  interface RgbaImage {
4
4
  width: number;
@@ -1,5 +1,5 @@
1
- import { Y as CalmLensError, ot as SDK_ERROR_CODES } from "./ModerationContextLimits-DxuPP4uM.js";
2
- import { t as CalmLensAppClient } from "./CalmLensAppClient-DNkIZb6x.js";
1
+ import { Y as CalmLensError, ot as SDK_ERROR_CODES } from "./ModerationContextLimits-BmV8QD32.js";
2
+ import { t as CalmLensAppClient } from "./CalmLensAppClient-CgDogQQC.js";
3
3
  // src/contract/PlaceholderHashDecode.js
4
4
  /**
5
5
  * Decodes a ThumbHash to an RGBA image. RGB is not be premultiplied by A.
@@ -1,4 +1,4 @@
1
- import { cn as Actor, ln as EventAsset, un as TypedEvent } from "./CalmLensTypes-Df8eBgWB.js";
1
+ import { cn as EventAsset, ln as TypedEvent, sn as Actor } from "./CalmLensTypes-HUERg5hI.js";
2
2
  import * as zod from "zod";
3
3
  /** Error codes the CalmLens API documents, by name. */
4
4
  declare const API_ERROR_CODES: {
@@ -67,9 +67,6 @@ declare const API_ERROR_CODES: {
67
67
  readonly ASSET_NOT_RETRYABLE: "asset/not-retryable";
68
68
  readonly ASSET_CONTENT_UNAVAILABLE: "asset/content-unavailable";
69
69
  readonly ASSET_CONTENT_PURGED: "asset/content-purged";
70
- readonly ASSET_NOT_DECIDED: "asset/not-decided";
71
- readonly ASSET_POLICY_CHANGED: "asset/policy-changed";
72
- readonly ASSET_REVIEWED: "asset/reviewed";
73
70
  readonly SUPPORT_TICKET_NOT_FOUND: "support-ticket/not-found";
74
71
  readonly DUPLICATE_EXTERNAL_ID: "asset/duplicate-external-id";
75
72
  readonly FOLDER_NOT_FOUND: "folder/not-found";
@@ -218,9 +215,6 @@ declare const CALMLENS_ERROR_CODES: {
218
215
  readonly ASSET_NOT_RETRYABLE: "asset/not-retryable";
219
216
  readonly ASSET_CONTENT_UNAVAILABLE: "asset/content-unavailable";
220
217
  readonly ASSET_CONTENT_PURGED: "asset/content-purged";
221
- readonly ASSET_NOT_DECIDED: "asset/not-decided";
222
- readonly ASSET_POLICY_CHANGED: "asset/policy-changed";
223
- readonly ASSET_REVIEWED: "asset/reviewed";
224
218
  readonly SUPPORT_TICKET_NOT_FOUND: "support-ticket/not-found";
225
219
  readonly DUPLICATE_EXTERNAL_ID: "asset/duplicate-external-id";
226
220
  readonly FOLDER_NOT_FOUND: "folder/not-found";