calmlens 0.19.0 → 0.20.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (74) hide show
  1. package/bin/calmlens.js +293 -18
  2. package/{esm/BrowserUpload-RkxV_Vv7.d.ts → cjs/BrowserUpload-C07aL9Vq.d.ts} +2 -2
  3. package/cjs/{BrowserUpload-CJ4Xc9bR.js → BrowserUpload-CjSHjx3C.js} +1 -1
  4. package/{esm/CalmLensAppClient-B5gfOB6J.d.ts → cjs/CalmLensAppClient-DDLojj0P.d.ts} +1 -1
  5. package/cjs/{CalmLensAppClient-LHMEQ-UZ.js → CalmLensAppClient-NaCxOVlM.js} +2 -2
  6. package/cjs/{CalmLensOptionKeys-BUj7v5AG.js → CalmLensOptionKeys-p2QK687A.js} +63 -2
  7. package/cjs/{CalmLensServerClient-BVOEUT_v.js → CalmLensServerClient-BDzTthxE.js} +12 -7
  8. package/cjs/{CalmLensServerClient-DCSbwIBs.d.ts → CalmLensServerClient-C-jsjn8m.d.ts} +4 -4
  9. package/cjs/{CalmLensTypes-DpU-hXq2.d.ts → CalmLensTypes-COJbOuiv.d.ts} +2 -2
  10. package/cjs/{ModerationContextLimits-FDpQmw_T.js → ModerationContextLimits-2nIv7Zh3.js} +304 -12
  11. package/cjs/{ReactUpload-BvpW4hJi.js → ReactUpload-BdTRCTGA.js} +1 -1
  12. package/cjs/{ReactUpload-huIMnOJ4.d.ts → ReactUpload-CRJNPB5T.d.ts} +1 -1
  13. package/cjs/{TestTriggers-CMwMrbjy-K0YBzu2a.js → TestTriggers-DbhsNPdg-DjvVuc2h.js} +2 -2
  14. package/cjs/{UploadController-D4qOZZc3.js → UploadController-MLVs97Zt.js} +2 -2
  15. package/cjs/{WebhookPayload-CQg8BBZQ.d.ts → WebhookPayload-DkukERKE.d.ts} +1 -1
  16. package/cjs/app.d.ts +4 -4
  17. package/cjs/app.js +2 -2
  18. package/cjs/elements.d.ts +2 -2
  19. package/cjs/elements.js +3 -3
  20. package/{esm/index-BcDDQJF2.d.ts → cjs/index-DxbJ_Xaa.d.ts} +2 -2
  21. package/cjs/index.d.ts +3 -3
  22. package/cjs/index.js +1 -1
  23. package/cjs/react-native.d.ts +2 -2
  24. package/cjs/react-native.js +3 -3
  25. package/cjs/react.d.ts +2 -2
  26. package/cjs/react.js +4 -4
  27. package/cjs/server.d.ts +4 -4
  28. package/cjs/server.js +2 -2
  29. package/cjs/test-inputs.js +9 -9
  30. package/cjs/testing.d.ts +10 -7
  31. package/cjs/testing.js +121 -18
  32. package/cjs/{ui-B23r8BvW.d.ts → ui-BSqPGKrZ.d.ts} +2 -2
  33. package/cjs/{ui-Dq-cm6Rx.js → ui-CX1z2pD9.js} +2 -2
  34. package/cjs/ui.d.ts +1 -1
  35. package/cjs/ui.js +2 -2
  36. package/cjs/vue.d.ts +4 -4
  37. package/cjs/vue.js +3 -3
  38. package/{cjs/BrowserUpload-RkxV_Vv7.d.ts → esm/BrowserUpload-C07aL9Vq.d.ts} +2 -2
  39. package/esm/{BrowserUpload-DpzS2bbj.js → BrowserUpload-CAVkRotw.js} +1 -1
  40. package/{cjs/CalmLensAppClient-B5gfOB6J.d.ts → esm/CalmLensAppClient-DDLojj0P.d.ts} +1 -1
  41. package/esm/{CalmLensAppClient-BjlvBweS.js → CalmLensAppClient-PQ9VBvlW.js} +2 -2
  42. package/esm/{CalmLensOptionKeys-BKez0Wiw.js → CalmLensOptionKeys-Do2mPP6w.js} +58 -3
  43. package/esm/{CalmLensServerClient-DCSbwIBs.d.ts → CalmLensServerClient-C-jsjn8m.d.ts} +4 -4
  44. package/esm/{CalmLensServerClient-DemxbNMn.js → CalmLensServerClient-C_H5aAsV.js} +12 -7
  45. package/esm/{CalmLensTypes-DpU-hXq2.d.ts → CalmLensTypes-COJbOuiv.d.ts} +2 -2
  46. package/esm/{ModerationContextLimits-lLfmyLni.js → ModerationContextLimits-Chw-AzgL.js} +291 -11
  47. package/esm/{ReactUpload-6klucehl.js → ReactUpload-CMmL0R5Q.js} +1 -1
  48. package/esm/{ReactUpload-huIMnOJ4.d.ts → ReactUpload-CRJNPB5T.d.ts} +1 -1
  49. package/esm/{TestTriggers-CMwMrbjy-bdowBBKw.js → TestTriggers-DbhsNPdg-CUdrv8Nm.js} +2 -2
  50. package/esm/{UploadController-UxP6gj7A.js → UploadController-BJZghJpg.js} +2 -2
  51. package/esm/{WebhookPayload-CQg8BBZQ.d.ts → WebhookPayload-DkukERKE.d.ts} +1 -1
  52. package/esm/app.d.ts +4 -4
  53. package/esm/app.js +2 -2
  54. package/esm/elements.d.ts +2 -2
  55. package/esm/elements.js +3 -3
  56. package/{cjs/index-BcDDQJF2.d.ts → esm/index-DxbJ_Xaa.d.ts} +2 -2
  57. package/esm/index.d.ts +3 -3
  58. package/esm/index.js +1 -1
  59. package/esm/react-native.d.ts +2 -2
  60. package/esm/react-native.js +3 -3
  61. package/esm/react.d.ts +2 -2
  62. package/esm/react.js +4 -4
  63. package/esm/server.d.ts +4 -4
  64. package/esm/server.js +2 -2
  65. package/esm/test-inputs.js +1 -1
  66. package/esm/testing.d.ts +10 -7
  67. package/esm/testing.js +118 -15
  68. package/esm/{ui-B23r8BvW.d.ts → ui-BSqPGKrZ.d.ts} +2 -2
  69. package/esm/{ui-Bn29rfAi.js → ui-CXH7xJpb.js} +2 -2
  70. package/esm/ui.d.ts +1 -1
  71. package/esm/ui.js +2 -2
  72. package/esm/vue.d.ts +4 -4
  73. package/esm/vue.js +3 -3
  74. package/package.json +1 -1
@@ -1,5 +1,5 @@
1
- import { M as SDK_ERROR_CODES, N as invalidArgument, P as invalidConfig, S as validateSignedUrlOptions, _ as transformSelector, b as validateRequestOptions, c as DEFAULT_CDN_BASE_URL, d as getAssetUrl, f as pollForDecision, g as toTextAssetOptions, j as CalmLensError, l as checkOptionKeys, o as isBrowserRuntime, s as isReactNativeRuntime, u as encodePathSegment, x as validateServerClientOptions, y as validateBatchAssetsOptions } from "./ModerationContextLimits-lLfmyLni.js";
2
- import { a as expectAsset, c as invalidPayload, d as resolveConnectionOptions, f as splitsIntoParts, l as newIdempotencyKey, n as SERVER_OPTION_KEYS, r as CalmLensConnection, s as getMockHooks, u as prepareSubmitAssetOptions } from "./CalmLensOptionKeys-BKez0Wiw.js";
1
+ import { C as validateRequestOptions, F as invalidArgument, I as invalidConfig, N as CalmLensError, P as SDK_ERROR_CODES, S as validateBatchAssetsOptions, T as validateSignedUrlOptions, b as transformSelector, c as DEFAULT_CDN_BASE_URL, d as encodePathSegment, f as getAssetUrl, h as pollForDecision, l as checkOptionKeys, o as isBrowserRuntime, s as isReactNativeRuntime, w as validateServerClientOptions, y as toTextAssetOptions } from "./ModerationContextLimits-Chw-AzgL.js";
2
+ import { c as getMockHooks, d as prepareSubmitAssetOptions, f as resolveConnectionOptions, i as CalmLensConnection, l as invalidPayload, n as NULLABLE_OPTION_KEYS, o as expectAsset, p as splitsIntoParts, r as SERVER_OPTION_KEYS, u as newIdempotencyKey } from "./CalmLensOptionKeys-Do2mPP6w.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) => {
@@ -146,10 +146,15 @@ const getEnsureLensCacheKey = (options) => stringifyJsonCanonical({
146
146
  version: options.version
147
147
  });
148
148
  const requireId = (value, name) => encodePathSegment(value, name);
149
- /** `options`, once `checkOptionKeys` finds only keys `operation` takes. */
149
+ /**
150
+ * `options`, once `checkOptionKeys` finds only keys `operation` takes, without the options given as
151
+ * `null` that the API refuses as `null`: those are left out, as if omitted.
152
+ */
150
153
  const checked = (operation, options) => {
151
154
  checkOptionKeys(options, operation, SERVER_OPTION_KEYS);
152
- return options;
155
+ if (!options || typeof options !== "object" || Array.isArray(options)) return options;
156
+ const nullable = NULLABLE_OPTION_KEYS[operation] ?? [];
157
+ return Object.fromEntries(Object.entries(options).filter(([key, value]) => value !== null || nullable.includes(key)));
153
158
  };
154
159
  /**
155
160
  * Iterators stop rather than loop: a page that says more follow must not hand back a cursor this
@@ -377,8 +382,8 @@ sign: async (options) => {
377
382
  * Uploads an asset and waits for its moderation decision. Audio and video still finish
378
383
  * in the background. Retried safely with an `Idempotency-Key`.
379
384
  */
380
- classify: async (options) => {
381
- checked("assets.classify", options);
385
+ classify: async (classifyOptions) => {
386
+ const options = checked("assets.classify", classifyOptions);
382
387
  if (options && "content" in options && "plainText" in options.content && (typeof options.content.plainText !== "string" || !options.content.plainText.trim())) throw invalidPayload("Text to classify must be a non-empty string");
383
388
  return this.submitAsset(options, false);
384
389
  },
@@ -621,7 +626,7 @@ sign: async (options) => {
621
626
  const { policyId, ...body } = checked("policies.applyPreset", options);
622
627
  return this.request("POST", `${policyPath(policyId)}/preset`, { body });
623
628
  },
624
- /** Switches automatic updates on or off for the project's preset policy. */
629
+ /** Switches automatic updates on or off for the organisation's own preset policy. */
625
630
  setAutomaticUpdates: async (options) => {
626
631
  const { policyId, ...body } = checked("policies.setAutomaticUpdates", options);
627
632
  return this.request("PUT", `${policyPath(policyId)}/automatic-updates`, { body });
@@ -38198,7 +38198,7 @@ declare const POLICY_SCHEMA: zod.ZodObject<{
38198
38198
  }>;
38199
38199
  version: zod.ZodNumber;
38200
38200
  latestVersion: zod.ZodNumber;
38201
- projectId: zod.ZodNullable<zod.ZodString>;
38201
+ own: zod.ZodBoolean;
38202
38202
  }, zod.core.$strip>>;
38203
38203
  projectIds: zod.ZodArray<zod.ZodString>;
38204
38204
  createdAt: zod.ZodNumber;
@@ -38833,7 +38833,7 @@ declare const GET_POLICIES_RESPONSE_SCHEMA: zod.ZodObject<{
38833
38833
  }>;
38834
38834
  version: zod.ZodNumber;
38835
38835
  latestVersion: zod.ZodNumber;
38836
- projectId: zod.ZodNullable<zod.ZodString>;
38836
+ own: zod.ZodBoolean;
38837
38837
  }, zod.core.$strip>>;
38838
38838
  projectIds: zod.ZodArray<zod.ZodString>;
38839
38839
  createdAt: zod.ZodNumber;
@@ -450,7 +450,7 @@ const API_ERROR_DEFINITIONS = {
450
450
  },
451
451
  "policy/used-by-another-project": {
452
452
  status: 409,
453
- message: "Another project uses or owns this policy, so it can only be changed from the portal or that project."
453
+ message: "Another project uses this policy, so it can only be changed from the portal or that project."
454
454
  },
455
455
  "policy/no-preset": {
456
456
  status: 400,
@@ -466,7 +466,7 @@ const API_ERROR_DEFINITIONS = {
466
466
  },
467
467
  "policy/automatic-updates-unavailable": {
468
468
  status: 409,
469
- message: "Automatic updates can only be switched on for a saved copy of a project's preset policy, and off for one that has them."
469
+ message: "Automatic updates can only be switched on for a saved copy of one of the organisation's own preset policies, and off for one that has them."
470
470
  },
471
471
  "upload-preset/not-found": {
472
472
  status: 404,
@@ -656,7 +656,7 @@ const invalidArgument = (message, details) => new CalmLensError(SDK_ERROR_CODES.
656
656
  details
657
657
  });
658
658
  const invalidConfig = (message) => new CalmLensError(SDK_ERROR_CODES.INVALID_CONFIG, { message });
659
- // src/contract/SharedConstants-CrqW8Uco.js
659
+ // src/contract/SharedConstants-DxUCZwLZ.js
660
660
  const IMPERSONATION_COOKIE_NAME = "CL_impersonation";
661
661
  const DAY_MS = 864e5;
662
662
  const YEAR_MS = 365 * DAY_MS;
@@ -857,7 +857,156 @@ const MAX_IMAGE_UPLOAD_BYTES = /* @__PURE__ */ (() => 20971520)();
857
857
  const MAX_DIRECT_IMAGE_UPLOAD_BYTES = /* @__PURE__ */ (() => 10485760)();
858
858
  const MAX_NON_IMAGE_UPLOAD_MB = 5e3;
859
859
  const MAX_NON_IMAGE_UPLOAD_BYTES = /* @__PURE__ */ (() => MAX_NON_IMAGE_UPLOAD_MB * 1024 * 1024)();
860
- const REJECTED_UPLOAD_MIME_TYPE_SET = /* @__PURE__ */ new Set([
860
+ const normalizeUploadMimeType = (mimeType) => mimeType.toLowerCase().split(";")[0]?.trim() || mimeType.toLowerCase().trim();
861
+ const getRejectedUploadMimeTypeError = (mimeType) => `${normalizeUploadMimeType(mimeType)} is not a valid upload file type. Uploads must use a concrete file MIME type that CalmLens can store and process, such as image/png, image/jpeg, application/pdf, or text/plain.`;
862
+ const DOMAIN = "calmlens.com";
863
+ // src/client/CalmLensTransformSchema.ts
864
+ /** The image transform options' schema, with only the rules the SDK checks. */
865
+ const TRANSFORM_OPTIONS_SCHEMA = {
866
+ type: "object",
867
+ properties: {
868
+ format: {
869
+ type: "string",
870
+ enum: [
871
+ "jpg",
872
+ "png",
873
+ "webp",
874
+ "avif",
875
+ "gif"
876
+ ]
877
+ },
878
+ width: {
879
+ type: "integer",
880
+ minimum: 1,
881
+ maximum: 1e4
882
+ },
883
+ height: {
884
+ type: "integer",
885
+ minimum: 1,
886
+ maximum: 1e4
887
+ },
888
+ dpr: {
889
+ type: "number",
890
+ minimum: 1,
891
+ maximum: 3
892
+ },
893
+ anim: { type: "boolean" },
894
+ background: { type: "string" },
895
+ blur: { type: "number" },
896
+ redact: {
897
+ type: "object",
898
+ properties: {
899
+ text: { type: "boolean" },
900
+ personalInformation: { type: "boolean" },
901
+ faces: { type: "boolean" }
902
+ }
903
+ },
904
+ border: {
905
+ type: "object",
906
+ properties: {
907
+ color: { type: "string" },
908
+ width: { type: "number" }
909
+ }
910
+ },
911
+ brightness: { type: "number" },
912
+ contrast: { type: "number" },
913
+ quality: { oneOf: [{
914
+ type: "integer",
915
+ minimum: 1,
916
+ maximum: 100
917
+ }, {
918
+ type: "string",
919
+ enum: [
920
+ "low",
921
+ "medium",
922
+ "high"
923
+ ]
924
+ }] },
925
+ fit: {
926
+ type: "string",
927
+ enum: [
928
+ "scale-down",
929
+ "contain",
930
+ "pad",
931
+ "squeeze",
932
+ "cover",
933
+ "crop"
934
+ ]
935
+ },
936
+ flip: {
937
+ type: "string",
938
+ enum: [
939
+ "h",
940
+ "v",
941
+ "hv"
942
+ ]
943
+ },
944
+ gamma: { type: "number" },
945
+ segment: {
946
+ type: "string",
947
+ enum: ["foreground"]
948
+ },
949
+ gravity: { oneOf: [{
950
+ type: "string",
951
+ enum: [
952
+ "face",
953
+ "left",
954
+ "right",
955
+ "top",
956
+ "bottom",
957
+ "center",
958
+ "auto",
959
+ "entropy"
960
+ ]
961
+ }, {
962
+ type: "object",
963
+ properties: {
964
+ mode: {
965
+ type: "string",
966
+ enum: ["remainder", "box-center"]
967
+ },
968
+ x: { type: "number" },
969
+ y: { type: "number" }
970
+ },
971
+ required: ["mode"]
972
+ }] },
973
+ rotate: {
974
+ type: "integer",
975
+ enum: [
976
+ 0,
977
+ 90,
978
+ 180,
979
+ 270
980
+ ]
981
+ },
982
+ saturation: { type: "number" },
983
+ sharpen: { type: "number" },
984
+ trim: { oneOf: [{
985
+ type: "string",
986
+ enum: ["border"]
987
+ }, {
988
+ type: "object",
989
+ properties: {
990
+ top: { type: "number" },
991
+ bottom: { type: "number" },
992
+ left: { type: "number" },
993
+ right: { type: "number" },
994
+ width: { type: "number" },
995
+ height: { type: "number" },
996
+ border: { oneOf: [{ type: "boolean" }, {
997
+ type: "object",
998
+ properties: {
999
+ color: { type: "string" },
1000
+ tolerance: { type: "number" },
1001
+ keep: { type: "number" }
1002
+ }
1003
+ }] }
1004
+ }
1005
+ }] }
1006
+ }
1007
+ };
1008
+ // src/client/CalmLensUploadMimeTypes.ts
1009
+ const UPLOAD_MIME_REJECTED = [
861
1010
  "application/octet-stream",
862
1011
  "multipart/form-data",
863
1012
  "multipart/mixed",
@@ -865,11 +1014,27 @@ const REJECTED_UPLOAD_MIME_TYPE_SET = /* @__PURE__ */ new Set([
865
1014
  "multipart/related",
866
1015
  "multipart/signed",
867
1016
  "multipart/encrypted"
868
- ]);
869
- const normalizeUploadMimeType = (mimeType) => mimeType.toLowerCase().split(";")[0]?.trim() || mimeType.toLowerCase().trim();
870
- const isRejectedUploadMimeType = (mimeType) => REJECTED_UPLOAD_MIME_TYPE_SET.has(normalizeUploadMimeType(mimeType));
871
- const getRejectedUploadMimeTypeError = (mimeType) => `${normalizeUploadMimeType(mimeType)} is not a valid upload file type. Uploads must use a concrete file MIME type that CalmLens can store and process, such as image/png, image/jpeg, application/pdf, or text/plain.`;
872
- const DOMAIN = "calmlens.com";
1017
+ ];
1018
+ const UPLOAD_MIME_PREFIXES = [
1019
+ "image/",
1020
+ "video/",
1021
+ "audio/",
1022
+ "text/"
1023
+ ];
1024
+ const UPLOAD_MIME_SUFFIXES = ["+json", "+xml"];
1025
+ const UPLOAD_MIME_TYPES = [
1026
+ "application/pdf",
1027
+ "application/vnd.openxmlformats-officedocument.wordprocessingml.document",
1028
+ "application/msword",
1029
+ "application/rtf",
1030
+ "application/vnd.oasis.opendocument.text",
1031
+ "application/javascript",
1032
+ "application/json",
1033
+ "application/x-javascript",
1034
+ "application/x-yaml",
1035
+ "application/xml",
1036
+ "application/yaml"
1037
+ ];
873
1038
  // src/client/CalmLensViewerClaims.ts
874
1039
  /** The ISO 3166-1 alpha-2 countries a viewer's `region` can be. EU is not a viewer country. */
875
1040
  const VIEWER_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(" "));
@@ -1036,6 +1201,16 @@ const encodePathSegment = (value, name) => {
1036
1201
  if (value === "." || value === "..") throw invalidArgument(`${name} cannot be "." or ".."`);
1037
1202
  return encodeURIComponent(value);
1038
1203
  };
1204
+ /**
1205
+ * Whether the API accepts an upload of this MIME type: an image, audio, video, text, document or
1206
+ * website type, not a container such as `application/octet-stream`. It refuses any other type with
1207
+ * `upload/invalid-mime-type`.
1208
+ */
1209
+ const isAcceptedUploadMimeType = (mimeType) => {
1210
+ const type = normalizeUploadMimeType(mimeType);
1211
+ if (UPLOAD_MIME_REJECTED.includes(type)) return false;
1212
+ return UPLOAD_MIME_PREFIXES.some((prefix) => type.startsWith(prefix)) || UPLOAD_MIME_SUFFIXES.some((suffix) => type.endsWith(suffix)) || UPLOAD_MIME_TYPES.includes(type);
1213
+ };
1039
1214
  const TRANSFORM_OPTION_NAME = /^[a-z][a-zA-Z0-9]*$/;
1040
1215
  const TRANSFORM_COLOUR_KEYS = /* @__PURE__ */ new Set([
1041
1216
  "background",
@@ -1064,6 +1239,110 @@ const appendTransformOptions = (pairs, key, value) => {
1064
1239
  else throw invalidArgument(`Transform option "${key}" must be a string, number, boolean or object`);
1065
1240
  pairs.push(`${key}=${encodeTransformComponent(text)}`);
1066
1241
  };
1242
+ const hasRuleType = (type, value) => {
1243
+ switch (type) {
1244
+ case "object": return isPlainObject(value);
1245
+ case "string":
1246
+ case "boolean": return typeof value === type;
1247
+ case "number": return typeof value === "number" && Number.isFinite(value);
1248
+ case "integer": return typeof value === "number" && Number.isInteger(value);
1249
+ default: return true;
1250
+ }
1251
+ };
1252
+ /**
1253
+ * Checks transform options against the image transform schema, as the CDN does, and returns the
1254
+ * dotted keys it doesn't know and those whose values it refuses (or that are required and missing).
1255
+ * `null` options are left out of a selector, so they are not checked.
1256
+ */
1257
+ const checkTransformOptions = (options) => {
1258
+ const unknownKeys = [];
1259
+ const invalidKeys = [];
1260
+ const check = (schema, value, key) => {
1261
+ const rule = schema.oneOf ? schema.oneOf.find(({ type }) => hasRuleType(type, value)) : schema;
1262
+ if (!rule || !hasRuleType(rule.type, value) || rule.enum && !rule.enum.includes(value) || rule.minimum !== void 0 && value < rule.minimum || rule.maximum !== void 0 && value > rule.maximum) {
1263
+ invalidKeys.push(key);
1264
+ return;
1265
+ }
1266
+ if (rule.type !== "object") return;
1267
+ const object = value;
1268
+ const path = (name) => key ? `${key}.${name}` : name;
1269
+ for (const name of rule.required ?? []) if (object[name] === void 0 || object[name] === null) invalidKeys.push(path(name));
1270
+ for (const name of Object.keys(object).sort()) {
1271
+ if (object[name] === void 0 || object[name] === null) continue;
1272
+ const child = rule.properties?.[name];
1273
+ if (child) check(child, object[name], path(name));
1274
+ else unknownKeys.push(path(name));
1275
+ }
1276
+ };
1277
+ check(TRANSFORM_OPTIONS_SCHEMA, options, "");
1278
+ return {
1279
+ unknownKeys,
1280
+ invalidKeys
1281
+ };
1282
+ };
1283
+ /**
1284
+ * Reads a CDN selector, the path segment after `/rendered` as sent (still percent-encoded), as the
1285
+ * CDN does (packages/shared/src/TransformSelector.ts): an optional first `@lens`, then `key=value`
1286
+ * options with dotted keys for nested ones (a bare key is `true`). Values are numbers, `true`,
1287
+ * `false`, hex colours (`#` added) for colour options, or text. Throws on anything the CDN refuses
1288
+ * as `asset/invalid-transform`. Used by the mock CDN.
1289
+ */
1290
+ const parseTransformSelector = (selector) => {
1291
+ if (!selector) return {};
1292
+ const fail = () => /* @__PURE__ */ new Error(`Invalid transform selector "${selector}"`);
1293
+ if (selector.includes("/")) throw fail();
1294
+ const decode = (text) => {
1295
+ try {
1296
+ return decodeURIComponent(text);
1297
+ } catch {
1298
+ throw fail();
1299
+ }
1300
+ };
1301
+ const entries = selector.split(",");
1302
+ let lens;
1303
+ if (entries[0].startsWith("@")) {
1304
+ lens = decode(entries.shift().slice(1));
1305
+ if (!/^[a-z0-9-]{1,50}$/.test(lens)) throw fail();
1306
+ }
1307
+ if (!entries.length) return { lens };
1308
+ const options = {};
1309
+ for (const entry of entries) {
1310
+ if (!entry || entry.startsWith("@")) throw fail();
1311
+ const separator = entry.indexOf("=");
1312
+ const key = separator === -1 ? entry : entry.slice(0, separator);
1313
+ const parts = key.split(".");
1314
+ if (!parts.every((part) => TRANSFORM_OPTION_NAME.test(part))) throw fail();
1315
+ let value = true;
1316
+ if (separator !== -1) {
1317
+ const text = decode(entry.slice(separator + 1));
1318
+ if (text === "") throw fail();
1319
+ value = TRANSFORM_COLOUR_KEYS.has(key) && HEX_COLOUR.test(`#${text}`) ? `#${text.toLowerCase()}` : /^-?(?:0|[1-9]\d*)(?:\.\d+)?$/.test(text) ? Number(text) : text === "true" || text === "false" ? text === "true" : text;
1320
+ }
1321
+ let target = options;
1322
+ for (const part of parts.slice(0, -1)) {
1323
+ const next = target[part];
1324
+ if (next !== void 0 && !isPlainObject(next)) throw fail();
1325
+ target = target[part] ??= {};
1326
+ }
1327
+ const last = parts.at(-1);
1328
+ if (last in target) throw fail();
1329
+ target[last] = value;
1330
+ }
1331
+ return {
1332
+ lens,
1333
+ options
1334
+ };
1335
+ };
1336
+ /** Throws `sdk/invalid-argument` naming each transform option the CDN would refuse. */
1337
+ const assertTransformOptions = (options) => {
1338
+ const { unknownKeys, invalidKeys } = checkTransformOptions(options);
1339
+ if (!unknownKeys.length && !invalidKeys.length) return;
1340
+ const problems = [...unknownKeys.length ? [`unknown option${unknownKeys.length > 1 ? "s" : ""} ${unknownKeys.join(", ")}`] : [], ...invalidKeys.length ? [`invalid value${invalidKeys.length > 1 ? "s" : ""} for ${invalidKeys.join(", ")}`] : []];
1341
+ throw invalidArgument(`Transform options are invalid: ${problems.join("; ")}. Pass the options themselves, such as { width: 640, format: "webp" }.`, {
1342
+ unknownKeys,
1343
+ invalidKeys
1344
+ });
1345
+ };
1067
1346
  /**
1068
1347
  * Serializes structured transform options as a CDN selector, such as `fit=cover,width=640`. Option
1069
1348
  * keys are sorted so equal transforms share a URL, nested keys are dotted (`border.color`),
@@ -1071,6 +1350,7 @@ const appendTransformOptions = (pairs, key, value) => {
1071
1350
  */
1072
1351
  const serializeTransform = (transform) => {
1073
1352
  if (!isPlainObject(transform)) throw invalidArgument("Transform options must be an object");
1353
+ assertTransformOptions(transform);
1074
1354
  const pairs = [];
1075
1355
  for (const key of Object.keys(transform).sort()) {
1076
1356
  if (!TRANSFORM_OPTION_NAME.test(key)) throw invalidArgument(`Transform option "${key}" is not a valid name`);
@@ -1199,7 +1479,7 @@ const pollForDecision = async (retrieve, { timeoutMs = DEFAULT_DECISION_TIMEOUT_
1199
1479
  };
1200
1480
  // src/client/CalmLensVersion.ts
1201
1481
  /** This SDK's version, from its package.json. */
1202
- const SDK_VERSION = "0.19.0";
1482
+ const SDK_VERSION = "0.20.0";
1203
1483
  const runtimeName = () => {
1204
1484
  const runtime = globalThis;
1205
1485
  if (isReactNativeRuntime()) return "react-native";
@@ -1247,4 +1527,4 @@ const selectModerationContextItems = (items) => {
1247
1527
  }
1248
1528
  return selected;
1249
1529
  };
1250
- export { CALMLENS_ERROR_CODES as A, EU_COUNTRIES as C, MAX_NON_IMAGE_UPLOAD_BYTES as D, MAX_IMAGE_UPLOAD_BYTES as E, API_ERROR_CODES as F, API_ERROR_DEFINITIONS as I, SDK_ERROR_CODES as M, invalidArgument as N, getRejectedUploadMimeTypeError as O, invalidConfig as P, validateSignedUrlOptions as S, MAX_DIRECT_IMAGE_UPLOAD_BYTES as T, transformSelector as _, getUserAgent as a, validateRequestOptions as b, DEFAULT_CDN_BASE_URL as c, getAssetUrl as d, pollForDecision as f, toTextAssetOptions as g, stringifyQuery as h, SDK_VERSION as i, CalmLensError as j, isRejectedUploadMimeType as k, checkOptionKeys as l, serializeTransform as m, MODERATION_CONTEXT_USED_ITEMS as n, isBrowserRuntime as o, randomUuid as p, selectModerationContextItems as r, isReactNativeRuntime as s, MODERATION_CONTEXT_USED_CHARACTERS as t, encodePathSegment as u, validateAppClientOptions as v, DOMAIN as w, validateServerClientOptions as x, validateBatchAssetsOptions as y };
1530
+ export { MAX_NON_IMAGE_UPLOAD_BYTES as A, validateRequestOptions as C, DOMAIN as D, EU_COUNTRIES as E, invalidArgument as F, invalidConfig as I, API_ERROR_CODES as L, CALMLENS_ERROR_CODES as M, CalmLensError as N, MAX_DIRECT_IMAGE_UPLOAD_BYTES as O, SDK_ERROR_CODES as P, API_ERROR_DEFINITIONS as R, validateBatchAssetsOptions as S, validateSignedUrlOptions as T, serializeTransform as _, getUserAgent as a, transformSelector as b, DEFAULT_CDN_BASE_URL as c, encodePathSegment as d, getAssetUrl as f, randomUuid as g, pollForDecision as h, SDK_VERSION as i, getRejectedUploadMimeTypeError as j, MAX_IMAGE_UPLOAD_BYTES as k, checkOptionKeys as l, parseTransformSelector as m, MODERATION_CONTEXT_USED_ITEMS as n, isBrowserRuntime as o, isAcceptedUploadMimeType as p, selectModerationContextItems as r, isReactNativeRuntime as s, MODERATION_CONTEXT_USED_CHARACTERS as t, checkTransformOptions as u, stringifyQuery as v, validateServerClientOptions as w, validateAppClientOptions as x, toTextAssetOptions as y };
@@ -1,4 +1,4 @@
1
- import { n as createUploadController } from "./UploadController-UxP6gj7A.js";
1
+ import { n as createUploadController } from "./UploadController-BJZghJpg.js";
2
2
  import { useEffect, useMemo, useRef, useState, useSyncExternalStore } from "react";
3
3
  // src/ui/ReactUpload.ts
4
4
  /** Re-renders with a controller's snapshot. */
@@ -1,4 +1,4 @@
1
- import { F as UploadFile, L as UploadSnapshot, N as UploadController, P as UploadControllerOptions } from "./ui-B23r8BvW.js";
1
+ import { F as UploadFile, L as UploadSnapshot, N as UploadController, P as UploadControllerOptions } from "./ui-BSqPGKrZ.js";
2
2
  interface UseCalmLensUploadResult<F extends UploadFile = UploadFile> extends UploadSnapshot<F> {
3
3
  controller: UploadController<F>;
4
4
  addFiles: UploadController<F>["addFiles"];
@@ -1076,7 +1076,7 @@ const TEST_REGIONAL_ACTIONS_SCHEMA = z.array(z.object({
1076
1076
  "block"
1077
1077
  ])
1078
1078
  }).strict()).max(7).refine((entries) => new Set(entries.map((entry) => entry.region)).size === entries.length, "Choose each region once");
1079
- // src/contract/TestTriggers-CMwMrbjy.js
1079
+ // src/contract/TestTriggers-DbhsNPdg.js
1080
1080
  /**
1081
1081
  * The visual encoding of test images (shared by images and video frames), independent of what the
1082
1082
  * bytes mean. An odd N×N grid of square cells fills the image. Its outer ring alternates black and
@@ -1422,7 +1422,7 @@ function testInputForSignal(signal, kind = "text") {
1422
1422
  }] };
1423
1423
  case "violence.graphic": return { instances: [{
1424
1424
  category: "violence",
1425
- qualifiers: ["violence-graphic"]
1425
+ qualifiers: ["violence-injury", "violence-graphic"]
1426
1426
  }] };
1427
1427
  default: return TEST_INPUT_SCHEMA.parse({ instances: [{
1428
1428
  category: signal,
@@ -1,5 +1,5 @@
1
- import { M as SDK_ERROR_CODES, j as CalmLensError } from "./ModerationContextLimits-lLfmyLni.js";
2
- import { t as CalmLensAppClient } from "./CalmLensAppClient-BjlvBweS.js";
1
+ import { N as CalmLensError, P as SDK_ERROR_CODES } from "./ModerationContextLimits-Chw-AzgL.js";
2
+ import { t as CalmLensAppClient } from "./CalmLensAppClient-PQ9VBvlW.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 { Bt as TypedEvent, zt as EventAsset } from "./CalmLensTypes-DpU-hXq2.js";
1
+ import { Bt as TypedEvent, zt as EventAsset } from "./CalmLensTypes-COJbOuiv.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: {
package/esm/app.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import { a as selectModerationContextItems, i as ModerationContextItem, n as MODERATION_CONTEXT_USED_CHARACTERS, o as HashList, r as MODERATION_CONTEXT_USED_ITEMS, s as HashListEntry, t as ModerationContext } from "./ModerationContext-9lGm-Mna-CcmbRnOy.js";
2
- import { $ as ImageTransformOptions, $t as AssetSearchMatchField, A as CdnServeOptions, At as UploadedAsset, B as DeleteAssetContentOptions, Bt as TypedEvent, C as AssignPolicyOptions, Ct as SubmitAssetOptions, D as CalmLensServerClientOptions, Dt as UpdatePolicyOptions, E as CalmLensAppClientOptions, Et as UpdateHashListOptions, F as CreateFolderOptions, Ft as WebhookPayloadInput, G as FolderIdOptions, Gt as EventSeverity, H as EnsureLensOptions, Ht as EventFact, I as CreateHashListOptions, It as AssetBatchOperation, J as HashListEntryIdOptions, Jt as Folder, Kt as EventType, L as CreateMultipartUploadPartOptions, Lt as GetEventsResponse, M as ClassifyTextOptions, Mt as ViewerClaims, N as ConnectionOptions, Nt as WaitForAssetDecisionOptions, O as CdnAssetUrlOptions, Ot as UploadAssetPartOptions, P as CreateAssetSignedUrlOptions, Pt as WebhookHeadersInput, Q as IdempotencyOptions, Qt as LensType, R as CreatePolicyOptions, S as AssetVisibility, St as SignedUrl, T as BatchAssetsResponse, Tt as UpdateFolderOptions, U as EnsureLensesOptions, Ut as EventFactValues, V as DeleteAssetOptions, Vt as EventCategory, W as ExplainAssetOptions, Wt as EventFacts, X as HashListIdOptions, Xt as CursorPage, Y as HashListEntryPage, Yt as Policy, Z as HashListPage, Zt as Order, _ as AssetSearchResponse, _t as RetryAssetOptions, a as AssetChildrenPage, an as ExtractedText, at as ListEventsOptions, b as AssetUpload, bt as SignUploadTokenOptions, c as AssetClassificationStatus, cn as ProcessingOptions, ct as ListHashListsOptions, d as AssetContentRemovalReason, dt as MultipartUploadOptions, en as AssetSearchQuery, et as IterateAssetChildrenOptions, f as AssetContentStatus, ft as MultipartUploadPartOptions, g as AssetPage, gt as RetrieveAssetOptions, h as AssetModerationStatus, ht as RequestOptions, i as AssetChecksums, in as AssetSafetyHoldReason, it as ListAssetsOptions, j as CdnTransform, jt as VerifyWebhookSignatureOptions, k as CdnResource, kt as UploadPresetSubmitAssetOptions, l as AssetContent, lt as MoveAssetOptions, m as AssetModerationDecision, mt as PolicyList, n as ApplyPolicyPresetOptions, nn as AssetImage, nt as Lens, o as AssetClassification, on as FileMetadata, p as AssetModeration, pt as PolicyIdOptions, q as GetAssetUrlOptions, r as Asset, rn as AssetSafetyHold, rt as ListAssetChildrenOptions, s as AssetClassificationFailureReason, sn as MetadataItem, st as ListHashListEntriesOptions, t as AddHashListEntryOptions, tt as IterateAssetsOptions, u as AssetContentOptions, ut as MoveFolderOptions, v as AssetSearchResult, vt as SearchAssetsOptions, w as BatchAssetsOptions, wt as UpdateAssetOptions, x as AssetUploadStatus, xt as SignedUploadToken, y as AssetType, yt as SetPolicyAutomaticUpdatesOptions, z as DecideAssetOptions, zt as EventAsset } from "./CalmLensTypes-DpU-hXq2.js";
3
- import { t as CalmLensAppClient } from "./CalmLensAppClient-B5gfOB6J.js";
4
- import { a as CalmLensErrorCode, c as SdkErrorCode, i as CalmLensError, l as ApiErrorCode, o as CalmLensErrorDetails, r as CALMLENS_ERROR_CODES, s as CalmLensErrorOptions, t as ReceivedWebhookEventPayload } from "./WebhookPayload-CQg8BBZQ.js";
5
- import { a as ProcessingFeatureId, c as ProcessingFeatures, d as getAssetUrl, i as DetectedPerson, l as SDK_VERSION, n as BoundingBox, o as ProcessingFeatureResults, r as DetectedFace, s as ProcessingFeatureStage, t as AgeRange, u as DEFAULT_CDN_BASE_URL } from "./index-BcDDQJF2.js";
2
+ import { $ as ImageTransformOptions, $t as AssetSearchMatchField, A as CdnServeOptions, At as UploadedAsset, B as DeleteAssetContentOptions, Bt as TypedEvent, C as AssignPolicyOptions, Ct as SubmitAssetOptions, D as CalmLensServerClientOptions, Dt as UpdatePolicyOptions, E as CalmLensAppClientOptions, Et as UpdateHashListOptions, F as CreateFolderOptions, Ft as WebhookPayloadInput, G as FolderIdOptions, Gt as EventSeverity, H as EnsureLensOptions, Ht as EventFact, I as CreateHashListOptions, It as AssetBatchOperation, J as HashListEntryIdOptions, Jt as Folder, Kt as EventType, L as CreateMultipartUploadPartOptions, Lt as GetEventsResponse, M as ClassifyTextOptions, Mt as ViewerClaims, N as ConnectionOptions, Nt as WaitForAssetDecisionOptions, O as CdnAssetUrlOptions, Ot as UploadAssetPartOptions, P as CreateAssetSignedUrlOptions, Pt as WebhookHeadersInput, Q as IdempotencyOptions, Qt as LensType, R as CreatePolicyOptions, S as AssetVisibility, St as SignedUrl, T as BatchAssetsResponse, Tt as UpdateFolderOptions, U as EnsureLensesOptions, Ut as EventFactValues, V as DeleteAssetOptions, Vt as EventCategory, W as ExplainAssetOptions, Wt as EventFacts, X as HashListIdOptions, Xt as CursorPage, Y as HashListEntryPage, Yt as Policy, Z as HashListPage, Zt as Order, _ as AssetSearchResponse, _t as RetryAssetOptions, a as AssetChildrenPage, an as ExtractedText, at as ListEventsOptions, b as AssetUpload, bt as SignUploadTokenOptions, c as AssetClassificationStatus, cn as ProcessingOptions, ct as ListHashListsOptions, d as AssetContentRemovalReason, dt as MultipartUploadOptions, en as AssetSearchQuery, et as IterateAssetChildrenOptions, f as AssetContentStatus, ft as MultipartUploadPartOptions, g as AssetPage, gt as RetrieveAssetOptions, h as AssetModerationStatus, ht as RequestOptions, i as AssetChecksums, in as AssetSafetyHoldReason, it as ListAssetsOptions, j as CdnTransform, jt as VerifyWebhookSignatureOptions, k as CdnResource, kt as UploadPresetSubmitAssetOptions, l as AssetContent, lt as MoveAssetOptions, m as AssetModerationDecision, mt as PolicyList, n as ApplyPolicyPresetOptions, nn as AssetImage, nt as Lens, o as AssetClassification, on as FileMetadata, p as AssetModeration, pt as PolicyIdOptions, q as GetAssetUrlOptions, r as Asset, rn as AssetSafetyHold, rt as ListAssetChildrenOptions, s as AssetClassificationFailureReason, sn as MetadataItem, st as ListHashListEntriesOptions, t as AddHashListEntryOptions, tt as IterateAssetsOptions, u as AssetContentOptions, ut as MoveFolderOptions, v as AssetSearchResult, vt as SearchAssetsOptions, w as BatchAssetsOptions, wt as UpdateAssetOptions, x as AssetUploadStatus, xt as SignedUploadToken, y as AssetType, yt as SetPolicyAutomaticUpdatesOptions, z as DecideAssetOptions, zt as EventAsset } from "./CalmLensTypes-COJbOuiv.js";
3
+ import { t as CalmLensAppClient } from "./CalmLensAppClient-DDLojj0P.js";
4
+ import { a as CalmLensErrorCode, c as SdkErrorCode, i as CalmLensError, l as ApiErrorCode, o as CalmLensErrorDetails, r as CALMLENS_ERROR_CODES, s as CalmLensErrorOptions, t as ReceivedWebhookEventPayload } from "./WebhookPayload-DkukERKE.js";
5
+ import { a as ProcessingFeatureId, c as ProcessingFeatures, d as getAssetUrl, i as DetectedPerson, l as SDK_VERSION, n as BoundingBox, o as ProcessingFeatureResults, r as DetectedFace, s as ProcessingFeatureStage, t as AgeRange, u as DEFAULT_CDN_BASE_URL } from "./index-DxbJ_Xaa.js";
6
6
  import { a as ClassificationNotEvaluatedReason, c as ModerationQualifier, i as ClassificationLabel, l as PolicyAction, n as ClassificationCategory, o as ClassificationQualifierResults, r as ClassificationCategoryReport, s as Likelihood, t as ClassificationCategories } from "./Classification-D3SkprrQ-CMnQKW13.js";
7
7
  export { type AddHashListEntryOptions, type AgeRange, type ApiErrorCode, type ApplyPolicyPresetOptions, type Asset, type AssetBatchOperation, type AssetChecksums, type AssetChildrenPage, type AssetClassification, type AssetClassificationFailureReason, type AssetClassificationStatus, type AssetContent, type AssetContentOptions, type AssetContentRemovalReason, type AssetContentStatus, type AssetImage, type AssetModeration, type AssetModerationDecision, type AssetModerationStatus, type AssetPage, type AssetSafetyHold, type AssetSafetyHoldReason, type AssetSearchMatchField, type AssetSearchQuery, type AssetSearchResponse, type AssetSearchResult, type AssetType, type AssetUpload, type AssetUploadStatus, type AssetVisibility, type AssignPolicyOptions, type BatchAssetsOptions, type BatchAssetsResponse, type BoundingBox, CALMLENS_ERROR_CODES, CalmLensAppClient, type CalmLensAppClientOptions, CalmLensError, type CalmLensErrorCode, type CalmLensErrorDetails, type CalmLensErrorOptions, type CalmLensServerClientOptions, type CdnAssetUrlOptions, type CdnResource, type CdnServeOptions, type CdnTransform, type ClassificationCategories, type ClassificationCategory, type ClassificationCategoryReport, type ClassificationLabel, type ClassificationNotEvaluatedReason, type ClassificationQualifierResults, type ClassifyTextOptions, type ConnectionOptions, type CreateAssetSignedUrlOptions, type CreateFolderOptions, type CreateHashListOptions, type CreateMultipartUploadPartOptions, type CreatePolicyOptions, type CursorPage, DEFAULT_CDN_BASE_URL, type DecideAssetOptions, type DeleteAssetContentOptions, type DeleteAssetOptions, type DetectedFace, type DetectedPerson, type EnsureLensOptions, type EnsureLensesOptions, type EventAsset, type EventCategory, type EventFact, type EventFactValues, type EventFacts, type EventSeverity, type EventType, type GetEventsResponse as EventsPage, type ExplainAssetOptions, type ExtractedText, type FileMetadata, type Folder, type FolderIdOptions, type GetAssetUrlOptions, type HashList, type HashListEntry, type HashListEntryIdOptions, type HashListEntryPage, type HashListIdOptions, type HashListPage, type IdempotencyOptions, type ImageTransformOptions, type IterateAssetChildrenOptions, type IterateAssetsOptions, type Lens, type LensType, type Likelihood, type ListAssetChildrenOptions, type ListAssetsOptions, type ListEventsOptions, type ListHashListEntriesOptions, type ListHashListsOptions, MODERATION_CONTEXT_USED_CHARACTERS, MODERATION_CONTEXT_USED_ITEMS, type MetadataItem, type ModerationContext, type ModerationContextItem, type ModerationQualifier, type MoveAssetOptions, type MoveFolderOptions, type MultipartUploadOptions, type MultipartUploadPartOptions, type Order, type Policy, type PolicyAction, type PolicyIdOptions, type PolicyList, type ProcessingFeatureId, type ProcessingFeatureResults, type ProcessingFeatureStage, type ProcessingFeatures, type ProcessingOptions, type RequestOptions, type RetrieveAssetOptions, type RetryAssetOptions, SDK_VERSION, type SdkErrorCode, type SearchAssetsOptions, type SetPolicyAutomaticUpdatesOptions, type SignUploadTokenOptions, type SignedUploadToken, type SignedUrl, type SubmitAssetOptions, type TypedEvent, type UpdateAssetOptions, type UpdateFolderOptions, type UpdateHashListOptions, type UpdatePolicyOptions, type UploadAssetPartOptions, type UploadPresetSubmitAssetOptions, type UploadedAsset, type VerifyWebhookSignatureOptions, type ViewerClaims, type WaitForAssetDecisionOptions, type ReceivedWebhookEventPayload as WebhookEventPayload, type WebhookHeadersInput, type WebhookPayloadInput, getAssetUrl, selectModerationContextItems };
package/esm/app.js CHANGED
@@ -1,4 +1,4 @@
1
- import { A as CALMLENS_ERROR_CODES, c as DEFAULT_CDN_BASE_URL, d as getAssetUrl, i as SDK_VERSION, j as CalmLensError, n as MODERATION_CONTEXT_USED_ITEMS, r as selectModerationContextItems, t as MODERATION_CONTEXT_USED_CHARACTERS } from "./ModerationContextLimits-lLfmyLni.js";
1
+ import { M as CALMLENS_ERROR_CODES, N as CalmLensError, c as DEFAULT_CDN_BASE_URL, f as getAssetUrl, i as SDK_VERSION, n as MODERATION_CONTEXT_USED_ITEMS, r as selectModerationContextItems, t as MODERATION_CONTEXT_USED_CHARACTERS } from "./ModerationContextLimits-Chw-AzgL.js";
2
2
  import "./index.js";
3
- import { t as CalmLensAppClient } from "./CalmLensAppClient-BjlvBweS.js";
3
+ import { t as CalmLensAppClient } from "./CalmLensAppClient-PQ9VBvlW.js";
4
4
  export { CALMLENS_ERROR_CODES, CalmLensAppClient, CalmLensError, DEFAULT_CDN_BASE_URL, MODERATION_CONTEXT_USED_CHARACTERS, MODERATION_CONTEXT_USED_ITEMS, SDK_VERSION, getAssetUrl, selectModerationContextItems };
package/esm/elements.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { A as CustomUploadContext, B as isFileAccepted, C as formatMessage, D as getUploadItemOutcome, E as getUploadItemMessage, F as UploadFile, G as MediaSource, H as MediaImageSource, J as pickMediaSource, K as MediaState, M as UploadClient, N as UploadController, O as resolveMessages, R as UploadStage, S as formatBytes, T as getMediaUnavailableMessage, U as MediaOptions, V as MediaAsset, W as MediaSettings, Y as resolveMediaProps, _ as DEFAULT_MESSAGES, a as ProgressFetchOptions, b as describeUploadItem, c as ICON_ATTRIBUTES, d as MediaProps, f as UploaderDisplayOptions, g as CalmLensMessages, h as getMediaLoadKey, i as CALMLENS_STYLES, j as CustomUploadResult, l as IconName, m as getMediaAspectRatio, n as CalmLensTheme, o as createProgressFetch, q as getMediaState, r as resolveTheme, s as ICONS, t as CALMLENS_THEME, u as MediaDisplayOptions, v as UploadItemView, w as getDropzoneHint, x as describeUploader, y as UploaderView } from "./ui-B23r8BvW.js";
2
- import { a as UploaderProps, i as UploadSnapshot, n as UploadControllerOptions, r as UploadItem, s as createUploadController, t as CalmLensUpload } from "./BrowserUpload-RkxV_Vv7.js";
1
+ import { A as CustomUploadContext, B as isFileAccepted, C as formatMessage, D as getUploadItemOutcome, E as getUploadItemMessage, F as UploadFile, G as MediaSource, H as MediaImageSource, J as pickMediaSource, K as MediaState, M as UploadClient, N as UploadController, O as resolveMessages, R as UploadStage, S as formatBytes, T as getMediaUnavailableMessage, U as MediaOptions, V as MediaAsset, W as MediaSettings, Y as resolveMediaProps, _ as DEFAULT_MESSAGES, a as ProgressFetchOptions, b as describeUploadItem, c as ICON_ATTRIBUTES, d as MediaProps, f as UploaderDisplayOptions, g as CalmLensMessages, h as getMediaLoadKey, i as CALMLENS_STYLES, j as CustomUploadResult, l as IconName, m as getMediaAspectRatio, n as CalmLensTheme, o as createProgressFetch, q as getMediaState, r as resolveTheme, s as ICONS, t as CALMLENS_THEME, u as MediaDisplayOptions, v as UploadItemView, w as getDropzoneHint, x as describeUploader, y as UploaderView } from "./ui-BSqPGKrZ.js";
2
+ import { a as UploaderProps, i as UploadSnapshot, n as UploadControllerOptions, r as UploadItem, s as createUploadController, t as CalmLensUpload } from "./BrowserUpload-C07aL9Vq.js";
3
3
  /** The `detail` of each event the elements dispatch. */
4
4
  export interface CalmLensElementEvents {
5
5
  "calmlens-uploaded": CalmLensUpload;
package/esm/elements.js CHANGED
@@ -1,6 +1,6 @@
1
- import { _ as getMediaState, a as getMediaAspectRatio, b as ICONS, c as describeUploadItem, d as formatMessage, f as getDropzoneHint, g as resolveMessages, h as getUploadItemOutcome, i as resolveTheme, l as describeUploader, m as getUploadItemMessage, o as getMediaLoadKey, p as getMediaUnavailableMessage, r as CALMLENS_THEME, s as DEFAULT_MESSAGES, t as CALMLENS_STYLES, u as formatBytes, v as pickMediaSource, x as ICON_ATTRIBUTES, y as resolveMediaProps } from "./ui-Bn29rfAi.js";
2
- import { i as createProgressFetch, n as createUploadController$1, r as isFileAccepted, t as UploadController } from "./UploadController-UxP6gj7A.js";
3
- import { t as createUploadController } from "./BrowserUpload-DpzS2bbj.js";
1
+ import { _ as getMediaState, a as getMediaAspectRatio, b as ICONS, c as describeUploadItem, d as formatMessage, f as getDropzoneHint, g as resolveMessages, h as getUploadItemOutcome, i as resolveTheme, l as describeUploader, m as getUploadItemMessage, o as getMediaLoadKey, p as getMediaUnavailableMessage, r as CALMLENS_THEME, s as DEFAULT_MESSAGES, t as CALMLENS_STYLES, u as formatBytes, v as pickMediaSource, x as ICON_ATTRIBUTES, y as resolveMediaProps } from "./ui-CXH7xJpb.js";
2
+ import { i as createProgressFetch, n as createUploadController$1, r as isFileAccepted, t as UploadController } from "./UploadController-BJZghJpg.js";
3
+ import { t as createUploadController } from "./BrowserUpload-CAVkRotw.js";
4
4
  // src/elements.ts
5
5
  const el = (tag, attributes = {}, children = []) => {
6
6
  const node = document.createElement(tag);
@@ -1,6 +1,6 @@
1
1
  import "./ModerationContext-9lGm-Mna-CcmbRnOy.js";
2
- import { q as GetAssetUrlOptions } from "./CalmLensTypes-DpU-hXq2.js";
3
- import "./WebhookPayload-CQg8BBZQ.js";
2
+ import { q as GetAssetUrlOptions } from "./CalmLensTypes-COJbOuiv.js";
3
+ import "./WebhookPayload-DkukERKE.js";
4
4
  import "./Classification-D3SkprrQ-CMnQKW13.js";
5
5
  import * as zod from "zod";
6
6
  declare const DEFAULT_CDN_BASE_URL = "https://cdn.calmlens.com/v1";
package/esm/index.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import { a as selectModerationContextItems, i as ModerationContextItem, n as MODERATION_CONTEXT_USED_CHARACTERS, o as HashList, r as MODERATION_CONTEXT_USED_ITEMS, s as HashListEntry, t as ModerationContext } from "./ModerationContext-9lGm-Mna-CcmbRnOy.js";
2
- import { $ as ImageTransformOptions, $t as AssetSearchMatchField, A as CdnServeOptions, At as UploadedAsset, B as DeleteAssetContentOptions, Bt as TypedEvent, C as AssignPolicyOptions, Ct as SubmitAssetOptions, D as CalmLensServerClientOptions, Dt as UpdatePolicyOptions, E as CalmLensAppClientOptions, Et as UpdateHashListOptions, F as CreateFolderOptions, Ft as WebhookPayloadInput, G as FolderIdOptions, Gt as EventSeverity, H as EnsureLensOptions, Ht as EventFact, I as CreateHashListOptions, It as AssetBatchOperation, J as HashListEntryIdOptions, Jt as Folder, Kt as EventType, L as CreateMultipartUploadPartOptions, Lt as GetEventsResponse, M as ClassifyTextOptions, Mt as ViewerClaims, N as ConnectionOptions, Nt as WaitForAssetDecisionOptions, O as CdnAssetUrlOptions, Ot as UploadAssetPartOptions, P as CreateAssetSignedUrlOptions, Pt as WebhookHeadersInput, Q as IdempotencyOptions, Qt as LensType, R as CreatePolicyOptions, S as AssetVisibility, St as SignedUrl, T as BatchAssetsResponse, Tt as UpdateFolderOptions, U as EnsureLensesOptions, Ut as EventFactValues, V as DeleteAssetOptions, Vt as EventCategory, W as ExplainAssetOptions, Wt as EventFacts, X as HashListIdOptions, Xt as CursorPage, Y as HashListEntryPage, Yt as Policy, Z as HashListPage, Zt as Order, _ as AssetSearchResponse, _t as RetryAssetOptions, a as AssetChildrenPage, an as ExtractedText, at as ListEventsOptions, b as AssetUpload, bt as SignUploadTokenOptions, c as AssetClassificationStatus, cn as ProcessingOptions, ct as ListHashListsOptions, d as AssetContentRemovalReason, dt as MultipartUploadOptions, en as AssetSearchQuery, et as IterateAssetChildrenOptions, f as AssetContentStatus, ft as MultipartUploadPartOptions, g as AssetPage, gt as RetrieveAssetOptions, h as AssetModerationStatus, ht as RequestOptions, i as AssetChecksums, in as AssetSafetyHoldReason, it as ListAssetsOptions, j as CdnTransform, jt as VerifyWebhookSignatureOptions, k as CdnResource, kt as UploadPresetSubmitAssetOptions, l as AssetContent, lt as MoveAssetOptions, m as AssetModerationDecision, mt as PolicyList, n as ApplyPolicyPresetOptions, nn as AssetImage, nt as Lens, o as AssetClassification, on as FileMetadata, p as AssetModeration, pt as PolicyIdOptions, q as GetAssetUrlOptions, r as Asset, rn as AssetSafetyHold, rt as ListAssetChildrenOptions, s as AssetClassificationFailureReason, sn as MetadataItem, st as ListHashListEntriesOptions, t as AddHashListEntryOptions, tt as IterateAssetsOptions, u as AssetContentOptions, ut as MoveFolderOptions, v as AssetSearchResult, vt as SearchAssetsOptions, w as BatchAssetsOptions, wt as UpdateAssetOptions, x as AssetUploadStatus, xt as SignedUploadToken, y as AssetType, yt as SetPolicyAutomaticUpdatesOptions, z as DecideAssetOptions, zt as EventAsset } from "./CalmLensTypes-DpU-hXq2.js";
3
- import { a as CalmLensErrorCode, c as SdkErrorCode, i as CalmLensError, l as ApiErrorCode, o as CalmLensErrorDetails, r as CALMLENS_ERROR_CODES, s as CalmLensErrorOptions, t as ReceivedWebhookEventPayload } from "./WebhookPayload-CQg8BBZQ.js";
4
- import { a as ProcessingFeatureId, c as ProcessingFeatures, d as getAssetUrl, i as DetectedPerson, l as SDK_VERSION, n as BoundingBox, o as ProcessingFeatureResults, r as DetectedFace, s as ProcessingFeatureStage, t as AgeRange, u as DEFAULT_CDN_BASE_URL } from "./index-BcDDQJF2.js";
2
+ import { $ as ImageTransformOptions, $t as AssetSearchMatchField, A as CdnServeOptions, At as UploadedAsset, B as DeleteAssetContentOptions, Bt as TypedEvent, C as AssignPolicyOptions, Ct as SubmitAssetOptions, D as CalmLensServerClientOptions, Dt as UpdatePolicyOptions, E as CalmLensAppClientOptions, Et as UpdateHashListOptions, F as CreateFolderOptions, Ft as WebhookPayloadInput, G as FolderIdOptions, Gt as EventSeverity, H as EnsureLensOptions, Ht as EventFact, I as CreateHashListOptions, It as AssetBatchOperation, J as HashListEntryIdOptions, Jt as Folder, Kt as EventType, L as CreateMultipartUploadPartOptions, Lt as GetEventsResponse, M as ClassifyTextOptions, Mt as ViewerClaims, N as ConnectionOptions, Nt as WaitForAssetDecisionOptions, O as CdnAssetUrlOptions, Ot as UploadAssetPartOptions, P as CreateAssetSignedUrlOptions, Pt as WebhookHeadersInput, Q as IdempotencyOptions, Qt as LensType, R as CreatePolicyOptions, S as AssetVisibility, St as SignedUrl, T as BatchAssetsResponse, Tt as UpdateFolderOptions, U as EnsureLensesOptions, Ut as EventFactValues, V as DeleteAssetOptions, Vt as EventCategory, W as ExplainAssetOptions, Wt as EventFacts, X as HashListIdOptions, Xt as CursorPage, Y as HashListEntryPage, Yt as Policy, Z as HashListPage, Zt as Order, _ as AssetSearchResponse, _t as RetryAssetOptions, a as AssetChildrenPage, an as ExtractedText, at as ListEventsOptions, b as AssetUpload, bt as SignUploadTokenOptions, c as AssetClassificationStatus, cn as ProcessingOptions, ct as ListHashListsOptions, d as AssetContentRemovalReason, dt as MultipartUploadOptions, en as AssetSearchQuery, et as IterateAssetChildrenOptions, f as AssetContentStatus, ft as MultipartUploadPartOptions, g as AssetPage, gt as RetrieveAssetOptions, h as AssetModerationStatus, ht as RequestOptions, i as AssetChecksums, in as AssetSafetyHoldReason, it as ListAssetsOptions, j as CdnTransform, jt as VerifyWebhookSignatureOptions, k as CdnResource, kt as UploadPresetSubmitAssetOptions, l as AssetContent, lt as MoveAssetOptions, m as AssetModerationDecision, mt as PolicyList, n as ApplyPolicyPresetOptions, nn as AssetImage, nt as Lens, o as AssetClassification, on as FileMetadata, p as AssetModeration, pt as PolicyIdOptions, q as GetAssetUrlOptions, r as Asset, rn as AssetSafetyHold, rt as ListAssetChildrenOptions, s as AssetClassificationFailureReason, sn as MetadataItem, st as ListHashListEntriesOptions, t as AddHashListEntryOptions, tt as IterateAssetsOptions, u as AssetContentOptions, ut as MoveFolderOptions, v as AssetSearchResult, vt as SearchAssetsOptions, w as BatchAssetsOptions, wt as UpdateAssetOptions, x as AssetUploadStatus, xt as SignedUploadToken, y as AssetType, yt as SetPolicyAutomaticUpdatesOptions, z as DecideAssetOptions, zt as EventAsset } from "./CalmLensTypes-COJbOuiv.js";
3
+ import { a as CalmLensErrorCode, c as SdkErrorCode, i as CalmLensError, l as ApiErrorCode, o as CalmLensErrorDetails, r as CALMLENS_ERROR_CODES, s as CalmLensErrorOptions, t as ReceivedWebhookEventPayload } from "./WebhookPayload-DkukERKE.js";
4
+ import { a as ProcessingFeatureId, c as ProcessingFeatures, d as getAssetUrl, i as DetectedPerson, l as SDK_VERSION, n as BoundingBox, o as ProcessingFeatureResults, r as DetectedFace, s as ProcessingFeatureStage, t as AgeRange, u as DEFAULT_CDN_BASE_URL } from "./index-DxbJ_Xaa.js";
5
5
  import { a as ClassificationNotEvaluatedReason, c as ModerationQualifier, i as ClassificationLabel, l as PolicyAction, n as ClassificationCategory, o as ClassificationQualifierResults, r as ClassificationCategoryReport, s as Likelihood, t as ClassificationCategories } from "./Classification-D3SkprrQ-CMnQKW13.js";
6
6
  export { type AddHashListEntryOptions, type AgeRange, type ApiErrorCode, type ApplyPolicyPresetOptions, type Asset, type AssetBatchOperation, type AssetChecksums, type AssetChildrenPage, type AssetClassification, type AssetClassificationFailureReason, type AssetClassificationStatus, type AssetContent, type AssetContentOptions, type AssetContentRemovalReason, type AssetContentStatus, type AssetImage, type AssetModeration, type AssetModerationDecision, type AssetModerationStatus, type AssetPage, type AssetSafetyHold, type AssetSafetyHoldReason, type AssetSearchMatchField, type AssetSearchQuery, type AssetSearchResponse, type AssetSearchResult, type AssetType, type AssetUpload, type AssetUploadStatus, type AssetVisibility, type AssignPolicyOptions, type BatchAssetsOptions, type BatchAssetsResponse, type BoundingBox, CALMLENS_ERROR_CODES, type CalmLensAppClientOptions, CalmLensError, type CalmLensErrorCode, type CalmLensErrorDetails, type CalmLensErrorOptions, type CalmLensServerClientOptions, type CdnAssetUrlOptions, type CdnResource, type CdnServeOptions, type CdnTransform, type ClassificationCategories, type ClassificationCategory, type ClassificationCategoryReport, type ClassificationLabel, type ClassificationNotEvaluatedReason, type ClassificationQualifierResults, type ClassifyTextOptions, type ConnectionOptions, type CreateAssetSignedUrlOptions, type CreateFolderOptions, type CreateHashListOptions, type CreateMultipartUploadPartOptions, type CreatePolicyOptions, type CursorPage, DEFAULT_CDN_BASE_URL, type DecideAssetOptions, type DeleteAssetContentOptions, type DeleteAssetOptions, type DetectedFace, type DetectedPerson, type EnsureLensOptions, type EnsureLensesOptions, type EventAsset, type EventCategory, type EventFact, type EventFactValues, type EventFacts, type EventSeverity, type EventType, type GetEventsResponse as EventsPage, type ExplainAssetOptions, type ExtractedText, type FileMetadata, type Folder, type FolderIdOptions, type GetAssetUrlOptions, type HashList, type HashListEntry, type HashListEntryIdOptions, type HashListEntryPage, type HashListIdOptions, type HashListPage, type IdempotencyOptions, type ImageTransformOptions, type IterateAssetChildrenOptions, type IterateAssetsOptions, type Lens, type LensType, type Likelihood, type ListAssetChildrenOptions, type ListAssetsOptions, type ListEventsOptions, type ListHashListEntriesOptions, type ListHashListsOptions, MODERATION_CONTEXT_USED_CHARACTERS, MODERATION_CONTEXT_USED_ITEMS, type MetadataItem, type ModerationContext, type ModerationContextItem, type ModerationQualifier, type MoveAssetOptions, type MoveFolderOptions, type MultipartUploadOptions, type MultipartUploadPartOptions, type Order, type Policy, type PolicyAction, type PolicyIdOptions, type PolicyList, type ProcessingFeatureId, type ProcessingFeatureResults, type ProcessingFeatureStage, type ProcessingFeatures, type ProcessingOptions, type RequestOptions, type RetrieveAssetOptions, type RetryAssetOptions, SDK_VERSION, type SdkErrorCode, type SearchAssetsOptions, type SetPolicyAutomaticUpdatesOptions, type SignUploadTokenOptions, type SignedUploadToken, type SignedUrl, type SubmitAssetOptions, type TypedEvent, type UpdateAssetOptions, type UpdateFolderOptions, type UpdateHashListOptions, type UpdatePolicyOptions, type UploadAssetPartOptions, type UploadPresetSubmitAssetOptions, type UploadedAsset, type VerifyWebhookSignatureOptions, type ViewerClaims, type WaitForAssetDecisionOptions, type ReceivedWebhookEventPayload as WebhookEventPayload, type WebhookHeadersInput, type WebhookPayloadInput, getAssetUrl, selectModerationContextItems };
package/esm/index.js CHANGED
@@ -1 +1 @@
1
- export { A as CALMLENS_ERROR_CODES, j as CalmLensError, c as DEFAULT_CDN_BASE_URL, t as MODERATION_CONTEXT_USED_CHARACTERS, n as MODERATION_CONTEXT_USED_ITEMS, i as SDK_VERSION, d as getAssetUrl, r as selectModerationContextItems } from "./ModerationContextLimits-lLfmyLni.js";
1
+ export { M as CALMLENS_ERROR_CODES, N as CalmLensError, c as DEFAULT_CDN_BASE_URL, t as MODERATION_CONTEXT_USED_CHARACTERS, n as MODERATION_CONTEXT_USED_ITEMS, i as SDK_VERSION, f as getAssetUrl, r as selectModerationContextItems } from "./ModerationContextLimits-Chw-AzgL.js";
@@ -1,5 +1,5 @@
1
- import { A as CustomUploadContext, B as isFileAccepted, C as formatMessage, D as getUploadItemOutcome, E as getUploadItemMessage, F as UploadFile, G as MediaSource, H as MediaImageSource, I as UploadItem, J as pickMediaSource, K as MediaState, L as UploadSnapshot, M as UploadClient, N as UploadController, O as resolveMessages, P as UploadControllerOptions, R as UploadStage, S as formatBytes, T as getMediaUnavailableMessage, U as MediaOptions, V as MediaAsset, W as MediaSettings, Y as resolveMediaProps, _ as DEFAULT_MESSAGES, a as ProgressFetchOptions, b as describeUploadItem, c as ICON_ATTRIBUTES, d as MediaProps, f as UploaderDisplayOptions, g as CalmLensMessages, h as getMediaLoadKey, i as CALMLENS_STYLES, j as CustomUploadResult, k as CalmLensUpload, l as IconName, m as getMediaAspectRatio, n as CalmLensTheme, o as createProgressFetch, p as UploaderProps, q as getMediaState, r as resolveTheme, s as ICONS, t as CALMLENS_THEME, u as MediaDisplayOptions, v as UploadItemView, w as getDropzoneHint, x as describeUploader, y as UploaderView, z as createUploadController } from "./ui-B23r8BvW.js";
2
- import { n as useCalmLensUpload, t as UseCalmLensUploadResult } from "./ReactUpload-huIMnOJ4.js";
1
+ import { A as CustomUploadContext, B as isFileAccepted, C as formatMessage, D as getUploadItemOutcome, E as getUploadItemMessage, F as UploadFile, G as MediaSource, H as MediaImageSource, I as UploadItem, J as pickMediaSource, K as MediaState, L as UploadSnapshot, M as UploadClient, N as UploadController, O as resolveMessages, P as UploadControllerOptions, R as UploadStage, S as formatBytes, T as getMediaUnavailableMessage, U as MediaOptions, V as MediaAsset, W as MediaSettings, Y as resolveMediaProps, _ as DEFAULT_MESSAGES, a as ProgressFetchOptions, b as describeUploadItem, c as ICON_ATTRIBUTES, d as MediaProps, f as UploaderDisplayOptions, g as CalmLensMessages, h as getMediaLoadKey, i as CALMLENS_STYLES, j as CustomUploadResult, k as CalmLensUpload, l as IconName, m as getMediaAspectRatio, n as CalmLensTheme, o as createProgressFetch, p as UploaderProps, q as getMediaState, r as resolveTheme, s as ICONS, t as CALMLENS_THEME, u as MediaDisplayOptions, v as UploadItemView, w as getDropzoneHint, x as describeUploader, y as UploaderView, z as createUploadController } from "./ui-BSqPGKrZ.js";
2
+ import { n as useCalmLensUpload, t as UseCalmLensUploadResult } from "./ReactUpload-CRJNPB5T.js";
3
3
  import { ReactNode } from "react";
4
4
  import { StyleProp, ViewStyle } from "react-native";
5
5
  /** What the uploader asks your picker for. */
@@ -1,7 +1,7 @@
1
- import { _ as getMediaState, a as getMediaAspectRatio, b as ICONS, c as describeUploadItem, d as formatMessage, f as getDropzoneHint, g as resolveMessages, h as getUploadItemOutcome, i as resolveTheme, l as describeUploader, m as getUploadItemMessage, o as getMediaLoadKey, p as getMediaUnavailableMessage, r as CALMLENS_THEME, s as DEFAULT_MESSAGES, t as CALMLENS_STYLES, u as formatBytes, v as pickMediaSource, x as ICON_ATTRIBUTES, y as resolveMediaProps } from "./ui-Bn29rfAi.js";
2
- import { i as createProgressFetch, n as createUploadController, r as isFileAccepted, t as UploadController } from "./UploadController-UxP6gj7A.js";
1
+ import { _ as getMediaState, a as getMediaAspectRatio, b as ICONS, c as describeUploadItem, d as formatMessage, f as getDropzoneHint, g as resolveMessages, h as getUploadItemOutcome, i as resolveTheme, l as describeUploader, m as getUploadItemMessage, o as getMediaLoadKey, p as getMediaUnavailableMessage, r as CALMLENS_THEME, s as DEFAULT_MESSAGES, t as CALMLENS_STYLES, u as formatBytes, v as pickMediaSource, x as ICON_ATTRIBUTES, y as resolveMediaProps } from "./ui-CXH7xJpb.js";
2
+ import { i as createProgressFetch, n as createUploadController, r as isFileAccepted, t as UploadController } from "./UploadController-BJZghJpg.js";
3
3
  import { a as getFileIcon, o as getFileIconLabel, t as FILE_ICON_COLORS } from "./FileIcons-M6dzjFxd.js";
4
- import { n as useOwnController, r as useUploadSnapshot, t as useCalmLensUpload } from "./ReactUpload-6klucehl.js";
4
+ import { n as useOwnController, r as useUploadSnapshot, t as useCalmLensUpload } from "./ReactUpload-CMmL0R5Q.js";
5
5
  import { useMemo, useState } from "react";
6
6
  import { jsx, jsxs } from "react/jsx-runtime";
7
7
  import { Image, PixelRatio, Pressable, StyleSheet, Text, View } from "react-native";